Loonguage is a language specified to generate assembly code to run on a specified CPU. The CPU is self-made on FPGA, using a set of instructions designed for this CPU. This repository contains a compiler to compile Loonguage and a user-friendly interface to edit, run and debug the code in Qt.
Loonguage compiler has four phases.
Use flex to generate lexical analyzer to transform raw code into token list.
Use Bison to generate lexical analyzer to transform token list into abstract syntax tree.
On syntax tree, perform type check, object check and so on to check its validity.
Generate ASM code using special instruction set designated for homemade CPU.
You can open the root path in repository in Qt Design to generate the user interface, which is used as a design environment for Loonguage writer. The folder /Compiler contains the core of the compiler, which is a Visual Studio project.