9#ifndef LLDB_VALUEOBJECT_DILAST_H
10#define LLDB_VALUEOBJECT_DILAST_H
14#include "llvm/Support/Error.h"
83 virtual llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const = 0;
98 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
110 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
129 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
151 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
170 m_lhs(std::move(lhs)),
m_rhs(std::move(rhs)) {}
172 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
194 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
216 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
242 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
266 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
283 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
302 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
325 virtual llvm::Expected<lldb::ValueObjectSP>
327 virtual llvm::Expected<lldb::ValueObjectSP>
329 virtual llvm::Expected<lldb::ValueObjectSP>
331 virtual llvm::Expected<lldb::ValueObjectSP>
333 virtual llvm::Expected<lldb::ValueObjectSP>
335 virtual llvm::Expected<lldb::ValueObjectSP>
337 virtual llvm::Expected<lldb::ValueObjectSP>
339 virtual llvm::Expected<lldb::ValueObjectSP>
341 virtual llvm::Expected<lldb::ValueObjectSP>
343 virtual llvm::Expected<lldb::ValueObjectSP>
Visit(
const CastNode &node) = 0;
Generic representation of a type in a programming language.
uint32_t GetLocation() const
ASTNode(uint32_t location, NodeKind kind)
virtual ~ASTNode()=default
virtual llvm::Expected< lldb::ValueObjectSP > Accept(Visitor *v) const =0
ArraySubscriptNode(uint32_t location, ASTNodeUP base, ASTNodeUP index)
ASTNode & GetBase() const
static bool classof(const ASTNode &node)
llvm::Expected< lldb::ValueObjectSP > Accept(Visitor *v) const override
ASTNode & GetIndex() const
llvm::Expected< lldb::ValueObjectSP > Accept(Visitor *v) const override
BinaryOpKind GetKind() const
static bool classof(const ASTNode *node)
BinaryOpNode(uint32_t location, BinaryOpKind kind, ASTNodeUP lhs, ASTNodeUP rhs)
static bool classof(const ASTNode &node)
llvm::Expected< lldb::ValueObjectSP > Accept(Visitor *v) const override
BooleanLiteralNode(uint32_t location, bool value)
ASTNode & GetOperand() const
CompilerType GetType() const
llvm::Expected< lldb::ValueObjectSP > Accept(Visitor *v) const override
static bool classof(const ASTNode &node)
CastKind GetCastKind() const
CastNode(uint32_t location, CompilerType type, ASTNodeUP operand, CastKind kind)
static bool classof(const ASTNode &node)
llvm::Expected< lldb::ValueObjectSP > Accept(Visitor *v) const override
static bool classof(const ASTNode &node)
const llvm::APFloat & GetValue() const
llvm::Expected< lldb::ValueObjectSP > Accept(Visitor *v) const override
FloatLiteralNode(uint32_t location, llvm::APFloat value)
IdentifierNode(uint32_t location, std::string name)
std::string GetName() const
static bool classof(const ASTNode &node)
llvm::Expected< lldb::ValueObjectSP > Accept(Visitor *v) const override
llvm::Expected< lldb::ValueObjectSP > Accept(Visitor *v) const override
IntegerLiteralNode(uint32_t location, llvm::APInt value, uint32_t radix, bool is_unsigned, IntegerTypeSuffix type)
uint32_t GetRadix() const
IntegerTypeSuffix GetTypeSuffix() const
static bool classof(const ASTNode &node)
const llvm::APInt & GetValue() const
MemberOfNode(uint32_t location, ASTNodeUP base, bool is_arrow, std::string name)
static bool classof(const ASTNode &node)
llvm::StringRef GetFieldName() const
llvm::Expected< lldb::ValueObjectSP > Accept(Visitor *v) const override
ASTNode & GetBase() const
UnaryOpNode(uint32_t location, UnaryOpKind kind, ASTNodeUP operand)
llvm::Expected< lldb::ValueObjectSP > Accept(Visitor *v) const override
static bool classof(const ASTNode &node)
UnaryOpKind GetKind() const
ASTNode & GetOperand() const
This class contains one Visit method for each specialized type of DIL AST node.
virtual llvm::Expected< lldb::ValueObjectSP > Visit(const MemberOfNode &node)=0
virtual llvm::Expected< lldb::ValueObjectSP > Visit(const IntegerLiteralNode &node)=0
virtual llvm::Expected< lldb::ValueObjectSP > Visit(const IdentifierNode &node)=0
virtual llvm::Expected< lldb::ValueObjectSP > Visit(const CastNode &node)=0
virtual llvm::Expected< lldb::ValueObjectSP > Visit(const FloatLiteralNode &node)=0
virtual ~Visitor()=default
virtual llvm::Expected< lldb::ValueObjectSP > Visit(const BinaryOpNode &node)=0
virtual llvm::Expected< lldb::ValueObjectSP > Visit(const BitFieldExtractionNode &node)=0
virtual llvm::Expected< lldb::ValueObjectSP > Visit(const BooleanLiteralNode &node)=0
virtual llvm::Expected< lldb::ValueObjectSP > Visit(const ArraySubscriptNode &node)=0
virtual llvm::Expected< lldb::ValueObjectSP > Visit(const UnaryOpNode &node)=0
CastKind
The type casts allowed by DIL.
@ eEnumeration
Casting from a scalar to an enumeration type.
@ ePointer
Casting to a pointer type.
@ eNone
Invalid promotion type (results in error).
@ eArithmetic
Casting to a scalar.
UnaryOpKind
The Unary operators recognized by DIL.
std::unique_ptr< ASTNode > ASTNodeUP
BinaryOpKind
The binary operators recognized by DIL.
NodeKind
The various types DIL AST nodes (used by the DIL parser).
BinaryOpKind GetBinaryOpKindFromToken(Token::Kind token_kind)
Translates DIL tokens to BinaryOpKind.