#ifndef lint
static char const 
yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $";
#endif
#include <stdlib.h>
#define YYBYACC 1
#define YYMAJOR 1
#define YYMINOR 9
#define YYLEX yylex()
#define YYEMPTY -1
#define yyclearin (yychar=(YYEMPTY))
#define yyerrok (yyerrflag=0)
#define YYRECOVERING() (yyerrflag!=0)
static int yygrowstack();
#define YYPREFIX "yy"
#line 2 "rsvc_logic.y"

/*----------------------------------------------------------------------------
// Copyright (c) 1994,1995 Southeastern Universities Research Association,
//                         Continuous Electron Beam Accelerator Facility
//
// This software was developed under a United States Government license
// described in the NOTICE file included as part of this distribution.
//----------------------------------------------------------------------------
//
// Description:    
//   Parser rsvc logic expression
//                                                  
// Author:  Jie Chen  
//       
// Revision History:
//   rsvc_logic.y,v
// Revision 1.2  1998/01/23  13:50:10  akers
// Ongoing development
//
 * Revision 1.1  1998/01/22  17:08:28  akers
 * Addition of new NameServer
 *
//                                       
//---------------------------------------------------------------------------*/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#ifndef _WIN32
#include <unistd.h>
#endif

#include <fcntl.h>
#include <rsvcLogic.h>

#ifdef __VMS
/* VMS does not have unlink but it does have the function remove().
   Note that remove() may not be able to delete directory files . */
#define unlink(tmp) (remove((tmp)))
#endif

#line 46 "rsvc_logic.y"
typedef union {
  rsvc_logic_data* data;
  rsvcLogicInst*   inst;
} YYSTYPE;
#line 65 "y.tab.c"
#define YYERRCODE 256
#define TAGNAME 257
#define CSTRING 258
#define DVALUE 259
#define IVALUE 260
#define EQUAL 261
#define LESS 262
#define GREATER 263
#define NOTEQUAL 264
#define LESSOREQUAL 265
#define GREATEROREQUAL 266
#define LEFTP 267
#define RIGHTP 268
#define OR 269
#define AND 270
#define LIKE 271
#define NOT 272
#define CERROR 273
const short yylhs[] = {                                        -1,
    0,    2,    2,    2,    2,    2,    1,    1,    1,    1,
    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
    1,
};
const short yylen[] = {                                         2,
    1,    1,    3,    3,    2,    3,    3,    3,    3,    3,
    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
    3,
};
const short yydefred[] = {                                      0,
    0,    0,    0,    0,    2,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    5,    0,    0,    9,    8,    7,
   11,   10,   13,   12,   20,   19,   18,   15,   14,   17,
   16,   21,    6,    0,    3,
};
const short yydgoto[] = {                                       4,
    5,    6,
};
const short yysindex[] = {                                   -257,
 -241, -257, -257,    0,    0, -267, -252, -243, -228, -247,
 -226, -224, -249, -242,    0, -257, -257,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0, -256,    0,
};
const short yyrindex[] = {                                      0,
    0,    0,    0,    0,    0,   29,    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,    1,    0,
};
const short yygindex[] = {                                      0,
    0,    2,
};
#define YYTABLESIZE 270
const short yytable[] = {                                       1,
    4,   16,   17,   14,   15,   18,   19,   20,   32,    2,
   25,   26,   27,   17,    3,   21,   22,   34,   35,    7,
    8,    9,   10,   11,   12,   33,   16,   17,    1,   13,
   23,   24,   28,   29,   30,   31,    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,    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,    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,    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,    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,    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,    4,    4,
};
const short yycheck[] = {                                     257,
    0,  269,  270,    2,    3,  258,  259,  260,  258,  267,
  258,  259,  260,  270,  272,  259,  260,   16,   17,  261,
  262,  263,  264,  265,  266,  268,  269,  270,    0,  271,
  259,  260,  259,  260,  259,  260,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  268,  269,
};
#define YYFINAL 4
#ifndef YYDEBUG
#define YYDEBUG 0
#endif
#define YYMAXTOKEN 273
#if YYDEBUG
const char * const yyname[] = {
"end-of-file",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,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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"TAGNAME","CSTRING","DVALUE",
"IVALUE","EQUAL","LESS","GREATER","NOTEQUAL","LESSOREQUAL","GREATEROREQUAL",
"LEFTP","RIGHTP","OR","AND","LIKE","NOT","CERROR",
};
const char * const yyrule[] = {
"$accept : rsvc_logic_parse",
"rsvc_logic_parse : rsvc_logic",
"rsvc_logic : logic_exp",
"rsvc_logic : rsvc_logic AND rsvc_logic",
"rsvc_logic : rsvc_logic OR rsvc_logic",
"rsvc_logic : NOT rsvc_logic",
"rsvc_logic : LEFTP rsvc_logic RIGHTP",
"logic_exp : TAGNAME EQUAL IVALUE",
"logic_exp : TAGNAME EQUAL DVALUE",
"logic_exp : TAGNAME EQUAL CSTRING",
"logic_exp : TAGNAME LESS IVALUE",
"logic_exp : TAGNAME LESS DVALUE",
"logic_exp : TAGNAME GREATER IVALUE",
"logic_exp : TAGNAME GREATER DVALUE",
"logic_exp : TAGNAME LESSOREQUAL IVALUE",
"logic_exp : TAGNAME LESSOREQUAL DVALUE",
"logic_exp : TAGNAME GREATEROREQUAL IVALUE",
"logic_exp : TAGNAME GREATEROREQUAL DVALUE",
"logic_exp : TAGNAME NOTEQUAL IVALUE",
"logic_exp : TAGNAME NOTEQUAL DVALUE",
"logic_exp : TAGNAME NOTEQUAL CSTRING",
"logic_exp : TAGNAME LIKE CSTRING",
};
#endif
#if YYDEBUG
#include <stdio.h>
#endif
#ifdef YYSTACKSIZE
#undef YYMAXDEPTH
#define YYMAXDEPTH YYSTACKSIZE
#else
#ifdef YYMAXDEPTH
#define YYSTACKSIZE YYMAXDEPTH
#else
#define YYSTACKSIZE 10000
#define YYMAXDEPTH 10000
#endif
#endif
#define YYINITSTACKSIZE 200
int yydebug;
int yynerrs;
int yyerrflag;
int yychar;
short *yyssp;
YYSTYPE *yyvsp;
YYSTYPE yyval;
YYSTYPE yylval;
short *yyss;
short *yysslim;
YYSTYPE *yyvs;
int yystacksize;
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
static int yygrowstack()
{
    int newsize, i;
    short *newss;
    YYSTYPE *newvs;

    if ((newsize = yystacksize) == 0)
        newsize = YYINITSTACKSIZE;
    else if (newsize >= YYMAXDEPTH)
        return -1;
    else if ((newsize *= 2) > YYMAXDEPTH)
        newsize = YYMAXDEPTH;
    i = yyssp - yyss;
    newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) :
      (short *)malloc(newsize * sizeof *newss);
    if (newss == NULL)
        return -1;
    yyss = newss;
    yyssp = newss + i;
    newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) :
      (YYSTYPE *)malloc(newsize * sizeof *newvs);
    if (newvs == NULL)
        return -1;
    yyvs = newvs;
    yyvsp = newvs + i;
    yystacksize = newsize;
    yysslim = yyss + newsize - 1;
    return 0;
}

