1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2024-11-10 00:45:36 +00:00

a bit more refactoring

This commit is contained in:
Antonin Portelli 2014-01-22 17:29:52 +01:00
parent 278bc59a33
commit 12bbd3ec7e
2 changed files with 11 additions and 11 deletions

View File

@ -197,7 +197,7 @@ MathCompiler::MathCompiler(void)
, state_(NULL)
, root_(NULL)
, out_()
, status_(Status::None)
, status_(Status::none)
{}
MathCompiler::MathCompiler(const std::string &code)
@ -221,16 +221,16 @@ void MathCompiler::init(const std::string &code)
code_ = new stringstream(code);
codeName_ = "<string>";
state_ = new MathParserState(code_, &codeName_, &root_);
status_ |= Status::Initialised;
status_ |= Status::initialised;
}
const VirtualProgram& MathCompiler::operator()(void)
{
if (!(status_ & Status::Parsed))
if (!(status_ & Status::parsed))
{
parse();
}
if (!(status_ & Status::Compiled))
if (!(status_ & Status::compiled))
{
compile(*root_);
}
@ -242,8 +242,8 @@ const VirtualProgram& MathCompiler::operator()(void)
void MathCompiler::parse(void)
{
_math_parse(state_);
status_ |= Status::Parsed;
status_ -= status_ & Status::Compiled;
status_ |= Status::parsed;
status_ -= status_ & Status::compiled;
}
#define IFOP(name, nArg) if ((n.getName() == (name))&&(n.getNArg() == nArg))
@ -278,7 +278,7 @@ void MathCompiler::compile(const MathNode& n)
"unknown node type (node '" + n.getName() + "')");
break;
}
status_ |= Status::Compiled;
status_ |= Status::compiled;
}
void MathCompiler::reset(void)

View File

@ -156,10 +156,10 @@ private:
public:
enum
{
None = 0,
Initialised = 1 << 0,
Parsed = 1 << 1,
Compiled = 1 << 2
none = 0,
initialised = 1 << 0,
parsed = 1 << 1,
compiled = 1 << 2
};
};
public: