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

33 lines
608 B
C
Raw Normal View History

2010-06-24 19:12:10 +00:00
#ifndef DBMS_PARSERS_IPARSERBASE_H
#define DBMS_PARSERS_IPARSERBASE_H
#include <list>
#include <Poco/SharedPtr.h>
#include <DB/Core/Types.h>
#include <DB/Parsers/IParser.h>
2010-06-24 19:37:23 +00:00
#include <iostream>
2010-06-24 19:12:10 +00:00
namespace DB
{
/** Базовый класс для большинства парсеров
*/
class IParserBase : public IParser
{
public:
bool parse(Pos & pos, Pos end, ASTPtr & node, String & expected)
{
expected = getName();
2010-06-24 19:37:23 +00:00
bool res = parseImpl(pos, end, node, expected);
return res;
2010-06-24 19:12:10 +00:00
}
protected:
virtual bool parseImpl(Pos & pos, Pos end, ASTPtr & node, String & expected) = 0;
};
}
#endif