private void handleUnary(UnaryOperation node, String operator) { result.append("("); result.append(operator); result.append("("); node.getOperand().accept(this); result.append("))"); }
/** * Dummy method for traversing a unary operation node * @param node The unary operation node */ private void traverseUnary(UnaryOperation node) { node.getOperand().accept(this); }
private void addUnaryOp(UnaryOperation node, String operator) { addNode(node, operator); node.getOperand().accept(this); addEdge(node.getOperand(), node); }
@Override protected void visitUnaryOperation(UnaryOperation node) { resultValue = null; node.getOperand().accept(this); if (resultValue != null) { node.setOperand(resultValue); resultValue = null; } }
/** * Visits a UnaryOperation instance * @param unaryOperation The UnaryOperation */ private void visitUnaryOperation(UnaryOperation unaryOperation) { unaryOperation.getOperand().accept(this); if (replace) { unaryOperation.setOperand(toReplace); replace = false; } }
@Override protected void visitUnaryOperation(UnaryOperation node) { node.getOperand().accept(expressionVisitor); if (replaceWith != null) { node.setOperand(replaceWith); replaceWith = null; } }
@Override protected void visitUnaryOperation(UnaryOperation node) { node.getOperand().accept(this); if (result != null) { node.setOperand(result); result = null; } }
@Override protected void visitUnaryOperation(UnaryOperation node) { if (node == toReplace) { result = replacement; return; } if (node.getOperand() == toReplace) { node.setOperand(replacement); } super.visitUnaryOperation(node); }
@Override protected void visitUnaryOperation(UnaryOperation node) { resultValue = null; node.getOperand().accept(this); if (resultValue != null) { node.setOperand(resultValue); resultValue = null; } }
/** * Creates a extended calculation from an unary operation * @param node The unary operation node * @param type The calculation type */ private void createExtCalculationFromUnaryOperation(UnaryOperation node, CalculationType type) { resultValue = null; node.getOperand().accept(this); resultValue = new ExtCalculation(type, resultValue, null); }