Expressions - Refactor

- The A3::Arg object is very similar to the E9::Term object, so the two are
  being merged.  First step is to separate A3::Arg into it's own space, then
  add a _type member.
- Added more valid stop characters as terminators for various arg types.
- Removed redundant E9 special handling for dates, which is already built in
  to the Date object.
This commit is contained in:
Paul Beckingham 2011-08-19 22:42:19 -04:00
parent 7dd3e081c7
commit 816b07e868
6 changed files with 190 additions and 112 deletions

View file

@ -30,56 +30,12 @@
#include <vector>
#include <string>
#include <Arg.h>
#include <Nibbler.h>
#include <File.h>
#define ARGUMENTS_SEQUENCE_MAX_RANGE 1000
class Arg
{
public:
Arg ()
: _raw ("")
, _category ("")
{
}
Arg (
const std::string& raw,
const std::string& category)
: _raw (raw)
, _category (category)
{
}
Arg (const Arg& other)
{
_raw = other._raw;
_category = other._category;
}
Arg& operator= (const Arg& other)
{
if (this != &other)
{
_raw = other._raw;
_category = other._category;
}
return *this;
}
bool operator== (const Arg& other) const
{
return _raw == other._raw &&
_category == other._category;
}
public:
std::string _raw; // Raw input token, never modified
std::string _category; // Categorized argument
};
class A3 : public std::vector <Arg>
{
public: