edu.cmu.cs.crystal.tac.model
Interface UnaryOperation

All Superinterfaces:
AssignmentInstruction, OneOperandInstruction, TACInstruction

public interface UnaryOperation
extends OneOperandInstruction

x = unop y; this class represents unary operations. Note that some seemingly unary operations such as x += y are desugared into binary operations. Pre- and post-increments and -decrements (++, --) are desugared as well.

Author:
Kevin Bierhoff
See Also:
PrefixExpression

Method Summary
 ASTNode getNode()
          Returns the node this instruction is for.
 UnaryOperator getOperator()
          Returns the unary operator.
 
Methods inherited from interface edu.cmu.cs.crystal.tac.model.OneOperandInstruction
getOperand
 
Methods inherited from interface edu.cmu.cs.crystal.tac.model.AssignmentInstruction
getTarget
 
Methods inherited from interface edu.cmu.cs.crystal.tac.model.TACInstruction
transfer, transfer
 

Method Detail

getNode

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

getOperator

UnaryOperator getOperator()
Returns the unary operator.

Returns:
the unary operator.