}
break;
case 223:
// line 867 "DefaultRubyParser.y"
{
yyVal = new ArrayNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
}
break;
case 224:
// line 870 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[-2+yyTop]);
((Node)yyVal).setPosition(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])));
}
break;
case 225:
// line 874 "DefaultRubyParser.y"
{
yyVal = support.newArrayNode(getPosition(((Token)yyVals[-3+yyTop])), ((Node)yyVals[-2+yyTop]));
}
break;
case 226:
// line 877 "DefaultRubyParser.y"
{
yyVal = ((ListNode)yyVals[-4+yyTop]).add(((Node)yyVals[-2+yyTop]));
}
break;
case 229:
// line 884 "DefaultRubyParser.y"
{
yyVal = support.newArrayNode(getPosition(((Node)yyVals[0+yyTop])), ((Node)yyVals[0+yyTop]));
}
break;
case 230:
// line 887 "DefaultRubyParser.y"
{
yyVal = support.arg_blk_pass(((ListNode)yyVals[-1+yyTop]), ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 231:
// line 890 "DefaultRubyParser.y"
{
yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-4+yyTop])), ((ListNode)yyVals[-4+yyTop]), ((Node)yyVals[-1+yyTop]));
yyVal = support.arg_blk_pass(((Node)yyVal), ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 232:
// line 894 "DefaultRubyParser.y"
{
yyVal = support.newArrayNode(getPosition(((ListNode)yyVals[-1+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 233:
// line 898 "DefaultRubyParser.y"
{
yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-4+yyTop])), support.newArrayNode(getPosition(((ListNode)yyVals[-4+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 234:
// line 902 "DefaultRubyParser.y"
{
yyVal = ((ListNode)yyVals[-3+yyTop]).add(new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 235:
// line 906 "DefaultRubyParser.y"
{
support.checkExpression(((Node)yyVals[-1+yyTop]));
yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-6+yyTop])), ((ListNode)yyVals[-6+yyTop]).add(new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 236:
// line 911 "DefaultRubyParser.y"
{
yyVal = support.arg_blk_pass(support.newSplatNode(getPosition(((Token)yyVals[-2+yyTop])), ((Node)yyVals[-1+yyTop])), ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 237:
// line 914 "DefaultRubyParser.y"
{}
break;
case 238:
// line 916 "DefaultRubyParser.y"
{
yyVal = support.arg_blk_pass(support.newArrayNode(getPosition(((Node)yyVals[-3+yyTop])), ((Node)yyVals[-3+yyTop])).addAll(((ListNode)yyVals[-1+yyTop])), ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 239:
// line 919 "DefaultRubyParser.y"
{
yyVal = support.arg_blk_pass(support.newArrayNode(getPosition(((Node)yyVals[-2+yyTop])), ((Node)yyVals[-2+yyTop])), ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 240:
// line 922 "DefaultRubyParser.y"
{
yyVal = support.arg_concat(getPosition(((Node)yyVals[-4+yyTop])), support.newArrayNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop])), ((Node)yyVals[-1+yyTop]));
yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 241:
// line 926 "DefaultRubyParser.y"
{
yyVal = support.arg_concat(getPosition(((Node)yyVals[-6+yyTop])), support.newArrayNode(getPosition(((Node)yyVals[-6+yyTop])), ((Node)yyVals[-6+yyTop])).addAll(new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 242:
// line 930 "DefaultRubyParser.y"
{
yyVal = support.newArrayNode(getPosition(((ListNode)yyVals[-1+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 243:
// line 934 "DefaultRubyParser.y"
{
yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-4+yyTop])), support.newArrayNode(getPosition(((ListNode)yyVals[-4+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 244:
// line 938 "DefaultRubyParser.y"
{
yyVal = support.newArrayNode(getPosition(((Node)yyVals[-3+yyTop])), ((Node)yyVals[-3+yyTop])).add(new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 245:
// line 942 "DefaultRubyParser.y"
{
yyVal = support.newArrayNode(getPosition(((Node)yyVals[-5+yyTop])), ((Node)yyVals[-5+yyTop])).addAll(((ListNode)yyVals[-3+yyTop])).add(new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 246:
// line 946 "DefaultRubyParser.y"
{
yyVal = support.arg_concat(getPosition(((Node)yyVals[-6+yyTop])), support.newArrayNode(getPosition(((Node)yyVals[-6+yyTop])), ((Node)yyVals[-6+yyTop])).add(new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 247:
// line 950 "DefaultRubyParser.y"
{
yyVal = support.arg_concat(getPosition(((Node)yyVals[-8+yyTop])), support.newArrayNode(getPosition(((Node)yyVals[-8+yyTop])), ((Node)yyVals[-8+yyTop])).addAll(((ListNode)yyVals[-6+yyTop])).add(new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 248:
// line 954 "DefaultRubyParser.y"
{
yyVal = support.arg_blk_pass(support.newSplatNode(getPosition(((Token)yyVals[-2+yyTop])), ((Node)yyVals[-1+yyTop])), ((BlockPassNode)yyVals[0+yyTop]));
}
break;
case 249:
// line 957 "DefaultRubyParser.y"
{}
break;
case 250:
// line 959 "DefaultRubyParser.y"
{
yyVal = new Long(lexer.getCmdArgumentState().begin());
}
break;
case 251:
// line 961 "DefaultRubyParser.y"
{
lexer.getCmdArgumentState().reset(((Long)yyVals[-1+yyTop]).longValue());
yyVal = ((Node)yyVals[0+yyTop]);
}
break;
case 253:
// line 967 "DefaultRubyParser.y"
{
lexer.setState(LexState.EXPR_ENDARG);
}
break;
case 254:
// line 969 "DefaultRubyParser.y"
{
warnings.warn(ID.ARGUMENT_EXTRA_SPACE, getPosition(((Token)yyVals[-2+yyTop])), "don't put space before argument parentheses");
yyVal = null;
}
break;
case 255:
// line 973 "DefaultRubyParser.y"
{
lexer.setState(LexState.EXPR_ENDARG);
}
break;
case 256:
// line 975 "DefaultRubyParser.y"
{
warnings.warn(ID.ARGUMENT_EXTRA_SPACE, getPosition(((Token)yyVals[-3+yyTop])), "don't put space before argument parentheses");
yyVal = ((Node)yyVals[-2+yyTop]);
}
break;
case 257:
// line 980 "DefaultRubyParser.y"
{
support.checkExpression(((Node)yyVals[0+yyTop]));
yyVal = new BlockPassNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), ((Node)yyVals[0+yyTop]));
}
break;
case 258:
// line 985 "DefaultRubyParser.y"
{
yyVal = ((BlockPassNode)yyVals[0+yyTop]);
}
break;
case 260:
// line 990 "DefaultRubyParser.y"
{
yyVal = support.newArrayNode(getPosition2(((Node)yyVals[0+yyTop])), ((Node)yyVals[0+yyTop]));
}
break;
case 261:
// line 993 "DefaultRubyParser.y"
{
yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[0+yyTop]));
}
break;
case 262:
// line 997 "DefaultRubyParser.y"
{
yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[0+yyTop]));
}
break;
case 263:
// line 1000 "DefaultRubyParser.y"
{
yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-3+yyTop])), ((ListNode)yyVals[-3+yyTop]), ((Node)yyVals[0+yyTop]));
}
break;
case 264:
// line 1003 "DefaultRubyParser.y"
{
yyVal = support.newSplatNode(getPosition(((Token)yyVals[-1+yyTop])), ((Node)yyVals[0+yyTop]));
}
break;
case 273:
// line 1015 "DefaultRubyParser.y"
{
yyVal = new FCallNoArgNode(((Token)yyVals[0+yyTop]).getPosition(), (String) ((Token)yyVals[0+yyTop]).getValue());
}
break;
case 274:
// line 1018 "DefaultRubyParser.y"
{
yyVal = new BeginNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-1+yyTop]) == null ? NilImplicitNode.NIL : ((Node)yyVals[-1+yyTop]));
}
break;
case 275:
// line 1021 "DefaultRubyParser.y"
{
lexer.setState(LexState.EXPR_ENDARG);
}
break;
case 276:
// line 1023 "DefaultRubyParser.y"
{
warnings.warning(ID.GROUPED_EXPRESSION, getPosition(((Token)yyVals[-4+yyTop])), "(...) interpreted as grouped expression");
yyVal = ((Node)yyVals[-3+yyTop]);
}
break;
case 277:
// line 1027 "DefaultRubyParser.y"
{
if (((Node)yyVals[-1+yyTop]) != null) {
/* compstmt position includes both parens around it*/
((ISourcePositionHolder) ((Node)yyVals[-1+yyTop])).setPosition(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
}
yyVal = ((Node)yyVals[-1+yyTop]);
}
break;
case 278:
// line 1034 "DefaultRubyParser.y"
{
yyVal = new Colon2Node(support.union(((Node)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), (String) ((Token)yyVals[0+yyTop]).getValue());
}
break;
case 279:
// line 1037 "DefaultRubyParser.y"
{
yyVal = new Colon3Node(support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop])), (String) ((Token)yyVals[0+yyTop]).getValue());
}
break;
case 280:
// line 1040 "DefaultRubyParser.y"
{
if (((Node)yyVals[-3+yyTop]) instanceof SelfNode) {
yyVal = support.new_fcall(new Token("[]", support.union(((Node)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop]))), ((Node)yyVals[-1+yyTop]), null);
} else {
yyVal = support.new_call(((Node)yyVals[-3+yyTop]), new Token("[]", support.union(((Node)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop]))), ((Node)yyVals[-1+yyTop]), null);
}
}
break;
case 281:
// line 1047 "DefaultRubyParser.y"
{
ISourcePosition position = support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]));
if (((Node)yyVals[-1+yyTop]) == null) {
yyVal = new ZArrayNode(position); /* zero length array */
} else {
yyVal = ((Node)yyVals[-1+yyTop]);
((ISourcePositionHolder)yyVal).setPosition(position);
}
}
break;
case 282:
// line 1056 "DefaultRubyParser.y"
{
yyVal = new HashNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((ListNode)yyVals[-1+yyTop]));
}
break;
case 283:
// line 1059 "DefaultRubyParser.y"
{
yyVal = new ReturnNode(((Token)yyVals[0+yyTop]).getPosition(), NilImplicitNode.NIL);
}
break;
case 284:
// line 1062 "DefaultRubyParser.y"
{
yyVal = support.new_yield(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-1+yyTop]));
}
break;
case 285:
// line 1065 "DefaultRubyParser.y"
{
yyVal = new YieldNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), null, false);
}
break;
case 286:
// line 1068 "DefaultRubyParser.y"
{
yyVal = new YieldNode(((Token)yyVals[0+yyTop]).getPosition(), null, false);
}
break;
case 287:
// line 1071 "DefaultRubyParser.y"
{
yyVal = new DefinedNode(getPosition(((Token)yyVals[-4+yyTop])), ((Node)yyVals[-1+yyTop]));
}
break;
case 288:
// line 1074 "DefaultRubyParser.y"
{
yyVal = new FCallNoArgBlockNode(support.union(((Token)yyVals[-1+yyTop]), ((IterNode)yyVals[0+yyTop])), (String) ((Token)yyVals[-1+yyTop]).getValue(), ((IterNode)yyVals[0+yyTop]));
}
break;
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;
case 342:
// line 1262 "DefaultRubyParser.y"
{
yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
}
break;
case 343:
// line 1265 "DefaultRubyParser.y"
{
yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
}
break;
case 344:
// line 1269 "DefaultRubyParser.y"
{
yyVal = support.new_fcall(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
}
break;
case 345:
// line 1272 "DefaultRubyParser.y"
{
yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
}
break;
case 346:
// line 1275 "DefaultRubyParser.y"
{
yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
}
break;
case 347:
// line 1278 "DefaultRubyParser.y"
{
yyVal = support.new_call(((Node)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]), null, null);
}
break;
case 348:
// line 1281 "DefaultRubyParser.y"
{
yyVal = support.new_super(((Node)yyVals[0+yyTop]), ((Token)yyVals[-1+yyTop]));
}
break;
case 349:
// line 1284 "DefaultRubyParser.y"
{
yyVal = new ZSuperNode(((Token)yyVals[0+yyTop]).getPosition());
}
break;
case 350:
// line 1289 "DefaultRubyParser.y"
{
support.pushBlockScope();
}
break;
case 351:
// line 1291 "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 352:
// line 1295 "DefaultRubyParser.y"
{
support.pushBlockScope();
}
break;
case 353:
// line 1297 "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]));
((ISourcePositionHolder)yyVals[-5+yyTop]).setPosition(support.union(((ISourcePositionHolder)yyVals[-5+yyTop]), ((ISourcePositionHolder)yyVal)));
support.popCurrentScope();
}
break;
case 354:
// line 1303 "DefaultRubyParser.y"
{
yyVal = support.newWhenNode(support.union(((Token)yyVals[-4+yyTop]), support.unwrapNewlineNode(((Node)yyVals[-1+yyTop]))), ((ListNode)yyVals[-3+yyTop]), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
}
break;
case 356:
// line 1308 "DefaultRubyParser.y"
{
yyVal = ((ListNode)yyVals[-3+yyTop]).add(support.newWhenNode(getPosition(((ListNode)yyVals[-3+yyTop])), ((Node)yyVals[0+yyTop]), null, null));
}
break;
case 357:
// line 1311 "DefaultRubyParser.y"
{
yyVal = support.newArrayNode(getPosition(((Token)yyVals[-1+yyTop])), support.newWhenNode(getPosition(((Token)yyVals[-1+yyTop])), ((Node)yyVals[0+yyTop]), null, null));
}
break;
case 360:
// line 1318 "DefaultRubyParser.y"
{
Node node;
if (((Node)yyVals[-3+yyTop]) != null) {
node = support.appendToBlock(support.node_assign(((Node)yyVals[-3+yyTop]), new GlobalVarNode(getPosition(((Token)yyVals[-5+yyTop])), "$!")), ((Node)yyVals[-1+yyTop]));
if(((Node)yyVals[-1+yyTop]) != null) {
node.setPosition(support.unwrapNewlineNode(((Node)yyVals[-1+yyTop])).getPosition());
}
} else {
node = ((Node)yyVals[-1+yyTop]);
}
Node body = node == null ? NilImplicitNode.NIL : node;
yyVal = new RescueBodyNode(getPosition(((Token)yyVals[-5+yyTop]), true), ((Node)yyVals[-4+yyTop]), body, ((RescueBodyNode)yyVals[0+yyTop]));
}
break;
case 361:
// line 1331 "DefaultRubyParser.y"
{yyVal = null;}
break;
case 362:
// line 1333 "DefaultRubyParser.y"
{
yyVal = support.newArrayNode(((Node)yyVals[0+yyTop]).getPosition(), ((Node)yyVals[0+yyTop]));
}
break;
case 365:
// line 1339 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[0+yyTop]);
}
break;
case 367:
// line 1344 "DefaultRubyParser.y"
{
if (((Node)yyVals[0+yyTop]) != null) {
yyVal = ((Node)yyVals[0+yyTop]);
} else {
yyVal = new NilNode(getPosition(null));
}
}
break;
case 370:
// line 1355 "DefaultRubyParser.y"
{
/* FIXME: We may be intern'ing more than once.*/
yyVal = new SymbolNode(((Token)yyVals[0+yyTop]).getPosition(), ((String) ((Token)yyVals[0+yyTop]).getValue()).intern());
}
break;
case 372:
// line 1362 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[0+yyTop]) instanceof EvStrNode ? new DStrNode(getPosition(((Node)yyVals[0+yyTop]))).add(((Node)yyVals[0+yyTop])) : ((Node)yyVals[0+yyTop]);
}
break;
case 374:
// line 1368 "DefaultRubyParser.y"
{
yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
}
break;
case 375:
// line 1373 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[-1+yyTop]);
((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
int extraLength = ((String) ((Token)yyVals[-2+yyTop]).getValue()).length() - 1;
/* We may need to subtract addition offset off of first */
/* string fragment (we optimistically take one off in*/
/* ParserSupport.literal_concat). Check token length*/
/* and subtract as neeeded.*/
if ((((Node)yyVals[-1+yyTop]) instanceof DStrNode) && extraLength > 0) {
Node strNode = ((DStrNode)((Node)yyVals[-1+yyTop])).get(0);
assert strNode != null;
strNode.getPosition().adjustStartOffset(-extraLength);
}
}
break;
case 376:
// line 1390 "DefaultRubyParser.y"
{
ISourcePosition position = support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]));
if (((Node)yyVals[-1+yyTop]) == null) {
yyVal = new XStrNode(position, null);
} else if (((Node)yyVals[-1+yyTop]) instanceof StrNode) {
yyVal = new XStrNode(position, (ByteList) ((StrNode)yyVals[-1+yyTop]).getValue().clone());
} else if (((Node)yyVals[-1+yyTop]) instanceof DStrNode) {
yyVal = new DXStrNode(position, ((DStrNode)yyVals[-1+yyTop]));
((Node)yyVal).setPosition(position);
} else {
yyVal = new DXStrNode(position).add(((Node)yyVals[-1+yyTop]));
}
}
break;
case 377:
// line 1407 "DefaultRubyParser.y"
{
int options = ((RegexpNode)yyVals[0+yyTop]).getOptions();
Node node = ((Node)yyVals[-1+yyTop]);
if (node == null) {
yyVal = new RegexpNode(getPosition(((Token)yyVals[-2+yyTop])), ByteList.create(""), options & ~ReOptions.RE_OPTION_ONCE);
} else if (node instanceof StrNode) {
yyVal = new RegexpNode(((Node)yyVals[-1+yyTop]).getPosition(), (ByteList) ((StrNode) node).getValue().clone(), options & ~ReOptions.RE_OPTION_ONCE);
} else if (node instanceof DStrNode) {
yyVal = new DRegexpNode(getPosition(((Token)yyVals[-2+yyTop])), (DStrNode) node, options, (options & ReOptions.RE_OPTION_ONCE) != 0);
} else {
yyVal = new DRegexpNode(getPosition(((Token)yyVals[-2+yyTop])), options, (options & ReOptions.RE_OPTION_ONCE) != 0).add(node);
}
}
break;
case 378:
// line 1423 "DefaultRubyParser.y"
{
yyVal = new ZArrayNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
}
break;
case 379:
// line 1426 "DefaultRubyParser.y"
{
yyVal = ((ListNode)yyVals[-1+yyTop]);
((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
}
break;
case 380:
// line 1432 "DefaultRubyParser.y"
{
yyVal = new ArrayNode(getPosition(null));
}
break;
case 381:
// line 1435 "DefaultRubyParser.y"
{
yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[-1+yyTop]) instanceof EvStrNode ? new DStrNode(getPosition(((ListNode)yyVals[-2+yyTop]))).add(((Node)yyVals[-1+yyTop])) : ((Node)yyVals[-1+yyTop]));
}
break;
case 383:
// line 1440 "DefaultRubyParser.y"
{
yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
}
break;
case 384:
// line 1445 "DefaultRubyParser.y"
{
yyVal = new ZArrayNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
}
break;
case 385:
// line 1448 "DefaultRubyParser.y"
{
yyVal = ((ListNode)yyVals[-1+yyTop]);
((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
}
break;
case 386:
// line 1454 "DefaultRubyParser.y"
{
yyVal = new ArrayNode(getPosition(null));
}
break;
case 387:
// line 1457 "DefaultRubyParser.y"
{
yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[-1+yyTop]));
}
break;
case 388:
// line 1462 "DefaultRubyParser.y"
{
yyVal = new StrNode(((Token)yyVals[0+yyTop]).getPosition(), ByteList.create(""));
}
break;
case 389:
// line 1465 "DefaultRubyParser.y"
{
yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
}
break;
case 390:
// line 1469 "DefaultRubyParser.y"
{
yyVal = null;
}
break;
case 391:
// line 1472 "DefaultRubyParser.y"
{
yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
}
break;
case 392:
// line 1477 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[0+yyTop]);
}
break;
case 393:
// line 1480 "DefaultRubyParser.y"
{
yyVal = lexer.getStrTerm();
lexer.setStrTerm(null);
lexer.setState(LexState.EXPR_BEG);
}
break;
case 394:
// line 1484 "DefaultRubyParser.y"
{
lexer.setStrTerm(((StrTerm)yyVals[-1+yyTop]));
yyVal = new EvStrNode(support.union(((Token)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), ((Node)yyVals[0+yyTop]));
}
break;
case 395:
// line 1488 "DefaultRubyParser.y"
{
yyVal = lexer.getStrTerm();
lexer.setStrTerm(null);
lexer.setState(LexState.EXPR_BEG);
}
break;
case 396:
// line 1492 "DefaultRubyParser.y"
{
lexer.setStrTerm(((StrTerm)yyVals[-2+yyTop]));
yyVal = support.newEvStrNode(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-1+yyTop]));
}
break;
case 397:
// line 1498 "DefaultRubyParser.y"
{
yyVal = new GlobalVarNode(((Token)yyVals[0+yyTop]).getPosition(), (String) ((Token)yyVals[0+yyTop]).getValue());
}
break;
case 398:
// line 1501 "DefaultRubyParser.y"
{
yyVal = new InstVarNode(((Token)yyVals[0+yyTop]).getPosition(), (String) ((Token)yyVals[0+yyTop]).getValue());
}
break;
case 399:
// line 1504 "DefaultRubyParser.y"
{
yyVal = new ClassVarNode(((Token)yyVals[0+yyTop]).getPosition(), (String) ((Token)yyVals[0+yyTop]).getValue());
}
break;
case 401:
// line 1511 "DefaultRubyParser.y"
{
lexer.setState(LexState.EXPR_END);
yyVal = ((Token)yyVals[0+yyTop]);
((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop])));
}
break;
case 406:
// line 1521 "DefaultRubyParser.y"
{
lexer.setState(LexState.EXPR_END);
/* DStrNode: :"some text #{some expression}"*/
/* StrNode: :"some text"*/
/* EvStrNode :"#{some expression}"*/
if (((Node)yyVals[-1+yyTop]) == null) {
yyerror("empty symbol literal");
}
if (((Node)yyVals[-1+yyTop]) instanceof DStrNode) {
yyVal = new DSymbolNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((DStrNode)yyVals[-1+yyTop]));
} else {
ISourcePosition position = support.union(((Node)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop]));
/* We substract one since tsymbeg is longer than one*/
/* and we cannot union it directly so we assume quote*/
/* is one character long and subtract for it.*/
position.adjustStartOffset(-1);
((Node)yyVals[-1+yyTop]).setPosition(position);
yyVal = new DSymbolNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
((DSymbolNode)yyVal).add(((Node)yyVals[-1+yyTop]));
}
}
break;
case 408:
// line 1548 "DefaultRubyParser.y"
{
yyVal = ((FloatNode)yyVals[0+yyTop]);
}
break;
case 409:
// line 1551 "DefaultRubyParser.y"
{
yyVal = support.negateInteger(((Node)yyVals[0+yyTop]));
}
break;
case 410:
// line 1554 "DefaultRubyParser.y"
{
yyVal = support.negateFloat(((FloatNode)yyVals[0+yyTop]));
}
break;
case 416:
// line 1560 "DefaultRubyParser.y"
{
yyVal = new Token("nil", Tokens.kNIL, ((Token)yyVals[0+yyTop]).getPosition());
}
break;
case 417:
// line 1563 "DefaultRubyParser.y"
{
yyVal = new Token("self", Tokens.kSELF, ((Token)yyVals[0+yyTop]).getPosition());
}
break;
case 418:
// line 1566 "DefaultRubyParser.y"
{
yyVal = new Token("true", Tokens.kTRUE, ((Token)yyVals[0+yyTop]).getPosition());
}
break;
case 419:
// line 1569 "DefaultRubyParser.y"
{
yyVal = new Token("false", Tokens.kFALSE, ((Token)yyVals[0+yyTop]).getPosition());
}
break;
case 420:
// line 1572 "DefaultRubyParser.y"
{
yyVal = new Token("__FILE__", Tokens.k__FILE__, ((Token)yyVals[0+yyTop]).getPosition());
}
break;
case 421:
// line 1575 "DefaultRubyParser.y"
{
yyVal = new Token("__LINE__", Tokens.k__LINE__, ((Token)yyVals[0+yyTop]).getPosition());
}
break;
case 422:
// line 1580 "DefaultRubyParser.y"
{
yyVal = support.gettable(((Token)yyVals[0+yyTop]));
}
break;
case 423:
// line 1585 "DefaultRubyParser.y"
{
yyVal = support.assignable(((Token)yyVals[0+yyTop]), NilImplicitNode.NIL);
}
break;
case 426:
// line 1593 "DefaultRubyParser.y"
{
yyVal = null;
}
break;
case 427:
// line 1596 "DefaultRubyParser.y"
{
lexer.setState(LexState.EXPR_BEG);
}
break;
case 428:
// line 1598 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[-1+yyTop]);
}
break;
case 429:
// line 1601 "DefaultRubyParser.y"
{
yyerrok();
yyVal = null;
}
break;
case 430:
// line 1607 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[-2+yyTop]);
((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])));
lexer.setState(LexState.EXPR_BEG);
}
break;
case 431:
// line 1612 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[-1+yyTop]);
}
break;
case 432:
// line 1617 "DefaultRubyParser.y"
{
yyVal = new ArgsNode(support.union(((ListNode)yyVals[-5+yyTop]), ((BlockArgNode)yyVals[0+yyTop])), ((ListNode)yyVals[-5+yyTop]), ((ListNode)yyVals[-3+yyTop]), ((Integer) ((Token)yyVals[-1+yyTop]).getValue()).intValue(), support.getRestArgNode(((Token)yyVals[-1+yyTop])), ((BlockArgNode)yyVals[0+yyTop]));
}
break;
case 433:
// line 1620 "DefaultRubyParser.y"
{
yyVal = new ArgsNode(getPosition(((ListNode)yyVals[-3+yyTop])), ((ListNode)yyVals[-3+yyTop]), ((ListNode)yyVals[-1+yyTop]), -1, null, ((BlockArgNode)yyVals[0+yyTop]));
}
break;
case 434:
// line 1623 "DefaultRubyParser.y"
{
yyVal = new ArgsNode(support.union(((ListNode)yyVals[-3+yyTop]), ((BlockArgNode)yyVals[0+yyTop])), ((ListNode)yyVals[-3+yyTop]), null, ((Integer) ((Token)yyVals[-1+yyTop]).getValue()).intValue(), support.getRestArgNode(((Token)yyVals[-1+yyTop])), ((BlockArgNode)yyVals[0+yyTop]));
}
break;
case 435:
// line 1626 "DefaultRubyParser.y"
{
yyVal = new ArgsNode(((ISourcePositionHolder)yyVals[-1+yyTop]).getPosition(), ((ListNode)yyVals[-1+yyTop]), null, -1, null, ((BlockArgNode)yyVals[0+yyTop]));
}
break;
case 436:
// line 1629 "DefaultRubyParser.y"
{
yyVal = new ArgsNode(getPosition(((ListNode)yyVals[-3+yyTop])), null, ((ListNode)yyVals[-3+yyTop]), ((Integer) ((Token)yyVals[-1+yyTop]).getValue()).intValue(), support.getRestArgNode(((Token)yyVals[-1+yyTop])), ((BlockArgNode)yyVals[0+yyTop]));
}
break;
case 437:
// line 1632 "DefaultRubyParser.y"
{
yyVal = new ArgsNode(getPosition(((ListNode)yyVals[-1+yyTop])), null, ((ListNode)yyVals[-1+yyTop]), -1, null, ((BlockArgNode)yyVals[0+yyTop]));
}
break;
case 438:
// line 1635 "DefaultRubyParser.y"
{
yyVal = new ArgsNode(getPosition(((Token)yyVals[-1+yyTop])), null, null, ((Integer) ((Token)yyVals[-1+yyTop]).getValue()).intValue(), support.getRestArgNode(((Token)yyVals[-1+yyTop])), ((BlockArgNode)yyVals[0+yyTop]));
}
break;
case 439:
// line 1638 "DefaultRubyParser.y"
{
yyVal = new ArgsNode(getPosition(((BlockArgNode)yyVals[0+yyTop])), null, null, -1, null, ((BlockArgNode)yyVals[0+yyTop]));
}
break;
case 440:
// line 1641 "DefaultRubyParser.y"
{
yyVal = new ArgsNode(support.createEmptyArgsNodePosition(getPosition(null)), null, null, -1, null, null);
}
break;
case 441:
// line 1646 "DefaultRubyParser.y"
{
yyerror("formal argument cannot be a constant");
}
break;
case 442:
// line 1649 "DefaultRubyParser.y"
{
yyerror("formal argument cannot be a instance variable");
}
break;
case 443:
// line 1652 "DefaultRubyParser.y"
{
yyerror("formal argument cannot be an global variable");
}
break;
case 444:
// line 1655 "DefaultRubyParser.y"
{
yyerror("formal argument cannot be a class variable");
}
break;
case 445:
// line 1658 "DefaultRubyParser.y"
{
String identifier = (String) ((Token)yyVals[0+yyTop]).getValue();
if (support.getCurrentScope().getLocalScope().isDefined(identifier) >= 0) {
yyerror("duplicate argument name");
}
support.getCurrentScope().getLocalScope().addVariable(identifier);
yyVal = ((Token)yyVals[0+yyTop]);
}
break;
case 446:
// line 1669 "DefaultRubyParser.y"
{
support.allowDubyExtension(((ISourcePositionHolder)yyVals[-2+yyTop]).getPosition());
yyVal = new ListNode(((ISourcePositionHolder)yyVals[-2+yyTop]).getPosition());
((ListNode) yyVal).add(new TypedArgumentNode(((ISourcePositionHolder)yyVals[-2+yyTop]).getPosition(), (String) ((Token)yyVals[-2+yyTop]).getValue(), ((Node)yyVals[0+yyTop])));
}
break;
case 447:
// line 1674 "DefaultRubyParser.y"
{
yyVal = new ListNode(((ISourcePositionHolder)yyVals[0+yyTop]).getPosition());
((ListNode) yyVal).add(new ArgumentNode(((ISourcePositionHolder)yyVals[0+yyTop]).getPosition(), (String) ((Token)yyVals[0+yyTop]).getValue()));
}
break;
case 448:
// line 1678 "DefaultRubyParser.y"
{
support.allowDubyExtension(((ISourcePositionHolder)yyVals[-4+yyTop]).getPosition());
((ListNode)yyVals[-4+yyTop]).add(new TypedArgumentNode(((ISourcePositionHolder)yyVals[-2+yyTop]).getPosition(), (String) ((Token)yyVals[-2+yyTop]).getValue(), ((Node)yyVals[0+yyTop])));
((ListNode)yyVals[-4+yyTop]).setPosition(support.union(((ListNode)yyVals[-4+yyTop]), ((Token)yyVals[-2+yyTop])));
yyVal = ((ListNode)yyVals[-4+yyTop]);
}
break;
case 449:
// line 1684 "DefaultRubyParser.y"
{
((ListNode)yyVals[-2+yyTop]).add(new ArgumentNode(((ISourcePositionHolder)yyVals[0+yyTop]).getPosition(), (String) ((Token)yyVals[0+yyTop]).getValue()));
((ListNode)yyVals[-2+yyTop]).setPosition(support.union(((ListNode)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
yyVal = ((ListNode)yyVals[-2+yyTop]);
}
break;
case 450:
// line 1691 "DefaultRubyParser.y"
{
String identifier = (String) ((Token)yyVals[-2+yyTop]).getValue();
if (support.getCurrentScope().getLocalScope().isDefined(identifier) >= 0) {
yyerror("duplicate optional argument name");
}
support.getCurrentScope().getLocalScope().addVariable(identifier);
yyVal = support.assignable(((Token)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
}
break;
case 451:
// line 1702 "DefaultRubyParser.y"
{
yyVal = new BlockNode(getPosition(((Node)yyVals[0+yyTop]))).add(((Node)yyVals[0+yyTop]));
}
break;
case 452:
// line 1705 "DefaultRubyParser.y"
{
yyVal = support.appendToBlock(((ListNode)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
}
break;
case 455:
// line 1713 "DefaultRubyParser.y"
{
String identifier = (String) ((Token)yyVals[0+yyTop]).getValue();
if (support.getCurrentScope().getLocalScope().isDefined(identifier) >= 0) {
yyerror("duplicate rest argument name");
}
((Token)yyVals[-1+yyTop]).setValue(new Integer(support.getCurrentScope().getLocalScope().addVariable(identifier)));
yyVal = ((Token)yyVals[-1+yyTop]);
}
break;
case 456:
// line 1722 "DefaultRubyParser.y"
{
((Token)yyVals[0+yyTop]).setValue(new Integer(support.getCurrentScope().getLocalScope().addVariable("*")));
yyVal = ((Token)yyVals[0+yyTop]);
}
break;
case 459:
// line 1731 "DefaultRubyParser.y"
{
String identifier = (String) ((Token)yyVals[0+yyTop]).getValue();
if (support.getCurrentScope().getLocalScope().isDefined(identifier) >= 0) {
yyerror("duplicate block argument name");
}
yyVal = new BlockArgNode(support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop])), support.getCurrentScope().getLocalScope().addVariable(identifier), identifier);
}
break;
case 460:
// line 1740 "DefaultRubyParser.y"
{
yyVal = ((BlockArgNode)yyVals[0+yyTop]);
}
break;
case 461:
// line 1743 "DefaultRubyParser.y"
{
yyVal = null;
}
break;
case 462:
// line 1747 "DefaultRubyParser.y"
{
if (!(((Node)yyVals[0+yyTop]) instanceof SelfNode)) {
support.checkExpression(((Node)yyVals[0+yyTop]));
}
yyVal = ((Node)yyVals[0+yyTop]);
}
break;
case 463:
// line 1753 "DefaultRubyParser.y"
{
lexer.setState(LexState.EXPR_BEG);
}
break;
case 464:
// line 1755 "DefaultRubyParser.y"
{
if (((Node)yyVals[-2+yyTop]) == null) {
yyerror("can't define single method for ().");
} else if (((Node)yyVals[-2+yyTop]) instanceof ILiteralNode) {
yyerror("can't define single method for literals.");
}
support.checkExpression(((Node)yyVals[-2+yyTop]));
yyVal = ((Node)yyVals[-2+yyTop]);
}
break;
case 465:
// line 1767 "DefaultRubyParser.y"
{ /* [!null]*/
yyVal = new ArrayNode(getPosition(null));
}
break;
case 466:
// line 1770 "DefaultRubyParser.y"
{ /* [!null]*/