================ @@ -0,0 +1,103 @@ +//===-- DILParser.h ---------------------------------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_VALUEOBJECT_DILPARSER_H +#define LLDB_VALUEOBJECT_DILPARSER_H + +#include "lldb/Target/ExecutionContextScope.h" +#include "lldb/Utility/Status.h" +#include "lldb/ValueObject/DILAST.h" +#include "lldb/ValueObject/DILLexer.h" +#include <memory> +#include <optional> +#include <string> +#include <tuple> +#include <vector> + +namespace lldb_private::dil { + +enum class ErrorCode : unsigned char { + kOk = 0, + kInvalidExpressionSyntax, + kUndeclaredIdentifier, + kUnknown, +}; + +std::string FormatDiagnostics(llvm::StringRef input_expr, + const std::string &message, uint32_t loc); + +/// Pure recursive descent parser for C++ like expressions. +/// EBNF grammar for the parser is described in lldb/docs/dil-expr-lang.ebnf +class DILParser { +public: + static llvm::Expected<ASTNodeUP> Parse(llvm::StringRef dil_input_expr, + DILLexer lexer, + std::shared_ptr<StackFrame> frame_sp, + lldb::DynamicValueType use_dynamic, + bool use_synthetic, bool fragile_ivar, + bool check_ptr_vs_member); + + ~DILParser() { m_ctx_scope.reset(); } ---------------- cmtice wrote:
Done. https://github.com/llvm/llvm-project/pull/120971 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits