[antlr-interest] [v3] LITERAL_xxx tokens?

Anthony Youngman Anthony.Youngman at eca-international.com
Wed Aug 16 02:40:33 PDT 2006


Is that defining a variable called IF, or STATIC ... ?

That will blow up a heck of a lot of languages. I guess that's why v2
prefixed everything with LITERAL_ - precisely to prevent explosions when
compiling the grammar.

Note to Ter - not that I have any use for it - might it make sense for
v3 to generate this stuff automatically if asked by a switch - seeing as
people like David have a need for it?

Cheers,
Wol

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of David Holroyd
Sent: 16 August 2006 10:16
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] [v3] LITERAL_xxx tokens?

On Wed, Aug 16, 2006 at 07:41:17AM +0000, David Holroyd wrote:
> For the moment, I'll just add lots of entries like
> 
>   tokens { IF='if'; STATIC='static'; ... }

Now that I think about it more, maybe this is actually a better way to
define a concrete interface between the parser and the application than
all those LITERAL_.. thingies anyway.  Nice to have them both using
STATIC to refer to the same thing, eh?

It'll be a *lot* easier to use IDE-auto-complete from the java side
without that common prefix everywhere too! ;)


ta,
dave

-- 
http://david.holroyd.me.uk/

* ************************************************************************ *

This transmission is intended for the named recipient only. It may contain private and confidential information. If this has come to you in error you must not act on anything disclosed in it, nor must you copy it, modify it, disseminate it in any way, or show it to anyone. Please e-mail the sender to inform us of the transmission error or telephone ECA International immediately and delete the e-mail from your information system.

Telephone numbers for ECA International offices are: Sydney +61 (0)2 8272 5300, Hong Kong + 852 2121 2388, London +44 (0)20 7351 5000 and New York +1 212 582 2333.

* ************************************************************************ *


More information about the antlr-interest mailing list