private Token parseTextToken(String fullPattern, boolean fillMode, int begin) {
    checkFillModeOff(fillMode, begin);
    int end = begin;
    do {
      end = fullPattern.indexOf('\"', end + 1);
      if (end == -1) {
        throw new IllegalArgumentException(
            "Missing closing double quote (\") opened at index " + begin);
      }
    // if double quote is escaped with a backslash, keep looking for the closing quotation mark
    } while ("\\".equals(fullPattern.substring(end - 1, end)));
    Token lastAddedToken = new Token(TokenType.TEXT, fullPattern.substring(begin + 1, end));
    tokens.add(lastAddedToken);
    return lastAddedToken;
  }
Parse pattern to list of tokens.
common/src/java/org/apache/hadoop/hive/common/format/datetime/HiveSqlDateTimeFormatter.java