/** * Dummy method for calculating a product * @param typeProduct The type of the product * @param node The node which represents the product to be calculated */ private void calculateUsingMultTable(Products typeProduct, BinaryOperation node) { MvExpressions left = expressions.get(node.getLeft()); MvExpressions right = expressions.get(node.getRight()); MvExpressions result = calculateUsingMultTable(typeProduct, left, right); expressions.put(node, result); }
private void handleBinary(BinaryOperation node, String operator) { result.append("("); node.getLeft().accept(this); result.append(operator); node.getRight().accept(this); result.append(")"); }
private void handleInfix(BinaryOperation operation, String operator, boolean withSpaces) { addChild(operation, operation.getLeft()); if (withSpaces) { code.append(' '); code.append(operator); code.append(' '); } else { code.append(operator); } addChild(operation, operation.getRight()); }
private void handleInfix(BinaryOperation operation, String operator, boolean withSpaces) { addChild(operation, operation.getLeft()); if (withSpaces) { code.append(' '); code.append(operator); code.append(' '); } else { code.append(operator); } addChild(operation, operation.getRight()); }
public void handlebinary(BinaryOperation node) { if (opstor.add(node, currentAssignment)) { System.out.println("Collector: Node not in Set( " + node.toString() + " ) ---> Adding"); } else { System.out.println("Collector: Node already in Set( " + node.toString() + " ) "); } node.getLeft().accept(this); node.getRight().accept(this); }
/** * Handles a binary operation: Prints the operator between the left and the right operand (infix) * @param operation The binary operation * @param operator The operator to be used * @param withSpaces <value>true</value> if spaces should be printed next to operator, otherwise <value>false</value> */ private void handleInfix(BinaryOperation operation, String operator, boolean withSpaces) { addChild(operation, operation.getLeft()); if (withSpaces) { code.append(' '); code.append(operator); code.append(' '); } else { code.append(operator); } addChild(operation, operation.getRight()); }
protected void addBinaryInfix(BinaryOperation op, String operator) { addChild(op, op.getLeft()); code.append(operator); addChild(op, op.getRight()); }
private void addBinaryInfix(BinaryOperation op, String operator) { op.getLeft().accept(this); code.append(operator); op.getRight().accept(this); }
/** * Dummy method for traversing a binary operation node * @param node The binary operation node */ private void traverseBinary(BinaryOperation node) { node.getLeft().accept(this); node.getRight().accept(this); }
public void handlebinary(BinaryOperation node) { Expression leftlocal; Expression rightlocal; node.getLeft().accept(this); leftlocal = resultExpr; node.getRight().accept(this); rightlocal = resultExpr; assert leftlocal != null && rightlocal != null; if (node.getLeft() instanceof MultivectorComponent && oneset.containsKey(((MultivectorComponent) node.getLeft()).toString())) { System.out.println("Assignment: "+ currAssignString+ " - Replaceable Left: " + ((MultivectorComponent) node.getLeft()).toString()+ "with: "+ oneset.get(((MultivectorComponent)node.getLeft()).toString())); leftlocal = new FloatConstant(oneset.get(((MultivectorComponent)node.getLeft()).toString())); System.out.println("Bhm"); replacements++; } if (node.getRight() instanceof MultivectorComponent && oneset.containsKey(((MultivectorComponent) node.getRight()).toString())) { System.out.println("Assignment: "+ currAssignString+ " - Replaceable Right: " + ((MultivectorComponent) node.getRight()).toString()+" with: "+ oneset.get(((MultivectorComponent)node.getRight()).toString())); rightlocal = new FloatConstant(oneset.get(((MultivectorComponent)node.getRight()).toString())); System.out.println("Bhm"); replacements++; } assert leftlocal != null && rightlocal != null; left=leftlocal; right=rightlocal; }
private void visitBinaryOperation(BinaryOperation op) { op.getLeft().accept(this); op.getRight().accept(this); }
/** * Creates a extended calculation from an binary operation * @param node The binary operation node * @param type The calculation type */ private void createExtCalculationFromBinaryOperation(BinaryOperation node, CalculationType type) { resultValue = null; node.getLeft().accept(this); ParallelObject left = resultValue; resultValue = null; node.getRight().accept(this); ParallelObject right = resultValue; resultValue = new ExtCalculation(type, left, right); }
@Override protected void visitBinaryOperation(BinaryOperation node) { if (node == toReplace) { result = replacement; return; } if (node.getLeft() == toReplace) { node.setLeft(replacement); } if (node.getRight() == toReplace) { node.setRight(replacement); } super.visitBinaryOperation(node); }
@Override protected void visitBinaryOperation(BinaryOperation node) { node.getLeft().accept(expressionVisitor); if (replaceWith != null) { node.setLeft(replaceWith); replaceWith = null; } node.getRight().accept(expressionVisitor); if (replaceWith != null) { node.setRight(replaceWith); replaceWith = null; } }
@Override protected void visitBinaryOperation(BinaryOperation node) { node.getLeft().accept(this); if (result != null) { node.setLeft(result); result = null; } node.getRight().accept(this); if (result != null) { node.setRight(result); result = null; } }
@Override protected void visitBinaryOperation(BinaryOperation node) { resultValue = null; node.getLeft().accept(this); if (resultValue != null) { node.setLeft(resultValue); resultValue = null; } node.getRight().accept(this); if (resultValue != null) { node.setRight(resultValue); resultValue = null; } }
@Override protected void visitBinaryOperation(BinaryOperation node) { resultValue = null; node.getLeft().accept(this); if (resultValue != null) { node.setLeft(resultValue); resultValue = null; } node.getRight().accept(this); if (resultValue != null) { node.setRight(resultValue); resultValue = null; } }
protected void addBinaryInfix(BinaryOperation op, String operator) { append("("); addChild(op, op.getLeft()); append(operator); addChild(op, op.getRight()); append(")"); }
/** * Visits a BinaryOperation instance * @param binaryOperation The BinaryOperation */ private void visitBinaryOperation(BinaryOperation binaryOperation) { binaryOperation.getLeft().accept(this); if (replace) { binaryOperation.setLeft(toReplace); replace = false; } binaryOperation.getRight().accept(this); if (replace) { binaryOperation.setRight(toReplace); replace = false; } }