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

hlt.language.design.kernel

## Class AndOr

- java.lang.Object
- - hlt.language.design.kernel.Expression
  - - hlt.language.design.kernel.AndOr

- All Implemented Interfaces:
    Locatable
  Direct Known Subclasses:
    And, Or

      public abstract class AndOr
      extends Expression

- - ### Field Summary

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

      `VOID_ASSIGNMENTS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AndOr(Expression left, Expression rite)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Type` | `checkedType()` This method returns the final unambiguously checked type of this expression.
    `abstract void` | `compile(Compiler compiler)` This method compiles this expression in the context of the specified `Compiler`.
    `Expression` | `left()`
    `int` | `numberOfSubexpressions()` Returns the number of subexpressions
    `Expression` | `right()`
    `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.
    `void` | `setCheckedType(Type type)` This method sets the final unambiguously checked type of this expression to the specified type.
    `Expression` | `setSubexpression(int n, Expression expression)` Returns this expression after setting its n-th subexpression to the specified expression; if there is no subexpression at the given position, this throws a `NoSuchSubexpressionException`
    `void` | `setType(Type type)` This method forcibly sets this expression's type field, if it has one, to the specified type.
    `Expression` | `subexpression(int n)` Returns the n-th subexpression of this expression; if there is no subexpression at the given position, this throws a `NoSuchSubexpressionException`
    `Type` | `type()` This method returns the current type of this expression.
    `void` | `typeCheck(TypeChecker typeChecker)` This method type-checks this expression in the context of the specified `TypeChecker`.
    `Type` | `typeRef()` This method returns this expression's undereferenced type field if it has one.

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

      `addType, addTypes, boxSort, containsFreeName, copy, enclosingScope, extent, getEnd, getStart, isConstant, isEquality, isFalse, isHiddenSlicing, isNull, isSelector, isSlicing, isTrue, isVoid, locationString, otherTypes, parameters, sanitizeNames, sanitizeSorts, setCheckedTypeLocked, setEnd, setExtent, setOtherTypes, setStart, shiftOffsets, shiftOffsets, sort, substitute, typeCheck, typeCheck, typeCheckLocked, typedCopy`

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

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

- - ### Constructor Detail

    - #### AndOr

          public AndOr(Expression left,
               Expression rite)

  - ### Method Detail

    - #### left

          public final Expression left()

    - #### right

          public final Expression right()

    - #### numberOfSubexpressions

          public final int numberOfSubexpressions()

      Description copied from class: `Expression`
      Returns the number of subexpressions
      Overrides:
        `numberOfSubexpressions` in class `Expression`

    - #### subexpression

          public final Expression subexpression(int n)
                                         throws NoSuchSubexpressionException

      Description copied from class: `Expression`
      Returns the n-th subexpression of this expression; if there is no subexpression at the given position, this throws a `NoSuchSubexpressionException`
      Overrides:
        `subexpression` in class `Expression`
      Throws:
        `NoSuchSubexpressionException`

    - #### setSubexpression

          public final Expression setSubexpression(int n,
                                    Expression expression)
                                            throws NoSuchSubexpressionException

      Description copied from class: `Expression`
      Returns this expression after setting its n-th subexpression to the specified expression; if there is no subexpression at the given position, this throws a `NoSuchSubexpressionException`
      Overrides:
        `setSubexpression` in class `Expression`
      Throws:
        `NoSuchSubexpressionException`

    - #### compile

          public abstract 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`

    - #### setType

          public final void setType(Type type)

      Description copied from class: `Expression`
      This method forcibly sets this expression's type field, if it has one, to the specified type. It will be an empty method otherwise.
      Specified by:
        `setType` in class `Expression`

    - #### type

          public final Type type()

      Description copied from class: `Expression`
      This method returns the current type of this expression. It will typically, but not necessarily, be the dereferenced value of a `TypeParameter` field. A notable exception is a `Local` since its type method will always return the type of the `Parameter` it stands for.
      Specified by:
        `type` in class `Expression`

    - #### typeRef

          public final Type typeRef()

      Description copied from class: `Expression`
      This method returns this expression's undereferenced type field if it has one. It will return `null` otherwise.
      Specified by:
        `typeRef` in class `Expression`

    - #### checkedType

          public final Type checkedType()

      Description copied from class: `Expression`
      This method returns the final unambiguously checked type of this expression.
      Specified by:
        `checkedType` in class `Expression`

    - #### setCheckedType

          public final void setCheckedType(Type type)

      Description copied from class: `Expression`
      This method sets the final unambiguously checked type of this expression to the specified type. This is used when expression are synthesized on the fly after the type-checking phase and prior to the compiling phase.
      Specified by:
        `setCheckedType` in class `Expression`

    - #### 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 final 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`