jashkenas--coffeescript/lib/coffee-script/parser.js

592 lines
102 KiB
JavaScript
Raw Normal View History

2010-02-11 04:24:05 +00:00
/* Jison generated parser */
var parser = (function(){
undefined
2010-02-11 04:24:05 +00:00
var parser = {trace: function trace() { },
yy: {},
2011-11-25 13:35:20 +00:00
symbols_: {"error":2,"Root":3,"Body":4,"Block":5,"TERMINATOR":6,"Line":7,"Expression":8,"Statement":9,"Return":10,"Comment":11,"STATEMENT":12,"Value":13,"Invocation":14,"Code":15,"Operation":16,"Assign":17,"If":18,"Try":19,"While":20,"For":21,"Switch":22,"Class":23,"Throw":24,"INDENT":25,"OUTDENT":26,"Identifier":27,"IDENTIFIER":28,"AlphaNumeric":29,"NUMBER":30,"STRING":31,"Literal":32,"JS":33,"REGEX":34,"DEBUGGER":35,"BOOL":36,"Assignable":37,"=":38,"AssignObj":39,"ObjAssignable":40,":":41,"ThisProperty":42,"RETURN":43,"HERECOMMENT":44,"PARAM_START":45,"ParamList":46,"PARAM_END":47,"FuncGlyph":48,"->":49,"=>":50,"OptComma":51,",":52,"Param":53,"ParamVar":54,"...":55,"Array":56,"Object":57,"Splat":58,"SimpleAssignable":59,"Accessor":60,"Parenthetical":61,"Range":62,"This":63,".":64,"?.":65,"::":66,"Index":67,"INDEX_START":68,"IndexValue":69,"INDEX_END":70,"INDEX_SOAK":71,"Slice":72,"{":73,"AssignList":74,"}":75,"CLASS":76,"EXTENDS":77,"OptFuncExist":78,"Arguments":79,"SUPER":80,"FUNC_EXIST":81,"CALL_START":82,"CALL_END":83,"ArgList":84,"THIS":85,"@":86,"[":87,"]":88,"RangeDots":89,"..":90,"Arg":91,"SimpleArgs":92,"TRY":93,"Catch":94,"FINALLY":95,"CATCH":96,"THROW":97,"(":98,")":99,"WhileSource":100,"WHILE":101,"WHEN":102,"UNTIL":103,"Loop":104,"LOOP":105,"ForBody":106,"FOR":107,"ForStart":108,"ForSource":109,"ForVariables":110,"OWN":111,"ForValue":112,"FORIN":113,"FOROF":114,"BY":115,"SWITCH":116,"Whens":117,"ELSE":118,"When":119,"LEADING_WHEN":120,"IfBlock":121,"IF":122,"POST_IF":123,"UNARY":124,"-":125,"+":126,"--":127,"++":128,"?":129,"MATH":130,"SHIFT":131,"COMPARE":132,"LOGIC":133,"RELATION":134,"COMPOUND_ASSIGN":135,"$accept":0,"$end":1},
terminals_: {2:"error",6:"TERMINATOR",12:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"DEBUGGER",36:"BOOL",38:"=",41:":",43:"RETURN",44:"HERECOMMENT",45:"PARAM_START",47:"PARAM_END",49:"->",50:"=>",52:",",55:"...",64:".",65:"?.",66:"::",68:"INDEX_START",70:"INDEX_END",71:"INDEX_SOAK",73:"{",75:"}",76:"CLASS",77:"EXTENDS",80:"SUPER",81:"FUNC_EXIST",82:"CALL_START",83:"CALL_END",85:"THIS",86:"@",87:"[",88:"]",90:"..",93:"TRY",95:"FINALLY",96:"CATCH",97:"THROW",98:"(",99:")",101:"WHILE",102:"WHEN",103:"UNTIL",105:"LOOP",107:"FOR",111:"OWN",113:"FORIN",114:"FOROF",115:"BY",116:"SWITCH",118:"ELSE",120:"LEADING_WHEN",122:"IF",123:"POST_IF",124:"UNARY",125:"-",126:"+",127:"--",128:"++",129:"?",130:"MATH",131:"SHIFT",132:"COMPARE",133:"LOGIC",134:"RELATION",135:"COMPOUND_ASSIGN"},
productions_: [0,[3,0],[3,1],[3,2],[4,1],[4,3],[4,2],[7,1],[7,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],[8,1],[5,2],[5,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[17,3],[17,4],[17,5],[39,1],[39,3],[39,5],[39,1],[40,1],[40,1],[40,1],[10,2],[10,1],[11,1],[15,5],[15,2],[48,1],[48,1],[51,0],[51,1],[46,0],[46,1],[46,3],[53,1],[53,2],[53,3],[54,1],[54,1],[54,1],[54,1],[58,2],[59,1],[59,2],[59,2],[59,1],[37,1],[37,1],[37,1],[13,1],[13,1],[13,1],[13,1],[13,1],[60,2],[60,2],[60,2],[60,1],[60,1],[67,3],[67,2],[69,1],[69,1],[57,4],[74,0],[74,1],[74,3],[74,4],[74,6],[23,1],[23,2],[23,3],[23,4],[23,2],[23,3],[23,4],[23,5],[14,3],[14,3],[14,1],[14,2],[78,0],[78,1],[79,2],[79,4],[63,1],[63,1],[42,2],[56,2],[56,4],[89,1],[89,1],[62,5],[72,3],[72,2],[72,2],[72,1],[84,1],[84,3],[84,4],[84,4],[84,6],[91,1],[91,1],[92,1],[92,3],[19,2],[19,3],[19,4],[19,5],[94,3],[24,2],[61,3],[61,5],[100,2],[100,4],[100,2],[100,4],[20,2],[20,2],[20,2],[20,1],[104,2],[104,2],[21,2],[21,2],[21,2],[106,2],[106,2],[108,2],[108,3],[112,1],[112,1],[112,1],[110,1],[110,3],[109,2],[109,2],[109,4],[109,4],[109,4],[109,6],[109,6],[22,5],[22,7],[22,4],[22,6],[117,1],[117,2],[119,3],[119,4],[121,3],[121,5],[18,1],[18,3],[18,3],[18,3],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,5],[16,3]],
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
2010-02-11 04:24:05 +00:00
2010-12-20 01:04:49 +00:00
var $0 = $$.length - 1;
switch (yystate) {
2011-01-15 19:19:35 +00:00
case 1:return this.$ = new yy.Block;
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 2:return this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 3:return this.$ = $$[$0-1];
2010-02-11 04:24:05 +00:00
break;
2011-01-15 19:19:35 +00:00
case 4:this.$ = yy.Block.wrap([$$[$0]]);
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 5:this.$ = $$[$0-2].push($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 6:this.$ = $$[$0-1];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 7:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 8:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 9:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 10:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
case 11:this.$ = new yy.Literal($$[$0]);
2010-02-11 04:24:05 +00:00
break;
case 12:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 13:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 14:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 15:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 16:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 17:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 18:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 19:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 20:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 21:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 22:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 23:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2011-01-15 19:19:35 +00:00
case 24:this.$ = new yy.Block;
2010-02-11 04:24:05 +00:00
break;
case 25:this.$ = $$[$0-1];
2010-02-11 04:24:05 +00:00
break;
case 26:this.$ = new yy.Literal($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 27:this.$ = new yy.Literal($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 28:this.$ = new yy.Literal($$[$0]);
2010-02-11 04:24:05 +00:00
break;
case 29:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
case 30:this.$ = new yy.Literal($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 31:this.$ = new yy.Literal($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-11-25 13:35:20 +00:00
case 32:this.$ = new yy.Literal($$[$0]);
break;
case 33:this.$ = (function () {
var val;
val = new yy.Literal($$[$0]);
if ($$[$0] === 'undefined') val.isUndefined = true;
return val;
}());
2010-02-11 04:24:05 +00:00
break;
2011-11-25 13:35:20 +00:00
case 34:this.$ = new yy.Assign($$[$0-2], $$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 35:this.$ = new yy.Assign($$[$0-3], $$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 36:this.$ = new yy.Assign($$[$0-4], $$[$0-1]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 37:this.$ = new yy.Value($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 38:this.$ = new yy.Assign(new yy.Value($$[$0-2]), $$[$0], 'object');
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 39:this.$ = new yy.Assign(new yy.Value($$[$0-4]), $$[$0-1], 'object');
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 40:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 41:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2011-11-25 13:35:20 +00:00
case 42:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 43:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 44:this.$ = new yy.Return($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 45:this.$ = new yy.Return;
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 46:this.$ = new yy.Comment($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 47:this.$ = new yy.Code($$[$0-3], $$[$0], $$[$0-1]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 48:this.$ = new yy.Code([], $$[$0], $$[$0-1]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 49:this.$ = 'func';
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 50:this.$ = 'boundfunc';
2010-02-11 04:24:05 +00:00
break;
2011-11-25 13:35:20 +00:00
case 51:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 52:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 53:this.$ = [];
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 54:this.$ = [$$[$0]];
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 55:this.$ = $$[$0-2].concat($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 56:this.$ = new yy.Param($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 57:this.$ = new yy.Param($$[$0-1], null, true);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 58:this.$ = new yy.Param($$[$0-2], $$[$0]);
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 59:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 60:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2011-11-25 13:35:20 +00:00
case 61:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 62:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 63:this.$ = new yy.Splat($$[$0-1]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 64:this.$ = new yy.Value($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 65:this.$ = $$[$0-1].add($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 66:this.$ = new yy.Value($$[$0-1], [].concat($$[$0]));
2010-02-11 04:24:05 +00:00
break;
2011-11-25 13:35:20 +00:00
case 67:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 68:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2011-11-25 13:35:20 +00:00
case 69:this.$ = new yy.Value($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 70:this.$ = new yy.Value($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 71:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2010-12-20 01:04:49 +00:00
case 72:this.$ = new yy.Value($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-11-25 13:35:20 +00:00
case 73:this.$ = new yy.Value($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 74:this.$ = new yy.Value($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 75:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 76:this.$ = new yy.Access($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 77:this.$ = new yy.Access($$[$0], 'soak');
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 78:this.$ = [new yy.Access(new yy.Literal('prototype')), new yy.Access($$[$0])];
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 79:this.$ = new yy.Access(new yy.Literal('prototype'));
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 80:this.$ = $$[$0];
2011-11-25 13:35:20 +00:00
break;
2011-12-14 23:31:20 +00:00
case 81:this.$ = $$[$0-1];
break;
case 82:this.$ = yy.extend($$[$0], {
2010-10-25 13:31:52 +00:00
soak: true
});
break;
2011-12-14 23:31:20 +00:00
case 83:this.$ = new yy.Index($$[$0]);
break;
2011-12-14 23:31:20 +00:00
case 84:this.$ = new yy.Slice($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 85:this.$ = new yy.Obj($$[$0-2], $$[$0-3].generated);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 86:this.$ = [];
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 87:this.$ = [$$[$0]];
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 88:this.$ = $$[$0-2].concat($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 89:this.$ = $$[$0-3].concat($$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 90:this.$ = $$[$0-5].concat($$[$0-2]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 91:this.$ = new yy.Class;
2010-06-26 17:36:31 +00:00
break;
2011-12-14 23:31:20 +00:00
case 92:this.$ = new yy.Class(null, null, $$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 93:this.$ = new yy.Class(null, $$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 94:this.$ = new yy.Class(null, $$[$0-1], $$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 95:this.$ = new yy.Class($$[$0]);
2010-11-13 23:13:09 +00:00
break;
2011-12-14 23:31:20 +00:00
case 96:this.$ = new yy.Class($$[$0-1], null, $$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 97:this.$ = new yy.Class($$[$0-2], $$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-12-14 23:31:20 +00:00
case 98:this.$ = new yy.Class($$[$0-3], $$[$0-1], $$[$0]);
2010-02-11 04:24:05 +00:00
break;
2011-11-25 13:35:20 +00:00
case 99:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]);
2010-10-23 20:35:35 +00:00
break;
2011-12-14 23:31:20 +00:00
case 100:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]);
break;
2011-12-14 23:31:20 +00:00
case 101:this.$ = new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))]);
break;
2011-12-14 23:31:20 +00:00
case 102:this.$ = new yy.Call('super', $$[$0]);
break;
2011-12-14 23:31:20 +00:00
case 103:this.$ = false;
break;
2011-12-14 23:31:20 +00:00
case 104:this.$ = true;
break;
2011-12-14 23:31:20 +00:00
case 105:this.$ = [];
break;
2011-12-14 23:31:20 +00:00
case 106:this.$ = $$[$0-2];
2010-11-20 21:25:22 +00:00
break;
2011-11-25 13:35:20 +00:00
case 107:this.$ = new yy.Value(new yy.Literal('this'));
2010-11-20 21:25:22 +00:00
break;
2011-12-14 23:31:20 +00:00
case 108:this.$ = new yy.Value(new yy.Literal('this'));
2010-11-20 21:25:22 +00:00
break;
2011-12-14 23:31:20 +00:00
case 109:this.$ = new yy.Value(new yy.Literal('this'), [new yy.Access($$[$0])], 'this');
2010-11-20 21:25:22 +00:00
break;
2011-12-14 23:31:20 +00:00
case 110:this.$ = new yy.Arr([]);
2010-03-28 17:06:16 +00:00
break;
2011-12-14 23:31:20 +00:00
case 111:this.$ = new yy.Arr($$[$0-2]);
2010-03-28 17:06:16 +00:00
break;
2011-12-14 23:31:20 +00:00
case 112:this.$ = 'inclusive';
2010-03-28 17:06:16 +00:00
break;
2011-12-14 23:31:20 +00:00
case 113:this.$ = 'exclusive';
break;
2011-12-14 23:31:20 +00:00
case 114:this.$ = new yy.Range($$[$0-3], $$[$0-1], $$[$0-2]);
break;
2011-12-14 23:31:20 +00:00
case 115:this.$ = new yy.Range($$[$0-2], $$[$0], $$[$0-1]);
break;
2011-12-14 23:31:20 +00:00
case 116:this.$ = new yy.Range($$[$0-1], null, $$[$0]);
break;
2011-12-14 23:31:20 +00:00
case 117:this.$ = new yy.Range(null, $$[$0], $$[$0-1]);
break;
case 118:this.$ = new yy.Range(null, null, $$[$0]);
break;
case 119:this.$ = [$$[$0]];
break;
case 120:this.$ = $$[$0-2].concat($$[$0]);
break;
case 121:this.$ = $$[$0-3].concat($$[$0]);
break;
case 122:this.$ = $$[$0-2];
break;
case 123:this.$ = $$[$0-5].concat($$[$0-2]);
break;
2011-11-25 13:35:20 +00:00
case 124:this.$ = $$[$0];
break;
2011-12-14 23:31:20 +00:00
case 125:this.$ = $$[$0];
break;
case 126:this.$ = $$[$0];
break;
case 127:this.$ = [].concat($$[$0-2], $$[$0]);
break;
case 128:this.$ = new yy.Try($$[$0]);
break;
case 129:this.$ = new yy.Try($$[$0-1], $$[$0][0], $$[$0][1]);
break;
case 130:this.$ = new yy.Try($$[$0-2], null, null, $$[$0]);
2010-11-20 21:25:22 +00:00
break;
case 131:this.$ = new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0]);
2010-11-20 21:25:22 +00:00
break;
case 132:this.$ = [$$[$0-1], $$[$0]];
2010-11-20 21:25:22 +00:00
break;
case 133:this.$ = new yy.Throw($$[$0]);
break;
case 134:this.$ = new yy.Parens($$[$0-1]);
break;
case 135:this.$ = new yy.Parens($$[$0-2]);
2011-11-25 13:35:20 +00:00
break;
case 136:this.$ = new yy.While($$[$0]);
break;
case 137:this.$ = new yy.While($$[$0-2], {
2010-12-20 01:04:49 +00:00
guard: $$[$0]
});
2010-02-11 04:24:05 +00:00
break;
case 138:this.$ = new yy.While($$[$0], {
invert: true
});
break;
case 139:this.$ = new yy.While($$[$0-2], {
invert: true,
2010-12-20 01:04:49 +00:00
guard: $$[$0]
});
break;
case 140:this.$ = $$[$0-1].addBody($$[$0]);
break;
2011-12-14 23:31:20 +00:00
case 141:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]]));
2010-08-18 01:31:32 +00:00
break;
case 142:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]]));
break;
case 143:this.$ = $$[$0];
break;
case 144:this.$ = new yy.While(new yy.Literal('true')).addBody($$[$0]);
2010-10-04 20:53:32 +00:00
break;
case 145:this.$ = new yy.While(new yy.Literal('true')).addBody(yy.Block.wrap([$$[$0]]));
2011-11-25 13:35:20 +00:00
break;
2011-12-14 23:31:20 +00:00
case 146:this.$ = new yy.For($$[$0-1], $$[$0]);
break;
case 147:this.$ = new yy.For($$[$0-1], $$[$0]);
break;
case 148:this.$ = new yy.For($$[$0], $$[$0-1]);
break;
case 149:this.$ = {
source: new yy.Value($$[$0])
2010-11-20 21:25:22 +00:00
};
break;
case 150:this.$ = (function () {
2010-12-20 01:04:49 +00:00
$$[$0].own = $$[$0-1].own;
$$[$0].name = $$[$0-1][0];
$$[$0].index = $$[$0-1][1];
2010-12-20 01:04:49 +00:00
return $$[$0];
2010-11-20 21:25:22 +00:00
}());
break;
case 151:this.$ = $$[$0];
break;
case 152:this.$ = (function () {
2010-12-20 01:04:49 +00:00
$$[$0].own = true;
return $$[$0];
2010-11-20 21:25:22 +00:00
}());
break;
case 153:this.$ = $$[$0];
2011-11-25 13:35:20 +00:00
break;
2011-12-14 23:31:20 +00:00
case 154:this.$ = new yy.Value($$[$0]);
break;
case 155:this.$ = new yy.Value($$[$0]);
break;
case 156:this.$ = [$$[$0]];
break;
case 157:this.$ = [$$[$0-2], $$[$0]];
2011-12-14 23:31:20 +00:00
break;
case 158:this.$ = {
2010-12-20 01:04:49 +00:00
source: $$[$0]
};
2010-02-11 04:24:05 +00:00
break;
case 159:this.$ = {
2010-12-20 01:04:49 +00:00
source: $$[$0],
2010-11-20 21:25:22 +00:00
object: true
};
break;
case 160:this.$ = {
2010-12-20 01:04:49 +00:00
source: $$[$0-2],
guard: $$[$0]
};
2010-02-11 04:24:05 +00:00
break;
case 161:this.$ = {
2010-12-20 01:04:49 +00:00
source: $$[$0-2],
guard: $$[$0],
2010-11-20 21:25:22 +00:00
object: true
};
break;
case 162:this.$ = {
2010-12-20 01:04:49 +00:00
source: $$[$0-2],
step: $$[$0]
};
break;
case 163:this.$ = {
2010-12-20 01:04:49 +00:00
source: $$[$0-4],
guard: $$[$0-2],
step: $$[$0]
};
2010-02-11 04:24:05 +00:00
break;
case 164:this.$ = {
2010-12-20 01:04:49 +00:00
source: $$[$0-4],
step: $$[$0-2],
guard: $$[$0]
};
2010-02-11 04:24:05 +00:00
break;
case 165:this.$ = new yy.Switch($$[$0-3], $$[$0-1]);
break;
case 166:this.$ = new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1]);
break;
case 167:this.$ = new yy.Switch(null, $$[$0-1]);
break;
case 168:this.$ = new yy.Switch(null, $$[$0-3], $$[$0-1]);
2010-05-11 02:57:51 +00:00
break;
case 169:this.$ = $$[$0];
2010-05-11 02:57:51 +00:00
break;
case 170:this.$ = $$[$0-1].concat($$[$0]);
break;
case 171:this.$ = [[$$[$0-1], $$[$0]]];
break;
case 172:this.$ = [[$$[$0-2], $$[$0-1]]];
2010-04-05 14:26:23 +00:00
break;
case 173:this.$ = new yy.If($$[$0-1], $$[$0], {
type: $$[$0-2]
2010-04-27 23:35:15 +00:00
});
2010-02-11 04:24:05 +00:00
break;
case 174:this.$ = $$[$0-4].addElse(new yy.If($$[$0-1], $$[$0], {
type: $$[$0-2]
}));
2010-02-11 04:24:05 +00:00
break;
case 175:this.$ = $$[$0];
2010-02-11 04:24:05 +00:00
break;
case 176:this.$ = $$[$0-2].addElse($$[$0]);
2010-02-11 04:24:05 +00:00
break;
case 177:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), {
type: $$[$0-1],
statement: true
});
2010-02-11 04:24:05 +00:00
break;
case 178:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), {
type: $$[$0-1],
2010-04-27 23:35:15 +00:00
statement: true
});
break;
case 179:this.$ = new yy.Op($$[$0-1], $$[$0]);
break;
case 180:this.$ = new yy.Op('-', $$[$0]);
break;
case 181:this.$ = new yy.Op('+', $$[$0]);
break;
case 182:this.$ = new yy.Op('--', $$[$0]);
break;
case 183:this.$ = new yy.Op('++', $$[$0]);
break;
case 184:this.$ = new yy.Op('--', $$[$0-1], null, true);
break;
case 185:this.$ = new yy.Op('++', $$[$0-1], null, true);
2010-11-13 23:13:09 +00:00
break;
case 186:this.$ = new yy.Existence($$[$0-1]);
break;
case 187:this.$ = new yy.Op('+', $$[$0-2], $$[$0]);
break;
case 188:this.$ = new yy.Op('-', $$[$0-2], $$[$0]);
break;
case 189:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
break;
2011-11-25 13:35:20 +00:00
case 190:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
break;
2011-12-14 23:31:20 +00:00
case 191:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
break;
case 192:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
break;
case 193:this.$ = (function () {
2010-12-20 01:04:49 +00:00
if ($$[$0-1].charAt(0) === '!') {
return new yy.Op($$[$0-1].slice(1), $$[$0-2], $$[$0]).invert();
} else {
2010-12-20 01:04:49 +00:00
return new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
}
}());
2010-08-18 01:31:32 +00:00
break;
case 194:this.$ = new yy.Assign($$[$0-2], $$[$0], $$[$0-1]);
2010-11-09 05:26:31 +00:00
break;
case 195:this.$ = new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3]);
break;
case 196:this.$ = new yy.Extends($$[$0-2], $$[$0]);
2010-08-21 12:56:25 +00:00
break;
}
},
table: [{1:[2,1],3:1,4:2,5:3,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[3]},{1:[2,2],6:[1,72]},{6:[1,73]},{1:[2,4],6:[2,4],26:[2,4],99:[2,4]},{4:75,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[1,74],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,7],6:[2,7],26:[2,7],99:[2,7],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,8],6:[2,8],26:[2,8],99:[2,8],100:88,101:[1,63],103:[1,64],106:89,107:[1,66],108:67,123:[1,87]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],47:[2,12],52:[2,12],55:[2,12],60:91,64:[1,93],65:[1,94],66:[1,95],67:96,68:[1,97],70:[2,12],71:[1,98],75:[2,12],78:90,81:[1,92],82:[2,103],83:[2,12],88:[2,12],90:[2,12],99:[2,12],101:[2,12],102:[2,12],103:[2,12],107:[2,12],115:[2,12],123:[2,12],125:[2,12],126:[2,12],129:[2,12],130:[2,12],131:[2,12],132:[2,12],133:[2,12],134:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],47:[2,13],52:[2,13],55:[2,13],60:100,64:[1,93],65:[1,94],66:[1,95],67:96,68:[1,97],70:[2,13],71:[1,98],75:[2,13],78:99,81:[1,92],82:[2,103],83:[2,13],88:[2,13],90:[2,13],99:[2,13],101:[2,13],102:[2,13],103:[2,13],107:[2,13],115:[2,13],123:[2,13],125:[2,13],126:[2,13],129:[2,13],130:[2,13],131:[2,13],132:[2,13],133:[2,13],134:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],47:[2,14],52:[2,14],55:[2,14],70:[2,14],75:[2,14],83:[2,14],88:[2,14],90:[2,14],99:[2,14],101:[2,14],102:[2,14],103:[2,14],107:[2,14],115:[2,14],123:[2,14],125:[2,14],126:[2,14],129:[2,14],130:[2,14],131:[2,14],132:[2,14],133:[2,14],134:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],47:[2,15],52:[2,15],55:[2,15],70:[2,15],75:[2,15],83:[2,15],88:[2,15],90:[2,15],99:[2,15],101:[2,15],102:[2,15],103:[2,15],107:[2,15],115:[2,15],123:[2,15],125:[2,15],126:[2,15],129:[2,15],130:[2,15],131:[2,15],132:[2,15],133:[2,15],134:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],47:[2,16],52:[2,16],55:[2,16],70:[2,16],75:[2,16],83:[2,16],88:[2,16],90:[2,16],99:[2,16],101:[2,16],102:[2,16],103:[2,16],107:[2,16],115:[2,16],123:[2,16],125:[2,16],126:[2,16],129:[2,16],130:[2,16],131:[2,16],132:[2,16],133:[2,16],134:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],47:[2,17],52:[2,17],55:[2,17],70:[2,17],75:[2,17],83:[2,17],88:[2,17],90:[2,17],99:[2,17],101:[2,17],102:[2,17],103:[2,17],107:[2,17],115:[2,17],123:[2,17],125:[2,17],126:[2,17],129:[2,17],130:[2,17],131:[2,17],132:[2,17],133:[2,17],134:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],47:[2,18],52:[2,18],55:[2,18],70:[2,18],75:[2,18],83:[2,18],88:[2,18],90:[2,18],99:[2,18],101:[2,18],102:[2,18],103:[2,18],107:[2,18],115:[2,18],123:[2,18],125:[2,18],126:[2,18],129:[2,18],130:[2,18],131:[2,18],132:[2,18],133:[2,18],134:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],47:[2,19],52:[2,19],55:[2,19],70:[2,19],75:[2,19],83:[2,19],88:[2,19],90:[2,19],99:[2,19],101:[2,19],102:[2,19],103:[2,19],107:[2,19],115:[2,19],123:[2,19],125:[2,19],126:[2,19],129:[2,19],130:[2,19],131:[2,19],132:[2,19],133:[2,19],134:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],47:[2,20],52:[2,20],55:[2,20],70:[2,20],75:[2,20],83:[2,20],88:[2,20],90:[2,20],99:[2,20],101:[2,20],
2011-12-14 23:31:20 +00:00
defaultActions: {58:[2,49],59:[2,50],73:[2,3],92:[2,104],186:[2,84]},
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], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 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;
if (typeof this.lexer.yylloc == "undefined")
this.lexer.yylloc = {};
var yyloc = this.lexer.yylloc;
lstack.push(yyloc);
if (typeof this.yy.parseError === "function")
2010-12-20 01:04:49 +00:00
this.parseError = this.yy.parseError;
function popStack(n) {
stack.length = stack.length - 2 * n;
vstack.length = vstack.length - n;
lstack.length = lstack.length - n;
}
2010-02-11 04:24:05 +00:00
function lex() {
var token;
token = self.lexer.lex() || 1;
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;
2010-02-11 04:24:05 +00:00
while (true) {
state = stack[stack.length - 1];
if (this.defaultActions[state]) {
action = this.defaultActions[state];
} else {
if (symbol == null)
symbol = lex();
action = table[state] && table[state][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
if (!recovering) {
expected = [];
for (p in table[state])
if (this.terminals_[p] && p > 2) {
expected.push("'" + this.terminals_[p] + "'");
}
var errStr = "";
if (this.lexer.showPosition) {
errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + this.terminals_[symbol] + "'";
} else {
errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
}
this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
}
}
if (action[0] instanceof Array && action.length > 1) {
throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
}
switch (action[0]) {
case 1:
stack.push(symbol);
vstack.push(this.lexer.yytext);
lstack.push(this.lexer.yylloc);
stack.push(action[1]);
symbol = null;
if (!preErrorSymbol) {
yyleng = this.lexer.yyleng;
yytext = this.lexer.yytext;
yylineno = this.lexer.yylineno;
yyloc = this.lexer.yylloc;
if (recovering > 0)
recovering--;
} else {
symbol = preErrorSymbol;
preErrorSymbol = null;
2010-01-31 04:17:36 +00:00
}
break;
case 2:
len = this.productions_[action[1]][1];
yyval.$ = vstack[vstack.length - len];
yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
if (typeof r !== "undefined") {
return r;
2010-02-13 23:19:59 +00:00
}
if (len) {
stack = stack.slice(0, -1 * len * 2);
vstack = vstack.slice(0, -1 * len);
lstack = lstack.slice(0, -1 * len);
}
stack.push(this.productions_[action[1]][0]);
vstack.push(yyval.$);
lstack.push(yyval._$);
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
stack.push(newState);
break;
case 3:
return true;
2010-02-11 04:24:05 +00:00
}
2010-01-31 04:17:36 +00:00
}
2010-02-11 04:24:05 +00:00
return true;
}
};
2010-02-11 04:24:05 +00:00
return parser;
})();
if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
2010-02-11 04:24:05 +00:00
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
}
}