ClickHouse/dbms/src/Parsers/formatAST.h

19 lines
528 B
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 <Parsers/IAST.h>
2010-06-28 13:44:42 +00:00
namespace DB
{
2017-05-27 17:29:55 +00:00
/** Takes a syntax tree and turns it back into text.
* In case of INSERT query, the data will be missing.
2010-06-28 13:44:42 +00:00
*/
2017-12-01 18:36:55 +00:00
void formatAST(const IAST & ast, std::ostream & s, bool hilite = true, bool one_line = false);
2010-06-28 13:44:42 +00:00
2017-12-01 18:36:55 +00:00
inline std::ostream & operator<<(std::ostream & os, const IAST & ast) { return formatAST(ast, os, false, true), os; }
inline std::ostream & operator<<(std::ostream & os, const ASTPtr & ast) { return formatAST(*ast, os, false, true), os; }
2014-10-01 16:38:04 +00:00
2010-06-28 13:44:42 +00:00
}