And that's a very handy way to think about cogeneration because it allows you to think about one case at a time without having to get mixed up thinking about all the different constructs at one time. &amp;gt;&amp;gt; And finally I recommend that you use a stack machine for your compiler. 