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

57 lines
3.7 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>
2012-06-18 06:19:13 +00:00
#include <DB/Parsers/ASTRenameQuery.h>
2012-06-18 07:49:19 +00:00
#include <DB/Parsers/ASTShowTablesQuery.h>
2012-07-12 19:49:22 +00:00
#include <DB/Parsers/ASTUseQuery.h>
2012-08-02 19:03:32 +00:00
#include <DB/Parsers/ASTSetQuery.h>
2012-07-31 19:08:49 +00:00
#include <DB/Parsers/ASTOptimizeQuery.h>
#include <DB/Parsers/TablePropertiesQueriesASTs.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>
2012-08-22 18:46:09 +00:00
#include <DB/Parsers/ASTSubquery.h>
2010-06-28 13:44:42 +00:00
namespace DB
{
/** Берёт синтаксическое дерево и превращает его обратно в текст.
2012-05-30 01:38:02 +00:00
* В случае запроса INSERT, данные будут отсутствовать.
2010-06-28 13:44:42 +00:00
*/
2012-05-30 01:38:02 +00:00
void formatAST(const IAST & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
2010-06-28 13:44:42 +00:00
2012-05-30 01:38:02 +00:00
void formatAST(const ASTSelectQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
void formatAST(const ASTCreateQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
void formatAST(const ASTDropQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
void formatAST(const ASTInsertQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
2012-06-18 06:19:13 +00:00
void formatAST(const ASTRenameQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
void formatAST(const ASTShowTablesQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
2012-07-12 19:49:22 +00:00
void formatAST(const ASTUseQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
2012-08-02 19:03:32 +00:00
void formatAST(const ASTSetQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
2012-07-31 19:08:49 +00:00
void formatAST(const ASTOptimizeQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
void formatAST(const ASTExistsQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
void formatAST(const ASTDescribeQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
void formatAST(const ASTShowCreateQuery & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
void formatAST(const ASTExpressionList & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
2012-05-30 01:38:02 +00:00
void formatAST(const ASTFunction & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
void formatAST(const ASTIdentifier & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
2012-05-30 01:38:02 +00:00
void formatAST(const ASTLiteral & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
void formatAST(const ASTNameTypePair & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
void formatAST(const ASTAsterisk & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
void formatAST(const ASTOrderByElement & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
2012-08-22 18:46:09 +00:00
void formatAST(const ASTSubquery & ast, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
void formatAST(const ASTQueryWithTableAndOutput & ast, std::string name, std::ostream & s, size_t indent = 0, bool hilite = true, bool one_line = false);
2010-06-28 13:44:42 +00:00
}