grammar: Simplify grammar parser

Remove the stub for parsing CREATE TABLE ... AS SELECT statements. This
provides no extra value because we never come across these statements in
our context and this is not remotely implemented in a useful way.

Also remove the statement and statement list structures as they are not
used either.
This commit is contained in:
Martin Kleusberg
2019-09-03 19:54:00 +02:00
parent 2958e5acba
commit 0bf323ffc0
3 changed files with 1778 additions and 1940 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -41,17 +41,13 @@ public:
public: void identifier();
public: void collationname();
public: void signednumber();
public: void statementlist();
public: void statement();
public: void createtable();
public: void createindex();
public: void create_statements();
public: void keywordastablename();
public: void createtable();
public: void columndef();
public: void tableconstraint();
public: void selectstmt();
public: void name();
public: void expr();
public: void createindex();
public: void indexedcolumn();
public: void keywordascolumnname();
public: void columnname();
@@ -60,6 +56,7 @@ public:
public: void conflictclause();
public: void literalvalue();
public: void foreignkeyclause();
public: void selectstmt();
public: void functionname();
public: void subexpr();
public: void binaryoperator();
@@ -133,8 +130,6 @@ private:
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_21;
static const unsigned long _tokenSet_22_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_22;
static const unsigned long _tokenSet_23_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_23;
};
#endif /*INC_Sqlite3Parser_hpp_*/

View File

@@ -222,23 +222,6 @@ signednumber
;
// parser part
statementlist
:
(statement)?
(SEMI statement)*
;
statement
:
createtable
| createindex
;
create_statements
:
createtable
| createindex
;
keywordastablename
:
@@ -289,9 +272,7 @@ keywordastablename
createtable
:
(CREATE (TEMP|TEMPORARY)? TABLE (IF_T NOT EXISTS)? (tablename | keywordastablename)
( (LPAREN columndef (COMMA columndef)* (COMMA tableconstraint)* RPAREN (WITHOUT ROWID)?)
| (AS selectstmt)
)
(LPAREN columndef (COMMA columndef)* (COMMA tableconstraint)* RPAREN (WITHOUT ROWID)?)
{#createtable = #([CREATETABLE, "CREATETABLE"], #createtable);}
)
|(CREATE VIRTUAL TABLE (IF_T NOT EXISTS)? (tablename | keywordastablename)