[flang] Impose a directory structure. Move files around. Introduce
authorpeter klausler <pklausler@nvidia.com>
Wed, 7 Feb 2018 20:04:42 +0000 (12:04 -0800)
committerpeter klausler <pklausler@nvidia.com>
Wed, 7 Feb 2018 20:04:42 +0000 (12:04 -0800)
an intermediate "parser" namespace.

Original-commit: flang-compiler/f18@690b6f0d1e92bdc694196f7857ffb0aa213f2edf
Reviewed-on: https://github.com/flang-compiler/f18/pull/4
Tree-same-pre-rewrite: false

32 files changed:
flang/.gitignore
flang/CMakeLists.txt
flang/documentation/C++style.md [moved from flang/C++style.md with 100% similarity]
flang/documentation/ParserCombinators.md [moved from flang/ParserCombinators.md with 100% similarity]
flang/documentation/f2018-grammar.txt [moved from flang/f2018-grammar.txt with 100% similarity]
flang/lib/parser/basic-parsers.h [moved from flang/basic-parsers.h with 99% similarity]
flang/lib/parser/char-buffer.cc [moved from flang/char-buffer.cc with 96% similarity]
flang/lib/parser/char-buffer.h [moved from flang/char-buffer.h with 98% similarity]
flang/lib/parser/char-parsers.h [moved from flang/char-parsers.h with 98% similarity]
flang/lib/parser/cooked-chars.h [moved from flang/cooked-chars.h with 99% similarity]
flang/lib/parser/cooked-tokens.h [moved from flang/cooked-tokens.h with 99% similarity]
flang/lib/parser/debug-parser.h [moved from flang/debug-parser.h with 96% similarity]
flang/lib/parser/format-specification.h [moved from flang/format-specification.h with 100% similarity]
flang/lib/parser/grammar.h [moved from flang/grammar.h with 99% similarity]
flang/lib/parser/idioms.cc [moved from flang/idioms.cc with 91% similarity]
flang/lib/parser/idioms.h [moved from flang/idioms.h with 97% similarity]
flang/lib/parser/indirection.h [moved from flang/indirection.h with 97% similarity]
flang/lib/parser/message.cc [moved from flang/message.cc with 92% similarity]
flang/lib/parser/message.h [moved from flang/message.h with 98% similarity]
flang/lib/parser/parse-state.h [moved from flang/parse-state.h with 99% similarity]
flang/lib/parser/parse-tree.cc [moved from flang/parse-tree.cc with 99% similarity]
flang/lib/parser/parse-tree.h [moved from flang/parse-tree.h with 99% similarity]
flang/lib/parser/position.cc [moved from flang/position.cc with 83% similarity]
flang/lib/parser/position.h [moved from flang/position.h with 97% similarity]
flang/lib/parser/preprocessor.cc [moved from flang/preprocessor.cc with 99% similarity]
flang/lib/parser/preprocessor.h [moved from flang/preprocessor.h with 93% similarity]
flang/lib/parser/prescan.cc [moved from flang/prescan.cc with 99% similarity]
flang/lib/parser/prescan.h [moved from flang/prescan.h with 98% similarity]
flang/lib/parser/source.cc [moved from flang/source.cc with 98% similarity]
flang/lib/parser/source.h [moved from flang/source.h with 95% similarity]
flang/lib/parser/user-state.h [moved from flang/user-state.h with 94% similarity]
flang/tools/f18/f18.cc [moved from flang/f2018-demo.cc with 81% similarity]

index 8a614a1..4c1751e 100644 (file)
@@ -1,7 +1,7 @@
 Debug
 Release
 tags
-f18
+./f18
 *.o
 *~
 CMakeCache.txt
index 258511b..1d59b87 100644 (file)
@@ -9,14 +9,14 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH true)
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++17")
 
 set(SOURCES
-  char-buffer.cc
-  f2018-demo.cc
-  idioms.cc
-  message.cc
-  parse-tree.cc
-  position.cc
-  preprocessor.cc
-  prescan.cc
-  source.cc
+  tools/f18/f18.cc
+  lib/parser/char-buffer.cc
+  lib/parser/idioms.cc
+  lib/parser/message.cc
+  lib/parser/parse-tree.cc
+  lib/parser/position.cc
+  lib/parser/preprocessor.cc
+  lib/parser/prescan.cc
+  lib/parser/source.cc
 )
 add_executable(f18 ${SOURCES})
