Internals

This page contains a sketch of the SMOL implementation internals.

Parsing and Typechecking Program Flow

REPL.initInterpreter

smol filename

antlr tree

antlr tree

StaticTable

StaticTable

`-i` argument or REPL `read` command

WhileParser.program

Translate.generateStatic

TypeChecker

Interpreter

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.