[antlr-interest] Help Needed with multiple alternatives

Alexander Gängel alexander at gaengel.de
Tue Feb 26 06:29:01 PST 2008


So it's not an "error" in my Grammar.
If this is so I'm glad, I spend hours to find a Way around this Message.

I was starting to think I just don't understand what Antlr is doing.

So I just discard dis Message.

Alexander

shmuel siegel schrieb:
> I am not 100% sure that I am reading the red diagram correctly but 
> this is my take on the problem. The green diagram says that an ARROW 
> can follow an exp_direct as part of the dotorarrow rule. The red 
> diagram says that the exit condition of dotorarrow (that is, a set of 
> null transitions) can also lead to ARROW. This is caused by 
> letexpression ending in exp which can ultimately be a dotorarrow. I 
> don't know how to avoid the warning but I think both alternatives are 
> equivalent. Alternative 1, the green arrow, is computationally more 
> efficient and is probably what you want.
>
> The bottom line is that there is an annoying irrelevant warning 
> message that is hard to circumvent.
> I would also appreciate any feedback on methods to avoid this kind of 
> ambiguity.
>
> Shmuel
>
> Alexander Gängel wrote:
>> I still have this Problem but I think I search in the wrong spot.
>>
>> can somebody explain me which rule makes the Problem?
>>
>> Thanks
>> Alexander
>>
>> Alexander Gängel schrieb:
>>> I found the problem but still have no working solution.
>>>
>>> I tried to get around it by using scoping and Semantic Predicates.
>>>
>>> so I set a scope with a boolean man variable and wanted to make a 
>>> decision like {$exp::name}=> ... | so that the rule chooses the 
>>> first alternative when $exp::name is set true and the other solution 
>>> if it is false.
>>>
>>> Is this possible, cause right now it's not working, but there may be 
>>> some other error still in the rule.
>>>
>>> Alexander
>>>
>>> Alexander Gängel schrieb:
>>>> I just can't get my grammar to work without having a multiple 
>>>> alternatives problem.
>>>>
>>>> I have some nested expression rules to get the precedence of the 
>>>> different operations.
>>>>
>>>> The problem occures since I added the letexpression  rule to 
>>>> exp_direct
>>>>
>>>> I hope someone can give me a hint how to solve this.
>>>>
>>>> Thanks Alexander
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080226/d48f21bc/attachment.html 


More information about the antlr-interest mailing list