Class LibrarySymbolReader
Reads the symbols that libraries declare off their descriptions (LibraryDescription), as StdLibSymbolReader reads those of the standard library off its declarations.
public sealed class LibrarySymbolReader
- Inheritance
-
LibrarySymbolReader
- Inherited Members
Remarks
A library is a project of its own, named for the library, and everything it declares says which (Library): that is what lets
Excel.Worksheet name the library's class and nothing else of the name, and what keeps one library's types from standing in for another's. What it
declares is a class module for each class, with its members and events, and for each enumeration a symbol and a constant for each member. The enumerations
hang off a synthetic module of the library that no source can name (_Excel), which is what makes both the enumeration and its constants names of
the project (MS-VBAL §5.2.3.4), as the standard library's are.
A member's code is not the workspace's, so none of it has an instruction list: each carries the key of what it stands for
(ExternalTarget), Library.Class.Member/kind with the kind one of method, get, let and set,
and a call to it is dispatched to whatever can reach the library.
The types of a library name one another - a worksheet has ranges, and a range has a worksheet - so a class cannot always be read after every class it names. A class is read after those it names whenever it can be, and where two name each other the one that is read second names the first as a type that is resolved by its name when it is used (VBUnresolvedType), as a workspace's classes that name one another are.
Constructors
LibrarySymbolReader(Uri, bool)
Reads the symbols that libraries declare off their descriptions (LibraryDescription), as StdLibSymbolReader reads those of the standard library off its declarations.
public LibrarySymbolReader(Uri workspaceRoot, bool is64Bit = true)
Parameters
workspaceRootUriThe workspace the symbols are addressed under. Library symbols are not of the workspace, but every Symbol is addressed relative to one, so they share its root.
is64BitboolThe pointer width of the environment:
LongPtris a different type in each.
Remarks
A library is a project of its own, named for the library, and everything it declares says which (Library): that is what lets
Excel.Worksheet name the library's class and nothing else of the name, and what keeps one library's types from standing in for another's. What it
declares is a class module for each class, with its members and events, and for each enumeration a symbol and a constant for each member. The enumerations
hang off a synthetic module of the library that no source can name (_Excel), which is what makes both the enumeration and its constants names of
the project (MS-VBAL §5.2.3.4), as the standard library's are.
A member's code is not the workspace's, so none of it has an instruction list: each carries the key of what it stands for
(ExternalTarget), Library.Class.Member/kind with the kind one of method, get, let and set,
and a call to it is dispatched to whatever can reach the library.
The types of a library name one another - a worksheet has ranges, and a range has a worksheet - so a class cannot always be read after every class it names. A class is read after those it names whenever it can be, and where two name each other the one that is read second names the first as a type that is resolved by its name when it is used (VBUnresolvedType), as a workspace's classes that name one another are.
Methods
ExternalTargetOf(LibraryDescription, ClassDescription, MemberDescription)
The key a member of a library class carries as ExternalTarget: Library.Class.Member/kind, with the kind one of
method, get, let and set.
public static string ExternalTargetOf(LibraryDescription library, ClassDescription owner, MemberDescription member)
Parameters
libraryLibraryDescriptionThe library.
ownerClassDescriptionThe class.
memberMemberDescriptionThe member.
Returns
Remarks
The reader defines the format because the reader stamps it, as the standard library's does: a dispatcher that built its own key could disagree with this one and nothing would say so until a call went to the wrong member. The kind is part of it because the accessors of a property share a name.
Read(IReadOnlyList<LibraryDescription>, IReadOnlyDictionary<string, int>?)
Reads the symbols of libraries.
public ImmutableArray<Symbol> Read(IReadOnlyList<LibraryDescription> libraries, IReadOnlyDictionary<string, int>? priorities = null)
Parameters
librariesIReadOnlyList<LibraryDescription>The libraries, each after those it depends on (Libraries).
prioritiesIReadOnlyDictionary<string, int>The precedence of each library (Priorities), which every symbol that is a name of the project carries (LibraryPriority). The position of a library among the others when omitted.