Lines Matching refs:pattern
9 // for processing a regular expression pattern into the compiled form that
33 #include "regexcst.h" // Contains state table for the regex pattern parser.
91 // Compile regex pattern. The state machine for rexexp pattern parsing is here.
111 // There should be no pattern stuff in the RegexPattern object. They can not be reused.
114 // Prepare the RegexPattern object to receive the compiled pattern.
120 // Initialize the pattern scanning state machine
124 nextChar(fC); // Fetch the first char from the pattern string.
127 // Main loop for the regex pattern parsing state machine.
130 // - an advance to the the next pattern char
134 // recongizing the pattern syntax is there, not here.
138 // Regex pattern parsing stops on the first error encountered.
145 // Find the state table element that matches the input char from the pattern, or the
214 // NextChar. This is where characters are actually fetched from the pattern.
230 // This will occur if the user pattern has mis-matched parentheses,
241 // Bail out if the pattern had errors.
251 // The pattern has now been read and processed, and the compiled code generated.
287 // The pattern's fFrameSize so far has accumulated the requirements for
289 // in the pattern. Add space for the two variables that are always
291 // position in the compiled pattern.
297 // pattern can match. Used to avoid looking for matches in strings that
332 // doParseAction Do some action during regex pattern parsing.
347 // Start of pattern compiles to:
351 //3 NOP Dummy, so start of pattern looks the same as
365 // We've scanned to the end of the pattern
366 // The end of pattern compiles to:
369 // Encountering end of pattern also behaves like a close paren,
370 // and forces fixups of the State Save at the beginning of the compiled pattern
375 // Missing close paren in pattern.
379 // add the END operation to the compiled pattern.
382 // Terminate the pattern compilation state machine.
391 // Insert a SAVE operation at the start of the pattern section preceding
402 // Append an JMP operation into the compiled pattern. The operand for
412 // Append a NOP to the compiled pattern. This is the slot reserved
448 // of the two NOPs. Depending on what follows in the pattern, the
499 // of the two NOPs. Depending on what follows in the pattern, the
842 // Insert the state save into the compiled pattern, and we're done.
959 // Locate the position in the compiled pattern where the match will continue
967 // Append the URX_JMP_SAV or URX_JMPX operation to the compiled pattern.
1041 // (Can not reserve a slot in the compiled pattern at this time, because
1081 // We've just scanned a "normal" character from the pattern,
1421 // Otherwise the pattern "abc(?i)def" would make a single string of "abcdef"
1750 // literalChar We've encountered a literal character from the pattern,
1753 // the pattern.
1754 // If we are in a pattern string already, add the new char to it.
1755 // If we aren't in a pattern string, begin one now.
1759 int32_t op; // An operation in the compiled pattern.
1761 int32_t patternLoc; // A position in the compiled pattern.
1765 // If the last thing compiled into the pattern was not a literal char,
1774 // First char of a string in the pattern.
1775 // Emit a OneChar op into the compiled pattern.
1819 // The pattern contains a URX_SRING / URX_STRING_LEN. Update the
1855 // string in a pattern, we need to "fix" any preceding
1868 int32_t op; // An op from/for the compiled pattern.
1869 int32_t opType; // An opcode type from the compiled pattern.
1881 // Split: We need to ensure that the last item in the compiled pattern does
1885 // If the last operation from the compiled pattern is not a string,
1910 // Leave the string in the compiled pattern, shorten it by one char,
1934 // compiled pattern code.
1947 // Walk through the pattern, looking for any ops with targets that
1970 // the compiled pattern. (Negative values are frame boundaries, and don't need fixing.)
1992 // blockTopLoc() Find or create a location in the compiled pattern
2043 // real ) and at the end of the pattern.
2093 // Insert a End Capture op into the pattern.
2158 // Append the URX_LB_END and URX_LA_END to the compiled pattern.
2168 // string that the pattern can match.
2193 // Append the URX_LBN_END to the compiled pattern.
2201 // string that the pattern can match.
2217 // Insert the pattern location to continue at after a successful match
2230 // remember the next location in the compiled pattern.
2240 // compileSet Compile the pattern operations for a reference to a
2269 // the compiled pattern as a single char operation rather
2279 // Put it into the compiled pattern as a set.
2378 // Compute the pattern location where the inline sequence
2392 // Loop starts at 1 because one instance of the op already exists in the pattern,
2415 // pattern, keeping an on-going minimum-match-length. For any
2417 // starting matches to the possible starts for the overall pattern.
2426 int32_t loc; // Location in the pattern of the current op being processed.
2429 int32_t currentLen = 0; // Minimum length of a match to this point (loc) in the pattern
2432 UBool atStart = TRUE; // True if no part of the pattern yet encountered
2437 // are propagated forward in the pattern by JMP or STATE_SAVE operations.
2438 // It must be one longer than the pattern being checked because some ops
2452 // The loop is advancing linearly through the pattern.
2453 // If the op we are now at was the destination of a branch in the pattern,
2539 // .* at the start of a pattern.
2694 // characters for this pattern.
2699 // Remember this string. After the entire pattern has been checked,
2723 // characters for this pattern.
2890 // match the specified pattern.
2917 // are propagated forward in the pattern by JMP or STATE_SAVE operations.
2918 // It must be one longer than the pattern being checked because some ops
2931 // The loop is advancing linearly through the pattern.
2932 // If the op we are now at was the destination of a branch in the pattern,
3154 // match the specified pattern.
3185 // The loop is advancing linearly through the pattern.
3186 // If the op we are now at was the destination of a branch in the pattern,
3333 // it were normal pattern. Gives a too-long match length,
3371 // Stop further processing of the pattern.
3383 // stripNOPs Remove any NOP operations from the compiled pattern code.
3560 // nextCharLL Low Level Next Char from the regex pattern.
3567 UnicodeString &pattern = fRXPat->fPattern;
3577 ch = pattern.char32At(fNextIndex);
3578 fNextIndex = pattern.moveIndex32(fNextIndex, 1);
3616 // nextChar for pattern scanning. At this level, we handle stripping
3618 // The rest of the pattern grammar is handled at the next level up.
3757 // Get a UChar32 from a \N{UNICODE CHARACTER NAME} in the pattern.
3805 nextChar(fC); // Continue overall regex pattern processing with char after the '}'
3817 // Return a UnicodeSet, constructed from the \P pattern,
3818 // or NULL if the pattern is invalid.
3861 // Return a UnicodeSet constructed from the pattern,