/*
 * This file was generated by the mkinit program.
 */

#include "shell.h"
#include "mystring.h"
#include "init.h"
#include "eval.h"
#include "input.h"
#include "error.h"
#include <sys/types.h>
#include <stdlib.h>
#include "options.h"
#include "output.h"
#include "memalloc.h"
#include "redir.h"
#include <signal.h>
#include "trap.h"
#include "var.h"



#undef  ATABSIZE
#define ATABSIZE 39
#undef  EV_EXIT
#define EV_EXIT 01		/* exit after evaluating tree */
#undef  EV_TESTED
#define EV_TESTED 02		/* exit status is checked; ignore -e flag */
#undef  EV_BACKCMD
#define EV_BACKCMD 04		/* command executing within back quotes */
#undef  CMDTABLESIZE
#define CMDTABLESIZE 31		/* should be prime */
#undef  ARB
#define ARB 1			/* actual size determined at run time */
#undef  MAXHISTLOOPS
#define MAXHISTLOOPS	4	/* max recursions through fc */
#undef  DEFEDITOR
#define DEFEDITOR	"ed"	/* default editor *should* be $EDITOR */
#undef  editing
#define editing (Eflag || Vflag)
#undef  ATABSIZE
#define ATABSIZE 39
#undef  EV_EXIT
#define EV_EXIT 01		/* exit after evaluating tree */
#undef  EV_TESTED
#define EV_TESTED 02		/* exit status is checked; ignore -e flag */
#undef  EV_BACKCMD
#define EV_BACKCMD 04		/* command executing within back quotes */
#undef  CMDTABLESIZE
#define CMDTABLESIZE 31		/* should be prime */
#undef  ARB
#define ARB 1			/* actual size determined at run time */
#undef  MAXHISTLOOPS
#define MAXHISTLOOPS	4	/* max recursions through fc */
#undef  DEFEDITOR
#define DEFEDITOR	"ed"	/* default editor *should* be $EDITOR */
#undef  editing
#define editing (Eflag || Vflag)
#undef  ATABSIZE
#define ATABSIZE 39
#undef  EV_EXIT
#define EV_EXIT 01		/* exit after evaluating tree */
#undef  EV_TESTED
#define EV_TESTED 02		/* exit status is checked; ignore -e flag */
#undef  EV_BACKCMD
#define EV_BACKCMD 04		/* command executing within back quotes */
#undef  CMDTABLESIZE
#define CMDTABLESIZE 31		/* should be prime */
#undef  ARB
#define ARB 1			/* actual size determined at run time */
#undef  MAXHISTLOOPS
#define MAXHISTLOOPS	4	/* max recursions through fc */
#undef  DEFEDITOR
#define DEFEDITOR	"ed"	/* default editor *should* be $EDITOR */
#undef  editing
#define editing (Eflag || Vflag)
#undef  EOF_NLEFT
#define EOF_NLEFT -99		/* value of parsenleft when EOF pushed back */
#undef  MAXCMDTEXT
#define MAXCMDTEXT	200
#undef   YY_INT_ALIGNED
#define  YY_INT_ALIGNED short int
#undef  FLEX_SCANNER
#define FLEX_SCANNER
#undef  YY_FLEX_MAJOR_VERSION
#define YY_FLEX_MAJOR_VERSION 2
#undef  YY_FLEX_MINOR_VERSION
#define YY_FLEX_MINOR_VERSION 5
#undef  YY_FLEX_SUBMINOR_VERSION
#define YY_FLEX_SUBMINOR_VERSION 35
#undef  FLEX_BETA
#define FLEX_BETA
#undef  FLEXINT_H
#define FLEXINT_H
#undef  __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
#undef  INT8_MIN
#define INT8_MIN               (-128)
#undef  INT16_MIN
#define INT16_MIN              (-32767-1)
#undef  INT32_MIN
#define INT32_MIN              (-2147483647-1)
#undef  INT8_MAX
#define INT8_MAX               (127)
#undef  INT16_MAX
#define INT16_MAX              (32767)
#undef  INT32_MAX
#define INT32_MAX              (2147483647)
#undef  UINT8_MAX
#define UINT8_MAX              (255U)
#undef  UINT16_MAX
#define UINT16_MAX             (65535U)
#undef  UINT32_MAX
#define UINT32_MAX             (4294967295U)
#undef  YY_USE_CONST
#define YY_USE_CONST
#undef  YY_USE_CONST
#define YY_USE_CONST
#undef  yyconst
#define yyconst const
#undef  yyconst
#define yyconst
#undef  YY_NULL
#define YY_NULL 0
#undef  BEGIN
#define BEGIN (yy_start) = 1 + 2 *
#undef  YY_START
#define YY_START (((yy_start) - 1) / 2)
#undef  YYSTATE
#define YYSTATE YY_START
#undef  YY_NEW_FILE
#define YY_NEW_FILE yyrestart(yyin  )
#undef  YY_END_OF_BUFFER_CHAR
#define YY_END_OF_BUFFER_CHAR 0
#undef  YY_BUF_SIZE
#define YY_BUF_SIZE 16384
#undef  YY_STATE_BUF_SIZE
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
#undef  YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
#undef  EOB_ACT_CONTINUE_SCAN
#define EOB_ACT_CONTINUE_SCAN 0
#undef  EOB_ACT_END_OF_FILE
#define EOB_ACT_END_OF_FILE 1
#undef  EOB_ACT_LAST_MATCH
#define EOB_ACT_LAST_MATCH 2
#undef  YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
#undef  YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
#undef  YY_BUFFER_NEW
#define YY_BUFFER_NEW 0
#undef  YY_BUFFER_NORMAL
#define YY_BUFFER_NORMAL 1
#undef  YY_BUFFER_EOF_PENDING
#define YY_BUFFER_EOF_PENDING 2
#undef  YY_CURRENT_BUFFER_LVALUE
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
#undef  YY_FLUSH_BUFFER
#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
#undef  yy_new_buffer
#define yy_new_buffer yy_create_buffer
#undef  FLEX_DEBUG
#define FLEX_DEBUG
#undef  yytext_ptr
#define yytext_ptr yytext
#undef  YY_NUM_RULES
#define YY_NUM_RULES 40
#undef  YY_END_OF_BUFFER
#define YY_END_OF_BUFFER 41
#undef  REJECT
#define REJECT reject_used_but_not_detected
#undef  YY_MORE_ADJ
#define YY_MORE_ADJ 0
#undef  YY_RESTORE_YY_MORE_OFFSET
#define YY_RESTORE_YY_MORE_OFFSET
#undef  YY_NO_UNPUT
#define YY_NO_UNPUT
#undef  INITIAL
#define INITIAL 0
#undef  YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#undef  YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#undef  ECHO
#define ECHO fwrite( yytext, yyleng, 1, yyout )
#undef  YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#undef  YY_DECL_IS_OURS
#define YY_DECL_IS_OURS 1
#undef  YY_DECL
#define YY_DECL int yylex (void)
#undef  YY_USER_ACTION
#define YY_USER_ACTION
#undef  YY_BREAK
#define YY_BREAK break;
#undef  YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#undef  YYTABLES_NAME
#define YYTABLES_NAME "yytables"
#undef  MAXMBOXES
#define MAXMBOXES 10
#undef  MINSIZE
#define MINSIZE 496		/* minimum size of a block. */
#undef  __unused
#define __unused 
#undef  OUTFILE
#define OUTFILE "init.c"
#undef  OUTTEMP
#define OUTTEMP "init.c.new"
#undef  BLOCKSIZE
#define BLOCKSIZE 512
#undef  __printf0like
#define __printf0like __printflike
#undef  __unused
#define __unused
#undef  MAXTYPES
#define MAXTYPES 50		/* max number of node types */
#undef  MAXFIELDS
#define MAXFIELDS 20		/* max fields in a structure */
#undef  BUFLEN
#define BUFLEN 100		/* size of character buffers */
#undef  T_NODE
#define T_NODE 1		/* union node *field */
#undef  T_NODELIST
#define T_NODELIST 2		/* struct nodelist *field */
#undef  T_STRING
#define T_STRING 3
#undef  T_INT
#define T_INT 4			/* int field */
#undef  T_OTHER
#define T_OTHER 5		/* other */
#undef  T_TEMP
#define T_TEMP 6		/* don't copy this field */
#undef  __unused
#define __unused
#undef  DEFINE_OPTIONS
#define DEFINE_OPTIONS
#undef  OUTBUFSIZ
#define OUTBUFSIZ BUFSIZ
#undef  BLOCK_OUT
#define BLOCK_OUT -2		/* output to a fixed block of memory */
#undef  MEM_OUT
#define MEM_OUT -3		/* output to dynamically allocated memory */
#undef  OUTPUT_ERR
#define OUTPUT_ERR 01		/* error occurred on output */
#undef 	EOFMARKLEN
#define	EOFMARKLEN	79
#undef 	PROMPTLEN
#define	PROMPTLEN	128
#undef  EMPTY
#define EMPTY -2		/* marks an unused slot in redirtab */
#undef  PIPESIZE
#define PIPESIZE 4096		/* amount of buffering in a pipe */
#undef  S_DFL
#define S_DFL 1			/* default signal handling (SIG_DFL) */
#undef  S_CATCH
#define S_CATCH 2		/* signal is caught */
#undef  S_IGN
#define S_IGN 3			/* signal is ignored (SIG_IGN) */
#undef  S_HARD_IGN
#define S_HARD_IGN 4		/* signal is ignored permanently */
#undef  S_RESET
#define S_RESET 5		/* temporary - to reset a hard ignored sig */
#undef  sys_signame
#define sys_signame sys_siglist
#undef  VTABSIZE
#define VTABSIZE 39
#undef  YYBISON
#define YYBISON 1
#undef  YYBISON_VERSION
#define YYBISON_VERSION "2.4.1"
#undef  YYSKELETON_NAME
#define YYSKELETON_NAME "yacc.c"
#undef  YYPURE
#define YYPURE 0
#undef  YYPUSH
#define YYPUSH 0
#undef  YYPULL
#define YYPULL 1
#undef  YYLSP_NEEDED
#define YYLSP_NEEDED 0
#undef  ARITH_NUM
#define ARITH_NUM 258
#undef  ARITH_LPAREN
#define ARITH_LPAREN 259
#undef  ARITH_RPAREN
#define ARITH_RPAREN 260
#undef  ARITH_VAR
#define ARITH_VAR 261
#undef  ARITH_ASSIGN
#define ARITH_ASSIGN 262
#undef  ARITH_SUBASSIGN
#define ARITH_SUBASSIGN 263
#undef  ARITH_ADDASSIGN
#define ARITH_ADDASSIGN 264
#undef  ARITH_REMASSIGN
#define ARITH_REMASSIGN 265
#undef  ARITH_DIVASSIGN
#define ARITH_DIVASSIGN 266
#undef  ARITH_MULASSIGN
#define ARITH_MULASSIGN 267
#undef  ARITH_LSHASSIGN
#define ARITH_LSHASSIGN 268
#undef  ARITH_RSHASSIGN
#define ARITH_RSHASSIGN 269
#undef  ARITH_BORASSIGN
#define ARITH_BORASSIGN 270
#undef  ARITH_BXORASSIGN
#define ARITH_BXORASSIGN 271
#undef  ARITH_BANDASSIGN
#define ARITH_BANDASSIGN 272
#undef  ARITH_OR
#define ARITH_OR 273
#undef  ARITH_AND
#define ARITH_AND 274
#undef  ARITH_BOR
#define ARITH_BOR 275
#undef  ARITH_BXOR
#define ARITH_BXOR 276
#undef  ARITH_BAND
#define ARITH_BAND 277
#undef  ARITH_NE
#define ARITH_NE 278
#undef  ARITH_EQ
#define ARITH_EQ 279
#undef  ARITH_LE
#define ARITH_LE 280
#undef  ARITH_GE
#define ARITH_GE 281
#undef  ARITH_GT
#define ARITH_GT 282
#undef  ARITH_LT
#define ARITH_LT 283
#undef  ARITH_RSHIFT
#define ARITH_RSHIFT 284
#undef  ARITH_LSHIFT
#define ARITH_LSHIFT 285
#undef  ARITH_SUB
#define ARITH_SUB 286
#undef  ARITH_ADD
#define ARITH_ADD 287
#undef  ARITH_REM
#define ARITH_REM 288
#undef  ARITH_DIV
#define ARITH_DIV 289
#undef  ARITH_MUL
#define ARITH_MUL 290
#undef  ARITH_BNOT
#define ARITH_BNOT 291
#undef  ARITH_NOT
#define ARITH_NOT 292
#undef  ARITH_UNARYPLUS
#define ARITH_UNARYPLUS 293
#undef  ARITH_UNARYMINUS
#define ARITH_UNARYMINUS 294
#undef  YYSIZE_MAXIMUM
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#undef  YYFINAL
#define YYFINAL  26
#undef  YYLAST
#define YYLAST   201
#undef  YYNTOKENS
#define YYNTOKENS  40
#undef  YYNNTS
#define YYNNTS  3
#undef  YYNRULES
#define YYNRULES  38
#undef  YYNSTATES
#define YYNSTATES  75
#undef  YYUNDEFTOK
#define YYUNDEFTOK  2
#undef  YYMAXUTOK
#define YYMAXUTOK   294
#undef  YYPACT_NINF
#define YYPACT_NINF -28
#undef  YYTABLE_NINF
#define YYTABLE_NINF -1
#undef  yyerrok
#define yyerrok		(yyerrstatus = 0)
#undef  yyclearin
#define yyclearin	(yychar = YYEMPTY)
#undef  YYEMPTY
#define YYEMPTY		(-2)
#undef  YYEOF
#define YYEOF		0
#undef  YYACCEPT
#define YYACCEPT	goto yyacceptlab
#undef  YYABORT
#define YYABORT		goto yyabortlab
#undef  YYERROR
#define YYERROR		goto yyerrorlab
#undef  YYFAIL
#define YYFAIL		goto yyerrlab
#undef  YYTERROR
#define YYTERROR	1
#undef  YYERRCODE
#define YYERRCODE	256
#undef  YYPARSE_PARAM_TYPE
#define YYPARSE_PARAM_TYPE arith_t *
#undef  YYPARSE_PARAM
#define YYPARSE_PARAM result
#undef  EOF_NLEFT
#define EOF_NLEFT -99		/* value of parsenleft when EOF pushed back */
#undef  MAXCMDTEXT
#define MAXCMDTEXT	200
#undef  __unused
#define __unused
#undef  FLEX_SCANNER
#define FLEX_SCANNER
#undef  YY_FLEX_MAJOR_VERSION
#define YY_FLEX_MAJOR_VERSION 2
#undef  YY_FLEX_MINOR_VERSION
#define YY_FLEX_MINOR_VERSION 5
#undef  __cplusplus
#define __cplusplus
#undef  YY_USE_PROTOS
#define YY_USE_PROTOS
#undef  YY_USE_CONST
#define YY_USE_CONST
#undef  YY_USE_PROTOS
#define YY_USE_PROTOS
#undef  YY_USE_CONST
#define YY_USE_CONST
#undef  YY_USE_CONST
#define YY_USE_CONST
#undef  YY_USE_PROTOS
#define YY_USE_PROTOS
#undef  yyconst
#define yyconst const
#undef  yyconst
#define yyconst
#undef  YY_NULL
#define YY_NULL 0
#undef  BEGIN
#define BEGIN yy_start = 1 + 2 *
#undef  YY_START
#define YY_START ((yy_start - 1) / 2)
#undef  YYSTATE
#define YYSTATE YY_START
#undef  YY_NEW_FILE
#define YY_NEW_FILE yyrestart( yyin )
#undef  YY_END_OF_BUFFER_CHAR
#define YY_END_OF_BUFFER_CHAR 0
#undef  YY_BUF_SIZE
#define YY_BUF_SIZE 16384
#undef  EOB_ACT_CONTINUE_SCAN
#define EOB_ACT_CONTINUE_SCAN 0
#undef  EOB_ACT_END_OF_FILE
#define EOB_ACT_END_OF_FILE 1
#undef  EOB_ACT_LAST_MATCH
#define EOB_ACT_LAST_MATCH 2
#undef  YY_BUFFER_NEW
#define YY_BUFFER_NEW 0
#undef  YY_BUFFER_NORMAL
#define YY_BUFFER_NORMAL 1
#undef  YY_BUFFER_EOF_PENDING
#define YY_BUFFER_EOF_PENDING 2
#undef  YY_CURRENT_BUFFER
#define YY_CURRENT_BUFFER yy_current_buffer
#undef  YY_FLUSH_BUFFER
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
#undef  yy_new_buffer
#define yy_new_buffer yy_create_buffer
#undef  yytext_ptr
#define yytext_ptr yytext
#undef  YY_NUM_RULES
#define YY_NUM_RULES 40
#undef  YY_END_OF_BUFFER
#define YY_END_OF_BUFFER 41
#undef  REJECT
#define REJECT reject_used_but_not_detected
#undef  YY_MORE_ADJ
#define YY_MORE_ADJ 0
#undef  YY_RESTORE_YY_MORE_OFFSET
#define YY_RESTORE_YY_MORE_OFFSET
#undef  INITIAL
#define INITIAL 0
#undef  YY_NO_UNPUT
#define YY_NO_UNPUT
#undef  YY_NO_PUSH_STATE
#define YY_NO_PUSH_STATE 1
#undef  YY_NO_POP_STATE
#define YY_NO_POP_STATE 1
#undef  YY_NO_TOP_STATE
#define YY_NO_TOP_STATE 1
#undef  YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#undef  ECHO
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
#undef  YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#undef  YY_DECL
#define YY_DECL int yylex YY_PROTO(( void ))
#undef  YY_USER_ACTION
#define YY_USER_ACTION
#undef  YY_BREAK
#define YY_BREAK break;
#undef  YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#undef  MAXMBOXES
#define MAXMBOXES 10
#undef  MINSIZE
#define MINSIZE 496		/* minimum size of a block. */
#undef  __unused
#define __unused 
#undef  OUTFILE
#define OUTFILE "init.c"
#undef  OUTTEMP
#define OUTTEMP "init.c.new"
#undef  BLOCKSIZE
#define BLOCKSIZE 512
#undef  __printf0like
#define __printf0like __printflike
#undef  __unused
#define __unused
#undef  MAXTYPES
#define MAXTYPES 50		/* max number of node types */
#undef  MAXFIELDS
#define MAXFIELDS 20		/* max fields in a structure */
#undef  BUFLEN
#define BUFLEN 100		/* size of character buffers */
#undef  T_NODE
#define T_NODE 1		/* union node *field */
#undef  T_NODELIST
#define T_NODELIST 2		/* struct nodelist *field */
#undef  T_STRING
#define T_STRING 3
#undef  T_INT
#define T_INT 4			/* int field */
#undef  T_OTHER
#define T_OTHER 5		/* other */
#undef  T_TEMP
#define T_TEMP 6		/* don't copy this field */
#undef  __unused
#define __unused
#undef  DEFINE_OPTIONS
#define DEFINE_OPTIONS
#undef  OUTBUFSIZ
#define OUTBUFSIZ BUFSIZ
#undef  BLOCK_OUT
#define BLOCK_OUT -2		/* output to a fixed block of memory */
#undef  MEM_OUT
#define MEM_OUT -3		/* output to dynamically allocated memory */
#undef  OUTPUT_ERR
#define OUTPUT_ERR 01		/* error occurred on output */
#undef 	EOFMARKLEN
#define	EOFMARKLEN	79
#undef 	PROMPTLEN
#define	PROMPTLEN	128
#undef  EMPTY
#define EMPTY -2		/* marks an unused slot in redirtab */
#undef  PIPESIZE
#define PIPESIZE 4096		/* amount of buffering in a pipe */
#undef  S_DFL
#define S_DFL 1			/* default signal handling (SIG_DFL) */
#undef  S_CATCH
#define S_CATCH 2		/* signal is caught */
#undef  S_IGN
#define S_IGN 3			/* signal is ignored (SIG_IGN) */
#undef  S_HARD_IGN
#define S_HARD_IGN 4		/* signal is ignored permanently */
#undef  S_RESET
#define S_RESET 5		/* temporary - to reset a hard ignored sig */
#undef  sys_signame
#define sys_signame sys_siglist
#undef  VTABSIZE
#define VTABSIZE 39
#undef  YYBYACC
#define YYBYACC 1
#undef  YYMAJOR
#define YYMAJOR 1
#undef  YYMINOR
#define YYMINOR 9
#undef  YYLEX
#define YYLEX yylex()
#undef  YYEMPTY
#define YYEMPTY -1
#undef  yyclearin
#define yyclearin (yychar=(YYEMPTY))
#undef  yyerrok
#define yyerrok (yyerrflag=0)
#undef  YYPREFIX
#define YYPREFIX "yy"
#undef  YYERRCODE
#define YYERRCODE 256
#undef  ARITH_NUM
#define ARITH_NUM 257
#undef  ARITH_LPAREN
#define ARITH_LPAREN 258
#undef  ARITH_RPAREN
#define ARITH_RPAREN 259
#undef  ARITH_VAR
#define ARITH_VAR 260
#undef  ARITH_ASSIGN
#define ARITH_ASSIGN 261
#undef  ARITH_ADDASSIGN
#define ARITH_ADDASSIGN 262
#undef  ARITH_SUBASSIGN
#define ARITH_SUBASSIGN 263
#undef  ARITH_MULASSIGN
#define ARITH_MULASSIGN 264
#undef  ARITH_DIVASSIGN
#define ARITH_DIVASSIGN 265
#undef  ARITH_REMASSIGN
#define ARITH_REMASSIGN 266
#undef  ARITH_RSHASSIGN
#define ARITH_RSHASSIGN 267
#undef  ARITH_LSHASSIGN
#define ARITH_LSHASSIGN 268
#undef  ARITH_BANDASSIGN
#define ARITH_BANDASSIGN 269
#undef  ARITH_BXORASSIGN
#define ARITH_BXORASSIGN 270
#undef  ARITH_BORASSIGN
#define ARITH_BORASSIGN 271
#undef  ARITH_OR
#define ARITH_OR 272
#undef  ARITH_AND
#define ARITH_AND 273
#undef  ARITH_BOR
#define ARITH_BOR 274
#undef  ARITH_BXOR
#define ARITH_BXOR 275
#undef  ARITH_BAND
#define ARITH_BAND 276
#undef  ARITH_EQ
#define ARITH_EQ 277
#undef  ARITH_NE
#define ARITH_NE 278
#undef  ARITH_LT
#define ARITH_LT 279
#undef  ARITH_GT
#define ARITH_GT 280
#undef  ARITH_GE
#define ARITH_GE 281
#undef  ARITH_LE
#define ARITH_LE 282
#undef  ARITH_LSHIFT
#define ARITH_LSHIFT 283
#undef  ARITH_RSHIFT
#define ARITH_RSHIFT 284
#undef  ARITH_ADD
#define ARITH_ADD 285
#undef  ARITH_SUB
#define ARITH_SUB 286
#undef  ARITH_MUL
#define ARITH_MUL 287
#undef  ARITH_DIV
#define ARITH_DIV 288
#undef  ARITH_REM
#define ARITH_REM 289
#undef  ARITH_UNARYMINUS
#define ARITH_UNARYMINUS 290
#undef  ARITH_UNARYPLUS
#define ARITH_UNARYPLUS 291
#undef  ARITH_NOT
#define ARITH_NOT 292
#undef  ARITH_BNOT
#define ARITH_BNOT 293
#undef  YYTABLESIZE
#define YYTABLESIZE 549
#undef  YYFINAL
#define YYFINAL 8
#undef  YYDEBUG
#define YYDEBUG 0
#undef  YYMAXTOKEN
#define YYMAXTOKEN 293
#undef  YYMAXDEPTH
#define YYMAXDEPTH YYSTACKSIZE
#undef  YYSTACKSIZE
#define YYSTACKSIZE YYMAXDEPTH
#undef  YYSTACKSIZE
#define YYSTACKSIZE 10000
#undef  YYMAXDEPTH
#define YYMAXDEPTH 10000
#undef  YYINITSTACKSIZE
#define YYINITSTACKSIZE 200
#undef  YYPARSE_PARAM_TYPE
#define YYPARSE_PARAM_TYPE arith_t *
#undef  YYPARSE_PARAM
#define YYPARSE_PARAM result
#undef  YYABORT
#define YYABORT goto yyabort
#undef  YYREJECT
#define YYREJECT goto yyabort
#undef  YYACCEPT
#define YYACCEPT goto yyaccept
#undef  YYERROR
#define YYERROR goto yyerrlab
#undef  YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_ARG void
#undef  YYPARSE_PARAM_DECL
#define YYPARSE_PARAM_DECL
#undef  YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_ARG
#undef  YYPARSE_PARAM_DECL
#define YYPARSE_PARAM_DECL
#undef  YYPARSE_PARAM_TYPE
#define YYPARSE_PARAM_TYPE void *
#undef  YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM
#undef  YYPARSE_PARAM_DECL
#define YYPARSE_PARAM_DECL
#undef  YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
#undef  YYPARSE_PARAM_DECL
#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;
#undef  EOF_NLEFT
#define EOF_NLEFT -99		/* value of parsenleft when EOF pushed back */
#undef  MAXCMDTEXT
#define MAXCMDTEXT	200
#undef  __unused
#define __unused
#undef  FLEX_SCANNER
#define FLEX_SCANNER
#undef  YY_FLEX_MAJOR_VERSION
#define YY_FLEX_MAJOR_VERSION 2
#undef  YY_FLEX_MINOR_VERSION
#define YY_FLEX_MINOR_VERSION 5
#undef  __cplusplus
#define __cplusplus
#undef  YY_USE_PROTOS
#define YY_USE_PROTOS
#undef  YY_USE_CONST
#define YY_USE_CONST
#undef  YY_USE_PROTOS
#define YY_USE_PROTOS
#undef  YY_USE_CONST
#define YY_USE_CONST
#undef  YY_USE_CONST
#define YY_USE_CONST
#undef  YY_USE_PROTOS
#define YY_USE_PROTOS
#undef  yyconst
#define yyconst const
#undef  yyconst
#define yyconst
#undef  YY_NULL
#define YY_NULL 0
#undef  BEGIN
#define BEGIN yy_start = 1 + 2 *
#undef  YY_START
#define YY_START ((yy_start - 1) / 2)
#undef  YYSTATE
#define YYSTATE YY_START
#undef  YY_NEW_FILE
#define YY_NEW_FILE yyrestart( yyin )
#undef  YY_END_OF_BUFFER_CHAR
#define YY_END_OF_BUFFER_CHAR 0
#undef  YY_BUF_SIZE
#define YY_BUF_SIZE 16384
#undef  EOB_ACT_CONTINUE_SCAN
#define EOB_ACT_CONTINUE_SCAN 0
#undef  EOB_ACT_END_OF_FILE
#define EOB_ACT_END_OF_FILE 1
#undef  EOB_ACT_LAST_MATCH
#define EOB_ACT_LAST_MATCH 2
#undef  YY_BUFFER_NEW
#define YY_BUFFER_NEW 0
#undef  YY_BUFFER_NORMAL
#define YY_BUFFER_NORMAL 1
#undef  YY_BUFFER_EOF_PENDING
#define YY_BUFFER_EOF_PENDING 2
#undef  YY_CURRENT_BUFFER
#define YY_CURRENT_BUFFER yy_current_buffer
#undef  YY_FLUSH_BUFFER
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
#undef  yy_new_buffer
#define yy_new_buffer yy_create_buffer
#undef  yytext_ptr
#define yytext_ptr yytext
#undef  YY_NUM_RULES
#define YY_NUM_RULES 40
#undef  YY_END_OF_BUFFER
#define YY_END_OF_BUFFER 41
#undef  REJECT
#define REJECT reject_used_but_not_detected
#undef  YY_MORE_ADJ
#define YY_MORE_ADJ 0
#undef  YY_RESTORE_YY_MORE_OFFSET
#define YY_RESTORE_YY_MORE_OFFSET
#undef  INITIAL
#define INITIAL 0
#undef  YY_NO_UNPUT
#define YY_NO_UNPUT
#undef  YY_NO_PUSH_STATE
#define YY_NO_PUSH_STATE 1
#undef  YY_NO_POP_STATE
#define YY_NO_POP_STATE 1
#undef  YY_NO_TOP_STATE
#define YY_NO_TOP_STATE 1
#undef  YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#undef  ECHO
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
#undef  YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#undef  YY_DECL
#define YY_DECL int yylex YY_PROTO(( void ))
#undef  YY_USER_ACTION
#define YY_USER_ACTION
#undef  YY_BREAK
#define YY_BREAK break;
#undef  YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#undef  MAXMBOXES
#define MAXMBOXES 10
#undef  MINSIZE
#define MINSIZE 496		/* minimum size of a block. */
#undef  __unused
#define __unused 
#undef  OUTFILE
#define OUTFILE "init.c"
#undef  OUTTEMP
#define OUTTEMP "init.c.new"
#undef  BLOCKSIZE
#define BLOCKSIZE 512
#undef  __printf0like
#define __printf0like __printflike
#undef  __unused
#define __unused
#undef  MAXTYPES
#define MAXTYPES 50		/* max number of node types */
#undef  MAXFIELDS
#define MAXFIELDS 20		/* max fields in a structure */
#undef  BUFLEN
#define BUFLEN 100		/* size of character buffers */
#undef  T_NODE
#define T_NODE 1		/* union node *field */
#undef  T_NODELIST
#define T_NODELIST 2		/* struct nodelist *field */
#undef  T_STRING
#define T_STRING 3
#undef  T_INT
#define T_INT 4			/* int field */
#undef  T_OTHER
#define T_OTHER 5		/* other */
#undef  T_TEMP
#define T_TEMP 6		/* don't copy this field */
#undef  __unused
#define __unused
#undef  DEFINE_OPTIONS
#define DEFINE_OPTIONS
#undef  OUTBUFSIZ
#define OUTBUFSIZ BUFSIZ
#undef  BLOCK_OUT
#define BLOCK_OUT -2		/* output to a fixed block of memory */
#undef  MEM_OUT
#define MEM_OUT -3		/* output to dynamically allocated memory */
#undef  OUTPUT_ERR
#define OUTPUT_ERR 01		/* error occurred on output */
#undef 	EOFMARKLEN
#define	EOFMARKLEN	79
#undef 	PROMPTLEN
#define	PROMPTLEN	128
#undef  EMPTY
#define EMPTY -2		/* marks an unused slot in redirtab */
#undef  PIPESIZE
#define PIPESIZE 4096		/* amount of buffering in a pipe */
#undef  S_DFL
#define S_DFL 1			/* default signal handling (SIG_DFL) */
#undef  S_CATCH
#define S_CATCH 2		/* signal is caught */
#undef  S_IGN
#define S_IGN 3			/* signal is ignored (SIG_IGN) */
#undef  S_HARD_IGN
#define S_HARD_IGN 4		/* signal is ignored permanently */
#undef  S_RESET
#define S_RESET 5		/* temporary - to reset a hard ignored sig */
#undef  sys_signame
#define sys_signame sys_siglist
#undef  VTABSIZE
#define VTABSIZE 39
#undef  YYBYACC
#define YYBYACC 1
#undef  YYMAJOR
#define YYMAJOR 1
#undef  YYMINOR
#define YYMINOR 9
#undef  YYLEX
#define YYLEX yylex()
#undef  YYEMPTY
#define YYEMPTY -1
#undef  yyclearin
#define yyclearin (yychar=(YYEMPTY))
#undef  yyerrok
#define yyerrok (yyerrflag=0)
#undef  YYPREFIX
#define YYPREFIX "yy"
#undef  YYERRCODE
#define YYERRCODE 256
#undef  ARITH_NUM
#define ARITH_NUM 257
#undef  ARITH_LPAREN
#define ARITH_LPAREN 258
#undef  ARITH_RPAREN
#define ARITH_RPAREN 259
#undef  ARITH_VAR
#define ARITH_VAR 260
#undef  ARITH_ASSIGN
#define ARITH_ASSIGN 261
#undef  ARITH_ADDASSIGN
#define ARITH_ADDASSIGN 262
#undef  ARITH_SUBASSIGN
#define ARITH_SUBASSIGN 263
#undef  ARITH_MULASSIGN
#define ARITH_MULASSIGN 264
#undef  ARITH_DIVASSIGN
#define ARITH_DIVASSIGN 265
#undef  ARITH_REMASSIGN
#define ARITH_REMASSIGN 266
#undef  ARITH_RSHASSIGN
#define ARITH_RSHASSIGN 267
#undef  ARITH_LSHASSIGN
#define ARITH_LSHASSIGN 268
#undef  ARITH_BANDASSIGN
#define ARITH_BANDASSIGN 269
#undef  ARITH_BXORASSIGN
#define ARITH_BXORASSIGN 270
#undef  ARITH_BORASSIGN
#define ARITH_BORASSIGN 271
#undef  ARITH_OR
#define ARITH_OR 272
#undef  ARITH_AND
#define ARITH_AND 273
#undef  ARITH_BOR
#define ARITH_BOR 274
#undef  ARITH_BXOR
#define ARITH_BXOR 275
#undef  ARITH_BAND
#define ARITH_BAND 276
#undef  ARITH_EQ
#define ARITH_EQ 277
#undef  ARITH_NE
#define ARITH_NE 278
#undef  ARITH_LT
#define ARITH_LT 279
#undef  ARITH_GT
#define ARITH_GT 280
#undef  ARITH_GE
#define ARITH_GE 281
#undef  ARITH_LE
#define ARITH_LE 282
#undef  ARITH_LSHIFT
#define ARITH_LSHIFT 283
#undef  ARITH_RSHIFT
#define ARITH_RSHIFT 284
#undef  ARITH_ADD
#define ARITH_ADD 285
#undef  ARITH_SUB
#define ARITH_SUB 286
#undef  ARITH_MUL
#define ARITH_MUL 287
#undef  ARITH_DIV
#define ARITH_DIV 288
#undef  ARITH_REM
#define ARITH_REM 289
#undef  ARITH_UNARYMINUS
#define ARITH_UNARYMINUS 290
#undef  ARITH_UNARYPLUS
#define ARITH_UNARYPLUS 291
#undef  ARITH_NOT
#define ARITH_NOT 292
#undef  ARITH_BNOT
#define ARITH_BNOT 293
#undef  YYTABLESIZE
#define YYTABLESIZE 549
#undef  YYFINAL
#define YYFINAL 8
#undef  YYDEBUG
#define YYDEBUG 0
#undef  YYMAXTOKEN
#define YYMAXTOKEN 293
#undef  YYMAXDEPTH
#define YYMAXDEPTH YYSTACKSIZE
#undef  YYSTACKSIZE
#define YYSTACKSIZE YYMAXDEPTH
#undef  YYSTACKSIZE
#define YYSTACKSIZE 10000
#undef  YYMAXDEPTH
#define YYMAXDEPTH 10000
#undef  YYINITSTACKSIZE
#define YYINITSTACKSIZE 200
#undef  YYPARSE_PARAM_TYPE
#define YYPARSE_PARAM_TYPE arith_t *
#undef  YYPARSE_PARAM
#define YYPARSE_PARAM result
#undef  YYABORT
#define YYABORT goto yyabort
#undef  YYREJECT
#define YYREJECT goto yyabort
#undef  YYACCEPT
#define YYACCEPT goto yyaccept
#undef  YYERROR
#define YYERROR goto yyerrlab
#undef  YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_ARG void
#undef  YYPARSE_PARAM_DECL
#define YYPARSE_PARAM_DECL
#undef  YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_ARG
#undef  YYPARSE_PARAM_DECL
#define YYPARSE_PARAM_DECL
#undef  YYPARSE_PARAM_TYPE
#define YYPARSE_PARAM_TYPE void *
#undef  YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM
#undef  YYPARSE_PARAM_DECL
#define YYPARSE_PARAM_DECL
#undef  YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
#undef  YYPARSE_PARAM_DECL
#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;



