Examples of ParenGroupNode


Examples of com.impossibl.postgres.jdbc.SQLTextTree.ParenGroupNode

    return sequence(name, groupedBy(args, ","));
  }

  static ParenGroupNode groupedBy(List<Node> args, String sep) {

    ParenGroupNode groupNode = new ParenGroupNode(-1);

    Iterator<Node> argsIter = args.iterator();
    while (argsIter.hasNext()) {
      groupNode.add(argsIter.next());
      if (argsIter.hasNext()) {
        groupNode.add(new GrammarPiece(sep, -1));
      }
    }

    return groupNode;
  }
View Full Code Here

Examples of com.impossibl.postgres.jdbc.SQLTextTree.ParenGroupNode

    return groupNode;
  }

  static ParenGroupNode groupedSequence(Object... args) {

    ParenGroupNode groupNode = new ParenGroupNode(-1);

    sequence(groupNode, asList(args));

    return groupNode;
  }
View Full Code Here

Examples of com.impossibl.postgres.jdbc.SQLTextTree.ParenGroupNode

    return start + 1;
  }

  private static int consumeParens(final String sql, final int start, final Deque<CompositeNode> parents) throws ParseException {
    if (sql.charAt(start) == '(') {
      parents.push(new ParenGroupNode(start));
    }
    else {
      if (parents.peek() instanceof ParenGroupNode) {
        ParenGroupNode tmp = (ParenGroupNode) parents.pop();
        tmp.setEndPos(start);
        parents.peek().add(tmp);
      }
      else {
        throw new ParseException("Mismmatched parenthesis", start);
      }
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.