Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // null can be referenced instead of allocating a new object each time we evaluate a node. NULL = &object.Null{} // there will only ever be two variations of object.Booleans, // it is more beneficial to reference them instead of allocating new ones. TRUE = &object.Boolean{Value: true} FALSE = &object.Boolean{Value: false} )
Functions ¶
func Eval ¶
Eval accepts an AST Node and determines the best way to evaluate it. We store the evaluated value in an Object, which can be later referenced. Eval is expected to run recursively, following the "tree-walking pattern". It should traverse the tree (AST), starting with the top-level *ast.Program, going into all its statements and evaluating each one. It traverses each Statement, evaluating its own nodes. This will lead to evaluating the actual Expression Nodes, where the Value of the node can be consumed and stored in an Object.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.