edu.cmu.cs.crystal.tac
Interface TACInstruction

All Known Subinterfaces:
ArrayInitInstruction, AssignmentInstruction, BinaryOperation, CastInstruction, ConstructorCallInstruction, CopyInstruction, DotClassInstruction, EnhancedForConditionInstruction, InstanceofInstruction, InvocationInstruction, LoadArrayInstruction, LoadFieldInstruction, LoadInstruction, LoadLiteralInstruction, MethodCallInstruction, NewArrayInstruction, NewObjectInstruction, OneOperandInstruction, ReturnInstruction, SourceVariableDeclaration, SourceVariableRead, StoreArrayInstruction, StoreFieldInstruction, StoreInstruction, TACArrayAccess, TACFieldAccess, TACInvocation, UnaryOperation
All Known Implementing Classes:
EclipseInstructionSequence, ReturnInstructionImpl

public interface TACInstruction

Abstract base class for 3-Address-Code instructions built from Eclipse AST nodes. ITACTransferFunction lists subclasses that define the different types of instructions. Additional (abstract and/or package-private) classes simplify 3-Address-Code generation from AST nodes.

Author:
Kevin Bierhoff
See Also:
ITACTransferFunction

Method Summary
 ASTNode getNode()
          Returns the node this instruction is for.
<LE> IResult<LE>
transfer(ITACBranchSensitiveTransferFunction<LE> tf, java.util.List<ILabel> labels, LE value)
          Use this method to transfer over an instruction.
<LE> LE
transfer(ITACTransferFunction<LE> tf, LE value)
          Use this method to transfer over an instruction.
 

Method Detail

getNode

ASTNode getNode()
Returns the node this instruction is for. Usually, one instruction exists per AST node, but can be more when AST nodes are desugared, such as for post-increment. Subtypes may give more specific information on the type of AST node returned, but more specific typing is not guaranteed due to possible evolution of the Eclipse AST or these interfaces.

Returns:
The AST node this instruction is for.

transfer

<LE> LE transfer(ITACTransferFunction<LE> tf,
                 LE value)
Use this method to transfer over an instruction. This method performs double-dispatch to call the appropriate transfer method on the transfer function being passed.

Type Parameters:
LE - Lattice element used in the transfer function.
Parameters:
tf - Transfer function.
value - Incoming lattice value.
Returns:
Outgoing lattice value after transferring over this instruction.

transfer

<LE> IResult<LE> transfer(ITACBranchSensitiveTransferFunction<LE> tf,
                          java.util.List<ILabel> labels,
                          LE value)
Use this method to transfer over an instruction. This method performs double-dispatch to call the appropriate transfer method on the transfer function being passed.

Type Parameters:
LE - Lattice element used in the transfer function.
Parameters:
tf - Transfer function.
labels - Branch labels to consider.
value - Incoming lattice value.
Returns:
Outgoing lattice values for given labels after transferring over this instruction.