sql-ddl-to-json-schema
Version:
Parse and convert SQL DDL statements to a JSON Schema.
428 lines • 209 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
// Generated automatically by nearley, version 2.20.1
// http://github.com/Hardmath123/nearley
// Bypasses TS6133. Allow declared but unused functions.
// @ts-ignore
function id(d) { return d[0]; }
const moo_1 = __importDefault(require("moo"));
const keywords_1 = __importDefault(require("./dictionary/keywords"));
const symbols_1 = __importDefault(require("./dictionary/symbols"));
const rules = Object.assign({}, keywords_1.default, symbols_1.default);
const lexer = moo_1.default.compile(rules);
;
;
;
;
const grammar = {
Lexer: lexer,
ParserRules: [
{ "name": "P_DDS$subexpression$1", "symbols": ["P_CREATE_DB", "_"], "postprocess": id },
{ "name": "P_DDS$subexpression$1", "symbols": ["P_CREATE_TABLE", "_"], "postprocess": id },
{ "name": "P_DDS$subexpression$1", "symbols": ["P_CREATE_INDEX", "_"], "postprocess": id },
{ "name": "P_DDS$subexpression$1", "symbols": ["P_ALTER_DB", "_"], "postprocess": id },
{ "name": "P_DDS$subexpression$1", "symbols": ["P_ALTER_TABLE", "_"], "postprocess": id },
{ "name": "P_DDS$subexpression$1", "symbols": ["P_DROP_DB", "_"], "postprocess": id },
{ "name": "P_DDS$subexpression$1", "symbols": ["P_DROP_TABLE", "_"], "postprocess": id },
{ "name": "P_DDS$subexpression$1", "symbols": ["P_DROP_INDEX", "_"], "postprocess": id },
{ "name": "P_DDS$subexpression$1", "symbols": ["P_RENAME_TABLE", "_"], "postprocess": id },
{ "name": "P_DDS$subexpression$1", "symbols": ["P_SET", "_"], "postprocess": id },
{ "name": "P_DDS$subexpression$1", "symbols": ["P_USE_DB", "_"], "postprocess": id },
{ "name": "P_DDS", "symbols": ["_", "P_DDS$subexpression$1"], "postprocess": d => {
return {
id: 'P_DDS',
def: d[1]
};
} },
{ "name": "_$ebnf$1", "symbols": [] },
{ "name": "_$ebnf$1", "symbols": ["_$ebnf$1", (lexer.has("WS") ? { type: "WS" } : WS)], "postprocess": (d) => d[0].concat([d[1]]) },
{ "name": "_", "symbols": ["_$ebnf$1"] },
{ "name": "__$ebnf$1", "symbols": [(lexer.has("WS") ? { type: "WS" } : WS)] },
{ "name": "__$ebnf$1", "symbols": ["__$ebnf$1", (lexer.has("WS") ? { type: "WS" } : WS)], "postprocess": (d) => d[0].concat([d[1]]) },
{ "name": "__", "symbols": ["__$ebnf$1"] },
{ "name": "S_EOS", "symbols": ["_", (lexer.has("S_SEMICOLON") ? { type: "S_SEMICOLON" } : S_SEMICOLON)] },
{ "name": "O_CHARSET", "symbols": ["O_QUOTED_STRING"], "postprocess": d => d[0] },
{ "name": "O_CHARSET", "symbols": ["S_IDENTIFIER"], "postprocess": d => d[0] },
{ "name": "O_COLLATION", "symbols": ["O_QUOTED_STRING"], "postprocess": d => d[0] },
{ "name": "O_COLLATION", "symbols": ["S_IDENTIFIER"], "postprocess": d => d[0] },
{ "name": "O_ENGINE", "symbols": ["O_QUOTED_STRING"], "postprocess": d => d[0] },
{ "name": "O_ENGINE", "symbols": ["S_IDENTIFIER"], "postprocess": d => d[0] },
{ "name": "O_DEFAULT_VALUE", "symbols": [(lexer.has("S_NUMBER") ? { type: "S_NUMBER" } : S_NUMBER)], "postprocess": d => d[0].value },
{ "name": "O_DEFAULT_VALUE", "symbols": [(lexer.has("S_BIT_FORMAT") ? { type: "S_BIT_FORMAT" } : S_BIT_FORMAT)], "postprocess": d => d[0].value },
{ "name": "O_DEFAULT_VALUE", "symbols": [(lexer.has("S_HEXA_FORMAT") ? { type: "S_HEXA_FORMAT" } : S_HEXA_FORMAT)], "postprocess": d => d[0].value },
{ "name": "O_DEFAULT_VALUE$ebnf$1$subexpression$1$ebnf$1", "symbols": [(lexer.has("S_NUMBER") ? { type: "S_NUMBER" } : S_NUMBER)], "postprocess": id },
{ "name": "O_DEFAULT_VALUE$ebnf$1$subexpression$1$ebnf$1", "symbols": [], "postprocess": () => null },
{ "name": "O_DEFAULT_VALUE$ebnf$1$subexpression$1", "symbols": [(lexer.has("S_LPARENS") ? { type: "S_LPARENS" } : S_LPARENS), "_", "O_DEFAULT_VALUE$ebnf$1$subexpression$1$ebnf$1", "_", (lexer.has("S_RPARENS") ? { type: "S_RPARENS" } : S_RPARENS)], "postprocess": d => '(' + (d[2] ? d[2].value : '') + ')'
},
{ "name": "O_DEFAULT_VALUE$ebnf$1", "symbols": ["O_DEFAULT_VALUE$ebnf$1$subexpression$1"], "postprocess": id },
{ "name": "O_DEFAULT_VALUE$ebnf$1", "symbols": [], "postprocess": () => null },
{ "name": "O_DEFAULT_VALUE", "symbols": ["S_IDENTIFIER", "O_DEFAULT_VALUE$ebnf$1"], "postprocess": d => d[0] + (d[1] ?? '') },
{ "name": "O_DEFAULT_VALUE", "symbols": ["O_QUOTED_STRING"], "postprocess": id },
{ "name": "O_QUOTED_STRING", "symbols": [(lexer.has("S_DQUOTE_STRING") ? { type: "S_DQUOTE_STRING" } : S_DQUOTE_STRING)], "postprocess": d => d[0].value },
{ "name": "O_QUOTED_STRING", "symbols": [(lexer.has("S_SQUOTE_STRING") ? { type: "S_SQUOTE_STRING" } : S_SQUOTE_STRING)], "postprocess": d => d[0].value },
{ "name": "O_TABLE_OPTION_VALUE", "symbols": ["O_QUOTED_STRING"], "postprocess": d => d[0] },
{ "name": "O_TABLE_OPTION_VALUE", "symbols": ["S_IDENTIFIER"], "postprocess": d => d[0] },
{ "name": "O_TABLE_OPTION_VALUE", "symbols": [(lexer.has("S_NUMBER") ? { type: "S_NUMBER" } : S_NUMBER)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("S_IDENTIFIER_QUOTED") ? { type: "S_IDENTIFIER_QUOTED" } : S_IDENTIFIER_QUOTED)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("S_IDENTIFIER_UNQUOTED") ? { type: "S_IDENTIFIER_UNQUOTED" } : S_IDENTIFIER_UNQUOTED)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_TO") ? { type: "K_TO" } : K_TO)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_PI") ? { type: "K_PI" } : K_PI)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_IF") ? { type: "K_IF" } : K_IF)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_OR") ? { type: "K_OR" } : K_OR)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ON") ? { type: "K_ON" } : K_ON)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_BY") ? { type: "K_BY" } : K_BY)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_NO") ? { type: "K_NO" } : K_NO)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_AS") ? { type: "K_AS" } : K_AS)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_USE") ? { type: "K_USE" } : K_USE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ASC") ? { type: "K_ASC" } : K_ASC)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_FOR") ? { type: "K_FOR" } : K_FOR)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_NOT") ? { type: "K_NOT" } : K_NOT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_LZ4") ? { type: "K_LZ4" } : K_LZ4)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ADD") ? { type: "K_ADD" } : K_ADD)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_SET") ? { type: "K_SET" } : K_SET)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_NOW") ? { type: "K_NOW" } : K_NOW)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_KEY") ? { type: "K_KEY" } : K_KEY)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_INT") ? { type: "K_INT" } : K_INT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_YES") ? { type: "K_YES" } : K_YES)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_BIT") ? { type: "K_BIT" } : K_BIT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ZLIB") ? { type: "K_ZLIB" } : K_ZLIB)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DATE") ? { type: "K_DATE" } : K_DATE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DESC") ? { type: "K_DESC" } : K_DESC)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DISK") ? { type: "K_DISK" } : K_DISK)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_WITH") ? { type: "K_WITH" } : K_WITH)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_TRUE") ? { type: "K_TRUE" } : K_TRUE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DROP") ? { type: "K_DROP" } : K_DROP)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DATA") ? { type: "K_DATA" } : K_DATA)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ENUM") ? { type: "K_ENUM" } : K_ENUM)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_BOOL") ? { type: "K_BOOL" } : K_BOOL)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_NULL") ? { type: "K_NULL" } : K_NULL)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_RAND") ? { type: "K_RAND" } : K_RAND)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_TIME") ? { type: "K_TIME" } : K_TIME)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_TEXT") ? { type: "K_TEXT" } : K_TEXT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_PAGE") ? { type: "K_PAGE" } : K_PAGE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_USER") ? { type: "K_USER" } : K_USER)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_YEAR") ? { type: "K_YEAR" } : K_YEAR)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_BLOB") ? { type: "K_BLOB" } : K_BLOB)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_FULL") ? { type: "K_FULL" } : K_FULL)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_HASH") ? { type: "K_HASH" } : K_HASH)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_NONE") ? { type: "K_NONE" } : K_NONE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_WAIT") ? { type: "K_WAIT" } : K_WAIT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_COPY") ? { type: "K_COPY" } : K_COPY)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_JSON") ? { type: "K_JSON" } : K_JSON)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CHAR") ? { type: "K_CHAR" } : K_CHAR)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_KEYS") ? { type: "K_KEYS" } : K_KEYS)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_LAST") ? { type: "K_LAST" } : K_LAST)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_LIKE") ? { type: "K_LIKE" } : K_LIKE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_LOCK") ? { type: "K_LOCK" } : K_LOCK)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_UUID") ? { type: "K_UUID" } : K_UUID)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_UNION") ? { type: "K_UNION" } : K_UNION)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_FALSE") ? { type: "K_FALSE" } : K_FALSE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_FIRST") ? { type: "K_FIRST" } : K_FIRST)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_FIXED") ? { type: "K_FIXED" } : K_FIXED)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ORDER") ? { type: "K_ORDER" } : K_ORDER)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_TABLE") ? { type: "K_TABLE" } : K_TABLE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_FORCE") ? { type: "K_FORCE" } : K_FORCE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_USING") ? { type: "K_USING" } : K_USING)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_AFTER") ? { type: "K_AFTER" } : K_AFTER)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_BTREE") ? { type: "K_BTREE" } : K_BTREE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_RTREE") ? { type: "K_RTREE" } : K_RTREE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_MATCH") ? { type: "K_MATCH" } : K_MATCH)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_NCHAR") ? { type: "K_NCHAR" } : K_NCHAR)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ROUND") ? { type: "K_ROUND" } : K_ROUND)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ALTER") ? { type: "K_ALTER" } : K_ALTER)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_POINT") ? { type: "K_POINT" } : K_POINT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_FLOAT") ? { type: "K_FLOAT" } : K_FLOAT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_INDEX") ? { type: "K_INDEX" } : K_INDEX)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_COLUMN") ? { type: "K_COLUMN" } : K_COLUMN)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_PARSER") ? { type: "K_PARSER" } : K_PARSER)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CHANGE") ? { type: "K_CHANGE" } : K_CHANGE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DOUBLE") ? { type: "K_DOUBLE" } : K_DOUBLE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_UNIQUE") ? { type: "K_UNIQUE" } : K_UNIQUE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_PERIOD") ? { type: "K_PERIOD" } : K_PERIOD)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_SCHEMA") ? { type: "K_SCHEMA" } : K_SCHEMA)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ONLINE") ? { type: "K_ONLINE" } : K_ONLINE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ACTION") ? { type: "K_ACTION" } : K_ACTION)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_IMPORT") ? { type: "K_IMPORT" } : K_IMPORT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_SHARED") ? { type: "K_SHARED" } : K_SHARED)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_IGNORE") ? { type: "K_IGNORE" } : K_IGNORE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_NOWAIT") ? { type: "K_NOWAIT" } : K_NOWAIT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_BINARY") ? { type: "K_BINARY" } : K_BINARY)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_RENAME") ? { type: "K_RENAME" } : K_RENAME)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_EXISTS") ? { type: "K_EXISTS" } : K_EXISTS)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_SIMPLE") ? { type: "K_SIMPLE" } : K_SIMPLE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_SYSTEM") ? { type: "K_SYSTEM" } : K_SYSTEM)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_BIGINT") ? { type: "K_BIGINT" } : K_BIGINT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_UPDATE") ? { type: "K_UPDATE" } : K_UPDATE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ENGINE") ? { type: "K_ENGINE" } : K_ENGINE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DELETE") ? { type: "K_DELETE" } : K_DELETE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_MODIFY") ? { type: "K_MODIFY" } : K_MODIFY)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CREATE") ? { type: "K_CREATE" } : K_CREATE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_MEMORY") ? { type: "K_MEMORY" } : K_MEMORY)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ENABLE") ? { type: "K_ENABLE" } : K_ENABLE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_PARTIAL") ? { type: "K_PARTIAL" } : K_PARTIAL)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_WITHOUT") ? { type: "K_WITHOUT" } : K_WITHOUT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_VERSION") ? { type: "K_VERSION" } : K_VERSION)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_VARCHAR") ? { type: "K_VARCHAR" } : K_VARCHAR)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_POLYGON") ? { type: "K_POLYGON" } : K_POLYGON)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_PRIMARY") ? { type: "K_PRIMARY" } : K_PRIMARY)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_OFFLINE") ? { type: "K_OFFLINE" } : K_OFFLINE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_NUMERIC") ? { type: "K_NUMERIC" } : K_NUMERIC)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_BOOLEAN") ? { type: "K_BOOLEAN" } : K_BOOLEAN)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CASCADE") ? { type: "K_CASCADE" } : K_CASCADE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CHARSET") ? { type: "K_CHARSET" } : K_CHARSET)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_REPLACE") ? { type: "K_REPLACE" } : K_REPLACE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_COLLATE") ? { type: "K_COLLATE" } : K_COLLATE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_COMMENT") ? { type: "K_COMMENT" } : K_COMMENT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_COMPACT") ? { type: "K_COMPACT" } : K_COMPACT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_INTEGER") ? { type: "K_INTEGER" } : K_INTEGER)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CURDATE") ? { type: "K_CURDATE" } : K_CURDATE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CURTIME") ? { type: "K_CURTIME" } : K_CURTIME)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DECIMAL") ? { type: "K_DECIMAL" } : K_DECIMAL)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DEFAULT") ? { type: "K_DEFAULT" } : K_DEFAULT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DISABLE") ? { type: "K_DISABLE" } : K_DISABLE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DISCARD") ? { type: "K_DISCARD" } : K_DISCARD)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DYNAMIC") ? { type: "K_DYNAMIC" } : K_DYNAMIC)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_TINYINT") ? { type: "K_TINYINT" } : K_TINYINT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_FOREIGN") ? { type: "K_FOREIGN" } : K_FOREIGN)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_SYSDATE") ? { type: "K_SYSDATE" } : K_SYSDATE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_STORAGE") ? { type: "K_STORAGE" } : K_STORAGE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_INPLACE") ? { type: "K_INPLACE" } : K_INPLACE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_SPATIAL") ? { type: "K_SPATIAL" } : K_SPATIAL)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CONVERT") ? { type: "K_CONVERT" } : K_CONVERT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_NVARCHAR") ? { type: "K_NVARCHAR" } : K_NVARCHAR)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_SMALLINT") ? { type: "K_SMALLINT" } : K_SMALLINT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_LONGTEXT") ? { type: "K_LONGTEXT" } : K_LONGTEXT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_RESTRICT") ? { type: "K_RESTRICT" } : K_RESTRICT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CHECKSUM") ? { type: "K_CHECKSUM" } : K_CHECKSUM)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_PASSWORD") ? { type: "K_PASSWORD" } : K_PASSWORD)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_UTC_DATE") ? { type: "K_UTC_DATE" } : K_UTC_DATE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ZEROFILL") ? { type: "K_ZEROFILL" } : K_ZEROFILL)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_MIN_ROWS") ? { type: "K_MIN_ROWS" } : K_MIN_ROWS)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DATETIME") ? { type: "K_DATETIME" } : K_DATETIME)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_TINYTEXT") ? { type: "K_TINYTEXT" } : K_TINYTEXT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_UNSIGNED") ? { type: "K_UNSIGNED" } : K_UNSIGNED)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_LONGBLOB") ? { type: "K_LONGBLOB" } : K_LONGBLOB)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DATABASE") ? { type: "K_DATABASE" } : K_DATABASE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_MAX_ROWS") ? { type: "K_MAX_ROWS" } : K_MAX_ROWS)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_GEOMETRY") ? { type: "K_GEOMETRY" } : K_GEOMETRY)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_FULLTEXT") ? { type: "K_FULLTEXT" } : K_FULLTEXT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_NATIONAL") ? { type: "K_NATIONAL" } : K_NATIONAL)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_UTC_TIME") ? { type: "K_UTC_TIME" } : K_UTC_TIME)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_TINYBLOB") ? { type: "K_TINYBLOB" } : K_TINYBLOB)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CHARACTER") ? { type: "K_CHARACTER" } : K_CHARACTER)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ALGORITHM") ? { type: "K_ALGORITHM" } : K_ALGORITHM)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_PACK_KEYS") ? { type: "K_PACK_KEYS" } : K_PACK_KEYS)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_INVISIBLE") ? { type: "K_INVISIBLE" } : K_INVISIBLE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DIRECTORY") ? { type: "K_DIRECTORY" } : K_DIRECTORY)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_TIMESTAMP") ? { type: "K_TIMESTAMP" } : K_TIMESTAMP)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_MEDIUMINT") ? { type: "K_MEDIUMINT" } : K_MEDIUMINT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_LOCALTIME") ? { type: "K_LOCALTIME" } : K_LOCALTIME)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ROW_COUNT") ? { type: "K_ROW_COUNT" } : K_ROW_COUNT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_EXCLUSIVE") ? { type: "K_EXCLUSIVE" } : K_EXCLUSIVE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_REDUNDANT") ? { type: "K_REDUNDANT" } : K_REDUNDANT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_TEMPORARY") ? { type: "K_TEMPORARY" } : K_TEMPORARY)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_VARBINARY") ? { type: "K_VARBINARY" } : K_VARBINARY)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_MEDIUMTEXT") ? { type: "K_MEDIUMTEXT" } : K_MEDIUMTEXT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_REFERENCES") ? { type: "K_REFERENCES" } : K_REFERENCES)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_TABLESPACE") ? { type: "K_TABLESPACE" } : K_TABLESPACE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_FOUND_ROWS") ? { type: "K_FOUND_ROWS" } : K_FOUND_ROWS)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_UUID_SHORT") ? { type: "K_UUID_SHORT" } : K_UUID_SHORT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ROW_FORMAT") ? { type: "K_ROW_FORMAT" } : K_ROW_FORMAT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CONSTRAINT") ? { type: "K_CONSTRAINT" } : K_CONSTRAINT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_VALIDATION") ? { type: "K_VALIDATION" } : K_VALIDATION)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ENCRYPTION") ? { type: "K_ENCRYPTION" } : K_ENCRYPTION)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_COMPRESSED") ? { type: "K_COMPRESSED" } : K_COMPRESSED)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_MEDIUMBLOB") ? { type: "K_MEDIUMBLOB" } : K_MEDIUMBLOB)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CONNECTION") ? { type: "K_CONNECTION" } : K_CONNECTION)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_LINESTRING") ? { type: "K_LINESTRING" } : K_LINESTRING)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_MULTIPOINT") ? { type: "K_MULTIPOINT" } : K_MULTIPOINT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_VERSIONING") ? { type: "K_VERSIONING" } : K_VERSIONING)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_SYSTEM_USER") ? { type: "K_SYSTEM_USER" } : K_SYSTEM_USER)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_SYSTEM_TIME") ? { type: "K_SYSTEM_TIME" } : K_SYSTEM_TIME)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_IETF_QUOTES") ? { type: "K_IETF_QUOTES" } : K_IETF_QUOTES)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_COMPRESSION") ? { type: "K_COMPRESSION" } : K_COMPRESSION)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CURRENT_USER") ? { type: "K_CURRENT_USER" } : K_CURRENT_USER)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CURRENT_TIME") ? { type: "K_CURRENT_TIME" } : K_CURRENT_TIME)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CURRENT_DATE") ? { type: "K_CURRENT_DATE" } : K_CURRENT_DATE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_MULTIPOLYGON") ? { type: "K_MULTIPOLYGON" } : K_MULTIPOLYGON)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_SESSION_USER") ? { type: "K_SESSION_USER" } : K_SESSION_USER)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_INSERT_METHOD") ? { type: "K_INSERT_METHOD" } : K_INSERT_METHOD)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_UTC_TIMESTAMP") ? { type: "K_UTC_TIMESTAMP" } : K_UTC_TIMESTAMP)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_TRANSACTIONAL") ? { type: "K_TRANSACTIONAL" } : K_TRANSACTIONAL)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_PAGE_CHECKSUM") ? { type: "K_PAGE_CHECKSUM" } : K_PAGE_CHECKSUM)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CONNECTION_ID") ? { type: "K_CONNECTION_ID" } : K_CONNECTION_ID)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_COLUMN_FORMAT") ? { type: "K_COLUMN_FORMAT" } : K_COLUMN_FORMAT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_KEY_BLOCK_SIZE") ? { type: "K_KEY_BLOCK_SIZE" } : K_KEY_BLOCK_SIZE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_LAST_INSERT_ID") ? { type: "K_LAST_INSERT_ID" } : K_LAST_INSERT_ID)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_UNIX_TIMESTAMP") ? { type: "K_UNIX_TIMESTAMP" } : K_UNIX_TIMESTAMP)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_AVG_ROW_LENGTH") ? { type: "K_AVG_ROW_LENGTH" } : K_AVG_ROW_LENGTH)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_AUTO_INCREMENT") ? { type: "K_AUTO_INCREMENT" } : K_AUTO_INCREMENT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_LOCALTIMESTAMP") ? { type: "K_LOCALTIMESTAMP" } : K_LOCALTIMESTAMP)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_MULTILINESTRING") ? { type: "K_MULTILINESTRING" } : K_MULTILINESTRING)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_DELAY_KEY_WRITE") ? { type: "K_DELAY_KEY_WRITE" } : K_DELAY_KEY_WRITE)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_UNIQUEIDENTIFIER") ? { type: "K_UNIQUEIDENTIFIER" } : K_UNIQUEIDENTIFIER)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_STATS_PERSISTENT") ? { type: "K_STATS_PERSISTENT" } : K_STATS_PERSISTENT)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_CURRENT_TIMESTAMP") ? { type: "K_CURRENT_TIMESTAMP" } : K_CURRENT_TIMESTAMP)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_ENCRYPTION_KEY_ID") ? { type: "K_ENCRYPTION_KEY_ID" } : K_ENCRYPTION_KEY_ID)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_STATS_AUTO_RECALC") ? { type: "K_STATS_AUTO_RECALC" } : K_STATS_AUTO_RECALC)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_GEOMETRYCOLLECTION") ? { type: "K_GEOMETRYCOLLECTION" } : K_GEOMETRYCOLLECTION)], "postprocess": d => d[0].value },
{ "name": "S_IDENTIFIER", "symbols": [(lexer.has("K_STATS_SAMPLE_PAGES") ? { type: "K_STATS_SAMPLE_PAGES" } : K_STATS_SAMPLE_PAGES)], "postprocess": d => d[0].value },
{ "name": "P_ALTER_DB$subexpression$1", "symbols": [(lexer.has("K_DATABASE") ? { type: "K_DATABASE" } : K_DATABASE)] },
{ "name": "P_ALTER_DB$subexpression$1", "symbols": [(lexer.has("K_SCHEMA") ? { type: "K_SCHEMA" } : K_SCHEMA)] },
{ "name": "P_ALTER_DB$ebnf$1$subexpression$1", "symbols": ["__", "S_IDENTIFIER"], "postprocess": d => d[1] },
{ "name": "P_ALTER_DB$ebnf$1", "symbols": ["P_ALTER_DB$ebnf$1$subexpression$1"], "postprocess": id },
{ "name": "P_ALTER_DB$ebnf$1", "symbols": [], "postprocess": () => null },
{ "name": "P_ALTER_DB$ebnf$2$subexpression$1", "symbols": ["__", "O_ALTER_DB_SPEC"], "postprocess": d => d[1] },
{ "name": "P_ALTER_DB$ebnf$2", "symbols": ["P_ALTER_DB$ebnf$2$subexpression$1"] },
{ "name": "P_ALTER_DB$ebnf$2$subexpression$2", "symbols": ["__", "O_ALTER_DB_SPEC"], "postprocess": d => d[1] },
{ "name": "P_ALTER_DB$ebnf$2", "symbols": ["P_ALTER_DB$ebnf$2", "P_ALTER_DB$ebnf$2$subexpression$2"], "postprocess": (d) => d[0].concat([d[1]]) },
{ "name": "P_ALTER_DB", "symbols": [(lexer.has("K_ALTER") ? { type: "K_ALTER" } : K_ALTER), "__", "P_ALTER_DB$subexpression$1", "P_ALTER_DB$ebnf$1", "P_ALTER_DB$ebnf$2", "S_EOS"], "postprocess": d => {
return {
id: 'P_ALTER_DB',
def: {
database: d[3],
meta: d[4]
}
};
} },
{ "name": "O_ALTER_DB_SPEC$subexpression$1$ebnf$1$subexpression$1", "symbols": [(lexer.has("K_DEFAULT") ? { type: "K_DEFAULT" } : K_DEFAULT), "__"] },
{ "name": "O_ALTER_DB_SPEC$subexpression$1$ebnf$1", "symbols": ["O_ALTER_DB_SPEC$subexpression$1$ebnf$1$subexpression$1"], "postprocess": id },
{ "name": "O_ALTER_DB_SPEC$subexpression$1$ebnf$1", "symbols": [], "postprocess": () => null },
{ "name": "O_ALTER_DB_SPEC$subexpression$1$subexpression$1", "symbols": [(lexer.has("K_CHARACTER") ? { type: "K_CHARACTER" } : K_CHARACTER), "__", (lexer.has("K_SET") ? { type: "K_SET" } : K_SET)] },
{ "name": "O_ALTER_DB_SPEC$subexpression$1$subexpression$1", "symbols": [(lexer.has("K_CHARSET") ? { type: "K_CHARSET" } : K_CHARSET)] },
{ "name": "O_ALTER_DB_SPEC$subexpression$1$subexpression$2", "symbols": ["__"] },
{ "name": "O_ALTER_DB_SPEC$subexpression$1$subexpression$2", "symbols": ["_", (lexer.has("S_EQUAL") ? { type: "S_EQUAL" } : S_EQUAL), "_"] },
{ "name": "O_ALTER_DB_SPEC$subexpression$1", "symbols": ["O_ALTER_DB_SPEC$subexpression$1$ebnf$1", "O_ALTER_DB_SPEC$subexpression$1$subexpression$1", "O_ALTER_DB_SPEC$subexpression$1$subexpression$2", "O_CHARSET"], "postprocess": d => {
return {
charset: d[3]
};
} },
{ "name": "O_ALTER_DB_SPEC$subexpression$1$ebnf$2$subexpression$1", "symbols": [(lexer.has("K_DEFAULT") ? { type: "K_DEFAULT" } : K_DEFAULT), "__"] },
{ "name": "O_ALTER_DB_SPEC$subexpression$1$ebnf$2", "symbols": ["O_ALTER_DB_SPEC$subexpression$1$ebnf$2$subexpression$1"], "postprocess": id },
{ "name": "O_ALTER_DB_SPEC$subexpression$1$ebnf$2", "symbols": [], "postprocess": () => null },
{ "name": "O_ALTER_DB_SPEC$subexpression$1$subexpression$3", "symbols": ["__"] },
{ "name": "O_ALTER_DB_SPEC$subexpression$1$subexpression$3", "symbols": ["_", (lexer.has("S_EQUAL") ? { type: "S_EQUAL" } : S_EQUAL), "_"] },
{ "name": "O_ALTER_DB_SPEC$subexpression$1", "symbols": ["O_ALTER_DB_SPEC$subexpression$1$ebnf$2", (lexer.has("K_COLLATE") ? { type: "K_COLLATE" } : K_COLLATE), "O_ALTER_DB_SPEC$subexpression$1$subexpression$3", "O_COLLATION"], "postprocess": d => {
return {
collation: d[3]
};
} },
{ "name": "O_ALTER_DB_SPEC", "symbols": ["O_ALTER_DB_SPEC$subexpression$1"], "postprocess": d => {
return {
id: 'O_ALTER_DB_SPEC',
def: d[0]
};
} },
{ "name": "P_ALTER_TABLE$ebnf$1$subexpression$1", "symbols": [(lexer.has("K_ONLINE") ? { type: "K_ONLINE" } : K_ONLINE), "__"] },
{ "name": "P_ALTER_TABLE$ebnf$1", "symbols": ["P_ALTER_TABLE$ebnf$1$subexpression$1"], "postprocess": id },
{ "name": "P_ALTER_TABLE$ebnf$1", "symbols": [], "postprocess": () => null },
{ "name": "P_ALTER_TABLE$ebnf$2$subexpression$1", "symbols": [(lexer.has("K_IGNORE") ? { type: "K_IGNORE" } : K_IGNORE), "__"] },
{ "name": "P_ALTER_TABLE$ebnf$2", "symbols": ["P_ALTER_TABLE$ebnf$2$subexpression$1"], "postprocess": id },
{ "name": "P_ALTER_TABLE$ebnf$2", "symbols": [], "postprocess": () => null },
{ "name": "P_ALTER_TABLE$ebnf$3$subexpression$1", "symbols": [(lexer.has("K_WAIT") ? { type: "K_WAIT" } : K_WAIT), "__", (lexer.has("S_NUMBER") ? { type: "S_NUMBER" } : S_NUMBER), "__"] },
{ "name": "P_ALTER_TABLE$ebnf$3$subexpression$1", "symbols": [(lexer.has("K_NOWAIT") ? { type: "K_NOWAIT" } : K_NOWAIT), "__"] },
{ "name": "P_ALTER_TABLE$ebnf$3", "symbols": ["P_ALTER_TABLE$ebnf$3$subexpression$1"], "postprocess": id },
{ "name": "P_ALTER_TABLE$ebnf$3", "symbols": [], "postprocess": () => null },
{ "name": "P_ALTER_TABLE$ebnf$4", "symbols": [] },
{ "name": "P_ALTER_TABLE$ebnf$4$subexpression$1", "symbols": ["_", (lexer.has("S_COMMA") ? { type: "S_COMMA" } : S_COMMA), "_", "P_ALTER_TABLE_SPECS"], "postprocess": d => d[3] },
{ "name": "P_ALTER_TABLE$ebnf$4", "symbols": ["P_ALTER_TABLE$ebnf$4", "P_ALTER_TABLE$ebnf$4$subexpression$1"], "postprocess": (d) => d[0].concat([d[1]]) },
{ "name": "P_ALTER_TABLE", "symbols": [(lexer.has("K_ALTER") ? { type: "K_ALTER" } : K_ALTER), "__", "P_ALTER_TABLE$ebnf$1", "P_ALTER_TABLE$ebnf$2", (lexer.has("K_TABLE") ? { type: "K_TABLE" } : K_TABLE), "__", "S_IDENTIFIER", "__", "P_ALTER_TABLE$ebnf$3", "P_ALTER_TABLE_SPECS", "P_ALTER_TABLE$ebnf$4", "S_EOS"], "postprocess": d => {
return {
id: 'P_ALTER_TABLE',
def: {
table: d[6],
specs: [d[9]].concat(d[10])
}
};
} },
{ "name": "P_ALTER_TABLE_SPECS$subexpression$1", "symbols": ["P_CREATE_TABLE_OPTIONS"], "postprocess": d => {
return { tableOptions: d[0] };
} },
{ "name": "P_ALTER_TABLE_SPECS$subexpression$1", "symbols": ["O_ALTER_TABLE_SPEC"], "postprocess": d => {
return { spec: d[0] };
} },
{ "name": "P_ALTER_TABLE_SPECS", "symbols": ["P_ALTER_TABLE_SPECS$subexpression$1"], "postprocess": d => {
return {
id: 'P_ALTER_TABLE_SPECS',
def: d[0]
};
} },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$1$subexpression$1", "symbols": ["__", (lexer.has("K_COLUMN") ? { type: "K_COLUMN" } : K_COLUMN)] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$1", "symbols": ["O_ALTER_TABLE_SPEC$subexpression$1$ebnf$1$subexpression$1"], "postprocess": id },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$1", "symbols": [], "postprocess": () => null },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$2", "symbols": [] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$2$subexpression$1", "symbols": ["__", "O_COLUMN_DEFINITION"], "postprocess": d => d[1] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$2", "symbols": ["O_ALTER_TABLE_SPEC$subexpression$1$ebnf$2", "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$2$subexpression$1"], "postprocess": (d) => d[0].concat([d[1]]) },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$3$subexpression$1", "symbols": ["__", "P_COLUMN_REFERENCE"], "postprocess": d => d[1] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$3", "symbols": ["O_ALTER_TABLE_SPEC$subexpression$1$ebnf$3$subexpression$1"], "postprocess": id },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$3", "symbols": [], "postprocess": () => null },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$4$subexpression$1", "symbols": ["__", (lexer.has("K_FIRST") ? { type: "K_FIRST" } : K_FIRST)], "postprocess": d => { return { after: null }; } },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$4$subexpression$1", "symbols": ["__", (lexer.has("K_AFTER") ? { type: "K_AFTER" } : K_AFTER), "__", "S_IDENTIFIER"], "postprocess": d => { return { after: d[3] }; } },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$4", "symbols": ["O_ALTER_TABLE_SPEC$subexpression$1$ebnf$4$subexpression$1"], "postprocess": id },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$4", "symbols": [], "postprocess": () => null },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1", "symbols": [(lexer.has("K_ADD") ? { type: "K_ADD" } : K_ADD), "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$1", "__", "S_IDENTIFIER", "__", "O_DATATYPE", "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$2", "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$3", "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$4"], "postprocess": d => {
const obj = {
action: 'addColumn',
name: d[3],
datatype: d[5],
columnDefinition: d[6] ?? [],
position: d[8],
};
if (d[7]) {
obj.reference = d[7];
}
return obj;
} },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$5$subexpression$1", "symbols": ["__", (lexer.has("K_COLUMN") ? { type: "K_COLUMN" } : K_COLUMN)] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$5", "symbols": ["O_ALTER_TABLE_SPEC$subexpression$1$ebnf$5$subexpression$1"], "postprocess": id },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$5", "symbols": [], "postprocess": () => null },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$1", "symbols": [] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$1$subexpression$1", "symbols": ["__", "O_COLUMN_DEFINITION"], "postprocess": d => d[1] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$1", "symbols": ["O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$1", "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$1$subexpression$1"], "postprocess": (d) => d[0].concat([d[1]]) },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$2$subexpression$1", "symbols": ["__", "P_COLUMN_REFERENCE"], "postprocess": d => d[1] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$2", "symbols": ["O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$2$subexpression$1"], "postprocess": id },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$2", "symbols": [], "postprocess": () => null },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3", "symbols": [] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3$subexpression$1$ebnf$1", "symbols": [] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3$subexpression$1$ebnf$1$subexpression$1", "symbols": ["__", "O_COLUMN_DEFINITION"], "postprocess": d => d[1] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3$subexpression$1$ebnf$1", "symbols": ["O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3$subexpression$1$ebnf$1", "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3$subexpression$1$ebnf$1$subexpression$1"], "postprocess": (d) => d[0].concat([d[1]]) },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3$subexpression$1$ebnf$2$subexpression$1", "symbols": ["__", "P_COLUMN_REFERENCE"], "postprocess": d => d[1] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3$subexpression$1$ebnf$2", "symbols": ["O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3$subexpression$1$ebnf$2$subexpression$1"], "postprocess": id },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3$subexpression$1$ebnf$2", "symbols": [], "postprocess": () => null },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3$subexpression$1", "symbols": ["_", (lexer.has("S_COMMA") ? { type: "S_COMMA" } : S_COMMA), "_", "S_IDENTIFIER", "__", "O_DATATYPE", "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3$subexpression$1$ebnf$1", "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3$subexpression$1$ebnf$2"], "postprocess": d => {
const obj = {
name: d[3],
datatype: d[5],
columnDefinition: d[6] ?? [],
};
if (d[7]) {
obj.reference = d[7];
}
return obj;
} },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3", "symbols": ["O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3", "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3$subexpression$1"], "postprocess": (d) => d[0].concat([d[1]]) },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1", "symbols": ["S_IDENTIFIER", "__", "O_DATATYPE", "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$1", "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$2", "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1$ebnf$3"], "postprocess": d => {
const obj = {
name: d[0],
datatype: d[2],
columnDefinition: d[3] ?? [],
};
if (d[4]) {
obj.reference = d[4];
}
return [obj].concat(d[5] ?? []);
} },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1", "symbols": [(lexer.has("K_ADD") ? { type: "K_ADD" } : K_ADD), "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$5", "_", (lexer.has("S_LPARENS") ? { type: "S_LPARENS" } : S_LPARENS), "_", "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$1", "_", (lexer.has("S_RPARENS") ? { type: "S_RPARENS" } : S_RPARENS)], "postprocess": d => {
return {
action: 'addColumns',
columns: d[5]
};
} },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$2", "symbols": [(lexer.has("K_INDEX") ? { type: "K_INDEX" } : K_INDEX)] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$subexpression$2", "symbols": [(lexer.has("K_KEY") ? { type: "K_KEY" } : K_KEY)] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$6$subexpression$1", "symbols": ["__", "S_IDENTIFIER"], "postprocess": d => d[1] },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$6", "symbols": ["O_ALTER_TABLE_SPEC$subexpression$1$ebnf$6$subexpression$1"], "postprocess": id },
{ "name": "O_ALTER_TABLE_SPEC$subexpression$1$ebnf$6", "symbols": [], "postprocess": () =