jashkenas--coffeescript/lib/parser.js

699 lines
132 KiB
JavaScript
Raw Normal View History

2010-02-11 04:24:05 +00:00
/* Jison generated parser */
var parser = (function(){
var parser = {trace: function trace() { },
yy: {},
2010-11-09 05:26:31 +00:00
symbols_: {"error":2,"Root":3,"TERMINATOR":4,"Body":5,"Block":6,"Line":7,"Expression":8,"Statement":9,"Return":10,"Throw":11,"BREAK":12,"CONTINUE":13,"DEBUGGER":14,"Comment":15,"Value":16,"Invocation":17,"Code":18,"Operation":19,"Assign":20,"If":21,"Try":22,"While":23,"For":24,"Switch":25,"Class":26,"INDENT":27,"OUTDENT":28,"Identifier":29,"IDENTIFIER":30,"AlphaNumeric":31,"NUMBER":32,"STRING":33,"Literal":34,"JS":35,"REGEX":36,"BOOL":37,"Assignable":38,"=":39,"AssignObj":40,"ObjAssignable":41,":":42,"ThisProperty":43,"Parenthetical":44,"RETURN":45,"HERECOMMENT":46,"PARAM_START":47,"ParamList":48,"PARAM_END":49,"FuncGlyph":50,"->":51,"=>":52,"OptComma":53,",":54,"Param":55,"ParamVar":56,"...":57,"Array":58,"Object":59,"Splat":60,"SimpleAssignable":61,"Accessor":62,"This":63,".":64,"?.":65,"::":66,"Index":67,"INDEX_START":68,"INDEX_END":69,"INDEX_SOAK":70,"INDEX_PROTO":71,"{":72,"AssignList":73,"}":74,"CLASS":75,"EXTENDS":76,"ClassBody":77,"ClassAssign":78,"OptFuncExist":79,"Arguments":80,"SUPER":81,"FUNC_EXIST":82,"CALL_START":83,"CALL_END":84,"ArgList":85,"THIS":86,"@":87,"[":88,"]":89,"Arg":90,"SimpleArgs":91,"TRY":92,"Catch":93,"FINALLY":94,"CATCH":95,"THROW":96,"(":97,")":98,"WhileSource":99,"WHILE":100,"WHEN":101,"UNTIL":102,"Loop":103,"LOOP":104,"ForBody":105,"ForValue":106,"ForIn":107,"FORIN":108,"BY":109,"ForOf":110,"FOROF":111,"ForTo":112,"TO":113,"FOR":114,"ALL":115,"FROM":116,"SWITCH":117,"Whens":118,"ELSE":119,"When":120,"LEADING_WHEN":121,"IfBlock":122,"IF":123,"UNLESS":124,"POST_IF":125,"POST_UNLESS":126,"UNARY":127,"-":128,"+":129,"--":130,"++":131,"?":132,"MATH":133,"SHIFT":134,"COMPARE":135,"LOGIC":136,"RELATION":137,"COMPOUND_ASSIGN":138,"$accept":0,"$end":1},
terminals_: {"2":"error","4":"TERMINATOR","12":"BREAK","13":"CONTINUE","14":"DEBUGGER","27":"INDENT","28":"OUTDENT","30":"IDENTIFIER","32":"NUMBER","33":"STRING","35":"JS","36":"REGEX","37":"BOOL","39":"=","42":":","45":"RETURN","46":"HERECOMMENT","47":"PARAM_START","49":"PARAM_END","51":"->","52":"=>","54":",","57":"...","64":".","65":"?.","66":"::","68":"INDEX_START","69":"INDEX_END","70":"INDEX_SOAK","71":"INDEX_PROTO","72":"{","74":"}","75":"CLASS","76":"EXTENDS","81":"SUPER","82":"FUNC_EXIST","83":"CALL_START","84":"CALL_END","86":"THIS","87":"@","88":"[","89":"]","92":"TRY","94":"FINALLY","95":"CATCH","96":"THROW","97":"(","98":")","100":"WHILE","101":"WHEN","102":"UNTIL","104":"LOOP","108":"FORIN","109":"BY","111":"FOROF","113":"TO","114":"FOR","115":"ALL","116":"FROM","117":"SWITCH","119":"ELSE","121":"LEADING_WHEN","123":"IF","124":"UNLESS","125":"POST_IF","126":"POST_UNLESS","127":"UNARY","128":"-","129":"+","130":"--","131":"++","132":"?","133":"MATH","134":"SHIFT","135":"COMPARE","136":"LOGIC","137":"RELATION","138":"COMPOUND_ASSIGN"},
productions_: [0,[3,0],[3,1],[3,1],[3,2],[5,1],[5,3],[5,2],[7,1],[7,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[6,3],[6,2],[6,2],[29,1],[31,1],[31,1],[34,1],[34,1],[34,1],[34,1],[20,3],[20,5],[40,1],[40,3],[40,5],[40,1],[40,1],[41,1],[41,1],[41,1],[10,2],[10,1],[15,1],[18,5],[18,2],[50,1],[50,1],[53,0],[53,1],[48,0],[48,1],[48,3],[55,1],[55,2],[55,3],[56,1],[56,1],[56,1],[56,1],[60,2],[61,1],[61,2],[61,2],[61,1],[38,1],[38,1],[38,1],[16,1],[16,1],[16,1],[16,1],[62,2],[62,2],[62,2],[62,1],[62,1],[67,3],[67,2],[67,2],[59,4],[73,0],[73,1],[73,3],[73,4],[73,6],[26,2],[26,4],[26,5],[26,7],[26,4],[26,1],[26,3],[26,6],[78,1],[78,3],[78,5],[77,0],[77,1],[77,3],[77,3],[17,3],[17,3],[17,1],[17,2],[79,0],[79,1],[80,2],[80,4],[63,1],[63,1],[43,2],[58,2],[58,4],[85,1],[85,3],[85,4],[85,4],[85,6],[90,1],[90,1],[91,1],[91,3],[22,2],[22,3],[22,4],[22,5],[93,3],[11,2],[44,3],[99,2],[99,4],[99,2],[99,4],[23,2],[23,2],[23,2],[23,1],[103,2],[103,2],[24,2],[24,2],[24,2],[106,1],[106,1],[106,1],[107,2],[107,4],[107,4],[107,6],[110,2],[110,4],[112,2],[112,4],[112,4],[112,6],[105,3],[105,5],[105,3],[105,5],[105,4],[105,6],[105,5],[25,5],[25,7],[25,4],[25,6],[118,1],[118,2],[120,3],[120,4],[122,3],[122,3],[122,5],[122,3],[21,1],[21,3],[21,3],[21,3],[21,3],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,3],[19,3],[19,3],[19,3],[19,3],[19,3],[19,3],[19,3],[19,5],[19,3]],
2010-02-11 04:24:05 +00:00
performAction: function anonymous(yytext,yyleng,yylineno,yy) {
var $$ = arguments[5],$0=arguments[5].length;
switch(arguments[4]) {
case 1:return this.$ = new yy.Expressions;
2010-02-11 04:24:05 +00:00
break;
case 2:return this.$ = new yy.Expressions;
2010-02-11 04:24:05 +00:00
break;
case 3:return this.$ = $$[$0-1+1-1];
break;
case 4:return this.$ = $$[$0-2+1-1];
break;
2010-09-21 07:50:32 +00:00
case 5:this.$ = yy.Expressions.wrap([$$[$0-1+1-1]]);
2010-02-11 04:24:05 +00:00
break;
case 6:this.$ = $$[$0-3+1-1].push($$[$0-3+3-1]);
break;
case 7:this.$ = $$[$0-2+1-1];
break;
case 8:this.$ = $$[$0-1+1-1];
break;
case 9:this.$ = $$[$0-1+1-1];
break;
case 10:this.$ = $$[$0-1+1-1];
break;
case 11:this.$ = $$[$0-1+1-1];
break;
case 12:this.$ = new yy.Literal($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
case 13:this.$ = new yy.Literal($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
case 14:this.$ = new yy.Literal($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
case 15:this.$ = $$[$0-1+1-1];
break;
case 16:this.$ = $$[$0-1+1-1];
break;
case 17:this.$ = $$[$0-1+1-1];
break;
case 18:this.$ = $$[$0-1+1-1];
break;
case 19:this.$ = $$[$0-1+1-1];
break;
case 20:this.$ = $$[$0-1+1-1];
break;
case 21:this.$ = $$[$0-1+1-1];
break;
case 22:this.$ = $$[$0-1+1-1];
break;
case 23:this.$ = $$[$0-1+1-1];
break;
case 24:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
case 25:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
case 26:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 27:this.$ = $$[$0-3+2-1];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 28:this.$ = new yy.Expressions;
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 29:this.$ = yy.Expressions.wrap([$$[$0-2+2-1]]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 30:this.$ = new yy.Literal($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
case 31:this.$ = new yy.Literal($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
2010-10-25 00:34:50 +00:00
case 32:this.$ = new yy.Literal($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 33:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 34:this.$ = new yy.Literal($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
case 35:this.$ = new yy.Literal($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 36:this.$ = new yy.Literal($$[$0-1+1-1] === 'undefined' ? 'void 0' : $$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 37:this.$ = new yy.Assign($$[$0-3+1-1], $$[$0-3+3-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 38:this.$ = new yy.Assign($$[$0-5+1-1], $$[$0-5+4-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 39:this.$ = new yy.Value($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 40:this.$ = new yy.Assign(new yy.Value($$[$0-3+1-1]), $$[$0-3+3-1], 'object');
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 41:this.$ = new yy.Assign(new yy.Value($$[$0-5+1-1]), $$[$0-5+4-1], 'object');
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 42:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
case 43:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-10-25 00:34:50 +00:00
case 44:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-10-24 05:05:31 +00:00
case 45:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-10-24 05:05:31 +00:00
case 46:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 47:this.$ = new yy.Return($$[$0-2+2-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 48:this.$ = new yy.Return;
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 49:this.$ = new yy.Comment($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 50:this.$ = new yy.Code($$[$0-5+2-1], $$[$0-5+5-1], $$[$0-5+4-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 51:this.$ = new yy.Code([], $$[$0-2+2-1], $$[$0-2+1-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 52:this.$ = 'func';
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 53:this.$ = 'boundfunc';
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 54:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
case 55:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 56:this.$ = [];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 57:this.$ = [$$[$0-1+1-1]];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 58:this.$ = $$[$0-3+1-1].concat($$[$0-3+3-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 59:this.$ = new yy.Param($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 60:this.$ = new yy.Param($$[$0-2+1-1], null, true);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 61:this.$ = new yy.Param($$[$0-3+1-1], $$[$0-3+3-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 62:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-10-26 10:08:01 +00:00
case 63:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-10-26 10:08:01 +00:00
case 64:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
case 65:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 66:this.$ = new yy.Splat($$[$0-2+1-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 67:this.$ = new yy.Value($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 68:this.$ = $$[$0-2+1-1].push($$[$0-2+2-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 69:this.$ = new yy.Value($$[$0-2+1-1], [$$[$0-2+2-1]]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 70:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
case 71:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 72:this.$ = new yy.Value($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
2010-10-25 00:34:50 +00:00
case 73:this.$ = new yy.Value($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 74:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 75:this.$ = new yy.Value($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
case 76:this.$ = new yy.Value($$[$0-1+1-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 77:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 78:this.$ = new yy.Accessor($$[$0-2+2-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 79:this.$ = new yy.Accessor($$[$0-2+2-1], 'soak');
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 80:this.$ = new yy.Accessor($$[$0-2+2-1], 'proto');
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 81:this.$ = new yy.Accessor(new yy.Literal('prototype'));
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 82:this.$ = $$[$0-1+1-1];
2010-10-26 04:09:46 +00:00
break;
2010-11-09 05:26:31 +00:00
case 83:this.$ = new yy.Index($$[$0-3+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 84:this.$ = yy.extend($$[$0-2+2-1], {
2010-10-25 13:31:52 +00:00
soak: true
});
break;
2010-11-09 05:26:31 +00:00
case 85:this.$ = yy.extend($$[$0-2+2-1], {
proto: true
});
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 86:this.$ = new yy.Obj($$[$0-4+2-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 87:this.$ = [];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 88:this.$ = [$$[$0-1+1-1]];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 89:this.$ = $$[$0-3+1-1].concat($$[$0-3+3-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 90:this.$ = $$[$0-4+1-1].concat($$[$0-4+4-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 91:this.$ = $$[$0-6+1-1].concat($$[$0-6+4-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 92:this.$ = new yy.Class($$[$0-2+2-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 93:this.$ = new yy.Class($$[$0-4+2-1], $$[$0-4+4-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 94:this.$ = new yy.Class($$[$0-5+2-1], null, $$[$0-5+4-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 95:this.$ = new yy.Class($$[$0-7+2-1], $$[$0-7+4-1], $$[$0-7+6-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 96:this.$ = new yy.Class(null, null, $$[$0-4+3-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 97:this.$ = new yy.Class(null, null, new yy.Expressions);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 98:this.$ = new yy.Class(null, $$[$0-3+3-1], new yy.Expressions);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 99:this.$ = new yy.Class(null, $$[$0-6+3-1], $$[$0-6+5-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 100:this.$ = $$[$0-1+1-1];
2010-06-26 17:36:31 +00:00
break;
2010-11-09 05:26:31 +00:00
case 101:this.$ = new yy.Assign(new yy.Value($$[$0-3+1-1]), $$[$0-3+3-1], 'this');
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 102:this.$ = new yy.Assign(new yy.Value($$[$0-5+1-1]), $$[$0-5+4-1], 'this');
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 103:this.$ = [];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 104:this.$ = [$$[$0-1+1-1]];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 105:this.$ = $$[$0-3+1-1].concat($$[$0-3+3-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 106:this.$ = $$[$0-3+2-1];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 107:this.$ = new yy.Call($$[$0-3+1-1], $$[$0-3+3-1], $$[$0-3+2-1]);
2010-10-23 20:35:35 +00:00
break;
2010-11-09 05:26:31 +00:00
case 108:this.$ = new yy.Call($$[$0-3+1-1], $$[$0-3+3-1], $$[$0-3+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 109:this.$ = new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))]);
break;
2010-11-09 05:26:31 +00:00
case 110:this.$ = new yy.Call('super', $$[$0-2+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 111:this.$ = false;
break;
2010-11-09 05:26:31 +00:00
case 112:this.$ = true;
break;
2010-11-09 05:26:31 +00:00
case 113:this.$ = [];
break;
2010-11-09 05:26:31 +00:00
case 114:this.$ = $$[$0-4+2-1];
2010-03-28 17:06:16 +00:00
break;
2010-11-09 05:26:31 +00:00
case 115:this.$ = new yy.Value(new yy.Literal('this'));
2010-03-28 17:06:16 +00:00
break;
2010-11-09 05:26:31 +00:00
case 116:this.$ = new yy.Value(new yy.Literal('this'));
2010-03-28 17:06:16 +00:00
break;
2010-11-09 05:26:31 +00:00
case 117:this.$ = new yy.Value(new yy.Literal('this'), [new yy.Accessor($$[$0-2+2-1])], 'this');
break;
2010-11-09 05:26:31 +00:00
case 118:this.$ = new yy.Arr([]);
break;
2010-11-09 05:26:31 +00:00
case 119:this.$ = new yy.Arr($$[$0-4+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 120:this.$ = [$$[$0-1+1-1]];
break;
2010-11-09 05:26:31 +00:00
case 121:this.$ = $$[$0-3+1-1].concat($$[$0-3+3-1]);
break;
2010-11-09 05:26:31 +00:00
case 122:this.$ = $$[$0-4+1-1].concat($$[$0-4+4-1]);
break;
2010-11-09 05:26:31 +00:00
case 123:this.$ = $$[$0-4+2-1];
break;
2010-11-09 05:26:31 +00:00
case 124:this.$ = $$[$0-6+1-1].concat($$[$0-6+4-1]);
break;
2010-11-09 05:26:31 +00:00
case 125:this.$ = $$[$0-1+1-1];
break;
2010-11-09 05:26:31 +00:00
case 126:this.$ = $$[$0-1+1-1];
break;
2010-11-09 05:26:31 +00:00
case 127:this.$ = $$[$0-1+1-1];
break;
2010-11-09 05:26:31 +00:00
case 128:this.$ = [].concat($$[$0-3+1-1], $$[$0-3+3-1]);
break;
2010-11-09 05:26:31 +00:00
case 129:this.$ = new yy.Try($$[$0-2+2-1]);
2010-08-18 01:31:32 +00:00
break;
2010-11-09 05:26:31 +00:00
case 130:this.$ = new yy.Try($$[$0-3+2-1], $$[$0-3+3-1][0], $$[$0-3+3-1][1]);
break;
2010-11-09 05:26:31 +00:00
case 131:this.$ = new yy.Try($$[$0-4+2-1], null, null, $$[$0-4+4-1]);
break;
2010-11-09 05:26:31 +00:00
case 132:this.$ = new yy.Try($$[$0-5+2-1], $$[$0-5+3-1][0], $$[$0-5+3-1][1], $$[$0-5+5-1]);
break;
2010-11-09 05:26:31 +00:00
case 133:this.$ = [$$[$0-3+2-1], $$[$0-3+3-1]];
break;
2010-11-09 05:26:31 +00:00
case 134:this.$ = new yy.Throw($$[$0-2+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 135:this.$ = new yy.Parens($$[$0-3+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 136:this.$ = new yy.While($$[$0-2+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 137:this.$ = new yy.While($$[$0-4+2-1], {
guard: $$[$0-4+4-1]
});
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 138:this.$ = new yy.While($$[$0-2+2-1], {
invert: true
});
break;
2010-11-09 05:26:31 +00:00
case 139:this.$ = new yy.While($$[$0-4+2-1], {
invert: true,
guard: $$[$0-4+4-1]
});
break;
2010-11-09 05:26:31 +00:00
case 140:this.$ = $$[$0-2+1-1].addBody($$[$0-2+2-1]);
2010-10-23 20:35:35 +00:00
break;
2010-11-09 05:26:31 +00:00
case 141:this.$ = $$[$0-2+2-1].addBody(yy.Expressions.wrap([$$[$0-2+1-1]]));
break;
2010-11-09 05:26:31 +00:00
case 142:this.$ = $$[$0-2+2-1].addBody(yy.Expressions.wrap([$$[$0-2+1-1]]));
break;
2010-11-09 05:26:31 +00:00
case 143:this.$ = $$[$0-1+1-1];
break;
2010-11-09 05:26:31 +00:00
case 144:this.$ = new yy.While(new yy.Literal('true')).addBody($$[$0-2+2-1]);
2010-08-18 01:31:32 +00:00
break;
2010-11-09 05:26:31 +00:00
case 145:this.$ = new yy.While(new yy.Literal('true')).addBody(yy.Expressions.wrap([$$[$0-2+2-1]]));
break;
2010-11-09 05:26:31 +00:00
case 146:this.$ = new yy.For($$[$0-2+1-1], $$[$0-2+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 147:this.$ = new yy.For($$[$0-2+1-1], $$[$0-2+2-1]);
2010-10-04 20:53:32 +00:00
break;
2010-11-09 05:26:31 +00:00
case 148:this.$ = new yy.For($$[$0-2+2-1], $$[$0-2+1-1]);
break;
2010-11-09 05:26:31 +00:00
case 149:this.$ = $$[$0-1+1-1];
break;
2010-11-09 05:26:31 +00:00
case 150:this.$ = new yy.Value($$[$0-1+1-1]);
break;
2010-11-09 05:26:31 +00:00
case 151:this.$ = new yy.Value($$[$0-1+1-1]);
break;
2010-11-09 05:26:31 +00:00
case 152:this.$ = {
source: $$[$0-2+2-1]
};
break;
2010-11-09 05:26:31 +00:00
case 153:this.$ = {
source: $$[$0-4+2-1],
guard: $$[$0-4+4-1]
};
2010-10-04 20:53:32 +00:00
break;
2010-11-09 05:26:31 +00:00
case 154:this.$ = {
source: $$[$0-4+2-1],
step: $$[$0-4+4-1]
};
break;
2010-11-09 05:26:31 +00:00
case 155:this.$ = {
source: $$[$0-6+2-1],
step: $$[$0-6+4-1],
guard: $$[$0-6+6-1]
};
break;
2010-11-09 05:26:31 +00:00
case 156:this.$ = {
object: true,
source: $$[$0-2+2-1]
};
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 157:this.$ = {
object: true,
source: $$[$0-4+2-1],
guard: $$[$0-4+4-1]
};
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 158:this.$ = {
to: $$[$0-2+2-1]
};
break;
2010-11-09 05:26:31 +00:00
case 159:this.$ = {
to: $$[$0-4+2-1],
guard: $$[$0-4+4-1]
};
break;
2010-11-09 05:26:31 +00:00
case 160:this.$ = {
to: $$[$0-4+2-1],
step: $$[$0-4+4-1]
};
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 161:this.$ = {
to: $$[$0-6+2-1],
step: $$[$0-6+4-1],
guard: $$[$0-6+6-1]
};
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 162:this.$ = yy.extend($$[$0-3+3-1], {
name: $$[$0-3+2-1]
});
break;
2010-11-09 05:26:31 +00:00
case 163:this.$ = yy.extend($$[$0-5+5-1], {
name: $$[$0-5+2-1],
index: $$[$0-5+4-1]
});
break;
2010-11-09 05:26:31 +00:00
case 164:this.$ = yy.extend($$[$0-3+3-1], {
index: $$[$0-3+2-1]
});
break;
2010-11-09 05:26:31 +00:00
case 165:this.$ = yy.extend($$[$0-5+5-1], {
index: $$[$0-5+2-1],
name: $$[$0-5+4-1]
});
break;
2010-11-09 05:26:31 +00:00
case 166:this.$ = yy.extend($$[$0-4+4-1], {
raw: true,
index: $$[$0-4+3-1]
});
break;
2010-11-09 05:26:31 +00:00
case 167:this.$ = yy.extend($$[$0-6+6-1], {
raw: true,
index: $$[$0-6+3-1],
name: $$[$0-6+5-1]
});
break;
2010-11-09 05:26:31 +00:00
case 168:this.$ = yy.extend($$[$0-5+5-1], {
index: $$[$0-5+2-1],
from: $$[$0-5+4-1]
});
break;
2010-11-09 05:26:31 +00:00
case 169:this.$ = new yy.Switch($$[$0-5+2-1], $$[$0-5+4-1]);
break;
2010-11-09 05:26:31 +00:00
case 170:this.$ = new yy.Switch($$[$0-7+2-1], $$[$0-7+4-1], $$[$0-7+6-1]);
break;
2010-11-09 05:26:31 +00:00
case 171:this.$ = new yy.Switch(null, $$[$0-4+3-1]);
2010-05-11 02:57:51 +00:00
break;
2010-11-09 05:26:31 +00:00
case 172:this.$ = new yy.Switch(null, $$[$0-6+3-1], $$[$0-6+5-1]);
2010-05-11 02:57:51 +00:00
break;
2010-11-09 05:26:31 +00:00
case 173:this.$ = $$[$0-1+1-1];
break;
2010-11-09 05:26:31 +00:00
case 174:this.$ = $$[$0-2+1-1].concat($$[$0-2+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 175:this.$ = [[$$[$0-3+2-1], $$[$0-3+3-1]]];
2010-04-05 14:26:23 +00:00
break;
2010-11-09 05:26:31 +00:00
case 176:this.$ = [[$$[$0-4+2-1], $$[$0-4+3-1]]];
break;
2010-11-09 05:26:31 +00:00
case 177:this.$ = new yy.If($$[$0-3+2-1], $$[$0-3+3-1]);
break;
2010-11-09 05:26:31 +00:00
case 178:this.$ = new yy.If($$[$0-3+2-1], $$[$0-3+3-1], {
2010-04-27 23:35:15 +00:00
invert: true
});
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 179:this.$ = $$[$0-5+1-1].addElse(new yy.If($$[$0-5+4-1], $$[$0-5+5-1]));
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 180:this.$ = $$[$0-3+1-1].addElse($$[$0-3+3-1]);
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 181:this.$ = $$[$0-1+1-1];
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 182:this.$ = new yy.If($$[$0-3+3-1], yy.Expressions.wrap([$$[$0-3+1-1]]), {
statement: true
});
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 183:this.$ = new yy.If($$[$0-3+3-1], yy.Expressions.wrap([$$[$0-3+1-1]]), {
2010-04-27 23:35:15 +00:00
statement: true
});
break;
2010-11-09 05:26:31 +00:00
case 184:this.$ = new yy.If($$[$0-3+3-1], yy.Expressions.wrap([$$[$0-3+1-1]]), {
2010-04-05 14:26:23 +00:00
statement: true,
invert: true
});
break;
2010-11-09 05:26:31 +00:00
case 185:this.$ = new yy.If($$[$0-3+3-1], yy.Expressions.wrap([$$[$0-3+1-1]]), {
statement: true,
invert: true
});
2010-02-11 04:24:05 +00:00
break;
2010-11-09 05:26:31 +00:00
case 186:this.$ = new yy.Op($$[$0-2+1-1], $$[$0-2+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 187:this.$ = new yy.Op('-', $$[$0-2+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 188:this.$ = new yy.Op('+', $$[$0-2+2-1]);
2010-10-11 08:05:50 +00:00
break;
2010-11-09 05:26:31 +00:00
case 189:this.$ = new yy.Op('--', $$[$0-2+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 190:this.$ = new yy.Op('++', $$[$0-2+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 191:this.$ = new yy.Op('--', $$[$0-2+1-1], null, true);
break;
2010-11-09 05:26:31 +00:00
case 192:this.$ = new yy.Op('++', $$[$0-2+1-1], null, true);
break;
2010-11-09 05:26:31 +00:00
case 193:this.$ = new yy.Existence($$[$0-2+1-1]);
break;
2010-11-09 05:26:31 +00:00
case 194:this.$ = new yy.Op('+', $$[$0-3+1-1], $$[$0-3+3-1]);
break;
2010-11-09 05:26:31 +00:00
case 195:this.$ = new yy.Op('-', $$[$0-3+1-1], $$[$0-3+3-1]);
break;
2010-11-09 05:26:31 +00:00
case 196:this.$ = new yy.Op($$[$0-3+2-1], $$[$0-3+1-1], $$[$0-3+3-1]);
break;
2010-11-09 05:26:31 +00:00
case 197:this.$ = new yy.Op($$[$0-3+2-1], $$[$0-3+1-1], $$[$0-3+3-1]);
break;
2010-11-09 05:26:31 +00:00
case 198:this.$ = new yy.Op($$[$0-3+2-1], $$[$0-3+1-1], $$[$0-3+3-1]);
break;
2010-11-09 05:26:31 +00:00
case 199:this.$ = new yy.Op($$[$0-3+2-1], $$[$0-3+1-1], $$[$0-3+3-1]);
break;
2010-11-09 05:26:31 +00:00
case 200:this.$ = (function () {
if ($$[$0-3+2-1].charAt(0) === '!') {
return new yy.Op($$[$0-3+2-1].slice(1), $$[$0-3+1-1], $$[$0-3+3-1]).invert();
} else {
return new yy.Op($$[$0-3+2-1], $$[$0-3+1-1], $$[$0-3+3-1]);
}
}());
2010-08-18 01:31:32 +00:00
break;
2010-11-09 05:26:31 +00:00
case 201:this.$ = new yy.Assign($$[$0-3+1-1], $$[$0-3+3-1], $$[$0-3+2-1]);
break;
case 202:this.$ = new yy.Assign($$[$0-5+1-1], $$[$0-5+4-1], $$[$0-5+2-1]);
break;
2010-11-09 05:26:31 +00:00
case 203:this.$ = new yy.Extends($$[$0-3+1-1], $$[$0-3+3-1]);
2010-08-21 12:56:25 +00:00
break;
}
},
2010-11-09 05:26:31 +00:00
table: [{"1":[2,1],"3":1,"4":[1,2],"5":3,"6":4,"7":5,"8":7,"9":8,"10":20,"11":21,"12":[1,22],"13":[1,23],"14":[1,24],"15":25,"16":9,"17":10,"18":11,"19":12,"20":13,"21":14,"22":15,"23":16,"24":17,"25":18,"26":19,"27":[1,6],"29":60,"30":[1,72],"31":51,"32":[1,70],"33":[1,71],"34":27,"35":[1,52],"36":[1,53],"37":[1,54],"38":26,"43":61,"44":28,"45":[1,46],"46":[1,48],"47":[1,31],"50":32,"51":[1,58],"52":[1,59],"58":49,"59":50,"61":38,"63":29,"72":[1,69],"75":[1,45],"81":[1,30],"86":[1,56],"87":[1,57],"88":[1,68],"92":[1,40],"96":[1,47],"97":[1,55],"99":41,"100":[1,64],"102":[1,65],"103":42,"104":[1,66],"105":43,"114":[1,67],"117":[1,44],"122":39,"123":[1,62],"124":[1,63],"127":[1,33],"128":[1,34],"129":[1,35],"130":[1,36],"131":[1,37]},{"1":[3]},{"1":[2,2],"15":73,"46":[1,48]},{"1":[2,3],"4":[1,74]},{"4":[1,75]},{"1":[2,5],"4":[2,5],"28":[2,5]},{"5":76,"7":5,"8":7,"9":8,"10":20,"11":21,"12":[1,22],"13":[1,23],"14":[1,24],"15":25,"16":9,"17":10,"18":11,"19":12,"20":13,"21":14,"22":15,"23":16,"24":17,"25":18,"26":19,"28":[1,77],"29":60,"30":[1,72],"31":51,"32":[1,70],"33":[1,71],"34":27,"35":[1,52],"36":[1,53],"37":[1,54],"38":26,"43":61,"44":28,"45":[1,46],"46":[1,48],"47":[1,31],"50":32,"51":[1,58],"52":[1,59],"58":49,"59":50,"61":38,"63":29,"72":[1,69],"75":[1,45],"81":[1,30],"86":[1,56],"87":[1,57],"88":[1,68],"92":[1,40],"96":[1,47],"97":[1,55],"99":41,"100":[1,64],"102":[1,65],"103":42,"104":[1,66],"105":43,"114":[1,67],"117":[1,44],"122":39,"123":[1,62],"124":[1,63],"127":[1,33],"128":[1,34],"129":[1,35],"130":[1,36],"131":[1,37]},{"1":[2,8],"4":[2,8],"28":[2,8],"99":88,"100":[1,64],"102":[1,65],"105":89,"114":[1,67],"125":[1,86],"126":[1,87],"128":[1,80],"129":[1,79],"132":[1,78],"133":[1,81],"134":[1,82],"135":[1,83],"136":[1,84],"137":[1,85]},{"1":[2,9],"4":[2,9],"28":[2,9],"99":92,"100":[1,64],"102":[1,65],"105":93,"114":[1,67],"125":[1,90],"126":[1,91]},{"1":[2,16],"4":[2,16],"27":[2,16],"28":[2,16],"49":[2,16],"54":[2,16],"57":[2,16],"62":95,"64":[1,97],"65":[1,98],"66":[1,99],"67":100,"68":[1,101],"69":[2,16],"70":[1,102],"71":[1,103],"74":[2,16],"79":94,"82":[1,96],"83":[2,111],"84":[2,16],"89":[2,16],"98":[2,16],"100":[2,16],"101":[2,16],"102":[2,16],"109":[2,16],"113":[2,16],"114":[2,16],"125":[2,16],"126":[2,16],"128":[2,16],"129":[2,16],"132":[2,16],"133":[2,16],"134":[2,16],"135":[2,16],"136":[2,16],"137":[2,16]},{"1":[2,17],"4":[2,17],"27":[2,17],"28":[2,17],"49":[2,17],"54":[2,17],"57":[2,17],"62":105,"64":[1,97],"65":[1,98],"66":[1,99],"67":100,"68":[1,101],"69":[2,17],"70":[1,102],"71":[1,103],"74":[2,17],"79":104,"82":[1,96],"83":[2,111],"84":[2,17],"89":[2,17],"98":[2,17],"100":[2,17],"101":[2,17],"102":[2,17],"109":[2,17],"113":[2,17],"114":[2,17],"125":[2,17],"126":[2,17],"128":[2,17],"129":[2,17],"132":[2,17],"133":[2,17],"134":[2,17],"135":[2,17],"136":[2,17],"137":[2,17]},{"1":[2,18],"4":[2,18],"27":[2,18],"28":[2,18],"49":[2,18],"54":[2,18],"57":[2,18],"69":[2,18],"74":[2,18],"84":[2,18],"89":[2,18],"98":[2,18],"100":[2,18],"101":[2,18],"102":[2,18],"109":[2,18],"113":[2,18],"114":[2,18],"125":[2,18],"126":[2,18],"128":[2,18],"129":[2,18],"132":[2,18],"133":[2,18],"134":[2,18],"135":[2,18],"136":[2,18],"137":[2,18]},{"1":[2,19],"4":[2,19],"27":[2,19],"28":[2,19],"49":[2,19],"54":[2,19],"57":[2,19],"69":[2,19],"74":[2,19],"84":[2,19],"89":[2,19],"98":[2,19],"100":[2,19],"101":[2,19],"102":[2,19],"109":[2,19],"113":[2,19],"114":[2,19],"125":[2,19],"126":[2,19],"128":[2,19],"129":[2,19],"132":[2,19],"133":[2,19],"134":[2,19],"135":[2,19],"136":[2,19],"137":[2,19]},{"1":[2,20],"4":[2,20],"27":[2,20],"28":[2,20],"49":[2,20],"54":[2,20],"57":[2,20],"69":[2,20],"74":[2,20],"84":[2,20],"89":[2,20],"98":[2,20],"100":[2,20],"101":[2,20],"102":[2,20],"109":[2,20],"113":[2,20],"114":[2,20],"125":[2,20],"126":[2,20],"128":[2,20],"129":[2,20],"132":[2,20],"133":[2,20],"134":[2,20],"135":[2,20],"136":[2,20],"137":[2,20]},{"1":[2,21],"4":[2,21],"27":[2,21],"28":[2,21],"49":[2,21],"54":[2,21],"57":[2,21],"69":[2,21],"74":[2,21],"84":[2,21],"89":[2,21],"98":[2,21],"100":[2,21],"101":[2,21],"102":[2,21],"109":[2
defaultActions: {"75":[2,4],"96":[2,112],"310":[2,149]},
2010-02-11 04:24:05 +00:00
parseError: function parseError(str, hash) {
throw new Error(str);
},
parse: function parse(input) {
var self = this,
stack = [0],
vstack = [null], // semantic value stack
table = this.table,
yytext = '',
yylineno = 0,
yyleng = 0,
shifts = 0,
reductions = 0,
recovering = 0,
TERROR = 2,
EOF = 1;
2010-02-11 04:24:05 +00:00
this.lexer.setInput(input);
this.lexer.yy = this.yy;
this.yy.lexer = this.lexer;
2010-02-11 04:24:05 +00:00
var parseError = this.yy.parseError = typeof this.yy.parseError == 'function' ? this.yy.parseError : this.parseError;
function popStack (n) {
stack.length = stack.length - 2*n;
vstack.length = vstack.length - n;
}
function checkRecover (st) {
for (var p in table[st]) if (p == TERROR) {
return true;
}
return false;
}
2010-02-11 04:24:05 +00:00
function lex() {
var token;
token = self.lexer.lex() || 1; // $end = 1
// if token isn't its numeric value, convert
if (typeof token !== 'number') {
token = self.symbols_[token] || token;
2010-02-11 04:24:05 +00:00
}
return token;
};
var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected, recovered = false;
2010-02-11 04:24:05 +00:00
while (true) {
// retreive state number from top of stack
2010-02-11 04:24:05 +00:00
state = stack[stack.length-1];
// use default actions if available
if (this.defaultActions[state]) {
action = this.defaultActions[state];
} else {
if (symbol == null)
symbol = lex();
// read action for current state and first input
action = table[state] && table[state][symbol];
}
2010-02-11 04:24:05 +00:00
// handle parse error
if (typeof action === 'undefined' || !action.length || !action[0]) {
if (!recovering) {
// Report error
expected = [];
for (p in table[state]) if (this.terminals_[p] && p > 2) {
expected.push("'"+this.terminals_[p]+"'");
}
if (this.lexer.showPosition) {
parseError.call(this, 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+'\nExpecting '+expected.join(', '),
{text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, expected: expected});
} else {
var errStr = symbol == 1 /*EOF*/ ? "end of input" :
("'"+(this.terminals_[symbol] || symbol)+"'");
parseError.call(this, 'Parse error on line '+(yylineno+1)+": Unexpected "+errStr,
{text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, expected: expected});
}
}
// just recovered from another error
if (recovering == 3) {
if (symbol == EOF) {
throw 'Parsing halted.'
}
// discard current lookahead and grab another
yyleng = this.lexer.yyleng;
yytext = this.lexer.yytext;
yylineno = this.lexer.yylineno;
symbol = lex();
2010-01-31 04:17:36 +00:00
}
// try to recover from error
while (1) {
// check for error recovery rule in this state
if (checkRecover(state)) {
break;
}
if (state == 0) {
throw 'Parsing halted.'
}
popStack(1);
state = stack[stack.length-1];
2010-02-13 23:19:59 +00:00
}
preErrorSymbol = symbol; // save the lookahead token
symbol = TERROR; // insert generic error symbol as new lookahead
state = stack[stack.length-1];
action = table[state] && table[state][TERROR];
recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
2010-01-31 04:17:36 +00:00
}
2010-02-11 04:24:05 +00:00
// this shouldn't happen, unless resolve defaults are off
if (action[0] instanceof Array && action.length > 1) {
2010-02-11 04:24:05 +00:00
throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);
}
a = action;
2010-02-11 04:24:05 +00:00
switch (a[0]) {
case 1: // shift
shifts++;
stack.push(symbol);
vstack.push(this.lexer.yytext); // semantic values or junk only, no terminals
2010-02-11 04:24:05 +00:00
stack.push(a[1]); // push state
symbol = null;
if (!preErrorSymbol) { // normal execution/no error
yyleng = this.lexer.yyleng;
yytext = this.lexer.yytext;
yylineno = this.lexer.yylineno;
if (recovering > 0)
recovering--;
} else { // error just occurred, resume old lookahead f/ before error
symbol = preErrorSymbol;
preErrorSymbol = null;
}
2010-02-11 04:24:05 +00:00
break;
case 2: // reduce
reductions++;
len = this.productions_[a[1]][1];
// perform semantic action
yyval.$ = vstack[vstack.length-len]; // default to $$ = $1
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, a[1], vstack);
if (typeof r !== 'undefined') {
return r;
}
// pop off stack
if (len) {
stack = stack.slice(0,-1*len*2);
vstack = vstack.slice(0, -1*len);
}
stack.push(this.productions_[a[1]][0]); // push nonterminal (reduce)
vstack.push(yyval.$);
// goto new state = table[STATE][NONTERMINAL]
newState = table[stack[stack.length-2]][stack[stack.length-1]];
stack.push(newState);
break;
case 3: // accept
this.reductionCount = reductions;
this.shiftCount = shifts;
2010-02-11 04:24:05 +00:00
return true;
}
2010-01-31 04:17:36 +00:00
}
2010-02-11 04:24:05 +00:00
return true;
}};
return parser;
})();
if (typeof require !== 'undefined') {
exports.parser = parser;
exports.parse = function () { return parser.parse.apply(parser, arguments); }
exports.main = function commonjsMain(args) {
if (!args[1])
throw new Error('Usage: '+args[0]+' FILE');
if (typeof process !== 'undefined') {
var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8");
} else {
var cwd = require("file").path(require("file").cwd());
var source = cwd.join(args[1]).read({charset: "utf-8"});
}
return exports.parser.parse(source);
2010-02-11 04:24:05 +00:00
}
if (typeof module !== 'undefined' && require.main === module) {
exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args);
2010-02-11 04:24:05 +00:00
}
}