diff options
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/parser/parser.h')
| -rw-r--r-- | SQLiteStudio3/coreSQLiteStudio/parser/parser.h | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/parser.h b/SQLiteStudio3/coreSQLiteStudio/parser/parser.h index 8fe25f2..04e9ccb 100644 --- a/SQLiteStudio3/coreSQLiteStudio/parser/parser.h +++ b/SQLiteStudio3/coreSQLiteStudio/parser/parser.h @@ -2,7 +2,7 @@ #define PARSER_H #include "token.h" -#include "../dialect.h" +#undef NDEBUG #include "ast/sqlitequery.h" #include "ast/sqliteexpr.h" @@ -18,7 +18,7 @@ class ParserError; * * Typical use case would be: * @code - * Parser parser(db->getDialect()); + * Parser parser(); * if (parser.parse(queryString)) * { * QList<SqliteQueryPtr> queries = parser.getQueries(); @@ -47,9 +47,7 @@ class ParserError; * Finally, there is a parseExpr() to parse just a SQLite expression * (http://sqlite.org/lang_expr.html). * - * Parser works basing on SQLite grammar defined in sqlite2.y and sqlite3.y files. - * Since there are 2 completly separate grammar definitions, there are 2 dialects - * that the parser works with. + * Parser works basing on SQLite grammar defined in sqlite3.y file. * * This is a high-level API to the Lemon Parser, the original SQLite parser. */ @@ -57,10 +55,9 @@ class API_EXPORT Parser { public: /** - * @brief Creates parser for given SQLite dialect. - * @param dialect SQLite dialect to use. Can be changed later with setDialect(). + * @brief Creates parser for SQLite dialect. */ - Parser(Dialect dialect); + Parser(); /** * @brief Releases internal resources. @@ -78,12 +75,6 @@ class API_EXPORT Parser void setLemonDebug(bool enabled); /** - * @brief Changes dialect used by parser. - * @param dialect Dialect to use. - */ - void setDialect(Dialect dialect); - - /** * @brief Parses given query string. * @param sql SQL query string to parse. Can be multiple queries separated with semicolon. * @param ignoreMinorErrors If true, then parser will ignore minor errors. Detailed descritpion below. @@ -125,7 +116,7 @@ class API_EXPORT Parser * * Example: * @code - * Parser parser(db->getDialect()); + * Parser parser; * SqliteSelectPtr select = parser.parse<SelectPtr>(queryString); * if (!select) * { @@ -257,14 +248,6 @@ class API_EXPORT Parser void cleanUp(); /** - * @brief Propagates dialect to all AST objects. - * - * This is called after successful parsing to set the adequate SQLite dialect - * in all AST objects. - */ - void fillSqliteDialect(); - - /** * @brief Creates Lemon parser. * @return Pointer to Lemon parser. */ @@ -326,11 +309,6 @@ class API_EXPORT Parser void parseAddToken(void* other, TokenPtr token); /** - * @brief Parser's dialect. - */ - Dialect dialect; - - /** * @brief Flag indicating if the Lemon low-level debug messages are enabled. */ bool debugLemon = false; |
