A portable compiler: theory and practice

2017年5月8日 (一) 09:08Dennis zhuang讨论 | 贡献的版本

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转到: 导航搜索

Overview of the amsterdam compiler kit

The tool kit consists of eight components:

• The preprocessor
• The front ends
• The peephole optimizer
• The global optimizer
• The back end
• The target machine optimizer
• The universal assembler/linker • The utility package

Amsterdam compiler kit.png

The preprocessor

  • extend all the program- ming languages by adding certain generally useful facilities to them in a uniform way. One of these is a simple macro system,
  • Another useful facility provided by the preprocessor is the ability to include compile-time libraries.
  • A third feature of the preprocessor is conditional compila- tion.

The front ends

  • All front ends, independent of the language being compiled, produce a common intermediate code called EM, which is the assembly language for a simple stack machine. The EM machine is based on a memory architecture containing a stack for local variables, a (static) data area for variables de- clared in the outermost block and global to the whole pro- gram, and a heap for dynamic data structures.