Alors l'oeuf ou la poule ?
Source for a C# compiler written in pure C#.
For anybody looking for the full source to a bootstrapping C# compiler, today’s your lucky day.
A while ago (back in 2001 before we shipped v1.0), I wrote a C# compiler called “Blue”. I know it’s 3.5 years after I wrote it, but I figured releasing it now was better late then never. Some fast facts:
- It’s written 100% in C#.
- It uses Reflection to import all references and Reflection.Emit to emit the IL.
- Everything (particularly the parser and lexer) were written by hand.
- It has the standard compiler pipeline as described in the dragon book.
- It produces verifiable IL (you can run PEVerify on the output and it passes).
Here’s the source: http://mikewinisp.members.winisp.net/blog/blue/blue.zip
There’s a ReadMe.html in there with more information. Unzip it do a directory , and then in a v1.0 or v1.1 command shell, run build_all.bat.