jamgram.c #11

  • //
  • guest/
  • matt_armstrong/
  • jam/
  • patched_version/
  • jamgram.c
  • View
  • Commits
  • Open Download .zip Download (32 KB)
# define _BANG_t 257
# define _BANG_EQUALS_t 258
# define _AMPER_t 259
# define _AMPERAMPER_t 260
# define _LPAREN_t 261
# define _RPAREN_t 262
# define _PLUS_EQUALS_t 263
# define _COLON_t 264
# define _SEMIC_t 265
# define _LANGLE_t 266
# define _LANGLE_EQUALS_t 267
# define _EQUALS_t 268
# define _RANGLE_t 269
# define _RANGLE_EQUALS_t 270
# define _QUESTION_EQUALS_t 271
# define _LBRACKET_t 272
# define _RBRACKET_t 273
# define ACTIONS_t 274
# define BIND_t 275
# define BREAK_t 276
# define CASE_t 277
# define CONTINUE_t 278
# define DEFAULT_t 279
# define ELSE_t 280
# define EXISTING_t 281
# define FOR_t 282
# define IF_t 283
# define IGNORE_t 284
# define IN_t 285
# define INCLUDE_t 286
# define LOCAL_t 287
# define MAXLINE_t 288
# define ON_t 289
# define PIECEMEAL_t 290
# define QUIETLY_t 291
# define RESPONSE_t 292
# define RETURN_t 293
# define RULE_t 294
# define SWITCH_t 295
# define TOGETHER_t 296
# define UPDATED_t 297
# define WHILE_t 298
# define _LBRACE_t 299
# define _BAR_t 300
# define _BARBAR_t 301
# define _RBRACE_t 302
# define ARG 303
# define STRING 304

# line 86 "jamgram.y"
#include "jam.h"

#include "lists.h"
#include "variable.h"
#include "parse.h"
#include "scan.h"
#include "compile.h"
#include "newstr.h"
#include "rules.h"

# define YYMAXDEPTH 10000	/* for OSF and other less endowed yaccs */

# define F0 (LIST *(*)(PARSE *, LOL *, int *))0
# define P0 (PARSE *)0
# define S0 (char *)0

# define pappend( l,r )    	parse_make( compile_append,l,r,P0,S0,S0,0 )
# define pbreak( l,f )     	parse_make( compile_break,l,P0,P0,S0,S0,f )
# define peval( c,l,r )		parse_make( compile_eval,l,r,P0,S0,S0,c )
# define pfor( s,l,r )    	parse_make( compile_foreach,l,r,P0,s,S0,0 )
# define pif( l,r,t )	  	parse_make( compile_if,l,r,t,S0,S0,0 )
# define pincl( l )       	parse_make( compile_include,l,P0,P0,S0,S0,0 )
# define plist( s )	  	parse_make( compile_list,P0,P0,P0,s,S0,0 )
# define plocal( l,r,t )  	parse_make( compile_local,l,r,t,S0,S0,0 )
# define pnull()	  	parse_make( compile_null,P0,P0,P0,S0,S0,0 )
# define pon( l,r )	  	parse_make( compile_on,l,r,P0,S0,S0,0 )
# define prule( a,p )     	parse_make( compile_rule,a,p,P0,S0,S0,0 )
# define prules( l,r )	  	parse_make( compile_rules,l,r,P0,S0,S0,0 )
# define pset( l,r,a ) 	  	parse_make( compile_set,l,r,P0,S0,S0,a )
# define pset1( l,r,t,a )	parse_make( compile_settings,l,r,t,S0,S0,a )
# define psetc( s,l,r )     	parse_make( compile_setcomp,l,r,P0,s,S0,0 )
# define psete( s,l,s1,f ) 	parse_make( compile_setexec,l,P0,P0,s,s1,f )
# define pswitch( l,r )   	parse_make( compile_switch,l,r,P0,S0,S0,0 )
# define pwhile( l,r )   	parse_make( compile_while,l,r,P0,S0,S0,0 )

# define pnode( l,r )    	parse_make( F0,l,r,P0,S0,S0,0 )
# define psnode( s,l )     	parse_make( F0,l,P0,P0,s,S0,0 )


