1/* original parser id follows */ 2/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ |
3/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ |
4 5#define YYBYACC 1 6#define YYMAJOR 1 7#define YYMINOR 9 8#define YYCHECK "yyyymmdd" 9 10#define YYEMPTY (-1) 11#define yyclearin (yychar = YYEMPTY) --- 293 unchanged lines hidden (view full) --- 305 43, -1, 45, -1, 47, -1, 42, 43, -1, 45, 306 -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, 307 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 308 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 309 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310 -1, -1, -1, -1, -1, 256, 257, 258, 259, 257, 311 258, 259, 257, -1, 259, 312}; |
313#if YYBTYACC 314static const YYINT calc1_ctable[] = { -1, 315 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 316 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 317 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 318 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 319 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 320 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 321 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 322 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 323 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 325 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 326 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 327 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 328 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 329 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 330 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 331 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 332 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 333 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 334 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 335 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 336 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 337 -1, -1, -1, -1, 338}; 339#endif |
340#define YYFINAL 7 341#ifndef YYDEBUG 342#define YYDEBUG 0 343#endif 344#define YYMAXTOKEN 260 345#define YYUNDFTOKEN 266 346#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) 347#if YYDEBUG --- 293 unchanged lines hidden (view full) --- 641 return (0); 642} 643 644INTERVAL 645vdiv(double a, double b, INTERVAL v) 646{ 647 return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); 648} |
649#line 650 "calc1.tab.c" |
650 651/* For use in generated program */ 652#define yydepth (int)(yystack.s_mark - yystack.s_base) 653#if YYBTYACC 654#define yytrial (yyps->save) 655#endif /* YYBTYACC */ 656 657#if YYDEBUG |
658#include <stdio.h> /* needed for printf */ |
659#endif 660 |
661#include <stdlib.h> /* needed for malloc, etc */ 662#include <string.h> /* needed for memset */ |
663 664/* allocate initial stack or double stack size, up to YYMAXDEPTH */ 665static int yygrowstack(YYSTACKDATA *data) 666{ 667 int i; 668 unsigned newsize; 669 short *newss; 670 YYSTYPE *newvs; --- 167 unchanged lines hidden (view full) --- 838 yychar = *yylexp++; 839 break; 840 } 841 if (yyps->save) 842 { 843 /* in trial mode; save scanner results for future parse attempts */ 844 if (yylvp == yylvlim) 845 { /* Enlarge lexical value queue */ |
846 size_t p = (size_t) (yylvp - yylvals); 847 size_t s = (size_t) (yylvlim - yylvals); |
848 849 s += YYLVQUEUEGROWTH; 850 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; 851 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; 852#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 853 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; 854#endif 855 yylvp = yylve = yylvals + p; --- 79 unchanged lines hidden (view full) --- 935 } 936#endif 937 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 938 if (save == NULL) goto yyenomem; 939 save->save = yyps->save; 940 save->state = yystate; 941 save->errflag = yyerrflag; 942 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base); |
943 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); |
944 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base); |
945 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); |
946#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 947 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base); |
948 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); |
949#endif 950 ctry = yytable[yyn]; 951 if (yyctable[ctry] == -1) 952 { 953#if YYDEBUG 954 if (yydebug && yychar >= YYEOF) 955 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth); 956#endif --- 38 unchanged lines hidden (view full) --- 995 { 996 yylvp--; 997#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 998 yylpp--; 999#endif 1000 yylexp--; 1001 yychar = YYEMPTY; 1002 } |
1003 save->lexeme = (int) (yylvp - yylvals); |
1004 yyps->save = save; 1005 } 1006 if (yytable[yyn] == ctry) 1007 { 1008#if YYDEBUG 1009 if (yydebug) 1010 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", 1011 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]); --- 77 unchanged lines hidden (view full) --- 1089 if (yyerrctx) yyFreeState(yyerrctx); 1090 /* Create and fill out new saved error context state */ 1091 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 1092 if (yyerrctx == NULL) goto yyenomem; 1093 yyerrctx->save = yyps->save; 1094 yyerrctx->state = yystate; 1095 yyerrctx->errflag = yyerrflag; 1096 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base); |
1097 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); |
1098 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base); |
1099 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); |
1100#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1101 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base); |
1102 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); |
1103#endif |
1104 yyerrctx->lexeme = (int) (yylvp - yylvals); |
1105 } 1106 yylvp = yylvals + save->lexeme; 1107#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1108 yylpp = yylpsns + save->lexeme; 1109#endif 1110 yylexp = yylexemes + save->lexeme; 1111 yychar = YYEMPTY; 1112 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base); |
1113 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); |
1114 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base); |
1115 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); |
1116#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1117 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base); |
1118 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); |
1119#endif 1120 ctry = ++save->ctry; 1121 yystate = save->state; 1122 /* We tried shift, try reduce now */ 1123 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce; 1124 yyps->save = save->save; 1125 save->save = NULL; 1126 yyFreeState(save); --- 13 unchanged lines hidden (view full) --- 1140#endif 1141 yylexp = yylexemes + yyerrctx->lexeme; 1142 yychar = yylexp[-1]; 1143 yylval = yylvp[-1]; 1144#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1145 yylloc = yylpp[-1]; 1146#endif 1147 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base); |
1148 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); |
1149 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base); |
1150 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); |
1151#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1152 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base); |
1153 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); |
1154#endif 1155 yystate = yyerrctx->state; 1156 yyFreeState(yyerrctx); 1157 yyerrctx = NULL; 1158 } 1159 yynewerrflag = 1; 1160 } 1161 if (yynewerrflag == 0) goto yyinrecovery; --- 299 unchanged lines hidden (view full) --- 1461 } 1462break; 1463case 28: 1464#line 171 "calc1.y" 1465 { 1466 yyval.vval = yystack.l_mark[-1].vval; 1467 } 1468break; |
1469#line 1470 "calc1.tab.c" |
1470 default: 1471 break; 1472 } 1473 yystack.s_mark -= yym; 1474 yystate = *yystack.s_mark; 1475 yystack.l_mark -= yym; 1476#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1477 yystack.p_mark -= yym; --- 34 unchanged lines hidden (view full) --- 1512 yychar = *yylexp++; 1513 break; 1514 } 1515 if (yyps->save) 1516 { 1517 /* in trial mode; save scanner results for future parse attempts */ 1518 if (yylvp == yylvlim) 1519 { /* Enlarge lexical value queue */ |
1520 size_t p = (size_t) (yylvp - yylvals); 1521 size_t s = (size_t) (yylvlim - yylvals); |
1522 1523 s += YYLVQUEUEGROWTH; 1524 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) 1525 goto yyenomem; 1526 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) 1527 goto yyenomem; 1528#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1529 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) --- 86 unchanged lines hidden (view full) --- 1616 } 1617 yylvp = yylvals + yypath->lexeme; 1618#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1619 yylpp = yylpsns + yypath->lexeme; 1620#endif 1621 yylexp = yylexemes + yypath->lexeme; 1622 yychar = YYEMPTY; 1623 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base); |
1624 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); |
1625 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base); |
1626 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); |
1627#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1628 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base); |
1629 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); |
1630#endif 1631 yystate = yypath->state; 1632 goto yyloop; 1633#endif /* YYBTYACC */ 1634 1635yyoverflow: 1636 YYERROR_CALL("yacc stack overflow"); 1637#if YYBTYACC --- 67 unchanged lines hidden --- |