/* KJT 11/03/98: not included for NS/OS */
/* KJT 08/08/06: not included for CygWin */

#ifndef __NeXT__
#ifndef __CYGWIN__
// extern char *malloc(), *realloc();
#endif
#endif

# line 2 "gram.y"
# include "swbus.h"
# define YYSTYPE         yystype
# define putgrn(n)       (void)ITadd(n, gl)
# define class(nt)       { cls= 0; xxc= nt-1;   \
	       for (xc= 0; xc < nt; xc++, xxc--)    \
			     if (stpick(xc)->type != tNULL) \
		 cls += (1 << xxc);}
# define ndput(tp)   { stput(tp);   \
	       if (gn != NULL){gn->value0=  \
		  (CLR_TYPE)IAT_IT_add(gl, grnl); \
		  gl->size= 0;} \
	       gn= (sttype() == tNULL) ? NULL : sttop(); }
# define ndterm(tp, val) { stput (tp);  \
		       staclr (c_lexv, (CLR_TYPE)val.name); \
		       staclr (c_line, (CLR_TYPE)val.line);}

IT* gl;
TNODE*  gn;
int cls;
int xc;
int xxc;

/* KJT 22/01/23: added function prototypes */
int yyparse();

# define LANGUAGE 260
# define SYNTAX 261
# define END_LANGUAGE 262
# define LID 263
# define RULE 264
# define ASSIGN 265
# define TAST 266
# define ATTRIBUTION 267
# define CONDITION 268
# define VISIT 269
# define END_RULE 270
# define NODE 271
# define UID 272
# define STRING 273
# define INCLUDE_LAG 274
# define END_INCLUDE 275
# define INCLUDE_RAG 276
# define ATTRIBUTES 277
# define CHAR 278
# define ID 279
#define yyclearin yychar = -1
#define yyerrok yyerrflag = 0
extern int yychar;
extern int yyerrflag;
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 150
#endif
#ifndef YYSTYPE
#define YYSTYPE int
#endif
YYSTYPE yylval, yyval;
# define YYERRCODE 256

# line 833 "gram.y"


PRIVATE int
yylex ()
{
    token *tk;

   tk = gtk ();
   yylval = tk->yylval;
   return tk->type;
}

PUBLIC TNODE*
bast ()
{
   gl= ITcreate (4, 2, 1);
   gn= NULL;
   (void)yyparse();
   if (gn != NULL) gn->value0= (CLR_TYPE)IAT_IT_add(gl, grnl);
   return sttop();
}
int yyexca[] ={
-1, 1,
	0, -1,
	-2, 0,
-1, 52,
	262, 12,
	264, 12,
	-2, 13,
-1, 70,
	43, 22,
	42, 22,
	-2, 37,
-1, 71,
	43, 23,
	42, 23,
	-2, 38,
	};
# define YYNPROD 83
# define YYLAST 238
int yyact[]={

    24,    23,    74,    27,    10,    58,    37,    31,     7,    93,
    49,    91,   103,    96,    86,    77,    67,    51,    50,    42,
     4,    44,    33,     2,    13,   102,   101,    83,    73,    41,
    62,    61,    63,   105,    46,    30,    98,    32,    82,    81,
    88,    79,    35,    34,    29,    12,    28,    11,    72,    21,
    69,    22,    36,    59,    38,    57,    56,    55,    54,    53,
    43,   104,    95,    97,    85,    87,    76,    78,    66,    52,
    45,    40,    39,    48,    47,     3,    26,    25,     9,     8,
    60,     6,     5,     1,     0,     0,     0,     0,    75,    71,
    70,     0,    80,    68,     0,     0,     0,     0,     0,     0,
     0,    84,    89,     0,    90,     0,     0,     0,     0,     0,
     0,    99,     0,   100,    92,    94,     0,     0,     0,     0,
     0,   106,     0,   107,     0,     0,     0,     0,     0,     0,
   108,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,    49,     0,     0,    49,     0,     0,
     0,     0,    50,    64,    65,    50,    64,    65,    64,    65,
    64,    65,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,    14,     0,    15,     0,     0,     0,     0,     0,    16,
    17,    18,     0,     0,     0,     0,    19,    20 };
int yypact[]={

  -237, -1000,  -243,  -266, -1000,  -272, -1000,   -42,  -274, -1000,
   -42,  -268,   -42, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000, -1000, -1000, -1000,  -239, -1000,   -42,  -269,   -42,
 -1000, -1000, -1000,  -245, -1000,   -42, -1000, -1000, -1000,  -241,
  -245, -1000,  -253, -1000, -1000, -1000,  -248, -1000, -1000, -1000,
 -1000,   -86,  -250, -1000, -1000, -1000, -1000, -1000,   -89,   -89,
 -1000, -1000, -1000, -1000, -1000, -1000,  -252,   -42,    -4,   -66,
 -1000, -1000,   -89, -1000,   -89, -1000,  -254,   -42, -1000,   -42,
 -1000,   -82,   -84, -1000, -1000,  -256,   -42, -1000,   -42, -1000,
 -1000, -1000,   -67, -1000,   -68,  -258,   -42, -1000,   -42, -1000,
 -1000, -1000, -1000, -1000, -1000,   -42, -1000, -1000, -1000 };
