Scope

Models a hierarchy of environments.

Constructors

this
this(Scope parent, ScopeSymbol symbol)

Constructs a Scope.

Members

Functions

classScope
Scope classScope()

Searches for the enclosing Class scope.

enter
Scope enter(ScopeSymbol symbol)

Creates a new inner scope and returns that.

exit
Scope exit()

Destroys this scope and returns the outer scope.

findScope
Scope findScope(SYM sid)

Searches for a scope matching type sid.

lookup
Symbol lookup(Identifier* name)

Finds a symbol in this scope.

moduleScope
Scope moduleScope()

Searches for the enclosing Module scope.

search
Symbol search(Identifier* name)

Searches for a symbol in this scope and all enclosing scopes.

search
Symbol search(Identifier* name, Symbol ignoreSymbol)

Searches for a symbol in this scope and all enclosing scopes.

Variables

parent
Scope parent;

The surrounding scope, or null if this is the root scope.

symbol
ScopeSymbol symbol;

The current symbol with the symbol table.

Meta