A compiler for the Simple Integer Language (SIL) that reads a SIL source program, and generates instructions for a target machine known as the Simple Integer Machine (SIM).
Source Language (SIL) description can be found at [http://andromeda.nitc.ac.in/~addy/compiler/sil.html]
Target Machine (SIM) Architecture description can be found at [http://andromeda.nitc.ac.in/~addy/compiler/sim.html]
- Addy Singh [email protected]
- Saurabh Sinha [email protected]
- Vipin Nair [email protected]
- The code is licensed under the MIT License
# Repository Information
<tr>
<td>SILCompiler</td><td>Contains compiler source programs that are used to compile and generate SIM code for a SIL source program</td>
</tr>
<tr>
<td>SILCompiler/LexYaccFiles</td><td>Contains a Lex file <i>SIL.l</i> (for lexically analysing SIL source program) and a Yacc file <i>SIL.y</i> (for parsing SIL source program)</td>
</tr>
<tr>
<td>Main</td><td>Contains a <i>Makefile</i> for compiling the compiler source programs, SIL source program files</td>
</tr>
<tr>
<td>Main/SIM_Simulator</td><td>Contains the simulator for SIM, and a file <i>SIMcode</i> (target file for the SIM instructions that the compiler generates for an input SIL program)</td>
</tr>
Folder | Description |
---|
-
Compile the compiler source programs using the Makefile present in Main/. In the terminal, write
$ cd Main/
$ make all
-
Using the object file sil that is created, compile any of the SIL source programs present in Main/. In the terminal, write
$ ./sil SILsource1
-
The SIL source program will be executed. Also, the SIM instructions that are generated will be stored in file SIMcode
-
The instructions in the file SIMcode are executed using the SIM simulator present in Main/SIM_Simulator/. To execute the generated SIM instructions, write in the terminal
$ cd SIM_Simulator/
$ make all
$ ./sim ../SIMcode