[antlr-interest] Initializing synthetic tokens?

Jim Idle jimi at temporal-wave.com
Thu Nov 15 23:01:43 PST 2012


As in, make it a real token in the lexer, not define it in the tokens {}
section. The syntax you show, is the correct syntax for the enum - it is a
list of imaginary tokens - real tokens belong in the lexer.

Jim

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Gerald Rosenberg
Sent: Friday, November 16, 2012 2:55 PM
To: parrt at cs.usfca.edu
Cc: antlr-interest
Subject: Re: [antlr-interest] Initializing synthetic tokens?

Strange. I get ". . . mismatched input ':' expecting RBRACE" .  The only
syntax that seems to be recognized is

tokens { A, B }


On 11/15/2012 10:41 AM, Terence Parr wrote:
> tokens is now an enum.
>
> COMMA : ',' ;
>
> is preferred
> T
> On Nov 15, 2012, at 9:52 AM, Gerald Rosenberg wrote:
>
>> In v3, synthetic tokens could be initialized:
>> tokens {
>>      COMMA = ',' ;
>> }
>>
>> v4 complains about the assignment.  Is there an alternative/preferred
>> way to initialize these tokens?  Did not find anything in TDAR4.
>>
>> Thanks.
>>
>>
>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> Unsubscribe:
>> http://www.antlr.org/mailman/options/antlr-interest/your-email-addres
>> s
>



List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address


More information about the antlr-interest mailing list