[antlr-interest] How can I make sure there's one such rule in the input ?

devdoer bird devdoer2 at gmail.com
Wed Feb 16 21:04:55 PST 2011


HI:

I have the grammar:

statements:(inputStatement|schemaStatement|filtersStatement|COMMENT)* EOF;


As you see ,it will match as many inputStatements as there are in the input
file.


How can change the grammar to  make sure there is only one inputStatment in
the input file?


Thanks.


More information about the antlr-interest mailing list