@Override public void validate(ComponentDeclaration decl) throws XPathException { slotManager = getConfiguration().makeSlotManager(); sourceBinding.validate(); }
@Override public void validate(ComponentDeclaration decl) throws XPathException { slotManager = getConfiguration().makeSlotManager(); sourceBinding.validate(); }
/** * Optimize the stylesheet construct * * @param declaration the declaration of this variable */ public void optimize(ComponentDeclaration declaration) throws XPathException { if (!redundant && compiledVariable.getSelectExpression() != null) { Expression exp2 = compiledVariable.getSelectExpression(); ExpressionVisitor visitor = makeExpressionVisitor(); exp2 = ExpressionTool.optimizeComponentBody( exp2, getCompilation(), visitor, getConfiguration().makeContextItemStaticInfo(AnyItemType.getInstance(), true), false); allocateLocalSlots(exp2); if (slotManager != null && slotManager.getNumberOfVariables() > 0) { compiledVariable.setContainsLocals(slotManager); } if (exp2 != compiledVariable.getSelectExpression()) { compiledVariable.setSelectExpression(exp2); } } }
/** * Optimize the stylesheet construct * * @param declaration the declaration of this variable */ public void optimize(ComponentDeclaration declaration) throws XPathException { if (!redundant && compiledVariable.getSelectExpression() != null) { Expression exp2 = compiledVariable.getSelectExpression(); ExpressionVisitor visitor = makeExpressionVisitor(); exp2 = ExpressionTool.optimizeComponentBody( exp2, getCompilation(), visitor, getConfiguration().makeContextItemStaticInfo(AnyItemType.getInstance(), true), false); allocateLocalSlots(exp2); if (slotManager != null && slotManager.getNumberOfVariables() > 0) { compiledVariable.setContainsLocals(slotManager); } if (exp2 != compiledVariable.getSelectExpression()) { compiledVariable.setSelectExpression(exp2); } } }
/** * Initialize - common code called from the compile() method of all subclasses * * @param var the representation of the variable declaration in the compiled executable */ protected void initializeBinding(GlobalVariable var) { Expression select = var.getSelectExpression(); Expression exp2 = select; if (exp2 != null) { try { ExpressionVisitor visitor = makeExpressionVisitor(); exp2 = select.simplify().typeCheck(visitor, getConfiguration().makeContextItemStaticInfo(Type.ITEM_TYPE, true)); } catch (XPathException err) { compileError(err); } // Add trace wrapper code if required exp2 = makeTraceInstruction(this, exp2); allocateLocalSlots(exp2); } if (slotManager != null && slotManager.getNumberOfVariables() > 0) { var.setContainsLocals(slotManager); } //StylesheetPackage pack = getCompilation().getStylesheetPackage(); //pack.registerGlobalVariable(gvar); if (exp2 != select) { var.setSelectExpression(exp2); } }
/** * Initialize - common code called from the compile() method of all subclasses * * @param var the representation of the variable declaration in the compiled executable */ protected void initializeBinding(GlobalVariable var) { Expression select = var.getSelectExpression(); Expression exp2 = select; if (exp2 != null) { try { ExpressionVisitor visitor = makeExpressionVisitor(); exp2 = select.simplify().typeCheck(visitor, getConfiguration().makeContextItemStaticInfo(Type.ITEM_TYPE, true)); } catch (XPathException err) { compileError(err); } // Add trace wrapper code if required exp2 = makeTraceInstruction(this, exp2); allocateLocalSlots(exp2); } if (slotManager != null && slotManager.getNumberOfVariables() > 0) { var.setContainsLocals(slotManager); } //StylesheetPackage pack = getCompilation().getStylesheetPackage(); //pack.registerGlobalVariable(gvar); if (exp2 != select) { var.setSelectExpression(exp2); } }