UNPKG

alasql

Version:

AlaSQL.js - JavaScript SQL database library for relational and graph data manipulation with support of localStorage, IndexedDB, and Excel

824 lines (779 loc) 586 kB
// // alasql.js // AlaSQL - JavaScript SQL database // Date: 11.05.2015 // Version: 0.1.4 // (ñ) 2014-2015, Andrey Gershun // /* The MIT License (MIT) Copyright (c) 2014-2015 Andrey Gershun (agershun@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** UMD envelope */ (function (root, factory) { if (typeof define === 'function' && define.amd) { define([], factory); } else if (typeof exports === 'object') { module.exports = factory(); } else { root.alasql = factory(); } }(this, function () { /** alasql - Main Alasql class @param {string | Object} sql SQL-statement or data object for fuent interface @param {Object} params SQL parameters @param {Function} cb callback function @param {Object} scope Scope for nested queries @return {array} Result data object Standard sync call: alasql('CREATE TABLE one'); Query: var res = alasql('SELECT * FROM one'); Call with parameters: var res = alasql('SELECT * FROM ?',[data]); Standard async call with callback function: alasql('SELECT * FROM ?',[data],function(res){ console.log(data); }); Call with scope for subquery (to pass common values): var scope = {one:{a:2,b;20}} alasql('SELECT * FROM ? two WHERE two.a = one.a',[data],null,scope); Call for fluent interface with data object: alasql(data).Where(function(x){return x.a == 10}).exec(); Call for fluent interface without data object: alasql().From(data).Where(function(x){return x.a == 10}).exec(); */ var alasql = function(sql, params, cb, scope) { if(typeof importScripts != 'function' && alasql.webworker) { var id = alasql.lastid++; alasql.buffer[id] = cb; alasql.webworker.postMessage({id:id,sql:sql,params:params}); } else { if(arguments.length == 0) { // Without arguments - Fluent interface return new yy.Select({ columns:[new yy.Column({columnid:'*'})], from: [new yy.ParamValue({param:0})] }); } else if (arguments.length == 1 && typeof sql == "object" && sql instanceof Array) { // One argument data object - fluent interface var select = new yy.Select({ columns:[new yy.Column({columnid:'*'})], from: [new yy.ParamValue({param:0})] }); select.preparams = [sql]; return select; } else { // Standard interface // alasql('#sql'); if(typeof sql == 'string' && sql[0]=='#' && typeof document == "object") { sql = document.querySelector(sql).textContent; } else if(typeof sql == 'object' && sql instanceof HTMElement) { sql = sql.textContent; } else if(typeof sql == 'function') { // to run multiline functions sql = sql.toString().slice(14,-3); } // Run SQL return alasql.exec(sql, params, cb, scope); } }; }; /** Current version of alasql */ alasql.version = "0.1.4"; /* parser generated by jison 0.4.15 */ /* Returns a Parser object of the following structure: Parser: { yy: {} } Parser.prototype: { yy: {}, trace: function(), symbols_: {associative list: name ==> number}, terminals_: {associative list: number ==> name}, productions_: [...], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), table: [...], defaultActions: {...}, parseError: function(str, hash), parse: function(input), lexer: { EOF: 1, parseError: function(str, hash), setInput: function(input), input: function(), unput: function(str), more: function(), less: function(n), pastInput: function(), upcomingInput: function(), showPosition: function(), test_match: function(regex_match_array, rule_index), next: function(), lex: function(), begin: function(condition), popState: function(), _currentRules: function(), topState: function(), pushState: function(condition), options: { ranges: boolean (optional: true ==> token location info will include a .range[] member) flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) }, performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), rules: [...], conditions: {associative list: name ==> set}, } } token location info (@$, _$, etc.): { first_line: n, last_line: n, first_column: n, last_column: n, range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } the parseError function receives a 'hash' object with these members for lexer and parser errors: { text: (matched text) token: (the produced terminal token, if any) line: (yylineno) } while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { loc: (yylloc) expected: (string describing the set of expected tokens) recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } */ var parser = (function(){ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[2,11],$V1=[1,6],$V2=[1,38],$V3=[1,65],$V4=[1,63],$V5=[1,82],$V6=[1,52],$V7=[1,84],$V8=[1,74],$V9=[1,72],$Va=[1,57],$Vb=[1,60],$Vc=[1,55],$Vd=[1,59],$Ve=[1,53],$Vf=[1,61],$Vg=[1,54],$Vh=[1,58],$Vi=[1,71],$Vj=[1,66],$Vk=[1,73],$Vl=[1,75],$Vm=[1,76],$Vn=[1,69],$Vo=[1,70],$Vp=[1,68],$Vq=[1,77],$Vr=[1,78],$Vs=[1,79],$Vt=[1,80],$Vu=[1,81],$Vv=[1,56],$Vw=[1,67],$Vx=[1,64],$Vy=[1,86],$Vz=[1,87],$VA=[8,9,11,259],$VB=[8,9,11,259,263],$VC=[1,144],$VD=[1,145],$VE=[1,107],$VF=[1,117],$VG=[1,120],$VH=[1,115],$VI=[1,123],$VJ=[1,127],$VK=[1,124],$VL=[1,112],$VM=[1,114],$VN=[1,116],$VO=[1,125],$VP=[1,109],$VQ=[1,134],$VR=[1,130],$VS=[1,131],$VT=[1,135],$VU=[1,136],$VV=[1,137],$VW=[1,138],$VX=[1,139],$VY=[1,140],$VZ=[1,141],$V_=[1,142],$V$=[1,143],$V01=[1,118],$V11=[1,119],$V21=[1,121],$V31=[1,122],$V41=[1,128],$V51=[1,126],$V61=[1,129],$V71=[1,113],$V81=[1,133],$V91=[1,146],$Va1=[101,300,359],$Vb1=[1,156],$Vc1=[1,155],$Vd1=[1,161],$Ve1=[4,5],$Vf1=[8,9,11,68,90,100,130,136,137,149,151,170,199,259,263],$Vg1=[4,5,8,9,11,62,66,67,68,87,90,94,95,100,101,102,103,104,105,106,107,108,109,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,149,157,159,170,239,240,241,242,243,244,245,246,247,259,263,365,369],$Vh1=[1,181],$Vi1=[1,189],$Vj1=[1,188],$Vk1=[4,5,8,9,11,48,62,64,66,67,68,78,82,87,90,94,95,100,101,102,103,104,105,106,107,108,109,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,145,146,147,149,151,157,159,160,170,178,180,188,189,190,191,192,193,194,195,199,207,210,211,227,239,240,241,242,243,244,245,246,247,251,259,261,262,263,264,265,266,267,268,269,270,271,272,273,276,278,279,280,281,283,285,286,294,344,347,348,351,353,355,356,360,362,363,365,369,379,381,382,384,385,386,387,388,390,393,394,406,412],$Vl1=[1,213],$Vm1=[1,220],$Vn1=[4,5,67,102,103,108,112,115,120,122,145,146,147,226,227,228,229,231,239,240,241,242,243,244,245,246,247,249,250,251,252,253,255,256,265,365,369],$Vo1=[2,138],$Vp1=[1,234],$Vq1=[4,5,67,102,103,108,112,115,120,122,132,145,146,147,157,159,167,226,227,228,229,231,239,240,241,242,243,244,245,246,247,249,250,251,252,253,255,256,265,365,369],$Vr1=[1,246],$Vs1=[1,254],$Vt1=[1,260],$Vu1=[1,251],$Vv1=[1,255],$Vw1=[1,252],$Vx1=[1,256],$Vy1=[1,258],$Vz1=[1,270],$VA1=[1,267],$VB1=[1,268],$VC1=[1,248],$VD1=[1,250],$VE1=[1,247],$VF1=[1,249],$VG1=[1,253],$VH1=[1,257],$VI1=[1,259],$VJ1=[1,261],$VK1=[1,262],$VL1=[1,263],$VM1=[1,264],$VN1=[1,265],$VO1=[1,269],$VP1=[1,271],$VQ1=[1,272],$VR1=[1,273],$VS1=[1,274],$VT1=[2,258],$VU1=[1,283],$VV1=[4,5,8,9,11,48,62,64,66,67,68,78,82,87,90,94,95,100,101,102,103,104,105,106,107,108,109,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,145,146,147,149,151,157,159,160,170,178,180,188,189,190,191,192,193,194,195,199,207,210,211,227,239,240,241,242,243,244,245,246,247,251,252,259,261,262,263,264,265,266,267,268,269,270,271,272,273,276,278,279,280,281,283,285,286,290,294,304,318,319,323,324,343,344,347,348,351,353,355,356,360,362,363,365,369,371,373,379,381,382,384,385,386,387,388,390,393,394,406,412],$VW1=[2,319],$VX1=[4,5,8,9,11,48,62,64,66,67,68,78,82,87,90,94,95,100,101,102,103,104,105,106,107,108,109,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,145,146,147,149,151,157,159,160,170,178,180,188,189,190,191,192,193,194,195,196,197,199,207,210,211,227,239,240,241,242,243,244,245,246,247,251,252,259,261,262,263,264,265,266,267,268,269,270,271,272,273,276,278,279,280,281,283,285,286,290,294,304,318,319,323,324,343,344,347,348,351,353,355,356,360,362,363,365,369,371,373,379,381,382,384,385,386,387,388,390,393,394,406,412],$VY1=[1,294],$VZ1=[1,304],$V_1=[4,5,8,9,11,48,62,64,66,67,68,78,82,87,90,94,95,100,101,102,103,104,105,106,107,108,109,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,145,146,147,149,151,157,159,160,170,178,180,188,189,190,191,192,193,194,195,199,207,210,211,227,239,240,241,242,243,244,245,246,247,251,259,261,262,263,264,265,266,267,268,269,270,271,272,273,276,278,279,280,281,283,285,286,294,344,347,348,351,353,355,356,360,362,363,365,369,371,373,379,381,382,384,385,386,387,388,390,393,394,406,412],$V$1=[1,320],$V02=[4,5,8,9,11,48,62,64,66,67,68,78,82,87,90,94,95,100,101,102,103,104,105,106,107,108,109,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,145,146,147,149,151,157,159,160,165,170,178,180,188,189,190,191,192,193,194,195,196,197,199,207,210,211,227,239,240,241,242,243,244,245,246,247,251,252,259,261,262,263,264,265,266,267,268,269,270,271,272,273,276,278,279,280,281,283,285,286,288,290,294,303,304,305,318,319,320,323,324,335,337,343,344,347,348,349,350,351,352,353,355,356,357,360,362,363,365,369,371,373,378,379,381,382,384,385,386,387,388,390,393,394,406,412],$V12=[1,328],$V22=[1,327],$V32=[2,439],$V42=[1,333],$V52=[8,9,11,64,66,103,108,110,120,259,263,365,369],$V62=[2,736],$V72=[1,345],$V82=[8,9,11,68,78,103,108,117,160,251,259,263,412],$V92=[8,9,11,64,259,263],$Va2=[2,497],$Vb2=[1,359],$Vc2=[4,5,124],$Vd2=[8,9,11,68,90,100,130,136,137,149,151,199,259,263],$Ve2=[2,139],$Vf2=[1,367],$Vg2=[4,5,87],$Vh2=[1,378],$Vi2=[1,395],$Vj2=[1,377],$Vk2=[1,376],$Vl2=[1,373],$Vm2=[1,374],$Vn2=[1,375],$Vo2=[1,379],$Vp2=[1,380],$Vq2=[1,381],$Vr2=[1,382],$Vs2=[1,383],$Vt2=[1,384],$Vu2=[1,385],$Vv2=[1,386],$Vw2=[1,387],$Vx2=[1,388],$Vy2=[1,389],$Vz2=[1,390],$VA2=[1,391],$VB2=[1,392],$VC2=[1,394],$VD2=[1,396],$VE2=[1,397],$VF2=[1,398],$VG2=[1,399],$VH2=[1,400],$VI2=[1,401],$VJ2=[1,404],$VK2=[1,405],$VL2=[1,406],$VM2=[1,407],$VN2=[1,408],$VO2=[1,409],$VP2=[1,410],$VQ2=[1,411],$VR2=[1,412],$VS2=[1,413],$VT2=[1,414],$VU2=[8,9,11,64,68,90,100,130,136,137,151,178,180,188,189,190,191,192,193,194,195,196,197,199,259,263],$VV2=[2,175],$VW2=[1,429],$VX2=[64,78,160],$VY2=[8,9,11,64,68,122,159,252,259,263,290,304,318,319,323,324,343],$VZ2=[132,134,282],$V_2=[1,498],$V$2=[1,504],$V03=[1,505],$V13=[1,520],$V23=[4,5,8,9,11,48,62,64,66,67,68,78,82,87,90,95,100,101,102,103,105,106,108,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,145,147,149,151,157,159,160,170,178,180,188,189,190,191,192,193,194,195,199,207,210,211,227,239,240,241,242,243,244,245,246,247,251,259,261,262,263,264,265,267,268,269,270,271,272,273,276,278,279,280,281,283,285,286,294,344,347,348,351,353,355,356,360,362,363,365,369,379,381,382,384,385,386,387,388,390,393,394,406,412],$V33=[2,334],$V43=[1,527],$V53=[259,261,263],$V63=[64,373],$V73=[64,371,373],$V83=[1,534],$V93=[4,5,8,9,11,48,62,64,66,68,78,82,87,90,94,95,100,101,102,103,104,105,106,107,108,109,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,145,146,147,149,151,157,159,160,170,178,180,188,189,190,191,192,193,194,195,199,207,210,211,227,239,240,241,242,243,244,245,246,247,251,259,261,262,263,264,265,266,267,268,269,270,271,272,273,276,278,279,280,281,283,285,286,294,344,347,348,351,353,355,356,360,362,363,365,369,379,381,382,384,385,386,387,388,390,393,394,406,412],$Va3=[64,371],$Vb3=[4,5,103,251],$Vc3=[8,9,11,64,66,259,263],$Vd3=[8,9,11,64,66,103,110,115,120,259,263,365,369],$Ve3=[8,9,11,68,78,103,117,160,251,259,263,412],$Vf3=[8,9,11,68,90,100,130,136,137,151,199,259,263],$Vg3=[1,589],$Vh3=[8,9,11,68,259,263],$Vi3=[1,595],$Vj3=[1,596],$Vk3=[1,597],$Vl3=[4,5,8,9,11,62,64,66,67,68,87,90,94,95,100,101,102,103,104,105,106,107,108,109,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,145,146,147,149,157,159,170,239,240,241,242,243,244,245,246,247,259,263,365,369],$Vm3=[8,9,11,68,82,90,100,130,136,137,149,151,170,199,259,263],$Vn3=[1,661],$Vo3=[8,9,11,64,68,82,90,100,130,136,137,149,151,170,199,259,263],$Vp3=[4,5,8,9,11,48,62,64,66,67,68,78,82,87,90,95,100,101,102,103,105,106,108,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,147,149,151,157,159,160,170,178,180,188,189,190,191,192,193,194,195,199,207,210,211,227,239,240,241,242,243,244,245,246,247,251,259,261,262,263,264,267,268,269,270,271,272,273,276,278,279,280,281,283,285,286,294,344,347,348,351,353,355,356,360,362,363,365,369,379,381,382,384,385,386,387,388,390,393,394,406,412],$Vq3=[4,5,8,9,11,48,62,64,66,67,68,78,82,87,90,95,100,101,102,103,104,105,106,108,109,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,145,146,147,149,151,157,159,160,170,178,180,188,189,190,191,192,193,194,195,199,207,210,211,227,239,240,241,242,243,244,245,246,247,251,259,261,262,263,264,265,267,268,269,270,271,272,273,276,278,279,280,281,283,285,286,294,344,347,348,351,353,355,356,360,362,363,365,369,379,381,382,384,385,386,387,388,390,393,394,406,412],$Vr3=[4,5,8,9,11,48,62,64,66,67,68,78,82,90,95,100,101,102,103,105,106,108,110,111,112,113,115,116,117,119,120,124,130,132,134,136,137,138,139,140,141,147,149,151,157,159,160,170,178,180,188,189,190,191,192,193,194,195,199,207,210,211,227,239,240,241,242,243,244,245,246,247,251,259,261,262,263,267,268,269,270,271,272,273,278,279,281,283,285,286,294,344,347,348,351,353,355,356,360,362,363,365,369,379,381,382,384,385,386,387,388,390,393,394,406,412],$Vs3=[4,5,8,9,11,48,62,64,66,67,68,78,82,90,100,101,102,103,105,106,108,112,113,115,116,117,119,120,124,130,132,134,136,137,139,140,141,147,149,151,157,159,160,170,178,180,188,189,190,191,192,193,194,195,199,207,210,211,227,239,240,241,242,243,244,245,246,247,251,259,261,262,263,278,279,281,283,285,286,294,344,347,348,351,353,355,356,360,362,363,365,369,379,381,382,384,385,386,387,388,390,393,394,406,412],$Vt3=[1,681],$Vu3=[8,9,11,64,68,259,263],$Vv3=[2,256],$Vw3=[1,718],$Vx3=[8,9,11,64,66,110,115,120,259,263,365,369],$Vy3=[8,9,11,64,110,259,263],$Vz3=[8,9,11,68,78,117,160,259,263,412],$VA3=[1,736],$VB3=[8,9,11,68,90,130,136,137,151,199,259,263],$VC3=[8,9,11,64,68,90,100,130,136,137,149,151,170,199,259,263],$VD3=[4,5,62,66,67,68,87,90,94,95,100,101,102,103,104,105,106,107,108,109,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,157,159,239,240,241,242,243,244,245,246,247,365,369],$VE3=[4,5,62,64,66,67,68,87,90,94,95,100,101,102,103,104,105,106,107,108,109,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,157,159,239,240,241,242,243,244,245,246,247,365,369],$VF3=[2,694],$VG3=[1,781],$VH3=[1,792],$VI3=[8,9,11,64,68,100,259,261,263,406],$VJ3=[1,800],$VK3=[1,799],$VL3=[2,297],$VM3=[1,822],$VN3=[2,514],$VO3=[1,844],$VP3=[66,110],$VQ3=[8,9,11,64,66,110,115,259,263,365,369],$VR3=[2,642],$VS3=[1,859],$VT3=[1,860],$VU3=[1,864],$VV3=[8,9,11,64,68,259,261,263,406],$VW3=[1,867],$VX3=[8,9,11,64,68,90,100,130,136,137,151,178,180,188,189,190,191,192,193,194,195,199,259,263],$VY3=[8,9,11,68,90,130,136,137,151,259,263],$VZ3=[1,872],$V_3=[1,876],$V$3=[1,877],$V04=[1,879],$V14=[1,880],$V24=[1,881],$V34=[1,882],$V44=[1,883],$V54=[1,884],$V64=[1,885],$V74=[1,886],$V84=[1,909],$V94=[64,68],$Va4=[8,9,11,259,261,263,406],$Vb4=[94,95],$Vc4=[1,948],$Vd4=[8,9,11,68,130,136,137,151,259,263],$Ve4=[8,9,11,68,90,100,130,136,137,151,178,180,188,189,190,191,192,193,194,195,199,259,263],$Vf4=[1,998],$Vg4=[1,1000],$Vh4=[4,5,67,112,115,120,147,255],$Vi4=[1,1014],$Vj4=[8,9,11,64,68,130,136,137,151,259,263],$Vk4=[4,5,8,9,11,48,62,64,66,67,68,78,82,87,90,94,95,100,101,102,103,104,105,106,107,108,109,110,111,112,113,115,116,117,119,120,122,124,130,132,134,136,137,138,139,140,141,145,146,147,149,151,157,159,160,170,178,180,188,189,190,191,192,193,194,195,199,207,210,211,227,239,240,241,242,243,244,245,246,247,251,252,259,261,262,263,264,265,266,267,268,269,270,271,272,273,276,278,279,280,281,283,285,286,290,294,304,318,319,323,324,343,344,347,348,351,353,355,356,360,362,363,365,369,379,381,382,384,385,386,387,388,390,393,394,406,412],$Vl4=[1,1030],$Vm4=[1,1044],$Vn4=[1,1046],$Vo4=[1,1043],$Vp4=[1,1042],$Vq4=[1,1040],$Vr4=[1,1047],$Vs4=[1,1037],$Vt4=[1,1038],$Vu4=[1,1039],$Vv4=[1,1041],$Vw4=[8,9,11,68,130,136,137,259,263],$Vx4=[1,1065],$Vy4=[1,1066],$Vz4=[1,1067],$VA4=[8,9,11,68,90,100,130,136,137,151,178,180,188,189,190,191,192,193,194,195,196,197,199,259,263],$VB4=[1,1093],$VC4=[1,1092],$VD4=[1,1124],$VE4=[1,1125],$VF4=[1,1126],$VG4=[1,1127],$VH4=[159,165,318,319,320,323],$VI4=[2,451],$VJ4=[1,1132],$VK4=[1,1142],$VL4=[8,9,11,64,68,90,130,136,137,151,207,259,263],$VM4=[1,1162],$VN4=[1,1172],$VO4=[8,9,11,259,263,290,303,304,305],$VP4=[1,1283],$VQ4=[1,1293],$VR4=[64,68,196]; var parser = {trace: function trace() { }, yy: {}, symbols_: {"error":2,"Literal":3,"LITERAL":4,"BRALITERAL":5,"main":6,"Statements":7,"EOF":8,"SEMICOLON":9,"AStatement":10,"GO":11,"ExplainStatement":12,"EXPLAIN":13,"QUERY":14,"PLAN":15,"Statement":16,"If":17,"AlterTable":18,"AttachDatabase":19,"CreateDatabase":20,"CreateIndex":21,"CreateGraph":22,"CreateTable":23,"CreateView":24,"CreateEdge":25,"CreateVertex":26,"Declare":27,"Delete":28,"DetachDatabase":29,"DropDatabase":30,"DropIndex":31,"DropTable":32,"DropView":33,"Insert":34,"RenameTable":35,"Select":36,"Merge":37,"WithSelect":38,"ShowCreateTable":39,"ShowColumns":40,"ShowDatabases":41,"ShowIndex":42,"ShowTables":43,"TruncateTable":44,"BeginTransaction":45,"CommitTransaction":46,"RollbackTransaction":47,"EndTransaction":48,"UseDatabase":49,"Update":50,"Help":51,"JavaScript":52,"Source":53,"Assert":54,"While":55,"Continue":56,"Break":57,"BeginEnd":58,"Print":59,"Require":60,"SetVariable":61,"WITH":62,"WithTablesList":63,"COMMA":64,"WithTable":65,"AS":66,"LPAR":67,"RPAR":68,"SelectClause":69,"Select_option0":70,"IntoClause":71,"FromClause":72,"WhereClause":73,"GroupClause":74,"OrderClause":75,"LimitClause":76,"UnionClause":77,"SEARCH":78,"Select_repetition0":79,"Select_option1":80,"RemoveClause":81,"REMOVE":82,"RemoveClause_option0":83,"RemoveColumnsList":84,"RemoveColumn":85,"Column":86,"LIKE":87,"StringValue":88,"SearchSelector":89,"ORDER":90,"BY":91,"OrderExpressionsList":92,"SearchSelector_option0":93,"ARROW":94,"EQ":95,"Expression":96,"SearchSelector_repetition_plus0":97,"SearchSelector_repetition_plus1":98,"SearchSelector_option1":99,"WHERE":100,"CLASS":101,"NUMBER":102,"STRING":103,"SLASH":104,"VERTEX":105,"EDGE":106,"EXCLAMATION":107,"SHARP":108,"MODULO":109,"GT":110,"LT":111,"DOLLAR":112,"DOT":113,"Json":114,"AT":115,"TO":116,"SET":117,"SetColumnsList":118,"VALUE":119,"COLON":120,"PlusStar":121,"NOT":122,"SearchSelector_repetition2":123,"IF":124,"SearchSelector_repetition3":125,"Aggregator":126,"SearchSelector_repetition4":127,"SearchSelector_group0":128,"SearchSelector_repetition5":129,"UNION":130,"SearchSelectorList":131,"ALL":132,"SearchSelector_repetition6":133,"ANY":134,"SearchSelector_repetition7":135,"INTERSECT":136,"EXCEPT":137,"AND":138,"OR":139,"PATH":140,"RETURNS":141,"ResultColumns":142,"SearchSelectorList_repetition0":143,"SearchSelectorList_repetition1":144,"PLUS":145,"STAR":146,"QUESTION":147,"SearchFrom":148,"FROM":149,"SearchLimit":150,"LIMIT":151,"SearchStrategy":152,"STRATEGY":153,"SearchTimeout":154,"TIMEOUT":155,"SelectModifier":156,"DISTINCT":157,"TopClause":158,"UNIQUE":159,"SELECT":160,"ROW":161,"COLUMN":162,"MATRIX":163,"TEXTSTRING":164,"INDEX":165,"RECORDSET":166,"TOP":167,"NumValue":168,"PERCENT":169,"INTO":170,"Table":171,"FuncValue":172,"ParamValue":173,"VarValue":174,"FromTablesList":175,"JoinTablesList":176,"ApplyClause":177,"CROSS":178,"APPLY":179,"OUTER":180,"FromTable":181,"FromString":182,"JoinTable":183,"JoinMode":184,"JoinTableAs":185,"OnClause":186,"JoinModeMode":187,"NATURAL":188,"JOIN":189,"INNER":190,"LEFT":191,"RIGHT":192,"FULL":193,"SEMI":194,"ANTI":195,"ON":196,"USING":197,"ColumnsList":198,"GROUP":199,"GroupExpressionsList":200,"HavingClause":201,"GroupExpression":202,"GROUPING":203,"SETS":204,"ROLLUP":205,"CUBE":206,"HAVING":207,"CORRESPONDING":208,"OrderExpression":209,"DIRECTION":210,"COLLATE":211,"NOCASE":212,"OffsetClause":213,"OFFSET":214,"ResultColumn":215,"Star":216,"AggrValue":217,"Op":218,"LogicValue":219,"NullValue":220,"ExistsValue":221,"CaseValue":222,"CastClause":223,"NewClause":224,"Expression_group0":225,"CURRENT_TIMESTAMP":226,"JAVASCRIPT":227,"NEW":228,"CAST":229,"ColumnType":230,"CONVERT":231,"PrimitiveValue":232,"ExprList":233,"OverClause":234,"OVER":235,"OverPartitionClause":236,"OverOrderByClause":237,"PARTITION":238,"SUM":239,"COUNT":240,"MIN":241,"MAX":242,"AVG":243,"FIRST":244,"LAST":245,"AGGR":246,"ARRAY":247,"FuncValue_option0":248,"TRUE":249,"FALSE":250,"NSTRING":251,"NULL":252,"EXISTS":253,"ParamValue_group0":254,"BRAQUESTION":255,"CASE":256,"WhensList":257,"ElseClause":258,"END":259,"When":260,"WHEN":261,"THEN":262,"ELSE":263,"NOT_LIKE":264,"MINUS":265,"CARET":266,"GE":267,"LE":268,"EQEQ":269,"EQEQEQ":270,"NE":271,"NEEQEQ":272,"NEEQEQEQ":273,"CondOp":274,"AllSome":275,"IN":276,"ColFunc":277,"BETWEEN":278,"NOT_BETWEEN":279,"IS":280,"DOUBLECOLON":281,"SOME":282,"UPDATE":283,"SetColumn":284,"DELETE":285,"INSERT":286,"Into":287,"VALUES":288,"ValuesListsList":289,"DEFAULT":290,"ValuesList":291,"Value":292,"DateValue":293,"CREATE":294,"TemporaryClause":295,"TableClass":296,"IfNotExists":297,"CreateTableDefClause":298,"CreateTableOptionsClause":299,"TABLE":300,"CreateTableOptions":301,"CreateTableOption":302,"ENGINE":303,"AUTO_INCREMENT":304,"CHARSET":305,"TEMPORARY":306,"TEMP":307,"ColumnDefsList":308,"ConstraintsList":309,"Constraint":310,"ConstraintName":311,"PrimaryKey":312,"ForeignKey":313,"UniqueKey":314,"IndexKey":315,"Check":316,"CONSTRAINT":317,"CHECK":318,"PRIMARY":319,"KEY":320,"PrimaryKey_option0":321,"ColsList":322,"FOREIGN":323,"REFERENCES":324,"ForeignKey_option0":325,"OnForeignKeyClause":326,"ParColsList":327,"OnDeleteClause":328,"OnUpdateClause":329,"NO":330,"ACTION":331,"UniqueKey_option0":332,"ColumnDef":333,"ColumnConstraintsClause":334,"ColumnConstraints":335,"NumberMax":336,"ENUM":337,"ColumnConstraintsList":338,"ColumnConstraint":339,"ParLiteral":340,"ColumnConstraint_option0":341,"ColumnConstraint_option1":342,"IDENTITY":343,"DROP":344,"DropTable_group0":345,"IfExists":346,"ALTER":347,"RENAME":348,"ADD":349,"MODIFY":350,"ATTACH":351,"DATABASE":352,"DETACH":353,"AsClause":354,"USE":355,"SHOW":356,"DATABASES":357,"TABLES":358,"VIEW":359,"HELP":360,"ExpressionStatement":361,"SOURCE":362,"ASSERT":363,"JsonObject":364,"ATLBRA":365,"JsonArray":366,"JsonValue":367,"JsonPrimitiveValue":368,"LCUR":369,"JsonPropertiesList":370,"RCUR":371,"JsonElementsList":372,"RBRA":373,"JsonProperty":374,"OnOff":375,"SetPropsList":376,"SetProp":377,"OFF":378,"COMMIT":379,"TRANSACTION":380,"ROLLBACK":381,"BEGIN":382,"ElseStatement":383,"WHILE":384,"CONTINUE":385,"BREAK":386,"PRINT":387,"REQUIRE":388,"StringValuesList":389,"DECLARE":390,"DeclaresList":391,"DeclareItem":392,"TRUNCATE":393,"MERGE":394,"MergeInto":395,"MergeUsing":396,"MergeOn":397,"MergeMatchedList":398,"OutputClause":399,"MergeMatched":400,"MergeNotMatched":401,"MATCHED":402,"MergeMatchedAction":403,"MergeNotMatchedAction":404,"TARGET":405,"OUTPUT":406,"CreateVertex_option0":407,"CreateVertex_option1":408,"CreateVertex_option2":409,"CreateVertexSet":410,"SharpValue":411,"CONTENT":412,"CreateEdge_option0":413,"GRAPH":414,"GraphList":415,"GraphVertexEdge":416,"GraphElement":417,"GraphVertexEdge_option0":418,"GraphVertexEdge_option1":419,"GraphVertexEdge_group0":420,"GraphVertexEdge_option2":421,"GraphVertexEdge_option3":422,"GraphVertexEdge_group1":423,"GraphVar":424,"GraphAsClause":425,"GraphAtClause":426,"GraphElement_option0":427,"GraphElement_option1":428,"GraphElement_option2":429,"GraphElement_option3":430,"ColonLiteral":431,"SharpLiteral":432,"DeleteVertex":433,"DeleteVertex_option0":434,"DeleteEdge":435,"DeleteEdge_option0":436,"DeleteEdge_option1":437,"DeleteEdge_option2":438,"FuncValue_option0_group0":439,"$accept":0,"$end":1}, terminals_: {2:"error",4:"LITERAL",5:"BRALITERAL",8:"EOF",9:"SEMICOLON",11:"GO",13:"EXPLAIN",14:"QUERY",15:"PLAN",48:"EndTransaction",62:"WITH",64:"COMMA",66:"AS",67:"LPAR",68:"RPAR",78:"SEARCH",82:"REMOVE",87:"LIKE",90:"ORDER",91:"BY",94:"ARROW",95:"EQ",100:"WHERE",101:"CLASS",102:"NUMBER",103:"STRING",104:"SLASH",105:"VERTEX",106:"EDGE",107:"EXCLAMATION",108:"SHARP",109:"MODULO",110:"GT",111:"LT",112:"DOLLAR",113:"DOT",115:"AT",116:"TO",117:"SET",119:"VALUE",120:"COLON",122:"NOT",124:"IF",130:"UNION",132:"ALL",134:"ANY",136:"INTERSECT",137:"EXCEPT",138:"AND",139:"OR",140:"PATH",141:"RETURNS",145:"PLUS",146:"STAR",147:"QUESTION",149:"FROM",151:"LIMIT",153:"STRATEGY",155:"TIMEOUT",157:"DISTINCT",159:"UNIQUE",160:"SELECT",161:"ROW",162:"COLUMN",163:"MATRIX",164:"TEXTSTRING",165:"INDEX",166:"RECORDSET",167:"TOP",169:"PERCENT",170:"INTO",178:"CROSS",179:"APPLY",180:"OUTER",188:"NATURAL",189:"JOIN",190:"INNER",191:"LEFT",192:"RIGHT",193:"FULL",194:"SEMI",195:"ANTI",196:"ON",197:"USING",199:"GROUP",203:"GROUPING",204:"SETS",205:"ROLLUP",206:"CUBE",207:"HAVING",208:"CORRESPONDING",210:"DIRECTION",211:"COLLATE",212:"NOCASE",214:"OFFSET",226:"CURRENT_TIMESTAMP",227:"JAVASCRIPT",228:"NEW",229:"CAST",231:"CONVERT",235:"OVER",238:"PARTITION",239:"SUM",240:"COUNT",241:"MIN",242:"MAX",243:"AVG",244:"FIRST",245:"LAST",246:"AGGR",247:"ARRAY",249:"TRUE",250:"FALSE",251:"NSTRING",252:"NULL",253:"EXISTS",255:"BRAQUESTION",256:"CASE",259:"END",261:"WHEN",262:"THEN",263:"ELSE",264:"NOT_LIKE",265:"MINUS",266:"CARET",267:"GE",268:"LE",269:"EQEQ",270:"EQEQEQ",271:"NE",272:"NEEQEQ",273:"NEEQEQEQ",276:"IN",278:"BETWEEN",279:"NOT_BETWEEN",280:"IS",281:"DOUBLECOLON",282:"SOME",283:"UPDATE",285:"DELETE",286:"INSERT",288:"VALUES",290:"DEFAULT",293:"DateValue",294:"CREATE",300:"TABLE",303:"ENGINE",304:"AUTO_INCREMENT",305:"CHARSET",306:"TEMPORARY",307:"TEMP",317:"CONSTRAINT",318:"CHECK",319:"PRIMARY",320:"KEY",323:"FOREIGN",324:"REFERENCES",330:"NO",331:"ACTION",335:"ColumnConstraints",337:"ENUM",343:"IDENTITY",344:"DROP",347:"ALTER",348:"RENAME",349:"ADD",350:"MODIFY",351:"ATTACH",352:"DATABASE",353:"DETACH",355:"USE",356:"SHOW",357:"DATABASES",358:"TABLES",359:"VIEW",360:"HELP",362:"SOURCE",363:"ASSERT",365:"ATLBRA",369:"LCUR",371:"RCUR",373:"RBRA",378:"OFF",379:"COMMIT",380:"TRANSACTION",381:"ROLLBACK",382:"BEGIN",384:"WHILE",385:"CONTINUE",386:"BREAK",387:"PRINT",388:"REQUIRE",390:"DECLARE",393:"TRUNCATE",394:"MERGE",402:"MATCHED",405:"TARGET",406:"OUTPUT",412:"CONTENT",414:"GRAPH"}, productions_: [0,[3,1],[3,1],[6,2],[7,3],[7,3],[7,1],[7,1],[12,2],[12,4],[10,1],[16,0],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[38,3],[63,3],[63,1],[65,5],[36,9],[36,4],[81,3],[84,3],[84,1],[85,1],[85,2],[89,1],[89,5],[89,5],[89,2],[89,2],[89,2],[89,3],[89,4],[89,4],[89,4],[89,4],[89,1],[89,1],[89,1],[89,1],[89,1],[89,1],[89,2],[89,2],[89,2],[89,1],[89,1],[89,1],[89,2],[89,1],[89,2],[89,3],[89,3],[89,4],[89,1],[89,2],[89,2],[89,4],[89,4],[89,4],[89,4],[89,4],[89,5],[89,4],[89,4],[89,4],[89,4],[89,4],[89,4],[89,4],[89,4],[131,3],[131,1],[121,1],[121,1],[121,1],[148,2],[150,2],[152,2],[154,2],[69,4],[69,4],[69,4],[69,3],[156,1],[156,2],[156,2],[156,2],[156,2],[156,2],[156,2],[156,2],[158,2],[158,4],[158,3],[158,0],[71,0],[71,2],[71,2],[71,2],[71,2],[71,2],[72,2],[72,3],[72,5],[72,0],[177,6],[177,7],[177,6],[177,7],[175,1],[175,3],[181,4],[181,5],[181,3],[181,2],[181,3],[181,1],[181,2],[181,3],[181,1],[181,1],[181,2],[181,3],[181,1],[181,2],[181,3],[181,1],[181,2],[181,3],[182,1],[171,3],[171,1],[176,2],[176,2],[176,1],[176,1],[183,3],[185,1],[185,2],[185,3],[185,2],[185,3],[185,4],[185,5],[185,1],[185,2],[185,3],[185,1],[185,2],[185,3],[184,1],[184,2],[187,1],[187,2],[187,2],[187,3],[187,2],[187,3],[187,2],[187,3],[187,2],[187,2],[187,2],[186,2],[186,2],[186,0],[73,0],[73,2],[74,0],[74,4],[200,1],[200,3],[202,5],[202,4],[202,4],[202,1],[201,0],[201,2],[77,0],[77,2],[77,3],[77,2],[77,2],[77,3],[77,4],[77,3],[77,3],[75,0],[75,3],[92,1],[92,3],[209,1],[209,2],[209,3],[209,4],[76,0],[76,3],[213,0],[213,2],[142,3],[142,1],[215,3],[215,2],[215,3],[215,2],[215,3],[215,2],[215,1],[216,5],[216,3],[216,1],[86,5],[86,3],[86,3],[86,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,3],[96,3],[96,3],[96,1],[96,1],[52,1],[224,2],[224,2],[223,6],[223,8],[223,6],[223,8],[232,1],[232,1],[232,1],[232,1],[232,1],[232,1],[232,1],[217,5],[217,6],[217,6],[234,0],[234,4],[234,4],[234,5],[236,3],[237,3],[126,1],[126,1],[126,1],[126,1],[126,1],[126,1],[126,1],[126,1],[126,1],[172,5],[172,3],[233,1],[233,3],[168,1],[219,1],[219,1],[88,1],[88,1],[220,1],[174,2],[221,4],[173,2],[173,2],[173,1],[173,1],[222,5],[222,4],[257,2],[257,1],[260,4],[258,2],[258,0],[218,3],[218,3],[218,3],[218,3],[218,3],[218,3],[218,3],[218,3],[218,3],[218,3],[218,5],[218,3],[218,3],[218,3],[218,5],[218,3],[218,3],[218,3],[218,3],[218,3],[218,3],[218,3],[218,3],[218,3],[218,3],[218,3],[218,6],[218,6],[218,3],[218,3],[218,2],[218,2],[218,2],[218,2],[218,3],[218,5],[218,6],[218,5],[218,6],[218,4],[218,5],[218,3],[218,4],[218,3],[218,3],[218,3],[218,3],[277,1],[277,1],[277,4],[274,1],[274,1],[274,1],[274,1],[274,1],[274,1],[275,1],[275,1],[275,1],[50,6],[50,4],[118,1],[118,3],[284,3],[28,5],[28,3],[34,5],[34,5],[34,8],[34,4],[34,7],[287,0],[287,1],[289,3],[289,1],[289,1],[289,5],[289,3],[289,3],[291,1],[291,3],[292,1],[292,1],[292,1],[292,1],[292,1],[292,1],[198,1],[198,3],[23,9],[23,5],[296,1],[296,1],[299,0],[299,1],[301,2],[301,1],[302,1],[302,3],[302,3],[302,3],[295,0],[295,1],[295,1],[297,0],[297,3],[298,3],[298,1],[298,2],[309,1],[309,3],[310,2],[310,2],[310,2],[310,2],[310,2],[311,0],[311,2],[316,4],[312,6],[313,9],[327,3],[326,0],[326,2],[328,4],[329,4],[314,5],[315,5],[315,5],[322,1],[322,1],[322,3],[322,3],[308,1],[308,3],[333,3],[333,2],[333,1],[230,6],[230,4],[230,1],[230,4],[336,1],[336,1],[334,0],[334,1],[338,2],[338,1],[340,3],[339,2],[339,5],[339,3],[339,1],[339,6],[339,1],[339,2],[339,4],[339,1],[339,2],[339,1],[339,1],[32,4],[346,0],[346,2],[18,6],[18,6],[18,6],[18,8],[18,6],[35,5],[19,4],[19,7],[19,6],[19,9],[29,3],[20,4],[20,6],[20,9],[20,6],[354,0],[354,2],[49,3],[49,2],[30,4],[30,5],[30,5],[21,8],[21,9],[31,3],[41,2],[41,4],[41,3],[41,5],[43,2],[43,4],[43,4],[43,6],[40,4],[40,6],[42,4],[42,6],[39,4],[39,6],[24,10],[24,7],[33,4],[51,2],[51,1],[361,1],[53,2],[54,2],[54,2],[54,4],[114,4],[114,2],[114,2],[114,2],[114,2],[114,1],[114,2],[114,2],[367,1],[367,1],[368,1],[368,1],[368,1],[368,1],[368,1],[368,1],[368,1],[368,3],[364,3],[364,4],[364,2],[366,2],[366,3],[366,1],[370,3],[370,1],[374,3],[374,3],[374,3],[372,3],[372,1],[61,3],[61,5],[61,6],[376,3],[376,2],[377,1],[377,1],[377,3],[375,1],[375,1],[46,2],[47,2],[45,2],[17,4],[17,3],[383,2],[55,3],[56,1],[57,1],[58,3],[59,2],[59,2],[60,2],[389,3],[389,1],[27,2],[391,1],[391,3],[392,3],[392,4],[392,5],[392,6],[44,3],[37,6],[395,1],[395,2],[396,2],[397,2],[398,2],[398,2],[398,1],[398,1],[400,4],[400,6],[403,1],[403,3],[401,5],[401,7],[401,7],[401,9],[401,7],[401,9],[404,3],[404,6],[404,3],[404,6],[399,0],[399,2],[399,5],[399,4],[399,7],[26,6],[411,2],[410,0],[410,2],[410,2],[410,1],[25,8],[22,3],[22,4],[415,3],[415,1],[416,3],[416,7],[424,2],[425,3],[426,2],[417,4],[431,2],[432,2],[432,2],[433,4],[435,6],[70,0],[70,1],[79,0],[79,2],[80,0],[80,1],[83,0],[83,1],[93,0],[93,1],[97,1],[97,2],[98,1],[98,2],[99,0],[99,1],[123,0],[123,2],[125,0],[125,2],[127,0],[127,2],[128,1],[128,1],[129,0],[129,2],[133,0],[133,2],[135,0],[135,2],[143,0],[143,2],[144,0],[144,2],[225,1],[225,1],[439,1],[439,1],[248,0],[248,1],[254,1],[254,1],[321,0],[321,1],[325,0],[325,1],[332,0],[332,1],[341,0],[341,1],[342,0],[342,1],[345,1],[345,1],[407,0],[407,1],[408,0],[408,1],[409,0],[409,1],[413,0],[413,1],[418,0],[418,1],[419,0],[419,1],[420,1],[420,1],[421,0],[421,1],[422,0],[422,1],[423,1],[423,1],[427,0],[427,1],[428,0],[428,1],[429,0],[429,1],[430,0],[430,1],[434,0],[434,2],[436,0],[436,2],[437,0],[437,2],[438,0],[438,2]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 1: if (yy.casesensitive) this.$ = $$[$0]; else this.$ = $$[$0].toLowerCase(); break; case 2: this.$ = doubleq($$[$0].substr(1,$$[$0].length-2)); break; case 3: return new yy.Statements({statements:$$[$0-1]}); break; case 4: case 5: this.$ = $$[$0-2]; if($$[$0]) $$[$0-2].push($$[$0]); break; case 6: case 7: case 59: case 65: case 115: case 153: case 178: case 179: case 214: case 233: case 244: case 314: case 331: case 396: case 409: case 410: case 414: case 422: case 464: case 465: case 578: case 583: case 603: case 605: case 619: case 620: case 650: this.$ = [$$[$0]]; break; case 8: this.$ = $$[$0]; $$[$0].explain = true; break; case 9: this.$ = $$[$0]; $$[$0].explain = true; break; case 10: this.$ = $$[$0]; if(yy.exists) this.$.exists = yy.exists; delete yy.exists; if(yy.queries) this.$.queries = yy.queries; delete yy.queries; break; case 11: case 127: case 138: case 148: case 209: case 210: case 212: case 220: case 222: case 231: case 239: case 241: case 334: case 426: case 436: case 439: case 451: case 457: case 458: case 497: this.$ = undefined; break; case 57: this.$ = new yy.WithSelect({withs: $$[$0-1], select:$$[$0]}); break; case 58: $$[$0-2].push($$[$0]); this.$=$$[$0-2]; break; case 60: this.$ = {name:$$[$0-4], select:$$[$0-1]}; break; case 61: yy.extend(this.$,$$[$0-8]); yy.extend(this.$,$$[$0-7]); yy.extend(this.$,$$[$0-6]); yy.extend(this.$,$$[$0-5]); yy.extend(this.$,$$[$0-4]); yy.extend(this.$,$$[$0-3]);yy.extend(this.$,$$[$0-2]); yy.extend(this.$,$$[$0-1]); yy.extend(this.$,$$[$0]); this.$ = $$[$0-8]; /* if(yy.exists) this.$.exists = yy.exists; delete yy.exists; if(yy.queries) this.$.queries = yy.queries; delete yy.queries; */ break; case 62: this.$ = new yy.Search({selectors:$$[$0-2], from:$$[$0]}); yy.extend(this.$,$$[$0-1]); break; case 63: this.$ = {removecolumns:$$[$0]}; break; case 64: case 649: this.$ = $$[$0-2]; this.$.push($$[$0]); break; case 66: case 119: case 160: case 219: case 251: case 259: case 260: case 261: case 262: case 263: case 264: case 265: case 266: case 267: case 268: case 269: case 270: case 271: case 272: case 274: case 287: case 288: case 289: case 290: case 291: case 292: case 333: case 385: case 386: case 387: case 388: case 389: case 390: case 452: case 480: case 482: case 552: case 553: case 554: case 555: case 556: case 557: case 561: case 563: case 564: case 573: case 584: case 585: case 641: case 654: case 655: case 657: case 658: this.$ = $$[$0]; break; case 67: this.$ = {like:$$[$0]}; break; case 68: case 79: this.$ = {srchid:"PROP", args: [$$[$0]]}; break; case 69: this.$ = {srchid:"ORDERBY", args: $$[$0-1]}; break; case 70: var dir = $$[$0-1]; if(!dir) dir = 'ASC'; this.$ = {srchid:"ORDERBY", args: [{expression: new yy.Column({columnid:'_'}), direction:dir}]}; break; case 71: this.$ = {srchid:"APROP", args: [$$[$0]]}; break; case 72: this.$ = {srchid:"EQ", args: [$$[$0]]}; break; case 73: this.$ = {srchid:"LIKE", args: [$$[$0]]}; break; case 74: case 75: this.$ = {selid:"WITH", args: $$[$0-1]}; break; case 76: this.$ = {srchid:$$[$0-3].toUpperCase(), args:$$[$0-1]}; break; case 77: this.$ = {srchid:"WHERE", args:[$$[$0-1]]}; break; case 78: this.$ = {srchid:"CLASS", args:[$$[$0-1]]}; break; case 80: this.$ = {srchid:"NAME", args: [$$[$0].substr(1,$$[$0].length-2)]}; break; case 81: this.$ = {srchid:"CHILD"}; break; case 82: this.$ = {srchid:"VERTEX"}; break; case 83: this.$ = {srchid:"EDGE"}; break; case 84: this.$ = {srchid:"REF"}; break; case 85: this.$ = {srchid:"SHARP", args:[$$[$0]]}; break; case 86: this.$ = {srchid:"ATTR", args:((typeof $$[$0] == 'undefined')?undefined:[$$[$0]])}; break; case 87: this.$ = {srchid:"ATTR"}; break; case 88: this.$ = {srchid:"OUT"}; break; case 89: this.$ = {srchid:"IN"}; break; case 90: this.$ = {srchid:"CONTENT"}; break; case 91: this.$ = {srchid:"PARENT"}; break; case 92: this.$ = {srchid:"EX",args:[new yy.Json({value:$$[$0]})]}; break; case 93: this.$ = {srchid:"AT", args:[$$[$0]]}; break; case 94: this.$ = {srchid:"AS", args:[$$[$0]]}; break; case 95: this.$ = {srchid:"TO", args:[$$[$0]]}; break; case 96: this.$ = {srchid:"SET", args:$$[$0-1]}; break; case 97: this.$ = {srchid:"VALUE"}; break; case 98: this.$ = {srchid:"CLASS", args:[$$[$0]]}; break; case 99: this.$ = {selid:$$[$0],args:[$$[$0-1]] }; break; case 100: this.$ = {selid:"NOT",args:$$[$0-1] }; break; case 101: this.$ = {selid:"IF",args:$$[$0-1] }; break; case 102: this.$ = {selid:$$[$0-3],args:$$[$0-1] }; break; case 103: this.$ = {selid:'DISTINCT',args:$$[$0-1] }; break; case 104: this.$ = {selid:'UNION',args:$$[$0-1] }; break; case 105: this.$ = {selid:'UNIONALL',args:$$[$0-1] }; break; case 106: this.$ = {selid:'ALL',args:[$$[$0-1]] }; break; case 107: this.$ = {selid:'ANY',args:[$$[$0-1]] }; break; case 108: this.$ = {selid:'INTERSECT',args:$$[$0-1] }; break; case 109: this.$ = {selid:'EXCEPT',args:$$[$0-1] }; break; case 110: this.$ = {selid:'AND',args:$$[$0-1] }; break; case 111: this.$ = {selid:'OR',args:$$[$0-1] }; break; case 112: this.$ = {selid:'PATH',args:[$$[$0-1]] }; break; case 113: this.$ = {srchid:'RETURNS',args:$$[$0-1] }; break; case 114: this.$ = $$[$0-2]; this.$.push($$[$0]); break; case 116: this.$ = "PLUS"; break; case 117: this.$ = "STAR"; break; case 118: this.$ = "QUESTION"; break; case 123: this.$ = new yy.Select({ columns:$$[$0], distinct: true }); yy,extend(this.$, $$[$0-3]); yy.extend(this.$, $$[$0-1]); break; case 124: this.$ = new yy.Select({ columns:$$[$0], distinct: true }); yy,extend(this.$, $$[$0-3]);yy.extend(this.$, $$[$0-1]); break; case 125: this.$ = new yy.Select({ columns:$$[$0], all:true }); yy,extend(this.$, $$[$0-3]);yy.extend(this.$, $$[$0-1]); break; case 126: this.$ = new yy.Select({ columns:$$[$0] }); yy,extend(this.$, $$[$0-2]);yy.extend(this.$, $$[$0-1]); break; case 128: this.$ = {modifier:'VALUE'} break; case 129: this.$ = {modifier:'ROW'} break; case 130: this.$ = {modifier:'COLUMN'} break; case 131: this.$ = {modifier:'MATRIX'} break; case 132: this.$ = {modifier:'TEXTSTRING'} break; case 133: this.$ = {modifier:'INDEX'} break; case 134: this.$ = {modifier:'RECORDSET'} break; case 135: this.$ = {top: $$[$0]}; break; case 136: this.$ = {top: $$[$0-1]}; break; case 137: this.$ = {top: $$[$0-1], percent:true}; break; case 139: case 297: case 459: case 460: case 642: this.$ = undefined; break; case 140: case 141: case 142: case 143: this.$ = {into: $$[$0]} break; case 144: var s = $$[$0]; s = s.substr(1,s.length-2); var x3 = s.substr(-3).toUpperCase(); var x4 = s.substr(-4).toUpperCase(); if(s[0] == '#') { this.$ = {into: new yy.FuncValue({funcid: 'HTML', args:[new yy.StringValue({value: s}), new yy.Json({value:{headers:true}})]})}; } else if(x3=='XLS' || x3 == 'CSV' || x3=='TAB') { this.$ = {into: new yy.FuncValue({funcid: x3, args:[new yy.StringValue({value: s}), new yy.Json({value:{headers:true}})]})}; } else if(x4=='XLSX' || x4 == 'JSON') { this.$ = {into: new yy.FuncValue({funcid: x4, args:[new yy.StringValue({value: s}), new yy.Json({value:{headers:true}})]})}; } break; case 145: this.$ = { from: $$[$0] }; break; case 146: this.$ = { from: $$[$0-1], joins: $$[$0] }; break; case 147: this.$ = { from: $$[$0-2], joins: $$[$0-1] }; break; case 149: this.$ = new yy.Apply({select: $$[$0-2], applymode:'CROSS', as:$$[$0]}); break; case 150: this.$ = new yy.Apply({select: $$[$0-3], applymode:'CROSS', as:$$[$0]}); break; case 151: this.$ = new yy.Apply({select: $$[$0-2], applymode:'OUTER', as:$$[$0]}); break; case 152: this.$ = new yy.Apply({select: $$[$0-3], applymode:'OUTER', as:$$[$0]}); break; case 154: case 215: case 397: case 466: case 467: this.$ = $$[$0-2]; $$[$0-2].push($$[$0]); break; case 155: this.$ = $$[$0-2]; this.$.as = $$[$0] break; case 156: this.$ = $$[$0-3]; this.$.as = $$[$0] break; case 157: this.$ = $$[$0-1]; this.$.as = 'default' break; case 158: this.$ = $$[$0-1]; $$[$0-1].as = $$[$0] break; case 159: this.$ = $$[$0-2]; $$[$0-2].as = $$[$0] break; case 161: case 165: case 168: case 171: this.$ = $$[$0-1]; $$[$0-1].as = $$[$0]; break; case 162: case 166: case 169: case 172: this.$ = $$[$0-2]; $$[$0-2].as = $$[$0]; break; case 163: case 164: case 167: case 170: this.$ = $$[$0]; $$[$0].as = 'default'; break; case 173: var s = $$[$0]; s = s.substr(1,s.length-2); var x3 = s.substr(-3).toUpperCase(); var x4 = s.substr(-4).toUpperCase(); var r; if(s[0] == '#') { r = new yy.FuncValue({funcid: 'HTML', args:[new yy.StringValue({value: s}), new yy.Json({value:{headers:true}})]}); } else if(x3=='XLS' || x3 == 'CSV' || x3=='TAB') { r = new yy.FuncValue({funcid: x3, args:[new yy.StringValue({value: s}), new yy.Json({value:{headers:true}})]}); } else if(x4=='XLSX' || x4 == 'JSON') { r = new yy.FuncValue({funcid: x4, args:[new yy.StringValue({value: s}), new yy.Json({value:{headers:true}})]}); } else { throw new Error('Unknown string in FROM clause'); }; this.$ = r; break; case 174: if($$[$0-2] == 'INFORMATION_SCHEMA') { this.$ = new yy.FuncValue({funcid: $$[$0-2], args:[new yy.StringValue({value:$$[$0]})]}); } else { this.$ = new yy.Table({databaseid: $$[$0-2], tableid:$$[$0]}); } break; case 175: this.$ = new yy.Table({tableid: $$[$0]}); break; case 176: case 177: this.$ = $$[$0-1]; $$[$0-1].push($$[$0]); break; case 180: this.$ = new yy.Join($$[$0-2]); yy.extend(this.$, $$[$0-1]); yy.extend(this.$, $$[$0]); break; case 181: this.$ = {table: $$[$0]}; break; case 182: this.$ = {table: $$[$0-1], as: $$[$0] } ; break; case 183: this.$ = {table: $$[$0-2], as: $$[$0] } ; break; case 184: this.$ = {param: $$[$0-1], as: $$[$0] } ; break; case 185: this.$ = {param: $$[$0-2], as: $$[$0] } ; break; case 186: this.$ = {select: $$[$0-3], as: $$[$0]} ; break; case 187: this.$ = {select: $$[$0-4], as: $$[$0] } ; break; case 188: this.$ = {funcid:$$[$0], as:'default'}; break; case 189: this.$ = {funcid:$$[$0-1], as: $$[$0]}; break; case 190: this.$ = {funcid:$$[$0-2], as: $$[$0]}; break; case 191: this.$ = {variable:$$[$0],as:'default'}; break; case 192: this.$ = {variable:$$[$0-1],as:$$[$0]}; break; case 193: this.$ = {variable:$$[$0-2],as:$$[$0]} break; case 194: this.$ = { joinmode: $$[$0] } ; break; case 195: this.$ = {joinmode: $$[$0-1], natural:true} ; break; case 196: case 197: this.$ = "INNER"; break; case 198: case 199: this.$ = "LEFT"; break; case 200: case 201: this.$ = "RIGHT"; break; case 202: case 203: this.$ = "OUTER"; break; case 204: this.$ = "SEMI"; break; case 205: this.$ = "ANTI"; break; case 206: this.$ = "CROSS"; break; case 207: this.$ = {on: $$[$0]}; break; case 208: case 615: this.$ = {using: $$[$0]}; break; case 211: this.$ = {where: new yy.Expression({expression:$$[$0]})}; break; case 213: this.$ = {group:$$[$0-1]}; yy.extend(this.$,$$[$0]); break; case 216: this.$ = new yy.GroupExpression({type:'GROUPING SETS', group: $$[$0-1]}); break; case 217: this.$ = new yy.GroupExpression({type:'ROLLUP', group: $$[$0-1]}); break; case 218: this.$ = new yy.GroupExpression({type:'CUBE', group: $$[$0-1]}); break; case 221: this.$ = {having:$$[$0]} break; case 223: this.$ = {union: $$[$0]} ; break; case 224: this.$ = {unionall: $$[$0]} ; break; case 225: this.$ = {except: $$[$0]} ; break; case 226: this.$ = {intersect: $$[$0]} ; break; case 227: this.$ = {union: $$[$0], corresponding:true} ; break; case 228: this.$ = {unionall: $$[$0], corresponding:true} ; break; case 229: this.$ = {except: $$[$0], corresponding:true} ; break; case 230: this.$ = {intersect: $$[$0], corresponding:true} ; break; case 232: this.$ = {order:$$[$0]} break; case 234: this.$ = $$[$0-2]; $$[$0-2].push($$[$0]) break; case 235: this.$ = new yy.Expression({expression: $$[$0], direction:'ASC'}) break; case 236: this.$ = new yy.Expression({expression: $$[$0-1], direction:$$[$0].toUpperCase()}) break; case 237: this.$ = new yy.Expression({expression: $$[$0-2], direction:'ASC', nocase:true}) break; case 238: this.$ = new yy.Expression({expression: $$[$0-3], direction:$$[$0].toUpperCase(), nocase:true}) break; case 240: this.$ = {limit:$$[$0-1]}; yy.extend(this.$, $$[$0]) break; case 242: this.$ = {offset:$$[$0]} break; case 243: case 445: case 469: case 577: case 582: case 602: case 606: $$[$0-2].push($$[$0]); this.$ = $$[$0-2]; break; case 245: case 247: case 249: $$[$0-2].as = $$[$0]; this.$ = $$[$0-2]; break; case 246: case 248: case 250: $$[$0-1].as = $$[$0]; this.$ = $$[$0-1]; break; case 252: this.$ = new yy.Column({columid: $$[$0], tableid: $$[$0-2], databaseid:$$[$0-4]}); break; case 253: this.$ = new yy.Column({columnid: $$[$0], tableid: $$[$0-2]}); break; case 254: this.$ = new yy.Column({columnid:$$[$0]}); break; case 255: this.$ = new yy.Column({columnid: $$[$0], tableid: $$[$0-2], databaseid:$$[$0-4]}); break; case 256: case 257: this.$ = new yy.Column({columnid: $$[$0], tableid: $$[$0-2]}); break; case 258: this.$ = new yy.Column({columnid: $$[$0]}); break; case 273: this.$ = new yy.Json({value:$$[$0]}); break; case 275: case 276: case 277: if(!yy.queries) yy.queries = []; yy.queries.push($$[$0-1]); $$[$0-1].queriesidx = yy.queries.length; this.$ = $$[$0-1]; break; case 278: this.$ = $$[$0] break; case 279: this.$ = new yy.FuncValue({funcid:'CURRENT_TIMESTAMP'}); break; case 280: this.$ = new yy.JavaScript({value:$$[$0].substr(2,$$[$0].length-4)}); break; case 281: this.$ = new yy.FuncValue({funcid:$$[$0], newid:true}); break; case 282: this.$ = $$[$0]; yy.extend(this.$,{newid:true}); break; case 283: this.$ = new yy.Convert({expression:$$[$0-3]}) ; yy.extend(this.$,$$[$0-1]) ; break; case 284: this.$ = new yy.Convert({expression:$$[$0-5], style:$$[$0-1]}) ; yy.extend(this.$,$$[$0-3]) ; break; case 285: this.$ = new yy.Convert({expression:$$[$0-1]}) ; yy.extend(this.$,$$[$0-3]) ; break; case 286: this.$ = new yy.Convert({expression:$$[$0-3], style:$$[$0-1]}) ; yy.extend(this.$,$$[$0-5]) ; break; case 293: this.$ = new yy.FuncValue({funcid:'CURRENT_TIMESTAMP'}); break; case 294: if($$[$0-2].length > 1 && ($$[$0-4].toUpperCase() == 'MAX' || $$[$0-4].toUpperCase() == 'MIN')) { this.$ = new yy.FuncValue({funcid:$$[$0-4],args:$$[$0-2]}); } else { this.$ = new yy.AggrValue({aggregatorid: $$[$0-4].toUpperCase(), expression: $$[$0-2].pop(), over:$$[$0]}); } break; case 295: this.$ = new yy.AggrValue({aggregatorid: $$[$0-5].toUpperCase(), expression: $$[$0-2], distinct:true, over:$$[$0]}); break; case 296: this.$ = new yy.AggrValue({aggregatorid: $$[$0-5].toUpperCase(), expression: $$[$0-2], over:$$[$0]}); break; case 298: case 299: this.$ = new yy.Over(); yy.extend(this.$,$$[$0-1]); break; case 300: this.$ = new yy.Over(); yy.extend(this.$,$$[$0-2]); yy.extend(this.$,$$[$0-1]); break; case 301: this.$ = {partition:$$[$0]}; break; case 302: this.$ = {order:$$[$0]}; break; case 303: this.$ = "SUM"; break; case 304: this.$ = "COUNT"; break; case 305: this.$ = "MIN"; break; case 306: case 478: this.$ = "MAX"; break; case 307: this.$ = "AVG"; break; case 308: thi