SFE.Compiler
Class IfStatement

java.lang.Object
  extended by SFE.Compiler.Statement
      extended by SFE.Compiler.IfStatement
All Implemented Interfaces:
Multi2SingleBit

public class IfStatement
extends Statement

A class for representing if statement that can be defined in the program.


Constructor Summary
IfStatement(Expression condition, Statement thenBlock, Statement elseBlock)
          Construct a new if statement.
 
Method Summary
 Statement duplicate()
          Returns a replica of this IfStatement.
 BlockStatement multi2SingleBit(java.lang.Object obj)
          Transforms this multibit AssignmentStatement into singlebit statements and returns the result.
 java.lang.String toString()
          Returns a string representation of this IfStatement.
 Statement uniqueVars()
          Unique vars transformations.
 
Methods inherited from class SFE.Compiler.Statement
hasUnaryOperator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IfStatement

public IfStatement(Expression condition,
                   Statement thenBlock,
                   Statement elseBlock)
Construct a new if statement.

Parameters:
condition - the condition of the if statement.
thenBlock - the block of the if statement.
elseBlock - the block of the else statement.
Method Detail

uniqueVars

public Statement uniqueVars()
Unique vars transformations.

Specified by:
uniqueVars in class Statement

multi2SingleBit

public BlockStatement multi2SingleBit(java.lang.Object obj)
Transforms this multibit AssignmentStatement into singlebit statements and returns the result.

Parameters:
obj - not needed (null).
Returns:
a BlockStatement containing the result statements.

duplicate

public Statement duplicate()
Returns a replica of this IfStatement.

Specified by:
duplicate in class Statement
Returns:
a replica of this IfStatement.

toString

public java.lang.String toString()
Returns a string representation of this IfStatement.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this IfStatement.