OCaml implementation of the CiviC compiler for Compiler Construction course at UvA

Taddeus Kroes 4f4ff50e16 Now using Int32 for integer bounds checking %!s(int64=12) %!d(string=hai) anos
bin32 ee11dce399 Started on implementing CiviC compiler %!s(int64=12) %!d(string=hai) anos
doc 3d3c4d5421 Added empty assmebly phase %!s(int64=12) %!d(string=hai) anos
phases 4f4ff50e16 Now using Int32 for integer bounds checking %!s(int64=12) %!d(string=hai) anos
test 60a3a48b60 Scalar array initialisation now supports non-constant values, which are evaluated only once %!s(int64=12) %!d(string=hai) anos
.gitignore 2126ae7cee Removed preprocessor from parser, improved some error messages, moved some functions to common files %!s(int64=12) %!d(string=hai) anos
Makefile d7b07541bb Fixed shift/reduce conflicts by making vardecs list right-recursive %!s(int64=12) %!d(string=hai) anos
OCamlMakefile ee11dce399 Started on implementing CiviC compiler %!s(int64=12) %!d(string=hai) anos
README.md 4f4ff50e16 Now using Int32 for integer bounds checking %!s(int64=12) %!d(string=hai) anos
lexer.mll cd39b017b6 Cleanup %!s(int64=12) %!d(string=hai) anos
main.ml 9e5ee5acf8 Phase titles are now only printed when verbosity >= 2 %!s(int64=12) %!d(string=hai) anos
parser.mly fcb75e6424 Parser cleanup %!s(int64=12) %!d(string=hai) anos
run df77f208ef Run script now does not continue when compiling fails %!s(int64=12) %!d(string=hai) anos
stringify.ml f979c1faf4 Changed the way array types are represented, and cleaned up a lot of code in the process %!s(int64=12) %!d(string=hai) anos
stringify.mli 21fc065c8f Changed constant node types, added VarDecs|LocalFuns wrappers, implemented first steps of assembler %!s(int64=12) %!d(string=hai) anos
types.ml f979c1faf4 Changed the way array types are represented, and cleaned up a lot of code in the process %!s(int64=12) %!d(string=hai) anos
util.ml d57caab46f Error printer now handles tabs in input file correctly %!s(int64=12) %!d(string=hai) anos
util.mli 7462e88b3d Added warning and constant propagation check for division by zero %!s(int64=12) %!d(string=hai) anos

README.md

CiviCaml

CiviCaml is a compiler for the CiviC language, written in OCaml.

Issues & TODO

  • Keep file content in buffer to prevent error messages from crashing when reading from stdin.
  • Documentation for each phase, in ocamldoc format.
  • Create automated testsuite runner.
  • Assembly printer should print optimized instructions.
  • Erronous array initialisation needs more insightfull error messages and array assignment needs better better type checking.
  • Typechecking now gives an error when integers are not in the 32-bit range, as the reference compiler implements it. However, 64-bit should imo also be supported (using Nativeint instead of Int32).