Examples of ExpressionVisitor


Examples of net.sf.saxon.expr.ExpressionVisitor

     * This method is for internal use.
     * @param env the static context for the main query body.
     */

    protected void fixupGlobalFunctions(QueryModule env) throws XPathException {
        ExpressionVisitor visitor = ExpressionVisitor.make(env);
        Iterator<XQueryFunction> iter = functions.values().iterator();
        while (iter.hasNext()) {
            XQueryFunction fn = iter.next();
            fn.compile();
        }
        iter = functions.values().iterator();
        while (iter.hasNext()) {
            XQueryFunction fn = iter.next();
            visitor.setExecutable(fn.getExecutable());
            fn.checkReferences(visitor);
        }
    }
View Full Code Here

Examples of net.sf.saxon.expr.ExpressionVisitor

                body = Literal.makeEmptySequence();
            }

            try {

                ExpressionVisitor visitor = makeExpressionVisitor();
                body = visitor.simplify(body);
                if (getConfiguration().isCompileWithTracing()) {
                    TraceWrapper trace = new TraceInstruction(body, this);
                    trace.setLocationId(allocateLocationId(getSystemId(), getLineNumber()));
                    trace.setContainer(procedure);
                    body = trace;
View Full Code Here

Examples of net.sf.saxon.expr.ExpressionVisitor

        return createExpressionInternal(expression);
    }

    private XPathExpressionImpl createExpressionInternal(String expression) throws net.sf.saxon.trans.XPathException {
        Expression exp = ExpressionTool.make(expression, staticContext, 0, -1, 1, false);
        ExpressionVisitor visitor = ExpressionVisitor.make(staticContext);
        visitor.setExecutable(getExecutable());
        exp = visitor.typeCheck(exp, Type.ITEM_TYPE);
        SlotManager map = staticContext.getConfiguration().makeSlotManager();
        ExpressionTool.allocateSlots(exp, 0, map);
        exp.setContainer(staticContext);
        XPathExpressionImpl xpe = new XPathExpressionImpl(exp, getExecutable());
        xpe.setStackFrameMap(map);
View Full Code Here

Examples of net.sf.saxon.expr.ExpressionVisitor

     * @deprecated since Saxon 8.9 - use the various method defined in the JAXP interface definition
    */

    public List evaluate(String expression) throws net.sf.saxon.trans.XPathException {
        Expression exp = ExpressionTool.make(expression, staticContext,0,-1,1, false);
        ExpressionVisitor visitor = ExpressionVisitor.make(staticContext);
        visitor.setExecutable(getExecutable());
        exp = visitor.typeCheck(exp, Type.ITEM_TYPE);
        SlotManager map = staticContext.getConfiguration().makeSlotManager();
        ExpressionTool.allocateSlots(exp, 0, map);
        XPathContextMajor context = new XPathContextMajor(contextNode, staticContext.getExecutable());
        context.openStackFrame(map);
        SequenceIterator iterator = exp.iterate(context);
View Full Code Here

Examples of net.sf.saxon.expr.ExpressionVisitor

     * @deprecated since Saxon 8.9 - use the methods defined in the JAXP interface
    */

    public Object evaluateSingle(String expression) throws net.sf.saxon.trans.XPathException {
        Expression exp = ExpressionTool.make(expression, staticContext,0,-1,1, false);
        ExpressionVisitor visitor = ExpressionVisitor.make(staticContext);
        visitor.setExecutable(getExecutable());
        exp = visitor.typeCheck(exp, Type.ITEM_TYPE);
        SlotManager map = staticContext.getConfiguration().makeSlotManager();
        ExpressionTool.allocateSlots(exp, 0, map);
        XPathContextMajor context = new XPathContextMajor(contextNode, staticContext.getExecutable());
        context.openStackFrame(map);
        SequenceIterator iterator = exp.iterate(context);
View Full Code Here

Examples of net.sf.saxon.expr.ExpressionVisitor

    */

    public XPathExpression createExpression(String expression) throws XPathException {
        Expression exp = ExpressionTool.make(expression, staticContext, 0, -1, 1, false);
        exp.setContainer(staticContext);
        ExpressionVisitor visitor = ExpressionVisitor.make(staticContext);
        visitor.setExecutable(getExecutable());
        exp = visitor.typeCheck(exp, Type.ITEM_TYPE);
        SlotManager map = staticContext.getStackFrameMap();
        int numberOfExternalVariables = map.getNumberOfVariables();
        ExpressionTool.allocateSlots(exp, numberOfExternalVariables, map);
        XPathExpression xpe = new XPathExpression(this, exp);
        xpe.setStackFrameMap(map, numberOfExternalVariables);
View Full Code Here

Examples of org.apache.olingo.odata2.api.uri.expression.ExpressionVisitor

  }

  public ParserTool printSerialized() {
    String actual = null;
    ExpressionVisitor visitor = new VisitorTool();
    try {
      actual = tree.accept(visitor).toString();
    } catch (ExceptionVisitExpression e) {
      fail("Error in visitor:" + e.getLocalizedMessage());
    } catch (ODataApplicationException e) {
View Full Code Here

Examples of org.apache.xalan.extensions.ExpressionVisitor

          throws javax.xml.transform.TransformerException
  {
    ErrorListener handler = m_stylesheetProcessor.getErrorListener();
    XPath xpath = new XPath(str, owningTemplate, this, XPath.SELECT, handler);
    // Visit the expression, registering namespaces for any extension functions it includes.
    xpath.callVisitors(xpath, new ExpressionVisitor(getStylesheetRoot()));
    return xpath;
  }
View Full Code Here

Examples of org.apache.xalan.extensions.ExpressionVisitor

          throws javax.xml.transform.TransformerException
  {
    ErrorListener handler = m_stylesheetProcessor.getErrorListener();
    XPath xpath = new XPath(str, owningTemplate, this, XPath.MATCH, handler);
    // Visit the expression, registering namespaces for any extension functions it includes.
    xpath.callVisitors(xpath, new ExpressionVisitor(getStylesheetRoot()));
    return xpath;   
  }
View Full Code Here

Examples of org.apache.xalan.extensions.ExpressionVisitor

  {
    ErrorListener handler = m_stylesheetProcessor.getErrorListener();
    XPath xpath = new XPath(str, owningTemplate, this, XPath.SELECT, handler,
            m_funcTable);
    // Visit the expression, registering namespaces for any extension functions it includes.
    xpath.callVisitors(xpath, new ExpressionVisitor(getStylesheetRoot()));
    return xpath;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.