pub trait ASTNode {
// Required methods
fn compile<'a>(&'a self, state: &'a SymTable<'a>) -> CompileResult;
fn print_level(&self, level: usize) -> String;
// Provided method
fn prettyprint(&self) -> String { ... }
}
Expand description
Trait for AST nodes.
Required Methods§
Sourcefn compile<'a>(&'a self, state: &'a SymTable<'a>) -> CompileResult
fn compile<'a>(&'a self, state: &'a SymTable<'a>) -> CompileResult
Compile this node to a list of SVM expressions
Sourcefn print_level(&self, level: usize) -> String
fn print_level(&self, level: usize) -> String
Pretty-print this node at the desired indent level
Provided Methods§
Sourcefn prettyprint(&self) -> String
fn prettyprint(&self) -> String
Pretty-print this node to a String.
This should start with this node indented zero spaces, and recursively
walk the tree downward, increasing the indentation level by INDENT
every step.