This is a Python implementation of a Non Recursive Predictive Parser. It can be used to parse a given input string based on a specific grammar.
You can also find it hosted at parser.aayushpokharel.com
This is the original grammer that was used to design the parser.
S -> ABC
A -> abA | ab
B -> b | BC
C -> c | cC
This is the equivaltent grammer used to implement the parser after removing ambiguities and immediate left-recursion.
S -> AB'C'
A -> abA' | ab
A' -> abA' | ε
B -> bB' | ε
B' -> cB' | ε
C -> cC' | ε
C' -> cC' | ε
- Python 3.x
- Flask
-
Clone the repository:
git clone https://github.com/AayushPokharel/CompilerParser.git
-
Install the dependencies:
pip install -r requirements.txt
-
Run the application:
python app.py
-
Open your web browser and visit
http://localhost:5000
to access the application.
- Enter an input string in the provided input form.
- Click the "Parse" button to parse the input string.
- The application will display the result of the parsing process, along with the computed First and Follow sets.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.