This page contains a sketch of the SMOL implementation internals.

Parsing and Typechecking Program Flow

flowchart TB input([ `-i` argument or REPL `read` command]) antlr[[WhileParser.program]] translate[[Translate.generateStatic]] typecheck[TypeChecker] interpret[Interpreter] click antlr "" _blank click translate "" _blank click interpret "" _blank click typecheck "" _blank input-- smol filename -->antlr subgraph REPL.initInterpreter direction TB antlr -- antlr tree -->translate antlr -- antlr tree -->typecheck translate -- StaticTable -->interpret translate -- StaticTable -->typecheck end

The program flow of smol program text inside REPL.initInterpreter

Statement Execution

Executing a smol program is controlled by the REPL class. An Interpreter object keeps track of the execution state, which consists of a stack of StackEntry objects and a GlobalMemory instance, which in turn maps object names to their Memory.

A single statement is executed by the method Interpreter.makeStep.