#define YYABORT goto yyabort
#define YYREJECT goto yyabort
#define YYACCEPT goto yyaccept
#define YYERROR goto yyerrlab

#ifndef YYPARSE_PARAM
#if defined(__cplusplus) || __STDC__
#define YYPARSE_PARAM_ARG void
#define YYPARSE_PARAM_DECL
#else	/* ! ANSI-C/C++ */
#define YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_DECL
#endif	/* ANSI-C/C++ */
#else	/* YYPARSE_PARAM */
#ifndef YYPARSE_PARAM_TYPE
#define YYPARSE_PARAM_TYPE void *
#endif
#if defined(__cplusplus) || __STDC__
#define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM
#define YYPARSE_PARAM_DECL
#else	/* ! ANSI-C/C++ */
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;
#endif	/* ANSI-C/C++ */
#endif	/* ! YYPARSE_PARAM */

int
yyparse (YYPARSE_PARAM_ARG)
    YYPARSE_PARAM_DECL
{
    register int yym, yyn, yystate;
#if YYDEBUG
    register const char *yys;

    if ((yys = getenv("YYDEBUG")))
    {
        yyn = *yys;
        if (yyn >= '0' && yyn <= '9')
            yydebug = yyn - '0';
    }
#endif

    yynerrs = 0;
    yyerrflag = 0;
    yychar = (-1);

    if (yyss == NULL && yygrowstack()) goto yyoverflow;
    yyssp = yyss;
    yyvsp = yyvs;
    *yyssp = yystate = 0;

yyloop:
    if ((yyn = yydefred[yystate])) goto yyreduce;
    if (yychar < 0)
    {
        if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
        if (yydebug)
        {
            yys = 0;
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
            if (!yys) yys = "illegal-symbol";
            printf("%sdebug: state %d, reading %d (%s)\n",
                    YYPREFIX, yystate, yychar, yys);
        }
#endif
    }
    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
    {
#if YYDEBUG
        if (yydebug)
            printf("%sdebug: state %d, shifting to state %d\n",
                    YYPREFIX, yystate, yytable[yyn]);
#endif
        if (yyssp >= yysslim && yygrowstack())
        {
            goto yyoverflow;
        }
        *++yyssp = yystate = yytable[yyn];
        *++yyvsp = yylval;
        yychar = (-1);
        if (yyerrflag > 0)  --yyerrflag;
        goto yyloop;
    }
    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
    {
        yyn = yytable[yyn];
        goto yyreduce;
    }
    if (yyerrflag) goto yyinrecovery;
#if defined(lint) || defined(__GNUC__)
    goto yynewerror;
#endif
yynewerror:
    yyerror("syntax error");
#if defined(lint) || defined(__GNUC__)
    goto yyerrlab;
#endif
yyerrlab:
    ++yynerrs;
yyinrecovery:
    if (yyerrflag < 3)
    {
        yyerrflag = 3;
        for (;;)
        {
            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
            {
#if YYDEBUG
                if (yydebug)
                    printf("%sdebug: state %d, error recovery shifting\
 to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
#endif
                if (yyssp >= yysslim && yygrowstack())
                {
                    goto yyoverflow;
                }
                *++yyssp = yystate = yytable[yyn];
                *++yyvsp = yylval;
                goto yyloop;
            }
            else
            {
#if YYDEBUG
                if (yydebug)
                    printf("%sdebug: error recovery discarding state %d\n",
                            YYPREFIX, *yyssp);
#endif
                if (yyssp <= yyss) goto yyabort;
                --yyssp;
                --yyvsp;
            }
        }
    }
    else
    {
        if (yychar == 0) goto yyabort;
#if YYDEBUG
        if (yydebug)
        {
            yys = 0;
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
            if (!yys) yys = "illegal-symbol";
            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                    YYPREFIX, yystate, yychar, yys);
        }
#endif
        yychar = (-1);
        goto yyloop;
    }
yyreduce:
#if YYDEBUG
    if (yydebug)
        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
                YYPREFIX, yystate, yyn, yyrule[yyn]);
