Grammar ambiguity

"Joachim Durchholz" <>
5 Feb 2000 18:49:00 -0500

          From comp.compilers

Related articles
Grammar ambiguity (Joachim Durchholz) (2000-02-05)
Re: Grammar ambiguity (Ira D. Baxter) (2000-02-10)
Re: Grammar ambiguity (Robert Sherry) (2000-02-10)
Re: Grammar ambiguity (Jocelyn Coulmance) (2000-02-12)
Re: grammar ambiguity world! (Chris F Clark) (2000-02-12)
Re: Grammar ambiguity (Joachim Durchholz) (2000-02-12)
Re: grammar ambiguity (Chris F Clark) (2000-02-12)
[10 later articles]
| List of all articles for this month |

From: "Joachim Durchholz" <>
Newsgroups: comp.compilers
Date: 5 Feb 2000 18:49:00 -0500
Organization: Compilers Central
Keywords: parse, theory, question

Hi all,

I need a tool that checks context-free grammars for ambiguity. I
already know that this is not decidable in general, so I'll have to be
content with heuristics. For example, I could use an LALR parser
generator; if it reports no conflicts, I know that the grammar is
unambiguous (besides being LALR).

Unfortunately, trying to rewrite a grammar for LALR is error-prone (at
least for me) and time-consuming; we're currently talking about
extending an existing language which is sort-of unambiguous (with a
rule that states "a semicolon between statements is optional unless it
is needed to disambiguate the program"). The language is easy to parse
with an Earley algorithm but a nightmare with yacc; unfortunately,
Accent or other Earley-based parsers will not tell me whether a CFG is
ambiguous or not.

In summary: Are there parser generators available that cover more than
just LALR, and where the effort to tweak language syntax to a form
that the generator will accept is so straightforward that I can easily
infer whether the rewritten and the original syntax are still the same

I don't have my hopes too far up, but I wanted to ask before giving


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.