예제 #1
0
  String getStatement(int startPosition, short[] startTokens) {

    int semiPosition = 0;

    while (true) {
      if (token.tokenType == Tokens.SEMICOLON) {
        semiPosition = scanner.getPosition();
      } else if (token.tokenType == Tokens.X_ENDPARSE) {
        if (semiPosition == 0) {
          break;
        } else {
          rewind(semiPosition);

          break;
        }
      } else {
        semiPosition = 0;

        if (ArrayUtil.find(startTokens, token.tokenType) != -1) {
          break;
        }
      }

      read();
    }

    String sql = scanner.getPart(startPosition, scanner.getPosition());

    return sql;
  }
예제 #2
0
 String getLastPart(int position) {
   return scanner.getPart(position, scanner.getTokenPosition());
 }
예제 #3
0
 String getLastPartAndCurrent(int position) {
   return scanner.getPart(position, scanner.getPosition());
 }
예제 #4
0
 String getLastPart() {
   return scanner.getPart(parsePosition, scanner.getTokenPosition());
 }