Home | History | Annotate | Line # | Download | only in btyacc
err_syntax10.tab.c revision 1.3.6.1
      1 /*	$NetBSD: err_syntax10.tab.c,v 1.3.6.1 2019/06/10 21:44:42 christos Exp $	*/
      2 
      3 /* original parser id follows */
      4 /* yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93" */
      5 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
      6 
      7 #define YYBYACC 1
      8 #define YYMAJOR 1
      9 #define YYMINOR 9
     10 #define YYCHECK "yyyymmdd"
     11 
     12 #define YYEMPTY        (-1)
     13 #define yyclearin      (yychar = YYEMPTY)
     14 #define yyerrok        (yyerrflag = 0)
     15 #define YYRECOVERING() (yyerrflag != 0)
     16 #define YYENOMEM       (-2)
     17 #define YYEOF          0
     18 #undef YYBTYACC
     19 #define YYBTYACC 0
     20 #define YYDEBUGSTR YYPREFIX "debug"
     21 
     22 #ifndef yyparse
     23 #define yyparse    err_syntax10_parse
     24 #endif /* yyparse */
     25 
     26 #ifndef yylex
     27 #define yylex      err_syntax10_lex
     28 #endif /* yylex */
     29 
     30 #ifndef yyerror
     31 #define yyerror    err_syntax10_error
     32 #endif /* yyerror */
     33 
     34 #ifndef yychar
     35 #define yychar     err_syntax10_char
     36 #endif /* yychar */
     37 
     38 #ifndef yyval
     39 #define yyval      err_syntax10_val
     40 #endif /* yyval */
     41 
     42 #ifndef yylval
     43 #define yylval     err_syntax10_lval
     44 #endif /* yylval */
     45 
     46 #ifndef yydebug
     47 #define yydebug    err_syntax10_debug
     48 #endif /* yydebug */
     49 
     50 #ifndef yynerrs
     51 #define yynerrs    err_syntax10_nerrs
     52 #endif /* yynerrs */
     53 
     54 #ifndef yyerrflag
     55 #define yyerrflag  err_syntax10_errflag
     56 #endif /* yyerrflag */
     57 
     58 #ifndef yylhs
     59 #define yylhs      err_syntax10_lhs
     60 #endif /* yylhs */
     61 
     62 #ifndef yylen
     63 #define yylen      err_syntax10_len
     64 #endif /* yylen */
     65 
     66 #ifndef yydefred
     67 #define yydefred   err_syntax10_defred
     68 #endif /* yydefred */
     69 
     70 #ifndef yystos
     71 #define yystos     err_syntax10_stos
     72 #endif /* yystos */
     73 
     74 #ifndef yydgoto
     75 #define yydgoto    err_syntax10_dgoto
     76 #endif /* yydgoto */
     77 
     78 #ifndef yysindex
     79 #define yysindex   err_syntax10_sindex
     80 #endif /* yysindex */
     81 
     82 #ifndef yyrindex
     83 #define yyrindex   err_syntax10_rindex
     84 #endif /* yyrindex */
     85 
     86 #ifndef yygindex
     87 #define yygindex   err_syntax10_gindex
     88 #endif /* yygindex */
     89 
     90 #ifndef yytable
     91 #define yytable    err_syntax10_table
     92 #endif /* yytable */
     93 
     94 #ifndef yycheck
     95 #define yycheck    err_syntax10_check
     96 #endif /* yycheck */
     97 
     98 #ifndef yyname
     99 #define yyname     err_syntax10_name
    100 #endif /* yyname */
    101 
    102 #ifndef yyrule
    103 #define yyrule     err_syntax10_rule
    104 #endif /* yyrule */
    105 
    106 #if YYBTYACC
    107 
    108 #ifndef yycindex
    109 #define yycindex   err_syntax10_cindex
    110 #endif /* yycindex */
    111 
    112 #ifndef yyctable
    113 #define yyctable   err_syntax10_ctable
    114 #endif /* yyctable */
    115 
    116 #endif /* YYBTYACC */
    117 
    118 #define YYPREFIX "err_syntax10_"
    119 
    120 #define YYPURE 0
    121 
    122 #line 2 "err_syntax10.y"
    123 int yylex(void);
    124 static void yyerror(const char *);
    125 #line 124 "err_syntax10.tab.c"
    126 
    127 /* compatibility with bison */
    128 #ifdef YYPARSE_PARAM
    129 /* compatibility with FreeBSD */
    130 # ifdef YYPARSE_PARAM_TYPE
    131 #  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
    132 # else
    133 #  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
    134 # endif
    135 #else
    136 # define YYPARSE_DECL() yyparse(void)
    137 #endif
    138 
    139 /* Parameters sent to lex. */
    140 #ifdef YYLEX_PARAM
    141 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
    142 # define YYLEX yylex(YYLEX_PARAM)
    143 #else
    144 # define YYLEX_DECL() yylex(void)
    145 # define YYLEX yylex()
    146 #endif
    147 
    148 /* Parameters sent to yyerror. */
    149 #ifndef YYERROR_DECL
    150 #define YYERROR_DECL() yyerror(const char *s)
    151 #endif
    152 #ifndef YYERROR_CALL
    153 #define YYERROR_CALL(msg) yyerror(msg)
    154 #endif
    155 
    156 extern int YYPARSE_DECL();
    157 
    158 #define YYERRCODE 256
    159 typedef short YYINT;
    160 static const YYINT err_syntax10_lhs[] = {                -1,
    161     0,
    162 };
    163 static const YYINT err_syntax10_len[] = {                 2,
    164     1,
    165 };
    166 static const YYINT err_syntax10_defred[] = {              0,
    167     1,    0,
    168 };
    169 #if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING)
    170 static const YYINT err_syntax10_stos[] = {                0,
    171   256,  258,
    172 };
    173 #endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */
    174 static const YYINT err_syntax10_dgoto[] = {               2,
    175 };
    176 static const YYINT err_syntax10_sindex[] = {           -256,
    177     0,    0,
    178 };
    179 static const YYINT err_syntax10_rindex[] = {              0,
    180     0,    0,
    181 };
    182 #if YYBTYACC
    183 static const YYINT err_syntax10_cindex[] = {              0,
    184     0,    0,
    185 };
    186 #endif
    187 static const YYINT err_syntax10_gindex[] = {              0,
    188 };
    189 #define YYTABLESIZE 0
    190 static const YYINT err_syntax10_table[] = {               1,
    191 };
    192 static const YYINT err_syntax10_check[] = {             256,
    193 };
    194 #if YYBTYACC
    195 static const YYINT err_syntax10_ctable[] = {             -1,
    196 };
    197 #endif
    198 #define YYFINAL 2
    199 #ifndef YYDEBUG
    200 #define YYDEBUG 0
    201 #endif
    202 #define YYMAXTOKEN 256
    203 #define YYUNDFTOKEN 259
    204 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
    205 #if YYDEBUG
    206 static const char *const err_syntax10_name[] = {
    207 
    208 "$end",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    209 0,"'&'",0,"'('",0,"'*'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    210 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    211 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    212 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    213 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    214 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"error","$accept","S",
    215 "illegal-symbol",
    216 };
    217 static const char *const err_syntax10_rule[] = {
    218 "$accept : S",
    219 "S : error",
    220 
    221 };
    222 #endif
    223 
    224 #if YYDEBUG
    225 int      yydebug;
    226 #endif
    227 
    228 int      yyerrflag;
    229 int      yychar;
    230 YYSTYPE  yyval;
    231 YYSTYPE  yylval;
    232 int      yynerrs;
    233 
    234 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    235 YYLTYPE  yyloc; /* position returned by actions */
    236 YYLTYPE  yylloc; /* position from the lexer */
    237 #endif
    238 
    239 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    240 #ifndef YYLLOC_DEFAULT
    241 #define YYLLOC_DEFAULT(loc, rhs, n) \
    242 do \
    243 { \
    244     if (n == 0) \
    245     { \
    246         (loc).first_line   = YYRHSLOC(rhs, 0).last_line; \
    247         (loc).first_column = YYRHSLOC(rhs, 0).last_column; \
    248         (loc).last_line    = YYRHSLOC(rhs, 0).last_line; \
    249         (loc).last_column  = YYRHSLOC(rhs, 0).last_column; \
    250     } \
    251     else \
    252     { \
    253         (loc).first_line   = YYRHSLOC(rhs, 1).first_line; \
    254         (loc).first_column = YYRHSLOC(rhs, 1).first_column; \
    255         (loc).last_line    = YYRHSLOC(rhs, n).last_line; \
    256         (loc).last_column  = YYRHSLOC(rhs, n).last_column; \
    257     } \
    258 } while (0)
    259 #endif /* YYLLOC_DEFAULT */
    260 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
    261 #if YYBTYACC
    262 
    263 #ifndef YYLVQUEUEGROWTH
    264 #define YYLVQUEUEGROWTH 32
    265 #endif
    266 #endif /* YYBTYACC */
    267 
    268 /* define the initial stack-sizes */
    269 #ifdef YYSTACKSIZE
    270 #undef YYMAXDEPTH
    271 #define YYMAXDEPTH  YYSTACKSIZE
    272 #else
    273 #ifdef YYMAXDEPTH
    274 #define YYSTACKSIZE YYMAXDEPTH
    275 #else
    276 #define YYSTACKSIZE 10000
    277 #define YYMAXDEPTH  10000
    278 #endif
    279 #endif
    280 
    281 #ifndef YYINITSTACKSIZE
    282 #define YYINITSTACKSIZE 200
    283 #endif
    284 
    285 typedef struct {
    286     unsigned stacksize;
    287     YYINT    *s_base;
    288     YYINT    *s_mark;
    289     YYINT    *s_last;
    290     YYSTYPE  *l_base;
    291     YYSTYPE  *l_mark;
    292 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    293     YYLTYPE  *p_base;
    294     YYLTYPE  *p_mark;
    295 #endif
    296 } YYSTACKDATA;
    297 #if YYBTYACC
    298 
    299 struct YYParseState_s
    300 {
    301     struct YYParseState_s *save;    /* Previously saved parser state */
    302     YYSTACKDATA            yystack; /* saved parser stack */
    303     int                    state;   /* saved parser state */
    304     int                    errflag; /* saved error recovery status */
    305     int                    lexeme;  /* saved index of the conflict lexeme in the lexical queue */
    306     YYINT                  ctry;    /* saved index in yyctable[] for this conflict */
    307 };
    308 typedef struct YYParseState_s YYParseState;
    309 #endif /* YYBTYACC */
    310 /* variables for the parser stack */
    311 static YYSTACKDATA yystack;
    312 #if YYBTYACC
    313 
    314 /* Current parser state */
    315 static YYParseState *yyps = 0;
    316 
    317 /* yypath != NULL: do the full parse, starting at *yypath parser state. */
    318 static YYParseState *yypath = 0;
    319 
    320 /* Base of the lexical value queue */
    321 static YYSTYPE *yylvals = 0;
    322 
    323 /* Current position at lexical value queue */
    324 static YYSTYPE *yylvp = 0;
    325 
    326 /* End position of lexical value queue */
    327 static YYSTYPE *yylve = 0;
    328 
    329 /* The last allocated position at the lexical value queue */
    330 static YYSTYPE *yylvlim = 0;
    331 
    332 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    333 /* Base of the lexical position queue */
    334 static YYLTYPE *yylpsns = 0;
    335 
    336 /* Current position at lexical position queue */
    337 static YYLTYPE *yylpp = 0;
    338 
    339 /* End position of lexical position queue */
    340 static YYLTYPE *yylpe = 0;
    341 
    342 /* The last allocated position at the lexical position queue */
    343 static YYLTYPE *yylplim = 0;
    344 #endif
    345 
    346 /* Current position at lexical token queue */
    347 static YYINT  *yylexp = 0;
    348 
    349 static YYINT  *yylexemes = 0;
    350 #endif /* YYBTYACC */
    351 #line 12 "err_syntax10.y"
    352 
    353 #include <stdio.h>
    354 
    355 int
    356 main(void)
    357 {
    358     printf("yyparse() = %d\n", yyparse());
    359     return 0;
    360 }
    361 
    362 int
    363 yylex(void)
    364 {
    365     return -1;
    366 }
    367 
    368 static void
    369 yyerror(const char* s)
    370 {
    371     printf("%s\n", s);
    372 }
    373 #line 372 "err_syntax10.tab.c"
    374 
    375 /* For use in generated program */
    376 #define yydepth (int)(yystack.s_mark - yystack.s_base)
    377 #if YYBTYACC
    378 #define yytrial (yyps->save)
    379 #endif /* YYBTYACC */
    380 
    381 #if YYDEBUG
    382 #include <stdio.h>	/* needed for printf */
    383 #endif
    384 
    385 #include <stdlib.h>	/* needed for malloc, etc */
    386 #include <string.h>	/* needed for memset */
    387 
    388 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
    389 static int yygrowstack(YYSTACKDATA *data)
    390 {
    391     int i;
    392     unsigned newsize;
    393     YYINT *newss;
    394     YYSTYPE *newvs;
    395 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    396     YYLTYPE *newps;
    397 #endif
    398 
    399     if ((newsize = data->stacksize) == 0)
    400         newsize = YYINITSTACKSIZE;
    401     else if (newsize >= YYMAXDEPTH)
    402         return YYENOMEM;
    403     else if ((newsize *= 2) > YYMAXDEPTH)
    404         newsize = YYMAXDEPTH;
    405 
    406     i = (int) (data->s_mark - data->s_base);
    407     newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
    408     if (newss == 0)
    409         return YYENOMEM;
    410 
    411     data->s_base = newss;
    412     data->s_mark = newss + i;
    413 
    414     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
    415     if (newvs == 0)
    416         return YYENOMEM;
    417 
    418     data->l_base = newvs;
    419     data->l_mark = newvs + i;
    420 
    421 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    422     newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
    423     if (newps == 0)
    424         return YYENOMEM;
    425 
    426     data->p_base = newps;
    427     data->p_mark = newps + i;
    428 #endif
    429 
    430     data->stacksize = newsize;
    431     data->s_last = data->s_base + newsize - 1;
    432 
    433 #if YYDEBUG
    434     if (yydebug)
    435         fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
    436 #endif
    437     return 0;
    438 }
    439 
    440 #if YYPURE || defined(YY_NO_LEAKS)
    441 static void yyfreestack(YYSTACKDATA *data)
    442 {
    443     free(data->s_base);
    444     free(data->l_base);
    445 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    446     free(data->p_base);
    447 #endif
    448     memset(data, 0, sizeof(*data));
    449 }
    450 #else
    451 #define yyfreestack(data) /* nothing */
    452 #endif /* YYPURE || defined(YY_NO_LEAKS) */
    453 #if YYBTYACC
    454 
    455 static YYParseState *
    456 yyNewState(unsigned size)
    457 {
    458     YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
    459     if (p == NULL) return NULL;
    460 
    461     p->yystack.stacksize = size;
    462     if (size == 0)
    463     {
    464         p->yystack.s_base = NULL;
    465         p->yystack.l_base = NULL;
    466 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    467         p->yystack.p_base = NULL;
    468 #endif
    469         return p;
    470     }
    471     p->yystack.s_base    = (YYINT *) malloc(size * sizeof(YYINT));
    472     if (p->yystack.s_base == NULL) return NULL;
    473     p->yystack.l_base    = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
    474     if (p->yystack.l_base == NULL) return NULL;
    475     memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
    476 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    477     p->yystack.p_base    = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
    478     if (p->yystack.p_base == NULL) return NULL;
    479     memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
    480 #endif
    481 
    482     return p;
    483 }
    484 
    485 static void
    486 yyFreeState(YYParseState *p)
    487 {
    488     yyfreestack(&p->yystack);
    489     free(p);
    490 }
    491 #endif /* YYBTYACC */
    492 
    493 #define YYABORT  goto yyabort
    494 #define YYREJECT goto yyabort
    495 #define YYACCEPT goto yyaccept
    496 #define YYERROR  goto yyerrlab
    497 #if YYBTYACC
    498 #define YYVALID        do { if (yyps->save)            goto yyvalid; } while(0)
    499 #define YYVALID_NESTED do { if (yyps->save && \
    500                                 yyps->save->save == 0) goto yyvalid; } while(0)
    501 #endif /* YYBTYACC */
    502 
    503 int
    504 YYPARSE_DECL()
    505 {
    506     int yym, yyn, yystate, yyresult;
    507 #if YYBTYACC
    508     int yynewerrflag;
    509     YYParseState *yyerrctx = NULL;
    510 #endif /* YYBTYACC */
    511 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    512     YYLTYPE  yyerror_loc_range[3]; /* position of error start/end (0 unused) */
    513 #endif
    514 #if YYDEBUG
    515     const char *yys;
    516 
    517     if ((yys = getenv("YYDEBUG")) != 0)
    518     {
    519         yyn = *yys;
    520         if (yyn >= '0' && yyn <= '9')
    521             yydebug = yyn - '0';
    522     }
    523     if (yydebug)
    524         fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
    525 #endif
    526 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    527     memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range));
    528 #endif
    529 
    530 #if YYBTYACC
    531     yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
    532     yyps->save = 0;
    533 #endif /* YYBTYACC */
    534     yym = 0;
    535     yyn = 0;
    536     yynerrs = 0;
    537     yyerrflag = 0;
    538     yychar = YYEMPTY;
    539     yystate = 0;
    540 
    541 #if YYPURE
    542     memset(&yystack, 0, sizeof(yystack));
    543 #endif
    544 
    545     if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
    546     yystack.s_mark = yystack.s_base;
    547     yystack.l_mark = yystack.l_base;
    548 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    549     yystack.p_mark = yystack.p_base;
    550 #endif
    551     yystate = 0;
    552     *yystack.s_mark = 0;
    553 
    554 yyloop:
    555     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
    556     if (yychar < 0)
    557     {
    558 #if YYBTYACC
    559         do {
    560         if (yylvp < yylve)
    561         {
    562             /* we're currently re-reading tokens */
    563             yylval = *yylvp++;
    564 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    565             yylloc = *yylpp++;
    566 #endif
    567             yychar = *yylexp++;
    568             break;
    569         }
    570         if (yyps->save)
    571         {
    572             /* in trial mode; save scanner results for future parse attempts */
    573             if (yylvp == yylvlim)
    574             {   /* Enlarge lexical value queue */
    575                 size_t p = (size_t) (yylvp - yylvals);
    576                 size_t s = (size_t) (yylvlim - yylvals);
    577 
    578                 s += YYLVQUEUEGROWTH;
    579                 if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;
    580                 if ((yylvals   = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
    581 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    582                 if ((yylpsns   = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
    583 #endif
    584                 yylvp   = yylve = yylvals + p;
    585                 yylvlim = yylvals + s;
    586 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    587                 yylpp   = yylpe = yylpsns + p;
    588                 yylplim = yylpsns + s;
    589 #endif
    590                 yylexp  = yylexemes + p;
    591             }
    592             *yylexp = (YYINT) YYLEX;
    593             *yylvp++ = yylval;
    594             yylve++;
    595 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    596             *yylpp++ = yylloc;
    597             yylpe++;
    598 #endif
    599             yychar = *yylexp++;
    600             break;
    601         }
    602         /* normal operation, no conflict encountered */
    603 #endif /* YYBTYACC */
    604         yychar = YYLEX;
    605 #if YYBTYACC
    606         } while (0);
    607 #endif /* YYBTYACC */
    608         if (yychar < 0) yychar = YYEOF;
    609 #if YYDEBUG
    610         if (yydebug)
    611         {
    612             if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
    613             fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
    614                             YYDEBUGSTR, yydepth, yystate, yychar, yys);
    615 #ifdef YYSTYPE_TOSTRING
    616 #if YYBTYACC
    617             if (!yytrial)
    618 #endif /* YYBTYACC */
    619                 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
    620 #endif
    621             fputc('\n', stderr);
    622         }
    623 #endif
    624     }
    625 #if YYBTYACC
    626 
    627     /* Do we have a conflict? */
    628     if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
    629         yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
    630     {
    631         YYINT ctry;
    632 
    633         if (yypath)
    634         {
    635             YYParseState *save;
    636 #if YYDEBUG
    637             if (yydebug)
    638                 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
    639                                 YYDEBUGSTR, yydepth, yystate);
    640 #endif
    641             /* Switch to the next conflict context */
    642             save = yypath;
    643             yypath = save->save;
    644             save->save = NULL;
    645             ctry = save->ctry;
    646             if (save->state != yystate) YYABORT;
    647             yyFreeState(save);
    648 
    649         }
    650         else
    651         {
    652 
    653             /* Unresolved conflict - start/continue trial parse */
    654             YYParseState *save;
    655 #if YYDEBUG
    656             if (yydebug)
    657             {
    658                 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
    659                 if (yyps->save)
    660                     fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
    661                 else
    662                     fputs("Starting trial parse.\n", stderr);
    663             }
    664 #endif
    665             save                  = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
    666             if (save == NULL) goto yyenomem;
    667             save->save            = yyps->save;
    668             save->state           = yystate;
    669             save->errflag         = yyerrflag;
    670             save->yystack.s_mark  = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
    671             memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
    672             save->yystack.l_mark  = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
    673             memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
    674 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    675             save->yystack.p_mark  = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
    676             memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
    677 #endif
    678             ctry                  = yytable[yyn];
    679             if (yyctable[ctry] == -1)
    680             {
    681 #if YYDEBUG
    682                 if (yydebug && yychar >= YYEOF)
    683                     fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
    684 #endif
    685                 ctry++;
    686             }
    687             save->ctry = ctry;
    688             if (yyps->save == NULL)
    689             {
    690                 /* If this is a first conflict in the stack, start saving lexemes */
    691                 if (!yylexemes)
    692                 {
    693                     yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));
    694                     if (yylexemes == NULL) goto yyenomem;
    695                     yylvals   = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
    696                     if (yylvals == NULL) goto yyenomem;
    697                     yylvlim   = yylvals + YYLVQUEUEGROWTH;
    698 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    699                     yylpsns   = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
    700                     if (yylpsns == NULL) goto yyenomem;
    701                     yylplim   = yylpsns + YYLVQUEUEGROWTH;
    702 #endif
    703                 }
    704                 if (yylvp == yylve)
    705                 {
    706                     yylvp  = yylve = yylvals;
    707 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    708                     yylpp  = yylpe = yylpsns;
    709 #endif
    710                     yylexp = yylexemes;
    711                     if (yychar >= YYEOF)
    712                     {
    713                         *yylve++ = yylval;
    714 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    715                         *yylpe++ = yylloc;
    716 #endif
    717                         *yylexp  = (YYINT) yychar;
    718                         yychar   = YYEMPTY;
    719                     }
    720                 }
    721             }
    722             if (yychar >= YYEOF)
    723             {
    724                 yylvp--;
    725 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    726                 yylpp--;
    727 #endif
    728                 yylexp--;
    729                 yychar = YYEMPTY;
    730             }
    731             save->lexeme = (int) (yylvp - yylvals);
    732             yyps->save   = save;
    733         }
    734         if (yytable[yyn] == ctry)
    735         {
    736 #if YYDEBUG
    737             if (yydebug)
    738                 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
    739                                 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
    740 #endif
    741             if (yychar < 0)
    742             {
    743                 yylvp++;
    744 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    745                 yylpp++;
    746 #endif
    747                 yylexp++;
    748             }
    749             if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
    750                 goto yyoverflow;
    751             yystate = yyctable[ctry];
    752             *++yystack.s_mark = (YYINT) yystate;
    753             *++yystack.l_mark = yylval;
    754 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    755             *++yystack.p_mark = yylloc;
    756 #endif
    757             yychar  = YYEMPTY;
    758             if (yyerrflag > 0) --yyerrflag;
    759             goto yyloop;
    760         }
    761         else
    762         {
    763             yyn = yyctable[ctry];
    764             goto yyreduce;
    765         }
    766     } /* End of code dealing with conflicts */
    767 #endif /* YYBTYACC */
    768     if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
    769             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
    770     {
    771 #if YYDEBUG
    772         if (yydebug)
    773             fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
    774                             YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
    775 #endif
    776         if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
    777         yystate = yytable[yyn];
    778         *++yystack.s_mark = yytable[yyn];
    779         *++yystack.l_mark = yylval;
    780 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    781         *++yystack.p_mark = yylloc;
    782 #endif
    783         yychar = YYEMPTY;
    784         if (yyerrflag > 0)  --yyerrflag;
    785         goto yyloop;
    786     }
    787     if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
    788             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
    789     {
    790         yyn = yytable[yyn];
    791         goto yyreduce;
    792     }
    793     if (yyerrflag != 0) goto yyinrecovery;
    794 #if YYBTYACC
    795 
    796     yynewerrflag = 1;
    797     goto yyerrhandler;
    798     goto yyerrlab; /* redundant goto avoids 'unused label' warning */
    799 
    800 yyerrlab:
    801     /* explicit YYERROR from an action -- pop the rhs of the rule reduced
    802      * before looking for error recovery */
    803     yystack.s_mark -= yym;
    804     yystate = *yystack.s_mark;
    805     yystack.l_mark -= yym;
    806 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    807     yystack.p_mark -= yym;
    808 #endif
    809 
    810     yynewerrflag = 0;
    811 yyerrhandler:
    812     while (yyps->save)
    813     {
    814         int ctry;
    815         YYParseState *save = yyps->save;
    816 #if YYDEBUG
    817         if (yydebug)
    818             fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
    819                             YYDEBUGSTR, yydepth, yystate, yyps->save->state,
    820                     (int)(yylvp - yylvals - yyps->save->lexeme));
    821 #endif
    822         /* Memorize most forward-looking error state in case it's really an error. */
    823         if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
    824         {
    825             /* Free old saved error context state */
    826             if (yyerrctx) yyFreeState(yyerrctx);
    827             /* Create and fill out new saved error context state */
    828             yyerrctx                 = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
    829             if (yyerrctx == NULL) goto yyenomem;
    830             yyerrctx->save           = yyps->save;
    831             yyerrctx->state          = yystate;
    832             yyerrctx->errflag        = yyerrflag;
    833             yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
    834             memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
    835             yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
    836             memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
    837 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    838             yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
    839             memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
    840 #endif
    841             yyerrctx->lexeme         = (int) (yylvp - yylvals);
    842         }
    843         yylvp          = yylvals   + save->lexeme;
    844 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    845         yylpp          = yylpsns   + save->lexeme;
    846 #endif
    847         yylexp         = yylexemes + save->lexeme;
    848         yychar         = YYEMPTY;
    849         yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
    850         memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
    851         yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
    852         memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
    853 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    854         yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
    855         memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
    856 #endif
    857         ctry           = ++save->ctry;
    858         yystate        = save->state;
    859         /* We tried shift, try reduce now */
    860         if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
    861         yyps->save     = save->save;
    862         save->save     = NULL;
    863         yyFreeState(save);
    864 
    865         /* Nothing left on the stack -- error */
    866         if (!yyps->save)
    867         {
    868 #if YYDEBUG
    869             if (yydebug)
    870                 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
    871                                 YYPREFIX, yydepth);
    872 #endif
    873             /* Restore state as it was in the most forward-advanced error */
    874             yylvp          = yylvals   + yyerrctx->lexeme;
    875 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    876             yylpp          = yylpsns   + yyerrctx->lexeme;
    877 #endif
    878             yylexp         = yylexemes + yyerrctx->lexeme;
    879             yychar         = yylexp[-1];
    880             yylval         = yylvp[-1];
    881 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    882             yylloc         = yylpp[-1];
    883 #endif
    884             yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
    885             memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
    886             yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
    887             memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
    888 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    889             yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
    890             memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
    891 #endif
    892             yystate        = yyerrctx->state;
    893             yyFreeState(yyerrctx);
    894             yyerrctx       = NULL;
    895         }
    896         yynewerrflag = 1;
    897     }
    898     if (yynewerrflag == 0) goto yyinrecovery;
    899 #endif /* YYBTYACC */
    900 
    901     YYERROR_CALL("syntax error");
    902 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    903     yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */
    904 #endif
    905 
    906 #if !YYBTYACC
    907     goto yyerrlab; /* redundant goto avoids 'unused label' warning */
    908 yyerrlab:
    909 #endif
    910     ++yynerrs;
    911 
    912 yyinrecovery:
    913     if (yyerrflag < 3)
    914     {
    915         yyerrflag = 3;
    916         for (;;)
    917         {
    918             if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
    919                     yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
    920             {
    921 #if YYDEBUG
    922                 if (yydebug)
    923                     fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
    924                                     YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
    925 #endif
    926                 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
    927                 yystate = yytable[yyn];
    928                 *++yystack.s_mark = yytable[yyn];
    929                 *++yystack.l_mark = yylval;
    930 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    931                 /* lookahead position is error end position */
    932                 yyerror_loc_range[2] = yylloc;
    933                 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
    934                 *++yystack.p_mark = yyloc;
    935 #endif
    936                 goto yyloop;
    937             }
    938             else
    939             {
    940 #if YYDEBUG
    941                 if (yydebug)
    942                     fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
    943                                     YYDEBUGSTR, yydepth, *yystack.s_mark);
    944 #endif
    945                 if (yystack.s_mark <= yystack.s_base) goto yyabort;
    946 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    947                 /* the current TOS position is the error start position */
    948                 yyerror_loc_range[1] = *yystack.p_mark;
    949 #endif
    950 #if defined(YYDESTRUCT_CALL)
    951 #if YYBTYACC
    952                 if (!yytrial)
    953 #endif /* YYBTYACC */
    954 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    955                     YYDESTRUCT_CALL("error: discarding state",
    956                                     yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
    957 #else
    958                     YYDESTRUCT_CALL("error: discarding state",
    959                                     yystos[*yystack.s_mark], yystack.l_mark);
    960 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
    961 #endif /* defined(YYDESTRUCT_CALL) */
    962                 --yystack.s_mark;
    963                 --yystack.l_mark;
    964 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    965                 --yystack.p_mark;
    966 #endif
    967             }
    968         }
    969     }
    970     else
    971     {
    972         if (yychar == YYEOF) goto yyabort;
    973 #if YYDEBUG
    974         if (yydebug)
    975         {
    976             if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
    977             fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
    978                             YYDEBUGSTR, yydepth, yystate, yychar, yys);
    979         }
    980 #endif
    981 #if defined(YYDESTRUCT_CALL)
    982 #if YYBTYACC
    983         if (!yytrial)
    984 #endif /* YYBTYACC */
    985 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
    986             YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
    987 #else
    988             YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
    989 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
    990 #endif /* defined(YYDESTRUCT_CALL) */
    991         yychar = YYEMPTY;
    992         goto yyloop;
    993     }
    994 
    995 yyreduce:
    996     yym = yylen[yyn];
    997 #if YYDEBUG
    998     if (yydebug)
    999     {
   1000         fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
   1001                         YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
   1002 #ifdef YYSTYPE_TOSTRING
   1003 #if YYBTYACC
   1004         if (!yytrial)
   1005 #endif /* YYBTYACC */
   1006             if (yym > 0)
   1007             {
   1008                 int i;
   1009                 fputc('<', stderr);
   1010                 for (i = yym; i > 0; i--)
   1011                 {
   1012                     if (i != yym) fputs(", ", stderr);
   1013                     fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
   1014                                            yystack.l_mark[1-i]), stderr);
   1015                 }
   1016                 fputc('>', stderr);
   1017             }
   1018 #endif
   1019         fputc('\n', stderr);
   1020     }
   1021 #endif
   1022     if (yym > 0)
   1023         yyval = yystack.l_mark[1-yym];
   1024     else
   1025         memset(&yyval, 0, sizeof yyval);
   1026 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
   1027 
   1028     /* Perform position reduction */
   1029     memset(&yyloc, 0, sizeof(yyloc));
   1030 #if YYBTYACC
   1031     if (!yytrial)
   1032 #endif /* YYBTYACC */
   1033     {
   1034         YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym);
   1035         /* just in case YYERROR is invoked within the action, save
   1036            the start of the rhs as the error start position */
   1037         yyerror_loc_range[1] = yystack.p_mark[1-yym];
   1038     }
   1039 #endif
   1040 
   1041     switch (yyn)
   1042     {
   1043     default:
   1044         break;
   1045     }
   1046     yystack.s_mark -= yym;
   1047     yystate = *yystack.s_mark;
   1048     yystack.l_mark -= yym;
   1049 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
   1050     yystack.p_mark -= yym;
   1051 #endif
   1052     yym = yylhs[yyn];
   1053     if (yystate == 0 && yym == 0)
   1054     {
   1055 #if YYDEBUG
   1056         if (yydebug)
   1057         {
   1058             fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
   1059 #ifdef YYSTYPE_TOSTRING
   1060 #if YYBTYACC
   1061             if (!yytrial)
   1062 #endif /* YYBTYACC */
   1063                 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
   1064 #endif
   1065             fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
   1066         }
   1067 #endif
   1068         yystate = YYFINAL;
   1069         *++yystack.s_mark = YYFINAL;
   1070         *++yystack.l_mark = yyval;
   1071 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
   1072         *++yystack.p_mark = yyloc;
   1073 #endif
   1074         if (yychar < 0)
   1075         {
   1076 #if YYBTYACC
   1077             do {
   1078             if (yylvp < yylve)
   1079             {
   1080                 /* we're currently re-reading tokens */
   1081                 yylval = *yylvp++;
   1082 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
   1083                 yylloc = *yylpp++;
   1084 #endif
   1085                 yychar = *yylexp++;
   1086                 break;
   1087             }
   1088             if (yyps->save)
   1089             {
   1090                 /* in trial mode; save scanner results for future parse attempts */
   1091                 if (yylvp == yylvlim)
   1092                 {   /* Enlarge lexical value queue */
   1093                     size_t p = (size_t) (yylvp - yylvals);
   1094                     size_t s = (size_t) (yylvlim - yylvals);
   1095 
   1096                     s += YYLVQUEUEGROWTH;
   1097                     if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL)
   1098                         goto yyenomem;
   1099                     if ((yylvals   = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
   1100                         goto yyenomem;
   1101 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
   1102                     if ((yylpsns   = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
   1103                         goto yyenomem;
   1104 #endif
   1105                     yylvp   = yylve = yylvals + p;
   1106                     yylvlim = yylvals + s;
   1107 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
   1108                     yylpp   = yylpe = yylpsns + p;
   1109                     yylplim = yylpsns + s;
   1110 #endif
   1111                     yylexp  = yylexemes + p;
   1112                 }
   1113                 *yylexp = (YYINT) YYLEX;
   1114                 *yylvp++ = yylval;
   1115                 yylve++;
   1116 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
   1117                 *yylpp++ = yylloc;
   1118                 yylpe++;
   1119 #endif
   1120                 yychar = *yylexp++;
   1121                 break;
   1122             }
   1123             /* normal operation, no conflict encountered */
   1124 #endif /* YYBTYACC */
   1125             yychar = YYLEX;
   1126 #if YYBTYACC
   1127             } while (0);
   1128 #endif /* YYBTYACC */
   1129             if (yychar < 0) yychar = YYEOF;
   1130 #if YYDEBUG
   1131             if (yydebug)
   1132             {
   1133                 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
   1134                 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
   1135                                 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
   1136             }
   1137 #endif
   1138         }
   1139         if (yychar == YYEOF) goto yyaccept;
   1140         goto yyloop;
   1141     }
   1142     if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
   1143             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
   1144         yystate = yytable[yyn];
   1145     else
   1146         yystate = yydgoto[yym];
   1147 #if YYDEBUG
   1148     if (yydebug)
   1149     {
   1150         fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
   1151 #ifdef YYSTYPE_TOSTRING
   1152 #if YYBTYACC
   1153         if (!yytrial)
   1154 #endif /* YYBTYACC */
   1155             fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
   1156 #endif
   1157         fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
   1158     }
   1159 #endif
   1160     if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
   1161     *++yystack.s_mark = (YYINT) yystate;
   1162     *++yystack.l_mark = yyval;
   1163 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
   1164     *++yystack.p_mark = yyloc;
   1165 #endif
   1166     goto yyloop;
   1167 #if YYBTYACC
   1168 
   1169     /* Reduction declares that this path is valid. Set yypath and do a full parse */
   1170 yyvalid:
   1171     if (yypath) YYABORT;
   1172     while (yyps->save)
   1173     {
   1174         YYParseState *save = yyps->save;
   1175         yyps->save = save->save;
   1176         save->save = yypath;
   1177         yypath = save;
   1178     }
   1179 #if YYDEBUG
   1180     if (yydebug)
   1181         fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
   1182                         YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
   1183 #endif
   1184     if (yyerrctx)
   1185     {
   1186         yyFreeState(yyerrctx);
   1187         yyerrctx = NULL;
   1188     }
   1189     yylvp          = yylvals + yypath->lexeme;
   1190 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
   1191     yylpp          = yylpsns + yypath->lexeme;
   1192 #endif
   1193     yylexp         = yylexemes + yypath->lexeme;
   1194     yychar         = YYEMPTY;
   1195     yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
   1196     memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
   1197     yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
   1198     memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
   1199 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
   1200     yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
   1201     memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
   1202 #endif
   1203     yystate        = yypath->state;
   1204     goto yyloop;
   1205 #endif /* YYBTYACC */
   1206 
   1207 yyoverflow:
   1208     YYERROR_CALL("yacc stack overflow");
   1209 #if YYBTYACC
   1210     goto yyabort_nomem;
   1211 yyenomem:
   1212     YYERROR_CALL("memory exhausted");
   1213 yyabort_nomem:
   1214 #endif /* YYBTYACC */
   1215     yyresult = 2;
   1216     goto yyreturn;
   1217 
   1218 yyabort:
   1219     yyresult = 1;
   1220     goto yyreturn;
   1221 
   1222 yyaccept:
   1223 #if YYBTYACC
   1224     if (yyps->save) goto yyvalid;
   1225 #endif /* YYBTYACC */
   1226     yyresult = 0;
   1227 
   1228 yyreturn:
   1229 #if defined(YYDESTRUCT_CALL)
   1230     if (yychar != YYEOF && yychar != YYEMPTY)
   1231 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
   1232         YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
   1233 #else
   1234         YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
   1235 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
   1236 
   1237     {
   1238         YYSTYPE *pv;
   1239 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
   1240         YYLTYPE *pp;
   1241 
   1242         for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
   1243              YYDESTRUCT_CALL("cleanup: discarding state",
   1244                              yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
   1245 #else
   1246         for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
   1247              YYDESTRUCT_CALL("cleanup: discarding state",
   1248                              yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
   1249 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
   1250     }
   1251 #endif /* defined(YYDESTRUCT_CALL) */
   1252 
   1253 #if YYBTYACC
   1254     if (yyerrctx)
   1255     {
   1256         yyFreeState(yyerrctx);
   1257         yyerrctx = NULL;
   1258     }
   1259     while (yyps)
   1260     {
   1261         YYParseState *save = yyps;
   1262         yyps = save->save;
   1263         save->save = NULL;
   1264         yyFreeState(save);
   1265     }
   1266     while (yypath)
   1267     {
   1268         YYParseState *save = yypath;
   1269         yypath = save->save;
   1270         save->save = NULL;
   1271         yyFreeState(save);
   1272     }
   1273 #endif /* YYBTYACC */
   1274     yyfreestack(&yystack);
   1275     return (yyresult);
   1276 }
   1277