LLVM

Flattening the AST

April 11, 2025
QLogo, Code, Compiler
LLVM, Compiler, Logo Programming, Tree-Walking Interpreter

Limitations of the Tree-Walk Interpreter # QLogo was implemented as a tree-walk interpreter. What this means is that the execution happens by traversing the AST nodes and performing the corresponding operations for each node. For example, this code: PRINT 2 + 3 * FN :A Generates this tree: So, using a tree-walk interpreter in this example would generate three nested subroutine calls from the call to PRINT to the call to FN :A. ...