comp.lang.ada
 help / color / mirror / Atom feed
From: Cesar Rabak <csrabak@uol.com.br>
Subject: Re: Ada 95 grammar for aflex?
Date: Sat, 20 Jan 2001 23:55:26 -0200
Date: 2001-01-20T23:55:26-02:00	[thread overview]
Message-ID: <3A6A418E.80F1ADC@uol.com.br> (raw)
In-Reply-To: 94comf$vf7$1@nnrp1.deja.com



Robert Dewar wrote:
> 
> In article <3A69BA8F.A26A531E@uol.com.br>,
>   Cesar Rabak <csrabak@uol.com.br> wrote:
> > On your lines it continues with "...C++ was not a new
> > experimental language, it was an almost compatible superset
> > of C - and at that tim nobody had been able to write an
> > LARL(1) grammar for C. The LARL(1) grammar used by ANSI C was
> > constructed by Tom Pennello about a year and
> > half later - far too late to benefit me and C++."
> 
> I find that a bit odd, there has been no problem in
> constructing the necessary grammars for parsing C with these
> kind of tools, and they have been around for years, but that's
> not the issue.
> 
> The issues are
> 
> a) these tools generate rather slow parsers. This is fixable.
> 
> b) these tools generate junk error messages. This is also
> quite fixable. GNAT gives better error messages than Ada/Ed,
> but at the time, people regarded Ada/Ed as having excellent
> error messages, among the best around.

We agree on these.

> 
> If you are not interested in error recovery, there is
> absolutely no difficulty in writing a table driven parser
> for C++. The problem with g++ is that it has grown rusty
> with all kinds of kludges, and no one has had the nerve
> to redo it from scratch which is what was needed :-)

So we're detecting an opportunity for improvement! 

> 
> To be fair, many other C++ compilers give equally horrible
> error messages, but they do not seem to suffer from the time
> penalty in parsing to such an extent.

I never thought about this, and in fact with the monolithic binaries
they come I can't figure a way to benchmark the parsing of other
compilers.

> 
> Parsing should take zero time. In my assembly language scanner
> and parser for Ada 83, which runs at something approaching
> ten million lines a minute on a fast PC, perhaps more, I have
> not run it for a while, parsing takes less than 10% of the
> total time (the rest is I/O and lexical analysis).

Taking in account the functions of the parser, it makes all sense to me.
In fact it could be considered one of the "quality attributes" of a
compiler! So bad life is not so easy.

Cesar



  reply	other threads:[~2001-01-21  1:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-18 14:54 Ada 95 grammar for aflex? Ralf Reißing
2001-01-18 15:07 ` Frode Tenneboe
2001-01-18 15:37 ` Ted Dennison
2001-01-19 11:15 ` Mario Amado Alves
2001-01-19 16:36   ` Robert Dewar
2001-01-19 18:29     ` Cesar Rabak
2001-01-20 14:30       ` Robert Dewar
2001-01-20 16:19         ` Cesar Rabak
2001-01-20 19:25           ` Robert Dewar
2001-01-21  1:55             ` Cesar Rabak [this message]
2001-01-21 16:01               ` Robert Dewar
2001-01-22 15:58               ` Ira D. Baxter
2001-01-22 17:32                 ` Robert Dewar
2001-01-21  4:46             ` Larry Hazel
2001-01-21 16:02               ` Robert Dewar
2001-01-21 17:30                 ` Larry Hazel
2001-01-21 22:42                   ` Larry Kilgallen
2001-01-23  4:16                     ` Warren W. Gay VE3WWG
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox