Pristine Ack-5.5
[Ack-5.5.git] / doc / pascal / ab+intro.doc
1 .TL
2 The ACK Pascal Compiler
3 .AU
4 Aad Geudeke
5 Frans Hofmeester
6 .AI
7 Dept. of Mathematics and Computer Science
8 Vrije Universiteit
9 Amsterdam, The Netherlands
10 .AB
11 This document describes the implementation of a Pascal to EM compiler. The
12 compiler is written in C. The lexical analysis is done using a hand-written
13 lexical analyzer. Semantic analysis makes use of the extended LL(1) parser
14 generator LLgen. Several EM utility modules are used in the compiler.
15 .AE
16 .sp 2
17 .NH
18 Introduction
19
20 .PP
21 .nh
22 The Pascal front end of the Amsterdam Compiler Kit (ACK) complies with the
23 requirements of the international standard published by the International
24 Organization for Standardization (ISO) [ISO]. An informal description, which
25 unfortunately is not conforming to the standard, of the programming language
26 Pascal is given in [JEN].
27
28 .PP
29 The main reason for rewriting the Pascal compiler was that the old Pascal
30 compiler was written in Pascal itself, and a disadvantage of it was its
31 lack of flexibility. The compiler did not meet the needs of the current
32 ACK-framework, which makes use of modern parsing techniques and utility
33 modules. In this framework it is, for example, possible to use a fast back
34 end. Such a back end translates directly to object code [ACK]. Our compiler is
35 written in C and it is designed similar to the current C and Modula-2 compiler
36 of ACK.
37
38 .PP
39 Chapter 2 describes the basic structure of the compiler. Chapter 3 discusses
40 the code generation of the main Pascal constructs. Chapter 4 covers one of
41 the major components of Pascal, viz. the conformant array. In Chapter 5 the
42 various compiler options that can be used are enumerated. The extensions
43 to the standard and the deviations from the standard are listed in Chapter
44 6 and 7. Chapter 8 presents some ideas to improve the standard. Chapter 9
45 gives a short overview of testing the compiler. The major differences
46 between the old and new compiler can be found in Chapter 10. Suggestions
47 to improve the compiler are described in Chapter 11. The appendices
48 contain the grammar of Pascal and the changes made to the ACK Pascal run time
49 library. A translation of a Pascal program to EM code as example is presented.
50 .bp