fromAccumulate := ACCUMULATE LEFT_PAREN lhsAnd (COMMA|SEMICOLON)
( INIT chunk_(_) COMMA ACTION chunk_(_) COMMA
( REVERSE chunk_(_) COMMA)? RESULT chunk_(_)
| accumulateFunction
) RIGHT_PAREN

@param pattern
@throws org.antlr.runtime.RecognitionException
493948
private void fromAccumulate(PatternDescrBuilder<?> pattern) throws RecognitionException {
        AccumulateDescrBuilder<?> accumulate = helper.start(pattern,
                AccumulateDescrBuilder.class,
                null);
        try {
            if (helper.validateIdentifierKey(DroolsSoftKeywords.ACCUMULATE)) {
                match(input,
                        DRL6Lexer.ID,
                        DroolsSoftKeywords.ACCUMULATE,
                        null,
                        DroolsEditorType.KEYWORD);
            } else {
                // might be using the short mnemonic
                match(input,
                        DRL6Lexer.ID,
                        DroolsSoftKeywords.ACC,
                        null,
                        DroolsEditorType.KEYWORD);
            }
            if (state.failed)
                return;

            if (state.backtracking == 0 && input.LA(1) != DRL6Lexer.EOF) {
                helper.emit(Location.LOCATION_LHS_FROM_ACCUMULATE);
            }
            match(input,
                    DRL6Lexer.LEFT_PAREN,
                    null,
                    null,
                    DroolsEditorType.SYMBOL);
            if (state.failed)
                return;

            CEDescrBuilder<?, AndDescr> source = accumulate.source();
            try {
                helper.start(source,
                        CEDescrBuilder.class,
                        null);
                lhsAnd(source,
                        false);
                if (state.failed)
                    return;

                if (source.getDescr() != null && source.getDescr() instanceof ConditionalElementDescr) {
                    ConditionalElementDescr root = (ConditionalElementDescr) source.getDescr();
                    BaseDescr[] descrs = root.getDescrs().toArray(new BaseDescr[root.getDescrs().size()]);
                    root.getDescrs().clear();
                    for (int i = 0; i < descrs.length; i++) {
                        root.addOrMerge(descrs[i]);
                    }
                }
            } finally {
                helper.end(CEDescrBuilder.class,
                        source);
            }

            if (input.LA(1) == DRL6Lexer.COMMA) {
                match(input,
                        DRL6Lexer.COMMA,
                        null,
                        null,
                        DroolsEditorType.SYMBOL);
                if (state.failed)
                    return;
            } else if (input.LA(-1) != DRL6Lexer.SEMICOLON) {
                match(input,
                      DRL6Lexer.SEMICOLON,
                      null,
                      null,
                      DroolsEditorType.SYMBOL);
                if (state.failed)
                    return;
            }

            if (helper.validateIdentifierKey(DroolsSoftKeywords.INIT)) {
                // custom code, inline accumulate

                // initBlock
                match(input,
                        DRL6Lexer.ID,
                        DroolsSoftKeywords.INIT,
                        null,
                        DroolsEditorType.KEYWORD);
                if (state.failed)
                    return;
                if (state.backtracking == 0 && input.LA(1) != DRL6Lexer.EOF) {
                    helper.emit(Location.LOCATION_LHS_FROM_ACCUMULATE_INIT);
                }

                String init = chunk(DRL6Lexer.LEFT_PAREN,
                        DRL6Lexer.RIGHT_PAREN,
                        Location.LOCATION_LHS_FROM_ACCUMULATE_INIT_INSIDE);
                if (state.failed)
                    return;
                if (state.backtracking == 0)
                    accumulate.init(init);

                if (input.LA(1) == DRL6Lexer.COMMA) {
                    match(input,
                            DRL6Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                    if (state.failed)
                        return;
                }

                // actionBlock
                match(input,
                        DRL6Lexer.ID,
                        DroolsSoftKeywords.ACTION,
                        null,
                        DroolsEditorType.KEYWORD);
                if (state.failed)
                    return;
                if (state.backtracking == 0 && input.LA(1) != DRL6Lexer.EOF) {
                    helper.emit(Location.LOCATION_LHS_FROM_ACCUMULATE_ACTION);
                }

                String action = chunk(DRL6Lexer.LEFT_PAREN,
                        DRL6Lexer.RIGHT_PAREN,
                        Location.LOCATION_LHS_FROM_ACCUMULATE_ACTION_INSIDE);
                if (state.failed)
                    return;
                if (state.backtracking == 0)
                    accumulate.action(action);

                if (input.LA(1) == DRL6Lexer.COMMA) {
                    match(input,
                            DRL6Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                    if (state.failed)
                        return;
                }

                // reverseBlock
                if (helper.validateIdentifierKey(DroolsSoftKeywords.REVERSE)) {
                    match(input,
                            DRL6Lexer.ID,
                            DroolsSoftKeywords.REVERSE,
                            null,
                            DroolsEditorType.KEYWORD);
                    if (state.failed)
                        return;
                    if (state.backtracking == 0 && input.LA(1) != DRL6Lexer.EOF) {
                        helper.emit(Location.LOCATION_LHS_FROM_ACCUMULATE_REVERSE);
                    }

                    String reverse = chunk(DRL6Lexer.LEFT_PAREN,
                            DRL6Lexer.RIGHT_PAREN,
                            Location.LOCATION_LHS_FROM_ACCUMULATE_REVERSE_INSIDE);
                    if (state.failed)
                        return;
                    if (state.backtracking == 0)
                        accumulate.reverse(reverse);

                    if (input.LA(1) == DRL6Lexer.COMMA) {
                        match(input,
                                DRL6Lexer.COMMA,
                                null,
                                null,
                                DroolsEditorType.SYMBOL);
                        if (state.failed)
                            return;
                    }
                }

                // resultBlock
                match(input,
                        DRL6Lexer.ID,
                        DroolsSoftKeywords.RESULT,
                        null,
                        DroolsEditorType.KEYWORD);
                if (state.failed)
                    return;

                if (state.backtracking == 0 && input.LA(1) != DRL6Lexer.EOF) {
                    helper.emit(Location.LOCATION_LHS_FROM_ACCUMULATE_RESULT);
                }

                String result = chunk(DRL6Lexer.LEFT_PAREN,
                        DRL6Lexer.RIGHT_PAREN,
                        Location.LOCATION_LHS_FROM_ACCUMULATE_RESULT_INSIDE);
                if (state.failed)
                    return;
                if (state.backtracking == 0)
                    accumulate.result(result);
            } else {
                // accumulate functions
                accumulateFunction(accumulate,
                                   false,
                                   null);
                if (state.failed)
                    return;
            }

            match(input,
                    DRL6Lexer.RIGHT_PAREN,
                    null,
                    null,
                    DroolsEditorType.SYMBOL);
            if (state.failed)
                return;
        } finally {
            helper.end(AccumulateDescrBuilder.class,
                    accumulate);
            if (state.backtracking == 0 && input.LA(1) != DRL6Lexer.EOF) {
                helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION);
            }
        }
    }
1255882
protected function parsePattern($pattern)
    {
        $currentPos      = 0;
        $length          = strlen($pattern);
        $tokens          = [];
        $level           = 0;
        $quotedDelimiter = preg_quote($this->delimiter);

        while ($currentPos < $length) {
            preg_match('(\G(?P<literal>[^:{\[\]]*)(?P<token>[:\[\]]|$))', $pattern, $matches, 0, $currentPos);

            $currentPos += strlen($matches[0]);

            if (!empty($matches['literal'])) {
                $tokens[] = ['literal', $matches['literal']];
            }

            if ($matches['token'] === ':') {
                if (!preg_match(
                    '(\G(?P<name>[^:' . $quotedDelimiter . '{\[\]]+)(?:{(?P<delimiters>[^}]+)})?:?)',
                    $pattern,
                    $matches,
                    0,
                    $currentPos
                )) {
                    throw new Exception\RuntimeException('Found empty parameter name');
                }

                $tokens[] = [
                    'parameter',
                    $matches['name'],
                    isset($matches['delimiters']) ? $matches['delimiters'] : null
                ];

                $currentPos += strlen($matches[0]);
            } elseif ($matches['token'] === '[') {
                $tokens[] = ['optional-start'];
                $level++;
            } elseif ($matches['token'] === ']') {
                $tokens[] = ['optional-end'];
                $level--;

                if ($level < 0) {
                    throw new Exception\RuntimeException('Found closing bracket without matching opening bracket');
                }
            } else {
                break;
            }
        }

        if ($level > 0) {
            throw new Exception\RuntimeException('Found unbalanced brackets');
        }

        return $tokens;
    }
1361337
private static void parsePatternTo(DateTimeFormatterBuilder builder, String pattern) {
        int length = pattern.length();
        int[] indexRef = new int[1];

        for (int i=0; i<length; i++) {
            indexRef[0] = i;
            String token = parseToken(pattern, indexRef);
            i = indexRef[0];

            int tokenLen = token.length();
            if (tokenLen == 0) {
                break;
            }
            char c = token.charAt(0);

            switch (c) {
            case 'G': // era designator (text)
                builder.appendEraText();
                break;
            case 'C': // century of era (number)
                builder.appendCenturyOfEra(tokenLen, tokenLen);
                break;
            case 'x': // weekyear (number)
            case 'y': // year (number)
            case 'Y': // year of era (number)
                if (tokenLen == 2) {
                    boolean lenientParse = true;

                    // Peek ahead to next token.
                    if (i + 1 < length) {
                        indexRef[0]++;
                        if (isNumericToken(parseToken(pattern, indexRef))) {
                            // If next token is a number, cannot support
                            // lenient parse, because it will consume digits
                            // that it should not.
                            lenientParse = false;
                        }
                        indexRef[0]--;
                    }

                    // Use pivots which are compatible with SimpleDateFormat.
                    switch (c) {
                    case 'x':
                        builder.appendTwoDigitWeekyear
                            (new DateTime().getWeekyear() - 30, lenientParse);
                        break;
                    case 'y':
                    case 'Y':
                    default:
                        builder.appendTwoDigitYear(new DateTime().getYear() - 30, lenientParse);
                        break;
                    }
                } else {
                    // Try to support long year values.
                    int maxDigits = 9;

                    // Peek ahead to next token.
                    if (i + 1 < length) {
                        indexRef[0]++;
                        if (isNumericToken(parseToken(pattern, indexRef))) {
                            // If next token is a number, cannot support long years.
                            maxDigits = tokenLen;
                        }
                        indexRef[0]--;
                    }

                    switch (c) {
                    case 'x':
                        builder.appendWeekyear(tokenLen, maxDigits);
                        break;
                    case 'y':
                        builder.appendYear(tokenLen, maxDigits);
                        break;
                    case 'Y':
                        builder.appendYearOfEra(tokenLen, maxDigits);
                        break;
                    }
                }
                break;
            case 'M': // month of year (text and number)
                if (tokenLen >= 3) {
                    if (tokenLen >= 4) {
                        builder.appendMonthOfYearText();
                    } else {
                        builder.appendMonthOfYearShortText();
                    }
                } else {
                    builder.appendMonthOfYear(tokenLen);
                }
                break;
            case 'd': // day of month (number)
                builder.appendDayOfMonth(tokenLen);
                break;
            case 'a': // am/pm marker (text)
                builder.appendHalfdayOfDayText();
                break;
            case 'h': // clockhour of halfday (number, 1..12)
                builder.appendClockhourOfHalfday(tokenLen);
                break;
            case 'H': // hour of day (number, 0..23)
                builder.appendHourOfDay(tokenLen);
                break;
            case 'k': // clockhour of day (1..24)
                builder.appendClockhourOfDay(tokenLen);
                break;
            case 'K': // hour of halfday (0..11)
                builder.appendHourOfHalfday(tokenLen);
                break;
            case 'm': // minute of hour (number)
                builder.appendMinuteOfHour(tokenLen);
                break;
            case 's': // second of minute (number)
                builder.appendSecondOfMinute(tokenLen);
                break;
            case 'S': // fraction of second (number)
                builder.appendFractionOfSecond(tokenLen, tokenLen);
                break;
            case 'e': // day of week (number)
                builder.appendDayOfWeek(tokenLen);
                break;
            case 'E': // dayOfWeek (text)
                if (tokenLen >= 4) {
                    builder.appendDayOfWeekText();
                } else {
                    builder.appendDayOfWeekShortText();
                }
                break;
            case 'D': // day of year (number)
                builder.appendDayOfYear(tokenLen);
                break;
            case 'w': // week of weekyear (number)
                builder.appendWeekOfWeekyear(tokenLen);
                break;
            case 'z': // time zone (text)
                if (tokenLen >= 4) {
                    builder.appendTimeZoneName();
                } else {
                    builder.appendTimeZoneShortName(null);
                }
                break;
            case 'Z': // time zone offset
                if (tokenLen == 1) {
                    builder.appendTimeZoneOffset(null, "Z", false, 2, 2);
                } else if (tokenLen == 2) {
                    builder.appendTimeZoneOffset(null, "Z", true, 2, 2);
                } else {
                    builder.appendTimeZoneId();
                }
                break;
            case '\'': // literal text
                String sub = token.substring(1);
                if (sub.length() == 1) {
                    builder.appendLiteral(sub.charAt(0));
                } else {
                    // Create copy of sub since otherwise the temporary quoted
                    // string would still be referenced internally.
                    builder.appendLiteral(new String(sub));
                }
                break;
            default:
                throw new IllegalArgumentException
                    ("Illegal pattern component: " + token);
            }
        }
    }
171584
public FulltextMatch addPattern(
                    final String pattern
                    )
    {
        if (pattern == null  ||  pattern.length() == 0) {
            throw new IllegalArgumentException( "no pattern specified" );
        }

        _patterns.add( pattern );

        return this;
    }
386199
private void constraint(PatternDescrBuilder<?> pattern,
            boolean positional,
            String prefix) throws RecognitionException {
        if (speculateNestedConstraint()) {
            nestedConstraint(pattern, prefix);
            return;
        }

        if (state.backtracking == 0) {
            helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_START);
        }

        int first = input.index();
        exprParser.getHelper().setHasOperator(false); // resetting
        try {
            exprParser.conditionalOrExpression();
        } finally {
            if (state.backtracking == 0) {
                if (input.LA(1) == DRL6Lexer.ID && input.LA(2) == DRL6Lexer.EOF) {
                    helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT);
                } else if (input.LA(1) != DRL6Lexer.EOF) {
                    helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_END);
                } else if (!lastTokenWasWhiteSpace()) {
                    int location = getCurrentLocation();
                    if (location == Location.LOCATION_LHS_INSIDE_CONDITION_END) {
                        helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT);
                    } else if (input.get(input.index()).getType() != DRL6Lexer.EOF) {
                        helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_START);
                    }
                } else if (getCurrentLocation() == Location.LOCATION_LHS_INSIDE_CONDITION_START &&
                        !exprParser.getHelper().getHasOperator() &&
                        lastTokenWasWhiteSpace() &&
                        input.LA(1) == DRL6Lexer.EOF &&
                        input.LA(-1) == DRL6Lexer.ID) {
                    helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);
                }
            }
        }

        if (state.failed)
            return;

        if (state.backtracking == 0 && input.index() > first) {
            // expression consumed something
            int last = input.LT(-1).getTokenIndex();
            String expr = toExpression(prefix, first, last);
            pattern.constraint(expr,
                    positional);
            BaseDescr constrDescr = pattern.getDescr().getDescrs().get(pattern.getDescr().getDescrs().size() - 1);
            constrDescr.setLocation(input.get(first).getLine(),
                    input.get(first).getCharPositionInLine());
            constrDescr.setEndLocation(input.get(last).getLine(),
                    input.get(last).getCharPositionInLine());
            constrDescr.setStartCharacter(((CommonToken) input.get(first)).getStartIndex());
            constrDescr.setEndCharacter(((CommonToken) input.get(last)).getStopIndex());
        }
    }
