[antlr-interest] Testing a grammar

Ulrich Frank Ulrich.Frank at dlr.de
Thu Mar 16 02:39:20 PST 2006

So summarizing your opinions and proposals I get the following:

It doesn't make sense to create test input for a application using a  
parser because the test input can only be generated based on the  
grammar itself. So of course the test input follows the rules of the  
grammar. Conclusion: I can only use the test input automatically  
generated based on the grammar to verify, if the test input is  
correct. Correct means if I see a generated test input string I can  
decide, if it is correct or not (if I see "from abc where def > 4" I  
know "select" is missing and therefore I know there is something  
wrong with my grammar definition).
Terence Parr introduced the new feature for generating strings  
following the rules of a grammar in this slides: http://www.antlr.org/ 
This is coming with ANTLR v3. Of course it would be important to know  
if the generated strings cover the whole grammar or if they are  
totally random and ignore some possibilities.


More information about the antlr-interest mailing list