Tidy up some forward declarations.

Change-Id: I625fe935fbdbdffa05cfd6f02060e5b23a4190af
Reviewed-on: https://code-review.googlesource.com/5424
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/re2/dfa.cc b/re2/dfa.cc
index fba7b64..b0a977a 100644
--- a/re2/dfa.cc
+++ b/re2/dfa.cc
@@ -85,9 +85,9 @@
 
   // These data structures are logically private, but C++ makes it too
   // difficult to mark them as such.
-  class Workq;
   class RWLocker;
   class StateSaver;
+  class Workq;
 
   // A single DFA state.  The DFA is represented as a graph of these
   // States, linked by the next_ pointers.  If in state s and reading
diff --git a/re2/prog.h b/re2/prog.h
index e1c7249..140093f 100644
--- a/re2/prog.h
+++ b/re2/prog.h
@@ -40,10 +40,8 @@
   kEmptyAllFlags         = (1<<6)-1,
 };
 
-class Regexp;
-
 class DFA;
-struct OneState;
+class Regexp;
 
 // Compiled form of regexp program.
 class Prog {
diff --git a/re2/regexp.h b/re2/regexp.h
index 607dc93..a455b5c 100644
--- a/re2/regexp.h
+++ b/re2/regexp.h
@@ -211,10 +211,6 @@
   DISALLOW_COPY_AND_ASSIGN(RegexpStatus);
 };
 
-// Walkers to implement Simplify.
-class CoalesceWalker;
-class SimplifyWalker;
-
 // Compiled form; see prog.h
 class Prog;
 
@@ -443,6 +439,7 @@
 
   // Helpers for Parse.  Listed here so they can edit Regexps.
   class ParseState;
+
   friend class ParseState;
   friend bool ParseCharClass(StringPiece* s, Regexp** out_re,
                              RegexpStatus* status);
diff --git a/re2/set.h b/re2/set.h
index 0e6d4b3..6efc972 100644
--- a/re2/set.h
+++ b/re2/set.h
@@ -11,6 +11,11 @@
 #include "re2/re2.h"
 
 namespace re2 {
+class Prog;
+class Regexp;
+}  // namespace re2
+
+namespace re2 {
 using std::vector;
 
 // An RE2::Set represents a collection of regexps that can
diff --git a/re2/testing/exhaustive2_test.cc b/re2/testing/exhaustive2_test.cc
index 6dc5016..f0638b5 100644
--- a/re2/testing/exhaustive2_test.cc
+++ b/re2/testing/exhaustive2_test.cc
@@ -8,8 +8,6 @@
 #include "re2/re2.h"
 #include "re2/testing/exhaustive_tester.h"
 
-DECLARE_string(regexp_engines);
-
 namespace re2 {
 
 // Test empty string matches (aka "(?:)")
diff --git a/re2/testing/exhaustive_test.cc b/re2/testing/exhaustive_test.cc
index fc40dee..514fd90 100644
--- a/re2/testing/exhaustive_test.cc
+++ b/re2/testing/exhaustive_test.cc
@@ -9,8 +9,6 @@
 
 namespace re2 {
 
-DECLARE_string(regexp_engines);
-
 // Test very simple expressions.
 TEST(EgrepLiterals, Lowercase) {
   EgrepTest(3, 2, "abc.", 3, "abc", "");
diff --git a/re2/testing/tester.h b/re2/testing/tester.h
index 07291d2..e2d72cb 100644
--- a/re2/testing/tester.h
+++ b/re2/testing/tester.h
@@ -16,8 +16,6 @@
 
 namespace re2 {
 
-class Regexp;
-
 // All the supported regexp engines.
 enum Engine {
   kEngineBacktrack = 0,    // Prog::UnsafeSearchBacktrack