[antlr-interest] What's wrong with this grammar? (2.7.6)

Terence Parr parrt at cs.usfca.edu
Fri Oct 20 18:49:37 PDT 2006


(.)*
Ter
On Oct 20, 2006, at 6:42 PM, Robert Baruch wrote:

> Here is a test grammar I was putting together and running through  
> ANTLR 2.7.6:
>
> header { package generated; }
> class TestParser extends Parser;
> options { k=2; }
>
> r0 : . * ;
>
> class TestLexer extends Lexer;
>
> N : 'n';
> V : 'v';
>
>
> Really, all it says is that a valid sentence is any token, any  
> number of times. Without the *, it works fine, but with the *, the  
> output is:
>
> ANTLR Parser Generator   Version 2.7.6 (2005-12-22)   1989-2005
> generated.g:5:6: rule classDef trapped:
> generated.g:5:6: unexpected token: .
> error: aborting grammar 'TestParser' due to errors
> Exiting due to errors.
>
> So what is wrong with . *?
>
> Thanks,
>
> --Rob
>
>



More information about the antlr-interest mailing list