[antlr-interest] putting an Object into a token

mzukowski at yci.com mzukowski at yci.com
Wed Jan 21 11:39:50 PST 2004


Just use your own Token subclass.  It's in the documentation and probably in
an example somewhere.  For instance the gcc grammar has a CToken object with
some extra info in it like filename.  http://www.codetransform.com/gcc.html

Monty

-----Original Message-----
From: William Lam [mailto:xeenman at yahoo.com] 
Sent: Wednesday, January 21, 2004 10:44 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] putting an Object into a token

Hi all,

I have a lexer rule that lexes a complicated token, and I would like 
to process it, and put the results into an arbitrary Object and then
pass the object to the parser rule that uses the token.  Protected 
lexer rules can return something, but public ones can not.

How can I do this?  The antlr.Token class does not have a #setObject
(Object) method.  And I do not want to use a static Object in the 
Lexer/Parser.


 

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/ 


 

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