Re: detecting ambiguous grammars

"Joachim Durchholz" <joachim_d@gmx.de>
26 Mar 2001 13:50:21 -0500

          From comp.compilers

Related articles
[5 earlier articles]
Re: detecting ambiguous grammars thant@acm.org (Thant Tessman) (2001-03-04)
Re: detecting ambiguous grammars davidpereira@home.com (David Pereira) (2001-03-08)
Re: detecting ambiguous grammars dlester@cs.man.ac.uk (2001-03-10)
Re: detecting ambiguous grammars thant@acm.org (Thant Tessman) (2001-03-12)
Re: detecting ambiguous grammars christian.bau@isltd.insignia.com (2001-03-22)
Re: detecting ambiguous grammars thant@acm.org (Thant Tessman) (2001-03-26)
Re: detecting ambiguous grammars joachim_d@gmx.de (Joachim Durchholz) (2001-03-26)
Re: detecting ambiguous grammars cfc@world.std.com (Chris F Clark) (2001-03-27)
Re: detecting ambiguous grammars genew@shuswap.net (2001-03-27)
Re: detecting ambiguous grammars genew@shuswap.net (2001-03-27)
Re: detecting ambiguous grammars thant@acm.org (Thant Tessman) (2001-03-31)
Re: detecting ambiguous grammars cfc@world.std.com (Chris F Clark) (2001-03-31)
Re: detecting ambiguous grammars kenarose@earthlink.net (Ken Rose) (2001-03-31)
[4 later articles]
| List of all articles for this month |

From: "Joachim Durchholz" <joachim_d@gmx.de>
Newsgroups: comp.compilers
Date: 26 Mar 2001 13:50:21 -0500
Organization: Compilers Central
References: 01-02-080 01-03-020 01-03-032 01-03-078 01-03-084 01-03-102
Keywords: parse
Posted-Date: 26 Mar 2001 13:50:21 EST

Christian Bau <christian.bau@isltd.insignia.com> wrote:
>
> [...] If the compiler actually detects and rejects all
> ambiguous programs then you have the strange effect that the language
> that it accepts is actually unambiguous, but different from the
> language defined by the grammar.


This is actually very workable.


I'm using a language with an ambiguous grammar, Eiffel. The rule is
simple: The language is defined by the grammar, minus those constructs
that are ambiguous. I'm not sure about the general case, but in the
case of Eiffel this has created zero hassle - I've got several
megabytes of Eiffel code with not a single ambiguity in it. Of course,
it helps that the constructs that are actually ambiguous are (a)
extremely rare in practice and (b) easily fixed by dropping a
semicolon in the right position.


Regards,
Joachim


Post a followup to this message

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