Toy Pascal compiler written in Haskell using an adapted version of the incremental approach outlined in this paper.
Currently implements a very small (but slowly growing) subset of the language.
Increments:
- Integers
- Binary Operators on Ints
- Unary Operators on Ints
- Local Variables and Assignment
- Booleans
- Branching (if statements)
- While Loops
- Comparisons
- Blocks as statements
- For Loops
- Strings (WriteLn("Hello World"))
- Type Checking
- Procedures
- Functions
- Arrays
- Floats
- Records
- Pointers
HSPC's approach to testing is to test parity with fpc.
This is tested with integration tests comparing the STDOUT and
EXIT_CODE of compiled versions of the same pascal code
(one by hspc and one by fpc).
To rerun the programs against fpc.
# from project root
cd test/sample_programs
bash generate_goldens.bashTo run the tests.
# from project root
cabal test