case 290:
// line 1078 "DefaultRubyParser.y"
{
if (((Node)yyVals[-1+yyTop]) != null &&
((BlockAcceptingNode)yyVals[-1+yyTop]).getIterNode() instanceof BlockPassNode) {
throw new SyntaxException(PID.BLOCK_ARG_AND_BLOCK_GIVEN, getPosition(((Node)yyVals[-1+yyTop])), "Both block arg and actual block given.");
}
yyVal = ((BlockAcceptingNode)yyVals[-1+yyTop]).setIterNode(((IterNode)yyVals[0+yyTop]));
((Node)yyVal).setPosition(support.union(((Node)yyVals[-1+yyTop]), ((IterNode)yyVals[0+yyTop])));
}
break;
case 291:
// line 1086 "DefaultRubyParser.y"
{
yyVal = new IfNode(support.union(((Token)yyVals[-5+yyTop]), ((Token)yyVals[0+yyTop])), support.getConditionNode(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-2+yyTop]), ((Node)yyVals[-1+yyTop]));
}
break;
case 292:
// line 1089 "DefaultRubyParser.y"
{
yyVal = new IfNode(support.union(((Token)yyVals[-5+yyTop]), ((Token)yyVals[0+yyTop])), support.getConditionNode(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[-2+yyTop]));
}
break;
case 293:
// line 1092 "DefaultRubyParser.y"
{
lexer.getConditionState().begin();
}
break;
case 294:
// line 1094 "DefaultRubyParser.y"
{
lexer.getConditionState().end();
}
break;
case 295:
// line 1096 "DefaultRubyParser.y"
{
Node body = ((Node)yyVals[-1+yyTop]) == null ? NilImplicitNode.NIL : ((Node)yyVals[-1+yyTop]);
yyVal = new WhileNode(support.union(((Token)yyVals[-6+yyTop]), ((Token)yyVals[0+yyTop])), support.getConditionNode(((Node)yyVals[-4+yyTop])), body);
}
break;
case 296:
// line 1100 "DefaultRubyParser.y"
{
lexer.getConditionState().begin();
}
break;
case 297:
// line 1102 "DefaultRubyParser.y"
{
lexer.getConditionState().end();
}
break;
case 298:
// line 1104 "DefaultRubyParser.y"
{
Node body = ((Node)yyVals[-1+yyTop]) == null ? NilImplicitNode.NIL : ((Node)yyVals[-1+yyTop]);
yyVal = new UntilNode(getPosition(((Token)yyVals[-6+yyTop])), support.getConditionNode(((Node)yyVals[-4+yyTop])), body);
}
break;
case 299:
// line 1108 "DefaultRubyParser.y"
{
yyVal = new CaseNode(support.union(((Token)yyVals[-4+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-3+yyTop]), ((Node)yyVals[-1+yyTop]));
}
break;
case 300:
// line 1111 "DefaultRubyParser.y"
{
/* TODO: MRI is just a when node. We need this extra logic for IDE consumers (null in casenode statement should be implicit nil)*/
/* if (support.getConfiguration().hasExtraPositionInformation()) {*/
yyVal = new CaseNode(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])), null, ((Node)yyVals[-1+yyTop]));
/* } else {*/
/* $$ = $3;*/
/* }*/
}
break;
case 301:
// line 1119 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[-1+yyTop]);
}
break;
case 302:
// line 1122 "DefaultRubyParser.y"
{
lexer.getConditionState().begin();
}
break;
case 303:
// line 1124 "DefaultRubyParser.y"
{
lexer.getConditionState().end();
}
break;
case 304:
// line 1126 "DefaultRubyParser.y"
{
yyVal = new ForNode(support.union(((Token)yyVals[-8+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-7+yyTop]), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[-4+yyTop]));
}
break;
case 305:
// line 1129 "DefaultRubyParser.y"
{
if (support.isInDef() || support.isInSingle()) {
yyerror("class definition in method body");
}
support.pushLocalScope();
}
break;
case 306:
// line 1134 "DefaultRubyParser.y"
{
Node body = ((Node)yyVals[-1+yyTop]) == null ? NilImplicitNode.NIL : ((Node)yyVals[-1+yyTop]);
yyVal = new ClassNode(support.union(((Token)yyVals[-5+yyTop]), ((Token)yyVals[0+yyTop])), ((Colon3Node)yyVals[-4+yyTop]), support.getCurrentScope(), body, ((Node)yyVals[-3+yyTop]));
support.popCurrentScope();
}
break;
case 307:
// line 1140 "DefaultRubyParser.y"
{
yyVal = new Boolean(support.isInDef());
support.setInDef(false);
}
break;
case 308:
// line 1143 "DefaultRubyParser.y"
{
yyVal = new Integer(support.getInSingle());
support.setInSingle(0);
support.pushLocalScope();
}
break;
case 309:
// line 1147 "DefaultRubyParser.y"
{
yyVal = new SClassNode(support.union(((Token)yyVals[-7+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-5+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]));
support.popCurrentScope();
support.setInDef(((Boolean)yyVals[-4+yyTop]).booleanValue());
support.setInSingle(((Integer)yyVals[-2+yyTop]).intValue());
}
break;
case 310:
// line 1153 "DefaultRubyParser.y"
{
if (support.isInDef() || support.isInSingle()) {
yyerror("module definition in method body");
}
support.pushLocalScope();
}
break;
case 311:
// line 1158 "DefaultRubyParser.y"
{
Node body = ((Node)yyVals[-1+yyTop]) == null ? NilImplicitNode.NIL : ((Node)yyVals[-1+yyTop]);
yyVal = new ModuleNode(support.union(((Token)yyVals[-4+yyTop]), ((Token)yyVals[0+yyTop])), ((Colon3Node)yyVals[-3+yyTop]), support.getCurrentScope(), body);
support.popCurrentScope();
}
break;
case 312:
// line 1164 "DefaultRubyParser.y"
{
support.setInDef(true);
support.pushLocalScope();
}
break;
case 313:
// line 1167 "DefaultRubyParser.y"
{
/* TODO: We should use implicit nil for body, but problem (punt til later)*/
Node body = ((Node)yyVals[-1+yyTop]); /*$5 == null ? NilImplicitNode.NIL : $5;*/
/* NOEX_PRIVATE for toplevel */
yyVal = new DefnNode(support.union(((Token)yyVals[-5+yyTop]), ((Token)yyVals[0+yyTop])), new ArgumentNode(((Token)yyVals[-4+yyTop]).getPosition(), (String) ((Token)yyVals[-4+yyTop]).getValue()), ((ArgsNode)yyVals[-2+yyTop]), support.getCurrentScope(), body);
support.popCurrentScope();
support.setInDef(false);
}
break;
case 314:
// line 1176 "DefaultRubyParser.y"
{
lexer.setState(LexState.EXPR_FNAME);
}
break;
case 315:
// line 1178 "DefaultRubyParser.y"
{
support.setInSingle(support.getInSingle() + 1);
support.pushLocalScope();
lexer.setState(LexState.EXPR_END); /* force for args */
}
break;
case 316:
// line 1182 "DefaultRubyParser.y"
{
/* TODO: We should use implicit nil for body, but problem (punt til later)*/
Node body = ((Node)yyVals[-1+yyTop]); /*$8 == null ? NilImplicitNode.NIL : $8;*/
yyVal = new DefsNode(support.union(((Token)yyVals[-8+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-7+yyTop]), new ArgumentNode(((Token)yyVals[-4+yyTop]).getPosition(), (String) ((Token)yyVals[-4+yyTop]).getValue()), ((ArgsNode)yyVals[-2+yyTop]), support.getCurrentScope(), body);
support.popCurrentScope();
support.setInSingle(support.getInSingle() - 1);
}
break;
case 317:
// line 1190 "DefaultRubyParser.y"
{
yyVal = new BreakNode(((Token)yyVals[0+yyTop]).getPosition(), NilImplicitNode.NIL);
}
break;
case 318:
// line 1193 "DefaultRubyParser.y"
{
yyVal = new NextNode(((Token)yyVals[0+yyTop]).getPosition(), NilImplicitNode.NIL);
}
break;
case 319:
// line 1196 "DefaultRubyParser.y"
{
yyVal = new RedoNode(((Token)yyVals[0+yyTop]).getPosition());
}
break;
case 320:
// line 1199 "DefaultRubyParser.y"
{
yyVal = new RetryNode(((Token)yyVals[0+yyTop]).getPosition());
}
break;
case 321:
// line 1203 "DefaultRubyParser.y"
{
support.checkExpression(((Node)yyVals[0+yyTop]));
yyVal = ((Node)yyVals[0+yyTop]);
}
break;
case 330:
// line 1218 "DefaultRubyParser.y"
{
/*mirko: support.union($<ISourcePositionHolder>1.getPosition(), getPosition($<ISourcePositionHolder>1)) ?*/
yyVal = new IfNode(getPosition(((Token)yyVals[-4+yyTop])), support.getConditionNode(((Node)yyVals[-3+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
}
break;
case 332:
// line 1224 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[0+yyTop]);
}
break;
case 334:
// line 1229 "DefaultRubyParser.y"
{}
break;
case 336:
// line 1232 "DefaultRubyParser.y"
{
yyVal = new ZeroArgNode(support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop])));
}
break;
case 337:
// line 1235 "DefaultRubyParser.y"
{
yyVal = new ZeroArgNode(((Token)yyVals[0+yyTop]).getPosition());
}
break;
case 338:
// line 1238 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[-1+yyTop]);
/* Include pipes on multiple arg type*/
if (((Node)yyVals[-1+yyTop]) instanceof MultipleAsgnNode) {
((Node)yyVals[-1+yyTop]).setPosition(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
}
}
break;
case 339:
// line 1247 "DefaultRubyParser.y"
{
support.pushBlockScope();
}
break;
case 340:
// line 1249 "DefaultRubyParser.y"
{
yyVal = new IterNode(support.union(((Token)yyVals[-4+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]));
support.popCurrentScope();
}
break;
case 341:
// line 1255 "DefaultRubyParser.y"
{
if (((BlockAcceptingNode)yyVals[-1+yyTop]).getIterNode() instanceof BlockPassNode) {
throw new SyntaxException(PID.BLOCK_ARG_AND_BLOCK_GIVEN, getPosition(((Node)yyVals[-1+yyTop])), "Both block arg and actual block given.");
}
yyVal = ((BlockAcceptingNode)yyVals[-1+yyTop]).setIterNode(((IterNode)yyVals[0+yyTop]));
((Node)yyVal).setPosition(support.union(((Node)yyVals[-1+yyTop]), ((IterNode)yyVals[0+yyTop])));
}
break;