@Override public void meet(Reduced node) throws RuntimeException { TupleExpr child = node.getArg(); if(!isSupported(child) && child instanceof UnaryTupleOperator) { UnaryTupleOperator replacement = (UnaryTupleOperator)child.clone(); // switch positions of child and node node.replaceWith(replacement); node.setArg(((UnaryTupleOperator) child).getArg().clone()); replacement.setArg(node.clone()); // visit the newly inserted replacement node (i.e. the clone of child now containing the old "node" as // child, so "node" can be bubbled down further if needed) replacement.visit(this); } }
@Override public void meet(Slice node) throws RuntimeException { TupleExpr child = node.getArg(); if(!isSupported(child) && child instanceof UnaryTupleOperator) { UnaryTupleOperator replacement = (UnaryTupleOperator)child.clone(); // switch positions of child and node node.replaceWith(replacement); node.setArg(((UnaryTupleOperator) child).getArg().clone()); replacement.setArg(node.clone()); // visit the newly inserted replacement node (i.e. the clone of child now containing the old "node" as // child, so "node" can be bubbled down further if needed) replacement.visit(this); } }
@Override public void meet(Distinct node) throws RuntimeException { TupleExpr child = node.getArg(); if(!isSupported(child) && child instanceof UnaryTupleOperator) { UnaryTupleOperator replacement = (UnaryTupleOperator)child.clone(); // switch positions of child and node node.replaceWith(replacement); node.setArg(((UnaryTupleOperator) child).getArg().clone()); replacement.setArg(node.clone()); // visit the newly inserted replacement node (i.e. the clone of child now containing the old "node" as // child, so "node" can be bubbled down further if needed) replacement.visit(this); } }