Peter Stuifzand

META II

Today I implemented the META II compiler compiler using this paper: META II: A syntax-oriented compiler writing language. The code can be found on GitHub.

An interesting idea from this paper is that the language is really easy to implement using just a few lines of code. The C code is quite a bit larger, but could be made smaller. A bigger problem with the code is that the compiler generates an assembly language program that still needs an assembler and a virtual machine. These two parts need to be created before I can actually test the program.

There is a website that contains a tutorial based on the paper. They also implemented the code from paper and my generates the same code as their code, except for the label names. My code for generating the labels uses a method that’s more similar to the one used in the paper. All the other instructions are the same.

© 2023 Peter Stuifzand