How bareca/mini works
Mini is a statically typed, indentation-based language compiler: a programmer supplies a .mini program, the compiler parses and checks it, then emits LLVM IR for external tools to turn into a native executable. Its core stages are lexing, parsing/AST construction, semantic analysis, and code generation; the runtime supplies dynamic values and language operations. The README documents these stages and runtime capabilities, while sampled source confirms driver, semantic, codegen, and runtime responsibilities. Lexer and parser implementation details were not sampled, so their links rely on the README’s documented pipeline.
Main entry points: main.c Compiler driver · codegen.c LLVM codegen · semantic.c Semantic analysis · mini.y Parser
Components 12
Front end
- Compiler driver
src/main.c - Lexer
src/mini.l - Parser
src/mini.y - AST model
src/ast.c - Diagnostics
src/diag.c
Analysis and codegen
- Semantic analysis
src/semantic.c - LLVM codegen
src/codegen.c
Runtime and language services
- Runtime support
runtime/rt.c
Other components
- Programmer
- Mini source
- LLVM native tools
- Native executable
Connections 15
- Programmer → Mini source: writes
README.md - Mini source → Compiler driver: supplies input
README.md - Compiler driver → Lexer: scans
src/main.c - Compiler driver → Parser: invokes
src/main.c - Lexer → Parser: provides tokens
README.md - Parser → AST model: builds
README.md - Compiler driver → Semantic analysis: analyzes AST
src/main.c - Semantic analysis → Diagnostics: reports errors
src/semantic.c - Compiler driver → Diagnostics: checks errors
src/main.c - Semantic analysis → LLVM codegen: annotates AST
src/codegen.c - Compiler driver → LLVM codegen: emits IR
src/main.c - LLVM codegen → Runtime support: calls runtime
src/codegen.c - LLVM codegen → LLVM native tools: produces LLVM IR
README.md - Runtime support → LLVM native tools: links into program
README.md - LLVM native tools → Native executable: builds
README.md