9#ifndef LLDB_VALUEOBJECT_DILPARSER_H
10#define LLDB_VALUEOBJECT_DILPARSER_H
17#include "llvm/Support/Error.h"
21#include <system_error>
40 :
public llvm::ErrorInfo<DILDiagnosticError, DiagnosticError> {
46 : ErrorInfo(make_error_code(std::errc::invalid_argument)),
50 uint32_t loc, uint16_t err_len = 1);
52 std::unique_ptr<CloneableError>
Clone()
const override {
53 return std::make_unique<DILDiagnosticError>(
m_detail);
56 llvm::ArrayRef<DiagnosticDetail>
GetDetails()
const override {
67 static llvm::Expected<ASTNodeUP>
Parse(llvm::StringRef dil_input_expr,
69 std::shared_ptr<StackFrame> frame_sp,
77 std::shared_ptr<StackFrame> frame_sp,
106 const std::vector<Token> &ptr_operators);
108 void BailOut(
const std::string &
error, uint32_t loc, uint16_t err_len);
112 void ExpectOneOf(std::vector<Token::Kind> kinds_vec);
116 llvm::consumeError(std::move(
m_error));
static llvm::raw_ostream & error(Stream &strm)
Generic representation of a type in a programming language.
This base class provides an interface to stack frames.
DILDiagnosticError(DiagnosticDetail detail)
std::unique_ptr< CloneableError > Clone() const override
llvm::ArrayRef< DiagnosticDetail > GetDetails() const override
std::string message() const override
DiagnosticDetail m_detail
Class for doing the simple lexing required by DIL.
ASTNodeUP ParseAdditiveExpression()
ASTNodeUP ParseUnaryExpression()
void ParseTypeSpecifierSeq(std::string &type_name)
ASTNodeUP ParseIntegerLiteral()
void Expect(Token::Kind kind)
std::optional< CompilerType > ParseTypeId()
void TentativeParsingRollback(uint32_t saved_idx)
ASTNodeUP ParseFloatingPointLiteral()
ASTNodeUP ParseExpression()
void ExpectOneOf(std::vector< Token::Kind > kinds_vec)
std::optional< std::string > ParseTypeSpecifier()
ASTNodeUP ParseNumericLiteral()
std::optional< CompilerType > ParseBuiltinType()
ASTNodeUP ParsePrimaryExpression()
std::shared_ptr< StackFrame > m_ctx_scope
void BailOut(const std::string &error, uint32_t loc, uint16_t err_len)
CompilerType ResolveTypeDeclarators(CompilerType type, const std::vector< Token > &ptr_operators)
ASTNodeUP ParsePostfixExpression()
std::string ParseIdExpression()
ASTNodeUP ParseMultiplicativeExpression()
lldb::DynamicValueType m_use_dynamic
std::string ParseUnqualifiedId()
DILParser(llvm::StringRef dil_input_expr, DILLexer lexer, std::shared_ptr< StackFrame > frame_sp, lldb::DynamicValueType use_dynamic, llvm::Error &error, lldb::DILMode mode)
static llvm::Expected< ASTNodeUP > Parse(llvm::StringRef dil_input_expr, DILLexer lexer, std::shared_ptr< StackFrame > frame_sp, lldb::DynamicValueType use_dynamic, lldb::DILMode mode)
ASTNodeUP ParseCastExpression()
ASTNodeUP ParseBooleanLiteral()
std::optional< std::string > ParseTypeName()
llvm::StringRef m_input_expr
std::string ParseNestedNameSpecifier()
Class defining the tokens generated by the DIL lexer and used by the DIL parser.
std::unique_ptr< ASTNode > ASTNodeUP
@ kInvalidExpressionSyntax
A class that represents a running process on the host machine.
DILMode
Data Inspection Language (DIL) evaluation modes.
A compiler-independent representation of an lldb_private::Diagnostic.