@Override //dfg public void visit(MathFunctionCall 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.getOperand().accept(this); }
@Override public void visit(MathFunctionCall node) { //TODO Schluckt nachkommende werte if (opstor.OperationShouldBeReplaced(node)) { nx = new Variable(opstor.getReplacementID(node)); System.out.println("Replacer: Node in Set: ( " + node.toString() + " ) ---> Replacing with " + opstor.getReplacementID(node)); } else { node.getOperand().accept(this); nx = new MathFunctionCall(nx, node.getFunction()); } //nx = node; }
@Override public void visit(MathFunctionCall node) { System.out.println("MyMathFuncVisit"); mathfunctionHack = true; node.getOperand().accept(this); mathfunctionHack = false; UnaryOperation newOp; switch (node.getFunction()) { case SQRT: newOp = new SquareRoot(); break; case ABS: newOp = new Absolut(); break; case ACOS: newOp = new ArcCos(); break; case COS: newOp = new Cos(); break; case SIN: newOp = new Sin(); break; default: throw new UnsupportedOperationException("Math function " + node.toString() + " not supported."); } newOp.setData(toappend); toappend = newOp; addToGraph(toappend); }