diff --git a/README.md b/README.md index a101bbb..ed3e900 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,21 @@ The parser only currently supports SELECT queries but is able to produce a Selec FROM `my_table` WHERE `foo` = 'bar' +Using Variables +--------------- + +The parser and lexer also support setting special variables + + let tokens = lexer.tokenize('select * from my_table where foo = '{bar}', { + variableTokens: '{bar}' + }) + parser.parse(tokens).toString() + + SELECT * + FROM `my_table` + WHERE `foo` = '{bar}' + + Credits ------- diff --git a/browser/sql-parser.js b/browser/sql-parser.js index 4ebe726..17839ae 100644 --- a/browser/sql-parser.js +++ b/browser/sql-parser.js @@ -8,7 +8,7 @@ var Lexer; Lexer = (function() { - var BOOLEAN, DBLSTRING, LITERAL, MATH, MATH_MULTI, NUMBER, PARAMETER, SEPARATOR, SQL_BETWEENS, SQL_CONDITIONALS, SQL_FUNCTIONS, SQL_OPERATORS, SQL_SORT_ORDERS, STAR, STRING, SUB_SELECT_OP, SUB_SELECT_UNARY_OP, WHITESPACE; + var BOOLEAN, DBLSTRING, LITERAL, MATH, MATH_MULTI, NUMBER, PARAMETER, SEPARATOR, SQL_BETWEENS, SQL_CONDITIONALS, SQL_FUNCTIONS, SQL_OPERATORS, SQL_SORT_ORDERS, STAR, STRING, SUB_SELECT_OP, SUB_SELECT_UNARY_OP, VARIABLE, WHITESPACE; function Lexer(sql, opts) { var bytesConsumed, i; @@ -17,11 +17,12 @@ } this.sql = sql; this.preserveWhitespace = opts.preserveWhitespace || false; + this.variableTokens = opts.variableTokens || []; this.tokens = []; this.currentLine = 1; i = 0; while (this.chunk = sql.slice(i)) { - bytesConsumed = this.keywordToken() || this.starToken() || this.booleanToken() || this.functionToken() || this.windowExtension() || this.sortOrderToken() || this.seperatorToken() || this.operatorToken() || this.mathToken() || this.dotToken() || this.conditionalToken() || this.betweenToken() || this.subSelectOpToken() || this.subSelectUnaryOpToken() || this.numberToken() || this.stringToken() || this.parameterToken() || this.parensToken() || this.whitespaceToken() || this.literalToken(); + bytesConsumed = this.keywordToken() || this.starToken() || this.booleanToken() || this.functionToken() || this.windowExtension() || this.sortOrderToken() || this.seperatorToken() || this.operatorToken() || this.mathToken() || this.dotToken() || this.conditionalToken() || this.betweenToken() || this.subSelectOpToken() || this.subSelectUnaryOpToken() || this.numberToken() || this.stringToken() || this.parameterToken() || this.parensToken() || this.whitespaceToken() || this.variableToken() || this.literalToken(); if (bytesConsumed < 1) { throw new Error("NOTHING CONSUMED: Stopped at - '" + (this.chunk.slice(0, 30)) + "'"); } @@ -104,6 +105,12 @@ return ret; }; + Lexer.prototype.variableToken = function() { + if (this.variableTokens.length > 0) { + return this.tokenizeFromList('VARIABLE', this.variableTokens); + } + }; + Lexer.prototype.keywordToken = function() { return this.tokenizeFromWord('SELECT') || this.tokenizeFromWord('DISTINCT') || this.tokenizeFromWord('FROM') || this.tokenizeFromWord('WHERE') || this.tokenizeFromWord('GROUP') || this.tokenizeFromWord('ORDER') || this.tokenizeFromWord('BY') || this.tokenizeFromWord('HAVING') || this.tokenizeFromWord('LIMIT') || this.tokenizeFromWord('JOIN') || this.tokenizeFromWord('LEFT') || this.tokenizeFromWord('RIGHT') || this.tokenizeFromWord('INNER') || this.tokenizeFromWord('OUTER') || this.tokenizeFromWord('ON') || this.tokenizeFromWord('AS') || this.tokenizeFromWord('UNION') || this.tokenizeFromWord('ALL') || this.tokenizeFromWord('LIMIT') || this.tokenizeFromWord('OFFSET') || this.tokenizeFromWord('FETCH') || this.tokenizeFromWord('ROW') || this.tokenizeFromWord('ROWS') || this.tokenizeFromWord('ONLY') || this.tokenizeFromWord('NEXT') || this.tokenizeFromWord('FIRST'); }; @@ -241,6 +248,8 @@ DBLSTRING = /^"([^\\"]*(?:\\.[^\\"]*)*)"/; + VARIABLE = /^[\{][a-zA-Z0-9]+[\}]/; + return Lexer; })(); @@ -327,12 +336,12 @@ } */ var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,8],$V1=[5,26],$V2=[1,14],$V3=[1,13],$V4=[5,26,31,42],$V5=[1,17],$V6=[5,26,31,42,45,62],$V7=[1,27],$V8=[1,29],$V9=[1,39],$Va=[1,43],$Vb=[1,44],$Vc=[1,40],$Vd=[1,41],$Ve=[1,38],$Vf=[1,42],$Vg=[1,25],$Vh=[5,26,31],$Vi=[5,26,31,42,45],$Vj=[1,56],$Vk=[18,43],$Vl=[1,59],$Vm=[1,60],$Vn=[1,61],$Vo=[1,62],$Vp=[1,63],$Vq=[5,18,23,26,31,34,37,38,41,42,43,45,62,64,65,66,67,68,70],$Vr=[5,18,23,26,31,34,37,38,41,42,43,44,45,51,62,64,65,66,67,68,70,71],$Vs=[1,69],$Vt=[2,83],$Vu=[1,83],$Vv=[1,84],$Vw=[1,102],$Vx=[5,26,31,42,43,44],$Vy=[1,110],$Vz=[5,26,31,42,43,45,64],$VA=[5,26,31,41,42,45,62],$VB=[1,113],$VC=[1,114],$VD=[1,115],$VE=[5,26,31,34,35,37,38,41,42,45,62],$VF=[5,18,23,26,31,34,37,38,41,42,43,45,62,64,70],$VG=[5,26,31,34,37,38,41,42,45,62],$VH=[5,26,31,42,56,58]; -var parser = {trace: function trace() { }, +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,8],$V1=[5,26],$V2=[1,14],$V3=[1,13],$V4=[5,26,31,42],$V5=[1,17],$V6=[5,26,31,42,45,62],$V7=[1,27],$V8=[1,29],$V9=[1,40],$Va=[1,44],$Vb=[1,45],$Vc=[1,41],$Vd=[1,42],$Ve=[1,39],$Vf=[1,46],$Vg=[1,43],$Vh=[1,25],$Vi=[5,26,31],$Vj=[5,26,31,42,45],$Vk=[1,58],$Vl=[18,43],$Vm=[1,61],$Vn=[1,62],$Vo=[1,63],$Vp=[1,64],$Vq=[1,65],$Vr=[5,18,23,26,31,34,37,38,41,42,43,45,62,64,65,66,67,68,70],$Vs=[5,18,23,26,31,34,37,38,41,42,43,44,45,51,62,64,65,66,67,68,70,71],$Vt=[1,71],$Vu=[2,84],$Vv=[1,85],$Vw=[1,86],$Vx=[1,104],$Vy=[5,26,31,42,43,44],$Vz=[1,112],$VA=[5,26,31,42,43,45,64],$VB=[5,26,31,41,42,45,62],$VC=[1,115],$VD=[1,116],$VE=[1,117],$VF=[5,26,31,34,35,37,38,41,42,45,62],$VG=[5,18,23,26,31,34,37,38,41,42,43,45,62,64,70],$VH=[5,26,31,34,37,38,41,42,45,62],$VI=[5,26,31,42,56,58]; +var parser = {trace: function trace () { }, yy: {}, -symbols_: {"error":2,"Root":3,"Query":4,"EOF":5,"SelectQuery":6,"Unions":7,"SelectWithLimitQuery":8,"BasicSelectQuery":9,"Select":10,"OrderClause":11,"GroupClause":12,"LimitClause":13,"SelectClause":14,"WhereClause":15,"SELECT":16,"Fields":17,"FROM":18,"Table":19,"DISTINCT":20,"Joins":21,"Literal":22,"AS":23,"LEFT_PAREN":24,"List":25,"RIGHT_PAREN":26,"WINDOW":27,"WINDOW_FUNCTION":28,"Number":29,"Union":30,"UNION":31,"ALL":32,"Join":33,"JOIN":34,"ON":35,"Expression":36,"LEFT":37,"RIGHT":38,"INNER":39,"OUTER":40,"WHERE":41,"LIMIT":42,"SEPARATOR":43,"OFFSET":44,"ORDER":45,"BY":46,"OrderArgs":47,"OffsetClause":48,"OrderArg":49,"Value":50,"DIRECTION":51,"OffsetRows":52,"FetchClause":53,"ROW":54,"ROWS":55,"FETCH":56,"FIRST":57,"ONLY":58,"NEXT":59,"GroupBasicClause":60,"HavingClause":61,"GROUP":62,"ArgumentList":63,"HAVING":64,"MATH":65,"MATH_MULTI":66,"OPERATOR":67,"BETWEEN":68,"BetweenExpression":69,"CONDITIONAL":70,"SUB_SELECT_OP":71,"SubSelectExpression":72,"SUB_SELECT_UNARY_OP":73,"String":74,"Function":75,"UserFunction":76,"Boolean":77,"Parameter":78,"NUMBER":79,"BOOLEAN":80,"PARAMETER":81,"STRING":82,"DBLSTRING":83,"LITERAL":84,"DOT":85,"FUNCTION":86,"AggregateArgumentList":87,"Field":88,"STAR":89,"$accept":0,"$end":1}, -terminals_: {2:"error",5:"EOF",16:"SELECT",18:"FROM",20:"DISTINCT",23:"AS",24:"LEFT_PAREN",26:"RIGHT_PAREN",27:"WINDOW",28:"WINDOW_FUNCTION",31:"UNION",32:"ALL",34:"JOIN",35:"ON",37:"LEFT",38:"RIGHT",39:"INNER",40:"OUTER",41:"WHERE",42:"LIMIT",43:"SEPARATOR",44:"OFFSET",45:"ORDER",46:"BY",51:"DIRECTION",54:"ROW",55:"ROWS",56:"FETCH",57:"FIRST",58:"ONLY",59:"NEXT",62:"GROUP",64:"HAVING",65:"MATH",66:"MATH_MULTI",67:"OPERATOR",68:"BETWEEN",70:"CONDITIONAL",71:"SUB_SELECT_OP",73:"SUB_SELECT_UNARY_OP",79:"NUMBER",80:"BOOLEAN",81:"PARAMETER",82:"STRING",83:"DBLSTRING",84:"LITERAL",85:"DOT",86:"FUNCTION",89:"STAR"}, -productions_: [0,[3,2],[4,1],[4,2],[6,1],[6,1],[9,1],[9,2],[9,2],[9,3],[8,2],[10,1],[10,2],[14,4],[14,5],[14,5],[14,6],[19,1],[19,2],[19,3],[19,3],[19,3],[19,4],[19,6],[7,1],[7,2],[30,2],[30,3],[21,1],[21,2],[33,4],[33,5],[33,5],[33,6],[33,6],[33,6],[33,6],[15,2],[13,2],[13,4],[13,4],[11,3],[11,4],[47,1],[47,3],[49,1],[49,2],[48,2],[48,3],[52,2],[52,2],[53,4],[53,4],[12,1],[12,2],[60,3],[61,2],[36,3],[36,3],[36,3],[36,3],[36,3],[36,3],[36,5],[36,3],[36,2],[36,1],[36,1],[69,3],[72,3],[50,1],[50,1],[50,1],[50,1],[50,1],[50,1],[50,1],[25,1],[29,1],[77,1],[78,1],[74,1],[74,1],[22,1],[22,3],[75,4],[76,3],[76,4],[87,1],[87,2],[63,1],[63,3],[17,1],[17,3],[88,1],[88,1],[88,3]], +symbols_: {"error":2,"Root":3,"Query":4,"EOF":5,"SelectQuery":6,"Unions":7,"SelectWithLimitQuery":8,"BasicSelectQuery":9,"Select":10,"OrderClause":11,"GroupClause":12,"LimitClause":13,"SelectClause":14,"WhereClause":15,"SELECT":16,"Fields":17,"FROM":18,"Table":19,"DISTINCT":20,"Joins":21,"Literal":22,"AS":23,"LEFT_PAREN":24,"List":25,"RIGHT_PAREN":26,"WINDOW":27,"WINDOW_FUNCTION":28,"Number":29,"Union":30,"UNION":31,"ALL":32,"Join":33,"JOIN":34,"ON":35,"Expression":36,"LEFT":37,"RIGHT":38,"INNER":39,"OUTER":40,"WHERE":41,"LIMIT":42,"SEPARATOR":43,"OFFSET":44,"ORDER":45,"BY":46,"OrderArgs":47,"OffsetClause":48,"OrderArg":49,"Value":50,"DIRECTION":51,"OffsetRows":52,"FetchClause":53,"ROW":54,"ROWS":55,"FETCH":56,"FIRST":57,"ONLY":58,"NEXT":59,"GroupBasicClause":60,"HavingClause":61,"GROUP":62,"ArgumentList":63,"HAVING":64,"MATH":65,"MATH_MULTI":66,"OPERATOR":67,"BETWEEN":68,"BetweenExpression":69,"CONDITIONAL":70,"SUB_SELECT_OP":71,"SubSelectExpression":72,"SUB_SELECT_UNARY_OP":73,"String":74,"Function":75,"UserFunction":76,"Boolean":77,"Parameter":78,"Variable":79,"NUMBER":80,"BOOLEAN":81,"PARAMETER":82,"STRING":83,"DBLSTRING":84,"LITERAL":85,"DOT":86,"VARIABLE":87,"FUNCTION":88,"AggregateArgumentList":89,"Field":90,"STAR":91,"$accept":0,"$end":1}, +terminals_: {2:"error",5:"EOF",16:"SELECT",18:"FROM",20:"DISTINCT",23:"AS",24:"LEFT_PAREN",26:"RIGHT_PAREN",27:"WINDOW",28:"WINDOW_FUNCTION",31:"UNION",32:"ALL",34:"JOIN",35:"ON",37:"LEFT",38:"RIGHT",39:"INNER",40:"OUTER",41:"WHERE",42:"LIMIT",43:"SEPARATOR",44:"OFFSET",45:"ORDER",46:"BY",51:"DIRECTION",54:"ROW",55:"ROWS",56:"FETCH",57:"FIRST",58:"ONLY",59:"NEXT",62:"GROUP",64:"HAVING",65:"MATH",66:"MATH_MULTI",67:"OPERATOR",68:"BETWEEN",70:"CONDITIONAL",71:"SUB_SELECT_OP",73:"SUB_SELECT_UNARY_OP",80:"NUMBER",81:"BOOLEAN",82:"PARAMETER",83:"STRING",84:"DBLSTRING",85:"LITERAL",86:"DOT",87:"VARIABLE",88:"FUNCTION",91:"STAR"}, +productions_: [0,[3,2],[4,1],[4,2],[6,1],[6,1],[9,1],[9,2],[9,2],[9,3],[8,2],[10,1],[10,2],[14,4],[14,5],[14,5],[14,6],[19,1],[19,2],[19,3],[19,3],[19,3],[19,4],[19,6],[7,1],[7,2],[30,2],[30,3],[21,1],[21,2],[33,4],[33,5],[33,5],[33,6],[33,6],[33,6],[33,6],[15,2],[13,2],[13,4],[13,4],[11,3],[11,4],[47,1],[47,3],[49,1],[49,2],[48,2],[48,3],[52,2],[52,2],[53,4],[53,4],[12,1],[12,2],[60,3],[61,2],[36,3],[36,3],[36,3],[36,3],[36,3],[36,3],[36,5],[36,3],[36,2],[36,1],[36,1],[69,3],[72,3],[50,1],[50,1],[50,1],[50,1],[50,1],[50,1],[50,1],[50,1],[25,1],[29,1],[77,1],[78,1],[74,1],[74,1],[22,1],[22,3],[79,1],[75,4],[76,3],[76,4],[89,1],[89,2],[63,1],[63,3],[17,1],[17,3],[90,1],[90,1],[90,3]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ @@ -341,42 +350,42 @@ switch (yystate) { case 1: return this.$ = $$[$0-1]; break; -case 2: case 4: case 5: case 6: case 11: case 53: case 66: case 67: case 70: case 71: case 72: case 73: case 74: case 75: case 76: +case 2: case 4: case 5: case 6: case 11: case 53: case 66: case 67: case 70: case 71: case 72: case 73: case 74: case 75: case 76: case 77: this.$ = $$[$0]; break; case 3: -this.$ = (function () { +this.$ = (function() { $$[$0-1].unions = $$[$0]; return $$[$0-1]; }()); break; case 7: -this.$ = (function () { +this.$ = (function() { $$[$0-1].order = $$[$0]; return $$[$0-1]; }()); break; case 8: -this.$ = (function () { +this.$ = (function() { $$[$0-1].group = $$[$0]; return $$[$0-1]; }()); break; case 9: -this.$ = (function () { +this.$ = (function() { $$[$0-2].group = $$[$0-1]; $$[$0-2].order = $$[$0]; return $$[$0-2]; }()); break; case 10: -this.$ = (function () { +this.$ = (function() { $$[$0-1].limit = $$[$0]; return $$[$0-1]; }()); break; case 12: -this.$ = (function () { +this.$ = (function() { $$[$0-1].where = $$[$0]; return $$[$0-1]; }()); @@ -414,7 +423,7 @@ break; case 23: this.$ = new yy.Table($$[$0-5], null, $$[$0-4], $$[$0-3], $$[$0-1]); break; -case 24: case 28: case 43: case 90: case 92: +case 24: case 28: case 43: case 92: case 94: this.$ = [$$[$0]]; break; case 25: @@ -468,7 +477,7 @@ break; case 42: this.$ = new yy.Order($$[$0-1], $$[$0]); break; -case 44: case 91: case 93: +case 44: case 93: case 95: this.$ = $$[$0-2].concat($$[$0]); break; case 45: @@ -484,7 +493,7 @@ case 48: this.$ = new yy.Offset($$[$0-1], $$[$0]); break; case 54: -this.$ = (function () { +this.$ = (function() { $$[$0-1].having = $$[$0]; return $$[$0-1]; }()); @@ -507,59 +516,62 @@ break; case 68: this.$ = new yy.BetweenOp([$$[$0-2], $$[$0]]); break; -case 77: +case 78: this.$ = new yy.ListValue($$[$0]); break; -case 78: +case 79: this.$ = new yy.NumberValue($$[$0]); break; -case 79: +case 80: this.$ = new yy.BooleanValue($$[$0]); break; -case 80: +case 81: this.$ = new yy.ParameterValue($$[$0]); break; -case 81: +case 82: this.$ = new yy.StringValue($$[$0], "'"); break; -case 82: +case 83: this.$ = new yy.StringValue($$[$0], '"'); break; -case 83: +case 84: this.$ = new yy.LiteralValue($$[$0]); break; -case 84: +case 85: this.$ = new yy.LiteralValue($$[$0-2], $$[$0]); break; -case 85: +case 86: +this.$ = new yy.VariableValue($$[$0], "{", "}"); +break; +case 87: this.$ = new yy.FunctionValue($$[$0-3], $$[$0-1]); break; -case 86: +case 88: this.$ = new yy.FunctionValue($$[$0-2], null, true); break; -case 87: +case 89: this.$ = new yy.FunctionValue($$[$0-3], $$[$0-1], true); break; -case 88: +case 90: this.$ = new yy.ArgumentListValue($$[$0]); break; -case 89: +case 91: this.$ = new yy.ArgumentListValue($$[$0], true); break; -case 94: +case 96: this.$ = new yy.Star(); break; -case 95: +case 97: this.$ = new yy.Field($$[$0]); break; -case 96: +case 98: this.$ = new yy.Field($$[$0-2], $$[$0]); break; } }, -table: [{3:1,4:2,6:3,8:4,9:5,10:6,14:7,16:$V0},{1:[3]},{5:[1,9]},o($V1,[2,2],{7:10,13:11,30:12,31:$V2,42:$V3}),o($V4,[2,4]),o($V4,[2,5]),o($V4,[2,6],{11:15,12:16,60:18,45:$V5,62:[1,19]}),o($V6,[2,11],{15:20,41:[1,21]}),{17:22,20:[1,23],22:31,24:$V7,29:32,36:26,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf,88:24,89:$Vg},{1:[2,1]},o($V1,[2,3],{30:45,31:$V2}),o($V4,[2,10]),o($Vh,[2,24]),{29:46,79:$V9},{6:47,8:4,9:5,10:6,14:7,16:$V0,32:[1,48]},o($V4,[2,7]),o($V4,[2,8],{11:49,45:$V5}),{46:[1,50]},o($Vi,[2,53],{61:51,64:[1,52]}),{46:[1,53]},o($V6,[2,12]),{22:31,24:$V7,29:32,36:54,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{18:[1,55],43:$Vj},{17:57,22:31,24:$V7,29:32,36:26,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf,88:24,89:$Vg},o($Vk,[2,92]),o($Vk,[2,94]),o($Vk,[2,95],{23:[1,58],65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),{4:65,6:3,8:4,9:5,10:6,14:7,16:$V0,22:31,24:$V7,29:32,36:64,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($Vq,[2,67],{71:[1,66]}),{24:[1,68],72:67},o($Vq,[2,66]),o($Vr,[2,70],{85:$Vs}),o($Vr,[2,71]),o($Vr,[2,72]),o($Vr,[2,73]),o($Vr,[2,74]),o($Vr,[2,75]),o($Vr,[2,76]),o([5,18,23,26,31,34,37,38,41,42,43,44,45,51,62,64,65,66,67,68,70,71,85],$Vt,{24:[1,70]}),o([5,18,23,26,31,34,37,38,41,42,43,44,45,51,54,55,62,64,65,66,67,68,70,71],[2,78]),o($Vr,[2,81]),o($Vr,[2,82]),{24:[1,71]},o($Vr,[2,79]),o($Vr,[2,80]),o($Vh,[2,25]),o($V4,[2,38],{43:[1,72],44:[1,73]}),o($Vh,[2,26],{13:11,42:$V3}),{6:74,8:4,9:5,10:6,14:7,16:$V0},o($V4,[2,9]),{22:31,29:32,47:75,49:76,50:77,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($Vi,[2,54]),{22:31,24:$V7,29:32,36:78,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:80,50:28,63:79,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($V6,[2,37],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),{19:81,22:82,24:$Vu,84:$Vv},{22:31,24:$V7,29:32,36:26,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf,88:85,89:$Vg},{18:[1,86],43:$Vj},{22:87,84:$Vv},{22:31,24:$V7,29:32,36:88,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:89,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:90,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:92,50:28,69:91,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:93,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{26:[1,94],65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp},{26:[1,95]},{24:[1,96],72:97},o($Vq,[2,65]),{4:65,6:3,8:4,9:5,10:6,14:7,16:$V0},{84:[1,98]},{20:$Vw,22:31,24:$V7,26:[1,99],29:32,36:80,50:28,63:101,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf,87:100},{20:$Vw,22:31,24:$V7,29:32,36:80,50:28,63:101,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf,87:103},{29:104,79:$V9},{29:105,79:$V9},o($Vh,[2,27],{13:11,42:$V3}),o($V4,[2,41],{48:106,43:[1,107],44:[1,108]}),o($Vx,[2,43]),o($Vx,[2,45],{51:[1,109]}),o($Vi,[2,56],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),o([5,26,31,42,45,64],[2,55],{43:$Vy}),o($Vz,[2,90],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),o($VA,[2,13],{21:111,33:112,34:$VB,37:$VC,38:$VD}),o($VE,[2,17],{22:116,23:[1,117],27:[1,118],84:$Vv,85:$Vs}),{4:120,6:3,8:4,9:5,10:6,14:7,16:$V0,22:31,24:$V7,25:119,29:32,36:80,50:28,63:121,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o([5,18,23,26,27,31,34,35,37,38,41,42,43,45,62,84,85],$Vt),o($Vk,[2,93]),{19:122,22:82,24:$Vu,84:$Vv},o($Vk,[2,96],{85:$Vs}),o([5,18,23,26,31,34,37,38,41,42,43,45,62,64,65,67,70],[2,58],{66:$Vm,68:$Vo}),o([5,18,23,26,31,34,37,38,41,42,43,45,62,64,65,66,67,70],[2,59],{68:$Vo}),o([5,18,23,26,31,34,37,38,41,42,43,45,62,64,67,70],[2,60],{65:$Vl,66:$Vm,68:$Vo}),o($Vq,[2,61]),{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:[1,123]},o($VF,[2,62],{65:$Vl,66:$Vm,67:$Vn,68:$Vo}),o($Vq,[2,57]),o($Vq,[2,69]),{4:65,6:3,8:4,9:5,10:6,14:7,16:$V0,22:31,24:$V7,25:124,29:32,36:80,50:28,63:121,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($Vq,[2,64]),o([5,18,23,26,27,31,34,35,37,38,41,42,43,44,45,51,62,64,65,66,67,68,70,71,84,85],[2,84]),o($Vr,[2,86]),{26:[1,125]},{26:[2,88],43:$Vy},{22:31,24:$V7,29:32,36:80,50:28,63:126,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{26:[1,127]},o($V4,[2,39]),o($V4,[2,40]),o($V4,[2,42]),{22:31,29:32,49:128,50:77,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{29:130,52:129,79:$V9},o($Vx,[2,46]),{22:31,29:32,50:131,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($VA,[2,15],{33:132,34:$VB,37:$VC,38:$VD}),o($VG,[2,28]),{19:133,22:82,24:$Vu,84:$Vv},{34:[1,134],39:[1,135],40:[1,136]},{34:[1,137],39:[1,138],40:[1,139]},o($VE,[2,18],{85:$Vs}),{22:140,84:$Vv},{28:[1,141]},{26:[1,142]},{26:[1,143]},{26:[2,77],43:$Vy},o($VA,[2,14],{33:112,21:144,34:$VB,37:$VC,38:$VD}),{22:31,24:$V7,29:32,36:145,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{26:[1,146]},o($Vr,[2,87]),{26:[2,89],43:$Vy},o($Vr,[2,85]),o($Vx,[2,44]),o($V4,[2,47],{53:147,56:[1,148]}),{54:[1,149],55:[1,150]},o($Vz,[2,91]),o($VG,[2,29]),{35:[1,151]},{19:152,22:82,24:$Vu,84:$Vv},{34:[1,153]},{34:[1,154]},{19:155,22:82,24:$Vu,84:$Vv},{34:[1,156]},{34:[1,157]},o($VE,[2,19],{85:$Vs}),{24:[1,158]},o($VE,[2,20]),o($VE,[2,21],{22:159,84:$Vv}),o($VA,[2,16],{33:132,34:$VB,37:$VC,38:$VD}),o($VF,[2,68],{65:$Vl,66:$Vm,67:$Vn,68:$Vo}),o($Vq,[2,63]),o($V4,[2,48]),{57:[1,160],59:[1,161]},o($VH,[2,49]),o($VH,[2,50]),{22:31,24:$V7,29:32,36:162,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{35:[1,163]},{19:164,22:82,24:$Vu,84:$Vv},{19:165,22:82,24:$Vu,84:$Vv},{35:[1,166]},{19:167,22:82,24:$Vu,84:$Vv},{19:168,22:82,24:$Vu,84:$Vv},{29:169,79:$V9},o($VE,[2,22],{85:$Vs}),{29:130,52:170,79:$V9},{29:130,52:171,79:$V9},o($VG,[2,30],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),{22:31,24:$V7,29:32,36:172,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{35:[1,173]},{35:[1,174]},{22:31,24:$V7,29:32,36:175,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{35:[1,176]},{35:[1,177]},{26:[1,178]},{58:[1,179]},{58:[1,180]},o($VG,[2,31],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),{22:31,24:$V7,29:32,36:181,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:182,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($VG,[2,32],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),{22:31,24:$V7,29:32,36:183,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:184,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($VE,[2,23]),o($V4,[2,51]),o($V4,[2,52]),o($VG,[2,33],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),o($VG,[2,35],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),o($VG,[2,34],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),o($VG,[2,36],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp})], +table: [{3:1,4:2,6:3,8:4,9:5,10:6,14:7,16:$V0},{1:[3]},{5:[1,9]},o($V1,[2,2],{7:10,13:11,30:12,31:$V2,42:$V3}),o($V4,[2,4]),o($V4,[2,5]),o($V4,[2,6],{11:15,12:16,60:18,45:$V5,62:[1,19]}),o($V6,[2,11],{15:20,41:[1,21]}),{17:22,20:[1,23],22:31,24:$V7,29:32,36:26,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg,90:24,91:$Vh},{1:[2,1]},o($V1,[2,3],{30:47,31:$V2}),o($V4,[2,10]),o($Vi,[2,24]),{29:48,80:$V9},{6:49,8:4,9:5,10:6,14:7,16:$V0,32:[1,50]},o($V4,[2,7]),o($V4,[2,8],{11:51,45:$V5}),{46:[1,52]},o($Vj,[2,53],{61:53,64:[1,54]}),{46:[1,55]},o($V6,[2,12]),{22:31,24:$V7,29:32,36:56,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{18:[1,57],43:$Vk},{17:59,22:31,24:$V7,29:32,36:26,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg,90:24,91:$Vh},o($Vl,[2,94]),o($Vl,[2,96]),o($Vl,[2,97],{23:[1,60],65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),{4:67,6:3,8:4,9:5,10:6,14:7,16:$V0,22:31,24:$V7,29:32,36:66,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($Vr,[2,67],{71:[1,68]}),{24:[1,70],72:69},o($Vr,[2,66]),o($Vs,[2,70],{86:$Vt}),o($Vs,[2,71]),o($Vs,[2,72]),o($Vs,[2,73]),o($Vs,[2,74]),o($Vs,[2,75]),o($Vs,[2,76]),o($Vs,[2,77]),o([5,18,23,26,31,34,37,38,41,42,43,44,45,51,62,64,65,66,67,68,70,71,86],$Vu,{24:[1,72]}),o([5,18,23,26,31,34,37,38,41,42,43,44,45,51,54,55,62,64,65,66,67,68,70,71],[2,79]),o($Vs,[2,82]),o($Vs,[2,83]),{24:[1,73]},o($Vs,[2,80]),o($Vs,[2,81]),o($Vs,[2,86]),o($Vi,[2,25]),o($V4,[2,38],{43:[1,74],44:[1,75]}),o($Vi,[2,26],{13:11,42:$V3}),{6:76,8:4,9:5,10:6,14:7,16:$V0},o($V4,[2,9]),{22:31,29:32,47:77,49:78,50:79,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($Vj,[2,54]),{22:31,24:$V7,29:32,36:80,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:82,50:28,63:81,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($V6,[2,37],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),{19:83,22:84,24:$Vv,85:$Vw},{22:31,24:$V7,29:32,36:26,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg,90:87,91:$Vh},{18:[1,88],43:$Vk},{22:89,85:$Vw},{22:31,24:$V7,29:32,36:90,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:91,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:92,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:94,50:28,69:93,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:95,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{26:[1,96],65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq},{26:[1,97]},{24:[1,98],72:99},o($Vr,[2,65]),{4:67,6:3,8:4,9:5,10:6,14:7,16:$V0},{85:[1,100]},{20:$Vx,22:31,24:$V7,26:[1,101],29:32,36:82,50:28,63:103,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg,89:102},{20:$Vx,22:31,24:$V7,29:32,36:82,50:28,63:103,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg,89:105},{29:106,80:$V9},{29:107,80:$V9},o($Vi,[2,27],{13:11,42:$V3}),o($V4,[2,41],{48:108,43:[1,109],44:[1,110]}),o($Vy,[2,43]),o($Vy,[2,45],{51:[1,111]}),o($Vj,[2,56],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),o([5,26,31,42,45,64],[2,55],{43:$Vz}),o($VA,[2,92],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),o($VB,[2,13],{21:113,33:114,34:$VC,37:$VD,38:$VE}),o($VF,[2,17],{22:118,23:[1,119],27:[1,120],85:$Vw,86:$Vt}),{4:122,6:3,8:4,9:5,10:6,14:7,16:$V0,22:31,24:$V7,25:121,29:32,36:82,50:28,63:123,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o([5,18,23,26,27,31,34,35,37,38,41,42,43,45,62,85,86],$Vu),o($Vl,[2,95]),{19:124,22:84,24:$Vv,85:$Vw},o($Vl,[2,98],{86:$Vt}),o([5,18,23,26,31,34,37,38,41,42,43,45,62,64,65,67,70],[2,58],{66:$Vn,68:$Vp}),o([5,18,23,26,31,34,37,38,41,42,43,45,62,64,65,66,67,70],[2,59],{68:$Vp}),o([5,18,23,26,31,34,37,38,41,42,43,45,62,64,67,70],[2,60],{65:$Vm,66:$Vn,68:$Vp}),o($Vr,[2,61]),{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:[1,125]},o($VG,[2,62],{65:$Vm,66:$Vn,67:$Vo,68:$Vp}),o($Vr,[2,57]),o($Vr,[2,69]),{4:67,6:3,8:4,9:5,10:6,14:7,16:$V0,22:31,24:$V7,25:126,29:32,36:82,50:28,63:123,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($Vr,[2,64]),o([5,18,23,26,27,31,34,35,37,38,41,42,43,44,45,51,62,64,65,66,67,68,70,71,85,86],[2,85]),o($Vs,[2,88]),{26:[1,127]},{26:[2,90],43:$Vz},{22:31,24:$V7,29:32,36:82,50:28,63:128,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{26:[1,129]},o($V4,[2,39]),o($V4,[2,40]),o($V4,[2,42]),{22:31,29:32,49:130,50:79,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{29:132,52:131,80:$V9},o($Vy,[2,46]),{22:31,29:32,50:133,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($VB,[2,15],{33:134,34:$VC,37:$VD,38:$VE}),o($VH,[2,28]),{19:135,22:84,24:$Vv,85:$Vw},{34:[1,136],39:[1,137],40:[1,138]},{34:[1,139],39:[1,140],40:[1,141]},o($VF,[2,18],{86:$Vt}),{22:142,85:$Vw},{28:[1,143]},{26:[1,144]},{26:[1,145]},{26:[2,78],43:$Vz},o($VB,[2,14],{33:114,21:146,34:$VC,37:$VD,38:$VE}),{22:31,24:$V7,29:32,36:147,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{26:[1,148]},o($Vs,[2,89]),{26:[2,91],43:$Vz},o($Vs,[2,87]),o($Vy,[2,44]),o($V4,[2,47],{53:149,56:[1,150]}),{54:[1,151],55:[1,152]},o($VA,[2,93]),o($VH,[2,29]),{35:[1,153]},{19:154,22:84,24:$Vv,85:$Vw},{34:[1,155]},{34:[1,156]},{19:157,22:84,24:$Vv,85:$Vw},{34:[1,158]},{34:[1,159]},o($VF,[2,19],{86:$Vt}),{24:[1,160]},o($VF,[2,20]),o($VF,[2,21],{22:161,85:$Vw}),o($VB,[2,16],{33:134,34:$VC,37:$VD,38:$VE}),o($VG,[2,68],{65:$Vm,66:$Vn,67:$Vo,68:$Vp}),o($Vr,[2,63]),o($V4,[2,48]),{57:[1,162],59:[1,163]},o($VI,[2,49]),o($VI,[2,50]),{22:31,24:$V7,29:32,36:164,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{35:[1,165]},{19:166,22:84,24:$Vv,85:$Vw},{19:167,22:84,24:$Vv,85:$Vw},{35:[1,168]},{19:169,22:84,24:$Vv,85:$Vw},{19:170,22:84,24:$Vv,85:$Vw},{29:171,80:$V9},o($VF,[2,22],{86:$Vt}),{29:132,52:172,80:$V9},{29:132,52:173,80:$V9},o($VH,[2,30],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),{22:31,24:$V7,29:32,36:174,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{35:[1,175]},{35:[1,176]},{22:31,24:$V7,29:32,36:177,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{35:[1,178]},{35:[1,179]},{26:[1,180]},{58:[1,181]},{58:[1,182]},o($VH,[2,31],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),{22:31,24:$V7,29:32,36:183,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:184,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($VH,[2,32],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),{22:31,24:$V7,29:32,36:185,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:186,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($VF,[2,23]),o($V4,[2,51]),o($V4,[2,52]),o($VH,[2,33],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),o($VH,[2,35],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),o($VH,[2,34],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),o($VH,[2,36],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq})], defaultActions: {9:[2,1]}, -parseError: function parseError(str, hash) { +parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { @@ -716,7 +728,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { exports.parser = parser; exports.Parser = parser.Parser; exports.parse = function () { return parser.parse.apply(parser, arguments); }; -exports.main = function commonjsMain(args) { +exports.main = function commonjsMain (args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); @@ -732,7 +744,7 @@ if (typeof module !== 'undefined' && require.main === module) { var exports = this; // Generated by CoffeeScript 1.8.0 (function() { - var ArgumentListValue, BetweenOp, Field, FunctionValue, Group, Having, Join, Limit, ListValue, LiteralValue, Offset, Op, Order, OrderArgument, ParameterValue, Select, Star, StringValue, SubSelect, Table, UnaryOp, Union, Where, indent; + var ArgumentListValue, BetweenOp, Field, FunctionValue, Group, Having, Join, Limit, ListValue, LiteralValue, Offset, Op, Order, OrderArgument, ParameterValue, Select, Star, StringValue, SubSelect, Table, UnaryOp, Union, VariableValue, Where, indent; indent = function(str) { var line; @@ -856,6 +868,24 @@ if (typeof module !== 'undefined' && require.main === module) { })(); + exports.VariableValue = VariableValue = (function() { + function VariableValue(value, openingDelimiter, closingDelimiter) { + this.value = value; + this.openingDelimiter = openingDelimiter != null ? openingDelimiter : "{"; + if (closingDelimiter == null) { + closingDelimiter = "}"; + } + null; + } + + VariableValue.prototype.toString = function() { + return "" + this.openingDelimiter + this.value + this.closingDelimiter; + }; + + return VariableValue; + + })(); + exports.LiteralValue = LiteralValue = (function() { function LiteralValue(value, value2) { this.value = value; diff --git a/lib/compiled_parser.js b/lib/compiled_parser.js index 0e32d9b..b59b715 100644 --- a/lib/compiled_parser.js +++ b/lib/compiled_parser.js @@ -72,12 +72,12 @@ } */ var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,8],$V1=[5,26],$V2=[1,14],$V3=[1,13],$V4=[5,26,31,42],$V5=[1,17],$V6=[5,26,31,42,45,62],$V7=[1,27],$V8=[1,29],$V9=[1,39],$Va=[1,43],$Vb=[1,44],$Vc=[1,40],$Vd=[1,41],$Ve=[1,38],$Vf=[1,42],$Vg=[1,25],$Vh=[5,26,31],$Vi=[5,26,31,42,45],$Vj=[1,56],$Vk=[18,43],$Vl=[1,59],$Vm=[1,60],$Vn=[1,61],$Vo=[1,62],$Vp=[1,63],$Vq=[5,18,23,26,31,34,37,38,41,42,43,45,62,64,65,66,67,68,70],$Vr=[5,18,23,26,31,34,37,38,41,42,43,44,45,51,62,64,65,66,67,68,70,71],$Vs=[1,69],$Vt=[2,83],$Vu=[1,83],$Vv=[1,84],$Vw=[1,102],$Vx=[5,26,31,42,43,44],$Vy=[1,110],$Vz=[5,26,31,42,43,45,64],$VA=[5,26,31,41,42,45,62],$VB=[1,113],$VC=[1,114],$VD=[1,115],$VE=[5,26,31,34,35,37,38,41,42,45,62],$VF=[5,18,23,26,31,34,37,38,41,42,43,45,62,64,70],$VG=[5,26,31,34,37,38,41,42,45,62],$VH=[5,26,31,42,56,58]; -var parser = {trace: function trace() { }, +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,8],$V1=[5,26],$V2=[1,14],$V3=[1,13],$V4=[5,26,31,42],$V5=[1,17],$V6=[5,26,31,42,45,62],$V7=[1,27],$V8=[1,29],$V9=[1,40],$Va=[1,44],$Vb=[1,45],$Vc=[1,41],$Vd=[1,42],$Ve=[1,39],$Vf=[1,46],$Vg=[1,43],$Vh=[1,25],$Vi=[5,26,31],$Vj=[5,26,31,42,45],$Vk=[1,58],$Vl=[18,43],$Vm=[1,61],$Vn=[1,62],$Vo=[1,63],$Vp=[1,64],$Vq=[1,65],$Vr=[5,18,23,26,31,34,37,38,41,42,43,45,62,64,65,66,67,68,70],$Vs=[5,18,23,26,31,34,37,38,41,42,43,44,45,51,62,64,65,66,67,68,70,71],$Vt=[1,71],$Vu=[2,84],$Vv=[1,85],$Vw=[1,86],$Vx=[1,104],$Vy=[5,26,31,42,43,44],$Vz=[1,112],$VA=[5,26,31,42,43,45,64],$VB=[5,26,31,41,42,45,62],$VC=[1,115],$VD=[1,116],$VE=[1,117],$VF=[5,26,31,34,35,37,38,41,42,45,62],$VG=[5,18,23,26,31,34,37,38,41,42,43,45,62,64,70],$VH=[5,26,31,34,37,38,41,42,45,62],$VI=[5,26,31,42,56,58]; +var parser = {trace: function trace () { }, yy: {}, -symbols_: {"error":2,"Root":3,"Query":4,"EOF":5,"SelectQuery":6,"Unions":7,"SelectWithLimitQuery":8,"BasicSelectQuery":9,"Select":10,"OrderClause":11,"GroupClause":12,"LimitClause":13,"SelectClause":14,"WhereClause":15,"SELECT":16,"Fields":17,"FROM":18,"Table":19,"DISTINCT":20,"Joins":21,"Literal":22,"AS":23,"LEFT_PAREN":24,"List":25,"RIGHT_PAREN":26,"WINDOW":27,"WINDOW_FUNCTION":28,"Number":29,"Union":30,"UNION":31,"ALL":32,"Join":33,"JOIN":34,"ON":35,"Expression":36,"LEFT":37,"RIGHT":38,"INNER":39,"OUTER":40,"WHERE":41,"LIMIT":42,"SEPARATOR":43,"OFFSET":44,"ORDER":45,"BY":46,"OrderArgs":47,"OffsetClause":48,"OrderArg":49,"Value":50,"DIRECTION":51,"OffsetRows":52,"FetchClause":53,"ROW":54,"ROWS":55,"FETCH":56,"FIRST":57,"ONLY":58,"NEXT":59,"GroupBasicClause":60,"HavingClause":61,"GROUP":62,"ArgumentList":63,"HAVING":64,"MATH":65,"MATH_MULTI":66,"OPERATOR":67,"BETWEEN":68,"BetweenExpression":69,"CONDITIONAL":70,"SUB_SELECT_OP":71,"SubSelectExpression":72,"SUB_SELECT_UNARY_OP":73,"String":74,"Function":75,"UserFunction":76,"Boolean":77,"Parameter":78,"NUMBER":79,"BOOLEAN":80,"PARAMETER":81,"STRING":82,"DBLSTRING":83,"LITERAL":84,"DOT":85,"FUNCTION":86,"AggregateArgumentList":87,"Field":88,"STAR":89,"$accept":0,"$end":1}, -terminals_: {2:"error",5:"EOF",16:"SELECT",18:"FROM",20:"DISTINCT",23:"AS",24:"LEFT_PAREN",26:"RIGHT_PAREN",27:"WINDOW",28:"WINDOW_FUNCTION",31:"UNION",32:"ALL",34:"JOIN",35:"ON",37:"LEFT",38:"RIGHT",39:"INNER",40:"OUTER",41:"WHERE",42:"LIMIT",43:"SEPARATOR",44:"OFFSET",45:"ORDER",46:"BY",51:"DIRECTION",54:"ROW",55:"ROWS",56:"FETCH",57:"FIRST",58:"ONLY",59:"NEXT",62:"GROUP",64:"HAVING",65:"MATH",66:"MATH_MULTI",67:"OPERATOR",68:"BETWEEN",70:"CONDITIONAL",71:"SUB_SELECT_OP",73:"SUB_SELECT_UNARY_OP",79:"NUMBER",80:"BOOLEAN",81:"PARAMETER",82:"STRING",83:"DBLSTRING",84:"LITERAL",85:"DOT",86:"FUNCTION",89:"STAR"}, -productions_: [0,[3,2],[4,1],[4,2],[6,1],[6,1],[9,1],[9,2],[9,2],[9,3],[8,2],[10,1],[10,2],[14,4],[14,5],[14,5],[14,6],[19,1],[19,2],[19,3],[19,3],[19,3],[19,4],[19,6],[7,1],[7,2],[30,2],[30,3],[21,1],[21,2],[33,4],[33,5],[33,5],[33,6],[33,6],[33,6],[33,6],[15,2],[13,2],[13,4],[13,4],[11,3],[11,4],[47,1],[47,3],[49,1],[49,2],[48,2],[48,3],[52,2],[52,2],[53,4],[53,4],[12,1],[12,2],[60,3],[61,2],[36,3],[36,3],[36,3],[36,3],[36,3],[36,3],[36,5],[36,3],[36,2],[36,1],[36,1],[69,3],[72,3],[50,1],[50,1],[50,1],[50,1],[50,1],[50,1],[50,1],[25,1],[29,1],[77,1],[78,1],[74,1],[74,1],[22,1],[22,3],[75,4],[76,3],[76,4],[87,1],[87,2],[63,1],[63,3],[17,1],[17,3],[88,1],[88,1],[88,3]], +symbols_: {"error":2,"Root":3,"Query":4,"EOF":5,"SelectQuery":6,"Unions":7,"SelectWithLimitQuery":8,"BasicSelectQuery":9,"Select":10,"OrderClause":11,"GroupClause":12,"LimitClause":13,"SelectClause":14,"WhereClause":15,"SELECT":16,"Fields":17,"FROM":18,"Table":19,"DISTINCT":20,"Joins":21,"Literal":22,"AS":23,"LEFT_PAREN":24,"List":25,"RIGHT_PAREN":26,"WINDOW":27,"WINDOW_FUNCTION":28,"Number":29,"Union":30,"UNION":31,"ALL":32,"Join":33,"JOIN":34,"ON":35,"Expression":36,"LEFT":37,"RIGHT":38,"INNER":39,"OUTER":40,"WHERE":41,"LIMIT":42,"SEPARATOR":43,"OFFSET":44,"ORDER":45,"BY":46,"OrderArgs":47,"OffsetClause":48,"OrderArg":49,"Value":50,"DIRECTION":51,"OffsetRows":52,"FetchClause":53,"ROW":54,"ROWS":55,"FETCH":56,"FIRST":57,"ONLY":58,"NEXT":59,"GroupBasicClause":60,"HavingClause":61,"GROUP":62,"ArgumentList":63,"HAVING":64,"MATH":65,"MATH_MULTI":66,"OPERATOR":67,"BETWEEN":68,"BetweenExpression":69,"CONDITIONAL":70,"SUB_SELECT_OP":71,"SubSelectExpression":72,"SUB_SELECT_UNARY_OP":73,"String":74,"Function":75,"UserFunction":76,"Boolean":77,"Parameter":78,"Variable":79,"NUMBER":80,"BOOLEAN":81,"PARAMETER":82,"STRING":83,"DBLSTRING":84,"LITERAL":85,"DOT":86,"VARIABLE":87,"FUNCTION":88,"AggregateArgumentList":89,"Field":90,"STAR":91,"$accept":0,"$end":1}, +terminals_: {2:"error",5:"EOF",16:"SELECT",18:"FROM",20:"DISTINCT",23:"AS",24:"LEFT_PAREN",26:"RIGHT_PAREN",27:"WINDOW",28:"WINDOW_FUNCTION",31:"UNION",32:"ALL",34:"JOIN",35:"ON",37:"LEFT",38:"RIGHT",39:"INNER",40:"OUTER",41:"WHERE",42:"LIMIT",43:"SEPARATOR",44:"OFFSET",45:"ORDER",46:"BY",51:"DIRECTION",54:"ROW",55:"ROWS",56:"FETCH",57:"FIRST",58:"ONLY",59:"NEXT",62:"GROUP",64:"HAVING",65:"MATH",66:"MATH_MULTI",67:"OPERATOR",68:"BETWEEN",70:"CONDITIONAL",71:"SUB_SELECT_OP",73:"SUB_SELECT_UNARY_OP",80:"NUMBER",81:"BOOLEAN",82:"PARAMETER",83:"STRING",84:"DBLSTRING",85:"LITERAL",86:"DOT",87:"VARIABLE",88:"FUNCTION",91:"STAR"}, +productions_: [0,[3,2],[4,1],[4,2],[6,1],[6,1],[9,1],[9,2],[9,2],[9,3],[8,2],[10,1],[10,2],[14,4],[14,5],[14,5],[14,6],[19,1],[19,2],[19,3],[19,3],[19,3],[19,4],[19,6],[7,1],[7,2],[30,2],[30,3],[21,1],[21,2],[33,4],[33,5],[33,5],[33,6],[33,6],[33,6],[33,6],[15,2],[13,2],[13,4],[13,4],[11,3],[11,4],[47,1],[47,3],[49,1],[49,2],[48,2],[48,3],[52,2],[52,2],[53,4],[53,4],[12,1],[12,2],[60,3],[61,2],[36,3],[36,3],[36,3],[36,3],[36,3],[36,3],[36,5],[36,3],[36,2],[36,1],[36,1],[69,3],[72,3],[50,1],[50,1],[50,1],[50,1],[50,1],[50,1],[50,1],[50,1],[25,1],[29,1],[77,1],[78,1],[74,1],[74,1],[22,1],[22,3],[79,1],[75,4],[76,3],[76,4],[89,1],[89,2],[63,1],[63,3],[17,1],[17,3],[90,1],[90,1],[90,3]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ @@ -86,42 +86,42 @@ switch (yystate) { case 1: return this.$ = $$[$0-1]; break; -case 2: case 4: case 5: case 6: case 11: case 53: case 66: case 67: case 70: case 71: case 72: case 73: case 74: case 75: case 76: +case 2: case 4: case 5: case 6: case 11: case 53: case 66: case 67: case 70: case 71: case 72: case 73: case 74: case 75: case 76: case 77: this.$ = $$[$0]; break; case 3: -this.$ = (function () { +this.$ = (function() { $$[$0-1].unions = $$[$0]; return $$[$0-1]; }()); break; case 7: -this.$ = (function () { +this.$ = (function() { $$[$0-1].order = $$[$0]; return $$[$0-1]; }()); break; case 8: -this.$ = (function () { +this.$ = (function() { $$[$0-1].group = $$[$0]; return $$[$0-1]; }()); break; case 9: -this.$ = (function () { +this.$ = (function() { $$[$0-2].group = $$[$0-1]; $$[$0-2].order = $$[$0]; return $$[$0-2]; }()); break; case 10: -this.$ = (function () { +this.$ = (function() { $$[$0-1].limit = $$[$0]; return $$[$0-1]; }()); break; case 12: -this.$ = (function () { +this.$ = (function() { $$[$0-1].where = $$[$0]; return $$[$0-1]; }()); @@ -159,7 +159,7 @@ break; case 23: this.$ = new yy.Table($$[$0-5], null, $$[$0-4], $$[$0-3], $$[$0-1]); break; -case 24: case 28: case 43: case 90: case 92: +case 24: case 28: case 43: case 92: case 94: this.$ = [$$[$0]]; break; case 25: @@ -213,7 +213,7 @@ break; case 42: this.$ = new yy.Order($$[$0-1], $$[$0]); break; -case 44: case 91: case 93: +case 44: case 93: case 95: this.$ = $$[$0-2].concat($$[$0]); break; case 45: @@ -229,7 +229,7 @@ case 48: this.$ = new yy.Offset($$[$0-1], $$[$0]); break; case 54: -this.$ = (function () { +this.$ = (function() { $$[$0-1].having = $$[$0]; return $$[$0-1]; }()); @@ -252,59 +252,62 @@ break; case 68: this.$ = new yy.BetweenOp([$$[$0-2], $$[$0]]); break; -case 77: +case 78: this.$ = new yy.ListValue($$[$0]); break; -case 78: +case 79: this.$ = new yy.NumberValue($$[$0]); break; -case 79: +case 80: this.$ = new yy.BooleanValue($$[$0]); break; -case 80: +case 81: this.$ = new yy.ParameterValue($$[$0]); break; -case 81: +case 82: this.$ = new yy.StringValue($$[$0], "'"); break; -case 82: +case 83: this.$ = new yy.StringValue($$[$0], '"'); break; -case 83: +case 84: this.$ = new yy.LiteralValue($$[$0]); break; -case 84: +case 85: this.$ = new yy.LiteralValue($$[$0-2], $$[$0]); break; -case 85: +case 86: +this.$ = new yy.VariableValue($$[$0], "{", "}"); +break; +case 87: this.$ = new yy.FunctionValue($$[$0-3], $$[$0-1]); break; -case 86: +case 88: this.$ = new yy.FunctionValue($$[$0-2], null, true); break; -case 87: +case 89: this.$ = new yy.FunctionValue($$[$0-3], $$[$0-1], true); break; -case 88: +case 90: this.$ = new yy.ArgumentListValue($$[$0]); break; -case 89: +case 91: this.$ = new yy.ArgumentListValue($$[$0], true); break; -case 94: +case 96: this.$ = new yy.Star(); break; -case 95: +case 97: this.$ = new yy.Field($$[$0]); break; -case 96: +case 98: this.$ = new yy.Field($$[$0-2], $$[$0]); break; } }, -table: [{3:1,4:2,6:3,8:4,9:5,10:6,14:7,16:$V0},{1:[3]},{5:[1,9]},o($V1,[2,2],{7:10,13:11,30:12,31:$V2,42:$V3}),o($V4,[2,4]),o($V4,[2,5]),o($V4,[2,6],{11:15,12:16,60:18,45:$V5,62:[1,19]}),o($V6,[2,11],{15:20,41:[1,21]}),{17:22,20:[1,23],22:31,24:$V7,29:32,36:26,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf,88:24,89:$Vg},{1:[2,1]},o($V1,[2,3],{30:45,31:$V2}),o($V4,[2,10]),o($Vh,[2,24]),{29:46,79:$V9},{6:47,8:4,9:5,10:6,14:7,16:$V0,32:[1,48]},o($V4,[2,7]),o($V4,[2,8],{11:49,45:$V5}),{46:[1,50]},o($Vi,[2,53],{61:51,64:[1,52]}),{46:[1,53]},o($V6,[2,12]),{22:31,24:$V7,29:32,36:54,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{18:[1,55],43:$Vj},{17:57,22:31,24:$V7,29:32,36:26,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf,88:24,89:$Vg},o($Vk,[2,92]),o($Vk,[2,94]),o($Vk,[2,95],{23:[1,58],65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),{4:65,6:3,8:4,9:5,10:6,14:7,16:$V0,22:31,24:$V7,29:32,36:64,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($Vq,[2,67],{71:[1,66]}),{24:[1,68],72:67},o($Vq,[2,66]),o($Vr,[2,70],{85:$Vs}),o($Vr,[2,71]),o($Vr,[2,72]),o($Vr,[2,73]),o($Vr,[2,74]),o($Vr,[2,75]),o($Vr,[2,76]),o([5,18,23,26,31,34,37,38,41,42,43,44,45,51,62,64,65,66,67,68,70,71,85],$Vt,{24:[1,70]}),o([5,18,23,26,31,34,37,38,41,42,43,44,45,51,54,55,62,64,65,66,67,68,70,71],[2,78]),o($Vr,[2,81]),o($Vr,[2,82]),{24:[1,71]},o($Vr,[2,79]),o($Vr,[2,80]),o($Vh,[2,25]),o($V4,[2,38],{43:[1,72],44:[1,73]}),o($Vh,[2,26],{13:11,42:$V3}),{6:74,8:4,9:5,10:6,14:7,16:$V0},o($V4,[2,9]),{22:31,29:32,47:75,49:76,50:77,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($Vi,[2,54]),{22:31,24:$V7,29:32,36:78,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:80,50:28,63:79,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($V6,[2,37],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),{19:81,22:82,24:$Vu,84:$Vv},{22:31,24:$V7,29:32,36:26,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf,88:85,89:$Vg},{18:[1,86],43:$Vj},{22:87,84:$Vv},{22:31,24:$V7,29:32,36:88,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:89,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:90,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:92,50:28,69:91,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:93,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{26:[1,94],65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp},{26:[1,95]},{24:[1,96],72:97},o($Vq,[2,65]),{4:65,6:3,8:4,9:5,10:6,14:7,16:$V0},{84:[1,98]},{20:$Vw,22:31,24:$V7,26:[1,99],29:32,36:80,50:28,63:101,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf,87:100},{20:$Vw,22:31,24:$V7,29:32,36:80,50:28,63:101,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf,87:103},{29:104,79:$V9},{29:105,79:$V9},o($Vh,[2,27],{13:11,42:$V3}),o($V4,[2,41],{48:106,43:[1,107],44:[1,108]}),o($Vx,[2,43]),o($Vx,[2,45],{51:[1,109]}),o($Vi,[2,56],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),o([5,26,31,42,45,64],[2,55],{43:$Vy}),o($Vz,[2,90],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),o($VA,[2,13],{21:111,33:112,34:$VB,37:$VC,38:$VD}),o($VE,[2,17],{22:116,23:[1,117],27:[1,118],84:$Vv,85:$Vs}),{4:120,6:3,8:4,9:5,10:6,14:7,16:$V0,22:31,24:$V7,25:119,29:32,36:80,50:28,63:121,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o([5,18,23,26,27,31,34,35,37,38,41,42,43,45,62,84,85],$Vt),o($Vk,[2,93]),{19:122,22:82,24:$Vu,84:$Vv},o($Vk,[2,96],{85:$Vs}),o([5,18,23,26,31,34,37,38,41,42,43,45,62,64,65,67,70],[2,58],{66:$Vm,68:$Vo}),o([5,18,23,26,31,34,37,38,41,42,43,45,62,64,65,66,67,70],[2,59],{68:$Vo}),o([5,18,23,26,31,34,37,38,41,42,43,45,62,64,67,70],[2,60],{65:$Vl,66:$Vm,68:$Vo}),o($Vq,[2,61]),{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:[1,123]},o($VF,[2,62],{65:$Vl,66:$Vm,67:$Vn,68:$Vo}),o($Vq,[2,57]),o($Vq,[2,69]),{4:65,6:3,8:4,9:5,10:6,14:7,16:$V0,22:31,24:$V7,25:124,29:32,36:80,50:28,63:121,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($Vq,[2,64]),o([5,18,23,26,27,31,34,35,37,38,41,42,43,44,45,51,62,64,65,66,67,68,70,71,84,85],[2,84]),o($Vr,[2,86]),{26:[1,125]},{26:[2,88],43:$Vy},{22:31,24:$V7,29:32,36:80,50:28,63:126,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{26:[1,127]},o($V4,[2,39]),o($V4,[2,40]),o($V4,[2,42]),{22:31,29:32,49:128,50:77,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{29:130,52:129,79:$V9},o($Vx,[2,46]),{22:31,29:32,50:131,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($VA,[2,15],{33:132,34:$VB,37:$VC,38:$VD}),o($VG,[2,28]),{19:133,22:82,24:$Vu,84:$Vv},{34:[1,134],39:[1,135],40:[1,136]},{34:[1,137],39:[1,138],40:[1,139]},o($VE,[2,18],{85:$Vs}),{22:140,84:$Vv},{28:[1,141]},{26:[1,142]},{26:[1,143]},{26:[2,77],43:$Vy},o($VA,[2,14],{33:112,21:144,34:$VB,37:$VC,38:$VD}),{22:31,24:$V7,29:32,36:145,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{26:[1,146]},o($Vr,[2,87]),{26:[2,89],43:$Vy},o($Vr,[2,85]),o($Vx,[2,44]),o($V4,[2,47],{53:147,56:[1,148]}),{54:[1,149],55:[1,150]},o($Vz,[2,91]),o($VG,[2,29]),{35:[1,151]},{19:152,22:82,24:$Vu,84:$Vv},{34:[1,153]},{34:[1,154]},{19:155,22:82,24:$Vu,84:$Vv},{34:[1,156]},{34:[1,157]},o($VE,[2,19],{85:$Vs}),{24:[1,158]},o($VE,[2,20]),o($VE,[2,21],{22:159,84:$Vv}),o($VA,[2,16],{33:132,34:$VB,37:$VC,38:$VD}),o($VF,[2,68],{65:$Vl,66:$Vm,67:$Vn,68:$Vo}),o($Vq,[2,63]),o($V4,[2,48]),{57:[1,160],59:[1,161]},o($VH,[2,49]),o($VH,[2,50]),{22:31,24:$V7,29:32,36:162,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{35:[1,163]},{19:164,22:82,24:$Vu,84:$Vv},{19:165,22:82,24:$Vu,84:$Vv},{35:[1,166]},{19:167,22:82,24:$Vu,84:$Vv},{19:168,22:82,24:$Vu,84:$Vv},{29:169,79:$V9},o($VE,[2,22],{85:$Vs}),{29:130,52:170,79:$V9},{29:130,52:171,79:$V9},o($VG,[2,30],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),{22:31,24:$V7,29:32,36:172,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{35:[1,173]},{35:[1,174]},{22:31,24:$V7,29:32,36:175,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{35:[1,176]},{35:[1,177]},{26:[1,178]},{58:[1,179]},{58:[1,180]},o($VG,[2,31],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),{22:31,24:$V7,29:32,36:181,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:182,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($VG,[2,32],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),{22:31,24:$V7,29:32,36:183,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},{22:31,24:$V7,29:32,36:184,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:$V9,80:$Va,81:$Vb,82:$Vc,83:$Vd,84:$Ve,86:$Vf},o($VE,[2,23]),o($V4,[2,51]),o($V4,[2,52]),o($VG,[2,33],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),o($VG,[2,35],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),o($VG,[2,34],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp}),o($VG,[2,36],{65:$Vl,66:$Vm,67:$Vn,68:$Vo,70:$Vp})], +table: [{3:1,4:2,6:3,8:4,9:5,10:6,14:7,16:$V0},{1:[3]},{5:[1,9]},o($V1,[2,2],{7:10,13:11,30:12,31:$V2,42:$V3}),o($V4,[2,4]),o($V4,[2,5]),o($V4,[2,6],{11:15,12:16,60:18,45:$V5,62:[1,19]}),o($V6,[2,11],{15:20,41:[1,21]}),{17:22,20:[1,23],22:31,24:$V7,29:32,36:26,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg,90:24,91:$Vh},{1:[2,1]},o($V1,[2,3],{30:47,31:$V2}),o($V4,[2,10]),o($Vi,[2,24]),{29:48,80:$V9},{6:49,8:4,9:5,10:6,14:7,16:$V0,32:[1,50]},o($V4,[2,7]),o($V4,[2,8],{11:51,45:$V5}),{46:[1,52]},o($Vj,[2,53],{61:53,64:[1,54]}),{46:[1,55]},o($V6,[2,12]),{22:31,24:$V7,29:32,36:56,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{18:[1,57],43:$Vk},{17:59,22:31,24:$V7,29:32,36:26,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg,90:24,91:$Vh},o($Vl,[2,94]),o($Vl,[2,96]),o($Vl,[2,97],{23:[1,60],65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),{4:67,6:3,8:4,9:5,10:6,14:7,16:$V0,22:31,24:$V7,29:32,36:66,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($Vr,[2,67],{71:[1,68]}),{24:[1,70],72:69},o($Vr,[2,66]),o($Vs,[2,70],{86:$Vt}),o($Vs,[2,71]),o($Vs,[2,72]),o($Vs,[2,73]),o($Vs,[2,74]),o($Vs,[2,75]),o($Vs,[2,76]),o($Vs,[2,77]),o([5,18,23,26,31,34,37,38,41,42,43,44,45,51,62,64,65,66,67,68,70,71,86],$Vu,{24:[1,72]}),o([5,18,23,26,31,34,37,38,41,42,43,44,45,51,54,55,62,64,65,66,67,68,70,71],[2,79]),o($Vs,[2,82]),o($Vs,[2,83]),{24:[1,73]},o($Vs,[2,80]),o($Vs,[2,81]),o($Vs,[2,86]),o($Vi,[2,25]),o($V4,[2,38],{43:[1,74],44:[1,75]}),o($Vi,[2,26],{13:11,42:$V3}),{6:76,8:4,9:5,10:6,14:7,16:$V0},o($V4,[2,9]),{22:31,29:32,47:77,49:78,50:79,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($Vj,[2,54]),{22:31,24:$V7,29:32,36:80,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:82,50:28,63:81,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($V6,[2,37],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),{19:83,22:84,24:$Vv,85:$Vw},{22:31,24:$V7,29:32,36:26,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg,90:87,91:$Vh},{18:[1,88],43:$Vk},{22:89,85:$Vw},{22:31,24:$V7,29:32,36:90,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:91,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:92,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:94,50:28,69:93,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:95,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{26:[1,96],65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq},{26:[1,97]},{24:[1,98],72:99},o($Vr,[2,65]),{4:67,6:3,8:4,9:5,10:6,14:7,16:$V0},{85:[1,100]},{20:$Vx,22:31,24:$V7,26:[1,101],29:32,36:82,50:28,63:103,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg,89:102},{20:$Vx,22:31,24:$V7,29:32,36:82,50:28,63:103,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg,89:105},{29:106,80:$V9},{29:107,80:$V9},o($Vi,[2,27],{13:11,42:$V3}),o($V4,[2,41],{48:108,43:[1,109],44:[1,110]}),o($Vy,[2,43]),o($Vy,[2,45],{51:[1,111]}),o($Vj,[2,56],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),o([5,26,31,42,45,64],[2,55],{43:$Vz}),o($VA,[2,92],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),o($VB,[2,13],{21:113,33:114,34:$VC,37:$VD,38:$VE}),o($VF,[2,17],{22:118,23:[1,119],27:[1,120],85:$Vw,86:$Vt}),{4:122,6:3,8:4,9:5,10:6,14:7,16:$V0,22:31,24:$V7,25:121,29:32,36:82,50:28,63:123,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o([5,18,23,26,27,31,34,35,37,38,41,42,43,45,62,85,86],$Vu),o($Vl,[2,95]),{19:124,22:84,24:$Vv,85:$Vw},o($Vl,[2,98],{86:$Vt}),o([5,18,23,26,31,34,37,38,41,42,43,45,62,64,65,67,70],[2,58],{66:$Vn,68:$Vp}),o([5,18,23,26,31,34,37,38,41,42,43,45,62,64,65,66,67,70],[2,59],{68:$Vp}),o([5,18,23,26,31,34,37,38,41,42,43,45,62,64,67,70],[2,60],{65:$Vm,66:$Vn,68:$Vp}),o($Vr,[2,61]),{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:[1,125]},o($VG,[2,62],{65:$Vm,66:$Vn,67:$Vo,68:$Vp}),o($Vr,[2,57]),o($Vr,[2,69]),{4:67,6:3,8:4,9:5,10:6,14:7,16:$V0,22:31,24:$V7,25:126,29:32,36:82,50:28,63:123,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($Vr,[2,64]),o([5,18,23,26,27,31,34,35,37,38,41,42,43,44,45,51,62,64,65,66,67,68,70,71,85,86],[2,85]),o($Vs,[2,88]),{26:[1,127]},{26:[2,90],43:$Vz},{22:31,24:$V7,29:32,36:82,50:28,63:128,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{26:[1,129]},o($V4,[2,39]),o($V4,[2,40]),o($V4,[2,42]),{22:31,29:32,49:130,50:79,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{29:132,52:131,80:$V9},o($Vy,[2,46]),{22:31,29:32,50:133,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($VB,[2,15],{33:134,34:$VC,37:$VD,38:$VE}),o($VH,[2,28]),{19:135,22:84,24:$Vv,85:$Vw},{34:[1,136],39:[1,137],40:[1,138]},{34:[1,139],39:[1,140],40:[1,141]},o($VF,[2,18],{86:$Vt}),{22:142,85:$Vw},{28:[1,143]},{26:[1,144]},{26:[1,145]},{26:[2,78],43:$Vz},o($VB,[2,14],{33:114,21:146,34:$VC,37:$VD,38:$VE}),{22:31,24:$V7,29:32,36:147,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{26:[1,148]},o($Vs,[2,89]),{26:[2,91],43:$Vz},o($Vs,[2,87]),o($Vy,[2,44]),o($V4,[2,47],{53:149,56:[1,150]}),{54:[1,151],55:[1,152]},o($VA,[2,93]),o($VH,[2,29]),{35:[1,153]},{19:154,22:84,24:$Vv,85:$Vw},{34:[1,155]},{34:[1,156]},{19:157,22:84,24:$Vv,85:$Vw},{34:[1,158]},{34:[1,159]},o($VF,[2,19],{86:$Vt}),{24:[1,160]},o($VF,[2,20]),o($VF,[2,21],{22:161,85:$Vw}),o($VB,[2,16],{33:134,34:$VC,37:$VD,38:$VE}),o($VG,[2,68],{65:$Vm,66:$Vn,67:$Vo,68:$Vp}),o($Vr,[2,63]),o($V4,[2,48]),{57:[1,162],59:[1,163]},o($VI,[2,49]),o($VI,[2,50]),{22:31,24:$V7,29:32,36:164,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{35:[1,165]},{19:166,22:84,24:$Vv,85:$Vw},{19:167,22:84,24:$Vv,85:$Vw},{35:[1,168]},{19:169,22:84,24:$Vv,85:$Vw},{19:170,22:84,24:$Vv,85:$Vw},{29:171,80:$V9},o($VF,[2,22],{86:$Vt}),{29:132,52:172,80:$V9},{29:132,52:173,80:$V9},o($VH,[2,30],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),{22:31,24:$V7,29:32,36:174,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{35:[1,175]},{35:[1,176]},{22:31,24:$V7,29:32,36:177,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{35:[1,178]},{35:[1,179]},{26:[1,180]},{58:[1,181]},{58:[1,182]},o($VH,[2,31],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),{22:31,24:$V7,29:32,36:183,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:184,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($VH,[2,32],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),{22:31,24:$V7,29:32,36:185,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},{22:31,24:$V7,29:32,36:186,50:28,72:30,73:$V8,74:33,75:34,76:35,77:36,78:37,79:38,80:$V9,81:$Va,82:$Vb,83:$Vc,84:$Vd,85:$Ve,87:$Vf,88:$Vg},o($VF,[2,23]),o($V4,[2,51]),o($V4,[2,52]),o($VH,[2,33],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),o($VH,[2,35],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),o($VH,[2,34],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq}),o($VH,[2,36],{65:$Vm,66:$Vn,67:$Vo,68:$Vp,70:$Vq})], defaultActions: {9:[2,1]}, -parseError: function parseError(str, hash) { +parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { @@ -461,7 +464,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { exports.parser = parser; exports.Parser = parser.Parser; exports.parse = function () { return parser.parse.apply(parser, arguments); }; -exports.main = function commonjsMain(args) { +exports.main = function commonjsMain (args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); diff --git a/lib/grammar.js b/lib/grammar.js index 78dbc96..9118217 100644 --- a/lib/grammar.js +++ b/lib/grammar.js @@ -220,7 +220,7 @@ return new SubSelect($2); }) ], - Value: [o('Literal'), o('Number'), o('String'), o('Function'), o('UserFunction'), o('Boolean'), o('Parameter')], + Value: [o('Literal'), o('Number'), o('String'), o('Function'), o('UserFunction'), o('Boolean'), o('Parameter'), o('Variable')], List: [ o('ArgumentList', function() { return new ListValue($1); @@ -255,6 +255,11 @@ return new LiteralValue($1, $3); }) ], + Variable: [ + o('VARIABLE', function() { + return new VariableValue($1, "{", "}"); + }) + ], Function: [ o("FUNCTION LEFT_PAREN AggregateArgumentList RIGHT_PAREN", function() { return new FunctionValue($1, $3); diff --git a/lib/lexer.js b/lib/lexer.js index 3f0ed9c..e8b5e43 100644 --- a/lib/lexer.js +++ b/lib/lexer.js @@ -3,7 +3,7 @@ var Lexer; Lexer = (function() { - var BOOLEAN, DBLSTRING, LITERAL, MATH, MATH_MULTI, NUMBER, PARAMETER, SEPARATOR, SQL_BETWEENS, SQL_CONDITIONALS, SQL_FUNCTIONS, SQL_OPERATORS, SQL_SORT_ORDERS, STAR, STRING, SUB_SELECT_OP, SUB_SELECT_UNARY_OP, WHITESPACE; + var BOOLEAN, DBLSTRING, LITERAL, MATH, MATH_MULTI, NUMBER, PARAMETER, SEPARATOR, SQL_BETWEENS, SQL_CONDITIONALS, SQL_FUNCTIONS, SQL_OPERATORS, SQL_SORT_ORDERS, STAR, STRING, SUB_SELECT_OP, SUB_SELECT_UNARY_OP, VARIABLE, WHITESPACE; function Lexer(sql, opts) { var bytesConsumed, i; @@ -12,11 +12,12 @@ } this.sql = sql; this.preserveWhitespace = opts.preserveWhitespace || false; + this.variableTokens = opts.variableTokens || []; this.tokens = []; this.currentLine = 1; i = 0; while (this.chunk = sql.slice(i)) { - bytesConsumed = this.keywordToken() || this.starToken() || this.booleanToken() || this.functionToken() || this.windowExtension() || this.sortOrderToken() || this.seperatorToken() || this.operatorToken() || this.mathToken() || this.dotToken() || this.conditionalToken() || this.betweenToken() || this.subSelectOpToken() || this.subSelectUnaryOpToken() || this.numberToken() || this.stringToken() || this.parameterToken() || this.parensToken() || this.whitespaceToken() || this.literalToken(); + bytesConsumed = this.keywordToken() || this.starToken() || this.booleanToken() || this.functionToken() || this.windowExtension() || this.sortOrderToken() || this.seperatorToken() || this.operatorToken() || this.mathToken() || this.dotToken() || this.conditionalToken() || this.betweenToken() || this.subSelectOpToken() || this.subSelectUnaryOpToken() || this.numberToken() || this.stringToken() || this.parameterToken() || this.parensToken() || this.whitespaceToken() || this.variableToken() || this.literalToken(); if (bytesConsumed < 1) { throw new Error("NOTHING CONSUMED: Stopped at - '" + (this.chunk.slice(0, 30)) + "'"); } @@ -99,6 +100,12 @@ return ret; }; + Lexer.prototype.variableToken = function() { + if (this.variableTokens.length > 0) { + return this.tokenizeFromList('VARIABLE', this.variableTokens); + } + }; + Lexer.prototype.keywordToken = function() { return this.tokenizeFromWord('SELECT') || this.tokenizeFromWord('DISTINCT') || this.tokenizeFromWord('FROM') || this.tokenizeFromWord('WHERE') || this.tokenizeFromWord('GROUP') || this.tokenizeFromWord('ORDER') || this.tokenizeFromWord('BY') || this.tokenizeFromWord('HAVING') || this.tokenizeFromWord('LIMIT') || this.tokenizeFromWord('JOIN') || this.tokenizeFromWord('LEFT') || this.tokenizeFromWord('RIGHT') || this.tokenizeFromWord('INNER') || this.tokenizeFromWord('OUTER') || this.tokenizeFromWord('ON') || this.tokenizeFromWord('AS') || this.tokenizeFromWord('UNION') || this.tokenizeFromWord('ALL') || this.tokenizeFromWord('LIMIT') || this.tokenizeFromWord('OFFSET') || this.tokenizeFromWord('FETCH') || this.tokenizeFromWord('ROW') || this.tokenizeFromWord('ROWS') || this.tokenizeFromWord('ONLY') || this.tokenizeFromWord('NEXT') || this.tokenizeFromWord('FIRST'); }; @@ -236,6 +243,8 @@ DBLSTRING = /^"([^\\"]*(?:\\.[^\\"]*)*)"/; + VARIABLE = /^[\{][a-zA-Z0-9]+[\}]/; + return Lexer; })(); diff --git a/lib/nodes.js b/lib/nodes.js index 6bb9bb9..592472b 100644 --- a/lib/nodes.js +++ b/lib/nodes.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript 1.8.0 (function() { - var ArgumentListValue, BetweenOp, Field, FunctionValue, Group, Having, Join, Limit, ListValue, LiteralValue, Offset, Op, Order, OrderArgument, ParameterValue, Select, Star, StringValue, SubSelect, Table, UnaryOp, Union, Where, indent; + var ArgumentListValue, BetweenOp, Field, FunctionValue, Group, Having, Join, Limit, ListValue, LiteralValue, Offset, Op, Order, OrderArgument, ParameterValue, Select, Star, StringValue, SubSelect, Table, UnaryOp, Union, VariableValue, Where, indent; indent = function(str) { var line; @@ -124,6 +124,24 @@ })(); + exports.VariableValue = VariableValue = (function() { + function VariableValue(value, openingDelimiter, closingDelimiter) { + this.value = value; + this.openingDelimiter = openingDelimiter != null ? openingDelimiter : "{"; + if (closingDelimiter == null) { + closingDelimiter = "}"; + } + null; + } + + VariableValue.prototype.toString = function() { + return "" + this.openingDelimiter + this.value + this.closingDelimiter; + }; + + return VariableValue; + + })(); + exports.LiteralValue = LiteralValue = (function() { function LiteralValue(value, value2) { this.value = value; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..d502a9f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,317 @@ +{ + "name": "sql-parser", + "version": "0.5.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "JSONSelect": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/JSONSelect/-/JSONSelect-0.4.0.tgz", + "integrity": "sha1-oI7cxn6z/L6Z7WMIVTRKDPKCu40=", + "dev": true + }, + "JSV": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", + "integrity": "sha1-0Hf2glVx+CEy+d/67Vh7QCn+/1c=", + "dev": true + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true, + "optional": true + }, + "cjson": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/cjson/-/cjson-0.3.0.tgz", + "integrity": "sha1-5kObkHA9MS/24iJAl76pLOPQKhQ=", + "dev": true, + "requires": { + "jsonlint": "1.6.0" + } + }, + "coffee-script": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.8.0.tgz", + "integrity": "sha1-nJ8dK0pSoADe0Vtll5FwNkgmPB0=", + "dev": true, + "requires": { + "mkdirp": "~0.3.5" + } + }, + "colors": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz", + "integrity": "sha1-fQAj6usVTo7p/Oddy5I9DtFmd3Q=", + "dev": true + }, + "commander": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.3.0.tgz", + "integrity": "sha1-/UMOiJgy7DU7ms0d4hfBHLPu+HM=", + "dev": true + }, + "debug": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.0.0.tgz", + "integrity": "sha1-ib2d9nMrUSVrxnBTQrugLtEhMe8=", + "dev": true, + "requires": { + "ms": "0.6.2" + } + }, + "diff": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.0.8.tgz", + "integrity": "sha1-NDJ2MI7Jkbe8giZ+1VvBQR+XFmY=", + "dev": true + }, + "ebnf-parser": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/ebnf-parser/-/ebnf-parser-0.1.10.tgz", + "integrity": "sha1-zR9rpHfFY4xAyX7ZtXLbW6tdgzE=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", + "integrity": "sha1-Tbwv5nTnGUnK8/smlc5/LcHZqNE=", + "dev": true + }, + "escodegen": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.3.3.tgz", + "integrity": "sha1-8CQBb1qI4Eb9EgBQVek5gC5sXyM=", + "dev": true, + "requires": { + "esprima": "~1.1.1", + "estraverse": "~1.5.0", + "esutils": "~1.0.0", + "source-map": "~0.1.33" + } + }, + "esprima": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.1.1.tgz", + "integrity": "sha1-W28VR/TRAuZw4UDFCb5ncdautUk=", + "dev": true + }, + "estraverse": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz", + "integrity": "sha1-hno+jlip+EYYr7bC3bzZFrfLr3E=", + "dev": true + }, + "esutils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz", + "integrity": "sha1-gVHTWOIMisx/t0XnRywAJf5JZXA=", + "dev": true + }, + "glob": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.3.tgz", + "integrity": "sha1-4xPusknHr/qlxHUoaw4RW1mDlGc=", + "dev": true, + "requires": { + "graceful-fs": "~2.0.0", + "inherits": "2", + "minimatch": "~0.2.11" + } + }, + "graceful-fs": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz", + "integrity": "sha1-fNLNsiiko/Nule+mzBQt59GhNtA=", + "dev": true + }, + "growl": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.8.1.tgz", + "integrity": "sha1-Sy3sjZB+k9szZiTc7AGDUC+MlCg=", + "dev": true + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "jade": { + "version": "0.26.3", + "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", + "integrity": "sha1-jxDXl32NefL2/4YqgbBRPMslaGw=", + "dev": true, + "requires": { + "commander": "0.6.1", + "mkdirp": "0.3.0" + }, + "dependencies": { + "commander": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", + "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=", + "dev": true + }, + "mkdirp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", + "integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=", + "dev": true + } + } + }, + "jison": { + "version": "0.4.15", + "resolved": "https://registry.npmjs.org/jison/-/jison-0.4.15.tgz", + "integrity": "sha1-bGM2xD52sTx84p+WiYyL304eOPo=", + "dev": true, + "requires": { + "JSONSelect": "0.4.0", + "cjson": "0.3.0", + "ebnf-parser": "0.1.10", + "escodegen": "1.3.x", + "esprima": "1.1.x", + "jison-lex": "0.3.x", + "lex-parser": "~0.1.3", + "nomnom": "1.5.2" + } + }, + "jison-lex": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/jison-lex/-/jison-lex-0.3.4.tgz", + "integrity": "sha1-gcoo2E+ESZ36jFlNzePYo/Jux6U=", + "dev": true, + "requires": { + "lex-parser": "0.1.x", + "nomnom": "1.5.2" + } + }, + "jsonlint": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/jsonlint/-/jsonlint-1.6.0.tgz", + "integrity": "sha1-iKpGvCiaesk7tGyuLVihh6m7SUo=", + "dev": true, + "requires": { + "JSV": ">= 4.0.x", + "nomnom": ">= 1.5.x" + } + }, + "lex-parser": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/lex-parser/-/lex-parser-0.1.4.tgz", + "integrity": "sha1-ZMTwJfF/1Tv7RXY/rrFvAVp0dVA=", + "dev": true + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=", + "dev": true + }, + "mocha": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-2.0.1.tgz", + "integrity": "sha1-Whboi4VtDEFF2MaIjCfr1PqxPpA=", + "dev": true, + "requires": { + "commander": "2.3.0", + "debug": "2.0.0", + "diff": "1.0.8", + "escape-string-regexp": "1.0.2", + "glob": "3.2.3", + "growl": "1.8.1", + "jade": "0.26.3", + "mkdirp": "0.5.0" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", + "integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + } + } + }, + "ms": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz", + "integrity": "sha1-2JwhJMb9wTU9Zai3e/GqxLGTcIw=", + "dev": true + }, + "nomnom": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.5.2.tgz", + "integrity": "sha1-9DRUSKhTz71cDSYyDyR3qwUm/i8=", + "dev": true, + "requires": { + "colors": "0.5.x", + "underscore": "1.1.x" + } + }, + "should": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/should/-/should-4.1.0.tgz", + "integrity": "sha1-rjM1ZVof27FW4LM4vxkRBvWdqyE=", + "dev": true, + "requires": { + "should-equal": "0.0.1" + } + }, + "should-equal": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-0.0.1.tgz", + "integrity": "sha1-VQZmU6nwMhHaaVov6naLGZVqnAs=", + "dev": true + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "optional": true, + "requires": { + "amdefine": ">=0.0.4" + } + }, + "underscore": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.1.7.tgz", + "integrity": "sha1-QLq4S60Z0jAJbo1u9ii/8FXYPbA=", + "dev": true + } + } +} diff --git a/package.json b/package.json index 04c9ffb..daa6427 100644 --- a/package.json +++ b/package.json @@ -10,15 +10,14 @@ "email": "andy@forward.co.uk" }, "directories": { - "lib" : "./lib" - }, - "dependencies": { + "lib": "./lib" }, + "dependencies": {}, "devDependencies": { "jison": "0.4.15", "coffee-script": "1.8.0", - "mocha" : "2.0.1", - "should" : "4.1.0" + "mocha": "2.0.1", + "should": "4.1.0" }, "engines": [ "node" @@ -27,4 +26,4 @@ "type": "git", "url": "http://github.com/forward/sql-parser.git" } -} \ No newline at end of file +} diff --git a/src/grammar.coffee b/src/grammar.coffee index b89a4a4..751dc34 100644 --- a/src/grammar.coffee +++ b/src/grammar.coffee @@ -169,6 +169,7 @@ grammar = o 'UserFunction' o 'Boolean' o 'Parameter' + o 'Variable' ] List: [ @@ -197,6 +198,11 @@ grammar = o 'Literal DOT LITERAL', -> new LiteralValue($1, $3) ] + Variable: [ + o 'VARIABLE', -> new VariableValue($1,"{","}") + ] + + Function: [ o "FUNCTION LEFT_PAREN AggregateArgumentList RIGHT_PAREN", -> new FunctionValue($1, $3) ] diff --git a/src/lexer.coffee b/src/lexer.coffee index 4cb3d8b..2e52920 100644 --- a/src/lexer.coffee +++ b/src/lexer.coffee @@ -2,6 +2,7 @@ class Lexer constructor: (sql, opts={}) -> @sql = sql @preserveWhitespace = opts.preserveWhitespace || false + @variableTokens = opts.variableTokens || [] @tokens = [] @currentLine = 1 i = 0 @@ -25,6 +26,7 @@ class Lexer @parameterToken() or @parensToken() or @whitespaceToken() or + @variableToken() or @literalToken() throw new Error("NOTHING CONSUMED: Stopped at - '#{@chunk.slice(0,30)}'") if bytesConsumed < 1 i += bytesConsumed @@ -65,6 +67,10 @@ class Lexer break if ret > 0 ret + variableToken: -> + if @variableTokens.length > 0 + @tokenizeFromList('VARIABLE', @variableTokens) + keywordToken: -> @tokenizeFromWord('SELECT') or @tokenizeFromWord('DISTINCT') or @@ -156,8 +162,8 @@ class Lexer NUMBER = /^[0-9]+(\.[0-9]+)?/ STRING = /^'([^\\']*(?:\\.[^\\']*)*)'/ DBLSTRING = /^"([^\\"]*(?:\\.[^\\"]*)*)"/ + VARIABLE = /^[\{][a-zA-Z0-9]+[\}]/; exports.tokenize = (sql, opts) -> (new Lexer(sql, opts)).tokens - diff --git a/src/nodes.coffee b/src/nodes.coffee index 119fd43..852ece1 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -41,6 +41,10 @@ exports.Union = class Union all = if @all then ' ALL' else '' "UNION#{all}\n#{@query.toString()}" +exports.VariableValue = class VariableValue + constructor: (@value, @openingDelimiter="{", closingDelimiter="}") -> null + toString: -> "#{@openingDelimiter}#{@value}#{@closingDelimiter}" + exports.LiteralValue = class LiteralValue constructor: (@value, @value2=null) -> if @value2