Lexer: Removed unnecessary ::ambiguity method

This commit is contained in:
Paul Beckingham 2015-07-01 16:18:28 -04:00
parent 8e8b2f9f38
commit b090c6bccf
4 changed files with 0 additions and 16 deletions

View file

@ -371,7 +371,6 @@ void CLI2::lexArguments ()
std::string lexeme; std::string lexeme;
Lexer::Type type; Lexer::Type type;
Lexer lex (_original_args[i]); Lexer lex (_original_args[i]);
lex.ambiguity (false);
while (lex.token (lexeme, type)) while (lex.token (lexeme, type))
_args.push_back (A2 (lexeme, type)); _args.push_back (A2 (lexeme, type));
@ -451,7 +450,6 @@ void CLI2::addFilter (const std::string& arg)
std::string lexeme; std::string lexeme;
Lexer::Type type; Lexer::Type type;
Lexer lex (arg); Lexer lex (arg);
lex.ambiguity (false);
while (lex.token (lexeme, type)) while (lex.token (lexeme, type))
add (lexeme); add (lexeme);
@ -1592,7 +1590,6 @@ void CLI2::defaultCommand ()
std::string lexeme; std::string lexeme;
Lexer::Type type; Lexer::Type type;
Lexer lex (defaultCommand); Lexer lex (defaultCommand);
lex.ambiguity (false);
while (lex.token (lexeme, type)) while (lex.token (lexeme, type))
{ {

View file

@ -126,7 +126,6 @@ void Eval::evaluateInfixExpression (const std::string& e, Variant& v) const
{ {
// Reduce e to a vector of tokens. // Reduce e to a vector of tokens.
Lexer l (e); Lexer l (e);
l.ambiguity (_ambiguity);
std::vector <std::pair <std::string, Lexer::Type>> tokens; std::vector <std::pair <std::string, Lexer::Type>> tokens;
std::string token; std::string token;
Lexer::Type type; Lexer::Type type;
@ -154,7 +153,6 @@ void Eval::evaluatePostfixExpression (const std::string& e, Variant& v) const
{ {
// Reduce e to a vector of tokens. // Reduce e to a vector of tokens.
Lexer l (e); Lexer l (e);
l.ambiguity (_ambiguity);
std::vector <std::pair <std::string, Lexer::Type>> tokens; std::vector <std::pair <std::string, Lexer::Type>> tokens;
std::string token; std::string token;
Lexer::Type type; Lexer::Type type;
@ -173,7 +171,6 @@ void Eval::compileExpression (const std::string& e)
{ {
// Reduce e to a vector of tokens. // Reduce e to a vector of tokens.
Lexer l (e); Lexer l (e);
l.ambiguity (_ambiguity);
std::string token; std::string token;
Lexer::Type type; Lexer::Type type;
while (l.token (token, type)) while (l.token (token, type))

View file

@ -43,7 +43,6 @@ Lexer::Lexer (const std::string& text)
: _text (text) : _text (text)
, _cursor (0) , _cursor (0)
, _eos (text.size ()) , _eos (text.size ())
, _ambiguity (false)
{ {
} }
@ -52,12 +51,6 @@ Lexer::~Lexer ()
{ {
} }
////////////////////////////////////////////////////////////////////////////////
void Lexer::ambiguity (bool value)
{
_ambiguity = value;
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// When a Lexer object is constructed with a string, this method walks through // When a Lexer object is constructed with a string, this method walks through
// the stream of low-level tokens. // the stream of low-level tokens.
@ -455,7 +448,6 @@ bool Lexer::isDate (std::string& token, Lexer::Type& type)
{ {
std::size_t iso_i = 0; std::size_t iso_i = 0;
ISO8601d iso; ISO8601d iso;
iso.ambiguity (_ambiguity);
if (iso.parse (_text.substr (_cursor), iso_i)) if (iso.parse (_text.substr (_cursor), iso_i))
{ {
type = Lexer::Type::date; type = Lexer::Type::date;

View file

@ -53,7 +53,6 @@ public:
Lexer (const std::string&); Lexer (const std::string&);
~Lexer (); ~Lexer ();
void ambiguity (bool);
bool token (std::string&, Lexer::Type&); bool token (std::string&, Lexer::Type&);
static std::vector <std::pair <std::string, Lexer::Type>> tokens (const std::string&); static std::vector <std::pair <std::string, Lexer::Type>> tokens (const std::string&);
static std::vector <std::string> split (const std::string&); static std::vector <std::string> split (const std::string&);
@ -109,7 +108,6 @@ private:
std::string _text; std::string _text;
std::size_t _cursor; std::size_t _cursor;
std::size_t _eos; std::size_t _eos;
bool _ambiguity;
}; };
#endif #endif