413314
function accumulativeParser(condition, str) {
    let accumulations = [];
    let accumulator = "";

    for (let i = 0; i < str.length; ++i) {
        let ch = str[i];

        if (condition(ch)) {
            accumulator += ch;
        } else if (accumulator !== "") {
            accumulations.push(accumulator);
            accumulator = "";
        }
    }

    return accumulations;
}
578331
private void initializePattern(final String pattern) {
        final String[] split = pattern.split(Pattern.quote("*"), -1);
        final StringBuilder escapedPattern = new StringBuilder(Pattern.quote(split[0]));
        for (int i = 1; i < split.length; i++) {
            String quoted = Pattern.quote(split[i]);
            escapedPattern.append("([^.]*)").append(quoted);
        }

        final String regex = "^" + escapedPattern.toString() + "$";
        this.patternStr = regex;
        this.pattern = Pattern.compile(regex);
    }
1013857
private String[] splitIntoPlusMinusPatterns(AmountFormatContext amountFormatContext, String pattern) {
        DecimalFormatSymbols decimalFormatSymbols = amountFormatContext.get(DecimalFormatSymbols.class);
        char patternSeparator = decimalFormatSymbols != null ? decimalFormatSymbols.getPatternSeparator() : SUBPATTERN_BOUNDARY;
        return pattern.split(String.valueOf(patternSeparator));
    }
