mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
ASTPrinter.hpp
Go to the documentation of this file.
2
3
4namespace m {
5
6namespace ast {
7
9struct M_EXPORT ASTPrinter : ConstASTVisitor
10{
11 public:
12 std::ostream &out;
13 private:
14 unsigned indent_;
15 bool is_nested_ = false;
16 bool expand_nested_queries_ = true;
17
18 public:
19 ASTPrinter(std::ostream &out, unsigned indent = 0) : out(out), indent_(indent) { (void)(this->indent_); }
20
21 bool expand_nested_queries() { return expand_nested_queries_; }
22 void expand_nested_queries(bool expand) { expand_nested_queries_ = expand; }
23
24 using ConstASTVisitor::operator();
25#define DECLARE(CLASS) void operator()(Const<CLASS>&) override;
27#undef DECLARE
28};
29
30}
31
32}
#define M_AST_LIST(X)
Definition: AST.hpp:1063
#define DECLARE(CLASS)
‍mutable namespace
Definition: Backend.hpp:10
Pretty-prints the AST in SQL.
Definition: ASTPrinter.hpp:10
ASTPrinter(std::ostream &out, unsigned indent=0)
Definition: ASTPrinter.hpp:19
void expand_nested_queries(bool expand)
Definition: ASTPrinter.hpp:22
bool expand_nested_queries()
Definition: ASTPrinter.hpp:21
unsigned indent_
the current level of indentation
Definition: ASTPrinter.hpp:14
std::ostream & out
the output stream to write to
Definition: ASTPrinter.hpp:12