9#ifndef LLDB_VALUEOBJECT_DILAST_H
10#define LLDB_VALUEOBJECT_DILAST_H
14#include "llvm/Support/Error.h"
80 virtual llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const = 0;
95 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
107 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
126 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
148 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
167 m_lhs(std::move(lhs)),
m_rhs(std::move(rhs)) {}
169 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
191 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
213 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
239 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
263 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
280 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
299 llvm::Expected<lldb::ValueObjectSP>
Accept(
Visitor *v)
const override;
322 virtual llvm::Expected<lldb::ValueObjectSP>
324 virtual llvm::Expected<lldb::ValueObjectSP>
326 virtual llvm::Expected<lldb::ValueObjectSP>
328 virtual llvm::Expected<lldb::ValueObjectSP>
330 virtual llvm::Expected<lldb::ValueObjectSP>
332 virtual llvm::Expected<lldb::ValueObjectSP>
334 virtual llvm::Expected<lldb::ValueObjectSP>
336 virtual llvm::Expected<lldb::ValueObjectSP>
338 virtual llvm::Expected<lldb::ValueObjectSP>
340 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.