public class Local extends Expression
VOID_ASSIGNMENTS| Constructor and Description |
|---|
Local(Parameter parameter) |
Local(Parameter parameter,
Type type) |
| 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 Locals 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.
|
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, typeCheckLockedpublic Local(Parameter parameter)
public final Expression copy()
Expressioncopy in class Expressionpublic final Expression typedCopy()
ExpressiontypedCopy in class Expressionpublic final Parameter parameter()
public final int offset()
public final void setOffset(int offset)
public final void incOffset()
public final java.lang.String name()
public final Type typeRef()
typeRef in class Expressionpublic final Type type()
type in class Expressionpublic final void setType(Type type)
ExpressionsetType in class Expressionpublic final Type checkedType()
checkedType in class Expressionpublic void setCheckedType()
setCheckedType in class Expressionpublic final void setCheckedType(Type type)
setCheckedType in class Expressionpublic final boolean containsFreeName(java.lang.String name)
ExpressioncontainsFreeName in class Expressionpublic final void typeCheck(TypeChecker typeChecker) throws TypingErrorException
typeCheck in class ExpressionTypingErrorExceptionpublic Expression sanitizeNames(ParameterStack parameters)
sanitizeNames in class Expressionpublic void sanitizeSorts(Enclosure enclosure)
sanitizeSorts in class Expressionpublic Expression shiftOffsets(int intShift, int realShift, int objectShift, int intDepth, int realDepth, int objectDepth)
ExpressionshiftOffsets in class Expressionpublic void compile(Compiler compiler)
Expressioncompile in class Expressionpublic final java.lang.String toString()
toString in class java.lang.Object