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

38 lines
1.5 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>
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
*/
2011-11-07 02:10:34 +00:00
void formatAST(const IAST & ast, std::ostream & s, size_t indent = 0);
2010-06-28 13:44:42 +00:00
2011-11-07 02:10:34 +00:00
void formatAST(const ASTSelectQuery & ast, std::ostream & s, size_t indent = 0);
void formatAST(const ASTCreateQuery & ast, std::ostream & s, size_t indent = 0);
void formatAST(const ASTInsertQuery & ast, std::ostream & s, size_t indent = 0);
void formatAST(const ASTExpressionList & ast, std::ostream & s, size_t indent = 0);
void formatAST(const ASTFunction & ast, std::ostream & s, size_t indent = 0);
void formatAST(const ASTIdentifier & ast, std::ostream & s, size_t indent = 0);
void formatAST(const ASTLiteral & ast, std::ostream & s, size_t indent = 0);
void formatAST(const ASTNameTypePair & ast, std::ostream & s, size_t indent = 0);
void formatAST(const ASTAsterisk & ast, std::ostream & s, size_t indent = 0);
void formatAST(const ASTOrderByElement & ast, std::ostream & s, size_t indent = 0);
2010-06-28 13:44:42 +00:00
}