Tue Apr 14 14:08:21 2015 UTC ()
- remove malloc/realloc casts.
- use YYINT instead of short.


(christos)
diff -r1.1.1.1 -r1.2 src/external/bsd/byacc/dist/btyaccpar.skel

cvs diff -r1.1.1.1 -r1.2 src/external/bsd/byacc/dist/btyaccpar.skel (expand / switch to unified diff)

--- src/external/bsd/byacc/dist/btyaccpar.skel 2015/01/03 22:58:23 1.1.1.1
+++ src/external/bsd/byacc/dist/btyaccpar.skel 2015/04/14 14:08:21 1.2
@@ -103,29 +103,29 @@ do \ @@ -103,29 +103,29 @@ do \
103#define YYSTACKSIZE YYMAXDEPTH 103#define YYSTACKSIZE YYMAXDEPTH
104#else 104#else
105#define YYSTACKSIZE 10000 105#define YYSTACKSIZE 10000
106#define YYMAXDEPTH 10000 106#define YYMAXDEPTH 10000
107#endif 107#endif
108#endif 108#endif
109 109
110#ifndef YYINITSTACKSIZE 110#ifndef YYINITSTACKSIZE
111#define YYINITSTACKSIZE 200 111#define YYINITSTACKSIZE 200
112#endif 112#endif
113 113
114typedef struct { 114typedef struct {
115 unsigned stacksize; 115 unsigned stacksize;
116 short *s_base; 116 YYINT *s_base;
117 short *s_mark; 117 YYINT *s_mark;
118 short *s_last; 118 YYINT *s_last;
119 YYSTYPE *l_base; 119 YYSTYPE *l_base;
120 YYSTYPE *l_mark; 120 YYSTYPE *l_mark;
121#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 121#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
122 YYLTYPE *p_base; 122 YYLTYPE *p_base;
123 YYLTYPE *p_mark; 123 YYLTYPE *p_mark;
124#endif 124#endif
125} YYSTACKDATA; 125} YYSTACKDATA;
126%%ifdef YYBTYACC 126%%ifdef YYBTYACC
127 127
128struct YYParseState_s 128struct YYParseState_s
129{ 129{
130 struct YYParseState_s *save; /* Previously saved parser state */ 130 struct YYParseState_s *save; /* Previously saved parser state */
131 YYSTACKDATA yystack; /* saved parser stack */ 131 YYSTACKDATA yystack; /* saved parser stack */
@@ -164,29 +164,29 @@ static YYSTYPE *yylvlim = 0; @@ -164,29 +164,29 @@ static YYSTYPE *yylvlim = 0;
164static YYLTYPE *yylpsns = 0; 164static YYLTYPE *yylpsns = 0;
165 165
166/* Current position at lexical position queue */ 166/* Current position at lexical position queue */
167static YYLTYPE *yylpp = 0; 167static YYLTYPE *yylpp = 0;
168 168
169/* End position of lexical position queue */ 169/* End position of lexical position queue */
170static YYLTYPE *yylpe = 0; 170static YYLTYPE *yylpe = 0;
171 171
172/* The last allocated position at the lexical position queue */ 172/* The last allocated position at the lexical position queue */
173static YYLTYPE *yylplim = 0; 173static YYLTYPE *yylplim = 0;
174#endif 174#endif
175 175
176/* Current position at lexical token queue */ 176/* Current position at lexical token queue */
177static short *yylexp = 0; 177static YYINT *yylexp = 0;
178 178
179static short *yylexemes = 0; 179static YYINT *yylexemes = 0;
180%%endif YYBTYACC 180%%endif YYBTYACC
181%% body_vars 181%% body_vars
182 int yyerrflag; 182 int yyerrflag;
183 int yychar; 183 int yychar;
184 YYSTYPE yyval; 184 YYSTYPE yyval;
185 YYSTYPE yylval; 185 YYSTYPE yylval;
186#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 186#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
187 YYLTYPE yyloc; /* position returned by actions */ 187 YYLTYPE yyloc; /* position returned by actions */
188 YYLTYPE yylloc; /* position from the lexer */ 188 YYLTYPE yylloc; /* position from the lexer */
189#endif 189#endif
190 190
191 /* variables for the parser stack */ 191 /* variables for the parser stack */
192 YYSTACKDATA yystack; 192 YYSTACKDATA yystack;
@@ -215,65 +215,65 @@ static short *yylexemes = 0; @@ -215,65 +215,65 @@ static short *yylexemes = 0;
215 static YYLTYPE *yylpsns = 0; 215 static YYLTYPE *yylpsns = 0;
216 216
217 /* Current position at lexical position queue */ 217 /* Current position at lexical position queue */
218 static YYLTYPE *yylpp = 0; 218 static YYLTYPE *yylpp = 0;
219 219
220 /* End position of lexical position queue */ 220 /* End position of lexical position queue */
221 static YYLTYPE *yylpe = 0; 221 static YYLTYPE *yylpe = 0;
222 222
223 /* The last allocated position at the lexical position queue */ 223 /* The last allocated position at the lexical position queue */
224 static YYLTYPE *yylplim = 0; 224 static YYLTYPE *yylplim = 0;
225#endif 225#endif
226 226
227 /* Current position at lexical token queue */ 227 /* Current position at lexical token queue */
228 static short *yylexp = 0; 228 static YYINT *yylexp = 0;
229 229
230 static short *yylexemes = 0; 230 static YYINT *yylexemes = 0;
231%%endif YYBTYACC 231%%endif YYBTYACC
232%% body_1 232%% body_1
233 233
234/* For use in generated program */ 234/* For use in generated program */
235#define yydepth (int)(yystack.s_mark - yystack.s_base) 235#define yydepth (int)(yystack.s_mark - yystack.s_base)
236%%ifdef YYBTYACC 236%%ifdef YYBTYACC
237#define yytrial (yyps->save) 237#define yytrial (yyps->save)
238%%endif 238%%endif
239 239
240#if YYDEBUG 240#if YYDEBUG
241#include <stdio.h> /* needed for printf */ 241#include <stdio.h> /* needed for printf */
242#endif 242#endif
243 243
244#include <stdlib.h> /* needed for malloc, etc */ 244#include <stdlib.h> /* needed for malloc, etc */
245#include <string.h> /* needed for memset */ 245#include <string.h> /* needed for memset */
246 246
247/* allocate initial stack or double stack size, up to YYMAXDEPTH */ 247/* allocate initial stack or double stack size, up to YYMAXDEPTH */
248static int yygrowstack(YYSTACKDATA *data) 248static int yygrowstack(YYSTACKDATA *data)
249{ 249{
250 int i; 250 int i;
251 unsigned newsize; 251 unsigned newsize;
252 short *newss; 252 YYINT *newss;
253 YYSTYPE *newvs; 253 YYSTYPE *newvs;
254#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 254#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
255 YYLTYPE *newps; 255 YYLTYPE *newps;
256#endif 256#endif
257 257
258 if ((newsize = data->stacksize) == 0) 258 if ((newsize = data->stacksize) == 0)
259 newsize = YYINITSTACKSIZE; 259 newsize = YYINITSTACKSIZE;
260 else if (newsize >= YYMAXDEPTH) 260 else if (newsize >= YYMAXDEPTH)
261 return YYENOMEM; 261 return YYENOMEM;
262 else if ((newsize *= 2) > YYMAXDEPTH) 262 else if ((newsize *= 2) > YYMAXDEPTH)
263 newsize = YYMAXDEPTH; 263 newsize = YYMAXDEPTH;
264 264
265 i = (int) (data->s_mark - data->s_base); 265 i = (int) (data->s_mark - data->s_base);
266 newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); 266 newss = realloc(data->s_base, newsize * sizeof(*newss));
267 if (newss == 0) 267 if (newss == 0)
268 return YYENOMEM; 268 return YYENOMEM;
269 269
270 data->s_base = newss; 270 data->s_base = newss;
271 data->s_mark = newss + i; 271 data->s_mark = newss + i;
272 272
273 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); 273 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
274 if (newvs == 0) 274 if (newvs == 0)
275 return YYENOMEM; 275 return YYENOMEM;
276 276
277 data->l_base = newvs; 277 data->l_base = newvs;
278 data->l_mark = newvs + i; 278 data->l_mark = newvs + i;
279 279
@@ -317,33 +317,33 @@ yyNewState(unsigned size) @@ -317,33 +317,33 @@ yyNewState(unsigned size)
317 YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState)); 317 YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
318 if (p == NULL) return NULL; 318 if (p == NULL) return NULL;
319 319
320 p->yystack.stacksize = size; 320 p->yystack.stacksize = size;
321 if (size == 0) 321 if (size == 0)
322 { 322 {
323 p->yystack.s_base = NULL; 323 p->yystack.s_base = NULL;
324 p->yystack.l_base = NULL; 324 p->yystack.l_base = NULL;
325#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 325#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
326 p->yystack.p_base = NULL; 326 p->yystack.p_base = NULL;
327#endif 327#endif
328 return p; 328 return p;
329 } 329 }
330 p->yystack.s_base = (short *) malloc(size * sizeof(short)); 330 p->yystack.s_base = malloc(size * sizeof(YYINT));
331 if (p->yystack.s_base == NULL) return NULL; 331 if (p->yystack.s_base == NULL) return NULL;
332 p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE)); 332 p->yystack.l_base = malloc(size * sizeof(YYSTYPE));
333 if (p->yystack.l_base == NULL) return NULL; 333 if (p->yystack.l_base == NULL) return NULL;
334 memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE)); 334 memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
335#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 335#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
336 p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE)); 336 p->yystack.p_base = malloc(size * sizeof(YYLTYPE));
337 if (p->yystack.p_base == NULL) return NULL; 337 if (p->yystack.p_base == NULL) return NULL;
338 memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE)); 338 memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
339#endif 339#endif
340 340
341 return p; 341 return p;
342} 342}
343 343
344static void 344static void
345yyFreeState(YYParseState *p) 345yyFreeState(YYParseState *p)
346{ 346{
347 yyfreestack(&p->yystack); 347 yyfreestack(&p->yystack);
348 free(p); 348 free(p);
349} 349}
@@ -421,40 +421,40 @@ yyloop: @@ -421,40 +421,40 @@ yyloop:
421#endif 421#endif
422 yychar = *yylexp++; 422 yychar = *yylexp++;
423 break; 423 break;
424 } 424 }
425 if (yyps->save) 425 if (yyps->save)
426 { 426 {
427 /* in trial mode; save scanner results for future parse attempts */ 427 /* in trial mode; save scanner results for future parse attempts */
428 if (yylvp == yylvlim) 428 if (yylvp == yylvlim)
429 { /* Enlarge lexical value queue */ 429 { /* Enlarge lexical value queue */
430 int p = yylvp - yylvals; 430 int p = yylvp - yylvals;
431 int s = yylvlim - yylvals; 431 int s = yylvlim - yylvals;
432 432
433 s += YYLVQUEUEGROWTH; 433 s += YYLVQUEUEGROWTH;
434 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; 434 if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;
435 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; 435 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
436#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 436#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
437 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; 437 if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
438#endif 438#endif
439 yylvp = yylve = yylvals + p; 439 yylvp = yylve = yylvals + p;
440 yylvlim = yylvals + s; 440 yylvlim = yylvals + s;
441#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 441#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
442 yylpp = yylpe = yylpsns + p; 442 yylpp = yylpe = yylpsns + p;
443 yylplim = yylpsns + s; 443 yylplim = yylpsns + s;
444#endif 444#endif
445 yylexp = yylexemes + p; 445 yylexp = yylexemes + p;
446 } 446 }
447 *yylexp = (short) YYLEX; 447 *yylexp = (YYINT) YYLEX;
448 *yylvp++ = yylval; 448 *yylvp++ = yylval;
449 yylve++; 449 yylve++;
450#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 450#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
451 *yylpp++ = yylloc; 451 *yylpp++ = yylloc;
452 yylpe++; 452 yylpe++;
453#endif 453#endif
454 yychar = *yylexp++; 454 yychar = *yylexp++;
455 break; 455 break;
456 } 456 }
457 /* normal operation, no conflict encountered */ 457 /* normal operation, no conflict encountered */
458%%endif YYBTYACC 458%%endif YYBTYACC
459 yychar = YYLEX; 459 yychar = YYLEX;
460%%ifdef YYBTYACC 460%%ifdef YYBTYACC
@@ -514,73 +514,73 @@ yyloop: @@ -514,73 +514,73 @@ yyloop:
514 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate); 514 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
515 if (yyps->save) 515 if (yyps->save)
516 fputs("ALREADY in conflict, continuing trial parse.\n", stderr); 516 fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
517 else 517 else
518 fputs("Starting trial parse.\n", stderr); 518 fputs("Starting trial parse.\n", stderr);
519 } 519 }
520#endif 520#endif
521 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 521 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
522 if (save == NULL) goto yyenomem; 522 if (save == NULL) goto yyenomem;
523 save->save = yyps->save; 523 save->save = yyps->save;
524 save->state = yystate; 524 save->state = yystate;
525 save->errflag = yyerrflag; 525 save->errflag = yyerrflag;
526 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base); 526 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
527 memcpy (save->yystack.s_base, yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); 527 memcpy (save->yystack.s_base, yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
528 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base); 528 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
529 memcpy (save->yystack.l_base, yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 529 memcpy (save->yystack.l_base, yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
530#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 530#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
531 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base); 531 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
532 memcpy (save->yystack.p_base, yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 532 memcpy (save->yystack.p_base, yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
533#endif 533#endif
534 ctry = yytable[yyn]; 534 ctry = yytable[yyn];
535 if (yyctable[ctry] == -1) 535 if (yyctable[ctry] == -1)
536 { 536 {
537#if YYDEBUG 537#if YYDEBUG
538 if (yydebug && yychar >= YYEOF) 538 if (yydebug && yychar >= YYEOF)
539 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth); 539 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
540#endif 540#endif
541 ctry++; 541 ctry++;
542 } 542 }
543 save->ctry = ctry; 543 save->ctry = ctry;
544 if (yyps->save == NULL) 544 if (yyps->save == NULL)
545 { 545 {
546 /* If this is a first conflict in the stack, start saving lexemes */ 546 /* If this is a first conflict in the stack, start saving lexemes */
547 if (!yylexemes) 547 if (!yylexemes)
548 { 548 {
549 yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); 549 yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));
550 if (yylexemes == NULL) goto yyenomem; 550 if (yylexemes == NULL) goto yyenomem;
551 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); 551 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
552 if (yylvals == NULL) goto yyenomem; 552 if (yylvals == NULL) goto yyenomem;
553 yylvlim = yylvals + YYLVQUEUEGROWTH; 553 yylvlim = yylvals + YYLVQUEUEGROWTH;
554#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 554#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
555 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE)); 555 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
556 if (yylpsns == NULL) goto yyenomem; 556 if (yylpsns == NULL) goto yyenomem;
557 yylplim = yylpsns + YYLVQUEUEGROWTH; 557 yylplim = yylpsns + YYLVQUEUEGROWTH;
558#endif 558#endif
559 } 559 }
560 if (yylvp == yylve) 560 if (yylvp == yylve)
561 { 561 {
562 yylvp = yylve = yylvals; 562 yylvp = yylve = yylvals;
563#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 563#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
564 yylpp = yylpe = yylpsns; 564 yylpp = yylpe = yylpsns;
565#endif 565#endif
566 yylexp = yylexemes; 566 yylexp = yylexemes;
567 if (yychar >= YYEOF) 567 if (yychar >= YYEOF)
568 { 568 {
569 *yylve++ = yylval; 569 *yylve++ = yylval;
570#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 570#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
571 *yylpe++ = yylloc; 571 *yylpe++ = yylloc;
572#endif 572#endif
573 *yylexp = (short) yychar; 573 *yylexp = (YYINT) yychar;
574 yychar = YYEMPTY; 574 yychar = YYEMPTY;
575 } 575 }
576 } 576 }
577 } 577 }
578 if (yychar >= YYEOF) 578 if (yychar >= YYEOF)
579 { 579 {
580 yylvp--; 580 yylvp--;
581#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 581#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
582 yylpp--; 582 yylpp--;
583#endif 583#endif
584 yylexp--; 584 yylexp--;
585 yychar = YYEMPTY; 585 yychar = YYEMPTY;
586 } 586 }
@@ -595,27 +595,27 @@ yyloop: @@ -595,27 +595,27 @@ yyloop:
595 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]); 595 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
596#endif 596#endif
597 if (yychar < 0) 597 if (yychar < 0)
598 { 598 {
599 yylvp++; 599 yylvp++;
600#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 600#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
601 yylpp++; 601 yylpp++;
602#endif 602#endif
603 yylexp++; 603 yylexp++;
604 } 604 }
605 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 605 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
606 goto yyoverflow; 606 goto yyoverflow;
607 yystate = yyctable[ctry]; 607 yystate = yyctable[ctry];
608 *++yystack.s_mark = (short) yystate; 608 *++yystack.s_mark = (YYINT) yystate;
609 *++yystack.l_mark = yylval; 609 *++yystack.l_mark = yylval;
610#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 610#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
611 *++yystack.p_mark = yylloc; 611 *++yystack.p_mark = yylloc;
612#endif 612#endif
613 yychar = YYEMPTY; 613 yychar = YYEMPTY;
614 if (yyerrflag > 0) --yyerrflag; 614 if (yyerrflag > 0) --yyerrflag;
615 goto yyloop; 615 goto yyloop;
616 } 616 }
617 else 617 else
618 { 618 {
619 yyn = yyctable[ctry]; 619 yyn = yyctable[ctry];
620 goto yyreduce; 620 goto yyreduce;
621 } 621 }
@@ -668,43 +668,43 @@ yyerrhandler: @@ -668,43 +668,43 @@ yyerrhandler:
668#endif 668#endif
669 /* Memorize most forward-looking error state in case it's really an error. */ 669 /* Memorize most forward-looking error state in case it's really an error. */
670 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals) 670 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
671 { 671 {
672 /* Free old saved error context state */ 672 /* Free old saved error context state */
673 if (yyerrctx) yyFreeState(yyerrctx); 673 if (yyerrctx) yyFreeState(yyerrctx);
674 /* Create and fill out new saved error context state */ 674 /* Create and fill out new saved error context state */
675 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 675 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
676 if (yyerrctx == NULL) goto yyenomem; 676 if (yyerrctx == NULL) goto yyenomem;
677 yyerrctx->save = yyps->save; 677 yyerrctx->save = yyps->save;
678 yyerrctx->state = yystate; 678 yyerrctx->state = yystate;
679 yyerrctx->errflag = yyerrflag; 679 yyerrctx->errflag = yyerrflag;
680 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base); 680 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
681 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); 681 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
682 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base); 682 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
683 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 683 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
684#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 684#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
685 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base); 685 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
686 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 686 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
687#endif 687#endif
688 yyerrctx->lexeme = yylvp - yylvals; 688 yyerrctx->lexeme = yylvp - yylvals;
689 } 689 }
690 yylvp = yylvals + save->lexeme; 690 yylvp = yylvals + save->lexeme;
691#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 691#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
692 yylpp = yylpsns + save->lexeme; 692 yylpp = yylpsns + save->lexeme;
693#endif 693#endif
694 yylexp = yylexemes + save->lexeme; 694 yylexp = yylexemes + save->lexeme;
695 yychar = YYEMPTY; 695 yychar = YYEMPTY;
696 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base); 696 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
697 memcpy (yystack.s_base, save->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); 697 memcpy (yystack.s_base, save->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
698 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base); 698 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
699 memcpy (yystack.l_base, save->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 699 memcpy (yystack.l_base, save->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
700#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 700#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
701 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base); 701 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
702 memcpy (yystack.p_base, save->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 702 memcpy (yystack.p_base, save->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
703#endif 703#endif
704 ctry = ++save->ctry; 704 ctry = ++save->ctry;
705 yystate = save->state; 705 yystate = save->state;
706 /* We tried shift, try reduce now */ 706 /* We tried shift, try reduce now */
707 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce; 707 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
708 yyps->save = save->save; 708 yyps->save = save->save;
709 save->save = NULL; 709 save->save = NULL;
710 yyFreeState(save); 710 yyFreeState(save);
@@ -719,27 +719,27 @@ yyerrhandler: @@ -719,27 +719,27 @@ yyerrhandler:
719#endif 719#endif
720 /* Restore state as it was in the most forward-advanced error */ 720 /* Restore state as it was in the most forward-advanced error */
721 yylvp = yylvals + yyerrctx->lexeme; 721 yylvp = yylvals + yyerrctx->lexeme;
722#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 722#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
723 yylpp = yylpsns + yyerrctx->lexeme; 723 yylpp = yylpsns + yyerrctx->lexeme;
724#endif 724#endif
725 yylexp = yylexemes + yyerrctx->lexeme; 725 yylexp = yylexemes + yyerrctx->lexeme;
726 yychar = yylexp[-1]; 726 yychar = yylexp[-1];
727 yylval = yylvp[-1]; 727 yylval = yylvp[-1];
728#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 728#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
729 yylloc = yylpp[-1]; 729 yylloc = yylpp[-1];
730#endif 730#endif
731 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base); 731 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
732 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); 732 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
733 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base); 733 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
734 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 734 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
735#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 735#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
736 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base); 736 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
737 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 737 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
738#endif 738#endif
739 yystate = yyerrctx->state; 739 yystate = yyerrctx->state;
740 yyFreeState(yyerrctx); 740 yyFreeState(yyerrctx);
741 yyerrctx = NULL; 741 yyerrctx = NULL;
742 } 742 }
743 yynewerrflag = 1; 743 yynewerrflag = 1;
744 } 744 }
745 if (yynewerrflag == 0) goto yyinrecovery; 745 if (yynewerrflag == 0) goto yyinrecovery;
@@ -932,43 +932,43 @@ yyreduce: @@ -932,43 +932,43 @@ yyreduce:
932#endif 932#endif
933 yychar = *yylexp++; 933 yychar = *yylexp++;
934 break; 934 break;
935 } 935 }
936 if (yyps->save) 936 if (yyps->save)
937 { 937 {
938 /* in trial mode; save scanner results for future parse attempts */ 938 /* in trial mode; save scanner results for future parse attempts */
939 if (yylvp == yylvlim) 939 if (yylvp == yylvlim)
940 { /* Enlarge lexical value queue */ 940 { /* Enlarge lexical value queue */
941 int p = yylvp - yylvals; 941 int p = yylvp - yylvals;
942 int s = yylvlim - yylvals; 942 int s = yylvlim - yylvals;
943 943
944 s += YYLVQUEUEGROWTH; 944 s += YYLVQUEUEGROWTH;
945 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) 945 if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL)
946 goto yyenomem; 946 goto yyenomem;
947 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) 947 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
948 goto yyenomem; 948 goto yyenomem;
949#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 949#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
950 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) 950 if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
951 goto yyenomem; 951 goto yyenomem;
952#endif 952#endif
953 yylvp = yylve = yylvals + p; 953 yylvp = yylve = yylvals + p;
954 yylvlim = yylvals + s; 954 yylvlim = yylvals + s;
955#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 955#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
956 yylpp = yylpe = yylpsns + p; 956 yylpp = yylpe = yylpsns + p;
957 yylplim = yylpsns + s; 957 yylplim = yylpsns + s;
958#endif 958#endif
959 yylexp = yylexemes + p; 959 yylexp = yylexemes + p;
960 } 960 }
961 *yylexp = (short) YYLEX; 961 *yylexp = (YYINT) YYLEX;
962 *yylvp++ = yylval; 962 *yylvp++ = yylval;
963 yylve++; 963 yylve++;
964#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 964#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
965 *yylpp++ = yylloc; 965 *yylpp++ = yylloc;
966 yylpe++; 966 yylpe++;
967#endif 967#endif
968 yychar = *yylexp++; 968 yychar = *yylexp++;
969 break; 969 break;
970 } 970 }
971 /* normal operation, no conflict encountered */ 971 /* normal operation, no conflict encountered */
972%%endif YYBTYACC 972%%endif YYBTYACC
973 yychar = YYLEX; 973 yychar = YYLEX;
974%%ifdef YYBTYACC 974%%ifdef YYBTYACC
@@ -997,27 +997,27 @@ yyreduce: @@ -997,27 +997,27 @@ yyreduce:
997 if (yydebug) 997 if (yydebug)
998 { 998 {
999 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); 999 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1000#ifdef YYSTYPE_TOSTRING 1000#ifdef YYSTYPE_TOSTRING
1001%%ifdef YYBTYACC 1001%%ifdef YYBTYACC
1002 if (!yytrial) 1002 if (!yytrial)
1003%%endif 1003%%endif
1004 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval)); 1004 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1005#endif 1005#endif
1006 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate); 1006 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1007 } 1007 }
1008#endif 1008#endif
1009 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 1009 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1010 *++yystack.s_mark = (short) yystate; 1010 *++yystack.s_mark = (YYINT) yystate;
1011 *++yystack.l_mark = yyval; 1011 *++yystack.l_mark = yyval;
1012#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1012#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1013 *++yystack.p_mark = yyloc; 1013 *++yystack.p_mark = yyloc;
1014#endif 1014#endif
1015 goto yyloop; 1015 goto yyloop;
1016%%ifdef YYBTYACC 1016%%ifdef YYBTYACC
1017 1017
1018 /* Reduction declares that this path is valid. Set yypath and do a full parse */ 1018 /* Reduction declares that this path is valid. Set yypath and do a full parse */
1019yyvalid: 1019yyvalid:
1020 if (yypath) YYABORT; 1020 if (yypath) YYABORT;
1021 while (yyps->save) 1021 while (yyps->save)
1022 { 1022 {
1023 YYParseState *save = yyps->save; 1023 YYParseState *save = yyps->save;
@@ -1032,27 +1032,27 @@ yyvalid: @@ -1032,27 +1032,27 @@ yyvalid:
1032#endif 1032#endif
1033 if (yyerrctx) 1033 if (yyerrctx)
1034 { 1034 {
1035 yyFreeState(yyerrctx); 1035 yyFreeState(yyerrctx);
1036 yyerrctx = NULL; 1036 yyerrctx = NULL;
1037 } 1037 }
1038 yylvp = yylvals + yypath->lexeme; 1038 yylvp = yylvals + yypath->lexeme;
1039#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1039#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1040 yylpp = yylpsns + yypath->lexeme; 1040 yylpp = yylpsns + yypath->lexeme;
1041#endif 1041#endif
1042 yylexp = yylexemes + yypath->lexeme; 1042 yylexp = yylexemes + yypath->lexeme;
1043 yychar = YYEMPTY; 1043 yychar = YYEMPTY;
1044 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base); 1044 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1045 memcpy (yystack.s_base, yypath->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); 1045 memcpy (yystack.s_base, yypath->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1046 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base); 1046 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1047 memcpy (yystack.l_base, yypath->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 1047 memcpy (yystack.l_base, yypath->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1048#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1048#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1049 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base); 1049 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1050 memcpy (yystack.p_base, yypath->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 1050 memcpy (yystack.p_base, yypath->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1051#endif 1051#endif
1052 yystate = yypath->state; 1052 yystate = yypath->state;
1053 goto yyloop; 1053 goto yyloop;
1054%%endif YYBTYACC 1054%%endif YYBTYACC
1055 1055
1056yyoverflow: 1056yyoverflow:
1057 YYERROR_CALL("yacc stack overflow"); 1057 YYERROR_CALL("yacc stack overflow");
1058%%ifdef YYBTYACC 1058%%ifdef YYBTYACC