edu.cmu.cs.crystal.tac
Interface BinaryOperation

All Superinterfaces:
AssignmentInstruction, TACInstruction

public interface BinaryOperation
extends AssignmentInstruction

x = y binop z, representing all binary operations. Example:
a = f + g;
To find out which type of binary operation this is, you have to call getOperator() and compare it with the BinaryOperator enumerated type.

Author:
Kevin Bierhoff
See Also:
InfixExpression

Method Summary
 ASTNode getNode()
          Returns the node this instruction is for.
 Variable getOperand1()
          Returns the first operand.
 Variable getOperand2()
          Returns the second operand.
 BinaryOperator getOperator()
          Returns the binary operator.
 
Methods inherited from interface edu.cmu.cs.crystal.tac.AssignmentInstruction
getTarget
 
Methods inherited from interface edu.cmu.cs.crystal.tac.TACInstruction
transfer, transfer
 

Method Detail

getNode

ASTNode getNode()
Returns the node this instruction is for. Should be of type Expression. 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()

getOperand1

Variable getOperand1()
Returns the first operand.

Returns:
the first operand.

getOperator

BinaryOperator getOperator()
Returns the binary operator.

Returns:
The binary operator.

getOperand2

Variable getOperand2()
Returns the second operand.

Returns:
the second operand.