How drdoddle/sketch works
Sketch is an early C++ compiler for the Doodle language. Its current workflow reads the fixed test_source.doodle input, lexes and parses it into an AST, performs name resolution and type checking (including overload and named-argument matching), then generates and verifies LLVM IR and writes output.ll. The README also documents using Clang to compile that IR into a native executable. The map focuses on runtime compiler stages; it does not infer connections among unsampled modules.
Main entry points: main.cpp Compiler Driver · codegen.cpp LLVM Code Generator · parser.cpp Recursive-Descent Parser · lexer.cpp Lexer
Components 13
Language Front End
- Lexer
src/lexer.cpp - Token Model
include/token.hpp - Recursive-Descent Parser
src/parser.cpp - AST Model
include/parser.hpp
Semantic Analysis
- Semantic Analyzer
src/semanticanalyzer.cpp
IR Backend
- LLVM Code Generator
src/codegen.cpp - LLVM
- LLVM IR Output
Compiler Driver
- Compiler Driver
src/main.cpp - Doodle Source
test_source.doodle
Other components
- Compiler User
- Clang
- Native Executable
Connections 15
- Compiler User → Compiler Driver: runs
README.md - Compiler Driver → Doodle Source: reads
src/main.cpp - Compiler Driver → Lexer: constructs
src/main.cpp - Recursive-Descent Parser → Lexer: requests tokens
src/parser.cpp - Lexer → Token Model: creates
src/lexer.cpp - Compiler Driver → Recursive-Descent Parser: parses with
src/main.cpp - Recursive-Descent Parser → AST Model: builds
src/parser.cpp - Compiler Driver → Semantic Analyzer: analyzes AST
src/main.cpp - Semantic Analyzer → AST Model: resolves calls
src/semanticanalyzer.cpp - Compiler Driver → LLVM Code Generator: generates IR
src/main.cpp - LLVM Code Generator → AST Model: reads AST
src/codegen.cpp - LLVM Code Generator → LLVM: uses
src/codegen.cpp - LLVM Code Generator → LLVM IR Output: writes
src/codegen.cpp - Clang → LLVM IR Output: compiles
README.md - Clang → Native Executable: produces
README.md