extern void rmaliases(void);

extern int evalskip;		/* set if we are skipping commands */
extern int loopnest;		/* current loop nesting level */

extern void deletefuncs(void);

struct strpush {
	struct strpush *prev;	/* preceding string on stack */
	char *prevstring;
	int prevnleft;
	int prevlleft;
	struct alias *ap;	/* if push was associated with an alias */
};

struct parsefile {
	struct parsefile *prev;	/* preceding file on stack */
	int linno;		/* current line */
	int fd;			/* file descriptor (or -1 if string) */
	int nleft;		/* number of chars left in this line */
	int lleft;		/* number of lines left in this buffer */
	char *nextc;		/* next char in buffer */
	char *buf;		/* input buffer */
	struct strpush *strpush; /* for pushing strings at this level */
	struct strpush basestrpush; /* so pushing one is fast */
};

extern int parsenleft;		/* copy of parsefile->nleft */
extern int parselleft;		/* copy of parsefile->lleft */
extern struct parsefile basepf;	/* top level input file */

extern pid_t backgndpid;	/* pid of last background process */
extern int jobctl;

extern int tokpushback;		/* last token pushed back */
extern int checkkwd;            /* 1 == check for kwds, 2 == also eat newlines */

struct redirtab {
	struct redirtab *next;
	int renamed[10];
};