924722
private BaseDescr lhsAccumulate(PatternContainerDescrBuilder<?, ?> ce) throws RecognitionException {
        PatternDescrBuilder<?> pattern = null;
        BaseDescr result = null;

        pattern = helper.start((DescrBuilder<?, ?>) ce,
                PatternDescrBuilder.class,
                null);
        if (pattern != null) {
            result = pattern.getDescr();
        }

        try {
            if (state.backtracking == 0) {
                pattern.type("Object");
                pattern.isQuery(false);
                // might have to add the implicit bindings as well
            }

            AccumulateDescrBuilder<?> accumulate = helper.start(pattern,
                    AccumulateDescrBuilder.class,
                    null);
            try {
                if (helper.validateIdentifierKey(DroolsSoftKeywords.ACCUMULATE)) {
                    match(input,
                            DRL6Lexer.ID,
                            DroolsSoftKeywords.ACCUMULATE,
                            null,
                            DroolsEditorType.KEYWORD);
                } else {
                    // might be using the short mnemonic
                    match(input,
                            DRL6Lexer.ID,
                            DroolsSoftKeywords.ACC,
                            null,
                            DroolsEditorType.KEYWORD);
                }
                if (state.failed)
                    return null;

                if (state.backtracking == 0 && input.LA(1) != DRL6Lexer.EOF) {
                    helper.emit(Location.LOCATION_LHS_FROM_ACCUMULATE);
                }
                match(input,
                        DRL6Lexer.LEFT_PAREN,
                        null,
                        null,
                        DroolsEditorType.SYMBOL);
                if (state.failed)
                    return null;

                CEDescrBuilder<?, AndDescr> source = accumulate.source();
                try {
                    helper.start(source,
                            CEDescrBuilder.class,
                            null);
                    lhsAnd(source,
                            true);
                    if (state.failed)
                        return null;

                    if (source.getDescr() != null && source.getDescr() instanceof ConditionalElementDescr) {
                        ConditionalElementDescr root = (ConditionalElementDescr) source.getDescr();
                        BaseDescr[] descrs = root.getDescrs().toArray(new BaseDescr[root.getDescrs().size()]);
                        root.getDescrs().clear();
                        for (int i = 0; i < descrs.length; i++) {
                            root.addOrMerge(descrs[i]);
                        }
                    }
                } finally {
                    helper.end(CEDescrBuilder.class,
                            source);
                }

                if (input.LA(1) == DRL6Lexer.COMMA) {
                    match(input,
                            DRL6Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                    if (state.failed)
                        return null;
                } else if (input.LA(-1) != DRL6Lexer.SEMICOLON) {
                    // lhsUnary will consume an optional SEMICOLON, so we need to check if it was consumed already
                    // or if we must fail consuming it now
                    match(input,
                            DRL6Lexer.SEMICOLON,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                    if (state.failed)
                        return null;
                }

                // accumulate functions
                accumulateFunctionBinding(accumulate);
                if (state.failed)
                    return null;

                while (input.LA(1) == DRL6Lexer.COMMA) {
                    match(input,
                            DRL6Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                    if (state.failed)
                        return null;

                    accumulateFunctionBinding(accumulate);
                    if (state.failed)
                        return null;
                }

                if (input.LA(1) == DRL6Lexer.SEMICOLON) {
                    match(input,
                            DRL6Lexer.SEMICOLON,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                    if (state.failed)
                        return null;

                    constraints(pattern);
                }
                match(input,
                        DRL6Lexer.RIGHT_PAREN,
                        null,
                        null,
                        DroolsEditorType.SYMBOL);
                if (state.failed)
                    return null;
            } finally {
                helper.end(AccumulateDescrBuilder.class,
                        accumulate);
                if (state.backtracking == 0 && input.LA(1) != DRL6Lexer.EOF) {
                    helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION);
                }
            }
        } finally {
            helper.end(PatternDescrBuilder.class,
                    pattern);
        }

        if (input.LA(1) == DRL6Lexer.SEMICOLON) {
            match(input,
                    DRL6Lexer.SEMICOLON,
                    null,
                    null,
                    DroolsEditorType.SYMBOL);
            if (state.failed)
                return null;
        }
        return result;
    }
795313
private void parseSinglePattern(String pattern) {
		final String[] parts = pattern.split("\\s");

		int offset = 0;// 偏移量用于兼容Quartz表达式，当表达式有6或7项时，第一项为秒
		if (parts.length == 6 || parts.length == 7) {
			offset = 1;
		} else if (parts.length != 5) {
			throw new CronException("Pattern [{}] is invalid, it must be 5-7 parts!", pattern);
		}

		// 秒
		if (1 == offset) {// 支持秒的表达式
			try {
				this.secondMatchers.add(ValueMatcherBuilder.build(parts[0], SECOND_VALUE_PARSER));
			} catch (Exception e) {
				throw new CronException(e, "Invalid pattern [{}], parsing 'second' field error!", pattern);
			}
		} else {// 不支持秒的表达式，则第一位按照表达式生成时间的秒数赋值，表示整分匹配
			this.secondMatchers.add(ValueMatcherBuilder.build(String.valueOf(DateUtil.date().second()), SECOND_VALUE_PARSER));
		}
		// 分
		try {
			this.minuteMatchers.add(ValueMatcherBuilder.build(parts[0 + offset], MINUTE_VALUE_PARSER));
		} catch (Exception e) {
			throw new CronException(e, "Invalid pattern [{}], parsing 'minute' field error!", pattern);
		}
		// 小时
		try {
			this.hourMatchers.add(ValueMatcherBuilder.build(parts[1 + offset], HOUR_VALUE_PARSER));
		} catch (Exception e) {
			throw new CronException(e, "Invalid pattern [{}], parsing 'hour' field error!", pattern);
		}
		// 每月第几天
		try {
			this.dayOfMonthMatchers.add(ValueMatcherBuilder.build(parts[2 + offset], DAY_OF_MONTH_VALUE_PARSER));
		} catch (Exception e) {
			throw new CronException(e, "Invalid pattern [{}], parsing 'day of month' field error!", pattern);
		}
		// 月
		try {
			this.monthMatchers.add(ValueMatcherBuilder.build(parts[3 + offset], MONTH_VALUE_PARSER));
		} catch (Exception e) {
			throw new CronException(e, "Invalid pattern [{}], parsing 'month' field error!", pattern);
		}
		// 星期几
		try {
			this.dayOfWeekMatchers.add(ValueMatcherBuilder.build(parts[4 + offset], DAY_OF_WEEK_VALUE_PARSER));
		} catch (Exception e) {
			throw new CronException(e, "Invalid pattern [{}], parsing 'day of week' field error!", pattern);
		}
		// 年
		if (parts.length == 7) {// 支持年的表达式
			try {
				this.yearMatchers.add(ValueMatcherBuilder.build(parts[6], YEAR_VALUE_PARSER));
			} catch (Exception e) {
				throw new CronException(e, "Invalid pattern [{}], parsing 'year' field error!", pattern);
			}
		} else {// 不支持年的表达式，全部匹配
			this.secondMatchers.add(new AlwaysTrueValueMatcher());
		}
		matcherSize++;
	}
239679
public void setPattern(NumberPattern pattern, int _maxSigDigits, int _minSigDigits) {
    Format format = pattern.format();
    minIntDigits = orDefault(options.minimumIntegerDigits(), format.minimumIntegerDigits());

    maxFracDigits = currencyDigits == -1 ? format.maximumFractionDigits() : currencyDigits;
    maxFracDigits = orDefault(options.maximumFractionDigits(), maxFracDigits);

    minFracDigits = currencyDigits == -1 ? format.minimumFractionDigits() : currencyDigits;
    minFracDigits = orDefault(options.minimumFractionDigits(), minFracDigits);

    boolean useSignificant = formatMode == SIGNIFICANT || formatMode == SIGNIFICANT_MAXFRAC;
    if (useSignificant) {
        maxSigDigits = orDefault(options.maximumSignificantDigits(), _maxSigDigits);
        minSigDigits = orDefault(options.minimumSignificantDigits(), _minSigDigits);
    } else {
        maxSigDigits = -1;
        minSigDigits = -1;
    }
  }
298358
private void seekNonWs(final String pattern, final ParsePosition pos) {
        int len = 0;
        final char[] buffer = pattern.toCharArray();
        do {
            len = StrMatcher.splitMatcher().isMatch(buffer, pos.getIndex());
            pos.setIndex(pos.getIndex() + len);
        } while (len > 0 && pos.getIndex() < pattern.length());
    }
755509
private ParseTree parseArrayPattern(PatternKind kind) {
    SourcePosition start = getTreeStartLocation();
    ImmutableList.Builder<ParseTree> elements = ImmutableList.builder();
    eat(TokenType.OPEN_SQUARE);
    while (peek(TokenType.COMMA) || peekArrayPatternElement()) {
      if (peek(TokenType.COMMA)) {
        SourcePosition nullStart = getTreeStartLocation();
        eat(TokenType.COMMA);
        elements.add(new NullTree(getTreeLocation(nullStart)));
      } else {
        elements.add(parsePatternAssignmentTarget(kind));

        if (peek(TokenType.COMMA)) {
          // Consume the comma separator
          eat(TokenType.COMMA);
        } else {
          // Otherwise we must be done
          break;
        }
      }
    }
    if (peek(TokenType.SPREAD)) {
      recordFeatureUsed(Feature.ARRAY_PATTERN_REST);
      elements.add(parsePatternRest(kind));
    }
    if (eat(TokenType.CLOSE_SQUARE) == null) {
      // If we get no closing bracket then return invalid tree to avoid compiler tripping
      // downstream. It's needed only for IDE mode where compiler continues processing even if
      // source has syntactic errors.
      return new MissingPrimaryExpressionTree(getTreeLocation(getTreeStartLocation()));
    }
    return new ArrayPatternTree(getTreeLocation(start), elements.build());
  }
1214551
private String insertFormats(final String pattern, final ArrayList<String> customPatterns) {
        if (!containsElements(customPatterns)) {
            return pattern;
        }
        final StringBuilder sb = new StringBuilder(pattern.length() * 2);
        final ParsePosition pos = new ParsePosition(0);
        int fe = -1;
        int depth = 0;
        while (pos.getIndex() < pattern.length()) {
            final char c = pattern.charAt(pos.getIndex());
            switch (c) {
            case QUOTE:
                appendQuotedString(pattern, pos, sb);
                break;
            case START_FE:
                depth++;
                sb.append(START_FE).append(readArgumentIndex(pattern, next(pos)));
                // do not look for custom patterns when they are embedded, e.g. in a choice
                if (depth == 1) {
                    fe++;
                    final String customPattern = customPatterns.get(fe);
                    if (customPattern != null) {
                        sb.append(START_FMT).append(customPattern);
                    }
                }
                break;
            case END_FE:
                depth--;
                //$FALL-THROUGH$
            default:
                sb.append(c);
                next(pos);
            }
        }
        return sb.toString();
    }
116716
public void doMatch() {
    boolean matchFound = false;
    for (ConsumablePattern<T> pattern : patterns) {
      if (pattern.matches(value)) {
        pattern.consume(value);
        matchFound = true;
        break;
      }
    }

    if (!matchFound) {
      throw new MatchException("No match found for " + value);
    }
  }
573617
public void addSynchronizeExcludePattern(String pattern) {

        try {
            m_synchronizeExcludePatterns.add(Pattern.compile(pattern));
        } catch (PatternSyntaxException e) {
            LOG.error(Messages.get().getBundle().key(Messages.LOG_INVALID_SYNCHRONIZE_EXCLUDE_PATTERN_1, pattern), e);
        }
    }
65319
public static boolean matchRegex(Object left, Object right) {
        if (left == null || right == null) return false;
        Pattern pattern;
        if (right instanceof Pattern) {
            pattern = (Pattern) right;
        } else {
            pattern = Pattern.compile(toString(right));
        }
        String stringToCompare = toString(left);
        Matcher matcher = pattern.matcher(stringToCompare);
        RegexSupport.setLastMatcher(matcher);
        return matcher.matches();
    }