This is Complier for Simple Integer Language which supports different features like
- Built in error and sytax checking
- Different Data Types like
int
,string
,arrays
,etc - Conditional Loops
- Functions
-
sim-2
is a machine simulator which we use to run the compiled code.$ cd sim-2 $ make
this generates the
sim
file which is our machine simulator, -
Now we need to compile our
SILC
Compiler$ cd .. $ make
this generates the file
interpreter
which is executables for ourSILC
compiler -
Now run these following commands to check the error and syntachecking feature
$ ./interpreter bubble_sort.silc
$ ./interpreter array_test.silc
-
And now to generate the machine code run following command
$ ./interpreter program.silc
this generates the file
program.sim
this is compiled machine code of the fileprogram.silc
. To run this compiled file onsim-2
machine use the command$ sim-2/sim program.sim
SILC compiler uses a number of open source projects to work properly:
- [C++] - For compiler design logic
- [Lex] - Generates lexical analyzers. Lex is commonly used with the yacc parser generator
- [YACC] - It is Compiler Compiler
- [markdown-it] - Markdown parser done right. Fast and easy to extend.
MIT