name mode size
c2p 040000
.gitignore 100644 17B
Makefile 100644 566B
README.txt 100644 1.09kB
build 100755 106B
c2p.py 100644 275B
report.pdf 100644 78.72kB
report.tex 100644 2.37kB
runtests.py 100644 145B
test 100755 33B
README.txt
A C to P-code compiler project by Christophe Verdonck and Stein de Groof INSTALLING /RUNNING A makefile is provided for building and testing the project. In absence of the make utility the equivalent commands are given below: make parser Generates the parser classes using antlr java -jar c2p/src/parser/antlr-4.6-complete.jar -Dlanguage=Python3 c2p/src/parser/C.g4 -visitor make test runs the automatic test script verifying mostly semantic checks python3 runtests.py -v make all run both above commands make clean removes generated files The c2p.py script will take a C-file and compile it into a P-file on the condition the parser classes have been built using the above command. syntax: python3 c2p.py cfile.c pfile.p TESTING Test files are located in c2p/tests/testfiles organised in subdirectories by feature and given descriptive names. All the tests are run automatically by the test script, except for the one under 'codegen', as the results of those can not easily be verified automatically. SOURCE The source for the compiler can be found under c2p/src.