Grammar ambiguity

"Joachim Durchholz" <joachim.durchholz@halstenbach.com.or.de>
5 Feb 2000 18:49:00 -0500

          From comp.compilers

Related articles
Grammar ambiguity joachim.durchholz@halstenbach.com.or.de (Joachim Durchholz) (2000-02-05)
Re: Grammar ambiguity idbaxter@semdesigns.com (Ira D. Baxter) (2000-02-10)
Re: Grammar ambiguity rsherry@home.com (Robert Sherry) (2000-02-10)
Re: Grammar ambiguity j.coulmance@itecor.com (Jocelyn Coulmance) (2000-02-12)
Re: grammar ambiguity world!cfc@uunet.uu.net (Chris F Clark) (2000-02-12)
Re: Grammar ambiguity joachim.durchholz@halstenbach.com.or.de (Joachim Durchholz) (2000-02-12)
Re: grammar ambiguity compres@world.std.com (Chris F Clark) (2000-02-12)
[10 later articles]
| List of all articles for this month |
From: "Joachim Durchholz" <joachim.durchholz@halstenbach.com.or.de>
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
language?


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


Regards,
Joachim


Post a followup to this message

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