int yypgo[]={

     0,    83,    82,    81,    79,    78,    77,    76,    75,    72,
    71,    29,    34,    69,    68,    67,    66,    65,    64,    63,
    62,    61,    31,    30,    59,    58,    57,    56,    55,    32,
    53,    28,    50,    48,    47,    46,    45,    24,    44,    43,
    42,    41,    40,    36,    33 };
int yyr1[]={

     0,     2,     2,     4,     4,     6,     6,     1,     8,    10,
    10,     9,    11,    14,    14,    16,    16,    18,    18,    20,
    20,    11,    12,    12,    13,    13,    13,    13,    13,    13,
    24,    25,    26,    27,    30,    30,    28,    31,    31,    31,
    31,    33,    33,    32,    22,    23,    29,    29,     3,     5,
    36,    36,    34,    38,    38,    35,     7,    40,    40,    39,
    41,    41,    15,    42,    42,    17,    43,    43,    19,    44,
    44,    21,    37,    37,    37,    37,    37,    37,    37,    37,
    37,    37,    37 };
int yyr2[]={

     0,     1,     2,     1,     2,     1,     2,    17,     3,     2,
     5,     3,     9,     1,     4,     1,     4,     1,     4,     1,
     4,    19,     3,     3,     1,     3,     3,     3,     3,     3,
     9,     9,    11,    11,     2,     5,     3,     3,     3,     3,
     7,     2,     5,     3,     3,     3,     3,     3,     7,     7,
     2,     5,     3,     2,     5,     3,     5,     2,     5,     3,
     2,     5,     3,     2,     5,     3,     2,     5,     3,     2,
     5,     3,     3,     3,     3,     3,     3,     3,     3,     3,
     3,     3,     3 };
int yychk[]={

 -1000,    -1,   260,    -8,   263,    -2,    -3,   274,    -4,    -5,
   276,   -34,   -36,   -37,   263,   265,   271,   272,   273,   278,
   279,    91,    93,    43,    42,    -6,    -7,   277,   -35,   -38,
   -37,   275,   -37,   261,   -39,   -40,   -37,   275,   -37,    -9,
   -10,   -11,   264,   -37,   262,   -11,   -12,   -22,   -23,   263,
   271,   265,   -13,   -24,   -25,   -26,   -27,   -28,    91,   -30,
   -31,   -22,   -23,   -29,   272,   273,   -14,   266,   -12,   -32,
   -22,   -23,   -33,   -31,    91,   -31,   -16,   267,   -15,   -41,
   -37,    43,    42,    93,   -31,   -18,   268,   -17,   -42,   -37,
   -37,    93,   -29,    93,   -29,   -20,   269,   -19,   -43,   -37,
   -37,    93,    93,   270,   -21,   -44,   -37,   -37,   -37 };
int yydef[]={

     0,    -2,     0,     1,     8,     3,     2,     0,     5,     4,
     0,     0,    52,    50,    72,    73,    74,    75,    76,    77,
    78,    79,    80,    81,    82,     0,     6,     0,     0,    55,
    53,    48,    51,     0,    56,    59,    57,    49,    54,     0,
    11,     9,     0,    58,     7,    10,     0,    22,    23,    44,
    45,    24,    -2,    25,    26,    27,    28,    29,     0,    36,
    34,    37,    38,    39,    46,    47,    15,     0,     0,     0,
    -2,    -2,    43,    41,     0,    35,    17,     0,    14,    62,
    60,     0,     0,    40,    42,    19,     0,    16,    65,    63,
    61,    30,     0,    31,     0,     0,     0,    18,    68,    66,
    64,    32,    33,    21,    20,    71,    69,    67,    70 };
typedef struct { char *t_name; int t_val; } yytoktype;
#ifndef YYDEBUG
#	define YYDEBUG	0	/* don't allow debugging */
#endif

#if YYDEBUG

yytoktype yytoks[] =
{
	"LANGUAGE",	260,
	"SYNTAX",	261,
	"END_LANGUAGE",	262,
	"LID",	263,
	"RULE",	264,
	"ASSIGN",	265,
	"TAST",	266,
	"ATTRIBUTION",	267,
	"CONDITION",	268,
	"VISIT",	269,
	"END_RULE",	270,
	"NODE",	271,
	"UID",	272,
	"STRING",	273,
	"INCLUDE_LAG",	274,
	"END_INCLUDE",	275,
	"INCLUDE_RAG",	276,
	"ATTRIBUTES",	277,
	"CHAR",	278,
	"ID",	279,
	"-unknown-",	-1	/* ends search */
};

