- Implemented ::getBinaryOperators.
This commit is contained in:
Paul Beckingham 2014-11-09 15:18:04 -05:00
parent 84f9bc52ef
commit d7378d830f
2 changed files with 11 additions and 0 deletions

View file

@ -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,

View file

@ -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;