public class Application extends ProtoExpression
VOID_ASSIGNMENTS| Constructor and Description |
|---|
Application(Expression function,
java.util.AbstractList arguments) |
Application(Expression function,
Expression argument) |
Application(Expression function,
Expression[] arguments) |
Application(Expression function,
Expression arg1,
Expression arg2) |
| Modifier and Type | Method and Description |
|---|---|
Expression |
argument(int n) |
Expression[] |
arguments() |
int |
arity() |
void |
compile(Compiler compiler)
This method compiles this expression in the context of the specified
Compiler.
|
Expression |
copy()
Returns a deep copy of this expression.
|
Application |
flatten() |
Expression |
function() |
boolean |
isFieldApplication() |
boolean |
isHiddenSlicing(Tables tables,
Parameter parameter)
Returns true iff this application is a "hidden" filter for the specified
parameter; i.e., iff it is of the form s(x) == e, where x
is the parameter, and x does not occur free in e.
|
boolean |
isSelector(Tables tables,
Parameter parameter)
Returns true iff this application is a selector filter for the specified
parameter; i.e., iff it is of the form x == e, where x
is the parameter, and x does not occur free in e.
|
boolean |
isSlicing(Tables tables,
Parameter parameter)
Returns true iff this application is a slicing filter for the specified
parameter; i.e., iff it is of the form x.s == e, where x
is the parameter, and x does not occur free in e.
|
boolean |
isTupleProjection() |
boolean |
isUnaryTupleProjection() |
boolean |
noCurrying() |
int |
numberOfSubexpressions()
Returns the number of subexpressions
|
void |
setArguments(Expression[] arguments) |
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)
NB: this is not final because itis overridden in
Abstraction and
Global.
|
void |
setFunction(Expression function) |
Application |
setNoCurrying() |
Application |
setNoCurrying(boolean flag) |
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
|
boolean |
slicesParameter(Parameter parameter)
Returns true iff this is of the form p1(p2(...pk(x)...)) where
x is a local occurrence of the specified parameter, and the pis
are unary tuple projections.
|
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() |
void |
typeCheck(TypeChecker typeChecker)
This method type-checks this expression in the context of the specified
TypeChecker.
|
void |
typeCheck(Type type,
TypeChecker typeChecker)
This method ascertains that this expression has the specified type 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.
|
Expression |
undoDummyLocal()
When this application is a slicing equality, this undoes the name-sanitizing of
the "dummy local" parameter occurrence of the projection back to a plain dummy.
|
checkedType, setType, type, typeRefaddType, addTypes, boxSort, containsFreeName, enclosingScope, extent, getEnd, getStart, isConstant, isEquality, isFalse, isNull, isTrue, isVoid, locationString, otherTypes, parameters, sanitizeNames, sanitizeSorts, setCheckedTypeLocked, setEnd, setExtent, setOtherTypes, setStart, shiftOffsets, shiftOffsets, sort, substitute, typeCheck, typeCheckLockedpublic Application(Expression function, Expression[] arguments)
public Application(Expression function, Expression arg1, Expression arg2)
public Application(Expression function, Expression argument)
public Application(Expression function, java.util.AbstractList arguments)
public final Application flatten()
public final Expression copy()
Expressioncopy in class Expressionpublic final Expression typedCopy()
ExpressiontypedCopy in class Expressionpublic final boolean isSlicing(Tables tables, Parameter parameter) throws UndefinedEqualityException
isSlicing in class ExpressionUndefinedEqualityExceptionpublic final boolean isHiddenSlicing(Tables tables, Parameter parameter) throws UndefinedEqualityException
isHiddenSlicing in class ExpressionUndefinedEqualityExceptionpublic final boolean slicesParameter(Parameter parameter)
public final boolean isSelector(Tables tables, Parameter parameter) throws UndefinedEqualityException
isSelector in class ExpressionUndefinedEqualityExceptionpublic final Expression undoDummyLocal()
public final boolean noCurrying()
public final Application setNoCurrying()
public final Application setNoCurrying(boolean flag)
public 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 Expression function()
public final Expression[] arguments()
public final Expression argument(int n)
public final void setFunction(Expression function)
public final void setArguments(Expression[] arguments)
public final int arity()
public final void setCheckedType()
ExpressionsetCheckedType in class Expressionpublic final void setCheckedType(Type type)
ProtoExpressionsetCheckedType in class ProtoExpressionpublic final void typeCheck(Type type, TypeChecker typeChecker) throws TypingErrorException
ExpressiontypeCheck in class ExpressionTypingErrorExceptionpublic void typeCheck(TypeChecker typeChecker) throws TypingErrorException
ExpressiontypeCheck in class ExpressionTypingErrorExceptionpublic final boolean isTupleProjection()
public final boolean isUnaryTupleProjection()
public final boolean isFieldApplication()
public void compile(Compiler compiler)
Expressioncompile in class Expressionpublic java.lang.String toString()
toString in class java.lang.Object