Examples of ParseTreeNode


Examples of com.google.caja.parser.ParseTreeNode

  }

  @VisibleForTesting
  static ParseTreeNode parse(InputSource is, CharProducer cp, String mime, MessageQueue mq)
      throws ParseException {
    ParseTreeNode ptn;
    if (mime.contains("javascript")) {
      JsLexer lexer = new JsLexer(cp);
      JsTokenQueue tq = new JsTokenQueue(lexer, is);
      if (tq.isEmpty()) { return null; }
      Parser p = new Parser(tq, mq);
View Full Code Here

Examples of com.google.caja.parser.ParseTreeNode

      ExternalReference extRef = new ExternalReference(javaUri,
          FilePosition.instance(is, /*lineNo*/ 1, /*charInFile*/ 1, /*charInLine*/ 1));
      // If the fetch fails, a UriFetchException is thrown and serialized as part of the
      // message queue.
      CharProducer cp = fetcher.fetch(extRef, mime).getTextualContent();
      ParseTreeNode ptn = parse(is, cp, mime, mq);
      return rewrite(uri, container, ptn, es53, debug);
    } catch (UnsupportedEncodingException e) {
      LOG.severe("Unexpected inability to recognize mime type: " + mime);
      mq.addMessage(ServiceMessageType.UNEXPECTED_INPUT_MIME_TYPE,
          MessagePart.Factory.valueOf(mime));
View Full Code Here

Examples of com.google.caja.parser.ParseTreeNode

  }

  @VisibleForTesting
  static ParseTreeNode parse(InputSource is, CharProducer cp, String mime, MessageQueue mq)
      throws ParseException {
    ParseTreeNode ptn;
    if (mime.contains("javascript")) {
      JsLexer lexer = new JsLexer(cp);
      JsTokenQueue tq = new JsTokenQueue(lexer, is);
      if (tq.isEmpty()) { return null; }
      Parser p = new Parser(tq, mq);
View Full Code Here

Examples of com.google.caja.parser.ParseTreeNode

      ExternalReference extRef = new ExternalReference(javaUri,
          FilePosition.instance(is, /*lineNo*/ 1, /*charInFile*/ 1, /*charInLine*/ 1));
      // If the fetch fails, a UriFetchException is thrown and serialized as part of the
      // message queue.
      CharProducer cp = fetcher.fetch(extRef, mime).getTextualContent();
      ParseTreeNode ptn = parse(is, cp, mime, mq);
      return rewrite(uri, container, ptn, es53, debug);
    } catch (UnsupportedEncodingException e) {
      LOG.severe("Unexpected inability to recognize mime type: " + mime);
      mq.addMessage(ServiceMessageType.UNEXPECTED_INPUT_MIME_TYPE,
          MessagePart.Factory.valueOf(mime));
View Full Code Here

Examples of org.exolab.castor.jdo.oql.ParseTreeNode

            return;
        }

        Lexer lexer = new Lexer(oql);
        Parser parser = new Parser(lexer);
        ParseTreeNode parseTree = parser.getParseTree();

        _dbEngine = ((AbstractDatabaseImpl) _database).getLockEngine();
        if (_dbEngine == null) {
            throw new QueryException("Could not get a persistence engine");
        }
View Full Code Here

Examples of org.olap4j.mdx.ParseTreeNode

        for (AxisNode an : newSelectNode.getAxisList()) {
            if (an.getAxis() == axis) {
                // this is the axis we're drilling

                ParseTreeNode initialAxisExp = an.getExpression();

                // apply the drill operation
                ParseTreeNode newAxisExp =
                    processAxisExp(initialAxisExp);

                // replace the expression in the axis by the new generated one
                an.setExpression(newAxisExp);
            }
View Full Code Here

Examples of org.olap4j.mdx.ParseTreeNode

                cnodes);
    }

    protected static CallNode generateCrossJoin(List<ParseTreeNode> selections)
    {
        ParseTreeNode sel1 = selections.remove(0);
        if (sel1 instanceof MemberNode) {
            sel1 = generateSetCall(sel1);
        }
        if (selections.size() == 1) {
            ParseTreeNode sel2 = selections.get(0);
            if (sel2 instanceof MemberNode) {
                sel2 = generateSetCall(sel2);
            }
            return new CallNode(
                null, "CrossJoin", Syntax.Function, sel1, sel2);
View Full Code Here

Examples of org.olap4j.mdx.ParseTreeNode

        List<ParseTreeNode> curr,
        List<List<ParseTreeNode>> unions,
        List<Selection> selsWithContext,
        List<List<ParseTreeNode>> contextUnions)
    {
        ParseTreeNode exceptSet = null;
        QueryDimension qDim = axis.getDimensions().get(dim);

        List<Selection> exclusionSelections = qDim.getExclusions();
        List<ParseTreeNode> exclusionNodes = new ArrayList<ParseTreeNode>();

        // Check if any exclusions are selected for this dimension
        // and convert them to a list of nodes and then later a set
        for (Selection exclusion : exclusionSelections) {
            exclusionNodes.add(toOlap4j(exclusion));
        }
        if (exclusionNodes.size() > 0) {
            exceptSet = generateListSetCall(exclusionNodes);
        }

        for (Selection sel : qDim.getInclusions()) {
            ParseTreeNode selectionNode = toOlap4j(sel);
            // If a sort Order was specified for this dimension
            // apply it for this inclusion
            if (qDim.getSortOrder() != null) {
                CallNode currentMemberNode = new CallNode(
                        null,
View Full Code Here

Examples of org.olap4j.mdx.ParseTreeNode

                callNode = generateCrossJoin(unions.get(0));
            }
        }

        // We might need to sort the whole axis.
        ParseTreeNode sortedNode = null;
        if (axis.getSortOrder() != null) {
            LiteralNode evaluatorNode =
                 LiteralNode.createSymbol(
                     null,
                     axis.getSortIdentifierNodeName());
View Full Code Here

Examples of org.olap4j.mdx.ParseTreeNode

    static ParseTreeNode toOlap4j(
        Member member,
        Selection.Operator oper)
    {
        ParseTreeNode node = null;
        try {
            switch (oper) {
            case MEMBER:
                node = new MemberNode(null, member);
                break;
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.