1 4 39 package org.jruby.parser; 40 41 import java.io.IOException ; 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 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 275 protected static final int yyFinal = 1; 276 277 280 protected static final short[] yyLhs = { 281 -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 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 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 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 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 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 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 696 protected static final String [] 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 739 public static class yyException extends java.lang.Exception { 740 private static final long serialVersionUID = 1L; 741 public yyException (String message) { 742 super(message); 743 } 744 } 745 746 749 public interface yyInput { 750 751 755 boolean advance () throws java.io.IOException ; 756 757 761 int token (); 762 763 767 Object value (); 768 } 769 770 773 public void yyerror (String message) { 774 yyerror(message, null, null); 775 } 776 777 782 public void yyerror (String message, String [] expected, String found) { 783 StringBuffer text = new StringBuffer (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 800 protected String [] 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 result[] = new String [len]; 820 for (n = token = 0; n < len; ++ token) 821 if (ok[token]) result[n++] = yyNames[token]; 822 return result; 823 } 824 825 832 public Object yyparse (RubyYaccLexer yyLex, Object ayydebug) 833 throws java.io.IOException , yyException { 834 return yyparse(yyLex); 835 } 836 837 841 protected int yyMax; 842 843 849 protected Object yyDefault (Object first) { 850 return first; 851 } 852 853 859 public Object yyparse (RubyYaccLexer yyLex) throws java.io.IOException , yyException { 860 if (yyMax <= 0) yyMax = 256; int yyState = 0, yyStates[] = new int[yyMax]; Object yyVal = null, yyVals[] = new Object [yyMax]; int yyToken = -1; int yyErrorFlag = 0; 866 yyLoop: for (int yyTop = 0;; ++ yyTop) { 867 if (yyTop >= yyStates.length) { int[] i = new int[yyStates.length+yyMax]; 869 System.arraycopy(yyStates, 0, i, 0, yyStates.length); 870 yyStates = i; 871 Object [] o = new Object [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 (;;) { int yyN; 880 if ((yyN = yyDefRed[yyState]) == 0) { 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]; 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]; 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; } 921 } 922 int yyV = yyTop + 1-yyLen[yyN]; 923 yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]); 924 switch (yyN) { 925 case 1: 926 { 928 lexer.setState(LexState.EXPR_BEG); 929 support.initTopLocalVariables(); 930 } 931 break; 932 case 2: 933 { 935 if (((Node)yyVals[0+yyTop]) != null) { 936 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 { 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 { 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 { 976 yyVal = support.newline_node(((Node)yyVals[0+yyTop]), getPosition(((Node)yyVals[0+yyTop]), true)); 977 } 978 break; 979 case 7: 980 { 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 { 988 yyVal = ((Node)yyVals[0+yyTop]); 989 } 990 break; 991 case 9: 992 { 994 lexer.setState(LexState.EXPR_FNAME); 995 } 996 break; 997 case 10: 998 { 1000 yyVal = new AliasNode(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])), (String ) ((Token)yyVals[-2+yyTop]).getValue(), (String ) ((Token)yyVals[0+yyTop]).getValue()); 1001 } 1002 break; 1003case 11: 1004 { 1006 yyVal = new VAliasNode(getPosition(((Token)yyVals[-2+yyTop])), (String ) ((Token)yyVals[-1+yyTop]).getValue(), (String ) ((Token)yyVals[0+yyTop]).getValue()); 1007 } 1008 break; 1009case 12: 1010 { 1012 yyVal = new VAliasNode(getPosition(((Token)yyVals[-2+yyTop])), (String ) ((Token)yyVals[-1+yyTop]).getValue(), "$" + ((BackRefNode)yyVals[0+yyTop]).getType()); 1013 } 1014 break; 1015case 13: 1016 { 1018 yyerror("can't make alias for the number variables"); 1019 } 1020 break; 1021case 14: 1022 { 1024 yyVal = ((Node)yyVals[0+yyTop]); 1025 } 1026 break; 1027case 15: 1028 { 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 { 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 { 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 { 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 { 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 { 1068 if (support.isInDef() || support.isInSingle()) { 1069 yyerror("BEGIN in method"); 1070 } 1071 support.pushLocalScope(); 1072 } 1073 break; 1074case 21: 1075 { 1077 support.getResult().addBeginNode(support.getCurrentScope(), ((Node)yyVals[-1+yyTop])); 1078 support.popCurrentScope(); 1079 yyVal = null; 1080 } 1081 break; 1082case 22: 1083 { 1085 if (support.isInDef() || support.isInSingle()) { 1086 yyerror("END in method; use at_exit"); 1087 } 1088 1089 support.getResult().addEndNode(new PostExeNode(getPosition(((Token)yyVals[-3+yyTop])), ((Node)yyVals[-1+yyTop]))); 1090 yyVal = null; 1091 } 1092 break; 1093case 23: 1094 { 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 { 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 { 1115 support.checkExpression(((Node)yyVals[0+yyTop])); 1116 1117 String name = ((INameNode)yyVals[-2+yyTop]).getName(); 1118 String asgnOp = (String ) ((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 { 1134 yyVal = new OpElementAsgnNode(getPosition(((Node)yyVals[-5+yyTop])), ((Node)yyVals[-5+yyTop]), (String ) ((Token)yyVals[-1+yyTop]).getValue(), ((Node)yyVals[-3+yyTop]), ((Node)yyVals[0+yyTop])); 1135 1136 } 1137 break; 1138case 27: 1139 { 1141 yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String ) ((Token)yyVals[-2+yyTop]).getValue(), (String ) ((Token)yyVals[-1+yyTop]).getValue()); 1142 } 1143 break; 1144case 28: 1145 { 1147 yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String ) ((Token)yyVals[-2+yyTop]).getValue(), (String ) ((Token)yyVals[-1+yyTop]).getValue()); 1148 } 1149 break; 1150case 29: 1151 { 1153 yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String ) ((Token)yyVals[-2+yyTop]).getValue(), (String ) ((Token)yyVals[-1+yyTop]).getValue()); 1154 } 1155 break; 1156case 30: 1157 { 1159 support.backrefAssignError(((Node)yyVals[-2+yyTop])); 1160 } 1161 break; 1162case 31: 1163 { 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 { 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 { 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 { 1190 yyVal = support.newAndNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])); 1191 } 1192 break; 1193case 37: 1194 { 1196 yyVal = support.newOrNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])); 1197 } 1198 break; 1199case 38: 1200 { 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 { 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 { 1214 support.checkExpression(((Node)yyVals[0+yyTop])); 1215 } 1216 break; 1217case 44: 1218 { 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 { 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 { 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 { 1238 yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null); 1239 } 1240 break; 1241case 49: 1242 { 1244 yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null); 1245 } 1246 break; 1247case 50: 1248 { 1250 support.pushBlockScope(); 1251 } 1252 break; 1253case 51: 1254 { 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 { 1263 yyVal = support.new_fcall(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null); 1264 } 1265 break; 1266case 53: 1267 { 1269 yyVal = support.new_fcall(((Token)yyVals[-2+yyTop]), ((Node)yyVals[-1+yyTop]), ((IterNode)yyVals[0+yyTop])); 1270 } 1271 break; 1272case 54: 1273 { 1275 yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null); 1276 } 1277 break; 1278case 55: 1279 { 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 { 1287 yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null); 1288 } 1289 break; 1290case 57: 1291 { 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 { 1299 yyVal = support.new_super(((Node)yyVals[0+yyTop]), ((Token)yyVals[-1+yyTop])); 1300 } 1301 break; 1302case 59: 1303 { 1305 yyVal = support.new_yield(getPosition(((Token)yyVals[-1+yyTop])), ((Node)yyVals[0+yyTop])); 1306 } 1307 break; 1308case 61: 1309 { 1311 yyVal = ((MultipleAsgnNode)yyVals[-1+yyTop]); 1312 } 1313 break; 1314case 63: 1315 { 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 { 1323 yyVal = new MultipleAsgnNode(getPosition(((ListNode)yyVals[0+yyTop])), ((ListNode)yyVals[0+yyTop]), null); 1324 } 1325 break; 1326case 65: 1327 { 1329 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 { 1337 yyVal = new MultipleAsgnNode(getPosition(((ListNode)yyVals[-2+yyTop])), ((ListNode)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])); 1338 } 1339 break; 1340case 67: 1341 { 1343 yyVal = new MultipleAsgnNode(getPosition(((ListNode)yyVals[-1+yyTop])), ((ListNode)yyVals[-1+yyTop]), new StarNode(getPosition(null))); 1344 } 1345 break; 1346case 68: 1347 { 1349 yyVal = new MultipleAsgnNode(getPosition(((Token)yyVals[-1+yyTop])), null, ((Node)yyVals[0+yyTop])); 1350 } 1351 break; 1352case 69: 1353 { 1355 yyVal = new MultipleAsgnNode(getPosition(((Token)yyVals[0+yyTop])), null, new StarNode(getPosition(null))); 1356 } 1357 break; 1358case 71: 1359 { 1361 yyVal = ((MultipleAsgnNode)yyVals[-1+yyTop]); 1362 } 1363 break; 1364case 72: 1365 { 1367 yyVal = new ArrayNode(((Node)yyVals[-1+yyTop]).getPosition(), ((Node)yyVals[-1+yyTop])); 1368 } 1369 break; 1370case 73: 1371 { 1373 yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[-1+yyTop])); 1374 } 1375 break; 1376case 74: 1377 { 1379 yyVal = support.assignable(((Token)yyVals[0+yyTop]), null); 1380 } 1381 break; 1382case 75: 1383 { 1385 yyVal = support.aryset(((Node)yyVals[-3+yyTop]), ((Node)yyVals[-1+yyTop])); 1386 } 1387 break; 1388case 76: 1389 { 1391 yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String ) ((Token)yyVals[0+yyTop]).getValue()); 1392 } 1393 break; 1394case 77: 1395 { 1397 yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String ) ((Token)yyVals[0+yyTop]).getValue()); 1398 } 1399 break; 1400case 78: 1401 { 1403 yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String ) ((Token)yyVals[0+yyTop]).getValue()); 1404 } 1405 break; 1406case 79: 1407 { 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 ) ((Token)yyVals[0+yyTop]).getValue()), null); 1416 } 1417 break; 1418case 80: 1419 { 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 ) ((Token)yyVals[0+yyTop]).getValue()), null); 1428 } 1429 break; 1430case 81: 1431 { 1433 support.backrefAssignError(((Node)yyVals[0+yyTop])); 1434 } 1435 break; 1436case 82: 1437 { 1439 yyVal = support.assignable(((Token)yyVals[0+yyTop]), null); 1440 } 1441 break; 1442case 83: 1443 { 1445 yyVal = support.aryset(((Node)yyVals[-3+yyTop]), ((Node)yyVals[-1+yyTop])); 1446 } 1447 break; 1448case 84: 1449 { 1451 yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String ) ((Token)yyVals[0+yyTop]).getValue()); 1452 } 1453 break; 1454case 85: 1455 { 1457 yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String ) ((Token)yyVals[0+yyTop]).getValue()); 1458 } 1459 break; 1460case 86: 1461 { 1463 yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String ) ((Token)yyVals[0+yyTop]).getValue()); 1464 } 1465 break; 1466case 87: 1467 { 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 ) ((Token)yyVals[0+yyTop]).getValue()), null); 1476 } 1477 break; 1478case 88: 1479 { 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 ) ((Token)yyVals[0+yyTop]).getValue()), null); 1488 } 1489 break; 1490case 89: 1491 { 1493 support.backrefAssignError(((Node)yyVals[0+yyTop])); 1494 } 1495 break; 1496case 90: 1497 { 1499 yyerror("class/module name must be CONSTANT"); 1500 } 1501 break; 1502case 92: 1503 { 1505 yyVal = new Colon3Node(support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop])), (String ) ((Token)yyVals[0+yyTop]).getValue()); 1506 } 1507 break; 1508case 93: 1509 { 1511 yyVal = new Colon2Node(((Token)yyVals[0+yyTop]).getPosition(), null, (String ) ((Token)yyVals[0+yyTop]).getValue()); 1512 } 1513 break; 1514case 94: 1515 { 1517 yyVal = new Colon2Node(support.union(((Node)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), (String ) ((Token)yyVals[0+yyTop]).getValue()); 1518 } 1519 break; 1520case 98: 1521 { 1523 lexer.setState(LexState.EXPR_END); 1524 yyVal = ((Token)yyVals[0+yyTop]); 1525 } 1526 break; 1527case 99: 1528 { 1530 lexer.setState(LexState.EXPR_END); 1531 yyVal = yyVals[0+yyTop]; 1532 } 1533 break; 1534case 102: 1535 { 1537 yyVal = new UndefNode(getPosition(((Token)yyVals[0+yyTop])), (String ) ((Token)yyVals[0+yyTop]).getValue()); 1538 } 1539 break; 1540case 103: 1541 { 1543 lexer.setState(LexState.EXPR_FNAME); 1544 } 1545 break; 1546case 104: 1547 { 1549 yyVal = support.appendToBlock(((Node)yyVals[-3+yyTop]), new UndefNode(getPosition(((Node)yyVals[-3+yyTop])), (String ) ((Token)yyVals[0+yyTop]).getValue())); 1550 } 1551 break; 1552case 172: 1553 { 1555 yyVal = support.node_assign(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])); 1556 1557 ((Node)yyVal).setPosition(support.union(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]))); 1558 } 1559 break; 1560case 173: 1561 { 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 { 1570 support.checkExpression(((Node)yyVals[0+yyTop])); 1571 String name = ((INameNode)yyVals[-2+yyTop]).getName(); 1572 String asgnOp = (String ) ((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 { 1590 yyVal = new OpElementAsgnNode(getPosition(((Node)yyVals[-5+yyTop])), ((Node)yyVals[-5+yyTop]), (String ) ((Token)yyVals[-1+yyTop]).getValue(), ((Node)yyVals[-3+yyTop]), ((Node)yyVals[0+yyTop])); 1591 } 1592 break; 1593case 176: 1594 { 1596 yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String ) ((Token)yyVals[-2+yyTop]).getValue(), (String ) ((Token)yyVals[-1+yyTop]).getValue()); 1597 } 1598 break; 1599case 177: 1600 { 1602 yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String ) ((Token)yyVals[-2+yyTop]).getValue(), (String ) ((Token)yyVals[-1+yyTop]).getValue()); 1603 } 1604 break; 1605case 178: 1606 { 1608 yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String ) ((Token)yyVals[-2+yyTop]).getValue(), (String ) ((Token)yyVals[-1+yyTop]).getValue()); 1609 } 1610 break; 1611case 179: 1612 { 1614 yyerror("constant re-assignment"); 1615 } 1616 break; 1617case 180: 1618 { 1620 yyerror("constant re-assignment"); 1621 } 1622 break; 1623case 181: 1624 { 1626 support.backrefAssignError(((Node)yyVals[-2+yyTop])); 1627 } 1628 break; 1629case 182: 1630 { 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 { 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 { 1648 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "+", ((Node)yyVals[0+yyTop])); 1649 } 1650 break; 1651case 185: 1652 { 1654 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "-", ((Node)yyVals[0+yyTop])); 1655 } 1656 break; 1657case 186: 1658 { 1660 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "*", ((Node)yyVals[0+yyTop])); 1661 } 1662 break; 1663case 187: 1664 { 1666 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "/", ((Node)yyVals[0+yyTop])); 1667 } 1668 break; 1669case 188: 1670 { 1672 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "%", ((Node)yyVals[0+yyTop])); 1673 } 1674 break; 1675case 189: 1676 { 1678 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "**", ((Node)yyVals[0+yyTop])); 1679 } 1680 break; 1681case 190: 1682 { 1684 yyVal = support.getOperatorCallNode(support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "**", ((Node)yyVals[0+yyTop])), "-@"); 1685 } 1686 break; 1687case 191: 1688 { 1690 yyVal = support.getOperatorCallNode(support.getOperatorCallNode(((FloatNode)yyVals[-2+yyTop]), "**", ((Node)yyVals[0+yyTop])), "-@"); 1691 } 1692 break; 1693case 192: 1694 { 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 { 1706 yyVal = support.getOperatorCallNode(((Node)yyVals[0+yyTop]), "-@"); 1707 } 1708 break; 1709case 194: 1710 { 1712 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "|", ((Node)yyVals[0+yyTop])); 1713 } 1714 break; 1715case 195: 1716 { 1718 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "^", ((Node)yyVals[0+yyTop])); 1719 } 1720 break; 1721case 196: 1722 { 1724 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "&", ((Node)yyVals[0+yyTop])); 1725 } 1726 break; 1727case 197: 1728 { 1730 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "<=>", ((Node)yyVals[0+yyTop])); 1731 } 1732 break; 1733case 198: 1734 { 1736 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), ">", ((Node)yyVals[0+yyTop])); 1737 } 1738 break; 1739case 199: 1740 { 1742 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), ">=", ((Node)yyVals[0+yyTop])); 1743 } 1744 break; 1745case 200: 1746 { 1748 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "<", ((Node)yyVals[0+yyTop])); 1749 } 1750 break; 1751case 201: 1752 { 1754 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "<=", ((Node)yyVals[0+yyTop])); 1755 } 1756 break; 1757case 202: 1758 { 1760 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "==", ((Node)yyVals[0+yyTop])); 1761 } 1762 break; 1763case 203: 1764 { 1766 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "===", ((Node)yyVals[0+yyTop])); 1767 } 1768 break; 1769case 204: 1770 { 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 { 1778 yyVal = support.getMatchNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])); 1779 } 1780 break; 1781case 206: 1782 { 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 { 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 { 1796 yyVal = support.getOperatorCallNode(((Node)yyVals[0+yyTop]), "~"); 1797 } 1798 break; 1799case 209: 1800 { 1802 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "<<", ((Node)yyVals[0+yyTop])); 1803 } 1804 break; 1805case 210: 1806 { 1808 yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), ">>", ((Node)yyVals[0+yyTop])); 1809 } 1810 break; 1811case 211: 1812 { 1814 yyVal = support.newAndNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])); 1815 } 1816 break; 1817case 212: 1818 { 1820 yyVal = support.newOrNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])); 1821 } 1822 break; 1823case 213: 1824 { 1826 yyVal = new DefinedNode(getPosition(((Token)yyVals[-2+yyTop])), ((Node)yyVals[0+yyTop])); 1827 } 1828 break; 1829case 214: 1830 { 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 { 1838 yyVal = ((Node)yyVals[0+yyTop]); 1839 } 1840 break; 1841case 216: 1842 { 1844 support.checkExpression(((Node)yyVals[0+yyTop])); 1845 yyVal = ((Node)yyVals[0+yyTop]); 1846 } 1847 break; 1848case 218: 1849 { 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 { 1858 yyVal = ((ListNode)yyVals[-1+yyTop]); 1859 } 1860 break; 1861case 220: 1862 { 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 { 1871 yyVal = new ArrayNode(getPosition(((ListNode)yyVals[-1+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop]))); 1872 } 1873 break; 1874case 222: 1875 { 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 { 1884 yyVal = new ArrayNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]))); 1885 } 1886 break; 1887case 224: 1888 { 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 { 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 { 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 { 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 { 1918 yyVal = support.arg_blk_pass(((ListNode)yyVals[-1+yyTop]), ((BlockPassNode)yyVals[0+yyTop])); 1919 } 1920 break; 1921case 231: 1922 { 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 { 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 { 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 { 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 { 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 { 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 {} 1966 break; 1967case 238: 1968 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 {} 2044 break; 2045case 250: 2046 { 2048 yyVal = new Long (lexer.getCmdArgumentState().begin()); 2049 } 2050 break; 2051case 251: 2052 { 2054 lexer.getCmdArgumentState().reset(((Long )yyVals[-1+yyTop]).longValue()); 2055 yyVal = ((Node)yyVals[0+yyTop]); 2056 } 2057 break; 2058case 253: 2059 { 2061 lexer.setState(LexState.EXPR_ENDARG); 2062 } 2063 break; 2064case 254: 2065 { 2067 warnings.warn(getPosition(((Token)yyVals[-2+yyTop])), "don't put space before argument parentheses"); 2068 yyVal = null; 2069 } 2070 break; 2071case 255: 2072 { 2074 lexer.setState(LexState.EXPR_ENDARG); 2075 } 2076 break; 2077case 256: 2078 { 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 { 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 { 2094 yyVal = ((BlockPassNode)yyVals[0+yyTop]); 2095 } 2096 break; 2097case 260: 2098 { 2100 yyVal = new ArrayNode(getPosition2(((Node)yyVals[0+yyTop])), ((Node)yyVals[0+yyTop])); 2101 } 2102 break; 2103case 261: 2104 { 2106 yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[0+yyTop])); 2107 } 2108 break; 2109case 262: 2110 { 2112 yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[0+yyTop])); 2113 } 2114 break; 2115case 263: 2116 { 2118 yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-3+yyTop])), ((ListNode)yyVals[-3+yyTop]), ((Node)yyVals[0+yyTop])); 2119 } 2120 break; 2121case 264: 2122 { 2124 yyVal = new SplatNode(getPosition(((Token)yyVals[-1+yyTop])), ((Node)yyVals[0+yyTop])); 2125 } 2126 break; 2127case 273: 2128 { 2130 yyVal = new FCallNode(((Token)yyVals[0+yyTop]).getPosition(), (String ) ((Token)yyVals[0+yyTop]).getValue(), null); 2131 } 2132 break; 2133case 274: 2134 { 2136 yyVal = new BeginNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-1+yyTop])); 2137 } 2138 break; 2139case 275: 2140 { 2142 lexer.setState(LexState.EXPR_ENDARG); 2143 } 2144 break; 2145case 276: 2146 { 2148 warnings.warning(getPosition(((Token)yyVals[-4+yyTop])), "(...) interpreted as grouped expression"); 2149 yyVal = ((Node)yyVals[-3+yyTop]); 2150 } 2151 break; 2152case 277: 2153 { 2155 yyVal = ((Node)yyVals[-1+yyTop]); 2156 } 2157 break; 2158case 278: 2159 { 2161 yyVal = new Colon2Node(support.union(((Node)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), (String ) ((Token)yyVals[0+yyTop]).getValue()); 2162 } 2163 break; 2164case 279: 2165 { 2167 yyVal = new Colon3Node(support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop])), (String ) ((Token)yyVals[0+yyTop]).getValue()); 2168 } 2169 break; 2170case 280: 2171 { 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 { 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); 2186 } else { 2187 yyVal = ((Node)yyVals[-1+yyTop]); 2188 ((ISourcePositionHolder)yyVal).setPosition(position); 2189 } 2190 } 2191 break; 2192case 282: 2193 { 2195 yyVal = new HashNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((ListNode)yyVals[-1+yyTop])); 2196 } 2197 break; 2198case 283: 2199 { 2201 yyVal = new ReturnNode(((Token)yyVals[0+yyTop]).getPosition(), null); 2202 } 2203 break; 2204case 284: 2205 { 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 { 2213 yyVal = new YieldNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), null, false); 2214 } 2215 break; 2216case 286: 2217 { 2219 yyVal = new YieldNode(((Token)yyVals[0+yyTop]).getPosition(), null, false); 2220 } 2221 break; 2222case 287: 2223 { 2225 yyVal = new DefinedNode(getPosition(((Token)yyVals[-4+yyTop])), ((Node)yyVals[-1+yyTop])); 2226 } 2227 break; 2228case 288: 2229 { 2231 yyVal = new FCallNode(support.union(((Token)yyVals[-1+yyTop]), ((IterNode)yyVals[0+yyTop])), (String ) ((Token)yyVals[-1+yyTop]).getValue(), null, ((IterNode)yyVals[0+yyTop])); 2232 } 2233 break; 2234case 290: 2235 { 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 { 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 { 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 { 2260 lexer.getConditionState().begin(); 2261 } 2262 break; 2263case 294: 2264 { 2266 lexer.getConditionState().end(); 2267 } 2268 break; 2269case 295: 2270 { 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 { 2278 lexer.getConditionState().begin(); 2279 } 2280 break; 2281case 297: 2282 { 2284 lexer.getConditionState().end(); 2285 } 2286 break; 2287case 298: 2288 { 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 { 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 { 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 { 2308 yyVal = ((Node)yyVals[-1+yyTop]); 2309 } 2310 break; 2311case 302: 2312 { 2314 lexer.getConditionState().begin(); 2315 } 2316 break; 2317case 303: 2318 { 2320 lexer.getConditionState().end(); 2321 } 2322 break; 2323case 304: 2324 { 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 { 2332 if (support.isInDef() || support.isInSingle()) { 2333 yyerror("class definition in method body"); 2334 } 2335 support.pushLocalScope(); 2336 } 2337 break; 2338case 306: 2339 { 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 { 2348 yyVal = new Boolean (support.isInDef()); 2349 support.setInDef(false); 2350 } 2351 break; 2352case 308: 2353 { 2355 yyVal = new Integer (support.getInSingle()); 2356 support.setInSingle(0); 2357 support.pushLocalScope(); 2358 } 2359 break; 2360case 309: 2361 { 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 )yyVals[-4+yyTop]).booleanValue()); 2366 support.setInSingle(((Integer )yyVals[-2+yyTop]).intValue()); 2367 } 2368 break; 2369case 310: 2370 { 2372 if (support.isInDef() || support.isInSingle()) { 2373 yyerror("module definition in method body"); 2374 } 2375 support.pushLocalScope(); 2376 } 2377 break; 2378case 311: 2379 { 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 { 2388 support.setInDef(true); 2389 support.pushLocalScope(); 2390 } 2391 break; 2392case 313: 2393 { 2395 2396 yyVal = new DefnNode(support.union(((Token)yyVals[-5+yyTop]), ((Token)yyVals[0+yyTop])), new ArgumentNode(((Token)yyVals[-4+yyTop]).getPosition(), (String ) ((Token)yyVals[-4+yyTop]).getValue()), ((ArgsNode)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]), Visibility.PRIVATE); 2397 support.popCurrentScope(); 2398 support.setInDef(false); 2399 } 2400 break; 2401case 314: 2402 { 2404 lexer.setState(LexState.EXPR_FNAME); 2405 } 2406 break; 2407case 315: 2408 { 2410 support.setInSingle(support.getInSingle() + 1); 2411 support.pushLocalScope(); 2412 lexer.setState(LexState.EXPR_END); 2413 } 2414 break; 2415case 316: 2416 { 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 ) ((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 { 2426 yyVal = new BreakNode(((Token)yyVals[0+yyTop]).getPosition()); 2427 } 2428 break; 2429case 318: 2430 { 2432 yyVal = new NextNode(((Token)yyVals[0+yyTop]).getPosition()); 2433 } 2434 break; 2435case 319: 2436 { 2438 yyVal = new RedoNode(((Token)yyVals[0+yyTop]).getPosition()); 2439 } 2440 break; 2441case 320: 2442 { 2444 yyVal = new RetryNode(((Token)yyVals[0+yyTop]).getPosition()); 2445 } 2446 break; 2447case 321: 2448 { 2450 support.checkExpression(((Node)yyVals[0+yyTop])); 2451 yyVal = ((Node)yyVals[0+yyTop]); 2452 } 2453 break; 2454case 330: 2455 { 2457 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 { 2464 yyVal = ((Node)yyVals[0+yyTop]); 2465 } 2466 break; 2467case 334: 2468 {} 2470 break; 2471case 336: 2472 { 2474 yyVal = new ZeroArgNode(support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop]))); 2475 } 2476 break; 2477case 337: 2478 { 2480 yyVal = new ZeroArgNode(((Token)yyVals[0+yyTop]).getPosition()); 2481 } 2482 break; 2483case 338: 2484 { 2486 yyVal = ((Node)yyVals[-1+yyTop]); 2487 2488 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 { 2497 support.pushBlockScope(); 2498 } 2499 break; 2500case 340: 2501 { 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 { 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 { 2521 yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null); 2522 } 2523 break; 2524case 343: 2525 { 2527 yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null); 2528 } 2529 break; 2530case 344: 2531 { 2533 yyVal = support.new_fcall(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null); 2534 } 2535 break; 2536case 345: 2537 { 2539 yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null); 2540 } 2541 break; 2542case 346: 2543 { 2545 yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]), null); 2546 } 2547 break; 2548case 347: 2549 { 2551 yyVal = support.new_call(((Node)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]), null, null); 2552 } 2553 break; 2554case 348: 2555 { 2557 yyVal = support.new_super(((Node)yyVals[0+yyTop]), ((Token)yyVals[-1+yyTop])); 2558 } 2559 break; 2560case 349: 2561 { 2563 yyVal = new ZSuperNode(((Token)yyVals[0+yyTop]).getPosition()); 2564 } 2565 break; 2566case 350: 2567 { 2569 support.pushBlockScope(); 2570 } 2571 break; 2572case 351: 2573 { 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 { 2582 support.pushBlockScope(); 2583 } 2584 break; 2585case 353: 2586 { 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 { 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 { 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 { 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 { 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 {yyVal = null;} 2629 break; 2630case 362: 2631 { 2633 yyVal = new ArrayNode(((Node)yyVals[0+yyTop]).getPosition(), ((Node)yyVals[0+yyTop])); 2634 } 2635 break; 2636case 365: 2637 { 2639 yyVal = ((Node)yyVals[0+yyTop]); 2640 } 2641 break; 2642case 367: 2643 { 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 { 2655 yyVal = new SymbolNode(((Token)yyVals[0+yyTop]).getPosition(), (String ) ((Token)yyVals[0+yyTop]).getValue()); 2656 } 2657 break; 2658case 372: 2659 { 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 { 2671 yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])); 2672 } 2673 break; 2674case 375: 2675 { 2677 yyVal = ((Node)yyVals[-1+yyTop]); 2678 ((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]))); 2679 int extraLength = ((String ) ((Token)yyVals[-2+yyTop]).getValue()).length() - 1; 2680 2681 2682 2683 2684 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 { 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 { 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 { 2730 yyVal = new ZArrayNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]))); 2731 } 2732 break; 2733case 379: 2734 { 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 { 2743 yyVal = new ArrayNode(getPosition(null)); 2744 } 2745 break; 2746case 381: 2747 { 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 { 2755 yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])); 2756 } 2757 break; 2758case 384: 2759 { 2761 yyVal = new ZArrayNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]))); 2762 } 2763 break; 2764case 385: 2765 { 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 { 2774 yyVal = new ArrayNode(getPosition(null)); 2775 } 2776 break; 2777case 387: 2778 { 2780 yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[-1+yyTop])); 2781 } 2782 break; 2783case 388: 2784 { 2786 yyVal = new StrNode(((Token)yyVals[0+yyTop]).getPosition(), ByteList.create("")); 2787 } 2788 break; 2789case 389: 2790 { 2792 yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])); 2793 } 2794 break; 2795case 390: 2796 { 2798 yyVal = null; 2799 } 2800 break; 2801case 391: 2802 { 2804 yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])); 2805 } 2806 break; 2807case 392: 2808 { 2810 yyVal = ((Node)yyVals[0+yyTop]); 2811 } 2812 break; 2813case 393: 2814 { 2816 yyVal = lexer.getStrTerm(); 2817 lexer.setStrTerm(null); 2818 lexer.setState(LexState.EXPR_BEG); 2819 } 2820 break; 2821case 394: 2822 { 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 { 2831 yyVal = lexer.getStrTerm(); 2832 lexer.setStrTerm(null); 2833 lexer.setState(LexState.EXPR_BEG); 2834 } 2835 break; 2836case 396: 2837 { 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 { 2847 yyVal = new GlobalVarNode(((Token)yyVals[0+yyTop]).getPosition(), (String ) ((Token)yyVals[0+yyTop]).getValue()); 2848 } 2849 break; 2850case 398: 2851 { 2853 yyVal = new InstVarNode(((Token)yyVals[0+yyTop]).getPosition(), (String ) ((Token)yyVals[0+yyTop]).getValue()); 2854 } 2855 break; 2856case 399: 2857 { 2859 yyVal = new ClassVarNode(((Token)yyVals[0+yyTop]).getPosition(), (String ) ((Token)yyVals[0+yyTop]).getValue()); 2860 } 2861 break; 2862case 401: 2863 { 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 { 2873 lexer.setState(LexState.EXPR_END); 2874 2875 2876 2877 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 2890 2891 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 { 2903 yyVal = ((FloatNode)yyVals[0+yyTop]); 2904 } 2905 break; 2906case 409: 2907 { 2909 yyVal = support.negateInteger(((Node)yyVals[0+yyTop])); 2910 } 2911 break; 2912case 410: 2913 { 2915 yyVal = support.negateFloat(((FloatNode)yyVals[0+yyTop])); 2916 } 2917 break; 2918case 416: 2919 { 2921 yyVal = new Token("nil", ((Token)yyVals[0+yyTop]).getPosition()); 2922 } 2923 break; 2924case 417: 2925 { 2927 yyVal = new Token("self", ((Token)yyVals[0+yyTop]).getPosition()); 2928 } 2929 break; 2930case 418: 2931 { 2933 yyVal = new Token("true", ((Token)yyVals[0+yyTop]).getPosition()); 2934 } 2935 break; 2936case 419: 2937 { 2939 yyVal = new Token("false", ((Token)yyVals[0+yyTop]).getPosition()); 2940 } 2941 break; 2942case 420: 2943 { 2945 yyVal = new Token("__FILE__", ((Token)yyVals[0+yyTop]).getPosition()); 2946 } 2947 break; 2948case 421: 2949 { 2951 yyVal = new Token("__LINE__", ((Token)yyVals[0+yyTop]).getPosition()); 2952 } 2953 break; 2954case 422: 2955 { 2957 yyVal = support.gettable((String ) ((Token)yyVals[0+yyTop]).getValue(), ((Token)yyVals[0+yyTop]).getPosition()); 2958 } 2959 break; 2960case 423: 2961 { 2963 yyVal = support.assignable(((Token)yyVals[0+yyTop]), null); 2964 } 2965 break; 2966case 426: 2967 { 2969 yyVal = null; 2970 } 2971 break; 2972case 427: 2973 { 2975 lexer.setState(LexState.EXPR_BEG); 2976 } 2977 break; 2978case 428: 2979 { 2981 yyVal = ((Node)yyVals[-1+yyTop]); 2982 } 2983 break; 2984case 429: 2985 { 2987 yyerrok(); 2988 yyVal = null; 2989 } 2990 break; 2991case 430: 2992 { 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 { 3002 yyVal = ((Node)yyVals[-1+yyTop]); 3003 } 3004 break; 3005case 432: 3006 { 3008 yyVal = new ArgsNode(support.union(((ListNode)yyVals[-5+yyTop]), ((BlockArgNode)yyVals[0+yyTop])), ((ListNode)yyVals[-5+yyTop]), ((ListNode)yyVals[-3+yyTop]), ((Integer ) ((Token)yyVals[-1+yyTop]).getValue()).intValue(), ((BlockArgNode)yyVals[0+yyTop])); 3009 } 3010 break; 3011case 433: 3012 { 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 { 3020 yyVal = new ArgsNode(support.union(((ListNode)yyVals[-3+yyTop]), ((BlockArgNode)yyVals[0+yyTop])), ((ListNode)yyVals[-3+yyTop]), null, ((Integer ) ((Token)yyVals[-1+yyTop]).getValue()).intValue(), ((BlockArgNode)yyVals[0+yyTop])); 3021 } 3022 break; 3023case 435: 3024 { 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 { 3032 yyVal = new ArgsNode(getPosition(((ListNode)yyVals[-3+yyTop])), null, ((ListNode)yyVals[-3+yyTop]), ((Integer ) ((Token)yyVals[-1+yyTop]).getValue()).intValue(), ((BlockArgNode)yyVals[0+yyTop])); 3033 } 3034 break; 3035case 437: 3036 { 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 { 3044 yyVal = new ArgsNode(getPosition(((Token)yyVals[-1+yyTop])), null, null, ((Integer ) ((Token)yyVals[-1+yyTop]).getValue()).intValue(), ((BlockArgNode)yyVals[0+yyTop])); 3045 } 3046 break; 3047case 439: 3048 { 3050 yyVal = new ArgsNode(getPosition(((BlockArgNode)yyVals[0+yyTop])), null, null, -1, ((BlockArgNode)yyVals[0+yyTop])); 3051 } 3052 break; 3053case 440: 3054 { 3056 3057 yyVal = new ArgsNode(lexer.getPosition(), null, null, -1, null); 3058 } 3059 break; 3060case 441: 3061 { 3063 yyerror("formal argument cannot be a constant"); 3064 } 3065 break; 3066case 442: 3067 { 3069 yyerror("formal argument cannot be an instance variable"); 3070 } 3071 break; 3072case 443: 3073 { 3075 yyerror("formal argument cannot be a class variable"); 3076 } 3077 break; 3078case 444: 3079 { 3081 String identifier = (String ) ((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 { 3095 yyVal = new ListNode(((ISourcePositionHolder)yyVals[0+yyTop]).getPosition()); 3096 ((ListNode) yyVal).add(new ArgumentNode(((ISourcePositionHolder)yyVals[0+yyTop]).getPosition(), (String ) ((Token)yyVals[0+yyTop]).getValue())); 3097 } 3098 break; 3099case 446: 3100 { 3102 ((ListNode)yyVals[-2+yyTop]).add(new ArgumentNode(((ISourcePositionHolder)yyVals[0+yyTop]).getPosition(), (String ) ((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 { 3110 String identifier = (String ) ((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 { 3124 yyVal = new BlockNode(getPosition(((Node)yyVals[0+yyTop]))).add(((Node)yyVals[0+yyTop])); 3125 } 3126 break; 3127case 449: 3128 { 3130 yyVal = support.appendToBlock(((ListNode)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])); 3131 } 3132 break; 3133case 452: 3134 { 3136 String identifier = (String ) ((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 (support.getCurrentScope().getLocalScope().addVariable(identifier))); 3144 yyVal = ((Token)yyVals[-1+yyTop]); 3145 } 3146 break; 3147case 453: 3148 { 3150 ((Token)yyVals[0+yyTop]).setValue(new Integer (-2)); 3151 yyVal = ((Token)yyVals[0+yyTop]); 3152 } 3153 break; 3154case 456: 3155 { 3157 String identifier = (String ) ((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 { 3170 yyVal = ((BlockArgNode)yyVals[0+yyTop]); 3171 } 3172 break; 3173case 458: 3174 { 3176 yyVal = null; 3177 } 3178 break; 3179case 459: 3180 { 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 { 3191 lexer.setState(LexState.EXPR_BEG); 3192 } 3193 break; 3194case 461: 3195 { 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 { 3207 yyVal = new ArrayNode(getPosition(null)); 3208 } 3209 break; 3210case 463: 3211 { 3213 yyVal = ((ListNode)yyVals[-1+yyTop]); 3214 } 3215 break; 3216case 464: 3217 { 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 { 3228 yyVal = ((ListNode)yyVals[-2+yyTop]).addAll(((ListNode)yyVals[0+yyTop])); 3229 } 3230 break; 3231case 467: 3232 { 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 { 3240 yyerrok(); 3241 } 3242 break; 3243case 490: 3244 { 3246 yyerrok(); 3247 } 3248 break; 3249case 491: 3250 { 3252 yyVal = null; 3253 } 3254 break; 3255case 492: 3256 { 3258 yyVal = null; 3259 } 3260 break; 3261 } 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 3288 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, null); 3302 } catch (IOException e) { 3303 e.printStackTrace(); 3304 } catch (yyException e) { 3305 e.printStackTrace(); 3306 } 3307 3308 return support.getResult(); 3309 } 3310 3311 3314 void yyerrok() {} 3315 3316 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 | Popular Tags |