SemanticScope

A Scope class with added semantic information. (May be merged together with class Scope in the future.)

Constructors

this
this(Module modul)

Constructs a SemanticScope object.

Members

Functions

insert
void insert(Symbol symbol)

Inserts a symbol into the current scope.

insert
void insert(Symbol symbol, Identifier* name)

Inserts a symbol into the current scope.

insert
void insert(Symbol symbol, ScopeSymbol scopeSym)

Inserts a symbol into scopeSym.

insertOverload
void insertOverload(Symbol sym)

Inserts a symbol, overloading on the name, into the current scope.

isModuleScope
bool isModuleScope()

Returns true if this is the module scope.

reportSymbolConflict
void reportSymbolConflict(Symbol s1, Symbol s2, Identifier* name)

Reports an error: new symbol s1 conflicts with existing symbol s2.

search
Symbol search(Token* idTok)

Searches for a symbol.

symbol
ScopeSymbol symbol()

Returns the ScopeSymbol of this scope (class/function/etc.)

Static variables

emptyIdScope
ScopeSymbol emptyIdScope;

This object is assigned to idScope when a symbol lookup returned no valid symbol.

Variables

idScope
ScopeSymbol idScope;

The current scope symbol to use for looking up identifiers.

ignoreSymbol
Symbol ignoreSymbol;

The symbol that must be ignored and skipped during a symbol search.

modul
Module modul;

The module to be semantically checked.

reportUndefinedIds
bool reportUndefinedIds;

Error messages are reported for undefined identifiers if true.

rootIdNode
Node rootIdNode;

The root of the Identifier tree.

scop
Scope scop;

The current basic scope.

undefinedIdsCount
uint undefinedIdsCount;

Incremented when an undefined identifier was found.

Meta