How radimir007/ifj_compiler_2026 works
IFJ2026 is a compiler that reads source from standard input and emits IFJcode26 to standard output. Its main workflow is scanning tokens, parsing declarations and expressions into an AST, semantic analysis, then code generation. The graph also shows the symbol-table layer used for semantic state. The README provides no capability detail; scanner, parser, semantic, and code-generation behavior is based on the supplied source excerpts and index, so unsampled internal calls are omitted where not established.
Main entry points: main.c Compiler driver · parser.c Syntax parser · scanner.c Scanner · expr_parser.c Expression parser
Components 11
Compiler entry
- Compiler driver
src/main.c
Front end
- Scanner
src/scanner.c - Token model
src/token.h - Syntax parser
src/parser.c - Expression parser
src/expr_parser.c - AST
src/ast.c
Semantic analysis
- Semantic analyzer
src/semantic.c - Symbol tables
src/symtable.c
Code generation
- IFJcode26 generator
src/codegen.c
Other components
- Source input
- Generated code
Connections 12
- Source input → Compiler driver: reads stdin
src/main.c - Compiler driver → Scanner: initializes
src/main.c - Syntax parser → Scanner: fetches tokens
src/parser.c - Scanner → Token model: produces
- Syntax parser → Expression parser: parses expressions
src/parser.c - Syntax parser → AST: constructs
src/parser.c - Expression parser → AST: constructs
- Compiler driver → Syntax parser: parses source
src/main.c - Compiler driver → Semantic analyzer: analyzes AST
src/main.c - Semantic analyzer → Symbol tables: uses scopes
- Compiler driver → IFJcode26 generator: generates code
src/main.c - IFJcode26 generator → Generated code: writes code