summaryrefslogtreecommitdiff
path: root/include/lldb/Utility/StringLexer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Utility/StringLexer.h')
-rw-r--r--include/lldb/Utility/StringLexer.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/include/lldb/Utility/StringLexer.h b/include/lldb/Utility/StringLexer.h
index 42c169c5cf940..ae6b393b0eb68 100644
--- a/include/lldb/Utility/StringLexer.h
+++ b/include/lldb/Utility/StringLexer.h
@@ -10,8 +10,9 @@
#ifndef utility_StringLexer_h_
#define utility_StringLexer_h_
-#include <string>
+#include <initializer_list>
#include <list>
+#include <string>
namespace lldb_utility {
@@ -27,12 +28,19 @@ public:
StringLexer (const StringLexer& rhs);
+ // These APIs are not bounds-checked. Use HasAtLeast() if you're not sure.
Character
Peek ();
bool
NextIf (Character c);
+ std::pair<bool, Character>
+ NextIf (std::initializer_list<Character> cs);
+
+ bool
+ AdvanceIf (const std::string& token);
+
Character
Next ();
@@ -42,8 +50,12 @@ public:
bool
HasAny (Character c);
+ std::string
+ GetUnlexed ();
+
+ // This will assert if there are less than s characters preceding the cursor.
void
- PutBack (Character c);
+ PutBack (Size s);
StringLexer&
operator = (const StringLexer& rhs);
@@ -51,7 +63,6 @@ public:
private:
std::string m_data;
Position m_position;
- std::list<Character> m_putback_data;
void
Consume();