KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jruby > parser > DefaultRubyParser


1 // created by jay 1.0 (c) 2002 ats@cs.rit.edu
2
// skeleton Java 1.0 (c) 2002 ats@cs.rit.edu
3

4                     // line 2 "DefaultRubyParser.y"
5
/***** BEGIN LICENSE BLOCK *****
6  * Version: CPL 1.0/GPL 2.0/LGPL 2.1
7  *
8  * The contents of this file are subject to the Common Public
9  * License Version 1.0 (the "License"); you may not use this file
10  * except in compliance with the License. You may obtain a copy of
11  * the License at http://www.eclipse.org/legal/cpl-v10.html
12  *
13  * Software distributed under the License is distributed on an "AS
14  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
15  * implied. See the License for the specific language governing
16  * rights and limitations under the License.
17  *
18  * Copyright (C) 2001 Alan Moore <alan_moore@gmx.net>
19  * Copyright (C) 2001-2002 Benoit Cerrina <b.cerrina@wanadoo.fr>
20  * Copyright (C) 2001-2004 Stefan Matthias Aust <sma@3plus4.de>
21  * Copyright (C) 2001-2004 Jan Arne Petersen <jpetersen@uni-bonn.de>
22  * Copyright (C) 2002-2004 Anders Bengtsson <ndrsbngtssn@yahoo.se>
23  * Copyright (C) 2004-2006 Thomas E Enebo <enebo@acm.org>
24  * Copyright (C) 2004 Charles O Nutter <headius@headius.com>
25  * Copyright (C) 2006 Miguel Covarrubias <mlcovarrubias@gmail.com>
26  *
27  * Alternatively, the contents of this file may be used under the terms of
28  * either of the GNU General Public License Version 2 or later (the "GPL"),
29  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30  * in which case the provisions of the GPL or the LGPL are applicable instead
31  * of those above. If you wish to allow use of your version of this file only
32  * under the terms of either the GPL or the LGPL, and not to allow others to
33  * use your version of this file under the terms of the CPL, indicate your
34  * decision by deleting the provisions above and replace them with the notice
35  * and other provisions required by the GPL or the LGPL. If you do not delete
36  * the provisions above, a recipient may use your version of this file under
37  * the terms of any one of the CPL, the GPL or the LGPL.
38  ***** END LICENSE BLOCK *****/

