Effect on the language
In order to be even reasonably reusable, YAFL's compilation process has been
made as simple as possible. This shows in a few places:
- YAFL supports Ada-like comments; running from a double dash "--"
to the end of the line. Such comments can be easily linked together, and
attached to the previous or to the next significant token.
- The YAFL compiler generates intermediate C code. Such a code generator is
significantly easier to understand and to modify than a native code generator.
- YAFL's lexical definition has been adapted to avoid the need for a
lookahead character whenever possible. For instance, most of the compilation
literature refers to the Pascal range as an example where the lexical analyzer
must use a lookahead to distinguish between a real number ("1.7") and
a couple of integers in a range ("1..7"). In order to avoid this
problem, YAFL uses a keyword instead of the double-dot notation to specify
ranges.