kaustubhhiware / cOMPILER

Compiler for restricted grammar C.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Compiler for restricted grammar C.

License:Other


Languages

Language:C 67.3%Language:Yacc 17.2%Language:C++ 9.9%Language:Assembly 3.6%Language:Lex 1.4%Language:Makefile 0.5%