5#include <initializer_list>
39 case TK_GREATER_EQUAL:
80 M_insist(tk < TokenType::TokenType_MAX);
86#define M_FOLLOW(NAME, SET) \
87const Parser::follow_set_t follow_set_##NAME = make_follow_set SET ;
88#include "tables/FollowSet.tbl"
100 if (
token().type == TK_INSTRUCTION)
112 std::string_view sv(*(instr.
text));
113 const char *delimiter =
" \n";
116 std::string::size_type end = sv.find_first_of(delimiter);
120 std::vector<std::string>
args;
122 std::string::size_type start = sv.find_first_not_of(delimiter, end);
123 if (start == std::string::npos)
125 end = sv.find_first_of(delimiter, start);
126 args.emplace_back(sv.substr(start, end - start));
130 return std::make_unique<Instruction>(std::move(instr), std::move(instruction_name), std::move(
args));
136 std::unique_ptr<Stmt> stmt =
nullptr;
137 switch (
token().type) {
139 stmt = std::make_unique<ErrorStmt>(
token());
142 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
144 case TK_SEMICOL:
return std::make_unique<EmptyStmt>(
consume());
147 switch (token<1>().type) {
149 stmt = std::make_unique<ErrorStmt>(
token());
150 diag.
e(token<1>().pos) <<
"expected a create database statement or a create table statement, got "
151 << token<1>().text <<
'\n';
153 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
163 switch (token<1>().type) {
165 stmt = std::make_unique<ErrorStmt>(
token());
166 diag.
e(
token().pos) <<
"expected a drop database, table, or index statement, got "
169 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
197 if (not
expect(TK_Create)) {
199 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
202 if (not
expect(TK_Database))
203 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
206 if (not
expect(TK_IDENTIFIER))
207 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
209 return std::make_unique<CreateDatabaseStmt>(std::move(database_name));
217 if (not
expect(TK_Drop)) {
219 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
222 if (not
expect(TK_Database))
223 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
226 bool has_if_exists =
false;
228 if (not
expect(TK_Exists))
229 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
230 has_if_exists =
true;
235 if (not
expect(TK_IDENTIFIER))
236 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
238 return std::make_unique<DropDatabaseStmt>(std::move(database_name), has_if_exists);
248 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
252 if (not
expect(TK_IDENTIFIER))
253 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
255 return std::make_unique<UseDatabaseStmt>(std::move(database_name));
261 std::vector<std::unique_ptr<CreateTableStmt::attribute_definition>> attrs;
264 if (not
expect(TK_Create)) {
266 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
270 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
273 if (not
expect(TK_IDENTIFIER))
274 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
277 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
282 if (not
expect(TK_IDENTIFIER))
283 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
288 std::vector<std::unique_ptr<Constraint>> constraints;
290 switch (
token().type) {
294 if (not
expect(TK_Key))
goto constraint_error_recovery;
295 constraints.push_back(std::make_unique<PrimaryKeyConstraint>(std::move(tok)));
302 if (not
expect(TK_Null))
goto constraint_error_recovery;
303 constraints.push_back(std::make_unique<NotNullConstraint>(std::move(tok)));
310 constraints.push_back(std::make_unique<UniqueConstraint>(std::move(tok)));
317 if (not
expect(TK_LPAR))
goto constraint_error_recovery;
319 if (not
expect(TK_RPAR))
goto constraint_error_recovery;
320 constraints.push_back(std::make_unique<CheckConditionConstraint>(std::move(tok), std::move(cond)));
325 case TK_References: {
328 if (not
expect(TK_IDENTIFIER))
goto constraint_error_recovery;
329 if (not
expect(TK_LPAR))
goto constraint_error_recovery;
331 if (not
expect(TK_IDENTIFIER))
goto constraint_error_recovery;
332 if (not
expect(TK_RPAR))
goto constraint_error_recovery;
333 constraints.push_back(std::make_unique<ReferenceConstraint>(
335 std::move(ref_table_name),
336 std::move(attr_name),
343 goto exit_constraints;
347constraint_error_recovery:
348 recover(follow_set_CONSTRAINT);
350 attrs.push_back(std::make_unique<CreateTableStmt::attribute_definition>(std::move(
id),
352 std::move(constraints)));
353 }
while (
accept(TK_COMMA));
357 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
359 return std::make_unique<CreateTableStmt>(std::move(table_name), std::move(attrs));
367 if (not
expect(TK_Drop)) {
369 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
373 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
376 bool has_if_exists =
false;
378 if (not
expect(TK_Exists))
379 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
380 has_if_exists =
true;
384 std::vector<std::unique_ptr<Token>> table_names;
387 if (not
expect(TK_IDENTIFIER))
388 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
389 table_names.emplace_back(std::make_unique<Token>(std::move(table_name)));
390 }
while (
accept(TK_COMMA));
392 return std::make_unique<DropTableStmt>(std::move(table_names), has_if_exists);
400 if (not
expect(TK_Create))
401 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
404 if (
token() == TK_Unique)
408 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
411 bool has_if_not_exists =
false;
415 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
416 if (not
expect(TK_Exists))
417 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
418 has_if_not_exists =
true;
419 index_name =
token();
420 if (not
expect(TK_IDENTIFIER))
421 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
422 }
else if (
token().type == TK_IDENTIFIER)
427 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
430 if (not
expect(TK_IDENTIFIER))
431 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
436 if (
token().type != TK_IDENTIFIER
and token().type != TK_Default) {
438 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
445 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
446 std::vector<std::unique_ptr<Expr>> key_fields;
448 switch (
token().type) {
450 case TK_IDENTIFIER: {
451 auto id = std::make_unique<Designator>(
consume());
452 key_fields.emplace_back(std::move(
id));
458 key_fields.emplace_back(std::move(expr));
462 diag.
e(
token().pos) <<
"expected an identifier or expression, got " <<
token().
text <<
'\n';
463 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
466 }
while(
accept(TK_COMMA));
468 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
470 return std::make_unique<CreateIndexStmt>(
471 std::move(has_unique),
473 std::move(index_name),
474 std::move(table_name),
476 std::move(key_fields)
485 if (not
expect(TK_Drop)) {
487 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
491 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
494 bool has_if_exists =
false;
496 if (not
expect(TK_Exists))
497 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
498 has_if_exists =
true;
502 std::vector<std::unique_ptr<Token>> index_names;
505 if (not
expect(TK_IDENTIFIER))
506 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
507 index_names.emplace_back(std::make_unique<Token>(std::move(index_name)));
508 }
while (
accept(TK_COMMA));
510 return std::make_unique<DropIndexStmt>(std::move(index_names), has_if_exists);
516 std::unique_ptr<Clause> from =
nullptr;
517 std::unique_ptr<Clause> where =
nullptr;
518 std::unique_ptr<Clause> group_by =
nullptr;
519 std::unique_ptr<Clause> having =
nullptr;
520 std::unique_ptr<Clause> order_by =
nullptr;
521 std::unique_ptr<Clause> limit =
nullptr;
523 if (
token() == TK_From)
525 if (
token() == TK_Where)
527 if (
token() == TK_Group)
529 if (
token() == TK_Having)
531 if (
token() == TK_Order)
533 if (
token() == TK_Limit)
536 return std::make_unique<SelectStmt>(std::move(select),
550 if (not
expect(TK_Insert)) {
552 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
556 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
559 if (not
expect(TK_IDENTIFIER))
560 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
562 if (not
expect(TK_Values))
563 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
566 std::vector<InsertStmt::tuple_t> tuples;
570 if (not
expect(TK_LPAR))
goto tuple_error_recovery;
572 switch (
token().type) {
589 }
while (
accept(TK_COMMA));
590 if (not
expect(TK_RPAR))
goto tuple_error_recovery;
591 tuples.emplace_back(std::move(tuple));
595 }
while (
accept(TK_COMMA));
597 return std::make_unique<InsertStmt>(std::move(table_name), std::move(tuples));
605 if (not
expect(TK_Update)) {
607 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
611 if (not
expect(TK_IDENTIFIER))
612 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
615 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
618 std::vector<UpdateStmt::set_type> set;
621 if (not
expect(TK_IDENTIFIER))
622 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
625 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
628 set.emplace_back(
id, std::move(e));
629 }
while (
accept(TK_COMMA));
632 std::unique_ptr<Clause> where =
nullptr;
633 if (
token() == TK_Where)
636 return std::make_unique<UpdateStmt>(std::move(table_name), std::move(set), std::move(where));
644 if (not
expect(TK_Delete)) {
646 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
650 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
653 if (not
expect(TK_IDENTIFIER))
654 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
657 std::unique_ptr<Clause> where =
nullptr;
658 if (
token() == TK_Where)
661 return std::make_unique<DeleteStmt>(std::move(table_name), std::move(where));
669 if (not
expect(TK_Import)) {
671 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
675 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
678 if (not
expect(TK_IDENTIFIER))
679 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
681 switch (
token().type) {
688 if (not
expect(TK_STRING_LITERAL))
689 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
694 if (
token() == TK_DEC_INT or
token() == TK_OCT_INT) {
698 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
703 if (
accept(TK_Delimiter)) {
705 if (not
expect(TK_STRING_LITERAL))
706 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
712 if (not
expect(TK_STRING_LITERAL))
713 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
719 if (not
expect(TK_STRING_LITERAL))
720 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
725 if (not
expect(TK_Header))
726 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
732 if (not
expect(TK_Header))
733 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
737 return std::make_unique<DSVImportStmt>(stmt);
742 return recover<ErrorStmt>(std::move(start), follow_set_STATEMENT);
755 if (not
expect(TK_Select)) {
757 return recover<ErrorClause>(std::move(start), follow_set_SELECT_CLAUSE);
762 std::vector<SelectClause::select_type> select;
763 if (
token() == TK_ASTERISK) {
764 select_all =
token();
771 if (not
expect(TK_IDENTIFIER))
772 return recover<ErrorClause>(std::move(start), follow_set_SELECT_CLAUSE);
773 }
else if (
token().type == TK_IDENTIFIER) {
777 select.emplace_back(std::move(e), std::move(tok));
781 while (
accept(TK_COMMA)) {
786 if (not
expect(TK_IDENTIFIER))
787 return recover<ErrorClause>(std::move(start), follow_set_SELECT_CLAUSE);
788 }
else if (
token().type == TK_IDENTIFIER) {
792 select.emplace_back(std::move(e), std::move(tok));
795 return std::make_unique<SelectClause>(std::move(start), std::move(select), std::move(select_all));
803 if (not
expect(TK_From)) {
805 return recover<ErrorClause>(std::move(start), follow_set_FROM_CLAUSE);
809 std::vector<FromClause::from_type> from;
815 return recover<ErrorClause>(std::move(start), follow_set_FROM_CLAUSE);
818 if (not
expect(TK_IDENTIFIER))
819 return recover<ErrorClause>(std::move(start), follow_set_FROM_CLAUSE);
820 from.emplace_back(std::move(S), std::move(alias));
823 if (not
expect(TK_IDENTIFIER))
824 return recover<ErrorClause>(std::move(start), follow_set_FROM_CLAUSE);
827 if (not
expect(TK_IDENTIFIER))
828 return recover<ErrorClause>(std::move(start), follow_set_FROM_CLAUSE);
829 }
else if (
token().type == TK_IDENTIFIER) {
833 from.emplace_back(std::move(table), std::move(alias));
835 }
while (
accept(TK_COMMA));
837 return std::make_unique<FromClause>(std::move(start), std::move(from));
845 if (not
expect(TK_Where)) {
847 return recover<ErrorClause>(std::move(start), follow_set_WHERE_CLAUSE);
853 return std::make_unique<WhereClause>(std::move(start), std::move(where));
861 if (not
expect(TK_Group)) {
863 return recover<ErrorClause>(std::move(start), follow_set_GROUP_BY_CLAUSE);
866 return recover<ErrorClause>(std::move(start), follow_set_GROUP_BY_CLAUSE);
869 std::vector<GroupByClause::group_type> group_by;
875 if (not
expect(TK_IDENTIFIER))
876 return recover<ErrorClause>(std::move(start), follow_set_GROUP_BY_CLAUSE);
877 }
else if (
token().type == TK_IDENTIFIER) {
881 group_by.emplace_back(std::move(e), std::move(tok));
882 }
while (
accept(TK_COMMA));
884 return std::make_unique<GroupByClause>(std::move(start), std::move(group_by));
892 if (not
expect(TK_Having)) {
894 return recover<ErrorClause>(std::move(start), follow_set_HAVING_CLAUSE);
900 return std::make_unique<HavingClause>(std::move(start), std::move(having));
908 if (not
expect(TK_Order)) {
910 return recover<ErrorClause>(std::move(start), follow_set_ORDER_BY_CLAUSE);
913 return recover<ErrorClause>(std::move(start), follow_set_ORDER_BY_CLAUSE);
916 std::vector<OrderByClause::order_type> order_by;
919 if (
accept(TK_Descending)) {
920 order_by.emplace_back(std::move(e),
false);
923 order_by.emplace_back(std::move(e),
true);
925 }
while (
accept(TK_COMMA));
927 return std::make_unique<OrderByClause>(std::move(start), std::move(order_by));
935 if (not
expect(TK_Limit)) {
937 return recover<ErrorClause>(std::move(start), follow_set_LIMIT_CLAUSE);
940 if (limit.
type == TK_DEC_INT or limit.
type == TK_OCT_INT or limit.
type == TK_HEX_INT) {
943 diag.
e(limit.
pos) <<
"expected integer limit, got " << limit.
text <<
'\n';
944 return recover<ErrorClause>(std::move(start), follow_set_LIMIT_CLAUSE);
951 if (offset.
type == TK_DEC_INT or offset.
type == TK_OCT_INT or offset.
type == TK_HEX_INT) {
954 diag.
e(offset.
pos) <<
"expected integer offset, got " << offset.
text <<
'\n';
955 return recover<ErrorClause>(std::move(start), follow_set_LIMIT_CLAUSE);
959 return std::make_unique<LimitClause>(std::move(start), std::move(limit), std::move(offset));
973 switch (
token().type) {
981 case TK_STRING_LITERAL:
989 lhs = std::make_unique<Constant>(
consume());
993 if (
token().type == TK_Select)
997 if (not
expect(TK_RPAR)) {
998 recover(follow_set_PRIMARY_EXPRESSION);
1007 int p = get_precedence(TK_TILDE);
1008 lhs = std::make_unique<UnaryExpr>(std::move(tok),
parse_Expr(p));
1015 int p = get_precedence(tok.type);
1016 lhs = std::make_unique<UnaryExpr>(std::move(tok),
parse_Expr(p));
1022 recover(follow_set_EXPRESSION);
1023 return std::make_unique<ErrorExpr>(
token());
1027 while (
token() == TK_LPAR) {
1029 std::vector<std::unique_ptr<Expr>>
args;
1030 if (
token().type == TK_ASTERISK) {
1032 }
else if (
token().type != TK_RPAR) {
1035 while (
accept(TK_COMMA));
1037 if (not
expect(TK_RPAR)) {
1038 recover(follow_set_POSTFIX_EXPRESSION);
1039 lhs = std::make_unique<ErrorExpr>(
token());
1042 lhs = std::make_unique<FnApplicationExpr>(std::move(lpar), std::move(lhs), std::move(
args));
1047 int p = get_precedence(op);
1048 if (precedence_lhs > p)
return lhs;
1052 lhs = std::make_unique<BinaryExpr>(std::move(op), std::move(lhs), std::move(rhs));
1059 if (not
expect(TK_IDENTIFIER)) {
1060 recover(follow_set_DESIGNATOR);
1061 return std::make_unique<ErrorExpr>(std::move(lhs));
1063 if (
token() == TK_DOT) {
1066 if (not
expect(TK_IDENTIFIER)) {
1067 recover(follow_set_DESIGNATOR);
1068 return std::make_unique<ErrorExpr>(std::move(rhs));
1070 return std::make_unique<Designator>(std::move(dot), std::move(lhs), std::move(rhs));
1072 return std::make_unique<Designator>(std::move(lhs));
1077 if (is_integer(
token().type)) {
1078 return std::make_unique<Constant>(
consume());
1081 return std::make_unique<ErrorExpr>(
token());
1091 switch (
token().type) {
1094 goto error_recovery;
1105 bool is_varying =
token().
type == TK_Varchar;
1107 if (not
expect(TK_LPAR))
goto error_recovery;
1109 if (not
expect(TK_DEC_INT))
goto error_recovery;
1110 if (not
expect(TK_RPAR))
goto error_recovery;
1112 std::size_t length = strtoul(*(tok.
text),
nullptr, 10);
1114 diag.
e(tok.
pos) << tok.
text <<
" is not a valid length\n";
1115 goto error_recovery;
1133 if (not
expect(TK_LPAR))
goto error_recovery;
1135 if (not
expect(TK_DEC_INT))
goto error_recovery;
1136 if (not
expect(TK_RPAR))
goto error_recovery;
1138 std::size_t bytes = strtoul(*(tok.
text),
nullptr, 10);
1140 diag.
e(tok.
pos) << tok.
text <<
" is not a valid size for an INT\n";
1141 goto error_recovery;
1159 if (not
expect(TK_LPAR))
goto error_recovery;
1162 if (not
expect(TK_DEC_INT))
goto error_recovery;
1165 if (not
expect(TK_DEC_INT))
goto error_recovery;
1167 if (not
expect(TK_RPAR))
goto error_recovery;
1169 std::size_t p = strtoul(*(precision.
text),
nullptr, 10);
1171 diag.
e(precision.
pos) << precision.
text <<
" is not a valid precision for a DECIMAL\n";
1172 goto error_recovery;
1175 std::size_t s = scale.
text.
has_value() ? strtoul(*(scale.
text),
nullptr, 10) : 0;
1177 diag.
e(scale.
pos) << scale.
text <<
" is not a valid scale for a DECIMAL\n";
1178 goto error_recovery;
1185 recover(follow_set_DATA_TYPE);
static Catalog & Get()
Return a reference to the single Catalog instance.
std::ostream & e(const Position pos)
A data type representing a pooled (or internalized) object.
This class represents types in the SQL type system.
static Pooled< CharacterSequence > Get_Char(category_t category, std::size_t length)
Returns a CharacterSequence type of the given category and fixed length.
static Pooled< Numeric > Get_Double(category_t category)
Returns a Numeric type of given category for 64 bit floating-points.
static M_LCOV_EXCL_STOP Pooled< ErrorType > Get_Error()
Returns a ErrorType.
static Pooled< Numeric > Get_Decimal(category_t category, unsigned digits, unsigned scale)
Returns a Numeric type for decimals of given category, decimal digits, and scale.
static Pooled< Date > Get_Date(category_t category)
Returns a Date type of the given category.
static Pooled< Boolean > Get_Boolean(category_t category)
Returns a Boolean type of the given category.
static Pooled< DateTime > Get_Datetime(category_t category)
Returns a DateTime type of the given category.
static Pooled< Numeric > Get_Float(category_t category)
Returns a Numeric type of given category for 32 bit floating-points.
static Pooled< Numeric > Get_Integer(category_t category, unsigned num_bytes)
Returns a Numeric type for integrals of given category and num_bytes bytes.
static Pooled< CharacterSequence > Get_Varchar(category_t category, std::size_t length)
Returns a CharacterSequence type of the given category and varying length.
An import statement for a delimiter separated values (DSV) file.
std::vector< element_type > tuple_t
std::unique_ptr< Clause > parse_SelectClause()
const Type * parse_data_type()
std::unique_ptr< Stmt > parse_SelectStmt()
std::unique_ptr< Stmt > parse_ImportStmt()
std::unique_ptr< Stmt > parse_DropIndexStmt()
std::array< bool, unsigned(TokenType::TokenType_MAX)+1 > follow_set_t
bool accept(const TokenType tt)
std::unique_ptr< Stmt > parse_DropDatabaseStmt()
bool is(const TokenType tt)
std::unique_ptr< Stmt > parse_CreateDatabaseStmt()
std::unique_ptr< Stmt > parse_DeleteStmt()
std::unique_ptr< Clause > parse_LimitClause()
std::unique_ptr< Clause > parse_FromClause()
std::unique_ptr< Stmt > parse_UpdateStmt()
void recover(const follow_set_t &FS)
Consumes tokens until the first occurence of a token in the follow set FS is found.
bool expect(const TokenType tt)
std::unique_ptr< Stmt > parse_CreateIndexStmt()
std::unique_ptr< Stmt > parse_UseDatabaseStmt()
std::unique_ptr< Expr > expect_integer()
std::unique_ptr< Stmt > parse_CreateTableStmt()
std::unique_ptr< Clause > parse_OrderByClause()
std::unique_ptr< Stmt > parse_Stmt()
std::unique_ptr< Command > parse()
std::unique_ptr< Clause > parse_GroupByClause()
std::unique_ptr< Clause > parse_WhereClause()
std::unique_ptr< Expr > parse_designator()
std::unique_ptr< Expr > parse_Expr(int precedence_lhs=0, std::unique_ptr< Expr > lhs=nullptr)
std::unique_ptr< Stmt > parse_DropTableStmt()
std::unique_ptr< Clause > parse_HavingClause()
std::unique_ptr< Stmt > parse_InsertStmt()
std::unique_ptr< Instruction > parse_Instruction()
ThreadSafePooledOptionalString text
declared as optional for dummy tokens
static Token CreateArtificial(TokenType type=TK_EOF)