A3t::initialize
- Migrated ctor functionality over to the new initialize method, for integration with Context.
This commit is contained in:
@@ -36,12 +36,22 @@
|
||||
static const int minimumMatchLength = 3;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
A3t::A3t (int argc, char** argv)
|
||||
A3t::A3t ()
|
||||
{
|
||||
_tree = new Tree ("root");
|
||||
if (! _tree)
|
||||
throw std::string ("Failed to allocate memory for parse tree.");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
A3t::~A3t ()
|
||||
{
|
||||
delete _tree;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void A3t::initialize (int argc, char** argv)
|
||||
{
|
||||
for (int i = 0; i < argc; ++i)
|
||||
{
|
||||
Tree* branch = _tree->addBranch (new Tree (format ("arg{1}", i)));
|
||||
@@ -51,11 +61,6 @@ A3t::A3t (int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
A3t::~A3t ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Tree* A3t::parse ()
|
||||
{
|
||||
|
||||
@@ -34,8 +34,9 @@
|
||||
class A3t
|
||||
{
|
||||
public:
|
||||
A3t (int, char**);
|
||||
A3t ();
|
||||
~A3t ();
|
||||
void initialize (int, char**);
|
||||
Tree* parse ();
|
||||
void entity (const std::string&, const std::string&);
|
||||
bool canonicalize (std::string&, const std::string&, const std::string&) const;
|
||||
|
||||
@@ -39,7 +39,8 @@ int main (int argc, char** argv)
|
||||
// Prepare the Context object.
|
||||
|
||||
|
||||
A3t a3t (argc, argv);
|
||||
A3t a3t;
|
||||
a3t.initialize (argc, argv);
|
||||
|
||||
// Reports.
|
||||
a3t.entity ("report", "list");
|
||||
|
||||
Reference in New Issue
Block a user