next up previous contents index
Next: The Compiler Up: The GNAT Project Previous: GCC   Contents   Index

GNAT Organization

The first decision involved choosing the language in which GNAT should be written. GCC is fully written in C, but for technical reasons as well as non-technical ones, it was inconceivable to use anything but Ada for GNAT itself. The GNAT team started using a relatively small subset of Ada83, and in typical fashion, extended the subset whenever new features became implemented. Six months after the coding started in earnest, we were able to bootstrap the compiler, and abandon the commercial compiler we had been using up to that point. As Ada95 features are implemented, we are now able to write GNAT in Ada95. In fact, the definition of the language depends heavily on hierarchical libraries, and cannot be given except in Ada95, so that it is natural for the compiler and the environment to use child units throughout [SGC94, Section 3.1].

Figure 1.1: GNAT Overall Structure.
\begin{figure}\centerline{\psfig{figure=figures/01-GNAT/01-gnat.eps,width=13 cm }}\end{figure}

Figure [*] presents the overall structure of the GNAT system. It has three main parts: the Compiler, the Run Time System and the Binder (the GNU linker for the target operating system is always reused). From the figure, we can also deduce the steps followed to compile an Ada program.

The GNAT binder verifies the consistency of the objects and determines a valid order of elaboration (initialization) for the objects (from the same or different languages) that are to be assembled into an executable file. Following this sketch, the next sections of this chapter describe each part of the compiler.


next up previous contents index
Next: The Compiler Up: The GNAT Project Previous: GCC   Contents   Index
(c) Javier Miranda. Canary Islands (Spain), 2002. Version 1.0