[antlr-interest] Skip subtree in tree grammar

Martijn Reuvers martijn.reuvers at gmail.com
Wed May 6 11:54:04 PDT 2009


Hi Jim,

Thanks! I was not aware of that restriction with parameters. It seems
to work now for most of it.

It accepts everything with the | .*, except expressions if they are
inside the if-statement weird enough.

e.g:

if(false) {
  int a = 5+5;
}

Then i get a: node from after line 22:12 no viable alternative at
input 'DOWN'. But only if the if is false, if the if is true it
executes just fine without any error. Any other statement inside the
if-statement with false is accepted.

Does the | .* option not say accept everything until the end of the if
statement, irrelevant of what it is?

Martijn


More information about the antlr-interest mailing list