From 314d0e9d013afe5776038a5c90fcdeb76072ba2d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 1 Sep 2013 14:14:15 -0400 Subject: [PATCH] Parser Integration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - New parser integrated and functioning, but only shadows the A3 parser. In debug mode, there is new output, but that's all that happenѕ. --- src/Context.cpp | 22 ++++++++++++++++++++++ src/Context.h | 2 ++ src/parser/A3t.cpp | 2 +- src/parser/A3t.h | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/Context.cpp b/src/Context.cpp index e1347f350..75f7aabac 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -81,6 +81,16 @@ int Context::initialize (int argc, const char** argv) try { + // BEGIN EXPERIMENTAL CODE + + // Initialize the command line parser. + a3t.initialize (argc, argv); + Tree* parseTree = a3t.parse (); + + // END EXPERIMENTAL CODE + + + // char** argv --> std::vector Context::a3. a3.capture (argc, argv); @@ -165,6 +175,18 @@ int Context::initialize (int argc, const char** argv) a3.categorize (); a3.dump ("Context::initialize"); + + + // BEGIN EXPERIMENTAL CODE + + // Initialize the command line parser. + if (parseTree && config.getBoolean ("debug")) + parseTree->dump (); + + // END EXPERIMENTAL CODE + + + // TODO Instantiate extension command objects. // TODO Instantiate default command object. diff --git a/src/Context.h b/src/Context.h index 7ebb1013b..01f9a32e9 100644 --- a/src/Context.h +++ b/src/Context.h @@ -39,6 +39,7 @@ #include #include #include +#include #include class Context @@ -83,6 +84,7 @@ private: public: std::string program; A3 a3; + A3t a3t; std::string home_dir; File rc_file; Path data_dir; diff --git a/src/parser/A3t.cpp b/src/parser/A3t.cpp index 55843be1d..1df4d40e6 100644 --- a/src/parser/A3t.cpp +++ b/src/parser/A3t.cpp @@ -50,7 +50,7 @@ A3t::~A3t () } //////////////////////////////////////////////////////////////////////////////// -void A3t::initialize (int argc, char** argv) +void A3t::initialize (int argc, const char** argv) { for (int i = 0; i < argc; ++i) { diff --git a/src/parser/A3t.h b/src/parser/A3t.h index f7498d71b..ec160f313 100644 --- a/src/parser/A3t.h +++ b/src/parser/A3t.h @@ -36,7 +36,7 @@ class A3t public: A3t (); ~A3t (); - void initialize (int, char**); + void initialize (int, const char**); Tree* parse (); void entity (const std::string&, const std::string&); bool canonicalize (std::string&, const std::string&, const std::string&) const;