Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Unified Diff: third_party/re2/re2/testing/regexp_generator.h

Issue 1544433002: Replace RE2 import with a dependency (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-Added LICENSE and OWNERS file Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/re2/re2/testing/regexp_benchmark.cc ('k') | third_party/re2/re2/testing/regexp_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/re2/re2/testing/regexp_generator.h
diff --git a/third_party/re2/re2/testing/regexp_generator.h b/third_party/re2/re2/testing/regexp_generator.h
deleted file mode 100644
index 3ba0d70e2202639c83fcf2af060b0d32b32a4092..0000000000000000000000000000000000000000
--- a/third_party/re2/re2/testing/regexp_generator.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2008 The RE2 Authors. All Rights Reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Regular expression generator: generates all possible
-// regular expressions within given parameters (see below for details).
-
-#ifndef RE2_TESTING_REGEXP_GENERATOR_H__
-#define RE2_TESTING_REGEXP_GENERATOR_H__
-
-#include <string>
-#include <vector>
-#include "util/random.h"
-#include "util/util.h"
-#include "re2/stringpiece.h"
-
-namespace re2 {
-
-// Regular expression generator.
-//
-// Given a set of atom expressions like "a", "b", or "."
-// and operators like "%s*", generates all possible regular expressions
-// using at most maxbases base expressions and maxops operators.
-// For each such expression re, calls HandleRegexp(re).
-//
-// Callers are expected to subclass RegexpGenerator and provide HandleRegexp.
-//
-class RegexpGenerator {
- public:
- RegexpGenerator(int maxatoms, int maxops, const vector<string>& atoms,
- const vector<string>& ops);
- virtual ~RegexpGenerator() {}
-
- // Generates all the regular expressions, calling HandleRegexp(re) for each.
- void Generate();
-
- // Generates n random regular expressions, calling HandleRegexp(re) for each.
- void GenerateRandom(int32 seed, int n);
-
- // Handles a regular expression. Must be provided by subclass.
- virtual void HandleRegexp(const string& regexp) = 0;
-
- // The egrep regexp operators: * + ? | and concatenation.
- static const vector<string>& EgrepOps();
-
- private:
- void RunPostfix(const vector<string>& post);
- void GeneratePostfix(vector<string>* post, int nstk, int ops, int lits);
- bool GenerateRandomPostfix(vector<string>* post, int nstk, int ops, int lits);
-
- int maxatoms_; // Maximum number of atoms allowed in expr.
- int maxops_; // Maximum number of ops allowed in expr.
- vector<string> atoms_; // Possible atoms.
- vector<string> ops_; // Possible ops.
- ACMRandom* acm_; // Random generator.
- DISALLOW_COPY_AND_ASSIGN(RegexpGenerator);
-};
-
-// Helpers for preparing arguments to RegexpGenerator constructor.
-
-// Returns one string for each character in s.
-vector<string> Explode(const StringPiece& s);
-
-// Splits string everywhere sep is found, returning
-// vector of pieces.
-vector<string> Split(const StringPiece& sep, const StringPiece& s);
-
-} // namespace re2
-
-#endif // RE2_TESTING_REGEXP_GENERATOR_H__
« no previous file with comments | « third_party/re2/re2/testing/regexp_benchmark.cc ('k') | third_party/re2/re2/testing/regexp_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698