Parser Integration

- New parser integrated and functioning, but only shadows the A3 parser.  In
  debug mode, there is new output, but that's all that happenѕ.
This commit is contained in:
Paul Beckingham 2013-09-01 14:14:15 -04:00
parent 9ee17a5b51
commit 314d0e9d01
4 changed files with 26 additions and 2 deletions

View file

@ -81,6 +81,16 @@ int Context::initialize (int argc, const char** argv)
try try
{ {
// BEGIN EXPERIMENTAL CODE
// Initialize the command line parser.
a3t.initialize (argc, argv);
Tree* parseTree = a3t.parse ();
// END EXPERIMENTAL CODE
// char** argv --> std::vector <std::string> Context::a3. // char** argv --> std::vector <std::string> Context::a3.
a3.capture (argc, argv); a3.capture (argc, argv);
@ -165,6 +175,18 @@ int Context::initialize (int argc, const char** argv)
a3.categorize (); a3.categorize ();
a3.dump ("Context::initialize"); 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 extension command objects.
// TODO Instantiate default command object. // TODO Instantiate default command object.

View file

@ -39,6 +39,7 @@
#include <File.h> #include <File.h>
#include <Directory.h> #include <Directory.h>
#include <A3.h> #include <A3.h>
#include <A3t.h>
#include <Timer.h> #include <Timer.h>
class Context class Context
@ -83,6 +84,7 @@ private:
public: public:
std::string program; std::string program;
A3 a3; A3 a3;
A3t a3t;
std::string home_dir; std::string home_dir;
File rc_file; File rc_file;
Path data_dir; Path data_dir;

View file

@ -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) for (int i = 0; i < argc; ++i)
{ {

View file

@ -36,7 +36,7 @@ class A3t
public: public:
A3t (); A3t ();
~A3t (); ~A3t ();
void initialize (int, char**); void initialize (int, const char**);
Tree* parse (); Tree* parse ();
void entity (const std::string&, const std::string&); void entity (const std::string&, const std::string&);
bool canonicalize (std::string&, const std::string&, const std::string&) const; bool canonicalize (std::string&, const std::string&, const std::string&) const;