Lines Matching refs:Regexp
45 class Regexp::ParseState {
61 bool PushRegexp(Regexp* re);
105 Regexp* DoFinish();
110 Regexp* FinishRegexp(Regexp*);
119 bool ParseCharClass(StringPiece* s, Regexp** out_re,
156 Regexp* stacktop_;
167 Regexp::ParseState::ParseState(ParseFlags flags, in ParseState()
179 Regexp::ParseState::~ParseState() { in ~ParseState()
180 Regexp* next; in ~ParseState()
181 for (Regexp* re = stacktop_; re != NULL; re = next) { in ~ParseState()
193 Regexp* Regexp::ParseState::FinishRegexp(Regexp* re) { in FinishRegexp()
210 bool Regexp::ParseState::PushRegexp(Regexp* re) { in PushRegexp()
222 re = new Regexp(kRegexpLiteral, flags_); in PushRegexp()
228 re = new Regexp(kRegexpLiteral, flags_ | FoldCase); in PushRegexp()
369 bool Regexp::ParseState::PushLiteral(Rune r) { in PushLiteral()
372 Regexp* re = new Regexp(kRegexpCharClass, flags_ & ~FoldCase); in PushLiteral()
387 return PushRegexp(new Regexp(kRegexpNoMatch, flags_)); in PushLiteral()
393 Regexp* re = new Regexp(kRegexpLiteral, flags_); in PushLiteral()
399 bool Regexp::ParseState::PushCarat() { in PushCarat()
407 bool Regexp::ParseState::PushWordBoundary(bool word) { in PushWordBoundary()
414 bool Regexp::ParseState::PushDollar() { in PushDollar()
418 Regexp::ParseFlags oflags = flags_; in PushDollar()
428 bool Regexp::ParseState::PushDot() { in PushDot()
432 Regexp* re = new Regexp(kRegexpCharClass, flags_ & ~FoldCase); in PushDot()
440 bool Regexp::ParseState::PushSimpleOp(RegexpOp op) { in PushSimpleOp()
441 Regexp* re = new Regexp(op, flags_); in PushSimpleOp()
448 bool Regexp::ParseState::PushRepeatOp(RegexpOp op, const StringPiece& s, in PushRepeatOp()
455 Regexp::ParseFlags fl = flags_; in PushRepeatOp()
458 Regexp* re = new Regexp(op, fl); in PushRepeatOp()
469 bool Regexp::ParseState::PushRepetition(int min, int max, in PushRepetition()
482 Regexp::ParseFlags fl = flags_; in PushRepetition()
485 Regexp* re = new Regexp(kRegexpRepeat, fl); in PushRepetition()
498 bool Regexp::ParseState::IsMarker(RegexpOp op) { in IsMarker()
504 bool Regexp::ParseState::DoLeftParen(const StringPiece& name) { in DoLeftParen()
505 Regexp* re = new Regexp(kLeftParen, flags_); in DoLeftParen()
513 bool Regexp::ParseState::DoLeftParenNoCapture() { in DoLeftParenNoCapture()
514 Regexp* re = new Regexp(kLeftParen, flags_); in DoLeftParenNoCapture()
527 bool Regexp::ParseState::DoVerticalBar() { in DoVerticalBar()
536 Regexp* r1; in DoVerticalBar()
537 Regexp* r2; in DoVerticalBar()
543 Regexp* r3; in DoVerticalBar()
555 AddLiteral(r3->ccb_, rune, r3->parse_flags_ & Regexp::FoldCase); in DoVerticalBar()
560 r1->parse_flags_ & Regexp::FoldCase); in DoVerticalBar()
589 bool Regexp::ParseState::DoRightParen() { in DoRightParen()
596 Regexp* r1; in DoRightParen()
597 Regexp* r2; in DoRightParen()
610 Regexp* re = r2; in DoRightParen()
628 Regexp* Regexp::ParseState::DoFinish() { in DoFinish()
630 Regexp* re = stacktop_; in DoFinish()
643 Regexp* Regexp::LeadingRegexp(Regexp* re) { in LeadingRegexp()
647 Regexp** sub = re->sub(); in LeadingRegexp()
659 Regexp* Regexp::RemoveLeadingRegexp(Regexp* re) { in RemoveLeadingRegexp()
663 Regexp** sub = re->sub(); in RemoveLeadingRegexp()
670 Regexp* nre = sub[1]; in RemoveLeadingRegexp()
680 Regexp::ParseFlags pf = re->parse_flags(); in RemoveLeadingRegexp()
682 return new Regexp(kRegexpEmptyMatch, pf); in RemoveLeadingRegexp()
688 Rune* Regexp::LeadingString(Regexp* re, int *nrune, in LeadingString()
689 Regexp::ParseFlags *flags) { in LeadingString()
693 *flags = static_cast<Regexp::ParseFlags>(re->parse_flags_ & Regexp::FoldCase); in LeadingString()
711 void Regexp::RemoveLeadingString(Regexp* re, int n) { in RemoveLeadingString()
717 Regexp* stk[4]; in RemoveLeadingString()
751 Regexp** sub = re->sub(); in RemoveLeadingString()
767 Regexp* old = sub[1]; in RemoveLeadingString()
804 int Regexp::FactorAlternation( in FactorAlternation()
805 Regexp** sub, int n, in FactorAlternation()
806 Regexp::ParseFlags altflags) { in FactorAlternation()
811 int Regexp::FactorAlternationRecursive( in FactorAlternationRecursive()
812 Regexp** sub, int n, in FactorAlternationRecursive()
813 Regexp::ParseFlags altflags, in FactorAlternationRecursive()
822 Regexp::ParseFlags runeflags = Regexp::NoParseFlags; in FactorAlternationRecursive()
834 Regexp::ParseFlags runeflags_i = Regexp::NoParseFlags; in FactorAlternationRecursive()
861 Regexp* x[2]; // x[0] = prefix, x[1] = suffix1|suffix2|... in FactorAlternationRecursive()
886 Regexp* first = NULL; in FactorAlternationRecursive()
893 Regexp* first_i = NULL; in FactorAlternationRecursive()
896 if (first != NULL && Regexp::Equal(first, first_i)) { in FactorAlternationRecursive()
912 Regexp* x[2]; // x[0] = prefix, x[1] = suffix1|suffix2|... in FactorAlternationRecursive()
955 Regexp* re = sub[j]; in FactorAlternationRecursive()
998 void Regexp::ParseState::DoCollapse(RegexpOp op) { in DoCollapse()
1001 Regexp* next = NULL; in DoCollapse()
1002 Regexp* sub; in DoCollapse()
1017 Regexp** subs = new Regexp*[n]; in DoCollapse()
1023 Regexp** sub_subs = sub->sub(); in DoCollapse()
1032 Regexp* re = ConcatOrAlternate(op, subs, n, flags_, true); in DoCollapse()
1041 void Regexp::ParseState::DoConcatenation() { in DoConcatenation()
1042 Regexp* r1 = stacktop_; in DoConcatenation()
1045 Regexp* re = new Regexp(kRegexpEmptyMatch, flags_); in DoConcatenation()
1053 void Regexp::ParseState::DoAlternation() { in DoAlternation()
1056 Regexp* r1 = stacktop_; in DoAlternation()
1072 bool Regexp::ParseState::MaybeConcatString(int r, ParseFlags flags) { in MaybeConcatString()
1073 Regexp* re1; in MaybeConcatString()
1074 Regexp* re2; in MaybeConcatString()
1386 Rune lo, Rune hi, Regexp::ParseFlags parse_flags) { in AddRangeFlags()
1389 bool cutnl = !(parse_flags & Regexp::ClassNL) || in AddRangeFlags()
1390 (parse_flags & Regexp::NeverNL); in AddRangeFlags()
1400 if (parse_flags & Regexp::FoldCase) in AddRangeFlags()
1440 Regexp::ParseFlags parse_flags) { in AddUGroup()
1449 if (parse_flags & Regexp::FoldCase) { in AddUGroup()
1483 UGroup* MaybeParsePerlCCEscape(StringPiece* s, Regexp::ParseFlags parse_flags) { in MaybeParsePerlCCEscape()
1484 if (!(parse_flags & Regexp::PerlClasses)) in MaybeParsePerlCCEscape()
1506 ParseStatus ParseUnicodeGroup(StringPiece* s, Regexp::ParseFlags parse_flags, in ParseUnicodeGroup()
1510 if (!(parse_flags & Regexp::UnicodeGroups)) in ParseUnicodeGroup()
1570 static ParseStatus ParseCCName(StringPiece* s, Regexp::ParseFlags parse_flags, in ParseCCName()
1608 bool Regexp::ParseState::ParseCCCharacter(StringPiece* s, Rune *rp, in ParseCCCharacter()
1631 bool Regexp::ParseState::ParseCCRange(StringPiece* s, RuneRange* rr, in ParseCCRange()
1656 bool Regexp::ParseState::ParseCharClass(StringPiece* s, in ParseCharClass()
1657 Regexp** out_re, in ParseCharClass()
1667 Regexp* re = new Regexp(kRegexpCharClass, flags_ & ~FoldCase); in ParseCharClass()
1746 re->ccb_->AddRangeFlags(rr.lo, rr.hi, flags_ | Regexp::ClassNL); in ParseCharClass()
1788 bool Regexp::ParseState::ParsePerlFlags(StringPiece* s) { in ParsePerlFlags()
1919 flags_ = static_cast<Regexp::ParseFlags>(nflags); in ParsePerlFlags()
1948 Regexp* Regexp::Parse(const StringPiece& s, ParseFlags global_flags, in Parse()
2035 Regexp* re; in Parse()
2112 if ((ps.flags() & Regexp::PerlB) && in Parse()
2120 if ((ps.flags() & Regexp::PerlX) && t.size() >= 2) { in Parse()
2163 Regexp* re = new Regexp(kRegexpCharClass, ps.flags() & ~FoldCase); in Parse()
2181 Regexp* re = new Regexp(kRegexpCharClass, ps.flags() & ~FoldCase); in Parse()