[antlr-interest] detecting rubbish data at end of input

Gabriel Erzse gabriel_erzse at yahoo.com
Wed Jan 27 12:36:34 PST 2010


When using grammars written in ANTLR, the parser correctly recognizes 
data from an input stream, but if I have some rubbish text at the end of 
the input (which rubbish text is not supposed to be parsed by the grammar) 
the parser does not complain.

I guess this behavior is all right (I mean the parser did its job and parsed 
whatever I said it should parse), but is there any trick to detect when there 
is any data left in the input after the parser has done its job? 


More information about the antlr-interest mailing list