@Override public void visit(Relation relation) { addBinaryInfix(relation, relation.getTypeString()); }
@Override public void visit(Relation relation) { result = null; relation.getLeft().accept(this); Expression leftResult = result; relation.getRight().accept(this); Expression rightResult = result; if (leftResult != null || rightResult != null) result = new Relation(leftResult, rightResult, relation.getType()); }
@Override public void visit(Relation relation) { String operator = null; switch (relation.getType()) { case GREATER: operator = ">"; break; case GREATER_OR_EQUAL: operator = ">="; break; case LESS: operator = "<"; break; case LESS_OR_EQUAL: operator = "<="; break; } if (operator != null) { handleBinary(relation, operator); } }
/** * Converts this node into a human readable string. * * @return The string "<code>left relation right</code>", where left and right are the results of the toString methods of * the left and right operand and relation is the concrete relation, e.g. <. */ public String toString() { return bracketComposite(getLeft()) + type + bracketComposite(getRight()); }
@Override public void visit(Relation node) { traverseBinary(node); MvExpressions l = expressions.get(node.getLeft()); MvExpressions r = expressions.get(node.getRight()); MvExpressions result = createNewMvExpressions(); result.bladeExpressions[0] = new Relation(l.bladeExpressions[0], r.bladeExpressions[0], node.getType()); expressions.put(node, result); System.err.println("Warning: Relation is only implemented for scalars!"); }
@Override public void visit(Relation relation) { handleInfix(relation, relation.getTypeString(), false); }
@Override public void visit(Relation relation) { relation.getLeft().accept(this); Expression left = resultExpr; relation.getRight().accept(this); Expression right = resultExpr; resultExpr = new Relation(left, right, relation.getType()); if (isConstant(left) && isConstant(right)) { FloatConstant leftc = (FloatConstant) left; switch (relation.getType()) { case GREATER: resultExpr = (leftc.getValue() > rightc.getValue()) break; default: System.err.println("Warning: Unknown relation type " + relation.getTypeString() + ": Relation won't be optimized."); unknown = true; break;
@Override public void visit(Relation relation) { addBinaryOp(relation, relation.getTypeString()); }
@Override public void visit(Relation relation) { addBinaryInfix(relation, relation.getTypeString()); }
@Override public void visit(Relation relation) { addBinaryInfix(relation, relation.getTypeString()); }
@Override public void visit(Relation relation) { handleInfix(relation, relation.getTypeString(), false); }
@Override public void visit(Relation relation) { handleInfix(relation, relation.getTypeString(), false); }