grammar: Fix string literals in CHECK expressions (and maybe other places)

Fix parsing of table definitions like this one where there is a complex
check constraint using string literals:
CREATE TABLE "a" (
    `b` TEXT CHECK(`b`='A' or `b`='B')
);
The grammar parser would fail to parse this statement correctly prior to
this fix.

See issue #179.
This commit is contained in:
Martin Kleusberg
2015-01-06 14:11:28 +01:00
parent 0f4ac7e89c
commit 1ea67c33d2
6 changed files with 324 additions and 315 deletions

View File

@@ -1,4 +1,4 @@
/* $ANTLR 2.7.7 (20130425): "sqlite3.g" -> "Sqlite3Lexer.cpp"$ */
/* $ANTLR 2.7.7 (20141010): "sqlite3.g" -> "Sqlite3Lexer.cpp"$ */
#include "Sqlite3Lexer.hpp"
#include <antlr/CharBuffer.hpp>
#include <antlr/TokenStreamException.hpp>

View File

@@ -2,7 +2,7 @@
#define INC_Sqlite3Lexer_hpp_
#include <antlr/config.hpp>
/* $ANTLR 2.7.7 (20130425): "sqlite3.g" -> "Sqlite3Lexer.hpp"$ */
/* $ANTLR 2.7.7 (20141010): "sqlite3.g" -> "Sqlite3Lexer.hpp"$ */
#include <antlr/CommonToken.hpp>
#include <antlr/InputBuffer.hpp>
#include <antlr/BitSet.hpp>

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
#define INC_Sqlite3Parser_hpp_
#include <antlr/config.hpp>
/* $ANTLR 2.7.7 (20130425): "sqlite3.g" -> "Sqlite3Parser.hpp"$ */
/* $ANTLR 2.7.7 (20141010): "sqlite3.g" -> "Sqlite3Parser.hpp"$ */
#include <antlr/TokenStream.hpp>
#include <antlr/TokenBuffer.hpp>
#include "sqlite3TokenTypes.hpp"

View File

@@ -463,7 +463,7 @@ suffixexpr
literalvalue
:
NUMERIC
// | STRINGLITERAL // captured by columnname
| STRINGLITERAL
// | blob-literal
| NULL_T
| CURRENT_TIME

View File

@@ -1,7 +1,7 @@
#ifndef INC_sqlite3TokenTypes_hpp_
#define INC_sqlite3TokenTypes_hpp_
/* $ANTLR 2.7.7 (20130425): "sqlite3.g" -> "sqlite3TokenTypes.hpp"$ */
/* $ANTLR 2.7.7 (20141010): "sqlite3.g" -> "sqlite3TokenTypes.hpp"$ */
#ifndef CUSTOM_API
# define CUSTOM_API