edu.cmu.cs.crystal.tac.eclipse
Class EclipseInstructionSequence

java.lang.Object
  extended by edu.cmu.cs.crystal.tac.eclipse.EclipseInstructionSequence
All Implemented Interfaces:
TACInstruction

public class EclipseInstructionSequence
extends Object

Author:
Kevin Bierhoff

Constructor Summary
EclipseInstructionSequence(ASTNode node, TACInstruction[] instructions, IEclipseVariableQuery tac)
           
EclipseInstructionSequence(ASTNode node, TACInstruction[] instructions, int useAsResult, IEclipseVariableQuery tac)
           
 
Method Summary
<LE> IResult<LE>
deriveResult(ITACBranchSensitiveTransferFunction<LE> tf, List<ILabel> labels, TACInstruction targetInstr, LE value, boolean afterResult)
           
<LE> LE
deriveResult(ITACTransferFunction<LE> tf, TACInstruction targetInstr, LE value, boolean afterResult)
           
 E getNode()
          Returns the node this instruction is for.
 String toString()
           
<LE> IResult<LE>
transfer(ITACBranchSensitiveTransferFunction<LE> tf, 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EclipseInstructionSequence

public EclipseInstructionSequence(ASTNode node,
                                  TACInstruction[] instructions,
                                  int useAsResult,
                                  IEclipseVariableQuery tac)

EclipseInstructionSequence

public EclipseInstructionSequence(ASTNode node,
                                  TACInstruction[] instructions,
                                  IEclipseVariableQuery tac)
Method Detail

transfer

public <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.

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

transfer

public <LE> IResult<LE> transfer(ITACBranchSensitiveTransferFunction<LE> tf,
                                 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.

Specified by:
transfer in interface TACInstruction
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 transfering over this instruction.

deriveResult

public <LE> LE deriveResult(ITACTransferFunction<LE> tf,
                            TACInstruction targetInstr,
                            LE value,
                            boolean afterResult)

deriveResult

public <LE> IResult<LE> deriveResult(ITACBranchSensitiveTransferFunction<LE> tf,
                                     List<ILabel> labels,
                                     TACInstruction targetInstr,
                                     LE value,
                                     boolean afterResult)

toString

public String toString()
Overrides:
toString in class Object

getNode

public E getNode()
Description copied from interface: TACInstruction
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.

Specified by:
getNode in interface TACInstruction
Returns:
The AST node this instruction is for.