/mini-c

F# implementation of a Mini-C compiler targeting MSIL

Primary LanguageF#

Mini-C Compiler

This is a compiler for a subset of the C programming language. The compiler is written in F# and targets Microsoft Intermediate Language (MSIL). It was written so that I could teach myself F#. If you're interested in doing the same thing, you may find it useful.

GUI

I wrote a simple GUI to visualize the compilation process. The Abstract Syntax Tree (AST) and Microsoft Intermediate Language (MSIL) panels update in real-time when you change the source code.

Screenshot

Acknowledgements

  • I got the grammar for this particular subset of C from this paper, which looks like a university course assignment.
  • Tim Robinson's blog series on writing a Lisp compiler in F# was very useful. Although the source languages are different, I was still able to use many of his ideas for my implementation.

License

Mini-C is released under the MIT License.