Changeset ca1eb1 in git
- Timestamp:
- May 11, 2011, 2:26:22 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
- Children:
- 568cf0845ad03f316fc5a94760ced50ad71135aa
- Parents:
- 121fd948ff7e5bb73a626cab71e2ca71e4f01dd5
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-05-11 14:26:22+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:36:03+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/readcf.cc
r121fd9 rca1eb1 79 79 80 80 /* Copy the first part of user declarations. */ 81 #line 4 "readcf.y "81 #line 4 "readcf.yy" 82 82 83 83 … … 294 294 # if (defined __cplusplus && ! defined _STDLIB_H \ 295 295 && ! ((defined YYMALLOC || defined malloc) \ 296 296 && (defined YYFREE || defined free))) 297 297 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 298 298 # ifndef _STDLIB_H … … 320 320 #if (! defined yyoverflow \ 321 321 && (! defined __cplusplus \ 322 322 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 323 323 324 324 /* A type that is properly aligned for any stack member. */ … … 345 345 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 346 346 # else 347 # define YYCOPY(To, From, Count) 348 do 349 {\350 YYSIZE_T yyi;\351 for (yyi = 0; yyi < (Count); yyi++)\352 (To)[yyi] = (From)[yyi];\353 }\347 # define YYCOPY(To, From, Count) \ 348 do \ 349 { \ 350 YYSIZE_T yyi; \ 351 for (yyi = 0; yyi < (Count); yyi++) \ 352 (To)[yyi] = (From)[yyi]; \ 353 } \ 354 354 while (YYID (0)) 355 355 # endif … … 361 361 stack. Advance YYPTR to a properly aligned location for the next 362 362 stack. */ 363 # define YYSTACK_RELOCATE(Stack) 364 do 365 { 366 YYSIZE_T yynewbytes;\367 YYCOPY (&yyptr->Stack, Stack, yysize);\368 Stack = &yyptr->Stack;\369 370 yyptr += yynewbytes / sizeof (*yyptr);\371 } 363 # define YYSTACK_RELOCATE(Stack) \ 364 do \ 365 { \ 366 YYSIZE_T yynewbytes; \ 367 YYCOPY (&yyptr->Stack, Stack, yysize); \ 368 Stack = &yyptr->Stack; \ 369 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 370 yyptr += yynewbytes / sizeof (*yyptr); \ 371 } \ 372 372 while (YYID (0)) 373 373 … … 392 392 #define YYMAXUTOK 259 393 393 394 #define YYTRANSLATE(YYX) 394 #define YYTRANSLATE(YYX) \ 395 395 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 396 396 … … 551 551 }; 552 552 553 #define yyerrok 554 #define yyclearin 555 #define YYEMPTY 556 #define YYEOF 557 558 #define YYACCEPT 559 #define YYABORT 560 #define YYERROR 553 #define yyerrok (yyerrstatus = 0) 554 #define yyclearin (yychar = YYEMPTY) 555 #define YYEMPTY (-2) 556 #define YYEOF 0 557 558 #define YYACCEPT goto yyacceptlab 559 #define YYABORT goto yyabortlab 560 #define YYERROR goto yyerrorlab 561 561 562 562 … … 565 565 Once GCC version 2 has supplanted version 1, this can go. */ 566 566 567 #define YYFAIL 567 #define YYFAIL goto yyerrlab 568 568 569 569 #define YYRECOVERING() (!!yyerrstatus) 570 570 571 #define YYBACKUP(Token, Value) 572 do 573 if (yychar == YYEMPTY && yylen == 1) 574 { 575 yychar = (Token); 576 yylval = (Value); 577 yytoken = YYTRANSLATE (yychar); 578 YYPOPSTACK (1); 579 goto yybackup; 580 } 581 else 582 { 571 #define YYBACKUP(Token, Value) \ 572 do \ 573 if (yychar == YYEMPTY && yylen == 1) \ 574 { \ 575 yychar = (Token); \ 576 yylval = (Value); \ 577 yytoken = YYTRANSLATE (yychar); \ 578 YYPOPSTACK (1); \ 579 goto yybackup; \ 580 } \ 581 else \ 582 { \ 583 583 yyerror (YY_("syntax error: cannot back up")); \ 584 YYERROR; 585 } 584 YYERROR; \ 585 } \ 586 586 while (YYID (0)) 587 587 588 588 589 #define YYTERROR 590 #define YYERRCODE 589 #define YYTERROR 1 590 #define YYERRCODE 256 591 591 592 592 … … 597 597 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 598 598 #ifndef YYLLOC_DEFAULT 599 # define YYLLOC_DEFAULT(Current, Rhs, N) 600 do 599 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 600 do \ 601 601 if (YYID (N)) \ 602 {\603 (Current).first_line = YYRHSLOC (Rhs, 1).first_line;\604 (Current).first_column = YYRHSLOC (Rhs, 1).first_column;\605 (Current).last_line = YYRHSLOC (Rhs, N).last_line;\606 (Current).last_column = YYRHSLOC (Rhs, N).last_column;\607 }\608 else 609 {\610 (Current).first_line = (Current).last_line =\611 YYRHSLOC (Rhs, 0).last_line;\612 (Current).first_column = (Current).last_column =\613 YYRHSLOC (Rhs, 0).last_column;\614 }\602 { \ 603 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 604 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 605 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 606 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 607 } \ 608 else \ 609 { \ 610 (Current).first_line = (Current).last_line = \ 611 YYRHSLOC (Rhs, 0).last_line; \ 612 (Current).first_column = (Current).last_column = \ 613 YYRHSLOC (Rhs, 0).last_column; \ 614 } \ 615 615 while (YYID (0)) 616 616 #endif … … 623 623 #ifndef YY_LOCATION_PRINT 624 624 # if YYLTYPE_IS_TRIVIAL 625 # define YY_LOCATION_PRINT(File, Loc) 626 fprintf (File, "%d.%d-%d.%d", 627 (Loc).first_line, (Loc).first_column,\628 625 # define YY_LOCATION_PRINT(File, Loc) \ 626 fprintf (File, "%d.%d-%d.%d", \ 627 (Loc).first_line, (Loc).first_column, \ 628 (Loc).last_line, (Loc).last_column) 629 629 # else 630 630 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) … … 649 649 # endif 650 650 651 # define YYDPRINTF(Args) 652 do { 653 if (yydebug) 654 YYFPRINTF Args; 651 # define YYDPRINTF(Args) \ 652 do { \ 653 if (yydebug) \ 654 YYFPRINTF Args; \ 655 655 } while (YYID (0)) 656 656 657 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 658 do { 659 if (yydebug) 660 { 661 YYFPRINTF (stderr, "%s ", Title); 662 yy_symbol_print (stderr, 663 664 YYFPRINTF (stderr, "\n"); 665 } 657 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 658 do { \ 659 if (yydebug) \ 660 { \ 661 YYFPRINTF (stderr, "%s ", Title); \ 662 yy_symbol_print (stderr, \ 663 Type, Value); \ 664 YYFPRINTF (stderr, "\n"); \ 665 } \ 666 666 } while (YYID (0)) 667 667 … … 695 695 { 696 696 default: 697 697 break; 698 698 } 699 699 } … … 747 747 } 748 748 749 # define YY_STACK_PRINT(Bottom, Top) 750 do { 751 if (yydebug) 752 yy_stack_print ((Bottom), (Top)); 749 # define YY_STACK_PRINT(Bottom, Top) \ 750 do { \ 751 if (yydebug) \ 752 yy_stack_print ((Bottom), (Top)); \ 753 753 } while (YYID (0)) 754 754 … … 773 773 unsigned long int yylno = yyrline[yyrule]; 774 774 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 775 775 yyrule - 1, yylno); 776 776 /* The symbols being reduced. */ 777 777 for (yyi = 0; yyi < yynrhs; yyi++) … … 779 779 fprintf (stderr, " $%d = ", yyi + 1); 780 780 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 781 782 781 &(yyvsp[(yyi + 1) - (yynrhs)]) 782 ); 783 783 fprintf (stderr, "\n"); 784 784 } 785 785 } 786 786 787 # define YY_REDUCE_PRINT(Rule) 788 do { 789 if (yydebug) 787 # define YY_REDUCE_PRINT(Rule) \ 788 do { \ 789 if (yydebug) \ 790 790 yy_reduce_print (yyvsp, Rule); \ 791 791 } while (YYID (0)) … … 803 803 804 804 /* YYINITDEPTH -- initial size of the parser's stacks. */ 805 #ifndef 805 #ifndef YYINITDEPTH 806 806 # define YYINITDEPTH 200 807 807 #endif … … 891 891 892 892 for (;;) 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 893 switch (*++yyp) 894 { 895 case '\'': 896 case ',': 897 goto do_not_strip_quotes; 898 899 case '\\': 900 if (*++yyp != '\\') 901 goto do_not_strip_quotes; 902 /* Fall through. */ 903 default: 904 if (yyres) 905 yyres[yyn] = *yyp; 906 yyn++; 907 break; 908 909 case '"': 910 if (yyres) 911 yyres[yyn] = '\0'; 912 return yyn; 913 } 914 914 do_not_strip_quotes: ; 915 915 } … … 949 949 # if 0 950 950 /* This is so xgettext sees the translatable formats that are 951 951 constructed on the fly. */ 952 952 YY_("syntax error, unexpected %s"); 953 953 YY_("syntax error, unexpected %s, expecting %s"); … … 962 962 static char const yyor[] = " or %s"; 963 963 char yyformat[sizeof yyunexpected 964 965 966 964 + sizeof yyexpecting - 1 965 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 966 * (sizeof yyor - 1))]; 967 967 char const *yyprefix = yyexpecting; 968 968 969 969 /* Start YYX at -YYN if negative to avoid negative indexes in 970 970 YYCHECK. */ 971 971 int yyxbegin = yyn < 0 ? -yyn : 0; 972 972 … … 980 980 981 981 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 982 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 983 { 984 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 985 { 986 yycount = 1; 987 yysize = yysize0; 988 yyformat[sizeof yyunexpected - 1] = '\0'; 989 break; 990 } 991 yyarg[yycount++] = yytname[yyx]; 992 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 993 yysize_overflow |= (yysize1 < yysize); 994 yysize = yysize1; 995 yyfmt = yystpcpy (yyfmt, yyprefix); 996 yyprefix = yyor; 997 } 998 998 999 999 yyf = YY_(yyformat); … … 1003 1003 1004 1004 if (yysize_overflow) 1005 1005 return YYSIZE_MAXIMUM; 1006 1006 1007 1007 if (yyresult) 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1008 { 1009 /* Avoid sprintf, as that infringes on the user's name space. 1010 Don't have undefined behavior even if the translation 1011 produced a string with the wrong number of "%s"s. */ 1012 char *yyp = yyresult; 1013 int yyi = 0; 1014 while ((*yyp = *yyf) != '\0') 1015 { 1016 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) 1017 { 1018 yyp += yytnamerr (yyp, yyarg[yyi++]); 1019 yyf += 2; 1020 } 1021 else 1022 { 1023 yyp++; 1024 yyf++; 1025 } 1026 } 1027 } 1028 1028 return yysize; 1029 1029 } … … 1060 1060 1061 1061 default: 1062 1062 break; 1063 1063 } 1064 1064 } … … 1121 1121 #endif 1122 1122 { 1123 1123 1124 1124 int yystate; 1125 1125 int yyn; … … 1174 1174 yyerrstatus = 0; 1175 1175 yynerrs = 0; 1176 yychar = YYEMPTY; /* Cause a token to be read. */1176 yychar = YYEMPTY; /* Cause a token to be read. */ 1177 1177 1178 1178 /* Initialize stack pointers. … … 1204 1204 #ifdef yyoverflow 1205 1205 { 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1206 /* Give user a chance to reallocate the stack. Use copies of 1207 these so that the &'s don't force the real ones into 1208 memory. */ 1209 YYSTYPE *yyvs1 = yyvs; 1210 yytype_int16 *yyss1 = yyss; 1211 1212 1213 /* Each stack pointer address is followed by the size of the 1214 data in use in that stack, in bytes. This used to be a 1215 conditional around just the two extra args, but that might 1216 be undefined if yyoverflow is a macro. */ 1217 yyoverflow (YY_("memory exhausted"), 1218 &yyss1, yysize * sizeof (*yyssp), 1219 &yyvs1, yysize * sizeof (*yyvsp), 1220 1221 &yystacksize); 1222 1223 yyss = yyss1; 1224 yyvs = yyvs1; 1225 1225 } 1226 1226 #else /* no yyoverflow */ … … 1230 1230 /* Extend the stack our own way. */ 1231 1231 if (YYMAXDEPTH <= yystacksize) 1232 1232 goto yyexhaustedlab; 1233 1233 yystacksize *= 2; 1234 1234 if (YYMAXDEPTH < yystacksize) 1235 1235 yystacksize = YYMAXDEPTH; 1236 1236 1237 1237 { 1238 1239 1240 1241 1242 1243 1244 1238 yytype_int16 *yyss1 = yyss; 1239 union yyalloc *yyptr = 1240 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1241 if (! yyptr) 1242 goto yyexhaustedlab; 1243 YYSTACK_RELOCATE (yyss); 1244 YYSTACK_RELOCATE (yyvs); 1245 1245 1246 1246 # undef YYSTACK_RELOCATE 1247 1248 1247 if (yyss1 != yyssa) 1248 YYSTACK_FREE (yyss1); 1249 1249 } 1250 1250 # endif … … 1256 1256 1257 1257 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1258 1258 (unsigned long int) yystacksize)); 1259 1259 1260 1260 if (yyss + yystacksize - 1 <= yyssp) 1261 1261 YYABORT; 1262 1262 } 1263 1263 … … 1308 1308 { 1309 1309 if (yyn == 0 || yyn == YYTABLE_NINF) 1310 1310 goto yyerrlab; 1311 1311 yyn = -yyn; 1312 1312 goto yyreduce; … … 1366 1366 { 1367 1367 case 5: 1368 #line 71 "readcf.y "1369 { *retvalue = (yyvsp[(1) - (2)]).getval(); return 0; ;}1368 #line 71 "readcf.yy" 1369 { *retvalue = (yyvsp[(1) - (2)]).getval(); return 0; } 1370 1370 break; 1371 1371 1372 1372 case 6: 1373 #line 74 "readcf.y "1374 { (yyval) = (yyvsp[(1) - (1)]); ;}1373 #line 74 "readcf.yy" 1374 { (yyval) = (yyvsp[(1) - (1)]); } 1375 1375 break; 1376 1376 1377 1377 case 7: 1378 #line 75 "readcf.y "1379 { (yyval) = (yyvsp[(1) - (3)]).getval() + (yyvsp[(3) - (3)]).getval(); ;}1378 #line 75 "readcf.yy" 1379 { (yyval) = (yyvsp[(1) - (3)]).getval() + (yyvsp[(3) - (3)]).getval(); } 1380 1380 break; 1381 1381 1382 1382 case 8: 1383 #line 76 "readcf.y "1384 { (yyval) = (yyvsp[(1) - (3)]).getval() - (yyvsp[(3) - (3)]).getval(); ;}1383 #line 76 "readcf.yy" 1384 { (yyval) = (yyvsp[(1) - (3)]).getval() - (yyvsp[(3) - (3)]).getval(); } 1385 1385 break; 1386 1386 1387 1387 case 9: 1388 #line 77 "readcf.y "1389 { (yyval) = (yyvsp[(1) - (3)]).getval() * (yyvsp[(3) - (3)]).getval(); ;}1388 #line 77 "readcf.yy" 1389 { (yyval) = (yyvsp[(1) - (3)]).getval() * (yyvsp[(3) - (3)]).getval(); } 1390 1390 break; 1391 1391 1392 1392 case 10: 1393 #line 78 "readcf.y "1394 { (yyval) = (yyvsp[(1) - (3)]).getval() / (yyvsp[(3) - (3)]).getval(); ;}1393 #line 78 "readcf.yy" 1394 { (yyval) = (yyvsp[(1) - (3)]).getval() / (yyvsp[(3) - (3)]).getval(); } 1395 1395 break; 1396 1396 1397 1397 case 11: 1398 #line 79 "readcf.y "1399 { (yyval) = -(yyvsp[(2) - (2)]).getval(); ;}1398 #line 79 "readcf.yy" 1399 { (yyval) = -(yyvsp[(2) - (2)]).getval(); } 1400 1400 break; 1401 1401 1402 1402 case 12: 1403 #line 80 "readcf.y "1404 { (yyval) = (yyvsp[(2) - (2)]).getval(); ;}1403 #line 80 "readcf.yy" 1404 { (yyval) = (yyvsp[(2) - (2)]).getval(); } 1405 1405 break; 1406 1406 1407 1407 case 13: 1408 #line 81 "readcf.y "1409 { (yyval) = power( (yyvsp[(1) - (3)]).getval(), (yyvsp[(3) - (3)]).getintval() ); ;}1408 #line 81 "readcf.yy" 1409 { (yyval) = power( (yyvsp[(1) - (3)]).getval(), (yyvsp[(3) - (3)]).getintval() ); } 1410 1410 break; 1411 1411 1412 1412 case 14: 1413 #line 82 "readcf.y "1414 { (yyval) = (yyvsp[(2) - (3)]).getval(); ;}1413 #line 82 "readcf.yy" 1414 { (yyval) = (yyvsp[(2) - (3)]).getval(); } 1415 1415 break; 1416 1416 … … 1456 1456 #else 1457 1457 { 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1458 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); 1459 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) 1460 { 1461 YYSIZE_T yyalloc = 2 * yysize; 1462 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) 1463 yyalloc = YYSTACK_ALLOC_MAXIMUM; 1464 if (yymsg != yymsgbuf) 1465 YYSTACK_FREE (yymsg); 1466 yymsg = (char *) YYSTACK_ALLOC (yyalloc); 1467 if (yymsg) 1468 yymsg_alloc = yyalloc; 1469 else 1470 { 1471 yymsg = yymsgbuf; 1472 yymsg_alloc = sizeof yymsgbuf; 1473 } 1474 } 1475 1476 if (0 < yysize && yysize <= yymsg_alloc) 1477 { 1478 (void) yysyntax_error (yymsg, yystate, yychar); 1479 yyerror (yymsg); 1480 } 1481 else 1482 { 1483 yyerror (YY_("syntax error")); 1484 if (yysize != 0) 1485 goto yyexhaustedlab; 1486 } 1487 1487 } 1488 1488 #endif … … 1494 1494 { 1495 1495 /* If just tried and failed to reuse look-ahead token after an 1496 1496 error, discard it. */ 1497 1497 1498 1498 if (yychar <= YYEOF) 1499 1500 1501 1502 1503 1499 { 1500 /* Return failure if at end of input. */ 1501 if (yychar == YYEOF) 1502 YYABORT; 1503 } 1504 1504 else 1505 1506 1507 1508 1509 1505 { 1506 yydestruct ("Error: discarding", 1507 yytoken, &yylval); 1508 yychar = YYEMPTY; 1509 } 1510 1510 } 1511 1511 … … 1539 1539 `-------------------------------------------------------------*/ 1540 1540 yyerrlab1: 1541 yyerrstatus = 3; 1541 yyerrstatus = 3; /* Each real token shifted decrements this. */ 1542 1542 1543 1543 for (;;) … … 1545 1545 yyn = yypact[yystate]; 1546 1546 if (yyn != YYPACT_NINF) 1547 1548 1549 1550 1551 1552 1553 1554 1555 1547 { 1548 yyn += YYTERROR; 1549 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 1550 { 1551 yyn = yytable[yyn]; 1552 if (0 < yyn) 1553 break; 1554 } 1555 } 1556 1556 1557 1557 /* Pop the current state because it cannot handle the error token. */ 1558 1558 if (yyssp == yyss) 1559 1559 YYABORT; 1560 1560 1561 1561 1562 1562 yydestruct ("Error: popping", 1563 1563 yystos[yystate], yyvsp); 1564 1564 YYPOPSTACK (1); 1565 1565 yystate = *yyssp; … … 1607 1607 if (yychar != YYEOF && yychar != YYEMPTY) 1608 1608 yydestruct ("Cleanup: discarding lookahead", 1609 1609 yytoken, &yylval); 1610 1610 /* Do not reclaim the symbols of the rule which action triggered 1611 1611 this YYABORT or YYACCEPT. */ … … 1615 1615 { 1616 1616 yydestruct ("Cleanup: popping", 1617 1617 yystos[*yyssp], yyvsp); 1618 1618 YYPOPSTACK (1); 1619 1619 } … … 1631 1631 1632 1632 1633 #line 85 "readcf.y "1633 #line 85 "readcf.yy" 1634 1634 1635 1635
Note: See TracChangeset
for help on using the changeset viewer.