Lines Matching defs:Regexp
16 Regexp::Regexp(RegexpOp op, ParseFlags parse_flags)
32 Regexp::~Regexp() {
34 LOG(DFATAL) << "Regexp not destroyed.";
54 bool Regexp::QuickDestroy() {
62 static map<Regexp*, int> *ref_map;
65 int Regexp::Ref() {
79 Regexp* Regexp::Incref() {
84 ref_map = new map<Regexp*, int>;
103 void Regexp::Decref() {
123 void Regexp::Destroy() {
130 Regexp* stack = this;
132 Regexp* re = stack;
137 Regexp** subs = re->sub();
139 Regexp* sub = subs[i];
159 void Regexp::AddRuneToString(Rune r) {
176 Regexp* Regexp::HaveMatch(int match_id, ParseFlags flags) {
177 Regexp* re = new Regexp(kRegexpHaveMatch, flags);
182 Regexp* Regexp::Plus(Regexp* sub, ParseFlags flags) {
185 Regexp* re = new Regexp(kRegexpPlus, flags);
191 Regexp* Regexp::Star(Regexp* sub, ParseFlags flags) {
194 Regexp* re = new Regexp(kRegexpStar, flags);
200 Regexp* Regexp::Quest(Regexp* sub, ParseFlags flags) {
203 Regexp* re = new Regexp(kRegexpQuest, flags);
209 Regexp* Regexp::ConcatOrAlternate(RegexpOp op, Regexp** sub, int nsub,
214 Regexp** subcopy = NULL;
217 subcopy = new Regexp*[nsub];
222 Regexp* re = sub[0];
229 // Too many subexpressions to fit in a single Regexp.
232 Regexp* re = new Regexp(op, flags);
234 Regexp** subs = re->sub();
244 Regexp* re = new Regexp(op, flags);
246 Regexp** subs = re->sub();
254 Regexp* Regexp::Concat(Regexp** sub, int nsub, ParseFlags flags) {
258 Regexp* Regexp::Alternate(Regexp** sub, int nsub, ParseFlags flags) {
262 Regexp* Regexp::AlternateNoFactor(Regexp** sub, int nsub, ParseFlags flags) {
266 Regexp* Regexp::Capture(Regexp* sub, ParseFlags flags, int cap) {
267 Regexp* re = new Regexp(kRegexpCapture, flags);
274 Regexp* Regexp::Repeat(Regexp* sub, ParseFlags flags, int min, int max) {
275 Regexp* re = new Regexp(kRegexpRepeat, flags);
283 Regexp* Regexp::NewLiteral(Rune rune, ParseFlags flags) {
284 Regexp* re = new Regexp(kRegexpLiteral, flags);
289 Regexp* Regexp::LiteralString(Rune* runes, int nrunes, ParseFlags flags) {
291 return new Regexp(kRegexpEmptyMatch, flags);
294 Regexp* re = new Regexp(kRegexpLiteralString, flags);
300 Regexp* Regexp::NewCharClass(CharClass* cc, ParseFlags flags) {
301 Regexp* re = new Regexp(kRegexpCharClass, flags);
307 void Regexp::Swap(Regexp* that) {
308 // Can use memmove because Regexp is just a struct (no vtable).
316 static bool TopEqual(Regexp* a, Regexp* b) {
335 return ((a->parse_flags() ^ b->parse_flags()) & Regexp::WasDollar) == 0;
339 ((a->parse_flags() ^ b->parse_flags()) & Regexp::FoldCase) == 0;
343 ((a->parse_flags() ^ b->parse_flags()) & Regexp::FoldCase) == 0 &&
354 return ((a->parse_flags() ^ b->parse_flags()) & Regexp::NonGreedy) == 0;
357 return ((a->parse_flags() ^ b->parse_flags()) & Regexp::NonGreedy) == 0 &&
377 LOG(DFATAL) << "Unexpected op in Regexp::Equal: " << a->op();
381 bool Regexp::Equal(Regexp* a, Regexp* b) {
408 vector<Regexp*> stk;
412 Regexp* a2;
413 Regexp* b2;
502 class NumCapturesWalker : public Regexp::Walker<Ignored> {
507 virtual Ignored PreVisit(Regexp* re, Ignored ignored, bool* stop) {
512 virtual Ignored ShortVisit(Regexp* re, Ignored ignored) {
523 int Regexp::NumCaptures() {
530 class NamedCapturesWalker : public Regexp::Walker<Ignored> {
541 Ignored PreVisit(Regexp* re, Ignored ignored, bool* stop) {
556 virtual Ignored ShortVisit(Regexp* re, Ignored ignored) {
567 map<string, int>* Regexp::NamedCaptures() {
574 class CaptureNamesWalker : public Regexp::Walker<Ignored> {
585 Ignored PreVisit(Regexp* re, Ignored ignored, bool* stop) {
596 virtual Ignored ShortVisit(Regexp* re, Ignored ignored) {
607 map<int, string>* Regexp::CaptureNames() {
617 bool Regexp::RequiredPrefix(string *prefix, bool *foldcase, Regexp** suffix) {
630 Regexp** sub = this->sub();
636 Regexp* re = sub[i];
681 re = new Regexp(kRegexpEmptyMatch, parse_flags());