<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Compiler</title>
        <link>http://blog.brownie.com.au/category/7.aspx</link>
        <description>Compiler</description>
        <language>en-AU</language>
        <copyright>Andrew Browne</copyright>
        <managingEditor>brownie@brownie.com.au</managingEditor>
        <generator>Subtext Version 1.9.5.177</generator>
        <item>
            <title>Announcing the CFlat compiler</title>
            <link>http://blog.brownie.com.au/archive/2009/06/17/announcing-the-cflat-compiler.aspx</link>
            <description>&lt;p&gt;While I have been backpacking through Europe my urge to code has not been completely ignored. On trains and planes and buses I have been working my way through “The Dragon Book” and “The Deﬁnitive ANTLR Reference”.&lt;/p&gt;
&lt;p&gt;As of a few minutes ago I am probably too proud of the fact that the command line:&lt;/p&gt;
&lt;pre&gt;cflat.exe SimpleTest.cflat -o SimpleTest.dll&lt;/pre&gt;
&lt;p&gt;Compiles this:&lt;/p&gt;
&lt;pre&gt;public class SimpleTest
{
    public int GetValue()
    {
        return 1;
    }

    public int Main()
    {
	int a = 2;
	if(true){
		return a + GetValue();
	}
	return a;
    }
}&lt;/pre&gt;
&lt;p&gt;into this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.brownie.com.au/images/blog_brownie_com_au/WindowsLiveWriter/Announcingthecflatcompiler_114D5/SimpleTests_2.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="SimpleTests" border="0" alt="SimpleTests" width="504" height="302" src="http://blog.brownie.com.au/images/blog_brownie_com_au/WindowsLiveWriter/Announcingthecflatcompiler_114D5/SimpleTests_thumb.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;There is lots more to do but I finally feel like after much experimentation I am on track to having my own compiler for a very small subset of C#.&lt;/p&gt;
&lt;p&gt;I built a compiler once before for possibly my favorite university class: Programming Language Implementation. I became interested in compilers again after playing around with the first Oslo release and the combination of M/IntelliPad.&lt;/p&gt;
&lt;p&gt;Of course this compiler will never be of any use except as a learning tool for me.  Currently I am using ANTLR for parsing/lexing and Reflection.Emit to target the CLR.  Once I am happy with the feature set of my C# subset I am planning to look into other options for parsing including MGrammar and F#. Before that I am going to need to add at least one looping construct :-).&lt;/p&gt;
&lt;p&gt;All the source and test are available in my github &lt;a href="http://github.com/adbrowne/abcm/tree/master"&gt;repository&lt;/a&gt; in case anybody wants to follow along.&lt;/p&gt;&lt;img src="http://blog.brownie.com.au/aggbug/17.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Browne</dc:creator>
            <guid>http://blog.brownie.com.au/archive/2009/06/17/announcing-the-cflat-compiler.aspx</guid>
            <pubDate>Tue, 16 Jun 2009 17:59:39 GMT</pubDate>
            <comments>http://blog.brownie.com.au/archive/2009/06/17/announcing-the-cflat-compiler.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blog.brownie.com.au/comments/commentRss/17.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>