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

hlt.language.design.kernel

## Class Loop

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

- All Implemented Interfaces:
    Locatable

      public class Loop
      extends Expression

  This class is the class of conditional looping expressions.

- - ### Field Summary

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

      `VOID_ASSIGNMENTS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Loop(Expression condition, Expression body)` Constructs a loop with the specified condition and body.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Type` | `checkedType()` The checked type of a loop is its type.
    `void` | `compile(Compiler compiler)` Compiles this loop expression in the context of the specified `Compiler`.
    `Expression` | `copy()` Returns a deep copy of this expression.
    `int` | `numberOfSubexpressions()` Returns the number of subexpressions
    `void` | `setCheckedType()` Sets the checked type of the condition and body.
    `void` | `setCheckedType(Type type)` No-op...
    `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`
    `java.lang.String` | `toString()`
    `Type` | `type()` The type of a loop is void.
    `void` | `typeCheck(TypeChecker typeChecker)` Type-checks this loop 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.
    `Type` | `typeRef()` The type reference of a loop is its type.

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

      `addType, addTypes, boxSort, containsFreeName, 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`

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

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

- - ### Constructor Detail

    - #### Loop

          public Loop(Expression condition,
              Expression body)

      Constructs a loop with the specified condition and body.

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

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

    - #### type

          public final Type type()

      The type of a loop is void.
      Specified by:
        `type` 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`

    - #### typeRef

          public final Type typeRef()

      The type reference of a loop is its type.
      Specified by:
        `typeRef` in class `Expression`

    - #### checkedType

          public final Type checkedType()

      The checked type of a loop is its type.
      Specified by:
        `checkedType` in class `Expression`

    - #### setCheckedType

          public final void setCheckedType()

      Sets the checked type of the condition and body.
      Specified by:
        `setCheckedType` in class `Expression`

    - #### setCheckedType

          public final void setCheckedType(Type type)

      No-op...
      Specified by:
        `setCheckedType` in class `Expression`

    - #### typeCheck

          public final void typeCheck(TypeChecker typeChecker)
                               throws TypingErrorException

      Type-checks this loop in the context of the specified `TypeChecker`.
      Specified by:
        `typeCheck` in class `Expression`
      Throws:
        `TypingErrorException`

    - #### compile

          public final void compile(Compiler compiler)

      Compiles this loop expression in the context of the specified `Compiler`.
      Specified by:
        `compile` in class `Expression`

    - #### toString

          public final java.lang.String toString()

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