public class JL5CallExt extends JL5ProcedureCallExt implements CallOps
typeArgs
Constructor and Description |
---|
JL5CallExt() |
JL5CallExt(java.util.List<TypeNode> typeArgs) |
Modifier and Type | Method and Description |
---|---|
protected Type |
computeReturnType(JL5MethodInstance mi) |
java.lang.Object |
constantValue(Lang lang)
Return the constant value of the expression, if any.
|
boolean |
constantValueSet(Lang lang)
Return true iff the compiler has determined whether this expression has a
constant value.
|
protected Type |
expectedReturnType() |
Type |
findContainer(TypeSystem ts,
MethodInstance mi)
Used to find the missing static target of a static method call.
|
ReferenceType |
findTargetType() |
boolean |
isConstant(Lang lang)
Return whether the expression evaluates to a constant.
|
Call |
node()
The node we ultimately extend.
|
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given
CodeWriter . |
protected void |
setExpectedReturnType(Type type) |
Node |
typeCheck(TypeChecker tc)
Type check the AST.
|
Node |
typeCheckNullTarget(TypeChecker tc,
java.util.List<Type> argTypes)
Typecheck the Call when the target is null.
|
Node |
typeCheckOverride(Node parent,
TypeChecker tc)
Type check the AST.
|
actualTypeArgs, printArgs, typeArgs, typeArgs, typeArgs, visitChildren
acceptCFG, firstChild
addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, ext, ext, extRewrite, extRewriteEnter, init, initPred, pred, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, superLang, throwTypes, toString, typeCheckEnter, visitChild, visitList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
printArgs
public JL5CallExt()
public JL5CallExt(java.util.List<TypeNode> typeArgs)
public Call node()
Ext
node
in interface Ext
node
in class JL5ProcedureCallExt
protected Type expectedReturnType()
protected void setExpectedReturnType(Type type)
public Node typeCheckOverride(Node parent, TypeChecker tc) throws SemanticException
NodeOps
override()
method of the
visitor. If this method returns non-null, the node's children
will not be visited automatically. Thus, the method should check
both the node this
and it's children, usually by
invoking visitChildren
with tc
or
with another visitor, returning a non-null node. OR, the method
should do nothing and simply return null
to allow
enter
, visitChildren
, and leave
to be invoked on the node.
The default implementation returns null
.
Overriding of this method is discouraged, but sometimes necessary.typeCheckOverride
in interface NodeOps
typeCheckOverride
in class Ext_c
tc
- The type checking visitor.SemanticException
public Node typeCheck(TypeChecker tc) throws SemanticException
NodeOps
leave()
method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this
or a new copy of the node which will be
installed as a child of the node's parent.typeCheck
in interface NodeOps
typeCheck
in class Ext_c
tc
- The type checking visitor.SemanticException
protected Type computeReturnType(JL5MethodInstance mi) throws SemanticException
SemanticException
public void prettyPrint(CodeWriter w, PrettyPrinter tr)
NodeOps
CodeWriter
.prettyPrint
in interface NodeOps
prettyPrint
in class JL5ProcedureCallExt
w
- The code writer to which to write.tr
- The pretty printer. This is not a visitor.public Type findContainer(TypeSystem ts, MethodInstance mi)
CallOps
findContainer
in interface CallOps
public ReferenceType findTargetType() throws SemanticException
findTargetType
in interface CallOps
SemanticException
public Node typeCheckNullTarget(TypeChecker tc, java.util.List<Type> argTypes) throws SemanticException
CallOps
typeCheckNullTarget
in interface CallOps
argTypes
- list of Type
s of the argumentsSemanticException
public boolean constantValueSet(Lang lang)
ExprOps
isConstant()
is valid only if
constantValueSet()
is true.constantValueSet
in interface ExprOps
public boolean isConstant(Lang lang)
ExprOps
constantValueSet()
is true.isConstant
in interface ExprOps
public java.lang.Object constantValue(Lang lang)
ExprOps
isConstant()
is true.constantValue
in interface ExprOps