A simple compiler for a test language called P--, made for educational purposes.
It's a project in C, that implements the basic functionality of a standard Programming Language Compiler.
This project was developed for the Compilers class at the Computer Science Department, University of Ioannina.
- compiler.c: The file that includes the main() and calls the other functions.
- syntax_analyzer.c: Does the Syntax Analyzing to check if the input is grammatically correct (according to the provided language's specifications)
- intercode_functions.c: Contains required function for the intercode generation
- symbol_table.c: Holds the data about the Scopes and Names of Functions and Variables.
- endcode.c: Contains that functions required for the production of .msim files, containing the Endcode.
- Compile "compiler.c" using GCC (tested on OSX and Ubuntu Linux)
- Open the "a.out" file using one of the provided test inputs (from the folder "/Inputs") as an argument.
- If everything worked ok (the input code was valid, according to the language's grammar), three output files should have been produced inside the "/Inputs" folder.
Normally, the endcode .msim files work on a proprietary processor emulator called "Metasim", that is used in dept. of Computer Science, University of Ioannina. But, still, the final code is similar to many common endcode implementations.