5#include <unordered_map>
23class ParsedExpressionChildrenVisitor;
26 std::pair<std::unique_ptr<ParsedExpression>, std::unique_ptr<ParsedExpression>>;
30 friend class ParsedExpressionChildrenVisitor;
36 std::unique_ptr<ParsedExpression> right, std::string rawName);
38 : type{type}, rawName{std::move(rawName)} {}
43 : type{type}, alias{std::move(alias)}, rawName{std::move(rawName)},
44 children{std::move(children)} {}
50 void setAlias(std::string name) { alias = std::move(name); }
52 bool hasAlias()
const {
return !alias.empty(); }
61 std::string
toString()
const {
return rawName; }
63 virtual std::unique_ptr<ParsedExpression>
copy()
const {
64 return std::make_unique<ParsedExpression>(type, alias, rawName, copyVector(children));
71 template<
class TARGET>
73 return common::ku_dynamic_cast<ParsedExpression&, TARGET&>(*
this);
75 template<
class TARGET>
77 return common::ku_dynamic_cast<const ParsedExpression&, const TARGET&>(*
this);
79 template<
class TARGET>
81 return common::ku_dynamic_cast<const ParsedExpression*, const TARGET*>(
this);
94using options_t = std::unordered_map<std::string, std::unique_ptr<parser::ParsedExpression>>;
#define KUZU_API
Definition api.h:25
Definition deserializer.h:15
Definition serializer.h:15
Definition parsed_expression.h:29
const TARGET * constPtrCast() const
Definition parsed_expression.h:80
void setAlias(std::string name)
Definition parsed_expression.h:50
std::string getRawName() const
Definition parsed_expression.h:56
uint32_t getNumChildren() const
Definition parsed_expression.h:58
ParsedExpression(common::ExpressionType type, std::string rawName)
Definition parsed_expression.h:37
common::ExpressionType getExpressionType() const
Definition parsed_expression.h:48
void serialize(common::Serializer &serializer) const
common::ExpressionType type
Definition parsed_expression.h:88
virtual std::unique_ptr< ParsedExpression > copy() const
Definition parsed_expression.h:63
parsed_expr_vector children
Definition parsed_expression.h:91
ParsedExpression(common::ExpressionType type, std::unique_ptr< ParsedExpression > left, std::unique_ptr< ParsedExpression > right, std::string rawName)
std::string alias
Definition parsed_expression.h:89
TARGET & cast()
Definition parsed_expression.h:72
ParsedExpression(common::ExpressionType type, std::unique_ptr< ParsedExpression > child, std::string rawName)
std::string getAlias() const
Definition parsed_expression.h:54
std::string rawName
Definition parsed_expression.h:90
bool hasAlias() const
Definition parsed_expression.h:52
ParsedExpression(common::ExpressionType type, std::string alias, std::string rawName, parsed_expr_vector children)
Definition parsed_expression.h:41
ParsedExpression * getChild(uint32_t idx) const
Definition parsed_expression.h:59
static std::unique_ptr< ParsedExpression > deserialize(common::Deserializer &deserializer)
ParsedExpression(common::ExpressionType type)
Definition parsed_expression.h:39
std::string toString() const
Definition parsed_expression.h:61
virtual ~ParsedExpression()=default
const TARGET & constCast() const
Definition parsed_expression.h:76
DELETE_COPY_DEFAULT_MOVE(ParsedExpression)
ExpressionType
Definition expression_type.h:9
std::unordered_map< std::string, std::unique_ptr< parser::ParsedExpression > > options_t
Definition parsed_expression.h:94
std::vector< std::unique_ptr< ParsedExpression > > parsed_expr_vector
Definition parsed_expression.h:24
std::pair< std::unique_ptr< ParsedExpression >, std::unique_ptr< ParsedExpression > > parsed_expr_pair
Definition parsed_expression.h:25
std::pair< std::string, std::unique_ptr< ParsedExpression > > s_parsed_expr_pair
Definition parsed_expression.h:27
Definition alter_type.h:5
Definition parsed_expression.h:96
static std::unique_ptr< ParsedExpression > getSerialDefaultExpr(const std::string &sequenceName)