[antlr-interest] Building composite grammars with output=AST

Stevenson, Todd (GE Healthcare, consultant) ToddStevenson at ge.com
Mon Nov 30 15:59:39 PST 2009


I have a lexer/parser grammar that I am attempting to decouple into a
parser, lexer, and a root composite grammar.  This grammar has an
output=AST that is to be read by a tree grammar parser.  
 
When I run the grammar, I get a 'mismatched input' on the first token of
the source.   The symptom seems to indicate that the generated tokens
aren't in sync.  Is there a trick to setting up the parser/lexer files
so that everything is generated correct?   I've noticed that I can't use
the 'TokenVocab=lex' option anymore.  Instead I need to import the lexer
along with the parser.
 
Also, if I import the lexer before the parser, it appears to parse
correctly, but crashes in the tree parser with a null pointer exception.
 
thanks.
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20091130/ee836d18/attachment.html 


More information about the antlr-interest mailing list