private static int getContextDepth(XPathContext c) { int i = 0; while (c != null) { c = c.getCaller(); i++; } return i; }
private static int getContextDepth(XPathContext c) { int i = 0; while (c != null) { c = c.getCaller(); i++; } return i; }
public void markContext(XPathContext context) { XPathContext c = context; while (!(c instanceof XPathContextMajor)) { c = c.getCaller(); } ((XPathContextMajor) c).requestTailCall(this, null); }
public void markContext(XPathContext context) { XPathContext c = context; while (!(c instanceof XPathContextMajor)) { c = c.getCaller(); } ((XPathContextMajor) c).requestTailCall(this, null); }
public TailCall processLeavingTail(XPathContext context) throws XPathException { XPathContext c = context; while (!(c instanceof XPathContextMajor)) { c = c.getCaller(); } XPathContextMajor cm = (XPathContextMajor)c; if (actualParams.length == 1) { cm.setLocalVariable(actualParams[0].getSlotNumber(), actualParams[0].getSelectValue(context)); } else { // we can't overwrite any of the parameters until we've evaluated all of them: test iterate012 Sequence[] oldVars = cm.getAllVariableValues(); Sequence[] newVars = Arrays.copyOf(oldVars, oldVars.length); for (WithParam wp : actualParams) { newVars[wp.getSlotNumber()] = wp.getSelectValue(context); } cm.resetAllVariableValues(newVars); } cm.requestTailCall(this, null); return null; }
public TailCall processLeavingTail(XPathContext context) throws XPathException { XPathContext c = context; while (!(c instanceof XPathContextMajor)) { c = c.getCaller(); } XPathContextMajor cm = (XPathContextMajor)c; if (actualParams.length == 1) { cm.setLocalVariable(actualParams[0].getSlotNumber(), actualParams[0].getSelectValue(context)); } else { // we can't overwrite any of the parameters until we've evaluated all of them: test iterate012 Sequence[] oldVars = cm.getAllVariableValues(); Sequence[] newVars = Arrays.copyOf(oldVars, oldVars.length); for (WithParam wp : actualParams) { newVars[wp.getSlotNumber()] = wp.getSelectValue(context); } cm.resetAllVariableValues(newVars); } cm.requestTailCall(this, null); return null; }
/** * Create a new "major" context (one that is capable of holding a stack frame with local variables * @param prev the previous context (the one causing the new context to be created) * @return the new major context */ public static XPathContextMajor newContext(XPathContextMinor prev) { XPathContextMajor c = new XPathContextMajor(); XPathContext p = prev; while (!(p instanceof XPathContextMajor)) { p = p.getCaller(); } c.controller = p.getController(); c.currentIterator = prev.getCurrentIterator(); c.stackFrame = prev.getStackFrame(); c.localParameters = p.getLocalParameters(); c.tunnelParameters = p.getTunnelParameters(); c.last = prev.last; c.currentReceiver = prev.currentReceiver; c.isTemporaryDestination = prev.isTemporaryDestination; c.currentMode = p.getCurrentMode(); c.currentTemplate = p.getCurrentTemplateRule(); c.currentRegexIterator = p.getCurrentRegexIterator(); c.currentGroupIterator = p.getCurrentGroupIterator(); c.caller = prev; c.tailCallFunction = null; return c; }
/** * Create a new "major" context (one that is capable of holding a stack frame with local variables * @param prev the previous context (the one causing the new context to be created) * @return the new major context */ public static XPathContextMajor newContext(XPathContextMinor prev) { XPathContextMajor c = new XPathContextMajor(); XPathContext p = prev; while (!(p instanceof XPathContextMajor)) { p = p.getCaller(); } c.controller = p.getController(); c.currentIterator = prev.getCurrentIterator(); c.stackFrame = prev.getStackFrame(); c.localParameters = p.getLocalParameters(); c.tunnelParameters = p.getTunnelParameters(); c.last = prev.last; c.currentReceiver = prev.currentReceiver; c.isTemporaryDestination = prev.isTemporaryDestination; c.currentMode = p.getCurrentMode(); c.currentTemplate = p.getCurrentTemplateRule(); c.currentRegexIterator = p.getCurrentRegexIterator(); c.currentGroupIterator = p.getCurrentGroupIterator(); c.caller = prev; c.tailCallFunction = null; return c; }
/** * Create a new "major" context (one that is capable of holding a stack frame with local variables * @param prev the previous context (the one causing the new context to be created) * @return the new major context */ public static XPathContextMajor newContext(XPathContextMinor prev) { XPathContextMajor c = new XPathContextMajor(); XPathContext p = prev; while (!(p instanceof XPathContextMajor)) { p = p.getCaller(); } c.controller = p.getController(); c.currentIterator = prev.getCurrentIterator(); c.stackFrame = prev.getStackFrame(); c.localParameters = p.getLocalParameters(); c.tunnelParameters = p.getTunnelParameters(); c.last = prev.last; c.currentReceiver = prev.currentReceiver; c.isTemporaryDestination = prev.isTemporaryDestination; c.currentMode = p.getCurrentMode(); c.currentTemplate = p.getCurrentTemplateRule(); c.currentRegexIterator = p.getCurrentRegexIterator(); c.currentGroupIterator = p.getCurrentGroupIterator(); c.caller = prev; c.tailCallFunction = null; return c; }
XPathContext p = prev; while (!(p instanceof XPathContextMajor)) { p = p.getCaller();
XPathContext p = prev; while (!(p instanceof XPathContextMajor)) { p = p.getCaller();
context = context.getCaller();
Rule head = chain == null ? null : chain.head(); while (!(context instanceof XPathContextMajor)) { context = context.getCaller();
context = context.getCaller();
Rule head = chain == null ? null : chain.head(); while (!(context instanceof XPathContextMajor)) { context = context.getCaller();