This project includes:
- Lexical analysis program for the SNL language written in C
- Recursive descent parser for the SNL language written in C
- LL(1) parser for the SNL language written in C
Written in Python:
- Program to compute the Predict set for any language production rule
- Program to automatically generate the three C programs above for any language's production rules
Additionally:
- A txt document containing 104 production rules for the SNL language
For detailed information, please refer to my blog:
中文版
English version
In addition, this project provides test samples and executable program files. You can directly run SNL_compiler\analyse.exe
to see the program's functionality.
For the automatic generation program, you can delete SNL_compiler
and run SNL Syntax Analyzer Code Generator.py
to regenerate the C language code. (This will regenerate a version of SNL_compiler
identical to the previous one, but without the test samples and executable program files. You will need to recompile it.)