Not quite sure if it has to be included in that secion, but it would
be good style in any case.

2010/5/14 Sergei Smolov <[email protected]>:
> Thank you, Oliver, that helps me so much! FirstToken really not a token, but
> a name of rule.
>
> By the way, is it true, that FIRSTTOKEN must be included in "tokens {...}"
> block? Or I can avoid from that?
>
>
> 2010/5/14 Oliver Zeigermann <[email protected]>
>>
>> Hi Sergei!
>>
>> The problem might be that in your grammar FirstToken is not a token,
>> but the name of a rule. You might want to create a new token, though?
>>
>> FirstToken : Second Third
>> ->
>> ^( FIRSTTOKEN["firstToken"] Second Third)
>> ;
>>
>> Hope that helps!
>>
>> - Oliver
>>
>> 2010/5/14 Sergei Smolov <[email protected]>:
>> > Hello, everybody!
>> > I have a very simple question. For example, I have the following grammar
>> > rule:
>> >
>> > FirstToken : Second Third;
>> >
>> > And I want to generate the following tree from such rule (I mean Tree in
>> > Java terms):
>> >
>> >        FirstToken
>> >        /           \
>> >  Second      Third
>> >
>> > How should I rewrite my grammar rule? As far, as I understand, I can use
>> > '^'
>> > and '!' operators for it. But I don't understand how to make First Token
>> > a
>> > root of this tree.
>> >
>> > Thanks in advance
>> >
>> > --
>> > Sergey Smolov
>> >
>> > List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> > Unsubscribe:
>> > http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>> >
>
>
>
> --
> Sergey Smolov
>

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

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to