[antlr-interest] retrieving the length of a production match

Jim Idle jimi at temporal-wave.com
Wed Aug 22 07:24:56 PDT 2007


Maybe you did, or maybe I did ;-) But the general point is that if you have a token, it will tell you where it starts in the input stream, so if you have discovered something semantically rather than syntactically (this is what I thought was being asked), then knowing the tokens will allow you to determine the run length for things you want to underline in green or whatever. :-)

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Kay Roepke
> Sent: Tuesday, August 21, 2007 2:12 PM
> To: ANTLR-Interest Interest
> Subject: Re: [antlr-interest] retrieving the length of a production
> match
> 
> 
> On Aug 21, 2007, at 11:06 PM, Jim Idle wrote:
> 
> > Just refer to $start and $stop in a rule or more likely for you
> > $rulelabel.start and $rulelabel.stop.
> 
> ah, I though this was supposed to be outside the actual grammar, but
> I might have misunderstood the OP.
> 
> cheers,
> -k
> --
> Kay Röpke
> http://classdump.org/
> 
> 
> 



More information about the antlr-interest mailing list