A simple C subset compiler

kjstol parrotcode at gmail.com
Fri May 18 20:15:19 UTC 2012


hi there,

I've indulged in some hacking time, and implemented a simple subset of C.
Attached is a zip file, just type "make" and it should work (assuming
you have bison and flex).

What it currently does, it generates the parsed code from the AST (mostly).
Not everything of the language is supported yet (e.g., parameters
etc.) The parser would have to be fixed a bit, it has some known
limitations.

The idea next is to implement a simple code generator to generate the
M0 ops that have been spec'ed so far.
There are many todos (e.g, thread-safety of the compiler),
register-allocator, etc.) most of which would be easy to implement.
For now, the focus would be on a simple and clean language
implementation that generate M0.

Comments welcome,
kjs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: m1.zip
Type: application/zip
Size: 19072 bytes
Desc: not available
URL: <http://lists.parrot.org/pipermail/parrot-dev/attachments/20120518/24d25f15/attachment.zip>


More information about the parrot-dev mailing list