File indexing completed on 2026-05-10 08:42:58
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_UTILITY_STRINGLEXER_H
0010 #define LLDB_UTILITY_STRINGLEXER_H
0011
0012 #include <initializer_list>
0013 #include <string>
0014 #include <utility>
0015
0016 namespace lldb_private {
0017
0018 class StringLexer {
0019 public:
0020 typedef std::string::size_type Position;
0021 typedef std::string::size_type Size;
0022
0023 typedef std::string::value_type Character;
0024
0025 StringLexer(std::string s);
0026
0027
0028 Character Peek();
0029
0030 bool NextIf(Character c);
0031
0032 std::pair<bool, Character> NextIf(std::initializer_list<Character> cs);
0033
0034 bool AdvanceIf(const std::string &token);
0035
0036 Character Next();
0037
0038 bool HasAtLeast(Size s);
0039
0040 std::string GetUnlexed();
0041
0042
0043 void PutBack(Size s);
0044
0045 StringLexer &operator=(const StringLexer &rhs);
0046
0047 private:
0048 std::string m_data;
0049 Position m_position;
0050
0051 void Consume();
0052 };
0053
0054 }
0055
0056 #endif