SFE.Compiler
Class Program

java.lang.Object
  extended by SFE.Compiler.Program

public class Program
extends java.lang.Object

A class that represents the program. It holds all the inforamtion needed for the program.


Field Summary
static Function output
          Hold a refernece to the output function
 
Constructor Summary
Program(java.lang.String name)
           
 
Method Summary
 void addFunction(Function function)
          Adds a new function to this program.
static Function functionFromName(java.lang.String name)
           
static int getLineNumber()
          Returns a current line number in the program.
 void multi2SingleBit()
          Transfroms multibit statements in the program into single bit statements.
 void optimize()
          Optimizes the program.
 void toCircuit(java.io.PrintWriter circuit, boolean opt)
          Returns a string representing this object as it appear at the output circuit.
 java.lang.String toFormat()
          Returns a String representing this object as it should appear in the format file.
 java.lang.String toString()
          Returns a string representation of the object.
 void uniqueVars()
          Unique vars transformations.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

output

public static Function output
Hold a refernece to the output function

Constructor Detail

Program

public Program(java.lang.String name)
Method Detail

addFunction

public void addFunction(Function function)
Adds a new function to this program.

Parameters:
function - the new function to add.

toString

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

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

multi2SingleBit

public void multi2SingleBit()
Transfroms multibit statements in the program into single bit statements. NOTE: this class is the only class that implements multi2SingleBit() methos without implementing Multi2SingleBit inteface.


toCircuit

public void toCircuit(java.io.PrintWriter circuit,
                      boolean opt)
Returns a string representing this object as it appear at the output circuit.


getLineNumber

public static int getLineNumber()
Returns a current line number in the program. This method is called the the statements that a line number is to be assigned to them.

Returns:
a current line number in the program.

toFormat

public java.lang.String toFormat()
Returns a String representing this object as it should appear in the format file.

Returns:
a String representing this object as it should appear in the format file.

optimize

public void optimize()
Optimizes the program.


uniqueVars

public void uniqueVars()
Unique vars transformations.


functionFromName

public static Function functionFromName(java.lang.String name)