SemanticPass1

The first pass is the declaration pass.

The basic task of this class is to traverse the parse tree, find all kinds of declarations and add them to the symbol tables of their respective scopes.

Constructors

this
this(Module modul, CompilationContext context)

Constructs a SemanticPass1 object.

Members

Classes

Deferred
class Deferred

Collects info about nodes which have to be evaluated later.

Functions

addDeferred
void addDeferred(Node node)

Adds a deferred node to the list.

enterScope
void enterScope(ScopeSymbol s)

Enters a new scope.

error
void error(Token* token, MID mid, ...)

Creates an error report.

exitScope
void exitScope()

Exits the current scope.

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.

run
void run()

Starts processing the module.

Variables

alignSize
uint alignSize;

Current align size.

context
CompilationContext context;

The compilation context.

deferred
Deferred[] deferred;

List of mixin, static if, static assert and pragma(msg,...) declarations.

importModule
Module delegate(cstring) importModule;

Called when importing a module.

linkageType
LinkageType linkageType;

Current linkage type.

modul
Module modul;

The module to be semantically checked.

protection
Protection protection;

Current protection attribute.

scop
Scope scop;

The current scope.

storageClass
StorageClass storageClass;

Current storage classes.

Inherited Members

From Visitor

dispatch
Node dispatch(Node n)

Calls the appropriate visit() method for a node.

dispatch
Node dispatch(Node n, NodeKind k)

Allows calling the visit() method with a null node.

unhandled
Node unhandled(Node n)

Called by visit() methods that were not overridden.

Meta