[antlr-interest] expecting IDENT, found 'x'

Mike Bresnahan mbresnah at visi.com
Sun Mar 7 10:02:32 PST 2004


> Could someone explain me why my parser returns the following message ?

It's because the lexer and parser are not using the same token vocabulary.
Note that the the two files ending in .txt list a different set of tokens.
I was able to fix your problem by putting "exportVocab=Test;" in the parser
options and changing the lexer options to read "importVocab=Test;".

A question for those more experienced, in what senario would you want the
lexer and parser using different vocabularies?  If there aren't any such
senarios, would it be better if ANTLR took care of making sure both are
using the same vocabulary instead of relying on the user to do this?  I
stumbled over the same vocabulary issue myself while learning the basics of
ANTLR.

Mike Bresnahan



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list