[antlr-interest] disambiguating semantic predicates

Tom Smith yotommy at gmail.com
Mon Sep 22 06:20:12 PDT 2008


The suggestions from Jim and Gavin worked perfectly.  Thanks!

On Sat, Sep 20, 2008 at 2:09 AM, Gavin Lambert <antlr at mirality.co.nz> wrote:
> At 11:02 20/09/2008, Jim Idle wrote:
>>
>> event: ^( EVENT
>>                       T1 ...
>>                     | T2 ...
>>                     | T3 ...
>>         );
>
> I'm pretty sure you'll also need an extra set of parentheses there:
>
> event : ^( EVENT
>           ( T1 ...
>           | T2 ...
>           | T3 ...
>           )
>        );
>
> Or alternatively a subrule:
>
> event : ^( EVENT eventdetails );
>
> eventdetails
>    : T1 ...
>    | T2 ...
>    | T3 ...
>    ;
>
>


More information about the antlr-interest mailing list