Tables (API documentation of hlt.language packages)
Date: 2013-01-30

hlt.language.design.types

## Class Tables

- java.lang.Object
- - hlt.language.design.types.Tables

-     public class Tables
      extends java.lang.Object

  This class encapsulates the tables in which defined symbols and declared types are registered.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Tables()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` This clears all definitions from all (symbol and type) tables.
    `ClassType` | `declareClass(java.lang.String name, java.util.AbstractList members, java.util.AbstractList types, java.util.AbstractList fieldInits, java.util.AbstractList typeParameters)`
    `void` | `defineBuiltIn(java.lang.String name, Type[] domains, Type range, Instruction builtin)`
    `void` | `defineBuiltIn(java.lang.String name, Type type, Instruction builtin)`
    `void` | `defineBuiltIn(java.lang.String name, Type domain, Type range, Instruction builtin)`
    `void` | `defineBuiltIn(java.lang.String name, Type domain1, Type domain2, Type range, Instruction builtin)`
    `void` | `defineBuiltIn(java.lang.String name, Type domain1, Type domain2, Type domain3, Type range, Instruction builtin)`
    `void` | `defineBuiltIn(Symbol symbol, Type[] domains, Type range, Instruction builtin)`
    `void` | `defineBuiltIn(Symbol symbol, Type type, Instruction builtin)`
    `void` | `defineBuiltIn(Symbol symbol, Type domain, Type range, Instruction builtin)`
    `void` | `defineBuiltIn(Symbol symbol, Type domain1, Type domain2, Type range, Instruction builtin)`
    `void` | `defineBuiltIn(Symbol symbol, Type domain1, Type domain2, Type domain3, Type range, Instruction builtin)`
    `TypeDefinition` | `defineBuiltinNewType(java.lang.String name, Type definition)` Registers a builtin new opaque type definition for the specified name with the given type.
    `TypeDefinition` | `defineBuiltinNewType(java.lang.String name, Type definition, java.util.AbstractList parameters)` Registers a builtin new opaque type definition for the specified name with the given type and parameters.
    `TypeDefinition` | `defineBuiltinTypeAlias(java.lang.String name, Type definition)` Registers a builtin type alias definition for the specified name with the given type.
    `TypeDefinition` | `defineBuiltinTypeAlias(java.lang.String name, Type definition, java.util.AbstractList parameters)` Registers a builtin type alias definition for the specified name with the given type and parameters.
    `Symbol` | `defineEqualitySymbol(java.lang.String equality)`
    `TypeDefinition` | `defineNewType(java.lang.String name, Type definition)` Registers a new (opaque) type definition for the specified name with the given type.
    `TypeDefinition` | `defineNewType(java.lang.String name, Type definition, java.util.AbstractList parameters)` Registers a new (opaque) type definition for the specified name with the given type and the list of type parameters.
    `TypeDefinition` | `defineTypeAlias(java.lang.String name, Type definition)` Registers a type alias definition for the specified name with the given type.
    `TypeDefinition` | `defineTypeAlias(java.lang.String name, Type definition, java.util.AbstractList parameters)` Registers a type alias definition for the specified name with the given type and the list of type parameters.
    `Global` | `equality()`
    `Symbol` | `equalitySymbol()`
    `Type` | `getDefinedType(java.lang.String name)` Returns the already defined type with the specified name from the type table.
    `Type` | `getType(java.lang.String name)` Returns the type defined with the specified name in the type table; or, if no type is defined with this name, a new registered undeclared class type with this name.
    `Type` | `getType(java.lang.String name, java.util.AbstractList types)` Returns the type defined with the specified name in the type table instantiated with the given types.
    `Global` | `in()`
    `boolean` | `isDefined(java.lang.String name)` Returns `true` iff the specified name is that of a defined symbol.
    `boolean` | `isDefinedScalar(java.lang.String name)` Returns `true` iff the specified name is that of a defined symbol with at least one non-functional type.
    `boolean` | `isEquality(java.lang.String name)`
    `void` | `reset()` This resets the (symbol and type) tables, erasing all definitions except for the built-ins.
    `void` | `setInSymbol(java.lang.String symbol)`
    `void` | `showDefined()` This lists all the defined symbol in the (random) order of the symbol table's iterator.
    `void` | `showOrderedSymbols()` This lists all the defined symbol in the order in which they have been defined.
    `void` | `showSortedSymbols()` This lists all the defined symbol in lexicographic order.
    `void` | `showSymbols()`
    `void` | `showTypes()` Shows the declared classes.
    `Symbol` | `symbol(java.lang.String name)`
    `Symbol` | `symbol(java.lang.String name, boolean flag)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Tables

          public Tables()

  - ### Method Detail

    - #### isEquality

          public final boolean isEquality(java.lang.String name)
                                   throws UndefinedEqualityException

      Throws:
        `UndefinedEqualityException`

    - #### defineEqualitySymbol

          public final Symbol defineEqualitySymbol(java.lang.String equality)

    - #### equalitySymbol

          public final Symbol equalitySymbol()
                                      throws UndefinedEqualityException

      Throws:
        `UndefinedEqualityException`

    - #### equality

          public final Global equality()
                                throws UndefinedEqualityException

      Throws:
        `UndefinedEqualityException`

    - #### in

          public final Global in()

    - #### setInSymbol

          public final void setInSymbol(java.lang.String symbol)

    - #### clear

          public final void clear()

      This clears all definitions from all (symbol and type) tables.

    - #### reset

          public final void reset()

      This resets the (symbol and type) tables, erasing all definitions except for the built-ins.

    - #### symbol

          public final Symbol symbol(java.lang.String name)

    - #### symbol

          public final Symbol symbol(java.lang.String name,
                      boolean flag)

    - #### isDefined

          public final boolean isDefined(java.lang.String name)

      Returns `true` iff the specified name is that of a defined symbol.

    - #### isDefinedScalar

          public final boolean isDefinedScalar(java.lang.String name)

      Returns `true` iff the specified name is that of a defined symbol with at least one non-functional type.

    - #### showSymbols

          public final void showSymbols()

    - #### showSortedSymbols

          public final void showSortedSymbols()

      This lists all the defined symbol in lexicographic order.

    - #### showOrderedSymbols

          public final void showOrderedSymbols()

      This lists all the defined symbol in the order in which they have been defined.

    - #### showDefined

          public final void showDefined()

      This lists all the defined symbol in the (random) order of the symbol table's iterator.

    - #### declareClass

          public final ClassType declareClass(java.lang.String name,
                               java.util.AbstractList members,
                               java.util.AbstractList types,
                               java.util.AbstractList fieldInits,
                               java.util.AbstractList typeParameters)
                                       throws ClassDeclarationException

      Throws:
        `ClassDeclarationException`

    - #### defineTypeAlias

          public final TypeDefinition defineTypeAlias(java.lang.String name,
                                       Type definition)
                                               throws TypeDefinitionException

      Registers a type alias definition for the specified name with the given type.
      Throws:
        `TypeDefinitionException`

    - #### defineTypeAlias

          public final TypeDefinition defineTypeAlias(java.lang.String name,
                                       Type definition,
                                       java.util.AbstractList parameters)
                                               throws TypeDefinitionException

      Registers a type alias definition for the specified name with the given type and the list of type parameters.
      Throws:
        `TypeDefinitionException`

    - #### defineBuiltinTypeAlias

          public final TypeDefinition defineBuiltinTypeAlias(java.lang.String name,
                                              Type definition)
                                                      throws TypeDefinitionException

      Registers a builtin type alias definition for the specified name with the given type.
      Throws:
        `TypeDefinitionException`

    - #### defineBuiltinTypeAlias

          public final TypeDefinition defineBuiltinTypeAlias(java.lang.String name,
                                              Type definition,
                                              java.util.AbstractList parameters)
                                                      throws TypeDefinitionException

      Registers a builtin type alias definition for the specified name with the given type and parameters.
      Throws:
        `TypeDefinitionException`

    - #### defineNewType

          public final TypeDefinition defineNewType(java.lang.String name,
                                     Type definition)
                                             throws TypeDefinitionException

      Registers a new (opaque) type definition for the specified name with the given type.
      Throws:
        `TypeDefinitionException`

    - #### defineNewType

          public final TypeDefinition defineNewType(java.lang.String name,
                                     Type definition,
                                     java.util.AbstractList parameters)
                                             throws TypeDefinitionException

      Registers a new (opaque) type definition for the specified name with the given type and the list of type parameters.
      Throws:
        `TypeDefinitionException`

    - #### defineBuiltinNewType

          public final TypeDefinition defineBuiltinNewType(java.lang.String name,
                                            Type definition)
                                                    throws TypeDefinitionException

      Registers a builtin new opaque type definition for the specified name with the given type.
      Throws:
        `TypeDefinitionException`

    - #### defineBuiltinNewType

          public final TypeDefinition defineBuiltinNewType(java.lang.String name,
                                            Type definition,
                                            java.util.AbstractList parameters)
                                                    throws TypeDefinitionException

      Registers a builtin new opaque type definition for the specified name with the given type and parameters.
      Throws:
        `TypeDefinitionException`

    - #### getDefinedType

          public final Type getDefinedType(java.lang.String name)

      Returns the already defined type with the specified name from the type table. NB: returns `null` if no type is defined for this name.

    - #### getType

          public final Type getType(java.lang.String name)

      Returns the type defined with the specified name in the type table; or, if no type is defined with this name, a new registered undeclared class type with this name.

    - #### getType

          public final Type getType(java.lang.String name,
                     java.util.AbstractList types)
                             throws StaticSemanticsErrorException

      Returns the type defined with the specified name in the type table instantiated with the given types. If no type is declared with this name, this will return an instance of a new undeclared class type and register it as a definition for this name. If the number of types specified is not the same as the expected arity, a `StaticSemanticsErrorException` is thrown.
      Throws:
        `StaticSemanticsErrorException`

    - #### showTypes

          public final void showTypes()

      Shows the declared classes.

    - #### defineBuiltIn

          public final void defineBuiltIn(Symbol symbol,
                           Type type,
                           Instruction builtin)
                                   throws DuplicateCodeEntryException

      Throws:
        `DuplicateCodeEntryException`

    - #### defineBuiltIn

          public final void defineBuiltIn(java.lang.String name,
                           Type type,
                           Instruction builtin)
                                   throws DuplicateCodeEntryException

      Throws:
        `DuplicateCodeEntryException`

    - #### defineBuiltIn

          public final void defineBuiltIn(Symbol symbol,
                           Type domain,
                           Type range,
                           Instruction builtin)
                                   throws DuplicateCodeEntryException

      Throws:
        `DuplicateCodeEntryException`

    - #### defineBuiltIn

          public final void defineBuiltIn(java.lang.String name,
                           Type domain,
                           Type range,
                           Instruction builtin)
                                   throws DuplicateCodeEntryException

      Throws:
        `DuplicateCodeEntryException`

    - #### defineBuiltIn

          public final void defineBuiltIn(Symbol symbol,
                           Type domain1,
                           Type domain2,
                           Type range,
                           Instruction builtin)
                                   throws DuplicateCodeEntryException

      Throws:
        `DuplicateCodeEntryException`

    - #### defineBuiltIn

          public final void defineBuiltIn(java.lang.String name,
                           Type domain1,
                           Type domain2,
                           Type range,
                           Instruction builtin)
                                   throws DuplicateCodeEntryException

      Throws:
        `DuplicateCodeEntryException`

    - #### defineBuiltIn

          public final void defineBuiltIn(Symbol symbol,
                           Type domain1,
                           Type domain2,
                           Type domain3,
                           Type range,
                           Instruction builtin)
                                   throws DuplicateCodeEntryException

      Throws:
        `DuplicateCodeEntryException`

    - #### defineBuiltIn

          public final void defineBuiltIn(java.lang.String name,
                           Type domain1,
                           Type domain2,
                           Type domain3,
                           Type range,
                           Instruction builtin)
                                   throws DuplicateCodeEntryException

      Throws:
        `DuplicateCodeEntryException`

    - #### defineBuiltIn

          public final void defineBuiltIn(Symbol symbol,
                           Type[] domains,
                           Type range,
                           Instruction builtin)
                                   throws DuplicateCodeEntryException

      Throws:
        `DuplicateCodeEntryException`

    - #### defineBuiltIn

          public final void defineBuiltIn(java.lang.String name,
                           Type[] domains,
                           Type range,
                           Instruction builtin)
                                   throws DuplicateCodeEntryException

      Throws:
        `DuplicateCodeEntryException`