2017-04-01 09:19:00 +00:00
|
|
|
#include <Parsers/IParserBase.h>
|
2015-04-14 02:11:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2016-01-11 21:46:36 +00:00
|
|
|
namespace ErrorCodes
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
extern const int LOGICAL_ERROR;
|
2016-01-11 21:46:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-07-10 03:28:12 +00:00
|
|
|
bool IParserBase::parse(Pos & pos, ASTPtr & node, Expected & expected)
|
2015-04-14 02:11:59 +00:00
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
Pos begin = pos;
|
2017-07-13 04:20:56 +00:00
|
|
|
expected.add(pos, getName());
|
2015-04-14 02:11:59 +00:00
|
|
|
|
2017-07-13 04:20:56 +00:00
|
|
|
bool res = parseImpl(pos, node, expected);
|
2015-04-14 02:11:59 +00:00
|
|
|
|
2017-07-10 03:28:12 +00:00
|
|
|
/// TODO expected
|
2015-04-14 02:11:59 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
if (!res)
|
|
|
|
{
|
|
|
|
node = nullptr;
|
|
|
|
pos = begin;
|
|
|
|
}
|
2015-04-14 02:11:59 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
return res;
|
2015-04-14 02:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|