public StructuredQName getObjectName() { return getFunctionName(); }
public StructuredQName getObjectName() { return getFunctionName(); }
public StructuredQName getObjectName() { return getFunctionName(); }
/** * Mark tail-recursive calls on stylesheet functions. This marks the function call as tailRecursive if * if is a call to the containing function, and in this case it also returns "true" to the caller to indicate * that a tail call was found. */ public int markTailFunctionCalls(StructuredQName qName, int arity) { tailCall = true; return (getFunctionName().equals(qName) && arity == getNumberOfArguments() ? 2 : 1); }
/** * Mark tail-recursive calls on stylesheet functions. This marks the function call as tailRecursive if * if is a call to the containing function, and in this case it also returns "true" to the caller to indicate * that a tail call was found. */ public int markTailFunctionCalls(StructuredQName qName, int arity) { tailCall = getFunctionName().equals(qName) && arity == getArity() ? SELF_TAIL_CALL : FOREIGN_TAIL_CALL; return tailCall; }
/** * Mark tail-recursive calls on stylesheet functions. This marks the function call as tailRecursive if * if is a call to the containing function, and in this case it also returns "true" to the caller to indicate * that a tail call was found. */ public int markTailFunctionCalls(StructuredQName qName, int arity) { tailCall = true; return (getFunctionName().equals(qName) && arity == getNumberOfArguments() ? 2 : 1); }
/** * Mark tail-recursive calls on stylesheet functions. This marks the function call as tailRecursive if * if is a call to the containing function, and in this case it also returns "true" to the caller to indicate * that a tail call was found. */ public int markTailFunctionCalls(StructuredQName qName, int arity) { tailCall = getFunctionName().equals(qName) && arity == getArity() ? SELF_TAIL_CALL : FOREIGN_TAIL_CALL; return tailCall; }
/** * Mark tail-recursive calls on stylesheet functions. This marks the function call as tailRecursive if * if is a call to the containing function, and in this case it also returns "true" to the caller to indicate * that a tail call was found. */ public int markTailFunctionCalls(StructuredQName qName, int arity) { tailCall = true; return (getFunctionName().equals(qName) && arity == getNumberOfArguments() ? 2 : 1); }
public SymbolicName getSymbolicName() { return new SymbolicName.F(getFunctionName(), getArity()); }
public SymbolicName getSymbolicName() { return new SymbolicName.F(getFunctionName(), getArity()); }
/** * Gather a list of the names of the user-defined functions which a given expression calls directly * @param e the expression being tested * @param list a list of the functions that are called. The items in this list are strings in the format * "{uri}local/arity" */ public static void gatherCalledFunctionNames(Expression e, List list) { if (e instanceof UserFunctionCall) { StructuredQName name = ((UserFunctionCall)e).getFunctionName(); int arity = ((UserFunctionCall)e).getNumberOfArguments(); String key = name.getClarkName() + "/" + arity; if (!list.contains(key)) { list.add(key); } } else { for (Iterator children = e.iterateSubExpressions(); children.hasNext();) { Expression child = (Expression)children.next(); gatherCalledFunctionNames(child, list); } } }
/** * Gather a list of the names of the user-defined functions which a given expression calls directly * @param e the expression being tested * @param list a list of the functions that are called. The items in this list are strings in the format * "{uri}local/arity" */ public static void gatherCalledFunctionNames(Expression e, List list) { if (e instanceof UserFunctionCall) { StructuredQName name = ((UserFunctionCall)e).getFunctionName(); int arity = ((UserFunctionCall)e).getNumberOfArguments(); String key = name.getClarkName() + "/" + arity; if (!list.contains(key)) { list.add(key); } } else { for (Iterator children = e.iterateSubExpressions(); children.hasNext();) { Expression child = (Expression)children.next(); gatherCalledFunctionNames(child, list); } } }
final StructuredQName q = ufc.getFunctionName(); final int arity = ufc.getArity();
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void export(ExpressionPresenter out) throws XPathException { out.startElement("ufCall", this); if (getFunctionName() != null) { out.emitAttribute("name", getFunctionName()); out.emitAttribute("tailCall", tailCall == NOT_TAIL_CALL ? "false" : tailCall == SELF_TAIL_CALL ? "self" : "foreign"); } out.emitAttribute("bSlot", "" + getBindingSlot()); if (argumentEvaluators != null && getArity() > 0) { FastStringBuffer fsb = new FastStringBuffer(FastStringBuffer.C64); for (Evaluator e : argumentEvaluators) { fsb.append(e.getCode() + " "); } out.emitAttribute("eval", Whitespace.trim(fsb)); } for (Operand o : operands()) { o.getChildExpression().export(out); } if (getFunctionName() == null) { out.setChildRole("inline"); function.getBody().export(out); out.endElement(); } out.endElement(); }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void export(ExpressionPresenter out) throws XPathException { out.startElement("ufCall", this); if (getFunctionName() != null) { out.emitAttribute("name", getFunctionName()); out.emitAttribute("tailCall", tailCall == NOT_TAIL_CALL ? "false" : tailCall == SELF_TAIL_CALL ? "self" : "foreign"); } out.emitAttribute("bSlot", "" + getBindingSlot()); if (argumentEvaluators != null && getArity() > 0) { FastStringBuffer fsb = new FastStringBuffer(FastStringBuffer.C64); for (Evaluator e : argumentEvaluators) { fsb.append(e.getCode() + " "); } out.emitAttribute("eval", Whitespace.trim(fsb)); } for (Operand o : operands()) { o.getChildExpression().export(out); } if (getFunctionName() == null) { out.setChildRole("inline"); function.getBody().export(out); out.endElement(); } out.endElement(); }
final StructuredQName q = ufc.getFunctionName(); final int arity = ufc.getNumberOfArguments();
final StructuredQName q = ufc.getFunctionName(); final int arity = ufc.getNumberOfArguments();
logger.trace("iterateParams; switching to UDF: {}", ufc.getFunctionName()); ex = ufc.getFunction().getBody();
/** * Get diagnostic information about this expression */ public InstructionInfo getInstructionInfo() { InstructionDetails details = new InstructionDetails(); details.setConstructType(Location.FUNCTION_CALL); details.setLineNumber(getLineNumber()); details.setSystemId(getSystemId()); details.setObjectName(getFunctionName()); details.setProperty("expression", this); details.setProperty("target", function); return details; }
/** * Get diagnostic information about this expression */ public InstructionInfo getInstructionInfo() { InstructionDetails details = new InstructionDetails(); details.setConstructType(Location.FUNCTION_CALL); details.setLineNumber(getLineNumber()); details.setSystemId(getSystemId()); details.setObjectName(getFunctionName()); details.setProperty("expression", this); details.setProperty("target", function); return details; }