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
Actions Documentation
Add(Libraries.Language.Compile.Symbol.Class clazz)
Returns whether the symbol table has any
Parameters
Return
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.
Parameters
- Libraries.Language.Object: The object to compare to.
Return
integer: The Compare result, Smaller, Equal, or Larger.
Example
Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
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
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.
Parameters
- Libraries.Language.Object: The to be compared.
Return
boolean: True if the hash codes are equal and false if they are not equal.
Example
use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
GetClass(text key)
Returns a class with the corresponding unique static key.
Parameters
- text key
Return
GetClassByName(text name)
This action returns an array of all classes that have a particular name regardless of their static key.
Parameters
- text name
Return
GetClassInFile(text fileKey)
This action returns the first class in the file with the designated key.
Parameters
- text fileKey
Return
GetClassInPackage(text packageKey, text name)
finally, since it is unique, add it to the list of class names
Parameters
- text packageKey
- text name
Return
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
GetClassesInPackage(text packageKey)
Returns all classes in a particular package.
Parameters
- text packageKey
Return
GetClassesSortedInPackage(text packageKey)
This action returns an array of classes in a particular subpackage sorted by their static keys.
Parameters
- text packageKey
Return
GetFileSize()
Returns the number of files in the symbol table.
Return
integer:
GetHashCode()
This action gets the hash code for an object.
Return
integer: The integer hash code of the object.
Example
Object o
integer hash = o:GetHashCode()
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
GetPackageSize()
Returns the number of packages in the symbol table.
Return
integer:
GetPackages()
GetPackagesSorted()
GetPackagesSortedIterator()
This action returns an array of classes in a particular subpackage sorted by their static keys.
Return
GetSubpackageNames(text parentPackage)
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
- text key
Return
boolean:
HasFile(text absolutePath)
Returns whether or not the symbol table has a file
Parameters
- text absolutePath
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
- text key
RemoveFile(text absolutePath)
Removes a file, and any associated classes, from the system.
Parameters
- text absolutePath
SetLibrary(Libraries.Language.Compile.Library library)
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.
Parameters
On this page
Variables TableAction Documentation- Add(Libraries.Language.Compile.Symbol.Class clazz)
- Compare(Libraries.Language.Object object)
- Copy()
- Empty()
- Equals(Libraries.Language.Object object)
- GetClass(text key)
- GetClassByName(text name)
- GetClassInFile(text fileKey)
- GetClassInPackage(text packageKey, text name)
- GetClassSize()
- GetClasses()
- GetClassesInPackage(text packageKey)
- GetClassesSortedInPackage(text packageKey)
- GetFileSize()
- GetHashCode()
- GetLibrary()
- GetPackageSize()
- GetPackages()
- GetPackagesSorted()
- GetPackagesSortedIterator()
- GetSubpackageNames(text parentPackage)
- HasClass(text key)
- HasFile(text absolutePath)
- HasLibrary()
- IsEmpty()
- RemoveClass(text key)
- RemoveFile(text absolutePath)
- SetLibrary(Libraries.Language.Compile.Library library)
- SetTo(Libraries.Language.Compile.Symbol.SymbolTable table)