This converts PL/0 code to JavaScript via an AST.
The Shunting Yard Algorithm is used for mathematical expressions.
Includes these bits:
- tokenizer
- parser
- emitter (JavaScript)
- shunting yard
Right now, the PL/0 source is hardcoded in compiler.js
. (Obviously
that's scheduled to change.)
node compiler > foo.js
node foo.js
This isn't the most efficient code, by any means. The tokenizer and emitter constantly make new strings, for example.
- Accept input filename on command line
- Finish implementing
ODD
?
statment- Report symbol table-related errors
- Add a C emitter
- Moar testing!