How r4351546-source/tk-language works
TK-Language is an in-development compiler. Its documented user-to-result workflow loads source, tokenizes it, parses an AST, performs semantic and memory-safety analysis, then builds an intermediate representation. The graph also preserves the README’s planned resource limits, function phases, object data structures, and code-generation stage. Edges between compiler stages follow the documented pipeline; source excerpts chiefly show the Safetifier memory-state model, so finer internal call relationships are not inferred.
Main entry points: parser.cxx Parser · source_loader.cxx Source loader · lexer.cxx Lexer · analyzer.cxx Semantic analyzer
Components 20
Source loading
- Source loader
file/source_loader.cxx - File handling
file/file.cxx
Semantic analysis
- Semantic analyzer
semantic/analyzer/analyzer.cxx - Type system
semantic/Type/type.cxx - Symbols
semantic/symbol/symbol.cxx - Symbol table
semantic/symboltable/smb.cxx
Safety analysis
- Memory state
safetifier/state/memory_state.h - Allocation operations
safetifier/state/allocation.cxx - Pointer tracking
safetifier/state/pointer.cpp - State merger
safetifier/state/memory_state_merging.cpp
Intermediate representation
- IR builder
ir/ir.cxx - IR memory ops
ir/allocfree.cxx
Planned systems
- Limits
- Temp phases
- Object structures
- Code generation
Other components
- Programmer
Connections 8
- Programmer → Source loader: provides source
README.md - Source loader → Lexer: loads before
README.md - Lexer → Parser: tokenizes for
README.md - Parser → AST: builds
README.md - Parser → Semantic analyzer: validates after
README.md - Semantic analyzer → Memory state: analyzes after
README.md - Memory state → IR builder: precedes
README.md - IR builder → Code generation: planned output
README.md