/** * Optimize the body of all global functions. This may involve inlining functions calls * * @throws net.sf.saxon.trans.XPathException * if an error occurs * @param topModule the top level module of the compilation unit whose functions are * to be optimized; functions in separately-compiled imported libraries * are unaffected. */ protected void optimizeGlobalFunctions(QueryModule topModule) throws XPathException { for (XQueryFunction fn : functions.values()) { if (((QueryModule)fn.getStaticContext()).getTopLevelModule() == topModule) { fn.optimize(); } } }
/** * Optimize the body of all global functions. This may involve inlining functions calls * * @throws net.sf.saxon.trans.XPathException * if an error occurs * @param topModule the top level module of the compilation unit whose functions are * to be optimized; functions in separately-compiled imported libraries * are unaffected. */ protected void optimizeGlobalFunctions(QueryModule topModule) throws XPathException { for (XQueryFunction fn : functions.values()) { if (((QueryModule)fn.getStaticContext()).getTopLevelModule() == topModule) { fn.optimize(); } } }
XQueryFunction fd = functions.get(functionName); if (fd != null) { if (fd.isPrivate() && fd.getStaticContext() != env) { reasons.add("Cannot call the private XQuery function " + functionName.getComponentName().getDisplayName() + " from outside its module");
XQueryFunction fd = functions.get(functionName); if (fd != null) { if (fd.isPrivate() && fd.getStaticContext() != env) { reasons.add("Cannot call the private XQuery function " + functionName.getComponentName().getDisplayName() + " from outside its module");
} else { ufc.setFunction(fn); ExpressionVisitor visitor = ExpressionVisitor.make(fd.getStaticContext()); visitor.setExecutable(fd.getExecutable()); ufc.checkFunctionCall(fn, visitor);
} else { ufc.setFunction(fn); ExpressionVisitor visitor = ExpressionVisitor.make(fd.getStaticContext()); visitor.setExecutable(fd.getExecutable()); ufc.checkFunctionCall(fn, visitor);
final Executable exec = ((QueryModule)getStaticContext()).getExecutable(); GlobalVariableManager manager = new GlobalVariableManager() { public void addGlobalVariable(GlobalVariable variable) throws XPathException {
final Executable exec = ((QueryModule)getStaticContext()).getExecutable(); GlobalVariableManager manager = new GlobalVariableManager() { public void addGlobalVariable(GlobalVariable variable) throws XPathException {
rsc = getStaticContext().makeRetainedStaticContext(); body.setRetainedStaticContext(rsc);
rsc = getStaticContext().makeRetainedStaticContext(); body.setRetainedStaticContext(rsc);