Parser generation to check the syntax of Pascal code.
- Makefile: self explanatory, the file for the make command;
- Pascal.g4: the file that contains the grammar that the parser will use;
- Syncheck.cpp: the file that use the parser to see if the Pascal code has one or more syntax errors;
- Test: directory that contains some tests.
You need to download ANTLR v4 from the official page and the c++ runtime dev, libantlr4-runtime-dev.
First use the command make (to reverse it use make clean).
Then when all files are created, you can execute the syncheck output file and use a test file as argument
Example:
./syncheck test/valid.pas
If you try to use tests that you find in the test directory, it's normal that test from 5 to 8 output "1 syntax error found".
This is a little project I made as a test for my university (Universita' Degli Studi di Padova), so part of the project is the foundation they gave me to build all.