Changeset 4739 in webkit for trunk/JavaScriptCore/kjs/grammar.cpp


Ignore:
Timestamp:
Jul 30, 2003, 4:54:41 PM (22 years ago)
Author:
darin
Message:

Reviewed by Dave.

  • fixed problem where some JavaScriptCore symbols had no namespace or prefix
  • kjs/grammar.y: Added a define for yylloc to make it use the kjs prefix. This is the same thing done for the rest of the symbols automatically by yacc, but for some reason it's not done for yyloc. Also make automatic() function static.
  • kjs/grammar.cpp: Regenerated.
  • kjs/lexer.cpp: Use kjsyylloc instead of yyloc.
  • pcre/pcre.h: Add defines to prepend kjs prefixes for all the PCRE functions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/grammar.cpp

    r3313 r4739  
    109109#include "internal.h"
    110110
     111// Not sure why, but yacc doesn't add this define along with the others.
     112#define yylloc kjsyylloc
     113
    111114/* default values for bison */
    112115#define YYDEBUG 0
     
    117120#define DBG(l, s, e) { l->setLoc(s.first_line, e.last_line, Parser::sid); } // location
    118121
    119 extern int yylex();
    120 int yyerror (const char *);
    121 bool automatic();
     122extern int kjsyylex();
     123int kjsyyerror(const char *);
     124static bool automatic();
    122125
    123126using namespace KJS;
    124127
    125128
    126 #line 52 "grammar.y"
     129#line 55 "grammar.y"
    127130typedef union {
    128131  int                 ival;
     
    315318#if YYDEBUG != 0
    316319static const short yyrline[] = { 0,
    317    162,   164,   165,   166,   167,   168,   171,   177,   179,   181,
    318    182,   183,   184,   185,   188,   190,   191,   194,   196,   200,
    319    202,   205,   207,   210,   212,   216,   218,   219,   222,   224,
    320    225,   226,   227,   230,   232,   235,   237,   238,   239,   243,
    321    245,   248,   250,   253,   255,   258,   260,   261,   264,   266,
    322    267,   268,   269,   270,   271,   272,   273,   274,   275,   276,
    323    279,   281,   282,   283,   286,   288,   289,   292,   294,   295,
    324    296,   299,   301,   303,   305,   307,   309,   311,   315,   317,
    325    318,   319,   320,   323,   325,   328,   330,   333,   335,   338,
    326    340,   344,   346,   350,   352,   356,   358,   362,   364,   365,
    327    366,   367,   368,   369,   370,   371,   372,   373,   374,   377,
    328    379,   382,   384,   385,   386,   387,   388,   389,   390,   391,
    329    392,   393,   394,   395,   396,   399,   401,   404,   406,   409,
    330    412,   421,   423,   427,   429,   432,   436,   440,   443,   450,
    331    452,   456,   458,   459,   462,   465,   468,   472,   478,   480,
    332    483,   485,   489,   491,   498,   500,   504,   506,   514,   516,
    333    520,   521,   527,   532,   537,   539,   543,   545,   548,   550,
    334    553,   555,   558,   560,   563,   569,   573,   575,   576,   579,
    335    583,   587,   590,   594,   596,   601,   603,   606,   609,   613,
    336    616,   620,   622,   625,   627
     320   165,   167,   168,   169,   170,   171,   174,   180,   182,   184,
     321   185,   186,   187,   188,   191,   193,   194,   197,   199,   203,
     322   205,   208,   210,   213,   215,   219,   221,   222,   225,   227,
     323   228,   229,   230,   233,   235,   238,   240,   241,   242,   246,
     324   248,   251,   253,   256,   258,   261,   263,   264,   267,   269,
     325   270,   271,   272,   273,   274,   275,   276,   277,   278,   279,
     326   282,   284,   285,   286,   289,   291,   292,   295,   297,   298,
     327   299,   302,   304,   306,   308,   310,   312,   314,   318,   320,
     328   321,   322,   323,   326,   328,   331,   333,   336,   338,   341,
     329   343,   347,   349,   353,   355,   359,   361,   365,   367,   368,
     330   369,   370,   371,   372,   373,   374,   375,   376,   377,   380,
     331   382,   385,   387,   388,   389,   390,   391,   392,   393,   394,
     332   395,   396,   397,   398,   399,   402,   404,   407,   409,   412,
     333   415,   424,   426,   430,   432,   435,   439,   443,   446,   453,
     334   455,   459,   461,   462,   465,   468,   471,   475,   481,   483,
     335   486,   488,   492,   494,   501,   503,   507,   509,   517,   519,
     336   523,   524,   530,   535,   540,   542,   546,   548,   551,   553,
     337   556,   558,   561,   563,   566,   572,   576,   578,   579,   582,
     338   586,   590,   593,   597,   599,   604,   606,   609,   612,   616,
     339   619,   623,   625,   628,   630
    337340};
    338341#endif
     
    13311334
    13321335case 1:
    1333 #line 163 "grammar.y"
     1336#line 166 "grammar.y"
    13341337{ yyval.node = new NullNode(); ;
    13351338    break;}
    13361339case 2:
    1337 #line 164 "grammar.y"
     1340#line 167 "grammar.y"
    13381341{ yyval.node = new BooleanNode(true); ;
    13391342    break;}
    13401343case 3:
    1341 #line 165 "grammar.y"
     1344#line 168 "grammar.y"
    13421345{ yyval.node = new BooleanNode(false); ;
    13431346    break;}
    13441347case 4:
    1345 #line 166 "grammar.y"
     1348#line 169 "grammar.y"
    13461349{ yyval.node = new NumberNode(yyvsp[0].dval); ;
    13471350    break;}
    13481351case 5:
    1349 #line 167 "grammar.y"
     1352#line 170 "grammar.y"
    13501353{ yyval.node = new StringNode(yyvsp[0].ustr); delete yyvsp[0].ustr; ;
    13511354    break;}
    13521355case 6:
    1353 #line 168 "grammar.y"
     1356#line 171 "grammar.y"
    13541357{ Lexer *l = Lexer::curr();
    13551358                                     if (!l->scanRegExp()) YYABORT;
     
    13571360    break;}
    13581361case 7:
    1359 #line 172 "grammar.y"
     1362#line 175 "grammar.y"
    13601363{ Lexer *l = Lexer::curr();
    13611364                                     if (!l->scanRegExp()) YYABORT;
     
    13631366    break;}
    13641367case 8:
    1365 #line 178 "grammar.y"
     1368#line 181 "grammar.y"
    13661369{ yyval.node = new ThisNode(); ;
    13671370    break;}
    13681371case 9:
    1369 #line 179 "grammar.y"
     1372#line 182 "grammar.y"
    13701373{ yyval.node = new ResolveNode(*yyvsp[0].ident);
    13711374                                     delete yyvsp[0].ident; ;
    13721375    break;}
    13731376case 12:
    1374 #line 183 "grammar.y"
     1377#line 186 "grammar.y"
    13751378{ yyval.node = new GroupNode(yyvsp[-1].node); ;
    13761379    break;}
    13771380case 13:
    1378 #line 184 "grammar.y"
     1381#line 187 "grammar.y"
    13791382{ yyval.node = new ObjectLiteralNode(0L); ;
    13801383    break;}
    13811384case 14:
    1382 #line 185 "grammar.y"
     1385#line 188 "grammar.y"
    13831386{ yyval.node = new ObjectLiteralNode(yyvsp[-1].plist); ;
    13841387    break;}
    13851388case 15:
    1386 #line 189 "grammar.y"
     1389#line 192 "grammar.y"
    13871390{ yyval.node = new ArrayNode(yyvsp[-1].ival); ;
    13881391    break;}
    13891392case 16:
    1390 #line 190 "grammar.y"
     1393#line 193 "grammar.y"
    13911394{ yyval.node = new ArrayNode(yyvsp[-1].elm); ;
    13921395    break;}
    13931396case 17:
    1394 #line 191 "grammar.y"
     1397#line 194 "grammar.y"
    13951398{ yyval.node = new ArrayNode(yyvsp[-1].ival, yyvsp[-3].elm); ;
    13961399    break;}
    13971400case 18:
    1398 #line 195 "grammar.y"
     1401#line 198 "grammar.y"
    13991402{ yyval.elm = new ElementNode(yyvsp[-1].ival, yyvsp[0].node); ;
    14001403    break;}
    14011404case 19:
    1402 #line 197 "grammar.y"
     1405#line 200 "grammar.y"
    14031406{ yyval.elm = new ElementNode(yyvsp[-3].elm, yyvsp[-1].ival, yyvsp[0].node); ;
    14041407    break;}
    14051408case 20:
    1406 #line 201 "grammar.y"
     1409#line 204 "grammar.y"
    14071410{ yyval.ival = 0; ;
    14081411    break;}
    14091412case 22:
    1410 #line 206 "grammar.y"
     1413#line 209 "grammar.y"
    14111414{ yyval.ival = 1; ;
    14121415    break;}
    14131416case 23:
    1414 #line 207 "grammar.y"
     1417#line 210 "grammar.y"
    14151418{ yyval.ival = yyvsp[-1].ival + 1; ;
    14161419    break;}
    14171420case 24:
    1418 #line 211 "grammar.y"
     1421#line 214 "grammar.y"
    14191422{ yyval.plist = new PropertyValueNode(yyvsp[-2].pnode, yyvsp[0].node); ;
    14201423    break;}
    14211424case 25:
    1422 #line 213 "grammar.y"
     1425#line 216 "grammar.y"
    14231426{ yyval.plist = new PropertyValueNode(yyvsp[-2].pnode, yyvsp[0].node, yyvsp[-4].plist); ;
    14241427    break;}
    14251428case 26:
    1426 #line 217 "grammar.y"
     1429#line 220 "grammar.y"
    14271430{ yyval.pnode = new PropertyNode(*yyvsp[0].ident); delete yyvsp[0].ident; ;
    14281431    break;}
    14291432case 27:
    1430 #line 218 "grammar.y"
     1433#line 221 "grammar.y"
    14311434{ yyval.pnode = new PropertyNode(Identifier(*yyvsp[0].ustr)); delete yyvsp[0].ustr; ;
    14321435    break;}
    14331436case 28:
    1434 #line 219 "grammar.y"
     1437#line 222 "grammar.y"
    14351438{ yyval.pnode = new PropertyNode(yyvsp[0].dval); ;
    14361439    break;}
    14371440case 31:
    1438 #line 225 "grammar.y"
     1441#line 228 "grammar.y"
    14391442{ yyval.node = new AccessorNode1(yyvsp[-3].node, yyvsp[-1].node); ;
    14401443    break;}
    14411444case 32:
    1442 #line 226 "grammar.y"
     1445#line 229 "grammar.y"
    14431446{ yyval.node = new AccessorNode2(yyvsp[-2].node, *yyvsp[0].ident); delete yyvsp[0].ident; ;
    14441447    break;}
    14451448case 33:
    1446 #line 227 "grammar.y"
     1449#line 230 "grammar.y"
    14471450{ yyval.node = new NewExprNode(yyvsp[-1].node, yyvsp[0].args); ;
    14481451    break;}
    14491452case 35:
    1450 #line 232 "grammar.y"
     1453#line 235 "grammar.y"
    14511454{ yyval.node = new NewExprNode(yyvsp[0].node); ;
    14521455    break;}
    14531456case 36:
    1454 #line 236 "grammar.y"
     1457#line 239 "grammar.y"
    14551458{ yyval.node = new FunctionCallNode(yyvsp[-1].node, yyvsp[0].args); ;
    14561459    break;}
    14571460case 37:
    1458 #line 237 "grammar.y"
     1461#line 240 "grammar.y"
    14591462{ yyval.node = new FunctionCallNode(yyvsp[-1].node, yyvsp[0].args); ;
    14601463    break;}
    14611464case 38:
    1462 #line 238 "grammar.y"
     1465#line 241 "grammar.y"
    14631466{ yyval.node = new AccessorNode1(yyvsp[-3].node, yyvsp[-1].node); ;
    14641467    break;}
    14651468case 39:
    1466 #line 239 "grammar.y"
     1469#line 242 "grammar.y"
    14671470{ yyval.node = new AccessorNode2(yyvsp[-2].node, *yyvsp[0].ident);
    14681471                                     delete yyvsp[0].ident; ;
    14691472    break;}
    14701473case 40:
    1471 #line 244 "grammar.y"
     1474#line 247 "grammar.y"
    14721475{ yyval.args = new ArgumentsNode(0L); ;
    14731476    break;}
    14741477case 41:
    1475 #line 245 "grammar.y"
     1478#line 248 "grammar.y"
    14761479{ yyval.args = new ArgumentsNode(yyvsp[-1].alist); ;
    14771480    break;}
    14781481case 42:
    1479 #line 249 "grammar.y"
     1482#line 252 "grammar.y"
    14801483{ yyval.alist = new ArgumentListNode(yyvsp[0].node); ;
    14811484    break;}
    14821485case 43:
    1483 #line 250 "grammar.y"
     1486#line 253 "grammar.y"
    14841487{ yyval.alist = new ArgumentListNode(yyvsp[-2].alist, yyvsp[0].node); ;
    14851488    break;}
    14861489case 47:
    1487 #line 260 "grammar.y"
     1490#line 263 "grammar.y"
    14881491{ yyval.node = new PostfixNode(yyvsp[-1].node, OpPlusPlus); ;
    14891492    break;}
    14901493case 48:
    1491 #line 261 "grammar.y"
     1494#line 264 "grammar.y"
    14921495{ yyval.node = new PostfixNode(yyvsp[-1].node, OpMinusMinus); ;
    14931496    break;}
    14941497case 50:
    1495 #line 266 "grammar.y"
     1498#line 269 "grammar.y"
    14961499{ yyval.node = new DeleteNode(yyvsp[0].node); ;
    14971500    break;}
    14981501case 51:
    1499 #line 267 "grammar.y"
     1502#line 270 "grammar.y"
    15001503{ yyval.node = new VoidNode(yyvsp[0].node); ;
    15011504    break;}
    15021505case 52:
    1503 #line 268 "grammar.y"
     1506#line 271 "grammar.y"
    15041507{ yyval.node = new TypeOfNode(yyvsp[0].node); ;
    15051508    break;}
    15061509case 53:
    1507 #line 269 "grammar.y"
     1510#line 272 "grammar.y"
    15081511{ yyval.node = new PrefixNode(OpPlusPlus, yyvsp[0].node); ;
    15091512    break;}
    15101513case 54:
    1511 #line 270 "grammar.y"
     1514#line 273 "grammar.y"
    15121515{ yyval.node = new PrefixNode(OpPlusPlus, yyvsp[0].node); ;
    15131516    break;}
    15141517case 55:
    1515 #line 271 "grammar.y"
     1518#line 274 "grammar.y"
    15161519{ yyval.node = new PrefixNode(OpMinusMinus, yyvsp[0].node); ;
    15171520    break;}
    15181521case 56:
    1519 #line 272 "grammar.y"
     1522#line 275 "grammar.y"
    15201523{ yyval.node = new PrefixNode(OpMinusMinus, yyvsp[0].node); ;
    15211524    break;}
    15221525case 57:
    1523 #line 273 "grammar.y"
     1526#line 276 "grammar.y"
    15241527{ yyval.node = new UnaryPlusNode(yyvsp[0].node); ;
    15251528    break;}
    15261529case 58:
    1527 #line 274 "grammar.y"
     1530#line 277 "grammar.y"
    15281531{ yyval.node = new NegateNode(yyvsp[0].node); ;
    15291532    break;}
    15301533case 59:
    1531 #line 275 "grammar.y"
     1534#line 278 "grammar.y"
    15321535{ yyval.node = new BitwiseNotNode(yyvsp[0].node); ;
    15331536    break;}
    15341537case 60:
    1535 #line 276 "grammar.y"
     1538#line 279 "grammar.y"
    15361539{ yyval.node = new LogicalNotNode(yyvsp[0].node); ;
    15371540    break;}
    15381541case 62:
    1539 #line 281 "grammar.y"
     1542#line 284 "grammar.y"
    15401543{ yyval.node = new MultNode(yyvsp[-2].node, yyvsp[0].node, '*'); ;
    15411544    break;}
    15421545case 63:
    1543 #line 282 "grammar.y"
     1546#line 285 "grammar.y"
    15441547{ yyval.node = new MultNode(yyvsp[-2].node, yyvsp[0].node, '/'); ;
    15451548    break;}
    15461549case 64:
    1547 #line 283 "grammar.y"
     1550#line 286 "grammar.y"
    15481551{ yyval.node = new MultNode(yyvsp[-2].node,yyvsp[0].node,'%'); ;
    15491552    break;}
    15501553case 66:
    1551 #line 288 "grammar.y"
     1554#line 291 "grammar.y"
    15521555{ yyval.node = new AddNode(yyvsp[-2].node, yyvsp[0].node, '+'); ;
    15531556    break;}
    15541557case 67:
    1555 #line 289 "grammar.y"
     1558#line 292 "grammar.y"
    15561559{ yyval.node = new AddNode(yyvsp[-2].node, yyvsp[0].node, '-'); ;
    15571560    break;}
    15581561case 69:
    1559 #line 294 "grammar.y"
     1562#line 297 "grammar.y"
    15601563{ yyval.node = new ShiftNode(yyvsp[-2].node, OpLShift, yyvsp[0].node); ;
    15611564    break;}
    15621565case 70:
    1563 #line 295 "grammar.y"
     1566#line 298 "grammar.y"
    15641567{ yyval.node = new ShiftNode(yyvsp[-2].node, OpRShift, yyvsp[0].node); ;
    15651568    break;}
    15661569case 71:
    1567 #line 296 "grammar.y"
     1570#line 299 "grammar.y"
    15681571{ yyval.node = new ShiftNode(yyvsp[-2].node, OpURShift, yyvsp[0].node); ;
    15691572    break;}
    15701573case 73:
    1571 #line 302 "grammar.y"
     1574#line 305 "grammar.y"
    15721575{ yyval.node = new RelationalNode(yyvsp[-2].node, OpLess, yyvsp[0].node); ;
    15731576    break;}
    15741577case 74:
    1575 #line 304 "grammar.y"
     1578#line 307 "grammar.y"
    15761579{ yyval.node = new RelationalNode(yyvsp[-2].node, OpGreater, yyvsp[0].node); ;
    15771580    break;}
    15781581case 75:
    1579 #line 306 "grammar.y"
     1582#line 309 "grammar.y"
    15801583{ yyval.node = new RelationalNode(yyvsp[-2].node, OpLessEq, yyvsp[0].node); ;
    15811584    break;}
    15821585case 76:
    1583 #line 308 "grammar.y"
     1586#line 311 "grammar.y"
    15841587{ yyval.node = new RelationalNode(yyvsp[-2].node, OpGreaterEq, yyvsp[0].node); ;
    15851588    break;}
    15861589case 77:
    1587 #line 310 "grammar.y"
     1590#line 313 "grammar.y"
    15881591{ yyval.node = new RelationalNode(yyvsp[-2].node, OpInstanceOf, yyvsp[0].node); ;
    15891592    break;}
    15901593case 78:
    1591 #line 312 "grammar.y"
     1594#line 315 "grammar.y"
    15921595{ yyval.node = new RelationalNode(yyvsp[-2].node, OpIn, yyvsp[0].node); ;
    15931596    break;}
    15941597case 80:
    1595 #line 317 "grammar.y"
     1598#line 320 "grammar.y"
    15961599{ yyval.node = new EqualNode(yyvsp[-2].node, OpEqEq, yyvsp[0].node); ;
    15971600    break;}
    15981601case 81:
    1599 #line 318 "grammar.y"
     1602#line 321 "grammar.y"
    16001603{ yyval.node = new EqualNode(yyvsp[-2].node, OpNotEq, yyvsp[0].node); ;
    16011604    break;}
    16021605case 82:
    1603 #line 319 "grammar.y"
     1606#line 322 "grammar.y"
    16041607{ yyval.node = new EqualNode(yyvsp[-2].node, OpStrEq, yyvsp[0].node); ;
    16051608    break;}
    16061609case 83:
    1607 #line 320 "grammar.y"
     1610#line 323 "grammar.y"
    16081611{ yyval.node = new EqualNode(yyvsp[-2].node, OpStrNEq, yyvsp[0].node);;
    16091612    break;}
    16101613case 85:
    1611 #line 325 "grammar.y"
     1614#line 328 "grammar.y"
    16121615{ yyval.node = new BitOperNode(yyvsp[-2].node, OpBitAnd, yyvsp[0].node); ;
    16131616    break;}
    16141617case 87:
    1615 #line 330 "grammar.y"
     1618#line 333 "grammar.y"
    16161619{ yyval.node = new BitOperNode(yyvsp[-2].node, OpBitXOr, yyvsp[0].node); ;
    16171620    break;}
    16181621case 89:
    1619 #line 335 "grammar.y"
     1622#line 338 "grammar.y"
    16201623{ yyval.node = new BitOperNode(yyvsp[-2].node, OpBitOr, yyvsp[0].node); ;
    16211624    break;}
    16221625case 91:
    1623 #line 341 "grammar.y"
     1626#line 344 "grammar.y"
    16241627{ yyval.node = new BinaryLogicalNode(yyvsp[-2].node, OpAnd, yyvsp[0].node); ;
    16251628    break;}
    16261629case 93:
    1627 #line 347 "grammar.y"
     1630#line 350 "grammar.y"
    16281631{ yyval.node = new BinaryLogicalNode(yyvsp[-2].node, OpOr, yyvsp[0].node); ;
    16291632    break;}
    16301633case 95:
    1631 #line 353 "grammar.y"
     1634#line 356 "grammar.y"
    16321635{ yyval.node = new ConditionalNode(yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); ;
    16331636    break;}
    16341637case 97:
    1635 #line 359 "grammar.y"
     1638#line 362 "grammar.y"
    16361639{ yyval.node = new AssignNode(yyvsp[-2].node, yyvsp[-1].op, yyvsp[0].node);;
    16371640    break;}
    16381641case 98:
    1639 #line 363 "grammar.y"
     1642#line 366 "grammar.y"
    16401643{ yyval.op = OpEqual; ;
    16411644    break;}
    16421645case 99:
    1643 #line 364 "grammar.y"
     1646#line 367 "grammar.y"
    16441647{ yyval.op = OpPlusEq; ;
    16451648    break;}
    16461649case 100:
    1647 #line 365 "grammar.y"
     1650#line 368 "grammar.y"
    16481651{ yyval.op = OpMinusEq; ;
    16491652    break;}
    16501653case 101:
    1651 #line 366 "grammar.y"
     1654#line 369 "grammar.y"
    16521655{ yyval.op = OpMultEq; ;
    16531656    break;}
    16541657case 102:
    1655 #line 367 "grammar.y"
     1658#line 370 "grammar.y"
    16561659{ yyval.op = OpDivEq; ;
    16571660    break;}
    16581661case 103:
    1659 #line 368 "grammar.y"
     1662#line 371 "grammar.y"
    16601663{ yyval.op = OpLShift; ;
    16611664    break;}
    16621665case 104:
    1663 #line 369 "grammar.y"
     1666#line 372 "grammar.y"
    16641667{ yyval.op = OpRShift; ;
    16651668    break;}
    16661669case 105:
    1667 #line 370 "grammar.y"
     1670#line 373 "grammar.y"
    16681671{ yyval.op = OpURShift; ;
    16691672    break;}
    16701673case 106:
    1671 #line 371 "grammar.y"
     1674#line 374 "grammar.y"
    16721675{ yyval.op = OpAndEq; ;
    16731676    break;}
    16741677case 107:
    1675 #line 372 "grammar.y"
     1678#line 375 "grammar.y"
    16761679{ yyval.op = OpXOrEq; ;
    16771680    break;}
    16781681case 108:
    1679 #line 373 "grammar.y"
     1682#line 376 "grammar.y"
    16801683{ yyval.op = OpOrEq; ;
    16811684    break;}
    16821685case 109:
    1683 #line 374 "grammar.y"
     1686#line 377 "grammar.y"
    16841687{ yyval.op = OpModEq; ;
    16851688    break;}
    16861689case 111:
    1687 #line 379 "grammar.y"
     1690#line 382 "grammar.y"
    16881691{ yyval.node = new CommaNode(yyvsp[-2].node, yyvsp[0].node); ;
    16891692    break;}
    16901693case 126:
    1691 #line 400 "grammar.y"
     1694#line 403 "grammar.y"
    16921695{ yyval.stat = new BlockNode(0L); DBG(yyval.stat, yylsp[0], yylsp[0]); ;
    16931696    break;}
    16941697case 127:
    1695 #line 401 "grammar.y"
     1698#line 404 "grammar.y"
    16961699{ yyval.stat = new BlockNode(yyvsp[-1].srcs); DBG(yyval.stat, yylsp[0], yylsp[0]); ;
    16971700    break;}
    16981701case 128:
    1699 #line 405 "grammar.y"
     1702#line 408 "grammar.y"
    17001703{ yyval.slist = new StatListNode(yyvsp[0].stat); ;
    17011704    break;}
    17021705case 129:
    1703 #line 406 "grammar.y"
     1706#line 409 "grammar.y"
    17041707{ yyval.slist = new StatListNode(yyvsp[-1].slist, yyvsp[0].stat); ;
    17051708    break;}
    17061709case 130:
    1707 #line 410 "grammar.y"
     1710#line 413 "grammar.y"
    17081711{ yyval.stat = new VarStatementNode(yyvsp[-1].vlist);
    17091712                                      DBG(yyval.stat, yylsp[-2], yylsp[0]); ;
    17101713    break;}
    17111714case 131:
    1712 #line 412 "grammar.y"
     1715#line 415 "grammar.y"
    17131716{ if (automatic()) {
    17141717                                          yyval.stat = new VarStatementNode(yyvsp[-1].vlist);
     
    17201723    break;}
    17211724case 132:
    1722 #line 422 "grammar.y"
     1725#line 425 "grammar.y"
    17231726{ yyval.vlist = new VarDeclListNode(yyvsp[0].decl); ;
    17241727    break;}
    17251728case 133:
    1726 #line 424 "grammar.y"
     1729#line 427 "grammar.y"
    17271730{ yyval.vlist = new VarDeclListNode(yyvsp[-2].vlist, yyvsp[0].decl); ;
    17281731    break;}
    17291732case 134:
    1730 #line 428 "grammar.y"
     1733#line 431 "grammar.y"
    17311734{ yyval.decl = new VarDeclNode(*yyvsp[0].ident, 0); delete yyvsp[0].ident; ;
    17321735    break;}
    17331736case 135:
    1734 #line 429 "grammar.y"
     1737#line 432 "grammar.y"
    17351738{ yyval.decl = new VarDeclNode(*yyvsp[-1].ident, yyvsp[0].init); delete yyvsp[-1].ident; ;
    17361739    break;}
    17371740case 136:
    1738 #line 433 "grammar.y"
     1741#line 436 "grammar.y"
    17391742{ yyval.init = new AssignExprNode(yyvsp[0].node); ;
    17401743    break;}
    17411744case 137:
    1742 #line 437 "grammar.y"
     1745#line 440 "grammar.y"
    17431746{ yyval.stat = new EmptyStatementNode(); ;
    17441747    break;}
    17451748case 138:
    1746 #line 441 "grammar.y"
     1749#line 444 "grammar.y"
    17471750{ yyval.stat = new ExprStatementNode(yyvsp[-1].node);
    17481751                                     DBG(yyval.stat, yylsp[-1], yylsp[0]); ;
    17491752    break;}
    17501753case 139:
    1751 #line 443 "grammar.y"
     1754#line 446 "grammar.y"
    17521755{ if (automatic()) {
    17531756                                       yyval.stat = new ExprStatementNode(yyvsp[-1].node);
     
    17571760    break;}
    17581761case 140:
    1759 #line 451 "grammar.y"
     1762#line 454 "grammar.y"
    17601763{ yyval.stat = new IfNode(yyvsp[-2].node,yyvsp[0].stat,0L);DBG(yyval.stat,yylsp[-4],yylsp[-1]); ;
    17611764    break;}
    17621765case 141:
    1763 #line 453 "grammar.y"
     1766#line 456 "grammar.y"
    17641767{ yyval.stat = new IfNode(yyvsp[-4].node,yyvsp[-2].stat,yyvsp[0].stat);DBG(yyval.stat,yylsp[-6],yylsp[-3]); ;
    17651768    break;}
    17661769case 142:
    1767 #line 457 "grammar.y"
     1770#line 460 "grammar.y"
    17681771{ yyval.stat=new DoWhileNode(yyvsp[-4].stat,yyvsp[-1].node);DBG(yyval.stat,yylsp[-5],yylsp[-3]);;
    17691772    break;}
    17701773case 143:
    1771 #line 458 "grammar.y"
     1774#line 461 "grammar.y"
    17721775{ yyval.stat = new WhileNode(yyvsp[-2].node,yyvsp[0].stat);DBG(yyval.stat,yylsp[-4],yylsp[-1]); ;
    17731776    break;}
    17741777case 144:
    1775 #line 460 "grammar.y"
     1778#line 463 "grammar.y"
    17761779{ yyval.stat = new ForNode(yyvsp[-6].node,yyvsp[-4].node,yyvsp[-2].node,yyvsp[0].stat);
    17771780                                     DBG(yyval.stat,yylsp[-8],yylsp[-1]); ;
    17781781    break;}
    17791782case 145:
    1780 #line 463 "grammar.y"
     1783#line 466 "grammar.y"
    17811784{ yyval.stat = new ForNode(yyvsp[-6].vlist,yyvsp[-4].node,yyvsp[-2].node,yyvsp[0].stat);
    17821785                                     DBG(yyval.stat,yylsp[-9],yylsp[-1]); ;
    17831786    break;}
    17841787case 146:
    1785 #line 466 "grammar.y"
     1788#line 469 "grammar.y"
    17861789{ yyval.stat = new ForInNode(yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].stat);
    17871790                                     DBG(yyval.stat,yylsp[-6],yylsp[-1]); ;
    17881791    break;}
    17891792case 147:
    1790 #line 469 "grammar.y"
     1793#line 472 "grammar.y"
    17911794{ yyval.stat = new ForInNode(*yyvsp[-4].ident,0L,yyvsp[-2].node,yyvsp[0].stat);
    17921795                                     DBG(yyval.stat,yylsp[-7],yylsp[-1]);
     
    17941797    break;}
    17951798case 148:
    1796 #line 473 "grammar.y"
     1799#line 476 "grammar.y"
    17971800{ yyval.stat = new ForInNode(*yyvsp[-5].ident,yyvsp[-4].init,yyvsp[-2].node,yyvsp[0].stat);
    17981801                                     DBG(yyval.stat,yylsp[-8],yylsp[-1]);
     
    18001803    break;}
    18011804case 149:
    1802 #line 479 "grammar.y"
     1805#line 482 "grammar.y"
    18031806{ yyval.node = 0L; ;
    18041807    break;}
    18051808case 151:
    1806 #line 484 "grammar.y"
     1809#line 487 "grammar.y"
    18071810{ yyval.stat = new ContinueNode(); DBG(yyval.stat,yylsp[-1],yylsp[0]); ;
    18081811    break;}
    18091812case 152:
    1810 #line 485 "grammar.y"
     1813#line 488 "grammar.y"
    18111814{ if (automatic()) {
    18121815                                       yyval.stat = new ContinueNode(); DBG(yyval.stat,yylsp[-1],yylsp[0]);
     
    18151818    break;}
    18161819case 153:
    1817 #line 489 "grammar.y"
     1820#line 492 "grammar.y"
    18181821{ yyval.stat = new ContinueNode(*yyvsp[-1].ident); DBG(yyval.stat,yylsp[-2],yylsp[0]);
    18191822                                     delete yyvsp[-1].ident; ;
    18201823    break;}
    18211824case 154:
    1822 #line 491 "grammar.y"
     1825#line 494 "grammar.y"
    18231826{ if (automatic()) {
    18241827                                       yyval.stat = new ContinueNode(*yyvsp[-1].ident);DBG(yyval.stat,yylsp[-2],yylsp[-1]);
     
    18281831    break;}
    18291832case 155:
    1830 #line 499 "grammar.y"
     1833#line 502 "grammar.y"
    18311834{ yyval.stat = new BreakNode();DBG(yyval.stat,yylsp[-1],yylsp[0]); ;
    18321835    break;}
    18331836case 156:
    1834 #line 500 "grammar.y"
     1837#line 503 "grammar.y"
    18351838{ if (automatic()) {
    18361839                                       yyval.stat = new BreakNode(); DBG(yyval.stat,yylsp[-1],yylsp[-1]);
     
    18391842    break;}
    18401843case 157:
    1841 #line 504 "grammar.y"
     1844#line 507 "grammar.y"
    18421845{ yyval.stat = new BreakNode(*yyvsp[-1].ident); DBG(yyval.stat,yylsp[-2],yylsp[0]);
    18431846                                     delete yyvsp[-1].ident; ;
    18441847    break;}
    18451848case 158:
    1846 #line 506 "grammar.y"
     1849#line 509 "grammar.y"
    18471850{ if (automatic()) {
    18481851                                       yyval.stat = new BreakNode(*yyvsp[-1].ident); DBG(yyval.stat,yylsp[-2],yylsp[-1]);
     
    18531856    break;}
    18541857case 159:
    1855 #line 515 "grammar.y"
     1858#line 518 "grammar.y"
    18561859{ yyval.stat = new ReturnNode(0L); DBG(yyval.stat,yylsp[-1],yylsp[0]); ;
    18571860    break;}
    18581861case 160:
    1859 #line 516 "grammar.y"
     1862#line 519 "grammar.y"
    18601863{ if (automatic()) {
    18611864                                       yyval.stat = new ReturnNode(0L); DBG(yyval.stat,yylsp[-1],yylsp[-1]);
     
    18641867    break;}
    18651868case 161:
    1866 #line 520 "grammar.y"
     1869#line 523 "grammar.y"
    18671870{ yyval.stat = new ReturnNode(yyvsp[-1].node); ;
    18681871    break;}
    18691872case 162:
    1870 #line 521 "grammar.y"
     1873#line 524 "grammar.y"
    18711874{ if (automatic())
    18721875                                       yyval.stat = new ReturnNode(yyvsp[-1].node);
     
    18751878    break;}
    18761879case 163:
    1877 #line 528 "grammar.y"
     1880#line 531 "grammar.y"
    18781881{ yyval.stat = new WithNode(yyvsp[-2].node,yyvsp[0].stat);
    18791882                                     DBG(yyval.stat, yylsp[-4], yylsp[-1]); ;
    18801883    break;}
    18811884case 164:
    1882 #line 533 "grammar.y"
     1885#line 536 "grammar.y"
    18831886{ yyval.stat = new SwitchNode(yyvsp[-2].node, yyvsp[0].cblk);
    18841887                                     DBG(yyval.stat, yylsp[-4], yylsp[-1]); ;
    18851888    break;}
    18861889case 165:
    1887 #line 538 "grammar.y"
     1890#line 541 "grammar.y"
    18881891{ yyval.cblk = new CaseBlockNode(yyvsp[-1].clist, 0L, 0L); ;
    18891892    break;}
    18901893case 166:
    1891 #line 540 "grammar.y"
     1894#line 543 "grammar.y"
    18921895{ yyval.cblk = new CaseBlockNode(yyvsp[-3].clist, yyvsp[-2].ccl, yyvsp[-1].clist); ;
    18931896    break;}
    18941897case 167:
    1895 #line 544 "grammar.y"
     1898#line 547 "grammar.y"
    18961899{ yyval.clist = 0L; ;
    18971900    break;}
    18981901case 169:
    1899 #line 549 "grammar.y"
     1902#line 552 "grammar.y"
    19001903{ yyval.clist = new ClauseListNode(yyvsp[0].ccl); ;
    19011904    break;}
    19021905case 170:
    1903 #line 550 "grammar.y"
     1906#line 553 "grammar.y"
    19041907{ yyval.clist = new ClauseListNode(yyvsp[-1].clist, yyvsp[0].ccl); ;
    19051908    break;}
    19061909case 171:
    1907 #line 554 "grammar.y"
     1910#line 557 "grammar.y"
    19081911{ yyval.ccl = new CaseClauseNode(yyvsp[-1].node, 0L); ;
    19091912    break;}
    19101913case 172:
    1911 #line 555 "grammar.y"
     1914#line 558 "grammar.y"
    19121915{ yyval.ccl = new CaseClauseNode(yyvsp[-2].node, yyvsp[0].slist); ;
    19131916    break;}
    19141917case 173:
    1915 #line 559 "grammar.y"
     1918#line 562 "grammar.y"
    19161919{ yyval.ccl = new CaseClauseNode(0L, 0L);; ;
    19171920    break;}
    19181921case 174:
    1919 #line 560 "grammar.y"
     1922#line 563 "grammar.y"
    19201923{ yyval.ccl = new CaseClauseNode(0L, yyvsp[0].slist); ;
    19211924    break;}
    19221925case 175:
    1923 #line 564 "grammar.y"
     1926#line 567 "grammar.y"
    19241927{ yyvsp[0].stat->pushLabel(*yyvsp[-2].ident);
    19251928                                     yyval.stat = new LabelNode(*yyvsp[-2].ident, yyvsp[0].stat);
     
    19271930    break;}
    19281931case 176:
    1929 #line 570 "grammar.y"
     1932#line 573 "grammar.y"
    19301933{ yyval.stat = new ThrowNode(yyvsp[-1].node); ;
    19311934    break;}
    19321935case 177:
    1933 #line 574 "grammar.y"
     1936#line 577 "grammar.y"
    19341937{ yyval.stat = new TryNode(yyvsp[-1].stat, yyvsp[0].node); ;
    19351938    break;}
    19361939case 178:
    1937 #line 575 "grammar.y"
     1940#line 578 "grammar.y"
    19381941{ yyval.stat = new TryNode(yyvsp[-1].stat, 0L, yyvsp[0].node); ;
    19391942    break;}
    19401943case 179:
    1941 #line 576 "grammar.y"
     1944#line 579 "grammar.y"
    19421945{ yyval.stat = new TryNode(yyvsp[-2].stat, yyvsp[-1].node, yyvsp[0].node); ;
    19431946    break;}
    19441947case 180:
    1945 #line 580 "grammar.y"
     1948#line 583 "grammar.y"
    19461949{ yyval.node = new CatchNode(*yyvsp[-2].ident, yyvsp[0].stat); delete yyvsp[-2].ident; ;
    19471950    break;}
    19481951case 181:
    1949 #line 584 "grammar.y"
     1952#line 587 "grammar.y"
    19501953{ yyval.node = new FinallyNode(yyvsp[0].stat); ;
    19511954    break;}
    19521955case 182:
    1953 #line 588 "grammar.y"
     1956#line 591 "grammar.y"
    19541957{ yyval.func = new FuncDeclNode(*yyvsp[-3].ident, 0L, yyvsp[0].body);
    19551958                                             delete yyvsp[-3].ident; ;
    19561959    break;}
    19571960case 183:
    1958 #line 591 "grammar.y"
     1961#line 594 "grammar.y"
    19591962{ yyval.func = new FuncDeclNode(*yyvsp[-4].ident, yyvsp[-2].param, yyvsp[0].body);
    19601963                                     delete yyvsp[-4].ident; ;
    19611964    break;}
    19621965case 184:
    1963 #line 595 "grammar.y"
     1966#line 598 "grammar.y"
    19641967{ yyval.node = new FuncExprNode(0L, yyvsp[0].body); ;
    19651968    break;}
    19661969case 185:
    1967 #line 597 "grammar.y"
     1970#line 600 "grammar.y"
    19681971{ yyval.node = new FuncExprNode(yyvsp[-2].param, yyvsp[0].body); ;
    19691972    break;}
    19701973case 186:
    1971 #line 602 "grammar.y"
     1974#line 605 "grammar.y"
    19721975{ yyval.param = new ParameterNode(*yyvsp[0].ident); delete yyvsp[0].ident; ;
    19731976    break;}
    19741977case 187:
    1975 #line 603 "grammar.y"
     1978#line 606 "grammar.y"
    19761979{ yyval.param = new ParameterNode(yyvsp[-2].param, *yyvsp[0].ident); delete yyvsp[0].ident; ;
    19771980    break;}
    19781981case 188:
    1979 #line 607 "grammar.y"
     1982#line 610 "grammar.y"
    19801983{ yyval.body = new FunctionBodyNode(0L);
    19811984                                     DBG(yyval.body, yylsp[-1], yylsp[0]);;
    19821985    break;}
    19831986case 189:
    1984 #line 609 "grammar.y"
     1987#line 612 "grammar.y"
    19851988{ yyval.body = new FunctionBodyNode(yyvsp[-1].srcs);
    19861989                                     DBG(yyval.body, yylsp[-2], yylsp[0]);;
    19871990    break;}
    19881991case 190:
    1989 #line 614 "grammar.y"
     1992#line 617 "grammar.y"
    19901993{ yyval.prog = new ProgramNode(0L);
    19911994                                     Parser::progNode = yyval.prog; ;
    19921995    break;}
    19931996case 191:
    1994 #line 616 "grammar.y"
     1997#line 619 "grammar.y"
    19951998{ yyval.prog = new ProgramNode(yyvsp[0].srcs);
    19961999                                     Parser::progNode = yyval.prog; ;
    19972000    break;}
    19982001case 192:
    1999 #line 621 "grammar.y"
     2002#line 624 "grammar.y"
    20002003{ yyval.srcs = new SourceElementsNode(yyvsp[0].stat); ;
    20012004    break;}
    20022005case 193:
    2003 #line 622 "grammar.y"
     2006#line 625 "grammar.y"
    20042007{ yyval.srcs = new SourceElementsNode(yyvsp[-1].srcs, yyvsp[0].stat); ;
    20052008    break;}
    20062009case 194:
    2007 #line 626 "grammar.y"
     2010#line 629 "grammar.y"
    20082011{ yyval.stat = yyvsp[0].stat; ;
    20092012    break;}
    20102013case 195:
    2011 #line 627 "grammar.y"
     2014#line 630 "grammar.y"
    20122015{ yyval.stat = yyvsp[0].func; ;
    20132016    break;}
     
    22352238  return 1;
    22362239}
    2237 #line 630 "grammar.y"
     2240#line 633 "grammar.y"
    22382241
    22392242
Note: See TracChangeset for help on using the changeset viewer.