How saatvika04/lalr_slr_parser_cd works
This compiler-design visualizer accepts source text in a browser, runs native SLR and Bison LALR parsers for comparison, and presents results, traces, automata, parsing tables, and LALR conflicts. Flask owns the API orchestration; the SLR engine constructs LR(0)/FOLLOW-based tables, while the LALR path uses the Bison grammar and report adapter. The README documents the shared Flex lexer and parser paths; unsampled grammar and template details are represented only at their documented level.
Main entry points: app.js Web interface · app.py Flask API · lalr_automaton.py LALR report adapter · parser_driver.c LALR parser driver
Components 13
Visualizer interface
- Web interface
static/app.js - Visualizer page
templates - Results and traces
static/app.js - State inspection
static/app.js
Flask service
- Flask API
app.py
Parsing engines
- LALR parser driver
parser_driver.c - LALR grammar
lalr_parser.y - SLR parser
slr_parser.c - Shared Flex lexer
lexer.l - SLR automaton builder
slr_parser.c
Automaton inspection
- Bison report
lalr_parser.output - LALR report adapter
lalr_automaton.py
Other components
- Engineer
Connections 14
- Engineer → Web interface: enters input
README.md - Web interface → Flask API: requests parse
static/app.js - Flask API → LALR parser driver: runs LALR
app.py - Flask API → SLR parser: runs SLR
app.py - LALR grammar → LALR parser driver: defines grammar
README.md - Shared Flex lexer → LALR parser driver: supplies tokens
README.md - Shared Flex lexer → SLR parser: supplies tokens
README.md - Flask API → LALR report adapter: loads automaton
app.py - LALR report adapter → Bison report: reads report
lalr_automaton.py - Flask API → SLR automaton builder: requests automaton
app.py - Web interface → LALR report adapter: requests state data
- Web interface → Results and traces: renders results
static/app.js - Web interface → State inspection: renders states
static/app.js - Visualizer page → Web interface: hosts interface