Re: simple vs. complex parsers

Sylvain Schmitz <schmitz@essi.fr>
18 May 2003 23:48:45 -0400

          From comp.compilers

Related articles
[7 earlier articles]
Re: parsing, was .NET Compiler for Interactive Fiction rpboland@math.uwaterloo.ca (Ralph P. Boland) (2003-04-15)
Re: parsing, was .NET Compiler for Interactive Fiction bobduff@shell01.TheWorld.com (Robert A Duff) (2003-04-20)
Re: simple vs. complex parsers cfc@world.std.com (Chris F Clark) (2003-04-27)
Re: simple vs. complex parsers joachim_d@gmx.de (Joachim Durchholz) (2003-05-05)
Re: simple vs. complex parsers bobduff@shell01.TheWorld.com (Robert A Duff) (2003-05-15)
Re: simple vs. complex parsers cfc@shell01.TheWorld.com (Chris F Clark) (2003-05-18)
Re: simple vs. complex parsers schmitz@essi.fr (Sylvain Schmitz) (2003-05-18)
Re: simple vs. complex parsers mal@wyrd.be (Lieven Marchand) (2003-05-18)
Re: simple vs. complex parsers bs@research.att.com (2003-05-18)
Re: simple vs. complex parsers nmm1@cus.cam.ac.uk (2003-05-23)
Re: simple vs. complex parsers bs@research.att.com (2003-05-23)
Re: simple vs. complex parsers antkaij@mit.jyu.fi (Antti-Juhani Kaijanaho) (2003-05-24)
| List of all articles for this month |

From: Sylvain Schmitz <schmitz@essi.fr>
Newsgroups: comp.compilers
Date: 18 May 2003 23:48:45 -0400
Organization: Compilers Central
References: 03-02-125 03-02-147 03-03-043 03-03-061 03-03-103 03-04-006 03-04-028 03-04-046 03-04-066 03-04-116 03-05-103
Keywords: parse, design
Posted-Date: 18 May 2003 23:48:45 EDT

Robert A Duff wrote:
> Hmm. I'm not sure I agree. Do we really want tools that can parse
> ambiguous grammars, if that encourages language designers to create
> ambiguous grammars? Are ambiguous grammars good for human readers?


I was under the impression that ambiguous grammars were a bigger
problem to computers. Human languages use extremely ambiguous grammars
which we solve using an enormous amount of context, be it the topic of
the conversation, usage or whatsoever. Computers on the other hand
have some hard time with nondeterminism. So being able to parse
ambiguous grammars is a quality when facing natural languages (and
that's Tomita's field of research), but it could turn into a drawback
for computer languages.


Joachim Durchholz wrote:
  > The only downside is that the parser generator won't tell you whether
  > your grammar is ambiguous. Nothing that a separate "grammar checker"
  > tool couldn't handle (that checker would need assistance from the
  > grammar writer, since the problem is undecidable in general).


Does anyone know a tool like this?
I've found the DMS Reengineering Toolkit, which automatically attempts
to tell whether the grammar is ambiguous or not
(http://compilers.iecc.com/comparch/article/00-02-029 and
http://www.semdesigns.com/Products/DMS/DMSToolkit.html), but I have no
idea of its efficiency.
Another solution would be to use a parser generator like bison and tweak
and distort the grammar until we're sure it's not ambiguous, but in that
case the risk of actually changing the language it generates is real.


I believe noncanonical methods have still something to offer, being
able to parse wide classes of grammar in a deterministic way (see
http://www.eecg.toronto.edu/~mdhutton/papers/noncan.pdf). I'd like to
gather some opinions on this point.


      Sylvain


Post a followup to this message

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