39 package org.jruby.parser;
40
41 import java.io.IOException JavaDoc;
42
43 import org.jruby.ast.AliasNode;
44 import org.jruby.ast.ArgsNode;
45 import org.jruby.ast.ArgumentNode;
46 import org.jruby.ast.ArrayNode;
47 import org.jruby.ast.AssignableNode;
48 import org.jruby.ast.BackRefNode;
49 import org.jruby.ast.BeginNode;
50 import org.jruby.ast.BlockAcceptingNode;
51 import org.jruby.ast.BlockArgNode;
52 import org.jruby.ast.BlockNode;
53 import org.jruby.ast.BlockPassNode;
54 import org.jruby.ast.BreakNode;
55 import org.jruby.ast.CallNode;
56 import org.jruby.ast.CaseNode;
57 import org.jruby.ast.ClassNode;
58 import org.jruby.ast.ClassVarNode;
59 import org.jruby.ast.Colon2Node;
60 import org.jruby.ast.Colon3Node;
61 import org.jruby.ast.ConstDeclNode;
62 import org.jruby.ast.DRegexpNode;
63 import org.jruby.ast.DStrNode;
64 import org.jruby.ast.DSymbolNode;
65 import org.jruby.ast.DXStrNode;
66 import org.jruby.ast.DefinedNode;
67 import org.jruby.ast.DefnNode;
68 import org.jruby.ast.DefsNode;
69 import org.jruby.ast.DotNode;
70 import org.jruby.ast.EnsureNode;
71 import org.jruby.ast.EvStrNode;
72 import org.jruby.ast.FCallNode;
73 import org.jruby.ast.FloatNode;
74 import org.jruby.ast.ForNode;
75 import org.jruby.ast.GlobalVarNode;
76 import org.jruby.ast.HashNode;
77 import org.jruby.ast.IfNode;
78 import org.jruby.ast.InstVarNode;
79 import org.jruby.ast.IterNode;
80 import org.jruby.ast.ListNode;
81 import org.jruby.ast.ModuleNode;
82 import org.jruby.ast.MultipleAsgnNode;
83 import org.jruby.ast.NewlineNode;
84 import org.jruby.ast.NextNode;
85 import org.jruby.ast.NilNode;
86 import org.jruby.ast.Node;
87 import org.jruby.ast.NotNode;
88 import org.jruby.ast.OpAsgnAndNode;
89 import org.jruby.ast.OpAsgnNode;
90 import org.jruby.ast.OpAsgnOrNode;
91 import org.jruby.ast.OpElementAsgnNode;
92 import org.jruby.ast.PostExeNode;
93 import org.jruby.ast.RedoNode;
94 import org.jruby.ast.RegexpNode;
95 import org.jruby.ast.RescueBodyNode;
96 import org.jruby.ast.RescueNode;
97 import org.jruby.ast.RetryNode;
98 import org.jruby.ast.ReturnNode;
99 import org.jruby.ast.SClassNode;
100 import org.jruby.ast.SValueNode;
101 import org.jruby.ast.SelfNode;
102 import org.jruby.ast.SplatNode;
103 import org.jruby.ast.StarNode;
104 import org.jruby.ast.StrNode;
105 import org.jruby.ast.SymbolNode;
106 import org.jruby.ast.ToAryNode;
107 import org.jruby.ast.UndefNode;
108 import org.jruby.ast.UntilNode;
109 import org.jruby.ast.VAliasNode;
110 import org.jruby.ast.WhenNode;
111 import org.jruby.ast.WhileNode;
112 import org.jruby.ast.XStrNode;
113 import org.jruby.ast.YieldNode;
114 import org.jruby.ast.ZArrayNode;
115 import org.jruby.ast.ZSuperNode;
116 import org.jruby.ast.ZeroArgNode;
117 import org.jruby.ast.types.ILiteralNode;
118 import org.jruby.ast.types.INameNode;
119 import org.jruby.common.IRubyWarnings;
120 import org.jruby.lexer.yacc.ISourcePosition;
121 import org.jruby.lexer.yacc.ISourcePositionHolder;
122 import org.jruby.lexer.yacc.LexState;
123 import org.jruby.lexer.yacc.LexerSource;
124 import org.jruby.lexer.yacc.RubyYaccLexer;
125 import org.jruby.lexer.yacc.StrTerm;
126 import org.jruby.lexer.yacc.SyntaxException;
127 import org.jruby.lexer.yacc.Token;
128 import org.jruby.runtime.Visibility;
129 import org.jruby.util.IdUtil;
130 import org.jruby.util.ByteList;
131
132 public class DefaultRubyParser {
133     private ParserSupport support;
134     private RubyYaccLexer lexer;
135     private IRubyWarnings warnings;
136
137     public DefaultRubyParser() {
138         support = new ParserSupport();
139         lexer = new RubyYaccLexer();
140         lexer.setParserSupport(support);
141     }
142
143     public void setWarnings(IRubyWarnings warnings) {
144         this.warnings = warnings;
145
146         support.setWarnings(warnings);
147         lexer.setWarnings(warnings);
148     }
149                     // line 150 "-"
150
// %token constants
151
public static final int kCLASS = 257;
152   public static final int kMODULE = 258;
153   public static final int kDEF = 259;
154   public static final int kUNDEF = 260;
155   public static final int kBEGIN = 261;
156   public static final int kRESCUE = 262;
157   public static final int kENSURE = 263;
158   public static final int kEND = 264;
159   public static final int kIF = 265;
160   public static final int kUNLESS = 266;
161   public static final int kTHEN = 267;
162   public static final int kELSIF = 268;
163   public static final int kELSE = 269;
164   public static final int kCASE = 270;
165   public static final int kWHEN = 271;
166   public static final int kWHILE = 272;
167   public static final int kUNTIL = 273;
168   public static final int kFOR = 274;
169   public static final int kBREAK = 275;
170   public static final int kNEXT = 276;
171   public static final int kREDO = 277;
172   public static final int kRETRY = 278;
173   public static final int kIN = 279;
174   public static final int kDO = 280;
175   public static final int kDO_COND = 281;
176   public static final int kDO_BLOCK = 282;
177   public static final int kRETURN = 283;
178   public static final int kYIELD = 284;
179   public static final int kSUPER = 285;
180   public static final int kSELF = 286;
181   public static final int kNIL = 287;
182   public static final int kTRUE = 288;
183   public static final int kFALSE = 289;
184   public static final int kAND = 290;
185   public static final int kOR = 291;
186   public static final int kNOT = 292;
187   public static final int kIF_MOD = 293;
188   public static final int kUNLESS_MOD = 294;
189   public static final int kWHILE_MOD = 295;
190   public static final int kUNTIL_MOD = 296;
191   public static final int kRESCUE_MOD = 297;
192   public static final int kALIAS = 298;
193   public static final int kDEFINED = 299;
194   public static final int klBEGIN = 300;
195   public static final int klEND = 301;
196   public static final int k__LINE__ = 302;
197   public static final int k__FILE__ = 303;
198   public static final int tIDENTIFIER = 304;
199   public static final int tFID = 305;
200   public static final int tGVAR = 306;
201   public static final int tIVAR = 307;
202   public static final int tCONSTANT = 308;
203   public static final int tCVAR = 309;
204   public static final int tNTH_REF = 310;
205   public static final int tBACK_REF = 311;
206   public static final int tSTRING_CONTENT = 312;
207   public static final int tINTEGER = 313;
208   public static final int tFLOAT = 314;
209   public static final int tREGEXP_END = 315;
210   public static final int tUPLUS = 316;
211   public static final int tUMINUS = 317;
212   public static final int tUMINUS_NUM = 318;
213   public static final int tPOW = 319;
214   public static final int tCMP = 320;
215   public static final int tEQ = 321;
216   public static final int tEQQ = 322;
217   public static final int tNEQ = 323;
218   public static final int tGEQ = 324;
219   public static final int tLEQ = 325;
220   public static final int tANDOP = 326;
221   public static final int tOROP = 327;
222   public static final int tMATCH = 328;
223   public static final int tNMATCH = 329;
224   public static final int tDOT = 330;
225   public static final int tDOT2 = 331;
226   public static final int tDOT3 = 332;
227   public static final int tAREF = 333;
228   public static final int tASET = 334;
229   public static final int tLSHFT = 335;
230   public static final int tRSHFT = 336;
231   public static final int tCOLON2 = 337;
232   public static final int tCOLON3 = 338;
233   public static final int tOP_ASGN = 339;
234   public static final int tASSOC = 340;
235   public static final int tLPAREN = 341;
236   public static final int tLPAREN2 = 342;
237   public static final int tRPAREN = 343;
238   public static final int tLPAREN_ARG = 344;
239   public static final int tLBRACK = 345;
240   public static final int tRBRACK = 346;
241   public static final int tLBRACE = 347;
242   public static final int tLBRACE_ARG = 348;
243   public static final int tSTAR = 349;
244   public static final int tSTAR2 = 350;
245   public static final int tAMPER = 351;
246   public static final int tAMPER2 = 352;
247   public static final int tTILDE = 353;
248   public static final int tPERCENT = 354;
249   public static final int tDIVIDE = 355;
250   public static final int tPLUS = 356;
251   public static final int tMINUS = 357;
252   public static final int tLT = 358;
253   public static final int tGT = 359;
254   public static final int tPIPE = 360;
255   public static final int tBANG = 361;
256   public static final int tCARET = 362;
257   public static final int tLCURLY = 363;
258   public static final int tRCURLY = 364;
259   public static final int tBACK_REF2 = 365;
260   public static final int tSYMBEG = 366;
261   public static final int tSTRING_BEG = 367;
262   public static final int tXSTRING_BEG = 368;
263   public static final int tREGEXP_BEG = 369;
264   public static final int tWORDS_BEG = 370;
265   public static final int tQWORDS_BEG = 371;
266   public static final int tSTRING_DBEG = 372;
267   public static final int tSTRING_DVAR = 373;
268   public static final int tSTRING_END = 374;
269   public static final int tLOWEST = 375;
270   public static final int tLAST_TOKEN = 376;
271   public static final int yyErrorCode = 256;
272
273   /** number of final state.
274     */

275   protected static final int yyFinal = 1;
276
277   /** parser tables.
278       Order is mandated by <i>jay</i>.
279     */

280   protected static final short[] yyLhs = {
281 //yyLhs 493
282
-1, 99, 0, 20, 19, 21, 21, 21, 21, 102,
283     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
284    103, 22, 22, 22, 22, 22, 22, 22, 22, 22,
285     22, 22, 22, 22, 22, 23, 23, 23, 23, 23,
286     23, 27, 18, 18, 18, 18, 18, 43, 43, 43,
287    104, 78, 26, 26, 26, 26, 26, 26, 26, 26,
288     79, 79, 81, 81, 80, 80, 80, 80, 80, 80,
289     51, 51, 67, 67, 52, 52, 52, 52, 52, 52,
290     52, 52, 59, 59, 59, 59, 59, 59, 59, 59,
291     91, 91, 17, 17, 17, 92, 92, 92, 92, 92,
292     85, 85, 47, 106, 47, 93, 93, 93, 93, 93,
293     93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
294     93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
295     93, 105, 105, 105, 105, 105, 105, 105, 105, 105,
296    105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
297    105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
298    105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
299    105, 105, 24, 24, 24, 24, 24, 24, 24, 24,
300     24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
301     24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
302     24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
303     24, 24, 24, 24, 24, 24, 53, 56, 56, 56,
304     56, 56, 56, 37, 37, 37, 37, 41, 41, 33,
305     33, 33, 33, 33, 33, 33, 33, 33, 34, 34,
306     34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
307    109, 39, 35, 110, 35, 111, 35, 72, 71, 71,
308     65, 65, 50, 50, 50, 25, 25, 25, 25, 25,
309     25, 25, 25, 25, 25, 112, 25, 25, 25, 25,
310     25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
311     25, 25, 25, 114, 116, 25, 117, 118, 25, 25,
312     25, 25, 119, 120, 25, 121, 25, 123, 124, 25,
313    125, 25, 126, 25, 127, 128, 25, 25, 25, 25,
314     25, 28, 113, 113, 113, 113, 115, 115, 115, 31,
315     31, 29, 29, 57, 57, 58, 58, 58, 58, 129,
316     77, 42, 42, 42, 10, 10, 10, 10, 10, 10,
317    130, 76, 131, 76, 54, 66, 66, 66, 30, 30,
318     82, 82, 55, 55, 55, 32, 32, 36, 36, 14,
319     14, 14, 2, 3, 3, 4, 5, 6, 11, 11,
320     62, 62, 13, 13, 12, 12, 61, 61, 7, 7,
321      8, 8, 9, 132, 9, 133, 9, 48, 48, 48,
322     48, 87, 86, 86, 86, 86, 16, 15, 15, 15,
323     15, 84, 84, 84, 84, 84, 84, 84, 84, 84,
324     84, 84, 40, 83, 49, 49, 38, 134, 38, 38,
325     44, 44, 45, 45, 45, 45, 45, 45, 45, 45,
326     45, 94, 94, 94, 94, 63, 63, 46, 64, 64,
327     97, 97, 95, 95, 98, 98, 75, 74, 74, 1,
328    135, 1, 70, 70, 70, 68, 68, 69, 88, 88,
329     88, 89, 89, 89, 89, 90, 90, 90, 96, 96,
330    100, 100, 107, 107, 108, 108, 108, 122, 122, 101,
331    101, 60, 73,
332     }, yyLen = {
333 //yyLen 493
334
2, 0, 2, 4, 2, 1, 1, 3, 2, 0,
335      4, 3, 3, 3, 2, 3, 3, 3, 3, 3,
336      0, 5, 4, 3, 3, 3, 6, 5, 5, 5,
337      3, 3, 3, 3, 1, 1, 3, 3, 2, 2,
338      1, 1, 1, 1, 2, 2, 2, 1, 4, 4,
339      0, 5, 2, 3, 4, 5, 4, 5, 2, 2,
340      1, 3, 1, 3, 1, 2, 3, 2, 2, 1,
341      1, 3, 2, 3, 1, 4, 3, 3, 3, 3,
342      2, 1, 1, 4, 3, 3, 3, 3, 2, 1,
343      1, 1, 2, 1, 3, 1, 1, 1, 1, 1,
344      1, 1, 1, 0, 4, 1, 1, 1, 1, 1,
345      1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
346      1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347      1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
348      1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349      1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350      1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
351      1, 1, 3, 5, 3, 6, 5, 5, 5, 5,
352      4, 3, 3, 3, 3, 3, 3, 3, 3, 3,
353      4, 4, 2, 2, 3, 3, 3, 3, 3, 3,
354      3, 3, 3, 3, 3, 3, 3, 2, 2, 3,
355      3, 3, 3, 3, 5, 1, 1, 1, 2, 2,
356      5, 2, 3, 3, 4, 4, 6, 1, 1, 1,
357      2, 5, 2, 5, 4, 7, 3, 1, 4, 3,
358      5, 7, 2, 5, 4, 6, 7, 9, 3, 1,
359      0, 2, 1, 0, 3, 0, 4, 2, 2, 1,
360      1, 3, 3, 4, 2, 1, 1, 1, 1, 1,
361      1, 1, 1, 1, 3, 0, 5, 3, 3, 2,
362      4, 3, 3, 1, 4, 3, 1, 5, 2, 1,
363      2, 6, 6, 0, 0, 7, 0, 0, 7, 5,
364      4, 5, 0, 0, 9, 0, 6, 0, 0, 8,
365      0, 5, 0, 6, 0, 0, 9, 1, 1, 1,
366      1, 1, 1, 1, 1, 2, 1, 1, 1, 1,
367      5, 1, 2, 1, 1, 1, 2, 1, 3, 0,
368      5, 2, 4, 4, 2, 4, 4, 3, 2, 1,
369      0, 5, 0, 5, 5, 1, 4, 2, 1, 1,
370      6, 0, 1, 1, 1, 2, 1, 2, 1, 1,
371      1, 1, 1, 1, 2, 3, 3, 3, 3, 3,
372      0, 3, 1, 2, 3, 3, 0, 3, 0, 2,
373      0, 2, 1, 0, 3, 0, 4, 1, 1, 1,
374      1, 2, 1, 1, 1, 1, 3, 1, 1, 2,
375      2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376      1, 1, 1, 1, 1, 1, 1, 0, 4, 2,
377      4, 2, 6, 4, 4, 2, 4, 2, 2, 1,
378      0, 1, 1, 1, 1, 1, 3, 3, 1, 3,
379      1, 1, 2, 1, 1, 1, 2, 2, 0, 1,
380      0, 5, 1, 2, 2, 1, 3, 3, 1, 1,
381      1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
382      0, 1, 0, 1, 0, 1, 1, 1, 1, 1,
383      2, 0, 0,
384     }, yyDefRed = {
385 //yyDefRed 884
386
1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
387      0, 0, 293, 296, 0, 0, 0, 319, 320, 0,
388      0, 0, 417, 416, 418, 419, 0, 0, 0, 20,
389      0, 421, 420, 0, 0, 413, 412, 0, 415, 424,
390    425, 407, 408, 0, 0, 0, 0, 0, 0, 0,
391      0, 0, 0, 0, 0, 388, 390, 390, 0, 0,
392    266, 0, 373, 267, 268, 0, 269, 270, 265, 369,
393    371, 35, 2, 0, 0, 0, 0, 0, 0, 0,
394    271, 0, 43, 0, 0, 70, 0, 5, 0, 0,
395     60, 0, 0, 370, 0, 0, 317, 318, 283, 0,
396      0, 0, 0, 0, 0, 0, 0, 0, 0, 321,
397      0, 272, 422, 0, 93, 310, 140, 151, 141, 164,
398    137, 157, 147, 146, 162, 145, 144, 139, 165, 149,
399    138, 152, 156, 158, 150, 143, 159, 166, 161, 0,
400      0, 0, 0, 136, 155, 154, 167, 168, 169, 170,
401    171, 135, 142, 133, 134, 0, 0, 0, 97, 0,
402    126, 127, 124, 108, 109, 110, 113, 115, 111, 128,
403    129, 116, 117, 460, 121, 120, 107, 125, 123, 122,
404    118, 119, 114, 112, 105, 106, 130, 0, 459, 312,
405     98, 99, 160, 153, 163, 148, 131, 132, 95, 96,
406      0, 0, 102, 101, 100, 0, 0, 0, 0, 0,
407      0, 0, 0, 0, 0, 0, 488, 487, 0, 0,
408      0, 489, 0, 0, 0, 0, 0, 0, 333, 334,
409      0, 0, 0, 0, 0, 229, 45, 0, 0, 0,
410    465, 237, 46, 44, 0, 59, 0, 0, 348, 58,
411     38, 0, 9, 483, 0, 0, 0, 192, 0, 0,
412      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
413      0, 217, 0, 0, 462, 0, 0, 0, 0, 0,
414      0, 68, 0, 208, 39, 207, 404, 403, 405, 0,
415    401, 402, 0, 0, 0, 0, 0, 0, 0, 374,
416    352, 350, 290, 4, 0, 0, 0, 0, 0, 0,
417      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
418      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
419      0, 0, 0, 0, 0, 0, 0, 0, 339, 341,
420      0, 0, 0, 0, 0, 0, 72, 0, 0, 0,
421      0, 0, 0, 344, 0, 288, 0, 409, 410, 0,
422     90, 0, 92, 0, 427, 305, 426, 0, 0, 0,
423      0, 0, 478, 479, 314, 0, 103, 0, 0, 274,
424      0, 324, 323, 0, 0, 0, 0, 0, 0, 0,
425      0, 0, 0, 0, 0, 0, 490, 0, 0, 0,
426      0, 0, 0, 302, 0, 257, 0, 0, 230, 259,
427      0, 232, 285, 0, 0, 252, 251, 0, 0, 0,
428      0, 0, 11, 13, 12, 0, 0, 0, 0, 0,
429      0, 0, 0, 0, 0, 0, 277, 0, 0, 0,
430    218, 281, 0, 485, 219, 0, 221, 0, 464, 463,
431    282, 0, 0, 0, 0, 392, 395, 393, 406, 391,
432    375, 389, 376, 377, 378, 379, 382, 0, 384, 0,
433    385, 0, 0, 0, 15, 16, 17, 18, 19, 36,
434     37, 0, 0, 0, 0, 0, 0, 0, 0, 0,
435      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
436      0, 0, 0, 0, 0, 0, 0, 0, 0, 473,
437      0, 0, 474, 0, 0, 0, 0, 347, 0, 0,
438    471, 472, 0, 0, 30, 0, 0, 23, 0, 31,
439    260, 0, 0, 66, 73, 24, 33, 0, 25, 0,
440     50, 53, 0, 429, 0, 0, 0, 0, 0, 0,
441     94, 0, 0, 0, 0, 0, 442, 441, 443, 0,
442    451, 450, 455, 454, 0, 0, 448, 0, 0, 439,
443    445, 0, 0, 0, 0, 363, 0, 0, 364, 0,
444      0, 331, 0, 325, 0, 0, 0, 0, 0, 0,
445      0, 0, 0, 0, 0, 0, 300, 328, 327, 294,
446    326, 297, 0, 0, 0, 0, 0, 0, 0, 236,
447    467, 0, 0, 0, 258, 0, 0, 466, 284, 0,
448      0, 255, 0, 0, 249, 0, 0, 0, 0, 0,
449    223, 0, 10, 0, 0, 22, 0, 0, 0, 0,
450      0, 222, 0, 261, 0, 0, 0, 0, 0, 0,
451      0, 381, 383, 387, 337, 0, 0, 335, 0, 0,
452      0, 0, 0, 228, 0, 345, 227, 0, 0, 346,
453      0, 0, 48, 342, 49, 343, 264, 0, 0, 71,
454      0, 308, 0, 0, 280, 311, 0, 315, 0, 0,
455      0, 431, 0, 435, 0, 437, 0, 438, 452, 456,
456    104, 0, 0, 366, 332, 0, 3, 368, 0, 329,
457      0, 0, 0, 0, 0, 0, 299, 301, 357, 0,
458      0, 0, 0, 0, 0, 0, 0, 234, 0, 0,
459      0, 0, 0, 242, 254, 224, 0, 0, 225, 0,
460      0, 287, 21, 276, 0, 0, 0, 397, 398, 399,
461    394, 400, 336, 0, 0, 0, 0, 0, 27, 0,
462     28, 0, 55, 29, 0, 0, 57, 0, 0, 0,
463      0, 0, 0, 428, 306, 461, 0, 447, 0, 313,
464      0, 457, 446, 0, 0, 449, 0, 0, 0, 0,
465    365, 0, 0, 367, 0, 291, 0, 292, 0, 0,
466      0, 0, 303, 231, 0, 233, 248, 256, 0, 0,
467      0, 239, 0, 0, 220, 396, 338, 353, 351, 340,
468     26, 0, 263, 0, 0, 0, 430, 0, 433, 434,
469    436, 0, 0, 0, 0, 0, 0, 356, 358, 354,
470    359, 295, 298, 0, 0, 0, 0, 238, 0, 244,
471      0, 226, 51, 309, 0, 0, 0, 0, 0, 0,
472      0, 360, 0, 0, 235, 240, 0, 0, 0, 243,
473    316, 432, 0, 330, 304, 0, 0, 245, 0, 241,
474      0, 246, 0, 247,
475     }, yyDgoto = {
476 //yyDgoto 136
477
1, 187, 60, 61, 62, 63, 64, 292, 289, 459,
478     65, 66, 67, 467, 68, 69, 70, 108, 71, 205,
479    206, 73, 74, 75, 76, 77, 78, 209, 258, 709,
480    839, 710, 702, 236, 621, 416, 706, 663, 365, 245,
481     80, 665, 81, 82, 564, 565, 566, 201, 750, 211,
482    529, 84, 85, 237, 395, 577, 270, 227, 656, 212,
483     87, 298, 296, 567, 568, 272, 595, 88, 273, 240,
484    277, 408, 614, 409, 693, 781, 355, 339, 541, 89,
485     90, 266, 378, 213, 214, 202, 290, 93, 113, 546,
486    517, 114, 204, 512, 570, 571, 374, 572, 573, 2,
487    219, 220, 425, 255, 680, 191, 574, 254, 444, 246,
488    625, 730, 438, 383, 222, 599, 721, 223, 722, 607,
489    843, 545, 384, 542, 772, 370, 375, 554, 776, 507,
490    472, 471, 650, 649, 544, 371,
491     }, yySindex = {
492 //yySindex 884
493
0, 0, 3681, 5119, 16053, 16398, 16963, 16853, 3681, 4675,
494   4675, 4558, 0, 0, 16168, 13523, 13523, 0, 0, 13523,
495   -295, -286, 0, 0, 0, 0, 4675, 16743, 62, 0,
496   -267, 0, 0, 0, 0, 0, 0, 0, 0, 0,
497      0, 0, 0, 15823, 15823, -86, -111, 4161, 4675, 14903,
498  15823, 16513, 15823, 15938, 17072, 0, 0, 0, 187, 204,
499      0, -125, 0, 0, 0, -244, 0, 0, 0, 0,
500      0, 0, 0, 55, 1056, 179, 2741, 0, -16, -46,
501      0, -159, 0, -59, 243, 0, 232, 0, 16283, 270,
502      0, -4, 0, 0, -209, 1056, 0, 0, 0, -295,
503   -286, 62, 0, 0, -36, 4675, -74, 3681, 39, 0,
504    129, 0, 0, -209, 0, 0, 0, 0, 0, 0,
505      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
506      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
507      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
508      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
509      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
510      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
511      0, 0, 0, 0, 0, 0, 0, -142, 0, 0,
512      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
513  17072, 289, 0, 0, 0, 77, 172, 48, 179, 83,
514    156, 107, 394, 123, 0, 83, 0, 0, 55, -184,
515    409, 0, 4675, 4675, 152, 170, 0, 193, 0, 0,
516      0, 15823, 15823, 15823, 2741, 0, 0, 140, 459, 482,
517      0, 0, 0, 0, 13293, 0, 13638, 13523, 0, 0,
518      0, 212, 0, 0, 5644, 120, 3681, 0, 205, 218,
519    225, 235, 219, 4161, 217, 0, 237, 179, 15823, 62,
520    186, 0, 60, 76, 0, 118, 76, 211, 277, 439,
521      0, 0, 0, 0, 0, 0, 0, 0, 0, -199,
522      0, 0, -190, -162, 318, 220, -110, 223, -234, 0,
523      0, 0, 0, 0, 13178, 4675, 4675, 4675, 4675, 5119,
524   4675, 4675, 15823, 15823, 15823, 15823, 15823, 15823, 15823, 15823,
525  15823, 15823, 15823, 15823, 15823, 15823, 15823, 15823, 15823, 15823,
526  15823, 15823, 15823, 15823, 15823, 15823, 15823, 15823, 0, 0,
527   5712, 9042, 14903, 17240, 17240, 15938, 0, 15018, 4161, 16513,
528    559, 15018, 15938, 0, 239, 0, 267, 0, 0, 179,
529      0, 0, 0, 55, 0, 0, 0, 17240, 17299, 14903,
530   3681, 4675, 0, 0, 0, 718, 0, 15133, 344, 0,
531    219, 0, 0, 3681, 354, 17358, 17417, 14903, 15823, 15823,
532  15823, 3681, 352, 3681, 15248, 362, 0, 80, 80, 0,
533  17476, 17535, 14903, 0, 587, 0, 15823, 13753, 0, 0,
534  13868, 0, 0, 292, 13408, 0, 0, -16, 62, 15,
535    294, 595, 0, 0, 0, 16853, 4675, 2741, 3681, 285,
536  17358, 17417, 15823, 15823, 15823, 308, 0, 0, 62, 1669,
537      0, 0, 15363, 0, 0, 15823, 0, 15823, 0, 0,
538      0, 0, 17594, 17653, 14903, 0, 0, 0, 0, 0,
539      0, 0, 0, 0, 0, 0, 0, 29, 0, 636,
540      0, -166, -166, 1056, 0, 0, 0, 0, 0, 0,
541      0, 218, 1727, 1727, 1727, 1727, 1512, 1512, 8470, 2685,
542   1727, 1727, 2205, 2205, 631, 631, 218, 826, 218, 218,
543    286, 286, 1512, 1512, 1427, 1427, 4968, -166, 322, 0,
544    337, -286, 0, 338, 0, 339, -286, 0, 0, 341,
545      0, 0, -286, -286, 0, 2741, 15823, 0, 2261, 0,
546      0, 645, 349, 0, 0, 0, 0, 0, 0, 2741,
547      0, 0, 55, 0, 4675, 3681, -286, 0, 0, -286,
548      0, 353, 437, 154, 17181, 641, 0, 0, 0, 1449,
549      0, 0, 0, 0, 3681, 55, 0, 659, 663, 0,
550      0, 666, 411, 420, 16853, 0, 0, 388, 0, 3681,
551    469, 0, 226, 0, 398, 399, 405, 339, 387, 2261,
552    344, 483, 485, 15823, 702, 83, 0, 0, 0, 0,
553      0, 0, 0, 0, 0, 0, 404, 4675, 402, 0,
554      0, 15823, 140, 712, 0, 15823, 140, 0, 0, 15823,
555   2741, 0, -2, 717, 0, 421, 427, 17240, 17240, 431,
556      0, 13983, 0, -147, 413, 0, 218, 218, 2741, 0,
557    436, 0, 15823, 0, 0, 0, 0, 0, 445, 3681,
558    986, 0, 0, 0, 0, 3235, 3681, 0, 3681, 15823,
559   3681, 15938, 15938, 0, 239, 0, 0, 15938, 15823, 0,
560    239, 434, 0, 0, 0, 0, 0, 15823, 15478, 0,
561   -166, 0, 55, 528, 0, 0, 453, 0, 15823, 62,
562    536, 0, 1449, 0, 654, 0, 215, 0, 0, 0,
563      0, 16628, 83, 0, 0, 3681, 0, 0, 4675, 0,
564    538, 15823, 15823, 15823, 465, 542, 0, 0, 0, 15593,
565   3681, 3681, 3681, 0, 80, 587, 14098, 0, 587, 587,
566    466, 14213, 14328, 0, 0, 0, -286, -286, 0, -16,
567     15, 0, 0, 0, 1669, 0, 444, 0, 0, 0,
568      0, 0, 0, 461, 558, 468, 2741, 570, 0, 2741,
569      0, 2741, 0, 0, 2741, 2741, 0, 15938, 2741, 15823,
570      0, 3681, 3681, 0, 0, 0, 718, 0, 493, 0,
571    794, 0, 0, 666, 641, 0, 666, 531, 464, 0,
572      0, 0, 3681, 0, 83, 0, 15823, 0, 15823, -172,
573    577, 585, 0, 0, 15823, 0, 0, 0, 15823, 811,
574    813, 0, 15823, 516, 0, 0, 0, 0, 0, 0,
575      0, 2741, 0, 496, 598, 3681, 0, 654, 0, 0,
576      0, 0, 17712, 17771, 14903, 77, 3681, 0, 0, 0,
577      0, 0, 0, 3681, 4010, 587, 14443, 0, 14558, 0,
578    587, 0, 0, 0, 602, 666, 0, 0, 0, 0,
579    521, 0, 226, 604, 0, 0, 15823, 835, 15823, 0,
580      0, 0, 0, 0, 0, 587, 14673, 0, 587, 0,
581  15823, 0, 587, 0,
582     }, yyRindex = {
583 //yyRindex 884
584
0, 0, 167, 0, 0, 0, 0, 0, 566, 0,
585      0, -145, 0, 0, 0, 7401, 7506, 0, 0, 7615,
586   4432, 3837, 0, 0, 0, 0, 0, 0, 15708, 0,
587      0, 0, 0, 1917, 2992, 0, 0, 2032, 0, 0,
588      0, 0, 0, 0, 0, 0, 0, 57, 0, 537,
589    522, 105, 0, 0, 190, 0, 0, 0, 245, -223,
590      0, 6697, 0, 0, 0, 6802, 0, 0, 0, 0,
591      0, 0, 0, 708, 213, 2630, 8683, 6911, 12063, 0,
592      0, 12108, 0, 8665, 0, 0, 0, 0, 222, 0,
593      0, 0, 8548, 0, 14788, 265, 0, 0, 0, 7050,
594   5832, 551, 12242, 12363, 0, 0, 0, 57, 0, 0,
595      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
596      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
597      0, 0, 0, 0, 0, 0, 0, 0, 0, 919,
598   1802, 2102, 2159, 0, 0, 0, 0, 0, 0, 0,
599      0, 0, 0, 0, 0, 2639, 3119, 3541, 0, 3552,
600      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
601      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
602      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
603      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
604      0, 3110, 0, 0, 0, 351, 0, 0, 12149, 0,
605      0, 6346, 0, 0, 5935, 0, 0, 0, 618, 0,
606    -71, 0, 0, 0, 0, 0, 547, 0, 0, 0,
607    759, 0, 0, 0, 10949, 0, 0, 11797, 6286, 6286,
608      0, 0, 0, 0, 0, 0, 0, 555, 0, 0,
609      0, 0, 0, 0, 0, 0, 16, 0, 0, 7735,
610   7153, 7264, 8774, 57, 0, 33, 0, 20, 0, 563,
611      0, 0, 564, 564, 0, 541, 541, 0, 0, 0,
612    363, 0, 1338, 0, 0, 0, 0, 0, 0, 0,
613      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
614      0, 0, 0, 0, 842, 0, 0, 0, 0, 0,
615      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
616      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
617      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
618      0, 0, 537, 0, 0, 0, 0, 0, 57, 435,
619    520, 0, 0, 0, 1619, 0, 0, 0, 0, 98,
620      0, 12713, 0, 0, 0, 0, 0, 0, 0, 537,
621    566, 0, 0, 0, 0, 150, 0, 121, 401, 0,
622   6449, 0, 0, 676, 12829, 0, 0, 537, 0, 0,
623      0, 59, 0, 142, 0, 0, 0, 0, 0, 830,
624      0, 0, 537, 0, 6286, 0, 0, 0, 0, 0,
625      0, 0, 0, 0, 568, 0, 0, 43, 571, 571,
626      0, 53, 0, 0, 0, 0, 0, 11038, 16, 0,
627      0, 0, 0, 0, 0, 0, 0, 146, 571, 563,
628      0, 0, 574, 0, 0, -143, 0, 552, 0, 0,
629      0, 1473, 0, 0, 537, 0, 0, 0, 0, 0,
630      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
631      0, 12947, 13063, 854, 0, 0, 0, 0, 0, 0,
632      0, 7844, 10177, 10267, 10370, 10469, 9734, 9838, 10559, 10824,
633  10646, 10735, 6183, 10911, 9279, 9383, 7949, 9494, 8086, 8197,
634   8972, 9157, 9960, 10078, 1776, 9623, 0, 12947, 4795, 0,
635   4910, 3952, 0, 5275, 3357, 5390, 14788, 0, 3472, 0,
636      0, 0, 5517, 5517, 0, 11079, 0, 0, 878, 0,
637      0, 0, 0, 0, 0, 0, 0, 1561, 0, 11166,
638      0, 0, 0, 0, 0, 566, 6039, 12479, 12597, 0,
639      0, 0, 0, 571, 0, 73, 0, 0, 0, 70,
640      0, 0, 0, 0, 566, 0, 0, 97, 97, 0,
641      0, 97, 90, 0, 0, 0, 111, 100, 0, 189,
642    661, 0, 661, 0, 2397, 2512, 2877, 4317, 0, 11833,
643    661, 0, 0, 0, 127, 0, 0, 0, 0, 0,
644      0, 0, 178, 1046, 1600, 430, 0, 0, 0, 0,
645      0, 0, 11924, 6286, 0, 0, 0, 0, 0, 0,
646     91, 0, 0, 580, 0, 0, 0, 0, 0, 0,
647      0, 0, 0, 0, 0, 0, 8300, 8423, 11226, 92,
648      0, 0, 0, 0, 1329, 1363, 1591, 874, 0, 16,
649      0, 0, 0, 0, 0, 0, 142, 0, 16, 0,
650    142, 0, 0, 0, 11960, 0, 0, 0, 0, 0,
651  12023, 8850, 0, 0, 0, 0, 0, 0, 0, 0,
652  13063, 0, 0, 0, 0, 0, 0, 0, 0, 571,
653      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
654      0, 0, 0, 0, 0, 142, 0, 0, 0, 0,
655      0, 0, 0, 0, 6560, 0, 0, 0, 0, 0,
656    543, 142, 142, 873, 0, 6286, 0, 0, 6286, 580,
657      0, 0, 0, 0, 0, 0, 14, 14, 0, 0,
658    571, 0, 0, 0, 563, 2086, 0, 0, 0, 0,
659      0, 0, 0, 0, 0, 0, 11264, 0, 0, 11352,
660      0, 11394, 0, 0, 11481, 11541, 0, 0, 11650, 0,
661   1445, 16, 566, 0, 0, 0, 150, 0, 0, 0,
662     97, 0, 0, 97, 0, 0, 97, 0, 0, 481,
663      0, 515, 566, 0, 0, 0, 0, 0, 0, 661,
664      0, 0, 0, 0, 0, 0, 0, 0, 0, 580,
665    580, 0, 0, 0, 0, 0, 0, 0, 0, 0,
666      0, 11710, 0, 0, 0, 566, 0, 0, 0, 0,
667      0, 765, 0, 0, 537, 351, 676, 0, 0, 0,
668      0, 0, 0, 142, 6286, 580, 0, 0, 0, 0,
669    580, 0, 0, 0, 0, 97, 985, 1248, 1288, 182,
670      0, 0, 661, 0, 0, 0, 0, 580, 0, 0,
671      0, 0, 833, 0, 0, 580, 0, 0, 580, 0,
672      0, 0, 580, 0,
673     }, yyGindex = {
674 //yyGindex 136
675
0, 0, 0, 0, 865, 0, 0, 0, 615, -120,
676      0, 0, 0, 0, 0, 0, 0, 922, 13, 928,
677   -358, 0, 106, 1189, -15, 4, 35, 63, 241, -357,
678      0, 66, 0, 629, 0, 0, 0, -18, 0, -6,
679    925, 134, -228, 0, 158, 379, -646, 0, 0, 680,
680   -186, 853, -24, 1280, -376, 0, -325, 293, -426, 892,
681    903, 0, 0, 0, 255, 96, 0, 0, -9, -377,
682      0, 37, 24, 0, 30, -355, 886, 0, -456, -1,
683     11, -203, 124, 1131, 737, -13, 0, -5, 710, -238,
684      0, -42, 5, 25, 263, -569, 0, 0, 0, 0,
685    -50, 887, 0, 0, 0, 0, 0, -10, 295, 0,
686      0, 0, 0, -210, 0, -341, 0, 0, 0, 0,
687      0, 0, 116, 0, 0, 0, 0, 0, 0, 0,
688      0, 0, 0, 0, 0, 0,
689     };
690     protected static final short[] yyTable = YyTables.yyTable();
691     protected static final short[] yyCheck = YyTables.yyCheck();
692
693   /** maps symbol value to printable name.
694       @see #yyExpecting
695     */

696   protected static final String JavaDoc[] yyNames = {
697     "end-of-file",null,null,null,null,null,null,null,null,null,"'\\n'",
698     null,null,null,null,null,null,null,null,null,null,null,null,null,null,
699     null,null,null,null,null,null,null,"' '",null,null,null,null,null,
700     null,null,null,null,null,null,"','",null,null,null,null,null,null,
701     null,null,null,null,null,null,null,"':'","';'",null,"'='",null,"'?'",
702     null,null,null,null,null,null,null,null,null,null,null,null,null,null,
703     null,null,null,null,null,null,null,null,null,null,null,null,null,
704     "'['",null,null,null,null,null,null,null,null,null,null,null,null,
705     null,null,null,null,null,null,null,null,null,null,null,null,null,null,
706     null,null,null,null,null,null,null,null,null,null,null,null,null,null,
707     null,null,null,null,null,null,null,null,null,null,null,null,null,null,
708     null,null,null,null,null,null,null,null,null,null,null,null,null,null,
709     null,null,null,null,null,null,null,null,null,null,null,null,null,null,
710     null,null,null,null,null,null,null,null,null,null,null,null,null,null,
711     null,null,null,null,null,null,null,null,null,null,null,null,null,null,
712     null,null,null,null,null,null,null,null,null,null,null,null,null,null,
713     null,null,null,null,null,null,null,null,null,null,null,null,null,null,
714     null,null,null,null,null,null,null,null,null,null,null,null,null,null,
715     null,null,null,null,null,null,null,null,null,null,null,null,null,
716     "kCLASS","kMODULE","kDEF","kUNDEF","kBEGIN","kRESCUE","kENSURE",
717     "kEND","kIF","kUNLESS","kTHEN","kELSIF","kELSE","kCASE","kWHEN",
718     "kWHILE","kUNTIL","kFOR","kBREAK","kNEXT","kREDO","kRETRY","kIN",
719     "kDO","kDO_COND","kDO_BLOCK","kRETURN","kYIELD","kSUPER","kSELF",
720     "kNIL","kTRUE","kFALSE","kAND","kOR","kNOT","kIF_MOD","kUNLESS_MOD",
721     "kWHILE_MOD","kUNTIL_MOD","kRESCUE_MOD","kALIAS","kDEFINED","klBEGIN",
722     "klEND","k__LINE__","k__FILE__","tIDENTIFIER","tFID","tGVAR","tIVAR",
723     "tCONSTANT","tCVAR","tNTH_REF","tBACK_REF","tSTRING_CONTENT",
724     "tINTEGER","tFLOAT","tREGEXP_END","tUPLUS","tUMINUS","tUMINUS_NUM",
725     "tPOW","tCMP","tEQ","tEQQ","tNEQ","tGEQ","tLEQ","tANDOP","tOROP",
726     "tMATCH","tNMATCH","tDOT","tDOT2","tDOT3","tAREF","tASET","tLSHFT",
727     "tRSHFT","tCOLON2","tCOLON3","tOP_ASGN","tASSOC","tLPAREN","tLPAREN2",
728     "tRPAREN","tLPAREN_ARG","tLBRACK","tRBRACK","tLBRACE","tLBRACE_ARG",
729     "tSTAR","tSTAR2","tAMPER","tAMPER2","tTILDE","tPERCENT","tDIVIDE",
730     "tPLUS","tMINUS","tLT","tGT","tPIPE","tBANG","tCARET","tLCURLY",
731     "tRCURLY","tBACK_REF2","tSYMBEG","tSTRING_BEG","tXSTRING_BEG",
732     "tREGEXP_BEG","tWORDS_BEG","tQWORDS_BEG","tSTRING_DBEG",
733     "tSTRING_DVAR","tSTRING_END","tLOWEST","tLAST_TOKEN",
734     };
735
736   /** thrown for irrecoverable syntax errors and stack overflow.
737       Nested for convenience, does not depend on parser class.
738     */

739   public static class yyException extends java.lang.Exception JavaDoc {
740     private static final long serialVersionUID = 1L;
741     public yyException (String JavaDoc message) {
742       super(message);
743     }
744   }
745
746   /** must be implemented by a scanner object to supply input to the parser.
747       Nested for convenience, does not depend on parser class.
748     */

749   public interface yyInput {
750
751     /** move on to next token.
752         @return <tt>false</tt> if positioned beyond tokens.
753         @throws IOException on input error.
754       */

755     boolean advance () throws java.io.IOException JavaDoc;
756
757     /** classifies current token.
758         Should not be called if {@link #advance()} returned <tt>false</tt>.
759         @return current <tt>%token</tt> or single character.
760       */

761     int token ();
762
763     /** associated with current token.
764         Should not be called if {@link #advance()} returned <tt>false</tt>.
765         @return value for {@link #token()}.
766       */

767     Object JavaDoc value ();
768   }
769
770   /** simplified error message.
771       @see #yyerror(java.lang.String, java.lang.String[])
772     */

773   public void yyerror (String JavaDoc message) {
774     yyerror(message, null, null);
775   }
776
777   /** (syntax) error message.
778       Can be overwritten to control message format.
779       @param message text to be displayed.
780       @param expected list of acceptable tokens, if available.
781     */

782   public void yyerror (String JavaDoc message, String JavaDoc[] expected, String JavaDoc found) {
783     StringBuffer JavaDoc text = new StringBuffer JavaDoc(message);
784
785     if (expected != null && expected.length > 0) {
786       text.append(", expecting");
787       for (int n = 0; n < expected.length; ++ n) {
788         text.append("\t").append(expected[n]);
789       }
790       text.append(" but found " + found + " instead\n");
791     }
792
793     throw new SyntaxException(getPosition(null), text.toString());
794   }
795
796   /** computes list of expected tokens on error by tracing the tables.
797       @param state for which to compute the list.
798       @return list of token names.
799     */

800   protected String JavaDoc[] yyExpecting (int state) {
801     int token, n, len = 0;
802     boolean[] ok = new boolean[yyNames.length];
803
804     if ((n = yySindex[state]) != 0)
805       for (token = n < 0 ? -n : 0;
806            token < yyNames.length && n+token < yyTable.length; ++ token)
807         if (yyCheck[n+token] == token && !ok[token] && yyNames[token] != null) {
808           ++ len;
809           ok[token] = true;
810         }
811     if ((n = yyRindex[state]) != 0)
812       for (token = n < 0 ? -n : 0;
813            token < yyNames.length && n+token < yyTable.length; ++ token)
814         if (yyCheck[n+token] == token && !ok[token] && yyNames[token] != null) {
815           ++ len;
816           ok[token] = true;
817         }
818
819     String JavaDoc result[] = new String JavaDoc[len];
820     for (n = token = 0; n < len; ++ token)
821       if (ok[token]) result[n++] = yyNames[token];
822     return result;
823   }
824
825   /** the generated parser, with debugging messages.
826       Maintains a dynamic state and value stack.
827       @param yyLex scanner.
828       @param yydebug debug message writer implementing <tt>yyDebug</tt>, or <tt>null</tt>.
829       @return result of the last reduction, if any.
830       @throws yyException on irrecoverable parse error.
831     */

832   public Object JavaDoc yyparse (RubyYaccLexer yyLex, Object JavaDoc ayydebug)
833                 throws java.io.IOException JavaDoc, yyException {
834     return yyparse(yyLex);
835   }
836
837   /** initial size and increment of the state/value stack [default 256].
838       This is not final so that it can be overwritten outside of invocations
839       of {@link #yyparse}.
840     */

841   protected int yyMax;
842
843   /** executed at the beginning of a reduce action.
844       Used as <tt>$$ = yyDefault($1)</tt>, prior to the user-specified action, if any.
845       Can be overwritten to provide deep copy, etc.
846       @param first value for <tt>$1</tt>, or <tt>null</tt>.
847       @return first.
848     */

849   protected Object JavaDoc yyDefault (Object JavaDoc first) {
850     return first;
851   }
852
853   /** the generated parser.
854       Maintains a dynamic state and value stack.
855       @param yyLex scanner.
856       @return result of the last reduction, if any.
857       @throws yyException on irrecoverable parse error.
858     */

859   public Object JavaDoc yyparse (RubyYaccLexer yyLex) throws java.io.IOException JavaDoc, yyException {
860     if (yyMax <= 0) yyMax = 256; // initial size
861
int yyState = 0, yyStates[] = new int[yyMax]; // state stack
862
Object JavaDoc yyVal = null, yyVals[] = new Object JavaDoc[yyMax]; // value stack
863
int yyToken = -1; // current input
864
int yyErrorFlag = 0; // #tokens to shift
865

866     yyLoop: for (int yyTop = 0;; ++ yyTop) {
867       if (yyTop >= yyStates.length) { // dynamically increase
868
int[] i = new int[yyStates.length+yyMax];
869         System.arraycopy(yyStates, 0, i, 0, yyStates.length);
870         yyStates = i;
871         Object JavaDoc[] o = new Object JavaDoc[yyVals.length+yyMax];
872         System.arraycopy(yyVals, 0, o, 0, yyVals.length);
873         yyVals = o;
874       }
875       yyStates[yyTop] = yyState;
876       yyVals[yyTop] = yyVal;
877
878       yyDiscarded: for (;;) { // discarding a token does not change stack
879
int yyN;
880         if ((yyN = yyDefRed[yyState]) == 0) { // else [default] reduce (yyN)
881
if (yyToken < 0) {
882             yyToken = yyLex.advance() ? yyLex.token() : 0;
883           }
884           if ((yyN = yySindex[yyState]) != 0 && (yyN += yyToken) >= 0
885               && yyN < yyTable.length && yyCheck[yyN] == yyToken) {
886             yyState = yyTable[yyN]; // shift to yyN
887
yyVal = yyLex.value();
888             yyToken = -1;
889             if (yyErrorFlag > 0) -- yyErrorFlag;
890             continue yyLoop;
891           }
892           if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0
893               && yyN < yyTable.length && yyCheck[yyN] == yyToken)
894             yyN = yyTable[yyN]; // reduce (yyN)
895
else
896             switch (yyErrorFlag) {
897   
898             case 0:
899               yyerror("syntax error", yyExpecting(yyState), yyNames[yyToken]);
900   
901             case 1: case 2:
902               yyErrorFlag = 3;
903               do {
904                 if ((yyN = yySindex[yyStates[yyTop]]) != 0
905                     && (yyN += yyErrorCode) >= 0 && yyN < yyTable.length
906                     && yyCheck[yyN] == yyErrorCode) {
907                   yyState = yyTable[yyN];
908                   yyVal = yyLex.value();
909                   continue yyLoop;
910                 }
911               } while (-- yyTop >= 0);
912               throw new yyException("irrecoverable syntax error");
913   
914             case 3:
915               if (yyToken == 0) {
916                 throw new yyException("irrecoverable syntax error at end-of-file");
917               }
918               yyToken = -1;
919               continue yyDiscarded; // leave stack alone
920
}
921         }
922         int yyV = yyTop + 1-yyLen[yyN];
923         yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
924         switch (yyN) {
925 case 1:
926                     // line 259 "DefaultRubyParser.y"
927
{
928                   lexer.setState(LexState.EXPR_BEG);
929                   support.initTopLocalVariables();
930               }
931   break;
932 case 2:
933                     // line 262 "DefaultRubyParser.y"
934
{
935                   if (((Node)yyVals[0+yyTop]) != null) {
936                       /* last expression should not be void */
937                       if (((Node)yyVals[0+yyTop]) instanceof BlockNode) {
938                           support.checkUselessStatement(((BlockNode)yyVals[0+yyTop]).getLast());
939                       } else {
940                           support.checkUselessStatement(((Node)yyVals[0+yyTop]));
941                       }
942                   }
943                   support.getResult().setAST(support.addRootNode(((Node)yyVals[0+yyTop])));
944               }
945   break;
946 case 3:
947                     // line 274 "DefaultRubyParser.y"
948
{
949                   Node node = ((Node)yyVals[-3+yyTop]);
950
951           if (((RescueBodyNode)yyVals[-2+yyTop]) != null) {
952               node = new RescueNode(getPosition(((Node)yyVals[-3+yyTop]), true), ((Node)yyVals[-3+yyTop]), ((RescueBodyNode)yyVals[-2+yyTop]), ((Node)yyVals[-1+yyTop]));
953           } else if (((Node)yyVals[-1+yyTop]) != null) {
954               warnings.warn(getPosition(((Node)yyVals[-3+yyTop])), "else without rescue is useless");
955                       node = support.appendToBlock(((Node)yyVals[-3+yyTop]), ((Node)yyVals[-1+yyTop]));
956           }
957           if (((Node)yyVals[0+yyTop]) != null) {
958               node = new EnsureNode(getPosition(((Node)yyVals[-3+yyTop])), node, ((Node)yyVals[0+yyTop]));
959           }
960
961               yyVal = node;
962               }
963   break;
964 case 4:
965                     // line 290 "DefaultRubyParser.y"
966
{
967                   if (((Node)yyVals[-1+yyTop]) instanceof BlockNode) {
968                       support.checkUselessStatements(((BlockNode)yyVals[-1+yyTop]));
969           }
970                   yyVal = ((Node)yyVals[-1+yyTop]);
971               }
972   break;
973 case 6:
974                     // line 298 "DefaultRubyParser.y"
975
{
976                   yyVal = support.newline_node(((Node)yyVals[0+yyTop]), getPosition(((Node)yyVals[0+yyTop]), true));
977               }
978   break;
979 case 7:
980                     // line 301 "DefaultRubyParser.y"
981
{
982               yyVal = support.appendToBlock(((Node)yyVals[-2+yyTop]), support.newline_node(((Node)yyVals[0+yyTop]), getPosition(((Node)yyVals[-2+yyTop]), true)));
983               }
984   break;
985 case 8:
986                     // line 304 "DefaultRubyParser.y"
987
{
988                   yyVal = ((Node)yyVals[0+yyTop]);
989               }
990   break;
991 case 9:
992                     // line 308 "DefaultRubyParser.y"
993
{
994                   lexer.setState(LexState.EXPR_FNAME);
995               }
996   break;
997 case 10:
998                     // line 310 "DefaultRubyParser.y"
999
{
1000                  yyVal = new AliasNode(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])), (String JavaDoc) ((Token)yyVals[-2+yyTop]).getValue(), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
1001              }
1002  break;
1003case 11:
1004                    // line 313 "DefaultRubyParser.y"
1005
{
1006                  yyVal = new VAliasNode(getPosition(((Token)yyVals[-2+yyTop])), (String JavaDoc) ((Token)yyVals[-1+yyTop]).getValue(), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
1007              }
1008  break;
1009case 12:
1010                    // line 316 "DefaultRubyParser.y"
1011
{
1012                  yyVal = new VAliasNode(getPosition(((Token)yyVals[-2+yyTop])), (String JavaDoc) ((Token)yyVals[-1+yyTop]).getValue(), "$" + ((BackRefNode)yyVals[0+yyTop]).getType()); /* XXX*/
1013              }
1014  break;
1015case 13:
1016                    // line 319 "DefaultRubyParser.y"
1017
{
1018                  yyerror("can't make alias for the number variables");
1019              }
1020  break;
1021case 14:
1022                    // line 322 "DefaultRubyParser.y"
1023
{
1024                  yyVal = ((Node)yyVals[0+yyTop]);
1025              }
1026  break;
1027case 15:
1028                    // line 325 "DefaultRubyParser.y"
1029
{
1030                  yyVal = new IfNode(support.union(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), support.getConditionNode(((Node)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), null);
1031              }
1032  break;
1033case 16:
1034                    // line 328 "DefaultRubyParser.y"
1035
{
1036                  yyVal = new IfNode(support.union(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), support.getConditionNode(((Node)yyVals[0+yyTop])), null, ((Node)yyVals[-2+yyTop]));
1037              }
1038  break;
1039case 17:
1040                    // line 331 "DefaultRubyParser.y"
1041
{
1042                  if (((Node)yyVals[-2+yyTop]) != null && ((Node)yyVals[-2+yyTop]) instanceof BeginNode) {
1043                      yyVal = new WhileNode(getPosition(((Node)yyVals[-2+yyTop])), support.getConditionNode(((Node)yyVals[0+yyTop])), ((BeginNode)yyVals[-2+yyTop]).getBodyNode(), false);
1044                  } else {
1045                      yyVal = new WhileNode(getPosition(((Node)yyVals[-2+yyTop])), support.getConditionNode(((Node)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), true);
1046                  }
1047              }
1048  break;
1049case 18:
1050                    // line 338 "DefaultRubyParser.y"
1051
{
1052                  if (((Node)yyVals[-2+yyTop]) != null && ((Node)yyVals[-2+yyTop]) instanceof BeginNode) {
1053                      yyVal = new UntilNode(getPosition(((Node)yyVals[-2+yyTop])), support.getConditionNode(((Node)yyVals[0+yyTop])), ((BeginNode)yyVals[-2+yyTop]).getBodyNode());
1054                  } else {
1055                      yyVal = new UntilNode(getPosition(((Node)yyVals[-2+yyTop])), support.getConditionNode(((Node)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]));
1056                  }
1057              }
1058  break;
1059case 19:
1060                    // line 345 "DefaultRubyParser.y"
1061
{
1062              yyVal = new RescueNode(getPosition(((Node)yyVals[-2+yyTop])), ((Node)yyVals[-2+yyTop]), new RescueBodyNode(getPosition(((Node)yyVals[-2+yyTop])), null,((Node)yyVals[0+yyTop]), null), null);
1063              }
1064  break;
1065case 20:
1066                    // line 348 "DefaultRubyParser.y"
1067
{
1068                  if (support.isInDef() || support.isInSingle()) {
1069                      yyerror("BEGIN in method");
1070                  }
1071          support.pushLocalScope();
1072              }
1073  break;
1074case 21:
1075                    // line 353 "DefaultRubyParser.y"
1076
{
1077                  support.getResult().addBeginNode(support.getCurrentScope(), ((Node)yyVals[-1+yyTop]));
1078                  support.popCurrentScope();
1079                  yyVal = null; /*XXX 0;*/
1080              }
1081  break;
1082case 22:
1083                    // line 358 "DefaultRubyParser.y"
1084
{
1085                  if (support.isInDef() || support.isInSingle()) {
1086                      yyerror("END in method; use at_exit");
1087                  }
1088          /* FIXME: Totally broken if scoping is important...though if not this is an improvement over iterNode*/
1089                  support.getResult().addEndNode(new PostExeNode(getPosition(((Token)yyVals[-3+yyTop])), ((Node)yyVals[-1+yyTop])));
1090                  yyVal = null;
1091              }
1092  break;
1093case 23:
1094                    // line 366 "DefaultRubyParser.y"
1095
{
1096                  support.checkExpression(((Node)yyVals[0+yyTop]));
1097                  yyVal = support.node_assign(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
1098              }
1099  break;
1100case 24:
1101                    // line 370 "DefaultRubyParser.y"
1102
{
1103                  support.checkExpression(((Node)yyVals[0+yyTop]));
1104          if (((MultipleAsgnNode)yyVals[-2+yyTop]).getHeadNode() != null) {
1105              ((MultipleAsgnNode)yyVals[-2+yyTop]).setValueNode(new ToAryNode(getPosition(((MultipleAsgnNode)yyVals[-2+yyTop])), ((Node)yyVals[0+yyTop])));
1106          } else {
1107              ((MultipleAsgnNode)yyVals[-2+yyTop]).setValueNode(new ArrayNode(getPosition(((MultipleAsgnNode)yyVals[-2+yyTop])), ((Node)yyVals[0+yyTop])));
1108          }
1109          yyVal = ((MultipleAsgnNode)yyVals[-2+yyTop]);
1110              }
1111  break;
1112case 25:
1113                    // line 379 "DefaultRubyParser.y"
1114
{
1115              support.checkExpression(((Node)yyVals[0+yyTop]));
1116
1117              String JavaDoc name = ((INameNode)yyVals[-2+yyTop]).getName();
1118          String JavaDoc asgnOp = (String JavaDoc) ((Token)yyVals[-1+yyTop]).getValue();
1119          if (asgnOp.equals("||")) {
1120                  ((AssignableNode)yyVals[-2+yyTop]).setValueNode(((Node)yyVals[0+yyTop]));
1121                  yyVal = new OpAsgnOrNode(getPosition(((AssignableNode)yyVals[-2+yyTop])), support.gettable2(name, ((AssignableNode)yyVals[-2+yyTop]).getPosition()), ((AssignableNode)yyVals[-2+yyTop]));
1122          } else if (asgnOp.equals("&&")) {
1123                  ((AssignableNode)yyVals[-2+yyTop]).setValueNode(((Node)yyVals[0+yyTop]));
1124                      yyVal = new OpAsgnAndNode(getPosition(((AssignableNode)yyVals[-2+yyTop])), support.gettable2(name, ((AssignableNode)yyVals[-2+yyTop]).getPosition()), ((AssignableNode)yyVals[-2+yyTop]));
1125          } else {
1126                      ((AssignableNode)yyVals[-2+yyTop]).setValueNode(support.getOperatorCallNode(support.gettable2(name, ((AssignableNode)yyVals[-2+yyTop]).getPosition()), asgnOp, ((Node)yyVals[0+yyTop])));
1127              yyVal = ((AssignableNode)yyVals[-2+yyTop]);
1128          }
1129          }
1130  break;
1131case 26:
1132                    // line 395 "DefaultRubyParser.y"
1133
{
1134                  yyVal = new OpElementAsgnNode(getPosition(((Node)yyVals[-5+yyTop])), ((Node)yyVals[-5+yyTop]), (String JavaDoc) ((Token)yyVals[-1+yyTop]).getValue(), ((Node)yyVals[-3+yyTop]), ((Node)yyVals[0+yyTop]));
1135
1136              }
1137  break;
1138case 27:
1139                    // line 399 "DefaultRubyParser.y"
1140
{
1141                  yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String JavaDoc) ((Token)yyVals[-2+yyTop]).getValue(), (String JavaDoc) ((Token)yyVals[-1+yyTop]).getValue());
1142              }
1143  break;
1144case 28:
1145                    // line 402 "DefaultRubyParser.y"
1146
{
1147                  yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String JavaDoc) ((Token)yyVals[-2+yyTop]).getValue(), (String JavaDoc) ((Token)yyVals[-1+yyTop]).getValue());
1148              }
1149  break;
1150case 29:
1151                    // line 405 "DefaultRubyParser.y"
1152
{
1153                  yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String JavaDoc) ((Token)yyVals[-2+yyTop]).getValue(), (String JavaDoc) ((Token)yyVals[-1+yyTop]).getValue());
1154              }
1155  break;
1156case 30:
1157                    // line 408 "DefaultRubyParser.y"
1158
{
1159                  support.backrefAssignError(((Node)yyVals[-2+yyTop]));
1160              }
1161  break;
1162case 31:
1163                    // line 411 "DefaultRubyParser.y"
1164
{
1165                  yyVal = support.node_assign(((Node)yyVals[-2+yyTop]), new SValueNode(getPosition(((Node)yyVals[-2+yyTop])), ((Node)yyVals[0+yyTop])));
1166              }
1167  break;
1168case 32:
1169                    // line 414 "DefaultRubyParser.y"
1170
{
1171                  if (((MultipleAsgnNode)yyVals[-2+yyTop]).getHeadNode() != null) {
1172              ((MultipleAsgnNode)yyVals[-2+yyTop]).setValueNode(new ToAryNode(getPosition(((MultipleAsgnNode)yyVals[-2+yyTop])), ((Node)yyVals[0+yyTop])));
1173          } else {
1174              ((MultipleAsgnNode)yyVals[-2+yyTop]).setValueNode(new ArrayNode(getPosition(((MultipleAsgnNode)yyVals[-2+yyTop])), ((Node)yyVals[0+yyTop])));
1175          }
1176          yyVal = ((MultipleAsgnNode)yyVals[-2+yyTop]);
1177          }
1178  break;
1179case 33:
1180                    // line 422 "DefaultRubyParser.y"
1181
{
1182                  ((AssignableNode)yyVals[-2+yyTop]).setValueNode(((Node)yyVals[0+yyTop]));
1183          yyVal = ((MultipleAsgnNode)yyVals[-2+yyTop]);
1184                  ((MultipleAsgnNode)yyVals[-2+yyTop]).setPosition(support.union(((MultipleAsgnNode)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])));
1185          }
1186  break;
1187case 36:
1188                    // line 430 "DefaultRubyParser.y"
1189
{
1190                  yyVal = support.newAndNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
1191              }
1192  break;
1193case 37:
1194                    // line 433 "DefaultRubyParser.y"
1195
{
1196                  yyVal = support.newOrNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
1197              }
1198  break;
1199case 38:
1200                    // line 436 "DefaultRubyParser.y"
1201
{
1202                  yyVal = new NotNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), support.getConditionNode(((Node)yyVals[0+yyTop])));
1203              }
1204  break;
1205case 39:
1206                    // line 439 "DefaultRubyParser.y"
1207
{
1208                  yyVal = new NotNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), support.getConditionNode(((Node)yyVals[0+yyTop])));
1209              }
1210  break;
1211case 41:
1212                    // line 444 "DefaultRubyParser.y"
1213
{
1214                  support.checkExpression(((Node)yyVals[0+yyTop]));
1215          }
1216  break;
1217case 44:
1218                    // line 450 "DefaultRubyParser.y"
1219
{
1220                  yyVal = new ReturnNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), support.ret_args(((Node)yyVals[0+yyTop]), getPosition(((Token)yyVals[-1+yyTop]))));
1221              }
1222  break;
1223case 45:
1224                    // line 453 "DefaultRubyParser.y"
1225
{
1226                  yyVal = new BreakNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), support.ret_args(((Node)yyVals[0+yyTop]), getPosition(((Token)yyVals[-1+yyTop]))));
1227              }
1228  break;
1229case 46:
1230                    // line 456 "DefaultRubyParser.y"
1231
{
1232                  yyVal = new NextNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), support.ret_args(((Node)yyVals[0+yyTop]), getPosition(((Token)yyVals[-1+yyTop]))));
1233              }
1234  break;
1235case 48:
1236                    // line 461 "DefaultRubyParser.y"
1237
{
1238                  yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
1239              }
1240  break;
1241case 49:
1242                    // line 464 "DefaultRubyParser.y"
1243
{
1244                  yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
1245              }
1246  break;
1247case 50:
1248                    // line 468 "DefaultRubyParser.y"
1249
{
1250                    support.pushBlockScope();
1251        }
1252  break;
1253case 51:
1254                    // line 470 "DefaultRubyParser.y"
1255
{
1256                    yyVal = new IterNode(getPosition(((Token)yyVals[-4+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]));
1257                    support.popCurrentScope();
1258        }
1259  break;
1260case 52:
1261                    // line 475 "DefaultRubyParser.y"
1262
{
1263                  yyVal = support.new_fcall(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
1264              }
1265  break;
1266case 53:
1267                    // line 478 "DefaultRubyParser.y"
1268
{
1269                  yyVal = support.new_fcall(((Token)yyVals[-2+yyTop]), ((Node)yyVals[-1+yyTop]), ((IterNode)yyVals[0+yyTop]));
1270              }
1271  break;
1272case 54:
1273                    // line 481 "DefaultRubyParser.y"
1274
{
1275                  yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
1276              }
1277  break;
1278case 55:
1279                    // line 484 "DefaultRubyParser.y"
1280
{
1281                  yyVal = support.new_call(((Node)yyVals[-4+yyTop]), ((Token)yyVals[-2+yyTop]), ((Node)yyVals[-1+yyTop]), ((IterNode)yyVals[0+yyTop]));
1282          }
1283  break;
1284case 56:
1285                    // line 487 "DefaultRubyParser.y"
1286
{
1287                  yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
1288              }
1289  break;
1290case 57:
1291                    // line 490 "DefaultRubyParser.y"
1292
{
1293                  yyVal = support.new_call(((Node)yyVals[-4+yyTop]), ((Token)yyVals[-2+yyTop]), ((Node)yyVals[-1+yyTop]), ((IterNode)yyVals[0+yyTop]));
1294          }
1295  break;
1296case 58:
1297                    // line 493 "DefaultRubyParser.y"
1298
{
1299          yyVal = support.new_super(((Node)yyVals[0+yyTop]), ((Token)yyVals[-1+yyTop])); /* .setPosFrom($2);*/
1300          }
1301  break;
1302case 59:
1303                    // line 496 "DefaultRubyParser.y"
1304
{
1305                  yyVal = support.new_yield(getPosition(((Token)yyVals[-1+yyTop])), ((Node)yyVals[0+yyTop]));
1306          }
1307  break;
1308case 61:
1309                    // line 501 "DefaultRubyParser.y"
1310
{
1311                  yyVal = ((MultipleAsgnNode)yyVals[-1+yyTop]);
1312          }
1313  break;
1314case 63:
1315                    // line 506 "DefaultRubyParser.y"
1316
{
1317                  yyVal = new MultipleAsgnNode(getPosition(((Token)yyVals[-2+yyTop])), new ArrayNode(getPosition(((Token)yyVals[-2+yyTop])), ((MultipleAsgnNode)yyVals[-1+yyTop])), null);
1318              }
1319  break;
1320case 64:
1321                    // line 510 "DefaultRubyParser.y"
1322
{
1323                  yyVal = new MultipleAsgnNode(getPosition(((ListNode)yyVals[0+yyTop])), ((ListNode)yyVals[0+yyTop]), null);
1324              }
1325  break;
1326case 65:
1327                    // line 513 "DefaultRubyParser.y"
1328
{
1329/*mirko: check*/
1330                  yyVal = new MultipleAsgnNode(support.union(((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), ((ListNode)yyVals[-1+yyTop]).add(((Node)yyVals[0+yyTop])), null);
1331                  ((Node)yyVals[-1+yyTop]).setPosition(support.union(((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])));
1332              }
1333  break;
1334case 66:
1335                    // line 518 "DefaultRubyParser.y"
1336
{
1337                  yyVal = new MultipleAsgnNode(getPosition(((ListNode)yyVals[-2+yyTop])), ((ListNode)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
1338              }
1339  break;
1340case 67:
1341                    // line 521 "DefaultRubyParser.y"
1342
{
1343                  yyVal = new MultipleAsgnNode(getPosition(((ListNode)yyVals[-1+yyTop])), ((ListNode)yyVals[-1+yyTop]), new StarNode(getPosition(null)));
1344              }
1345  break;
1346case 68:
1347                    // line 524 "DefaultRubyParser.y"
1348
{
1349                  yyVal = new MultipleAsgnNode(getPosition(((Token)yyVals[-1+yyTop])), null, ((Node)yyVals[0+yyTop]));
1350              }
1351  break;
1352case 69:
1353                    // line 527 "DefaultRubyParser.y"
1354
{
1355                  yyVal = new MultipleAsgnNode(getPosition(((Token)yyVals[0+yyTop])), null, new StarNode(getPosition(null)));
1356              }
1357  break;
1358case 71:
1359                    // line 532 "DefaultRubyParser.y"
1360
{
1361                  yyVal = ((MultipleAsgnNode)yyVals[-1+yyTop]);
1362              }
1363  break;
1364case 72:
1365                    // line 536 "DefaultRubyParser.y"
1366
{
1367                  yyVal = new ArrayNode(((Node)yyVals[-1+yyTop]).getPosition(), ((Node)yyVals[-1+yyTop]));
1368              }
1369  break;
1370case 73:
1371                    // line 539 "DefaultRubyParser.y"
1372
{
1373                  yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[-1+yyTop]));
1374              }
1375  break;
1376case 74:
1377                    // line 543 "DefaultRubyParser.y"
1378
{
1379                  yyVal = support.assignable(((Token)yyVals[0+yyTop]), null);
1380              }
1381  break;
1382case 75:
1383                    // line 546 "DefaultRubyParser.y"
1384
{
1385                  yyVal = support.aryset(((Node)yyVals[-3+yyTop]), ((Node)yyVals[-1+yyTop]));
1386              }
1387  break;
1388case 76:
1389                    // line 549 "DefaultRubyParser.y"
1390
{
1391                  yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
1392              }
1393  break;
1394case 77:
1395                    // line 552 "DefaultRubyParser.y"
1396
{
1397                  yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
1398              }
1399  break;
1400case 78:
1401                    // line 555 "DefaultRubyParser.y"
1402
{
1403                  yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
1404              }
1405  break;
1406case 79:
1407                    // line 558 "DefaultRubyParser.y"
1408
{
1409                  if (support.isInDef() || support.isInSingle()) {
1410              yyerror("dynamic constant assignment");
1411          }
1412
1413          ISourcePosition position = support.union(((Node)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]));
1414
1415                  yyVal = new ConstDeclNode(position, null, new Colon2Node(position, ((Node)yyVals[-2+yyTop]), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue()), null);
1416          }
1417  break;
1418case 80:
1419                    // line 567 "DefaultRubyParser.y"
1420
{
1421                  if (support.isInDef() || support.isInSingle()) {
1422              yyerror("dynamic constant assignment");
1423          }
1424
1425                  ISourcePosition position = support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop]));
1426
1427                  yyVal = new ConstDeclNode(position, null, new Colon3Node(position, (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue()), null);
1428          }
1429  break;
1430case 81:
1431                    // line 576 "DefaultRubyParser.y"
1432
{
1433              support.backrefAssignError(((Node)yyVals[0+yyTop]));
1434              }
1435  break;
1436case 82:
1437                    // line 580 "DefaultRubyParser.y"
1438
{
1439                  yyVal = support.assignable(((Token)yyVals[0+yyTop]), null);
1440              }
1441  break;
1442case 83:
1443                    // line 583 "DefaultRubyParser.y"
1444
{
1445                  yyVal = support.aryset(((Node)yyVals[-3+yyTop]), ((Node)yyVals[-1+yyTop]));
1446              }
1447  break;
1448case 84:
1449                    // line 586 "DefaultRubyParser.y"
1450
{
1451                  yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
1452              }
1453  break;
1454case 85:
1455                    // line 589 "DefaultRubyParser.y"
1456
{
1457                  yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
1458          }
1459  break;
1460case 86:
1461                    // line 592 "DefaultRubyParser.y"
1462
{
1463                  yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
1464              }
1465  break;
1466case 87:
1467                    // line 595 "DefaultRubyParser.y"
1468
{
1469                  if (support.isInDef() || support.isInSingle()) {
1470              yyerror("dynamic constant assignment");
1471          }
1472            
1473          ISourcePosition position = support.union(((Node)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]));
1474
1475                  yyVal = new ConstDeclNode(position, null, new Colon2Node(position, ((Node)yyVals[-2+yyTop]), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue()), null);
1476              }
1477  break;
1478case 88:
1479                    // line 604 "DefaultRubyParser.y"
1480
{
1481                  if (support.isInDef() || support.isInSingle()) {
1482              yyerror("dynamic constant assignment");
1483          }
1484
1485                  ISourcePosition position = support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop]));
1486
1487                  yyVal = new ConstDeclNode(position, null, new Colon3Node(position, (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue()), null);
1488          }
1489  break;
1490case 89:
1491                    // line 613 "DefaultRubyParser.y"
1492
{
1493                   support.backrefAssignError(((Node)yyVals[0+yyTop]));
1494          }
1495  break;
1496case 90:
1497                    // line 617 "DefaultRubyParser.y"
1498
{
1499                  yyerror("class/module name must be CONSTANT");
1500              }
1501  break;
1502case 92:
1503                    // line 622 "DefaultRubyParser.y"
1504
{
1505                  yyVal = new Colon3Node(support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop])), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
1506          }
1507  break;
1508case 93:
1509                    // line 625 "DefaultRubyParser.y"
1510
{
1511                  yyVal = new Colon2Node(((Token)yyVals[0+yyTop]).getPosition(), null, (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
1512          }
1513  break;
1514case 94:
1515                    // line 628 "DefaultRubyParser.y"
1516
{
1517                  yyVal = new Colon2Node(support.union(((Node)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
1518          }
1519  break;
1520case 98:
1521                    // line 634 "DefaultRubyParser.y"
1522
{
1523                  lexer.setState(LexState.EXPR_END);
1524                  yyVal = ((Token)yyVals[0+yyTop]);
1525              }
1526  break;
1527case 99:
1528                    // line 639 "DefaultRubyParser.y"
1529
{
1530                  lexer.setState(LexState.EXPR_END);
1531                  yyVal = yyVals[0+yyTop];
1532              }
1533  break;
1534case 102:
1535                    // line 646 "DefaultRubyParser.y"
1536
{
1537                  yyVal = new UndefNode(getPosition(((Token)yyVals[0+yyTop])), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
1538              }
1539  break;
1540case 103:
1541                    // line 649 "DefaultRubyParser.y"
1542
{
1543                  lexer.setState(LexState.EXPR_FNAME);
1544          }
1545  break;
1546case 104:
1547                    // line 651 "DefaultRubyParser.y"
1548
{
1549                  yyVal = support.appendToBlock(((Node)yyVals[-3+yyTop]), new UndefNode(getPosition(((Node)yyVals[-3+yyTop])), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue()));
1550              }
1551  break;
1552case 172:
1553                    // line 670 "DefaultRubyParser.y"
1554
{
1555                  yyVal = support.node_assign(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
1556          /* FIXME: Consider fixing node_assign itself rather than single case*/
1557          ((Node)yyVal).setPosition(support.union(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])));
1558              }
1559  break;
1560case 173:
1561                    // line 675 "DefaultRubyParser.y"
1562
{
1563                  ISourcePosition position = support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
1564                  yyVal = support.node_assign(((Node)yyVals[-4+yyTop]), new RescueNode(position, ((Node)yyVals[-2+yyTop]), new RescueBodyNode(position, null, ((Node)yyVals[0+yyTop]), null), null));
1565          }
1566  break;
1567case 174:
1568                    // line 679 "DefaultRubyParser.y"
1569
{
1570          support.checkExpression(((Node)yyVals[0+yyTop]));
1571              String JavaDoc name = ((INameNode)yyVals[-2+yyTop]).getName();
1572          String JavaDoc asgnOp = (String JavaDoc) ((Token)yyVals[-1+yyTop]).getValue();
1573
1574          if (asgnOp.equals("||")) {
1575                  ((AssignableNode)yyVals[-2+yyTop]).setValueNode(((Node)yyVals[0+yyTop]));
1576                  yyVal = new OpAsgnOrNode(getPosition(((AssignableNode)yyVals[-2+yyTop])), support.gettable2(name, ((AssignableNode)yyVals[-2+yyTop]).getPosition()), ((AssignableNode)yyVals[-2+yyTop]));
1577          } else if (asgnOp.equals("&&")) {
1578                  ((AssignableNode)yyVals[-2+yyTop]).setValueNode(((Node)yyVals[0+yyTop]));
1579                      yyVal = new OpAsgnAndNode(getPosition(((AssignableNode)yyVals[-2+yyTop])), support.gettable2(name, ((AssignableNode)yyVals[-2+yyTop]).getPosition()), ((AssignableNode)yyVals[-2+yyTop]));
1580          } else {
1581              ((AssignableNode)yyVals[-2+yyTop]).setValueNode(support.getOperatorCallNode(support.gettable2(name, ((AssignableNode)yyVals[-2+yyTop]).getPosition()), asgnOp, ((Node)yyVals[0+yyTop])));
1582                      ((AssignableNode)yyVals[-2+yyTop]).setPosition(support.union(((AssignableNode)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])));
1583              yyVal = ((AssignableNode)yyVals[-2+yyTop]);
1584          }
1585              }
1586  break;
1587case 175:
1588                    // line 696 "DefaultRubyParser.y"
1589
{
1590                  yyVal = new OpElementAsgnNode(getPosition(((Node)yyVals[-5+yyTop])), ((Node)yyVals[-5+yyTop]), (String JavaDoc) ((Token)yyVals[-1+yyTop]).getValue(), ((Node)yyVals[-3+yyTop]), ((Node)yyVals[0+yyTop]));
1591              }
1592  break;
1593case 176:
1594                    // line 699 "DefaultRubyParser.y"
1595
{
1596                  yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String JavaDoc) ((Token)yyVals[-2+yyTop]).getValue(), (String JavaDoc) ((Token)yyVals[-1+yyTop]).getValue());
1597              }
1598  break;
1599case 177:
1600                    // line 702 "DefaultRubyParser.y"
1601
{
1602                  yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String JavaDoc) ((Token)yyVals[-2+yyTop]).getValue(), (String JavaDoc) ((Token)yyVals[-1+yyTop]).getValue());
1603              }
1604  break;
1605case 178:
1606                    // line 705 "DefaultRubyParser.y"
1607
{
1608                  yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String JavaDoc) ((Token)yyVals[-2+yyTop]).getValue(), (String JavaDoc) ((Token)yyVals[-1+yyTop]).getValue());
1609              }
1610  break;
1611case 179:
1612                    // line 708 "DefaultRubyParser.y"
1613
{
1614              yyerror("constant re-assignment");
1615          }
1616  break;
1617case 180:
1618                    // line 711 "DefaultRubyParser.y"
1619
{
1620          yyerror("constant re-assignment");
1621          }
1622  break;
1623case 181:
1624                    // line 714 "DefaultRubyParser.y"
1625
{
1626                  support.backrefAssignError(((Node)yyVals[-2+yyTop]));
1627              }
1628  break;
1629case 182:
1630                    // line 717 "DefaultRubyParser.y"
1631
{
1632          support.checkExpression(((Node)yyVals[-2+yyTop]));
1633          support.checkExpression(((Node)yyVals[0+yyTop]));
1634                  yyVal = new DotNode(support.union(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]), false);
1635              }
1636  break;
1637case 183:
1638                    // line 722 "DefaultRubyParser.y"
1639
{
1640          support.checkExpression(((Node)yyVals[-2+yyTop]));
1641          support.checkExpression(((Node)yyVals[0+yyTop]));
1642                  yyVal = new DotNode(support.union(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]), true);
1643              }
1644  break;
1645case 184:
1646                    // line 727 "DefaultRubyParser.y"
1647
{
1648                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "+", ((Node)yyVals[0+yyTop]));
1649              }
1650  break;
1651case 185:
1652                    // line 730 "DefaultRubyParser.y"
1653
{
1654                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "-", ((Node)yyVals[0+yyTop]));
1655              }
1656  break;
1657case 186:
1658                    // line 733 "DefaultRubyParser.y"
1659
{
1660                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "*", ((Node)yyVals[0+yyTop]));
1661              }
1662  break;
1663case 187:
1664                    // line 736 "DefaultRubyParser.y"
1665
{
1666                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "/", ((Node)yyVals[0+yyTop]));
1667              }
1668  break;
1669case 188:
1670                    // line 739 "DefaultRubyParser.y"
1671
{
1672                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "%", ((Node)yyVals[0+yyTop]));
1673              }
1674  break;
1675case 189:
1676                    // line 742 "DefaultRubyParser.y"
1677
{
1678          yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "**", ((Node)yyVals[0+yyTop]));
1679              }
1680  break;
1681case 190:
1682                    // line 745 "DefaultRubyParser.y"
1683
{
1684                  yyVal = support.getOperatorCallNode(support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "**", ((Node)yyVals[0+yyTop])), "-@");
1685              }
1686  break;
1687case 191:
1688                    // line 748 "DefaultRubyParser.y"
1689
{
1690                  yyVal = support.getOperatorCallNode(support.getOperatorCallNode(((FloatNode)yyVals[-2+yyTop]), "**", ((Node)yyVals[0+yyTop])), "-@");
1691              }
1692  break;
1693case 192:
1694                    // line 751 "DefaultRubyParser.y"
1695
{
1696              if (((Node)yyVals[0+yyTop]) != null && ((Node)yyVals[0+yyTop]) instanceof ILiteralNode) {
1697              yyVal = ((Node)yyVals[0+yyTop]);
1698          } else {
1699                      yyVal = support.getOperatorCallNode(((Node)yyVals[0+yyTop]), "+@");
1700          }
1701              }
1702  break;
1703case 193:
1704                    // line 758 "DefaultRubyParser.y"
1705
{
1706                  yyVal = support.getOperatorCallNode(((Node)yyVals[0+yyTop]), "-@");
1707          }
1708  break;
1709case 194:
1710                    // line 761 "DefaultRubyParser.y"
1711
{
1712                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "|", ((Node)yyVals[0+yyTop]));
1713              }
1714  break;
1715case 195:
1716                    // line 764 "DefaultRubyParser.y"
1717
{
1718                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "^", ((Node)yyVals[0+yyTop]));
1719              }
1720  break;
1721case 196:
1722                    // line 767 "DefaultRubyParser.y"
1723
{
1724                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "&", ((Node)yyVals[0+yyTop]));
1725              }
1726  break;
1727case 197:
1728                    // line 770 "DefaultRubyParser.y"
1729
{
1730                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "<=>", ((Node)yyVals[0+yyTop]));
1731              }
1732  break;
1733case 198:
1734                    // line 773 "DefaultRubyParser.y"
1735
{
1736                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), ">", ((Node)yyVals[0+yyTop]));
1737              }
1738  break;
1739case 199:
1740                    // line 776 "DefaultRubyParser.y"
1741
{
1742                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), ">=", ((Node)yyVals[0+yyTop]));
1743              }
1744  break;
1745case 200:
1746                    // line 779 "DefaultRubyParser.y"
1747
{
1748                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "<", ((Node)yyVals[0+yyTop]));
1749              }
1750  break;
1751case 201:
1752                    // line 782 "DefaultRubyParser.y"
1753
{
1754                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "<=", ((Node)yyVals[0+yyTop]));
1755              }
1756  break;
1757case 202:
1758                    // line 785 "DefaultRubyParser.y"
1759
{
1760                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "==", ((Node)yyVals[0+yyTop]));
1761              }
1762  break;
1763case 203:
1764                    // line 788 "DefaultRubyParser.y"
1765
{
1766                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "===", ((Node)yyVals[0+yyTop]));
1767              }
1768  break;
1769case 204:
1770                    // line 791 "DefaultRubyParser.y"
1771
{
1772                  yyVal = new NotNode(support.union(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "==", ((Node)yyVals[0+yyTop])));
1773              }
1774  break;
1775case 205:
1776                    // line 794 "DefaultRubyParser.y"
1777
{
1778                  yyVal = support.getMatchNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
1779              }
1780  break;
1781case 206:
1782                    // line 797 "DefaultRubyParser.y"
1783
{
1784                  yyVal = new NotNode(support.union(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), support.getMatchNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])));
1785              }
1786  break;
1787case 207:
1788                    // line 800 "DefaultRubyParser.y"
1789
{
1790                  yyVal = new NotNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), support.getConditionNode(((Node)yyVals[0+yyTop])));
1791              }
1792  break;
1793case 208:
1794                    // line 803 "DefaultRubyParser.y"
1795
{
1796                  yyVal = support.getOperatorCallNode(((Node)yyVals[0+yyTop]), "~");
1797              }
1798  break;
1799case 209:
1800                    // line 806 "DefaultRubyParser.y"
1801
{
1802                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "<<", ((Node)yyVals[0+yyTop]));
1803              }
1804  break;
1805case 210:
1806                    // line 809 "DefaultRubyParser.y"
1807
{
1808                  yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), ">>", ((Node)yyVals[0+yyTop]));
1809              }
1810  break;
1811case 211:
1812                    // line 812 "DefaultRubyParser.y"
1813
{
1814                  yyVal = support.newAndNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
1815              }
1816  break;
1817case 212:
1818                    // line 815 "DefaultRubyParser.y"
1819
{
1820                  yyVal = support.newOrNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
1821              }
1822  break;
1823case 213:
1824                    // line 818 "DefaultRubyParser.y"
1825
{
1826                  yyVal = new DefinedNode(getPosition(((Token)yyVals[-2+yyTop])), ((Node)yyVals[0+yyTop]));
1827              }
1828  break;
1829case 214:
1830                    // line 821 "DefaultRubyParser.y"
1831
{
1832                  yyVal = new IfNode(getPosition(((Node)yyVals[-4+yyTop])), support.getConditionNode(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
1833              }
1834  break;
1835case 215:
1836                    // line 824 "DefaultRubyParser.y"
1837
{
1838                  yyVal = ((Node)yyVals[0+yyTop]);
1839              }
1840  break;
1841case 216:
1842                    // line 828 "DefaultRubyParser.y"
1843
{
1844              support.checkExpression(((Node)yyVals[0+yyTop]));
1845              yyVal = ((Node)yyVals[0+yyTop]);
1846          }
1847  break;
1848case 218:
1849                    // line 834 "DefaultRubyParser.y"
1850
{
1851                  warnings.warn(getPosition(((Node)yyVals[-1+yyTop])), "parenthesize argument(s) for future version");
1852                  yyVal = new ArrayNode(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]));
1853              }
1854  break;
1855case 219:
1856                    // line 838 "DefaultRubyParser.y"
1857
{
1858                  yyVal = ((ListNode)yyVals[-1+yyTop]);
1859              }
1860  break;
1861case 220:
1862                    // line 841 "DefaultRubyParser.y"
1863
{
1864                  support.checkExpression(((Node)yyVals[-1+yyTop]));
1865                  yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-4+yyTop])), ((ListNode)yyVals[-4+yyTop]), ((Node)yyVals[-1+yyTop]));
1866              }
1867  break;
1868case 221:
1869                    // line 845 "DefaultRubyParser.y"
1870
{
1871                  yyVal = new ArrayNode(getPosition(((ListNode)yyVals[-1+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
1872              }
1873  break;
1874case 222:
1875                    // line 848 "DefaultRubyParser.y"
1876
{
1877                  support.checkExpression(((Node)yyVals[-1+yyTop]));
1878          yyVal = new NewlineNode(getPosition(((Token)yyVals[-2+yyTop])), new SplatNode(getPosition(((Token)yyVals[-2+yyTop])), ((Node)yyVals[-1+yyTop])));
1879              }
1880  break;
1881case 223:
1882                    // line 853 "DefaultRubyParser.y"
1883
{
1884                  yyVal = new ArrayNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
1885              }
1886  break;
1887case 224:
1888                    // line 856 "DefaultRubyParser.y"
1889
{
1890                  yyVal = ((Node)yyVals[-2+yyTop]);
1891          ((Node)yyVal).setPosition(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])));
1892              }
1893  break;
1894case 225:
1895                    // line 860 "DefaultRubyParser.y"
1896
{
1897                  warnings.warn(getPosition(((Token)yyVals[-3+yyTop])), "parenthesize argument(s) for future version");
1898                  yyVal = new ArrayNode(getPosition(((Token)yyVals[-3+yyTop])), ((Node)yyVals[-2+yyTop]));
1899              }
1900  break;
1901case 226:
1902                    // line 864 "DefaultRubyParser.y"
1903
{
1904                  warnings.warn(getPosition(((Token)yyVals[-5+yyTop])), "parenthesize argument(s) for future version");
1905                  yyVal = ((ListNode)yyVals[-4+yyTop]).add(((Node)yyVals[-2+yyTop]));
1906              }
1907  break;
1908case 229:
1909                    // line 872 "DefaultRubyParser.y"
1910
{
1911                  warnings.warn(getPosition(((Node)yyVals[0+yyTop])), "parenthesize argument(s) for future version");
1912                  yyVal = new ArrayNode(getPosition(((Node)yyVals[0+yyTop])), ((Node)yyVals[0+yyTop]));
1913              }
1914  break;
1915case 230:
1916                    // line 876 "DefaultRubyParser.y"
1917
{
1918                  yyVal = support.arg_blk_pass(((ListNode)yyVals[-1+yyTop]), ((BlockPassNode)yyVals[0+yyTop]));
1919              }
1920  break;
1921case 231:
1922                    // line 879 "DefaultRubyParser.y"
1923
{
1924                  yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-4+yyTop])), ((ListNode)yyVals[-4+yyTop]), ((Node)yyVals[-1+yyTop]));
1925                  yyVal = support.arg_blk_pass(((Node)yyVal), ((BlockPassNode)yyVals[0+yyTop]));
1926              }
1927  break;
1928case 232:
1929                    // line 883 "DefaultRubyParser.y"
1930
{
1931                  yyVal = new ArrayNode(getPosition(((ListNode)yyVals[-1+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
1932                  yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
1933              }
1934  break;
1935case 233:
1936                    // line 887 "DefaultRubyParser.y"
1937
{
1938                  yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-4+yyTop])), new ArrayNode(getPosition(((ListNode)yyVals[-4+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
1939                  yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
1940              }
1941  break;
1942case 234:
1943                    // line 891 "DefaultRubyParser.y"
1944
{
1945                  yyVal = ((ListNode)yyVals[-3+yyTop]).add(new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
1946                  yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
1947              }
1948  break;
1949case 235:
1950                    // line 895 "DefaultRubyParser.y"
1951
{
1952                  support.checkExpression(((Node)yyVals[-1+yyTop]));
1953          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]));
1954                  yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
1955              }
1956  break;
1957case 236:
1958                    // line 900 "DefaultRubyParser.y"
1959
{
1960                  yyVal = support.arg_blk_pass(new SplatNode(getPosition(((Token)yyVals[-2+yyTop])), ((Node)yyVals[-1+yyTop])), ((BlockPassNode)yyVals[0+yyTop]));
1961              }
1962  break;
1963case 237:
1964                    // line 903 "DefaultRubyParser.y"
1965
{}
1966  break;
1967case 238:
1968                    // line 905 "DefaultRubyParser.y"
1969
{
1970                  yyVal = support.arg_blk_pass(new ArrayNode(getPosition(((Node)yyVals[-3+yyTop])), ((Node)yyVals[-3+yyTop])).addAll(((ListNode)yyVals[-1+yyTop])), ((BlockPassNode)yyVals[0+yyTop]));
1971          }
1972  break;
1973case 239:
1974                    // line 908 "DefaultRubyParser.y"
1975
{
1976                  yyVal = support.arg_blk_pass(new ArrayNode(getPosition(((Node)yyVals[-2+yyTop])), ((Node)yyVals[-2+yyTop])), ((BlockPassNode)yyVals[0+yyTop]));
1977              }
1978  break;
1979case 240:
1980                    // line 911 "DefaultRubyParser.y"
1981
{
1982                  yyVal = support.arg_concat(getPosition(((Node)yyVals[-4+yyTop])), new ArrayNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop])), ((Node)yyVals[-1+yyTop]));
1983                  yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
1984          }
1985  break;
1986case 241:
1987                    // line 915 "DefaultRubyParser.y"
1988
{
1989                  yyVal = support.arg_concat(getPosition(((Node)yyVals[-6+yyTop])), new ArrayNode(getPosition(((Node)yyVals[-6+yyTop])), ((Node)yyVals[-6+yyTop])).addAll(new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
1990                  yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
1991          }
1992  break;
1993case 242:
1994                    // line 919 "DefaultRubyParser.y"
1995
{
1996                  yyVal = new ArrayNode(getPosition(((ListNode)yyVals[-1+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
1997                  yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
1998          }
1999  break;
2000case 243:
2001                    // line 923 "DefaultRubyParser.y"
2002
{
2003                  yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-4+yyTop])), new ArrayNode(getPosition(((ListNode)yyVals[-4+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
2004                  yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
2005          }
2006  break;
2007case 244:
2008                    // line 927 "DefaultRubyParser.y"
2009
{
2010                  yyVal = new ArrayNode(getPosition(((Node)yyVals[-3+yyTop])), ((Node)yyVals[-3+yyTop])).add(new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
2011                  yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
2012          }
2013  break;
2014case 245:
2015                    // line 931 "DefaultRubyParser.y"
2016
{
2017                  yyVal = new ArrayNode(getPosition(((Node)yyVals[-5+yyTop])), ((Node)yyVals[-5+yyTop])).addAll(((ListNode)yyVals[-3+yyTop])).add(new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
2018                  yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
2019          }
2020  break;
2021case 246:
2022                    // line 935 "DefaultRubyParser.y"
2023
{
2024                  yyVal = support.arg_concat(getPosition(((Node)yyVals[-6+yyTop])), new ArrayNode(getPosition(((Node)yyVals[-6+yyTop])), ((Node)yyVals[-6+yyTop])).add(new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
2025                  yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
2026          }
2027  break;
2028case 247:
2029                    // line 939 "DefaultRubyParser.y"
2030
{
2031                  yyVal = support.arg_concat(getPosition(((Node)yyVals[-8+yyTop])), new ArrayNode(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]));
2032                  yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
2033          }
2034  break;
2035case 248:
2036                    // line 943 "DefaultRubyParser.y"
2037
{
2038                  yyVal = support.arg_blk_pass(new SplatNode(getPosition(((Token)yyVals[-2+yyTop])), ((Node)yyVals[-1+yyTop])), ((BlockPassNode)yyVals[0+yyTop]));
2039          }
2040  break;
2041case 249:
2042                    // line 946 "DefaultRubyParser.y"
2043
{}
2044  break;
2045case 250:
2046                    // line 948 "DefaultRubyParser.y"
2047
{
2048              yyVal = new Long JavaDoc(lexer.getCmdArgumentState().begin());
2049          }
2050  break;
2051case 251:
2052                    // line 950 "DefaultRubyParser.y"
2053
{
2054                  lexer.getCmdArgumentState().reset(((Long JavaDoc)yyVals[-1+yyTop]).longValue());
2055                  yyVal = ((Node)yyVals[0+yyTop]);
2056              }
2057  break;
2058case 253:
2059                    // line 956 "DefaultRubyParser.y"
2060
{
2061          lexer.setState(LexState.EXPR_ENDARG);
2062          }
2063  break;
2064case 254:
2065                    // line 958 "DefaultRubyParser.y"
2066
{
2067                  warnings.warn(getPosition(((Token)yyVals[-2+yyTop])), "don't put space before argument parentheses");
2068              yyVal = null;
2069          }
2070  break;
2071case 255:
2072                    // line 962 "DefaultRubyParser.y"
2073
{
2074          lexer.setState(LexState.EXPR_ENDARG);
2075          }
2076  break;
2077case 256:
2078                    // line 964 "DefaultRubyParser.y"
2079
{
2080                  warnings.warn(getPosition(((Token)yyVals[-3+yyTop])), "don't put space before argument parentheses");
2081          yyVal = ((Node)yyVals[-2+yyTop]);
2082          }
2083  break;
2084case 257:
2085                    // line 969 "DefaultRubyParser.y"
2086
{
2087                  support.checkExpression(((Node)yyVals[0+yyTop]));
2088                  yyVal = new BlockPassNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), ((Node)yyVals[0+yyTop]));
2089              }
2090  break;
2091case 258:
2092                    // line 974 "DefaultRubyParser.y"
2093
{
2094                  yyVal = ((BlockPassNode)yyVals[0+yyTop]);
2095              }
2096  break;
2097case 260:
2098                    // line 979 "DefaultRubyParser.y"
2099
{
2100                  yyVal = new ArrayNode(getPosition2(((Node)yyVals[0+yyTop])), ((Node)yyVals[0+yyTop]));
2101              }
2102  break;
2103case 261:
2104                    // line 982 "DefaultRubyParser.y"
2105
{
2106                  yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[0+yyTop]));
2107              }
2108  break;
2109case 262:
2110                    // line 986 "DefaultRubyParser.y"
2111
{
2112          yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[0+yyTop]));
2113              }
2114  break;
2115case 263:
2116                    // line 989 "DefaultRubyParser.y"
2117
{
2118                  yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-3+yyTop])), ((ListNode)yyVals[-3+yyTop]), ((Node)yyVals[0+yyTop]));
2119          }
2120  break;
2121case 264:
2122                    // line 992 "DefaultRubyParser.y"
2123
{
2124                  yyVal = new SplatNode(getPosition(((Token)yyVals[-1+yyTop])), ((Node)yyVals[0+yyTop]));
2125          }
2126  break;
2127case 273:
2128                    // line 1004 "DefaultRubyParser.y"
2129
{
2130                  yyVal = new FCallNode(((Token)yyVals[0+yyTop]).getPosition(), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue(), null);
2131          }
2132  break;
2133case 274:
2134                    // line 1007 "DefaultRubyParser.y"
2135
{
2136                  yyVal = new BeginNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-1+yyTop]));
2137          }
2138  break;
2139case 275:
2140                    // line 1010 "DefaultRubyParser.y"
2141
{
2142                  lexer.setState(LexState.EXPR_ENDARG);
2143              }
2144  break;
2145case 276:
2146                    // line 1012 "DefaultRubyParser.y"
2147
{
2148          warnings.warning(getPosition(((Token)yyVals[-4+yyTop])), "(...) interpreted as grouped expression");
2149                  yyVal = ((Node)yyVals[-3+yyTop]);
2150          }
2151  break;
2152case 277:
2153                    // line 1016 "DefaultRubyParser.y"
2154
{
2155          yyVal = ((Node)yyVals[-1+yyTop]);
2156              }
2157  break;
2158case 278:
2159                    // line 1019 "DefaultRubyParser.y"
2160
{
2161                  yyVal = new Colon2Node(support.union(((Node)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
2162              }
2163  break;
2164case 279:
2165                    // line 1022 "DefaultRubyParser.y"
2166
{
2167                  yyVal = new Colon3Node(support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop])), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
2168              }
2169  break;
2170case 280:
2171                    // line 1025 "DefaultRubyParser.y"
2172
{
2173                  if (((Node)yyVals[-3+yyTop]) instanceof SelfNode) {
2174                      yyVal = new FCallNode(getPosition(((Node)yyVals[-3+yyTop])), "[]", ((Node)yyVals[-1+yyTop]));
2175                  } else {
2176                      yyVal = new CallNode(getPosition(((Node)yyVals[-3+yyTop])), ((Node)yyVals[-3+yyTop]), "[]", ((Node)yyVals[-1+yyTop]));
2177                  }
2178              }
2179  break;
2180case 281:
2181                    // line 1032 "DefaultRubyParser.y"
2182
{
2183                  ISourcePosition position = support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]));
2184                  if (((Node)yyVals[-1+yyTop]) == null) {
2185                      yyVal = new ZArrayNode(position); /* zero length array */
2186                  } else {
2187                      yyVal = ((Node)yyVals[-1+yyTop]);
2188                      ((ISourcePositionHolder)yyVal).setPosition(position);
2189                  }
2190              }
2191  break;
2192case 282:
2193                    // line 1041 "DefaultRubyParser.y"
2194
{
2195                  yyVal = new HashNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((ListNode)yyVals[-1+yyTop]));
2196              }
2197  break;
2198case 283:
2199                    // line 1044 "DefaultRubyParser.y"
2200
{
2201          yyVal = new ReturnNode(((Token)yyVals[0+yyTop]).getPosition(), null);
2202              }
2203  break;
2204case 284:
2205                    // line 1047 "DefaultRubyParser.y"
2206
{
2207                  yyVal = support.new_yield(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-1+yyTop]));
2208              }
2209  break;
2210case 285:
2211                    // line 1050 "DefaultRubyParser.y"
2212
{
2213                  yyVal = new YieldNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), null, false);
2214              }
2215  break;
2216case 286:
2217                    // line 1053 "DefaultRubyParser.y"
2218
{
2219                  yyVal = new YieldNode(((Token)yyVals[0+yyTop]).getPosition(), null, false);
2220              }
2221  break;
2222case 287:
2223                    // line 1056 "DefaultRubyParser.y"
2224
{
2225                  yyVal = new DefinedNode(getPosition(((Token)yyVals[-4+yyTop])), ((Node)yyVals[-1+yyTop]));
2226              }
2227  break;
2228case 288:
2229                    // line 1059 "DefaultRubyParser.y"
2230
{
2231                  yyVal = new FCallNode(support.union(((Token)yyVals[-1+yyTop]), ((IterNode)yyVals[0+yyTop])), (String JavaDoc) ((Token)yyVals[-1+yyTop]).getValue(), null, ((IterNode)yyVals[0+yyTop]));
2232              }
2233  break;
2234case 290:
2235                    // line 1063 "DefaultRubyParser.y"
2236
{
2237              if (((Node)yyVals[-1+yyTop]) != null &&
2238                      ((BlockAcceptingNode)yyVals[-1+yyTop]).getIterNode() instanceof BlockPassNode) {
2239                      throw new SyntaxException(getPosition(((Node)yyVals[-1+yyTop])), "Both block arg and actual block given.");
2240          }
2241          ((BlockAcceptingNode)yyVals[-1+yyTop]).setIterNode(((IterNode)yyVals[0+yyTop]));
2242          ((Node)yyVals[-1+yyTop]).setPosition(support.union(((Node)yyVals[-1+yyTop]), ((IterNode)yyVals[0+yyTop])));
2243              }
2244  break;
2245case 291:
2246                    // line 1071 "DefaultRubyParser.y"
2247
{
2248                  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]));
2249              }
2250  break;
2251case 292:
2252                    // line 1074 "DefaultRubyParser.y"
2253
{
2254                  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]));
2255              }
2256  break;
2257case 293:
2258                    // line 1077 "DefaultRubyParser.y"
2259
{
2260                  lexer.getConditionState().begin();
2261          }
2262  break;
2263case 294:
2264                    // line 1079 "DefaultRubyParser.y"
2265
{
2266          lexer.getConditionState().end();
2267          }
2268  break;
2269case 295:
2270                    // line 1081 "DefaultRubyParser.y"
2271
{
2272                  yyVal = new WhileNode(support.union(((Token)yyVals[-6+yyTop]), ((Token)yyVals[0+yyTop])), support.getConditionNode(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-1+yyTop]));
2273              }
2274  break;
2275case 296:
2276                    // line 1084 "DefaultRubyParser.y"
2277
{
2278                  lexer.getConditionState().begin();
2279              }
2280  break;
2281case 297:
2282                    // line 1086 "DefaultRubyParser.y"
2283
{
2284                  lexer.getConditionState().end();
2285              }
2286  break;
2287case 298:
2288                    // line 1088 "DefaultRubyParser.y"
2289
{
2290                  yyVal = new UntilNode(getPosition(((Token)yyVals[-6+yyTop])), support.getConditionNode(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-1+yyTop]));
2291              }
2292  break;
2293case 299:
2294                    // line 1091 "DefaultRubyParser.y"
2295
{
2296                  yyVal = new CaseNode(support.union(((Token)yyVals[-4+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-3+yyTop]), ((Node)yyVals[-1+yyTop]));
2297              }
2298  break;
2299case 300:
2300                    // line 1094 "DefaultRubyParser.y"
2301
{
2302                  yyVal = new CaseNode(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])), null, ((Node)yyVals[-1+yyTop]));
2303              }
2304  break;
2305case 301:
2306                    // line 1097 "DefaultRubyParser.y"
2307
{
2308          yyVal = ((Node)yyVals[-1+yyTop]);
2309              }
2310  break;
2311case 302:
2312                    // line 1100 "DefaultRubyParser.y"
2313
{
2314                  lexer.getConditionState().begin();
2315              }
2316  break;
2317case 303:
2318                    // line 1102 "DefaultRubyParser.y"
2319
{
2320                  lexer.getConditionState().end();
2321              }
2322  break;
2323case 304:
2324                    // line 1104 "DefaultRubyParser.y"
2325
{
2326                  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]));
2327              }
2328  break;
2329case 305:
2330                    // line 1107 "DefaultRubyParser.y"
2331
{
2332                  if (support.isInDef() || support.isInSingle()) {
2333                      yyerror("class definition in method body");
2334                  }
2335          support.pushLocalScope();
2336              }
2337  break;
2338case 306:
2339                    // line 1112 "DefaultRubyParser.y"
2340
{
2341                  yyVal = new ClassNode(support.union(((Token)yyVals[-5+yyTop]), ((Token)yyVals[0+yyTop])), ((Colon3Node)yyVals[-4+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[-3+yyTop]));
2342                  support.popCurrentScope();
2343              }
2344  break;
2345case 307:
2346                    // line 1116 "DefaultRubyParser.y"
2347
{
2348                  yyVal = new Boolean JavaDoc(support.isInDef());
2349                  support.setInDef(false);
2350              }
2351  break;
2352case 308:
2353                    // line 1119 "DefaultRubyParser.y"
2354
{
2355                  yyVal = new Integer JavaDoc(support.getInSingle());
2356                  support.setInSingle(0);
2357          support.pushLocalScope();
2358              }
2359  break;
2360case 309:
2361                    // line 1123 "DefaultRubyParser.y"
2362
{
2363                  yyVal = new SClassNode(support.union(((Token)yyVals[-7+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-5+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]));
2364                  support.popCurrentScope();
2365                  support.setInDef(((Boolean JavaDoc)yyVals[-4+yyTop]).booleanValue());
2366                  support.setInSingle(((Integer JavaDoc)yyVals[-2+yyTop]).intValue());
2367              }
2368  break;
2369case 310:
2370                    // line 1129 "DefaultRubyParser.y"
2371
{
2372                  if (support.isInDef() || support.isInSingle()) {
2373                      yyerror("module definition in method body");
2374                  }
2375          support.pushLocalScope();
2376              }
2377  break;
2378case 311:
2379                    // line 1134 "DefaultRubyParser.y"
2380
{
2381                  yyVal = new ModuleNode(support.union(((Token)yyVals[-4+yyTop]), ((Token)yyVals[0+yyTop])), ((Colon3Node)yyVals[-3+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]));
2382                  support.popCurrentScope();
2383              }
2384  break;
2385case 312:
2386                    // line 1138 "DefaultRubyParser.y"
2387
{
2388                  support.setInDef(true);
2389          support.pushLocalScope();
2390              }
2391  break;
2392case 313:
2393                    // line 1141 "DefaultRubyParser.y"
2394
{
2395                    /* NOEX_PRIVATE for toplevel */
2396                  yyVal = new DefnNode(support.union(((Token)yyVals[-5+yyTop]), ((Token)yyVals[0+yyTop])), new ArgumentNode(((Token)yyVals[-4+yyTop]).getPosition(), (String JavaDoc) ((Token)yyVals[-4+yyTop]).getValue()), ((ArgsNode)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]), Visibility.PRIVATE);
2397                  support.popCurrentScope();
2398                  support.setInDef(false);
2399              }
2400  break;
2401case 314:
2402                    // line 1147 "DefaultRubyParser.y"
2403
{
2404                  lexer.setState(LexState.EXPR_FNAME);
2405              }
2406  break;
2407case 315:
2408                    // line 1149 "DefaultRubyParser.y"
2409
{
2410                  support.setInSingle(support.getInSingle() + 1);
2411          support.pushLocalScope();
2412                  lexer.setState(LexState.EXPR_END); /* force for args */
2413              }
2414  break;
2415case 316:
2416                    // line 1153 "DefaultRubyParser.y"
2417
{
2418                  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 JavaDoc) ((Token)yyVals[-4+yyTop]).getValue()), ((ArgsNode)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]));
2419                  support.popCurrentScope();
2420                  support.setInSingle(support.getInSingle() - 1);
2421              }
2422  break;
2423case 317:
2424                    // line 1158 "DefaultRubyParser.y"
2425
{
2426                  yyVal = new BreakNode(((Token)yyVals[0+yyTop]).getPosition());
2427              }
2428  break;
2429case 318:
2430                    // line 1161 "DefaultRubyParser.y"
2431
{
2432                  yyVal = new NextNode(((Token)yyVals[0+yyTop]).getPosition());
2433              }
2434  break;
2435case 319:
2436                    // line 1164 "DefaultRubyParser.y"
2437
{
2438                  yyVal = new RedoNode(((Token)yyVals[0+yyTop]).getPosition());
2439              }
2440  break;
2441case 320:
2442                    // line 1167 "DefaultRubyParser.y"
2443
{
2444                  yyVal = new RetryNode(((Token)yyVals[0+yyTop]).getPosition());
2445              }
2446  break;
2447case 321:
2448                    // line 1171 "DefaultRubyParser.y"
2449
{
2450                  support.checkExpression(((Node)yyVals[0+yyTop]));
2451          yyVal = ((Node)yyVals[0+yyTop]);
2452          }
2453  break;
2454case 330:
2455                    // line 1186 "DefaultRubyParser.y"
2456
{
2457/*mirko: support.union($<ISourcePositionHolder>1.getPosition(), getPosition($<ISourcePositionHolder>1)) ?*/
2458                  yyVal = new IfNode(getPosition(((Token)yyVals[-4+yyTop])), support.getConditionNode(((Node)yyVals[-3+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
2459              }
2460  break;
2461case 332:
2462                    // line 1192 "DefaultRubyParser.y"
2463
{
2464                  yyVal = ((Node)yyVals[0+yyTop]);
2465              }
2466  break;
2467case 334:
2468                    // line 1197 "DefaultRubyParser.y"
2469
{}
2470  break;
2471case 336:
2472                    // line 1200 "DefaultRubyParser.y"
2473
{
2474                  yyVal = new ZeroArgNode(support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop])));
2475              }
2476  break;
2477case 337:
2478                    // line 1203 "DefaultRubyParser.y"
2479
{
2480                  yyVal = new ZeroArgNode(((Token)yyVals[0+yyTop]).getPosition());
2481          }
2482  break;
2483case 338:
2484                    // line 1206 "DefaultRubyParser.y"
2485
{
2486                  yyVal = ((Node)yyVals[-1+yyTop]);
2487
2488          /* Include pipes on multiple arg type*/
2489                  if (((Node)yyVals[-1+yyTop]) instanceof MultipleAsgnNode) {
2490              ((Node)yyVals[-1+yyTop]).setPosition(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
2491          }
2492              }
2493  break;
2494case 339:
2495                    // line 1215 "DefaultRubyParser.y"
2496
{
2497                  support.pushBlockScope();
2498          }
2499  break;
2500case 340:
2501                    // line 1217 "DefaultRubyParser.y"
2502
{
2503                  yyVal = new IterNode(support.union(((Token)yyVals[-4+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]));
2504                  support.popCurrentScope();
2505              }
2506  break;
2507case 341:
2508                    // line 1222 "DefaultRubyParser.y"
2509
{
2510              if (((Node)yyVals[-1+yyTop]) != null &&
2511                      ((BlockAcceptingNode)yyVals[-1+yyTop]).getIterNode() instanceof BlockPassNode) {
2512                      throw new SyntaxException(getPosition(((Node)yyVals[-1+yyTop])), "Both block arg and actual block given.");
2513                  }
2514          ((BlockAcceptingNode)yyVals[-1+yyTop]).setIterNode(((IterNode)yyVals[0+yyTop]));
2515          ((Node)yyVals[-1+yyTop]).setPosition(support.union(((Node)yyVals[-1+yyTop]), ((IterNode)yyVals[0+yyTop])));
2516              }
2517  break;
2518case 342:
2519                    // line 1230 "DefaultRubyParser.y"
2520
{
2521                  yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
2522              }
2523  break;
2524case 343:
2525                    // line 1233 "DefaultRubyParser.y"
2526
{
2527                  yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
2528              }
2529  break;
2530case 344:
2531                    // line 1237 "DefaultRubyParser.y"
2532
{
2533                  yyVal = support.new_fcall(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
2534              }
2535  break;
2536case 345:
2537                    // line 1240 "DefaultRubyParser.y"
2538
{
2539                  yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
2540              }
2541  break;
2542case 346:
2543                    // line 1243 "DefaultRubyParser.y"
2544
{
2545                  yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null);
2546              }
2547  break;
2548case 347:
2549                    // line 1246 "DefaultRubyParser.y"
2550
{
2551                  yyVal = support.new_call(((Node)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]), null, null);
2552              }
2553  break;
2554case 348:
2555                    // line 1249 "DefaultRubyParser.y"
2556
{
2557                  yyVal = support.new_super(((Node)yyVals[0+yyTop]), ((Token)yyVals[-1+yyTop]));
2558              }
2559  break;
2560case 349:
2561                    // line 1252 "DefaultRubyParser.y"
2562
{
2563                  yyVal = new ZSuperNode(((Token)yyVals[0+yyTop]).getPosition());
2564              }
2565  break;
2566case 350:
2567                    // line 1257 "DefaultRubyParser.y"
2568
{
2569                  support.pushBlockScope();
2570          }
2571  break;
2572case 351:
2573                    // line 1259 "DefaultRubyParser.y"
2574
{
2575                  yyVal = new IterNode(support.union(((Token)yyVals[-4+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]));
2576                  support.popCurrentScope();
2577              }
2578  break;
2579case 352:
2580                    // line 1263 "DefaultRubyParser.y"
2581
{
2582                  support.pushBlockScope();
2583          }
2584  break;
2585case 353:
2586                    // line 1265 "DefaultRubyParser.y"
2587
{
2588                  yyVal = new IterNode(support.union(((Token)yyVals[-4+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]));
2589                  ((ISourcePositionHolder)yyVals[-5+yyTop]).setPosition(support.union(((ISourcePositionHolder)yyVals[-5+yyTop]), ((ISourcePositionHolder)yyVal)));
2590                  support.popCurrentScope();
2591              }
2592  break;
2593case 354:
2594                    // line 1271 "DefaultRubyParser.y"
2595
{
2596                  yyVal = new WhenNode(support.union(((Token)yyVals[-4+yyTop]), support.unwrapNewlineNode(((Node)yyVals[-1+yyTop]))), ((ListNode)yyVals[-3+yyTop]), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
2597              }
2598  break;
2599case 356:
2600                    // line 1276 "DefaultRubyParser.y"
2601
{
2602                  yyVal = ((ListNode)yyVals[-3+yyTop]).add(new WhenNode(getPosition(((ListNode)yyVals[-3+yyTop])), ((Node)yyVals[0+yyTop]), null, null));
2603              }
2604  break;
2605case 357:
2606                    // line 1279 "DefaultRubyParser.y"
2607
{
2608                  yyVal = new ArrayNode(getPosition(((Token)yyVals[-1+yyTop])), new WhenNode(getPosition(((Token)yyVals[-1+yyTop])), ((Node)yyVals[0+yyTop]), null, null));
2609              }
2610  break;
2611case 360:
2612                    // line 1286 "DefaultRubyParser.y"
2613
{
2614                  Node node;
2615                  if (((Node)yyVals[-3+yyTop]) != null) {
2616                     node = support.appendToBlock(support.node_assign(((Node)yyVals[-3+yyTop]), new GlobalVarNode(getPosition(((Token)yyVals[-5+yyTop])), "$!")), ((Node)yyVals[-1+yyTop]));
2617                     if(((Node)yyVals[-1+yyTop]) != null) {
2618                        node.setPosition(support.unwrapNewlineNode(((Node)yyVals[-1+yyTop])).getPosition());
2619                     }
2620          } else {
2621             node = ((Node)yyVals[-1+yyTop]);
2622                  }
2623                  yyVal = new RescueBodyNode(getPosition(((Token)yyVals[-5+yyTop]), true), ((Node)yyVals[-4+yyTop]), node, ((RescueBodyNode)yyVals[0+yyTop]));
2624          }
2625  break;
2626case 361:
2627                    // line 1298 "DefaultRubyParser.y"
2628
{yyVal = null;}
2629  break;
2630case 362:
2631                    // line 1300 "DefaultRubyParser.y"
2632
{
2633                  yyVal = new ArrayNode(((Node)yyVals[0+yyTop]).getPosition(), ((Node)yyVals[0+yyTop]));
2634          }
2635  break;
2636case 365:
2637                    // line 1306 "DefaultRubyParser.y"
2638
{
2639                  yyVal = ((Node)yyVals[0+yyTop]);
2640              }
2641  break;
2642case 367:
2643                    // line 1311 "DefaultRubyParser.y"
2644
{
2645                  if (((Node)yyVals[0+yyTop]) != null) {
2646                      yyVal = ((Node)yyVals[0+yyTop]);
2647                  } else {
2648                      yyVal = new NilNode(getPosition(null));
2649                  }
2650              }
2651  break;
2652case 370:
2653                    // line 1321 "DefaultRubyParser.y"
2654
{
2655                  yyVal = new SymbolNode(((Token)yyVals[0+yyTop]).getPosition(), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
2656              }
2657  break;
2658case 372:
2659                    // line 1326 "DefaultRubyParser.y"
2660
{
2661                  if (((Node)yyVals[0+yyTop]) instanceof EvStrNode) {
2662                      yyVal = new DStrNode(getPosition(((Node)yyVals[0+yyTop]))).add(((Node)yyVals[0+yyTop]));
2663                  } else {
2664                      yyVal = ((Node)yyVals[0+yyTop]);
2665                  }
2666          }
2667  break;
2668case 374:
2669                    // line 1335 "DefaultRubyParser.y"
2670
{
2671                  yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
2672              }
2673  break;
2674case 375:
2675                    // line 1339 "DefaultRubyParser.y"
2676
{
2677                  yyVal = ((Node)yyVals[-1+yyTop]);
2678                  ((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
2679          int extraLength = ((String JavaDoc) ((Token)yyVals[-2+yyTop]).getValue()).length() - 1;
2680
2681                  /* We may need to subtract addition offset off of first */
2682          /* string fragment (we optimistically take one off in*/
2683          /* ParserSupport.literal_concat). Check token length*/
2684          /* and subtract as neeeded.*/
2685          if ((((Node)yyVals[-1+yyTop]) instanceof DStrNode) && extraLength > 0) {
2686             Node strNode = ((DStrNode)((Node)yyVals[-1+yyTop])).get(0);
2687             assert strNode != null;
2688             strNode.getPosition().adjustStartOffset(-extraLength);
2689          }
2690              }
2691  break;
2692case 376:
2693                    // line 1355 "DefaultRubyParser.y"
2694
{
2695                  ISourcePosition position = support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]));
2696
2697          if (((Node)yyVals[-1+yyTop]) == null) {
2698              yyVal = new XStrNode(position, null);
2699          } else if (((Node)yyVals[-1+yyTop]) instanceof StrNode) {
2700                      yyVal = new XStrNode(position, (ByteList) ((StrNode)yyVals[-1+yyTop]).getValue().clone());
2701          } else if (((Node)yyVals[-1+yyTop]) instanceof DStrNode) {
2702                      yyVal = new DXStrNode(position, ((DStrNode)yyVals[-1+yyTop]));
2703
2704                      ((Node)yyVal).setPosition(position);
2705                  } else {
2706                      yyVal = new DXStrNode(position).add(((Node)yyVals[-1+yyTop]));
2707          }
2708              }
2709  break;
2710case 377:
2711                    // line 1371 "DefaultRubyParser.y"
2712
{
2713          int options = ((RegexpNode)yyVals[0+yyTop]).getOptions();
2714          Node node = ((Node)yyVals[-1+yyTop]);
2715
2716          if (node == null) {
2717                      yyVal = new RegexpNode(getPosition(((Token)yyVals[-2+yyTop])), ByteList.create(""), options & ~ReOptions.RE_OPTION_ONCE);
2718          } else if (node instanceof StrNode) {
2719                      yyVal = new RegexpNode(((Node)yyVals[-1+yyTop]).getPosition(), (ByteList) ((StrNode) node).getValue().clone(), options & ~ReOptions.RE_OPTION_ONCE);
2720          } else if (node instanceof DStrNode) {
2721                      yyVal = new DRegexpNode(getPosition(((Token)yyVals[-2+yyTop])), (DStrNode) node, options, (options & ReOptions.RE_OPTION_ONCE) != 0);
2722          } else {
2723              yyVal = new DRegexpNode(getPosition(((Token)yyVals[-2+yyTop])), options, (options & ReOptions.RE_OPTION_ONCE) != 0).add(node);
2724                  }
2725           }
2726  break;
2727case 378:
2728                    // line 1386 "DefaultRubyParser.y"
2729
{
2730                   yyVal = new ZArrayNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
2731           }
2732  break;
2733case 379:
2734                    // line 1389 "DefaultRubyParser.y"
2735
{
2736           yyVal = ((ListNode)yyVals[-1+yyTop]);
2737                   ((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
2738           }
2739  break;
2740case 380:
2741                    // line 1394 "DefaultRubyParser.y"
2742
{
2743                   yyVal = new ArrayNode(getPosition(null));
2744           }
2745  break;
2746case 381:
2747                    // line 1397 "DefaultRubyParser.y"
2748
{
2749                   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]));
2750           }
2751  break;
2752case 383:
2753                    // line 1402 "DefaultRubyParser.y"
2754
{
2755                   yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
2756           }
2757  break;
2758case 384:
2759                    // line 1406 "DefaultRubyParser.y"
2760
{
2761                   yyVal = new ZArrayNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
2762           }
2763  break;
2764case 385:
2765                    // line 1409 "DefaultRubyParser.y"
2766
{
2767           yyVal = ((ListNode)yyVals[-1+yyTop]);
2768                   ((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
2769           }
2770  break;
2771case 386:
2772                    // line 1414 "DefaultRubyParser.y"
2773
{
2774                   yyVal = new ArrayNode(getPosition(null));
2775           }
2776  break;
2777case 387:
2778                    // line 1417 "DefaultRubyParser.y"
2779
{
2780                   yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[-1+yyTop]));
2781           }
2782  break;
2783case 388:
2784                    // line 1421 "DefaultRubyParser.y"
2785
{
2786                   yyVal = new StrNode(((Token)yyVals[0+yyTop]).getPosition(), ByteList.create(""));
2787           }
2788  break;
2789case 389:
2790                    // line 1424 "DefaultRubyParser.y"
2791
{
2792                   yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
2793           }
2794  break;
2795case 390:
2796                    // line 1428 "DefaultRubyParser.y"
2797
{
2798           yyVal = null;
2799           }
2800  break;
2801case 391:
2802                    // line 1431 "DefaultRubyParser.y"
2803
{
2804                   yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
2805           }
2806  break;
2807case 392:
2808                    // line 1435 "DefaultRubyParser.y"
2809
{
2810                   yyVal = ((Node)yyVals[0+yyTop]);
2811               }
2812  break;
2813case 393:
2814                    // line 1438 "DefaultRubyParser.y"
2815
{
2816                   yyVal = lexer.getStrTerm();
2817           lexer.setStrTerm(null);
2818           lexer.setState(LexState.EXPR_BEG);
2819           }
2820  break;
2821case 394:
2822                    // line 1442 "DefaultRubyParser.y"
2823
{
2824           lexer.setStrTerm(((StrTerm)yyVals[-1+yyTop]));
2825               yyVal = new EvStrNode(support.union(((Token)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), ((Node)yyVals[0+yyTop]));
2826           }
2827  break;
2828case 395:
2829                    // line 1446 "DefaultRubyParser.y"
2830
{
2831           yyVal = lexer.getStrTerm();
2832           lexer.setStrTerm(null);
2833           lexer.setState(LexState.EXPR_BEG);
2834           }
2835  break;
2836case 396:
2837                    // line 1450 "DefaultRubyParser.y"
2838
{
2839           lexer.setStrTerm(((StrTerm)yyVals[-2+yyTop]));
2840
2841           yyVal = support.newEvStrNode(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-1+yyTop]));
2842           }
2843  break;
2844case 397:
2845                    // line 1456 "DefaultRubyParser.y"
2846
{
2847                   yyVal = new GlobalVarNode(((Token)yyVals[0+yyTop]).getPosition(), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
2848               }
2849  break;
2850case 398:
2851                    // line 1459 "DefaultRubyParser.y"
2852
{
2853                   yyVal = new InstVarNode(((Token)yyVals[0+yyTop]).getPosition(), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
2854               }
2855  break;
2856case 399:
2857                    // line 1462 "DefaultRubyParser.y"
2858
{
2859                   yyVal = new ClassVarNode(((Token)yyVals[0+yyTop]).getPosition(), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue());
2860               }
2861  break;
2862case 401:
2863                    // line 1468 "DefaultRubyParser.y"
2864
{
2865                   lexer.setState(LexState.EXPR_END);
2866                   yyVal = ((Token)yyVals[0+yyTop]);
2867           ((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop])));
2868               }
2869  break;
2870case 406:
2871                    // line 1476 "DefaultRubyParser.y"
2872
{
2873                   lexer.setState(LexState.EXPR_END);
2874
2875           /* DStrNode: :"some text #{some expression}"*/
2876                   /* StrNode: :"some text"*/
2877           /* EvStrNode :"#{some expression}"*/
2878           DStrNode node;
2879
2880                   if (((Node)yyVals[-1+yyTop]) == null) {
2881                       yyerror("empty symbol literal");
2882                   }
2883
2884           if (((Node)yyVals[-1+yyTop]) instanceof DStrNode) {
2885               yyVal = new DSymbolNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((DStrNode)yyVals[-1+yyTop]));
2886           } else {
2887                       ISourcePosition position = support.union(((Node)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop]));
2888
2889                       /* We substract one since tsymbeg is longer than one*/
2890               /* and we cannot union it directly so we assume quote*/
2891                       /* is one character long and subtract for it.*/
2892               position.adjustStartOffset(-1);
2893                       ((Node)yyVals[-1+yyTop]).setPosition(position);
2894               
2895               yyVal = new DSymbolNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
2896                       ((DSymbolNode)yyVal).add(((Node)yyVals[-1+yyTop]));
2897                   }
2898           }
2899  break;
2900case 408:
2901                    // line 1505 "DefaultRubyParser.y"
2902
{
2903                   yyVal = ((FloatNode)yyVals[0+yyTop]);
2904               }
2905  break;
2906case 409:
2907                    // line 1508 "DefaultRubyParser.y"
2908
{
2909                   yyVal = support.negateInteger(((Node)yyVals[0+yyTop]));
2910           }
2911  break;
2912case 410:
2913                    // line 1511 "DefaultRubyParser.y"
2914
{
2915                   yyVal = support.negateFloat(((FloatNode)yyVals[0+yyTop]));
2916           }
2917  break;
2918case 416:
2919                    // line 1517 "DefaultRubyParser.y"
2920
{
2921           yyVal = new Token("nil", ((Token)yyVals[0+yyTop]).getPosition());
2922               }
2923  break;
2924case 417:
2925                    // line 1520 "DefaultRubyParser.y"
2926
{
2927           yyVal = new Token("self", ((Token)yyVals[0+yyTop]).getPosition());
2928               }
2929  break;
2930case 418:
2931                    // line 1523 "DefaultRubyParser.y"
2932
{
2933           yyVal = new Token("true", ((Token)yyVals[0+yyTop]).getPosition());
2934               }
2935  break;
2936case 419:
2937                    // line 1526 "DefaultRubyParser.y"
2938
{
2939           yyVal = new Token("false", ((Token)yyVals[0+yyTop]).getPosition());
2940               }
2941  break;
2942case 420:
2943                    // line 1529 "DefaultRubyParser.y"
2944
{
2945           yyVal = new Token("__FILE__", ((Token)yyVals[0+yyTop]).getPosition());
2946               }
2947  break;
2948case 421:
2949                    // line 1532 "DefaultRubyParser.y"
2950
{
2951           yyVal = new Token("__LINE__", ((Token)yyVals[0+yyTop]).getPosition());
2952               }
2953  break;
2954case 422:
2955                    // line 1536 "DefaultRubyParser.y"
2956
{
2957           yyVal = support.gettable((String JavaDoc) ((Token)yyVals[0+yyTop]).getValue(), ((Token)yyVals[0+yyTop]).getPosition());
2958               }
2959  break;
2960case 423:
2961                    // line 1540 "DefaultRubyParser.y"
2962
{
2963                   yyVal = support.assignable(((Token)yyVals[0+yyTop]), null);
2964               }
2965  break;
2966case 426:
2967                    // line 1546 "DefaultRubyParser.y"
2968
{
2969                   yyVal = null;
2970               }
2971  break;
2972case 427:
2973                    // line 1549 "DefaultRubyParser.y"
2974
{
2975                   lexer.setState(LexState.EXPR_BEG);
2976               }
2977  break;
2978case 428:
2979                    // line 1551 "DefaultRubyParser.y"
2980
{
2981                   yyVal = ((Node)yyVals[-1+yyTop]);
2982               }
2983  break;
2984case 429:
2985                    // line 1554 "DefaultRubyParser.y"
2986
{
2987                   yyerrok();
2988                   yyVal = null;
2989               }
2990  break;
2991case 430:
2992                    // line 1560 "DefaultRubyParser.y"
2993
{
2994                   yyVal = ((Node)yyVals[-2+yyTop]);
2995                   ((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])));
2996                   lexer.setState(LexState.EXPR_BEG);
2997               }
2998  break;
2999case 431:
3000                    // line 1565 "DefaultRubyParser.y"
3001
{
3002                   yyVal = ((Node)yyVals[-1+yyTop]);
3003               }
3004  break;
3005case 432:
3006                    // line 1569 "DefaultRubyParser.y"
3007
{
3008                   yyVal = new ArgsNode(support.union(((ListNode)yyVals[-5+yyTop]), ((BlockArgNode)yyVals[0+yyTop])), ((ListNode)yyVals[-5+yyTop]), ((ListNode)yyVals[-3+yyTop]), ((Integer JavaDoc) ((Token)yyVals[-1+yyTop]).getValue()).intValue(), ((BlockArgNode)yyVals[0+yyTop]));
3009               }
3010  break;
3011case 433:
3012                    // line 1572 "DefaultRubyParser.y"
3013
{
3014                   yyVal = new ArgsNode(getPosition(((ListNode)yyVals[-3+yyTop])), ((ListNode)yyVals[-3+yyTop]), ((ListNode)yyVals[-1+yyTop]), -1, ((BlockArgNode)yyVals[0+yyTop]));
3015               }
3016  break;
3017case 434:
3018                    // line 1575 "DefaultRubyParser.y"
3019
{
3020                   yyVal = new ArgsNode(support.union(((ListNode)yyVals[-3+yyTop]), ((BlockArgNode)yyVals[0+yyTop])), ((ListNode)yyVals[-3+yyTop]), null, ((Integer JavaDoc) ((Token)yyVals[-1+yyTop]).getValue()).intValue(), ((BlockArgNode)yyVals[0+yyTop]));
3021               }
3022  break;
3023case 435:
3024                    // line 1578 "DefaultRubyParser.y"
3025
{
3026                   yyVal = new ArgsNode(((ISourcePositionHolder)yyVals[-1+yyTop]).getPosition(), ((ListNode)yyVals[-1+yyTop]), null, -1, ((BlockArgNode)yyVals[0+yyTop]));
3027               }
3028  break;
3029case 436:
3030                    // line 1581 "DefaultRubyParser.y"
3031
{
3032                   yyVal = new ArgsNode(getPosition(((ListNode)yyVals[-3+yyTop])), null, ((ListNode)yyVals[-3+yyTop]), ((Integer JavaDoc) ((Token)yyVals[-1+yyTop]).getValue()).intValue(), ((BlockArgNode)yyVals[0+yyTop]));
3033               }
3034  break;
3035case 437:
3036                    // line 1584 "DefaultRubyParser.y"
3037
{
3038                   yyVal = new ArgsNode(getPosition(((ListNode)yyVals[-1+yyTop])), null, ((ListNode)yyVals[-1+yyTop]), -1, ((BlockArgNode)yyVals[0+yyTop]));
3039               }
3040  break;
3041case 438:
3042                    // line 1587 "DefaultRubyParser.y"
3043
{
3044                   yyVal = new ArgsNode(getPosition(((Token)yyVals[-1+yyTop])), null, null, ((Integer JavaDoc) ((Token)yyVals[-1+yyTop]).getValue()).intValue(), ((BlockArgNode)yyVals[0+yyTop]));
3045               }
3046  break;
3047case 439:
3048                    // line 1590 "DefaultRubyParser.y"
3049
{
3050                   yyVal = new ArgsNode(getPosition(((BlockArgNode)yyVals[0+yyTop])), null, null, -1, ((BlockArgNode)yyVals[0+yyTop]));
3051               }
3052  break;
3053case 440:
3054                    // line 1593 "DefaultRubyParser.y"
3055
{
3056                   /*take the last position from the lexer, this isn't entirely correct, but more accurate then getPosition(null). */
3057                   yyVal = new ArgsNode(lexer.getPosition(), null, null, -1, null);
3058               }
3059  break;
3060case 441:
3061                    // line 1598 "DefaultRubyParser.y"
3062
{
3063                   yyerror("formal argument cannot be a constant");
3064               }
3065  break;
3066case 442:
3067                    // line 1601 "DefaultRubyParser.y"
3068
{
3069                   yyerror("formal argument cannot be an instance variable");
3070               }
3071  break;
3072case 443:
3073                    // line 1604 "DefaultRubyParser.y"
3074
{
3075                   yyerror("formal argument cannot be a class variable");
3076               }
3077  break;
3078case 444:
3079                    // line 1607 "DefaultRubyParser.y"
3080
{
3081                   String JavaDoc identifier = (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue();
3082                   if (IdUtil.getVarType(identifier) != IdUtil.LOCAL_VAR) {
3083                       yyerror("formal argument must be local variable");
3084                   } else if (support.getCurrentScope().getLocalScope().isDefined(identifier) >= 0) {
3085                       yyerror("duplicate argument name");
3086                   }
3087
3088           support.getCurrentScope().getLocalScope().addVariable(identifier);
3089                   yyVal = ((Token)yyVals[0+yyTop]);
3090               }
3091  break;
3092case 445:
3093                    // line 1619 "DefaultRubyParser.y"
3094
{
3095                    yyVal = new ListNode(((ISourcePositionHolder)yyVals[0+yyTop]).getPosition());
3096                    ((ListNode) yyVal).add(new ArgumentNode(((ISourcePositionHolder)yyVals[0+yyTop]).getPosition(), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue()));
3097               }
3098  break;
3099case 446:
3100                    // line 1623 "DefaultRubyParser.y"
3101
{
3102                   ((ListNode)yyVals[-2+yyTop]).add(new ArgumentNode(((ISourcePositionHolder)yyVals[0+yyTop]).getPosition(), (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue()));
3103                   ((ListNode)yyVals[-2+yyTop]).setPosition(support.union(((ListNode)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
3104           yyVal = ((ListNode)yyVals[-2+yyTop]);
3105               }
3106  break;
3107case 447:
3108                    // line 1629 "DefaultRubyParser.y"
3109
{
3110                   String JavaDoc identifier = (String JavaDoc) ((Token)yyVals[-2+yyTop]).getValue();
3111
3112                   if (IdUtil.getVarType(identifier) != IdUtil.LOCAL_VAR) {
3113                       yyerror("formal argument must be local variable");
3114                   } else if (support.getCurrentScope().getLocalScope().isDefined(identifier) >= 0) {
3115                       yyerror("duplicate optional argument name");
3116                   }
3117           support.getCurrentScope().getLocalScope().addVariable(identifier);
3118                   yyVal = support.assignable(((Token)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
3119              }
3120  break;
3121case 448:
3122                    // line 1641 "DefaultRubyParser.y"
3123
{
3124                  yyVal = new BlockNode(getPosition(((Node)yyVals[0+yyTop]))).add(((Node)yyVals[0+yyTop]));
3125              }
3126  break;
3127case 449:
3128                    // line 1644 "DefaultRubyParser.y"
3129
{
3130                  yyVal = support.appendToBlock(((ListNode)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
3131              }
3132  break;
3133case 452:
3134                    // line 1650 "DefaultRubyParser.y"
3135
{
3136                  String JavaDoc identifier = (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue();
3137
3138                  if (IdUtil.getVarType(identifier) != IdUtil.LOCAL_VAR) {
3139                      yyerror("rest argument must be local variable");
3140                   } else if (support.getCurrentScope().getLocalScope().isDefined(identifier) >= 0) {
3141                      yyerror("duplicate rest argument name");
3142                  }
3143          ((Token)yyVals[-1+yyTop]).setValue(new Integer JavaDoc(support.getCurrentScope().getLocalScope().addVariable(identifier)));
3144                  yyVal = ((Token)yyVals[-1+yyTop]);
3145              }
3146  break;
3147case 453:
3148                    // line 1661 "DefaultRubyParser.y"
3149
{
3150                  ((Token)yyVals[0+yyTop]).setValue(new Integer JavaDoc(-2));
3151                  yyVal = ((Token)yyVals[0+yyTop]);
3152              }
3153  break;
3154case 456:
3155                    // line 1668 "DefaultRubyParser.y"
3156
{
3157                  String JavaDoc identifier = (String JavaDoc) ((Token)yyVals[0+yyTop]).getValue();
3158
3159                  if (IdUtil.getVarType(identifier) != IdUtil.LOCAL_VAR) {
3160                      yyerror("block argument must be local variable");
3161          } else if (support.getCurrentScope().getLocalScope().isDefined(identifier) >= 0) {
3162                      yyerror("duplicate block argument name");
3163                  }
3164                  yyVal = new BlockArgNode(support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop])), support.getCurrentScope().getLocalScope().addVariable(identifier), identifier);
3165              }
3166  break;
3167case 457:
3168                    // line 1679 "DefaultRubyParser.y"
3169
{
3170                  yyVal = ((BlockArgNode)yyVals[0+yyTop]);
3171              }
3172  break;
3173case 458:
3174                    // line 1682 "DefaultRubyParser.y"
3175
{
3176              yyVal = null;
3177          }
3178  break;
3179case 459:
3180                    // line 1686 "DefaultRubyParser.y"
3181
{
3182                  if (!(((Node)yyVals[0+yyTop]) instanceof SelfNode)) {
3183              support.checkExpression(((Node)yyVals[0+yyTop]));
3184          }
3185          yyVal = ((Node)yyVals[0+yyTop]);
3186              }
3187  break;
3188case 460:
3189                    // line 1692 "DefaultRubyParser.y"
3190
{
3191                  lexer.setState(LexState.EXPR_BEG);
3192              }
3193  break;
3194case 461:
3195                    // line 1694 "DefaultRubyParser.y"
3196
{
3197                  if (((Node)yyVals[-2+yyTop]) instanceof ILiteralNode) {
3198                      yyerror("Can't define single method for literals.");
3199                  }
3200          support.checkExpression(((Node)yyVals[-2+yyTop]));
3201                  yyVal = ((Node)yyVals[-2+yyTop]);
3202              }
3203  break;
3204case 462:
3205                    // line 1704 "DefaultRubyParser.y"
3206
{ /* [!null]*/
3207                  yyVal = new ArrayNode(getPosition(null));
3208              }
3209  break;
3210case 463:
3211                    // line 1707 "DefaultRubyParser.y"
3212
{ /* [!null]*/
3213                  yyVal = ((ListNode)yyVals[-1+yyTop]);
3214              }
3215  break;
3216case 464:
3217                    // line 1710 "DefaultRubyParser.y"
3218
{
3219                  if (((ListNode)yyVals[-1+yyTop]).size() % 2 != 0) {
3220                      yyerror("Odd number list for Hash.");
3221                  }
3222                  yyVal = ((ListNode)yyVals[-1+yyTop]);
3223              }
3224  break;
3225case 466:
3226                    // line 1719 "DefaultRubyParser.y"
3227
{ /* [!null]*/
3228                  yyVal = ((ListNode)yyVals[-2+yyTop]).addAll(((ListNode)yyVals[0+yyTop]));
3229              }
3230  break;
3231case 467:
3232                    // line 1724 "DefaultRubyParser.y"
3233
{ /* [!null]*/
3234                  yyVal = new ArrayNode(support.union(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop])).add(((Node)yyVals[0+yyTop]));
3235              }
3236  break;
3237case 487:
3238                    // line 1736 "DefaultRubyParser.y"
3239
{
3240                  yyerrok();
3241              }
3242  break;
3243case 490:
3244                    // line 1742 "DefaultRubyParser.y"
3245
{
3246                  yyerrok();
3247              }
3248  break;
3249case 491:
3250                    // line 1746 "DefaultRubyParser.y"
3251
{
3252                  yyVal = null;
3253              }
3254  break;
3255case 492:
3256                    // line 1750 "DefaultRubyParser.y"
3257
{
3258                  yyVal = null;
3259          }
3260  break;
3261                    // line 7426 "-"
3262
}
3263        yyTop -= yyLen[yyN];
3264        yyState = yyStates[yyTop];
3265        int yyM = yyLhs[yyN];
3266        if (yyState == 0 && yyM == 0) {
3267          yyState = yyFinal;
3268          if (yyToken < 0) {
3269            yyToken = yyLex.advance() ? yyLex.token() : 0;
3270          }
3271          if (yyToken == 0) {
3272            return yyVal;
3273          }
3274          continue yyLoop;
3275        }
3276        if ((yyN = yyGindex[yyM]) != 0 && (yyN += yyState) >= 0
3277            && yyN < yyTable.length && yyCheck[yyN] == yyState)
3278          yyState = yyTable[yyN];
3279        else
3280          yyState = yyDgoto[yyM];
3281        continue yyLoop;
3282      }
3283    }
3284  }
3285
3286                    // line 1755 "DefaultRubyParser.y"
3287

3288    /** The parse method use an lexer stream and parse it to an AST node
3289     * structure
3290     */

3291    public RubyParserResult parse(RubyParserConfiguration configuration, LexerSource source) {
3292        support.reset();
3293        support.setConfiguration(configuration);
3294        support.setResult(new RubyParserResult());
3295        
3296        lexer.reset();
3297        lexer.setSource(source);
3298        try {
3299        //yyparse(lexer, new jay.yydebug.yyAnim("JRuby", 9));
3300
//yyparse(lexer, new jay.yydebug.yyDebugAdapter());
3301
yyparse(lexer, null);
3302        } catch (IOException JavaDoc e) {
3303            e.printStackTrace();
3304        } catch (yyException e) {
3305            e.printStackTrace();
3306        }
3307        
3308        return support.getResult();
3309    }
3310
3311    // +++
3312
// Helper Methods
3313

3314    void yyerrok() {}
3315
3316    /**
3317     * Since we can recieve positions at times we know can be null we
3318     * need an extra safety net here.
3319     */

3320    private ISourcePosition getPosition2(ISourcePositionHolder pos) {
3321        return pos == null ? lexer.getPosition(null, false) : pos.getPosition();
3322    }
3323
3324    private ISourcePosition getPosition(ISourcePositionHolder start) {
3325        return getPosition(start, false);
3326    }
3327
3328    private ISourcePosition getPosition(ISourcePositionHolder start, boolean inclusive) {
3329        if (start != null) {
3330        return lexer.getPosition(start.getPosition(), inclusive);
3331    }
3332    
3333    return lexer.getPosition(null, inclusive);
3334    }
3335}
3336                    // line 7506 "-"
3337
Popular Tags