Architecture
Architecture
Section titled “Architecture”NXL is divided into several stages:
NXL SOURCE │ ▼┌───────────────┐│ CLI ││ main.rs │└───────┬───────┘ │ ▼┌───────────────┐│ Lexer ││ lexer.rs │└───────┬───────┘ │ ▼ Tokens │ ▼┌───────────────┐│ Parser ││ parser.rs │└───────┬───────┘ │ ▼ AST │ ▼┌───────────────┐│ Interpreter ││interpreter.rs │└───────┬───────┘ │ ┌────┴─────┐ ▼ ▼Environment Runtimeenvironment runtime │ │ └────┬─────┘ ▼ OUTPUTComplete execution pipeline
Section titled “Complete execution pipeline”Suppose the source is:
let age = 23
if age >= 18 { print("Adult")}NXL processes this in stages:
Source Code ↓Lexer ↓Tokens ↓Parser ↓AST ↓Interpreter ↓Environment + Runtime Values ↓OutputEach stage has a focused responsibility.
How everything connects
Section titled “How everything connects”hello.nxl │ source text ▼main.rs │ ▼lexer.rs │ Vec<Token> ▼parser.rs │ Program ▼ast.rs │ ▼interpreter.rs │ ├── environment.rs └── runtime.rs │ ▼stdout