@Override public void visit(ExprFunctionOp funcOp) { funcOp.getGraphPattern().visit(visitor) ; } }
@Override public void visit(ExprFunctionOp funcOp) { walk(funcOp.getGraphPattern()); if ( exprVisitor != null ) funcOp.visit(exprVisitor) ; }
@Override public void visit(ExprFunctionOp funcOp) { Collection<Var> vars = OpVars.visibleVars(funcOp.getGraphPattern()) ; for ( Var v : vars ) action.var(acc, v) ; }
@Override public void visit(ExprFunctionOp funcOp) { ElementRewriter elementRewriter = new ElementRewriter(values); funcOp.getElement().visit(elementRewriter); OpRewriter opRewriter = new OpRewriter(values); funcOp.getGraphPattern().visit(opRewriter); try { Constructor<? extends ExprFunctionOp> con = funcOp.getClass() .getConstructor(Element.class, Op.class); push(con.newInstance(elementRewriter.pop(), opRewriter.pop())); } catch (NoSuchMethodException e) { throw new IllegalStateException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } catch (InstantiationException e) { throw new IllegalStateException(e); } catch (IllegalAccessException e) { throw new IllegalStateException(e); } catch (InvocationTargetException e) { throw new IllegalStateException(e); } }
@Override public void visit(ExprFunctionOp funcOp) { ElementRewriter elementRewriter = new ElementRewriter(values); funcOp.getElement().visit(elementRewriter); OpRewriter opRewriter = new OpRewriter(values); funcOp.getGraphPattern().visit(opRewriter); try { Constructor<? extends ExprFunctionOp> con = funcOp.getClass() .getConstructor(Element.class, Op.class); push(con.newInstance(elementRewriter.pop(), opRewriter.pop())); } catch (NoSuchMethodException e) { throw new IllegalStateException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } catch (InstantiationException e) { throw new IllegalStateException(e); } catch (IllegalAccessException e) { throw new IllegalStateException(e); } catch (InvocationTargetException e) { throw new IllegalStateException(e); } }
private Expr xform(ExprFunctionOp funcOp, ExprList args, Op opArg) { if ( !alwaysCopy && equals1(funcOp.getArgs(), args.getList()) && funcOp.getGraphPattern() == opArg ) return funcOp ; return funcOp.copy(args, opArg) ; }
@Override public Expr transform(ExprFunctionOp funcOp, ExprList args, Op opArg) { // Manually transform each argument Op op = Transformer.transform(new TransformCopy(), this, funcOp.getGraphPattern()); ExprList newArgs = new ExprList(); for (int i = 0; i < args.size(); i++) { Expr curr = args.get(i); Expr newArg = ExprTransformer.transform(this, curr) ; newArgs.add(newArg); } return funcOp.copy(newArgs, op); }
@Override public void visit(ExprFunctionOp funcOp) { out.print("(") ; // How far we are from current indent to current location // (beginning of operator name) int x = out.getCurrentOffset() ; // Indent to "(" out.incIndent(x) ; out.print(funcOp.getFunctionName(context)) ; out.incIndent() ; Op op = funcOp.getGraphPattern() ; if ( oneLine(op) ) out.print(" ") ; else out.ensureStartOfLine() ; // Ensures we are unit indent under the (operator ...) // Without trappings. WriterOp.outputNoPrologue(out, funcOp.getGraphPattern(), context) ; out.decIndent() ; out.decIndent(x) ; out.print(")") ; return ; }
@Override public void visit(ExprFunctionOp funcOp) { String fn = funcOp.getFunctionPrintName(context) ; if ( funcOp instanceof E_NotExists ) fn = "NOT EXISTS" ; else if ( funcOp instanceof E_Exists ) fn = "EXISTS" ; else throw new ARQInternalErrorException("Unrecognized ExprFunctionOp: "+fn) ; FormatterElement fmtElt = new FormatterElement(out, context) ; out.print(fn) ; out.print(" ") ; int indent = out.getAbsoluteIndent() ; int currentCol = out.getCol() ; try { out.setAbsoluteIndent(currentCol); Element el = funcOp.getElement() ; if ( el == null ) el = OpAsQuery.asQuery(funcOp.getGraphPattern()).getQueryPattern() ; el.visit(fmtElt) ; } finally { out.setAbsoluteIndent(indent); } }