[antlr-interest] antlr 2.7.6: newbie question - getting the lastmatched token

Micheal J open.zone at virgin.net
Tue Aug 8 00:54:26 PDT 2006


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
<http://us.rd.yahoo.com/evt=40705/*http://mrd.mail.yahoo.com/try_beta?.intl=
ca> All-new Yahoo! Mail 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060808/e3c7dd59/attachment-0001.html


More information about the antlr-interest mailing list