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

hlt.language.design.kernel

## Class Constant

- java.lang.Object
- - hlt.language.design.kernel.Expression
  - - hlt.language.design.kernel.ProtoExpression
    - - hlt.language.design.kernel.Constant

- All Implemented Interfaces:
    Locatable
  Direct Known Subclasses:
    BuiltinObjectConstant, Char, Int, NewObject, Real

      public class Constant
      extends ProtoExpression

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Global` | `UNWRAP_INT`
    `static Global` | `UNWRAP_REAL`
    `static Constant` | `VOID`
    `static Global` | `WRAP_INT`
    `static Global` | `WRAP_REAL`

    - ### Fields inherited from class hlt.language.design.kernel.Expression

      `VOID_ASSIGNMENTS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Constant()`
    `Constant(Type type)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `compile(Compiler compiler)` This method compiles this expression in the context of the specified `Compiler`.
    `Expression` | `copy()` Returns a deep copy of this expression.
    `boolean` | `equals(java.lang.Object other)`
    `static Constant` | `FALSE()`
    `static void` | `initialize(Tables tables)` Initialization of some constants.
    `boolean` | `isFalse()` Returns `true` iff this expression denotes the constant `false`.
    `boolean` | `isNull()` Returns `true` iff this expression denotes the constant `null`.
    `boolean` | `isTrue()` Returns `true` iff this expression denotes the constant `true`.
    `static Constant` | `NULL()`
    `static Constant` | `NULL(Type type)`
    `void` | `setCheckedType()` This method sets the final unambiguously checked type of this expression, possibly along with other final information that may be needed by the compiler for generating code.
    `Constant` | `setIsNull()`
    `java.lang.String` | `toString()`
    `static Constant` | `TRUE()`
    `void` | `typeCheck(TypeChecker typeChecker)` This method type-checks this expression in the context of the specified `TypeChecker`.
    `Expression` | `typedCopy()` Returns a deep copy of this expression this and all its subexpressions share the same type as their copy's counterparts.

    - ### Methods inherited from class hlt.language.design.kernel.ProtoExpression

      `checkedType, setCheckedType, setType, type, typeRef`

    - ### Methods inherited from class hlt.language.design.kernel.Expression

      `addType, addTypes, boxSort, containsFreeName, enclosingScope, extent, getEnd, getStart, isConstant, isEquality, isHiddenSlicing, isSelector, isSlicing, isVoid, locationString, numberOfSubexpressions, otherTypes, parameters, sanitizeNames, sanitizeSorts, setCheckedTypeLocked, setEnd, setExtent, setOtherTypes, setStart, setSubexpression, shiftOffsets, shiftOffsets, sort, subexpression, substitute, typeCheck, typeCheck, typeCheckLocked`

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

      `getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### VOID

          public static final Constant VOID

    - #### WRAP_INT

          public static Global WRAP_INT

    - #### UNWRAP_INT

          public static Global UNWRAP_INT

    - #### WRAP_REAL

          public static Global WRAP_REAL

    - #### UNWRAP_REAL

          public static Global UNWRAP_REAL

  - ### Constructor Detail

    - #### Constant

          public Constant()

    - #### Constant

          public Constant(Type type)

  - ### Method Detail

    - #### copy

          public final Expression copy()

      Description copied from class: `Expression`
      Returns a deep copy of this expression. The types are not not copied. NB: This is a convenience for building expressions that should be used exclusively before any processing (in particular sanitizing), is done on this expression.
      Specified by:
        `copy` in class `Expression`

    - #### typedCopy

          public final Expression typedCopy()

      Description copied from class: `Expression`
      Returns a deep copy of this expression this and all its subexpressions share the same type as their copy's counterparts. NB: This is a convenience for building expressions that should be used exclusively before any processing (in particular sanitizing), is done on this expression.
      Specified by:
        `typedCopy` in class `Expression`

    - #### TRUE

          public static final Constant TRUE()

    - #### isTrue

          public final boolean isTrue()

      Description copied from class: `Expression`
      Returns `true` iff this expression denotes the constant `true`.
      Overrides:
        `isTrue` in class `Expression`

    - #### FALSE

          public static final Constant FALSE()

    - #### isFalse

          public final boolean isFalse()

      Description copied from class: `Expression`
      Returns `true` iff this expression denotes the constant `false`.
      Overrides:
        `isFalse` in class `Expression`

    - #### NULL

          public static final Constant NULL()

    - #### setIsNull

          public final Constant setIsNull()

    - #### isNull

          public final boolean isNull()

      Description copied from class: `Expression`
      Returns `true` iff this expression denotes the constant `null`.
      Overrides:
        `isNull` in class `Expression`

    - #### NULL

          public static final Constant NULL(Type type)

    - #### initialize

          public static final void initialize(Tables tables)

      Initialization of some constants.

    - #### setCheckedType

          public final void setCheckedType()

      Description copied from class: `Expression`
      This method sets the final unambiguously checked type of this expression, possibly along with other final information that may be needed by the compiler for generating code.
      Specified by:
        `setCheckedType` in class `Expression`

    - #### typeCheck

          public void typeCheck(TypeChecker typeChecker)
                         throws TypingErrorException

      Description copied from class: `Expression`
      This method type-checks this expression in the context of the specified `TypeChecker`.
      Specified by:
        `typeCheck` in class `Expression`
      Throws:
        `TypingErrorException`

    - #### compile

          public void compile(Compiler compiler)

      Description copied from class: `Expression`
      This method compiles this expression in the context of the specified `Compiler`.
      Specified by:
        `compile` in class `Expression`

    - #### equals

          public boolean equals(java.lang.Object other)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`