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

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.

Parameters

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

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.

Parameters

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

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

  • text name

Return

Libraries.Containers.Iterator:

GetClassInFile(text fileKey)

This action returns the first class in the file with the designated key.

Parameters

  • text fileKey

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

  • text packageKey
  • text name

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

  • text packageKey

Return

Libraries.Containers.Iterator:

GetClassesSortedInPackage(text packageKey)

This action returns an array of classes in a particular subpackage sorted by their static keys.

Parameters

  • text packageKey

Return

Libraries.Containers.Array:

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

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

Libraries.Containers.Array:

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

  • text parentPackage

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

  • 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)

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.

Parameters