ab+intro.doc 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. .PP
  20. .nh
  21. The Pascal front end of the Amsterdam Compiler Kit (ACK) complies with the
  22. requirements of the international standard published by the International
  23. Organization for Standardization (ISO) [ISO]. An informal description, which
  24. unfortunately is not conforming to the standard, of the programming language
  25. Pascal is given in [JEN].
  26. .PP
  27. The main reason for rewriting the Pascal compiler was that the old Pascal
  28. compiler was written in Pascal itself, and a disadvantage of it was its
  29. lack of flexibility. The compiler did not meet the needs of the current
  30. ACK-framework, which makes use of modern parsing techniques and utility
  31. modules. In this framework it is, for example, possible to use a fast back
  32. end. Such a back end translates directly to object code [ACK]. Our compiler is
  33. written in C and it is designed similar to the current C and Modula-2 compiler
  34. of ACK.
  35. .PP
  36. Chapter 2 describes the basic structure of the compiler. Chapter 3 discusses
  37. the code generation of the main Pascal constructs. Chapter 4 covers one of
  38. the major components of Pascal, viz. the conformant array. In Chapter 5 the
  39. various compiler options that can be used are enumerated. The extensions
  40. to the standard and the deviations from the standard are listed in Chapter
  41. 6 and 7. Chapter 8 presents some ideas to improve the standard. Chapter 9
  42. gives a short overview of testing the compiler. The major differences
  43. between the old and new compiler can be found in Chapter 10. Suggestions
  44. to improve the compiler are described in Chapter 11. The appendices
  45. contain the grammar of Pascal and the changes made to the ACK Pascal run time
  46. library. A translation of a Pascal program to EM code as example is presented.
  47. .bp