[antlr-interest] Antlr3 does not report error with incorrect input.
Terence Parr
parrt at cs.usfca.edu
Mon Mar 5 11:58:21 PST 2007
Hi Martin,
StringReader input = new StringReader("xitem foo");
is the culprit. It should be "item foo". It sees xitem as STRING
and then matches nothing, which is legal by your grammar:
catalog : item*;
it silently exists because it didn't find an item. ;)
If you use
catalog : item* EOF;
then it would say missing EOF, found STRING or something.
Ter
More information about the antlr-interest
mailing list