[antlr-interest] Enhancement request for identifying imaginarytokens

Hardy, Stephen Stephen.Hardy at digi.com
Fri Dec 14 10:04:25 PST 2007


Hi Terence,

Understood, but with a large grammar it becomes a bit tedious to
explicitly put for all imaginary tokens.  Also, there is often no
convenient token to co-opt for the purpose.  I thought being able to
specify a default of the "start" token (whatever it may be) would be
useful for most folks, provided there was the option to override the
token assignment as you showed below, with the usual [] syntax.

Regards,
SJH


> -----Original Message-----
> From: antlr-interest-bounces at antlr.org 
> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Terence Parr
> Sent: Friday, December 14, 2007 9:55 AM
> To: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] Enhancement request for 
> identifying imaginarytokens
> 
> OH!  I get it.  Well, I put the [...] ctor args there as you might  
> want the 2nd not first token to be payload of imaginary...
> 
> e : x=INT op='+' y=INT -> ^(ADD[$op] $x $y );
> 
> Ter
> 
> 


More information about the antlr-interest mailing list