Maybe issue:Blank chars is removed when call RuleContext.getText() and ParseTree.getText()

24 views
Skip to first unread message

Flying Xu

unread,
Aug 18, 2018, 2:00:53 AM8/18/18
to antlr-discussion
Hello, I use antlr v4 for parse my sql statement, such as "select a a a from b", but I got following error message:
"no viable alternative at input: 'selectaaafromb' " // blank chars between tokens is removed.
"select a a a from b" ----call getText()---> "selectaaafromb"
I debug the code and found this:
issue
I create a subclass by override method: 'getText(Interval interval)', it's solved.
Same issue in code: RuleContent.getText();
It is better for add a blank char between tokens when assemble text?
sorry for I am not good at English.

Kind regards
flying
Reply all
Reply to author
Forward
0 new messages