|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSFE.Compiler.Expression
SFE.Compiler.OperationExpression
SFE.Compiler.BinaryOpExpression
public class BinaryOpExpression
A class for representing binary operation expressions that can be defined in the program.
Field Summary | |
---|---|
static java.util.Vector |
inputFormat
|
Constructor Summary | |
---|---|
BinaryOpExpression(Operator op,
Expression left,
Expression right)
Constructs a new BinaryOpExpression from a given oparator and inputs. |
Method Summary | |
---|---|
void |
changeReference(UniqueVariables unique)
Changes references of variables to the last place they were changed |
OperationExpression |
combineConstInput()
Combines an input expression that is constant and return the result expression. |
OperationExpression |
combineEqualInputs()
Combines identical input expression an returns the result expression. |
OperationExpression |
combineSharedInput()
Combines the gates that share an input pin into one gate. |
void |
combineUnaryInput()
Combines an input expression that is the output of an unary operator into this Operation expression. |
Expression |
duplicate()
returns a replica of this BinaryOpExpression. |
Expression |
getLeft()
Returns the left input pin. |
java.util.Vector |
getLvalExpressionInputs()
Returns an array of the input LvalExpressions of this gate. |
Expression |
getRight()
Returns the right input pin. |
boolean |
hasConstantInput()
Return true iff this OperationExpression has a constant input. |
boolean |
hasEqualInputs()
Returns true iff this operator expression has at lease two identical input expression. |
boolean |
hasSharedInput()
Returns true if the gates input pins share an input pin. |
boolean |
hasUnaryInput()
Returns true iff one of the operands of this operator expression is a result of an unary operator. |
boolean |
isComplexIDOrNeg()
returns true if this gate outputs true of false(constant output). |
BlockStatement |
multi2SingleBit(java.lang.Object obj)
Transforms this multibit BinaryOpExpression into singlebit Statements and returns a BlockStatement containing the result. |
OperationExpression |
negate()
returns the negate gate (OperatorExpression) of this OperatorExpression. |
OperationExpression |
simplify()
Transformas this gate to a simple id or not gate. |
OperationExpression |
sortInputs()
Sorts the input gates according to their names and returns the result OperationExpression. |
void |
toCircuit(java.io.PrintWriter circuit)
Writes this Expression to the output circuit. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class SFE.Compiler.OperationExpression |
---|
evaluateExpression, getConstantOutput, getOperator, isConstant, size |
Methods inherited from class SFE.Compiler.Expression |
---|
bitAt, hasSharedInput |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.util.Vector inputFormat
Constructor Detail |
---|
public BinaryOpExpression(Operator op, Expression left, Expression right)
op
- the binary operator.left
- the left input pin.right
- the right input pin.Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public BlockStatement multi2SingleBit(java.lang.Object obj)
obj
- the AssignmentStatement that holds this BinaryOpExpression.
public Expression getRight()
public Expression getLeft()
public void toCircuit(java.io.PrintWriter circuit)
circuit
- the output circuit file.public boolean hasUnaryInput()
hasUnaryInput
in class OperationExpression
public void combineUnaryInput()
combineUnaryInput
in class OperationExpression
public boolean hasConstantInput()
hasConstantInput
in class OperationExpression
public OperationExpression combineConstInput()
combineConstInput
in class OperationExpression
public boolean hasEqualInputs()
hasEqualInputs
in class OperationExpression
public OperationExpression combineEqualInputs()
combineEqualInputs
in class OperationExpression
public OperationExpression sortInputs()
sortInputs
in class OperationExpression
public OperationExpression negate()
negate
in class OperationExpression
public java.util.Vector getLvalExpressionInputs()
getLvalExpressionInputs
in class OperationExpression
public void changeReference(UniqueVariables unique)
changeReference
in class OperationExpression
unique
- holds all the variables and their referencespublic boolean isComplexIDOrNeg()
isComplexIDOrNeg
in class OperationExpression
public OperationExpression simplify()
simplify
in class OperationExpression
public Expression duplicate()
duplicate
in class OperationExpression
public boolean hasSharedInput()
hasSharedInput
in class OperationExpression
public OperationExpression combineSharedInput()
combineSharedInput
in class OperationExpression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |