[antlr-interest] Java API for checking ambiguity in grammars using ANLTR

Loring Craymer lgcraymer at yahoo.com
Tue Jun 12 00:30:06 PDT 2012


My apologies, then.  You are not interested in working grammars, only that subset for which ANTLR reports no ambiguities; I misunderstood.

Most large ANTLR grammars have ambiguities that ANTLR resolves by order precedence; you have to verify that the ambiguities are resolved correctly (that alternatives are ordered correctly).  Eliminating ambiguities from your grammars is sometimes a quixotic quest.

--Loring



>________________________________
> From: sathya moorthy <brsmoorthy at gmail.com>
>To: Loring Craymer <lgcraymer at yahoo.com> 
>Cc: "antlr-interest at antlr.org" <antlr-interest at antlr.org> 
>Sent: Monday, June 11, 2012 8:13 PM
>Subject: Re: [antlr-interest] Java API for checking ambiguity in grammars using ANLTR
> 
>
>I want to know whether the grammar is ambiguous by calling some ANTLR API but I want to know is there such API?
>The purpose is not to generate files from the grammar if it is ambiguous.
>
>
>Antlr generates files even if it is ambiguous(in some cases)
>
>
>On Mon, Jun 11, 2012 at 2:53 PM, Loring Craymer <lgcraymer at yahoo.com> wrote:
>
>You want code generated even if the grammar is reported to be ambiguous.  ANTLR tells you how it handles ambiguity (some alternatives are disabled); if this is not what you want, fix your grammar.
>>
>>
>>--Loring
>>
>>
>>
>>
>>
>>>________________________________
>>> From: sathya moorthy <brsmoorthy at gmail.com>
>>>To: antlr-interest at antlr.org 
>>>Sent: Monday, June 11, 2012 1:54 AM
>>>Subject: Re: [antlr-interest] Java API for checking ambiguity in grammars using ANLTR
>>> 
>>>
>>>Guys any help would be great
>>>thanks
>>>Sathya
>>>
>>>On Sat, Jun 9, 2012 at 1:40 PM, sathya moorthy <brsmoorthy at gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> When i use ANTLR IDE, it suggests that the grammar is ambiguous but still
>>>> i am able to generate code using that grammar.
>>>> Is there a specific API in ANTLR which will tell whether the grammar is
>>>> ambiguous?
>>>> If the grammar is ambiguous i dont want to generate the code for that
>>>> specific file.
>>>>
>>>> Regards,
>>>> Sathya
>>>>
>>>>
>>>
>>>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