# define _BANG 257
# define _BANG_EQUALS 258
# define _AMPERAMPER 259
# define _LPAREN 260
# define _RPAREN 261
# define _PLUS_EQUALS 262
# define _COLON 263
# define _SEMIC 264
# define _LANGLE 265
# define _LANGLE_EQUALS 266
# define _EQUALS 267
# define _RANGLE 268
# define _RANGLE_EQUALS 269
# define _QUESTION_EQUALS 270
# define ACTIONS 271
# define BIND 272
# define CASE 273
# define DEFAULT 274
# define ELSE 275
# define EXISTING 276
# define FOR 277
# define IF 278
# define IGNORE 279
# define IN 280
# define INCLUDE 281
# define LOCAL 282
# define ON 283
# define PIECEMEAL 284
# define QUIETLY 285
# define RULE 286
# define SWITCH 287
# define TOGETHER 288
# define UPDATED 289
# define _LBRACE 290
# define _BARBAR 291
# define _RBRACE 292
# define ARG 293
# define STRING 294
# line 64 "jamgram.y"
#include "jam.h"
#include "lists.h"
#include "parse.h"
#include "scan.h"
#include "compile.h"
#include "newstr.h"
# define F0 (void (*)())0
# define P0 (PARSE *)0
# define S0 (char *)0
# define pset( l,r,a ) parse_make( compile_set,P0,P0,S0,S0,l,r,a )
# define pset1( l,p,a ) parse_make( compile_settings,p,P0,S0,S0,l,L0,a )
# define pstng( p,l,r,a ) pset1( p, parse_make( F0,P0,P0,S0,S0,l,r,0 ), a )
# define prule( s,p ) parse_make( compile_rule,p,P0,s,S0,L0,L0,0 )
# define prules( l,r ) parse_make( compile_rules,l,r,S0,S0,L0,L0,0 )
# define pfor( s,p,l ) parse_make( compile_foreach,p,P0,s,S0,l,L0,0 )
# define psetc( s,p ) parse_make( compile_setcomp,p,P0,s,S0,L0,L0,0 )
# define psete( s,l,s1,f ) parse_make( compile_setexec,P0,P0,s,s1,l,L0,f )
# define pincl( l ) parse_make( compile_include,P0,P0,S0,S0,l,L0,0 )
# define pswitch( l,p ) parse_make( compile_switch,p,P0,S0,S0,l,L0,0 )
# define plocal( l,r,p ) parse_make( compile_local,p,P0,S0,S0,l,r,0 )
# define pnull() parse_make( compile_null,P0,P0,S0,S0,L0,L0,0 )
# define pcases( l,r ) parse_make( F0,l,r,S0,S0,L0,L0,0 )
# define pcase( s,p ) parse_make( F0,p,P0,s,S0,L0,L0,0 )
# define pif( l,r ) parse_make( compile_if,l,r,S0,S0,L0,L0,0 )
# define pthen( l,r ) parse_make( F0,l,r,S0,S0,L0,L0,0 )
# define pcond( c,l,r ) parse_make( F0,l,r,S0,S0,L0,L0,c )
# define pcomp( c,l,r ) parse_make( F0,P0,P0,S0,S0,l,r,c )
# define plol( p,l ) parse_make( F0,p,P0,S0,S0,l,L0,0 )
#include <inttypes.h>
#ifdef __STDC__
#include <stdlib.h>
#include <string.h>
#else
#include <malloc.h>
#include <memory.h>
#endif
#include <values.h>
#if defined(__cplusplus) || defined(__STDC__)
#if defined(__cplusplus) && defined(__EXTERN_C__)
extern "C" {
#endif
#ifndef yyerror
#if defined(__cplusplus)
void yyerror(const char *);
#endif
#endif
#ifndef yylex
int yylex(void);
#endif
int yyparse(void);
#if defined(__cplusplus) && defined(__EXTERN_C__)
}
#endif
#endif
#define yyclearin yychar = -1
#define yyerrok yyerrflag = 0
extern int yychar;
extern int yyerrflag;
#ifndef YYSTYPE
#define YYSTYPE int
#endif
YYSTYPE yylval;
YYSTYPE yyval;
typedef int yytabelem;
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 150
#endif
#if YYMAXDEPTH > 0
int yy_yys[YYMAXDEPTH], *yys = yy_yys;
YYSTYPE yy_yyv[YYMAXDEPTH], *yyv = yy_yyv;
#else /* user does initial allocation */
int *yys;
YYSTYPE *yyv;
#endif
static int yymaxdepth = YYMAXDEPTH;
# define YYERRCODE 256
static const yytabelem yyexca[] ={
-1, 1,
0, -1,
-2, 0,
-1, 7,
263, 41,
264, 41,
293, 41,
-2, 43,
};
# define YYNPROD 54
# define YYLAST 187
static const yytabelem yyact[]={
13, 111, 13, 98, 33, 38, 9, 11, 9, 11,
6, 4, 6, 49, 34, 12, 10, 12, 10, 5,
68, 5, 7, 65, 7, 27, 113, 31, 67, 66,
32, 108, 64, 63, 49, 99, 89, 61, 96, 39,
100, 95, 47, 25, 48, 50, 46, 106, 24, 52,
78, 26, 91, 45, 103, 23, 53, 54, 51, 55,
56, 94, 25, 33, 22, 36, 50, 24, 37, 92,
26, 57, 72, 41, 40, 105, 42, 49, 2, 3,
76, 21, 14, 20, 17, 29, 62, 16, 15, 19,
18, 77, 8, 112, 28, 107, 90, 35, 1, 0,
0, 0, 0, 0, 30, 43, 44, 0, 0, 0,
0, 0, 0, 0, 60, 69, 0, 58, 59, 0,
0, 70, 0, 0, 30, 30, 73, 79, 0, 74,
75, 0, 71, 0, 0, 80, 81, 0, 0, 0,
0, 88, 30, 30, 82, 83, 84, 85, 86, 87,
0, 0, 0, 0, 0, 0, 0, 93, 97, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 102, 0, 0, 104, 101, 0, 0, 0, 0,
0, 0, 0, 0, 109, 0, 110 };
static const yytabelem yypact[]={
-271,-10000000,-10000000, -271,-10000000, -271,-10000000,-10000000, -219, -268,
-10000000, -230, -279,-10000000,-10000000, -199, -288, -253, -190, -191,
-187,-10000000,-10000000, -214,-10000000,-10000000,-10000000, -234, -248, -246,
-209, -230, -230,-10000000, -269, -256, -271,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000, -192, -200,-10000000,-10000000, -223, -271, -230,
-230, -289, -289, -289, -289, -289, -289,-10000000,-10000000, -225,
-10000000, -220,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
-195,-10000000,-10000000,-10000000, -203, -249, -254, -223, -290, -257,
-10000000, -182,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
-250,-10000000, -271, -210,-10000000, -271,-10000000,-10000000, -188, -228,
-10000000,-10000000,-10000000,-10000000, -261, -271, -269, -293,-10000000,-10000000,
-10000000,-10000000, -266,-10000000 };
static const yytabelem yypgo[]={
0, 98, 78, 79, 83, 89, 92, 81, 80, 85,
97, 96, 95, 93, 91, 87, 86 };
static const yytabelem yyr1[]={
0, 1, 2, 2, 2, 2, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 12, 13, 3,
7, 7, 7, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 8, 8, 14, 5, 5,
4, 15, 15, 6, 10, 10, 16, 16, 16, 16,
16, 16, 11, 11 };
static const yytabelem yyr2[]={
0, 3, 1, 5, 9, 13, 7, 7, 7, 9,
13, 11, 15, 11, 11, 15, 7, 1, 1, 19,
3, 3, 3, 3, 7, 7, 7, 7, 7, 7,
7, 5, 7, 7, 7, 1, 5, 9, 3, 7,
3, 1, 5, 3, 1, 5, 3, 3, 3, 3,
3, 3, 1, 5 };
static const yytabelem yychk[]={
-10000000, -1, -2, -3, 282, 290, 281, 293, -6, 277,
287, 278, 286, 271, -2, -4, -15, -2, -4, -5,
-4, -7, 283, 274, 267, 262, 270, 293, -4, -9,
-6, 257, 260, 293, 293, -10, 264, 267, 293, 292,
264, 264, 263, -4, -4, 267, 280, 290, 290, 259,
291, 267, 258, 265, 266, 268, 269, 280, -9, -9,
-3, 293, -16, 289, 288, 279, 285, 284, 276, -2,
-4, -5, 264, -7, -4, -4, -8, -14, 273, -2,
-9, -9, -6, -6, -6, -6, -6, -6, -4, 261,
-11, 272, 264, -4, 264, 290, 292, -8, 293, 292,
290, -4, -2, 264, -2, 263, 275, -12, 292, -2,
-3, 294, -13, 292 };
static const yytabelem yydef[]={
2, -2, 1, 2, 41, 2, 41, -2, 0, 0,
41, 0, 0, 44, 3, 0, 40, 0, 0, 0,
38, 41, 41, 0, 20, 21, 22, 0, 0, 0,
23, 0, 0, 43, 0, 0, 2, 41, 42, 6,
7, 8, 41, 0, 0, 41, 41, 35, 2, 0,
0, 0, 0, 0, 0, 0, 0, 41, 31, 0,
16, 52, 45, 46, 47, 48, 49, 50, 51, 4,
0, 39, 9, 41, 0, 0, 0, 35, 0, 0,
32, 33, 24, 25, 26, 27, 28, 29, 30, 34,
0, 41, 2, 0, 11, 2, 13, 36, 0, 14,
17, 53, 5, 10, 0, 2, 0, 0, 12, 37,
15, 18, 0, 19 };
typedef struct
#ifdef __cplusplus
yytoktype
#endif
{ char *t_name; int t_val; } yytoktype;
#ifndef YYDEBUG
# define YYDEBUG 0 /* don't allow debugging */
#endif
#if YYDEBUG
yytoktype yytoks[] =
{
"_BANG", 257,
"_BANG_EQUALS", 258,
"_AMPERAMPER", 259,
"_LPAREN", 260,
"_RPAREN", 261,
"_PLUS_EQUALS", 262,
"_COLON", 263,
"_SEMIC", 264,
"_LANGLE", 265,
"_LANGLE_EQUALS", 266,
"_EQUALS", 267,
"_RANGLE", 268,
"_RANGLE_EQUALS", 269,
"_QUESTION_EQUALS", 270,
"ACTIONS", 271,
"BIND", 272,
"CASE", 273,
"DEFAULT", 274,
"ELSE", 275,
"EXISTING", 276,
"FOR", 277,
"IF", 278,
"IGNORE", 279,
"IN", 280,
"INCLUDE", 281,
"LOCAL", 282,
"ON", 283,
"PIECEMEAL", 284,
"QUIETLY", 285,
"RULE", 286,
"SWITCH", 287,
"TOGETHER", 288,
"UPDATED", 289,
"_LBRACE", 290,
"_BARBAR", 291,
"_RBRACE", 292,
"ARG", 293,
"STRING", 294,
"-unknown-", -1 /* ends search */
};
char * yyreds[] =
{
"-no such reduction-",
"run : block",
"block : /* empty */",
"block : rule block",
"block : LOCAL args _SEMIC block",
"block : LOCAL args _EQUALS args _SEMIC block",
"rule : _LBRACE block _RBRACE",
"rule : INCLUDE args _SEMIC",
"rule : ARG lol _SEMIC",
"rule : arg1 assign args _SEMIC",
"rule : arg1 ON args assign args _SEMIC",
"rule : arg1 DEFAULT _EQUALS args _SEMIC",
"rule : FOR ARG IN args _LBRACE block _RBRACE",
"rule : SWITCH args _LBRACE cases _RBRACE",
"rule : IF cond _LBRACE block _RBRACE",
"rule : IF cond _LBRACE block _RBRACE ELSE rule",
"rule : RULE ARG rule",
"rule : ACTIONS eflags ARG bindlist _LBRACE",
"rule : ACTIONS eflags ARG bindlist _LBRACE STRING",
"rule : ACTIONS eflags ARG bindlist _LBRACE STRING _RBRACE",
"assign : _EQUALS",
"assign : _PLUS_EQUALS",
"assign : _QUESTION_EQUALS",
"cond : arg1",
"cond : arg1 _EQUALS arg1",
"cond : arg1 _BANG_EQUALS arg1",
"cond : arg1 _LANGLE arg1",
"cond : arg1 _LANGLE_EQUALS arg1",
"cond : arg1 _RANGLE arg1",
"cond : arg1 _RANGLE_EQUALS arg1",
"cond : arg1 IN args",
"cond : _BANG cond",
"cond : cond _AMPERAMPER cond",
"cond : cond _BARBAR cond",
"cond : _LPAREN cond _RPAREN",
"cases : /* empty */",
"cases : case cases",
"case : CASE ARG _COLON block",
"lol : args",
"lol : args _COLON lol",
"args : argsany",
"argsany : /* empty */",
"argsany : argsany ARG",
"arg1 : ARG",
"eflags : /* empty */",
"eflags : eflags eflag",
"eflag : UPDATED",
"eflag : TOGETHER",
"eflag : IGNORE",
"eflag : QUIETLY",
"eflag : PIECEMEAL",
"eflag : EXISTING",
"bindlist : /* empty */",
"bindlist : BIND args",
};
#endif /* YYDEBUG */
# line 1 "/usr/ccs/bin/yaccpar"
/*
* Copyright (c) 1993 by Sun Microsystems, Inc.
*/
#pragma ident "@(#)yaccpar 6.15 97/12/08 SMI"
/*
** Skeleton parser driver for yacc output
*/
/*
** yacc user known macros and defines
*/
#define YYERROR goto yyerrlab
#define YYACCEPT return(0)
#define YYABORT 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)
#define YYNEW(type) malloc(sizeof(type) * yynewmax)
#define YYCOPY(to, from, type) \
(type *) memcpy(to, (char *) from, yymaxdepth * sizeof (type))
#define YYENLARGE( from, type) \
(type *) realloc((char *) from, yynewmax * sizeof(type))
#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 (-10000000)
/*
** global variables used by the parser
*/
YYSTYPE *yypv; /* top of value stack */
int *yyps; /* top of state stack */
int yystate; /* current state */
int yytmp; /* extra var (lasts between blocks) */
int yynerrs; /* number of errors */
int yyerrflag; /* error recovery flag */
int yychar; /* current input token number */
#ifdef YYNMBCHARS
#define YYLEX() yycvtok(yylex())
/*
** yycvtok - return a token if i is a wchar_t value that exceeds 255.
** If i<255, i itself is the token. If i>255 but the neither
** of the 30th or 31st bit is on, i is already a token.
*/
#if defined(__STDC__) || defined(__cplusplus)
int yycvtok(int i)
#else
int yycvtok(i) int i;
#endif
{
int first = 0;
int last = YYNMBCHARS - 1;
int mid;
wchar_t j;
if(i&0x60000000){/*Must convert to a token. */
if( yymbchars[last].character < i ){
return i;/*Giving up*/
}
while ((last>=first)&&(first>=0)) {/*Binary search loop*/
mid = (first+last)/2;
j = yymbchars[mid].character;
if( j==i ){/*Found*/
return yymbchars[mid].tvalue;
}else if( j<i ){
first = mid + 1;
}else{
last = mid -1;
}
}
/*No entry in the table.*/
return i;/* Giving up.*/
}else{/* i is already a token. */
return i;
}
}
#else/*!YYNMBCHARS*/
#define YYLEX() yylex()
#endif/*!YYNMBCHARS*/
/*
** yyparse - return 0 if worked, 1 if syntax error not recovered from
*/
#if defined(__STDC__) || defined(__cplusplus)
int yyparse(void)
#else
int yyparse()
#endif
{
register YYSTYPE *yypvt = 0; /* top of value stack for $vars */
#if defined(__cplusplus) || defined(lint)
/*
hacks to please C++ and lint - goto's inside
switch should never be executed
*/
static int __yaccpar_lint_hack__ = 0;
switch (__yaccpar_lint_hack__)
{
case 1: goto yyerrlab;
case 2: goto yynewstate;
}
#endif
/*
** 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;
#if YYMAXDEPTH <= 0
if (yymaxdepth <= 0)
{
if ((yymaxdepth = YYEXPAND(0)) <= 0)
{
yyerror("yacc initialization error");
YYABORT;
}
}
#endif
{
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 */
goto yystack; /* moved from 6 lines above to here to please C++ */
/*
** 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? */
{
/*
** reallocate and recover. Note that pointers
** have to be reset, or bad things will happen
*/
long yyps_index = (yy_ps - yys);
long yypv_index = (yy_pv - yyv);
long yypvt_index = (yypvt - yyv);
int yynewmax;
#ifdef YYEXPAND
yynewmax = YYEXPAND(yymaxdepth);
#else
yynewmax = 2 * yymaxdepth; /* double table size */
if (yymaxdepth == YYMAXDEPTH) /* first time growth */
{
char *newyys = (char *)YYNEW(int);
char *newyyv = (char *)YYNEW(YYSTYPE);
if (newyys != 0 && newyyv != 0)
{
yys = YYCOPY(newyys, yys, int);
yyv = YYCOPY(newyyv, yyv, YYSTYPE);
}
else
yynewmax = 0; /* failed */
}
else /* not first time */
{
yys = YYENLARGE(yys, int);
yyv = YYENLARGE(yyv, YYSTYPE);
if (yys == 0 || yyv == 0)
yynewmax = 0; /* failed */
}
#endif
if (yynewmax <= yymaxdepth) /* tables not expanded */
{
yyerror( "yacc stack overflow" );
YYABORT;
}
yymaxdepth = yynewmax;
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;
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 ) )
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;
skip_init:
yynerrs++;
/* FALLTHRU */
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 1:
# line 102 "jamgram.y"
{
if( yypvt[-0].parse->func == compile_null )
{
parse_free( yypvt[-0].parse );
}
else
{
parse_save( yypvt[-0].parse );
}
} break;
case 2:
# line 120 "jamgram.y"
{ yyval.parse = pnull(); } break;
case 3:
# line 122 "jamgram.y"
{ yyval.parse = prules( yypvt[-1].parse, yypvt[-0].parse ); } break;
case 4:
# line 124 "jamgram.y"
{ yyval.parse = plocal( yypvt[-2].list, L0, yypvt[-0].parse ); } break;
case 5:
# line 126 "jamgram.y"
{ yyval.parse = plocal( yypvt[-4].list, yypvt[-2].list, yypvt[-0].parse ); } break;
case 6:
# line 130 "jamgram.y"
{ yyval.parse = yypvt[-1].parse; } break;
case 7:
# line 132 "jamgram.y"
{ yyval.parse = pincl( yypvt[-1].list ); } break;
case 8:
# line 134 "jamgram.y"
{ yyval.parse = prule( yypvt[-2].string, yypvt[-1].parse ); } break;
case 9:
# line 136 "jamgram.y"
{ yyval.parse = pset( yypvt[-3].list, yypvt[-1].list, yypvt[-2].number ); } break;
case 10:
# line 138 "jamgram.y"
{ yyval.parse = pstng( yypvt[-3].list, yypvt[-5].list, yypvt[-1].list, yypvt[-2].number ); } break;
case 11:
# line 140 "jamgram.y"
{ yyval.parse = pset( yypvt[-4].list, yypvt[-1].list, ASSIGN_DEFAULT ); } break;
case 12:
# line 142 "jamgram.y"
{ yyval.parse = pfor( yypvt[-5].string, yypvt[-1].parse, yypvt[-3].list ); } break;
case 13:
# line 144 "jamgram.y"
{ yyval.parse = pswitch( yypvt[-3].list, yypvt[-1].parse ); } break;
case 14:
# line 146 "jamgram.y"
{ yyval.parse = pif( yypvt[-3].parse, pthen( yypvt[-1].parse, pnull() ) ); } break;
case 15:
# line 148 "jamgram.y"
{ yyval.parse = pif( yypvt[-5].parse, pthen( yypvt[-3].parse, yypvt[-0].parse ) ); } break;
case 16:
# line 150 "jamgram.y"
{ yyval.parse = psetc( yypvt[-1].string, yypvt[-0].parse ); } break;
case 17:
# line 152 "jamgram.y"
{ yymode( SCAN_STRING ); } break;
case 18:
# line 154 "jamgram.y"
{ yymode( SCAN_NORMAL ); } break;
case 19:
# line 156 "jamgram.y"
{ yyval.parse = psete( yypvt[-6].string,yypvt[-5].list,yypvt[-2].string,yypvt[-7].number ); } break;
case 20:
# line 164 "jamgram.y"
{ yyval.number = ASSIGN_SET; } break;
case 21:
# line 166 "jamgram.y"
{ yyval.number = ASSIGN_APPEND; } break;
case 22:
# line 168 "jamgram.y"
{ yyval.number = ASSIGN_DEFAULT; } break;
case 23:
# line 176 "jamgram.y"
{ yyval.parse = pcomp( COND_EXISTS, yypvt[-0].list, L0 ); } break;
case 24:
# line 178 "jamgram.y"
{ yyval.parse = pcomp( COND_EQUALS, yypvt[-2].list, yypvt[-0].list ); } break;
case 25:
# line 180 "jamgram.y"
{ yyval.parse = pcomp( COND_NOTEQ, yypvt[-2].list, yypvt[-0].list ); } break;
case 26:
# line 182 "jamgram.y"
{ yyval.parse = pcomp( COND_LESS, yypvt[-2].list, yypvt[-0].list ); } break;
case 27:
# line 184 "jamgram.y"
{ yyval.parse = pcomp( COND_LESSEQ, yypvt[-2].list, yypvt[-0].list ); } break;
case 28:
# line 186 "jamgram.y"
{ yyval.parse = pcomp( COND_MORE, yypvt[-2].list, yypvt[-0].list ); } break;
case 29:
# line 188 "jamgram.y"
{ yyval.parse = pcomp( COND_MOREEQ, yypvt[-2].list, yypvt[-0].list ); } break;
case 30:
# line 190 "jamgram.y"
{ yyval.parse = pcomp( COND_IN, yypvt[-2].list, yypvt[-0].list ); } break;
case 31:
# line 192 "jamgram.y"
{ yyval.parse = pcond( COND_NOT, yypvt[-0].parse, P0 ); } break;
case 32:
# line 194 "jamgram.y"
{ yyval.parse = pcond( COND_AND, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 33:
# line 196 "jamgram.y"
{ yyval.parse = pcond( COND_OR, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 34:
# line 198 "jamgram.y"
{ yyval.parse = yypvt[-1].parse; } break;
case 35:
# line 209 "jamgram.y"
{ yyval.parse = P0; } break;
case 36:
# line 211 "jamgram.y"
{ yyval.parse = pcases( yypvt[-1].parse, yypvt[-0].parse ); } break;
case 37:
# line 215 "jamgram.y"
{ yyval.parse = pcase( yypvt[-2].string, yypvt[-0].parse ); } break;
case 38:
# line 223 "jamgram.y"
{ yyval.parse = plol( P0, yypvt[-0].list ); } break;
case 39:
# line 225 "jamgram.y"
{ yyval.parse = plol( yypvt[-0].parse, yypvt[-2].list ); } break;
case 40:
# line 234 "jamgram.y"
{ yymode( SCAN_NORMAL ); } break;
case 41:
# line 238 "jamgram.y"
{ yyval.list = L0; yymode( SCAN_PUNCT ); } break;
case 42:
# line 240 "jamgram.y"
{ yyval.list = list_new( yypvt[-1].list, copystr( yypvt[-0].string ) ); } break;
case 43:
# line 244 "jamgram.y"
{ yyval.list = list_new( L0, copystr( yypvt[-0].string ) ); } break;
case 44:
# line 253 "jamgram.y"
{ yyval.number = 0; } break;
case 45:
# line 255 "jamgram.y"
{ yyval.number = yypvt[-1].number | yypvt[-0].number; } break;
case 46:
# line 259 "jamgram.y"
{ yyval.number = EXEC_UPDATED; } break;
case 47:
# line 261 "jamgram.y"
{ yyval.number = EXEC_TOGETHER; } break;
case 48:
# line 263 "jamgram.y"
{ yyval.number = EXEC_IGNORE; } break;
case 49:
# line 265 "jamgram.y"
{ yyval.number = EXEC_QUIETLY; } break;
case 50:
# line 267 "jamgram.y"
{ yyval.number = EXEC_PIECEMEAL; } break;
case 51:
# line 269 "jamgram.y"
{ yyval.number = EXEC_EXISTING; } break;
case 52:
# line 278 "jamgram.y"
{ yyval.list = L0; } break;
case 53:
# line 280 "jamgram.y"
{ yyval.list = yypvt[-0].list; } break;
# line 531 "/usr/ccs/bin/yaccpar"
}
goto yystack; /* reset registers in driver code */
}