[antlr-interest] Simple grammar doesn't complain about illegal input
Gavin Lambert
antlr at mirality.co.nz
Thu Nov 13 11:36:38 PST 2008
At 08:29 14/11/2008, amartinez at atc.ugr.es wrote:
>If I do what yo say I obtain this error:
>line 7:8 missing EOF at 'adds'
>
>Shouldn't this error be something like this?:
>line 7:8 required (...)+ loop did not match anything at input
>'adds'
If your input consists solely of the invalid instruction, then
this is the error you'll get as well.
When your input contains some valid instructions followed by some
invalid instructions, then the (...)+ loop will pass (since there
was at least one valid instruction) and it'll then try to match
the EOF -- if it's not yet the end of the input (because there was
an invalid instruction afterwards), then you'll get an "missing
EOF" error (like you did).
More information about the antlr-interest
mailing list