CFGI-Interpreter-GUI
The project is for a context-free grammar interpreter. The interpreter takes as input a context-free grammar and a string to parse and gives an output whether the test string is either accepted or rejected. The program is implemented in a GUI, using Python.
Program Overview
It consists of three files. One is for setting context free grammar and parsing string and another is for setting up UI layout and last one is for setting button signal and slots to use context free grammar interpreter. The below code is developed in Python language.
Demo
Presentation on Youtube
Example
Context Free Grammar
- S → aaaaS|A|B|C
- S → D|E|ɛ
- A → m|AC
- A → aB|c|D
- A → aa
- B → ae|BE|ɛ|azz
- B → Cd
- C → i|D
- C → u|ɛ|o
- D → n|E|t|at
- D → y|ɛ
- E → j|r|D|F
- E → CBF
- F → lolF|h|g
- F → d|kkk
Derivation Trees
Strings are accepted by grammar:
- minji
Strings are not accepted by grammar:
- car: The grammar cannot produce ‘ar’
Built with
License
This project is licensed under the MIT License