#ifdef __STDC__
#include <stdlib.h>
#include <string.h>
#else
#include <malloc.h>
#include <memory.h>
#endif

/* #include <values.h> */

#ifdef __cplusplus

#ifndef yyerror
	void yyerror(const char *);
#endif

#ifndef yylex
#ifdef __EXTERN_C__
	extern "C" { int yylex(void); }
#else
	int yylex(void);
#endif
#endif
	int yyparse(void);

#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,
	};
# define YYNPROD 74
# define YYLAST 304
static const yytabelem yyact[]={

    19,    41,    17,   151,     8,    42,     9,    79,   130,    19,
    11,    13,    19,   121,     6,     4,    19,    16,    44,    37,
   153,    10,    15,    12,   148,   144,    14,     5,    19,   132,
    17,    18,     8,   138,     9,   131,   128,    51,    11,    13,
    18,   135,     6,    18,    19,    16,   127,    18,   117,    10,
    15,    12,    62,    74,    14,     5,    65,    70,    71,    18,
   115,    93,    61,   143,    66,    67,    64,    68,    69,    88,
   102,   120,    85,   122,    48,    18,    89,    49,    87,    86,
    90,    31,    57,   142,    84,    83,    30,   140,   125,    32,
    96,    81,    65,    70,    71,    60,    59,    33,    72,    73,
    66,    67,    64,    68,    69,    65,    70,    71,    58,    53,
    65,    70,    71,    66,    67,    64,    68,    69,    66,    67,
    64,    68,    69,    31,    52,   118,    56,    23,    30,    26,
   100,    32,    65,    77,    72,    73,    82,    78,     3,    33,
    66,    67,    64,    68,    69,    91,    63,    72,    73,    28,
    66,    67,    27,    68,    69,    40,     7,    47,    22,     7,
   101,     7,    24,     2,    29,   152,    20,   145,   119,    21,
    46,    25,    45,    34,    35,    36,    94,    38,    50,     1,
     0,     0,     0,     0,    80,     0,    98,     0,     0,     0,
     0,   103,    54,    55,     0,     0,     0,     0,     0,     0,
     0,     7,     0,    92,     7,   116,     0,     0,    97,     0,
     0,     0,     0,     0,    95,     0,     0,     0,     0,     7,
     0,    39,   123,     0,     0,     0,    99,     0,     0,     0,
     0,     0,   129,     7,     0,     0,    43,     0,     0,   114,
     0,     0,     0,     0,     0,   133,     0,     0,     0,   124,
     0,     0,     0,   139,     0,   141,   134,     0,     0,     0,
     0,     0,   126,    75,    76,     0,     0,   146,     0,     0,
   149,     0,     0,     7,     0,     0,     0,     0,     0,     0,
   137,     7,   150,     7,     0,   136,   104,   105,   106,   107,
   108,   109,   110,   111,   112,   113,     0,     0,     7,     7,
     0,     0,     0,   147 };
static const yytabelem yypact[]={

  -272,-10000000,-10000000,  -272,-10000000,  -272,-10000000,  -140,-10000000,-10000000,
-10000000,  -284,-10000000,  -256,  -256,  -285,  -263,-10000000,-10000000,-10000000,
-10000000,  -191,  -263,  -265,-10000000,  -141,  -156,-10000000,-10000000,  -138,
-10000000,-10000000,-10000000,  -186,  -157,  -169,  -170,  -223,  -247,  -153,
  -232,  -256,  -256,  -166,  -296,  -244,  -212,  -228,  -272,-10000000,
-10000000,-10000000,-10000000,-10000000,  -175,  -182,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,  -207,  -272,  -256,  -256,  -256,  -256,  -256,  -256,
  -256,  -256,  -256,  -256,-10000000,-10000000,  -202,  -272,  -251,  -139,
-10000000,  -204,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -290,
-10000000,  -200,-10000000,  -263,-10000000,  -177,-10000000,-10000000,-10000000,  -253,
  -266,  -207,  -295,  -267,  -116,  -116,-10000000,-10000000,-10000000,-10000000,
  -126,  -126,  -148,  -148,-10000000,-10000000,  -273,  -272,  -296,  -258,
-10000000,-10000000,-10000000,-10000000,  -260,  -272,  -178,  -272,-10000000,-10000000,
  -181,  -217,-10000000,  -277,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,  -278,  -272,  -244,-10000000,  -301,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,  -282,-10000000 };
