public class Loop extends Expression
VOID_ASSIGNMENTS| Constructor and Description |
|---|
Loop(Expression condition,
Expression body)
Constructs a loop with the specified condition and body.
|
| 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.
|
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, typeCheckLockedpublic Loop(Expression condition, Expression body)
public final Expression copy()
Expressioncopy in class Expressionpublic final Expression typedCopy()
ExpressiontypedCopy in class Expressionpublic final int numberOfSubexpressions()
ExpressionnumberOfSubexpressions in class Expressionpublic final Expression subexpression(int n) throws NoSuchSubexpressionException
Expressionsubexpression in class ExpressionNoSuchSubexpressionExceptionpublic final Expression setSubexpression(int n, Expression expression) throws NoSuchSubexpressionException
ExpressionsetSubexpression in class ExpressionNoSuchSubexpressionExceptionpublic final Type type()
type in class Expressionpublic final void setType(Type type)
ExpressionsetType in class Expressionpublic final Type typeRef()
typeRef in class Expressionpublic final Type checkedType()
checkedType in class Expressionpublic final void setCheckedType()
setCheckedType in class Expressionpublic final void setCheckedType(Type type)
setCheckedType in class Expressionpublic final void typeCheck(TypeChecker typeChecker) throws TypingErrorException
typeCheck in class ExpressionTypingErrorExceptionpublic final void compile(Compiler compiler)
compile in class Expressionpublic final java.lang.String toString()
toString in class java.lang.Object