jscc-parser
Version:
A LALR(1) Parser Generator for JavaScript written in JavaScript.
86 lines • 61 kB
JavaScript
var d,h,t,aa,u,w,x,y,z,B,C,D,H,J,L,ba,M,ca,N,O,P,R,da,S,T,ea,fa,U,V,W,X=this.jscc={};X.enums={};X.classes={};X.Pa=X.enums;X.classes=X.classes;var ga={NONE:0,ya:1,Ja:2,Aa:3},ha={xa:0,EPSILON:1,ba:2},Y={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,FATAL:5};X.Pa.LOG_LEVEL=Y;var ia={Ob:0,Ia:1,bb:2},ja={NONE:0,wa:1,Ka:2,ERROR:3},ka={H:0,w:1},la=require("util"),fs=require("fs"),path=require("path");
function Z(){X.Za=function(){var a=this;this.ka=[];this.set=function(b,c){c=!!c;a.ka[b>>5]=c?a.ka[b>>5]|1<<(b&31):a.ka[b>>5]&~(1<<(b&31));return c};this.get=function(b){return 0!=(a.ka[b>>5]&1<<(b&31))};this.count=function(){var b,c,e=0;b=0;for(c=32*a.ka.length;b<c;b++)a.get(b)&&e++;return e}};return X.Za}d="function"===typeof Z?Z():Z;function ma(){return ha}h="function"===typeof ma?ha:ma;
function na(){X.classes.Y=function(a){a=a||{};if(a.I===h.ba||a.I===h.xa)this.I=a.I;"object"===typeof a.B&&a.B.hasOwnProperty("get")&&a.B.hasOwnProperty("set")&&a.B.hasOwnProperty("count")?this.B=a.B:this.B=new d;"number"===typeof a.o&&(this.o=a.o);"number"===typeof a.C&&(this.C=a.C);"number"===typeof a.accept&&(this.accept=a.accept);"number"===typeof a.weight&&(this.weight=a.weight)};X.classes.Y.prototype.I=h.EPSILON;X.classes.Y.prototype.B=new d;X.classes.Y.prototype.o=-1;X.classes.Y.prototype.C=
-1;X.classes.Y.prototype.accept=-1;X.classes.Y.prototype.weight=-1;return X.classes.Y}t="function"===typeof na?na():na;function oa(){X.za=function(){};X.za.prototype.value=[];X.za.prototype.create=function(){var a,b;for(b=0;b<this.value.length&&this.value[b].I!==h.xa;b++);b==this.value.length?(a=new t,this.value.push(a)):a=this.value[b];a.I=h.EPSILON;a.B=new d;a.accept=-1;a.o=-1;a.C=-1;a.weight=-1;return b};return X.za}aa="function"===typeof oa?oa():oa;function pa(){return ka}
u="function"===typeof pa?ka:pa;function qa(){return ga}w="function"===typeof qa?ga:qa;function ra(){return ja}x="function"===typeof ra?ja:ra;
function sa(){X.classes.Symbol=function(a){a=a||{};"number"===typeof a.id&&(this.id=a.id);a.kind===u.w&&(this.kind=a.kind);"string"===typeof a.label&&(this.label=a.label);Array.isArray(a.v)&&(this.v=a.v);Array.isArray(a.first)&&(this.first=a.first);if(a.V===w.ya||a.V===w.Ja||a.V===w.Aa)this.V=a.V;"number"===typeof a.level&&(this.level=a.level);"string"===typeof a.code&&(this.code=a.code);if(a.L===x.wa||a.L===x.ERROR||a.L===x.Ka)this.L=a.L;"boolean"===typeof a.aa&&(this.aa=a.aa);"boolean"===typeof a.W&&
(this.W=a.W)};X.classes.Symbol.prototype.id=-1;X.classes.Symbol.prototype.kind=u.H;X.classes.Symbol.prototype.label="";X.classes.Symbol.prototype.v=[];X.classes.Symbol.prototype.first=[];X.classes.Symbol.prototype.V=w.NONE;X.classes.Symbol.prototype.level=0;X.classes.Symbol.prototype.code="";X.classes.Symbol.prototype.L=x.NONE;X.classes.Symbol.prototype.aa=!1;X.classes.Symbol.prototype.W=!1;return X.classes.Symbol}y="function"===typeof sa?sa():sa;
function ta(){X.classes.ea=function(a){a=a||{};"number"===typeof a.id&&(this.id=a.id);"number"===typeof a.R&&(this.R=a.R);"undefined"!==typeof a.h&&Array.isArray(a.h)&&(this.h=a.h);"number"===typeof a.level&&(this.level=a.level);"string"===typeof a.code&&(this.code=a.code)};X.classes.ea.prototype.id=-1;X.classes.ea.prototype.R=-1;X.classes.ea.prototype.h=[];X.classes.ea.prototype.level=0;X.classes.ea.prototype.code="";return X.classes.ea}z="function"===typeof ta?ta():ta;
function ua(a){var b;try{b='/*\r\n\tThis is the general, platform-independent part of every parser driver;\r\n\tInput-/Output and Feature-Functions are done by the particular drivers\r\n\tcreated for the particular platform.\r\n*/\r\n##HEADER##\r\nvar __parse\x3d(function(/** number */ eof, /** number */ whitespace, /** number */ error_token){\r\n\t\r\n/// there was "continue" in code, we must to replace it\r\nvar Continue \x3d function(){throw Continue;};\r\n\r\n\t/**\r\n\t * @template T\r\n\t * @param {T} value\r\n\t * @constructor\r\n\t * @extends {Error}\r\n */\r\n\tvar ReturnValue \x3d function(value) {\r\n\t\tError.call(this);\r\n\t\tthis._value \x3d value;\r\n\t};\r\n\tReturnValue.prototype \x3d Object.create(Error.prototype);\r\n\tReturnValue.prototype.constructor \x3d ReturnValue;\r\n\t/**\r\n\t * @type {T}\r\n\t * @private\r\n */\r\n\tReturnValue.prototype._value \x3d null;\r\n\t/**\r\n\t * @returns {T}\r\n */\r\n\tReturnValue.prototype.valueOf \x3d function() {\r\n\t\treturn this._value;\r\n\t};\r\n\r\n\t///can return value from any place of callback\r\n\tfunction Return(value){\r\n\t\tthrow new ReturnValue(value);\r\n\t}\r\n\r\n\tvar TERMINAL_ACTIONS \x3d (function(){\r\n\t\tfunction emptyFn(PCB){return PCB.att;}\r\n\t\tvar actions \x3d ##TERMINAL_ACTIONS##\r\n\t\treturn function(/** @type {!PcbClass} */ PCB, match){\r\n\t\t\ttry{\r\n\t\t\t\treturn (actions[match] || emptyFn)(PCB);\r\n\t\t\t}catch(e){\r\n\t\t\t\tif(e instanceof ReturnValue)return e.valueOf();\r\n\t\t\t\tif(e \x3d\x3d Continue)return Continue;\r\n\t\t\t\tthrow e;\r\n\t\t\t}\r\n\t\t}\r\n\t})();\r\n\t/**\r\n\t * @constructor\r\n */\r\n\tvar DfaLex \x3d function() {\r\n\t\tthis._dfaData \x3d ##DFA##;\r\n\t};\r\n\t/**\r\n\t * @type {!Array\x3c!{line: !Array, accept: !number}\x3e}\r\n\t * @private\r\n */\r\n\tDfaLex.prototype._dfaData \x3d [];\r\n\t/**\r\n\t * @type {number}\r\n */\r\n\tDfaLex.prototype.match_pos \x3d 0;\r\n\t/**\r\n\t * @type {?number}\r\n */\r\n\tDfaLex.prototype.state \x3d 0;\r\n\t/**\r\n\t * @type {?number}\r\n */\r\n\tDfaLex.prototype.match \x3d null;\r\n\t/**\r\n\t * @param {number} chr\r\n\t * @param {number} pos\r\n */\r\n\tDfaLex.prototype.exec \x3d function(chr, pos) {\r\n\t\tif (this.state !\x3d\x3d null) {\r\n\t\t if ((typeof this.state !\x3d\x3d "number") || this.state \x3e\x3d this._dfaData.length) {\r\n\t\t this.state \x3d null;\r\n\t\t throw new Error("Invalid value for DfaLex.state at chr " + chr + " and pos " + pos);\r\n\t\t }\r\n\t\t\tvar line \x3d this._dfaData[this.state].line;\r\n\t\t\tif (typeof line \x3d\x3d\x3d "undefined" || line \x3d\x3d\x3d null) {\r\n\t\t\t var badState \x3d this.state;\r\n\t\t\t this.state \x3d null;\r\n\t\t\t throw new Error("At chr " + chr + " and pos " + pos +\r\n\t\t\t ", DfaLex._dfaData[" + badState +\r\n\t\t\t "] appears to exist, but its line property is " +\r\n\t\t\t (typeof line \x3d\x3d\x3d "undefined" ? "undefined." : "null."));\r\n\t\t\t}\r\n\t\t\tvar p, st;\r\n\t\t\tfor (p \x3d 1 \x3c\x3c 8, st \x3d line; p; p \x3e\x3e\x3d 1) {\r\n\t\t\t\tif ((chr \x26 p) !\x3d\x3d 0) {\r\n\t\t\t\t\tst \x3d st[1];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tst \x3d st[0];\r\n\t\t\t\t}\r\n\t\t\t\tif (typeof st \x3d\x3d\x3d "undefined") {\r\n\t\t\t\t st \x3d null;\r\n\t\t\t\t}\r\n\t\t\t\tif (st \x3d\x3d\x3d null)break;\r\n\t\t\t\tif (Array.isArray(st))continue;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tvar ac \x3d this._dfaData[this.state].accept;\r\n\t\t\tthis.state \x3d /** @type {?number} */ (st);\r\n\t\t\tif (ac !\x3d\x3d -1) {\r\n\t\t\t\tthis.match \x3d /** @type{number} */ (ac);\r\n\t\t\t\tthis.match_pos \x3d pos;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n##TABLES##\r\n##LABELS##\r\n\tvar ACTIONS \x3d (function(){\r\n\t\tvar PCB \x3d {};\r\n\t\tvar actions \x3d ##ACTIONS##;\r\n\t\treturn function (/** number */ act, /** Array\x3c*\x3e */ vstack, /** !PcbClass */ pcb){\r\n\t\t\ttry{\r\n\t\t\t\tPCB \x3d pcb;\r\n\t\t\t\treturn actions[act].apply(null,vstack);\r\n\t\t\t}catch(e){\r\n\t\t\t\tif(e instanceof ReturnValue)return e.valueOf();\r\n\t\t\t\tthrow e;\r\n\t\t\t}\r\n\t\t}\r\n\t})();\r\n\r\n\t/**\r\n\t * @param {number} top\r\n\t * @param {?number} la\r\n\t * @returns {?number}\r\n */\r\n\tfunction get_act(top, la){\t\r\n\t\tfor(var i \x3d 0; i \x3c act_tab[top].length; i+\x3d2)\r\n\t\t\tif(act_tab[top][i] \x3d\x3d\x3d la)\r\n\t\t\t\treturn act_tab[top][i+1];\r\n\t\treturn null;\r\n\t}\r\n\tfunction get_goto(top, pop){\t\r\n\t\tfor(var i \x3d 0; i \x3c goto_tab[top].length; i+\x3d2)\r\n\t\t\tif(goto_tab[top][i] \x3d\x3d\x3d pop)\r\n\t\t\t\treturn goto_tab[top][i+1];\r\n\t\treturn null;\r\n\t}\r\n\r\n\t/**\r\n\t * @param {!string} src\r\n\t * @constructor\r\n */\r\n\tvar PcbClass \x3d function(src) {\r\n\t\tthis.src \x3d src;\r\n\t};\r\n\t/**\r\n\t * @type {number}\r\n */\r\n\tPcbClass.prototype.line \x3d 1;\r\n\t/**\r\n\t * @type {number}\r\n */\r\n\tPcbClass.prototype.column \x3d 1;\r\n\t/**\r\n\t * @type {number}\r\n */\r\n\tPcbClass.prototype.offset \x3d 0;\r\n\t/**\r\n\t * @type {number}\r\n */\r\n\tPcbClass.prototype.error_step \x3d 0;\r\n\t/**\r\n\t * @type {string}\r\n */\r\n\tPcbClass.prototype.src \x3d "";\r\n\t/**\r\n\t * @type {string}\r\n */\r\n\tPcbClass.prototype.att \x3d "";\r\n\t/**\r\n\t * @type {?number}\r\n */\r\n\tPcbClass.prototype.la \x3d null;\r\n\t/**\r\n\t * @type {?number}\r\n */\r\n\tPcbClass.prototype.act \x3d null;\r\n\t/**\r\n\t * @returns {?number}\r\n */\r\n\tPcbClass.prototype.lex \x3d function() {\r\n var /** number */ start, /** number */ pos, /** number */ chr, actionResult;\r\n\t\tvar dfa \x3d new DfaLex();\r\n\t\tvar loop \x3d true;\r\n\t\twhile(loop){\r\n\t\t\tdfa.match_pos \x3d 0;\r\n\t\t\tpos \x3d this.offset + 1;\r\n\t\t\tdo{\r\n\t\t\t\tpos--;\r\n\t\t\t\tdfa.state \x3d 0;\r\n\t\t\t\tdfa.match \x3d null;\r\n\t\t\t\tstart \x3d pos;\r\n\t\t\t\tif(this.src.length \x3c\x3d start) {\r\n\t\t\t\t\tthis.la \x3d eof;\r\n\t\t\t\t\treturn eof;\r\n\t\t\t\t}\r\n\t\t\t\tdo{\r\n\t\t\t\t\tchr \x3d this.src.charCodeAt(pos);\r\n\t\t\t\t\tdfa.exec(chr,pos);\r\n\t\t\t\t\tif(dfa.state !\x3d\x3d null)\r\n\t\t\t\t\t\tthis.accountChar(chr);\r\n\t\t\t\t\tpos++;\r\n\t\t\t\t}while(dfa.state !\x3d\x3d null);\r\n\t\t\t}while(whitespace \x3e -1 \x26\x26 dfa.match \x3d\x3d\x3d whitespace);\r\n\t\t\tif(dfa.match !\x3d\x3d null){\r\n\t\t\t\tthis.att \x3d this.src.slice(start, dfa.match_pos);\r\n\t\t\t\tthis.offset \x3d dfa.match_pos;\r\n\t\t\t\tactionResult \x3d TERMINAL_ACTIONS(this,dfa.match);\r\n\t\t\t\tif(dfa.state !\x3d\x3d null)\r\n\t\t\t\t\tthis.accountChar(chr);\r\n\t\t\t\tif(actionResult \x3d\x3d\x3d Continue)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tthis.att \x3d actionResult;\r\n\t\t\t}else {\r\n\t\t\t\tthis.att \x3d "";\r\n\t\t\t}\r\n\t\t\tloop \x3d false;\r\n\t\t}\r\n\t\tthis.la \x3d dfa.match;\r\n\t\treturn this.la;\r\n\t};\r\n\t/**\r\n\t * @param {number} chr\r\n */\r\n PcbClass.prototype.accountChar \x3d function(chr) {\r\n\t\tif( chr \x3d\x3d\x3d 10 ){\r\n\t\t\tthis.line++;\r\n\t\t\tthis.column \x3d 0;\r\n\t\t}\r\n\t\tthis.column++;\r\n\t};\r\n\tfunction parse(/** string */ src, err_off, err_la){\r\n\t\t/**\r\n\t\t * @type {!Array\x3cnumber\x3e}\r\n */\r\n\t\tvar\t\tsstack\t\t\t\x3d [0];\r\n\t\t/**\r\n\t\t * @type {!Array\x3c*\x3e}\r\n */\r\n\t\tvar\t\tvstack\t\t\t\x3d [0];\r\n\t\t/**\r\n\t\t * @type {number}\r\n */\r\n\t\tvar \terr_cnt\t\t\t\x3d 0;\r\n\t\t/**\r\n\t\t * @type {*}\r\n\t\t */\r\n\t\tvar\t\trval;\r\n\t\t/**\r\n\t\t * @type {?number}\r\n\t\t */\r\n\t\tvar\t\tact;\r\n\t\t/**\r\n\t\t * @type {number}\r\n\t\t */\r\n\t\tvar i \x3d 0;\r\n\r\n\t\tvar PCB\t\x3d new PcbClass(src);\r\n\t\terr_off\t\x3d err_off || [];\r\n\t\terr_la \x3d err_la || [];\r\n\t\tPCB.lex();\r\n\t\twhile(true){\r\n\t\t\tPCB.act \x3d get_act(sstack[0],PCB.la);\r\n\t\t\tif(PCB.act \x3d\x3d\x3d null \x26\x26 defact_tab[sstack[0]] \x3e\x3d 0)\r\n\t\t\t\tPCB.act \x3d -defact_tab[sstack[0]];\r\n\t\t\tif(PCB.act \x3d\x3d\x3d null){//Parse error? Try to recover!\r\n\t\t\t\t//Report errors only when error_step is 0, and this is not a\r\n\t\t\t\t//subsequent error from a previous parse\r\n\t\t\t\tif(PCB.error_step \x3d\x3d\x3d 0){\r\n\t\t\t\t\terr_cnt++;\r\n\t\t\t\t\terr_off.unshift(PCB.offset - PCB.att.length);\r\n\t\t\t\t\terr_la.unshift([]);\r\n\t\t\t\t\tfor(i \x3d 0; i \x3c act_tab[sstack[0]].length; i+\x3d2)\r\n\t\t\t\t\t\terr_la[0].push(labels[act_tab[sstack[0]][i]]);\r\n\t\t\t\t}\r\n\t\t\t\t//Perform error recovery\t\t\t\r\n\t\t\t\twhile(sstack.length \x3e 1 \x26\x26 PCB.act \x3d\x3d\x3d null){\r\n\t\t\t\t\tsstack.shift();\r\n\t\t\t\t\tvstack.shift();\r\n\t\t\t\t\t//Try to shift on error token\r\n\t\t\t\t\tPCB.act \x3d get_act(sstack[0],PCB.la);\r\n\t\t\t\t\tif(PCB.act \x3d\x3d\x3d error_token){\r\n\t\t\t\t\t\tsstack.unshift(PCB.act);\r\n\t\t\t\t\t\tvstack.unshift("");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//Is it better to leave the parser now?\r\n\t\t\t\tif(sstack.length \x3e 1 \x26\x26 PCB.act !\x3d\x3d null){\r\n\t\t\t\t\t//Ok, now try to shift on the next tokens\r\n\t\t\t\t\twhile(PCB.la !\x3d\x3d eof){\r\n\t\t\t\t\t\tPCB.act \x3d act_tab[sstack[0]][i+1];\r\n\t\t\t\t\t\tif(PCB.act !\x3d null)break;\r\n\t\t\t\t\t\twhile(PCB.lex() !\x3d null)PCB.offset++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(PCB.act \x3d\x3d\x3d null || PCB.la \x3d\x3d\x3d eof){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t//Try to parse the next three tokens successfully...\r\n\t\t\t\tPCB.error_step \x3d 3;\r\n\t\t\t}\r\n\t\t\tif(PCB.act \x3e 0){//Shift\r\n\t\t\t\t//Parse tree generation\r\n\t\t\t\tsstack.unshift(PCB.act);\r\n\t\t\t\tvstack.unshift(PCB.att);\r\n\t\t\t\tPCB.lex();\r\n\t\t\t\t//Successfull shift and right beyond error recovery?\r\n\t\t\t\tif(PCB.error_step \x3e 0)\r\n\t\t\t\t\tPCB.error_step--;\r\n\t\t\t}else{\t//Reduce\t\r\n\t\t\t\tact \x3d -PCB.act;\r\n\t\t\t\t//vstack.unshift(vstack);\r\n\t\t\t\trval \x3d ACTIONS(act,vstack,PCB);\r\n\t\t\t\t//vstack.shift();\r\n\t\t\t\tsstack.splice(0,pop_tab[act][1]);\r\n\t\t\t\tvstack.splice(0,pop_tab[act][1]);\r\n\t\t\t\t\r\n\t\t\t\tPCB.act \x3d get_goto(sstack[0],pop_tab[act][0]);\r\n\t\t\t\t//Do some parse tree construction if desired\r\n\t\t\t\t//Goal symbol match?\r\n\t\t\t\tif(act \x3d\x3d\x3d 0) break; //Don\'t use PCB.act here!\r\n\t\t\t\r\n\t\t\t\t//...and push it!\r\n\t\t\t\tsstack.unshift(PCB.act);\r\n\t\t\t\tvstack.unshift(rval);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn err_cnt;\r\n\t}\r\n\treturn parse;\r\n})(##EOF##,##WHITESPACE##,##ERROR_TOKEN##);\r\n\r\n##FOOTER##\r\n'}catch(c){"undefined"!==
typeof fs&&"undefined"!==typeof path?b=fs.readFileSync(path.join(__dirname,"template","parser-driver-js.txt"),"utf8"):"function"===typeof a&&(b=a("fs").readFileSync(a("path").join(__dirname,"template","parser-driver-js.txt"),"utf8"))}X.global=function(){this.f=new aa;var a=new y;a.kind=u.H;a.L=x.NONE;a.label="";a.id=0;a.W=!0;var e=new y;e.kind=u.w;e.L=x.ERROR;e.label="ERROR_RESYNC";e.id=1;e.W=!0;this.a=[a,e];a=new z;a.R=0;a.h=[];a.code="%% \x3d %1;";this.a[0].v.push(0);this.g=[a];this.oa=-1;this.file=
"";this.Xa=this.Fa=this.Ga=this.Ha=this.ua=this.K=0;this.ra=this.sa="";this.va=b;this.ab="%% \x3d %1;";this.da=0;this.X=255};X.global.prototype.a=[];X.global.prototype.g=[];X.global.prototype.c=[];X.global.prototype.f=null;X.global.prototype.na=[];X.global.prototype.oa=-1;X.global.prototype.sa="";X.global.prototype.ra="";X.global.prototype.file="";X.global.prototype.K=0;X.global.prototype.ua=0;X.global.prototype.Ha=0;X.global.prototype.Ga=0;X.global.prototype.Fa=0;X.global.prototype.fa=1;X.global.prototype.Xa=
0;X.global.prototype.Mb=null;X.global.prototype.Va=null;X.global.prototype.Wa=null;return new X.global}var va={};B="function"===typeof ua?ua(va):ua;
function wa(){var a,b;a=fs;b=path;X.ia=function(){};X.ia.prototype.Cb=function(c){function e(){}function g(){}var f="",k=!1;c&&("string"===typeof c?f=c:"function"===typeof c?(g=c,k=!0):"object"===typeof c&&("string"===typeof c.filename&&(f=c.filename),"function"===typeof c.qa&&(g=c.qa,k=!0),"function"===typeof c.kb&&(e=c.kb,k=!0)));""===f||b.isAbsolute(f)||(f=b.join(process.cwd(),f));if(""!==f&&!k)return a.readFileSync(f,"utf-8");if(""===f&&!k){var l="",m=!1;process.stdin.setEncoding("utf-8");process.stdin.on("end",
function(){m=!0});for(process.stdin.on("data",function(a,b,c){l+=""+a;c()});!m;);return l}""!==f?a.readFile(f,"utf-8",g):(process.stdin.setEncoding("utf-8"),process.stdin.on("end",e),process.stdin.on("data",g))};X.ia.prototype.Db=function(c){function e(){}var g=null,f=!1;c&&("string"===typeof c?g=c:"function"===typeof c?(e=c.qa,f=!0):"object"===typeof c&&("string"===typeof c.filename&&(g=c.filename),"function"===typeof c.qa&&(e=c.qa,f=!0)));if(null===g)if(f)e(B.va,"utf-8",function(){});else return B.va;
else{b.isAbsolute(g)||(g=b.join(process.cwd(),g));if(!f)return a.readFileSync(g,"utf-8");a.readFile(g,"utf-8",e)}};X.ia.prototype.Ya=function(b){function e(){}var g="",f="",k=!1;b&&("string"===typeof b?g=b:"object"===typeof b&&("string"===typeof b.text&&(g=b.text),"string"===typeof b.destination&&(f=b.destination),"function"===typeof b.eb&&(e=b.eb,k=!0)));""===f||k?""!==f||k?""!==f?a.Sb(f,g,"utf-8",e):(process.stdout.on("finish",e),process.stdout.write(g,"utf-8"),process.stdout.end()):process.stdout.write(g,
"utf-8"):a.writeFileSync(f,g,"utf-8")};X.ia.prototype.Lb=function(a){la.Rb(a)};X.ia.prototype.exit=function(a){process.exit(a)};return new X.ia}C="function"===typeof wa?wa():wa;function xa(){return Y}D="function"===typeof xa?Y:xa;
function ya(){X.util=function(){};X.util.prototype={ta:function(a,b){var c,e;for(c=0;c<b.length;c++){for(e=0;e<a.length&&b[c]!=a[e];e++);e==a.length&&a.push(b[c])}return a},tb:function(a){switch((a||"").trim().toUpperCase()){case "FATAL":return D.Nb;case "ERROR":return D.ERROR;case "WARN":return D.ja;case "INFO":return D.INFO;case "DEBUG":return D.$a;case "TRACE":return D.cb;default:return D.ja}}};return new X.util}H="function"===typeof ya?ya():ya;
function za(){X.first=function(){};X.first.prototype.first=function(){var a=0,b,c;do{b=a;for(var e=a=0;e<B.a.length;e++)if(B.a[e].kind==u.H)for(var g=0;g<B.a[e].v.length;g++){c=!1;for(var f=0;f<B.g[B.a[e].v[g]].h.length&&(B.a[e].first=H.ta(B.a[e].first,B.a[B.g[B.a[e].v[g]].h[f]].first),c=B.a[B.g[B.a[e].v[g]].h[f]].aa,c);f++);a+=B.a[e].first.length;f==B.g[B.a[e].v[g]].h.length&&(c=!0);c&&(B.a[e].aa=!0)}}while(a!=b)};X.first.prototype.Fb=function(a,b,c){for(;c<b.h.length;c++)if(a.l=H.ta(a.l,B.a[b.h[c]].first),
!B.a[b.h[c]].aa)return!1;return!0};return new X.first}J="function"===typeof za?za():za;
function Aa(){X.S=function(){this.Z=D.ja};X.S.prototype.Z=D.ja;X.S.prototype.fatal=function(a){console.error(a);B.K++};X.S.prototype.error=function(a){this.Z<=D.ERROR&&console.error(a);B.K++};X.S.prototype.warn=function(a){this.Z<=D.ja&&console.warn(a);B.ua++};X.S.prototype.info=function(a){this.Z<=D.INFO&&console.info(a)};X.S.prototype.debug=function(a){this.Z<=D.$a&&console.log(a)};X.S.prototype.trace=function(a){this.Z<=D.cb&&console.trace(a)};X.S.prototype.setLevel=function(a){this.Z=a};return new X.S}
L="function"===typeof Aa?Aa():Aa;
function Ba(){X.classes.U=function(a){a=a||{};Array.isArray(a.u)&&(this.u=a.u);Array.isArray(a.M)&&(this.M=a.M);"number"===typeof a.J&&(this.J=a.J);"boolean"===typeof a.done&&(this.done=a.done);"boolean"===typeof a.closed&&(this.closed=a.closed);Array.isArray(a.s)&&(this.s=a.s);Array.isArray(a.N)&&(this.N=a.N)};X.classes.U.prototype.u=[];X.classes.U.prototype.M=[];X.classes.U.prototype.J=0;X.classes.U.prototype.done=!1;X.classes.U.prototype.closed=!1;X.classes.U.prototype.s=[];X.classes.U.prototype.N=
[];return X.classes.U}ba="function"===typeof Ba?Ba():Ba;function Ca(){X.classes.pa=function(a){a=a||{};"number"===typeof a.i&&(this.i=a.i);"number"===typeof a.m&&(this.m=a.m);"undefined"!==typeof a.l&&Array.isArray(a.l)&&(this.l=a.l)};X.classes.pa.prototype.i=-1;X.classes.pa.prototype.m=0;X.classes.pa.prototype.l=[];return X.classes.pa}M="function"===typeof Ca?Ca():Ca;
function Da(){X.classes.Ca=function(a,b){this.symbol=a;this.action=b};X.classes.Ca.prototype.symbol=-1;X.classes.Ca.prototype.action=-1;return X.classes.Ca}ca="function"===typeof Da?Da():Da;function Ea(){return ia}N="function"===typeof Ea?ia:Ea;function Fa(){X.debug=function(){};X.debug.prototype={};return new X.debug}"function"===typeof Fa&&Fa();
function Ga(){X.D=function(){};X.D.prototype.Oa=function(){var a=new ba({u:[],M:[],s:[],N:[],done:!1,closed:!1,J:0});B.c.push(a);return a};X.D.prototype.Na=function(a){return new M({i:a,m:0,l:[]})};X.D.prototype.Da=function(a,b,c){for(var e=0;e<a.length;e++)if(a[e].symbol==b)return a;a.push(new ca(b,c));return a};X.D.prototype.Kb=function(a,b,c){var e;for(e=0;e<a.length;e++)if(a[e].symbol==b){a[e].action=c;break}};X.D.prototype.Eb=function(a,b){for(var c=0;c<a.length;c++)if(a[c].symbol==b){a.splice(c,
1);break}};X.D.prototype.Ea=function(a,b){for(var c=0;c<a.length;c++)if(a[c].symbol==b)return a[c].action};X.D.prototype.ob=function(){for(var a=0;a<B.c.length;a++)if(0==B.c[a].done)return a;return-1};X.D.prototype.Hb=function(a,b){return a.i-b.i};X.D.prototype.ha=function(a,b,c){c||(c=x.NONE);for(var e=0;e<B.a.length;e++)if(B.a[e].label.toString()==a.toString()&&B.a[e].kind==b&&B.a[e].L==c)return e;return-1};X.D.prototype.ga=function(a,b,c){var e;if(-1<(e=this.ha(a,b,c)))return B.a[e].id;a=new y({label:a,
kind:b,v:[],aa:!1,id:B.a.length,code:"",V:w.NONE,level:0,L:c,W:!1,first:[]});b==u.w&&a.first.push(a.id);B.a.push(a);return a.id};X.D.prototype.qb=function(a,b){var c,e,g=0;if(a.length!=b.length)return!1;for(c=0;c<a.length;c++)for(e=0;e<b.length;e++)if(a[c].i==b[e].i&&a[c].m==b[e].m){g++;break}return g==a.length};X.D.prototype.gb=function(a,b){var c,e,g,f=0,k;for(c=0;c<a.length;c++)if(a[c].m<B.g[a[c].i].h.length&&B.a[B.g[a[c].i].h[a[c].m]].kind==u.H)for(e=0;e<B.a[B.g[a[c].i].h[a[c].m]].v.length;e++){for(g=
0;g<b.length&&b[g].i!=B.a[B.g[a[c].i].h[a[c].m]].v[e];g++);g==b.length&&(k=this.Na(B.a[B.g[a[c].i].h[a[c].m]].v[e]),b.push(k),f++);k=b[g].l.length;J.Fb(b[g],B.g[a[c].i],a[c].m+1)&&(b[g].l=H.ta(b[g].l,a[c].l));f+=b[g].l.length-k}return f};X.D.prototype.rb=function(a){var b=[],c,e,g,f,k;g=0;do c=g,g=this.gb(0==c?B.c[a].u:b,b);while(g!=c);for(f=0;f<B.c[a].u.length;f++)if(B.c[a].u[f].m<B.g[B.c[a].u[f].i].h.length)for(b.unshift(new M({i:B.c[a].u[f].i,m:B.c[a].u[f].m,l:[]})),k=0;k<B.c[a].u[f].l.length;k++)b[0].l[k]=
B.c[a].u[f].l[k];for(f=0;f<b.length;f++)if(0==B.g[b[f].i].h.length){for(k=0;k<B.c[a].M.length&&(B.c[a].M[k].i!=b[f].i||B.c[a].M[k].m!=b[f].m);k++);k==B.c[a].M.length&&B.c[a].M.push(b[f]);b.splice(f,1)}for(;0<b.length;){e=[];c=[];g=-1;for(f=0;f<b.length;f++)0==e.length&&(g=B.g[b[f].i].h[b[f].m]),b[f].m<B.g[b[f].i].h.length&&(B.g[b[f].i].h[b[f].m]==g?(b[f].m++,e.push(b[f])):c.push(b[f]));if(0<e.length){e.sort(this.Hb);for(f=0;f<B.c.length&&!this.qb(B.c[f].u,e);f++);f==B.c.length&&(b=this.Oa(),b.u=e);
for(k=g=b=0;k<e.length;k++)b+=B.c[f].u[k].l.length,B.c[f].u[k].l=H.ta(B.c[f].u[k].l,e[k].l),g+=B.c[f].u[k].l.length;b!=g&&(B.c[f].done=!1);if(!B.c[a].closed)for(k=0;k<e.length;k++)e[k].m-1<B.g[e[k].i].h.length&&(B.a[B.g[e[k].i].h[e[k].m-1]].kind==u.w?(B.c[a].s=this.Da(B.c[a].s,B.g[e[k].i].h[e[k].m-1],f),B.Ha++):(B.c[a].N=this.Da(B.c[a].N,B.g[e[k].i].h[e[k].m-1],f),B.Fa++))}b=c}B.c[a].closed=!0};X.D.prototype.ib=function(a){var b,c,e,g,f,k,l,m=[],n=0;for(b=0;2>b;b++)for(l=b?B.c[a].M:B.c[a].u,c=0;c<
l.length;c++)if(l[c].m==B.g[l[c].i].h.length)for(e=0;e<l[c].l.length;e++)if(k=!0,g=this.Ea(B.c[a].s,l[c].l[e]),void 0==g)f=-1*l[c].i,B.c[a].s=this.Da(B.c[a].s,l[c].l[e],f),B.Ga++;else{f=g;var r;if(0<g){if(0<B.a[l[c].l[e]].level||0<B.g[l[c].i].level)B.a[l[c].l[e]].level==B.g[l[c].i].level?B.a[l[c].l[e]].V==w.ya?f=-1*l[c].i:B.a[l[c].l[e]].V==w.Aa&&(this.Eb(B.c[a].s,l[c].l[e]),L.warn("Removing nonassociative symbol '"+B.a[l[c].l[e]].label+"' in state "+a),k=!1):B.a[l[c].l[e]].level<B.g[l[c].i].level&&
(f=-1*l[c].i);r="Shift"}else f=-1*f<l[c].i?f:-1*l[c].i,r="Reduce";r+="-reduce conflict on symbol '"+B.a[l[c].l[e]].label+"' in state "+a;r+="\n Conflict resolved by "+(0>=f?"reducing with production":"shifting to state")+" "+(0>=f?-1*f:f);k&&L.warn(r);f!=g&&this.Kb(B.c[a].s,l[c].l[e],f)}B.c[a].J=-1;for(c=0;c<m.length;c++){for(b=e=0;e<m.length;e++)m[e]==m[c]&&b++;n<b&&(n=b,B.c[a].J=m[c])}if(0<=B.c[a].J){do for(b=B.c[a].s.length,c=0;c<B.c[a].s.length;c++)B.c[a].s[c][1]==-1*B.c[a].J&&B.c[a].s.splice(c,
1);while(b!=B.c[a].s.length)}};X.D.prototype.sb=function(){var a,b;a=this.Na(0);b=this.ga("$",u.w,x.wa);a.l.push(b);b=this.Oa();for(b.u.push(a);0<=(a=this.ob());)B.c[a].done=!0,this.rb(a);for(a=0;a<B.c.length;a++)this.ib(a)};return new X.D}O="function"===typeof Ga?Ga():Ga;
function Ha(){X.Ua=function(){};X.Ua.prototype={zb:function(a){var b="",c,e=0,g;switch(a){case N.bb:case "html":b+='\x3ctable class\x3d"print" cellpadding\x3d"0" cellspacing\x3d"0"\x3e\x3ctr\x3e\x3ctd class\x3d"tabtitle" colspan\x3d"2"\x3ePop-Table\x3c/td\x3e\x3c/tr\x3e\x3ctd class\x3d"coltitle" width\x3d"1%" style\x3d"border-right: 1px solid lightgray;"\x3eLeft-hand side\x3c/td\x3e\x3ctd class\x3d"coltitle"\x3eNumber of symbols to pop\x3c/td\x3e\x3c/tr\x3e';for(a=0;a<B.g.length;a++)b+="\x3ctr\x3e",
b+='\x3ctd style\x3d"border-right: 1px solid lightgray;"\x3e'+B.g[a].R+"\x3c/td\x3e",b+="\x3ctd\x3e"+B.g[a].h.length+"\x3c/td\x3e",b+="\x3c/tr\x3e";for(a=0;a<B.a.length;a++)B.a[a].kind==u.w&&e++;b=b+'\x3c/table\x3e\x3ctable class\x3d"print" cellpadding\x3d"0" cellspacing\x3d"0"\x3e\x3ctr\x3e'+('\x3ctd class\x3d"tabtitle" colspan\x3d"'+(e+1)+'"\x3eAction-Table\x3c/td\x3e')+'\x3c/tr\x3e\x3ctd class\x3d"coltitle" width\x3d"1%" style\x3d"border-right: 1px solid lightgray;"\x3eState\x3c/td\x3e';for(a=
0;a<B.a.length;a++)B.a[a].kind==u.w&&(b+="\x3ctd\x3e\x3cb\x3e"+B.a[a].label+"\x3c/b\x3e\x3c/td\x3e");b+="\x3c/tr\x3e";for(a=0;a<B.c.length;a++){b+="\x3ctr\x3e";b+='\x3ctd class\x3d"coltitle" style\x3d"border-right: 1px solid lightgray;"\x3e'+a+"\x3c/td\x3e";for(c=0;c<B.a.length;c++)B.a[c].kind==u.w&&(b+="\x3ctd\x3e",void 0!=(g=O.Ea(B.c[a].s,c))&&(b=0>=g?b+("r"+-1*g):b+("s"+g)),b+="\x3c/td\x3e");b+="\x3c/tr\x3e"}b+="\x3c/table\x3e";for(a=0;a<B.a.length;a++)B.a[a].kind==u.H&&e++;b+='\x3ctable class\x3d"print" cellpadding\x3d"0" cellspacing\x3d"0"\x3e';
b+="\x3ctr\x3e";b=b+('\x3ctd class\x3d"tabtitle" colspan\x3d"'+(e+1)+'"\x3eGoto-Table\x3c/td\x3e')+'\x3c/tr\x3e\x3ctd class\x3d"coltitle" width\x3d"1%" style\x3d"border-right: 1px solid lightgray;"\x3eState\x3c/td\x3e';for(a=0;a<B.a.length;a++)B.a[a].kind==u.H&&(b+="\x3ctd\x3e"+B.a[a].label+"\x3c/td\x3e");b+="\x3c/tr\x3e";for(a=0;a<B.c.length;a++){b+="\x3ctr\x3e";b+='\x3ctd class\x3d"coltitle" style\x3d"border-right: 1px solid lightgray;"\x3e'+a+"\x3c/td\x3e";for(c=0;c<B.a.length;c++)B.a[c].kind==
u.H&&(b+="\x3ctd\x3e",void 0!=(g=O.Ea(B.c[a].N,c))&&(b+=g),b+="\x3c/td\x3e");b+="\x3c/tr\x3e"}b+="\x3c/table\x3e";b+='\x3ctable class\x3d"print" cellpadding\x3d"0" cellspacing\x3d"0"\x3e';b+="\x3ctr\x3e";b+='\x3ctd class\x3d"tabtitle" colspan\x3d"2"\x3eDefault Actions Table\x3c/td\x3e';b+="\x3c/tr\x3e";b+='\x3ctd class\x3d"coltitle" width\x3d"1%" style\x3d"border-right: 1px solid lightgray;"\x3eLeft-hand side\x3c/td\x3e';b+='\x3ctd class\x3d"coltitle"\x3eNumber of symbols to pop\x3c/td\x3e';b+="\x3c/tr\x3e";
for(a=0;a<B.c.length;a++)b+="\x3ctr\x3e",b+='\x3ctd style\x3d"border-right: 1px solid lightgray;"\x3eState '+a+"\x3c/td\x3e",b+="\x3ctd\x3e"+(0>B.c[a].J?"(none)":B.c[a].J)+"\x3c/td\x3e",b+="\x3c/tr\x3e";b+="\x3c/table\x3e";break;case N.Ia:case "js":c=[];for(a=0;a<B.g.length;a++)c.push([B.g[a].R,B.g[a].h.length]);b+="\nvar pop_tab \x3d "+JSON.stringify(c)+";\n";e=[];for(a=0;a<B.c.length;a++){g=[];for(c=0;c<B.c[a].s.length;c++)g.push(B.c[a].s[c].symbol,B.c[a].s[c].action);e.push(g)}b+="\n/** @type {!Array\x3c!Array\x3cnumber\x3e\x3e} */\nvar act_tab \x3d"+
JSON.stringify(e)+";\n";e=[];for(a=0;a<B.c.length;a++){g=[];for(c=0;c<B.c[a].N.length;c++)g.push(B.c[a].N[c].symbol,B.c[a].N[c].action);e.push(g)}b+="\nvar goto_tab \x3d"+JSON.stringify(e)+";\n";c=[];for(a=0;a<B.c.length;a++)c.push(B.c[a].J);b+="\nvar defect_tab \x3d"+JSON.stringify(c)+";\n"}return b},vb:function(a){function b(a){for(var b=[];a.length;){var c=a.shift(),e=a.shift();c==e?b.push(c):b.push([c,e])}return b}for(var c=[],e=0;e<a.length;e++)(function(e){for(var f=[],k=0;k<a[e].b.length;k++)-1!=
a[e].b[k]&&(f[k]=a[e].b[k]);f=b(b(b(b(b(b(b(b(f))))))));c.push({b:f,accept:a[e].accept})})(e);return c},yb:function(a){for(var b=[],c=0;c<a.length;c++){for(var e=c,g={},f=0;f<a[e].b.length;f++)-1!=a[e].b[f]&&(g[f]=a[e].b[f]);b.push({b:g,accept:a[e].accept})}return JSON.stringify(this.vb(a)).replace(/"([A-Za-z_][A-Za-z0-9_]*)"\s*:/g,"$1:").replace(/,/g,",\n\t")},Ab:function(){for(var a=0,b=[];a<B.a.length;a++)b.push(B.a[a].label);return"var labels \x3d "+JSON.stringify(B.a)+";\n\n"},Bb:function(){var a=
"({\n",b=/%match|%offset|%source/,c,e,g,f,k;for(c=0;c<B.a.length;c++)if(B.a[c].kind==u.w&&""!=B.a[c].code){a+=' "'+c+'":';a+=" /** @suppress {uselessCode} */ function(PCB){";f="";for(g=e=0;e<B.a[c].code.length;e++,g++)(k=b.exec(B.a[c].code.substr(e,B.a[c].code.length)))&&0==k.index?("%match"==k[0]?f+="PCB.att":"%offset"==k[0]?f+="( PCB.offset - PCB.att.length )":"%source"==k[0]&&(f+="PCB.src"),e+=k[0].length-1,g=f.length):f+=B.a[c].code.charAt(e);a+=" "+f+"\n";a+=" return PCB.att;},\n"}return a+
"\n})"},wb:function(){var a,b=/%[0-9]+|%%/,c,e,g,f,k,l;a="[";for(g=0;g<B.g.length;g++){l=B.g[g].code;c="function(){\n";c+="var rval;";for(k=f=0;f<l.length;f++,k++)(e=b.exec(l.substr(f,l.length)))&&0==e.index?("%%"==e[0]?c+="rval":(k=parseInt(e[0].substr(1,e[0].length),10),k=B.g[g].h.length-k,0>k?(k=B.a[B.g[g].R],0==B.g[g].h.length?L.error("Default code was used for an empty right-hand side of a production, or a wildcard "+e[0]+" was used explicitly. The faulty left-hand side symbol label is '"+k.label+
"'."):L.error("The wildcard "+e[0]+" was used, but there are only "+B.g[g].h.length+" symbols on the right-hand side of the production. The faulty left-hand side symbol label is '"+k.label+"'."),c+=' "" '):c+=" arguments["+k+"] "),f+=e[0].length-1,k=c.length):c+=l.charAt(f);a+=" "+c+"\nreturn rval;},\n"}return a+"]"},lb:function(){for(var a=-1,b=0;b<B.a.length;b++)if(B.a[b].L==x.wa){a=b;break}-1==a&&L.error("No EOF-symbol defined - This might not be possible (bug!)");return a},mb:function(){for(var a=
-1,b=0;b<B.a.length;b++)if(B.a[b].L==x.ERROR){a=b;break}-1==a&&L.error("No ERROR-symbol defined - This might not be possible (bug!)");return a},pb:function(){return B.oa}};return new X.Ua}P="function"===typeof Ha?Ha():Ha;
function Ia(){X.Ra=function(){};X.Ra.prototype={Ib:function(){for(var a=0;a<B.a.length;a++)B.a[a].kind==u.H&&0==B.a[a].W&&L.error('Call to undefined non-terminal "'+B.a[a].label+'"')},Jb:function(){var a=[],b=[],c,e,g,f;for(c=0;c<B.a.length&&B.a[c].kind!=u.H;c++);if(c!=B.a.length){a.push(c);for(b.push(c);0<a.length;)for(c=a.pop(),e=0;e<B.a[c].v.length;e++)for(g=0;g<B.g[B.a[c].v[e]].h.length;g++)if(B.a[B.g[B.a[c].v[e]].h[g]].kind==u.H){for(f=0;f<b.length&&b[f]!=B.g[B.a[c].v[e]].h[g];f++);f==b.length&&
(a.push(B.g[B.a[c].v[e]].h[g]),b.push(B.g[B.a[c].v[e]].h[g]))}for(c=0;c<B.a.length;c++)if(B.a[c].kind==u.H){for(e=0;e<b.length&&b[e]!=c;e++);e==b.length&&L.warn('Unreachable non-terminal "'+B.a[c].label+'"')}}},fb:function(){for(var a=0;a<B.c.length;a++)0==B.c[a].s.length&&-1==B.c[a].J&&L.error("No lookaheads in state "+a+", watch for endless list definitions")}};return new X.Ra}R="function"===typeof Ia?Ia():Ia;
function Ja(){X.Sa=function(){};X.Sa.prototype={xb:function(a){for(var b,c,e=0;e<a.length;e++){b=e+" \x3d\x3e (";for(var g=c=0;g<a[e].b.length;g++)-1<a[e].b[g]&&(b+=" \x3e"+String.fromCharCode(g)+"\x3c,"+a[e].b[g]+" ",c++,0==c%5&&(b+="\n "));b+=") "+a[e].accept;C.Lb(b)}}};return new X.Sa}da="function"===typeof Ja?Ja():Ja;
function Ka(){X.classes.Ba=function(a,b){"number"===typeof a&&(this.start=a);"number"===typeof b&&(this.end=b)};X.classes.Ba.prototype.start=-1;X.classes.Ba.prototype.end=-1;return X.classes.Ba}S="function"===typeof Ka?Ka():Ka;
function La(){var a,b,c=function(c,g,f){function k(a){this.src=a}function l(){this.O=[{b:[[[[1,[[1,[[[2,3],[4,5]],[1,[6,1]]]],[1,[1,[1,[1,7]]]]]],[[1,[1,[[1,[1,8]],[[13,9],1]]]],[1,[1,[1,[[10,1],1]]]]]],[1,[1,[1,[1,[1,[1,[1,null]]]]]]]]],accept:-1},{b:[],accept:13},{b:[],accept:6},{b:[],accept:7},{b:[],accept:3},{b:[],accept:4},{b:[],accept:10},{b:[],accept:5},{b:[],accept:8},{b:[],accept:9},{b:[],accept:2},{b:[],accept:12},{b:[[[[null,[null,[12,[[12,null],null]]]],null],null]],accept:11},{b:[[[[11,
[11,[12,[[12,11],11]]]],11],[11,[11,[11,[11,[11,[11,[11,null]]]]]]]]],accept:13}]}function m(a){this.la=a}function n(){throw n;}function r(a,b){for(var c=0;c<A[a].length;c+=2)if(A[a][c]===b)return A[a][c+1];return null}m.prototype=Object.create(Error.prototype);m.prototype.constructor=m;m.prototype.la=null;m.prototype.valueOf=function(){return this.la};var v=function(){function a(b){return b.F}var b={};return function(c,e){try{return(b[e]||a)(c)}catch(f){if(f instanceof m)return f.valueOf();if(f==
n)return n;throw f;}}}();l.prototype.O=[];l.prototype.T=0;l.prototype.state=0;l.prototype.match=null;l.prototype.exec=function(a,b){if(null!==this.state){if("number"!==typeof this.state||this.state>=this.O.length)throw this.state=null,Error("Invalid value for DfaLex.state at chr "+a+" and pos "+b);var c=this.O[this.state].b;if("undefined"===typeof c||null===c){var e=this.state;this.state=null;throw Error("At chr "+a+" and pos "+b+", DfaLex._dfaData["+e+"] appears to exist, but its line property is "+
("undefined"===typeof c?"undefined.":"null."));}for(e=256;e;e>>=1){c=0!==(a&e)?c[1]:c[0];"undefined"===typeof c&&(c=null);if(null===c)break;if(!Array.isArray(c))break}a=this.O[this.state].accept;this.state=c;-1!==a&&(this.match=a,this.T=b)}};var G=[[0,1],[15,1],[14,3],[14,1],[16,2],[16,1],[17,2],[17,2],[17,2],[17,1],[18,1],[18,1],[18,3],[20,3],[20,1],[21,2],[21,0],[19,1],[19,1],[19,1]],A=[[6,8,11,9,12,10,13,11,8,12,10,13],[],[2,14],[6,8,11,9,12,10,13,11,8,12,10,13],[],[5,16,4,17,3,18],[],[],[6,8,
11,9,12,10,13,11,8,12,10,13],[],[],[],[],[],[6,8,11,9,12,10,13,11,8,12,10,13],[],[],[],[],[7,22,2,14],[9,24,11,9,12,10,13,11],[6,8,11,9,12,10,13,11,8,12,10,13],[],[],[]],I=[[15,1,14,2,16,3,17,4,18,5,19,6,20,7],[],[],[17,15,18,5,19,6,20,7],[],[],[],[],[14,19,16,3,17,4,18,5,19,6,20,7],[],[],[],[21,20],[],[16,21,17,4,18,5,19,6,20,7],[],[],[],[],[],[19,23],[17,15,18,5,19,6,20,7],[],[],[]],F=[-1,0,1,3,5,9,10,11,-1,17,18,19,16,14,-1,4,8,7,6,-1,-1,2,12,15,13],K=[{label:"RegEx'",kind:{},prods:[0],nullable:0,
id:0,code:"",level:0,special:{},defined:!0,first:[6,11,12,13,8,10]},{label:"ERROR_RESYNC",kind:{},prods:[],nullable:!1,id:1,code:"",level:0,special:{},defined:!0,first:[1]},{label:"|",kind:{},prods:[],nullable:!1,id:2,code:"",level:0,special:{},defined:!1,first:[2]},{label:"*",kind:{},prods:[],nullable:!1,id:3,code:"",level:0,special:{},defined:!1,first:[3]},{label:"+",kind:{},prods:[],nullable:!1,id:4,code:"",level:0,special:{},defined:!1,first:[4]},{label:"?",kind:{},prods:[],nullable:!1,id:5,code:"",
level:0,special:{},defined:!1,first:[5]},{label:"(",kind:{},prods:[],nullable:!1,id:6,code:"",level:0,special:{},defined:!1,first:[6]},{label:")",kind:{},prods:[],nullable:!1,id:7,code:"",level:0,special:{},defined:!1,first:[7]},{label:"[",kind:{},prods:[],nullable:!1,id:8,code:"",level:0,special:{},defined:!1,first:[8]},{label:"]",kind:{},prods:[],nullable:!1,id:9,code:"",level:0,special:{},defined:!1,first:[9]},{label:"ANY_CHAR",kind:{},prods:[],nullable:!1,id:10,code:"",level:0,special:{},defined:!1,
first:[10]},{label:"ASCII_CODE",kind:{},prods:[],nullable:!1,id:11,code:"",level:0,special:{},defined:!1,first:[11]},{label:"ESCAPED_CHAR",kind:{},prods:[],nullable:!1,id:12,code:"",level:0,special:{},defined:!1,first:[12]},{label:"ANY",kind:{},prods:[],nullable:!1,id:13,code:"",level:0,special:{},defined:!1,first:[13]},{label:"Expression",kind:{},prods:[2,3],nullable:0,id:14,code:"",level:0,special:{},defined:!0,first:[6,11,12,13,8,10]},{label:"RegEx",kind:{},prods:[1],nullable:0,id:15,code:"",level:0,
special:{},defined:!0,first:[6,11,12,13,8,10]},{label:"Catenation",kind:{},prods:[4,5],nullable:0,id:16,code:"",level:0,special:{},defined:!0,first:[6,11,12,13,8,10]},{label:"Factor",kind:{},prods:[6,7,8,9],nullable:0,id:17,code:"",level:0,special:{},defined:!0,first:[6,11,12,13,8,10]},{label:"Term",kind:{},prods:[10,11,12],nullable:0,id:18,code:"",level:0,special:{},defined:!0,first:[6,11,12,13,8,10]},{label:"Character",kind:{},prods:[17,18,19],nullable:0,id:19,code:"",level:0,special:{},defined:!0,
first:[11,12,13]},{label:"CharacterSet",kind:{},prods:[13,14],nullable:0,id:20,code:"",level:0,special:{},defined:!0,first:[8,10]},{label:"CharClass",kind:{},prods:[15,16],nullable:1,id:21,code:"",level:0,special:{},defined:!0,first:[11,12,13]},{label:"$",kind:{},prods:[],nullable:!1,id:22,code:"",level:0,special:{},defined:!1,first:[22]}],Q=function(){var c=[function(a){return a},function(c){var e;e=new S;B.f.value[a].o=c.start;b=c.end;return e},function(a,b,c){b=new S(B.f.create(),B.f.create());
B.f.value[b.start].o=c.start;B.f.value[b.start].C=a.start;B.f.value[c.end].o=b.end;B.f.value[a.end].o=b.end;return b},function(a){return a},function(a,b){var c=B.f.value[b.end].weight;B.f.value[b.end]=new t(B.f.value[a.start]);B.f.value[b.end].weight=c;B.f.value[a.start].I=h.xa;b.end=a.end;return b},function(a){return a},function(a,b){a=new S(B.f.create(),B.f.create());B.f.value[a.start].o=b.start;B.f.value[b.end].o=a.end;B.f.value[a.start].C=a.end;B.f.value[b.end].C=b.start;return a},function(a,
b){a=new S(B.f.create(),B.f.create());B.f.value[a.start].o=b.start;B.f.value[b.end].o=a.end;B.f.value[b.end].C=b.start;return a},function(a,b){a=new S(B.f.create(),B.f.create());B.f.value[a.start].o=b.start;B.f.value[a.start].C=a.end;B.f.value[b.end].o=a.end;return a},function(a){return a},function(a){var b;b=new S;b.start=B.f.create();b.end=B.f.value[b.start].o=B.f.create();B.f.value[b.start].I=h.ba;B.f.value[b.start].B.set(a.charCodeAt(0),!0);return b},function(a){return a},function(a,b){return b},
function(a,b){var c=!1,e=0,f;a=new S;a.start=B.f.create();a.end=B.f.value[a.start].o=B.f.create();B.f.value[a.start].I=h.ba;if("^"==b.charAt(e)){c=!0;for(f=B.da;f<B.X;f++)B.f.value[a.start].B.set(f,!0);e++}for(;e<b.length;e++)if("-"==b.charAt(e+1)&&e+2<b.length)for(e++,f=b.charCodeAt(e-1);f<b.charCodeAt(e+1);f++)B.f.value[a.start].B.set(f,!c);else B.f.value[a.start].B.set(b.charCodeAt(e),!c);return a},function(){var a;a=new S;a.start=B.f.create();a.end=B.f.value[a.start].o=B.f.create();B.f.value[a.start].I=
h.ba;for(var b=B.da;b<B.X;b++)B.f.value[a.start].B.set(b,!0);return a},function(a,b){return b+a},function(){return""},function(a){return String.fromCharCode(a.substr(1))},function(a){return{n:"\n",r:"\r",t:"\t",Pb:"a"}[a.substr(1)]||a.substr(1)},function(a){return a}];return function(a,b){try{return c[a].apply(null,b)}catch(e){if(e instanceof m)return e.valueOf();throw e;}}}();k.prototype.b=1;k.prototype.offset=0;k.prototype.P=0;k.prototype.src="";k.prototype.F="";k.prototype.G=null;k.prototype.j=
null;k.prototype.$=function(){for(var a,b,f,k=new l,E=!0;E;){k.T=0;b=this.offset+1;do{b--;k.state=0;k.match=null;a=b;if(this.src.length<=a)return this.G=c;do f=this.src.charCodeAt(b),k.exec(f,b),null!==k.state&&this.ma(f),b++;while(null!==k.state)}while(-1<g&&k.match===g);if(null!==k.match){this.F=this.src.slice(a,k.T);this.offset=k.T;a=v(this,k.match);null!==k.state&&this.ma(f);if(a===n)continue;this.F=a}else this.F="";E=!1}return this.G=k.match};k.prototype.ma=function(a){10===a&&this.b++};return function(a,
b,g){var l=[0],E=[0],Oa=0,m,n=0,p=new k(a);b=b||[];g=g||[];for(p.$();;){p.j=r(l[0],p.G);null===p.j&&0<=F[l[0]]&&(p.j=-F[l[0]]);if(null===p.j){if(0===p.P)for(Oa++,b.unshift(p.offset-p.F.length),g.unshift([]),n=0;n<A[l[0]].length;n+=2)g[0].push(K[A[l[0]][n]]);for(;1<l.length&&null===p.j;)l.shift(),E.shift(),p.j=r(l[0],p.G),p.j===f&&(l.unshift(p.j),E.unshift(""));if(1<l.length&&null!==p.j)for(;p.G!==c;){p.j=A[l[0]][n+1];if(null!=p.j)break;for(;null!=p.$();)p.offset++}if(null===p.j||p.G===c)break;p.P=
3}if(0<p.j)l.unshift(p.j),E.unshift(p.F),p.$(),0<p.P&&p.P--;else{m=-p.j;a=Q(m,E,p);l.splice(0,G[m][1]);E.splice(0,G[m][1]);var v;a:{v=l[0];for(var q=0;q<I[v].length;q+=2)if(I[v][q]===G[m][0]){v=I[v][q+1];break a}v=null}p.j=v;if(0===m)break;l.unshift(p.j);E.unshift(a)}}return Oa}}(22,-1,1);return function(e,g,f,k){var l,m=[],n=[],r;if(""!=e)if(k=k||0,a=B.f.create(),0==(r=c(e,m,n))){if(f)for(f=0;f<B.f.value.length;f++)if(B.f.value[f].I==h.ba)for(l=B.da;l<B.X;l++)B.f.value[f].B.get(l)&&(B.f.value[f].B.set(String.fromCharCode(l).toUpperCase().charCodeAt(0),
!0),B.f.value[f].B.set(String.fromCharCode(l).toLowerCase().charCodeAt(0),!0));B.f.value[b].accept=g;B.f.value[b].weight=B.Xa++;if(0<a){for(f=0;-1!=B.f.value[f].C;)f=B.f.value[f].C;B.f.value[f].C=a}}else for(f=0;f<r;f++){g="";for(l=0;l<m[f];l++)g+=" ";L.error("Regular expression:\n\t"+e+"\n\t"+g+"^ expecting "+n[f].join()+" on line "+k)}}}T="function"===typeof La?La():La;
function Ma(){function a(a,c){b.error("line "+a+": "+c)}var b;b=L;var c,e,g=function(b,g,l){function m(a){this.src=a}function n(){this.O=[{b:[[[[[[null,[[[null,1],[2,null]],[[null,1],null]]],null],[[[[[1,3],[19,22]],[null,[4,23]]],[null,[[null,5],[null,24]]]],[5,[[5,[6,7]],[[8,25],[9,null]]]]]],[[[[[[null,5],5],5],5],[5,[[5,[5,26]],[null,[10,5]]]]],[[[[[null,5],5],5],5],[5,[[5,[5,null]],[[11,null],[12,null]]]]]]],null]],accept:-1},{b:[[[[[[null,[[[null,1],null],[[null,1],null]]],null],[[[[[1,null],
null],null],null],null]],null],null]],accept:19},{b:[],accept:17},{b:[],accept:6},{b:[],accept:10},{b:[[[[null,[[null,[null,[[null,5],null]]],[5,[[5,null],null]]]],[[[[[[null,5],5],5],5],[5,[[5,[5,null]],[null,[null,5]]]]],[[[[[null,5],5],5],5],[5,[[5,[5,null]],null]]]]],null]],accept:16},{b:[],accept:8},{b:[],accept:7},{b:[],accept:3},{b:[],accept:4},{b:[],accept:5},{b:[],accept:9},{b:[],accept:11},{b:[],accept:15},{b:[],accept:2},{b:[],accept:14},{b:[],accept:12},{b:[],accept:18},{b:[],accept:13},
{b:[[[[19,[[[[19,[13,19]],19],19],19]],[[19,[19,[19,[[27,19],19]]]],19]],[19,[19,[19,[19,[19,[19,[19,null]]]]]]]]],accept:-1},{b:[[[[19,[[[[19,[13,19]],19],19],19]],[[19,[19,[19,[[27,19],19]]]],19]],[19,[19,[19,[19,[19,[19,[19,null]]]]]]]]],accept:15},{b:[[[[23,[[[23,[23,[23,15]]],23],23]],[[23,[23,[23,[[28,23],23]]]],23]],[23,[23,[23,[23,[23,[23,[23,null]]]]]]]]],accept:14},{b:[[[[null,[[[[null,[null,14]],null],null],null]],null],null]],accept:-1},{b:[[[[23,[[[23,[23,[23,15]]],23],23]],[[23,[23,
[23,[[28,23],23]]]],23]],[23,[23,[23,[23,[23,[23,[23,null]]]]]]]]],accept:-1},{b:[[[null,[null,[null,[null,[null,[null,[29,null]]]]]]],null]],accept:-1},{b:[[[[null,[null,[null,[null,[null,[16,null]]]]]],null],null]],accept:-1},{b:[[[[null,[[null,[[null,[37,null]],null]],null]],null],null]],accept:-1},{b:[[[[19,[[[[19,[20,19]],19],19],19]],[[19,[19,[19,[[27,19],19]]]],19]],[19,[19,[19,[19,[19,[19,[19,null]]]]]]]]],accept:-1},{b:[[[[23,[[[23,[23,[23,21]]],23],23]],[[23,[23,[23,[[28,23],23]]]],23]],
[23,[23,[23,[23,[23,[23,[23,null]]]]]]]]],accept:-1},{b:[[[[38,[[38,[38,[38,[38,30]]]],38]],[38,[38,[38,[38,[38,[31,38]]]]]]],[38,[38,[38,[38,[38,[38,[38,null]]]]]]]]],accept:-1},{b:[[[[null,[[null,[null,[null,[null,29]]]],null]],null],null]],accept:-1},{b:[[[[29,[[29,[29,[29,[29,17]]]],29]],29],[29,[29,[29,[29,[29,[29,[29,null]]]]]]]]],accept:-1},{b:[[[[32,[[32,[[32,[33,32]],32]],32]],32],[32,[32,[32,[32,[32,[32,[32,null]]]]]]]]],accept:-1},{b:[[[36,[[36,[36,[36,[[36,18],36]]]],36]],[36,[36,[36,
[36,[36,[36,[36,null]]]]]]]]],accept:-1},{b:[[[null,[[null,[null,[null,[[null,36],null]]]],null]],null]],accept:-1},{b:[[[[38,[[38,[38,[38,[38,35]]]],38]],[38,[38,[38,[38,[38,[31,38]]]]]]],[38,[38,[38,[38,[38,[38,[38,null]]]]]]]]],accept:-1},{b:[[[[32,[[32,[[32,[33,32]],32]],32]],[[32,[32,[32,[[32,34],32]]]],32]],[32,[32,[32,[32,[32,[32,[32,null]]]]]]]]],accept:-1},{b:[[[[32,[[32,[[32,[33,32]],32]],32]],[[32,[32,[32,[[32,34],32]]]],32]],[32,[32,[32,[32,[32,[32,[32,null]]]]]]]]],accept:-1},{b:[[[[38,
[[38,[38,[38,[38,35]]]],38]],[38,[38,[38,[38,[38,[31,38]]]]]]],[38,[38,[38,[38,[38,[38,[38,null]]]]]]]]],accept:-1}]}function r(a){this.la=a}function v(){throw v;}function G(a,b){for(var c=0;c<F[a].length;c+=2)if(F[a][c]===b)return F[a][c+1];return null}r.prototype=Object.create(Error.prototype);r.prototype.constructor=r;r.prototype.la=null;r.prototype.valueOf=function(){return this.la};var A=function(){function a(b){return b.F}var b={13:function(a){return a.F.substr(2,a.F.length-4)},17:function(a){return v.apply(null,
arguments)},18:function(a){return v.apply(null,arguments)},19:function(a){return v.apply(null,arguments)}};return function(c,e){try{return(b[e]||a)(c)}catch(f){if(f instanceof r)return f.valueOf();if(f==v)return v;throw f;}}}();n.prototype.O=[];n.prototype.T=0;n.prototype.state=0;n.prototype.match=null;n.prototype.exec=function(a,b){if(null!==this.state){if("number"!==typeof this.state||this.state>=this.O.length)throw this.state=null,Error("Invalid value for DfaLex.state at chr "+a+" and pos "+b);
var c=this.O[this.state].b;if("undefined"===typeof c||null===c){var e=this.state;this.state=null;throw Error("At chr "+a+" and pos "+b+", DfaLex._dfaData["+e+"] appears to exist, but its line property is "+("undefined"===typeof c?"undefined.":"null."));}for(e=256;e;e>>=1){c=0!==(a&e)?c[1]:c[0];"undefined"===typeof c&&(c=null);if(null===c)break;if(!Array.isArray(c))break}a=this.O[this.state].accept;this.state=c;-1!==a&&(this.match=a,this.T=b)}};var I=[[0,1],[24,5],[20,1],[23,1],[21,2],[21,1],[26,3],
[26,3],[26,3],[26,2],[26,3],[27,2],[27,1],[30,3],[30,2],[22,2],[22,1],[32,4],[32,2],[33,3],[33,1],[34,3],[36,2],[36,2],[36,0],[35,1],[35,0],[37,2],[37,1],[38,1],[38,1],[38,1],[25,1],[25,2],[25,2],[25,0],[39,2],[39,1],[28,1],[28,1],[31,1],[29,1],[29,0]],F=[[12,5,13,6],[],[3,9,4,10,5,11,6,13,14,16,15,17],[],[13,18],[13,19,16,21],[],[2,23,3,9,4,10,5,11,6,13,14,16,15,17],[],[14,16,15,17],[14,16,15,17],[14,16,15,17],[7,28,14,16,15,17],[14,16,15,17],[],[16,21,12,5,13,6],[],[],[],[],[],[],[],[1,35,16,21],
[7,36,14,16,15,17],[7,37,14,16,15,17],[7,38,14,16,15,17],[],[],[7,40],[],[12,5,13,6],[1,35,12,5,16,21,13,6],[],[8,45],[7,46],[],[],[],[],[],[],[],[],[],[11,54,16,21,14,16,15,17],[],[9,55,7,56],[],[10,58],[11,54,16,21,14,16,15,17],[],[],[],[],[11,54,16,21,14,16,15,17],[],[12,5,13,6],[16,21,14,16,15,17],[],[],[],[],[]],K=[[24,1,20,2,25,3,39,4],[],[21,7,26,8,27,12,30,14,28,15],[],[],[31,20],[],[26,22,27,12,30,14,28,15],[],[27,24,30,14,28,15],[27,25,30,14,28,15],[27,26,30,14,28,15],[30,27,28,15],[28,
29],[],[25,30,31,31,39,4],[],[],[],[],[],[],[],[22,32,32,33,31,34],[30,27,28,15],[30,27,28,15],[30,27,28,15],[],[],[29,39],[],[25,41,39,4],[32,42,23,43,25,44,31,34,39,4],[],[],[],[],[],[],[],[],[],[],[],[],[33,47,34,48,35,49,37,50,38,51,31,52,28,53],[],[],[],[36,57],[38,59,31,52,28,53],[],[],[],[],[34,60,35,49,37,50,38,51,31,52,28,53],[],[25,61,39,4],[28,62,31,63],[],[],[],[],[]],Q=[35,0,-1,2,32,-1,37,-1,5,-1,-1,-1,-1,-1,12,35,38,39,36,34,33,40,4,-1,-1,-1,-1,11,9,42,14,35,35,16,-1,-1,6,7,8,10,41,
13,15,1,3,26,18,-1,20,24,25,28,29,30,31,26,17,35,-1,27,19,21,23,22],Sa=[{label:"def'",kind:{},prods:[0],nullable:0,id:0,code:"",level:0,special:{},defined:!0,first:[12,3,4,5,6,13,14,15]},{label:"ERROR_RESYNC",kind:{},prods:[],nullable:!1,id:1,code:"",level:0,special:{},defined:!0,first:[1]},{label:"##",kind:{},prods:[],nullable:!1,id:2,code:"",level:0,special:{},defined:!1,first:[2]},{label:"\x3c",kind:{},prods:[],nullable:!1,id:3,code:"",level:0,special:{},defined:!1,first:[3]},{label:"\x3e",kind:{},
prods:[],nullable:!1,id:4,code:"",level:0,special:{},defined:!1,first:[4]},{label:"^",kind:{},prods:[],nullable:!1,id:5,code:"",level:0,special:{},defined:!1,first:[5]},{label:"!",kind:{},prods:[],nullable:!1,id:6,code:"",level:0,special:{},defined:!1,first:[6]},{label:";",kind:{},prods:[],nullable:!1,id:7,code:"",level:0,special:{},defined:!1,first:[7]},{label:":",kind:{},prods:[],nullable:!1,id:8,code:"",level:0,special:{},defined:!1,first:[8]},{label:"|",kind:{},prods:[],nullable:!1,id:9,code:"",
level:0,special:{},defined:!1,first:[9]},{label:"\x26",kind:{},prods:[],nullable:!1,id:10,code:"",level:0,special:{},defined:!1,first:[10]},{label:"~",kind:{},prods:[],nullable:!1,id:11,code:"",level:0,special:{},defined:!1,first:[11]},{label:"\x3d\x3e",kind:{},prods:[],nullable:!1,id:12,code:"",level:0,special:{},defined:!1,first:[12]},{label:"CODE",kind:{},prods:[],nullable:!1,id:13,code:"\treturn %match.substr(2, %match.length - 4 ); ",level:0,special:{},defined:!1,first:[13]},{label:"STRING_SINGLE",
kind:{},prods:[],nullable:!1,id:14,code:"",level:0,special:{},defined:!1,first:[14]},{label:"STRING_DOUBLE",kind:{},prods:[],nullable:!1,id:15,code:"",level:0,special:{},defined:!1,first:[15]},{label:"IDENT",kind:{},prods:[],nullable:!1,id:16,code:"",level:0,special:{},defined:!1,first:[16]},{label:"n",kind:{},prods:[],nullable:!1,id:17,code:"return Continue.apply(null, arguments);",level:0,special:{},defined:!1,first:[17]},{label:"/~([^~]/|~[^/]|[^~/])*~/",kind:{},prods:[],nullable:!1,id:18,code:"return Continue.apply(null, arguments);",
level:0,special:{},defined:!1,first:[18]},{label:"[tr ]+",kind:{},prods:[],nullable:!1,id:19,code:"return Continue.apply(null, arguments);",level:0,special:{},defined:!1,first:[19]},{label:"header_code",kind:{},prods:[2],nullable:1,id:20,code:"",level:0,special:{},defined:!0,first:[12,13]},{label:"token_assocs",kind:{},prods:[4,5],nullable:0,id:21,code:"",level:0,special:{},defined:!0,first:[3,4,5,6,14,15]},{label:"grammar_defs",kind:{},prods:[15,16],nullable:0,id:22,code:"",level:0,special:{},defined:!0,
first:[16,1]},{label:"footer_code",kind:{},prods:[3],nullable:1,id:23,code:"",level:0,special:{},defined:!0,first:[12,13]},{label:"def",kind:{},prods:[1],nullable:0,id:24,code:"",level:0,special:{},defined:!0,first:[12,3,4,5,6,13,14,15]},{label:"code_opt",kind:{},prods:[32,33,34,35],nullable:1,id:25,code:"",level:0,special:{},defined:!0,first:[12,13]},{label:"token_assoc",kind:{},prods:[6,7,8,9,10],nullable:0,id:26,code:"",level:0,special:{},defined:!0,first:[3,4,5,6,14,15]},{label:"token_defs",kind:{},
prods:[11,12],nullable:0,id:27,code:"",level:0,special:{},defined:!0,first:[14,15]},{label:"string",kind:{},prods:[38,39],nullable:0,id:28,code:"",level:0,special:{},defined:!0,first:[14,15]},{label:"opt_semicolon",kind:{},prods:[41,42],nullable:1,id:29,code:"",level:0,special:{},defined:!0,first:[7]},{label