[antlr-interest] Error parsing grammar comes from interactions between 3 lexer rules?

AlanM adman1108 at gmail.com
Sat Nov 8 10:24:40 PST 2008


Can anyone tell me what I'm doing wrong here? Antlr (great tool!) gives 
me the error

syntax error: buildnfa: expecting EOA, found '
  System.out.println( "foo");
  '
when parsing the following grammar file:

lexer grammar Test;
RPAREN     : ')' {  System.out.println( "foo");  };
fragment METACHAR   : RPAREN ;
 NON_METACHAR  :  ~METACHAR;


(Of course these rules are selected from a much larger grammar).
Thanks for any help.
Alan


More information about the antlr-interest mailing list