char * yyreds[] =
{
	"-no such reduction-",
	"I1opt : /* empty */",
	"I1opt : lagh",
	"I2opt : /* empty */",
	"I2opt : ragh",
	"I3opt : /* empty */",
	"I3opt : attrs",
	"language : LANGUAGE language_id I1opt I2opt I3opt SYNTAX rules END_LANGUAGE",
	"language_id : LID",
	"I4repp : rule",
	"I4repp : I4repp rule",
	"rules : I4repp",
	"rule : RULE lhs ASSIGN rhs",
	"I5opt : /* empty */",
	"I5opt : TAST astset",
	"I6opt : /* empty */",
	"I6opt : ATTRIBUTION attrset",
	"I7opt : /* empty */",
	"I7opt : CONDITION condset",
	"I8opt : /* empty */",
	"I8opt : VISIT visitset",
	"rule : RULE lhs ASSIGN rhs I5opt I6opt I7opt I8opt END_RULE",
	"lhs : phyla",
	"lhs : node",
	"rhs : /* empty */",
	"rhs : repp",
	"rhs : repa",
	"rhs : repp_sep",
	"rhs : repa_sep",
	"rhs : secuence",
	"repp : '[' lhs '+' ']'",
	"repa : '[' lhs '*' ']'",
	"repp_sep : '[' lhs '+' terminal ']'",
	"repa_sep : '[' lhs '*' terminal ']'",
	"I9repp : term",
	"I9repp : I9repp term",
	"secuence : I9repp",
	"term : phyla",
	"term : node",
	"term : terminal",
	"term : '[' option ']'",
	"I10repp : term",
	"I10repp : I10repp term",
	"option : I10repp",
	"phyla : LID",
	"node : NODE",
	"terminal : UID",
	"terminal : STRING",
	"lagh : INCLUDE_LAG laginc END_INCLUDE",
	"ragh : INCLUDE_RAG raginc END_INCLUDE",
	"I11repp : block",
	"I11repp : I11repp block",
	"laginc : I11repp",
	"I12repp : block",
	"I12repp : I12repp block",
	"raginc : I12repp",
	"attrs : ATTRIBUTES attr_list",
	"I13repp : block",
	"I13repp : I13repp block",
	"attr_list : I13repp",
	"I14repp : block",
	"I14repp : I14repp block",
	"astset : I14repp",
	"I15repp : block",
	"I15repp : I15repp block",
	"attrset : I15repp",
	"I16repp : block",
	"I16repp : I16repp block",
	"condset : I16repp",
	"I17repp : block",
	"I17repp : I17repp block",
	"visitset : I17repp",
	"block : LID",
	"block : ASSIGN",
	"block : NODE",
	"block : UID",
	"block : STRING",
	"block : CHAR",
	"block : ID",
	"block : '['",
	"block : ']'",
	"block : '+'",
	"block : '*'",
};
#endif /* YYDEBUG */
#line 1 "/usr/lib/yaccpar"
/*	@(#)yaccpar 1.10 89/04/04 SMI; from S5R3 1.10	*/

/*
** Skeleton parser driver for yacc output
*/

/*
** yacc user known macros and defines
*/
#define YYERROR		goto yyerrlab
#define YYACCEPT	{ free(yys); free(yyv); return(0); }
#define YYABORT		{ free(yys); free(yyv); return(1); }
#define YYBACKUP( newtoken, newvalue )\
{\
	if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
	{\
		yyerror( "syntax error - cannot backup" );\
		goto yyerrlab;\
	}\
	yychar = newtoken;\
	yystate = *yyps;\
	yylval = newvalue;\
	goto yynewstate;\
}
#define YYRECOVERING()	(!!yyerrflag)
#ifndef YYDEBUG
#	define YYDEBUG	1	/* make debugging available */
#endif

/*
** user known globals
*/
int yydebug;			/* set to 1 to get debugging */

/*
** driver internal defines
*/
#define YYFLAG		(-1000)

/*
** static variables used by the parser
*/
static YYSTYPE *yyv;			/* value stack */
static int *yys;			/* state stack */

static YYSTYPE *yypv;			/* top of value stack */
static int *yyps;			/* top of state stack */

static int yystate;			/* current state */
static int yytmp;			/* extra var (lasts between blocks) */

int yynerrs;			/* number of errors */

int yyerrflag;			/* error recovery flag */
int yychar;			/* current input token number */


