Plot Script
|
Class to parse and evaluate an expression (program) More...
#include <interpreter.hpp>
Public Member Functions | |
bool | parseStream (std::istream &expression) noexcept |
Expression | evaluate () |
Class to parse and evaluate an expression (program)
Interpreter has an Environment, which starts at a default. The parse method builds an internal AST. The eval method updates Environment and returns last result.
Expression Interpreter::evaluate | ( | ) |
Evaluate the Expression by walking the tree, returning the result.
SemanticError | when a semantic error is encountered |
|
noexcept |
Parse into an internal Expression from a stream
expression | the raw text stream repreenting the candidate expression |