Term Project for the Compiler Construction Course at BITS Pilani
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
oldtestcases
.gitignore
.testcase1.txt.swp
LanguageSpecifications.pdf
README.md
ast.c
ast.h
codegen.c
codegen.h
driver.c
firstandfollow.c
firsts.txt
follows.txt
grammar.txt
lexer.c
lexer.h
lexerDef.h
main1.txt
main2.txt
main3.txt
main4.txt
makefile
parser.c
parser.h
parserDef.h
remove.sh
run.sh
semantic.c
semantic.h
symboltable.c
symboltable.h
symboltabledef.h
testcase1.txt
testcase2.txt
testcase3.txt
typechecker.c
typechecker.h
typecheckerdef.h

README.md

Compiler

This is a toy compiler written in C for course CSF363 at BITS Pilani

Known Issues: Crashes with GCC 5.3 (ships with Ubuntu 16.04)

Tested with GCC 4.9 and below. It works perfectly for them! The compiler follows the language given in grammar.txt and LanguageSpecifications.pdf.

Running Instructions

$ make #compile the compiler
$ ./toycompiler <filename> #compiles the code
$ ./run.sh #converts the code.asm to machine code and executes

Use with caution.