edu.cmu.cs.crystal.tac
Interface ConstructorCallInstruction

All Superinterfaces:
TACInstruction, TACInvocation

public interface ConstructorCallInstruction
extends TACInvocation

x(y1, ..., yn), where x is "this" or "super". This instruction can by definition only occur in a constructor. It does not have to be the first instruction in the constructor if arguments to the constructor call are computed with preceding instructions.

Author:
Kevin Bierhoff
See Also:
ConstructorInvocation, SuperConstructorInvocation

Method Summary
 java.util.List<Variable> getArgOperands()
          Returns the operands for the arguments passed into an invocation.
 KeywordVariable getConstructionObject()
          Returns variable for the object being constructed, i.e., this or super.
 Variable getEnclosingInstanceSpecifier()
          Specifier of an enclosing instance passed into the constructor, if any.
 ASTNode getNode()
          Returns the node this instruction is for.
 boolean hasEnclosingInstanceSpecifier()
          Indicates whether there is an enclosing instance specifier passed into the constructor call.
 boolean isSuperCall()
          Indicates whether this is a super-constructor call or a call to a constructor in the same class as the surrounding constructor.
 IMethodBinding resolveBinding()
          Returns the method binding for this invocation.
 
Methods inherited from interface edu.cmu.cs.crystal.tac.TACInstruction
transfer, transfer
 

Method Detail

getNode

ASTNode getNode()
Returns the node this instruction is for. This should be one of the following types: Usually, one instruction exists per AST node, but can be more when AST nodes are desugared, such as for post-increment.

Specified by:
getNode in interface TACInstruction
Returns:
the node this instruction is for.
See Also:
TACInstruction.getNode()

getConstructionObject

KeywordVariable getConstructionObject()
Returns variable for the object being constructed, i.e., this or super.

Returns:
this or super.

isSuperCall

boolean isSuperCall()
Indicates whether this is a super-constructor call or a call to a constructor in the same class as the surrounding constructor. Thus, if this method returns true then getConstructionObject() will return super and otherwise this.

Returns:
true if this is a super-constructor call, false if this is a call to a constructor in the same class as the surrounding constructor.

getArgOperands

java.util.List<Variable> getArgOperands()
Description copied from interface: TACInvocation
Returns the operands for the arguments passed into an invocation.

Specified by:
getArgOperands in interface TACInvocation
Returns:
the operands for the arguments passed into an invocation.

hasEnclosingInstanceSpecifier

boolean hasEnclosingInstanceSpecifier()
Indicates whether there is an enclosing instance specifier passed into the constructor call. getEnclosingInstanceSpecifier() will only return a non-null value if this method returns true.

Returns:
true if there is an enclosing instance specifier, false otherwise.

getEnclosingInstanceSpecifier

Variable getEnclosingInstanceSpecifier()
Specifier of an enclosing instance passed into the constructor, if any. Please see the Java language specification for the semantics of providing an enclosing instance specifier with a constructor call.

Returns:
an enclosing instance passed into the constructor or null if there is none.

resolveBinding

IMethodBinding resolveBinding()
Description copied from interface: TACInvocation
Returns the method binding for this invocation.

Specified by:
resolveBinding in interface TACInvocation
Returns:
the method binding for this invocation.