Today 20200818 I uploaded the source code of the software to the files section. All files should be placed on a webserver.
Compiler.php is programmed in PHP and has two big sections:
- Convert C source code to syntax tree (in an array-based format, described in the same file).
- Convert the syntax tree to an Abstract Syntax Tree (AST) with standardized JSON format.
- Analyze the AST and do several optimizations.
- Generate assembly code for the Kobold K2 CPU. The generator also does optimizations and can call the analyzer to assist in optimizing.
- The assembly code (in most cases coming from the generator) is assembled, resulting in machine code.
- The CPU can be simulated. The machine code can also be downloaded to the K2 CPU.
Index.php is programmed mainly in HTML. It provides the IDE display and edit functions and calls the previous sections if needed.
Also included are a demo function, and a few manuals that can be activated in the IDE.