static const yytabelem yypgo[]={

     0,   179,   162,   127,   138,   164,   155,   129,   152,   130,
   221,   137,   170,   168,   167,   165,   160,   158,   157,   145,
   136 };
static const yytabelem yyr1[]={

     0,     1,     1,     3,     3,     2,     2,     2,     2,     4,
     4,     4,     4,     4,     4,     4,     4,     4,     4,     4,
     4,     4,     4,     4,    14,    15,     4,     8,     8,     8,
     8,    10,    10,    10,    10,    10,    10,    10,    10,    10,
    10,    10,    10,    10,    10,     9,     9,    16,    11,    11,
    11,     7,     7,     5,    17,    17,     6,    18,     6,    19,
    19,    19,    12,    12,    20,    20,    20,    20,    20,    20,
    20,    20,    13,    13 };
static const yytabelem yyr2[]={

     0,     0,     3,     1,     3,     3,     5,     9,    13,     7,
     7,     7,     9,    13,     7,     7,     7,    15,    11,    11,
    15,    11,    13,     7,     1,     1,    19,     3,     3,     3,
     5,     3,     7,     7,     7,     7,     7,     7,     7,     7,
     7,     7,     7,     5,     7,     1,     5,     9,     1,     7,
     3,     3,     7,     3,     1,     5,     3,     1,     9,     5,
     9,     9,     1,     5,     3,     3,     3,     3,     3,     3,
     5,     3,     1,     5 };
static const yytabelem yychk[]={

-10000000,    -1,    -2,    -4,   287,   299,   286,    -6,   276,   278,
   293,   282,   295,   283,   298,   294,   289,   274,   303,   272,
    -2,    -5,   -17,    -3,    -2,    -5,    -7,    -8,   289,    -5,
   268,   263,   271,   279,    -5,    -5,    -5,   303,    -5,   -10,
    -6,   257,   261,   -10,   303,    -6,   -12,   -18,   265,   268,
    -6,   302,   265,   265,    -5,    -5,   264,   268,   265,   265,
   265,   285,   299,   299,   268,   258,   266,   267,   269,   270,
   259,   260,   300,   301,   285,   -10,   -10,   299,   -11,   303,
    -4,   303,   -20,   297,   296,   284,   291,   290,   281,   288,
   292,   -19,    -6,   289,    -3,    -5,   265,    -8,    -7,    -5,
    -9,   -16,   277,    -3,   -10,   -10,   -10,   -10,   -10,   -10,
   -10,   -10,   -10,   -10,    -5,   262,    -3,   299,   264,   -13,
   275,   303,   273,    -7,    -6,   265,    -5,   299,   302,    -9,
   303,   302,   302,    -3,   -11,   299,    -5,    -6,   293,    -3,
   265,    -3,   264,   280,   302,   -14,    -7,    -5,   302,    -3,
    -4,   304,   -15,   302 };
