The compiler works in several passes, which may be broadly grouped as
- syntactic analysis: source inclusion, lexical analysis,
parsing, macro expansion,
- semantic analysis: scope binding, type inference,
- intermediate Foam code generation,
- intermediate code optimization
(several individual passes),
- concrete code generation: to C or Lisp.
The compiler can generate or accept files between any of these groups.
For example, when machine-generating
programs
it is possible to bypass the syntax analysis and pass
generated abstract syntax trees into the semantic analysis phase.
The
compiler is about 120,000 lines of C code and 6000 lines
of
code in its current implementation.
About 1% of the compiler is code for Lisp generation and about
3% is code for C generation.
Some code is shared between the general library and the default
run time system.
Most of the
run-time system is written in
, with
the rest written in C or Lisp depending on the platform.
Stephen Watt
Wed Sep 18 19:39:57 MET DST 1996