/** * Make a LetExpression. This returns an ordinary LetExpression if tracing is off, and an EagerLetExpression * if tracing is on. This is so that trace events occur in an order that the user can follow. * @return the constructed "let" expression */ private LetExpression makeLetExpression() { if (env.getConfiguration().isCompileWithTracing()) { return new EagerLetExpression(); } else { return new LetExpression(); } }
/** * Make a LetExpression. This returns an ordinary LetExpression if tracing is off, and an EagerLetExpression * if tracing is on. This is so that trace events occur in an order that the user can follow. * @return the constructed "let" expression */ private LetExpression makeLetExpression() { if (env.getConfiguration().isCompileWithTracing()) { return new EagerLetExpression(); } else { return new LetExpression(); } }
/** * Make a LetExpression. This returns an ordinary LetExpression if tracing is off, and an EagerLetExpression * if tracing is on. This is so that trace events occur in an order that the user can follow. * * @return the constructed "let" expression */ /*@NotNull*/ protected LetExpression makeLetExpression() { if (((QueryModule)env).getUserQueryContext().isCompileWithTracing()) { return new EagerLetExpression(); } else { return new LetExpression(); } }
/** * Make a LetExpression. This returns an ordinary LetExpression if tracing is off, and an EagerLetExpression * if tracing is on. This is so that trace events occur in an order that the user can follow. * * @return the constructed "let" expression */ /*@NotNull*/ protected LetExpression makeLetExpression() { if (((QueryModule)env).getUserQueryContext().isCompileWithTracing()) { return new EagerLetExpression(); } else { return new LetExpression(); } }
/** * Copy an expression. This makes a deep copy. * @return the copy of the original expression */ public Expression copy() { LetExpression let = new LetExpression(); let.setVariableQName(variableName); let.setRequiredType(requiredType); let.setSequence(sequence.copy()); Expression newAction = action.copy(); let.setAction(newAction); ExpressionTool.rebindVariableReferences(newAction, this, let); return let; }
/** * Copy an expression. This makes a deep copy. * @return the copy of the original expression */ public Expression copy() { LetExpression let = new LetExpression(); let.setVariableQName(variableName); let.setRequiredType(requiredType); let.setSequence(sequence.copy()); Expression newAction = action.copy(); let.setAction(newAction); ExpressionTool.rebindVariableReferences(newAction, this, let); return let; }
/** * Copy an expression. This makes a deep copy. * @return the copy of the original expression */ public Expression copy() { LetExpression let = new LetExpression(); let.setVariableQName(variableName); let.setRequiredType(requiredType); let.setSequence(sequence.copy()); Expression newAction = action.copy(); let.setAction(newAction); ExpressionTool.rebindVariableReferences(newAction, this, let); return let; }
/** * Resolve calls to the XSLT current() function within an expression * @param exp the expression within which calls to current() should be resolved * @param config the Saxon configuration * @return the expression after resolving calls to current() */ public static Expression resolveCallsToCurrentFunction(Expression exp, Configuration config) throws XPathException { if (callsFunction(exp, Current.FN_CURRENT)) { LetExpression let = new LetExpression(); let.setVariableQName( new StructuredQName("saxon", NamespaceConstant.SAXON, "current" + exp.hashCode())); let.setRequiredType(SequenceType.SINGLE_ITEM); let.setSequence(new CurrentItemExpression()); PromotionOffer offer = new PromotionOffer(config.getOptimizer()); offer.action = PromotionOffer.REPLACE_CURRENT; offer.containingExpression = let; exp = exp.promote(offer); let.setAction(exp); return let; } else { return exp; } }
/** * Resolve calls to the XSLT current() function within an expression * @param exp the expression within which calls to current() should be resolved * @param config the Saxon configuration * @return the expression after resolving calls to current() */ public static Expression resolveCallsToCurrentFunction(Expression exp, Configuration config) throws XPathException { if (callsFunction(exp, Current.FN_CURRENT)) { LetExpression let = new LetExpression(); let.setVariableQName( new StructuredQName("saxon", NamespaceConstant.SAXON, "current" + exp.hashCode())); let.setRequiredType(SequenceType.SINGLE_ITEM); let.setSequence(new CurrentItemExpression()); PromotionOffer offer = new PromotionOffer(config.getOptimizer()); offer.action = PromotionOffer.REPLACE_CURRENT; offer.containingExpression = let; exp = exp.promote(offer); let.setAction(exp); return let; } else { return exp; } }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression * @param rebindings variables whose binding needs to change */ /*@NotNull*/ public Expression copy(RebindingMap rebindings) { LetExpression let = new LetExpression(); ExpressionTool.copyLocationInfo(this, let); let.isIndexedVariable = isIndexedVariable; let.hasLoopingReference = hasLoopingReference; let.setNeedsEagerEvaluation(needsEagerEvaluation); let.setNeedsLazyEvaluation(needsLazyEvaluation); let.setVariableQName(variableName); let.setRequiredType(requiredType); let.setSequence(getSequence().copy(rebindings)); let.setInstruction(isInstruction()); Expression newAction = getAction().copy(rebindings); let.setAction(newAction); ExpressionTool.rebindVariableReferences(newAction, this, let); return let; }
assert oldOperand != null; LetExpression let = new LetExpression(); let.setVariableQName(new StructuredQName("vv", NamespaceConstant.SAXON_GENERATED_VARIABLE, "v" + sequence++)); SequenceType type = SequenceType.makeSequenceType(child.getItemType(), child.getCardinality());
String var = t.currentTokenValue; LetExpression v = new LetExpression(); StructuredQName varQName = makeStructuredQName(var, false); v.setRequiredType(SequenceType.ANY_SEQUENCE);
LetExpression let = new LetExpression(); let.setVariableQName(new StructuredQName("zz", NamespaceConstant.SAXON, "zz" + let.hashCode())); SequenceType type = SequenceType.makeSequenceType(child.getItemType(th), child.getCardinality());
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression * @param rebindings variables whose binding needs to change */ /*@NotNull*/ public Expression copy(RebindingMap rebindings) { LetExpression let = new LetExpression(); ExpressionTool.copyLocationInfo(this, let); let.isIndexedVariable = isIndexedVariable; let.hasLoopingReference = hasLoopingReference; let.setNeedsEagerEvaluation(needsEagerEvaluation); let.setNeedsLazyEvaluation(needsLazyEvaluation); let.setVariableQName(variableName); let.setRequiredType(requiredType); let.setSequence(getSequence().copy(rebindings)); let.setInstruction(isInstruction()); Expression newAction = getAction().copy(rebindings); let.setAction(newAction); ExpressionTool.rebindVariableReferences(newAction, this, let); return let; }
LetExpression let = new LetExpression(); let.setVariableQName( new StructuredQName("vv", NamespaceConstant.SAXON_GENERATED_VARIABLE, "current" + exp.hashCode()));
String var = t.currentTokenValue; LetExpression v = new LetExpression(); StructuredQName varQName = makeStructuredQName(var, false); v.setRequiredType(SequenceType.ANY_SEQUENCE);
LetExpression let = new LetExpression(); let.setVariableQName(new StructuredQName("zz", NamespaceConstant.SAXON, "zz" + let.hashCode())); SequenceType type = SequenceType.makeSequenceType(child.getItemType(th), child.getCardinality());
LetExpression let = new LetExpression(); let.setVariableQName(new StructuredQName("zz", NamespaceConstant.SAXON, "zz" + let.hashCode())); SequenceType type = SequenceType.makeSequenceType(child.getItemType(th), child.getCardinality());
} else if ((exp.getDependencies() & (StaticProperty.DEPENDS_ON_CONTEXT_ITEM | StaticProperty.DEPENDS_ON_CONTEXT_DOCUMENT)) != 0) { LetExpression let = new LetExpression(); let.setVariableQName( new StructuredQName("saxon", NamespaceConstant.SAXON, "dot" + exp.hashCode()));
LetExpression let = new LetExpression(); let.setVariableQName( new StructuredQName("vv", NamespaceConstant.SAXON_GENERATED_VARIABLE, "current" + exp.hashCode()));