static const yytabelem yydef[]={

     1,    -2,     2,     5,    54,     3,    54,    54,    54,    54,
    54,     0,    54,     0,     0,     0,     0,    62,    56,    57,
     6,     0,    53,     0,     4,     0,     0,    54,    54,    51,
    27,    28,    29,     0,     0,     0,     0,     0,     0,     0,
    31,     0,     0,     0,    48,     0,     0,     0,     3,    54,
    55,     9,    10,    11,     0,     0,    54,    30,    14,    15,
    16,    54,    45,     3,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,    54,    43,     0,     3,     0,    50,
    23,    72,    63,    64,    65,    66,    67,    68,    69,     0,
    71,     0,    54,     0,     7,     0,    12,    54,    52,     0,
     0,    45,     0,     0,    32,    33,    34,    35,    36,    37,
    38,    39,    40,    41,    42,    44,     0,     3,    48,     0,
    54,    70,    58,    59,     0,     3,     0,     3,    18,    46,
     0,    19,    21,     0,    49,    24,    73,    54,    54,     8,
    13,     0,     3,     0,    22,     0,    60,    61,    17,    47,
    20,    25,     0,    26 };
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_t",	257,
	"_BANG_EQUALS_t",	258,
	"_AMPER_t",	259,
	"_AMPERAMPER_t",	260,
	"_LPAREN_t",	261,
	"_RPAREN_t",	262,
	"_PLUS_EQUALS_t",	263,
	"_COLON_t",	264,
	"_SEMIC_t",	265,
	"_LANGLE_t",	266,
	"_LANGLE_EQUALS_t",	267,
	"_EQUALS_t",	268,
	"_RANGLE_t",	269,
	"_RANGLE_EQUALS_t",	270,
	"_QUESTION_EQUALS_t",	271,
	"_LBRACKET_t",	272,
	"_RBRACKET_t",	273,
	"ACTIONS_t",	274,
	"BIND_t",	275,
	"BREAK_t",	276,
	"CASE_t",	277,
	"CONTINUE_t",	278,
	"DEFAULT_t",	279,
	"ELSE_t",	280,
	"EXISTING_t",	281,
	"FOR_t",	282,
	"IF_t",	283,
	"IGNORE_t",	284,
	"IN_t",	285,
	"INCLUDE_t",	286,
	"LOCAL_t",	287,
	"MAXLINE_t",	288,
	"ON_t",	289,
	"PIECEMEAL_t",	290,
	"QUIETLY_t",	291,
	"RESPONSE_t",	292,
	"RETURN_t",	293,
	"RULE_t",	294,
	"SWITCH_t",	295,
	"TOGETHER_t",	296,
	"UPDATED_t",	297,
	"WHILE_t",	298,
	"_LBRACE_t",	299,
	"_BAR_t",	300,
	"_BARBAR_t",	301,
	"_RBRACE_t",	302,
	"ARG",	303,
	"STRING",	304,
	"-unknown-",	-1	/* ends search */
};

char * yyreds[] =
{
	"-no such reduction-",
	"run : /* empty */",
	"run : rules",
	"block : /* empty */",
	"block : rules",
	"rules : rule",
	"rules : rule rules",
	"rules : LOCAL_t list _SEMIC_t block",
	"rules : LOCAL_t list _EQUALS_t list _SEMIC_t block",
	"rule : _LBRACE_t block _RBRACE_t",
	"rule : INCLUDE_t list _SEMIC_t",
	"rule : arg lol _SEMIC_t",
	"rule : arg assign list _SEMIC_t",
	"rule : arg ON_t list assign list _SEMIC_t",
	"rule : BREAK_t list _SEMIC_t",
	"rule : CONTINUE_t list _SEMIC_t",
	"rule : RETURN_t list _SEMIC_t",
	"rule : FOR_t ARG IN_t list _LBRACE_t block _RBRACE_t",
	"rule : SWITCH_t list _LBRACE_t cases _RBRACE_t",
	"rule : IF_t expr _LBRACE_t block _RBRACE_t",
	"rule : IF_t expr _LBRACE_t block _RBRACE_t ELSE_t rule",
	"rule : WHILE_t expr _LBRACE_t block _RBRACE_t",
	"rule : RULE_t ARG params _LBRACE_t block _RBRACE_t",
	"rule : ON_t arg rule",
	"rule : ACTIONS_t eflags ARG bindlist _LBRACE_t",
	"rule : ACTIONS_t eflags ARG bindlist _LBRACE_t STRING",
	"rule : ACTIONS_t eflags ARG bindlist _LBRACE_t STRING _RBRACE_t",
	"assign : _EQUALS_t",
	"assign : _PLUS_EQUALS_t",
	"assign : _QUESTION_EQUALS_t",
	"assign : DEFAULT_t _EQUALS_t",
	"expr : arg",
	"expr : expr _EQUALS_t expr",
	"expr : expr _BANG_EQUALS_t expr",
	"expr : expr _LANGLE_t expr",
	"expr : expr _LANGLE_EQUALS_t expr",
	"expr : expr _RANGLE_t expr",
	"expr : expr _RANGLE_EQUALS_t expr",
	"expr : expr _AMPER_t expr",
	"expr : expr _AMPERAMPER_t expr",
	"expr : expr _BAR_t expr",
	"expr : expr _BARBAR_t expr",
	"expr : arg IN_t list",
	"expr : _BANG_t expr",
	"expr : _LPAREN_t expr _RPAREN_t",
	"cases : /* empty */",
	"cases : case cases",
	"case : CASE_t ARG _COLON_t block",
	"params : /* empty */",
	"params : ARG _COLON_t params",
	"params : ARG",
	"lol : list",
	"lol : list _COLON_t lol",
	"list : listp",
	"listp : /* empty */",
	"listp : listp arg",
	"arg : ARG",
	"arg : _LBRACKET_t",
	"arg : _LBRACKET_t func _RBRACKET_t",
	"func : arg lol",
	"func : ON_t arg arg lol",
	"func : ON_t arg RETURN_t list",
	"eflags : /* empty */",
	"eflags : eflags eflag",
	"eflag : UPDATED_t",
	"eflag : TOGETHER_t",
	"eflag : IGNORE_t",
	"eflag : QUIETLY_t",
	"eflag : PIECEMEAL_t",
	"eflag : EXISTING_t",
	"eflag : MAXLINE_t ARG",
	"eflag : RESPONSE_t",
	"bindlist : /* empty */",
	"bindlist : BIND_t list",
};
#endif /* YYDEBUG */
# line	1 "/usr/ccs/bin/yaccpar"
/*
 * Copyright (c) 1993 by Sun Microsystems, Inc.
 */

