Re: Infinite look ahead required by C++?

wclodius@los-alamos.net (William Clodius)
Sat, 13 Feb 2010 18:24:28 -0700

          From comp.compilers

Related articles
[5 earlier articles]
Re: Infinite look ahead required by C++? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-02-10)
Re: Infinite look ahead required by C++? sh006d3592@blueyonder.co.uk (Stephen Horne) (2010-02-10)
Re: Infinite look ahead required by C++? cfc@shell01.TheWorld.com (Chris F Clark) (2010-02-10)
Re: Infinite look ahead required by C++? martin@gkc.org.uk (Martin Ward) (2010-02-11)
Re: Infinite look ahead required by C++? idbaxter@semdesigns.com (Ira Baxter) (2010-02-13)
Re: Infinite look ahead required by C++? sh006d3592@blueyonder.co.uk (Stephen Horne) (2010-02-14)
Re: Infinite look ahead required by C++? wclodius@los-alamos.net (2010-02-13)
Re: Error reporting, was Infinite look ahead required by C++? sh006d3592@blueyonder.co.uk (Stephen Horne) (2010-02-14)
Re: Error reporting, was infinite look ahead max@gustavus.edu (Max Hailperin) (2010-02-14)
Re: Error reporting, was Infinite look ahead required by C++? idbaxter@semdesigns.com (Ira Baxter) (2010-02-15)
Re: Error reporting, was Infinite look ahead required by C++? haberg_20080406@math.su.se (Hans Aberg) (2010-02-16)
Re: Error reporting, was Infinite look ahead required by C++? sh006d3592@blueyonder.co.uk (Stephen Horne) (2010-02-17)
Re: Error reporting, was Infinite look ahead required by C++? kkylheku@gmail.com (Kaz Kylheku) (2010-02-17)
[14 later articles]
| List of all articles for this month |
From: wclodius@los-alamos.net (William Clodius)
Newsgroups: comp.compilers
Date: Sat, 13 Feb 2010 18:24:28 -0700
Organization: Compilers Central
References: 10-02-024 10-02-029 10-02-047 10-02-055
Keywords: C++, parse
Posted-Date: 13 Feb 2010 21:56:42 EST

Ira Baxter <idbaxter@semdesigns.com> wrote:


> "Chris F Clark" <cfc@shell01.TheWorld.com> wrote in message
> <snip>
> > This issue occurs not just at the parsing level. Templates in C++ and
> > type-inference in FP languages seem to exhibit the same issue at the
> > semantic level. If you write valid code in them, life is good.
> > However, if you make an error, the resulting messages are often so
> > cryptic and useless that you are often better off, just looking for
> > your typo rather than trying to decipher what the message is
> > attempting to tell you.
>
> Perhaps we need more serious effort put into automating the production
> of good error reports. While there is some research there,
> none of this appears to me to be widespread technology.
> <snip>


The production of good error reports relies on providing as much
context as possible to the user. LL(k) grammars by definition have a
clearer context, in particular a clearer dividing point in the
context, than other grammars. Everything prior to the point where the
error is discovered can be shown to be syntactically correct. Further
for such grammars there there is almost always a limited number of
productions possible and it is reasonable to give messages of the form
"expexted ..., but ... was found.'" These are intrinsically not
characteristics to be expected of general LR(k) grammars. Part of the
problem with error reports for C++ templates and at least some
functional languages,, Haskell comes to mind, is that their syntax is
not LL(k).


--
Bill Clodius


Post a followup to this message

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