[antlr-interest] Referencing Tokens in Lexer Rules?

Jason jasonriz at yahoo.com
Tue Jan 20 09:02:03 PST 2004


Hello,

I'm trying to reference a token in a lexer rule and
ANTLR is complaining.  Imagine I've got this:

tokens
{
  MYTOKEN = "foobar";
}

MYRULE: MYTOKEN NEWLINE
  ;

NEWLINE: 
  '\r' '\n'
|
 '\n'
;

When I try to build my lexer ANTLR complains that
there is no definition of rule mMYTOKEN.  Is there
some way to do what I'm trying to do?  If not, is it
because what I"m trying to do doesn't make sense? 
Thank in advance for any replies!

-jason



__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

 

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