A Python learning repository for compiler-design concepts, lexical analysis, parsing, translation, automata, and chapter-wise exercise solutions. The code is organized around classroom chapters, lab exams, and standalone compiler construction experiments.
- Lexical analyzer that recognizes numbers, identifiers, keywords, and symbols.
- Recursive-descent parser for expression translation.
- Syntax tree, environment, tag, and token helper classes.
- Chapter-wise exercise solutions for compiler theory problems.
- Automata and lab-practice scripts for exams and finals.
.
|-- chapter2/ # Lexer, parser, translator, token classes, syntax tree
|-- chapter3/ # Chapter 3 exercise and section problem solutions
|-- exam/ # Lab/exam practice scripts
|-- final/ # Final exam practice scripts and automata examples
`-- finalexam/ # Additional final exam lab files
- Python
Run individual examples with Python:
cd chapter2
python lexer.py
python parser.pyMost scripts are standalone and print their output directly to the terminal.
- Understand tokenization and symbol-table construction.
- Practice predictive parsing and infix-to-postfix translation.
- Implement automata and compiler-theory exercises in Python.
- Keep course and exam practice code organized by topic.