Changeset 2522 in webkit for trunk/JavaScriptCore/kjs/grammar.cpp
- Timestamp:
- Oct 31, 2002, 11:12:39 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/grammar.cpp
r2519 r2522 112 112 #define YYDEBUG 0 113 113 #define YYMAXDEPTH 0 114 #ifdef APPLE_CHANGES 115 #else 114 #if !APPLE_CHANGES 116 115 #define YYERROR_VERBOSE 117 116 #endif … … 125 124 126 125 127 #line 5 3"grammar.y"126 #line 52 "grammar.y" 128 127 typedef union { 129 128 int ival; … … 315 314 #if YYDEBUG != 0 316 315 static const short yyrline[] = { 0, 317 1 60, 162, 163, 164, 165, 166, 169, 175, 177, 179,318 1 80, 181, 182, 183, 186, 188, 189, 192, 194, 198,319 200, 203, 205, 208, 210, 214, 217, 218, 221, 223,320 22 4, 225, 227, 230, 232, 235, 237, 238, 239, 243,321 24 5, 248, 250, 253, 255, 258, 260, 261, 264, 266,322 26 7, 268, 269, 270, 271, 272, 273, 274, 275, 276,323 27 9, 281, 282, 283, 286, 288, 289, 292, 294, 295,324 29 6, 299, 301, 303, 305, 307, 309, 311, 315, 317,325 31 8, 319, 320, 323, 325, 328, 330, 333, 335, 338,326 3 40, 344, 346, 350, 352, 356, 358, 362, 364, 365,327 36 6, 367, 368, 369, 370, 371, 372, 373, 374, 377,328 37 9, 382, 384, 385, 386, 387, 388, 389, 390, 391,329 39 2, 393, 394, 395, 396, 399, 401, 404, 406, 409,330 41 2, 421, 423, 427, 429, 432, 436, 440, 443, 450,331 45 2, 456, 458, 459, 462, 465, 468, 472, 478, 480,332 48 3, 485, 489, 491, 498, 500, 504, 506, 514, 516,333 5 20, 521, 527, 532, 537, 539, 543, 545, 548, 550,334 55 3, 555, 558, 560, 563, 569, 573, 575, 576, 579,335 58 3, 587, 590, 594, 596, 601, 603, 607, 610, 614,336 61 7, 621, 624, 630, 632316 159, 161, 162, 163, 164, 165, 168, 174, 176, 178, 317 179, 180, 181, 182, 185, 187, 188, 191, 193, 197, 318 199, 202, 204, 207, 209, 213, 216, 217, 220, 222, 319 223, 224, 226, 229, 231, 234, 236, 237, 238, 242, 320 244, 247, 249, 252, 254, 257, 259, 260, 263, 265, 321 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 322 278, 280, 281, 282, 285, 287, 288, 291, 293, 294, 323 295, 298, 300, 302, 304, 306, 308, 310, 314, 316, 324 317, 318, 319, 322, 324, 327, 329, 332, 334, 337, 325 339, 343, 345, 349, 351, 355, 357, 361, 363, 364, 326 365, 366, 367, 368, 369, 370, 371, 372, 373, 376, 327 378, 381, 383, 384, 385, 386, 387, 388, 389, 390, 328 391, 392, 393, 394, 395, 398, 400, 403, 405, 408, 329 411, 420, 422, 426, 428, 431, 435, 439, 442, 449, 330 451, 455, 457, 458, 461, 464, 467, 471, 477, 479, 331 482, 484, 488, 490, 497, 499, 503, 505, 513, 515, 332 519, 520, 526, 531, 536, 538, 542, 544, 547, 549, 333 552, 554, 557, 559, 562, 568, 572, 574, 575, 578, 334 582, 586, 589, 593, 595, 600, 602, 606, 609, 613, 335 616, 620, 623, 629, 631 337 336 }; 338 337 #endif … … 1293 1292 1294 1293 case 1: 1294 #line 160 "grammar.y" 1295 { yyval.node = new NullNode(); ; 1296 break;} 1297 case 2: 1295 1298 #line 161 "grammar.y" 1296 { yyval.node = new NullNode(); ;1297 break;} 1298 case 2:1299 { yyval.node = new BooleanNode(true); ; 1300 break;} 1301 case 3: 1299 1302 #line 162 "grammar.y" 1300 { yyval.node = new BooleanNode( true); ;1301 break;} 1302 case 3:1303 { yyval.node = new BooleanNode(false); ; 1304 break;} 1305 case 4: 1303 1306 #line 163 "grammar.y" 1304 { yyval.node = new BooleanNode(false); ;1305 break;} 1306 case 4:1307 { yyval.node = new NumberNode(yyvsp[0].dval); ; 1308 break;} 1309 case 5: 1307 1310 #line 164 "grammar.y" 1308 { yyval.node = new NumberNode(yyvsp[0].dval); ;1309 break;} 1310 case 5:1311 { yyval.node = new StringNode(yyvsp[0].ustr); delete yyvsp[0].ustr; ; 1312 break;} 1313 case 6: 1311 1314 #line 165 "grammar.y" 1312 { yyval.node = new StringNode(yyvsp[0].ustr); delete yyvsp[0].ustr; ;1313 break;}1314 case 6:1315 #line 166 "grammar.y"1316 1315 { Lexer *l = Lexer::curr(); 1317 1316 if (!l->scanRegExp()) YYABORT; … … 1319 1318 break;} 1320 1319 case 7: 1321 #line 1 70"grammar.y"1320 #line 169 "grammar.y" 1322 1321 { Lexer *l = Lexer::curr(); 1323 1322 if (!l->scanRegExp()) YYABORT; … … 1325 1324 break;} 1326 1325 case 8: 1326 #line 175 "grammar.y" 1327 { yyval.node = new ThisNode(); ; 1328 break;} 1329 case 9: 1327 1330 #line 176 "grammar.y" 1328 { yyval.node = new ThisNode(); ;1329 break;}1330 case 9:1331 #line 177 "grammar.y"1332 1331 { yyval.node = new ResolveNode(yyvsp[0].ustr); 1333 1332 delete yyvsp[0].ustr; ; 1334 1333 break;} 1335 1334 case 12: 1335 #line 180 "grammar.y" 1336 { yyval.node = new GroupNode(yyvsp[-1].node); ; 1337 break;} 1338 case 13: 1336 1339 #line 181 "grammar.y" 1337 { yyval.node = new GroupNode(yyvsp[-1].node); ;1338 break;} 1339 case 1 3:1340 { yyval.node = new ObjectLiteralNode(0L); ; 1341 break;} 1342 case 14: 1340 1343 #line 182 "grammar.y" 1341 { yyval.node = new ObjectLiteralNode(0L); ;1342 break;}1343 case 14:1344 #line 183 "grammar.y"1345 1344 { yyval.node = new ObjectLiteralNode(yyvsp[-1].node); ; 1346 1345 break;} 1347 1346 case 15: 1347 #line 186 "grammar.y" 1348 { yyval.node = new ArrayNode(yyvsp[-1].eli); ; 1349 break;} 1350 case 16: 1348 1351 #line 187 "grammar.y" 1349 { yyval.node = new ArrayNode(yyvsp[-1].el i); ;1350 break;} 1351 case 1 6:1352 { yyval.node = new ArrayNode(yyvsp[-1].elm); ; 1353 break;} 1354 case 17: 1352 1355 #line 188 "grammar.y" 1353 { yyval.node = new ArrayNode(yyvsp[-1].elm); ;1354 break;}1355 case 17:1356 #line 189 "grammar.y"1357 1356 { yyval.node = new ArrayNode(yyvsp[-1].eli, yyvsp[-3].elm); ; 1358 1357 break;} 1359 1358 case 18: 1360 #line 19 3"grammar.y"1359 #line 192 "grammar.y" 1361 1360 { yyval.elm = new ElementNode(yyvsp[-1].eli, yyvsp[0].node); ; 1362 1361 break;} 1363 1362 case 19: 1364 #line 19 5"grammar.y"1363 #line 194 "grammar.y" 1365 1364 { yyval.elm = new ElementNode(yyvsp[-3].elm, yyvsp[-1].eli, yyvsp[0].node); ; 1366 1365 break;} 1367 1366 case 20: 1368 #line 19 9"grammar.y"1367 #line 198 "grammar.y" 1369 1368 { yyval.eli = 0L; ; 1370 1369 break;} 1371 1370 case 22: 1371 #line 203 "grammar.y" 1372 { yyval.eli = new ElisionNode(0L); ; 1373 break;} 1374 case 23: 1372 1375 #line 204 "grammar.y" 1373 { yyval.eli = new ElisionNode(0L); ;1374 break;}1375 case 23:1376 #line 205 "grammar.y"1377 1376 { yyval.eli = new ElisionNode(yyvsp[-1].eli); ; 1378 1377 break;} 1379 1378 case 24: 1380 #line 20 9"grammar.y"1379 #line 208 "grammar.y" 1381 1380 { yyval.node = new PropertyValueNode(yyvsp[-2].node, yyvsp[0].node); ; 1382 1381 break;} 1383 1382 case 25: 1384 #line 21 1"grammar.y"1383 #line 210 "grammar.y" 1385 1384 { yyval.node = new PropertyValueNode(yyvsp[-2].node, yyvsp[0].node, yyvsp[-4].node); ; 1386 1385 break;} 1387 1386 case 26: 1388 #line 21 5"grammar.y"1387 #line 214 "grammar.y" 1389 1388 { yyval.node = new PropertyNode(yyvsp[0].ustr); 1390 1389 delete yyvsp[0].ustr; ; 1391 1390 break;} 1392 1391 case 27: 1392 #line 216 "grammar.y" 1393 { yyval.node = new PropertyNode(yyvsp[0].ustr); delete yyvsp[0].ustr; ; 1394 break;} 1395 case 28: 1393 1396 #line 217 "grammar.y" 1394 { yyval.node = new PropertyNode(yyvsp[0].ustr); delete yyvsp[0].ustr; ;1395 break;}1396 case 28:1397 #line 218 "grammar.y"1398 1397 { yyval.node = new PropertyNode(yyvsp[0].dval); ; 1399 1398 break;} 1400 1399 case 31: 1400 #line 223 "grammar.y" 1401 { yyval.node = new AccessorNode1(yyvsp[-3].node, yyvsp[-1].node); ; 1402 break;} 1403 case 32: 1401 1404 #line 224 "grammar.y" 1402 { yyval.node = new AccessorNode1(yyvsp[-3].node, yyvsp[-1].node); ;1403 break;}1404 case 32:1405 #line 225 "grammar.y"1406 1405 { yyval.node = new AccessorNode2(yyvsp[-2].node, yyvsp[0].ustr); 1407 1406 delete yyvsp[0].ustr; ; 1408 1407 break;} 1409 1408 case 33: 1410 #line 22 7"grammar.y"1409 #line 226 "grammar.y" 1411 1410 { yyval.node = new NewExprNode(yyvsp[-1].node, yyvsp[0].args); ; 1412 1411 break;} 1413 1412 case 35: 1414 #line 23 2"grammar.y"1413 #line 231 "grammar.y" 1415 1414 { yyval.node = new NewExprNode(yyvsp[0].node); ; 1416 1415 break;} 1417 1416 case 36: 1417 #line 235 "grammar.y" 1418 { yyval.node = new FunctionCallNode(yyvsp[-1].node, yyvsp[0].args); ; 1419 break;} 1420 case 37: 1418 1421 #line 236 "grammar.y" 1419 1422 { yyval.node = new FunctionCallNode(yyvsp[-1].node, yyvsp[0].args); ; 1420 1423 break;} 1421 case 3 7:1424 case 38: 1422 1425 #line 237 "grammar.y" 1423 { yyval.node = new FunctionCallNode(yyvsp[-1].node, yyvsp[0].args); ;1424 break;} 1425 case 3 8:1426 { yyval.node = new AccessorNode1(yyvsp[-3].node, yyvsp[-1].node); ; 1427 break;} 1428 case 39: 1426 1429 #line 238 "grammar.y" 1427 { yyval.node = new AccessorNode1(yyvsp[-3].node, yyvsp[-1].node); ;1428 break;}1429 case 39:1430 #line 239 "grammar.y"1431 1430 { yyval.node = new AccessorNode2(yyvsp[-2].node, yyvsp[0].ustr); 1432 1431 delete yyvsp[0].ustr; ; 1433 1432 break;} 1434 1433 case 40: 1434 #line 243 "grammar.y" 1435 { yyval.args = new ArgumentsNode(0L); ; 1436 break;} 1437 case 41: 1435 1438 #line 244 "grammar.y" 1436 { yyval.args = new ArgumentsNode(0L); ;1437 break;}1438 case 41:1439 #line 245 "grammar.y"1440 1439 { yyval.args = new ArgumentsNode(yyvsp[-1].alist); ; 1441 1440 break;} 1442 1441 case 42: 1442 #line 248 "grammar.y" 1443 { yyval.alist = new ArgumentListNode(yyvsp[0].node); ; 1444 break;} 1445 case 43: 1443 1446 #line 249 "grammar.y" 1444 { yyval.alist = new ArgumentListNode(yyvsp[0].node); ;1445 break;}1446 case 43:1447 #line 250 "grammar.y"1448 1447 { yyval.alist = new ArgumentListNode(yyvsp[-2].alist, yyvsp[0].node); ; 1449 1448 break;} 1450 1449 case 47: 1450 #line 259 "grammar.y" 1451 { yyval.node = new PostfixNode(yyvsp[-1].node, OpPlusPlus); ; 1452 break;} 1453 case 48: 1451 1454 #line 260 "grammar.y" 1452 { yyval.node = new PostfixNode(yyvsp[-1].node, OpPlusPlus); ;1453 break;}1454 case 48:1455 #line 261 "grammar.y"1456 1455 { yyval.node = new PostfixNode(yyvsp[-1].node, OpMinusMinus); ; 1457 1456 break;} 1458 1457 case 50: 1458 #line 265 "grammar.y" 1459 { yyval.node = new DeleteNode(yyvsp[0].node); ; 1460 break;} 1461 case 51: 1459 1462 #line 266 "grammar.y" 1460 { yyval.node = new DeleteNode(yyvsp[0].node); ;1461 break;} 1462 case 5 1:1463 { yyval.node = new VoidNode(yyvsp[0].node); ; 1464 break;} 1465 case 52: 1463 1466 #line 267 "grammar.y" 1464 { yyval.node = new VoidNode(yyvsp[0].node); ;1465 break;} 1466 case 5 2:1467 { yyval.node = new TypeOfNode(yyvsp[0].node); ; 1468 break;} 1469 case 53: 1467 1470 #line 268 "grammar.y" 1468 { yyval.node = new TypeOfNode(yyvsp[0].node); ;1469 break;} 1470 case 5 3:1471 { yyval.node = new PrefixNode(OpPlusPlus, yyvsp[0].node); ; 1472 break;} 1473 case 54: 1471 1474 #line 269 "grammar.y" 1472 1475 { yyval.node = new PrefixNode(OpPlusPlus, yyvsp[0].node); ; 1473 1476 break;} 1474 case 5 4:1477 case 55: 1475 1478 #line 270 "grammar.y" 1476 { yyval.node = new PrefixNode(Op PlusPlus, yyvsp[0].node); ;1477 break;} 1478 case 5 5:1479 { yyval.node = new PrefixNode(OpMinusMinus, yyvsp[0].node); ; 1480 break;} 1481 case 56: 1479 1482 #line 271 "grammar.y" 1480 1483 { yyval.node = new PrefixNode(OpMinusMinus, yyvsp[0].node); ; 1481 1484 break;} 1482 case 5 6:1485 case 57: 1483 1486 #line 272 "grammar.y" 1484 { yyval.node = new PrefixNode(OpMinusMinus,yyvsp[0].node); ;1485 break;} 1486 case 5 7:1487 { yyval.node = new UnaryPlusNode(yyvsp[0].node); ; 1488 break;} 1489 case 58: 1487 1490 #line 273 "grammar.y" 1488 { yyval.node = new UnaryPlusNode(yyvsp[0].node); ;1489 break;} 1490 case 5 8:1491 { yyval.node = new NegateNode(yyvsp[0].node); ; 1492 break;} 1493 case 59: 1491 1494 #line 274 "grammar.y" 1492 { yyval.node = new NegateNode(yyvsp[0].node); ;1493 break;} 1494 case 59:1495 { yyval.node = new BitwiseNotNode(yyvsp[0].node); ; 1496 break;} 1497 case 60: 1495 1498 #line 275 "grammar.y" 1496 { yyval.node = new BitwiseNotNode(yyvsp[0].node); ;1497 break;}1498 case 60:1499 #line 276 "grammar.y"1500 1499 { yyval.node = new LogicalNotNode(yyvsp[0].node); ; 1501 1500 break;} 1502 1501 case 62: 1502 #line 280 "grammar.y" 1503 { yyval.node = new MultNode(yyvsp[-2].node, yyvsp[0].node, '*'); ; 1504 break;} 1505 case 63: 1503 1506 #line 281 "grammar.y" 1504 { yyval.node = new MultNode(yyvsp[-2].node, yyvsp[0].node, ' *'); ;1505 break;} 1506 case 6 3:1507 { yyval.node = new MultNode(yyvsp[-2].node, yyvsp[0].node, '/'); ; 1508 break;} 1509 case 64: 1507 1510 #line 282 "grammar.y" 1508 { yyval.node = new MultNode(yyvsp[-2].node, yyvsp[0].node, '/'); ;1509 break;}1510 case 64:1511 #line 283 "grammar.y"1512 1511 { yyval.node = new MultNode(yyvsp[-2].node,yyvsp[0].node,'%'); ; 1513 1512 break;} 1514 1513 case 66: 1514 #line 287 "grammar.y" 1515 { yyval.node = new AddNode(yyvsp[-2].node, yyvsp[0].node, '+'); ; 1516 break;} 1517 case 67: 1515 1518 #line 288 "grammar.y" 1516 { yyval.node = new AddNode(yyvsp[-2].node, yyvsp[0].node, '+'); ;1517 break;}1518 case 67:1519 #line 289 "grammar.y"1520 1519 { yyval.node = new AddNode(yyvsp[-2].node, yyvsp[0].node, '-'); ; 1521 1520 break;} 1522 1521 case 69: 1522 #line 293 "grammar.y" 1523 { yyval.node = new ShiftNode(yyvsp[-2].node, OpLShift, yyvsp[0].node); ; 1524 break;} 1525 case 70: 1523 1526 #line 294 "grammar.y" 1524 { yyval.node = new ShiftNode(yyvsp[-2].node, Op LShift, yyvsp[0].node); ;1525 break;} 1526 case 7 0:1527 { yyval.node = new ShiftNode(yyvsp[-2].node, OpRShift, yyvsp[0].node); ; 1528 break;} 1529 case 71: 1527 1530 #line 295 "grammar.y" 1528 { yyval.node = new ShiftNode(yyvsp[-2].node, OpRShift, yyvsp[0].node); ;1529 break;}1530 case 71:1531 #line 296 "grammar.y"1532 1531 { yyval.node = new ShiftNode(yyvsp[-2].node, OpURShift, yyvsp[0].node); ; 1533 1532 break;} 1534 1533 case 73: 1535 #line 30 2"grammar.y"1534 #line 301 "grammar.y" 1536 1535 { yyval.node = new RelationalNode(yyvsp[-2].node, OpLess, yyvsp[0].node); ; 1537 1536 break;} 1538 1537 case 74: 1539 #line 30 4"grammar.y"1538 #line 303 "grammar.y" 1540 1539 { yyval.node = new RelationalNode(yyvsp[-2].node, OpGreater, yyvsp[0].node); ; 1541 1540 break;} 1542 1541 case 75: 1543 #line 30 6"grammar.y"1542 #line 305 "grammar.y" 1544 1543 { yyval.node = new RelationalNode(yyvsp[-2].node, OpLessEq, yyvsp[0].node); ; 1545 1544 break;} 1546 1545 case 76: 1547 #line 30 8"grammar.y"1546 #line 307 "grammar.y" 1548 1547 { yyval.node = new RelationalNode(yyvsp[-2].node, OpGreaterEq, yyvsp[0].node); ; 1549 1548 break;} 1550 1549 case 77: 1551 #line 3 10"grammar.y"1550 #line 309 "grammar.y" 1552 1551 { yyval.node = new RelationalNode(yyvsp[-2].node, OpInstanceOf, yyvsp[0].node); ; 1553 1552 break;} 1554 1553 case 78: 1555 #line 31 2"grammar.y"1554 #line 311 "grammar.y" 1556 1555 { yyval.node = new RelationalNode(yyvsp[-2].node, OpIn, yyvsp[0].node); ; 1557 1556 break;} 1558 1557 case 80: 1558 #line 316 "grammar.y" 1559 { yyval.node = new EqualNode(yyvsp[-2].node, OpEqEq, yyvsp[0].node); ; 1560 break;} 1561 case 81: 1559 1562 #line 317 "grammar.y" 1560 { yyval.node = new EqualNode(yyvsp[-2].node, Op EqEq, yyvsp[0].node); ;1561 break;} 1562 case 8 1:1563 { yyval.node = new EqualNode(yyvsp[-2].node, OpNotEq, yyvsp[0].node); ; 1564 break;} 1565 case 82: 1563 1566 #line 318 "grammar.y" 1564 { yyval.node = new EqualNode(yyvsp[-2].node, Op NotEq, yyvsp[0].node); ;1565 break;} 1566 case 8 2:1567 { yyval.node = new EqualNode(yyvsp[-2].node, OpStrEq, yyvsp[0].node); ; 1568 break;} 1569 case 83: 1567 1570 #line 319 "grammar.y" 1568 { yyval.node = new EqualNode(yyvsp[-2].node, OpStrEq, yyvsp[0].node); ;1569 break;}1570 case 83:1571 #line 320 "grammar.y"1572 1571 { yyval.node = new EqualNode(yyvsp[-2].node, OpStrNEq, yyvsp[0].node);; 1573 1572 break;} 1574 1573 case 85: 1575 #line 32 5"grammar.y"1574 #line 324 "grammar.y" 1576 1575 { yyval.node = new BitOperNode(yyvsp[-2].node, OpBitAnd, yyvsp[0].node); ; 1577 1576 break;} 1578 1577 case 87: 1579 #line 3 30"grammar.y"1578 #line 329 "grammar.y" 1580 1579 { yyval.node = new BitOperNode(yyvsp[-2].node, OpBitXOr, yyvsp[0].node); ; 1581 1580 break;} 1582 1581 case 89: 1583 #line 33 5"grammar.y"1582 #line 334 "grammar.y" 1584 1583 { yyval.node = new BitOperNode(yyvsp[-2].node, OpBitOr, yyvsp[0].node); ; 1585 1584 break;} 1586 1585 case 91: 1587 #line 34 1"grammar.y"1586 #line 340 "grammar.y" 1588 1587 { yyval.node = new BinaryLogicalNode(yyvsp[-2].node, OpAnd, yyvsp[0].node); ; 1589 1588 break;} 1590 1589 case 93: 1591 #line 34 7"grammar.y"1590 #line 346 "grammar.y" 1592 1591 { yyval.node = new BinaryLogicalNode(yyvsp[-2].node, OpOr, yyvsp[0].node); ; 1593 1592 break;} 1594 1593 case 95: 1595 #line 35 3"grammar.y"1594 #line 352 "grammar.y" 1596 1595 { yyval.node = new ConditionalNode(yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); ; 1597 1596 break;} 1598 1597 case 97: 1599 #line 35 9"grammar.y"1598 #line 358 "grammar.y" 1600 1599 { yyval.node = new AssignNode(yyvsp[-2].node, yyvsp[-1].op, yyvsp[0].node);; 1601 1600 break;} 1602 1601 case 98: 1602 #line 362 "grammar.y" 1603 { yyval.op = OpEqual; ; 1604 break;} 1605 case 99: 1603 1606 #line 363 "grammar.y" 1604 { yyval.op = Op Equal; ;1605 break;} 1606 case 99:1607 { yyval.op = OpPlusEq; ; 1608 break;} 1609 case 100: 1607 1610 #line 364 "grammar.y" 1608 { yyval.op = Op PlusEq; ;1609 break;} 1610 case 10 0:1611 { yyval.op = OpMinusEq; ; 1612 break;} 1613 case 101: 1611 1614 #line 365 "grammar.y" 1612 { yyval.op = OpM inusEq; ;1613 break;} 1614 case 10 1:1615 { yyval.op = OpMultEq; ; 1616 break;} 1617 case 102: 1615 1618 #line 366 "grammar.y" 1616 { yyval.op = Op MultEq; ;1617 break;} 1618 case 10 2:1619 { yyval.op = OpDivEq; ; 1620 break;} 1621 case 103: 1619 1622 #line 367 "grammar.y" 1620 { yyval.op = Op DivEq; ;1621 break;} 1622 case 10 3:1623 { yyval.op = OpLShift; ; 1624 break;} 1625 case 104: 1623 1626 #line 368 "grammar.y" 1624 { yyval.op = Op LShift; ;1625 break;} 1626 case 10 4:1627 { yyval.op = OpRShift; ; 1628 break;} 1629 case 105: 1627 1630 #line 369 "grammar.y" 1628 { yyval.op = Op RShift; ;1629 break;} 1630 case 10 5:1631 { yyval.op = OpURShift; ; 1632 break;} 1633 case 106: 1631 1634 #line 370 "grammar.y" 1632 { yyval.op = Op URShift; ;1633 break;} 1634 case 10 6:1635 { yyval.op = OpAndEq; ; 1636 break;} 1637 case 107: 1635 1638 #line 371 "grammar.y" 1636 { yyval.op = Op AndEq; ;1637 break;} 1638 case 10 7:1639 { yyval.op = OpXOrEq; ; 1640 break;} 1641 case 108: 1639 1642 #line 372 "grammar.y" 1640 { yyval.op = Op XOrEq; ;1641 break;} 1642 case 10 8:1643 { yyval.op = OpOrEq; ; 1644 break;} 1645 case 109: 1643 1646 #line 373 "grammar.y" 1644 { yyval.op = OpOrEq; ;1645 break;}1646 case 109:1647 #line 374 "grammar.y"1648 1647 { yyval.op = OpModEq; ; 1649 1648 break;} 1650 1649 case 111: 1651 #line 37 9"grammar.y"1650 #line 378 "grammar.y" 1652 1651 { yyval.node = new CommaNode(yyvsp[-2].node, yyvsp[0].node); ; 1653 1652 break;} 1654 1653 case 126: 1654 #line 399 "grammar.y" 1655 { yyval.stat = new BlockNode(0L); DBG(yyval.stat, yylsp[0], yylsp[0]); ; 1656 break;} 1657 case 127: 1655 1658 #line 400 "grammar.y" 1656 { yyval.stat = new BlockNode(0L); DBG(yyval.stat, yylsp[0], yylsp[0]); ;1657 break;}1658 case 127:1659 #line 401 "grammar.y"1660 1659 { yyval.stat = new BlockNode(yyvsp[-1].srcs); DBG(yyval.stat, yylsp[0], yylsp[0]); ; 1661 1660 break;} 1662 1661 case 128: 1662 #line 404 "grammar.y" 1663 { yyval.slist = new StatListNode(yyvsp[0].stat); ; 1664 break;} 1665 case 129: 1663 1666 #line 405 "grammar.y" 1664 { yyval.slist = new StatListNode(yyvsp[0].stat); ;1665 break;}1666 case 129:1667 #line 406 "grammar.y"1668 1667 { yyval.slist = new StatListNode(yyvsp[-1].slist, yyvsp[0].stat); ; 1669 1668 break;} 1670 1669 case 130: 1671 #line 4 10"grammar.y"1670 #line 409 "grammar.y" 1672 1671 { yyval.stat = new VarStatementNode(yyvsp[-1].vlist); 1673 1672 DBG(yyval.stat, yylsp[-2], yylsp[0]); ; 1674 1673 break;} 1675 1674 case 131: 1676 #line 41 2"grammar.y"1675 #line 411 "grammar.y" 1677 1676 { if (automatic()) { 1678 1677 yyval.stat = new VarStatementNode(yyvsp[-1].vlist); … … 1684 1683 break;} 1685 1684 case 132: 1686 #line 42 2"grammar.y"1685 #line 421 "grammar.y" 1687 1686 { yyval.vlist = new VarDeclListNode(yyvsp[0].decl); ; 1688 1687 break;} 1689 1688 case 133: 1690 #line 42 4"grammar.y"1689 #line 423 "grammar.y" 1691 1690 { yyval.vlist = new VarDeclListNode(yyvsp[-2].vlist, yyvsp[0].decl); ; 1692 1691 break;} 1693 1692 case 134: 1693 #line 427 "grammar.y" 1694 { yyval.decl = new VarDeclNode(yyvsp[0].ustr, 0); delete yyvsp[0].ustr; ; 1695 break;} 1696 case 135: 1694 1697 #line 428 "grammar.y" 1695 { yyval.decl = new VarDeclNode(yyvsp[0].ustr, 0); delete yyvsp[0].ustr; ;1696 break;}1697 case 135:1698 #line 429 "grammar.y"1699 1698 { yyval.decl = new VarDeclNode(yyvsp[-1].ustr, yyvsp[0].init); delete yyvsp[-1].ustr; ; 1700 1699 break;} 1701 1700 case 136: 1702 #line 43 3"grammar.y"1701 #line 432 "grammar.y" 1703 1702 { yyval.init = new AssignExprNode(yyvsp[0].node); ; 1704 1703 break;} 1705 1704 case 137: 1706 #line 43 7"grammar.y"1705 #line 436 "grammar.y" 1707 1706 { yyval.stat = new EmptyStatementNode(); ; 1708 1707 break;} 1709 1708 case 138: 1710 #line 44 1"grammar.y"1709 #line 440 "grammar.y" 1711 1710 { yyval.stat = new ExprStatementNode(yyvsp[-1].node); 1712 1711 DBG(yyval.stat, yylsp[-1], yylsp[0]); ; 1713 1712 break;} 1714 1713 case 139: 1715 #line 44 3"grammar.y"1714 #line 442 "grammar.y" 1716 1715 { if (automatic()) { 1717 1716 yyval.stat = new ExprStatementNode(yyvsp[-1].node); … … 1721 1720 break;} 1722 1721 case 140: 1723 #line 45 1"grammar.y"1722 #line 450 "grammar.y" 1724 1723 { yyval.stat = new IfNode(yyvsp[-2].node,yyvsp[0].stat,0L);DBG(yyval.stat,yylsp[-4],yylsp[-1]); ; 1725 1724 break;} 1726 1725 case 141: 1727 #line 45 3"grammar.y"1726 #line 452 "grammar.y" 1728 1727 { yyval.stat = new IfNode(yyvsp[-4].node,yyvsp[-2].stat,yyvsp[0].stat);DBG(yyval.stat,yylsp[-6],yylsp[-3]); ; 1729 1728 break;} 1730 1729 case 142: 1730 #line 456 "grammar.y" 1731 { yyval.stat=new DoWhileNode(yyvsp[-4].stat,yyvsp[-1].node);DBG(yyval.stat,yylsp[-5],yylsp[-3]);; 1732 break;} 1733 case 143: 1731 1734 #line 457 "grammar.y" 1732 { yyval.stat=new DoWhileNode(yyvsp[-4].stat,yyvsp[-1].node);DBG(yyval.stat,yylsp[-5],yylsp[-3]);;1733 break;}1734 case 143:1735 #line 458 "grammar.y"1736 1735 { yyval.stat = new WhileNode(yyvsp[-2].node,yyvsp[0].stat);DBG(yyval.stat,yylsp[-4],yylsp[-1]); ; 1737 1736 break;} 1738 1737 case 144: 1739 #line 4 60"grammar.y"1738 #line 459 "grammar.y" 1740 1739 { yyval.stat = new ForNode(yyvsp[-6].node,yyvsp[-4].node,yyvsp[-2].node,yyvsp[0].stat); 1741 1740 DBG(yyval.stat,yylsp[-8],yylsp[-1]); ; 1742 1741 break;} 1743 1742 case 145: 1744 #line 46 3"grammar.y"1743 #line 462 "grammar.y" 1745 1744 { yyval.stat = new ForNode(yyvsp[-6].vlist,yyvsp[-4].node,yyvsp[-2].node,yyvsp[0].stat); 1746 1745 DBG(yyval.stat,yylsp[-9],yylsp[-1]); ; 1747 1746 break;} 1748 1747 case 146: 1749 #line 46 6"grammar.y"1748 #line 465 "grammar.y" 1750 1749 { yyval.stat = new ForInNode(yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].stat); 1751 1750 DBG(yyval.stat,yylsp[-6],yylsp[-1]); ; 1752 1751 break;} 1753 1752 case 147: 1754 #line 46 9"grammar.y"1753 #line 468 "grammar.y" 1755 1754 { yyval.stat = new ForInNode(yyvsp[-4].ustr,0L,yyvsp[-2].node,yyvsp[0].stat); 1756 1755 DBG(yyval.stat,yylsp[-7],yylsp[-1]); … … 1758 1757 break;} 1759 1758 case 148: 1760 #line 47 3"grammar.y"1759 #line 472 "grammar.y" 1761 1760 { yyval.stat = new ForInNode(yyvsp[-5].ustr,yyvsp[-4].init,yyvsp[-2].node,yyvsp[0].stat); 1762 1761 DBG(yyval.stat,yylsp[-8],yylsp[-1]); … … 1764 1763 break;} 1765 1764 case 149: 1766 #line 47 9"grammar.y"1765 #line 478 "grammar.y" 1767 1766 { yyval.node = 0L; ; 1768 1767 break;} 1769 1768 case 151: 1769 #line 483 "grammar.y" 1770 { yyval.stat = new ContinueNode(); DBG(yyval.stat,yylsp[-1],yylsp[0]); ; 1771 break;} 1772 case 152: 1770 1773 #line 484 "grammar.y" 1771 { yyval.stat = new ContinueNode(); DBG(yyval.stat,yylsp[-1],yylsp[0]); ;1772 break;}1773 case 152:1774 #line 485 "grammar.y"1775 1774 { if (automatic()) { 1776 1775 yyval.stat = new ContinueNode(); DBG(yyval.stat,yylsp[-1],yylsp[0]); … … 1779 1778 break;} 1780 1779 case 153: 1781 #line 48 9"grammar.y"1780 #line 488 "grammar.y" 1782 1781 { yyval.stat = new ContinueNode(yyvsp[-1].ustr); DBG(yyval.stat,yylsp[-2],yylsp[0]); 1783 1782 delete yyvsp[-1].ustr; ; 1784 1783 break;} 1785 1784 case 154: 1786 #line 49 1"grammar.y"1785 #line 490 "grammar.y" 1787 1786 { if (automatic()) { 1788 1787 yyval.stat = new ContinueNode(yyvsp[-1].ustr);DBG(yyval.stat,yylsp[-2],yylsp[-1]); … … 1792 1791 break;} 1793 1792 case 155: 1793 #line 498 "grammar.y" 1794 { yyval.stat = new BreakNode();DBG(yyval.stat,yylsp[-1],yylsp[0]); ; 1795 break;} 1796 case 156: 1794 1797 #line 499 "grammar.y" 1795 { yyval.stat = new BreakNode();DBG(yyval.stat,yylsp[-1],yylsp[0]); ;1796 break;}1797 case 156:1798 #line 500 "grammar.y"1799 1798 { if (automatic()) { 1800 1799 yyval.stat = new BreakNode(); DBG(yyval.stat,yylsp[-1],yylsp[-1]); … … 1803 1802 break;} 1804 1803 case 157: 1805 #line 50 4"grammar.y"1804 #line 503 "grammar.y" 1806 1805 { yyval.stat = new BreakNode(yyvsp[-1].ustr); DBG(yyval.stat,yylsp[-2],yylsp[0]); 1807 1806 delete yyvsp[-1].ustr; ; 1808 1807 break;} 1809 1808 case 158: 1810 #line 50 6"grammar.y"1809 #line 505 "grammar.y" 1811 1810 { if (automatic()) { 1812 1811 yyval.stat = new BreakNode(yyvsp[-1].ustr); DBG(yyval.stat,yylsp[-2],yylsp[-1]); … … 1817 1816 break;} 1818 1817 case 159: 1818 #line 514 "grammar.y" 1819 { yyval.stat = new ReturnNode(0L); DBG(yyval.stat,yylsp[-1],yylsp[0]); ; 1820 break;} 1821 case 160: 1819 1822 #line 515 "grammar.y" 1820 { yyval.stat = new ReturnNode(0L); DBG(yyval.stat,yylsp[-1],yylsp[0]); ;1821 break;}1822 case 160:1823 #line 516 "grammar.y"1824 1823 { if (automatic()) { 1825 1824 yyval.stat = new ReturnNode(0L); DBG(yyval.stat,yylsp[-1],yylsp[-1]); … … 1828 1827 break;} 1829 1828 case 161: 1829 #line 519 "grammar.y" 1830 { yyval.stat = new ReturnNode(yyvsp[-1].node); ; 1831 break;} 1832 case 162: 1830 1833 #line 520 "grammar.y" 1831 { yyval.stat = new ReturnNode(yyvsp[-1].node); ;1832 break;}1833 case 162:1834 #line 521 "grammar.y"1835 1834 { if (automatic()) 1836 1835 yyval.stat = new ReturnNode(yyvsp[-1].node); … … 1839 1838 break;} 1840 1839 case 163: 1841 #line 52 8"grammar.y"1840 #line 527 "grammar.y" 1842 1841 { yyval.stat = new WithNode(yyvsp[-2].node,yyvsp[0].stat); 1843 1842 DBG(yyval.stat, yylsp[-4], yylsp[-1]); ; 1844 1843 break;} 1845 1844 case 164: 1846 #line 53 3"grammar.y"1845 #line 532 "grammar.y" 1847 1846 { yyval.stat = new SwitchNode(yyvsp[-2].node, yyvsp[0].cblk); 1848 1847 DBG(yyval.stat, yylsp[-4], yylsp[-1]); ; 1849 1848 break;} 1850 1849 case 165: 1851 #line 53 8"grammar.y"1850 #line 537 "grammar.y" 1852 1851 { yyval.cblk = new CaseBlockNode(yyvsp[-1].clist, 0L, 0L); ; 1853 1852 break;} 1854 1853 case 166: 1855 #line 5 40"grammar.y"1854 #line 539 "grammar.y" 1856 1855 { yyval.cblk = new CaseBlockNode(yyvsp[-3].clist, yyvsp[-2].ccl, yyvsp[-1].clist); ; 1857 1856 break;} 1858 1857 case 167: 1859 #line 54 4"grammar.y"1858 #line 543 "grammar.y" 1860 1859 { yyval.clist = 0L; ; 1861 1860 break;} 1862 1861 case 169: 1862 #line 548 "grammar.y" 1863 { yyval.clist = new ClauseListNode(yyvsp[0].ccl); ; 1864 break;} 1865 case 170: 1863 1866 #line 549 "grammar.y" 1864 { yyval.clist = new ClauseListNode(yyvsp[0].ccl); ;1865 break;}1866 case 170:1867 #line 550 "grammar.y"1868 1867 { yyval.clist = yyvsp[-1].clist->append(yyvsp[0].ccl); ; 1869 1868 break;} 1870 1869 case 171: 1870 #line 553 "grammar.y" 1871 { yyval.ccl = new CaseClauseNode(yyvsp[-1].node, 0L); ; 1872 break;} 1873 case 172: 1871 1874 #line 554 "grammar.y" 1872 { yyval.ccl = new CaseClauseNode(yyvsp[-1].node, 0L); ;1873 break;}1874 case 172:1875 #line 555 "grammar.y"1876 1875 { yyval.ccl = new CaseClauseNode(yyvsp[-2].node, yyvsp[0].slist); ; 1877 1876 break;} 1878 1877 case 173: 1878 #line 558 "grammar.y" 1879 { yyval.ccl = new CaseClauseNode(0L, 0L);; ; 1880 break;} 1881 case 174: 1879 1882 #line 559 "grammar.y" 1880 { yyval.ccl = new CaseClauseNode(0L, 0L);; ;1881 break;}1882 case 174:1883 #line 560 "grammar.y"1884 1883 { yyval.ccl = new CaseClauseNode(0L, yyvsp[0].slist); ; 1885 1884 break;} 1886 1885 case 175: 1887 #line 56 4"grammar.y"1886 #line 563 "grammar.y" 1888 1887 { yyvsp[0].stat->pushLabel(yyvsp[-2].ustr); 1889 1888 yyval.stat = new LabelNode(yyvsp[-2].ustr, yyvsp[0].stat); … … 1891 1890 break;} 1892 1891 case 176: 1893 #line 5 70"grammar.y"1892 #line 569 "grammar.y" 1894 1893 { yyval.stat = new ThrowNode(yyvsp[-1].node); ; 1895 1894 break;} 1896 1895 case 177: 1896 #line 573 "grammar.y" 1897 { yyval.stat = new TryNode(yyvsp[-1].stat, yyvsp[0].node); ; 1898 break;} 1899 case 178: 1897 1900 #line 574 "grammar.y" 1898 { yyval.stat = new TryNode(yyvsp[-1].stat, yyvsp[0].node); ;1899 break;} 1900 case 17 8:1901 { yyval.stat = new TryNode(yyvsp[-1].stat, 0L, yyvsp[0].node); ; 1902 break;} 1903 case 179: 1901 1904 #line 575 "grammar.y" 1902 { yyval.stat = new TryNode(yyvsp[-1].stat, 0L, yyvsp[0].node); ;1903 break;}1904 case 179:1905 #line 576 "grammar.y"1906 1905 { yyval.stat = new TryNode(yyvsp[-2].stat, yyvsp[-1].node, yyvsp[0].node); ; 1907 1906 break;} 1908 1907 case 180: 1909 #line 5 80"grammar.y"1908 #line 579 "grammar.y" 1910 1909 { yyval.node = new CatchNode(yyvsp[-2].ustr, yyvsp[0].stat); delete yyvsp[-2].ustr; ; 1911 1910 break;} 1912 1911 case 181: 1913 #line 58 4"grammar.y"1912 #line 583 "grammar.y" 1914 1913 { yyval.node = new FinallyNode(yyvsp[0].stat); ; 1915 1914 break;} 1916 1915 case 182: 1917 #line 58 8"grammar.y"1916 #line 587 "grammar.y" 1918 1917 { yyval.func = new FuncDeclNode(yyvsp[-3].ustr, 0L, yyvsp[0].body); 1919 1918 delete yyvsp[-3].ustr; ; 1920 1919 break;} 1921 1920 case 183: 1922 #line 59 1"grammar.y"1921 #line 590 "grammar.y" 1923 1922 { yyval.func = new FuncDeclNode(yyvsp[-4].ustr, yyvsp[-2].param, yyvsp[0].body); 1924 1923 delete yyvsp[-4].ustr; ; 1925 1924 break;} 1926 1925 case 184: 1927 #line 59 5"grammar.y"1926 #line 594 "grammar.y" 1928 1927 { yyval.node = new FuncExprNode(0L, yyvsp[0].body); ; 1929 1928 break;} 1930 1929 case 185: 1931 #line 59 7"grammar.y"1930 #line 596 "grammar.y" 1932 1931 { yyval.node = new FuncExprNode(yyvsp[-2].param, yyvsp[0].body); ; 1933 1932 break;} 1934 1933 case 186: 1934 #line 601 "grammar.y" 1935 { yyval.param = new ParameterNode(yyvsp[0].ustr); delete yyvsp[0].ustr; ; 1936 break;} 1937 case 187: 1935 1938 #line 602 "grammar.y" 1936 { yyval.param = new ParameterNode(yyvsp[0].ustr); delete yyvsp[0].ustr; ;1937 break;}1938 case 187:1939 #line 603 "grammar.y"1940 1939 { yyval.param = yyvsp[-2].param->append(yyvsp[0].ustr); 1941 1940 delete yyvsp[0].ustr; ; 1942 1941 break;} 1943 1942 case 188: 1944 #line 60 8"grammar.y"1943 #line 607 "grammar.y" 1945 1944 { yyval.body = new FunctionBodyNode(0L); 1946 1945 DBG(yyval.body, yylsp[-1], yylsp[0]);; 1947 1946 break;} 1948 1947 case 189: 1949 #line 6 10"grammar.y"1948 #line 609 "grammar.y" 1950 1949 { yyval.body = new FunctionBodyNode(yyvsp[-1].srcs); 1951 1950 DBG(yyval.body, yylsp[-2], yylsp[0]);; 1952 1951 break;} 1953 1952 case 190: 1954 #line 61 5"grammar.y"1953 #line 614 "grammar.y" 1955 1954 { yyval.prog = new ProgramNode(0L); 1956 1955 Parser::progNode = yyval.prog; ; 1957 1956 break;} 1958 1957 case 191: 1959 #line 61 7"grammar.y"1958 #line 616 "grammar.y" 1960 1959 { yyval.prog = new ProgramNode(yyvsp[0].srcs); 1961 1960 Parser::progNode = yyval.prog; ; 1962 1961 break;} 1963 1962 case 192: 1964 #line 62 2"grammar.y"1963 #line 621 "grammar.y" 1965 1964 { yyval.srcs = new SourceElementsNode(yyvsp[0].src); ; 1966 1965 break;} 1967 1966 case 193: 1968 #line 62 4"grammar.y"1967 #line 623 "grammar.y" 1969 1968 { yyval.srcs = new SourceElementsNode(yyvsp[0].srcs, yyvsp[-1].src); ; 1970 1969 break;} 1971 1970 case 194: 1971 #line 630 "grammar.y" 1972 { yyval.src = new SourceElementNode(yyvsp[0].stat); ; 1973 break;} 1974 case 195: 1972 1975 #line 631 "grammar.y" 1973 { yyval.src = new SourceElementNode(yyvsp[0].stat); ;1974 break;}1975 case 195:1976 #line 632 "grammar.y"1977 1976 { yyval.src = new SourceElementNode(yyvsp[0].func); ; 1978 1977 break;} … … 2200 2199 return 1; 2201 2200 } 2202 #line 63 5"grammar.y"2201 #line 634 "grammar.y" 2203 2202 2204 2203
Note:
See TracChangeset
for help on using the changeset viewer.