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