[antlr-interest] antlr 2.7.6: newbie question - getting the
lastmatched token
Costa Basil
costa_basil at yahoo.ca
Tue Aug 8 12:15:24 PDT 2006
There's got to be an easier way. Would LT(0) work?
Micheal J <open.zone at virgin.net> wrote: Message Declare as a subrule and lebel the reference to the subrule. It has a cost of at least an extra method call but, it does what you want right?
Micheal
-----------------------
The best way to contact me is via the list/forum. My time is very limited.
-----Original Message-----
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Costa Basil
Sent: 08 August 2006 08:48
To: antlr-interest at antlr.org
Subject: [antlr-interest] antlr 2.7.6: newbie question - getting the lastmatched token
How can I get the last matched token? I have the following case:
(T1 | T2 ... | Tn) { action }
where Ti are terminals. In my action I want to get the token that was matched and I don't want to declare labels to each of the tokens because it is too cumbersome. Also for whatever reason, antlr doesn't let me use identical labels for each alternative.
Thanks
---------------------------------
Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060808/a298366b/attachment.html
More information about the antlr-interest
mailing list