similarity index 99%
rename from flang/basic-parsers.h
rename to flang/lib/parser/basic-parsers.h
index de32630..7ac406e 100644 (file)
@@ -26,6 +26,7 @@
 #include <string>
 
 namespace Fortran {
+namespace parser {
 
 // fail<A>("...") returns a parser that never succeeds.  It reports an
 // error message at the current position.  The result type is unused,
@@ -1316,5 +1317,6 @@ constexpr struct GetPosition {
   }
 } getPosition;
 
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_BASIC_PARSERS_H_
similarity index 96%
rename from flang/char-buffer.cc
rename to flang/lib/parser/char-buffer.cc
index d6f903b..ed553d7 100644 (file)
@@ -4,6 +4,7 @@
 #include <cstring>
 
 namespace Fortran {
+namespace parser {
 
 char *CharBuffer::FreeSpace(size_t *n) {
   int offset{LastBlockOffset()};
@@ -45,4 +46,5 @@ void CharBuffer::CopyToContiguous(char *data) {
   }
   CHECK(to == data + bytes_);
 }
+}  // namespace parser
 }  // namespace Fortran
similarity index 98%
rename from flang/char-buffer.h
rename to flang/lib/parser/char-buffer.h
index 70c5c0e..ba0c772 100644 (file)
@@ -10,6 +10,7 @@
 #include <vector>
 
 namespace Fortran {
+namespace parser {
 
 class CharBuffer {
 public:
@@ -113,5 +114,6 @@ private:
   size_t bytes_{0};
   bool lastBlockEmpty_{false};
 };
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_CHAR_BUFFER_H_
similarity index 98%
rename from flang/char-parsers.h
rename to flang/lib/parser/char-parsers.h
index c5cbdf5..cb5b6d5 100644 (file)
@@ -9,6 +9,7 @@
 #include <optional>
 
 namespace Fortran {
+namespace parser {
 
 template<char goal> struct ExactRaw {
   using resultType = char;
@@ -107,5 +108,6 @@ private:
 constexpr RawStringMatch operator""_raw(const char str[], size_t n) {
   return RawStringMatch{str, n};
 }
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_CHAR_PARSERS_H_
similarity index 99%
rename from flang/cooked-chars.h
rename to flang/lib/parser/cooked-chars.h
index 8dedf60..0a4ef35 100644 (file)
@@ -18,6 +18,7 @@
 #include <optional>
 
 namespace Fortran {
+namespace parser {
 
 constexpr struct FixedFormPadding {
   using resultType = char;
@@ -210,5 +211,6 @@ static inline bool ConsumedAllInput(const ParseState &state) {
 }
 
 constexpr StatePredicateGuardParser consumedAllInput{ConsumedAllInput};
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_COOKED_CHARS_H_
similarity index 99%
rename from flang/cooked-tokens.h
rename to flang/lib/parser/cooked-tokens.h
index 11b5d92..3c89b7d 100644 (file)
@@ -18,6 +18,7 @@
 #include <string>
 
 namespace Fortran {
+namespace parser {
 
 class CharPredicateGuardParser {
 public:
@@ -430,5 +431,6 @@ template<typename PA> inline constexpr auto optionalBeforeColons(const PA &p) {
   return "," >> p / "::" || "::" >> construct<typename PA::resultType>{} ||
       !","_tok >> construct<typename PA::resultType>{};
 }
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_COOKED_TOKENS_H_
similarity index 96%
rename from flang/debug-parser.h
rename to flang/lib/parser/debug-parser.h
index b395f5b..769f7f7 100644 (file)
@@ -12,6 +12,7 @@
 #include <string>
 
 namespace Fortran {
+namespace parser {
 
 class DebugParser {
 public:
@@ -34,5 +35,6 @@ private:
 constexpr DebugParser operator""_debug(const char str[], size_t n) {
   return DebugParser{str, n};
 }
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_DEBUG_PARSER_H_
similarity index 99%
rename from flang/grammar.h
rename to flang/lib/parser/grammar.h
index 928a79c..634bbbf 100644 (file)
@@ -24,6 +24,7 @@
 #include <utility>
 
 namespace Fortran {
+namespace parser {
 
 // The productions that follow are derived from the draft Fortran 2018
 // standard, with some necessary modifications to remove left recursion
@@ -3643,5 +3644,6 @@ TYPE_CONTEXT_PARSER("PAUSE statement",
 //     is used only via scalar-int-variable
 //   R1030 default-char-constant-expr -> default-char-expr
 //     is only used via scalar-default-char-constant-expr
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_GRAMMAR_H_
similarity index 91%
rename from flang/idioms.cc
rename to flang/lib/parser/idioms.cc
index cfdda03..7ffa152 100644 (file)
@@ -4,6 +4,7 @@
 #include <cstdlib>
 
 namespace Fortran {
+namespace parser {
 
 [[noreturn]] void die(const char *msg, ...) {
   va_list ap;
@@ -18,4 +19,5 @@ namespace Fortran {
 std::ostream &operator<<(std::ostream &o, const std::monostate &) {
   return o << "(empty variant)";
 }
+}  // namespace parser
 }  // namespace Fortran
similarity index 97%
rename from flang/idioms.h
rename to flang/lib/parser/idioms.h
index 39c77e0..34a71ce 100644 (file)
@@ -34,6 +34,7 @@ struct is_trivially_copy_constructible<optional<list<A>>> : false_type {};
 using namespace std::string_literals;  // enable "this is a std::string"s
 
 namespace Fortran {
+namespace parser {
 
 // Helper templates for combining a list of lambdas into an anonymous
 // struct for use with std::visit() on a std::variant<> sum type.
@@ -57,6 +58,7 @@ template<typename... LAMBDAS> visitors(LAMBDAS... x)->visitors<LAMBDAS...>;
 template<typename A> bool operator!(const std::optional<A> &x) {
   return !x.has_value();
 }
+}  // namespace parser
 }  // namespace Fortran
 
 // For switch statements without default: labels.
@@ -73,6 +75,7 @@ template<typename A> struct BadType : std::false_type {};
 
 // Formatting
 namespace Fortran {
+namespace parser {
 template<typename A>
 std::ostream &operator<<(std::ostream &o, const std::optional<A> &x) {
   if (x.has_value()) {
@@ -116,5 +119,6 @@ std::ostream &operator<<(std::ostream &o, const std::variant<As...> &x) {
   return std::visit(
       [&o](const auto &y) -> std::ostream & { return o << y; }, x);
 }
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_IDIOMS_H_
similarity index 97%
rename from flang/indirection.h
rename to flang/lib/parser/indirection.h
index 34987fd..707b105 100644 (file)
@@ -11,6 +11,7 @@
 #include <utility>
 
 namespace Fortran {
+namespace parser {
 
 template<typename A> class Indirection {
 public:
@@ -54,5 +55,6 @@ template<typename A>
 std::ostream &operator<<(std::ostream &o, const Indirection<A> &x) {
   return o << *x;
 }
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_INDIRECTION_H_
similarity index 92%
rename from flang/message.cc
rename to flang/lib/parser/message.cc
index 55cdbf4..d737520 100644 (file)
@@ -1,6 +1,7 @@
 #include "message.h"
 
 namespace Fortran {
+namespace parser {
 
 std::ostream &operator<<(std::ostream &o, const Message &msg) {
   if (msg.context()) {
@@ -21,4 +22,5 @@ std::ostream &operator<<(std::ostream &o, const Messages &ms) {
   }
   return o;
 }
+}  // namespace parser
 }  // namespace Fortran
similarity index 98%
rename from flang/message.h
rename to flang/lib/parser/message.h
index 4456e97..7671867 100644 (file)
@@ -13,6 +13,7 @@
 #include <string>
 
 namespace Fortran {
+namespace parser {
 
 class Message;
 using MessageContext = std::shared_ptr<Message>;
@@ -103,5 +104,6 @@ private:
 
 std::ostream &operator<<(std::ostream &, const Message &);
 std::ostream &operator<<(std::ostream &, const Messages &);
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_MESSAGE_H_
similarity index 99%
rename from flang/parse-state.h
rename to flang/lib/parser/parse-state.h
index 88e5735..e07f802 100644 (file)
@@ -17,6 +17,7 @@
 #include <utility>
 
 namespace Fortran {
+namespace parser {
 
 class UserState;
 
@@ -228,5 +229,6 @@ private:
   // reflected in the copy and move constructors defined at the top of this
   // class definition!
 };
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_PARSE_STATE_H_
similarity index 99%
rename from flang/parse-tree.cc
rename to flang/lib/parser/parse-tree.cc
index a4d84ee..4497a62 100644 (file)
@@ -4,6 +4,7 @@
 #include <algorithm>
 
 namespace Fortran {
+namespace parser {
 
 #define UNION_FORMATTER(TYPE) \
   std::ostream &operator<<(std::ostream &o, const TYPE &x) { \
@@ -1085,4 +1086,5 @@ std::ostream &operator<<(std::ostream &o, const ProcedureStmt &x) {
 std::ostream &operator<<(std::ostream &o, const Suffix &x) {
   return o << "(Suffix " << x.binding << ' ' << x.resultName << ')';
 }
+}  // namespace parser
 }  // namespace Fortran
similarity index 99%
rename from flang/parse-tree.h
rename to flang/lib/parser/parse-tree.h
index 85b4e89..34cecb5 100644 (file)
@@ -83,6 +83,7 @@
   }
 
 namespace Fortran {
+namespace parser {
 
 // These are the unavoidable recursively-defined productions of Fortran.
 // Some references to the representations of their parses require
@@ -3222,5 +3223,6 @@ std::ostream &operator<<(std::ostream &o, const LoopBounds<A> &x) {
   return o << "(LoopBounds " << x.name << ' ' << x.lower << ' ' << x.upper
            << ' ' << x.step << ')';
 }
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_PARSE_TREE_H_
similarity index 83%
rename from flang/position.cc
rename to flang/lib/parser/position.cc
index b398225..beeef3c 100644 (file)
@@ -1,7 +1,9 @@
 #include "position.h"
 
 namespace Fortran {
+namespace parser {
 std::ostream &operator<<(std::ostream &o, const Position &x) {
   return o << "(at line " << x.lineNumber() << ", column " << x.column() << ')';
 }
+}  // namespace parser
 }  // namespace Fortran
similarity index 97%
rename from flang/position.h
rename to flang/lib/parser/position.h
index 17a2458..943ee57 100644 (file)
@@ -8,6 +8,7 @@
 #include <ostream>
 
 namespace Fortran {
+namespace parser {
 
 class Position {
 public:
@@ -70,5 +71,6 @@ private:
 };
 
 std::ostream &operator<<(std::ostream &, const Position &);
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_POSITION_H_
similarity index 99%
rename from flang/preprocessor.cc
rename to flang/lib/parser/preprocessor.cc
index c5c0c77..3481a3f 100644 (file)
@@ -13,6 +13,7 @@
 #include <utility>
 
 namespace Fortran {
+namespace parser {
 
 bool CharPointerWithLength::IsBlank() const {
   for (size_t j{0}; j < bytes_; ++j) {
@@ -937,4 +938,5 @@ bool Preprocessor::IsIfPredicateTrue(
   }
   return result;
 }
+}  // namespace parser
 }  // namespace Fortran
similarity index 93%
rename from flang/preprocessor.h
rename to flang/lib/parser/preprocessor.h
index 165f935..2896a85 100644 (file)
@@ -19,6 +19,7 @@
 #include <vector>
 
 namespace Fortran {
+namespace parser {
 
 class CharBuffer;
 class Prescanner;
@@ -50,11 +51,12 @@ private:
   const char *data_{nullptr};
   size_t bytes_{0};
 };
+}  // namespace parser
 }  // namespace Fortran
 
 // Specializations to enable std::unordered_map<CharPointerWithLength, ...>
-template<> struct std::hash<Fortran::CharPointerWithLength> {
-  size_t operator()(const Fortran::CharPointerWithLength &x) const {
+template<> struct std::hash<Fortran::parser::CharPointerWithLength> {
+  size_t operator()(const Fortran::parser::CharPointerWithLength &x) const {
     size_t hash{0}, bytes{x.size()};
     for (size_t j{0}; j < bytes; ++j) {
       hash = (hash * 31) ^ x[j];
@@ -63,9 +65,9 @@ template<> struct std::hash<Fortran::CharPointerWithLength> {
   }
 };
 
-template<> struct std::equal_to<Fortran::CharPointerWithLength> {
-  bool operator()(const Fortran::CharPointerWithLength &x,
-      const Fortran::CharPointerWithLength &y) const {
+template<> struct std::equal_to<Fortran::parser::CharPointerWithLength> {
+  bool operator()(const Fortran::parser::CharPointerWithLength &x,
+      const Fortran::parser::CharPointerWithLength &y) const {
     return x.size() == y.size() &&
         std::memcmp(static_cast<const void *>(&x[0]),
             static_cast<const void *>(&y[0]), x.size()) == 0;
@@ -73,6 +75,7 @@ template<> struct std::equal_to<Fortran::CharPointerWithLength> {
 };
 
 namespace Fortran {
+namespace parser {
 
 // Buffers a contiguous sequence of characters that has been partitioned into
 // a sequence of preprocessing tokens.
@@ -199,5 +202,6 @@ private:
   std::unordered_map<CharPointerWithLength, Definition> definitions_;
   std::stack<CanDeadElseAppear> ifStack_;
 };
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_PREPROCESSOR_H_
similarity index 99%
rename from flang/prescan.cc
rename to flang/lib/parser/prescan.cc
index 7b84472..efe4a58 100644 (file)
@@ -8,6 +8,7 @@
 #include <vector>
 
 namespace Fortran {
+namespace parser {
 
 CharBuffer Prescanner::Prescan(const SourceFile &source) {
   sourceFile_ = &source;
@@ -490,4 +491,5 @@ void Prescanner::PayNewlineDebt(CharBuffer *out) {
     out->Put('\n');
   }
 }
+}  // namespace parser
 }  // namespace Fortran
similarity index 98%
rename from flang/prescan.h
rename to flang/lib/parser/prescan.h
index b28737c..aac8098 100644 (file)
@@ -20,6 +20,7 @@
 #include <optional>
 
 namespace Fortran {
+namespace parser {
 
 class Prescanner {
 public:
@@ -109,5 +110,6 @@ private:
   int delimiterNesting_{0};
   Preprocessor preprocessor_;
 };
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_PRESCAN_H_
similarity index 98%
rename from flang/source.cc
rename to flang/lib/parser/source.cc
index 4850155..635f44a 100644 (file)
@@ -14,6 +14,7 @@
 // TODO: Port to Windows &c.
 
 namespace Fortran {
+namespace parser {
 
 SourceFile::~SourceFile() { Close(); }
 
@@ -122,4 +123,5 @@ void SourceFile::Close() {
   }
   path_.clear();
 }
+}  // namespace parser
 }  // namespace Fortran
similarity index 95%
rename from flang/source.h
rename to flang/lib/parser/source.h
index e6d5754..c26bd8c 100644 (file)
@@ -9,6 +9,7 @@
 #include <string>
 
 namespace Fortran {
+namespace parser {
 
 class SourceFile {
 public:
@@ -27,5 +28,6 @@ private:
   const char *content_{nullptr};
   size_t bytes_{0};
 };
+}  // namespace parser
 }  // namespace Fortran
 #endif  // FORTRAN_SOURCE_H_
similarity index 94%
rename from flang/user-state.h
rename to flang/lib/parser/user-state.h
index b186784..972d432 100644 (file)
@@ -10,6 +10,7 @@
 #include <unordered_set>
 
 namespace Fortran {
+namespace parser {
 class UserState {
 public:
   using Label = std::uint64_t;
@@ -35,5 +36,6 @@ private:
   std::unordered_set<Label> doLabels_;
   int nonlabelDoConstructNestingDepth_{0};
 };
-};  // namespace Fortran
+}  // namespace parser
+}  // namespace Fortran
 #endif  // FORTRAN_USER_STATE_H_
similarity index 81%
rename from flang/f2018-demo.cc
rename to flang/tools/f18/f18.cc
index e81d578..82aea20 100644 (file)
@@ -1,15 +1,15 @@
 // Temporary Fortran front end driver main program for development scaffolding.
 
-#include "basic-parsers.h"
-#include "char-buffer.h"
-#include "cooked-chars.h"
-#include "grammar.h"
-#include "idioms.h"
-#include "message.h"
-#include "parse-tree.h"
-#include "prescan.h"
-#include "source.h"
-#include "user-state.h"
+#include "../../lib/parser/basic-parsers.h"
+#include "../../lib/parser/char-buffer.h"
+#include "../../lib/parser/cooked-chars.h"
+#include "../../lib/parser/grammar.h"
+#include "../../lib/parser/idioms.h"
+#include "../../lib/parser/message.h"
+#include "../../lib/parser/parse-tree.h"
+#include "../../lib/parser/prescan.h"
+#include "../../lib/parser/source.h"
+#include "../../lib/parser/user-state.h"
 #include <cerrno>
 #include <cstdio>
 #include <cstdlib>
@@ -36,9 +36,11 @@ std::list<std::string> argList(int argc, char *const argv[]) {
 }  // namespace
 
 namespace Fortran {
+namespace parser {
 constexpr auto grammar = program;
+}  // namespace parser
 }  // namespace Fortran
-using Fortran::grammar;
+using Fortran::parser::grammar;
 
 int main(int argc, char *const argv[]) {
 
@@ -97,7 +99,7 @@ int main(int argc, char *const argv[]) {
     }
   }
 
-  Fortran::SourceFile source;
+  Fortran::parser::SourceFile source;
   std::stringstream error;
   if (!source.Open(path, &error)) {
     std::cerr << error.str() << '\n';
@@ -108,9 +110,9 @@ int main(int argc, char *const argv[]) {
   size_t sourceBytes{source.bytes()};
   std::unique_ptr<char[]> prescanned;
   if (prescan) {
-    Fortran::Messages messages;
-    Fortran::Prescanner prescanner{messages};
-    Fortran::CharBuffer buffer{
+    Fortran::parser::Messages messages;
+    Fortran::parser::Prescanner prescanner{messages};
+    Fortran::parser::CharBuffer buffer{
         prescanner.set_fixedForm(fixedForm)
             .set_enableBackslashEscapesInCharLiterals(backslashEscapes)
             .set_fixedFormColumnLimit(columns)
@@ -128,7 +130,7 @@ int main(int argc, char *const argv[]) {
     columns = std::numeric_limits<int>::max();
   }
 
-  Fortran::ParseState state{sourceContent, sourceBytes};
+  Fortran::parser::ParseState state{sourceContent, sourceBytes};
   state.set_prescanned(prescan);
   state.set_inFixedForm(fixedForm);
   state.set_enableBackslashEscapesInCharLiterals(backslashEscapes);
@@ -136,11 +138,12 @@ int main(int argc, char *const argv[]) {
   state.set_columns(columns);
   state.set_enableOldDebugLines(enableOldDebugLines);
   state.PushContext("source file '"s + path + "'");
-  Fortran::UserState ustate;
+  Fortran::parser::UserState ustate;
   state.set_userState(&ustate);
 
   if (dumpCookedChars) {
-    while (std::optional<char> och{Fortran::cookedNextChar.Parse(&state)}) {
+    while (std::optional<char>
+        och{Fortran::parser::cookedNextChar.Parse(&state)}) {
       std::cout << *och;
     }
     return 0;
@@ -149,7 +152,7 @@ int main(int argc, char *const argv[]) {
   std::optional<typename decltype(grammar)::resultType> result;
 #if 0
   for (int j = 0; j < 1000; ++j) {
-    Fortran::ParseState state1{state};
+    Fortran::parser::ParseState state1{state};
     result = grammar.Parse(&state1);
     if (!result) {
       std::cerr << "demo FAIL in timing loop\n";