Libraries.Language.Compile.Symbol.SymbolTable Documentation
Ths SymbolTable class stores all pertinent information about a compile as it goes. It allows for querying of various kinds and stores only the information in its transitive dependency graph. However, in some instances, like in the use of IDE usage, a symbol table may contain a second table, called a standard library cache. This cache contains classes that are not used in the compile, but that are available to the compiler for use. This is useful for things like editor hints.
Inherits from: Libraries.Language.Object
Summary
Actions Summary Table
Actions | Description |
---|---|
Add(Libraries.Language.Compile.Symbol.Class clazz) | Returns whether the symbol table has any |
Compare(Libraries.Language.Object object) | This action compares two object hash codes and returns an integer. |
Copy() | This action returns a copy of the symbol table. |
Empty() | This action gathers all of the classes from the table variable and puts them into this symbol table, clearing out the table before starting. |
Equals(Libraries.Language.Object object) | This action determines if two objects are equal based on their hash code values. |
GetClass(text key) | Returns a class with the corresponding unique static key. |
GetClassByName(text name) | This action returns an array of all classes that have a particular name regardless of their static key. |
GetClassInFile(text fileKey) | This action returns the first class in the file with the designated key. |
GetClassInPackage(text packageKey, text name) | finally, since it is unique, add it to the list of class names |
GetClassSize() | Returns the number of classes in the symbol table. |
GetClasses() | This action returns a copy of the symbol table. |
GetClassesInPackage(text packageKey) | Returns all classes in a particular package. |
GetClassesSortedInPackage(text packageKey) | This action returns an array of classes in a particular subpackage sorted by their static keys. |
GetFileSize() | Returns the number of files in the symbol table. |
GetHashCode() | This action gets the hash code for an object. |
GetLibrary() | This stores the standard library cache. |
GetPackageSize() | Returns the number of packages in the symbol table. |
GetPackages() | Returns an iterator of all loaded packages. |
GetPackagesSorted() | Returns an iterator of all loaded packages. |
GetPackagesSortedIterator() | This action returns an array of classes in a particular subpackage sorted by their static keys. |
GetSubpackageNames(text parentPackage) | create one |
HasClass(text key) | Returns whether or not a class exists in the symbol table. |
HasFile(text absolutePath) | Returns whether or not the symbol table has a file |
HasLibrary() | This stores whether or not a standard library cache exists. |
IsEmpty() | Returns whether the symbol table has any |
RemoveClass(text key) | Removes a class with a static key from the symbol table. |
RemoveFile(text absolutePath) | Removes a file, and any associated classes, from the system. |
SetLibrary(Libraries.Language.Compile.Library library) | This action sets the standard library cache. |
SetTo(Libraries.Language.Compile.Symbol.SymbolTable table) | This action gathers all of the classes from the table variable and puts them into this symbol table, clearing out the table before starting. |
Actions Documentation
Add(Libraries.Language.Compile.Symbol.Class clazz)
Returns whether the symbol table has any
Parameters
Return
Libraries.Language.Compile.CompilerError:
Compare(Libraries.Language.Object object)
This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.
Example Code
Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
Parameters
- Libraries.Language.Object: The object to compare to.
Return
integer: The Compare result, Smaller, Equal, or Larger.
Copy()
This action returns a copy of the symbol table. Each class object inside of the table is a shallow copy of the original.
Return
Libraries.Language.Compile.Symbol.SymbolTable:
Empty()
This action gathers all of the classes from the table variable and puts them into this symbol table, clearing out the table before starting. This action only copies the classes.
Equals(Libraries.Language.Object object)
This action determines if two objects are equal based on their hash code values.
Example Code
use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
Parameters
- Libraries.Language.Object: The to be compared.
Return
boolean: True if the hash codes are equal and false if they are not equal.
GetClass(text key)
Returns a class with the corresponding unique static key.
Parameters
Return
Libraries.Language.Compile.Symbol.Class:
GetClassByName(text name)
This action returns an array of all classes that have a particular name regardless of their static key.
Parameters
Return
Libraries.Containers.Iterator:
GetClassInFile(text fileKey)
This action returns the first class in the file with the designated key.
Parameters
Return
Libraries.Language.Compile.Symbol.Class:
GetClassInPackage(text packageKey, text name)
finally, since it is unique, add it to the list of class names
Parameters
Return
Libraries.Language.Compile.Symbol.Class:
GetClassSize()
Returns the number of classes in the symbol table.
Return
integer:
GetClasses()
This action returns a copy of the symbol table. Each class object inside of the table is a shallow copy of the original.
Return
Libraries.Containers.Iterator:
GetClassesInPackage(text packageKey)
Returns all classes in a particular package.
Parameters
Return
Libraries.Containers.Iterator:
GetClassesSortedInPackage(text packageKey)
This action returns an array of classes in a particular subpackage sorted by their static keys.
Parameters
Return
GetFileSize()
Returns the number of files in the symbol table.
Return
integer:
GetHashCode()
This action gets the hash code for an object.
Example Code
Object o
integer hash = o:GetHashCode()
Return
integer: The integer hash code of the object.
GetLibrary()
This stores the standard library cache. It contains any classes available to the system, regardless of whether they available in the current compile.
Return
Libraries.Language.Compile.Library:
GetPackageSize()
Returns the number of packages in the symbol table.
Return
integer:
GetPackages()
Returns an iterator of all loaded packages.
Return
Libraries.Containers.Iterator:
GetPackagesSorted()
Returns an iterator of all loaded packages.
Return
GetPackagesSortedIterator()
This action returns an array of classes in a particular subpackage sorted by their static keys.
Return
Libraries.Containers.Iterator:
GetSubpackageNames(text parentPackage)
create one
Parameters
Return
Libraries.Containers.Iterator:
HasClass(text key)
Returns whether or not a class exists in the symbol table. The key passed must be the full static key (i.e., Libraries.Language.Object, not Object).
Parameters
Return
boolean:
HasFile(text absolutePath)
Returns whether or not the symbol table has a file
Parameters
Return
boolean:
HasLibrary()
This stores whether or not a standard library cache exists. There are good reasons why a cache may not exist. For example, if this symbol table is a cache, it won't have another one. Further, if scanning is turned off, then no cache will exist.
Return
boolean:
IsEmpty()
Returns whether the symbol table has any
Return
boolean:
RemoveClass(text key)
Removes a class with a static key from the symbol table.
Parameters
RemoveFile(text absolutePath)
Removes a file, and any associated classes, from the system.
Parameters
SetLibrary(Libraries.Language.Compile.Library library)
This action sets the standard library cache.
Parameters
SetTo(Libraries.Language.Compile.Symbol.SymbolTable table)
This action gathers all of the classes from the table variable and puts them into this symbol table, clearing out the table before starting. This action only copies the classes.