/*
** yyparse - return 0 if worked, 1 if syntax error not recovered from
*/
int
yyparse()
{
	register YYSTYPE *yypvt;	/* top of value stack for $vars */
	unsigned yymaxdepth = YYMAXDEPTH;

	/*
	** Initialize externals - yyparse may be called more than once
	*/
	yyv = (YYSTYPE*)malloc(yymaxdepth*sizeof(YYSTYPE));
	yys = (int*)malloc(yymaxdepth*sizeof(int));
	if (!yyv || !yys)
	{
		yyerror( "out of memory" );
		return(1);
	}
	yypv = &yyv[-1];
	yyps = &yys[-1];
	yystate = 0;
	yytmp = 0;
	yynerrs = 0;
	yyerrflag = 0;
	yychar = -1;

	goto yystack;
	{
		register YYSTYPE *yy_pv;	/* top of value stack */
		register int *yy_ps;		/* top of state stack */
		register int yy_state;		/* current state */
		register int  yy_n;		/* internal state number info */

		/*
		** get globals into registers.
		** branch to here only if YYBACKUP was called.
		*/
	yynewstate:
		yy_pv = yypv;
		yy_ps = yyps;
		yy_state = yystate;
		goto yy_newstate;

		/*
		** get globals into registers.
		** either we just started, or we just finished a reduction
		*/
	yystack:
		yy_pv = yypv;
		yy_ps = yyps;
		yy_state = yystate;

		/*
		** top of for (;;) loop while no reductions done
		*/
	yy_stack:
		/*
		** put a state and value onto the stacks
		*/
#if YYDEBUG
		/*
		** if debugging, look up token value in list of value vs.
		** name pairs.  0 and negative (-1) are special values.
		** Note: linear search is used since time is not a real
		** consideration while debugging.
		*/
		if ( yydebug )
		{
			register int yy_i;

			(void)printf( "State %d, token ", yy_state );
			if ( yychar == 0 )
				(void)printf( "end-of-file\n" );
			else if ( yychar < 0 )
				(void)printf( "-none-\n" );
			else
			{
				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
					yy_i++ )
				{
					if ( yytoks[yy_i].t_val == yychar )
						break;
				}
				(void)printf( "%s\n", yytoks[yy_i].t_name );
			}
		}
#endif /* YYDEBUG */
		if ( ++yy_ps >= &yys[ yymaxdepth ] )	/* room on stack? */
		{
			/*
			** reallocate and recover.  Note that pointers
			** have to be reset, or bad things will happen
			*/
			int yyps_index = (yy_ps - yys);
			int yypv_index = (yy_pv - yyv);
			int yypvt_index = (yypvt - yyv);
			yymaxdepth += YYMAXDEPTH;
			yyv = (YYSTYPE*)realloc((char*)yyv,
				yymaxdepth * sizeof(YYSTYPE));
			yys = (int*)realloc((char*)yys,
				yymaxdepth * sizeof(int));
			if (!yyv || !yys)
			{
				yyerror( "yacc stack overflow" );
				return(1);
			}
			yy_ps = yys + yyps_index;
			yy_pv = yyv + yypv_index;
			yypvt = yyv + yypvt_index;
		}
		*yy_ps = yy_state;
		*++yy_pv = yyval;

		/*
		** we have a new state - find out what to do
		*/
	yy_newstate:
		if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
			goto yydefault;		/* simple state */
#if YYDEBUG
		/*
		** if debugging, need to mark whether new token grabbed
		*/
		yytmp = yychar < 0;
#endif
		if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
			yychar = 0;		/* reached EOF */
#if YYDEBUG
		if ( yydebug && yytmp )
		{
			register int yy_i;

			(void)printf( "Received token " );
			if ( yychar == 0 )
				(void)printf( "end-of-file\n" );
			else if ( yychar < 0 )
				(void)printf( "-none-\n" );
			else
			{
				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
					yy_i++ )
				{
					if ( yytoks[yy_i].t_val == yychar )
						break;
				}
				(void)printf( "%s\n", yytoks[yy_i].t_name );
			}
		}
