Class DeclarationStaticSemanticsEvaluator
The static semantics of what a module declares, apart from what its procedures' bodies say: the declarations themselves.
public static class DeclarationStaticSemanticsEvaluator
- Inheritance
-
DeclarationStaticSemanticsEvaluator
- Inherited Members
Remarks
A module whose every procedure is valid is not a valid module: a name declared twice, an event that is wrong, an interface that is not implemented are all errors of a declaration, which no body shows. They are found here, once for the module, and a module model holds them next to the models of its procedures (DeclarationErrors).
- A name is declared once in the scope of a module (MS-VBAL §5.2, DuplicateDeclaration). The
Get,LetandSetaccessors of a property are the one declaration of it. - A declared type is a name that resolves to a type (UserDefinedTypeNotDefined): of a variable, a constant, a parameter, a function's or a property's result, and a local. Whether it does can only be told once everything the declaration can see is defined, which is why this rule is one a caller asks for (DeclaredTypes).
- A class module is also checked for what it declares about events (ClassModuleEventSemantics) and for what its
Implementsdirectives require (ImplementsSemantics).
Methods
Evaluate(Symbol, IReadOnlyList<VBTypeMemberSymbol>, ISymbolResolver, DeclarationRules)
Checks everything module declares.
public static ImmutableArray<VBCompileErrorInfo> Evaluate(Symbol module, IReadOnlyList<VBTypeMemberSymbol> members, ISymbolResolver resolver, DeclarationRules rules = DeclarationRules.Default)
Parameters
moduleSymbolThe module, as the session or the workspace composed it: a class module with its members.
membersIReadOnlyList<VBTypeMemberSymbol>The members declared by the module (MembersOf(Uri)).
resolverISymbolResolverWhat finds the classes the module's declarations name, as they are now.
rulesDeclarationRulesWhich of the rules that depend on what else is defined are checked.
Returns
- ImmutableArray<VBCompileErrorInfo>
Every error found, in declaration order within each rule; empty when the declarations are valid.