Package com.impossibl.postgres.jdbc.SQLTextTree

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


  static Node grammar(String val) {
    return new GrammarPiece(val, -1);
  }

  static Node literal(Number val) {
    return new NumericLiteralPiece(val.toString(), -1);
  }
View Full Code Here


  }

  private static int consumeNumeric(final String sql, final int start, final CompositeNode parent) throws ParseException {
    Matcher matcher = Pattern.compile("((?:[+-]?(?:\\d+)?(?:\\.\\d+(?:[eE][+-]?\\d+)?))|(?:[+-]?\\d+))").matcher(sql.substring(start));
    if (matcher.find()) {
      parent.add(new NumericLiteralPiece(matcher.group(1), matcher.start()));
      return start + matcher.group(1).length();
    }
    else {
      throw new ParseException("Invalid numeric literal", start);
    }
View Full Code Here

TOP

Related Classes of com.impossibl.postgres.jdbc.SQLTextTree.NumericLiteralPiece

Copyright © 2018 www.massapicom. 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.