#endif /* YYDEBUG */
		if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
			goto yydefault;
		if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar )	/*valid shift*/
		{
			yychar = -1;
			yyval = yylval;
			yy_state = yy_n;
			if ( yyerrflag > 0 )
				yyerrflag--;
			goto yy_stack;
		}

	yydefault:
		if ( ( yy_n = yydef[ yy_state ] ) == -2 )
		{
#if YYDEBUG
			yytmp = yychar < 0;
#endif
			if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
				yychar = 0;		/* reached EOF */
#if YYDEBUG
			if ( yydebug && yytmp )
			{
				register int yy_i;

				(void)printf( "Received token " );
				if ( yychar == 0 )
					(void)printf( "end-of-file\n" );
				else if ( yychar < 0 )
					(void)printf( "-none-\n" );
				else
				{
					for ( yy_i = 0;
						yytoks[yy_i].t_val >= 0;
						yy_i++ )
					{
						if ( yytoks[yy_i].t_val
							== yychar )
						{
							break;
						}
					}
					(void)printf( "%s\n", yytoks[yy_i].t_name );
				}
			}
#endif /* YYDEBUG */
			/*
			** look through exception table
			*/
			{
				register int *yyxi = yyexca;

				while ( ( *yyxi != -1 ) ||
					( yyxi[1] != yy_state ) )
				{
					yyxi += 2;
				}
				while ( ( *(yyxi += 2) >= 0 ) &&
					( *yyxi != yychar ) )
					;
				if ( ( yy_n = yyxi[1] ) < 0 )
					YYACCEPT;
			}
		}

		/*
		** check for syntax error
		*/
		if ( yy_n == 0 )	/* have an error */
		{
			/* no worry about speed here! */
			switch ( yyerrflag )
			{
			case 0:		/* new error */
				yyerror( "syntax error" );
				goto skip_init;
			yyerrlab:
				/*
				** get globals into registers.
				** we have a user generated syntax type error
				*/
				yy_pv = yypv;
				yy_ps = yyps;
				yy_state = yystate;
				yynerrs++;
			skip_init:
			case 1:
			case 2:		/* incompletely recovered error */
					/* try again... */
				yyerrflag = 3;
				/*
				** find state where "error" is a legal
				** shift action
				*/
				while ( yy_ps >= yys )
				{
					yy_n = yypact[ *yy_ps ] + YYERRCODE;
					if ( yy_n >= 0 && yy_n < YYLAST &&
						yychk[yyact[yy_n]] == YYERRCODE)					{
						/*
						** simulate shift of "error"
						*/
						yy_state = yyact[ yy_n ];
						goto yy_stack;
					}
					/*
					** current state has no shift on
					** "error", pop stack
					*/
#if YYDEBUG
#	define _POP_ "Error recovery pops state %d, uncovers state %d\n"
					if ( yydebug )
						(void)printf( _POP_, *yy_ps,
							yy_ps[-1] );
#	undef _POP_
#endif
					yy_ps--;
					yy_pv--;
				}
				/*
				** there is no state on stack with "error" as
				** a valid shift.  give up.
				*/
				YYABORT;
			case 3:		/* no shift yet; eat a token */
#if YYDEBUG
				/*
				** if debugging, look up token in list of
				** pairs.  0 and negative shouldn't occur,
				** but since timing doesn't matter when
				** debugging, it doesn't hurt to leave the
				** tests here.
				*/
				if ( yydebug )
				{
					register int yy_i;

					(void)printf( "Error recovery discards " );
					if ( yychar == 0 )
						(void)printf( "token end-of-file\n" );
					else if ( yychar < 0 )
						(void)printf( "token -none-\n" );
					else
					{
						for ( yy_i = 0;
							yytoks[yy_i].t_val >= 0;
							yy_i++ )
						{
							if ( yytoks[yy_i].t_val
								== yychar )
							{
								break;
							}
						}
						(void)printf( "token %s\n",
							yytoks[yy_i].t_name );
					}
				}
#endif /* YYDEBUG */
				if ( yychar == 0 )	/* reached EOF. quit */
					YYABORT;
				yychar = -1;
				goto yy_newstate;
			}
		}/* end if ( yy_n == 0 ) */
		/*
		** reduction by production yy_n
		** put stack tops, etc. so things right after switch
		*/
#if YYDEBUG
		/*
		** if debugging, print the string that is the user's
		** specification of the reduction which is just about
		** to be done.
		*/
		if ( yydebug )
			(void)printf( "Reduce by (%d) \"%s\"\n",
				yy_n, yyreds[ yy_n ] );
