How venkyjntu-git/compilerdesignlab_2026-27 works
This repository is a staged TinyCStr compiler-design lab: users run weekly Python compiler versions on source files to inspect tokens, parse into ASTs, check types, and produce three-address code or MIPS. The clearest end-to-end implementation is the Week 5–7 path; earlier weeks and practice examples provide smaller learning steps. The README also describes later control-flow, function, and optimization stages, but no corresponding later-week directories appear in the supplied tree. Connections below are limited to shown calls, imports, and documented scope.
Main entry points: Function.py Function model · main.py Week 6 driver · tinycstr_parser.py TinyCStr parser · type_checker.py Type checker
Components 18
Front end
- Week 6 driver
Week6_Level2SemanticAnalyzer_18_08_2026/main.py - TinyCStr lexer
Week5_Level2LexerParser_11_08_2026/tinycstr_lexer.py - TinyCStr parser
Week5_Level2LexerParser_11_08_2026/tinycstr_parser.py - AST nodes
Week5_Level2LexerParser_11_08_2026/ast_nodes.py
Semantic model
- Symbol table
Week5_Level2LexerParser_11_08_2026/SymbolTable.py - Function model
Week5_Level2LexerParser_11_08_2026/Function.py - Program model
Week5_Level2LexerParser_11_08_2026/Program.py - Type checker
Week7_Level2Codegenerator_01_09_2026/type_checker.py - Type rules
Week7_Level2Codegenerator_01_09_2026/type_rules.py
Code generation
- TAC generator
Week5_Level2LexerParser_11_08_2026/tac_generator.py - Triple representation
Week5_Level2LexerParser_11_08_2026/three_address_code.py - MIPS generator
Week5_Level2LexerParser_11_08_2026/tac_to_mips.py
Learning examples
- Later compiler stages
README.md - Calculator lexer
Week1_SlyPractice_18-07-2026/CalcLexer.py - Expression lexer
practice_examples/2_practice_examples_ast/ExprAstLexer.py - Expression parser
practice_examples/2_practice_examples_ast/ExprAstParser.py - TAC and MIPS exercises
practice_examples/3_practice_examples_threeaddress_quadruple
Other components
- Compiler user
Connections 23
- Compiler user → Week 6 driver: invokes
Week6_Level2SemanticAnalyzer_18_08_2026/main.py - Week 6 driver → TinyCStr lexer: tokenizes input
Week6_Level2SemanticAnalyzer_18_08_2026/main.py - Week 6 driver → TinyCStr parser: parses tokens
Week6_Level2SemanticAnalyzer_18_08_2026/main.py - TinyCStr parser → AST nodes: builds nodes
Week5_Level2LexerParser_11_08_2026/tinycstr_parser.py - TinyCStr parser → Symbol table: records declarations
Week5_Level2LexerParser_11_08_2026/tinycstr_parser.py - TinyCStr parser → Function model: creates functions
Week5_Level2LexerParser_11_08_2026/tinycstr_parser.py - TinyCStr parser → Program model: creates program
Week5_Level2LexerParser_11_08_2026/tinycstr_parser.py - Program model → Function model: dispatches stages
Week5_Level2LexerParser_11_08_2026/Program.py - Week 6 driver → Type checker: checks types
Week6_Level2SemanticAnalyzer_18_08_2026/main.py - Type checker → AST nodes: checks and annotates
Week7_Level2Codegenerator_01_09_2026/type_checker.py - Type checker → Symbol table: reads symbols
Week7_Level2Codegenerator_01_09_2026/type_checker.py - Type checker → Type rules: applies rules
Week7_Level2Codegenerator_01_09_2026/type_checker.py - Week 6 driver → Program model: generates and compiles
Week6_Level2SemanticAnalyzer_18_08_2026/main.py - Function model → TAC generator: generates TAC
Week5_Level2LexerParser_11_08_2026/Function.py - Function model → Triple representation: stores triples
Week5_Level2LexerParser_11_08_2026/Function.py - Function model → Symbol table: assigns offsets
Week5_Level2LexerParser_11_08_2026/Function.py - Function model → MIPS generator: generates assembly
Week5_Level2LexerParser_11_08_2026/Function.py - TAC generator → AST nodes: walks AST
Week5_Level2LexerParser_11_08_2026/tac_generator.py - TAC generator → Triple representation: builds triples
Week5_Level2LexerParser_11_08_2026/tac_generator.py - Compiler user → Calculator lexer: tries lexer
- Expression parser → Expression lexer: consumes tokens
practice_examples/2_practice_examples_ast/ExprAstParser.py - Compiler user → TAC and MIPS exercises: explores backend
- Later compiler stages → Compiler user: documents roadmap
README.md