(This came up in Expression parsing with ANTLR)
Using the Java8Parser from the ANTLR grammars repository.
If I try to parse return a.b.c(); using the returnStatement parser rule, I get an error on the ( and ), though it's clearly a valid return statement.
If, however, I just wrap it in braces ({return a.b.c();}) and use the block rule as the start rule, everything parses just fine:
My best guess is that ANTLR needs the extra character of lookahead to manage this, but that just doesn't "seem right".
Can anyone explain why the first fails, and the second succeeds?


