A Python implementation of SLR(1) parser with GUI interface for compiler frontend development.
- SLR Parsing Table Generation with conflict detection
- Interactive Tkinter-based GUI for grammar analysis
- Lexical analyzer with symbol table management
- Support for logical expressions (
AND/OR/NOT) - Automatic Excel report generation for:
- Action/Goto parsing tables
- Closure sets visualization
- FIRST/FOLLOW sets
- Multi-window visualization system
- Thread-safe queue implementation for parsing operations
git clone https://github.com/kcflexigbo/slr-parser-compiler-frontend.git
cd slr-parser-compiler-frontend
pip install -r requirements.txt
pandas
pandastable
mttkinter # For thread-safe Tkinter
xlrd # Excel file handling
python main.py
- Input Grammar in the main text editor
- Use control buttons to:
- Generate parsing tables
- View closure sets
- Analyze FIRST/FOLLOW sets
- Detect conflicts
- Save results to Excel/Text files through
Save Filesoption
. ├── Course Project/ # Main implementation
│ ├── analyzer.py # Lexical analysis core
│ ├── slrgenerator.py # SLR table generator
│ ├── filesbrowser.py # File I/O operations
│ └── main.py # GUI entry point
├── Question 1/ # Basic parser implementation
├── Question 2/ # Enhanced version with tables
├── run.bat # Windows launch script
└── .gitignore # Python/Venv exclusion rules
-
Closure Visualization
Closure 0:
S -> •EXPR
EXPR -> •EXPR OR TERM
EXPR -> •TERM
...
- Fork the repository
- Create feature branch (
git checkout -b feature/your-feature) - Commit changes (
git commit -am 'Add some feature') - Push to branch (
git push origin feature/your-feature) - Open Pull Request
MIT License - See LICENSE for details
Key elements included:
- Matches .gitignore patterns for Python projects
- Reflects multi-directory structure from codebase
- Highlights SLR-specific features from parsing tables
- Includes threading requirements from mttkinter usage
- Documents Excel I/O functionality shown in code
- Maintains Windows compatibility (run.bat reference)
