On Sep 29, 2008, at 12:43 PM, David Pearce wrote:

> Hi Terence,
>
>>> The reason is that the empty production has no rewrite.  However, in
>>> ANTLR 3.0.1, this error did not happen.
>>>
>>> So, my question is: is this is a bug, or intentional behaviour?  I
>>
>> hi!
>>
>> It is proper behavior; if there is no listBody then list must  
>> indicate
>> there is an error.
>
> Just to be clear here --- you're saying this behaviour exhibited in
> ANTLR 3.0.1 was entirely broken?

Yes.  you must use

> list : '(' listBody ')' -> ^(LIST listBody?)

not

> list : '(' listBody ')' -> ^(LIST listBody)

clearly listBody can be optional, right?
>> This seems clumsy, since neither the X or Y tokens are actually  
>> needed

just use ? :)

Ter


List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/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