sharwell/antlr4

Provide more readable result for org.antlr.v4.runtime.TokenStream#getText(java.lang.Object, java.lang.Object)

Closed this issue · 2 comments

Hi Sam(@sharwell),

   When I develop the new parser Parrot for Groovy programming language, 

I find the text of tokens generated by antlr4 are a bit hard to read and ambiguous, e.g.

class X {a b

You can see, a and b are concatenated without any separtors:

Unexpected input: 'ab' at line: 1, column: 12

Currently org.antlr.v4.runtime.TokenStream#getText(java.lang.Object, java.lang.Object) is used.
Could you please provide more readable getText method? (e.g. remaining text of the hidden channel tokens) Or give me some hints to implement it by myself? Thanks in advance!

@danielsun1106 I moved the main repository for the optimized fork to tunnelvisionlabs/antlr4. If you file this issue there, it will get a bit more visibility. I hope to look into it this week.

Sam, I've filed the issue to tunnelvisionlabs/antlr4, thanks!
tunnelvisionlabs/antlr4#21