Comparing version 0.2.14 to 0.3.0
@@ -113,2 +113,6 @@ // Jison, an LR(0), SLR(1), LARL(1), LR(1) Parser Generator | ||
if (!grammar.bnf && grammar.ebnf) { | ||
bnf = grammar.bnf = require("./jison/ebnf").transform(grammar.ebnf); | ||
} | ||
if (tokens) { | ||
@@ -873,2 +877,7 @@ if (typeof tokens === 'string') { | ||
var code = ""; | ||
// check for illegal identifier | ||
if (!opt.moduleName.match(/^[A-Za-z_$][A-Za-z0-9_$]*$/)) { | ||
opt.moduleName = "parser"; | ||
} | ||
switch (opt.moduleType) { | ||
@@ -906,4 +915,4 @@ case "js": | ||
out += (moduleName.match(/\./) ? moduleName : "var "+moduleName)+" = (function(){"; | ||
out += "\nvar parser = "+this.generateModule_(); | ||
out += "\n"+this.moduleInclude; | ||
out += "\nvar parser = "+this.generateModule_(); | ||
if (this.lexer && this.lexer.generateModule) { | ||
@@ -910,0 +919,0 @@ out += this.lexer.generateModule(); |
@@ -8,3 +8,3 @@ // Basic RegExp Lexer | ||
// expand macros and convert matchers to RegExp's | ||
function prepareRules(rules, macros, actions, tokens, startConditions) { | ||
function prepareRules(rules, macros, actions, tokens, startConditions, caseless) { | ||
var m,i,k,action,conditions, | ||
@@ -42,10 +42,10 @@ newRules = []; | ||
m = rules[i][0]; | ||
for (k in macros) { | ||
if (macros.hasOwnProperty(k) && typeof m === 'string') { | ||
m = m.split("{"+k+"}").join(macros[k]); | ||
if (typeof m === 'string') { | ||
for (k in macros) { | ||
if (macros.hasOwnProperty(k)) { | ||
m = m.split("{"+k+"}").join(macros[k]); | ||
} | ||
} | ||
m = new RegExp("^"+m, caseless ? 'i':''); | ||
} | ||
if (typeof m === 'string') { | ||
m = new RegExp("^"+m); | ||
} | ||
newRules.push(m); | ||
@@ -107,3 +107,3 @@ if (typeof rules[i][1] === 'function') { | ||
this.rules = prepareRules(dict.rules, dict.macros, actions, tokens && toks, this.conditions); | ||
this.rules = prepareRules(dict.rules, dict.macros, actions, tokens && toks, this.conditions, this.options["case-insensitive"]); | ||
var fun = actions.join("\n"); | ||
@@ -122,2 +122,3 @@ "yytext yyleng yylineno".split(' ').forEach(function (yy) { | ||
dict = dict || {}; | ||
this.options = dict.options || {}; | ||
this.conditions = prepareStartConditions(dict.startConditions); | ||
@@ -208,2 +209,4 @@ this.conditions['INITIAL'] = {rules:[],inclusive:true}; | ||
match, | ||
tempMatch, | ||
index, | ||
col, | ||
@@ -217,22 +220,26 @@ lines; | ||
for (var i=0;i < rules.length; i++) { | ||
match = this._input.match(this.rules[rules[i]]); | ||
if (match) { | ||
lines = match[0].match(/\n.*/g); | ||
if (lines) this.yylineno += lines.length; | ||
this.yylloc = {first_line: this.yylloc.last_line, | ||
last_line: this.yylineno+1, | ||
first_column: this.yylloc.last_column, | ||
last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length} | ||
this.yytext += match[0]; | ||
this.match += match[0]; | ||
this.matches = match; | ||
this.yyleng = this.yytext.length; | ||
this._more = false; | ||
this._input = this._input.slice(match[0].length); | ||
this.matched += match[0]; | ||
token = this.performAction.call(this, this.yy, this, rules[i],this.conditionStack[this.conditionStack.length-1]); | ||
if (token) return token; | ||
else return; | ||
tempMatch = this._input.match(this.rules[rules[i]]); | ||
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { | ||
match = tempMatch; | ||
index = i; | ||
if (!this.options.flex) break; | ||
} | ||
} | ||
if (match) { | ||
lines = match[0].match(/\n.*/g); | ||
if (lines) this.yylineno += lines.length; | ||
this.yylloc = {first_line: this.yylloc.last_line, | ||
last_line: this.yylineno+1, | ||
first_column: this.yylloc.last_column, | ||
last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length} | ||
this.yytext += match[0]; | ||
this.match += match[0]; | ||
this.yyleng = this.yytext.length; | ||
this._more = false; | ||
this._input = this._input.slice(match[0].length); | ||
this.matched += match[0]; | ||
token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]); | ||
if (token) return token; | ||
else return; | ||
} | ||
if (this._input === "") { | ||
@@ -284,3 +291,3 @@ return this.EOF; | ||
moduleName = opt.moduleName || "lexer"; | ||
out += "\nvar "+moduleName+" = (function(){\n"+(this.moduleInclude||'')+"\nvar lexer = ({"; | ||
out += "\nvar "+moduleName+" = (function(){\nvar lexer = ({"; | ||
var p = []; | ||
@@ -292,6 +299,10 @@ for (var k in RegExpLexer.prototype) | ||
out += "})"; | ||
if (this.options) { | ||
out += ";\nlexer.options = "+JSON.stringify(this.options); | ||
} | ||
out += ";\nlexer.performAction = "+String(this.performAction); | ||
out += ";\nlexer.rules = [" + this.rules + "]"; | ||
out += ";\nlexer.conditions = " + JSON.stringify(this.conditions); | ||
out += ";return lexer;})()"; | ||
if (this.moduleInclude) out += ";\n"+this.moduleInclude; | ||
out += ";\nreturn lexer;})()"; | ||
return out; | ||
@@ -314,4 +325,4 @@ }, | ||
if (typeof exports !== 'undefined') | ||
if (typeof exports !== 'undefined') | ||
exports.RegExpLexer = RegExpLexer; | ||
/* Jison generated parser */ | ||
var bnf = (function(){ | ||
var ebnf = false; | ||
var parser = {trace: function trace() { }, | ||
yy: {}, | ||
symbols_: {"error":2,"spec":3,"declaration_list":4,"%%":5,"grammar":6,"EOF":7,"CODE":8,"declaration":9,"START":10,"id":11,"LEX_BLOCK":12,"operator":13,"ACTION":14,"associativity":15,"token_list":16,"LEFT":17,"RIGHT":18,"NONASSOC":19,"symbol":20,"production_list":21,"production":22,":":23,"handle_list":24,";":25,"|":26,"handle_action":27,"handle":28,"prec":29,"action":30,"PREC":31,"STRING":32,"ID":33,"{":34,"action_body":35,"}":36,"ARROW_ACTION":37,"ACTION_BODY":38,"$accept":0,"$end":1}, | ||
terminals_: {2:"error",5:"%%",7:"EOF",8:"CODE",10:"START",12:"LEX_BLOCK",14:"ACTION",17:"LEFT",18:"RIGHT",19:"NONASSOC",23:":",25:";",26:"|",31:"PREC",32:"STRING",33:"ID",34:"{",36:"}",37:"ARROW_ACTION",38:"ACTION_BODY"}, | ||
productions_: [0,[3,4],[3,5],[3,6],[4,2],[4,0],[9,2],[9,1],[9,1],[9,1],[13,2],[15,1],[15,1],[15,1],[16,2],[16,1],[6,1],[21,2],[21,1],[22,4],[24,3],[24,1],[27,3],[28,2],[28,0],[29,2],[29,0],[20,1],[20,1],[11,1],[30,3],[30,1],[30,1],[30,0],[35,0],[35,1],[35,5],[35,4]], | ||
symbols_: {"error":2,"spec":3,"declaration_list":4,"%%":5,"grammar":6,"optional_end_block":7,"EOF":8,"CODE":9,"declaration":10,"START":11,"id":12,"LEX_BLOCK":13,"operator":14,"ACTION":15,"associativity":16,"token_list":17,"LEFT":18,"RIGHT":19,"NONASSOC":20,"symbol":21,"production_list":22,"production":23,":":24,"handle_list":25,";":26,"|":27,"handle_action":28,"handle":29,"prec":30,"action":31,"expression_suffix":32,"handle_sublist":33,"expression":34,"suffix":35,"ID":36,"STRING":37,"(":38,")":39,"*":40,"?":41,"PREC":42,"{":43,"action_body":44,"}":45,"ARROW_ACTION":46,"ACTION_BODY":47,"$accept":0,"$end":1}, | ||
terminals_: {2:"error",5:"%%",8:"EOF",9:"CODE",11:"START",13:"LEX_BLOCK",15:"ACTION",18:"LEFT",19:"RIGHT",20:"NONASSOC",24:":",26:";",27:"|",36:"ID",37:"STRING",38:"(",39:")",40:"*",41:"?",42:"PREC",43:"{",45:"}",46:"ARROW_ACTION",47:"ACTION_BODY"}, | ||
productions_: [0,[3,5],[3,6],[7,0],[7,1],[4,2],[4,0],[10,2],[10,1],[10,1],[10,1],[14,2],[16,1],[16,1],[16,1],[17,2],[17,1],[6,1],[22,2],[22,1],[23,4],[25,3],[25,1],[28,3],[29,2],[29,0],[33,3],[33,1],[32,2],[34,1],[34,1],[34,3],[35,0],[35,1],[35,1],[30,2],[30,0],[21,1],[21,1],[12,1],[31,3],[31,1],[31,1],[31,0],[44,0],[44,1],[44,5],[44,4]], | ||
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) { | ||
@@ -13,47 +17,45 @@ | ||
switch (yystate) { | ||
case 1:this.$ = $$[$0-3]; this.$.bnf = $$[$0-1]; return this.$; | ||
case 1:this.$ = $$[$0-4]; this.$[ebnf ? 'ebnf':'bnf'] = $$[$0-2]; return this.$; | ||
break; | ||
case 2:this.$ = $$[$0-4]; this.$.bnf = $$[$0-2]; return this.$; | ||
case 2:this.$ = $$[$0-5]; this.$[ebnf ? 'ebnf':'bnf'] = $$[$0-3]; yy.addDeclaration(this.$,{include:$$[$0-1]}); return this.$; | ||
break; | ||
case 3:this.$ = $$[$0-5]; this.$.bnf = $$[$0-3]; yy.addDeclaration(this.$,{include:$$[$0-1]}); return this.$; | ||
case 5:this.$ = $$[$0-1]; yy.addDeclaration(this.$, $$[$0]); | ||
break; | ||
case 4:this.$ = $$[$0-1]; yy.addDeclaration(this.$, $$[$0]); | ||
case 6:this.$ = {}; | ||
break; | ||
case 5:this.$ = {}; | ||
case 7:this.$ = {start: $$[$0]}; | ||
break; | ||
case 6:this.$ = {start: $$[$0]}; | ||
case 8:this.$ = {lex: $$[$0]}; | ||
break; | ||
case 7:this.$ = {lex: $$[$0]}; | ||
case 9:this.$ = {operator: $$[$0]}; | ||
break; | ||
case 8:this.$ = {operator: $$[$0]}; | ||
case 10:this.$ = {include: $$[$0]}; | ||
break; | ||
case 9:this.$ = {include: $$[$0]}; | ||
case 11:this.$ = [$$[$0-1]]; this.$.push.apply(this.$, $$[$0]); | ||
break; | ||
case 10:this.$ = [$$[$0-1]]; this.$.push.apply(this.$, $$[$0]); | ||
case 12:this.$ = 'left'; | ||
break; | ||
case 11:this.$ = 'left'; | ||
case 13:this.$ = 'right'; | ||
break; | ||
case 12:this.$ = 'right'; | ||
case 14:this.$ = 'nonassoc'; | ||
break; | ||
case 13:this.$ = 'nonassoc'; | ||
case 15:this.$ = $$[$0-1]; this.$.push($$[$0]); | ||
break; | ||
case 14:this.$ = $$[$0-1]; this.$.push($$[$0]); | ||
case 16:this.$ = [$$[$0]]; | ||
break; | ||
case 15:this.$ = [$$[$0]]; | ||
case 17:this.$ = $$[$0]; | ||
break; | ||
case 16:this.$ = $$[$0]; | ||
break; | ||
case 17:this.$ = $$[$0-1]; | ||
case 18:this.$ = $$[$0-1]; | ||
if($$[$0][0] in this.$) this.$[$$[$0][0]] = this.$[$$[$0][0]].concat($$[$0][1]); | ||
else this.$[$$[$0][0]] = $$[$0][1]; | ||
break; | ||
case 18:this.$ = {}; this.$[$$[$0][0]] = $$[$0][1]; | ||
case 19:this.$ = {}; this.$[$$[$0][0]] = $$[$0][1]; | ||
break; | ||
case 19:this.$ = [$$[$0-3], $$[$0-1]]; | ||
case 20:this.$ = [$$[$0-3], $$[$0-1]]; | ||
break; | ||
case 20:this.$ = $$[$0-2]; this.$.push($$[$0]); | ||
case 21:this.$ = $$[$0-2]; this.$.push($$[$0]); | ||
break; | ||
case 21:this.$ = [$$[$0]]; | ||
case 22:this.$ = [$$[$0]]; | ||
break; | ||
case 22:this.$ = [($$[$0-2].length ? $$[$0-2].join(' ') : '')]; | ||
case 23:this.$ = [($$[$0-2].length ? $$[$0-2].join(' ') : '')]; | ||
if($$[$0]) this.$.push($$[$0]); | ||
@@ -64,36 +66,50 @@ if($$[$0-1]) this.$.push($$[$0-1]); | ||
break; | ||
case 23:this.$ = $$[$0-1]; this.$.push($$[$0]) | ||
case 24:this.$ = $$[$0-1]; this.$.push($$[$0]) | ||
break; | ||
case 24:this.$ = []; | ||
case 25:this.$ = []; | ||
break; | ||
case 25:this.$ = {prec: $$[$0]}; | ||
case 26:this.$ = $$[$0-2]; this.$.push($$[$0].join(' ')); | ||
break; | ||
case 26:this.$ = null; | ||
case 27:this.$ = [$$[$0].join(' ')]; | ||
break; | ||
case 27:this.$ = $$[$0]; | ||
case 28:this.$ = $$[$0-1] + $$[$0]; | ||
break; | ||
case 28:this.$ = yytext; | ||
case 29:this.$ = $$[$0]; | ||
break; | ||
case 29:this.$ = yytext; | ||
case 30:this.$ = ebnf ? "'"+$$[$0]+"'" : $$[$0]; | ||
break; | ||
case 30:this.$ = $$[$0-1]; | ||
case 31:this.$ = '(' + $$[$0-1].join(' | ') + ')'; | ||
break; | ||
case 31:this.$ = $$[$0]; | ||
case 32:this.$ = '' | ||
break; | ||
case 32:this.$ = '$$ ='+$$[$0]+';'; | ||
case 35:this.$ = {prec: $$[$0]}; | ||
break; | ||
case 33:this.$ = ''; | ||
case 36:this.$ = null; | ||
break; | ||
case 34:this.$ = ''; | ||
case 37:this.$ = $$[$0]; | ||
break; | ||
case 35:this.$ = yytext; | ||
case 38:this.$ = yytext; | ||
break; | ||
case 36:this.$ = $$[$0-4]+$$[$0-3]+$$[$0-2]+$$[$0-1]+$$[$0]; | ||
case 39:this.$ = yytext; | ||
break; | ||
case 37:this.$ = $$[$0-3]+$$[$0-2]+$$[$0-1]+$$[$0]; | ||
case 40:this.$ = $$[$0-1]; | ||
break; | ||
case 41:this.$ = $$[$0]; | ||
break; | ||
case 42:this.$ = '$$ ='+$$[$0]+';'; | ||
break; | ||
case 43:this.$ = ''; | ||
break; | ||
case 44:this.$ = ''; | ||
break; | ||
case 45:this.$ = yytext; | ||
break; | ||
case 46:this.$ = $$[$0-4]+$$[$0-3]+$$[$0-2]+$$[$0-1]+$$[$0]; | ||
break; | ||
case 47:this.$ = $$[$0-3]+$$[$0-2]+$$[$0-1]+$$[$0]; | ||
break; | ||
} | ||
}, | ||
table: [{3:1,4:2,5:[2,5],10:[2,5],12:[2,5],14:[2,5],17:[2,5],18:[2,5],19:[2,5]},{1:[3]},{5:[1,3],9:4,10:[1,5],12:[1,6],13:7,14:[1,8],15:9,17:[1,10],18:[1,11],19:[1,12]},{6:13,11:16,21:14,22:15,33:[1,17]},{5:[2,4],10:[2,4],12:[2,4],14:[2,4],17:[2,4],18:[2,4],19:[2,4]},{11:18,33:[1,17]},{5:[2,7],10:[2,7],12:[2,7],14:[2,7],17:[2,7],18:[2,7],19:[2,7]},{5:[2,8],10:[2,8],12:[2,8],14:[2,8],17:[2,8],18:[2,8],19:[2,8]},{5:[2,9],10:[2,9],12:[2,9],14:[2,9],17:[2,9],18:[2,9],19:[2,9]},{11:21,16:19,20:20,32:[1,22],33:[1,17]},{32:[2,11],33:[2,11]},{32:[2,12],33:[2,12]},{32:[2,13],33:[2,13]},{5:[1,24],7:[1,23]},{5:[2,16],7:[2,16],11:16,22:25,33:[1,17]},{5:[2,18],7:[2,18],33:[2,18]},{23:[1,26]},{5:[2,29],10:[2,29],12:[2,29],14:[2,29],17:[2,29],18:[2,29],19:[2,29],23:[2,29],25:[2,29],26:[2,29],31:[2,29],32:[2,29],33:[2,29],34:[2,29],37:[2,29]},{5:[2,6],10:[2,6],12:[2,6],14:[2,6],17:[2,6],18:[2,6],19:[2,6]},{5:[2,10],10:[2,10],11:21,12:[2,10],14:[2,10],17:[2,10],18:[2,10],19:[2,10],20:27,32:[1,22],33:[1,17]},{5:[2,15],10:[2,15],12:[2,15],14:[2,15],17:[2,15],18:[2,15],19:[2,15],32:[2,15],33:[2,15]},{5:[2,27],10:[2,27],12:[2,27],14:[2,27],17:[2,27],18:[2,27],19:[2,27],25:[2,27],26:[2,27],31:[2,27],32:[2,27],33:[2,27],34:[2,27],37:[2,27]},{5:[2,28],10:[2,28],12:[2,28],14:[2,28],17:[2,28],18:[2,28],19:[2,28],25:[2,28],26:[2,28],31:[2,28],32:[2,28],33:[2,28],34:[2,28],37:[2,28]},{1:[2,1]},{7:[1,28],8:[1,29]},{5:[2,17],7:[2,17],33:[2,17]},{14:[2,24],24:30,25:[2,24],26:[2,24],27:31,28:32,31:[2,24],32:[2,24],33:[2,24],34:[2,24],37:[2,24]},{5:[2,14],10:[2,14],12:[2,14],14:[2,14],17:[2,14],18:[2,14],19:[2,14],32:[2,14],33:[2,14]},{1:[2,2]},{7:[1,33]},{25:[1,34],26:[1,35]},{25:[2,21],26:[2,21]},{11:21,14:[2,26],20:37,25:[2,26],26:[2,26],29:36,31:[1,38],32:[1,22],33:[1,17],34:[2,26],37:[2,26]},{1:[2,3]},{5:[2,19],7:[2,19],33:[2,19]},{14:[2,24],25:[2,24],26:[2,24],27:39,28:32,31:[2,24],32:[2,24],33:[2,24],34:[2,24],37:[2,24]},{14:[1,42],25:[2,33],26:[2,33],30:40,34:[1,41],37:[1,43]},{14:[2,23],25:[2,23],26:[2,23],31:[2,23],32:[2,23],33:[2,23],34:[2,23],37:[2,23]},{11:21,20:44,32:[1,22],33:[1,17]},{25:[2,20],26:[2,20]},{25:[2,22],26:[2,22]},{34:[2,34],35:45,36:[2,34],38:[1,46]},{25:[2,31],26:[2,31]},{25:[2,32],26:[2,32]},{14:[2,25],25:[2,25],26:[2,25],34:[2,25],37:[2,25]},{34:[1,48],36:[1,47]},{34:[2,35],36:[2,35]},{25:[2,30],26:[2,30]},{34:[2,34],35:49,36:[2,34],38:[1,46]},{34:[1,48],36:[1,50]},{34:[2,37],36:[2,37],38:[1,51]},{34:[2,36],36:[2,36]}], | ||
defaultActions: {23:[2,1],28:[2,2],33:[2,3]}, | ||
table: [{3:1,4:2,5:[2,6],11:[2,6],13:[2,6],15:[2,6],18:[2,6],19:[2,6],20:[2,6]},{1:[3]},{5:[1,3],10:4,11:[1,5],13:[1,6],14:7,15:[1,8],16:9,18:[1,10],19:[1,11],20:[1,12]},{6:13,12:16,22:14,23:15,36:[1,17]},{5:[2,5],11:[2,5],13:[2,5],15:[2,5],18:[2,5],19:[2,5],20:[2,5]},{12:18,36:[1,17]},{5:[2,8],11:[2,8],13:[2,8],15:[2,8],18:[2,8],19:[2,8],20:[2,8]},{5:[2,9],11:[2,9],13:[2,9],15:[2,9],18:[2,9],19:[2,9],20:[2,9]},{5:[2,10],11:[2,10],13:[2,10],15:[2,10],18:[2,10],19:[2,10],20:[2,10]},{12:21,17:19,21:20,36:[1,17],37:[1,22]},{36:[2,12],37:[2,12]},{36:[2,13],37:[2,13]},{36:[2,14],37:[2,14]},{5:[1,24],7:23,8:[2,3]},{5:[2,17],8:[2,17],12:16,23:25,36:[1,17]},{5:[2,19],8:[2,19],36:[2,19]},{24:[1,26]},{5:[2,39],11:[2,39],13:[2,39],15:[2,39],18:[2,39],19:[2,39],20:[2,39],24:[2,39],26:[2,39],27:[2,39],36:[2,39],37:[2,39],43:[2,39],46:[2,39]},{5:[2,7],11:[2,7],13:[2,7],15:[2,7],18:[2,7],19:[2,7],20:[2,7]},{5:[2,11],11:[2,11],12:21,13:[2,11],15:[2,11],18:[2,11],19:[2,11],20:[2,11],21:27,36:[1,17],37:[1,22]},{5:[2,16],11:[2,16],13:[2,16],15:[2,16],18:[2,16],19:[2,16],20:[2,16],36:[2,16],37:[2,16]},{5:[2,37],11:[2,37],13:[2,37],15:[2,37],18:[2,37],19:[2,37],20:[2,37],26:[2,37],27:[2,37],36:[2,37],37:[2,37],43:[2,37],46:[2,37]},{5:[2,38],11:[2,38],13:[2,38],15:[2,38],18:[2,38],19:[2,38],20:[2,38],26:[2,38],27:[2,38],36:[2,38],37:[2,38],43:[2,38],46:[2,38]},{8:[1,28]},{8:[2,4],9:[1,29]},{5:[2,18],8:[2,18],36:[2,18]},{15:[2,25],25:30,26:[2,25],27:[2,25],28:31,29:32,36:[2,25],37:[2,25],38:[2,25],42:[2,25],43:[2,25],46:[2,25]},{5:[2,15],11:[2,15],13:[2,15],15:[2,15],18:[2,15],19:[2,15],20:[2,15],36:[2,15],37:[2,15]},{1:[2,1]},{8:[1,33]},{26:[1,34],27:[1,35]},{26:[2,22],27:[2,22]},{15:[2,36],26:[2,36],27:[2,36],30:36,32:37,34:39,36:[1,40],37:[1,41],38:[1,42],42:[1,38],43:[2,36],46:[2,36]},{1:[2,2]},{5:[2,20],8:[2,20],36:[2,20]},{15:[2,25],26:[2,25],27:[2,25],28:43,29:32,36:[2,25],37:[2,25],38:[2,25],42:[2,25],43:[2,25],46:[2,25]},{15:[1,46],26:[2,43],27:[2,43],31:44,43:[1,45],46:[1,47]},{15:[2,24],26:[2,24],27:[2,24],36:[2,24],37:[2,24],38:[2,24],39:[2,24],42:[2,24],43:[2,24],46:[2,24]},{12:21,21:48,36:[1,17],37:[1,22]},{15:[2,32],26:[2,32],27:[2,32],35:49,36:[2,32],37:[2,32],38:[2,32],39:[2,32],40:[1,50],41:[1,51],42:[2,32],43:[2,32],46:[2,32]},{15:[2,29],26:[2,29],27:[2,29],36:[2,29],37:[2,29],38:[2,29],39:[2,29],40:[2,29],41:[2,29],42:[2,29],43:[2,29],46:[2,29]},{15:[2,30],26:[2,30],27:[2,30],36:[2,30],37:[2,30],38:[2,30],39:[2,30],40:[2,30],41:[2,30],42:[2,30],43:[2,30],46:[2,30]},{27:[2,25],29:53,33:52,36:[2,25],37:[2,25],38:[2,25],39:[2,25]},{26:[2,21],27:[2,21]},{26:[2,23],27:[2,23]},{43:[2,44],44:54,45:[2,44],47:[1,55]},{26:[2,41],27:[2,41]},{26:[2,42],27:[2,42]},{15:[2,35],26:[2,35],27:[2,35],43:[2,35],46:[2,35]},{15:[2,28],26:[2,28],27:[2,28],36:[2,28],37:[2,28],38:[2,28],39:[2,28],42:[2,28],43:[2,28],46:[2,28]},{15:[2,33],26:[2,33],27:[2,33],36:[2,33],37:[2,33],38:[2,33],39:[2,33],42:[2,33],43:[2,33],46:[2,33]},{15:[2,34],26:[2,34],27:[2,34],36:[2,34],37:[2,34],38:[2,34],39:[2,34],42:[2,34],43:[2,34],46:[2,34]},{27:[1,57],39:[1,56]},{27:[2,27],32:37,34:39,36:[1,40],37:[1,41],38:[1,42],39:[2,27]},{43:[1,59],45:[1,58]},{43:[2,45],45:[2,45]},{15:[2,31],26:[2,31],27:[2,31],36:[2,31],37:[2,31],38:[2,31],39:[2,31],40:[2,31],41:[2,31],42:[2,31],43:[2,31],46:[2,31]},{27:[2,25],29:60,36:[2,25],37:[2,25],38:[2,25],39:[2,25]},{26:[2,40],27:[2,40]},{43:[2,44],44:61,45:[2,44],47:[1,55]},{27:[2,26],32:37,34:39,36:[1,40],37:[1,41],38:[1,42],39:[2,26]},{43:[1,59],45:[1,62]},{43:[2,47],45:[2,47],47:[1,63]},{43:[2,46],45:[2,46]}], | ||
defaultActions: {28:[2,1],33:[2,2]}, | ||
parseError: function parseError(str, hash) { | ||
@@ -145,3 +161,3 @@ throw new Error(str); | ||
if (this.lexer.showPosition) { | ||
errStr = "Parse error on line " + (yylineno + 1) + ":\\n" + this.lexer.showPosition() + "\\nExpecting " + expected.join(", "); | ||
errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + this.terminals_[symbol] + "'"; | ||
} else { | ||
@@ -204,3 +220,2 @@ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'"); | ||
var lexer = ({EOF:1, | ||
@@ -317,2 +332,8 @@ parseError:function parseError(str, hash) { | ||
return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules; | ||
}, | ||
topState:function () { | ||
return this.conditionStack[this.conditionStack.length-2]; | ||
}, | ||
pushState:function begin(condition) { | ||
this.begin(condition); | ||
}}); | ||
@@ -325,62 +346,72 @@ lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { | ||
break; | ||
case 1:/* skip whitespace */ | ||
case 1:return 38 | ||
break; | ||
case 2:/* skip comment */ | ||
case 2:return 39 | ||
break; | ||
case 3:return yy.lexComment(this); | ||
case 3:return 40 | ||
break; | ||
case 4:return 33; | ||
case 4:return 41 | ||
break; | ||
case 5:yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 32; | ||
case 5:/* skip whitespace */ | ||
break; | ||
case 6:yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 32; | ||
case 6:/* skip comment */ | ||
break; | ||
case 7:return 23; | ||
case 7:return yy.lexComment(this); | ||
break; | ||
case 8:return 25; | ||
case 8:return 36; | ||
break; | ||
case 9:return 26; | ||
case 9:yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 37; | ||
break; | ||
case 10:this.begin('grammar');return 5; | ||
case 10:yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 37; | ||
break; | ||
case 11:return 31; | ||
case 11:return 24; | ||
break; | ||
case 12:return 10; | ||
case 12:return 26; | ||
break; | ||
case 13:return 17; | ||
case 13:return 27; | ||
break; | ||
case 14:return 18; | ||
case 14:this.begin(ebnf ? 'ebnf' : 'bnf');return 5; | ||
break; | ||
case 15:return 19; | ||
case 15:if (!yy.options) yy.options = {}; ebnf = yy.options.ebnf = true; | ||
break; | ||
case 16:return 12; | ||
case 16:return 42; | ||
break; | ||
case 17:/* ignore unrecognized decl */ | ||
case 17:return 11; | ||
break; | ||
case 18:/* ignore type */ | ||
case 18:return 18; | ||
break; | ||
case 19:yy_.yytext = yy_.yytext.substr(2, yy_.yyleng-4); return 14; | ||
case 19:return 19; | ||
break; | ||
case 20:yy_.yytext = yy_.yytext.substr(2, yy_.yytext.length-4);return 14; | ||
case 20:return 20; | ||
break; | ||
case 21:yy.depth=0; this.begin('action'); return 34; | ||
case 21:return 13; | ||
break; | ||
case 22:yy_.yytext = yy_.yytext.substr(2, yy_.yyleng-2); return 37; | ||
case 22:/* ignore unrecognized decl */ | ||
break; | ||
case 23:/* ignore bad characters */ | ||
case 23:/* ignore type */ | ||
break; | ||
case 24:return 7; | ||
case 24:yy_.yytext = yy_.yytext.substr(2, yy_.yyleng-4); return 15; | ||
break; | ||
case 25:return 38; | ||
case 25:yy_.yytext = yy_.yytext.substr(2, yy_.yytext.length-4);return 15; | ||
break; | ||
case 26:yy.depth++; return 34; | ||
case 26:yy.depth=0; this.begin('action'); return 43; | ||
break; | ||
case 27:yy.depth==0? this.begin('grammar') : yy.depth--; return 36; | ||
case 27:yy_.yytext = yy_.yytext.substr(2, yy_.yyleng-2); return 46; | ||
break; | ||
case 28:return 8; | ||
case 28:/* ignore bad characters */ | ||
break; | ||
case 29:return 8; | ||
break; | ||
case 30:return 47; | ||
break; | ||
case 31:yy.depth++; return 43; | ||
break; | ||
case 32:yy.depth==0? this.begin(ebnf ? 'ebnf' : 'bnf') : yy.depth--; return 45; | ||
break; | ||
case 33:return 9; | ||
break; | ||
} | ||
}; | ||
lexer.rules = [/^%%/,/^\s+/,/^\/\/.*/,/^\/\*[^*]*\*/,/^[a-zA-Z][a-zA-Z0-9_-]*/,/^"[^"]+"/,/^'[^']+'/,/^:/,/^;/,/^\|/,/^%%/,/^%prec\b/,/^%start\b/,/^%left\b/,/^%right\b/,/^%nonassoc\b/,/^%lex[\w\W]*?\/lex\b/,/^%[a-zA-Z]+[^\n]*/,/^<[a-zA-Z]*>/,/^\{\{[\w\W]*?\}\}/,/^%\{(.|\n)*?%\}/,/^\{/,/^->.*/,/^./,/^$/,/^[^{}]+/,/^\{/,/^\}/,/^(.|\n)+/]; | ||
lexer.conditions = {"grammar":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],"inclusive":true},"action":{"rules":[24,25,26,27],"inclusive":false},"code":{"rules":[24,28],"inclusive":false},"INITIAL":{"rules":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],"inclusive":true}};return lexer;})() | ||
lexer.rules = [/^%%/,/^\(/,/^\)/,/^\*/,/^\?/,/^\s+/,/^\/\/.*/,/^\/\*[^*]*\*/,/^[a-zA-Z][a-zA-Z0-9_-]*/,/^"[^"]+"/,/^'[^']+'/,/^:/,/^;/,/^\|/,/^%%/,/^%ebnf\b/,/^%prec\b/,/^%start\b/,/^%left\b/,/^%right\b/,/^%nonassoc\b/,/^%lex[\w\W]*?\/lex\b/,/^%[a-zA-Z]+[^\n]*/,/^<[a-zA-Z]*>/,/^\{\{[\w\W]*?\}\}/,/^%\{(.|\n)*?%\}/,/^\{/,/^->.*/,/^./,/^$/,/^[^{}]+/,/^\{/,/^\}/,/^(.|\n)+/]; | ||
lexer.conditions = {"bnf":{"rules":[0,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29],"inclusive":true},"ebnf":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29],"inclusive":true},"action":{"rules":[29,30,31,32],"inclusive":false},"code":{"rules":[29,33],"inclusive":false},"INITIAL":{"rules":[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29],"inclusive":true}};return lexer;})() | ||
parser.lexer = lexer; | ||
@@ -387,0 +418,0 @@ return parser; |
/* Jison generated parser */ | ||
var jisonlex = (function(){ | ||
var parser = {trace: function trace() { }, | ||
yy: {}, | ||
symbols_: {"error":2,"lex":3,"definitions":4,"include":5,"%%":6,"rules":7,"epilogue":8,"EOF":9,"CODE":10,"action":11,"definition":12,"NAME":13,"regex":14,"START_INC":15,"names_inclusive":16,"START_EXC":17,"names_exclusive":18,"START_COND":19,"name":20,"rule":21,"start_conditions":22,"<":23,"name_list":24,">":25,"*":26,",":27,"ACTION":28,"regex_list":29,"|":30,"regex_concat":31,"regex_base":32,"(":33,")":34,"SPECIAL_GROUP":35,"+":36,"?":37,"/":38,"/!":39,"name_expansion":40,"range_regex":41,"any_group_regex":42,".":43,"^":44,"$":45,"string":46,"escape_char":47,"{":48,"}":49,"ANY_GROUP_REGEX":50,"ESCAPE_CHAR":51,"RANGE_REGEX":52,"STRING_LIT":53,"$accept":0,"$end":1}, | ||
terminals_: {2:"error",6:"%%",9:"EOF",10:"CODE",13:"NAME",15:"START_INC",17:"START_EXC",19:"START_COND",23:"<",25:">",26:"*",27:",",28:"ACTION",30:"|",33:"(",34:")",35:"SPECIAL_GROUP",36:"+",37:"?",38:"/",39:"/!",43:".",44:"^",45:"$",48:"{",49:"}",50:"ANY_GROUP_REGEX",51:"ESCAPE_CHAR",52:"RANGE_REGEX",53:"STRING_LIT"}, | ||
productions_: [0,[3,5],[8,1],[8,2],[8,3],[5,1],[5,0],[4,2],[4,0],[12,2],[12,2],[12,2],[16,1],[16,2],[18,1],[18,2],[20,1],[7,2],[7,1],[21,3],[22,3],[22,3],[22,0],[24,1],[24,3],[11,1],[14,1],[29,3],[29,2],[29,1],[29,0],[31,2],[31,1],[32,3],[32,3],[32,2],[32,2],[32,2],[32,2],[32,2],[32,1],[32,2],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[40,3],[42,1],[47,1],[41,1],[46,1]], | ||
symbols_: {"error":2,"lex":3,"definitions":4,"%%":5,"rules":6,"epilogue":7,"EOF":8,"CODE":9,"definition":10,"ACTION":11,"NAME":12,"regex":13,"START_INC":14,"names_inclusive":15,"START_EXC":16,"names_exclusive":17,"START_COND":18,"rule":19,"start_conditions":20,"<":21,"name_list":22,">":23,"*":24,",":25,"regex_list":26,"|":27,"regex_concat":28,"regex_base":29,"(":30,")":31,"SPECIAL_GROUP":32,"+":33,"?":34,"/":35,"/!":36,"name_expansion":37,"range_regex":38,"any_group_regex":39,".":40,"^":41,"$":42,"string":43,"escape_char":44,"NAME_BRACE":45,"ANY_GROUP_REGEX":46,"ESCAPE_CHAR":47,"RANGE_REGEX":48,"STRING_LIT":49,"CHARACTER_LIT":50,"$accept":0,"$end":1}, | ||
terminals_: {2:"error",5:"%%",8:"EOF",9:"CODE",11:"ACTION",12:"NAME",14:"START_INC",16:"START_EXC",18:"START_COND",21:"<",23:">",24:"*",25:",",27:"|",30:"(",31:")",32:"SPECIAL_GROUP",33:"+",34:"?",35:"/",36:"/!",40:".",41:"^",42:"$",45:"NAME_BRACE",46:"ANY_GROUP_REGEX",47:"ESCAPE_CHAR",48:"RANGE_REGEX",49:"STRING_LIT",50:"CHARACTER_LIT"}, | ||
productions_: [0,[3,4],[7,1],[7,2],[7,3],[4,2],[4,2],[4,0],[10,2],[10,2],[10,2],[15,1],[15,2],[17,1],[17,2],[6,2],[6,1],[19,3],[20,3],[20,3],[20,0],[22,1],[22,3],[13,1],[26,3],[26,2],[26,1],[26,0],[28,2],[28,1],[29,3],[29,3],[29,2],[29,2],[29,2],[29,2],[29,2],[29,1],[29,2],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[37,1],[39,1],[44,1],[38,1],[43,1],[43,1]], | ||
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) { | ||
@@ -14,6 +13,9 @@ | ||
case 1: this.$ = {rules: $$[$0-1]}; | ||
if ($$[$0-4][0]) this.$.macros = $$[$0-4][0]; | ||
if ($$[$0-4][1]) this.$.startConditions = $$[$0-4][1]; | ||
if ($$[$0-3]) this.$.actionInclude = $$[$0-3]; | ||
if ($$[$0-3][0]) this.$.macros = $$[$0-3][0]; | ||
if ($$[$0-3][1]) this.$.startConditions = $$[$0-3][1]; | ||
if ($$[$0]) this.$.moduleInclude = $$[$0]; | ||
if (yy.options) this.$.options = yy.options; | ||
if (yy.actionInclude) this.$.actionInclude = yy.actionInclude; | ||
delete yy.options; | ||
delete yy.actionInclude; | ||
return this.$; | ||
@@ -27,3 +29,3 @@ break; | ||
break; | ||
case 7: | ||
case 5: | ||
this.$ = $$[$0]; | ||
@@ -41,85 +43,81 @@ if ('length' in $$[$0-1]) { | ||
break; | ||
case 8: this.$ = [null,null]; | ||
case 6: yy.actionInclude += $$[$0-1]; this.$ = $$[$0]; | ||
break; | ||
case 9: this.$ = [$$[$0-1], $$[$0]]; | ||
case 7: yy.actionInclude = ''; this.$ = [null,null]; | ||
break; | ||
case 10: this.$ = $$[$0]; | ||
case 8: this.$ = [$$[$0-1], $$[$0]]; | ||
break; | ||
case 11: this.$ = $$[$0]; | ||
case 9: this.$ = $$[$0]; | ||
break; | ||
case 12: this.$ = {}; this.$[$$[$0]] = 0; | ||
case 10: this.$ = $$[$0]; | ||
break; | ||
case 13: this.$ = $$[$0-1]; this.$[$$[$0]] = 0; | ||
case 11: this.$ = {}; this.$[$$[$0]] = 0; | ||
break; | ||
case 14: this.$ = {}; this.$[$$[$0]] = 1; | ||
case 12: this.$ = $$[$0-1]; this.$[$$[$0]] = 0; | ||
break; | ||
case 15: this.$ = $$[$0-1]; this.$[$$[$0]] = 1; | ||
case 13: this.$ = {}; this.$[$$[$0]] = 1; | ||
break; | ||
case 16: this.$ = yytext; | ||
case 14: this.$ = $$[$0-1]; this.$[$$[$0]] = 1; | ||
break; | ||
case 17: this.$ = $$[$0-1]; this.$.push($$[$0]); | ||
case 15: this.$ = $$[$0-1]; this.$.push($$[$0]); | ||
break; | ||
case 18: this.$ = [$$[$0]]; | ||
case 16: this.$ = [$$[$0]]; | ||
break; | ||
case 19: this.$ = $$[$0-2] ? [$$[$0-2], $$[$0-1], $$[$0]] : [$$[$0-1],$$[$0]]; | ||
case 17: this.$ = $$[$0-2] ? [$$[$0-2], $$[$0-1], $$[$0]] : [$$[$0-1],$$[$0]]; | ||
break; | ||
case 20: this.$ = $$[$0-1]; | ||
case 18: this.$ = $$[$0-1]; | ||
break; | ||
case 21: this.$ = ['*']; | ||
case 19: this.$ = ['*']; | ||
break; | ||
case 23: this.$ = [$$[$0]]; | ||
case 21: this.$ = [$$[$0]]; | ||
break; | ||
case 24: this.$ = $$[$0-2]; this.$.push($$[$0]); | ||
case 22: this.$ = $$[$0-2]; this.$.push($$[$0]); | ||
break; | ||
case 25: this.$ = yytext; | ||
break; | ||
case 26: this.$ = $$[$0]; | ||
if (this.$.match(/[\w\d]$/) && !this.$.match(/\\(b|c[A-Z]|x[0-9A-F]{2}|u[a-fA-F0-9]{4}|[0-7]{1,3})$/)) | ||
case 23: this.$ = $$[$0]; | ||
if (!(yy.options && yy.options.flex) && this.$.match(/[\w\d]$/) && !this.$.match(/\\(b|c[A-Z]|x[0-9A-F]{2}|u[a-fA-F0-9]{4}|[0-7]{1,3})$/)) | ||
this.$ += "\\b"; | ||
break; | ||
case 27: this.$ = $$[$0-2]+'|'+$$[$0]; | ||
case 24: this.$ = $$[$0-2]+'|'+$$[$0]; | ||
break; | ||
case 28: this.$ = $$[$0-1]+'|'; | ||
case 25: this.$ = $$[$0-1]+'|'; | ||
break; | ||
case 30: this.$ = '' | ||
case 27: this.$ = '' | ||
break; | ||
case 31: this.$ = $$[$0-1]+$$[$0]; | ||
case 28: this.$ = $$[$0-1]+$$[$0]; | ||
break; | ||
case 33: this.$ = '('+$$[$0-1]+')'; | ||
case 30: this.$ = '('+$$[$0-1]+')'; | ||
break; | ||
case 34: this.$ = $$[$0-2]+$$[$0-1]+')'; | ||
case 31: this.$ = $$[$0-2]+$$[$0-1]+')'; | ||
break; | ||
case 35: this.$ = $$[$0-1]+'+'; | ||
case 32: this.$ = $$[$0-1]+'+'; | ||
break; | ||
case 36: this.$ = $$[$0-1]+'*'; | ||
case 33: this.$ = $$[$0-1]+'*'; | ||
break; | ||
case 37: this.$ = $$[$0-1]+'?'; | ||
case 34: this.$ = $$[$0-1]+'?'; | ||
break; | ||
case 38: this.$ = '(?='+$$[$0]+')'; | ||
case 35: this.$ = '(?='+$$[$0]+')'; | ||
break; | ||
case 39: this.$ = '(?!'+$$[$0]+')'; | ||
case 36: this.$ = '(?!'+$$[$0]+')'; | ||
break; | ||
case 41: this.$ = $$[$0-1]+$$[$0]; | ||
case 38: this.$ = $$[$0-1]+$$[$0]; | ||
break; | ||
case 43: this.$ = '.'; | ||
case 40: this.$ = '.'; | ||
break; | ||
case 44: this.$ = '^'; | ||
case 41: this.$ = '^'; | ||
break; | ||
case 45: this.$ = '$'; | ||
case 42: this.$ = '$'; | ||
break; | ||
case 48: this.$ = '{'+$$[$0-1]+'}'; | ||
case 46: this.$ = yytext; | ||
break; | ||
case 49: this.$ = yytext; | ||
case 47: this.$ = yytext; | ||
break; | ||
case 50: this.$ = yytext; | ||
case 48: this.$ = yytext; | ||
break; | ||
case 51: this.$ = yytext; | ||
case 49: this.$ = yy.prepareString(yytext.substr(1, yytext.length-2)); | ||
break; | ||
case 52: this.$ = yy.prepareString(yytext.substr(1, yytext.length-2)); | ||
break; | ||
} | ||
}, | ||
table: [{3:1,4:2,6:[2,8],12:3,13:[1,4],15:[1,5],17:[1,6],28:[2,8]},{1:[3]},{5:7,6:[2,6],11:8,28:[1,9]},{4:10,6:[2,8],12:3,13:[1,4],15:[1,5],17:[1,6],28:[2,8]},{6:[2,30],13:[2,30],14:11,15:[2,30],17:[2,30],28:[2,30],29:12,30:[2,30],31:13,32:14,33:[1,15],35:[1,16],38:[1,17],39:[1,18],40:19,42:20,43:[1,21],44:[1,22],45:[1,23],46:24,47:25,48:[1,26],50:[1,27],51:[1,29],53:[1,28]},{16:30,19:[1,31]},{18:32,19:[1,33]},{6:[1,34]},{6:[2,5]},{6:[2,25],9:[2,25],23:[2,25],28:[2,25],30:[2,25],33:[2,25],35:[2,25],38:[2,25],39:[2,25],43:[2,25],44:[2,25],45:[2,25],48:[2,25],50:[2,25],51:[2,25],53:[2,25]},{6:[2,7],28:[2,7]},{6:[2,9],13:[2,9],15:[2,9],17:[2,9],28:[2,9]},{6:[2,26],13:[2,26],15:[2,26],17:[2,26],28:[2,26],30:[1,35]},{6:[2,29],13:[2,29],15:[2,29],17:[2,29],28:[2,29],30:[2,29],32:36,33:[1,15],34:[2,29],35:[1,16],38:[1,17],39:[1,18],40:19,42:20,43:[1,21],44:[1,22],45:[1,23],46:24,47:25,48:[1,26],50:[1,27],51:[1,29],53:[1,28]},{6:[2,32],13:[2,32],15:[2,32],17:[2,32],26:[1,38],28:[2,32],30:[2,32],33:[2,32],34:[2,32],35:[2,32],36:[1,37],37:[1,39],38:[2,32],39:[2,32],41:40,43:[2,32],44:[2,32],45:[2,32],48:[2,32],50:[2,32],51:[2,32],52:[1,41],53:[2,32]},{29:42,30:[2,30],31:13,32:14,33:[1,15],34:[2,30],35:[1,16],38:[1,17],39:[1,18],40:19,42:20,43:[1,21],44:[1,22],45:[1,23],46:24,47:25,48:[1,26],50:[1,27],51:[1,29],53:[1,28]},{29:43,30:[2,30],31:13,32:14,33:[1,15],34:[2,30],35:[1,16],38:[1,17],39:[1,18],40:19,42:20,43:[1,21],44:[1,22],45:[1,23],46:24,47:25,48:[1,26],50:[1,27],51:[1,29],53:[1,28]},{32:44,33:[1,15],35:[1,16],38:[1,17],39:[1,18],40:19,42:20,43:[1,21],44:[1,22],45:[1,23],46:24,47:25,48:[1,26],50:[1,27],51:[1,29],53:[1,28]},{32:45,33:[1,15],35:[1,16],38:[1,17],39:[1,18],40:19,42:20,43:[1,21],44:[1,22],45:[1,23],46:24,47:25,48:[1,26],50:[1,27],51:[1,29],53:[1,28]},{6:[2,40],13:[2,40],15:[2,40],17:[2,40],26:[2,40],28:[2,40],30:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],37:[2,40],38:[2,40],39:[2,40],43:[2,40],44:[2,40],45:[2,40],48:[2,40],50:[2,40],51:[2,40],52:[2,40],53:[2,40]},{6:[2,42],13:[2,42],15:[2,42],17:[2,42],26:[2,42],28:[2,42],30:[2,42],33:[2,42],34:[2,42],35:[2,42],36:[2,42],37:[2,42],38:[2,42],39:[2,42],43:[2,42],44:[2,42],45:[2,42],48:[2,42],50:[2,42],51:[2,42],52:[2,42],53:[2,42]},{6:[2,43],13:[2,43],15:[2,43],17:[2,43],26:[2,43],28:[2,43],30:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],37:[2,43],38:[2,43],39:[2,43],43:[2,43],44:[2,43],45:[2,43],48:[2,43],50:[2,43],51:[2,43],52:[2,43],53:[2,43]},{6:[2,44],13:[2,44],15:[2,44],17:[2,44],26:[2,44],28:[2,44],30:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],37:[2,44],38:[2,44],39:[2,44],43:[2,44],44:[2,44],45:[2,44],48:[2,44],50:[2,44],51:[2,44],52:[2,44],53:[2,44]},{6:[2,45],13:[2,45],15:[2,45],17:[2,45],26:[2,45],28:[2,45],30:[2,45],33:[2,45],34:[2,45],35:[2,45],36:[2,45],37:[2,45],38:[2,45],39:[2,45],43:[2,45],44:[2,45],45:[2,45],48:[2,45],50:[2,45],51:[2,45],52:[2,45],53:[2,45]},{6:[2,46],13:[2,46],15:[2,46],17:[2,46],26:[2,46],28:[2,46],30:[2,46],33:[2,46],34:[2,46],35:[2,46],36:[2,46],37:[2,46],38:[2,46],39:[2,46],43:[2,46],44:[2,46],45:[2,46],48:[2,46],50:[2,46],51:[2,46],52:[2,46],53:[2,46]},{6:[2,47],13:[2,47],15:[2,47],17:[2,47],26:[2,47],28:[2,47],30:[2,47],33:[2,47],34:[2,47],35:[2,47],36:[2,47],37:[2,47],38:[2,47],39:[2,47],43:[2,47],44:[2,47],45:[2,47],48:[2,47],50:[2,47],51:[2,47],52:[2,47],53:[2,47]},{13:[1,47],20:46},{6:[2,49],13:[2,49],15:[2,49],17:[2,49],26:[2,49],28:[2,49],30:[2,49],33:[2,49],34:[2,49],35:[2,49],36:[2,49],37:[2,49],38:[2,49],39:[2,49],43:[2,49],44:[2,49],45:[2,49],48:[2,49],50:[2,49],51:[2,49],52:[2,49],53:[2,49]},{6:[2,52],13:[2,52],15:[2,52],17:[2,52],26:[2,52],28:[2,52],30:[2,52],33:[2,52],34:[2,52],35:[2,52],36:[2,52],37:[2,52],38:[2,52],39:[2,52],43:[2,52],44:[2,52],45:[2,52],48:[2,52],50:[2,52],51:[2,52],52:[2,52],53:[2,52]},{6:[2,50],13:[2,50],15:[2,50],17:[2,50],26:[2,50],28:[2,50],30:[2,50],33:[2,50],34:[2,50],35:[2,50],36:[2,50],37:[2,50],38:[2,50],39:[2,50],43:[2,50],44:[2,50],45:[2,50],48:[2,50],50:[2,50],51:[2,50],52:[2,50],53:[2,50]},{6:[2,10],13:[2,10],15:[2,10],17:[2,10],19:[1,48],28:[2,10]},{6:[2,12],13:[2,12],15:[2,12],17:[2,12],19:[2,12],28:[2,12]},{6:[2,11],13:[2,11],15:[2,11],17:[2,11],19:[1,49],28:[2,11]},{6:[2,14],13:[2,14],15:[2,14],17:[2,14],19:[2,14],28:[2,14]},{7:50,21:51,22:52,23:[1,53],28:[2,22],30:[2,22],33:[2,22],35:[2,22],38:[2,22],39:[2,22],43:[2,22],44:[2,22],45:[2,22],48:[2,22],50:[2,22],51:[2,22],53:[2,22]},{6:[2,28],13:[2,28],15:[2,28],17:[2,28],28:[2,28],30:[2,28],31:54,32:14,33:[1,15],34:[2,28],35:[1,16],38:[1,17],39:[1,18],40:19,42:20,43:[1,21],44:[1,22],45:[1,23],46:24,47:25,48:[1,26],50:[1,27],51:[1,29],53:[1,28]},{6:[2,31],13:[2,31],15:[2,31],17:[2,31],26:[1,38],28:[2,31],30:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[1,37],37:[1,39],38:[2,31],39:[2,31],41:40,43:[2,31],44:[2,31],45:[2,31],48:[2,31],50:[2,31],51:[2,31],52:[1,41],53:[2,31]},{6:[2,35],13:[2,35],15:[2,35],17:[2,35],26:[2,35],28:[2,35],30:[2,35],33:[2,35],34:[2,35],35:[2,35],36:[2,35],37:[2,35],38:[2,35],39:[2,35],43:[2,35],44:[2,35],45:[2,35],48:[2,35],50:[2,35],51:[2,35],52:[2,35],53:[2,35]},{6:[2,36],13:[2,36],15:[2,36],17:[2,36],26:[2,36],28:[2,36],30:[2,36],33:[2,36],34:[2,36],35:[2,36],36:[2,36],37:[2,36],38:[2,36],39:[2,36],43:[2,36],44:[2,36],45:[2,36],48:[2,36],50:[2,36],51:[2,36],52:[2,36],53:[2,36]},{6:[2,37],13:[2,37],15:[2,37],17:[2,37],26:[2,37],28:[2,37],30:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],37:[2,37],38:[2,37],39:[2,37],43:[2,37],44:[2,37],45:[2,37],48:[2,37],50:[2,37],51:[2,37],52:[2,37],53:[2,37]},{6:[2,41],13:[2,41],15:[2,41],17:[2,41],26:[2,41],28:[2,41],30:[2,41],33:[2,41],34:[2,41],35:[2,41],36:[2,41],37:[2,41],38:[2,41],39:[2,41],43:[2,41],44:[2,41],45:[2,41],48:[2,41],50:[2,41],51:[2,41],52:[2,41],53:[2,41]},{6:[2,51],13:[2,51],15:[2,51],17:[2,51],26:[2,51],28:[2,51],30:[2,51],33:[2,51],34:[2,51],35:[2,51],36:[2,51],37:[2,51],38:[2,51],39:[2,51],43:[2,51],44:[2,51],45:[2,51],48:[2,51],50:[2,51],51:[2,51],52:[2,51],53:[2,51]},{30:[1,35],34:[1,55]},{30:[1,35],34:[1,56]},{6:[2,38],13:[2,38],15:[2,38],17:[2,38],26:[1,38],28:[2,38],30:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[1,37],37:[1,39],38:[2,38],39:[2,38],41:40,43:[2,38],44:[2,38],45:[2,38],48:[2,38],50:[2,38],51:[2,38],52:[1,41],53:[2,38]},{6:[2,39],13:[2,39],15:[2,39],17:[2,39],26:[1,38],28:[2,39],30:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[1,37],37:[1,39],38:[2,39],39:[2,39],41:40,43:[2,39],44:[2,39],45:[2,39],48:[2,39],50:[2,39],51:[2,39],52:[1,41],53:[2,39]},{49:[1,57]},{49:[2,16]},{6:[2,13],13:[2,13],15:[2,13],17:[2,13],19:[2,13],28:[2,13]},{6:[2,15],13:[2,15],15:[2,15],17:[2,15],19:[2,15],28:[2,15]},{6:[1,61],8:58,9:[1,60],21:59,22:52,23:[1,53],28:[2,22],30:[2,22],33:[2,22],35:[2,22],38:[2,22],39:[2,22],43:[2,22],44:[2,22],45:[2,22],48:[2,22],50:[2,22],51:[2,22],53:[2,22]},{6:[2,18],9:[2,18],23:[2,18],28:[2,18],30:[2,18],33:[2,18],35:[2,18],38:[2,18],39:[2,18],43:[2,18],44:[2,18],45:[2,18],48:[2,18],50:[2,18],51:[2,18],53:[2,18]},{14:62,28:[2,30],29:12,30:[2,30],31:13,32:14,33:[1,15],35:[1,16],38:[1,17],39:[1,18],40:19,42:20,43:[1,21],44:[1,22],45:[1,23],46:24,47:25,48:[1,26],50:[1,27],51:[1,29],53:[1,28]},{13:[1,65],24:63,26:[1,64]},{6:[2,27],13:[2,27],15:[2,27],17:[2,27],28:[2,27],30:[2,27],32:36,33:[1,15],34:[2,27],35:[1,16],38:[1,17],39:[1,18],40:19,42:20,43:[1,21],44:[1,22],45:[1,23],46:24,47:25,48:[1,26],50:[1,27],51:[1,29],53:[1,28]},{6:[2,33],13:[2,33],15:[2,33],17:[2,33],26:[2,33],28:[2,33],30:[2,33],33:[2,33],34:[2,33],35:[2,33],36:[2,33],37:[2,33],38:[2,33],39:[2,33],43:[2,33],44:[2,33],45:[2,33],48:[2,33],50:[2,33],51:[2,33],52:[2,33],53:[2,33]},{6:[2,34],13:[2,34],15:[2,34],17:[2,34],26:[2,34],28:[2,34],30:[2,34],33:[2,34],34:[2,34],35:[2,34],36:[2,34],37:[2,34],38:[2,34],39:[2,34],43:[2,34],44:[2,34],45:[2,34],48:[2,34],50:[2,34],51:[2,34],52:[2,34],53:[2,34]},{6:[2,48],13:[2,48],15:[2,48],17:[2,48],26:[2,48],28:[2,48],30:[2,48],33:[2,48],34:[2,48],35:[2,48],36:[2,48],37:[2,48],38:[2,48],39:[2,48],43:[2,48],44:[2,48],45:[2,48],48:[2,48],50:[2,48],51:[2,48],52:[2,48],53:[2,48]},{1:[2,1]},{6:[2,17],9:[2,17],23:[2,17],28:[2,17],30:[2,17],33:[2,17],35:[2,17],38:[2,17],39:[2,17],43:[2,17],44:[2,17],45:[2,17],48:[2,17],50:[2,17],51:[2,17],53:[2,17]},{1:[2,2]},{9:[1,66],10:[1,67]},{11:68,28:[1,9]},{25:[1,69],27:[1,70]},{25:[1,71]},{25:[2,23],27:[2,23]},{1:[2,3]},{9:[1,72]},{6:[2,19],9:[2,19],23:[2,19],28:[2,19],30:[2,19],33:[2,19],35:[2,19],38:[2,19],39:[2,19],43:[2,19],44:[2,19],45:[2,19],48:[2,19],50:[2,19],51:[2,19],53:[2,19]},{28:[2,20],30:[2,20],33:[2,20],35:[2,20],38:[2,20],39:[2,20],43:[2,20],44:[2,20],45:[2,20],48:[2,20],50:[2,20],51:[2,20],53:[2,20]},{13:[1,73]},{28:[2,21],30:[2,21],33:[2,21],35:[2,21],38:[2,21],39:[2,21],43:[2,21],44:[2,21],45:[2,21],48:[2,21],50:[2,21],51:[2,21],53:[2,21]},{1:[2,4]},{25:[2,24],27:[2,24]}], | ||
defaultActions: {8:[2,5],47:[2,16],58:[2,1],60:[2,2],66:[2,3],72:[2,4]}, | ||
table: [{3:1,4:2,5:[2,7],10:3,11:[1,4],12:[1,5],14:[1,6],16:[1,7]},{1:[3]},{5:[1,8]},{4:9,5:[2,7],10:3,11:[1,4],12:[1,5],14:[1,6],16:[1,7]},{4:10,5:[2,7],10:3,11:[1,4],12:[1,5],14:[1,6],16:[1,7]},{5:[2,27],11:[2,27],12:[2,27],13:11,14:[2,27],16:[2,27],26:12,27:[2,27],28:13,29:14,30:[1,15],32:[1,16],35:[1,17],36:[1,18],37:19,39:20,40:[1,21],41:[1,22],42:[1,23],43:24,44:25,45:[1,26],46:[1,27],47:[1,30],49:[1,28],50:[1,29]},{15:31,18:[1,32]},{17:33,18:[1,34]},{6:35,11:[2,20],19:36,20:37,21:[1,38],27:[2,20],30:[2,20],32:[2,20],35:[2,20],36:[2,20],40:[2,20],41:[2,20],42:[2,20],45:[2,20],46:[2,20],47:[2,20],49:[2,20],50:[2,20]},{5:[2,5]},{5:[2,6]},{5:[2,8],11:[2,8],12:[2,8],14:[2,8],16:[2,8]},{5:[2,23],11:[2,23],12:[2,23],14:[2,23],16:[2,23],27:[1,39]},{5:[2,26],11:[2,26],12:[2,26],14:[2,26],16:[2,26],27:[2,26],29:40,30:[1,15],31:[2,26],32:[1,16],35:[1,17],36:[1,18],37:19,39:20,40:[1,21],41:[1,22],42:[1,23],43:24,44:25,45:[1,26],46:[1,27],47:[1,30],49:[1,28],50:[1,29]},{5:[2,29],11:[2,29],12:[2,29],14:[2,29],16:[2,29],24:[1,42],27:[2,29],30:[2,29],31:[2,29],32:[2,29],33:[1,41],34:[1,43],35:[2,29],36:[2,29],38:44,40:[2,29],41:[2,29],42:[2,29],45:[2,29],46:[2,29],47:[2,29],48:[1,45],49:[2,29],50:[2,29]},{26:46,27:[2,27],28:13,29:14,30:[1,15],31:[2,27],32:[1,16],35:[1,17],36:[1,18],37:19,39:20,40:[1,21],41:[1,22],42:[1,23],43:24,44:25,45:[1,26],46:[1,27],47:[1,30],49:[1,28],50:[1,29]},{26:47,27:[2,27],28:13,29:14,30:[1,15],31:[2,27],32:[1,16],35:[1,17],36:[1,18],37:19,39:20,40:[1,21],41:[1,22],42:[1,23],43:24,44:25,45:[1,26],46:[1,27],47:[1,30],49:[1,28],50:[1,29]},{29:48,30:[1,15],32:[1,16],35:[1,17],36:[1,18],37:19,39:20,40:[1,21],41:[1,22],42:[1,23],43:24,44:25,45:[1,26],46:[1,27],47:[1,30],49:[1,28],50:[1,29]},{29:49,30:[1,15],32:[1,16],35:[1,17],36:[1,18],37:19,39:20,40:[1,21],41:[1,22],42:[1,23],43:24,44:25,45:[1,26],46:[1,27],47:[1,30],49:[1,28],50:[1,29]},{5:[2,37],11:[2,37],12:[2,37],14:[2,37],16:[2,37],24:[2,37],27:[2,37],30:[2,37],31:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],41:[2,37],42:[2,37],45:[2,37],46:[2,37],47:[2,37],48:[2,37],49:[2,37],50:[2,37]},{5:[2,39],11:[2,39],12:[2,39],14:[2,39],16:[2,39],24:[2,39],27:[2,39],30:[2,39],31:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],41:[2,39],42:[2,39],45:[2,39],46:[2,39],47:[2,39],48:[2,39],49:[2,39],50:[2,39]},{5:[2,40],11:[2,40],12:[2,40],14:[2,40],16:[2,40],24:[2,40],27:[2,40],30:[2,40],31:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[2,40],42:[2,40],45:[2,40],46:[2,40],47:[2,40],48:[2,40],49:[2,40],50:[2,40]},{5:[2,41],11:[2,41],12:[2,41],14:[2,41],16:[2,41],24:[2,41],27:[2,41],30:[2,41],31:[2,41],32:[2,41],33:[2,41],34:[2,41],35:[2,41],36:[2,41],40:[2,41],41:[2,41],42:[2,41],45:[2,41],46:[2,41],47:[2,41],48:[2,41],49:[2,41],50:[2,41]},{5:[2,42],11:[2,42],12:[2,42],14:[2,42],16:[2,42],24:[2,42],27:[2,42],30:[2,42],31:[2,42],32:[2,42],33:[2,42],34:[2,42],35:[2,42],36:[2,42],40:[2,42],41:[2,42],42:[2,42],45:[2,42],46:[2,42],47:[2,42],48:[2,42],49:[2,42],50:[2,42]},{5:[2,43],11:[2,43],12:[2,43],14:[2,43],16:[2,43],24:[2,43],27:[2,43],30:[2,43],31:[2,43],32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],41:[2,43],42:[2,43],45:[2,43],46:[2,43],47:[2,43],48:[2,43],49:[2,43],50:[2,43]},{5:[2,44],11:[2,44],12:[2,44],14:[2,44],16:[2,44],24:[2,44],27:[2,44],30:[2,44],31:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],41:[2,44],42:[2,44],45:[2,44],46:[2,44],47:[2,44],48:[2,44],49:[2,44],50:[2,44]},{5:[2,45],11:[2,45],12:[2,45],14:[2,45],16:[2,45],24:[2,45],27:[2,45],30:[2,45],31:[2,45],32:[2,45],33:[2,45],34:[2,45],35:[2,45],36:[2,45],40:[2,45],41:[2,45],42:[2,45],45:[2,45],46:[2,45],47:[2,45],48:[2,45],49:[2,45],50:[2,45]},{5:[2,46],11:[2,46],12:[2,46],14:[2,46],16:[2,46],24:[2,46],27:[2,46],30:[2,46],31:[2,46],32:[2,46],33:[2,46],34:[2,46],35:[2,46],36:[2,46],40:[2,46],41:[2,46],42:[2,46],45:[2,46],46:[2,46],47:[2,46],48:[2,46],49:[2,46],50:[2,46]},{5:[2,49],11:[2,49],12:[2,49],14:[2,49],16:[2,49],24:[2,49],27:[2,49],30:[2,49],31:[2,49],32:[2,49],33:[2,49],34:[2,49],35:[2,49],36:[2,49],40:[2,49],41:[2,49],42:[2,49],45:[2,49],46:[2,49],47:[2,49],48:[2,49],49:[2,49],50:[2,49]},{5:[2,50],11:[2,50],12:[2,50],14:[2,50],16:[2,50],24:[2,50],27:[2,50],30:[2,50],31:[2,50],32:[2,50],33:[2,50],34:[2,50],35:[2,50],36:[2,50],40:[2,50],41:[2,50],42:[2,50],45:[2,50],46:[2,50],47:[2,50],48:[2,50],49:[2,50],50:[2,50]},{5:[2,47],11:[2,47],12:[2,47],14:[2,47],16:[2,47],24:[2,47],27:[2,47],30:[2,47],31:[2,47],32:[2,47],33:[2,47],34:[2,47],35:[2,47],36:[2,47],40:[2,47],41:[2,47],42:[2,47],45:[2,47],46:[2,47],47:[2,47],48:[2,47],49:[2,47],50:[2,47]},{5:[2,9],11:[2,9],12:[2,9],14:[2,9],16:[2,9],18:[1,50]},{5:[2,11],11:[2,11],12:[2,11],14:[2,11],16:[2,11],18:[2,11]},{5:[2,10],11:[2,10],12:[2,10],14:[2,10],16:[2,10],18:[1,51]},{5:[2,13],11:[2,13],12:[2,13],14:[2,13],16:[2,13],18:[2,13]},{5:[1,55],7:52,8:[1,54],11:[2,20],19:53,20:37,21:[1,38],27:[2,20],30:[2,20],32:[2,20],35:[2,20],36:[2,20],40:[2,20],41:[2,20],42:[2,20],45:[2,20],46:[2,20],47:[2,20],49:[2,20],50:[2,20]},{5:[2,16],8:[2,16],11:[2,16],21:[2,16],27:[2,16],30:[2,16],32:[2,16],35:[2,16],36:[2,16],40:[2,16],41:[2,16],42:[2,16],45:[2,16],46:[2,16],47:[2,16],49:[2,16],50:[2,16]},{11:[2,27],13:56,26:12,27:[2,27],28:13,29:14,30:[1,15],32:[1,16],35:[1,17],36:[1,18],37:19,39:20,40:[1,21],41:[1,22],42:[1,23],43:24,44:25,45:[1,26],46:[1,27],47:[1,30],49:[1,28],50:[1,29]},{12:[1,59],22:57,24:[1,58]},{5:[2,25],11:[2,25],12:[2,25],14:[2,25],16:[2,25],27:[2,25],28:60,29:14,30:[1,15],31:[2,25],32:[1,16],35:[1,17],36:[1,18],37:19,39:20,40:[1,21],41:[1,22],42:[1,23],43:24,44:25,45:[1,26],46:[1,27],47:[1,30],49:[1,28],50:[1,29]},{5:[2,28],11:[2,28],12:[2,28],14:[2,28],16:[2,28],24:[1,42],27:[2,28],30:[2,28],31:[2,28],32:[2,28],33:[1,41],34:[1,43],35:[2,28],36:[2,28],38:44,40:[2,28],41:[2,28],42:[2,28],45:[2,28],46:[2,28],47:[2,28],48:[1,45],49:[2,28],50:[2,28]},{5:[2,32],11:[2,32],12:[2,32],14:[2,32],16:[2,32],24:[2,32],27:[2,32],30:[2,32],31:[2,32],32:[2,32],33:[2,32],34:[2,32],35:[2,32],36:[2,32],40:[2,32],41:[2,32],42:[2,32],45:[2,32],46:[2,32],47:[2,32],48:[2,32],49:[2,32],50:[2,32]},{5:[2,33],11:[2,33],12:[2,33],14:[2,33],16:[2,33],24:[2,33],27:[2,33],30:[2,33],31:[2,33],32:[2,33],33:[2,33],34:[2,33],35:[2,33],36:[2,33],40:[2,33],41:[2,33],42:[2,33],45:[2,33],46:[2,33],47:[2,33],48:[2,33],49:[2,33],50:[2,33]},{5:[2,34],11:[2,34],12:[2,34],14:[2,34],16:[2,34],24:[2,34],27:[2,34],30:[2,34],31:[2,34],32:[2,34],33:[2,34],34:[2,34],35:[2,34],36:[2,34],40:[2,34],41:[2,34],42:[2,34],45:[2,34],46:[2,34],47:[2,34],48:[2,34],49:[2,34],50:[2,34]},{5:[2,38],11:[2,38],12:[2,38],14:[2,38],16:[2,38],24:[2,38],27:[2,38],30:[2,38],31:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],41:[2,38],42:[2,38],45:[2,38],46:[2,38],47:[2,38],48:[2,38],49:[2,38],50:[2,38]},{5:[2,48],11:[2,48],12:[2,48],14:[2,48],16:[2,48],24:[2,48],27:[2,48],30:[2,48],31:[2,48],32:[2,48],33:[2,48],34:[2,48],35:[2,48],36:[2,48],40:[2,48],41:[2,48],42:[2,48],45:[2,48],46:[2,48],47:[2,48],48:[2,48],49:[2,48],50:[2,48]},{27:[1,39],31:[1,61]},{27:[1,39],31:[1,62]},{5:[2,35],11:[2,35],12:[2,35],14:[2,35],16:[2,35],24:[1,42],27:[2,35],30:[2,35],31:[2,35],32:[2,35],33:[1,41],34:[1,43],35:[2,35],36:[2,35],38:44,40:[2,35],41:[2,35],42:[2,35],45:[2,35],46:[2,35],47:[2,35],48:[1,45],49:[2,35],50:[2,35]},{5:[2,36],11:[2,36],12:[2,36],14:[2,36],16:[2,36],24:[1,42],27:[2,36],30:[2,36],31:[2,36],32:[2,36],33:[1,41],34:[1,43],35:[2,36],36:[2,36],38:44,40:[2,36],41:[2,36],42:[2,36],45:[2,36],46:[2,36],47:[2,36],48:[1,45],49:[2,36],50:[2,36]},{5:[2,12],11:[2,12],12:[2,12],14:[2,12],16:[2,12],18:[2,12]},{5:[2,14],11:[2,14],12:[2,14],14:[2,14],16:[2,14],18:[2,14]},{1:[2,1]},{5:[2,15],8:[2,15],11:[2,15],21:[2,15],27:[2,15],30:[2,15],32:[2,15],35:[2,15],36:[2,15],40:[2,15],41:[2,15],42:[2,15],45:[2,15],46:[2,15],47:[2,15],49:[2,15],50:[2,15]},{1:[2,2]},{8:[1,63],9:[1,64]},{11:[1,65]},{23:[1,66],25:[1,67]},{23:[1,68]},{23:[2,21],25:[2,21]},{5:[2,24],11:[2,24],12:[2,24],14:[2,24],16:[2,24],27:[2,24],29:40,30:[1,15],31:[2,24],32:[1,16],35:[1,17],36:[1,18],37:19,39:20,40:[1,21],41:[1,22],42:[1,23],43:24,44:25,45:[1,26],46:[1,27],47:[1,30],49:[1,28],50:[1,29]},{5:[2,30],11:[2,30],12:[2,30],14:[2,30],16:[2,30],24:[2,30],27:[2,30],30:[2,30],31:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],41:[2,30],42:[2,30],45:[2,30],46:[2,30],47:[2,30],48:[2,30],49:[2,30],50:[2,30]},{5:[2,31],11:[2,31],12:[2,31],14:[2,31],16:[2,31],24:[2,31],27:[2,31],30:[2,31],31:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],41:[2,31],42:[2,31],45:[2,31],46:[2,31],47:[2,31],48:[2,31],49:[2,31],50:[2,31]},{1:[2,3]},{8:[1,69]},{5:[2,17],8:[2,17],11:[2,17],21:[2,17],27:[2,17],30:[2,17],32:[2,17],35:[2,17],36:[2,17],40:[2,17],41:[2,17],42:[2,17],45:[2,17],46:[2,17],47:[2,17],49:[2,17],50:[2,17]},{11:[2,18],27:[2,18],30:[2,18],32:[2,18],35:[2,18],36:[2,18],40:[2,18],41:[2,18],42:[2,18],45:[2,18],46:[2,18],47:[2,18],49:[2,18],50:[2,18]},{12:[1,70]},{11:[2,19],27:[2,19],30:[2,19],32:[2,19],35:[2,19],36:[2,19],40:[2,19],41:[2,19],42:[2,19],45:[2,19],46:[2,19],47:[2,19],49:[2,19],50:[2,19]},{1:[2,4]},{23:[2,22],25:[2,22]}], | ||
defaultActions: {9:[2,5],10:[2,6],52:[2,1],54:[2,2],63:[2,3],69:[2,4]}, | ||
parseError: function parseError(str, hash) { | ||
@@ -171,3 +169,3 @@ throw new Error(str); | ||
if (this.lexer.showPosition) { | ||
errStr = "Parse error on line " + (yylineno + 1) + ":\\n" + this.lexer.showPosition() + "\\nExpecting " + expected.join(", "); | ||
errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + this.terminals_[symbol] + "'"; | ||
} else { | ||
@@ -226,7 +224,5 @@ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'"); | ||
} | ||
};/* Jison generated lexer */ | ||
}; | ||
/* Jison generated lexer */ | ||
var lexer = (function(){ | ||
var lexer = ({EOF:1, | ||
@@ -292,2 +288,4 @@ parseError:function parseError(str, hash) { | ||
match, | ||
tempMatch, | ||
index, | ||
col, | ||
@@ -301,22 +299,26 @@ lines; | ||
for (var i=0;i < rules.length; i++) { | ||
match = this._input.match(this.rules[rules[i]]); | ||
if (match) { | ||
lines = match[0].match(/\n.*/g); | ||
if (lines) this.yylineno += lines.length; | ||
this.yylloc = {first_line: this.yylloc.last_line, | ||
last_line: this.yylineno+1, | ||
first_column: this.yylloc.last_column, | ||
last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length} | ||
this.yytext += match[0]; | ||
this.match += match[0]; | ||
this.matches = match; | ||
this.yyleng = this.yytext.length; | ||
this._more = false; | ||
this._input = this._input.slice(match[0].length); | ||
this.matched += match[0]; | ||
token = this.performAction.call(this, this.yy, this, rules[i],this.conditionStack[this.conditionStack.length-1]); | ||
if (token) return token; | ||
else return; | ||
tempMatch = this._input.match(this.rules[rules[i]]); | ||
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { | ||
match = tempMatch; | ||
index = i; | ||
if (!this.options.flex) break; | ||
} | ||
} | ||
if (match) { | ||
lines = match[0].match(/\n.*/g); | ||
if (lines) this.yylineno += lines.length; | ||
this.yylloc = {first_line: this.yylloc.last_line, | ||
last_line: this.yylineno+1, | ||
first_column: this.yylloc.last_column, | ||
last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length} | ||
this.yytext += match[0]; | ||
this.match += match[0]; | ||
this.yyleng = this.yytext.length; | ||
this._more = false; | ||
this._input = this._input.slice(match[0].length); | ||
this.matched += match[0]; | ||
token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]); | ||
if (token) return token; | ||
else return; | ||
} | ||
if (this._input === "") { | ||
@@ -345,3 +347,10 @@ return this.EOF; | ||
return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules; | ||
}, | ||
topState:function () { | ||
return this.conditionStack[this.conditionStack.length-2]; | ||
}, | ||
pushState:function begin(condition) { | ||
this.begin(condition); | ||
}}); | ||
lexer.options = {}; | ||
lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { | ||
@@ -351,90 +360,124 @@ | ||
switch($avoiding_name_collisions) { | ||
case 0:return 19 | ||
case 0:return 12 | ||
break; | ||
case 1:this.begin('INITIAL') | ||
case 1:this.popState(); return 23 | ||
break; | ||
case 2:/* empty */ | ||
case 2:return 25 | ||
break; | ||
case 3:this.begin('INITIAL') | ||
case 3:return 24 | ||
break; | ||
case 4:this.begin('trail'); yy_.yytext = yy_.yytext.substr(1, yy_.yytext.length-2);return 28; | ||
case 4:/* */ | ||
break; | ||
case 5:this.begin('trail'); yy_.yytext = yy_.yytext.substr(2, yy_.yytext.length-4);return 28; | ||
case 5:this.begin('indented') | ||
break; | ||
case 6:this.begin('INITIAL'); return 28 | ||
case 6:this.begin('code'); return 5 | ||
break; | ||
case 7:this.begin('INITIAL') | ||
case 7:return 50 | ||
break; | ||
case 8:if (yy.ruleSection) this.begin('indented') | ||
case 8:yy.options[yy_.yytext] = true | ||
break; | ||
case 9:return 13 | ||
case 9:this.begin('INITIAL') | ||
break; | ||
case 10:yy_.yytext = yy_.yytext.replace(/\\"/g,'"');return 53; | ||
case 10:this.begin('INITIAL') | ||
break; | ||
case 11:yy_.yytext = yy_.yytext.replace(/\\'/g,"'");return 53; | ||
case 11:/* empty */ | ||
break; | ||
case 12:return 30 | ||
case 12:return 18 | ||
break; | ||
case 13:return 50 | ||
case 13:this.begin('INITIAL') | ||
break; | ||
case 14:return 35 | ||
case 14:this.begin('INITIAL') | ||
break; | ||
case 15:return 35 | ||
case 15:/* empty */ | ||
break; | ||
case 16:return 35 | ||
case 16:this.begin('rules') | ||
break; | ||
case 17:return 33 | ||
case 17:this.begin('trail'); yy_.yytext = yy_.yytext.substr(1, yy_.yytext.length-2);return 11 | ||
break; | ||
case 18:return 34 | ||
case 18:this.begin('trail'); yy_.yytext = yy_.yytext.substr(2, yy_.yytext.length-4);return 11 | ||
break; | ||
case 19:return 36 | ||
case 19:yy_.yytext = yy_.yytext.substr(2, yy_.yytext.length-4); return 11 | ||
break; | ||
case 20:return 26 | ||
case 20:this.begin('rules'); return 11 | ||
break; | ||
case 21:return 37 | ||
case 21:/* */ | ||
break; | ||
case 22:return 44 | ||
case 22:/* */ | ||
break; | ||
case 23:return 27 | ||
case 23:return 12 | ||
break; | ||
case 24:return 45 | ||
case 24:yy_.yytext = yy_.yytext.replace(/\\"/g,'"');return 49 | ||
break; | ||
case 25:return 23 | ||
case 25:yy_.yytext = yy_.yytext.replace(/\\'/g,"'");return 49 | ||
break; | ||
case 26:return 25 | ||
case 26:return 27 | ||
break; | ||
case 27:return 39 | ||
case 27:return 46 | ||
break; | ||
case 28:return 38 | ||
case 28:return 32 | ||
break; | ||
case 29:return 51 | ||
case 29:return 32 | ||
break; | ||
case 30:yy_.yytext = yy_.yytext.replace(/^\\/g,''); return 51 | ||
case 30:return 32 | ||
break; | ||
case 31:return 45 | ||
case 31:return 30 | ||
break; | ||
case 32:return 43 | ||
case 32:return 31 | ||
break; | ||
case 33:this.begin('start_condition');return 15 | ||
case 33:return 33 | ||
break; | ||
case 34:this.begin('start_condition');return 17 | ||
case 34:return 24 | ||
break; | ||
case 35:if (yy.ruleSection) this.begin('code'); yy.ruleSection = true; return 6 | ||
case 35:return 34 | ||
break; | ||
case 36:return 52 | ||
case 36:return 41 | ||
break; | ||
case 37:return 48 | ||
case 37:return 25 | ||
break; | ||
case 38:return 49 | ||
case 38:return 42 | ||
break; | ||
case 39:/* ignore bad characters */ | ||
case 39:this.begin('conditions'); return 21 | ||
break; | ||
case 40:return 9 | ||
case 40:return 36 | ||
break; | ||
case 41:return 10; | ||
case 41:return 35 | ||
break; | ||
case 42:return 47 | ||
break; | ||
case 43:yy_.yytext = yy_.yytext.replace(/^\\/g,''); return 47 | ||
break; | ||
case 44:return 42 | ||
break; | ||
case 45:return 40 | ||
break; | ||
case 46:yy.options = {}; this.begin('options') | ||
break; | ||
case 47:this.begin('start_condition');return 14 | ||
break; | ||
case 48:this.begin('start_condition');return 16 | ||
break; | ||
case 49:this.begin('rules'); return 5 | ||
break; | ||
case 50:return 48 | ||
break; | ||
case 51:return 45 | ||
break; | ||
case 52:return '{' | ||
break; | ||
case 53:return '}' | ||
break; | ||
case 54:/* ignore bad characters */ | ||
break; | ||
case 55:return 8 | ||
break; | ||
case 56:return 9 | ||
break; | ||
} | ||
}; | ||
lexer.rules = [/^[a-zA-Z_][a-zA-Z0-9_-]*/,/^\n+/,/^\s+/,/^.*\n+/,/^\{[^}]*\}/,/^%\{(.|\n)*?%\}/,/^.+/,/^\n+/,/^\s+/,/^[a-zA-Z_][a-zA-Z0-9_-]*/,/^"(\\\\|\\"|[^"])*"/,/^'(\\\\|\\'|[^'])*'/,/^\|/,/^\[(\\\]|[^\]])*\]/,/^\(\?:/,/^\(\?=/,/^\(\?!/,/^\(/,/^\)/,/^\+/,/^\*/,/^\?/,/^\^/,/^,/,/^<<EOF>>/,/^</,/^>/,/^\/!/,/^\//,/^\\([0-7]{1,3}|[rfntvsSbBwWdD\\*+()${}|[\]\/.^?]|c[A-Z]|x[0-9A-F]{2}|u[a-fA-F0-9]{4})/,/^\\./,/^\$/,/^\./,/^%s\b/,/^%x\b/,/^%%/,/^\{\d+(,\s?\d+|,)?\}/,/^\{/,/^\}/,/^./,/^$/,/^(.|\n)+/]; | ||
lexer.conditions = {"code":{"rules":[40,41],"inclusive":false},"start_condition":{"rules":[0,1,2,40],"inclusive":false},"indented":{"rules":[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"inclusive":true},"trail":{"rules":[3,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"inclusive":true},"INITIAL":{"rules":[5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"inclusive":true}};return lexer;})() | ||
lexer.rules = [/^[a-zA-Z_][a-zA-Z0-9_-]*/,/^>/,/^,/,/^\*/,/^\n+/,/^\s+/,/^%%/,/^[a-zA-Z0-9_]+/,/^[a-zA-Z_][a-zA-Z0-9_-]*/,/^\n+/,/^\s+\n+/,/^\s+/,/^[a-zA-Z_][a-zA-Z0-9_-]*/,/^\n+/,/^\s+\n+/,/^\s+/,/^.*\n+/,/^\{[^}]*\}/,/^%\{(.|\n)*?%\}/,/^%\{(.|\n)*?%\}/,/^.+/,/^\n+/,/^\s+/,/^[a-zA-Z_][a-zA-Z0-9_-]*/,/^"(\\\\|\\"|[^"])*"/,/^'(\\\\|\\'|[^'])*'/,/^\|/,/^\[(\\\]|[^\]])*\]/,/^\(\?:/,/^\(\?=/,/^\(\?!/,/^\(/,/^\)/,/^\+/,/^\*/,/^\?/,/^\^/,/^,/,/^<<EOF>>/,/^</,/^\/!/,/^\//,/^\\([0-7]{1,3}|[rfntvsSbBwWdD\\*+()${}|[\]\/.^?]|c[A-Z]|x[0-9A-F]{2}|u[a-fA-F0-9]{4})/,/^\\./,/^\$/,/^\./,/^%options\b/,/^%s\b/,/^%x\b/,/^%%/,/^\{\d+(,\s?\d+|,)?\}/,/^\{[a-zA-Z_][a-zA-Z0-9_-]*\}/,/^\{/,/^\}/,/^./,/^$/,/^(.|\n)+/]; | ||
lexer.conditions = {"code":{"rules":[55,56],"inclusive":false},"start_condition":{"rules":[12,13,14,15,55],"inclusive":false},"options":{"rules":[8,9,10,11,55],"inclusive":false},"conditions":{"rules":[0,1,2,3,55],"inclusive":false},"indented":{"rules":[17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55],"inclusive":true},"trail":{"rules":[16,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55],"inclusive":true},"rules":{"rules":[4,5,6,7,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55],"inclusive":true},"INITIAL":{"rules":[19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55],"inclusive":true}}; | ||
; | ||
return lexer;})() | ||
parser.lexer = lexer; | ||
@@ -441,0 +484,0 @@ return parser; |
@@ -5,3 +5,3 @@ { | ||
"description": "A parser generator with Bison's API", | ||
"version": "0.2.14", | ||
"version": "0.3.0", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "jison", |
@@ -11,6 +11,4 @@ Jison | ||
A brief warning before proceeding: **the API is ridiculously unstable** right now. The goal is to mirror Bison where it makes sense, but we're not even there yet. Also, optimization has not been a main focus as of yet. | ||
Briefly, Jison takes a JSON encoded grammar or Bison style grammar and outputs a JavaScript file capable of parsing the language described by that grammar. You can then use the generated script to parse inputs and accept, reject, or perform actions based on the input. | ||
Briefly, Jison takes a JSON encoded grammar specification and outputs a JavaScript file capable of parsing the language described by that grammar specification. You can then use the generated script to parse inputs and accept, reject, or perform actions based on the input. | ||
Installation | ||
@@ -108,3 +106,3 @@ ------------ | ||
> Copyright (c) 2009 Zachary Carter | ||
> Copyright (c) 2012 Zachary Carter | ||
> | ||
@@ -111,0 +109,0 @@ > Permission is hereby granted, free of |
@@ -9,3 +9,6 @@ #!/usr/bin/env narwhal | ||
exports.testEBNF = require("./ebnf"); | ||
exports.testEBNFParse = require("./ebnf_parse"); | ||
if (require.main === module) | ||
require("os").exit(require("test").run(exports)); | ||
require("os").exit(require("test").run(exports)); |
@@ -250,1 +250,25 @@ var assert = require("assert"), | ||
} | ||
exports["test options"] = function () { | ||
var lexgrammar = '%options flex\n%%\n"foo" return 1;'; | ||
var expected = { | ||
rules: [ | ||
["foo", "return 1;"] | ||
], | ||
options: {flex: true} | ||
}; | ||
assert.deepEqual(lex.parse(lexgrammar), expected, "grammar should be parsed correctly"); | ||
} | ||
exports["test unquoted string rules"] = function () { | ||
var lexgrammar = "%%\nfoo* return 1"; | ||
var expected = { | ||
rules: [ | ||
["foo*", "return 1"] | ||
] | ||
}; | ||
assert.deepEqual(lex.parse(lexgrammar), expected, "grammar should be parsed correctly"); | ||
} | ||
@@ -298,3 +298,3 @@ var RegExpLexer = require("../setup").RegExpLexer, | ||
lexer.setInput(input); | ||
assert.equal(lexer.lex(), "X"); | ||
@@ -352,3 +352,3 @@ assert.equal(lexer.lex(), "X"); | ||
exports.lexer.setInput(input); | ||
assert.equal(exports.lex(), "X"); | ||
@@ -366,3 +366,3 @@ assert.equal(exports.lex(), "X"); | ||
"digit": "[0-9]", | ||
"id": "[a-zA-Z][a-zA-Z0-9]*" | ||
"id": "[a-zA-Z][a-zA-Z0-9]*" | ||
}, | ||
@@ -472,3 +472,3 @@ | ||
var dict = "%%\n'x' {return 'X';}\n'y' {return 'Y';}\n<<EOF>> {return 'EOF';}"; | ||
var input = "x"; | ||
@@ -478,3 +478,3 @@ | ||
lexer.setInput(input); | ||
assert.equal(lexer.lex(), "X"); | ||
@@ -502,3 +502,3 @@ assert.equal(lexer.lex(), "EOF"); | ||
lexer.setInput(input); | ||
assert.equal(lexer.lex(), "X"); | ||
@@ -529,3 +529,3 @@ assert.equal(lexer.lex(), "T"); | ||
lexer.setInput(input); | ||
assert.equal(lexer.lex(), "X"); | ||
@@ -555,3 +555,3 @@ assert.equal(lexer.lex(), "Y"); | ||
lexer.setInput(input); | ||
assert.equal(lexer.lex(), "X"); | ||
@@ -581,3 +581,3 @@ assert.equal(lexer.lex(), "Y"); | ||
lexer.setInput(input); | ||
assert.equal(lexer.lex(), "X"); | ||
@@ -605,3 +605,3 @@ assert.equal(lexer.lex(), "Y"); | ||
lexer.setInput(input); | ||
assert.equal(lexer.lex(), "X"); | ||
@@ -625,3 +625,3 @@ assert.equal(lexer.lex(), "Y"); | ||
lexer.setInput(input); | ||
assert.equal(lexer.lex(), "CHECK"); | ||
@@ -643,5 +643,37 @@ assert.equal(lexer.lex(), "PI"); | ||
lexer.setInput(input); | ||
assert.equal(lexer.lex(), "PI"); | ||
assert.equal(lexer.lex(), "Y"); | ||
}; | ||
exports["test longest match returns"] = function() { | ||
var dict = { | ||
rules: [ | ||
[".", "return 'DOT';" ], | ||
["cat", "return 'CAT';" ] | ||
], | ||
options: {flex: true} | ||
}; | ||
var input = "cat!"; | ||
var lexer = new RegExpLexer(dict); | ||
lexer.setInput(input); | ||
assert.equal(lexer.lex(), "CAT"); | ||
assert.equal(lexer.lex(), "DOT"); | ||
}; | ||
exports["test case insensitivity"] = function() { | ||
var dict = { | ||
rules: [ | ||
["cat", "return 'CAT';" ] | ||
], | ||
options: {'case-insensitive': true} | ||
}; | ||
var input = "Cat"; | ||
var lexer = new RegExpLexer(dict); | ||
lexer.setInput(input); | ||
assert.equal(lexer.lex(), "CAT"); | ||
}; |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
270639
53
6458
143
9
13