@Override public void visit(LogicalOr node) { traverseBinary(node); MvExpressions l = expressions.get(node.getLeft()); MvExpressions r = expressions.get(node.getRight()); MvExpressions result = createNewMvExpressions(); result.bladeExpressions[0] = new LogicalOr(l.bladeExpressions[0], r.bladeExpressions[0]); expressions.put(node, result); System.err.println("Warning: LogicalOr is only implemented for scalars!"); }
@Override public void visit(LogicalOr node) { handleBinary(node.getLeft(), node.getRight()); }
@Override public void visit(LogicalOr node) { node.getLeft().accept(this); node.getRight().accept(this); }
/** * Converts this node into a human readable string. * * @return The string "<code>left</code> || <code>right</code>", where left and right are the results of the toString * methods of the left and right operand. */ public String toString() { return bracketComposite(getLeft()) + " || " + bracketComposite(getRight()); }
@Override public void visit(LogicalOr node) { // just do nothing, because only MulitvectorComponent is important node.getLeft().accept(this); node.getRight().accept(this); }
@Override public Expression copy() { return new LogicalOr(getLeft().copy(), getRight().copy()); }
@Override public void visit(LogicalOr node) { result = null; node.getLeft().accept(this); Expression leftResult = result; node.getRight().accept(this); Expression rightResult = result; if (leftResult != null || rightResult != null) result = new LogicalOr(leftResult, rightResult); }
@Override public void visit(LogicalOr node) { node.getLeft().accept(this); Expression left = resultExpr; node.getRight().accept(this); Expression right = resultExpr; resultExpr = new LogicalOr(left, right); if (isConstant(left)) { FloatConstant leftc = (FloatConstant) left; if (doubleEquals(leftc.getValue(), 0.0f)) { resultExpr = right; setGraphModified(); } if (doubleEquals(leftc.getValue(), 1.0f)) { resultExpr = left; setGraphModified(); } } else if (isConstant(right)) { FloatConstant rightc = (FloatConstant) right; if (doubleEquals(rightc.getValue(), 0.0f)) { resultExpr = left; setGraphModified(); } if (doubleEquals(rightc.getValue(), 1.0f)) { resultExpr = right; setGraphModified(); } } }