Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A compiler for the Simple Integer Language, written using Lex and Yacc
branch: master

This branch is 14 commits behind addy689:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Main
SILCompiler
.gitignore
LICENSE
README.md

README.md

SILC

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://athena.nitc.ac.in/~kmurali/Compiler/sil.html]
Target Machine (SIM) Architecture description can be found at [http://athena.nitc.ac.in/~kmurali/Compiler/sim.html]

Author :

Contributors :

License :

  • The code is licensed under the MIT License


Repository Information

Folder Listing

FolderDescription
SILCompilerContains compiler source programs that are used to compile and generate SIM code for a SIL source program
SILCompiler/LexYaccFilesContains a Lex file SIL.l (for lexically analysing SIL source program) and a Yacc file SIL.y (for parsing SIL source program)
MainContains a Makefile for compiling the compiler source programs, SIL source program files SILsource{1-4}, and a file SIMCode (target file for the instructions that the compiler generates)
Main/SIM_SimulatorContains the simulator for SIM

Instructions

  1. Compile the compiler source programs using the Makefile present in Main/. In the terminal, write

    $ cd Main/
    $ make all
  2. Using the object file sil that is created, compile any of the SIL source programs present in Main/. In the terminal, write

    $ ./sil SILsource1
    
  3. The SIL source program will be executed. Also, the SIM instructions that are generated will be stored in file SIMcode

  4. 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
Something went wrong with that request. Please try again.