ScopeSymbol

A symbol that has its own scope with a symbol table.

Constructors

this
this(SYM sid, Identifier* name, SLoc loc)

Constructs a ScopeSymbol object.

this
this(Identifier* name = Ident.Empty, SLoc loc = SLoc.init)

Constructs a ScopeSymbol object with the SYM.Scope ID.

Members

Functions

insert
void insert(Symbol s, Identifier* name)

Inserts a symbol into the table.

lookup
Symbol lookup(Identifier* name)

Looks up name in the table.

lookup
Symbol lookup(hash_t hash)

Looks up a symbol in the table using its string hash.

Variables

members
Symbol[] members;

The member symbols (in lexical order.)

symbolTable
SymbolTable symbolTable;

The symbol table.

Inherited Members

From Symbol

sid
SYM sid;

The ID of this symbol.

status
Status status;

The semantic status of this symbol.

parent
Symbol parent;

The parent this symbol belongs to.

name
Identifier* name;

The name of this symbol. If the symbol is nameless Ident.Empty is assigned to it.

loc
SLoc loc;

For locating a symbol.

setCompleting
void setCompleting()

Change the status to Status.Completing.

setComplete
void setComplete()

Change the status to Status.Complete.

isCompleting
bool isCompleting()

Returns true if the symbol is being completed.

isComplete
bool isComplete()

Returns true if the symbols is complete.

to
Class to()

Casts the symbol to Class.

getFQN
cstring getFQN()
getModule
Symbol getModule()

Returns the module this symbol belongs to or null if orphaned.

getType
Object getType()

Returns the type of this symbol or null if inexistent. The return type is Object to avoid circular imports.

toMangle
cstring toMangle()

Returns the mangled name of this symbol.

toString
string toString()

Returns the string representation of this symbol.

Meta