yyparse()
yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL
yyparse(){	/*	** Initialize externals - yyparse may be called more than once	*/	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;			printf( "State %d, token ", yy_state );			if ( yychar == 0 )				printf( "end-of-file\n" );			else if ( yychar < 0 )				printf( "-none-\n" );			else			{				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;					yy_i++ )				{					if ( yytoks[yy_i].t_val == yychar )						break;				}				printf( "%s\n", yytoks[yy_i].t_name );			}		}#endif /* YYDEBUG */		if ( ++yy_ps >= &yys[ YYMAXDEPTH ] )	/* room on stack? */		{			yyerror( "yacc stack overflow" );			YYABORT;		}		*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;			printf( "Received token " );			if ( yychar == 0 )				printf( "end-of-file\n" );			else if ( yychar < 0 )				printf( "-none-\n" );			else			{				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;					yy_i++ )				{					if ( yytoks[yy_i].t_val == yychar )						break;				}				printf( "%s\n", yytoks[yy_i].t_name );			}		}#endif /* YYDEBUG */		if ( ( ( yy_n += yychar ) < 0 ) ||                ( yy_n >= YYLAST )       ||                (yyact[yy_n ] < 0))               	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;				printf( "Received token " );				if ( yychar == 0 )					printf( "end-of-file\n" );				else if ( yychar < 0 )					printf( "-none-\n" );				else				{					for ( yy_i = 0;						yytoks[yy_i].t_val >= 0;						yy_i++ )					{						if ( yytoks[yy_i].t_val							== yychar )						{							break;						}					}					printf( "%s\n", yytoks[yy_i].t_name );				}			}#endif /* YYDEBUG */			/*			** look through exception table			*/			{				register const 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 )						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;					printf( "Error recovery discards " );					if ( yychar == 0 )						printf( "token end-of-file\n" );					else if ( yychar < 0 )						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;							}						}						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 )			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 2:	/* run : rules */# line 142 "jamgram.y"{ parse_save( yypvt[-0].parse ); } /*NOTREACHED*/ break;case 3:	/* block : null */# line 153 "jamgram.y"{ yyval.parse = yypvt[-0].parse; } /*NOTREACHED*/ break;case 4:	/* block : rules */# line 155 "jamgram.y"{ yyval.parse = yypvt[-0].parse; } /*NOTREACHED*/ break;case 5:	/* rules : rule */# line 159 "jamgram.y"{ yyval.parse = yypvt[-0].parse; } /*NOTREACHED*/ break;case 6:	/* rules : rule rules */# line 161 "jamgram.y"{ yyval.parse = prules( yypvt[-1].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 7:	/* rules : LOCAL_t list assign_list_opt _SEMIC_t block */# line 163 "jamgram.y"{ yyval.parse = plocal( yypvt[-3].parse, yypvt[-2].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 8:	/* null : Empty */# line 167 "jamgram.y"{ yyval.parse = pnull(); } /*NOTREACHED*/ break;case 9:	/* assign_list_opt : _EQUALS_t list */# line 171 "jamgram.y"{ yyval.parse = yypvt[-0].parse; yyval.number = ASSIGN_SET; } /*NOTREACHED*/ break;case 10:	/* assign_list_opt : null */# line 173 "jamgram.y"{ yyval.parse = yypvt[-0].parse; yyval.number = ASSIGN_APPEND; } /*NOTREACHED*/ break;case 11:	/* arglist_opt : _LPAREN_t lol _RPAREN_t */# line 177 "jamgram.y"{ yyval.parse = yypvt[-1].parse; } /*NOTREACHED*/ break;case 12:	/* arglist_opt : Empty */# line 179 "jamgram.y"{ yyval.parse = P0; } /*NOTREACHED*/ break;case 13:	/* local_opt : LOCAL_t */# line 183 "jamgram.y"{ yyval.number = 1; } /*NOTREACHED*/ break;case 14:	/* local_opt : Empty */# line 185 "jamgram.y"{ yyval.number = 0; } /*NOTREACHED*/ break;case 15:	/* rule : _LBRACE_t block _RBRACE_t */# line 189 "jamgram.y"{ yyval.parse = yypvt[-1].parse; } /*NOTREACHED*/ break;case 16:	/* rule : INCLUDE_t list _SEMIC_t */# line 191 "jamgram.y"{ yyval.parse = pincl( yypvt[-1].parse ); } /*NOTREACHED*/ break;case 17:	/* rule : ARG lol _SEMIC_t */# line 193 "jamgram.y"{ yyval.parse = prule( yypvt[-2].string, yypvt[-1].parse ); } /*NOTREACHED*/ break;case 18:	/* rule : arg assign list _SEMIC_t */# line 195 "jamgram.y"{ yyval.parse = pset( yypvt[-3].parse, yypvt[-1].parse, yypvt[-2].number ); } /*NOTREACHED*/ break;case 19:	/* rule : arg ON_t list assign list _SEMIC_t */# line 197 "jamgram.y"{ yyval.parse = pset1( yypvt[-5].parse, yypvt[-3].parse, yypvt[-1].parse, yypvt[-2].number ); } /*NOTREACHED*/ break;case 20:	/* rule : RETURN_t list _SEMIC_t */# line 199 "jamgram.y"{ yyval.parse = yypvt[-1].parse; } /*NOTREACHED*/ break;case 21:	/* rule : FOR_t local_opt ARG IN_t list _LBRACE_t block _RBRACE_t */# line 201 "jamgram.y"{ yyval.parse = pfor( yypvt[-5].string, yypvt[-3].parse, yypvt[-1].parse, yypvt[-6].number ); } /*NOTREACHED*/ break;case 22:	/* rule : SWITCH_t list _LBRACE_t cases _RBRACE_t */# line 203 "jamgram.y"{ yyval.parse = pswitch( yypvt[-3].parse, yypvt[-1].parse ); } /*NOTREACHED*/ break;case 23:	/* rule : IF_t expr _LBRACE_t block _RBRACE_t */# line 205 "jamgram.y"{ yyval.parse = pif( yypvt[-3].parse, yypvt[-1].parse, pnull() ); } /*NOTREACHED*/ break;case 24:	/* rule : MODULE_t list _LBRACE_t block _RBRACE_t */# line 207 "jamgram.y"{ yyval.parse = pmodule( yypvt[-3].parse, yypvt[-1].parse ); } /*NOTREACHED*/ break;case 25:	/* rule : WHILE_t expr _LBRACE_t block _RBRACE_t */# line 209 "jamgram.y"{ yyval.parse = pwhile( yypvt[-3].parse, yypvt[-1].parse ); } /*NOTREACHED*/ break;case 26:	/* rule : IF_t expr _LBRACE_t block _RBRACE_t ELSE_t rule */# line 211 "jamgram.y"{ yyval.parse = pif( yypvt[-5].parse, yypvt[-3].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 27:	/* rule : local_opt RULE_t ARG arglist_opt rule */# line 213 "jamgram.y"{ yyval.parse = psetc( yypvt[-2].string, yypvt[-0].parse, yypvt[-1].parse, yypvt[-4].number ); } /*NOTREACHED*/ break;case 28:	/* rule : ON_t arg rule */# line 215 "jamgram.y"{ yyval.parse = pon( yypvt[-1].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 29:	/* rule : ACTIONS_t eflags ARG bindlist _LBRACE_t */# line 217 "jamgram.y"{ yymode( SCAN_STRING ); } /*NOTREACHED*/ break;case 30:	/* rule : ACTIONS_t eflags ARG bindlist _LBRACE_t STRING */# line 219 "jamgram.y"{ yymode( SCAN_NORMAL ); } /*NOTREACHED*/ break;case 31:	/* rule : ACTIONS_t eflags ARG bindlist _LBRACE_t STRING _RBRACE_t */# line 221 "jamgram.y"{ yyval.parse = psete( yypvt[-6].string,yypvt[-5].parse,yypvt[-2].string,yypvt[-7].number ); } /*NOTREACHED*/ break;case 32:	/* assign : _EQUALS_t */# line 229 "jamgram.y"{ yyval.number = ASSIGN_SET; } /*NOTREACHED*/ break;case 33:	/* assign : _PLUS_EQUALS_t */# line 231 "jamgram.y"{ yyval.number = ASSIGN_APPEND; } /*NOTREACHED*/ break;case 34:	/* assign : _QUESTION_EQUALS_t */# line 233 "jamgram.y"{ yyval.number = ASSIGN_DEFAULT; } /*NOTREACHED*/ break;case 35:	/* assign : DEFAULT_t _EQUALS_t */# line 235 "jamgram.y"{ yyval.number = ASSIGN_DEFAULT; } /*NOTREACHED*/ break;case 36:	/* expr : arg */# line 242 "jamgram.y"{ yyval.parse = peval( EXPR_EXISTS, yypvt[-0].parse, pnull() ); } /*NOTREACHED*/ break;case 37:	/* expr : expr _EQUALS_t expr */# line 244 "jamgram.y"{ yyval.parse = peval( EXPR_EQUALS, yypvt[-2].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 38:	/* expr : expr _BANG_EQUALS_t expr */# line 246 "jamgram.y"{ yyval.parse = peval( EXPR_NOTEQ, yypvt[-2].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 39:	/* expr : expr _LANGLE_t expr */# line 248 "jamgram.y"{ yyval.parse = peval( EXPR_LESS, yypvt[-2].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 40:	/* expr : expr _LANGLE_EQUALS_t expr */# line 250 "jamgram.y"{ yyval.parse = peval( EXPR_LESSEQ, yypvt[-2].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 41:	/* expr : expr _RANGLE_t expr */# line 252 "jamgram.y"{ yyval.parse = peval( EXPR_MORE, yypvt[-2].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 42:	/* expr : expr _RANGLE_EQUALS_t expr */# line 254 "jamgram.y"{ yyval.parse = peval( EXPR_MOREEQ, yypvt[-2].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 43:	/* expr : expr _AMPER_t expr */# line 256 "jamgram.y"{ yyval.parse = peval( EXPR_AND, yypvt[-2].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 44:	/* expr : expr _AMPERAMPER_t expr */# line 258 "jamgram.y"{ yyval.parse = peval( EXPR_AND, yypvt[-2].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 45:	/* expr : expr _BAR_t expr */# line 260 "jamgram.y"{ yyval.parse = peval( EXPR_OR, yypvt[-2].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 46:	/* expr : expr _BARBAR_t expr */# line 262 "jamgram.y"{ yyval.parse = peval( EXPR_OR, yypvt[-2].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 47:	/* expr : arg IN_t list */# line 264 "jamgram.y"{ yyval.parse = peval( EXPR_IN, yypvt[-2].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 48:	/* expr : _BANG_t expr */# line 266 "jamgram.y"{ yyval.parse = peval( EXPR_NOT, yypvt[-0].parse, pnull() ); } /*NOTREACHED*/ break;case 49:	/* expr : _LPAREN_t expr _RPAREN_t */# line 268 "jamgram.y"{ yyval.parse = yypvt[-1].parse; } /*NOTREACHED*/ break;case 50:	/* cases : Empty */# line 279 "jamgram.y"{ yyval.parse = P0; } /*NOTREACHED*/ break;case 51:	/* cases : case cases */# line 281 "jamgram.y"{ yyval.parse = pnode( yypvt[-1].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 52:	/* case : CASE_t ARG _COLON_t block */# line 285 "jamgram.y"{ yyval.parse = psnode( yypvt[-2].string, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 53:	/* lol : list */# line 294 "jamgram.y"{ yyval.parse = pnode( P0, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 54:	/* lol : list _COLON_t lol */# line 296 "jamgram.y"{ yyval.parse = pnode( yypvt[-0].parse, yypvt[-2].parse ); } /*NOTREACHED*/ break;case 55:	/* list : listp */# line 306 "jamgram.y"{ yyval.parse = yypvt[-0].parse; yymode( SCAN_NORMAL ); } /*NOTREACHED*/ break;case 56:	/* listp : Empty */# line 310 "jamgram.y"{ yyval.parse = pnull(); yymode( SCAN_PUNCT ); } /*NOTREACHED*/ break;case 57:	/* listp : listp arg */# line 312 "jamgram.y"{ yyval.parse = pappend( yypvt[-1].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 58:	/* arg : ARG */# line 316 "jamgram.y"{ yyval.parse = plist( yypvt[-0].string ); } /*NOTREACHED*/ break;case 59:	/* arg : _LBRACKET_t */# line 317 "jamgram.y"{ yymode( SCAN_NORMAL ); } /*NOTREACHED*/ break;case 60:	/* arg : _LBRACKET_t func _RBRACKET_t */# line 318 "jamgram.y"{ yyval.parse = yypvt[-1].parse; } /*NOTREACHED*/ break;case 61:	/* func : arg lol */# line 327 "jamgram.y"{ yyval.parse = prule( yypvt[-1].string, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 62:	/* func : ON_t arg arg lol */# line 329 "jamgram.y"{ yyval.parse = pon( yypvt[-2].parse, prule( yypvt[-1].string, yypvt[-0].parse ) ); } /*NOTREACHED*/ break;case 63:	/* func : ON_t arg RETURN_t list */# line 331 "jamgram.y"{ yyval.parse = pon( yypvt[-2].parse, yypvt[-0].parse ); } /*NOTREACHED*/ break;case 64:	/* eflags : Empty */# line 341 "jamgram.y"{ yyval.number = 0; } /*NOTREACHED*/ break;case 65:	/* eflags : eflags eflag */# line 343 "jamgram.y"{ yyval.number = yypvt[-1].number | yypvt[-0].number; } /*NOTREACHED*/ break;case 66:	/* eflag : UPDATED_t */# line 347 "jamgram.y"{ yyval.number = EXEC_UPDATED; } /*NOTREACHED*/ break;case 67:	/* eflag : TOGETHER_t */# line 349 "jamgram.y"{ yyval.number = EXEC_TOGETHER; } /*NOTREACHED*/ break;case 68:	/* eflag : IGNORE_t */# line 351 "jamgram.y"{ yyval.number = EXEC_IGNORE; } /*NOTREACHED*/ break;case 69:	/* eflag : QUIETLY_t */# line 353 "jamgram.y"{ yyval.number = EXEC_QUIETLY; } /*NOTREACHED*/ break;case 70:	/* eflag : PIECEMEAL_t */# line 355 "jamgram.y"{ yyval.number = EXEC_PIECEMEAL; } /*NOTREACHED*/ break;case 71:	/* eflag : EXISTING_t */# line 357 "jamgram.y"{ yyval.number = EXEC_EXISTING; } /*NOTREACHED*/ break;case 72:	/* bindlist : Empty */# line 366 "jamgram.y"{ yyval.parse = pnull(); } /*NOTREACHED*/ break;case 73:	/* bindlist : BIND_t list */# line 368 "jamgram.y"{ yyval.parse = yypvt[-0].parse; } /*NOTREACHED*/ break;}	goto yystack;		/* reset registers in driver code */}