Eval
- Added Eval::getOperators to expose suported operator symbols.
This commit is contained in:
@@ -171,6 +171,15 @@ void Eval::debug ()
|
|||||||
_debug = true;
|
_debug = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Static.
|
||||||
|
void Eval::getOperators (std::vector <std::string>& all)
|
||||||
|
{
|
||||||
|
all.clear ();
|
||||||
|
for (unsigned int i = 0; i < NUM_OPERATORS; ++i)
|
||||||
|
all.push_back (operators[i].op);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Eval::evaluatePostfixStack (
|
void Eval::evaluatePostfixStack (
|
||||||
const std::vector <std::pair <std::string, Lexer::Type> >& tokens,
|
const std::vector <std::pair <std::string, Lexer::Type> >& tokens,
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ public:
|
|||||||
void ambiguity (bool);
|
void ambiguity (bool);
|
||||||
void debug ();
|
void debug ();
|
||||||
|
|
||||||
|
static void getOperators (std::vector <std::string>&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void evaluatePostfixStack (const std::vector <std::pair <std::string, Lexer::Type> >&, Variant&) const;
|
void evaluatePostfixStack (const std::vector <std::pair <std::string, Lexer::Type> >&, Variant&) const;
|
||||||
void infixToPostfix (std::vector <std::pair <std::string, Lexer::Type> >&) const;
|
void infixToPostfix (std::vector <std::pair <std::string, Lexer::Type> >&) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user