2 ms·
> Of course in addition to executing an AST you can also generate CODE for it... Yes! In the third part of the book [1], we'll do exactly that. The C interpret
by munificent 9y ago
> Of course in addition to executing an AST you can also generate CODE for it...
Yes! In the third part of the book [1], we'll do exactly that. The C interpreter's parser generates bytecode as it parses. I haven't written the text yet (that's the hard part...) but you can see the code for it here [2].
[1]: http://www.craftinginterpreters.com/a-bytecode-virtual-machine.html http://www.craftinginterpreters.com/a-bytecode-virtual-machi...
[2]: https://github.com/munificent/craftinginterpreters/blob/master/c/compiler.c https://github.com/munificent/craftinginterpreters/blob/mast...
- ChuckMcM 9y agoThat will be awesome.