[antlr-interest] Tool for testing lexers/parsers/tree parsers

mzukowski at bco.com mzukowski at bco.com
Wed Jan 16 08:31:36 PST 2002


> I will try to avoid rewriting tested grammars.
> To make sure that all input has been parsed, at the end of a 
> test I should:
> 1. Check that all tokens have been requested
> 2. The token queue of the parser is empty (to be sure that 
> tokens were not
> read only in guessing mode.
> 
> There still remains a problem, of course, because some rules 
> NEED trailing
> tokens for LA. I will add a keyword to distinguish tokens 
> that need to be
> consumed from tokens only needed in LA. 

Very clever.  That avoids the need to rewrite the grammar for testing.
 
> Something similar needs to be done for lexers too.

Luckily, only for protected rules.  If you keep to just testing your
non-protected rules then you are fine.

Monty

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list