jscc-parser
Version:
A LALR(1) Parser Generator for JavaScript written in JavaScript.
91 lines • 70.7 kB
JavaScript
/*
almond 0.3.2 Copyright jQuery Foundation and other contributors.
Released under MIT license, http://github.com/requirejs/almond/LICENSE
*/
var l=this.jscc={};l.enums={};l.classes={};l.Va=l.enums;l.classes=l.classes;var p={NONE:0,Aa:1,Oa:2,Ca:3},y={za:0,EPSILON:1,ca:2},J={Vb:0,Xb:1},K={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,FATAL:5};l.Va.LOG_LEVEL=K;var L={Wb:0,Na:1,kb:2},M={NONE:0,ya:1,Pa:2,ERROR:3},N={I:0,A:1},O,P,Q;
(function(a){function c(b,a){var q,k,c,g,d,m,n,e,h=a&&a.split("/"),F=u.map,t=F&&F["*"]||{};if(b){a=b.split("/");b=a.length-1;u.uc&&z.test(a[b])&&(a[b]=a[b].replace(z,""));"."===a[0].charAt(0)&&h&&(b=h.slice(0,h.length-1),a=b.concat(a));for(n=0;n<a.length;n++)b=a[n],"."===b?(a.splice(n,1),--n):".."===b&&(1!==n||".."!==a[2])&&".."!==a[n-1]&&0<n&&(a.splice(n-1,2),n-=2);b=a.join("/")}if((h||t)&&F){a=b.split("/");for(n=a.length;0<n;--n){q=a.slice(0,n).join("/");if(h)for(e=h.length;0<e;--e)if(k=F[h.slice(0,
e).join("/")])if(k=k[q]){c=k;g=n;break}if(c)break;!d&&t&&t[q]&&(d=t[q],m=n)}!c&&d&&(c=d,g=m);c&&(a.splice(0,g,c),b=a.join("/"))}return b}function b(b,q){return function(){var c=A.call(arguments,0);"string"!==typeof c[0]&&1===c.length&&c.push(null);return h.apply(a,c.concat([b,q]))}}function d(b){return function(a){return c(a,b)}}function g(b){return function(a){q[b]=a}}function e(b){if(x.call(n,b)){var c=n[b];delete n[b];t[b]=!0;m.apply(a,c)}if(!x.call(q,b)&&!x.call(t,b))throw Error("No "+b);return q[b]}
function f(b){var a,c=b?b.indexOf("!"):-1;-1<c&&(a=b.substring(0,c),b=b.substring(c+1,b.length));return[a,b]}function k(b){return function(){return u&&u.oa&&u.oa[b]||{}}}var m,h,w,r,q={},n={},u={},t={},x=Object.prototype.hasOwnProperty,A=[].slice,z=/\.js$/;w=function(b,a){var q;b=f(b);var k=b[0];b=b[1];k&&(k=c(k,a),q=e(k));k?b=q&&q.normalize?q.normalize(b,d(a)):c(b,a):(b=c(b,a),b=f(b),k=b[0],b=b[1],k&&(q=e(k)));return{Xa:k?k+"!"+b:b,n:b,xc:k,p:q}};r={Nb:function(a){return b(a)},exports:function(b){var a=
q[b];return"undefined"!==typeof a?a:q[b]={}},module:function(b){return{id:b,uri:"",exports:q[b],oa:k(b)}}};m=function(c,k,d,m){var u,h,f,C,A=[];h=typeof d;var Y;m=m||c;if("undefined"===h||"function"===h){k=!k.length&&d.length?["require","exports","module"]:k;for(C=0;C<k.length;C+=1)if(f=w(k[C],m),h=f.Xa,"require"===h)A[C]=r.Nb(c);else if("exports"===h)A[C]=r.exports(c),Y=!0;else if("module"===h)u=A[C]=r.module(c);else if(x.call(q,h)||x.call(n,h)||x.call(t,h))A[C]=e(h);else if(f.p)f.p.load(f.n,b(m,
!0),g(h),{}),A[C]=q[h];else throw Error(c+" missing "+h);k=d?d.apply(q[c],A):void 0;c&&(u&&u.exports!==a&&u.exports!==q[c]?q[c]=u.exports:k===a&&Y||(q[c]=k))}else c&&(q[c]=d)};O=P=h=function(b,c,k,q,g){if("string"===typeof b)return r[b]?r[b](c):e(w(b,c).Xa);if(!b.splice){u=b;u.pb&&h(u.pb,u.Ra);if(!c)return;c.splice?(b=c,c=k,k=null):b=a}c=c||function(){};"function"===typeof k&&(k=q,q=g);q?m(a,b,c,k):setTimeout(function(){m(a,b,c,k)},4);return h};h.oa=function(b){return h(b)};O.Yb=q;Q=function(b,a,
c){if("string"!==typeof b)throw Error("See almond README: incorrect module build, no module name");a.splice||(c=a,a=[]);x.call(q,b)||x.call(n,b)||(n[b]=[b,a,c])};Q.m={bc:!0}})(void 0);Q("bin/almond",function(){});Q("text",{load:function(a){throw Error("Dynamic load not allowed: "+a);}});Q("text!lib/jscc/template/parser-driver-js.txt",[],function(){return'/*\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'});
function R(){l.fb=function(){var a=this;this.la=[];this.set=function(c,b){b=!!b;a.la[c>>5]=b?a.la[c>>5]|1<<(c&31):a.la[c>>5]&~(1<<(c&31));return b};this.get=function(c){return 0!=(a.la[c>>5]&1<<(c&31))};this.count=function(){var c,b,d=0;c=0;for(b=32*a.la.length;c<b;c++)a.get(c)&&d++;return d}};return l.fb}"function"===typeof Q&&Q.m?Q("lib/jscc/bitset/BitSet32",R):"object"===typeof module&&module.exports?module.exports=R():R();function aa(){return y}
"function"===typeof Q&&Q.m?Q("lib/jscc/enums/EDGE",aa):"object"===typeof module&&module.exports&&(module.exports=y);
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/classes/Nfa",["require","../enums/EDGE","../bitset"],c):"object"===typeof module&&module.exports?module.exports=c(P):a.dc=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){var c,b=a("../enums/EDGE");c=a("../bitset");l.classes.$=function(a){a=a||{};if(a.J===b.ca||a.J===b.za)this.J=a.J;"object"===typeof a.C&&a.C.hasOwnProperty("get")&&a.C.hasOwnProperty("set")&&a.C.hasOwnProperty("count")?this.C=a.C:this.C=new c;"number"===typeof a.s&&
(this.s=a.s);"number"===typeof a.D&&(this.D=a.D);"number"===typeof a.accept&&(this.accept=a.accept);"number"===typeof a.weight&&(this.weight=a.weight)};l.classes.$.prototype.J=b.EPSILON;l.classes.$.prototype.C=new c;l.classes.$.prototype.s=-1;l.classes.$.prototype.D=-1;l.classes.$.prototype.accept=-1;l.classes.$.prototype.weight=-1;return l.classes.$});
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/nfaStates",["require","./bitset","./enums/EDGE","./classes/Nfa"],c):"object"===typeof module&&module.exports?module.exports=c(P):a.oc=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){var c,b=a("./enums/EDGE"),d=a("./classes/Nfa");c=a("./bitset");l.Ba=function(){};l.Ba.prototype.value=[];l.Ba.prototype.create=function(){var a,e;for(e=0;e<this.value.length&&this.value[e].J!==b.za;e++);e==this.value.length?(a=new d,this.value.push(a)):
a=this.value[e];a.J=b.EPSILON;a.C=new c;a.accept=-1;a.s=-1;a.D=-1;a.weight=-1;return e};return l.Ba});function ba(){return N}"function"===typeof Q&&Q.m?Q("lib/jscc/enums/SYM",ba):"object"===typeof module&&module.exports&&(module.exports=N);function ca(){return p}"function"===typeof Q&&Q.m?Q("lib/jscc/enums/ASSOC",ca):"object"===typeof module&&module.exports&&(module.exports=p);function da(){return M}
"function"===typeof Q&&Q.m?Q("lib/jscc/enums/SPECIAL",da):"object"===typeof module&&module.exports&&(module.exports=M);
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/classes/Symbol",["require","../enums/SYM","../enums/ASSOC","../enums/SPECIAL"],c):"object"===typeof module&&module.exports?module.exports=c(P):a.ec=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){var c=a("../enums/SYM"),b=a("../enums/ASSOC"),d=a("../enums/SPECIAL");l.classes.Symbol=function(a){a=a||{};"number"===typeof a.id&&(this.id=a.id);a.kind===c.A&&(this.kind=a.kind);"string"===typeof a.label&&(this.label=a.label);Array.isArray(a.w)&&
(this.w=a.w);Array.isArray(a.first)&&(this.first=a.first);if(a.X===b.Aa||a.X===b.Oa||a.X===b.Ca)this.X=a.X;"number"===typeof a.level&&(this.level=a.level);"string"===typeof a.code&&(this.code=a.code);if(a.M===d.ya||a.M===d.ERROR||a.M===d.Pa)this.M=a.M;"boolean"===typeof a.ba&&(this.ba=a.ba);"boolean"===typeof a.Y&&(this.Y=a.Y)};l.classes.Symbol.prototype.id=-1;l.classes.Symbol.prototype.kind=c.I;l.classes.Symbol.prototype.label="";l.classes.Symbol.prototype.w=[];l.classes.Symbol.prototype.first=[];
l.classes.Symbol.prototype.X=b.NONE;l.classes.Symbol.prototype.level=0;l.classes.Symbol.prototype.code="";l.classes.Symbol.prototype.M=d.NONE;l.classes.Symbol.prototype.ba=!1;l.classes.Symbol.prototype.Y=!1;return l.classes.Symbol});
function S(){l.classes.fa=function(a){a=a||{};"number"===typeof a.id&&(this.id=a.id);"number"===typeof a.S&&(this.S=a.S);"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)};l.classes.fa.prototype.id=-1;l.classes.fa.prototype.S=-1;l.classes.fa.prototype.h=[];l.classes.fa.prototype.level=0;l.classes.fa.prototype.code="";return l.classes.fa}
"function"===typeof Q&&Q.m?Q("lib/jscc/classes/Production",S):"object"===typeof module&&module.exports?module.exports=S():S();function ea(){return J}"function"===typeof Q&&Q.m?Q("lib/jscc/enums/EXEC",ea):"object"===typeof module&&module.exports&&(module.exports=J);
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/global","require text!./template/parser-driver-js.txt ./nfaStates ./classes/Symbol ./classes/Production ./enums/SYM ./enums/SPECIAL ./enums/EXEC".split(" "),c):"object"===typeof module&&module.exports?module.exports=c(P):a.hc=c(function(b){b=b.split("/");b=b[b.length-1];return/js\.txt$/.test(b)?a.cc:a["jscc"+b]})})(this,function(a){var c,b=a("./nfaStates"),d=a("./classes/Symbol"),g=a("./classes/Production"),e=a("./enums/SYM"),f=a("./enums/SPECIAL");
a("./enums/EXEC");c=a("text!./template/parser-driver-js.txt");l.global=function(){this.f=new b;var a=new d;a.kind=e.I;a.M=f.NONE;a.label="";a.id=0;a.Y=!0;var m=new d;m.kind=e.A;m.M=f.ERROR;m.label="ERROR_RESYNC";m.id=1;m.Y=!0;this.a=[a,m];a=new g;a.S=0;a.h=[];a.code="%% \x3d %1;";this.a[0].w.push(0);this.g=[a];this.sa=-1;this.file="";this.bb=this.Ja=this.Ka=this.La=this.xa=this.L=0;this.ua=this.va="";this.hb=c;this.ib="%% \x3d %1;";this.ea=0;this.Z=255};l.global.prototype.a=[];l.global.prototype.g=
[];l.global.prototype.c=[];l.global.prototype.f=null;l.global.prototype.pa=[];l.global.prototype.sa=-1;l.global.prototype.va="";l.global.prototype.ua="";l.global.prototype.file="";l.global.prototype.L=0;l.global.prototype.xa=0;l.global.prototype.La=0;l.global.prototype.Ka=0;l.global.prototype.Ja=0;l.global.prototype.ga=1;l.global.prototype.bb=0;l.global.prototype.Ma=null;l.global.prototype.qa=null;l.global.prototype.ra=null;l.global.prototype.cb=null;return new l.global});
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/io/ioBrowser",["require","../global"],c):"object"===typeof module&&module.exports?module.exports=c(P):a.jc=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){var c=a("../global");l.ja=function(){};l.ja.prototype.Kb=function(b){if("function"===typeof c.qa)if(b=b||{},"function"===typeof b.Ga){var a=b.Ga;b="function"===typeof b.Ha?b.Ha:function(){};a(c.qa());b()}else return c.qa();else throw Error("global.read_all_input_function was not defined");
};l.ja.prototype.Lb=function(b){if("function"===typeof c.ra)if(b=b||{},"function"===typeof b.Ga){var a=b.Ga;b="function"===typeof b.Ha?b.Ha:function(){};a(c.ra());b()}else return c.ra();else throw Error("global.read_template_function was not defined");};l.ja.prototype.eb=function(b){if("function"===typeof c.Ma){var a="",g=function(){};if("string"===typeof b)a=b;else if(b&&"object"===typeof b){if("string"===typeof b.text)a=b.text;else throw Error("options was not a string, and options.text was not a string");
"function"===typeof b.Ra&&(g=b.Ra)}c.Ma(a);g()}else throw Error("global.write_output_function was not defined");};l.ja.prototype.Ub=function(b){"function"===typeof c.cb&&c.cb(b)};l.ja.prototype.exit=function(){};return new l.ja});function fa(){return K}"function"===typeof Q&&Q.m?Q("lib/jscc/enums/LOG_LEVEL",fa):"object"===typeof module&&module.exports&&(module.exports=K);
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/util",["require","./enums/LOG_LEVEL"],c):"object"===typeof module&&module.exports?module.exports=c(P):a.tc=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){var c=a("./enums/LOG_LEVEL");l.util=function(){};l.util.prototype={wa:function(b,a){var c,e;for(c=0;c<a.length;c++){for(e=0;e<b.length&&a[c]!=b[e];e++);e==b.length&&b.push(a[c])}return b},Bb:function(b){switch((b||"").trim().toUpperCase()){case "FATAL":return c.jb;case "ERROR":return c.ERROR;
case "WARN":return c.ka;case "INFO":return c.INFO;case "DEBUG":return c.gb;case "TRACE":return c.lb;default:return c.ka}}};return new l.util});
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/first",["require","./global","./util","./enums/SYM"],c):"object"===typeof module&&module.exports?module.exports=c(P):a.gc=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){var c=a("./global"),b=a("./util"),d=a("./enums/SYM");l.first=function(){};l.first.prototype.first=function(){var a=0,e,f;do{e=a;for(var k=a=0;k<c.a.length;k++)if(c.a[k].kind==d.I)for(var m=0;m<c.a[k].w.length;m++){f=!1;for(var h=0;h<c.g[c.a[k].w[m]].h.length&&
(c.a[k].first=b.wa(c.a[k].first,c.a[c.g[c.a[k].w[m]].h[h]].first),f=c.a[c.g[c.a[k].w[m]].h[h]].ba,f);h++);a+=c.a[k].first.length;h==c.g[c.a[k].w[m]].h.length&&(f=!0);f&&(c.a[k].ba=!0)}}while(a!=e)};l.first.prototype.Ob=function(a,e,d){for(;d<e.h.length;d++)if(a.l=b.wa(a.l,c.a[e.h[d]].first),!c.a[e.h[d]].ba)return!1;return!0};return new l.first});
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/log/logBrowser",["require","../global","../enums/LOG_LEVEL"],c):"object"===typeof module&&module.exports?module.exports=c(P):a.mc=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){var c=a("../global"),b=a("../enums/LOG_LEVEL"),d=console||Console||{};d.log=d.log||function(){};d.warn=d.warn||d.log||function(){};d.error=d.error||d.log||function(){};d.info=d.info||d.log||function(){};d.trace=d.trace||d.log||function(){};l.T=function(){this.W=
b.ka};l.T.prototype.W=b.ka;l.T.prototype.fatal=function(a){this.W<=b.jb&&d.error(a);c.L++};l.T.prototype.error=function(a){this.W<=b.ERROR&&d.error(a);c.L++};l.T.prototype.warn=function(a){this.W<=b.ka&&d.warn(a);c.xa++};l.T.prototype.info=function(a){this.W<=b.INFO&&d.info(a)};l.T.prototype.debug=function(a){this.W<=b.gb&&d.log(a)};l.T.prototype.trace=function(a){this.W<=b.lb&&d.trace(a)};l.T.prototype.setLevel=function(b){this.W=b};return new l.T});
function T(){l.classes.V=function(a){a=a||{};Array.isArray(a.v)&&(this.v=a.v);Array.isArray(a.N)&&(this.N=a.N);"number"===typeof a.K&&(this.K=a.K);"boolean"===typeof a.done&&(this.done=a.done);"boolean"===typeof a.closed&&(this.closed=a.closed);Array.isArray(a.u)&&(this.u=a.u);Array.isArray(a.O)&&(this.O=a.O)};l.classes.V.prototype.v=[];l.classes.V.prototype.N=[];l.classes.V.prototype.K=0;l.classes.V.prototype.done=!1;l.classes.V.prototype.closed=!1;l.classes.V.prototype.u=[];l.classes.V.prototype.O=
[];return l.classes.V}"function"===typeof Q&&Q.m?Q("lib/jscc/classes/State",T):"object"===typeof module&&module.exports?module.exports=T():T();function U(){l.classes.ta=function(a){a=a||{};"number"===typeof a.i&&(this.i=a.i);"number"===typeof a.o&&(this.o=a.o);"undefined"!==typeof a.l&&Array.isArray(a.l)&&(this.l=a.l)};l.classes.ta.prototype.i=-1;l.classes.ta.prototype.o=0;l.classes.ta.prototype.l=[];return l.classes.ta}
"function"===typeof Q&&Q.m?Q("lib/jscc/classes/Item",U):"object"===typeof module&&module.exports?module.exports=U():U();function V(){l.classes.Ea=function(a,c){this.symbol=a;this.action=c};l.classes.Ea.prototype.symbol=-1;l.classes.Ea.prototype.action=-1;return l.classes.Ea}"function"===typeof Q&&Q.m?Q("lib/jscc/classes/TableEntry",V):"object"===typeof module&&module.exports?module.exports=V():V();function ga(){return L}
"function"===typeof Q&&Q.m?Q("lib/jscc/enums/MODE_GEN",ga):"object"===typeof module&&module.exports&&(module.exports=L);
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/debug","require ./global ./io/io ./enums/MODE_GEN ./enums/SYM ./enums/ASSOC".split(" "),c):"object"===typeof module&&module.exports?module.exports=c(P):a.fc=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){a("./global");a("./enums/MODE_GEN");a("./enums/SYM");a("./enums/ASSOC");a("./io/io");l.debug=function(){};l.debug.prototype={};return new l.debug});
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/tabgen","require ./global ./first ./util ./log/log ./classes/State ./classes/Item ./classes/TableEntry ./classes/Symbol ./enums/SPECIAL ./enums/ASSOC ./enums/SYM ./enums/MODE_GEN ./enums/EXEC ./debug".split(" "),c):"object"===typeof module&&module.exports?module.exports=c(P):a.sc=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){var c,b=a("./global"),d=a("./first"),g=a("./util");c=a("./log/log");var e=a("./classes/State"),
f=a("./classes/Item"),k=a("./classes/TableEntry"),m=a("./classes/Symbol"),h=a("./enums/SPECIAL"),w=a("./enums/ASSOC"),r=a("./enums/SYM");a("./enums/EXEC");a("./enums/MODE_GEN");a("./debug");l.F=function(){};l.F.prototype.Ua=function(){var a=new e({v:[],N:[],u:[],O:[],done:!1,closed:!1,K:0});b.c.push(a);return a};l.F.prototype.Ta=function(b){return new f({i:b,o:0,l:[]})};l.F.prototype.Fa=function(b,a,c){for(var m=0;m<b.length;m++)if(b[m].symbol==a)return b;b.push(new k(a,c));return b};l.F.prototype.Tb=
function(b,a,c){var k;for(k=0;k<b.length;k++)if(b[k].symbol==a){b[k].action=c;break}};l.F.prototype.Mb=function(b,a){for(var c=0;c<b.length;c++)if(b[c].symbol==a){b.splice(c,1);break}};l.F.prototype.Ia=function(b,a){for(var c=0;c<b.length;c++)if(b[c].symbol==a)return b[c].action};l.F.prototype.vb=function(){for(var a=0;a<b.c.length;a++)if(0==b.c[a].done)return a;return-1};l.F.prototype.Qb=function(b,a){return b.i-a.i};l.F.prototype.ia=function(a,c,k){k||(k=h.NONE);for(var m=0;m<b.a.length;m++)if(b.a[m].label.toString()==
a.toString()&&b.a[m].kind==c&&b.a[m].M==k)return m;return-1};l.F.prototype.ha=function(a,c,k){var h;if(-1<(h=this.ia(a,c,k)))return b.a[h].id;a=new m({label:a,kind:c,w:[],ba:!1,id:b.a.length,code:"",X:w.NONE,level:0,M:k,Y:!1,first:[]});c==r.A&&a.first.push(a.id);b.a.push(a);return a.id};l.F.prototype.xb=function(b,a){var c,k,m=0;if(b.length!=a.length)return!1;for(c=0;c<b.length;c++)for(k=0;k<a.length;k++)if(b[c].i==a[k].i&&b[c].o==a[k].o){m++;break}return m==b.length};l.F.prototype.nb=function(a,
c){var k,m,h,e=0,f;for(k=0;k<a.length;k++)if(a[k].o<b.g[a[k].i].h.length&&b.a[b.g[a[k].i].h[a[k].o]].kind==r.I)for(m=0;m<b.a[b.g[a[k].i].h[a[k].o]].w.length;m++){for(h=0;h<c.length&&c[h].i!=b.a[b.g[a[k].i].h[a[k].o]].w[m];h++);h==c.length&&(f=this.Ta(b.a[b.g[a[k].i].h[a[k].o]].w[m]),c.push(f),e++);f=c[h].l.length;d.Ob(c[h],b.g[a[k].i],a[k].o+1)&&(c[h].l=g.wa(c[h].l,a[k].l));e+=c[h].l.length-f}return e};l.F.prototype.zb=function(a){var c=[],k,m,h,e,d;h=0;do k=h,h=this.nb(0==k?b.c[a].v:c,c);while(h!=
k);for(e=0;e<b.c[a].v.length;e++)if(b.c[a].v[e].o<b.g[b.c[a].v[e].i].h.length)for(c.unshift(new f({i:b.c[a].v[e].i,o:b.c[a].v[e].o,l:[]})),d=0;d<b.c[a].v[e].l.length;d++)c[0].l[d]=b.c[a].v[e].l[d];for(e=0;e<c.length;e++)if(0==b.g[c[e].i].h.length){for(d=0;d<b.c[a].N.length&&(b.c[a].N[d].i!=c[e].i||b.c[a].N[d].o!=c[e].o);d++);d==b.c[a].N.length&&b.c[a].N.push(c[e]);c.splice(e,1)}for(;0<c.length;){m=[];k=[];h=-1;for(e=0;e<c.length;e++)0==m.length&&(h=b.g[c[e].i].h[c[e].o]),c[e].o<b.g[c[e].i].h.length&&
(b.g[c[e].i].h[c[e].o]==h?(c[e].o++,m.push(c[e])):k.push(c[e]));if(0<m.length){m.sort(this.Qb);for(e=0;e<b.c.length&&!this.xb(b.c[e].v,m);e++);e==b.c.length&&(c=this.Ua(),c.v=m);for(d=h=c=0;d<m.length;d++)c+=b.c[e].v[d].l.length,b.c[e].v[d].l=g.wa(b.c[e].v[d].l,m[d].l),h+=b.c[e].v[d].l.length;c!=h&&(b.c[e].done=!1);if(!b.c[a].closed)for(d=0;d<m.length;d++)m[d].o-1<b.g[m[d].i].h.length&&(b.a[b.g[m[d].i].h[m[d].o-1]].kind==r.A?(b.c[a].u=this.Fa(b.c[a].u,b.g[m[d].i].h[m[d].o-1],e),b.La++):(b.c[a].O=
this.Fa(b.c[a].O,b.g[m[d].i].h[m[d].o-1],e),b.Ja++))}c=k}b.c[a].closed=!0};l.F.prototype.qb=function(a){var k,m,e,h,d,f,g,r=[],E=0;for(k=0;2>k;k++)for(g=k?b.c[a].N:b.c[a].v,m=0;m<g.length;m++)if(g[m].o==b.g[g[m].i].h.length)for(e=0;e<g[m].l.length;e++)if(f=!0,h=this.Ia(b.c[a].u,g[m].l[e]),void 0==h)d=-1*g[m].i,b.c[a].u=this.Fa(b.c[a].u,g[m].l[e],d),b.Ka++;else{d=h;var v;if(0<h){if(0<b.a[g[m].l[e]].level||0<b.g[g[m].i].level)b.a[g[m].l[e]].level==b.g[g[m].i].level?b.a[g[m].l[e]].X==w.Aa?d=-1*g[m].i:
b.a[g[m].l[e]].X==w.Ca&&(this.Mb(b.c[a].u,g[m].l[e]),c.warn("Removing nonassociative symbol '"+b.a[g[m].l[e]].label+"' in state "+a),f=!1):b.a[g[m].l[e]].level<b.g[g[m].i].level&&(d=-1*g[m].i);v="Shift"}else d=-1*d<g[m].i?d:-1*g[m].i,v="Reduce";v+="-reduce conflict on symbol '"+b.a[g[m].l[e]].label+"' in state "+a;v+="\n Conflict resolved by "+(0>=d?"reducing with production":"shifting to state")+" "+(0>=d?-1*d:d);f&&c.warn(v);d!=h&&this.Tb(b.c[a].u,g[m].l[e],d)}b.c[a].K=-1;for(m=0;m<r.length;m++){for(k=
e=0;e<r.length;e++)r[e]==r[m]&&k++;E<k&&(E=k,b.c[a].K=r[m])}if(0<=b.c[a].K){do for(k=b.c[a].u.length,m=0;m<b.c[a].u.length;m++)b.c[a].u[m][1]==-1*b.c[a].K&&b.c[a].u.splice(m,1);while(k!=b.c[a].u.length)}};l.F.prototype.Ab=function(){var a,c;a=this.Ta(0);c=this.ha("$",r.A,h.ya);a.l.push(c);c=this.Ua();for(c.v.push(a);0<=(a=this.vb());)b.c[a].done=!0,this.zb(a);for(a=0;a<b.c.length;a++)this.qb(a)};return new l.F});
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/printtab","require ./global ./tabgen ./log/log ./enums/MODE_GEN ./enums/SYM ./enums/SPECIAL".split(" "),c):"object"===typeof module&&module.exports?module.exports=c(P):a.qc=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){var c,b=a("./global"),d=a("./tabgen"),g=a("./enums/MODE_GEN"),e=a("./enums/SYM"),f=a("./enums/SPECIAL");c=a("./log/log");l.ab=function(){};l.ab.prototype={Hb:function(a){var c="",h,f=0,r;switch(a){case g.kb:case "html":c+=
'\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++)c+="\x3ctr\x3e",c+='\x3ctd style\x3d"border-right: 1px solid lightgray;"\x3e'+b.g[a].S+"\x3c/td\x3e",c+="\x3ctd\x3e"+b.g[a].h.length+
"\x3c/td\x3e",c+="\x3c/tr\x3e";for(a=0;a<b.a.length;a++)b.a[a].kind==e.A&&f++;c=c+'\x3c/table\x3e\x3ctable class\x3d"print" cellpadding\x3d"0" cellspacing\x3d"0"\x3e\x3ctr\x3e'+('\x3ctd class\x3d"tabtitle" colspan\x3d"'+(f+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==e.A&&(c+="\x3ctd\x3e\x3cb\x3e"+b.a[a].label+"\x3c/b\x3e\x3c/td\x3e");c+="\x3c/tr\x3e";
for(a=0;a<b.c.length;a++){c+="\x3ctr\x3e";c+='\x3ctd class\x3d"coltitle" style\x3d"border-right: 1px solid lightgray;"\x3e'+a+"\x3c/td\x3e";for(h=0;h<b.a.length;h++)b.a[h].kind==e.A&&(c+="\x3ctd\x3e",void 0!=(r=d.Ia(b.c[a].u,h))&&(c=0>=r?c+("r"+-1*r):c+("s"+r)),c+="\x3c/td\x3e");c+="\x3c/tr\x3e"}c+="\x3c/table\x3e";for(a=0;a<b.a.length;a++)b.a[a].kind==e.I&&f++;c+='\x3ctable class\x3d"print" cellpadding\x3d"0" cellspacing\x3d"0"\x3e';c+="\x3ctr\x3e";c=c+('\x3ctd class\x3d"tabtitle" colspan\x3d"'+
(f+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==e.I&&(c+="\x3ctd\x3e"+b.a[a].label+"\x3c/td\x3e");c+="\x3c/tr\x3e";for(a=0;a<b.c.length;a++){c+="\x3ctr\x3e";c+='\x3ctd class\x3d"coltitle" style\x3d"border-right: 1px solid lightgray;"\x3e'+a+"\x3c/td\x3e";for(h=0;h<b.a.length;h++)b.a[h].kind==e.I&&(c+="\x3ctd\x3e",void 0!=(r=d.Ia(b.c[a].O,h))&&(c+=r),c+=
"\x3c/td\x3e");c+="\x3c/tr\x3e"}c+="\x3c/table\x3e";c+='\x3ctable class\x3d"print" cellpadding\x3d"0" cellspacing\x3d"0"\x3e';c+="\x3ctr\x3e";c+='\x3ctd class\x3d"tabtitle" colspan\x3d"2"\x3eDefault Actions Table\x3c/td\x3e';c+="\x3c/tr\x3e";c+='\x3ctd class\x3d"coltitle" width\x3d"1%" style\x3d"border-right: 1px solid lightgray;"\x3eLeft-hand side\x3c/td\x3e';c+='\x3ctd class\x3d"coltitle"\x3eNumber of symbols to pop\x3c/td\x3e';c+="\x3c/tr\x3e";for(a=0;a<b.c.length;a++)c+="\x3ctr\x3e",c+='\x3ctd style\x3d"border-right: 1px solid lightgray;"\x3eState '+
a+"\x3c/td\x3e",c+="\x3ctd\x3e"+(0>b.c[a].K?"(none)":b.c[a].K)+"\x3c/td\x3e",c+="\x3c/tr\x3e";c+="\x3c/table\x3e";break;case g.Na:case "js":h=[];for(a=0;a<b.g.length;a++)h.push([b.g[a].S,b.g[a].h.length]);c+="\nvar pop_tab \x3d "+JSON.stringify(h)+";\n";f=[];for(a=0;a<b.c.length;a++){r=[];for(h=0;h<b.c[a].u.length;h++)r.push(b.c[a].u[h].symbol,b.c[a].u[h].action);f.push(r)}c+="\n/** @type {!Array\x3c!Array\x3cnumber\x3e\x3e} */\nvar act_tab \x3d"+JSON.stringify(f)+";\n";f=[];for(a=0;a<b.c.length;a++){r=
[];for(h=0;h<b.c[a].O.length;h++)r.push(b.c[a].O[h].symbol,b.c[a].O[h].action);f.push(r)}c+="\nvar goto_tab \x3d"+JSON.stringify(f)+";\n";h=[];for(a=0;a<b.c.length;a++)h.push(b.c[a].K);c+="\nvar defect_tab \x3d"+JSON.stringify(h)+";\n"}return c},Db:function(a){function b(a){for(var c=[];a.length;){var e=a.shift(),k=a.shift();e==k?c.push(e):c.push([e,k])}return c}for(var c=[],e=0;e<a.length;e++)(function(e){for(var d=[],f=0;f<a[e].b.length;f++)-1!=a[e].b[f]&&(d[f]=a[e].b[f]);d=b(b(b(b(b(b(b(b(d))))))));
c.push({b:d,accept:a[e].accept})})(e);return c},Gb:function(a){for(var b=[],c=0;c<a.length;c++){for(var e=c,d={},f=0;f<a[e].b.length;f++)-1!=a[e].b[f]&&(d[f]=a[e].b[f]);b.push({b:d,accept:a[e].accept})}return JSON.stringify(this.Db(a)).replace(/"([A-Za-z_][A-Za-z0-9_]*)"\s*:/g,"$1:").replace(/,/g,",\n\t")},Ib:function(){for(var a=0,c=[];a<b.a.length;a++)c.push(b.a[a].label);return"var labels \x3d "+JSON.stringify(b.a)+";\n\n"},Jb:function(){var a="({\n",c=/%match|%offset|%source/,d,f,g,q,n;for(d=
0;d<b.a.length;d++)if(b.a[d].kind==e.A&&""!=b.a[d].code){a+=' "'+d+'":';a+=" /** @suppress {uselessCode} */ function(PCB){";q="";for(g=f=0;f<b.a[d].code.length;f++,g++)(n=c.exec(b.a[d].code.substr(f,b.a[d].code.length)))&&0==n.index?("%match"==n[0]?q+="PCB.att":"%offset"==n[0]?q+="( PCB.offset - PCB.att.length )":"%source"==n[0]&&(q+="PCB.src"),f+=n[0].length-1,g=q.length):q+=b.a[d].code.charAt(f);a+=" "+q+"\n";a+=" return PCB.att;},\n"}return a+"\n})"},Eb:function(){var a,e=/%[0-9]+|%%/,
d,f,g,q,n,u;a="[";for(g=0;g<b.g.length;g++){u=b.g[g].code;d="function(){\n";d+="var rval;";for(n=q=0;q<u.length;q++,n++)(f=e.exec(u.substr(q,u.length)))&&0==f.index?("%%"==f[0]?d+="rval":(n=parseInt(f[0].substr(1,f[0].length),10),n=b.g[g].h.length-n,0>n?(n=b.a[b.g[g].S],0==b.g[g].h.length?c.error("Default code was used for an empty right-hand side of a production, or a wildcard "+f[0]+" was used explicitly. The faulty left-hand side symbol label is '"+n.label+"'."):c.error("The wildcard "+f[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 '"+n.label+"'."),d+=' "" '):d+=" arguments["+n+"] "),q+=f[0].length-1,n=d.length):d+=u.charAt(q);a+=" "+d+"\nreturn rval;},\n"}return a+"]"},sb:function(){for(var a=-1,e=0;e<b.a.length;e++)if(b.a[e].M==f.ya){a=e;break}-1==a&&c.error("No EOF-symbol defined - This might not be possible (bug!)");return a},tb:function(){for(var a=-1,e=0;e<b.a.length;e++)if(b.a[e].M==f.ERROR){a=e;break}-1==
a&&c.error("No ERROR-symbol defined - This might not be possible (bug!)");return a},wb:function(){return b.sa}};return new l.ab});
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/integrity",["require","./global","./log/log","./enums/SYM"],c):"object"===typeof module&&module.exports?module.exports=c(P):a.ic=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){var c,b=a("./global"),d=a("./enums/SYM");c=a("./log/log");l.Ya=function(){};l.Ya.prototype={Rb:function(){for(var a=0;a<b.a.length;a++)b.a[a].kind==d.I&&0==b.a[a].Y&&c.error('Call to undefined non-terminal "'+b.a[a].label+'"')},Sb:function(){var a=
[],e=[],f,k,m,h;for(f=0;f<b.a.length&&b.a[f].kind!=d.I;f++);if(f!=b.a.length){a.push(f);for(e.push(f);0<a.length;)for(f=a.pop(),k=0;k<b.a[f].w.length;k++)for(m=0;m<b.g[b.a[f].w[k]].h.length;m++)if(b.a[b.g[b.a[f].w[k]].h[m]].kind==d.I){for(h=0;h<e.length&&e[h]!=b.g[b.a[f].w[k]].h[m];h++);h==e.length&&(a.push(b.g[b.a[f].w[k]].h[m]),e.push(b.g[b.a[f].w[k]].h[m]))}for(f=0;f<b.a.length;f++)if(b.a[f].kind==d.I){for(k=0;k<e.length&&e[k]!=f;k++);k==e.length&&c.warn('Unreachable non-terminal "'+b.a[f].label+
'"')}}},mb:function(){for(var a=0;a<b.c.length;a++)0==b.c[a].u.length&&-1==b.c[a].K&&c.error("No lookaheads in state "+a+", watch for endless list definitions")}};return new l.Ya});
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/lexdbg",["require","./global","./io/io","./enums/EDGE"],c):"object"===typeof module&&module.exports?module.exports=c(P):a.kc=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){var c;a("./global");a("./enums/EDGE");c=a("./io/io");l.Za=function(){};l.Za.prototype={Fb:function(a){for(var d,g,e=0;e<a.length;e++){d=e+" \x3d\x3e (";for(var f=g=0;f<a[e].b.length;f++)-1<a[e].b[f]&&(d+=" \x3e"+String.fromCharCode(f)+"\x3c,"+a[e].b[f]+
" ",g++,0==g%5&&(d+="\n "));d+=") "+a[e].accept;c.Ub(d)}}};return new l.Za});function W(){l.classes.Da=function(a,c){"number"===typeof a&&(this.start=a);"number"===typeof c&&(this.end=c)};l.classes.Da.prototype.start=-1;l.classes.Da.prototype.end=-1;return l.classes.Da}"function"===typeof Q&&Q.m?Q("lib/jscc/classes/Param",W):"object"===typeof module&&module.exports?module.exports=W():W();
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/regex","require ./global ./log/log ./classes/Param ./classes/Nfa ./enums/EDGE".split(" "),c):"object"===typeof module&&module.exports?module.exports=c(P):a.rc=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){var c,b,d,g=a("./global"),e=a("./classes/Param"),f=a("./classes/Nfa"),k=a("./enums/EDGE");d=a("./log/log");var m=function(a,d,m){function q(a){this.src=a}function n(){this.P=[{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 u(a){this.ma=a}function t(){throw t;
}function x(a,b){for(var c=0;c<B[a].length;c+=2)if(B[a][c]===b)return B[a][c+1];return null}u.prototype=Object.create(Error.prototype);u.prototype.constructor=u;u.prototype.ma=null;u.prototype.valueOf=function(){return this.ma};var A=function(){function a(b){return b.G}var b={};return function(c,e){try{return(b[e]||a)(c)}catch(d){if(d instanceof u)return d.valueOf();if(d==t)return t;throw d;}}}();n.prototype.P=[];n.prototype.U=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.P.length)throw this.state=null,Error("Invalid value for DfaLex.state at chr "+a+" and pos "+b);var c=this.P[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.P[this.state].accept;this.state=c;-1!==a&&(this.match=a,this.U=b)}};var z=[[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]],B=[[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],[],[],[]],G=[[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],[],[],[]],E=[-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],v=[{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]}],D=function(){var a=[function(a){return a},function(a){var d;d=new e;g.f.value[c].s=a.start;b=a.end;return d},function(a,b,c){b=new e(g.f.create(),g.f.create());g.f.value[b.start].s=c.start;g.f.value[b.start].D=a.start;g.f.value[c.end].s=b.end;g.f.value[a.end].s=b.end;return b},function(a){return a},function(a,
b){var c=g.f.value[b.end].weight;g.f.value[b.end]=new f(g.f.value[a.start]);g.f.value[b.end].weight=c;g.f.value[a.start].J=k.za;b.end=a.end;return b},function(a){return a},function(a,b){a=new e(g.f.create(),g.f.create());g.f.value[a.start].s=b.start;g.f.value[b.end].s=a.end;g.f.value[a.start].D=a.end;g.f.value[b.end].D=b.start;return a},function(a,b){a=new e(g.f.create(),g.f.create());g.f.value[a.start].s=b.start;g.f.value[b.end].s=a.end;g.f.value[b.end].D=b.start;return a},function(a,b){a=new e(g.f.create(),
g.f.create());g.f.value[a.start].s=b.start;g.f.value[a.start].D=a.end;g.f.value[b.end].s=a.end;return a},function(a){return a},function(a){var b;b=new e;b.start=g.f.create();b.end=g.f.value[b.start].s=g.f.create();g.f.value[b.start].J=k.ca;g.f.value[b.start].C.set(a.charCodeAt(0),!0);return b},function(a){return a},function(a,b){return b},function(a,b){var c=!1,d=0,f;a=new e;a.start=g.f.create();a.end=g.f.value[a.start].s=g.f.create();g.f.value[a.start].J=k.ca;if("^"==b.charAt(d)){c=!0;for(f=g.ea;f<
g.Z;f++)g.f.value[a.start].C.set(f,!0);d++}for(;d<b.length;d++)if("-"==b.charAt(d+1)&&d+2<b.length)for(d++,f=b.charCodeAt(d-1);f<b.charCodeAt(d+1);f++)g.f.value[a.start].C.set(f,!c);else g.f.value[a.start].C.set(b.charCodeAt(d),!c);return a},function(){var a;a=new e;a.start=g.f.create();a.end=g.f.value[a.start].s=g.f.create();g.f.value[a.start].J=k.ca;for(var b=g.ea;b<g.Z;b++)g.f.value[a.start].C.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",Zb:"a"}[a.substr(1)]||a.substr(1)},function(a){return a}];return function(b,c){try{return a[b].apply(null,c)}catch(e){if(e instanceof u)return e.valueOf();throw e;}}}();q.prototype.b=1;q.prototype.offset=0;q.prototype.R=0;q.prototype.src="";q.prototype.G="";q.prototype.H=null;q.prototype.j=null;q.prototype.aa=function(){for(var b,c,e,f=new n,k=!0;k;){f.U=0;c=this.offset+1;do{c--;f.state=0;f.match=null;b=c;if(this.src.length<=b)return this.H=a;do e=this.src.charCodeAt(c),
f.exec(e,c),null!==f.state&&this.na(e),c++;while(null!==f.state)}while(-1<d&&f.match===d);if(null!==f.match){this.G=this.src.slice(b,f.U);this.offset=f.U;b=A(this,f.match);null!==f.state&&this.na(e);if(b===t)continue;this.G=b}else this.G="";k=!1}return this.H=f.match};q.prototype.na=function(a){10===a&&this.b++};return function(b,c,e){var d=[0],f=[0],k=0,F,g=0,n=new q(b);c=c||[];e=e||[];for(n.aa();;){n.j=x(d[0],n.H);null===n.j&&0<=E[d[0]]&&(n.j=-E[d[0]]);if(null===n.j){if(0===n.R)for(k++,c.unshift(n.offset-
n.G.length),e.unshift([]),g=0;g<B[d[0]].length;g+=2)e[0].push(v[B[d[0]][g]]);for(;1<d.length&&null===n.j;)d.shift(),f.shift(),n.j=x(d[0],n.H),n.j===m&&(d.unshift(n.j),f.unshift(""));if(1<d.length&&null!==n.j)for(;n.H!==a;){n.j=B[d[0]][g+1];if(null!=n.j)break;for(;null!=n.aa();)n.offset++}if(null===n.j||n.H===a)break;n.R=3}if(0<n.j)d.unshift(n.j),f.unshift(n.G),n.aa(),0<n.R&&n.R--;else{F=-n.j;b=D(F,f,n);d.splice(0,z[F][1]);f.splice(0,z[F][1]);var t;a:{t=d[0];for(var u=0;u<G[t].length;u+=2)if(G[t][u]===
z[F][0]){t=G[t][u+1];break a}t=null}n.j=t;if(0===F)break;d.unshift(n.j);f.unshift(b)}}return k}}(22,-1,1);return function(a,e,f,q){var n,u=[],t=[],x;if(""!=a)if(q=q||0,c=g.f.create(),0==(x=m(a,u,t))){if(f)for(f=0;f<g.f.value.length;f++)if(g.f.value[f].J==k.ca)for(n=g.ea;n<g.Z;n++)g.f.value[f].C.get(n)&&(g.f.value[f].C.set(String.fromCharCode(n).toUpperCase().charCodeAt(0),!0),g.f.value[f].C.set(String.fromCharCode(n).toLowerCase().charCodeAt(0),!0));g.f.value[b].accept=e;g.f.value[b].weight=g.bb++;
if(0<c){for(f=0;-1!=g.f.value[f].D;)f=g.f.value[f].D;g.f.value[f].D=c}}else for(f=0;f<x;f++){e="";for(n=0;n<u[f];n++)e+=" ";d.error("Regular expression:\n\t"+a+"\n\t"+e+"^ expecting "+t[f].join()+" on line "+q)}}});
(function(a,c){"function"===typeof Q&&Q.m?Q("lib/jscc/parse","require ./global ./regex ./tabgen ./log/log ./classes/Production ./enums/ASSOC ./enums/SYM ./enums/SPECIAL".split(" "),c):"object"===typeof module&&module.exports?module.exports=c(P):a.pc=c(function(b){return a["jscc"+b.split("/").pop()]})})(this,function(a){function c(a,c){b.error("line "+a+": "+c)}var b,d=a("./global"),g=a("./regex"),e=a("./tabgen"),f=a("./classes/Production"),k=a("./enums/ASSOC"),m=a("./enums/SYM"),h=a("./enums/SPECIAL");
b=a("./log/log");var w,r,q=function(a,b,q){function x(a){this.src=a}function A(){this.P=[{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]]]]]]]]],