How n0067h/astron works
Astron is a space-themed programming language delivered as a command-line interpreter. A user supplies a program file and may select a launch; the CLI loads and merges imported files, then checks and executes the program, reporting load, type, or runtime errors. Its implementation separates tokenization, parsing into a shared AST, static checking, and interpretation. The excerpts establish the checker and interpreter calls from the CLI; lexer/parser call wiring is less directly visible, so those edges are marked unverified.
Main entry points: main.rs CLI and loader · ast.rs Program AST · parser.rs Parser · lexer.rs Tokenizer
Components 9
CLI and loading
- CLI and loader
src/main.rs
Language frontend
- Tokenizer
src/lexer.rs - Token model
src/token.rs - Parser
src/parser.rs - Program AST
src/ast.rs
Validation
- Type checker
src/checker.rs
Execution
- Interpreter
src/interpreter.rs
Other components
- Program author
- CLI output
Connections 12
- Program author → CLI and loader: provides file
README.md - CLI and loader → Tokenizer: tokenizes
src/main.rs - Tokenizer → Token model: creates tokens
src/lexer.rs - Parser → Token model: consumes tokens
src/parser.rs - Parser → Program AST: builds AST
src/parser.rs - CLI and loader → Parser: parses files
src/main.rs - CLI and loader → Program AST: merges imports
src/main.rs - CLI and loader → Type checker: checks program
src/main.rs - Type checker → Program AST: validates
src/checker.rs - CLI and loader → Interpreter: runs program
src/main.rs - Interpreter → Program AST: evaluates
src/interpreter.rs - CLI and loader → CLI output: reports results
src/main.rs