|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSFE.Compiler.Expression
SFE.Compiler.OperationExpression
public abstract class OperationExpression
class OperationExpression defines expressions containing operatioins, that can be defined in the program.
Field Summary | |
---|---|
static java.util.Vector |
inputFormat
|
Constructor Summary | |
---|---|
OperationExpression(Operator op)
Constracts a new OperationExpression from a given Operator. |
Method Summary | |
---|---|
abstract void |
changeReference(UniqueVariables unique)
|
abstract OperationExpression |
combineConstInput()
Combines an input expression that is constant and return the result expression. |
abstract OperationExpression |
combineEqualInputs()
Combines identical input expression an returns the result expression. |
OperationExpression |
combineSharedInput()
should be called only in hasSharedInput() is true. |
abstract void |
combineUnaryInput()
Combines an input expression the is the output of an unary operator into this Operation expression. |
abstract Expression |
duplicate()
returns a replic of this Expression |
Expression |
evaluateExpression(AssignmentStatement as,
BlockStatement result)
recursivly calculates inner arithmetic expression and inserts them into the proper function. |
UnaryOpExpression |
getConstantOutput()
Returns an unary op expression with a constant (constant expression). |
abstract java.util.Vector |
getLvalExpressionInputs()
Returns an array of the input LvalExpressions of this gate. |
Operator |
getOperator()
Returns this operator. |
abstract boolean |
hasConstantInput()
Return true iff this OperationExpression has a constant input. |
abstract boolean |
hasEqualInputs()
Returns true iff this operator expression has at lease two identical input expression. |
boolean |
hasSharedInput()
Returns true if this expression has input pins that share an input. |
abstract boolean |
hasUnaryInput()
Returns true iff one of the operand of this operator expression is a result of an unary operator. |
abstract boolean |
isComplexIDOrNeg()
returns true if this gate outputs true of false(constant output). |
boolean |
isConstant()
Returns true if the output of this operation is constant |
abstract OperationExpression |
negate()
returns the negate gate (OperatorExpression) of this OperatorExpression. |
abstract OperationExpression |
simplify()
Transformas this gate to a simple id or not gate. |
int |
size()
Returns the number of bits needed to represent this expression. |
abstract OperationExpression |
sortInputs()
Sorts the input gates according to their names and returns the result OperationExpression. |
void |
toCircuit(java.io.PrintWriter circuit)
Prints this Object into the circuit. |
Methods inherited from class SFE.Compiler.Expression |
---|
bitAt, hasSharedInput |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface SFE.Compiler.Multi2SingleBit |
---|
multi2SingleBit |
Field Detail |
---|
public static final java.util.Vector inputFormat
Constructor Detail |
---|
public OperationExpression(Operator op)
op
- this OperationExpression operator.Method Detail |
---|
public int size()
size
in class Expression
public boolean hasSharedInput()
public OperationExpression combineSharedInput()
public abstract boolean hasUnaryInput()
public abstract void combineUnaryInput()
public abstract boolean hasConstantInput()
public abstract OperationExpression combineConstInput()
public abstract boolean hasEqualInputs()
public abstract OperationExpression combineEqualInputs()
public Operator getOperator()
public abstract OperationExpression sortInputs()
public abstract OperationExpression negate()
public abstract java.util.Vector getLvalExpressionInputs()
public boolean isConstant()
public UnaryOpExpression getConstantOutput()
public abstract void changeReference(UniqueVariables unique)
public Expression evaluateExpression(AssignmentStatement as, BlockStatement result)
evaluateExpression
in class Expression
as
- the AssignmentStatement that holds this expression (as rhs).result
- a block statement to insert statments if needed.
public abstract boolean isComplexIDOrNeg()
public abstract OperationExpression simplify()
public abstract Expression duplicate()
duplicate
in class Expression
public void toCircuit(java.io.PrintWriter circuit)
circuit
- the circuit output file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |