/Cminusminus-compiler

[University] A small step-through debug interpreter for a subset of C

Primary LanguageHaskellBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Compiler for the C-- language

A small step-through debug interpreter for a subset of C. Check out the specification for more information.

While it's functional, the plan is to rewrite it to use the pattern layed out in the proof-of-concept STM-Fun, which showcases how to split the repl and eval apart.

You can test the program out with the C programs found in test/data/*.c, it will go something like below,

screenshot 2017-12-02 14 04 47

Building the interpreter

To build the interpreter it is recommended that you use the stack tool from https://docs.haskellstack.org. In the source code,

$ stack setup
$ stack build

You can now run the repl on a file via,

$ stack exec -- c-repl "path/to/program.c"

Specification

This specification is taken from the C-- Language Specification, and then extended a bit with some additional C features.