#endif
		yytmp = yy_n;			/* value to switch over */
		yypvt = yy_pv;			/* $vars top of value stack */
		/*
		** Look in goto table for next state
		** Sorry about using yy_state here as temporary
		** register variable, but why not, if it works...
		** If yyr2[ yy_n ] doesn't have the low order bit
		** set, then there is no action to be done for
		** this reduction.  So, no saving & unsaving of
		** registers done.  The only difference between the
		** code just after the if and the body of the if is
		** the goto yy_stack in the body.  This way the test
		** can be made before the choice of what to do is needed.
		*/
		{
			/* length of production doubled with extra bit */
			register int yy_len = yyr2[ yy_n ];

			if ( !( yy_len & 01 ) )
			{
				yy_len >>= 1;
				yyval = ( yy_pv -= yy_len )[1];	/* $$ = $1 */
				yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
					*( yy_ps -= yy_len ) + 1;
				if ( yy_state >= YYLAST ||
					yychk[ yy_state =
					yyact[ yy_state ] ] != -yy_n )
				{
					yy_state = yyact[ yypgo[ yy_n ] ];
				}
				goto yy_stack;
			}
			yy_len >>= 1;
			yyval = ( yy_pv -= yy_len )[1];	/* $$ = $1 */
			yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
				*( yy_ps -= yy_len ) + 1;
			if ( yy_state >= YYLAST ||
				yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
			{
				yy_state = yyact[ yypgo[ yy_n ] ];
			}
		}
					/* save until reenter driver code */
		yystate = yy_state;
		yyps = yy_ps;
		yypv = yy_pv;
	}
	/*
	** code supplied by user is placed in this switch
	*/
	switch( yytmp )
	{

case 1:
# line 54 "gram.y"
{ ndput (tNULL); } break;
case 3:
# line 63 "gram.y"
{ ndput (tNULL); } break;
case 5:
# line 72 "gram.y"
{ ndput (tNULL); } break;
case 7:
# line 81 "gram.y"
{
	if (errorcount == 0)
	{
	 class(5);
	 if (sttype() == tNULL) stpop();
	 else if (stpick(1)->type == tNULL) {stswap(); stpop();}
	 else stlrlink();
	 if (sttype() == tNULL) stpop();
	 else if (stpick(1)->type == tNULL) {stswap(); stpop();}
	 else stlrlink();
	 if (sttype() == tNULL) stpop();
	 else if (stpick(1)->type == tNULL) {stswap(); stpop();}
	 else stlrlink();
	 if (sttype() == tNULL) stpop();
	 else if (stpick(1)->type == tNULL) {stswap(); stpop();}
	 else stlrlink();
	 ndput(tlanguage);
	 sttop()->value1= (CLR_TYPE)cls;
	 if (stpick(1)->type == tNULL)
	      {stswap(); stpop();}
	 else stsflink ();
	 putgrn(1);
	}
	} break;
case 8:
# line 109 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tlanguage_id);
fprintf(stderr, "1A %d\n", (CLR_TYPE)yypvt[-0].name);
fprintf(stderr, "1B %d\n", (CLR_TYPE)yypvt[-0].line);
	 staclr (c_lexv, (CLR_TYPE)yypvt[-0].name);
	 staclr (c_line, (CLR_TYPE)yypvt[-0].line);
	 putgrn(2);
	}
	} break;
case 10:
# line 126 "gram.y"
{ if (errorcount == 0) stlrlink (); } break;
case 11:
# line 131 "gram.y"
{
	if (errorcount == 0)
	{
	 class(1);
	 ndput(trules);
	 sttop()->value1= (CLR_TYPE)cls;
	 if (stpick(1)->type == tNULL)
	      {stswap(); stpop();}
	 else stsflink ();
	 putgrn(3);
	}
	} break;
case 12:
# line 147 "gram.y"
{
	if (errorcount == 0)
	{
	 class(2);
	 if (sttype() == tNULL) stpop();
	 else if (stpick(1)->type == tNULL) {stswap(); stpop();}
	 else stlrlink();
	 ndput(trule);
	 sttop()->value1= (CLR_TYPE)cls;
	 if (stpick(1)->type == tNULL)
	      {stswap(); stpop();}
	 else stsflink ();
	 putgrn(4);
	}
	} break;
case 13:
# line 166 "gram.y"
{ ndput (tNULL); } break;
case 15:
# line 175 "gram.y"
{ ndput (tNULL); } break;
case 17:
# line 184 "gram.y"
{ ndput (tNULL); } break;
case 19:
# line 193 "gram.y"
{ ndput (tNULL); } break;
case 21:
# line 202 "gram.y"
{
	if (errorcount == 0)
	{
	 class(6);
	 if (sttype() == tNULL) stpop();
	 else if (stpick(1)->type == tNULL) {stswap(); stpop();}
	 else stlrlink();
	 if (sttype() == tNULL) stpop();
	 else if (stpick(1)->type == tNULL) {stswap(); stpop();}
	 else stlrlink();
	 if (sttype() == tNULL) stpop();
	 else if (stpick(1)->type == tNULL) {stswap(); stpop();}
	 else stlrlink();
	 if (sttype() == tNULL) stpop();
	 else if (stpick(1)->type == tNULL) {stswap(); stpop();}
	 else stlrlink();
	 if (sttype() == tNULL) stpop();
	 else if (stpick(1)->type == tNULL) {stswap(); stpop();}
	 else stlrlink();
	 ndput(trule);
	 sttop()->value1= (CLR_TYPE)cls;
	 if (stpick(1)->type == tNULL)
	      {stswap(); stpop();}
	 else stsflink ();
	 putgrn(5);
	}
	} break;
