Skip to content

billyedmoore/hspc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Haskell Pascal Compiler

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.

Progress

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

Testing

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.bash

To run the tests.

# from project root
cabal test

About

Haskell Pascal Compiler, A Toy Pascal Compiler Targeting X86-64 Linux.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors