grammar: Add support for row values

SQLite version 3.15.0 introduced a new feature called row values. These
are basically vectors of values that can be used to simplify some
expressions.

For example instead of this
CREATE TABLE x(a int, b int, c int, CHECK(a=1 and b=2));
you could write this:
CREATE TABLE x(a int, b int, c int, CHECK((a,b) = (1,2)));

However, the new syntax wasn't supported by our grammar parser which
made it impossible to access or edit that table. This commit attempts to
fix this.
This commit is contained in:
Martin Kleusberg
2016-10-30 21:27:02 +01:00
parent 9afa8d2ace
commit e9894b47fa
3 changed files with 529 additions and 419 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -128,6 +128,8 @@ private:
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_19;
static const unsigned long _tokenSet_20_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_20;
static const unsigned long _tokenSet_21_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_21;
};
#endif /*INC_Sqlite3Parser_hpp_*/

View File

@@ -409,7 +409,8 @@ functionname
expr
:
subexpr ((binaryoperator | AND | OR) subexpr )*
( LPAREN subexpr (COMMA subexpr)+ RPAREN binaryoperator LPAREN subexpr (COMMA subexpr)+ RPAREN )
| ( subexpr ((binaryoperator | AND | OR) subexpr )* )
;
subexpr