case 22:
# line 233 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(6);
	}
	} break;
case 23:
# line 243 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(7);
	}
	} break;
case 24:
# line 253 "gram.y"
{
	if (errorcount == 0)
	{
  ndput (tNULL);
	 putgrn(8);
	}
	} break;
case 25:
# line 264 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(9);
	}
	} break;
case 26:
# line 274 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(10);
	}
	} break;
case 27:
# line 284 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(11);
	}
	} break;
case 28:
# line 294 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(12);
	}
	} break;
case 29:
# line 304 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(13);
	}
	} break;
case 30:
# line 314 "gram.y"
{
	if (errorcount == 0)
	{
	 if (sttype() == tNULL){
		class(0);
		stpop();
	 }
	 else class(1);
	 ndput(trepp);
	 sttop()->value1= (CLR_TYPE)cls;
	 if (cls == 1) stsflink ();
	 putgrn(14);
	}
	} break;
case 31:
# line 332 "gram.y"
{
	if (errorcount == 0)
	{
	 if (sttype() == tNULL){
		class(0);
		stpop();
	 }
	 else class(1);
	 ndput(trepa);
	 sttop()->value1= (CLR_TYPE)cls;
	 if (cls == 1) stsflink ();
	 putgrn(15);
	}
	} break;
case 32:
# line 350 "gram.y"
{
	if (errorcount == 0)
	{
	 class(2);
	 if (sttype() == tNULL) stpop();
	 else if (stpick(1)->type == tNULL) {stswap(); stpop();}
	 else stlrlink();
	 ndput(trepp_sep);
	 sttop()->value1= (CLR_TYPE)cls;
	 if (stpick(1)->type == tNULL)
	      {stswap(); stpop();}
	 else stsflink ();
	 putgrn(16);
	}
	} break;
case 33:
# line 369 "gram.y"
{
	if (errorcount == 0)
	{
	 class(2);
	 if (sttype() == tNULL) stpop();
	 else if (stpick(1)->type == tNULL) {stswap(); stpop();}
	 else stlrlink();
	 ndput(trepa_sep);
	 sttop()->value1= (CLR_TYPE)cls;
	 if (stpick(1)->type == tNULL)
	      {stswap(); stpop();}
	 else stsflink ();
	 putgrn(17);
	}
	} break;
case 35:
# line 392 "gram.y"
{ if (errorcount == 0) stlrlink (); } break;
case 36:
# line 397 "gram.y"
{
	if (errorcount == 0)
	{
	 class(1);
	 ndput(tsecuence);
	 sttop()->value1= (CLR_TYPE)cls;
	 if (stpick(1)->type == tNULL)
	      {stswap(); stpop();}
	 else stsflink ();
	 putgrn(18);
	}
	} break;
case 37:
# line 413 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(19);
	}
	} break;
case 38:
# line 423 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(20);
	}
	} break;
case 39:
# line 433 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(21);
	}
	} break;
case 40:
# line 443 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(22);
	}
	} break;
case 42:
# line 457 "gram.y"
{ if (errorcount == 0) stlrlink (); } break;
case 43:
# line 462 "gram.y"
{
	if (errorcount == 0)
	{
	 class(1);
	 ndput(toption);
	 sttop()->value1= (CLR_TYPE)cls;
	 if (stpick(1)->type == tNULL)
	      {stswap(); stpop();}
	 else stsflink ();
	 putgrn(23);
	}
	} break;
case 44:
# line 478 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tphyla);
fprintf(stderr, "2A %d\n", (CLR_TYPE)yypvt[-0].name);
fprintf(stderr, "2B %d\n", (CLR_TYPE)yypvt[-0].line);
	 staclr (c_lexv, (CLR_TYPE)yypvt[-0].name);
	 staclr (c_line, (CLR_TYPE)yypvt[-0].line);
	 putgrn(24);
	}
	} break;
case 45:
# line 491 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tnode);
fprintf(stderr, "3A %d\n", (CLR_TYPE)yypvt[-0].name);
fprintf(stderr, "3B %d\n", (CLR_TYPE)yypvt[-0].line);
	 staclr (c_lexv, (CLR_TYPE)yypvt[-0].name);
	 staclr (c_line, (CLR_TYPE)yypvt[-0].line);
	 putgrn(25);
	}
	} break;
case 46:
# line 504 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tterminal);
fprintf(stderr, "4A %d\n", (CLR_TYPE)yypvt[-0].name);
fprintf(stderr, "4B %d\n", (CLR_TYPE)yypvt[-0].line);
	 staclr (c_lexv, (CLR_TYPE)yypvt[-0].name);
	 staclr (c_line, (CLR_TYPE)yypvt[-0].line);
	 putgrn(26);
	}
	} break;
