FC is a minimal compiler that supports a Forth syntax.
Its initial purpose was to be a pedagogical tool for learning about compilers.
It has morphed into a serious attempt at a minimal but useful full-fledged compiler.
The compiler currently does a minimal amount of error checking.
It generates assembly code for the FASM assembler.
Since FC generates assembly code for FASM, forward branches are a non-issue.
FC breaks the input stream into a stream of tokens.
The parser generates a simple IRL.
The IRL is then used to generate assembly code.
fcc.c: the forth compiler
- This takes a source file as the only argument.
- If no argument is given, it reads the source from STDIN.
- The output is FASM assembly, written to STDOUT.
- Any fatal errors are written to STDERR.
Running:
make test