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

31 lines
659 B
C
Raw Normal View History

2010-06-24 19:12:10 +00:00
#ifndef DBMS_PARSERS_ASTLITERAL_H
#define DBMS_PARSERS_ASTLITERAL_H
#include <DB/Core/Field.h>
2011-08-12 18:27:39 +00:00
#include <DB/DataTypes/IDataType.h>
2010-06-24 19:12:10 +00:00
#include <DB/Parsers/IAST.h>
namespace DB
{
/** Литерал (атомарный) - число, строка, NULL
*/
class ASTLiteral : public IAST
{
public:
Field value;
2011-08-12 18:27:39 +00:00
/// тип
DataTypePtr type;
2010-06-24 19:12:10 +00:00
2010-06-25 16:36:13 +00:00
ASTLiteral() {}
2011-08-13 21:05:18 +00:00
ASTLiteral(StringRange range_, const Field & value_) : IAST(range_), value(value_) {}
2010-06-24 19:12:10 +00:00
2011-08-09 19:19:00 +00:00
/** Получить текст, который идентифицирует этот элемент. */
String getID() { return "Literal_" + boost::apply_visitor(FieldVisitorDump(), value); }
2010-06-24 19:12:10 +00:00
};
}
#endif