case 47:
# line 517 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tterminal);
fprintf(stderr, "5A %d\n", (CLR_TYPE)yypvt[-0].name);
fprintf(stderr, "5B %d\n", (CLR_TYPE)yypvt[-0].line);
	 staclr (c_lexv, (CLR_TYPE)yypvt[-0].name);
	 staclr (c_line, (CLR_TYPE)yypvt[-0].line);
	 putgrn(27);
	}
	} break;
case 48:
# line 530 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(28);
	}
	} break;
case 49:
# line 540 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(29);
	}
	} break;
case 51:
# line 554 "gram.y"
{ if (errorcount == 0) stlrlink (); } break;
case 52:
# line 559 "gram.y"
{
	if (errorcount == 0)
	{
  stpop ();
  ndput(tlaginc);
fprintf(stderr, "6 %d\n", (CLR_TYPE)block);
  staclr (c_block, (CLR_TYPE)block);
	 putgrn(30);
	}
	} break;
case 54:
# line 576 "gram.y"
{ if (errorcount == 0) stlrlink (); } break;
case 55:
# line 581 "gram.y"
{
	if (errorcount == 0)
	{
  stpop ();
  ndput(traginc);
fprintf(stderr, "7 %d\n", (CLR_TYPE)block);
  staclr (c_block, (CLR_TYPE)block);
	 putgrn(31);
	}
	} break;
case 56:
# line 594 "gram.y"
{
	if (errorcount == 0)
	{
	 putgrn(32);
	}
	} break;
case 58:
# line 608 "gram.y"
{ if (errorcount == 0) stlrlink (); } break;
case 59:
# line 613 "gram.y"
{
	if (errorcount == 0)
	{
  stpop ();
  ndput(tattr_list);
fprintf(stderr, "8 %d\n", (CLR_TYPE)block);
  staclr (c_block, (CLR_TYPE)block);
	 putgrn(33);
	}
	} break;
case 61:
# line 630 "gram.y"
{ if (errorcount == 0) stlrlink (); } break;
case 62:
# line 635 "gram.y"
{
	if (errorcount == 0)
	{
  stpop ();
  ndput(tastset);
fprintf(stderr, "9 %d\n", (CLR_TYPE)block);
  staclr (c_block, (CLR_TYPE)block);
	 putgrn(34);
	}
	} break;
case 64:
# line 652 "gram.y"
{ if (errorcount == 0) stlrlink (); } break;
case 65:
# line 657 "gram.y"
{
	if (errorcount == 0)
	{
  stpop ();
  ndput(tattrset);
fprintf(stderr, "A %d\n", (CLR_TYPE)block);
  staclr (c_block, (CLR_TYPE)block);
	 putgrn(35);
	}
	} break;
case 67:
# line 674 "gram.y"
{ if (errorcount == 0) stlrlink (); } break;
case 68:
# line 679 "gram.y"
{
	if (errorcount == 0)
	{
  stpop ();
  ndput(tcondset);
fprintf(stderr, "B %d\n", (CLR_TYPE)block);
  staclr (c_block, (CLR_TYPE)block);
	 putgrn(36);
	}
	} break;
case 70:
# line 696 "gram.y"
{ if (errorcount == 0) stlrlink (); } break;
case 71:
# line 701 "gram.y"
{
	if (errorcount == 0)
	{
  stpop ();
  ndput(tvisitset);
fprintf(stderr, "C %d\n", (CLR_TYPE)block);
  staclr (c_block, (CLR_TYPE)block);
	 putgrn(37);
	}
	} break;
case 72:
# line 714 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tNULL);
	 putgrn(38);
	}
	} break;
case 73:
# line 725 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tNULL);
	 putgrn(39);
	}
	} break;
case 74:
# line 736 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tNULL);
	 putgrn(40);
	}
	} break;
case 75:
# line 747 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tNULL);
	 putgrn(41);
	}
	} break;
case 76:
# line 758 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tNULL);
	 putgrn(42);
	}
	} break;
case 77:
# line 769 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tNULL);
	 putgrn(43);
	}
	} break;
case 78:
# line 780 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tNULL);
	 putgrn(44);
	}
	} break;
case 79:
# line 791 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tNULL);
	 putgrn(45);
	}
	} break;
case 80:
# line 802 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tNULL);
	 putgrn(46);
	}
	} break;
case 81:
# line 813 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tNULL);
	 putgrn(47);
	}
	} break;
case 82:
# line 824 "gram.y"
{
	if (errorcount == 0)
	{
	 ndput(tNULL);
	 putgrn(48);
	}
	} break;
	}
	goto yystack;		/* reset registers in driver code */
}