#endif
    yym = yylen[yyn];
    yyval = yyvsp[1-yym];
    switch (yyn)
    {
case 1:
#line 63 "rsvc_logic.y"
{logic_code (rsvc_logic_end);
                                logic_code (RSVC_LOGIC_STOP);
                               }
break;
case 2:
#line 67 "rsvc_logic.y"
{ }
break;
case 3:
#line 68 "rsvc_logic.y"
{logic_code (rsvc_logic_and);}
break;
case 4:
#line 69 "rsvc_logic.y"
{logic_code (rsvc_logic_or);}
break;
case 5:
#line 70 "rsvc_logic.y"
{logic_code (rsvc_logic_neg);}
break;
case 6:
#line 71 "rsvc_logic.y"
{}
break;
case 7:
#line 74 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_equal_int);
                                 }
break;
case 8:
#line 79 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_equal_dbl);
                                }
break;
case 9:
#line 84 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_equal_str);
                                }
break;
case 10:
#line 89 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_less_int);
                                 }
break;
case 11:
#line 94 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_less_dbl);
                                }
break;
case 12:
#line 100 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_greater_int);
                                }
break;
case 13:
#line 105 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_greater_dbl);
                                 }
break;
case 14:
#line 110 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_lesseq_int);
                                 }
break;
case 15:
#line 115 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_lesseq_dbl);
                                 }
break;
case 16:
#line 120 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_greatereq_int);
                                 }
break;
case 17:
#line 125 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_greatereq_dbl);
                                 }
break;
case 18:
#line 130 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_noequal_int);
                                }
break;
case 19:
#line 135 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_noequal_dbl);
                               }
break;
case 20:
#line 140 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_noequal_str);
                                }
break;
case 21:
#line 145 "rsvc_logic.y"
{logic_code (logic_val_push);
                                 logic_code ((rsvcLogicInst)yyvsp[-2].data);
                                 logic_code ((rsvcLogicInst)yyvsp[0].data);
				 logic_code (rsvc_data_has_str);
                               }
break;
#line 586 "y.tab.c"
    }
    yyssp -= yym;
    yystate = *yyssp;
    yyvsp -= yym;
    yym = yylhs[yyn];
    if (yystate == 0 && yym == 0)
    {
#if YYDEBUG
        if (yydebug)
            printf("%sdebug: after reduction, shifting from state 0 to\
 state %d\n", YYPREFIX, YYFINAL);
#endif
        yystate = YYFINAL;
        *++yyssp = YYFINAL;
        *++yyvsp = yyval;
        if (yychar < 0)
        {
            if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
            if (yydebug)
            {
                yys = 0;
                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
                if (!yys) yys = "illegal-symbol";
                printf("%sdebug: state %d, reading %d (%s)\n",
                        YYPREFIX, YYFINAL, yychar, yys);
            }
#endif
        }
        if (yychar == 0) goto yyaccept;
        goto yyloop;
    }
    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
        yystate = yytable[yyn];
    else
        yystate = yydgoto[yym];
#if YYDEBUG
    if (yydebug)
        printf("%sdebug: after reduction, shifting from state %d \
to state %d\n", YYPREFIX, *yyssp, yystate);
#endif
    if (yyssp >= yysslim && yygrowstack())
    {
        goto yyoverflow;
    }
    *++yyssp = yystate;
    *++yyvsp = yyval;
    goto yyloop;
yyoverflow:
    yyerror("yacc stack overflow");
yyabort:
    return (1);
yyaccept:
    return (0);
}
