Class ScopeTreeBuilder
Builds a ScopeTree from a flat set of composed symbols. Placement is structural — a symbol's concrete type, its ParentUri, and its access modifier decide its scope:
- module symbols, project-level precompiler constants, global StaticSymbols, and anything the tree cannot otherwise place → the Global scope;
- a standard module's non-
Privatemembers → the project scope, where sibling modules see them; - every module's members — fields, constants, procedures, properties, enums, user-defined
types, events,
Declares → that module's own scope; - a procedure's parameters and its procedure-local
Dim/Static/Const(and the dynamic array a bareReDimintroduces) → that procedure's scope.
An enum constant is placed in the scope that declares its Enum, since that is where
MS-VBAL §5.2.3.4 makes it accessible — it parents to the enum, not to a scope, so
its placement is resolved through the enum. A user-defined type's fields are reached through member
access rather than lexical scoping, and are not placed at all. Ordering referenced libraries by
their .rdproj priority within the global scope is later work.
public static class ScopeTreeBuilder
- Inheritance
-
ScopeTreeBuilder
- Inherited Members
Methods
Build(IEnumerable<Symbol>)
Builds the scope tree for symbols. Any subset is valid input — a symbol
whose enclosing scope is not in the set is placed in the Global scope.
public static ScopeTree Build(IEnumerable<Symbol> symbols)
Parameters
symbolsIEnumerable<Symbol>