- Integrated Lexer2 in place of Lexer. Tests fail.
This commit is contained in:
Paul Beckingham
2015-02-22 13:52:14 -05:00
parent 2155bd3969
commit 0cf18f3b16
12 changed files with 416 additions and 1408 deletions

View File

@@ -29,7 +29,7 @@
#include <vector>
#include <string>
#include <Lexer.h>
#include <Lexer2.h>
#include <Variant.h>
class Eval
@@ -53,28 +53,28 @@ public:
static void getBinaryOperators (std::vector <std::string>&);
private:
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 infixParse (std::vector <std::pair <std::string, Lexer::Type> >&) const;
bool parseLogical (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseRegex (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseEquality (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseComparative (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseArithmetic (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseGeometric (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseTag (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseUnary (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseExponent (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parsePrimitive (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
void evaluatePostfixStack (const std::vector <std::pair <std::string, Lexer2::Type> >&, Variant&) const;
void infixToPostfix (std::vector <std::pair <std::string, Lexer2::Type> >&) const;
void infixParse (std::vector <std::pair <std::string, Lexer2::Type> >&) const;
bool parseLogical (std::vector <std::pair <std::string, Lexer2::Type> >&, int &) const;
bool parseRegex (std::vector <std::pair <std::string, Lexer2::Type> >&, int &) const;
bool parseEquality (std::vector <std::pair <std::string, Lexer2::Type> >&, int &) const;
bool parseComparative (std::vector <std::pair <std::string, Lexer2::Type> >&, int &) const;
bool parseArithmetic (std::vector <std::pair <std::string, Lexer2::Type> >&, int &) const;
bool parseGeometric (std::vector <std::pair <std::string, Lexer2::Type> >&, int &) const;
bool parseTag (std::vector <std::pair <std::string, Lexer2::Type> >&, int &) const;
bool parseUnary (std::vector <std::pair <std::string, Lexer2::Type> >&, int &) const;
bool parseExponent (std::vector <std::pair <std::string, Lexer2::Type> >&, int &) const;
bool parsePrimitive (std::vector <std::pair <std::string, Lexer2::Type> >&, int &) const;
bool identifyOperator (const std::string&, char&, int&, char&) const;
std::string dump (std::vector <std::pair <std::string, Lexer::Type> >&) const;
std::string dump (std::vector <std::pair <std::string, Lexer2::Type> >&) const;
private:
std::vector <bool (*)(const std::string&, Variant&)> _sources;
bool _ambiguity;
bool _debug;
std::vector <std::pair <std::string, Lexer::Type> > _compiled;
std::vector <std::pair <std::string, Lexer2::Type> > _compiled;
};