sample problems
Hi, I'm running the sample in antlr tools and getting these comments. 2:9 token recognition error at: '+' 2:10 extraneous input 'foo' expecting ';'
I've made no changes and just clicked the run button. The '+' makes sense to me since it's not in the lexer. It does build the tree but 'foo' is highlighted in the tree and input . Is this meant to be a learning exercise or possibly a bug?
My apologies if this has already been explained. Thx Garry
Which grammar? Expr.g4 or JavaLexer.g4/JavaParser.g4? Those are the only two discussed. https://github.com/antlr/antlr4-tools#parsing-using-interpreter
sorry I wasn't more clear . it's the default sample http://lab.antlr.org/
The default example at lab.antlr.org is supposed to contain the error. It's a demo of how it reports an error. If you change the input line a=3+foo; to a = 3 and 2;, then run the parse, it succeeds.
ok that matches the rules. constructive criticism - that's confusing for someone starting out. Also a really cool addition would be to include the virtuals and overrides based on those rules
anyway, thanks for helping me. Great product and appreciate the teams efforts.
Garry