The context model keeps track of all known variables and functions.

It is structured hierarchically to offer nested scopes.

Constructors

ContextModel()

Creates a new, empty root context model.

Properties

functions → Set<MathFunction>

Function set of this scope.

read / write
hashCode → int

Get a hash code for this object.

read-only, inherited
parentScope ContextModel

The parent scope.

read / write
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited
variables → Map<String, Expression>

Variable map of this scope (name -> expression).

read / write

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

bindFunction(MathFunction f) → void

Binds a function to this context.

bindVariable(Variable v, Expression e) → void

Binds a variable to an expression in this context.

bindVariableName(String vName, Expression e) → void

Binds a variable name to an expression in this context.

createChildScope() ContextModel

Returns a new child scope of this scope.

getExpression(String varName) Expression

Returns the bound expression for the given variable. Performs recursive lookup through parentScope.

getFunction(String name) MathFunction

Returns the function for the given function name. Performs recursive lookup through parentScope.

noSuchMethod(Invocation invocation) → dynamic

noSuchMethod is invoked when users invoke a non-existent method on an object. The name of the method and the arguments of the invocation are passed to noSuchMethod in an Invocation. If noSuchMethod returns a value, that value becomes the result of the original invocation.

inherited
toString() → String

Returns a string representation of this object.