Eval
- Implemented ::getBinaryOperators.
This commit is contained in:
10
src/Eval.cpp
10
src/Eval.cpp
@@ -224,6 +224,16 @@ void Eval::getOperators (std::vector <std::string>& all)
|
|||||||
all.push_back (operators[i].op);
|
all.push_back (operators[i].op);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Static.
|
||||||
|
void Eval::getBinaryOperators (std::vector <std::string>& all)
|
||||||
|
{
|
||||||
|
all.clear ();
|
||||||
|
for (unsigned int i = 0; i < NUM_OPERATORS; ++i)
|
||||||
|
if (operators[i].type == 'b')
|
||||||
|
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,
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public:
|
|||||||
void debug (bool);
|
void debug (bool);
|
||||||
|
|
||||||
static void getOperators (std::vector <std::string>&);
|
static void getOperators (std::vector <std::string>&);
|
||||||
|
static void getBinaryOperators (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;
|
||||||
|
|||||||
Reference in New Issue
Block a user