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

hlt.language.design.kernel

## Class Local

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

- All Implemented Interfaces:
    Locatable
  Direct Known Subclasses:
    DummyLocal

      public class Local
      extends Expression

- - ### Field Summary

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

      `VOID_ASSIGNMENTS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Local(Parameter parameter)`
    `Local(Parameter parameter, Type type)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Type` | `checkedType()` Returns the checked type of this occurrence.
    `void` | `compile(Compiler compiler)` This method compiles this expression in the context of the specified `Compiler`.
    `boolean` | `containsFreeName(java.lang.String name)` Returns `true` iff the specified name occurs free in this expression.
    `Expression` | `copy()` Returns a deep copy of this expression.
    `void` | `incOffset()`
    `java.lang.String` | `name()`
    `int` | `offset()`
    `Parameter` | `parameter()`
    `Expression` | `sanitizeNames(ParameterStack parameters)` A local is not supposed to be name-sanitized (it is already so!).
    `void` | `sanitizeSorts(Enclosure enclosure)` Sets this local's offset and its defining abstraction's depth of frame according to its sort.
    `void` | `setCheckedType()` No-op...
    `void` | `setCheckedType(Type type)` No-op...
    `void` | `setOffset(int offset)`
    `void` | `setType(Type type)` This method forcibly sets this expression's type field, if it has one, to the specified type.
    `Expression` | `shiftOffsets(int intShift, int realShift, int objectShift, int intDepth, int realDepth, int objectDepth)` This methods visits this expression shifting the offset of all the `Local`s it encounters by the specified amount (per sort) as long as the offset it sees is referencing a parameter within the specified scope depth (per sort); This method is used when the compiler needs to synthesize an scope from an already typechecked expression (i.e., for currying or un/boxing - e.g., see the `pad` method below).
    `java.lang.String` | `toString()`
    `Type` | `type()` Returns the current type binding of this occurrence.
    `void` | `typeCheck(TypeChecker typeChecker)` Ascertains that any other type for this local is that of the parameter this stands for.
    `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()` Returns the type reference of this occurrence.

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

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

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

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

- - ### Constructor Detail

    - #### Local

          public Local(Parameter parameter)

    - #### Local

          public Local(Parameter parameter,
               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`

    - #### parameter

          public final Parameter parameter()

    - #### offset

          public final int offset()

    - #### setOffset

          public final void setOffset(int offset)

    - #### incOffset

          public final void incOffset()

    - #### name

          public final java.lang.String name()

    - #### typeRef

          public final Type typeRef()

      Returns the type reference of this occurrence.
      Specified by:
        `typeRef` in class `Expression`

    - #### type

          public final Type type()

      Returns the current type binding of this occurrence.
      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`

    - #### checkedType

          public final Type checkedType()

      Returns the checked type of this occurrence.
      Specified by:
        `checkedType` in class `Expression`

    - #### setCheckedType

          public void setCheckedType()

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

    - #### setCheckedType

          public final void setCheckedType(Type type)

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

    - #### containsFreeName

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

      Description copied from class: `Expression`
      Returns `true` iff the specified name occurs free in this expression.
      Overrides:
        `containsFreeName` in class `Expression`

    - #### typeCheck

          public final void typeCheck(TypeChecker typeChecker)
                               throws TypingErrorException

      Ascertains that any other type for this local is that of the parameter this stands for.
      Specified by:
        `typeCheck` in class `Expression`
      Throws:
        `TypingErrorException`

    - #### sanitizeNames

          public Expression sanitizeNames(ParameterStack parameters)

      A local is not supposed to be name-sanitized (it is already so!).
      Overrides:
        `sanitizeNames` in class `Expression`

    - #### sanitizeSorts

          public void sanitizeSorts(Enclosure enclosure)

      Sets this local's offset and its defining abstraction's depth of frame according to its sort.
      Overrides:
        `sanitizeSorts` in class `Expression`

    - #### shiftOffsets

          public Expression shiftOffsets(int intShift,
                                int realShift,
                                int objectShift,
                                int intDepth,
                                int realDepth,
                                int objectDepth)

      Description copied from class: `Expression`
      This methods visits this expression shifting the offset of all the `Local`s it encounters by the specified amount (per sort) as long as the offset it sees is referencing a parameter within the specified scope depth (per sort); This method is used when the compiler needs to synthesize an scope from an already typechecked expression (i.e., for currying or un/boxing - e.g., see the `pad` method below).
      Overrides:
        `shiftOffsets` in class `Expression`

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

    - #### toString

          public final java.lang.String toString()

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