ClickHouse/dbms/include/DB/Parsers/formatAST.h

40 lines
1.9 KiB
C
Raw Normal View History

2011-09-04 05:14:52 +00:00
#pragma once
2010-06-28 13:44:42 +00:00
#include <ostream>
#include <DB/Parsers/IAST.h>
#include <DB/Parsers/ASTSelectQuery.h>
2011-08-18 18:48:00 +00:00
#include <DB/Parsers/ASTCreateQuery.h>
2012-01-09 19:20:48 +00:00
#include <DB/Parsers/ASTDropQuery.h>
2011-10-30 05:19:41 +00:00
#include <DB/Parsers/ASTInsertQuery.h>
2010-06-28 13:44:42 +00:00
#include <DB/Parsers/ASTExpressionList.h>
#include <DB/Parsers/ASTFunction.h>
#include <DB/Parsers/ASTIdentifier.h>
#include <DB/Parsers/ASTLiteral.h>
2011-08-18 18:48:00 +00:00
#include <DB/Parsers/ASTNameTypePair.h>
2011-08-28 08:50:27 +00:00
#include <DB/Parsers/ASTAsterisk.h>
2011-09-04 05:14:52 +00:00
#include <DB/Parsers/ASTOrderByElement.h>
2010-06-28 13:44:42 +00:00
namespace DB
{
/** Берёт синтаксическое дерево и превращает его обратно в текст.
2011-10-30 05:19:41 +00:00
* В случае запроса INSERT, данные могут быть опущены.
2010-06-28 13:44:42 +00:00
*/
2012-05-21 20:38:34 +00:00
void formatAST(const IAST & ast, std::ostream & s, size_t indent = 0, bool hilite = true);
2010-06-28 13:44:42 +00:00
2012-05-21 20:38:34 +00:00
void formatAST(const ASTSelectQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true);
void formatAST(const ASTCreateQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true);
void formatAST(const ASTDropQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true);
void formatAST(const ASTInsertQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true);
void formatAST(const ASTExpressionList & ast, std::ostream & s, size_t indent = 0, bool hilite = true);
void formatAST(const ASTFunction & ast, std::ostream & s, size_t indent = 0, bool hilite = true);
void formatAST(const ASTIdentifier & ast, std::ostream & s, size_t indent = 0, bool hilite = true);
void formatAST(const ASTLiteral & ast, std::ostream & s, size_t indent = 0, bool hilite = true);
void formatAST(const ASTNameTypePair & ast, std::ostream & s, size_t indent = 0, bool hilite = true);
void formatAST(const ASTAsterisk & ast, std::ostream & s, size_t indent = 0, bool hilite = true);
void formatAST(const ASTOrderByElement & ast, std::ostream & s, size_t indent = 0, bool hilite = true);
2010-06-28 13:44:42 +00:00
}