public void analyze(AnalyzeContextInfo contextInfo, OrderSpec orderBy[]) throws XPathException {  LocalVariable mark = context.markLocalVariables(false);  contextInfo.setParent(this); inputSequence.analyze(contextInfo);   LocalVariable inVar = new LocalVariable(QName.parse(context, varName, null)); inVar.setSequenceType(sequenceType); context.declareVariableBinding(inVar);   if(positionalVariable != null) { LocalVariable posVar = new LocalVariable(QName.parse(context, positionalVariable, null)); posVar.setSequenceType(POSITIONAL_VAR_TYPE); context.declareVariableBinding(posVar); }  if(whereExpr != null) { AnalyzeContextInfo newContextInfo = new AnalyzeContextInfo(contextInfo); newContextInfo.setFlags(contextInfo.getFlags() | IN_PREDICATE | IN_WHERE_CLAUSE); newContextInfo.setContextId(getExpressionId()); whereExpr.analyze(newContextInfo); }    if(returnExpr instanceof BindingExpression) { AnalyzeContextInfo newContextInfo = new AnalyzeContextInfo(contextInfo); newContextInfo.addFlag(SINGLE_STEP_EXECUTION); ((BindingExpression)returnExpr).analyze(newContextInfo, orderBy); } else { AnalyzeContextInfo newContextInfo = new AnalyzeContextInfo(contextInfo); newContextInfo.addFlag(SINGLE_STEP_EXECUTION);  if(orderBy != null) { for(int i = 0; i < orderBy.length; i++) orderBy[i].analyze(newContextInfo); } returnExpr.analyze(newContextInfo); }   context.popLocalVariables(mark);
public void analyze(AnalyzeContextInfo contextInfo, OrderSpec orderBy[]) throws XPathException { analyze(contextInfo, orderBy, null);
    public void analyze(AnalyzeContextInfo contextInfo, OrderSpec orderBy[]) throws XPathException {        // Save the local variable stack		LocalVariable mark = context.markLocalVariables(false);				contextInfo.setParent(this);		inputSequence.analyze(contextInfo);				// Declare the iteration variable        LocalVariable inVar = new LocalVariable(QName.parse(context, varName, null));        inVar.setSequenceType(sequenceType);		context.declareVariableBinding(inVar);				// Declare positional variable		if(positionalVariable != null) {			LocalVariable posVar = new LocalVariable(QName.parse(context, positionalVariable, null));            posVar.setSequenceType(POSITIONAL_VAR_TYPE);            context.declareVariableBinding(posVar);        }        		if(whereExpr != null) {			AnalyzeContextInfo newContextInfo = new AnalyzeContextInfo(contextInfo);			newContextInfo.setFlags(contextInfo.getFlags() | IN_PREDICATE | IN_WHERE_CLAUSE);			newContextInfo.setContextId(getExpressionId());		    whereExpr.analyze(newContextInfo);		}		// the order by specs should be analyzed by the last binding expression		// in the chain to have access to all variables. So if the return expression		// is another binding expression, we just forward the order specs.		if(returnExpr instanceof BindingExpression) {			AnalyzeContextInfo newContextInfo = new AnalyzeContextInfo(contextInfo);			newContextInfo.addFlag(SINGLE_STEP_EXECUTION);		    ((BindingExpression)returnExpr).analyze(newContextInfo, orderBy);		} else {			AnalyzeContextInfo newContextInfo = new AnalyzeContextInfo(contextInfo);			newContextInfo.addFlag(SINGLE_STEP_EXECUTION);		    // analyze the order specs			if(orderBy != null) {			    for(int i = 0; i < orderBy.length; i++)			        orderBy[i].analyze(newContextInfo);			}			returnExpr.analyze(newContextInfo);		}				// restore the local variable stack		context.popLocalVariables(mark);    }