#pragma ident	"@(#)yaccpar	6.14	97/01/16 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
			*/
			int yyps_index = (yy_ps - yys);
			int yypv_index = (yy_pv - yyv);
			int 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 2:
# line 131 "jamgram.y"
{ parse_save( yypvt[-0].parse ); } break;
case 3:
# line 142 "jamgram.y"
{ yyval.parse = pnull(); } break;
case 4:
# line 144 "jamgram.y"
{ yyval.parse = yypvt[-0].parse; } break;
case 5:
# line 148 "jamgram.y"
{ yyval.parse = yypvt[-0].parse; } break;
case 6:
# line 150 "jamgram.y"
{ yyval.parse = prules( yypvt[-1].parse, yypvt[-0].parse ); } break;
case 7:
# line 152 "jamgram.y"
{ yyval.parse = plocal( yypvt[-2].parse, pnull(), yypvt[-0].parse ); } break;
case 8:
# line 154 "jamgram.y"
{ yyval.parse = plocal( yypvt[-4].parse, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 9:
# line 158 "jamgram.y"
{ yyval.parse = yypvt[-1].parse; } break;
case 10:
# line 160 "jamgram.y"
{ yyval.parse = pincl( yypvt[-1].parse ); } break;
case 11:
# line 162 "jamgram.y"
{ yyval.parse = prule( yypvt[-2].parse, yypvt[-1].parse ); } break;
case 12:
# line 164 "jamgram.y"
{ yyval.parse = pset( yypvt[-3].parse, yypvt[-1].parse, yypvt[-2].number ); } break;
case 13:
# line 166 "jamgram.y"
{ yyval.parse = pset1( yypvt[-5].parse, yypvt[-3].parse, yypvt[-1].parse, yypvt[-2].number ); } break;
case 14:
# line 168 "jamgram.y"
{ yyval.parse = pbreak( yypvt[-1].parse, JMP_BREAK ); } break;
case 15:
# line 170 "jamgram.y"
{ yyval.parse = pbreak( yypvt[-1].parse, JMP_CONTINUE ); } break;
case 16:
# line 172 "jamgram.y"
{ yyval.parse = pbreak( yypvt[-1].parse, JMP_RETURN ); } break;
case 17:
# line 174 "jamgram.y"
{ yyval.parse = pfor( yypvt[-5].string, yypvt[-3].parse, yypvt[-1].parse ); } break;
case 18:
# line 176 "jamgram.y"
{ yyval.parse = pswitch( yypvt[-3].parse, yypvt[-1].parse ); } break;
case 19:
# line 178 "jamgram.y"
{ yyval.parse = pif( yypvt[-3].parse, yypvt[-1].parse, pnull() ); } break;
case 20:
# line 180 "jamgram.y"
{ yyval.parse = pif( yypvt[-5].parse, yypvt[-3].parse, yypvt[-0].parse ); } break;
case 21:
# line 182 "jamgram.y"
{ yyval.parse = pwhile( yypvt[-3].parse, yypvt[-1].parse ); } break;
case 22:
# line 184 "jamgram.y"
{ yyval.parse = psetc( yypvt[-4].string, yypvt[-3].parse, yypvt[-1].parse ); } break;
case 23:
# line 186 "jamgram.y"
{ yyval.parse = pon( yypvt[-1].parse, yypvt[-0].parse ); } break;
case 24:
# line 188 "jamgram.y"
{ yymode( SCAN_STRING ); } break;
case 25:
# line 190 "jamgram.y"
{ yymode( SCAN_NORMAL ); } break;
case 26:
# line 192 "jamgram.y"
{ yyval.parse = psete( yypvt[-6].string,yypvt[-5].parse,yypvt[-2].string,yypvt[-7].number ); } break;
case 27:
# line 200 "jamgram.y"
{ yyval.number = VAR_SET; } break;
case 28:
# line 202 "jamgram.y"
{ yyval.number = VAR_APPEND; } break;
case 29:
# line 204 "jamgram.y"
{ yyval.number = VAR_DEFAULT; } break;
case 30:
# line 206 "jamgram.y"
{ yyval.number = VAR_DEFAULT; } break;
case 31:
# line 214 "jamgram.y"
{ yyval.parse = peval( EXPR_EXISTS, yypvt[-0].parse, pnull() ); } break;
case 32:
# line 216 "jamgram.y"
{ yyval.parse = peval( EXPR_EQUALS, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 33:
# line 218 "jamgram.y"
{ yyval.parse = peval( EXPR_NOTEQ, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 34:
# line 220 "jamgram.y"
{ yyval.parse = peval( EXPR_LESS, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 35:
# line 222 "jamgram.y"
{ yyval.parse = peval( EXPR_LESSEQ, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 36:
# line 224 "jamgram.y"
{ yyval.parse = peval( EXPR_MORE, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 37:
# line 226 "jamgram.y"
{ yyval.parse = peval( EXPR_MOREEQ, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 38:
# line 228 "jamgram.y"
{ yyval.parse = peval( EXPR_AND, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 39:
# line 230 "jamgram.y"
{ yyval.parse = peval( EXPR_AND, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 40:
# line 232 "jamgram.y"
{ yyval.parse = peval( EXPR_OR, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 41:
# line 234 "jamgram.y"
{ yyval.parse = peval( EXPR_OR, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 42:
# line 236 "jamgram.y"
{ yyval.parse = peval( EXPR_IN, yypvt[-2].parse, yypvt[-0].parse ); } break;
case 43:
# line 238 "jamgram.y"
{ yyval.parse = peval( EXPR_NOT, yypvt[-0].parse, pnull() ); } break;
case 44:
# line 240 "jamgram.y"
{ yyval.parse = yypvt[-1].parse; } break;
case 45:
# line 250 "jamgram.y"
{ yyval.parse = P0; } break;
case 46:
# line 252 "jamgram.y"
{ yyval.parse = pnode( yypvt[-1].parse, yypvt[-0].parse ); } break;
case 47:
# line 256 "jamgram.y"
{ yyval.parse = psnode( yypvt[-2].string, yypvt[-0].parse ); } break;
case 48:
# line 265 "jamgram.y"
{ yyval.parse = P0; } break;
case 49:
# line 267 "jamgram.y"
{ yyval.parse = psnode( yypvt[-2].string, yypvt[-0].parse ); } break;
case 50:
# line 269 "jamgram.y"
{ yyval.parse = psnode( yypvt[-0].string, P0 ); } break;
case 51:
# line 278 "jamgram.y"
{ yyval.parse = pnode( P0, yypvt[-0].parse ); } break;
case 52:
# line 280 "jamgram.y"
{ yyval.parse = pnode( yypvt[-0].parse, yypvt[-2].parse ); } break;
case 53:
# line 290 "jamgram.y"
{ yyval.parse = yypvt[-0].parse; yymode( SCAN_NORMAL ); } break;
case 54:
# line 294 "jamgram.y"
{ yyval.parse = pnull(); yymode( SCAN_PUNCT ); } break;
case 55:
# line 296 "jamgram.y"
{ yyval.parse = pappend( yypvt[-1].parse, yypvt[-0].parse ); } break;
case 56:
# line 300 "jamgram.y"
{ yyval.parse = plist( yypvt[-0].string ); } break;
case 57:
# line 301 "jamgram.y"
{ yymode( SCAN_NORMAL ); } break;
case 58:
# line 302 "jamgram.y"
{ yyval.parse = yypvt[-1].parse; } break;
case 59:
# line 311 "jamgram.y"
{ yyval.parse = prule( yypvt[-1].parse, yypvt[-0].parse ); } break;
case 60:
# line 313 "jamgram.y"
{ yyval.parse = pon( yypvt[-2].parse, prule( yypvt[-1].parse, yypvt[-0].parse ) ); } break;
case 61:
# line 315 "jamgram.y"
{ yyval.parse = pon( yypvt[-2].parse, yypvt[-0].parse ); } break;
case 62:
# line 324 "jamgram.y"
{ yyval.number = 0; } break;
case 63:
# line 326 "jamgram.y"
{ yyval.number = yypvt[-1].number | yypvt[-0].number; } break;
case 64:
# line 330 "jamgram.y"
{ yyval.number = RULE_UPDATED; } break;
case 65:
# line 332 "jamgram.y"
{ yyval.number = RULE_TOGETHER; } break;
case 66:
# line 334 "jamgram.y"
{ yyval.number = RULE_IGNORE; } break;
case 67:
# line 336 "jamgram.y"
{ yyval.number = RULE_QUIETLY; } break;
case 68:
# line 338 "jamgram.y"
{ yyval.number = RULE_PIECEMEAL; } break;
case 69:
# line 340 "jamgram.y"
{ yyval.number = RULE_EXISTING; } break;
case 70:
# line 342 "jamgram.y"
{ yyval.number = atoi( yypvt[-0].string ) * RULE_MAXLINE; } break;
case 71:
# line 344 "jamgram.y"
{ yyval.number = RULE_RESPONSE; } break;
case 72:
# line 353 "jamgram.y"
{ yyval.parse = pnull(); } break;
case 73:
# line 355 "jamgram.y"
{ yyval.parse = yypvt[-0].parse; } break;
# line	531 "/usr/ccs/bin/yaccpar"
	}
	goto yystack;		/* reset registers in driver code */
}

# Change User Description Committed
#14 4004 Matt Armstrong Back out changes 3969, 3971, 3972 -- they didn't really fix
anything.
#13 3972 Matt Armstrong bootstrap integrations from //guest/matt_armstrong/jam/fix/2/...
(no code change)
#12 3969 Matt Armstrong Integrate from //guest/matt_armstrong/jam/fix/2/...@3963 -- no
real changes.
#11 3955 Matt Armstrong type -> text+w
#10 3950 Matt Armstrong Integrate from //guest/matt_armstrong/jam/fix/1/...
thru change
3948 and make no changes.
#9 3583 Matt Armstrong Don't include sys/values.h for windows' benefit.
#8 3576 Matt Armstrong submit the jamgram that contains "response" syntax for actions
#7 3311 Matt Armstrong Update from mainline.
#6 2817 Matt Armstrong Update with current known working version.
#5 2816 Matt Armstrong Integrate from mainline.
 This does not compile.
#4 2507 Matt Armstrong update from the mainline
#3 2089 Matt Armstrong More integrations from upstream.
#2 2087 Matt Armstrong I think most of this is updates from stock jam.
#1 1270 Matt Armstrong In prep for publishing all my patches to jam.
//guest/perforce_software/jam/src/jamgram.c
#3 486 Perforce staff Jam 2.3.
 See RELNOTES for a list of changes from 2.2.x.

Just about every source file was touched when jam got ANSI-fied.
#2 3 Perforce maintenance Jam/MR 2.2.1 (fix for NT handle leak)
#1 2 laura Add Jam/MR 2.2 source