SFE.Compiler
Class BlockStatement

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

public class BlockStatement
extends Statement

A class for representing a block of statements that can be defined in the program.


Field Summary
static java.util.Vector inputFormat
           
 
Constructor Summary
BlockStatement()
          Constructs a new BlockStatement.
 
Method Summary
 void buildUsedStatementsHash()
          Executes buildUsedStatementsHash() for each statement in the BlockStatement.
 Statement duplicate()
          returns a duplica of this BlockStatement.
 BlockStatement multi2SingleBit(java.lang.Object obj)
          Transforms this multibit statements in this BlockStatement into singlebit statements and returns the result.
 void optimizePhaseI()
          Optimizes this BlockStatment.
 void optimizePhaseII(java.util.Vector newBody)
          executes optimizePhaseII() on each of the statements in this BlockStatement.
 void toCircuit(java.io.PrintWriter circuit)
          Writes this BlockStatement to the output circuit.
 java.lang.String toString()
          Returns a string representation of the BlockStatement.
 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
 

Field Detail

inputFormat

public static final java.util.Vector inputFormat
Constructor Detail

BlockStatement

public BlockStatement()
Constructs a new BlockStatement.

Method Detail

toString

public java.lang.String toString()
Returns a string representation of the BlockStatement.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the BlockStatement.

multi2SingleBit

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

Specified by:
multi2SingleBit in interface Multi2SingleBit
Parameters:
obj - not needed (null).
Returns:
a BlockStatement containing the result of this transformation.

toCircuit

public void toCircuit(java.io.PrintWriter circuit)
Writes this BlockStatement to the output circuit.

Parameters:
circuit - the output circuit file.

uniqueVars

public Statement uniqueVars()
Unique vars transformations.

Specified by:
uniqueVars in class Statement

optimizePhaseI

public void optimizePhaseI()
Optimizes this BlockStatment. runs the first optimization phaze on each of the statements in this BlockStatement.


optimizePhaseII

public void optimizePhaseII(java.util.Vector newBody)
executes optimizePhaseII() on each of the statements in this BlockStatement.


buildUsedStatementsHash

public void buildUsedStatementsHash()
Executes buildUsedStatementsHash() for each statement in the BlockStatement.


duplicate

public Statement duplicate()
returns a duplica of this BlockStatement.

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