Skip to content
Compiler for restricted grammar C.
Branch: master
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.
docs
lib
tests
LICENSE
Makefile
README.md
a.out
compiler_actions.y
compiler_lexer.l
compiler_target_translator.cxx
compiler_translator.cxx
compiler_translator.h
lex.yy.c
libmylib.a
libmylib_safe.a
myl.h
mylib.c
mylib.o
y.output
y.tab.c
y.tab.h

README.md

cOMPILER

A tiny-c compiler made using flex, yacc, and gnu assembler. tiny-c has instructions are a subset of instructions from C. Targetted for x86_64 architecture.

Written for Compilers Course (CS39003). To know more about tiny-c, go through the docs folder.

Testing

The test files can be found in the tests folder. Run them with - make testi , i = 1 to 5

Test your own tiny-c file with :

make
./a.out < testfile.c  test_s_file_name
gcc -c test_s_file_name.s -o test_o_file_name.o
gcc test_o_file_name.o -L. -g -lmylib -o test.out
./test.out

P.S : The compiler assumes your tiny c file is correct, so if a segmentation fault is faced, make sure your test file is tiny-c compatible.

The quads generated for this program can be found in the test folder.

You can’t perform that action at this time.