A Compiler for a subset of Pascal
Education, Undergraduate Projects
For this assignment, the task was to implement the basic components of a compiler for a subset of Pascal. Detail of the assignment can be found at the APPENDIX section of The dragon book of Compiler. Stuffs I did here was:
- Design and develop a symbol-table mechanism.
- Write a lexical analyzer.
- Write semantic actions and the parser.
- Code generation (i.e. generate intermediate assembly code for a given progam in Pascal using the parser developed in previous step).
The source code contains all the four parts of this compiler task. It also includes shell scripts to build lexical analyzer and parser, nasm commands etc (All the stuffs I used while doing this assignment). You can download it here.