extern struct redirtab *redirlist;

extern char sigmode[NSIG];	/* current value of signal */

extern void shprocvar(void);



/*
 * Initialization code.
 */

void
init(void)
{

      /* from input.c: */
      {
	      extern char basebuf[];

	      basepf.nextc = basepf.buf = basebuf;
      }

      /* from var.c: */
      {
	      char **envp;
	      extern char **environ;

	      initvar();
	      for (envp = environ ; *envp ; envp++) {
		      if (strchr(*envp, '=')) {
			      setvareq(*envp, VEXPORT|VTEXTFIXED);
		      }
	      }
      }
}



/*
 * This routine is called when an error or an interrupt occurs in an
 * interactive shell and control is returned to the main command loop.
 */

void
reset(void)
{

      /* from eval.c: */
      {
	      evalskip = 0;
	      loopnest = 0;
	      funcnest = 0;
      }

      /* from input.c: */
      {
	      if (exception != EXSHELLPROC)
		      parselleft = parsenleft = 0;	/* clear input buffer */
	      popallfiles();
      }

      /* from output.c: */
      {
	      out1 = &output;
	      out2 = &errout;
	      if (memout.buf != NULL) {
		      ckfree(memout.buf);
		      memout.buf = NULL;
	      }
      }

      /* from parser.c: */
      {
	      tokpushback = 0;
	      checkkwd = 0;
      }

      /* from redir.c: */
      {
	      while (redirlist)
		      popredir();
      }
}



/*
 * This routine is called to initialize the shell to run a shell procedure.
 */

void
initshellproc(void)
{

      /* from alias.c: */
      {
	      rmaliases();
      }

      /* from eval.c: */
      {
	      exitstatus = 0;
      }

      /* from exec.c: */
      {
	      deletefuncs();
      }

      /* from input.c: */
      {
	      popallfiles();
      }

      /* from jobs.c: */
      {
	      backgndpid = -1;
#if JOBS
	      jobctl = 0;
#endif
      }

      /* from options.c: */
      {
	      int i;

	      for (i = 0; i < NOPTS; i++)
		      optlist[i].val = 0;
	      optschanged();

      }

      /* from redir.c: */
      {
	      clearredir();
      }

      /* from trap.c: */
      {
	      char *sm;

	      clear_traps();
	      for (sm = sigmode ; sm < sigmode + NSIG ; sm++) {
		      if (*sm == S_IGN)
			      *sm = S_HARD_IGN;
	      }
      }

      /* from var.c: */
      {
	      shprocvar();
      }
}
