Cimple is a simplified version of the C programming language with educational purposes.
Its capabilities are limited, however, it contains many well-known control flow statements.
Cimple program files have a .ci extension. A full language description can be found in the report
file (GR). The compiler was developed for the Compilers course @cse.uoi.gr and
the final code produced is in MIPS32 assembly.
cimple.py
: the compilercimple-test-files
: various Cimple programs used for testing purposescompilation-output
: examples of the files created from the compilationreport
: thorough project report.cleanup.py
: used to clean any unwanted files created from the compilation
-
Run command:
python3 cimple.py <cimple file> <optional arg>
<cimple file>
: the cimple program file path to be compiled ending in .ci
<optional arg>
: can be one of the following
-lex: print lex tokens on screen
-ic: print intermediate code quad on screen
-st: print symbol table on screen
-asm: print final assembly code on screen -
By default the compiler creates 3 files:
.int file with the intermediate code
.sym file with the symbol table
.asm file with the final MIPS assembly code -
If the cimple program has no function or procedure an extra C file equivalent is created
which contains the intermediate code quads as low level C code. (can be compiled with any C compiler) -
The produced final code can be assembled and executed with MARS 4.5:
MIPS Assembler and Runtime Simulator
Python 3.8.5