![]() |
mutable
A Database System for Research and Fast Prototyping
|
A query expression for nested queries. More...
#include <AST.hpp>
Public Member Functions | |
QueryExpr (Token op, std::unique_ptr< Stmt > query) | |
bool | is_constant () const override |
Returns true iff this Expr is constant, i.e. | |
bool | can_be_null () const override |
Returns true iff this Expr is nullable, i.e. | |
bool | contains_free_variables () const override |
Conceptually, QueryExpr s have no variables at all. | |
bool | contains_bound_variables () const override |
Conceptually, QueryExpr s have no variables at all. | |
uint64_t | hash () const override |
Computes a hash of this , considering only syntactic properties. | |
bool | operator== (const Expr &other) const override |
Returns true iff other is syntactically equal to this . | |
void | accept (ASTExprVisitor &v) override |
void | accept (ConstASTExprVisitor &v) const override |
const ThreadSafePooledString & | alias () const |
const Type * | type () const |
Returns the Type of this Expr . | |
void | type (const Type *type) |
Sets the Type of this Expr . | |
bool | has_type () const |
Returns true iff this Expr has been assigned a Type , most likely by Sema . | |
bool | operator!= (const Expr &other) const |
Returns false iff other is syntactically equal to this . | |
Schema | get_required () const |
Returns a Schema instance containing all required definitions. | |
void | dot (std::ostream &out) const |
Writes a Graphivz dot representation of this Expr to out . | |
M_LCOV_EXCL_STOP void | dump (std::ostream &out) const |
void | dump () const |
Data Fields | |
std::unique_ptr< Stmt > | query |
Token | tok |
the token of the expression; serves as an anchor to locate the expression in the source | |
Static Private Member Functions | |
static ThreadSafePooledString | make_unique_alias () |
Private Attributes | |
ThreadSafePooledString | alias_ |
the alias that is used for this query expression | |
const Type * | type_ = nullptr |
| |
bool | is_correlated_ = false |
Whether this Expr is correlated within its query, i.e. | |
|
overridevirtual |
Implements m::ast::Expr.
|
overridevirtual |
Implements m::ast::Expr.
|
inline |
Definition at line 421 of file AST.hpp.
Referenced by m::wasm::ExprCompiler::operator()().
|
overridevirtual |
|
inlineoverridevirtual |
Conceptually, QueryExpr
s have no variables at all.
They only contain another SelectStmt
. The correlation of expressions within this SelectStmt
does not matter here. Therefore, conceptually, all variables within the QueryExpr
are bound and this method always returns true
.
Implements m::ast::Expr.
|
inlineoverridevirtual |
Conceptually, QueryExpr
s have no variables at all.
They only contain another SelectStmt
. The correlation of expressions within this SelectStmt
does not matter here. Therefore, QueryExpr
s never have free variables and this method always returns false
.
Implements m::ast::Expr.
|
inherited |
Writes a Graphivz dot representation of this Expr
to out
.
Used to render ASTs with Graphivz.
Definition at line 205 of file AST.cpp.
References m::ast::Expr::dot().
Referenced by m::ast::Expr::dot().
|
inherited |
Definition at line 235 of file AST.cpp.
References m::ast::Expr::dump().
Referenced by m::ast::Expr::dump().
|
inherited |
|
inherited |
Returns a Schema
instance containing all required definitions.
Recursively traverses the Expr
to find all Designators
. Note, that FnApplicationExpr
s require special handling: a FnApplicationExpr
that is an aggregation is stringified to a Schema::Identifier
and not processed further recursively. The reason for this special treatment is that aggregations are performed during grouping and the aggregate value is referenced by the stringified expression (or alias, if given).
Definition at line 145 of file AST.cpp.
References m::Schema::add(), m::Catalog::Get(), m::Schema::has(), id, m::Catalog::pool(), and m::visit().
|
inlineinherited |
|
overridevirtual |
Computes a hash of this
, considering only syntactic properties.
Other properties are ignored, e.g. type or designator target.
Implements m::ast::Expr.
Definition at line 76 of file AST.cpp.
References query.
|
overridevirtual |
|
staticprivate |
Definition at line 14 of file AST.cpp.
References m::Catalog::Get(), id, and m::Catalog::pool().
|
inlineinherited |
|
overridevirtual |
Returns true
iff other
is syntactically equal to this
.
Implements m::ast::Expr.
Definition at line 133 of file AST.cpp.
References query.
|
inlineinherited |
Returns the Type
of this Expr
.
Assumes that the Expr
has been assigned a Type
by the Sema
.
Definition at line 58 of file AST.hpp.
References M_notnull.
Referenced by m::ast::Sema::create_designator(), m::ast::UnaryExpr::hash(), m::ast::BinaryExpr::hash(), index_scan_codegen_compilation(), m::wasm::ExprCompiler::operator()(), and WeighExpr::operator()().
|
inlineinherited |
Should be used when constructing an Expr
outside of the Sema
. Should not be called to replace an already assigned type.
Definition at line 61 of file AST.hpp.
References M_insist, and m::ast::Expr::type().
Referenced by m::ast::Expr::type().
|
private |
|
privateinherited |
std::unique_ptr<Stmt> m::ast::QueryExpr::query |
Definition at line 390 of file AST.hpp.
Referenced by can_be_null(), hash(), is_constant(), and operator==().
|
inherited |
the token of the expression; serves as an anchor to locate the expression in the source
Definition at line 43 of file AST.hpp.
Referenced by m::ast::Sema::create_designator(), m::ast::Constant::hash(), m::Interpreter::M_OPERATOR_LIST(), and m::ast::Constant::operator==().
|
privateinherited |