Lexer: Implemented ::readWord

- Lexer::readWord is a general-purpose text parser, for finding plain words and
  quoted strings. It supports \uNNNN and U+NNNN unicode sequences, and general
  escapes, \t, \', \" etc.
This commit is contained in:
Paul Beckingham 2015-07-06 15:32:12 -04:00
parent 26e6dd2131
commit d82da280cb
2 changed files with 100 additions and 8 deletions

View file

@ -75,13 +75,13 @@ public:
static bool isOneWord (const std::string&);
static void dequote (std::string&);
static bool wasQuoted (const std::string&);
static bool readWord (const std::string&, const std::string&, std::string::size_type&, std::string&);
static bool decomposePair (const std::string&, std::string&, std::string&, std::string&, std::string&);
static int hexToInt (int);
static int hexToInt (int, int);
static int hexToInt (int, int, int, int);
// Helpers.
bool isEOS () const;
int hexToInt (int) const;
int hexToInt (int, int) const;
int hexToInt (int, int, int, int) const;
bool isEOS () const;
// Stream Classifiers.
bool isString (std::string&, Lexer::Type&, int quote);