A3t::initialize

- Migrated ctor functionality over to the new initialize method, for integration
  with Context.
This commit is contained in:
Paul Beckingham
2013-09-01 13:57:24 -04:00
parent eb55c64f34
commit c3bf3b79a4
3 changed files with 15 additions and 8 deletions

View File

@@ -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 ()
{