Applications
The compiler support facility has been used to develop several non-trivial
tools:
- The original debugger has been developed without changing the original
source code of the compiler. It used a slightly modified (redefined) code
generation scheme
- An automatic make-like dependency manager
- A pretty printer
- A lint-like semantical analyzer.
Another obvious application of the compiler support feature would be related
to metrics, which are notoriously hard to gather in common languages as soon as
one goes beyond lexical [Halstead 77] or
structural [McCabe 76] metrics. For instance,
measuring class fan-in and fan-out in YAFL took merely a few hours of work,
while it can takes days and weeks to be applied to C++.
Other possible applications are:
- A profiler, a cross-referencer, a source code librarian, a performance
analyzer, etc...
- A structure-oriented program editor
- An automatic documentation generator
- A global optimizer, which would replace virtual table lookups by direct
function calls whenever the corresponding method has not been redefined on a
system-wide basis.
- A modified code generation scheme (see case study).