// ( argsarr -- argsarr ) internal static void EmitArgsArray(EmitContext ec, RNArray a) { int i = 0; while (a != null) { EmitStoreArg(ec, i, a.head); a = (RNArray)a.next; i++; } }
EmitScope scope; // New scope for the block internal override void Walk(EmitContext ec) { if (ec.Resolving) { scope = ec.CreateBlockScope("block"); } ec.PushScope(scope); if (ec.Emitting) { ec.EmitScopeInitializer(); } // The parser should produce a more comfortable format for this if (var is RNDAsgn) { RNDefn.WalkArg(ec, 0, var.vid); } else { RNArray args = var != null ? (RNArray)((RNMAsgn)var).head : null; int i = 0; for (RNode n = args; n != null;) { RNDAsgn a = (RNDAsgn)n.head; RNDefn.WalkArg(ec, i, a.vid); n = n.next; i++; } } body.Walk(ec); if (ec.Emitting) { Type t = ec.CloseScope(scope); RNCall call = (RNCall)iter; call.block = t; call.Walk(ec); } else { ec.PopScope(scope); iter.Walk(ec); } }
internal override void Walk(EmitContext ec) { if (ec.Resolving) { if (recv != null) { recv.Walk(ec); } if (args != null) { args.Walk(ec); } } if (ec.Emitting) { RNArray a = (RNArray)args; // rcver if (recv != null) { recv.Walk(ec); } else { ec.EmitSelf(); } // name ec.EmitString(mid); // args int len = a != null ? a.alen : 0; ec.EmitNewArgArray(len); EmitArgsArray(ec, a); // block if (block != null) { ec.EmitCreateBlock(block); } else { ec.EmitNull(); } ec.EmitSend(); } }
internal override void Walk(EmitContext ec) { if (ec.Resolving) { if (stts != null) { stts.Walk(ec); } } if (ec.Emitting) { // rcver ec.EmitBlockArg(); // thread ec.EmitLoadThread(); // args RNArray a = stts as RNArray; int len = a != null ? a.alen : (stts != null ? 1 : 0); ec.EmitNewArgArray(len); if (a != null) { RNCall.EmitArgsArray(ec, a); } else if (stts != null) { RNCall.EmitStoreArg(ec, 0, stts); } // block ec.EmitNull(); ec.EmitYield(); } }
// ( argsarr -- argsarr ) internal static void EmitArgsArray(EmitContext ec, RNArray a) { int i = 0; while(a != null) { EmitStoreArg(ec, i, a.head); a = (RNArray)a.next; i++; } }
/** the generated parser. Maintains a state and a value stack, currently with fixed maximum size. @param yyLex scanner. @return result of the last reduction, if any. @throws yyException on irrecoverable parse error. */ public Object yyparse (yyParser.yyInput yyLex) { if (yyMax <= 0) yyMax = 256; // initial size int yyState = 0; // state stack ptr int [] yyStates = new int[yyMax]; // state stack Object yyVal = null; // value stack ptr Object [] yyVals = new Object[yyMax]; // value stack int yyToken = -1; // current input int yyErrorFlag = 0; // #tks to shift int yyTop = 0; goto skip; yyLoop: yyTop++; skip: for (;; ++ yyTop) { if (yyTop >= yyStates.Length) { // dynamically increase int[] i = new int[yyStates.Length+yyMax]; System.Array.Copy(yyStates, i, 0); yyStates = i; Object[] o = new Object[yyVals.Length+yyMax]; System.Array.Copy(yyVals, o, 0); yyVals = o; } yyStates[yyTop] = yyState; yyVals[yyTop] = yyVal; //t if (yydebug != null) yydebug.push(yyState, yyVal); yyDiscarded: for (;;) { // discarding a token does not change stack int yyN; if ((yyN = yyDefRed[yyState]) == 0) { // else [default] reduce (yyN) if (yyToken < 0) { yyToken = yyLex.advance() ? yyLex.token() : 0; //t if (yydebug != null) //t yydebug.lex(yyState, yyToken, yyname(yyToken), yyLex.value()); } if ((yyN = yySindex[yyState]) != 0 && ((yyN += yyToken) >= 0) && (yyN < yyTable.Length) && (yyCheck[yyN] == yyToken)) { //t if (yydebug != null) //t yydebug.shift(yyState, yyTable[yyN], yyErrorFlag-1); yyState = yyTable[yyN]; // shift to yyN yyVal = yyLex.value(); yyToken = -1; if (yyErrorFlag > 0) -- yyErrorFlag; goto yyLoop; } if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0 && yyN < yyTable.Length && yyCheck[yyN] == yyToken) yyN = yyTable[yyN]; // reduce (yyN) else switch (yyErrorFlag) { case 0: yyerror("syntax error", yyExpecting(yyState)); //t if (yydebug != null) yydebug.error("syntax error"); goto case 1; case 1: case 2: yyErrorFlag = 3; do { if ((yyN = yySindex[yyStates[yyTop]]) != 0 && (yyN += Token.yyErrorCode) >= 0 && yyN < yyTable.Length && yyCheck[yyN] == Token.yyErrorCode) { //t if (yydebug != null) //t yydebug.shift(yyStates[yyTop], yyTable[yyN], 3); yyState = yyTable[yyN]; yyVal = yyLex.value(); goto yyLoop; } //t if (yydebug != null) yydebug.pop(yyStates[yyTop]); } while (-- yyTop >= 0); //t if (yydebug != null) yydebug.reject(); throw new yyParser.yyException("irrecoverable syntax error"); case 3: if (yyToken == 0) { //t if (yydebug != null) yydebug.reject(); throw new yyParser.yyException("irrecoverable syntax error at end-of-file"); } //t if (yydebug != null) //t yydebug.discard(yyState, yyToken, yyname(yyToken), //t yyLex.value()); yyToken = -1; goto yyDiscarded; // leave stack alone } } int yyV = yyTop + 1-yyLen[yyN]; //t if (yydebug != null) //t yydebug.reduce(yyState, yyStates[yyV-1], yyN, yyRule[yyN], yyLen[yyN]); yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]); switch (yyN) { case 1: //line 230 "parse.y" { yyVal = thread.dyna_vars; lex.State = EXPR.BEG; thread.TopLocalInit(); /* if ((VALUE)ruby_class == rb_cObject) class_nest = 0; else class_nest = 1; */ } break; case 2: //line 240 "parse.y" { if (((RNode)yyVals[0+yyTop]) != null && !compile_for_eval) { /* last expression should not be void */ if (((RNode)yyVals[0+yyTop]) is RNBlock) { RNode node = ((RNode)yyVals[0+yyTop]); while (node.next != null) { node = node.next; } void_expr(node.head); } else { void_expr(((RNode)yyVals[0+yyTop])); } } evalTree = block_append(evalTree, ((RNode)yyVals[0+yyTop])); thread.TopLocalSetup(); class_nest = 0; thread.dyna_vars = ((RVarmap)yyVals[-1+yyTop]); } break; case 3: //line 263 "parse.y" { void_stmts(((RNode)yyVals[-1+yyTop])); yyVal = ((RNode)yyVals[-1+yyTop]); } break; case 5: //line 270 "parse.y" { yyVal = new RNNewLine(thread, ((RNode)yyVals[0+yyTop])); } break; case 6: //line 274 "parse.y" { yyVal = block_append(((RNode)yyVals[-2+yyTop]), new RNNewLine(thread, ((RNode)yyVals[0+yyTop]))); } break; case 7: //line 278 "parse.y" { yyVal = ((RNode)yyVals[0+yyTop]); } break; case 8: //line 282 "parse.y" {lex.State = EXPR.FNAME;} break; case 9: //line 283 "parse.y" { if (in_def != 0 || in_single != 0) yyerror("alias within method"); yyVal = new RNAlias(thread, ((uint)yyVals[-2+yyTop]), ((uint)yyVals[0+yyTop])); } break; case 10: //line 289 "parse.y" { if (in_def != 0 || in_single != 0) yyerror("alias within method"); yyVal = new RNVAlias(thread, ((uint)yyVals[-1+yyTop]), ((uint)yyVals[0+yyTop])); } break; case 11: //line 295 "parse.y" { if (in_def != 0 || in_single != 0) yyerror("alias within method"); string buf = "$" + Convert.ToChar(((RNode)yyVals[0+yyTop]).nth); yyVal = new RNVAlias(thread, ((uint)yyVals[-1+yyTop]), intern(buf)); } break; case 12: //line 302 "parse.y" { yyerror("can't make alias for the number variables"); yyVal = null; } break; case 13: //line 307 "parse.y" { if (in_def != 0 || in_single != 0) yyerror("undef within method"); yyVal = ((RNode)yyVals[0+yyTop]); } break; case 14: //line 313 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = new RNIf(thread, cond(((RNode)yyVals[0+yyTop])), ((RNode)yyVals[-2+yyTop])); } break; case 15: //line 318 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = new RNUnless(thread, cond(((RNode)yyVals[0+yyTop])), ((RNode)yyVals[-2+yyTop])); } break; case 16: //line 323 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); if (((RNode)yyVals[-2+yyTop]) != null && ((RNode)yyVals[-2+yyTop]) is RNBegin) { yyVal = new RNWhile(thread, cond(((RNode)yyVals[0+yyTop])), ((RNode)yyVals[-2+yyTop]).body, false); } else { yyVal = new RNWhile(thread, cond(((RNode)yyVals[0+yyTop])), ((RNode)yyVals[-2+yyTop]), true); } } break; case 17: //line 333 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); if (((RNode)yyVals[-2+yyTop]) != null && ((RNode)yyVals[-2+yyTop]) is RNBegin) { yyVal = new RNUntil(thread, cond(((RNode)yyVals[0+yyTop])), ((RNode)yyVals[-2+yyTop]).body, false); } else { yyVal = new RNUntil(thread, cond(((RNode)yyVals[0+yyTop])), ((RNode)yyVals[-2+yyTop]), true); } } break; case 18: //line 343 "parse.y" { yyVal = new RNRescue(thread, ((RNode)yyVals[-2+yyTop]), new RNResBody(thread, null, ((RNode)yyVals[0+yyTop]), null), null); } break; case 19: //line 347 "parse.y" { if (in_def != 0 || in_single != 0) { yyerror("BEGIN in method"); } thread.LocalPush(); } break; case 20: //line 354 "parse.y" { thread.evalTreeBegin = block_append(thread.evalTreeBegin, new RNPreExe(thread, ((RNode)yyVals[-1+yyTop]))); thread.LocalPop(); yyVal = null; } break; case 21: //line 361 "parse.y" { if (compile_for_eval && (in_def != 0|| in_single != 0)) { yyerror("END in method; use at_exit"); } yyVal = new RNIter(thread, null, new RNPostExe(thread), ((RNode)yyVals[-1+yyTop])); } break; case 22: //line 370 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = node_assign(((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 23: //line 375 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); ((RNode)yyVals[-2+yyTop]).val = ((RNode)yyVals[0+yyTop]); yyVal = ((RNode)yyVals[-2+yyTop]); } break; case 24: //line 381 "parse.y" { yyVal = node_assign(((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 26: //line 387 "parse.y" { /* value_expr($3); // nakada ruby-dev:15905*/ ((RNode)yyVals[-2+yyTop]).val = ((RNode)yyVals[0+yyTop]); yyVal = ((RNode)yyVals[-2+yyTop]); } break; case 27: //line 393 "parse.y" { if (!compile_for_eval && in_def != 0 && in_single != 0) yyerror("return appeared outside of method"); yyVal = new RNReturn(thread, ((RNode)yyVals[0+yyTop])); } break; case 29: //line 400 "parse.y" { yyVal = logop(typeof(RNAnd), ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 30: //line 404 "parse.y" { yyVal = logop(typeof(RNOr), ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 31: //line 408 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = new RNNot(thread, cond(((RNode)yyVals[0+yyTop]))); } break; case 32: //line 413 "parse.y" { yyVal = new RNNot(thread, cond(((RNode)yyVals[0+yyTop]))); } break; case 37: //line 423 "parse.y" { value_expr(((RNode)yyVals[-3+yyTop])); yyVal = new_call(((RNode)yyVals[-3+yyTop]), ((uint)yyVals[-1+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 38: //line 428 "parse.y" { value_expr(((RNode)yyVals[-3+yyTop])); yyVal = new_call(((RNode)yyVals[-3+yyTop]), ((uint)yyVals[-1+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 39: //line 434 "parse.y" { yyVal = new_fcall(((uint)yyVals[-1+yyTop]), ((RNode)yyVals[0+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[0+yyTop])); } break; case 40: //line 439 "parse.y" { value_expr(((RNode)yyVals[-3+yyTop])); yyVal = new_call(((RNode)yyVals[-3+yyTop]), ((uint)yyVals[-1+yyTop]), ((RNode)yyVals[0+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[-3+yyTop])); } break; case 41: //line 445 "parse.y" { value_expr(((RNode)yyVals[-3+yyTop])); yyVal = new_call(((RNode)yyVals[-3+yyTop]), ((uint)yyVals[-1+yyTop]), ((RNode)yyVals[0+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[-3+yyTop])); } break; case 42: //line 451 "parse.y" { if (!compile_for_eval && in_def == 0 && in_single == 0) yyerror("super called outside of method"); yyVal = new_super(((RNode)yyVals[0+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[0+yyTop])); } break; case 43: //line 458 "parse.y" { yyVal = new RNYield(thread, ((RNode)yyVals[0+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[0+yyTop])); } break; case 45: //line 465 "parse.y" { yyVal = ((RNode)yyVals[-1+yyTop]); } break; case 47: //line 471 "parse.y" { yyVal = new RNMAsgn(thread, new RNArray(thread, ((RNode)yyVals[-1+yyTop]))); } break; case 48: //line 476 "parse.y" { yyVal = new RNMAsgn(thread, ((RNode)yyVals[0+yyTop])); } break; case 49: //line 480 "parse.y" { yyVal = new RNMAsgn(thread, RNode.list_append(thread,((RNode)yyVals[-1+yyTop]),((RNode)yyVals[0+yyTop]))); } break; case 50: //line 484 "parse.y" { yyVal = new RNMAsgn(thread, ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 51: //line 488 "parse.y" { yyVal = new RNMAsgn(thread, ((RNode)yyVals[-1+yyTop]), -1); } break; case 52: //line 492 "parse.y" { yyVal = new RNMAsgn(thread, null, ((RNode)yyVals[0+yyTop])); } break; case 53: //line 496 "parse.y" { yyVal = new RNMAsgn(thread, null, -1); } break; case 55: //line 502 "parse.y" { yyVal = ((RNode)yyVals[-1+yyTop]); } break; case 56: //line 507 "parse.y" { yyVal = new RNArray(thread, ((RNode)yyVals[-1+yyTop])); } break; case 57: //line 511 "parse.y" { yyVal = RNode.list_append(thread, ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[-1+yyTop])); } break; case 58: //line 516 "parse.y" { yyVal = assignable(((uint)yyVals[0+yyTop]), null); } break; case 59: //line 520 "parse.y" { yyVal = aryset(((RNode)yyVals[-3+yyTop]), ((RNode)yyVals[-1+yyTop])); } break; case 60: //line 524 "parse.y" { yyVal = attrset(((RNode)yyVals[-2+yyTop]), ((uint)yyVals[0+yyTop])); } break; case 61: //line 528 "parse.y" { yyVal = attrset(((RNode)yyVals[-2+yyTop]), ((uint)yyVals[0+yyTop])); } break; case 62: //line 532 "parse.y" { yyVal = attrset(((RNode)yyVals[-2+yyTop]), ((uint)yyVals[0+yyTop])); } break; case 63: //line 536 "parse.y" { backref_error(((RNode)yyVals[0+yyTop])); yyVal = null; } break; case 64: //line 542 "parse.y" { yyVal = assignable(((uint)yyVals[0+yyTop]), null); } break; case 65: //line 546 "parse.y" { yyVal = aryset(((RNode)yyVals[-3+yyTop]), ((RNode)yyVals[-1+yyTop])); } break; case 66: //line 550 "parse.y" { yyVal = attrset(((RNode)yyVals[-2+yyTop]), ((uint)yyVals[0+yyTop])); } break; case 67: //line 554 "parse.y" { yyVal = attrset(((RNode)yyVals[-2+yyTop]), ((uint)yyVals[0+yyTop])); } break; case 68: //line 558 "parse.y" { yyVal = attrset(((RNode)yyVals[-2+yyTop]), ((uint)yyVals[0+yyTop])); } break; case 69: //line 562 "parse.y" { backref_error(((RNode)yyVals[0+yyTop])); yyVal = null; } break; case 70: //line 568 "parse.y" { yyerror("class/module name must be CONSTANT"); } break; case 75: //line 577 "parse.y" { lex.State = EXPR.END; if (((object)yyVals[0+yyTop]) is int) yyVal = ((int)yyVals[0+yyTop]); else yyVal = ((char)yyVals[0+yyTop]); } break; case 76: //line 585 "parse.y" { lex.State = EXPR.END; yyVal = ((uint)yyVals[0+yyTop]); } break; case 79: //line 594 "parse.y" { yyVal = new RNUndef(thread, ((uint)yyVals[0+yyTop])); } break; case 80: //line 597 "parse.y" {lex.State = EXPR.FNAME;} break; case 81: //line 598 "parse.y" { yyVal = block_append(((RNode)yyVals[-3+yyTop]), new RNUndef(thread, ((uint)yyVals[0+yyTop]))); } break; case 82: //line 602 "parse.y" { yyVal = '|'; } break; case 83: //line 603 "parse.y" { yyVal = '^'; } break; case 84: //line 604 "parse.y" { yyVal = '&'; } break; case 85: //line 605 "parse.y" { yyVal = Token.tCMP; } break; case 86: //line 606 "parse.y" { yyVal = Token.tEQ; } break; case 87: //line 607 "parse.y" { yyVal = Token.tEQQ; } break; case 88: //line 608 "parse.y" { yyVal = Token.tMATCH; } break; case 89: //line 609 "parse.y" { yyVal = '>'; } break; case 90: //line 610 "parse.y" { yyVal = Token.tGEQ; } break; case 91: //line 611 "parse.y" { yyVal = '<'; } break; case 92: //line 612 "parse.y" { yyVal = Token.tLEQ; } break; case 93: //line 613 "parse.y" { yyVal = Token.tLSHFT; } break; case 94: //line 614 "parse.y" { yyVal = Token.tRSHFT; } break; case 95: //line 615 "parse.y" { yyVal = '+'; } break; case 96: //line 616 "parse.y" { yyVal = '-'; } break; case 97: //line 617 "parse.y" { yyVal = '*'; } break; case 98: //line 618 "parse.y" { yyVal = '*'; } break; case 99: //line 619 "parse.y" { yyVal = '/'; } break; case 100: //line 620 "parse.y" { yyVal = '%'; } break; case 101: //line 621 "parse.y" { yyVal = Token.tPOW; } break; case 102: //line 622 "parse.y" { yyVal = '~'; } break; case 103: //line 623 "parse.y" { yyVal = Token.tUPLUS; } break; case 104: //line 624 "parse.y" { yyVal = Token.tUMINUS; } break; case 105: //line 625 "parse.y" { yyVal = Token.tAREF; } break; case 106: //line 626 "parse.y" { yyVal = Token.tASET; } break; case 107: //line 627 "parse.y" { yyVal = '`'; } break; case 149: //line 638 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = node_assign(((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 150: //line 642 "parse.y" {yyVal = assignable(((uint)yyVals[-1+yyTop]), null);} break; case 151: //line 643 "parse.y" { uint id = (uint)((int)yyVals[-2+yyTop]); if (((RNode)yyVals[-1+yyTop]) != null) { if (id == Token.tOROP) { ((RNode)yyVals[-1+yyTop]).val = ((RNode)yyVals[0+yyTop]); yyVal = new RNOpAsgnOr(thread, gettable(((uint)yyVals[-3+yyTop])), ((RNode)yyVals[-1+yyTop])); if (is_instance_id(((uint)yyVals[-3+yyTop]))) { ((RNode)yyVal).aid = ((uint)yyVals[-3+yyTop]); } } else if (id == Token.tANDOP) { ((RNode)yyVals[-1+yyTop]).val = ((RNode)yyVals[0+yyTop]); yyVal = new RNOpAsgnAnd(thread, gettable(((uint)yyVals[-3+yyTop])), ((RNode)yyVals[-1+yyTop])); } else { yyVal = ((RNode)yyVals[-1+yyTop]); ((RNode)yyVal).val = call_op(gettable(((uint)yyVals[-3+yyTop])),id,1,((RNode)yyVals[0+yyTop])); } ((RNode)yyVal).FixPos(((RNode)yyVals[0+yyTop])); } else { yyVal = null; } } break; case 152: //line 668 "parse.y" { RNode args = new RNArray(thread, ((RNode)yyVals[0+yyTop])); RNode tail = RNode.list_append(thread, ((RNode)yyVals[-3+yyTop]), new RNNil(thread)); RNode.list_concat(args, tail); uint id = (uint)((int)yyVals[-1+yyTop]); if (id == Token.tOROP) { id = 0; } else if (id == Token.tANDOP) { id = 1; } yyVal = new RNOpAsgn1(thread, ((RNode)yyVals[-5+yyTop]), id, args); ((RNode)yyVal).FixPos(((RNode)yyVals[-5+yyTop])); } break; case 153: //line 684 "parse.y" { uint id = (uint)((int)yyVals[-1+yyTop]); if (id == Token.tOROP) { id = 0; } else if (id == Token.tANDOP) { id = 1; } yyVal = new RNOpAsgn2(thread, ((RNode)yyVals[-4+yyTop]), ((uint)yyVals[-2+yyTop]), id, ((RNode)yyVals[0+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[-4+yyTop])); } break; case 154: //line 696 "parse.y" { uint id = (uint)((int)yyVals[-1+yyTop]); if (id == Token.tOROP) { id = 0; } else if (id == Token.tANDOP) { id = 1; } yyVal = new RNOpAsgn2(thread, ((RNode)yyVals[-4+yyTop]), ((uint)yyVals[-2+yyTop]), id, ((RNode)yyVals[0+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[-4+yyTop])); } break; case 155: //line 708 "parse.y" { uint id = (uint)((int)yyVals[-1+yyTop]); if (id == Token.tOROP) { id = 0; } else if (id == Token.tANDOP) { id = 1; } yyVal = new RNOpAsgn2(thread, ((RNode)yyVals[-4+yyTop]), ((uint)yyVals[-2+yyTop]), id, ((RNode)yyVals[0+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[-4+yyTop])); } break; case 156: //line 720 "parse.y" { backref_error(((RNode)yyVals[-2+yyTop])); yyVal = null; } break; case 157: //line 725 "parse.y" { yyVal = new RNDot2(thread, ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 158: //line 729 "parse.y" { yyVal = new RNDot3(thread, ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 159: //line 733 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), '+', 1, ((RNode)yyVals[0+yyTop])); } break; case 160: //line 737 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), '-', 1, ((RNode)yyVals[0+yyTop])); } break; case 161: //line 741 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), '*', 1, ((RNode)yyVals[0+yyTop])); } break; case 162: //line 745 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), '/', 1, ((RNode)yyVals[0+yyTop])); } break; case 163: //line 749 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), '%', 1, ((RNode)yyVals[0+yyTop])); } break; case 164: //line 753 "parse.y" { /* TODO*/ /* bool need_negate = false;*/ /* #if UMINUS*/ /* if ($1 is RNLit) {*/ /* if ($1.lit is long ||*/ /* $1.lit is double ||*/ /* $1.lit is int /* ||*/ /* $1.lit is BIGNUM * /*/ /* )*/ /* {*/ /* if (RTEST(rb_funcall($1.lit,'<',1,0))) {*/ /* $1.lit = rb_funcall($1.lit,intern("-@"),0,0);*/ /* need_negate = true;*/ /* }*/ /* }*/ /* }*/ /* #endif*/ yyVal = call_op(((RNode)yyVals[-2+yyTop]), Token.tPOW, 1, ((RNode)yyVals[0+yyTop])); /* if (need_negate) {*/ /* $$ = call_op($<RNode>$, Token.tUMINUS, 0, null);*/ /* }*/ } break; case 165: //line 778 "parse.y" { if (((RNode)yyVals[0+yyTop]) != null && ((RNode)yyVals[0+yyTop]) is RNLit) { yyVal = ((RNode)yyVals[0+yyTop]); } else { yyVal = call_op(((RNode)yyVals[0+yyTop]), Token.tUPLUS, 0, null); } } break; case 166: //line 787 "parse.y" { if (((RNode)yyVals[0+yyTop]) != null && ((RNode)yyVals[0+yyTop]) is RNLit && (((RNode)yyVals[0+yyTop]).lit is int || ((RNode)yyVals[0+yyTop]).lit is long)) { if (((RNode)yyVals[0+yyTop]).lit is int) { int i = (int)((RNode)yyVals[0+yyTop]).lit; ((RNode)yyVals[0+yyTop]).lit = -i; } else { long i = (long)((RNode)yyVals[0+yyTop]).lit; ((RNode)yyVals[0+yyTop]).lit = -i; } yyVal = ((RNode)yyVals[0+yyTop]); } else { yyVal = call_op(((RNode)yyVals[0+yyTop]), Token.tUMINUS, 0, null); } } break; case 167: //line 807 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), '|', 1, ((RNode)yyVals[0+yyTop])); } break; case 168: //line 811 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), '^', 1, ((RNode)yyVals[0+yyTop])); } break; case 169: //line 815 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), '&', 1, ((RNode)yyVals[0+yyTop])); } break; case 170: //line 819 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), Token.tCMP, 1, ((RNode)yyVals[0+yyTop])); } break; case 171: //line 823 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), '>', 1, ((RNode)yyVals[0+yyTop])); } break; case 172: //line 827 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), Token.tGEQ, 1, ((RNode)yyVals[0+yyTop])); } break; case 173: //line 831 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), '<', 1, ((RNode)yyVals[0+yyTop])); } break; case 174: //line 835 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), Token.tLEQ, 1, ((RNode)yyVals[0+yyTop])); } break; case 175: //line 839 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), Token.tEQ, 1, ((RNode)yyVals[0+yyTop])); } break; case 176: //line 843 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), Token.tEQQ, 1, ((RNode)yyVals[0+yyTop])); } break; case 177: //line 847 "parse.y" { yyVal = new RNNot(thread, call_op(((RNode)yyVals[-2+yyTop]), Token.tEQ, 1, ((RNode)yyVals[0+yyTop]))); } break; case 178: //line 851 "parse.y" { yyVal = match_gen(((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 179: //line 855 "parse.y" { yyVal = new RNNot(thread, match_gen(((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop]))); } break; case 180: //line 859 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = new RNNot(thread, cond(((RNode)yyVals[0+yyTop]))); } break; case 181: //line 864 "parse.y" { yyVal = call_op(((RNode)yyVals[0+yyTop]), '~', 0, null); } break; case 182: //line 868 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), Token.tLSHFT, 1, ((RNode)yyVals[0+yyTop])); } break; case 183: //line 872 "parse.y" { yyVal = call_op(((RNode)yyVals[-2+yyTop]), Token.tRSHFT, 1, ((RNode)yyVals[0+yyTop])); } break; case 184: //line 876 "parse.y" { yyVal = logop(typeof(RNAnd), ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 185: //line 880 "parse.y" { yyVal = logop(typeof(RNOr), ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 186: //line 883 "parse.y" {in_defined = true;} break; case 187: //line 884 "parse.y" { in_defined = false; yyVal = new RNDefined(thread, ((RNode)yyVals[0+yyTop])); } break; case 188: //line 889 "parse.y" { value_expr(((RNode)yyVals[-4+yyTop])); yyVal = new RNIf(thread, cond(((RNode)yyVals[-4+yyTop])), ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 189: //line 894 "parse.y" { yyVal = ((RNode)yyVals[0+yyTop]); } break; case 191: //line 900 "parse.y" { yyVal = new RNArray(thread, ((RNode)yyVals[-1+yyTop])); } break; case 192: //line 904 "parse.y" { yyVal = RNode.list_append(thread, ((RNode)yyVals[-3+yyTop]), ((RNode)yyVals[-1+yyTop])); } break; case 193: //line 908 "parse.y" { yyVal = ((RNode)yyVals[-1+yyTop]); } break; case 194: //line 912 "parse.y" { value_expr(((RNode)yyVals[-1+yyTop])); yyVal = arg_concat(((RNode)yyVals[-4+yyTop]), ((RNode)yyVals[-1+yyTop])); } break; case 195: //line 917 "parse.y" { yyVal = new RNArray(thread, new RNHash(thread, ((RNode)yyVals[-1+yyTop]))); } break; case 196: //line 921 "parse.y" { value_expr(((RNode)yyVals[-1+yyTop])); yyVal = new RNRestArgs(thread, ((RNode)yyVals[-1+yyTop])); } break; case 197: //line 927 "parse.y" { yyVal = ((RNode)yyVals[-1+yyTop]); } break; case 198: //line 931 "parse.y" { yyVal = ((RNode)yyVals[-2+yyTop]); } break; case 199: //line 935 "parse.y" { yyVal = new RNArray(thread, ((RNode)yyVals[-2+yyTop])); } break; case 200: //line 939 "parse.y" { yyVal = RNode.list_append(thread, ((RNode)yyVals[-4+yyTop]), ((RNode)yyVals[-2+yyTop])); } break; case 203: //line 947 "parse.y" { yyVal = new RNArray(thread, ((RNode)yyVals[0+yyTop])); } break; case 204: //line 951 "parse.y" { yyVal = RNode.list_append(thread, ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 205: //line 955 "parse.y" { yyVal = arg_blk_pass(((RNode)yyVals[-1+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 206: //line 959 "parse.y" { value_expr(((RNode)yyVals[-1+yyTop])); yyVal = arg_concat(((RNode)yyVals[-4+yyTop]), ((RNode)yyVals[-1+yyTop])); yyVal = arg_blk_pass(((RNode)yyVal), ((RNode)yyVals[0+yyTop])); } break; case 207: //line 965 "parse.y" { yyVal = new RNArray(thread, new RNHash(thread, ((RNode)yyVals[-1+yyTop]))); yyVal = arg_blk_pass(((RNode)yyVal), ((RNode)yyVals[0+yyTop])); } break; case 208: //line 970 "parse.y" { value_expr(((RNode)yyVals[-1+yyTop])); yyVal = arg_concat(new RNArray(thread, new RNHash(thread, ((RNode)yyVals[-4+yyTop]))), ((RNode)yyVals[-1+yyTop])); yyVal = arg_blk_pass(((RNode)yyVal), ((RNode)yyVals[0+yyTop])); } break; case 209: //line 976 "parse.y" { yyVal = RNode.list_append(thread, ((RNode)yyVals[-3+yyTop]), new RNHash(thread, ((RNode)yyVals[-1+yyTop]))); yyVal = arg_blk_pass(((RNode)yyVal), ((RNode)yyVals[0+yyTop])); } break; case 210: //line 981 "parse.y" { value_expr(((RNode)yyVals[-1+yyTop])); yyVal = arg_concat(RNode.list_append(thread, ((RNode)yyVals[-6+yyTop]), new RNHash(thread, ((RNode)yyVals[-4+yyTop]))), ((RNode)yyVals[-1+yyTop])); yyVal = arg_blk_pass(((RNode)yyVal), ((RNode)yyVals[0+yyTop])); } break; case 211: //line 987 "parse.y" { value_expr(((RNode)yyVals[-1+yyTop])); yyVal = arg_blk_pass(new RNRestArgs(thread, ((RNode)yyVals[-1+yyTop])), ((RNode)yyVals[0+yyTop])); } break; case 213: //line 993 "parse.y" {lex.CMDARG_PUSH();} break; case 214: //line 994 "parse.y" { lex.CMDARG_POP(); yyVal = ((RNode)yyVals[0+yyTop]); } break; case 215: //line 1000 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = new RNBlockPass(thread, ((RNode)yyVals[0+yyTop])); } break; case 216: //line 1006 "parse.y" { yyVal = ((RNode)yyVals[0+yyTop]); } break; case 218: //line 1012 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = new RNArray(thread, ((RNode)yyVals[0+yyTop])); } break; case 219: //line 1017 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = RNode.list_append(thread, ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 220: //line 1023 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = ((RNode)yyVals[0+yyTop]); } break; case 222: //line 1030 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = RNode.list_append(thread, ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 223: //line 1035 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = arg_concat(((RNode)yyVals[-3+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 224: //line 1040 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = ((RNode)yyVals[0+yyTop]); } break; case 225: //line 1046 "parse.y" { yyVal = ((RNode)yyVals[0+yyTop]); if (((RNode)yyVals[0+yyTop]) != null) { if (((RNode)yyVals[0+yyTop]) is RNArray && ((RNode)yyVals[0+yyTop]).next == null) { yyVal = ((RNode)yyVals[0+yyTop]).head; } else if (((RNode)yyVals[0+yyTop]) is RNBlockPass) { thread.CompileError("block argument should not be given"); } } } break; case 226: //line 1059 "parse.y" { yyVal = new RNLit(thread, ((object)yyVals[0+yyTop])); } break; case 228: //line 1064 "parse.y" { yyVal = new RNXStr(thread, ruby, ((object)yyVals[0+yyTop])); } break; case 234: //line 1073 "parse.y" { yyVal = new RNVCall(thread, ((uint)yyVals[0+yyTop])); } break; case 235: //line 1082 "parse.y" { RNode nd = ((RNode)yyVals[-4+yyTop]); if (((RNode)yyVals[-3+yyTop]) == null && ((RNode)yyVals[-2+yyTop]) == null && ((RNode)yyVals[-1+yyTop]) == null) yyVal = new RNBegin(thread, ((RNode)yyVals[-4+yyTop])); else { if (((RNode)yyVals[-3+yyTop]) != null) nd = new RNRescue(thread, ((RNode)yyVals[-4+yyTop]), ((RNode)yyVals[-3+yyTop]), ((RNode)yyVals[-2+yyTop])); else if (((RNode)yyVals[-2+yyTop]) != null) { ruby.warn("else without rescue is useless"); nd = block_append(((RNode)yyVals[-4+yyTop]), ((RNode)yyVals[-2+yyTop])); } if (((RNode)yyVals[-1+yyTop]) != null) nd = new RNEnsure(thread, ((RNode)yyVals[-4+yyTop]), ((RNode)yyVals[-1+yyTop])); yyVal = nd; } ((RNode)yyVal).FixPos(nd); } break; case 236: //line 1098 "parse.y" { yyVal = ((RNode)yyVals[-1+yyTop]); } break; case 237: //line 1102 "parse.y" { value_expr(((RNode)yyVals[-2+yyTop])); yyVal = new RNColon2(thread, ((RNode)yyVals[-2+yyTop]), ((uint)yyVals[0+yyTop])); } break; case 238: //line 1107 "parse.y" { yyVal = new RNColon3(thread, ((uint)yyVals[0+yyTop])); } break; case 239: //line 1111 "parse.y" { value_expr(((RNode)yyVals[-3+yyTop])); yyVal = new RNCall(thread, ((RNode)yyVals[-3+yyTop]), Token.tAREF, ((RNode)yyVals[-1+yyTop])); } break; case 240: //line 1116 "parse.y" { if (((RNode)yyVals[-1+yyTop]) == null) yyVal = new RNZArray(thread); /* zero length array*/ else { yyVal = ((RNode)yyVals[-1+yyTop]); } } break; case 241: //line 1124 "parse.y" { yyVal = new RNHash(thread, ((RNode)yyVals[-1+yyTop])); } break; case 242: //line 1128 "parse.y" { if (!compile_for_eval && in_def == 0 && in_single == 0) yyerror("return appeared outside of method"); value_expr(((RNode)yyVals[-1+yyTop])); yyVal = new RNReturn(thread, ((RNode)yyVals[-1+yyTop])); } break; case 243: //line 1135 "parse.y" { if (!compile_for_eval && in_def == 0 && in_single == 0) yyerror("return appeared outside of method"); yyVal = new RNReturn(thread); } break; case 244: //line 1141 "parse.y" { if (!compile_for_eval && in_def == 0 && in_single == 0) yyerror("return appeared outside of method"); yyVal = new RNReturn(thread); } break; case 245: //line 1147 "parse.y" { value_expr(((RNode)yyVals[-1+yyTop])); yyVal = new RNYield(thread, ((RNode)yyVals[-1+yyTop])); } break; case 246: //line 1152 "parse.y" { yyVal = new RNYield(thread); } break; case 247: //line 1156 "parse.y" { yyVal = new RNYield(thread); } break; case 248: //line 1159 "parse.y" {in_defined = true;} break; case 249: //line 1160 "parse.y" { in_defined = false; yyVal = new RNDefined(thread, ((RNode)yyVals[-1+yyTop])); } break; case 250: //line 1165 "parse.y" { ((RNode)yyVals[0+yyTop]).iter = new RNFCall(thread, ((uint)yyVals[-1+yyTop])); yyVal = ((RNode)yyVals[0+yyTop]); } break; case 252: //line 1171 "parse.y" { if (((RNode)yyVals[-1+yyTop]) != null && ((RNode)yyVals[-1+yyTop]) is RNBlockPass) { thread.CompileError("both block arg and actual block given"); } ((RNode)yyVals[0+yyTop]).iter = ((RNode)yyVals[-1+yyTop]); yyVal = ((RNode)yyVals[0+yyTop]); ((RNode)yyVal).FixPos(((RNode)yyVals[-1+yyTop])); } break; case 253: //line 1183 "parse.y" { value_expr(((RNode)yyVals[-4+yyTop])); yyVal = new RNIf(thread, cond(((RNode)yyVals[-4+yyTop])), ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[-1+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[-4+yyTop])); } break; case 254: //line 1192 "parse.y" { value_expr(((RNode)yyVals[-4+yyTop])); yyVal = new RNUnless(thread, cond(((RNode)yyVals[-4+yyTop])), ((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[-1+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[-4+yyTop])); } break; case 255: //line 1197 "parse.y" {lex.COND_PUSH();} break; case 256: //line 1197 "parse.y" {lex.COND_POP();} break; case 257: //line 1200 "parse.y" { value_expr(((RNode)yyVals[-4+yyTop])); yyVal = new RNWhile(thread, cond(((RNode)yyVals[-4+yyTop])), ((RNode)yyVals[-1+yyTop]), true); ((RNode)yyVal).FixPos(((RNode)yyVals[-4+yyTop])); } break; case 258: //line 1205 "parse.y" {lex.COND_PUSH();} break; case 259: //line 1205 "parse.y" {lex.COND_POP();} break; case 260: //line 1208 "parse.y" { value_expr(((RNode)yyVals[-4+yyTop])); yyVal = new RNUntil(thread, cond(((RNode)yyVals[-4+yyTop])), ((RNode)yyVals[-1+yyTop]), true); ((RNode)yyVal).FixPos(((RNode)yyVals[-4+yyTop])); } break; case 261: //line 1216 "parse.y" { value_expr(((RNode)yyVals[-3+yyTop])); yyVal = new RNCase(thread, ((RNode)yyVals[-3+yyTop]), ((RNode)yyVals[-1+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[-3+yyTop])); } break; case 262: //line 1222 "parse.y" { yyVal = ((RNode)yyVals[-1+yyTop]); } break; case 263: //line 1225 "parse.y" {lex.COND_PUSH();} break; case 264: //line 1225 "parse.y" {lex.COND_POP();} break; case 265: //line 1228 "parse.y" { value_expr(((RNode)yyVals[-4+yyTop])); yyVal = new RNFor(thread, ((RNode)yyVals[-7+yyTop]), ((RNode)yyVals[-4+yyTop]), ((RNode)yyVals[-1+yyTop])); } break; case 266: //line 1233 "parse.y" { if (in_def != 0|| in_single != 0) yyerror("class definition in method body"); class_nest++; thread.LocalPush(); yyVal = sourceline; } break; case 267: //line 1242 "parse.y" { yyVal = new RNClass(thread, ((uint)yyVals[-4+yyTop]), ((RNode)yyVals[-1+yyTop]), ((RNode)yyVals[-3+yyTop])); ((RNode)yyVal).SetLine(((int)yyVals[-2+yyTop])); thread.LocalPop(); class_nest--; } break; case 268: //line 1249 "parse.y" { yyVal = in_def; in_def = 0; } break; case 269: //line 1254 "parse.y" { yyVal = in_single; in_single = 0; class_nest++; thread.LocalPush(); } break; case 270: //line 1262 "parse.y" { yyVal = new RNSClass(thread, ((RNode)yyVals[-5+yyTop]), ((RNode)yyVals[-1+yyTop])); thread.LocalPop(); class_nest--; in_def = ((int)yyVals[-4+yyTop]); in_single = ((int)yyVals[-2+yyTop]); } break; case 271: //line 1270 "parse.y" { if (in_def != 0|| in_single != 0) yyerror("module definition in method body"); class_nest++; thread.LocalPush(); yyVal = sourceline; } break; case 272: //line 1279 "parse.y" { yyVal = new RNModule(thread, ((uint)yyVals[-3+yyTop]), ((RNode)yyVals[-1+yyTop])); ((RNode)yyVal).SetLine(((int)yyVals[-2+yyTop])); thread.LocalPop(); class_nest--; } break; case 273: //line 1286 "parse.y" { if (in_def != 0|| in_single != 0) yyerror("nested method definition"); yyVal = cur_mid; if (((object)yyVals[0+yyTop]) is uint) cur_mid = ((uint)yyVals[0+yyTop]); else cur_mid = (uint)((int)yyVals[0+yyTop]); in_def++; thread.LocalPush(); } break; case 274: //line 1303 "parse.y" { RNode nd = ((RNode)yyVals[-4+yyTop]); if (((RNode)yyVals[-3+yyTop]) != null) nd = new RNRescue(thread, ((RNode)yyVals[-4+yyTop]), ((RNode)yyVals[-3+yyTop]), ((RNode)yyVals[-2+yyTop])); else if (((RNode)yyVals[-2+yyTop]) != null) { ruby.warn("else without rescue is useless"); nd = block_append(((RNode)yyVals[-4+yyTop]), ((RNode)yyVals[-2+yyTop])); } if (((RNode)yyVals[-1+yyTop]) != null) nd = new RNEnsure(thread, ((RNode)yyVals[-4+yyTop]), ((RNode)yyVals[-1+yyTop])); /* NOEX_PRIVATE for toplevel */ uint id; if (((object)yyVals[-7+yyTop]) is uint) { id = ((uint)yyVals[-7+yyTop]); } else { id = (uint)((int)yyVals[-7+yyTop]); } yyVal = new RNDefn(thread, id, ((RNode)yyVals[-5+yyTop]), nd, (class_nest > 0) ? NOEX.PUBLIC : NOEX.PRIVATE); if (is_attrset_id(id)) ((RNode)yyVal).noex = NOEX.PUBLIC; ((RNode)yyVal).FixPos(((RNode)yyVals[-5+yyTop])); thread.LocalPop(); in_def--; cur_mid = ((uint)yyVals[-6+yyTop]); } break; case 275: //line 1329 "parse.y" {lex.State = EXPR.FNAME;} break; case 276: //line 1330 "parse.y" { value_expr(((RNode)yyVals[-3+yyTop])); in_single++; thread.LocalPush(); lex.State = EXPR.END; /* force for args */ } break; case 277: //line 1342 "parse.y" { RNode nd = ((RNode)yyVals[-4+yyTop]); if (((RNode)yyVals[-3+yyTop]) != null) nd = new RNRescue(thread, ((RNode)yyVals[-4+yyTop]), ((RNode)yyVals[-3+yyTop]), ((RNode)yyVals[-2+yyTop])); else if (((RNode)yyVals[-2+yyTop]) != null) { ruby.warn("else without rescue is useless"); nd = block_append(((RNode)yyVals[-4+yyTop]), ((RNode)yyVals[-2+yyTop])); } if (((RNode)yyVals[-1+yyTop]) != null) nd = new RNEnsure(thread, ((RNode)yyVals[-4+yyTop]), ((RNode)yyVals[-1+yyTop])); yyVal = new RNDefs(thread, ((RNode)yyVals[-10+yyTop]), ((uint)yyVals[-7+yyTop]), ((RNode)yyVals[-5+yyTop]), nd); ((RNode)yyVal).FixPos(((RNode)yyVals[-10+yyTop])); thread.LocalPop(); in_single--; } break; case 278: //line 1357 "parse.y" { yyVal = new RNBreak(thread); } break; case 279: //line 1361 "parse.y" { yyVal = new RNNext(thread); } break; case 280: //line 1365 "parse.y" { yyVal = new RNRedo(thread); } break; case 281: //line 1369 "parse.y" { yyVal = new RNRetry(thread); } break; case 288: //line 1384 "parse.y" { value_expr(((RNode)yyVals[-3+yyTop])); yyVal = new RNIf(thread, cond(((RNode)yyVals[-3+yyTop])), ((RNode)yyVals[-1+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 290: //line 1391 "parse.y" { yyVal = ((RNode)yyVals[0+yyTop]); } break; case 294: //line 1400 "parse.y" { yyVal = new RNBlockNoArg(thread); } break; case 295: //line 1404 "parse.y" { yyVal = new RNBlockNoArg(thread); } break; case 296: //line 1408 "parse.y" { yyVal = ((RNode)yyVals[-1+yyTop]); } break; case 297: //line 1414 "parse.y" { yyVal = thread.DynaPush(); } break; case 298: //line 1420 "parse.y" { yyVal = new RNIter(thread, ((RNode)yyVals[-2+yyTop]), null, ((RNode)yyVals[-1+yyTop])); ((RNode)yyVal).FixPos((((RNode)yyVals[-2+yyTop]) != null) ? ((RNode)yyVals[-2+yyTop]) : ((RNode)yyVals[-1+yyTop])); thread.DynaPop(((RVarmap)yyVals[-3+yyTop])); } break; case 299: //line 1427 "parse.y" { if (((RNode)yyVals[-1+yyTop]) != null && ((RNode)yyVals[-1+yyTop]) is RNBlockPass) { thread.CompileError("both block arg and actual block given"); } ((RNode)yyVals[0+yyTop]).iter = ((RNode)yyVals[-1+yyTop]); yyVal = ((RNode)yyVals[0+yyTop]); ((RNode)yyVal).FixPos(((RNode)yyVals[0+yyTop])); } break; case 300: //line 1436 "parse.y" { value_expr(((RNode)yyVals[-3+yyTop])); yyVal = new_call(((RNode)yyVals[-3+yyTop]), ((uint)yyVals[-1+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 301: //line 1441 "parse.y" { value_expr(((RNode)yyVals[-3+yyTop])); yyVal = new_call(((RNode)yyVals[-3+yyTop]), ((uint)yyVals[-1+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 302: //line 1447 "parse.y" { yyVal = new_fcall(((uint)yyVals[-1+yyTop]), ((RNode)yyVals[0+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[0+yyTop])); } break; case 303: //line 1452 "parse.y" { value_expr(((RNode)yyVals[-3+yyTop])); yyVal = new_call(((RNode)yyVals[-3+yyTop]), ((uint)yyVals[-1+yyTop]), ((RNode)yyVals[0+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[-3+yyTop])); } break; case 304: //line 1458 "parse.y" { value_expr(((RNode)yyVals[-3+yyTop])); yyVal = new_call(((RNode)yyVals[-3+yyTop]), ((uint)yyVals[-1+yyTop]), ((RNode)yyVals[0+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[-3+yyTop])); } break; case 305: //line 1464 "parse.y" { value_expr(((RNode)yyVals[-2+yyTop])); yyVal = new_call(((RNode)yyVals[-2+yyTop]), ((uint)yyVals[0+yyTop]), null); } break; case 306: //line 1469 "parse.y" { if (!compile_for_eval && in_def == 0 && in_single == 0 && !in_defined) yyerror("super called outside of method"); yyVal = new_super(((RNode)yyVals[0+yyTop])); } break; case 307: //line 1476 "parse.y" { if (!compile_for_eval && in_def == 0 && in_single == 0 && !in_defined) yyerror("super called outside of method"); yyVal = new RNZSuper(thread, ruby); } break; case 308: //line 1484 "parse.y" { yyVal = thread.DynaPush(); } break; case 309: //line 1489 "parse.y" { yyVal = new RNIter(thread, ((RNode)yyVals[-2+yyTop]), null, ((RNode)yyVals[-1+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[-1+yyTop])); thread.DynaPop(((RVarmap)yyVals[-3+yyTop])); } break; case 310: //line 1495 "parse.y" { yyVal = thread.DynaPush(); } break; case 311: //line 1500 "parse.y" { yyVal = new RNIter(thread, ((RNode)yyVals[-2+yyTop]), null, ((RNode)yyVals[-1+yyTop])); ((RNode)yyVal).FixPos(((RNode)yyVals[-1+yyTop])); thread.DynaPop(((RVarmap)yyVals[-3+yyTop])); } break; case 312: //line 1509 "parse.y" { yyVal = new RNWhen(thread, ((RNode)yyVals[-3+yyTop]), ((RNode)yyVals[-1+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 314: //line 1515 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = RNode.list_append(thread, ((RNode)yyVals[-3+yyTop]), new RNWhen(thread, ((RNode)yyVals[0+yyTop]))); } break; case 315: //line 1520 "parse.y" { value_expr(((RNode)yyVals[0+yyTop])); yyVal = new RNArray(thread, new RNWhen(thread, ((RNode)yyVals[0+yyTop]))); } break; case 320: //line 1532 "parse.y" { yyVal = ((RNode)yyVals[0+yyTop]); } break; case 322: //line 1540 "parse.y" { RNode nd = ((RNode)yyVals[-3+yyTop]); RNode nd2 = ((RNode)yyVals[-1+yyTop]); if (nd != null) { nd = node_assign(((RNode)yyVals[-3+yyTop]), new RNGVar(thread, ruby, intern("$!"))); nd2 = block_append(nd, ((RNode)yyVals[-1+yyTop])); } yyVal = new RNResBody(thread, ((RNode)yyVals[-4+yyTop]), nd2, ((RNode)yyVals[0+yyTop])); ((RNode)yyVal).FixPos((((RNode)yyVals[-4+yyTop]) != null) ? ((RNode)yyVals[-4+yyTop]) : nd2); } break; case 325: //line 1554 "parse.y" { if (((RNode)yyVals[0+yyTop]) != null) yyVal = ((RNode)yyVals[0+yyTop]); else /* place holder */ yyVal = new RNNil(thread); } break; case 327: //line 1564 "parse.y" { if (((object)yyVals[0+yyTop]) is uint) yyVal = Symbol.ID2SYM(((uint)yyVals[0+yyTop])); else yyVal = Symbol.ID2SYM(((char)yyVals[0+yyTop])); } break; case 329: //line 1574 "parse.y" { yyVal = new RNStr(thread, ruby, ((object)yyVals[0+yyTop])); } break; case 331: //line 1579 "parse.y" { string s = ((object)yyVals[0+yyTop]).ToString(); if (((RNode)yyVals[-1+yyTop]) is RNDStr) { RNode.list_append(thread, ((RNode)yyVals[-1+yyTop]), new RNStr(thread, ruby, s)); } else { #if STRCONCAT rb_str_concat(((RNode)yyVals[-1+yyTop]).lit, ((object)yyVals[0+yyTop])); #else ((RNode)yyVals[-1+yyTop]).lit = new RString(ruby, (((RNode)yyVals[-1+yyTop]).lit).ToString() + s); #endif } yyVal = ((RNode)yyVals[-1+yyTop]); } break; case 332: //line 1595 "parse.y" { if (((RNode)yyVals[-1+yyTop]) is RNStr) { yyVal = new RNDStr(thread, ruby, ((RNode)yyVals[-1+yyTop]).lit); } else { yyVal = ((RNode)yyVals[-1+yyTop]); } /* Bugfix*/ /* $2.head = new RNStr(thread, ruby, $2.lit);*/ RNode.list_concat(((RNode)yyVal), new RNArray(thread, ((RNode)yyVals[0+yyTop]))); } break; case 333: //line 1608 "parse.y" { lex.State = EXPR.END; if (((object)yyVals[0+yyTop]) is uint) yyVal = ((uint)yyVals[0+yyTop]); else yyVal = ((char)yyVals[0+yyTop]); } break; case 345: //line 1629 "parse.y" {yyVal = (uint)Token.kNIL;} break; case 346: //line 1630 "parse.y" {yyVal = (uint)Token.kSELF;} break; case 347: //line 1631 "parse.y" {yyVal = (uint)Token.kTRUE;} break; case 348: //line 1632 "parse.y" {yyVal = (uint)Token.kFALSE;} break; case 349: //line 1633 "parse.y" {yyVal = (uint)Token.k__FILE__;} break; case 350: //line 1634 "parse.y" {yyVal = (uint)Token.k__LINE__;} break; case 351: //line 1637 "parse.y" { yyVal = gettable(((uint)yyVals[0+yyTop])); } break; case 354: //line 1645 "parse.y" { yyVal = null; } break; case 355: //line 1649 "parse.y" { lex.State = EXPR.BEG; } break; case 356: //line 1653 "parse.y" { yyVal = ((RNode)yyVals[-1+yyTop]); } break; case 357: //line 1656 "parse.y" {yyErrorFlag = 0; yyVal = null;} break; case 358: //line 1659 "parse.y" { yyVal = ((RNode)yyVals[-2+yyTop]); lex.State = EXPR.BEG; } break; case 359: //line 1664 "parse.y" { yyVal = ((RNode)yyVals[-1+yyTop]); } break; case 360: //line 1669 "parse.y" { yyVal = block_append(new RNArgs(thread, ((int)yyVals[-5+yyTop]), ((RNode)yyVals[-3+yyTop]), ((int)yyVals[-1+yyTop])), ((RNode)yyVals[0+yyTop])); } break; case 361: //line 1673 "parse.y" { yyVal = block_append(new RNArgs(thread, ((int)yyVals[-3+yyTop]), ((RNode)yyVals[-1+yyTop]), -1), ((RNode)yyVals[0+yyTop])); } break; case 362: //line 1677 "parse.y" { yyVal = block_append(new RNArgs(thread, ((int)yyVals[-3+yyTop]), null, ((int)yyVals[-1+yyTop])), ((RNode)yyVals[0+yyTop])); } break; case 363: //line 1681 "parse.y" { yyVal = block_append(new RNArgs(thread, ((int)yyVals[-1+yyTop]), null, -1), ((RNode)yyVals[0+yyTop])); } break; case 364: //line 1685 "parse.y" { yyVal = block_append(new RNArgs(thread, 0, ((RNode)yyVals[-3+yyTop]), ((uint)yyVals[-1+yyTop])), ((RNode)yyVals[0+yyTop])); } break; case 365: //line 1689 "parse.y" { yyVal = block_append(new RNArgs(thread, 0, ((RNode)yyVals[-1+yyTop]), -1), ((RNode)yyVals[0+yyTop])); } break; case 366: //line 1693 "parse.y" { yyVal = block_append(new RNArgs(thread, 0, null, ((int)yyVals[-1+yyTop])), ((RNode)yyVals[0+yyTop])); } break; case 367: //line 1697 "parse.y" { yyVal = block_append(new RNArgs(thread, 0, null, -1), ((RNode)yyVals[0+yyTop])); } break; case 368: //line 1701 "parse.y" { yyVal = new RNArgs(thread, 0, null, -1); } break; case 369: //line 1706 "parse.y" { yyerror("formal argument cannot be a constant"); } break; case 370: //line 1710 "parse.y" { yyerror("formal argument cannot be an instance variable"); } break; case 371: //line 1714 "parse.y" { yyerror("formal argument cannot be a global variable"); } break; case 372: //line 1718 "parse.y" { yyerror("formal argument cannot be a class variable"); } break; case 373: //line 1722 "parse.y" { if (!is_local_id(((uint)yyVals[0+yyTop]))) yyerror("formal argument must be local variable"); else if (thread.LocalID(((uint)yyVals[0+yyTop]))) yyerror("duplicate argument name"); thread.LocalCnt(((uint)yyVals[0+yyTop])); yyVal = 1; } break; case 375: //line 1733 "parse.y" { yyVal = ((int)yyVal) + 1; } break; case 376: //line 1738 "parse.y" { if (!is_local_id(((uint)yyVals[-2+yyTop]))) yyerror("formal argument must be local variable"); else if (thread.LocalID(((uint)yyVals[-2+yyTop]))) yyerror("duplicate optional argument name"); yyVal = assignable(((uint)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 377: //line 1747 "parse.y" { yyVal = new RNBlock(thread, ((RNode)yyVals[0+yyTop])); ((RNode)yyVal).end = ((RNode)yyVal); } break; case 378: //line 1752 "parse.y" { yyVal = block_append(((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 379: //line 1757 "parse.y" { if (!is_local_id(((uint)yyVals[0+yyTop]))) yyerror("rest argument must be local variable"); else if (thread.LocalID(((uint)yyVals[0+yyTop]))) yyerror("duplicate rest argument name"); yyVal = thread.LocalCnt(((uint)yyVals[0+yyTop])); } break; case 380: //line 1765 "parse.y" { yyVal = -2; } break; case 381: //line 1770 "parse.y" { if (!is_local_id(((uint)yyVals[0+yyTop]))) yyerror("block argument must be local variable"); else if (thread.LocalID(((uint)yyVals[0+yyTop]))) yyerror("duplicate block argument name"); yyVal = new RNBlockArg(thread, ((uint)yyVals[0+yyTop]), thread.LocalCnt(((uint)yyVals[0+yyTop]))); } break; case 382: //line 1779 "parse.y" { yyVal = ((RNode)yyVals[0+yyTop]); } break; case 384: //line 1785 "parse.y" { if (((RNode)yyVals[0+yyTop]) is RNSelf) { yyVal = new RNSelf(thread); } else { yyVal = ((RNode)yyVals[0+yyTop]); } } break; case 385: //line 1793 "parse.y" {lex.State = EXPR.BEG;} break; case 386: //line 1794 "parse.y" { if (((RNode)yyVals[-2+yyTop]) is RNStr || ((RNode)yyVals[-2+yyTop]) is RNDStr || ((RNode)yyVals[-2+yyTop]) is RNXStr || ((RNode)yyVals[-2+yyTop]) is RNDXStr || ((RNode)yyVals[-2+yyTop]) is RNDRegx || ((RNode)yyVals[-2+yyTop]) is RNLit || ((RNode)yyVals[-2+yyTop]) is RNArray || ((RNode)yyVals[-2+yyTop]) is RNZArray) { yyerror("can't define single method for literals."); } yyVal = ((RNode)yyVals[-2+yyTop]); } break; case 388: //line 1811 "parse.y" { yyVal = ((RNode)yyVals[-1+yyTop]); } break; case 389: //line 1815 "parse.y" { if (((RNode)yyVals[-1+yyTop]).alen % 2 != 0) { yyerror("odd number list for Hash"); } yyVal = ((RNode)yyVals[-1+yyTop]); } break; case 391: //line 1824 "parse.y" { yyVal = RNode.list_concat(((RNode)yyVals[-2+yyTop]), ((RNode)yyVals[0+yyTop])); } break; case 392: //line 1829 "parse.y" { yyVal = RNode.list_append(thread, new RNArray(thread, ((RNode)yyVals[-2+yyTop])), ((RNode)yyVals[0+yyTop])); } break; case 412: //line 1859 "parse.y" {yyErrorFlag = 0;} break; case 415: //line 1863 "parse.y" {yyErrorFlag = 0;} break; case 416: //line 1866 "parse.y" { yyVal = null; } break; //line default } yyTop -= yyLen[yyN]; yyState = yyStates[yyTop]; int yyM = yyLhs[yyN]; if (yyState == 0 && yyM == 0) { //t if (yydebug != null) yydebug.shift(0, yyFinal); yyState = yyFinal; if (yyToken < 0) { yyToken = yyLex.advance() ? yyLex.token() : 0; //t if (yydebug != null) //t yydebug.lex(yyState, yyToken,yyname(yyToken), yyLex.value()); } if (yyToken == 0) { //t if (yydebug != null) yydebug.accept(yyVal); return yyVal; } goto yyLoop; } if (((yyN = yyGindex[yyM]) != 0) && ((yyN += yyState) >= 0) && (yyN < yyTable.Length) && (yyCheck[yyN] == yyState)) yyState = yyTable[yyN]; else yyState = yyDgoto[yyM]; //t if (yydebug != null) yydebug.shift(yyStates[yyTop], yyState); goto yyLoop; } } }