comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: How is an ADA compiler done?
Date: 1996/10/27
Date: 1996-10-27T00:00:00+00:00	[thread overview]
Message-ID: <dewar.846423013@merv> (raw)
In-Reply-To: 54u38v$g9o@mikasa.iol.it


ischizophonic asks

"1- is ADA an LR(1), an LALR(1) language, or neither?
2- how is a commercial ADA compiler structured?
3- what kind of tools are used to support the developing of the
compiler?
4- are there some features in the language that deserve particular
attention, or create particular trouble?
5- are attribute grammars the formalism used for the semantical
analisis? if not, what kind of formalism is used, and why?"

To ask if Ada (please spell it right, you have been arond here long enough
not to make this mistake :-) is LR(1) or LALR(1) is very confused. Of course
it is possible to parse Ada using an LR(1) or LALR(1) parser, and some
Ada compilers use such parsers, some do not. Parsers almost never recognize
exactly the same language that is defined in the RM anyway (it is virtually
impossible to do so, for some very subtle reasons), but that is not a problem,
since there is no such requirement in a compiler.

TO see how one commercial Ada compiler is structured, have a look at the
sources of GNAT. They are certainly not typical in the following respects.

The parser is built by hand, and is not table driven. A very deliberate choice
which allows us to do a better job on error messages.

The backend IS table driven, which is not so common in other compilers. To
write a new code generator, we don't write any code, just a description
of the target machine.

As to special features, there is a huge literature on this subject, I suggest
looking through proceedings of past Ada conferences.

Are atrtibute grammars used? Yes by one or two compilers, No by most. I don't
think it is a particularly helpful formalism. At least one commercial compiler,
the DDCI compiler does, as far as I know use this approach, but on the other
hand, it is much later than expected, so it is certainly not a demonstration
that this technique is specially effective (it is also not a demonstraion
to the contrary either, there are MANY things that can make compilers later
than hoped, as all of us in the business know well!)





  reply	other threads:[~1996-10-27  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-26  0:00 How is an ADA compiler done? schizophonic
1996-10-27  0:00 ` Robert Dewar [this message]
1996-10-29  0:00   ` schizophonic
1996-10-29  0:00     ` Robert Dewar
1996-11-08  0:00       ` calling ADA from C EDSTAM Mikael
1996-11-14  0:00         ` Robert Dewar
1996-10-30  0:00     ` How is an ADA compiler done? Larry Kilgallen
replies disabled

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