Environment class final

An environment containing variables.

An environment can belong to another enclosing environment, which will be considered when looking for a variable.

Constructors

Environment.new({Environment? enclosing})
Creates an environment.

Properties

enclosing Environment?
The enclosing environment.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

ancestor(int distance) Environment
Gets the nᵗʰ ancestor environment, according to distance.
assign(Token name, Object? value) → void
Sets the value for name in the environment.
assignAt(int distance, Token name, Object? value) → void
Sets name to value in the nᵗʰ ancestor, according to distance.
define(String name, Object? value) → void
Defines a name in the environment with the passed value.
get(Token name) Object?
Get a variable with the given name in the environment.
getAt(int distance, String name) Object?
Gets name in the nᵗʰ ancestor, according to distance.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited