66//
77// ===----------------------------------------------------------------------===//
88
9- #ifndef LLDB_VALUEOBJECT_DILPARSER_H_
10- #define LLDB_VALUEOBJECT_DILPARSER_H_
9+ #ifndef LLDB_VALUEOBJECT_DILPARSER_H
10+ #define LLDB_VALUEOBJECT_DILPARSER_H
1111
1212#include " lldb/Target/ExecutionContextScope.h"
1313#include " lldb/Utility/Status.h"
1919#include < tuple>
2020#include < vector>
2121
22- namespace lldb_private {
23-
24- namespace dil {
22+ namespace lldb_private ::dil {
2523
2624enum class ErrorCode : unsigned char {
2725 kOk = 0 ,
@@ -37,7 +35,7 @@ std::string FormatDiagnostics(llvm::StringRef input_expr,
3735// / EBNF grammar for the parser is described in lldb/docs/dil-expr-lang.ebnf
3836class DILParser {
3937public:
40- explicit DILParser (llvm::StringRef dil_input_expr,
38+ explicit DILParser (llvm::StringRef dil_input_expr, DILLexer lexer,
4139 std::shared_ptr<ExecutionContextScope> exe_ctx_scope,
4240 lldb::DynamicValueType use_dynamic, bool use_synthetic,
4341 bool fragile_ivar, bool check_ptr_vs_member);
@@ -50,7 +48,7 @@ class DILParser {
5048
5149 lldb::DynamicValueType UseDynamic () { return m_use_dynamic; }
5250
53- using PtrOperator = std::tuple<dil::TokenKind , uint32_t >;
51+ using PtrOperator = std::tuple<Token::Kind , uint32_t >;
5452
5553private:
5654 DILASTNodeUP ParseExpression ();
@@ -67,9 +65,9 @@ class DILParser {
6765
6866 void BailOut (Status error);
6967
70- void Expect (dil::TokenKind kind);
68+ void Expect (Token::Kind kind);
7169
72- std::string TokenDescription (const DILToken &token);
70+ std::string TokenDescription (const Token &token);
7371
7472 void TentativeParsingRollback (uint32_t saved_idx) {
7573 m_error.Clear ();
@@ -83,20 +81,19 @@ class DILParser {
8381 std::shared_ptr<ExecutionContextScope> m_ctx_scope;
8482
8583 llvm::StringRef m_input_expr;
84+
85+ DILLexer m_dil_lexer;
8686 // The token lexer is stopped at (aka "current token").
87- DILToken m_dil_token;
87+ Token m_dil_token;
8888 // Holds an error if it occures during parsing.
8989 Status m_error;
9090
9191 lldb::DynamicValueType m_use_dynamic;
9292 bool m_use_synthetic;
9393 bool m_fragile_ivar;
9494 bool m_check_ptr_vs_member;
95- DILLexer m_dil_lexer;
9695}; // class DILParser
9796
98- } // namespace dil
99-
100- } // namespace lldb_private
97+ } // namespace lldb_private::dil
10198
102- #endif // LLDB_VALUEOBJECT_DILPARSER_H_
99+ #endif // LLDB_VALUEOBJECT_DILPARSER_H
0 commit comments