/* A Bison parser, made by GNU Bison 3.8.2.  */

/* Bison implementation for Yacc-like parsers in C

   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
   Inc.

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.

   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */

/* C LALR(1) parser skeleton written by Richard Stallman, by
   simplifying the original so-called "semantic" parser.  */

/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
   especially those whose name start with YY_ or yy_.  They are
   private implementation details that can be changed or removed.  */

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

/* Identify Bison output, and Bison version.  */
#define YYBISON 30802

/* Bison version string.  */
#define YYBISON_VERSION "3.8.2"

/* Skeleton name.  */
#define YYSKELETON_NAME "yacc.c"

/* Pure parsers.  */
#define YYPURE 1

/* Push parsers.  */
#define YYPUSH 0

/* Pull parsers.  */
#define YYPULL 1




/* First part of user prologue.  */
#line 34 "parser.y"


#define PARSER_VERSION_STRING "parser_version_3"

#include "config.h"
#include <stdlib.h>
#include <termios.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <setjmp.h>
#include <sys/stat.h>                    /* structure stat       */
#include <unistd.h>                      /* prototype for stat() */
#include <sys/wait.h>
#include <signal.h>
#include <stdarg.h>
#include <pwd.h>
#include <syslog.h>
#include <string.h>
#include <errno.h>
#ifdef __linux__
#include <mntent.h>
#endif

#include "dosemu_config.h"
#include "emu.h"
#ifdef X86_EMULATOR
#include "cpu-emu.h"
#endif
#include "disks.h"
#include "port.h"
#define allow_io	port_allow_io
#include "lpt.h"
#include "video.h"
#include "vc.h"
#include "mouse.h"
#include "serial.h"
#include "timers.h"
#include "keymaps.h"
#include "keyb_server.h"
#include "memory.h"
#include "mapping.h"
#include "utilities.h"
#include "aspi.h"
#include "pktdrvr.h"
#include "iodev.h" /* for TM_BIOS / TM_PIT / TM_LINUX */

#define USERVAR_PREF	"dosemu_"
static int user_scope_level;

static int after_secure_check = 0;
static serial_t *sptr;
static serial_t nullser;
static mouse_t *mptr = &config.mouse;
static int c_ser = 0;

static struct disk *dptr;
static struct disk nulldisk;
static int c_hdisks = 0;
static int c_fdisks = 0;

int dexe_running = 0;
static int dexe_forbid_disk = 1;
char own_hostname[128];

static struct printer null_ptr;
static struct printer *pptr = &null_ptr;
static int c_printers = 0;

static int ports_permission = IO_RDWR;
static unsigned int ports_ormask = 0;
static unsigned int ports_andmask = 0xFFFF;
static unsigned int portspeed = 0;
static char dev_name[255]= "";

static int errors = 0;
static int warnings = 0;

static int priv_lvl = 0;
static int saved_priv_lvl = 0; 


static char *file_being_parsed;

			/* this to ensure we are parsing a new style */
static int parser_version_3_style_used = 0;
#define CONFNAME_V3USED "version_3_style_used"

	/* local procedures */

static void start_ports(void);
static void start_mouse(void);
static void stop_mouse(void);
static void start_debug(void);
static void start_video(void);
static void stop_video(void);
static void set_vesamodes(int width, int height, int color_bits);
static int detect_vbios_seg(void);
static int detect_vbios_size(void);
static void stop_ttylocks(void);
static void start_serial(void);
static void stop_serial(void);
static void start_printer(void);
static void stop_printer(void);
static void start_keyboard(void);
static void keytable_start(int layout);
static void keytable_stop(void);
static void dump_keytables_to_file(char *name);
static void stop_terminal(void);
static void start_disk(void);
static void do_part(char *);
static void start_bootdisk(void);
static void start_floppy(void);
static void stop_disk(int token);
static void start_vnet(char *);
static FILE* open_file(char* filename);
static void close_file(FILE* file);
static void write_to_syslog(char *message);
static void set_irq_value(int bits, int i1);
static void set_irq_range(int bits, int i1, int i2);
static int undefine_config_variable(char *name);
static void check_user_var(char *name);
static char *run_shell(char *command);
static int for_each_handling(int loopid, char *varname, char *delim, char *list);
static void enter_user_scope(int incstackptr);
static void leave_user_scope(int incstackptr);
static void handle_features(int which, int value);
static void set_joy_device(char *devstring);
static int parse_timemode(const char *);

	/* class stuff */
#define IFCLASS(m) if (is_in_allowed_classes(m))

#define CL_ALL			-1
#define CL_VAR		    0x200
#define CL_VPORT	   0x2000
#define CL_PORT		  0x20000
#define CL_PCI		  0x40000
#define CL_IRQ		 0x200000
#define CL_HARDRAM	0x1000000
#define CL_NET		0x2000000

static int is_in_allowed_classes(int mask);

#define TOF(x) ( x.type == TYPE_REAL ? x.value.r : x.value.i )
#define V_VAL(x,y,z) \
do { x.type = y.type; if (x.type == TYPE_REAL) x.value.r = (z); \
      else x.value.i = (z); } \
while (0)

	/* variables in lexer.l */




	/* for unicode keyboard plugin */
static void keyb_mod(int wich, t_keysym keynum, int unicode);
static void dump_keytable_part(FILE *f, t_keysym *map, int size);



#include "translate.h"
#include "dosemu_charset.h"
	/* for translate plugin */

static void set_internal_charset(char *charset_name);
static void set_external_charset(char *charset_name);


#line 243 "parser.c"

# ifndef YY_CAST
#  ifdef __cplusplus
#   define YY_CAST(Type, Val) static_cast<Type> (Val)
#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
#  else
#   define YY_CAST(Type, Val) ((Type) (Val))
#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
#  endif
# endif
# ifndef YY_NULLPTR
#  if defined __cplusplus
#   if 201103L <= __cplusplus
#    define YY_NULLPTR nullptr
#   else
#    define YY_NULLPTR 0
#   endif
#  else
#   define YY_NULLPTR ((void*)0)
#  endif
# endif

#include "parser.h"
/* Symbol kind.  */
enum yysymbol_kind_t
{
  YYSYMBOL_YYEMPTY = -2,
  YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
  YYSYMBOL_YYerror = 1,                    /* error  */
  YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
  YYSYMBOL_INTEGER = 3,                    /* INTEGER  */
  YYSYMBOL_L_OFF = 4,                      /* L_OFF  */
  YYSYMBOL_L_ON = 5,                       /* L_ON  */
  YYSYMBOL_L_AUTO = 6,                     /* L_AUTO  */
  YYSYMBOL_L_YES = 7,                      /* L_YES  */
  YYSYMBOL_L_NO = 8,                       /* L_NO  */
  YYSYMBOL_CHIPSET_TYPE = 9,               /* CHIPSET_TYPE  */
  YYSYMBOL_KEYB_LAYOUT = 10,               /* KEYB_LAYOUT  */
  YYSYMBOL_REAL = 11,                      /* REAL  */
  YYSYMBOL_STRING = 12,                    /* STRING  */
  YYSYMBOL_VARIABLE = 13,                  /* VARIABLE  */
  YYSYMBOL_EXPRTEST = 14,                  /* EXPRTEST  */
  YYSYMBOL_INTCAST = 15,                   /* INTCAST  */
  YYSYMBOL_REALCAST = 16,                  /* REALCAST  */
  YYSYMBOL_AND_OP = 17,                    /* AND_OP  */
  YYSYMBOL_OR_OP = 18,                     /* OR_OP  */
  YYSYMBOL_XOR_OP = 19,                    /* XOR_OP  */
  YYSYMBOL_SHR_OP = 20,                    /* SHR_OP  */
  YYSYMBOL_SHL_OP = 21,                    /* SHL_OP  */
  YYSYMBOL_NOT_OP = 22,                    /* NOT_OP  */
  YYSYMBOL_EQ_OP = 23,                     /* EQ_OP  */
  YYSYMBOL_GE_OP = 24,                     /* GE_OP  */
  YYSYMBOL_LE_OP = 25,                     /* LE_OP  */
  YYSYMBOL_26_ = 26,                       /* '='  */
  YYSYMBOL_27_ = 27,                       /* '<'  */
  YYSYMBOL_28_ = 28,                       /* '>'  */
  YYSYMBOL_NEQ_OP = 29,                    /* NEQ_OP  */
  YYSYMBOL_STR_EQ_OP = 30,                 /* STR_EQ_OP  */
  YYSYMBOL_STR_NEQ_OP = 31,                /* STR_NEQ_OP  */
  YYSYMBOL_L_AND_OP = 32,                  /* L_AND_OP  */
  YYSYMBOL_L_OR_OP = 33,                   /* L_OR_OP  */
  YYSYMBOL_34_ = 34,                       /* '+'  */
  YYSYMBOL_35_ = 35,                       /* '-'  */
  YYSYMBOL_36_ = 36,                       /* '*'  */
  YYSYMBOL_37_ = 37,                       /* '/'  */
  YYSYMBOL_UMINUS = 38,                    /* UMINUS  */
  YYSYMBOL_UPLUS = 39,                     /* UPLUS  */
  YYSYMBOL_BIT_NOT_OP = 40,                /* BIT_NOT_OP  */
  YYSYMBOL_STRLEN = 41,                    /* STRLEN  */
  YYSYMBOL_STRTOL = 42,                    /* STRTOL  */
  YYSYMBOL_STRNCMP = 43,                   /* STRNCMP  */
  YYSYMBOL_STRCAT = 44,                    /* STRCAT  */
  YYSYMBOL_STRPBRK = 45,                   /* STRPBRK  */
  YYSYMBOL_STRSPLIT = 46,                  /* STRSPLIT  */
  YYSYMBOL_STRCHR = 47,                    /* STRCHR  */
  YYSYMBOL_STRRCHR = 48,                   /* STRRCHR  */
  YYSYMBOL_STRSTR = 49,                    /* STRSTR  */
  YYSYMBOL_STRDEL = 50,                    /* STRDEL  */
  YYSYMBOL_STRSPN = 51,                    /* STRSPN  */
  YYSYMBOL_STRCSPN = 52,                   /* STRCSPN  */
  YYSYMBOL_SHELL = 53,                     /* SHELL  */
  YYSYMBOL_DEFINED = 54,                   /* DEFINED  */
  YYSYMBOL_DEFINE = 55,                    /* DEFINE  */
  YYSYMBOL_UNDEF = 56,                     /* UNDEF  */
  YYSYMBOL_IFSTATEMENT = 57,               /* IFSTATEMENT  */
  YYSYMBOL_WHILESTATEMENT = 58,            /* WHILESTATEMENT  */
  YYSYMBOL_FOREACHSTATEMENT = 59,          /* FOREACHSTATEMENT  */
  YYSYMBOL_ENTER_USER_SPACE = 60,          /* ENTER_USER_SPACE  */
  YYSYMBOL_LEAVE_USER_SPACE = 61,          /* LEAVE_USER_SPACE  */
  YYSYMBOL_CHECKUSERVAR = 62,              /* CHECKUSERVAR  */
  YYSYMBOL_DOSBANNER = 63,                 /* DOSBANNER  */
  YYSYMBOL_FASTFLOPPY = 64,                /* FASTFLOPPY  */
  YYSYMBOL_HOGTHRESH = 65,                 /* HOGTHRESH  */
  YYSYMBOL_SPEAKER = 66,                   /* SPEAKER  */
  YYSYMBOL_IPXSUPPORT = 67,                /* IPXSUPPORT  */
  YYSYMBOL_IPXNETWORK = 68,                /* IPXNETWORK  */
  YYSYMBOL_NOVELLHACK = 69,                /* NOVELLHACK  */
  YYSYMBOL_ETHDEV = 70,                    /* ETHDEV  */
  YYSYMBOL_TAPDEV = 71,                    /* TAPDEV  */
  YYSYMBOL_VDESWITCH = 72,                 /* VDESWITCH  */
  YYSYMBOL_SLIRPARGS = 73,                 /* SLIRPARGS  */
  YYSYMBOL_VNET = 74,                      /* VNET  */
  YYSYMBOL_DEBUG = 75,                     /* DEBUG  */
  YYSYMBOL_MOUSE = 76,                     /* MOUSE  */
  YYSYMBOL_SERIAL = 77,                    /* SERIAL  */
  YYSYMBOL_COM = 78,                       /* COM  */
  YYSYMBOL_KEYBOARD = 79,                  /* KEYBOARD  */
  YYSYMBOL_TERMINAL = 80,                  /* TERMINAL  */
  YYSYMBOL_VIDEO = 81,                     /* VIDEO  */
  YYSYMBOL_EMURETRACE = 82,                /* EMURETRACE  */
  YYSYMBOL_TIMER = 83,                     /* TIMER  */
  YYSYMBOL_MATHCO = 84,                    /* MATHCO  */
  YYSYMBOL_CPU = 85,                       /* CPU  */
  YYSYMBOL_CPUSPEED = 86,                  /* CPUSPEED  */
  YYSYMBOL_RDTSC = 87,                     /* RDTSC  */
  YYSYMBOL_BOOTA = 88,                     /* BOOTA  */
  YYSYMBOL_BOOTB = 89,                     /* BOOTB  */
  YYSYMBOL_BOOTC = 90,                     /* BOOTC  */
  YYSYMBOL_L_XMS = 91,                     /* L_XMS  */
  YYSYMBOL_L_DPMI = 92,                    /* L_DPMI  */
  YYSYMBOL_DPMI_BASE = 93,                 /* DPMI_BASE  */
  YYSYMBOL_PM_DOS_API = 94,                /* PM_DOS_API  */
  YYSYMBOL_NO_NULL_CHECKS = 95,            /* NO_NULL_CHECKS  */
  YYSYMBOL_PORTS = 96,                     /* PORTS  */
  YYSYMBOL_DISK = 97,                      /* DISK  */
  YYSYMBOL_DOSMEM = 98,                    /* DOSMEM  */
  YYSYMBOL_EXT_MEM = 99,                   /* EXT_MEM  */
  YYSYMBOL_L_EMS = 100,                    /* L_EMS  */
  YYSYMBOL_L_UMB = 101,                    /* L_UMB  */
  YYSYMBOL_EMS_SIZE = 102,                 /* EMS_SIZE  */
  YYSYMBOL_EMS_FRAME = 103,                /* EMS_FRAME  */
  YYSYMBOL_EMS_UMA_PAGES = 104,            /* EMS_UMA_PAGES  */
  YYSYMBOL_EMS_CONV_PAGES = 105,           /* EMS_CONV_PAGES  */
  YYSYMBOL_TTYLOCKS = 106,                 /* TTYLOCKS  */
  YYSYMBOL_L_SOUND = 107,                  /* L_SOUND  */
  YYSYMBOL_L_SND_OSS = 108,                /* L_SND_OSS  */
  YYSYMBOL_L_JOYSTICK = 109,               /* L_JOYSTICK  */
  YYSYMBOL_FULL_FILE_LOCKS = 110,          /* FULL_FILE_LOCKS  */
  YYSYMBOL_DEXE = 111,                     /* DEXE  */
  YYSYMBOL_ALLOWDISK = 112,                /* ALLOWDISK  */
  YYSYMBOL_FORCEXDOS = 113,                /* FORCEXDOS  */
  YYSYMBOL_XDOSONLY = 114,                 /* XDOSONLY  */
  YYSYMBOL_ABORT = 115,                    /* ABORT  */
  YYSYMBOL_WARN = 116,                     /* WARN  */
  YYSYMBOL_BOOTDISK = 117,                 /* BOOTDISK  */
  YYSYMBOL_L_FLOPPY = 118,                 /* L_FLOPPY  */
  YYSYMBOL_EMUSYS = 119,                   /* EMUSYS  */
  YYSYMBOL_EMUINI = 120,                   /* EMUINI  */
  YYSYMBOL_L_X = 121,                      /* L_X  */
  YYSYMBOL_DOSEMUMAP = 122,                /* DOSEMUMAP  */
  YYSYMBOL_LOGBUFSIZE = 123,               /* LOGBUFSIZE  */
  YYSYMBOL_LOGFILESIZE = 124,              /* LOGFILESIZE  */
  YYSYMBOL_MAPPINGDRIVER = 125,            /* MAPPINGDRIVER  */
  YYSYMBOL_LFN_SUPPORT = 126,              /* LFN_SUPPORT  */
  YYSYMBOL_EMULATED = 127,                 /* EMULATED  */
  YYSYMBOL_NATIVE = 128,                   /* NATIVE  */
  YYSYMBOL_CPUEMU = 129,                   /* CPUEMU  */
  YYSYMBOL_VM86 = 130,                     /* VM86  */
  YYSYMBOL_FULL = 131,                     /* FULL  */
  YYSYMBOL_VM86SIM = 132,                  /* VM86SIM  */
  YYSYMBOL_FULLSIM = 133,                  /* FULLSIM  */
  YYSYMBOL_RAWKEYBOARD = 134,              /* RAWKEYBOARD  */
  YYSYMBOL_PRESTROKE = 135,                /* PRESTROKE  */
  YYSYMBOL_KEYTABLE = 136,                 /* KEYTABLE  */
  YYSYMBOL_SHIFT_MAP = 137,                /* SHIFT_MAP  */
  YYSYMBOL_ALT_MAP = 138,                  /* ALT_MAP  */
  YYSYMBOL_NUMPAD_MAP = 139,               /* NUMPAD_MAP  */
  YYSYMBOL_DUMP = 140,                     /* DUMP  */
  YYSYMBOL_DGRAVE = 141,                   /* DGRAVE  */
  YYSYMBOL_DACUTE = 142,                   /* DACUTE  */
  YYSYMBOL_DCIRCUM = 143,                  /* DCIRCUM  */
  YYSYMBOL_DTILDE = 144,                   /* DTILDE  */
  YYSYMBOL_DBREVE = 145,                   /* DBREVE  */
  YYSYMBOL_DABOVED = 146,                  /* DABOVED  */
  YYSYMBOL_DDIARES = 147,                  /* DDIARES  */
  YYSYMBOL_DABOVER = 148,                  /* DABOVER  */
  YYSYMBOL_DDACUTE = 149,                  /* DDACUTE  */
  YYSYMBOL_DCEDILLA = 150,                 /* DCEDILLA  */
  YYSYMBOL_DIOTA = 151,                    /* DIOTA  */
  YYSYMBOL_DOGONEK = 152,                  /* DOGONEK  */
  YYSYMBOL_DCARON = 153,                   /* DCARON  */
  YYSYMBOL_NETWORK = 154,                  /* NETWORK  */
  YYSYMBOL_PKTDRIVER = 155,                /* PKTDRIVER  */
  YYSYMBOL_DIRECTORY = 156,                /* DIRECTORY  */
  YYSYMBOL_NAMESTUB = 157,                 /* NAMESTUB  */
  YYSYMBOL_BINARY = 158,                   /* BINARY  */
  YYSYMBOL_BASE = 159,                     /* BASE  */
  YYSYMBOL_IRQ = 160,                      /* IRQ  */
  YYSYMBOL_DEVICE = 161,                   /* DEVICE  */
  YYSYMBOL_CHARSET = 162,                  /* CHARSET  */
  YYSYMBOL_BAUDRATE = 163,                 /* BAUDRATE  */
  YYSYMBOL_VIRTUAL = 164,                  /* VIRTUAL  */
  YYSYMBOL_PSEUDO = 165,                   /* PSEUDO  */
  YYSYMBOL_RTSCTS = 166,                   /* RTSCTS  */
  YYSYMBOL_LOWLAT = 167,                   /* LOWLAT  */
  YYSYMBOL_PCCOM = 168,                    /* PCCOM  */
  YYSYMBOL_MICROSOFT = 169,                /* MICROSOFT  */
  YYSYMBOL_MS3BUTTON = 170,                /* MS3BUTTON  */
  YYSYMBOL_LOGITECH = 171,                 /* LOGITECH  */
  YYSYMBOL_MMSERIES = 172,                 /* MMSERIES  */
  YYSYMBOL_MOUSEMAN = 173,                 /* MOUSEMAN  */
  YYSYMBOL_HITACHI = 174,                  /* HITACHI  */
  YYSYMBOL_MOUSESYSTEMS = 175,             /* MOUSESYSTEMS  */
  YYSYMBOL_BUSMOUSE = 176,                 /* BUSMOUSE  */
  YYSYMBOL_PS2 = 177,                      /* PS2  */
  YYSYMBOL_IMPS2 = 178,                    /* IMPS2  */
  YYSYMBOL_INTERNALDRIVER = 179,           /* INTERNALDRIVER  */
  YYSYMBOL_EMULATE3BUTTONS = 180,          /* EMULATE3BUTTONS  */
  YYSYMBOL_CLEARDTR = 181,                 /* CLEARDTR  */
  YYSYMBOL_L_DISPLAY = 182,                /* L_DISPLAY  */
  YYSYMBOL_L_TITLE = 183,                  /* L_TITLE  */
  YYSYMBOL_X_TITLE_SHOW_APPNAME = 184,     /* X_TITLE_SHOW_APPNAME  */
  YYSYMBOL_ICON_NAME = 185,                /* ICON_NAME  */
  YYSYMBOL_X_KEYCODE = 186,                /* X_KEYCODE  */
  YYSYMBOL_X_BLINKRATE = 187,              /* X_BLINKRATE  */
  YYSYMBOL_X_SHARECMAP = 188,              /* X_SHARECMAP  */
  YYSYMBOL_X_MITSHM = 189,                 /* X_MITSHM  */
  YYSYMBOL_X_FONT = 190,                   /* X_FONT  */
  YYSYMBOL_X_FIXED_ASPECT = 191,           /* X_FIXED_ASPECT  */
  YYSYMBOL_X_ASPECT_43 = 192,              /* X_ASPECT_43  */
  YYSYMBOL_X_LIN_FILT = 193,               /* X_LIN_FILT  */
  YYSYMBOL_X_BILIN_FILT = 194,             /* X_BILIN_FILT  */
  YYSYMBOL_X_MODE13FACT = 195,             /* X_MODE13FACT  */
  YYSYMBOL_X_WINSIZE = 196,                /* X_WINSIZE  */
  YYSYMBOL_X_GAMMA = 197,                  /* X_GAMMA  */
  YYSYMBOL_X_FULLSCREEN = 198,             /* X_FULLSCREEN  */
  YYSYMBOL_VGAEMU_MEMSIZE = 199,           /* VGAEMU_MEMSIZE  */
  YYSYMBOL_VESAMODE = 200,                 /* VESAMODE  */
  YYSYMBOL_X_LFB = 201,                    /* X_LFB  */
  YYSYMBOL_X_PM_INTERFACE = 202,           /* X_PM_INTERFACE  */
  YYSYMBOL_X_MGRAB_KEY = 203,              /* X_MGRAB_KEY  */
  YYSYMBOL_X_BACKGROUND_PAUSE = 204,       /* X_BACKGROUND_PAUSE  */
  YYSYMBOL_VGA = 205,                      /* VGA  */
  YYSYMBOL_MGA = 206,                      /* MGA  */
  YYSYMBOL_CGA = 207,                      /* CGA  */
  YYSYMBOL_EGA = 208,                      /* EGA  */
  YYSYMBOL_NONE = 209,                     /* NONE  */
  YYSYMBOL_CONSOLE = 210,                  /* CONSOLE  */
  YYSYMBOL_GRAPHICS = 211,                 /* GRAPHICS  */
  YYSYMBOL_CHIPSET = 212,                  /* CHIPSET  */
  YYSYMBOL_FULLREST = 213,                 /* FULLREST  */
  YYSYMBOL_PARTREST = 214,                 /* PARTREST  */
  YYSYMBOL_MEMSIZE = 215,                  /* MEMSIZE  */
  YYSYMBOL_VBIOS_SIZE_TOK = 216,           /* VBIOS_SIZE_TOK  */
  YYSYMBOL_VBIOS_SEG = 217,                /* VBIOS_SEG  */
  YYSYMBOL_VGAEMUBIOS_FILE = 218,          /* VGAEMUBIOS_FILE  */
  YYSYMBOL_VBIOS_FILE = 219,               /* VBIOS_FILE  */
  YYSYMBOL_VBIOS_COPY = 220,               /* VBIOS_COPY  */
  YYSYMBOL_VBIOS_MMAP = 221,               /* VBIOS_MMAP  */
  YYSYMBOL_DUALMON = 222,                  /* DUALMON  */
  YYSYMBOL_VBIOS_POST = 223,               /* VBIOS_POST  */
  YYSYMBOL_FORCE_VT_SWITCH = 224,          /* FORCE_VT_SWITCH  */
  YYSYMBOL_PCI = 225,                      /* PCI  */
  YYSYMBOL_UPDATEFREQ = 226,               /* UPDATEFREQ  */
  YYSYMBOL_UPDATELINES = 227,              /* UPDATELINES  */
  YYSYMBOL_COLOR = 228,                    /* COLOR  */
  YYSYMBOL_ESCCHAR = 229,                  /* ESCCHAR  */
  YYSYMBOL_XTERM_TITLE = 230,              /* XTERM_TITLE  */
  YYSYMBOL_IO = 231,                       /* IO  */
  YYSYMBOL_PORT = 232,                     /* PORT  */
  YYSYMBOL_CONFIG = 233,                   /* CONFIG  */
  YYSYMBOL_READ = 234,                     /* READ  */
  YYSYMBOL_WRITE = 235,                    /* WRITE  */
  YYSYMBOL_KEYB = 236,                     /* KEYB  */
  YYSYMBOL_PRINTER = 237,                  /* PRINTER  */
  YYSYMBOL_WARNING = 238,                  /* WARNING  */
  YYSYMBOL_GENERAL = 239,                  /* GENERAL  */
  YYSYMBOL_HARDWARE = 240,                 /* HARDWARE  */
  YYSYMBOL_L_IPC = 241,                    /* L_IPC  */
  YYSYMBOL_SOUND = 242,                    /* SOUND  */
  YYSYMBOL_TRACE = 243,                    /* TRACE  */
  YYSYMBOL_CLEAR = 244,                    /* CLEAR  */
  YYSYMBOL_LPT = 245,                      /* LPT  */
  YYSYMBOL_COMMAND = 246,                  /* COMMAND  */
  YYSYMBOL_TIMEOUT = 247,                  /* TIMEOUT  */
  YYSYMBOL_L_FILE = 248,                   /* L_FILE  */
  YYSYMBOL_L_PARTITION = 249,              /* L_PARTITION  */
  YYSYMBOL_BOOTFILE = 250,                 /* BOOTFILE  */
  YYSYMBOL_WHOLEDISK = 251,                /* WHOLEDISK  */
  YYSYMBOL_THREEINCH = 252,                /* THREEINCH  */
  YYSYMBOL_THREEINCH_720 = 253,            /* THREEINCH_720  */
  YYSYMBOL_THREEINCH_2880 = 254,           /* THREEINCH_2880  */
  YYSYMBOL_FIVEINCH = 255,                 /* FIVEINCH  */
  YYSYMBOL_FIVEINCH_360 = 256,             /* FIVEINCH_360  */
  YYSYMBOL_ATAPI = 257,                    /* ATAPI  */
  YYSYMBOL_READONLY = 258,                 /* READONLY  */
  YYSYMBOL_LAYOUT = 259,                   /* LAYOUT  */
  YYSYMBOL_SECTORS = 260,                  /* SECTORS  */
  YYSYMBOL_CYLINDERS = 261,                /* CYLINDERS  */
  YYSYMBOL_TRACKS = 262,                   /* TRACKS  */
  YYSYMBOL_HEADS = 263,                    /* HEADS  */
  YYSYMBOL_OFFSET = 264,                   /* OFFSET  */
  YYSYMBOL_HDIMAGE = 265,                  /* HDIMAGE  */
  YYSYMBOL_DISKCYL4096 = 266,              /* DISKCYL4096  */
  YYSYMBOL_RDONLY = 267,                   /* RDONLY  */
  YYSYMBOL_WRONLY = 268,                   /* WRONLY  */
  YYSYMBOL_RDWR = 269,                     /* RDWR  */
  YYSYMBOL_ORMASK = 270,                   /* ORMASK  */
  YYSYMBOL_ANDMASK = 271,                  /* ANDMASK  */
  YYSYMBOL_RANGE = 272,                    /* RANGE  */
  YYSYMBOL_FAST = 273,                     /* FAST  */
  YYSYMBOL_SLOW = 274,                     /* SLOW  */
  YYSYMBOL_SILLYINT = 275,                 /* SILLYINT  */
  YYSYMBOL_USE_SIGIO = 276,                /* USE_SIGIO  */
  YYSYMBOL_HARDWARE_RAM = 277,             /* HARDWARE_RAM  */
  YYSYMBOL_SB_BASE = 278,                  /* SB_BASE  */
  YYSYMBOL_SB_IRQ = 279,                   /* SB_IRQ  */
  YYSYMBOL_SB_DMA = 280,                   /* SB_DMA  */
  YYSYMBOL_SB_HDMA = 281,                  /* SB_HDMA  */
  YYSYMBOL_SB_MIXER = 282,                 /* SB_MIXER  */
  YYSYMBOL_SB_DSP = 283,                   /* SB_DSP  */
  YYSYMBOL_MPU_BASE = 284,                 /* MPU_BASE  */
  YYSYMBOL_SOUND_DRIVER = 285,             /* SOUND_DRIVER  */
  YYSYMBOL_OSS_MIN_FRAGS = 286,            /* OSS_MIN_FRAGS  */
  YYSYMBOL_OSS_MAX_FRAGS = 287,            /* OSS_MAX_FRAGS  */
  YYSYMBOL_OSS_STALLED_FRAGS = 288,        /* OSS_STALLED_FRAGS  */
  YYSYMBOL_OSS_DO_POST = 289,              /* OSS_DO_POST  */
  YYSYMBOL_OSS_MIN_EXTRA_FRAGS = 290,      /* OSS_MIN_EXTRA_FRAGS  */
  YYSYMBOL_OSS_DAC_FREQ = 291,             /* OSS_DAC_FREQ  */
  YYSYMBOL_CDROM = 292,                    /* CDROM  */
  YYSYMBOL_ASPI = 293,                     /* ASPI  */
  YYSYMBOL_DEVICETYPE = 294,               /* DEVICETYPE  */
  YYSYMBOL_TARGET = 295,                   /* TARGET  */
  YYSYMBOL_FEATURE = 296,                  /* FEATURE  */
  YYSYMBOL_JOYSTICK = 297,                 /* JOYSTICK  */
  YYSYMBOL_JOY_DEVICE = 298,               /* JOY_DEVICE  */
  YYSYMBOL_JOY_DOS_MIN = 299,              /* JOY_DOS_MIN  */
  YYSYMBOL_JOY_DOS_MAX = 300,              /* JOY_DOS_MAX  */
  YYSYMBOL_JOY_GRANULARITY = 301,          /* JOY_GRANULARITY  */
  YYSYMBOL_JOY_LATENCY = 302,              /* JOY_LATENCY  */
  YYSYMBOL_CLI_TIMEOUT = 303,              /* CLI_TIMEOUT  */
  YYSYMBOL_PIC_WATCHDOG = 304,             /* PIC_WATCHDOG  */
  YYSYMBOL_TIMEMODE = 305,                 /* TIMEMODE  */
  YYSYMBOL_UNICODE = 306,                  /* UNICODE  */
  YYSYMBOL_SHIFT_ALT_MAP = 307,            /* SHIFT_ALT_MAP  */
  YYSYMBOL_CTRL_MAP = 308,                 /* CTRL_MAP  */
  YYSYMBOL_CTRL_ALT_MAP = 309,             /* CTRL_ALT_MAP  */
  YYSYMBOL_INTERNAL = 310,                 /* INTERNAL  */
  YYSYMBOL_EXTERNAL = 311,                 /* EXTERNAL  */
  YYSYMBOL_312_ = 312,                     /* ';'  */
  YYSYMBOL_313_ = 313,                     /* '{'  */
  YYSYMBOL_314_ = 314,                     /* '}'  */
  YYSYMBOL_315_ = 315,                     /* '('  */
  YYSYMBOL_316_ = 316,                     /* ')'  */
  YYSYMBOL_317_ = 317,                     /* ','  */
  YYSYMBOL_YYACCEPT = 318,                 /* $accept  */
  YYSYMBOL_lines = 319,                    /* lines  */
  YYSYMBOL_optdelim = 320,                 /* optdelim  */
  YYSYMBOL_line = 321,                     /* line  */
  YYSYMBOL_322_1 = 322,                    /* $@1  */
  YYSYMBOL_323_2 = 323,                    /* $@2  */
  YYSYMBOL_324_3 = 324,                    /* $@3  */
  YYSYMBOL_325_4 = 325,                    /* $@4  */
  YYSYMBOL_326_5 = 326,                    /* $@5  */
  YYSYMBOL_327_6 = 327,                    /* $@6  */
  YYSYMBOL_328_7 = 328,                    /* $@7  */
  YYSYMBOL_329_8 = 329,                    /* $@8  */
  YYSYMBOL_330_9 = 330,                    /* $@9  */
  YYSYMBOL_331_10 = 331,                   /* $@10  */
  YYSYMBOL_332_11 = 332,                   /* $@11  */
  YYSYMBOL_333_12 = 333,                   /* $@12  */
  YYSYMBOL_334_13 = 334,                   /* $@13  */
  YYSYMBOL_335_14 = 335,                   /* $@14  */
  YYSYMBOL_expression = 336,               /* expression  */
  YYSYMBOL_real_expression = 337,          /* real_expression  */
  YYSYMBOL_typed_expr = 338,               /* typed_expr  */
  YYSYMBOL_int_expr = 339,                 /* int_expr  */
  YYSYMBOL_bool_expr = 340,                /* bool_expr  */
  YYSYMBOL_real_expr = 341,                /* real_expr  */
  YYSYMBOL_variable_content = 342,         /* variable_content  */
  YYSYMBOL_string_unquoted = 343,          /* string_unquoted  */
  YYSYMBOL_string_expr = 344,              /* string_expr  */
  YYSYMBOL_strarglist = 345,               /* strarglist  */
  YYSYMBOL_strarglist_item = 346,          /* strarglist_item  */
  YYSYMBOL_check_user_var_list = 347,      /* check_user_var_list  */
  YYSYMBOL_x_flags = 348,                  /* x_flags  */
  YYSYMBOL_x_flag = 349,                   /* x_flag  */
  YYSYMBOL_dexeflags = 350,                /* dexeflags  */
  YYSYMBOL_dexeflag = 351,                 /* dexeflag  */
  YYSYMBOL_sound_flags = 352,              /* sound_flags  */
  YYSYMBOL_sound_flag = 353,               /* sound_flag  */
  YYSYMBOL_snd_oss_flags = 354,            /* snd_oss_flags  */
  YYSYMBOL_snd_oss_flag = 355,             /* snd_oss_flag  */
  YYSYMBOL_joystick_flags = 356,           /* joystick_flags  */
  YYSYMBOL_joystick_flag = 357,            /* joystick_flag  */
  YYSYMBOL_video_flags = 358,              /* video_flags  */
  YYSYMBOL_video_flag = 359,               /* video_flag  */
  YYSYMBOL_term_flags = 360,               /* term_flags  */
  YYSYMBOL_term_flag = 361,                /* term_flag  */
  YYSYMBOL_debug_flags = 362,              /* debug_flags  */
  YYSYMBOL_debug_flag = 363,               /* debug_flag  */
  YYSYMBOL_mouse_flags = 364,              /* mouse_flags  */
  YYSYMBOL_mouse_flag = 365,               /* mouse_flag  */
  YYSYMBOL_keyboard_flags = 366,           /* keyboard_flags  */
  YYSYMBOL_keyboard_flag = 367,            /* keyboard_flag  */
  YYSYMBOL_368_15 = 368,                   /* $@15  */
  YYSYMBOL_keyboard_mods = 369,            /* keyboard_mods  */
  YYSYMBOL_keyboard_mod = 370,             /* keyboard_mod  */
  YYSYMBOL_371_16 = 371,                   /* $@16  */
  YYSYMBOL_372_17 = 372,                   /* $@17  */
  YYSYMBOL_373_18 = 373,                   /* $@18  */
  YYSYMBOL_374_19 = 374,                   /* $@19  */
  YYSYMBOL_375_20 = 375,                   /* $@20  */
  YYSYMBOL_376_21 = 376,                   /* $@21  */
  YYSYMBOL_377_22 = 377,                   /* $@22  */
  YYSYMBOL_keyboard_modvals = 378,         /* keyboard_modvals  */
  YYSYMBOL_keyboard_modval = 379,          /* keyboard_modval  */
  YYSYMBOL_ttylocks_flags = 380,           /* ttylocks_flags  */
  YYSYMBOL_ttylocks_flag = 381,            /* ttylocks_flag  */
  YYSYMBOL_serial_flags = 382,             /* serial_flags  */
  YYSYMBOL_serial_flag = 383,              /* serial_flag  */
  YYSYMBOL_printer_flags = 384,            /* printer_flags  */
  YYSYMBOL_printer_flag = 385,             /* printer_flag  */
  YYSYMBOL_optbootfile = 386,              /* optbootfile  */
  YYSYMBOL_disk_flags = 387,               /* disk_flags  */
  YYSYMBOL_disk_flag = 388,                /* disk_flag  */
  YYSYMBOL_port_flags = 389,               /* port_flags  */
  YYSYMBOL_port_flag = 390,                /* port_flag  */
  YYSYMBOL_trace_port_flags = 391,         /* trace_port_flags  */
  YYSYMBOL_trace_port_flag = 392,          /* trace_port_flag  */
  YYSYMBOL_sillyint_flags = 393,           /* sillyint_flags  */
  YYSYMBOL_sillyint_flag = 394,            /* sillyint_flag  */
  YYSYMBOL_ems_flags = 395,                /* ems_flags  */
  YYSYMBOL_ems_flag = 396,                 /* ems_flag  */
  YYSYMBOL_hardware_ram_flags = 397,       /* hardware_ram_flags  */
  YYSYMBOL_hardware_ram_flag = 398,        /* hardware_ram_flag  */
  YYSYMBOL_bool = 399,                     /* bool  */
  YYSYMBOL_floppy_bool = 400,              /* floppy_bool  */
  YYSYMBOL_int_bool = 401,                 /* int_bool  */
  YYSYMBOL_irq_bool = 402,                 /* irq_bool  */
  YYSYMBOL_speaker = 403,                  /* speaker  */
  YYSYMBOL_cpuemu = 404,                   /* cpuemu  */
  YYSYMBOL_charset_flags = 405,            /* charset_flags  */
  YYSYMBOL_charset_flag = 406              /* charset_flag  */
};
typedef enum yysymbol_kind_t yysymbol_kind_t;


/* Second part of user prologue.  */
#line 230 "parser.y"

#include "lexer.h"

#line 687 "parser.c"


#ifdef short
# undef short
#endif

/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
   <limits.h> and (if available) <stdint.h> are included
   so that the code can choose integer types of a good width.  */

#ifndef __PTRDIFF_MAX__
# include <limits.h> /* INFRINGES ON USER NAME SPACE */
# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
#  define YY_STDINT_H
# endif
#endif

/* Narrow types that promote to a signed type and that can represent a
   signed or unsigned integer of at least N bits.  In tables they can
   save space and decrease cache pressure.  Promoting to a signed type
   helps avoid bugs in integer arithmetic.  */

#ifdef __INT_LEAST8_MAX__
typedef __INT_LEAST8_TYPE__ yytype_int8;
#elif defined YY_STDINT_H
typedef int_least8_t yytype_int8;
#else
typedef signed char yytype_int8;
#endif

#ifdef __INT_LEAST16_MAX__
typedef __INT_LEAST16_TYPE__ yytype_int16;
#elif defined YY_STDINT_H
typedef int_least16_t yytype_int16;
#else
typedef short yytype_int16;
#endif

/* Work around bug in HP-UX 11.23, which defines these macros
   incorrectly for preprocessor constants.  This workaround can likely
   be removed in 2023, as HPE has promised support for HP-UX 11.23
   (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
   <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
#ifdef __hpux
# undef UINT_LEAST8_MAX
# undef UINT_LEAST16_MAX
# define UINT_LEAST8_MAX 255
# define UINT_LEAST16_MAX 65535
#endif

#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
       && UINT_LEAST8_MAX <= INT_MAX)
typedef uint_least8_t yytype_uint8;
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
typedef unsigned char yytype_uint8;
#else
typedef short yytype_uint8;
#endif

#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
typedef __UINT_LEAST16_TYPE__ yytype_uint16;
#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
       && UINT_LEAST16_MAX <= INT_MAX)
typedef uint_least16_t yytype_uint16;
#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
typedef unsigned short yytype_uint16;
#else
typedef int yytype_uint16;
#endif

#ifndef YYPTRDIFF_T
# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
#  define YYPTRDIFF_T __PTRDIFF_TYPE__
#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
# elif defined PTRDIFF_MAX
#  ifndef ptrdiff_t
#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  endif
#  define YYPTRDIFF_T ptrdiff_t
#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
# else
#  define YYPTRDIFF_T long
#  define YYPTRDIFF_MAXIMUM LONG_MAX
# endif
#endif

#ifndef YYSIZE_T
# ifdef __SIZE_TYPE__
#  define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
#  define YYSIZE_T size_t
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  define YYSIZE_T size_t
# else
#  define YYSIZE_T unsigned
# endif
#endif

#define YYSIZE_MAXIMUM                                  \
  YY_CAST (YYPTRDIFF_T,                                 \
           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
            ? YYPTRDIFF_MAXIMUM                         \
            : YY_CAST (YYSIZE_T, -1)))

#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))


/* Stored state numbers (used for stacks). */
typedef yytype_int16 yy_state_t;

/* State numbers in computations.  */
typedef int yy_state_fast_t;

#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
#  if ENABLE_NLS
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
#  endif
# endif
# ifndef YY_
#  define YY_(Msgid) Msgid
# endif
#endif


#ifndef YY_ATTRIBUTE_PURE
# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
#  define YY_ATTRIBUTE_PURE
# endif
#endif

#ifndef YY_ATTRIBUTE_UNUSED
# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
# else
#  define YY_ATTRIBUTE_UNUSED
# endif
#endif

/* Suppress unused-variable warnings by "using" E.  */
#if ! defined lint || defined __GNUC__
# define YY_USE(E) ((void) (E))
#else
# define YY_USE(E) /* empty */
#endif

/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
    _Pragma ("GCC diagnostic push")                                     \
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
# else
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
    _Pragma ("GCC diagnostic push")                                     \
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# endif
# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
    _Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
#endif
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif

#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
# define YY_IGNORE_USELESS_CAST_BEGIN                          \
    _Pragma ("GCC diagnostic push")                            \
    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
# define YY_IGNORE_USELESS_CAST_END            \
    _Pragma ("GCC diagnostic pop")
#endif
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
# define YY_IGNORE_USELESS_CAST_BEGIN
# define YY_IGNORE_USELESS_CAST_END
#endif


#define YY_ASSERT(E) ((void) (0 && (E)))

#if !defined yyoverflow

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# ifdef YYSTACK_USE_ALLOCA
#  if YYSTACK_USE_ALLOCA
#   ifdef __GNUC__
#    define YYSTACK_ALLOC __builtin_alloca
#   elif defined __BUILTIN_VA_ARG_INCR
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
#   elif defined _AIX
#    define YYSTACK_ALLOC __alloca
#   elif defined _MSC_VER
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
#    define alloca _alloca
#   else
#    define YYSTACK_ALLOC alloca
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
#     ifndef EXIT_SUCCESS
#      define EXIT_SUCCESS 0
#     endif
#    endif
#   endif
#  endif
# endif

# ifdef YYSTACK_ALLOC
   /* Pacify GCC's 'empty if-body' warning.  */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
#  ifndef YYSTACK_ALLOC_MAXIMUM
    /* The OS might guarantee only one guard page at the bottom of the stack,
       and a page size can be as small as 4096 bytes.  So we cannot safely
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
       to allow for a few compiler-allocated temporary stack slots.  */
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
#  endif
# else
#  define YYSTACK_ALLOC YYMALLOC
#  define YYSTACK_FREE YYFREE
#  ifndef YYSTACK_ALLOC_MAXIMUM
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
#  endif
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
       && ! ((defined YYMALLOC || defined malloc) \
             && (defined YYFREE || defined free)))
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#   ifndef EXIT_SUCCESS
#    define EXIT_SUCCESS 0
#   endif
#  endif
#  ifndef YYMALLOC
#   define YYMALLOC malloc
#   if ! defined malloc && ! defined EXIT_SUCCESS
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
#  ifndef YYFREE
#   define YYFREE free
#   if ! defined free && ! defined EXIT_SUCCESS
void free (void *); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
# endif
#endif /* !defined yyoverflow */

#if (! defined yyoverflow \
     && (! defined __cplusplus \
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  yy_state_t yyss_alloc;
  YYSTYPE yyvs_alloc;
};

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# define YYSTACK_BYTES(N) \
     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
      + YYSTACK_GAP_MAXIMUM)

# define YYCOPY_NEEDED 1

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
    do                                                                  \
      {                                                                 \
        YYPTRDIFF_T yynewbytes;                                         \
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
        Stack = &yyptr->Stack_alloc;                                    \
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
      }                                                                 \
    while (0)

#endif

#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from SRC to DST.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if defined __GNUC__ && 1 < __GNUC__
#   define YYCOPY(Dst, Src, Count) \
      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
#  else
#   define YYCOPY(Dst, Src, Count)              \
      do                                        \
        {                                       \
          YYPTRDIFF_T yyi;                      \
          for (yyi = 0; yyi < (Count); yyi++)   \
            (Dst)[yyi] = (Src)[yyi];            \
        }                                       \
      while (0)
#  endif
# endif
#endif /* !YYCOPY_NEEDED */

/* YYFINAL -- State number of the termination state.  */
#define YYFINAL  236
/* YYLAST -- Last index in YYTABLE.  */
#define YYLAST   3120

/* YYNTOKENS -- Number of terminals.  */
#define YYNTOKENS  318
/* YYNNTS -- Number of nonterminals.  */
#define YYNNTS  89
/* YYNRULES -- Number of rules.  */
#define YYNRULES  498
/* YYNSTATES -- Number of states.  */
#define YYNSTATES  937

/* YYMAXUTOK -- Last valid token kind.  */
#define YYMAXUTOK   559


/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
   as returned by yylex, with out-of-bounds checking.  */
#define YYTRANSLATE(YYX)                                \
  (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
   ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
   : YYSYMBOL_YYUNDEF)

/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
   as returned by yylex.  */
static const yytype_int16 yytranslate[] =
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     315,   316,    36,    34,   317,    35,     2,    37,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,   312,
      27,    26,    28,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,   313,     2,   314,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
      25,    29,    30,    31,    32,    33,    38,    39,    40,    41,
      42,    43,    44,    45,    46,    47,    48,    49,    50,    51,
      52,    53,    54,    55,    56,    57,    58,    59,    60,    61,
      62,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
      82,    83,    84,    85,    86,    87,    88,    89,    90,    91,
      92,    93,    94,    95,    96,    97,    98,    99,   100,   101,
     102,   103,   104,   105,   106,   107,   108,   109,   110,   111,
     112,   113,   114,   115,   116,   117,   118,   119,   120,   121,
     122,   123,   124,   125,   126,   127,   128,   129,   130,   131,
     132,   133,   134,   135,   136,   137,   138,   139,   140,   141,
     142,   143,   144,   145,   146,   147,   148,   149,   150,   151,
     152,   153,   154,   155,   156,   157,   158,   159,   160,   161,
     162,   163,   164,   165,   166,   167,   168,   169,   170,   171,
     172,   173,   174,   175,   176,   177,   178,   179,   180,   181,
     182,   183,   184,   185,   186,   187,   188,   189,   190,   191,
     192,   193,   194,   195,   196,   197,   198,   199,   200,   201,
     202,   203,   204,   205,   206,   207,   208,   209,   210,   211,
     212,   213,   214,   215,   216,   217,   218,   219,   220,   221,
     222,   223,   224,   225,   226,   227,   228,   229,   230,   231,
     232,   233,   234,   235,   236,   237,   238,   239,   240,   241,
     242,   243,   244,   245,   246,   247,   248,   249,   250,   251,
     252,   253,   254,   255,   256,   257,   258,   259,   260,   261,
     262,   263,   264,   265,   266,   267,   268,   269,   270,   271,
     272,   273,   274,   275,   276,   277,   278,   279,   280,   281,
     282,   283,   284,   285,   286,   287,   288,   289,   290,   291,
     292,   293,   294,   295,   296,   297,   298,   299,   300,   301,
     302,   303,   304,   305,   306,   307,   308,   309,   310,   311
};

#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
static const yytype_int16 yyrline[] =
{
       0,   360,   360,   361,   362,   365,   366,   369,   371,   372,
     373,   374,   396,   399,   403,   408,   409,   410,   429,   430,
     440,   444,   445,   450,   455,   464,   469,   474,   479,   483,
     487,   492,   502,   511,   526,   536,   546,   552,   558,   562,
     566,   570,   581,   593,   597,   602,   609,   610,   615,   620,
     625,   630,   635,   640,   641,   646,   647,   652,   653,   661,
     662,   663,   664,   665,   666,   667,   682,   681,   685,   686,
     689,   694,   693,   697,   696,   700,   704,   703,   708,   707,
     711,   710,   714,   720,   725,   724,   727,   729,   728,   733,
     732,   737,   736,   740,   753,   767,   766,   770,   771,   772,
     772,   773,   774,   775,   777,   776,   779,   785,   787,   786,
     792,   796,   798,   800,   806,   808,   811,   814,   819,   820,
     821,   822,   824,   826,   828,   832,   834,   836,   840,   844,
     856,   859,   860,   862,   864,   866,   868,   869,   870,   874,
     878,   882,   888,   894,   900,   906,   910,   914,   922,   924,
     926,   928,   930,   932,   934,   936,   938,   940,   942,   943,
     944,   945,   946,   947,   953,   954,   958,   975,   985,   986,
     987,  1000,  1012,  1016,  1019,  1020,  1029,  1030,  1039,  1043,
    1051,  1052,  1054,  1055,  1056,  1057,  1058,  1059,  1060,  1061,
    1062,  1063,  1064,  1065,  1066,  1067,  1068,  1069,  1070,  1071,
    1076,  1081,  1082,  1083,  1084,  1085,  1086,  1087,  1089,  1090,
    1091,  1092,  1095,  1096,  1099,  1100,  1104,  1116,  1117,  1119,
    1120,  1121,  1122,  1123,  1124,  1125,  1126,  1128,  1129,  1131,
    1132,  1133,  1134,  1135,  1136,  1141,  1142,  1144,  1145,  1146,
    1147,  1148,  1153,  1154,  1156,  1157,  1158,  1159,  1160,  1161,
    1166,  1167,  1170,  1173,  1176,  1179,  1180,  1181,  1184,  1185,
    1189,  1193,  1204,  1215,  1216,  1217,  1218,  1219,  1222,  1227,
    1228,  1230,  1231,  1232,  1233,  1236,  1245,  1246,  1248,  1249,
    1250,  1251,  1252,  1253,  1254,  1255,  1256,  1257,  1258,  1259,
    1260,  1261,  1262,  1263,  1264,  1265,  1266,  1267,  1268,  1269,
    1270,  1271,  1272,  1274,  1279,  1280,  1282,  1283,  1284,  1285,
    1286,  1292,  1297,  1302,  1308,  1313,  1318,  1323,  1328,  1333,
    1338,  1343,  1345,  1350,  1351,  1353,  1354,  1354,  1355,  1356,
    1357,  1358,  1361,  1364,  1365,  1368,  1368,  1369,  1369,  1370,
    1370,  1371,  1371,  1372,  1372,  1373,  1373,  1374,  1374,  1377,
    1378,  1381,  1382,  1383,  1384,  1385,  1386,  1387,  1388,  1389,
    1390,  1391,  1392,  1393,  1394,  1395,  1396,  1397,  1406,  1407,
    1409,  1410,  1411,  1412,  1414,  1419,  1420,  1422,  1424,  1436,
    1437,  1438,  1439,  1440,  1441,  1442,  1443,  1444,  1446,  1451,
    1452,  1454,  1455,  1456,  1457,  1458,  1459,  1461,  1466,  1472,
    1475,  1476,  1478,  1479,  1480,  1481,  1482,  1483,  1484,  1485,
    1486,  1487,  1488,  1489,  1490,  1491,  1497,  1503,  1511,  1518,
    1525,  1532,  1534,  1541,  1543,  1548,  1549,  1551,  1558,  1564,
    1574,  1584,  1585,  1586,  1587,  1588,  1589,  1590,  1591,  1592,
    1595,  1598,  1599,  1601,  1603,  1605,  1607,  1609,  1610,  1613,
    1618,  1619,  1621,  1622,  1623,  1624,  1625,  1626,  1627,  1628,
    1631,  1636,  1637,  1639,  1644,  1649,  1654,  1668,  1672,  1676,
    1679,  1684,  1685,  1687,  1693,  1699,  1706,  1713,  1716,  1721,
    1724,  1727,  1735,  1744,  1745,  1746,  1747,  1749,  1754,  1755,
    1756,  1757,  1758,  1759,  1761,  1764,  1765,  1768,  1769
};
#endif

/** Accessing symbol of state STATE.  */
#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])

#if YYDEBUG || 0
/* The user-facing name of the symbol whose (internal) number is
   YYSYMBOL.  No bounds checking.  */
static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;

/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
static const char *const yytname[] =
{
  "\"end of file\"", "error", "\"invalid token\"", "INTEGER", "L_OFF",
  "L_ON", "L_AUTO", "L_YES", "L_NO", "CHIPSET_TYPE", "KEYB_LAYOUT", "REAL",
  "STRING", "VARIABLE", "EXPRTEST", "INTCAST", "REALCAST", "AND_OP",
  "OR_OP", "XOR_OP", "SHR_OP", "SHL_OP", "NOT_OP", "EQ_OP", "GE_OP",
  "LE_OP", "'='", "'<'", "'>'", "NEQ_OP", "STR_EQ_OP", "STR_NEQ_OP",
  "L_AND_OP", "L_OR_OP", "'+'", "'-'", "'*'", "'/'", "UMINUS", "UPLUS",
  "BIT_NOT_OP", "STRLEN", "STRTOL", "STRNCMP", "STRCAT", "STRPBRK",
  "STRSPLIT", "STRCHR", "STRRCHR", "STRSTR", "STRDEL", "STRSPN", "STRCSPN",
  "SHELL", "DEFINED", "DEFINE", "UNDEF", "IFSTATEMENT", "WHILESTATEMENT",
  "FOREACHSTATEMENT", "ENTER_USER_SPACE", "LEAVE_USER_SPACE",
  "CHECKUSERVAR", "DOSBANNER", "FASTFLOPPY", "HOGTHRESH", "SPEAKER",
  "IPXSUPPORT", "IPXNETWORK", "NOVELLHACK", "ETHDEV", "TAPDEV",
  "VDESWITCH", "SLIRPARGS", "VNET", "DEBUG", "MOUSE", "SERIAL", "COM",
  "KEYBOARD", "TERMINAL", "VIDEO", "EMURETRACE", "TIMER", "MATHCO", "CPU",
  "CPUSPEED", "RDTSC", "BOOTA", "BOOTB", "BOOTC", "L_XMS", "L_DPMI",
  "DPMI_BASE", "PM_DOS_API", "NO_NULL_CHECKS", "PORTS", "DISK", "DOSMEM",
  "EXT_MEM", "L_EMS", "L_UMB", "EMS_SIZE", "EMS_FRAME", "EMS_UMA_PAGES",
  "EMS_CONV_PAGES", "TTYLOCKS", "L_SOUND", "L_SND_OSS", "L_JOYSTICK",
  "FULL_FILE_LOCKS", "DEXE", "ALLOWDISK", "FORCEXDOS", "XDOSONLY", "ABORT",
  "WARN", "BOOTDISK", "L_FLOPPY", "EMUSYS", "EMUINI", "L_X", "DOSEMUMAP",
  "LOGBUFSIZE", "LOGFILESIZE", "MAPPINGDRIVER", "LFN_SUPPORT", "EMULATED",
  "NATIVE", "CPUEMU", "VM86", "FULL", "VM86SIM", "FULLSIM", "RAWKEYBOARD",
  "PRESTROKE", "KEYTABLE", "SHIFT_MAP", "ALT_MAP", "NUMPAD_MAP", "DUMP",
  "DGRAVE", "DACUTE", "DCIRCUM", "DTILDE", "DBREVE", "DABOVED", "DDIARES",
  "DABOVER", "DDACUTE", "DCEDILLA", "DIOTA", "DOGONEK", "DCARON",
  "NETWORK", "PKTDRIVER", "DIRECTORY", "NAMESTUB", "BINARY", "BASE", "IRQ",
  "DEVICE", "CHARSET", "BAUDRATE", "VIRTUAL", "PSEUDO", "RTSCTS", "LOWLAT",
  "PCCOM", "MICROSOFT", "MS3BUTTON", "LOGITECH", "MMSERIES", "MOUSEMAN",
  "HITACHI", "MOUSESYSTEMS", "BUSMOUSE", "PS2", "IMPS2", "INTERNALDRIVER",
  "EMULATE3BUTTONS", "CLEARDTR", "L_DISPLAY", "L_TITLE",
  "X_TITLE_SHOW_APPNAME", "ICON_NAME", "X_KEYCODE", "X_BLINKRATE",
  "X_SHARECMAP", "X_MITSHM", "X_FONT", "X_FIXED_ASPECT", "X_ASPECT_43",
  "X_LIN_FILT", "X_BILIN_FILT", "X_MODE13FACT", "X_WINSIZE", "X_GAMMA",
  "X_FULLSCREEN", "VGAEMU_MEMSIZE", "VESAMODE", "X_LFB", "X_PM_INTERFACE",
  "X_MGRAB_KEY", "X_BACKGROUND_PAUSE", "VGA", "MGA", "CGA", "EGA", "NONE",
  "CONSOLE", "GRAPHICS", "CHIPSET", "FULLREST", "PARTREST", "MEMSIZE",
  "VBIOS_SIZE_TOK", "VBIOS_SEG", "VGAEMUBIOS_FILE", "VBIOS_FILE",
  "VBIOS_COPY", "VBIOS_MMAP", "DUALMON", "VBIOS_POST", "FORCE_VT_SWITCH",
  "PCI", "UPDATEFREQ", "UPDATELINES", "COLOR", "ESCCHAR", "XTERM_TITLE",
  "IO", "PORT", "CONFIG", "READ", "WRITE", "KEYB", "PRINTER", "WARNING",
  "GENERAL", "HARDWARE", "L_IPC", "SOUND", "TRACE", "CLEAR", "LPT",
  "COMMAND", "TIMEOUT", "L_FILE", "L_PARTITION", "BOOTFILE", "WHOLEDISK",
  "THREEINCH", "THREEINCH_720", "THREEINCH_2880", "FIVEINCH",
  "FIVEINCH_360", "ATAPI", "READONLY", "LAYOUT", "SECTORS", "CYLINDERS",
  "TRACKS", "HEADS", "OFFSET", "HDIMAGE", "DISKCYL4096", "RDONLY",
  "WRONLY", "RDWR", "ORMASK", "ANDMASK", "RANGE", "FAST", "SLOW",
  "SILLYINT", "USE_SIGIO", "HARDWARE_RAM", "SB_BASE", "SB_IRQ", "SB_DMA",
  "SB_HDMA", "SB_MIXER", "SB_DSP", "MPU_BASE", "SOUND_DRIVER",
  "OSS_MIN_FRAGS", "OSS_MAX_FRAGS", "OSS_STALLED_FRAGS", "OSS_DO_POST",
  "OSS_MIN_EXTRA_FRAGS", "OSS_DAC_FREQ", "CDROM", "ASPI", "DEVICETYPE",
  "TARGET", "FEATURE", "JOYSTICK", "JOY_DEVICE", "JOY_DOS_MIN",
  "JOY_DOS_MAX", "JOY_GRANULARITY", "JOY_LATENCY", "CLI_TIMEOUT",
  "PIC_WATCHDOG", "TIMEMODE", "UNICODE", "SHIFT_ALT_MAP", "CTRL_MAP",
  "CTRL_ALT_MAP", "INTERNAL", "EXTERNAL", "';'", "'{'", "'}'", "'('",
  "')'", "','", "$accept", "lines", "optdelim", "line", "$@1", "$@2",
  "$@3", "$@4", "$@5", "$@6", "$@7", "$@8", "$@9", "$@10", "$@11", "$@12",
  "$@13", "$@14", "expression", "real_expression", "typed_expr",
  "int_expr", "bool_expr", "real_expr", "variable_content",
  "string_unquoted", "string_expr", "strarglist", "strarglist_item",
  "check_user_var_list", "x_flags", "x_flag", "dexeflags", "dexeflag",
  "sound_flags", "sound_flag", "snd_oss_flags", "snd_oss_flag",
  "joystick_flags", "joystick_flag", "video_flags", "video_flag",
  "term_flags", "term_flag", "debug_flags", "debug_flag", "mouse_flags",
  "mouse_flag", "keyboard_flags", "keyboard_flag", "$@15", "keyboard_mods",
  "keyboard_mod", "$@16", "$@17", "$@18", "$@19", "$@20", "$@21", "$@22",
  "keyboard_modvals", "keyboard_modval", "ttylocks_flags", "ttylocks_flag",
  "serial_flags", "serial_flag", "printer_flags", "printer_flag",
  "optbootfile", "disk_flags", "disk_flag", "port_flags", "port_flag",
  "trace_port_flags", "trace_port_flag", "sillyint_flags", "sillyint_flag",
  "ems_flags", "ems_flag", "hardware_ram_flags", "hardware_ram_flag",
  "bool", "floppy_bool", "int_bool", "irq_bool", "speaker", "cpuemu",
  "charset_flags", "charset_flag", YY_NULLPTR
};

static const char *
yysymbol_name (yysymbol_kind_t yysymbol)
{
  return yytname[yysymbol];
}
#endif

#define YYPACT_NINF (-780)

#define yypact_value_is_default(Yyn) \
  ((Yyn) == YYPACT_NINF)

#define YYTABLE_NINF (-327)

#define yytable_value_is_error(Yyn) \
  0

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
static const yytype_int16 yypact[] =
{
    2676,  -780,  -780,    30,  1960,  -276,    47,    47,  -242,    77,
      81,  -780,  -780,    65,  1960,  1960,  1960,    93,  1960,  1960,
    1960,   149,   149,   149,   149,   149,    69,  -780,  -780,  -780,
    -224,  -780,  1960,  1960,  1960,  1397,  2012,  1960,  -780,  -780,
    -780,  1960,  1960,  1960,  1960,  -780,  -780,  1960,  1960,  1790,
    1960,  -214,  1960,  -207,  1842,  1960,  -197,    69,    69,  -780,
    -780,   136,   144,  -195,   149,  1960,  1960,   149,  1960,   302,
     149,    13,  1960,  -193,  1960,   149,  -780,    56,  1960,  -780,
    -158,  -155,  -153,  1960,  1960,   149,  1480,  -780,    69,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,    32,  -780,  -177,  -141,
    1960,  1960,  1960,  1960,  -139,  -137,  -134,  -132,  -130,  -128,
    -119,  -117,  -109,  -107,  -104,   -90,   -88,   -70,  1960,   775,
    -780,  -780,  -780,    55,  -780,    78,    69,  -780,  -780,  -780,
    1960,   -64,   -61,  -780,   -60,  -780,   775,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  1960,   -52,  -780,
     -49,  -780,   -39,   -37,   -34,    76,   -33,  -780,  -780,  -780,
    -780,  -780,   279,  -780,   775,  -780,  -780,  -780,  -780,  -780,
     -29,    -2,  -780,  -780,    42,  -780,  -780,    90,    17,  -780,
     130,  -175,  -780,  -780,   -81,   -49,   -49,    22,    27,   149,
    -780,   149,  -780,  2893,  -780,  -780,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,   149,
    -780,  -293,  -780,  -780,    28,    35,    40,  -780,  -780,    41,
     149,   149,  1960,  -780,  -780,  -780,  -780,  -780,  2418,  -780,
     -49,  1960,  1960,   577,  -780,  -780,  -780,   149,   149,   149,
      69,   149,   149,   149,   149,   149,   149,   149,   149,    69,
      47,   961,  1960,  1960,  1960,  1960,  1960,  1960,  1960,  1960,
    1960,  1960,  1960,  1960,  1960,  1960,  1960,  1960,  1960,   149,
     149,  -166,    -9,     1,   318,   325,  1004,  2777,    69,   505,
     414,     3,  -780,  -780,  1960,  1960,  1960,    49,  -780,  2402,
    -780,    54,  2672,  -780,  -780,  -780,  1960,  1960,  1960,  1960,
    1960,    37,  -780,  -780,  -780,   149,   149,  -780,   142,  -780,
     249,  1960,  1960,  1960,  1960,  1960,  1960,   190,  -780,   149,
    1960,  1960,  1960,  1960,   184,  -780,  -780,  -780,  -780,  -100,
    -780,  2672,  2672,    44,    45,   149,   149,  1960,   149,  1960,
    1960,  -780,  1960,   149,  1960,  -780,  -780,  -780,  1960,  2066,
    1960,  1960,  1960,  2129,  1960,  1960,   149,  1960,  1960,  1960,
    2801,  -780,    53,  -780,   348,   358,  -263,  -780,     4,    71,
      92,   109,    61,    82,   352,  -780,  -780,  1212,  1266,    64,
      66,    62,  -144,    68,    70,    88,    91,    94,    97,   108,
     110,  -125,    67,  -780,   577,   577,   577,   577,   577,   478,
     478,   478,   478,   478,   478,    96,    96,   180,   180,  -780,
    -780,  -780,  -780,  -780,  -780,  1960,    73,  -780,  -780,  -780,
    -780,  -780,  1960,  1960,  1960,  1960,  1960,  1960,  1960,  1960,
    1960,  1960,  1960,  1960,  1960,  1960,  1960,  1960,  1960,  1960,
    1960,  1960,  1960,  1960,  1960,   462,  -780,  -780,  -780,  -780,
     149,  1960,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,    63,  -780,  -780,  -780,  -780,
    1960,  1960,  1960,   149,  -780,  -780,  -780,  -780,  -780,    99,
    -780,  -780,  -780,  1960,    36,    75,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,   400,
     422,   420,  -780,  -780,  1960,  1960,  1960,   149,   149,  -780,
    -780,  -780,  -780,  -780,  -780,   523,  -780,  -780,  -780,  -780,
     149,  -780,  -780,  -780,  1960,  1960,  2181,  -780,  -780,  1960,
      18,  -780,  -780,  -780,   149,   149,   149,   149,   149,   418,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  1960,  1960,  1960,
    1960,  1960,   149,  -780,   754,  -780,  -780,  -780,  -780,  -780,
     120,  -780,  -780,  -780,  -780,  -780,  -780,  1960,  1960,  1960,
    1960,   149,   149,  1960,   149,   159,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,   886,   960,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,   442,   133,
    -780,  -780,  -780,   444,   134,  -780,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  1684,  -780,  -780,  -780,  -780,  -780,  -780,
    1960,  1960,   149,  1960,   149,    25,  -780,  -780,  -780,  -780,
    -780,  2236,  1960,    57,  -780,  -780,  -780,  -780,  2288,  1896,
    1960,    89,  -780,  -780,  -780,  -780,  2342,  1960,    95,  -780,
    -780,   149,  1960,  -780,  -780,  -780,  -780,   149,  -780,   149,
    1960,   149,   149,   149,  1960,   149,   149,  -780,  -780,   137,
     149,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,   139,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,   451,   145,   148,  -780,  -780,
    -780,  -780,   210,  -780,     5,   210,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  1960,   458,
    1960,  1960,  1960,  1960,  1960,  1960,  1960,   439,  1455,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,   467,   154,   171,
    -780,  -780,   472,   176,  2405,  -780,   178,  -780,  -780,   492,
     182,   181,  -780,  -780,   205,   191,   199,   192,   201,   203,
     204,   209,   219,   221,   224,  -780,   225,   194,  -780,  1960,
    -780,   149,  -780,   210,  -780,  -780,  -780,  -780,   232,   524,
     525,   526,   529,   530,   531,  -780,  -780,  -780,  -780,  1960,
    -780,  -780,  1960,   555,   243,  -780,  -780,  1960,  -780,  1960,
    -780,  1960,  -780,  1960,  -780,  -780,  -780,  1960,  -780,  -780,
      69,  1684,  -780,  -780,  -780,  1960,  -780,  -780,  -780,  -780,
    -780,  -780,   443,  -780,  -780,  -780,  1960,  -780,   247,   252,
     253,   255,   -94,  1614,  -780,   443,   443,   443,   443,   443,
     443,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  1960,  -780,   246,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,   246,   246,   246,
     246,   246,   246,   256,   443,  -780,  -780
};

/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
   Performed when YYTABLE does not specify something else to do.  Zero
   means the default is an error.  */
static const yytype_int16 yydefact[] =
{
       0,   115,   114,     0,     0,     0,     0,     0,     0,     0,
       0,    15,    16,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,    71,    73,    76,    78,
       0,    66,     0,     0,     0,     0,     0,     0,    38,    40,
      39,     0,     0,     0,     0,    84,    87,     0,     0,     0,
       0,     0,    99,     0,     0,     0,     0,     0,     0,    89,
      91,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,    95,     0,   104,   108,
       0,     0,     0,     0,     0,     0,     0,     2,     0,   131,
     162,   161,   136,   159,   160,   164,   147,   166,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,    19,
     118,   119,   120,   129,   168,     0,     0,   167,     9,    10,
       0,     0,     0,   178,    18,   479,   116,    44,   480,    30,
       8,   487,   483,   486,   485,   484,    65,    56,   481,    57,
      63,   173,    59,    60,    61,    62,    64,     0,     0,   176,
      70,   174,     0,     0,     0,     0,     0,    45,    41,    55,
      32,    31,   131,    34,   117,    36,    49,    50,    51,    52,
       0,     0,    53,    54,     0,    47,    48,     0,     0,    98,
       0,     0,   102,    28,     0,    20,    21,     0,     0,     0,
      22,     0,    26,     0,    24,    42,    43,    25,    29,   494,
     488,   493,   489,   490,   491,   492,    33,    82,    80,     0,
      58,     0,    37,    68,     0,     0,     0,   482,   106,     0,
       0,     0,     0,   111,   112,   113,     1,     5,     0,     3,
      17,     0,     0,   158,   126,   125,   135,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,   275,   274,     0,     0,     0,     0,   269,     0,
      35,     0,     0,   470,   463,   469,     0,     0,     0,     0,
       0,     0,   461,   374,   373,     0,     0,   372,     0,   368,
       0,     0,     0,     0,     0,     0,     0,     0,   227,     0,
       0,     0,     0,     0,     0,   235,   214,   215,   216,     0,
     212,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,   190,   191,     0,     0,   195,   196,   197,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,   180,     0,    83,     0,     0,     0,   495,     0,     0,
       0,     0,     0,     0,     0,     6,     4,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,   130,   132,   133,   134,   127,   128,   148,
     150,   151,   152,   153,   149,   154,   155,   121,   122,   123,
     124,   156,   157,    14,    11,     0,     0,   179,   177,   303,
     279,   302,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   276,   175,   322,   321,
       0,     0,   311,   312,   315,   314,   318,   319,   313,   320,
     316,   317,   307,   308,   310,     0,   304,   388,   387,   386,
       0,     0,     0,     0,   378,   379,   380,   381,   382,     0,
     375,   332,   331,     0,     0,     0,   323,   272,   273,   271,
      69,   270,   268,   267,   244,   245,   246,   247,   248,   253,
     251,     0,   255,   256,     0,     0,     0,     0,     0,   259,
     260,   264,   263,   265,   266,     0,   242,   440,   427,   439,
       0,   431,   432,   433,     0,     0,     0,   436,   437,     0,
       0,   425,   424,   423,     0,     0,     0,     0,     0,     0,
     403,   405,   404,   407,   408,   406,   402,     0,     0,     0,
       0,     0,     0,   409,     0,   400,   465,   466,   467,   468,
       0,    46,   462,   370,   371,    75,   369,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   217,   229,   230,   231,
     232,   233,   234,   101,   228,   237,   238,   239,   240,   241,
     103,   236,   107,   213,     0,     0,    23,    27,   184,   185,
     186,   187,   188,   189,   192,   193,   194,   198,   131,     0,
     201,   202,   203,   131,     0,   208,   209,   210,   211,   183,
     182,    97,   181,     0,   497,   498,     7,   496,   397,   396,
       0,     0,     0,     0,     0,     0,   389,   449,   443,   448,
     447,     0,     0,     0,   441,   460,   452,   459,     0,     0,
       0,     0,   450,   478,   473,   477,     0,     0,     0,   471,
      93,     0,     0,   137,   165,   139,   138,     0,   169,     0,
       0,     0,     0,     0,     0,     0,     0,   172,   163,     0,
       0,   294,   280,   286,   278,   292,   293,   282,   297,   299,
     298,   288,   289,   281,   283,   284,   285,   287,   290,   291,
     295,   296,   300,   301,    72,   277,   306,   309,    74,   305,
     383,   384,   385,   377,    77,   376,   330,   329,   328,   325,
      79,   324,   254,   252,   249,   250,   262,   261,   258,   257,
      67,   243,   438,   434,   435,   131,     0,     0,    85,   426,
     419,   422,   399,   416,   399,   399,   410,   411,   412,   413,
     414,   417,    88,   401,   464,   219,   222,   220,   221,   223,
     224,   225,   226,   100,   218,    90,    92,   199,     0,   204,
       0,     0,     0,     0,     0,     0,     0,     0,     0,   333,
     395,   391,   392,   393,   394,    96,   390,   131,     0,     0,
      86,   442,   131,     0,     0,   454,     0,   105,   451,   131,
       0,     0,   109,   472,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,    12,     0,     0,   429,     0,
     428,     0,   415,   399,   421,   418,   200,   205,   206,     0,
       0,     0,     0,     0,     0,   341,    81,   334,   445,     0,
     444,   455,     0,   131,     0,   453,   475,     0,   474,     0,
     110,     0,   141,     0,   142,   143,   144,     0,   145,   146,
       0,     0,   430,   398,   420,     0,   343,   345,   347,   337,
     335,   339,     0,   446,   456,   457,     0,   476,     0,     0,
       0,     0,     0,     0,   207,     0,     0,     0,     0,     0,
       0,   365,   352,   353,   354,   355,   356,   357,   358,   359,
     360,   361,   362,   363,   364,   351,     0,   367,   342,   349,
     458,    94,   140,   170,   171,    13,   327,   344,   346,   348,
     338,   336,   340,     0,     0,   366,   350
};

/* YYPGOTO[NTERM-NUM].  */
static const yytype_int16 yypgoto[] =
{
    -780,  -780,  -780,   -79,  -780,  -780,  -780,  -780,  -780,  -780,
    -780,  -780,  -780,  -780,  -780,  -780,  -780,  -780,   -13,  -780,
    2784,  -780,  -780,  -780,   143,    -6,   844,   -47,   288,  -780,
    -780,   207,  -780,   258,  -780,    14,  -780,   271,  -780,   273,
    -780,    83,  -780,   320,  -780,   160,  -780,   146,  -780,   123,
    -780,  -252,  -779,  -780,  -780,  -780,  -780,  -780,  -780,  -780,
    -264,  -312,  -780,   305,  -780,   135,  -780,   -20,  -730,  -112,
    -537,  -780,   100,  -780,   -24,  -780,   -19,  -780,   326,  -780,
     -27,   903,  -780,    87,  -780,  -780,  -780,  -780,   267
};

/* YYDEFGOTO[NTERM-NUM].  */
static const yytype_int16 yydefgoto[] =
{
       0,    86,   238,    87,   166,   158,   162,   163,   164,   372,
     180,   181,   197,   198,   224,   188,   226,   229,   135,   173,
     136,   120,   121,   122,   123,   124,   125,   160,   161,   134,
     370,   371,   339,   340,   585,   586,   327,   328,   334,   335,
     525,   526,   297,   298,   455,   456,   475,   476,   495,   496,
     827,   788,   789,   899,   898,   900,   882,   895,   896,   897,
     918,   919,   318,   319,   489,   490,   645,   646,   832,   564,
     565,   540,   541,   653,   654,   661,   662,   311,   312,   668,
     669,   137,   139,   149,   228,   146,   216,   376,   377
};

/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
   positive, shift that token.  If negative, reduce the rule whose
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
static const yytype_int16 yytable[] =
{
     128,   129,   138,   140,   491,   638,   148,   239,   833,   847,
     195,   196,   336,   337,   338,   492,   639,   374,   375,   527,
     168,   528,   171,   218,   834,   835,   638,   763,   148,   148,
     529,   336,   337,   338,   148,   148,   148,   639,   303,   126,
     304,   240,   727,   303,   728,   304,   729,   374,   375,   305,
     292,   636,   205,   206,   305,   527,    88,   528,   647,   127,
     648,   293,  -167,  -167,   458,   227,   529,   763,   763,   649,
     148,   148,   647,   130,   648,   459,   491,   292,   133,   281,
     131,   127,    97,   649,   132,  -173,  -173,   492,   293,   165,
     655,   313,   656,   655,   141,   656,   663,   142,   664,   187,
     477,   657,   314,   874,   657,   143,   190,   665,   279,   280,
     663,   478,   664,   107,   847,   109,   194,   282,   203,   113,
     221,   665,   116,   329,   330,   331,   332,   333,   176,   177,
     275,   276,   277,   278,   182,   183,   185,   493,   241,   306,
     307,   308,   309,   313,   306,   307,   308,   309,   127,    97,
     423,   288,   225,   219,   314,   230,   127,    97,   231,   386,
     232,   127,    97,   640,   151,   151,   151,   151,   151,   151,
     233,   234,   678,   288,   242,   479,   247,   480,   248,   530,
     107,   249,   109,   250,   640,   251,   113,   252,   107,   116,
     109,   687,   288,   107,   113,   109,   253,   116,   254,   113,
     151,   151,   116,   392,   151,   151,   255,   151,   256,   493,
     151,   257,   401,   151,   602,   530,   277,   278,   151,   384,
     144,   145,   925,   288,   460,   258,   461,   259,   151,   604,
     605,   151,   462,   463,   464,   465,   466,   467,   468,   469,
     470,   471,   472,   473,   474,   260,   315,   316,   317,   641,
     642,   643,   644,   283,   402,   831,   284,   285,   481,   482,
     483,   287,   494,   484,   485,   486,   487,   488,   288,   151,
     641,   642,   643,   644,   289,   294,   290,   295,   296,   291,
     299,   497,   300,   499,   301,   531,   532,   533,   534,   535,
     536,   537,   538,   566,   567,   568,   569,   570,   315,   316,
     317,   650,   294,   209,   295,   296,   210,   424,   587,   588,
     589,   302,   591,   592,   211,   650,   425,   596,   597,   598,
     599,   531,   532,   533,   534,   535,   536,   537,   538,   651,
     320,   426,   748,   539,   494,   341,   612,   613,   427,   795,
     342,   378,   151,   651,   151,   617,   619,   620,   379,   622,
     624,   571,   310,   380,   381,   629,   630,   310,   606,   607,
     634,   658,   151,   500,   658,   659,   633,   666,   659,   539,
     635,   800,   652,   151,   151,   670,   671,   718,   672,   677,
     675,   666,   676,   688,   157,   679,   652,   680,   690,   730,
     151,   151,   151,   151,   151,   151,   151,   151,   151,   151,
     151,   151,   151,   807,   660,   681,   732,   660,   682,   812,
     667,   683,   689,   724,   684,   477,   321,   322,   323,   324,
     325,   326,   151,   151,   667,   685,   478,   686,   733,   734,
     755,   151,   212,   213,   214,   215,   764,   577,   578,   579,
     580,   581,   582,   583,   584,   777,   901,   779,   717,   199,
     778,   780,  -326,   825,   828,   127,   575,   201,   151,   151,
     831,   837,   829,   429,   830,   845,   430,   720,   721,   722,
     848,   849,   151,   773,   431,   851,   321,   322,   323,   324,
     325,   326,   329,   330,   331,   332,   333,   850,   151,   151,
     479,   151,   480,   852,   855,   856,   151,   858,   600,   857,
     859,   735,   736,   737,   593,   860,   458,   871,   862,   151,
     273,   274,   275,   276,   277,   278,   861,   459,   863,   864,
     865,   743,   744,   746,   502,   866,   747,   577,   578,   579,
     580,   581,   582,   583,   584,   503,   867,   868,   432,   433,
     869,   434,   870,   435,   756,   757,   758,   759,   760,   875,
     876,   877,   878,   436,   437,   879,   880,   881,   885,   438,
     886,   921,   439,   934,   765,   766,   767,   768,   922,   923,
     771,   924,   935,   481,   482,   483,   457,   632,   484,   485,
     486,   487,   488,   440,   902,   903,   904,   905,   906,   907,
     908,   909,   910,   911,   912,   913,   914,   603,   594,   774,
     267,   268,   269,   151,   270,   271,   272,   601,   741,   273,
     274,   275,   276,   277,   278,   715,   441,   501,   731,   893,
     787,   719,   936,   576,   725,   796,   151,   790,   791,   801,
     793,   927,   928,   929,   930,   931,   932,   572,   798,   799,
     749,   813,   808,   637,     0,   803,   805,   806,     0,     0,
       0,     0,     0,   810,   811,     0,     0,     0,     0,   815,
     151,   151,     0,     0,     0,     0,   460,   818,   461,     0,
       0,   822,     0,   151,   462,   463,   464,   465,   466,   467,
     468,   469,   470,   471,   472,   473,   474,   151,   151,   151,
     151,   151,     0,   442,   443,   444,   445,   446,   447,   448,
     449,   450,   451,   452,   453,   151,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,   151,   151,     0,   151,   504,   505,
     506,   507,   508,   509,   510,   511,   512,   513,   514,   515,
     516,   517,   518,   519,   520,   521,   522,   523,   524,   915,
       0,     0,     0,     0,     0,   542,     0,     0,   916,   454,
       0,     0,     0,     0,     0,   836,   543,   838,   839,   840,
     841,   842,   843,   844,     0,   787,   714,     0,     0,     0,
       0,     0,     0,     0,     0,   151,     0,   151,     0,     0,
       0,   854,   262,   263,   264,   265,   266,     0,   267,   268,
     269,     0,   270,   271,   272,     0,     0,   273,   274,   275,
     276,   277,   278,     0,   151,     0,   872,     0,     0,     0,
     151,     0,   151,   892,   151,   151,   151,     0,   151,   151,
       0,     0,     0,   151,     0,     0,   883,   740,     0,   884,
       0,     0,     0,     0,   887,     0,   888,     0,   889,     0,
     890,     0,     0,     0,   891,     0,     0,     0,   787,     0,
       0,     0,   894,     0,     0,   152,   153,   154,   155,   156,
     159,     0,   544,   920,     0,     0,   917,     0,     0,     0,
     787,     0,     0,     0,     0,     0,     0,   542,     0,   917,
     917,   917,   917,   917,   917,     0,     0,     0,   543,     0,
       0,   159,   159,   933,     0,   200,   202,     0,   204,     0,
     545,   207,     0,     0,   217,   546,     0,     0,     0,   223,
       0,   147,     0,   150,     0,     0,     0,     0,   917,   235,
       0,     0,   159,     0,     0,   167,     0,   169,     0,     0,
     175,     0,     0,     0,     0,     0,   178,   179,     0,     0,
       0,     0,     0,   186,     0,   189,     0,   192,   193,     0,
       0,   542,     0,     0,     0,     0,     0,     0,     0,     0,
     159,   208,   543,     0,   151,   220,     0,   222,   262,   263,
     264,   265,   266,     0,   267,   268,   269,     0,   270,   271,
     272,     0,     0,   273,   274,   275,   276,   277,   278,     0,
       0,     0,   547,   548,   544,   549,   550,   551,   552,   553,
     554,   555,   556,   151,   557,   558,   559,   560,   561,   562,
     563,   262,   263,   264,   265,   266,     0,   267,   268,   269,
       0,   270,   271,   272,     0,     0,   273,   274,   275,   276,
     277,   278,   545,   343,     0,   344,     0,   546,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,   373,     0,     0,     0,     0,   762,     0,
       0,     0,     0,     0,   382,   383,     0,     0,   544,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,   389,   390,   391,   159,   393,   394,   395,   396,   397,
     398,   399,   400,   159,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   545,     0,     0,     0,
       0,   546,     0,   421,   422,     0,     0,     0,     0,     0,
       0,     0,   159,     0,   547,   548,     0,   549,   550,   551,
     552,   553,   554,   555,   556,     0,   557,   558,   559,   560,
     561,   562,   563,     0,     0,     0,     0,     0,     0,   573,
     574,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,   595,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,   608,
     609,     0,   611,     0,     0,     0,     0,   615,   498,     0,
     775,     0,     0,     0,     0,     0,     0,     0,   547,   548,
     627,   549,   550,   551,   552,   553,   554,   555,   556,     0,
     557,   558,   559,   560,   561,   562,   563,   590,     0,   262,
     263,   264,   265,   266,     0,   267,   268,   269,     0,   270,
     271,   272,     0,     0,   273,   274,   275,   276,   277,   278,
     610,     0,     0,     0,     0,   614,     0,   616,     0,     0,
       0,     0,     0,     0,   621,     0,     0,   625,   626,     0,
     628,     0,     0,     0,   776,     0,     0,   403,     0,     0,
       0,     0,     0,   262,   263,   264,   265,   266,     0,   267,
     268,   269,     0,   270,   271,   272,     0,     0,   273,   274,
     275,   276,   277,   278,   716,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     428,     0,     0,     0,     0,     0,     0,   723,     0,     0,
       0,     0,     0,     0,     0,   691,   692,   693,   694,   695,
     696,   697,   698,   699,   700,   701,   702,   703,   704,   705,
     706,   707,   708,   709,   710,   711,   712,   713,     0,     0,
       0,   738,   739,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,   742,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,   750,   751,
     752,   753,   754,     0,     0,     0,   726,     0,     0,     0,
      89,    90,    91,    92,    93,    94,   761,     0,    95,    96,
      97,     0,    98,    99,     0,     0,     0,     0,     0,   100,
       0,     0,     0,     0,     0,   769,   770,     0,   772,     0,
       0,   101,   102,     0,     0,     0,     0,   103,   104,   105,
     106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
     116,   117,     0,     0,     0,     0,     0,     0,    89,    90,
      91,    92,    93,    94,     0,     0,    95,    96,    97,     0,
      98,    99,     0,     0,     0,     0,     0,   100,     0,     0,
     236,     1,     0,     0,     0,     0,   792,     0,   794,   101,
     102,     0,     2,     3,     4,   103,   104,   105,   106,   107,
     108,   109,   110,   111,   112,   113,   114,   115,   116,   117,
       0,     0,     0,     0,     0,   814,     0,     0,     0,     0,
       0,   816,     0,   817,   170,   819,   820,   821,   673,   823,
     824,     0,     0,     5,   826,     6,     7,     8,     9,    10,
      11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
      21,    22,    23,    24,    25,    26,    27,    28,     0,    29,
      30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
      40,     0,    41,    42,    43,    44,    45,    46,    47,    48,
      49,    50,   674,     0,     0,     0,    51,    52,    53,    54,
      55,    56,   781,   782,   783,    57,    58,    59,    60,    61,
      62,    63,    64,    65,    66,    67,    68,     0,     0,    69,
       0,     0,     0,     0,     0,    70,    71,    89,    90,    91,
      92,    93,    94,     0,     0,    95,    96,    97,     0,    98,
      99,     0,     0,     0,     0,    72,   100,     0,     0,     0,
       0,     0,    73,     0,     0,     0,     0,     0,   101,   102,
       0,     0,     0,     0,   103,   104,   105,   106,   107,   108,
     109,   110,   111,   112,   113,   114,   115,   116,   117,     0,
       0,     0,     0,     0,     0,   873,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,    89,    90,    91,
      92,    93,    94,     0,     0,    95,    96,    97,     0,    98,
      99,     0,     0,     0,     0,    74,   100,     0,     0,     0,
      75,     0,   118,     0,   159,     0,     0,    76,   101,   102,
       0,     0,     0,    77,   103,   104,   105,   106,   107,   108,
     109,   110,   111,   112,   113,   114,   115,   116,   117,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,   781,   782,   783,     0,    78,     0,    79,     0,     0,
       0,     0,   784,   785,   786,     0,     0,     0,     0,   846,
     118,     0,    80,    81,     0,     0,    82,     0,     0,     0,
       0,     0,     0,    83,    84,    85,     0,     0,     0,     0,
       0,     0,   237,    89,    90,    91,    92,    93,    94,     0,
       0,    95,    96,    97,     0,    98,    99,     0,     0,     0,
       0,     0,   100,     0,     0,     0,     0,     0,     0,     0,
       0,   781,   782,   783,   101,   102,     0,     0,     0,     0,
     103,   104,   105,   106,   107,   108,   109,   110,   111,   112,
     113,   114,   115,   116,   117,    89,    90,    91,    92,    93,
      94,     0,     0,    95,    96,    97,     0,    98,    99,     0,
       0,     0,     0,     0,   100,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   101,   102,     0,     0,
       0,     0,   103,   104,   105,   106,   107,   108,   109,   110,
     111,   112,   113,   114,   115,   116,   117,     0,     0,    89,
      90,    91,    92,    93,    94,     0,     0,    95,    96,    97,
       0,    98,    99,     0,     0,     0,     0,     0,   100,     0,
       0,   784,   785,   786,     0,     0,     0,     0,   926,   118,
     101,   102,     0,     0,     0,     0,   103,   104,   105,   106,
     107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
     117,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,    89,    90,    91,    92,    93,    94,     0,
       0,    95,    96,    97,     0,    98,    99,     0,     0,     0,
       0,     0,   100,     0,     0,     0,     0,     0,     0,     0,
       0,   784,   785,   786,   101,   102,     0,     0,     0,   118,
     103,   104,   105,   106,   107,   108,   109,   110,   111,   112,
     113,   114,   115,   116,   117,   172,    90,    91,    92,    93,
      94,     0,     0,    95,    96,    97,     0,    98,    99,     0,
       0,     0,     0,     0,   100,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   101,   102,     0,     0,
       0,     0,   103,   104,   105,   106,   107,   108,   109,   110,
     111,   112,   113,   114,   115,   116,   117,     0,     0,   618,
      90,    91,    92,    93,    94,     0,     0,    95,    96,    97,
       0,    98,    99,     0,     0,     0,     0,     0,   100,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     101,   102,     0,   184,     0,   118,   103,   104,   105,   106,
     107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
     117,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,   623,    90,    91,    92,    93,    94,     0,     0,
      95,    96,    97,     0,    98,    99,     0,     0,     0,     0,
       0,   100,     0,     0,     0,   191,     0,   118,     0,     0,
       0,     0,     0,   101,   102,     0,     0,     0,   804,   103,
     104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
     114,   115,   116,   117,   745,    90,    91,    92,    93,    94,
       0,     0,    95,    96,    97,     0,    98,    99,     0,     0,
       0,     0,     0,   100,     0,     0,     0,     0,     0,     0,
       0,   118,     0,     0,     0,   101,   102,     0,     0,     0,
       0,   103,   104,   105,   106,   107,   108,   109,   110,   111,
     112,   113,   114,   115,   116,   117,     0,     0,     0,   797,
      90,    91,    92,    93,    94,     0,     0,    95,    96,    97,
       0,    98,    99,     0,     0,     0,     0,     0,   100,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     101,   102,     0,     0,     0,   118,   103,   104,   105,   106,
     107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
     117,   802,    90,    91,    92,    93,    94,     0,     0,    95,
      96,    97,     0,    98,    99,     0,     0,     0,     0,     0,
     100,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,   101,   102,     0,     0,     0,   118,   103,   104,
     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
     115,   116,   117,     0,     0,   809,    90,    91,    92,    93,
      94,     0,     0,    95,    96,    97,     0,    98,    99,     0,
       0,     0,     0,     0,   100,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   101,   102,     0,     0,
       0,   118,   103,   104,   105,   106,   107,   108,   109,   110,
     111,   112,   113,   114,   115,   116,   117,     0,     0,     0,
       0,     0,     0,   502,     0,     0,     0,     0,   853,    90,
      91,    92,    93,    94,   503,     0,    95,    96,    97,     1,
      98,    99,     0,     0,     0,     0,     0,   100,     0,     0,
       2,     3,     4,     0,     0,     0,     0,     0,     0,   101,
     102,     0,     0,     0,   118,   103,   104,   105,   106,   107,
     108,   109,   110,   111,   112,   113,   114,   115,   116,   117,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     5,     0,     6,     7,     8,     9,    10,    11,    12,
      13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
      23,    24,    25,    26,    27,    28,   118,    29,    30,    31,
      32,    33,    34,    35,    36,    37,    38,    39,    40,     0,
      41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
       0,     0,     0,     0,    51,    52,    53,    54,    55,    56,
       0,     0,     0,    57,    58,    59,    60,    61,    62,    63,
      64,    65,    66,    67,    68,     0,     0,    69,     0,     0,
       0,   118,     0,    70,    71,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,    72,     0,     0,     0,     0,     0,     0,
      73,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,   118,     0,     0,     0,   504,   505,   506,
     507,   508,   509,   510,   511,   512,   513,   514,   515,   516,
     517,   518,   519,   520,   521,   522,   523,   524,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,    74,     0,     0,     0,     0,    75,     0,
       0,     0,     0,     0,     0,    76,     0,   118,     0,     0,
       0,    77,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,   542,     0,     0,     0,     1,     0,     0,
       0,     0,     0,     0,   543,     0,     0,     0,     2,     3,
       4,     0,     0,    78,     0,    79,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
      80,    81,     0,     0,    82,     0,     0,     0,     0,     0,
     118,    83,    84,    85,     0,     0,     0,     0,     0,     5,
     385,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
      25,    26,    27,    28,     0,    29,    30,    31,    32,    33,
      34,    35,    36,    37,    38,    39,    40,     0,    41,    42,
      43,    44,    45,    46,    47,    48,    49,    50,   429,     0,
       0,   430,    51,    52,    53,    54,    55,    56,   119,   431,
     544,    57,    58,    59,    60,    61,    62,    63,    64,    65,
      66,    67,    68,     0,     0,    69,     0,     0,     0,     0,
       0,    70,    71,     0,     0,     0,     0,     0,     0,     0,
     174,     0,     0,     0,     0,     0,     0,     0,   545,     0,
       0,    72,     0,   546,     0,     0,     0,     0,    73,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,   432,   433,     0,   434,     0,   435,     0,
       0,     0,     0,     0,     0,     0,     0,     0,   436,   437,
       0,     0,     0,     0,   438,     0,     0,   439,     0,     0,
       0,     0,     0,     0,   243,   244,   245,   246,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,   440,     0,
       0,    74,   261,     0,     0,     0,    75,     0,     0,     0,
       0,     0,     0,    76,     0,     0,     0,     0,     0,    77,
     547,   548,     0,   549,   550,   551,   552,   553,   554,   555,
     556,   441,   557,   558,   559,   560,   561,   562,   563,     0,
       0,   286,     0,     0,     0,     0,     0,     0,     0,     0,
       0,    78,     0,    79,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,    80,    81,
       0,     0,    82,     0,     0,     0,     0,     0,     0,    83,
      84,    85,     0,   345,   346,   347,   348,   349,   350,   351,
     352,   353,   354,   355,   356,   357,   358,   359,   360,   361,
     362,   363,   364,   365,   366,   367,     0,     0,   442,   443,
     444,   445,   446,   447,   448,   449,   450,   451,   452,   453,
       0,     0,     0,     0,     0,   387,   388,   368,   369,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   404,   405,   406,   407,
     408,   409,   410,   411,   412,   413,   414,   415,   416,   417,
     418,   419,   420,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,   454,   345,   346,   347,   348,   349,
     350,   351,   352,   353,   354,   355,   356,   357,   358,   359,
     360,   361,   362,   363,   364,   365,   366,   367,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,   631,     0,     0,     0,   368,
     369
};

static const yytype_int16 yycheck[] =
{
       6,     7,    15,    16,     1,     1,    19,    86,     3,   788,
      57,    58,   112,   113,   114,    12,    12,   310,   311,     1,
      33,     3,    35,    10,   754,   755,     1,   564,    41,    42,
      12,   112,   113,   114,    47,    48,    49,    12,     1,   315,
       3,    88,     6,     1,     8,     3,    10,   310,   311,    12,
       1,   314,    65,    66,    12,     1,    26,     3,     1,    12,
       3,    12,    30,    31,     1,    78,    12,   604,   605,    12,
      83,    84,     1,   315,     3,    12,     1,     1,    13,   126,
       3,    12,    13,    12,     3,    30,    31,    12,    12,   313,
       1,     1,     3,     1,     1,     3,     1,     4,     3,   313,
       1,    12,    12,   833,    12,    12,   313,    12,    30,    31,
       1,    12,     3,    44,   893,    46,   313,   130,   313,    50,
     313,    12,    53,   298,   299,   300,   301,   302,    41,    42,
      34,    35,    36,    37,    47,    48,    49,   134,   315,   102,
     103,   104,   105,     1,   102,   103,   104,   105,    12,    13,
     316,   317,    96,   140,    12,   313,    12,    13,   313,   238,
     313,    12,    13,   159,    21,    22,    23,    24,    25,    26,
      83,    84,   316,   317,   315,    76,   315,    78,   315,   161,
      44,   315,    46,   315,   159,   315,    50,   315,    44,    53,
      46,   316,   317,    44,    50,    46,   315,    53,   315,    50,
      57,    58,    53,   250,    61,    62,   315,    64,   315,   134,
      67,   315,   259,    70,   314,   161,    36,    37,    75,   232,
     127,   128,   316,   317,   161,   315,   163,   315,    85,   341,
     342,    88,   169,   170,   171,   172,   173,   174,   175,   176,
     177,   178,   179,   180,   181,   315,   156,   157,   158,   245,
     246,   247,   248,   317,   260,   250,   317,   317,   159,   160,
     161,   313,   259,   164,   165,   166,   167,   168,   317,   126,
     245,   246,   247,   248,   313,   226,   313,   228,   229,   313,
     313,   294,     3,   296,   313,   267,   268,   269,   270,   271,
     272,   273,   274,   306,   307,   308,   309,   310,   156,   157,
     158,   244,   226,     1,   228,   229,     4,   316,   321,   322,
     323,   313,   325,   326,    12,   244,   315,   330,   331,   332,
     333,   267,   268,   269,   270,   271,   272,   273,   274,   272,
     313,    13,   314,   315,   259,   313,   349,   350,    13,   314,
     313,   313,   199,   272,   201,   358,   359,   360,   313,   362,
     363,   314,   315,   313,   313,   368,   369,   315,   314,   314,
      12,   272,   219,   314,   272,   276,   313,   272,   276,   315,
      12,   314,   315,   230,   231,   314,   294,   314,    26,   317,
     316,   272,   316,   316,   315,   317,   315,   317,   315,   314,
     247,   248,   249,   250,   251,   252,   253,   254,   255,   256,
     257,   258,   259,   314,   315,   317,     6,   315,   317,   314,
     315,   317,   425,   314,   317,     1,   286,   287,   288,   289,
     290,   291,   279,   280,   315,   317,    12,   317,     6,     9,
      12,   288,   130,   131,   132,   133,   316,   278,   279,   280,
     281,   282,   283,   284,   285,     3,     3,     3,   461,   313,
     317,   317,   313,   316,     3,    12,   314,   313,   315,   316,
     250,     3,   317,     1,   316,    26,     4,   480,   481,   482,
       3,   317,   329,   314,    12,     3,   286,   287,   288,   289,
     290,   291,   298,   299,   300,   301,   302,   316,   345,   346,
      76,   348,    78,   317,   316,     3,   353,   316,   314,   317,
     295,   514,   515,   516,   314,   314,     1,   313,   316,   366,
      32,    33,    34,    35,    36,    37,   317,    12,   317,   316,
     316,   534,   535,   536,     1,   316,   539,   278,   279,   280,
     281,   282,   283,   284,   285,    12,   317,   316,    76,    77,
     316,    79,   317,    81,   557,   558,   559,   560,   561,   317,
      26,    26,    26,    91,    92,    26,    26,    26,     3,    97,
     317,   314,   100,   317,   577,   578,   579,   580,   316,   316,
     583,   316,   316,   159,   160,   161,   288,   370,   164,   165,
     166,   167,   168,   121,   141,   142,   143,   144,   145,   146,
     147,   148,   149,   150,   151,   152,   153,   339,   327,   585,
      23,    24,    25,   460,    27,    28,    29,   334,   525,    32,
      33,    34,    35,    36,    37,   455,   154,   297,   495,   871,
     633,   475,   934,   318,   489,   645,   483,   640,   641,   653,
     643,   895,   896,   897,   898,   899,   900,   311,   651,   652,
     540,   668,   661,   376,    -1,   658,   659,   660,    -1,    -1,
      -1,    -1,    -1,   666,   667,    -1,    -1,    -1,    -1,   672,
     517,   518,    -1,    -1,    -1,    -1,   161,   680,   163,    -1,
      -1,   684,    -1,   530,   169,   170,   171,   172,   173,   174,
     175,   176,   177,   178,   179,   180,   181,   544,   545,   546,
     547,   548,    -1,   231,   232,   233,   234,   235,   236,   237,
     238,   239,   240,   241,   242,   562,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   581,   582,    -1,   584,   205,   206,
     207,   208,   209,   210,   211,   212,   213,   214,   215,   216,
     217,   218,   219,   220,   221,   222,   223,   224,   225,   306,
      -1,    -1,    -1,    -1,    -1,     1,    -1,    -1,   315,   297,
      -1,    -1,    -1,    -1,    -1,   778,    12,   780,   781,   782,
     783,   784,   785,   786,    -1,   788,   314,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   642,    -1,   644,    -1,    -1,
      -1,   804,    17,    18,    19,    20,    21,    -1,    23,    24,
      25,    -1,    27,    28,    29,    -1,    -1,    32,    33,    34,
      35,    36,    37,    -1,   671,    -1,   829,    -1,    -1,    -1,
     677,    -1,   679,   870,   681,   682,   683,    -1,   685,   686,
      -1,    -1,    -1,   690,    -1,    -1,   849,   314,    -1,   852,
      -1,    -1,    -1,    -1,   857,    -1,   859,    -1,   861,    -1,
     863,    -1,    -1,    -1,   867,    -1,    -1,    -1,   871,    -1,
      -1,    -1,   875,    -1,    -1,    21,    22,    23,    24,    25,
      26,    -1,   118,   886,    -1,    -1,   882,    -1,    -1,    -1,
     893,    -1,    -1,    -1,    -1,    -1,    -1,     1,    -1,   895,
     896,   897,   898,   899,   900,    -1,    -1,    -1,    12,    -1,
      -1,    57,    58,   916,    -1,    61,    62,    -1,    64,    -1,
     156,    67,    -1,    -1,    70,   161,    -1,    -1,    -1,    75,
      -1,    18,    -1,    20,    -1,    -1,    -1,    -1,   934,    85,
      -1,    -1,    88,    -1,    -1,    32,    -1,    34,    -1,    -1,
      37,    -1,    -1,    -1,    -1,    -1,    43,    44,    -1,    -1,
      -1,    -1,    -1,    50,    -1,    52,    -1,    54,    55,    -1,
      -1,     1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
     126,    68,    12,    -1,   831,    72,    -1,    74,    17,    18,
      19,    20,    21,    -1,    23,    24,    25,    -1,    27,    28,
      29,    -1,    -1,    32,    33,    34,    35,    36,    37,    -1,
      -1,    -1,   248,   249,   118,   251,   252,   253,   254,   255,
     256,   257,   258,   870,   260,   261,   262,   263,   264,   265,
     266,    17,    18,    19,    20,    21,    -1,    23,    24,    25,
      -1,    27,    28,    29,    -1,    -1,    32,    33,    34,    35,
      36,    37,   156,   199,    -1,   201,    -1,   161,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   219,    -1,    -1,    -1,    -1,   314,    -1,
      -1,    -1,    -1,    -1,   230,   231,    -1,    -1,   118,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,   247,   248,   249,   250,   251,   252,   253,   254,   255,
     256,   257,   258,   259,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,   156,    -1,    -1,    -1,
      -1,   161,    -1,   279,   280,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,   288,    -1,   248,   249,    -1,   251,   252,   253,
     254,   255,   256,   257,   258,    -1,   260,   261,   262,   263,
     264,   265,   266,    -1,    -1,    -1,    -1,    -1,    -1,   315,
     316,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   329,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   345,
     346,    -1,   348,    -1,    -1,    -1,    -1,   353,   295,    -1,
     314,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   248,   249,
     366,   251,   252,   253,   254,   255,   256,   257,   258,    -1,
     260,   261,   262,   263,   264,   265,   266,   324,    -1,    17,
      18,    19,    20,    21,    -1,    23,    24,    25,    -1,    27,
      28,    29,    -1,    -1,    32,    33,    34,    35,    36,    37,
     347,    -1,    -1,    -1,    -1,   352,    -1,   354,    -1,    -1,
      -1,    -1,    -1,    -1,   361,    -1,    -1,   364,   365,    -1,
     367,    -1,    -1,    -1,   314,    -1,    -1,   316,    -1,    -1,
      -1,    -1,    -1,    17,    18,    19,    20,    21,    -1,    23,
      24,    25,    -1,    27,    28,    29,    -1,    -1,    32,    33,
      34,    35,    36,    37,   460,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
     316,    -1,    -1,    -1,    -1,    -1,    -1,   483,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   432,   433,   434,   435,   436,
     437,   438,   439,   440,   441,   442,   443,   444,   445,   446,
     447,   448,   449,   450,   451,   452,   453,   454,    -1,    -1,
      -1,   517,   518,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   530,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   544,   545,
     546,   547,   548,    -1,    -1,    -1,   493,    -1,    -1,    -1,
       3,     4,     5,     6,     7,     8,   562,    -1,    11,    12,
      13,    -1,    15,    16,    -1,    -1,    -1,    -1,    -1,    22,
      -1,    -1,    -1,    -1,    -1,   581,   582,    -1,   584,    -1,
      -1,    34,    35,    -1,    -1,    -1,    -1,    40,    41,    42,
      43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
      53,    54,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,
       5,     6,     7,     8,    -1,    -1,    11,    12,    13,    -1,
      15,    16,    -1,    -1,    -1,    -1,    -1,    22,    -1,    -1,
       0,     1,    -1,    -1,    -1,    -1,   642,    -1,   644,    34,
      35,    -1,    12,    13,    14,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      -1,    -1,    -1,    -1,    -1,   671,    -1,    -1,    -1,    -1,
      -1,   677,    -1,   679,   127,   681,   682,   683,   316,   685,
     686,    -1,    -1,    53,   690,    55,    56,    57,    58,    59,
      60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,    76,    77,    -1,    79,
      80,    81,    82,    83,    84,    85,    86,    87,    88,    89,
      90,    -1,    92,    93,    94,    95,    96,    97,    98,    99,
     100,   101,   316,    -1,    -1,    -1,   106,   107,   108,   109,
     110,   111,   137,   138,   139,   115,   116,   117,   118,   119,
     120,   121,   122,   123,   124,   125,   126,    -1,    -1,   129,
      -1,    -1,    -1,    -1,    -1,   135,   136,     3,     4,     5,
       6,     7,     8,    -1,    -1,    11,    12,    13,    -1,    15,
      16,    -1,    -1,    -1,    -1,   155,    22,    -1,    -1,    -1,
      -1,    -1,   162,    -1,    -1,    -1,    -1,    -1,    34,    35,
      -1,    -1,    -1,    -1,    40,    41,    42,    43,    44,    45,
      46,    47,    48,    49,    50,    51,    52,    53,    54,    -1,
      -1,    -1,    -1,    -1,    -1,   831,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,     5,
       6,     7,     8,    -1,    -1,    11,    12,    13,    -1,    15,
      16,    -1,    -1,    -1,    -1,   225,    22,    -1,    -1,    -1,
     230,    -1,   315,    -1,   870,    -1,    -1,   237,    34,    35,
      -1,    -1,    -1,   243,    40,    41,    42,    43,    44,    45,
      46,    47,    48,    49,    50,    51,    52,    53,    54,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,   137,   138,   139,    -1,   275,    -1,   277,    -1,    -1,
      -1,    -1,   307,   308,   309,    -1,    -1,    -1,    -1,   314,
     315,    -1,   292,   293,    -1,    -1,   296,    -1,    -1,    -1,
      -1,    -1,    -1,   303,   304,   305,    -1,    -1,    -1,    -1,
      -1,    -1,   312,     3,     4,     5,     6,     7,     8,    -1,
      -1,    11,    12,    13,    -1,    15,    16,    -1,    -1,    -1,
      -1,    -1,    22,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,   137,   138,   139,    34,    35,    -1,    -1,    -1,    -1,
      40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
      50,    51,    52,    53,    54,     3,     4,     5,     6,     7,
       8,    -1,    -1,    11,    12,    13,    -1,    15,    16,    -1,
      -1,    -1,    -1,    -1,    22,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    34,    35,    -1,    -1,
      -1,    -1,    40,    41,    42,    43,    44,    45,    46,    47,
      48,    49,    50,    51,    52,    53,    54,    -1,    -1,     3,
       4,     5,     6,     7,     8,    -1,    -1,    11,    12,    13,
      -1,    15,    16,    -1,    -1,    -1,    -1,    -1,    22,    -1,
      -1,   307,   308,   309,    -1,    -1,    -1,    -1,   314,   315,
      34,    35,    -1,    -1,    -1,    -1,    40,    41,    42,    43,
      44,    45,    46,    47,    48,    49,    50,    51,    52,    53,
      54,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,     3,     4,     5,     6,     7,     8,    -1,
      -1,    11,    12,    13,    -1,    15,    16,    -1,    -1,    -1,
      -1,    -1,    22,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,   307,   308,   309,    34,    35,    -1,    -1,    -1,   315,
      40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
      50,    51,    52,    53,    54,     3,     4,     5,     6,     7,
       8,    -1,    -1,    11,    12,    13,    -1,    15,    16,    -1,
      -1,    -1,    -1,    -1,    22,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    34,    35,    -1,    -1,
      -1,    -1,    40,    41,    42,    43,    44,    45,    46,    47,
      48,    49,    50,    51,    52,    53,    54,    -1,    -1,     3,
       4,     5,     6,     7,     8,    -1,    -1,    11,    12,    13,
      -1,    15,    16,    -1,    -1,    -1,    -1,    -1,    22,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      34,    35,    -1,   313,    -1,   315,    40,    41,    42,    43,
      44,    45,    46,    47,    48,    49,    50,    51,    52,    53,
      54,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,     3,     4,     5,     6,     7,     8,    -1,    -1,
      11,    12,    13,    -1,    15,    16,    -1,    -1,    -1,    -1,
      -1,    22,    -1,    -1,    -1,   313,    -1,   315,    -1,    -1,
      -1,    -1,    -1,    34,    35,    -1,    -1,    -1,   272,    40,
      41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
      51,    52,    53,    54,     3,     4,     5,     6,     7,     8,
      -1,    -1,    11,    12,    13,    -1,    15,    16,    -1,    -1,
      -1,    -1,    -1,    22,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,   315,    -1,    -1,    -1,    34,    35,    -1,    -1,    -1,
      -1,    40,    41,    42,    43,    44,    45,    46,    47,    48,
      49,    50,    51,    52,    53,    54,    -1,    -1,    -1,     3,
       4,     5,     6,     7,     8,    -1,    -1,    11,    12,    13,
      -1,    15,    16,    -1,    -1,    -1,    -1,    -1,    22,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      34,    35,    -1,    -1,    -1,   315,    40,    41,    42,    43,
      44,    45,    46,    47,    48,    49,    50,    51,    52,    53,
      54,     3,     4,     5,     6,     7,     8,    -1,    -1,    11,
      12,    13,    -1,    15,    16,    -1,    -1,    -1,    -1,    -1,
      22,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    34,    35,    -1,    -1,    -1,   315,    40,    41,
      42,    43,    44,    45,    46,    47,    48,    49,    50,    51,
      52,    53,    54,    -1,    -1,     3,     4,     5,     6,     7,
       8,    -1,    -1,    11,    12,    13,    -1,    15,    16,    -1,
      -1,    -1,    -1,    -1,    22,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    34,    35,    -1,    -1,
      -1,   315,    40,    41,    42,    43,    44,    45,    46,    47,
      48,    49,    50,    51,    52,    53,    54,    -1,    -1,    -1,
      -1,    -1,    -1,     1,    -1,    -1,    -1,    -1,     3,     4,
       5,     6,     7,     8,    12,    -1,    11,    12,    13,     1,
      15,    16,    -1,    -1,    -1,    -1,    -1,    22,    -1,    -1,
      12,    13,    14,    -1,    -1,    -1,    -1,    -1,    -1,    34,
      35,    -1,    -1,    -1,   315,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    53,    -1,    55,    56,    57,    58,    59,    60,    61,
      62,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    76,    77,   315,    79,    80,    81,
      82,    83,    84,    85,    86,    87,    88,    89,    90,    -1,
      92,    93,    94,    95,    96,    97,    98,    99,   100,   101,
      -1,    -1,    -1,    -1,   106,   107,   108,   109,   110,   111,
      -1,    -1,    -1,   115,   116,   117,   118,   119,   120,   121,
     122,   123,   124,   125,   126,    -1,    -1,   129,    -1,    -1,
      -1,   315,    -1,   135,   136,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   155,    -1,    -1,    -1,    -1,    -1,    -1,
     162,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   315,    -1,    -1,    -1,   205,   206,   207,
     208,   209,   210,   211,   212,   213,   214,   215,   216,   217,
     218,   219,   220,   221,   222,   223,   224,   225,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   225,    -1,    -1,    -1,    -1,   230,    -1,
      -1,    -1,    -1,    -1,    -1,   237,    -1,   315,    -1,    -1,
      -1,   243,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,     1,    -1,    -1,    -1,     1,    -1,    -1,
      -1,    -1,    -1,    -1,    12,    -1,    -1,    -1,    12,    13,
      14,    -1,    -1,   275,    -1,   277,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
     292,   293,    -1,    -1,   296,    -1,    -1,    -1,    -1,    -1,
     315,   303,   304,   305,    -1,    -1,    -1,    -1,    -1,    53,
     312,    55,    56,    57,    58,    59,    60,    61,    62,    63,
      64,    65,    66,    67,    68,    69,    70,    71,    72,    73,
      74,    75,    76,    77,    -1,    79,    80,    81,    82,    83,
      84,    85,    86,    87,    88,    89,    90,    -1,    92,    93,
      94,    95,    96,    97,    98,    99,   100,   101,     1,    -1,
      -1,     4,   106,   107,   108,   109,   110,   111,     4,    12,
     118,   115,   116,   117,   118,   119,   120,   121,   122,   123,
     124,   125,   126,    -1,    -1,   129,    -1,    -1,    -1,    -1,
      -1,   135,   136,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      36,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   156,    -1,
      -1,   155,    -1,   161,    -1,    -1,    -1,    -1,   162,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    76,    77,    -1,    79,    -1,    81,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    91,    92,
      -1,    -1,    -1,    -1,    97,    -1,    -1,   100,    -1,    -1,
      -1,    -1,    -1,    -1,   100,   101,   102,   103,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   121,    -1,
      -1,   225,   118,    -1,    -1,    -1,   230,    -1,    -1,    -1,
      -1,    -1,    -1,   237,    -1,    -1,    -1,    -1,    -1,   243,
     248,   249,    -1,   251,   252,   253,   254,   255,   256,   257,
     258,   154,   260,   261,   262,   263,   264,   265,   266,    -1,
      -1,   157,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,   275,    -1,   277,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   292,   293,
      -1,    -1,   296,    -1,    -1,    -1,    -1,    -1,    -1,   303,
     304,   305,    -1,   182,   183,   184,   185,   186,   187,   188,
     189,   190,   191,   192,   193,   194,   195,   196,   197,   198,
     199,   200,   201,   202,   203,   204,    -1,    -1,   231,   232,
     233,   234,   235,   236,   237,   238,   239,   240,   241,   242,
      -1,    -1,    -1,    -1,    -1,   241,   242,   226,   227,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,   262,   263,   264,   265,
     266,   267,   268,   269,   270,   271,   272,   273,   274,   275,
     276,   277,   278,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   297,   182,   183,   184,   185,   186,
     187,   188,   189,   190,   191,   192,   193,   194,   195,   196,
     197,   198,   199,   200,   201,   202,   203,   204,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   314,    -1,    -1,    -1,   226,
     227
};

/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
   state STATE-NUM.  */
static const yytype_int16 yystos[] =
{
       0,     1,    12,    13,    14,    53,    55,    56,    57,    58,
      59,    60,    61,    62,    63,    64,    65,    66,    67,    68,
      69,    70,    71,    72,    73,    74,    75,    76,    77,    79,
      80,    81,    82,    83,    84,    85,    86,    87,    88,    89,
      90,    92,    93,    94,    95,    96,    97,    98,    99,   100,
     101,   106,   107,   108,   109,   110,   111,   115,   116,   117,
     118,   119,   120,   121,   122,   123,   124,   125,   126,   129,
     135,   136,   155,   162,   225,   230,   237,   243,   275,   277,
     292,   293,   296,   303,   304,   305,   319,   321,    26,     3,
       4,     5,     6,     7,     8,    11,    12,    13,    15,    16,
      22,    34,    35,    40,    41,    42,    43,    44,    45,    46,
      47,    48,    49,    50,    51,    52,    53,    54,   315,   338,
     339,   340,   341,   342,   343,   344,   315,    12,   343,   343,
     315,     3,     3,    13,   347,   336,   338,   399,   336,   400,
     336,     1,     4,    12,   127,   128,   403,   399,   336,   401,
     399,   342,   344,   344,   344,   344,   344,   315,   323,   344,
     345,   346,   324,   325,   326,   313,   322,   399,   336,   399,
     127,   336,     3,   337,   338,   399,   401,   401,   399,   399,
     328,   329,   401,   401,   313,   401,   399,   313,   333,   399,
     313,   313,   399,   399,   313,   345,   345,   330,   331,   313,
     344,   313,   344,   313,   344,   336,   336,   344,   399,     1,
       4,    12,   130,   131,   132,   133,   404,   344,    10,   140,
     399,   313,   399,   344,   332,    96,   334,   336,   402,   335,
     313,   313,   313,   401,   401,   344,     0,   312,   320,   321,
     345,   315,   315,   338,   338,   338,   338,   315,   315,   315,
     315,   315,   315,   315,   315,   315,   315,   315,   315,   315,
     315,   338,    17,    18,    19,    20,    21,    23,    24,    25,
      27,    28,    29,    32,    33,    34,    35,    36,    37,    30,
      31,   345,   336,   317,   317,   317,   338,   313,   317,   313,
     313,   313,     1,    12,   226,   228,   229,   360,   361,   313,
       3,   313,   313,     1,     3,    12,   102,   103,   104,   105,
     315,   395,   396,     1,    12,   156,   157,   158,   380,   381,
     313,   286,   287,   288,   289,   290,   291,   354,   355,   298,
     299,   300,   301,   302,   356,   357,   112,   113,   114,   350,
     351,   313,   313,   344,   344,   182,   183,   184,   185,   186,
     187,   188,   189,   190,   191,   192,   193,   194,   195,   196,
     197,   198,   199,   200,   201,   202,   203,   204,   226,   227,
     348,   349,   327,   344,   310,   311,   405,   406,   313,   313,
     313,   313,   344,   344,   336,   312,   321,   338,   338,   344,
     344,   344,   345,   344,   344,   344,   344,   344,   344,   344,
     344,   345,   343,   316,   338,   338,   338,   338,   338,   338,
     338,   338,   338,   338,   338,   338,   338,   338,   338,   338,
     338,   344,   344,   316,   316,   315,    13,    13,   316,     1,
       4,    12,    76,    77,    79,    81,    91,    92,    97,   100,
     121,   154,   231,   232,   233,   234,   235,   236,   237,   238,
     239,   240,   241,   242,   297,   362,   363,   346,     1,    12,
     161,   163,   169,   170,   171,   172,   173,   174,   175,   176,
     177,   178,   179,   180,   181,   364,   365,     1,    12,    76,
      78,   159,   160,   161,   164,   165,   166,   167,   168,   382,
     383,     1,    12,   134,   259,   366,   367,   336,   399,   336,
     314,   361,     1,    12,   205,   206,   207,   208,   209,   210,
     211,   212,   213,   214,   215,   216,   217,   218,   219,   220,
     221,   222,   223,   224,   225,   358,   359,     1,     3,    12,
     161,   267,   268,   269,   270,   271,   272,   273,   274,   315,
     389,   390,     1,    12,   118,   156,   161,   248,   249,   251,
     252,   253,   254,   255,   256,   257,   258,   260,   261,   262,
     263,   264,   265,   266,   387,   388,   336,   336,   336,   336,
     336,   314,   396,   344,   344,   314,   381,   278,   279,   280,
     281,   282,   283,   284,   285,   352,   353,   336,   336,   336,
     399,   336,   336,   314,   355,   344,   336,   336,   336,   336,
     314,   357,   314,   351,   387,   387,   314,   314,   344,   344,
     399,   344,   336,   336,   399,   344,   399,   336,     3,   336,
     336,   399,   336,     3,   336,   399,   399,   344,   399,   336,
     336,   314,   349,   313,    12,    12,   314,   406,     1,    12,
     159,   245,   246,   247,   248,   384,   385,     1,     3,    12,
     244,   272,   315,   391,   392,     1,     3,    12,   272,   276,
     315,   393,   394,     1,     3,    12,   272,   315,   397,   398,
     314,   294,    26,   316,   316,   316,   316,   317,   316,   317,
     317,   317,   317,   317,   317,   317,   317,   316,   316,   336,
     315,   399,   399,   399,   399,   399,   399,   399,   399,   399,
     399,   399,   399,   399,   399,   399,   399,   399,   399,   399,
     399,   399,   399,   399,   314,   363,   344,   336,   314,   365,
     336,   336,   336,   344,   314,   383,   399,     6,     8,    10,
     314,   367,     6,     6,     9,   336,   336,   336,   344,   344,
     314,   359,   344,   336,   336,     3,   336,   336,   314,   390,
     344,   344,   344,   344,   344,    12,   336,   336,   336,   336,
     336,   344,   314,   388,   316,   336,   336,   336,   336,   344,
     344,   336,   344,   314,   353,   314,   314,     3,   317,     3,
     317,   137,   138,   139,   307,   308,   309,   336,   369,   370,
     336,   336,   344,   336,   344,   314,   385,     3,   336,   336,
     314,   392,     3,   336,   272,   336,   336,   314,   394,     3,
     336,   336,   314,   398,   344,   336,   344,   344,   336,   344,
     344,   344,   336,   344,   344,   316,   344,   368,     3,   317,
     316,   250,   386,     3,   386,   386,   336,     3,   336,   336,
     336,   336,   336,   336,   336,    26,   314,   370,     3,   317,
     316,     3,   317,     3,   336,   316,     3,   317,   316,   295,
     314,   317,   316,   317,   316,   316,   316,   317,   316,   316,
     317,   313,   336,   344,   386,   317,    26,    26,    26,    26,
      26,    26,   374,   336,   336,     3,   317,   336,   336,   336,
     336,   336,   345,   369,   336,   375,   376,   377,   372,   371,
     373,     3,   141,   142,   143,   144,   145,   146,   147,   148,
     149,   150,   151,   152,   153,   306,   315,   343,   378,   379,
     336,   314,   316,   316,   316,   316,   314,   378,   378,   378,
     378,   378,   378,   336,   317,   316,   379
};

/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
static const yytype_int16 yyr1[] =
{
       0,   318,   319,   319,   319,   320,   320,   321,   321,   321,
     321,   321,   321,   321,   321,   321,   321,   321,   321,   321,
     321,   321,   321,   321,   321,   321,   321,   321,   321,   321,
     321,   321,   321,   321,   321,   321,   321,   321,   321,   321,
     321,   321,   321,   321,   321,   321,   321,   321,   321,   321,
     321,   321,   321,   321,   321,   321,   321,   321,   321,   321,
     321,   321,   321,   321,   321,   321,   322,   321,   321,   321,
     321,   323,   321,   324,   321,   321,   325,   321,   326,   321,
     327,   321,   321,   321,   328,   321,   321,   329,   321,   330,
     321,   331,   321,   321,   321,   332,   321,   321,   321,   333,
     321,   321,   321,   321,   334,   321,   321,   321,   335,   321,
     321,   321,   321,   321,   321,   321,   336,   337,   338,   338,
     338,   338,   338,   338,   338,   338,   338,   338,   338,   338,
     338,   339,   339,   339,   339,   339,   339,   339,   339,   339,
     339,   339,   339,   339,   339,   339,   339,   339,   340,   340,
     340,   340,   340,   340,   340,   340,   340,   340,   340,   340,
     340,   340,   340,   340,   341,   341,   342,   343,   344,   344,
     344,   344,   344,   344,   345,   345,   346,   346,   347,   347,
     348,   348,   349,   349,   349,   349,   349,   349,   349,   349,
     349,   349,   349,   349,   349,   349,   349,   349,   349,   349,
     349,   349,   349,   349,   349,   349,   349,   349,   349,   349,
     349,   349,   350,   350,   351,   351,   351,   352,   352,   353,
     353,   353,   353,   353,   353,   353,   353,   354,   354,   355,
     355,   355,   355,   355,   355,   356,   356,   357,   357,   357,
     357,   357,   358,   358,   359,   359,   359,   359,   359,   359,
     359,   359,   359,   359,   359,   359,   359,   359,   359,   359,
     359,   359,   359,   359,   359,   359,   359,   359,   359,   360,
     360,   361,   361,   361,   361,   361,   362,   362,   363,   363,
     363,   363,   363,   363,   363,   363,   363,   363,   363,   363,
     363,   363,   363,   363,   363,   363,   363,   363,   363,   363,
     363,   363,   363,   363,   364,   364,   365,   365,   365,   365,
     365,   365,   365,   365,   365,   365,   365,   365,   365,   365,
     365,   365,   365,   366,   366,   367,   368,   367,   367,   367,
     367,   367,   367,   369,   369,   371,   370,   372,   370,   373,
     370,   374,   370,   375,   370,   376,   370,   377,   370,   378,
     378,   379,   379,   379,   379,   379,   379,   379,   379,   379,
     379,   379,   379,   379,   379,   379,   379,   379,   380,   380,
     381,   381,   381,   381,   381,   382,   382,   383,   383,   383,
     383,   383,   383,   383,   383,   383,   383,   383,   383,   384,
     384,   385,   385,   385,   385,   385,   385,   385,   386,   386,
     387,   387,   388,   388,   388,   388,   388,   388,   388,   388,
     388,   388,   388,   388,   388,   388,   388,   388,   388,   388,
     388,   388,   388,   388,   388,   389,   389,   390,   390,   390,
     390,   390,   390,   390,   390,   390,   390,   390,   390,   390,
     390,   391,   391,   392,   392,   392,   392,   392,   392,   392,
     393,   393,   394,   394,   394,   394,   394,   394,   394,   394,
     394,   395,   395,   396,   396,   396,   396,   396,   396,   396,
     396,   397,   397,   398,   398,   398,   398,   398,   398,   399,
     400,   401,   402,   403,   403,   403,   403,   403,   404,   404,
     404,   404,   404,   404,   404,   405,   405,   406,   406
};

/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
static const yytype_int8 yyr2[] =
{
       0,     2,     1,     2,     3,     1,     2,     4,     2,     2,
       2,     4,     6,     9,     4,     1,     1,     3,     2,     2,
       2,     2,     2,     4,     2,     2,     2,     4,     2,     2,
       2,     2,     2,     2,     2,     3,     2,     2,     1,     1,
       1,     2,     2,     2,     2,     2,     4,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     0,     5,     2,     4,
       2,     0,     5,     0,     5,     4,     0,     5,     0,     5,
       0,     6,     2,     3,     0,     5,     5,     0,     5,     0,
       5,     0,     5,     4,     8,     0,     5,     4,     2,     0,
       5,     4,     2,     4,     0,     5,     2,     4,     0,     5,
       6,     2,     2,     2,     1,     1,     1,     1,     1,     1,
       1,     3,     3,     3,     3,     2,     2,     3,     3,     1,
       3,     1,     3,     3,     3,     2,     1,     4,     4,     4,
       8,     6,     6,     6,     6,     6,     6,     1,     3,     3,
       3,     3,     3,     3,     3,     3,     3,     3,     2,     1,
       1,     1,     1,     4,     1,     4,     1,     1,     1,     4,
       8,     8,     4,     1,     1,     3,     1,     3,     1,     3,
       1,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       1,     1,     2,     2,     2,     1,     1,     1,     2,     3,
       4,     2,     2,     2,     3,     4,     4,     6,     2,     2,
       2,     2,     1,     2,     1,     1,     1,     1,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     1,     2,     2,
       2,     2,     2,     2,     2,     1,     2,     2,     2,     2,
       2,     2,     1,     2,     1,     1,     1,     1,     1,     2,
       2,     1,     2,     1,     2,     1,     1,     2,     2,     1,
       1,     2,     2,     1,     1,     1,     1,     1,     1,     1,
       2,     2,     2,     2,     1,     1,     1,     2,     2,     1,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     1,     1,     1,     2,     2,     1,     1,     2,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     2,     2,     0,     6,     2,     2,
       2,     1,     1,     1,     2,     0,     5,     0,     5,     0,
       5,     0,     4,     0,     5,     0,     5,     0,     5,     1,
       3,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     3,     1,     1,     2,
       2,     2,     1,     1,     1,     1,     2,     2,     1,     1,
       1,     1,     1,     2,     2,     2,     1,     1,     1,     1,
       2,     2,     2,     2,     2,     2,     1,     1,     2,     0,
       1,     2,     1,     1,     1,     1,     1,     1,     1,     1,
       2,     2,     2,     2,     2,     3,     2,     2,     3,     2,
       4,     3,     2,     1,     1,     1,     2,     1,     3,     3,
       4,     1,     1,     1,     2,     2,     1,     1,     2,     1,
       1,     1,     2,     1,     3,     3,     4,     1,     1,     1,
       1,     2,     1,     3,     2,     3,     4,     4,     5,     1,
       1,     1,     2,     1,     3,     2,     2,     2,     2,     1,
       1,     1,     2,     1,     3,     3,     4,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     2,     2,     2
};


enum { YYENOMEM = -2 };

#define yyerrok         (yyerrstatus = 0)
#define yyclearin       (yychar = YYEMPTY)

#define YYACCEPT        goto yyacceptlab
#define YYABORT         goto yyabortlab
#define YYERROR         goto yyerrorlab
#define YYNOMEM         goto yyexhaustedlab


#define YYRECOVERING()  (!!yyerrstatus)

#define YYBACKUP(Token, Value)                                    \
  do                                                              \
    if (yychar == YYEMPTY)                                        \
      {                                                           \
        yychar = (Token);                                         \
        yylval = (Value);                                         \
        YYPOPSTACK (yylen);                                       \
        yystate = *yyssp;                                         \
        goto yybackup;                                            \
      }                                                           \
    else                                                          \
      {                                                           \
        yyerror (YY_("syntax error: cannot back up")); \
        YYERROR;                                                  \
      }                                                           \
  while (0)

/* Backward compatibility with an undocumented macro.
   Use YYerror or YYUNDEF. */
#define YYERRCODE YYUNDEF


/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)                        \
do {                                            \
  if (yydebug)                                  \
    YYFPRINTF Args;                             \
} while (0)




# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
do {                                                                      \
  if (yydebug)                                                            \
    {                                                                     \
      YYFPRINTF (stderr, "%s ", Title);                                   \
      yy_symbol_print (stderr,                                            \
                  Kind, Value); \
      YYFPRINTF (stderr, "\n");                                           \
    }                                                                     \
} while (0)


/*-----------------------------------.
| Print this symbol's value on YYO.  |
`-----------------------------------*/

static void
yy_symbol_value_print (FILE *yyo,
                       yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
  FILE *yyoutput = yyo;
  YY_USE (yyoutput);
  if (!yyvaluep)
    return;
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  YY_USE (yykind);
  YY_IGNORE_MAYBE_UNINITIALIZED_END
}


/*---------------------------.
| Print this symbol on YYO.  |
`---------------------------*/

static void
yy_symbol_print (FILE *yyo,
                 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
  YYFPRINTF (yyo, "%s %s (",
             yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));

  yy_symbol_value_print (yyo, yykind, yyvaluep);
  YYFPRINTF (yyo, ")");
}

/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included).                                                   |
`------------------------------------------------------------------*/

static void
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
  YYFPRINTF (stderr, "Stack now");
  for (; yybottom <= yytop; yybottom++)
    {
      int yybot = *yybottom;
      YYFPRINTF (stderr, " %d", yybot);
    }
  YYFPRINTF (stderr, "\n");
}

# define YY_STACK_PRINT(Bottom, Top)                            \
do {                                                            \
  if (yydebug)                                                  \
    yy_stack_print ((Bottom), (Top));                           \
} while (0)


/*------------------------------------------------.
| Report that the YYRULE is going to be reduced.  |
`------------------------------------------------*/

static void
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
                 int yyrule)
{
  int yylno = yyrline[yyrule];
  int yynrhs = yyr2[yyrule];
  int yyi;
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
             yyrule - 1, yylno);
  /* The symbols being reduced.  */
  for (yyi = 0; yyi < yynrhs; yyi++)
    {
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
      yy_symbol_print (stderr,
                       YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
                       &yyvsp[(yyi + 1) - (yynrhs)]);
      YYFPRINTF (stderr, "\n");
    }
}

# define YY_REDUCE_PRINT(Rule)          \
do {                                    \
  if (yydebug)                          \
    yy_reduce_print (yyssp, yyvsp, Rule); \
} while (0)

/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args) ((void) 0)
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */


/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif

/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).

   Do not make this value too large; the results are undefined if
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif






/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

static void
yydestruct (const char *yymsg,
            yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
{
  YY_USE (yyvaluep);
  if (!yymsg)
    yymsg = "Deleting";
  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  YY_USE (yykind);
  YY_IGNORE_MAYBE_UNINITIALIZED_END
}






/*----------.
| yyparse.  |
`----------*/

int
yyparse (void)
{
/* Lookahead token kind.  */
int yychar;


/* The semantic value of the lookahead symbol.  */
/* Default value used for initialization, for pacifying older GCCs
   or non-GCC compilers.  */
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);

    /* Number of syntax errors so far.  */
    int yynerrs = 0;

    yy_state_fast_t yystate = 0;
    /* Number of tokens to shift before error messages enabled.  */
    int yyerrstatus = 0;

    /* Refer to the stacks through separate pointers, to allow yyoverflow
       to reallocate them elsewhere.  */

    /* Their size.  */
    YYPTRDIFF_T yystacksize = YYINITDEPTH;

    /* The state stack: array, bottom, top.  */
    yy_state_t yyssa[YYINITDEPTH];
    yy_state_t *yyss = yyssa;
    yy_state_t *yyssp = yyss;

    /* The semantic value stack: array, bottom, top.  */
    YYSTYPE yyvsa[YYINITDEPTH];
    YYSTYPE *yyvs = yyvsa;
    YYSTYPE *yyvsp = yyvs;

  int yyn;
  /* The return value of yyparse.  */
  int yyresult;
  /* Lookahead symbol kind.  */
  yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;



#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))

  /* The number of symbols on the RHS of the reduced rule.
     Keep to zero when no symbol should be popped.  */
  int yylen = 0;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yychar = YYEMPTY; /* Cause a token to be read.  */

  goto yysetstate;


/*------------------------------------------------------------.
| yynewstate -- push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed.  So pushing a state here evens the stacks.  */
  yyssp++;


/*--------------------------------------------------------------------.
| yysetstate -- set current state (the top of the stack) to yystate.  |
`--------------------------------------------------------------------*/
yysetstate:
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
  YY_IGNORE_USELESS_CAST_BEGIN
  *yyssp = YY_CAST (yy_state_t, yystate);
  YY_IGNORE_USELESS_CAST_END
  YY_STACK_PRINT (yyss, yyssp);

  if (yyss + yystacksize - 1 <= yyssp)
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
    YYNOMEM;
#else
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYPTRDIFF_T yysize = yyssp - yyss + 1;

# if defined yyoverflow
      {
        /* Give user a chance to reallocate the stack.  Use copies of
           these so that the &'s don't force the real ones into
           memory.  */
        yy_state_t *yyss1 = yyss;
        YYSTYPE *yyvs1 = yyvs;

        /* Each stack pointer address is followed by the size of the
           data in use in that stack, in bytes.  This used to be a
           conditional around just the two extra args, but that might
           be undefined if yyoverflow is a macro.  */
        yyoverflow (YY_("memory exhausted"),
                    &yyss1, yysize * YYSIZEOF (*yyssp),
                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
                    &yystacksize);
        yyss = yyss1;
        yyvs = yyvs1;
      }
# else /* defined YYSTACK_RELOCATE */
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
        YYNOMEM;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
        yystacksize = YYMAXDEPTH;

      {
        yy_state_t *yyss1 = yyss;
        union yyalloc *yyptr =
          YY_CAST (union yyalloc *,
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
        if (! yyptr)
          YYNOMEM;
        YYSTACK_RELOCATE (yyss_alloc, yyss);
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
#  undef YYSTACK_RELOCATE
        if (yyss1 != yyssa)
          YYSTACK_FREE (yyss1);
      }
# endif

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;

      YY_IGNORE_USELESS_CAST_BEGIN
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
                  YY_CAST (long, yystacksize)));
      YY_IGNORE_USELESS_CAST_END

      if (yyss + yystacksize - 1 <= yyssp)
        YYABORT;
    }
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */


  if (yystate == YYFINAL)
    YYACCEPT;

  goto yybackup;


/*-----------.
| yybackup.  |
`-----------*/
yybackup:
  /* Do appropriate processing given the current state.  Read a
     lookahead token if we need one and don't already have one.  */

  /* First try to decide what to do without reference to lookahead token.  */
  yyn = yypact[yystate];
  if (yypact_value_is_default (yyn))
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token\n"));
      yychar = yylex (&yylval);
    }

  if (yychar <= YYEOF)
    {
      yychar = YYEOF;
      yytoken = YYSYMBOL_YYEOF;
      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else if (yychar == YYerror)
    {
      /* The scanner already issued an error message, process directly
         to error recovery.  But do not keep the error token as
         lookahead, it is too special and may lead us to an endless
         loop in error recovery. */
      yychar = YYUNDEF;
      yytoken = YYSYMBOL_YYerror;
      goto yyerrlab1;
    }
  else
    {
      yytoken = YYTRANSLATE (yychar);
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    }

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yytable_value_is_error (yyn))
        goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  /* Shift the lookahead token.  */
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  yystate = yyn;
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END

  /* Discard the shifted token.  */
  yychar = YYEMPTY;
  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     '$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];


  YY_REDUCE_PRINT (yyn);
  switch (yyn)
    {
  case 7: /* line: CHARSET '{' charset_flags '}'  */
#line 369 "parser.y"
                                              {}
#line 2800 "parser.c"
    break;

  case 8: /* line: HOGTHRESH expression  */
#line 371 "parser.y"
                                        { config.hogthreshold = (yyvsp[0].i_value); }
#line 2806 "parser.c"
    break;

  case 9: /* line: DEFINE string_unquoted  */
#line 372 "parser.y"
                                        { IFCLASS(CL_VAR){ define_config_variable((yyvsp[0].s_value));} free((yyvsp[0].s_value)); }
#line 2812 "parser.c"
    break;

  case 10: /* line: UNDEF string_unquoted  */
#line 373 "parser.y"
                                        { IFCLASS(CL_VAR){ undefine_config_variable((yyvsp[0].s_value));} free((yyvsp[0].s_value)); }
#line 2818 "parser.c"
    break;

  case 11: /* line: IFSTATEMENT '(' expression ')'  */
#line 374 "parser.y"
                                                 {
			/* NOTE:
			 * We _need_ absolutely to return to state stack 0
			 * because we 'backward' modify the input stream for
			 * the parser (in lexer). Hence, _if_ the parser needs
			 * to read one token more than needed, we are lost,
			 * because we can't discard it. So please, don't
			 * play with the grammar without knowing what you do.
			 * The ')' _will_ return to state stack 0, but fiddling
			 * with brackets '()' in the underlaying 'expression'
			 * rules may distroy this.
			 *                          -- Hans 971231
			 */
			tell_lexer_if((yyvsp[-1].i_value));
		}
#line 2838 "parser.c"
    break;

  case 12: /* line: WHILESTATEMENT INTEGER ',' '(' expression ')'  */
#line 396 "parser.y"
                                                                {
			tell_lexer_loop((yyvsp[-4].i_value), (yyvsp[-1].i_value));
		}
#line 2846 "parser.c"
    break;

  case 13: /* line: FOREACHSTATEMENT INTEGER ',' VARIABLE '(' string_expr ',' strarglist ')'  */
#line 399 "parser.y"
                                                                                           {
			tell_lexer_loop((yyvsp[-7].i_value), for_each_handling((yyvsp[-7].i_value),(yyvsp[-5].s_value),(yyvsp[-3].s_value),(yyvsp[-1].s_value)));
			free((yyvsp[-5].s_value)); free((yyvsp[-3].s_value)); free((yyvsp[-1].s_value));
		}
#line 2855 "parser.c"
    break;

  case 14: /* line: SHELL '(' strarglist ')'  */
#line 403 "parser.y"
                                           {
			char *s = run_shell((yyvsp[-1].s_value));
			if (s) free(s);
			free((yyvsp[-1].s_value));
		}
#line 2865 "parser.c"
    break;

  case 15: /* line: ENTER_USER_SPACE  */
#line 408 "parser.y"
                                   { enter_user_scope((yyvsp[0].i_value)); }
#line 2871 "parser.c"
    break;

  case 16: /* line: LEAVE_USER_SPACE  */
#line 409 "parser.y"
                                   { leave_user_scope((yyvsp[0].i_value)); }
#line 2877 "parser.c"
    break;

  case 17: /* line: VARIABLE '=' strarglist  */
#line 410 "parser.y"
                                          {
		    if (!parser_version_3_style_used) {
			parser_version_3_style_used = 1;
			define_config_variable(CONFNAME_V3USED);
		    }
		    if ((strpbrk((yyvsp[-2].s_value), "uhc") == (yyvsp[-2].s_value)) && ((yyvsp[-2].s_value)[1] == '_'))
			yyerror("reserved variable %s can't be set\n", (yyvsp[-2].s_value));
		    else {
			if (user_scope_level) {
			    char *s = malloc(strlen((yyvsp[-2].s_value))+sizeof(USERVAR_PREF));
			    strcpy(s, USERVAR_PREF);
			    strcat(s,(yyvsp[-2].s_value));
			    setenv(s, (yyvsp[0].s_value), 1);
			    free(s);
			}
			else IFCLASS(CL_VAR) setenv((yyvsp[-2].s_value), (yyvsp[0].s_value), 1);
		    }
		    free((yyvsp[-2].s_value)); free((yyvsp[0].s_value));
		}
#line 2901 "parser.c"
    break;

  case 19: /* line: EXPRTEST typed_expr  */
#line 430 "parser.y"
                                      {
		    if ((yyvsp[0].t_value).type == TYPE_REAL)
			c_printf("CONF TESTING: exprtest real %f\n", (yyvsp[0].t_value).value.r);
		    else
			c_printf("CONF TESTING: exprtest int %d\n", (yyvsp[0].t_value).value.i);
		}
#line 2912 "parser.c"
    break;

  case 20: /* line: ABORT strarglist  */
#line 441 "parser.y"
                    { if ((yyvsp[0].s_value)[0]) fprintf(stderr,"CONF aborted with: %s\n", (yyvsp[0].s_value));
			exit(99);
		    }
#line 2920 "parser.c"
    break;

  case 21: /* line: WARN strarglist  */
#line 444 "parser.y"
                                        { c_printf("CONF: %s\n", (yyvsp[0].s_value)); free((yyvsp[0].s_value)); }
#line 2926 "parser.c"
    break;

  case 22: /* line: EMUSYS string_expr  */
#line 446 "parser.y"
                    {
		    free(config.emusys); config.emusys = (yyvsp[0].s_value);
		    c_printf("CONF: config.emusys = '%s'\n", (yyvsp[0].s_value));
		    }
#line 2935 "parser.c"
    break;

  case 23: /* line: EMUSYS '{' string_expr '}'  */
#line 451 "parser.y"
                    {
		    free(config.emusys); config.emusys = (yyvsp[-1].s_value);
		    c_printf("CONF: config.emusys = '%s'\n", (yyvsp[-1].s_value));
		    }
#line 2944 "parser.c"
    break;

  case 24: /* line: DOSEMUMAP string_expr  */
#line 456 "parser.y"
                    {
#ifdef USE_MHPDBG
		    free(DOSEMU_MAP_PATH); DOSEMU_MAP_PATH = (yyvsp[0].s_value);
		    c_printf("CONF: dosemu.map path = '%s'\n", (yyvsp[0].s_value));
#else
		    free((yyvsp[0].s_value));
#endif
		    }
#line 2957 "parser.c"
    break;

  case 25: /* line: MAPPINGDRIVER string_expr  */
#line 465 "parser.y"
                    {
		    free(config.mappingdriver); config.mappingdriver = (yyvsp[0].s_value);
		    c_printf("CONF: mapping driver = '%s'\n", (yyvsp[0].s_value));
		    }
#line 2966 "parser.c"
    break;

  case 26: /* line: EMUINI string_expr  */
#line 470 "parser.y"
                    {
                    free(config.emuini); config.emuini = (yyvsp[0].s_value);
                    c_printf("CONF: config.emuini = '%s'\n", (yyvsp[0].s_value));
                    }
#line 2975 "parser.c"
    break;

  case 27: /* line: EMUINI '{' string_expr '}'  */
#line 475 "parser.y"
                    {
                    free(config.emuini); config.emuini = (yyvsp[-1].s_value);
                    c_printf("CONF: config.emuini = '%s'\n", (yyvsp[-1].s_value));
		    }
#line 2984 "parser.c"
    break;

  case 28: /* line: FULL_FILE_LOCKS bool  */
#line 480 "parser.y"
                    {
		    config.full_file_locks = ((yyvsp[0].i_value)!=0);
		    }
#line 2992 "parser.c"
    break;

  case 29: /* line: LFN_SUPPORT bool  */
#line 484 "parser.y"
                    {
		    config.lfn = ((yyvsp[0].i_value)!=0);
		    }
#line 3000 "parser.c"
    break;

  case 30: /* line: FASTFLOPPY floppy_bool  */
#line 488 "parser.y"
                        {
			config.fastfloppy = ((yyvsp[0].i_value)!=0);
			c_printf("CONF: fastfloppy = %d\n", config.fastfloppy);
			}
#line 3009 "parser.c"
    break;

  case 31: /* line: CPU expression  */
#line 493 "parser.y"
                        {
			int cpu = cpu_override (((yyvsp[0].i_value)%100)==86?((yyvsp[0].i_value)/100)%10:0);
			if (cpu > 0) {
				c_printf("CONF: CPU set to %d86\n",cpu);
				vm86s.cpu_type = cpu;
			}
			else
				yyerror("error in CPU user override\n");
			}
#line 3023 "parser.c"
    break;

  case 32: /* line: CPU EMULATED  */
#line 503 "parser.y"
                        {
			vm86s.cpu_type = 5;
#ifdef X86_EMULATOR
			config.cpuemu = 1;
			c_printf("CONF: CPUEMU set to %d for %d86\n",
				config.cpuemu, vm86s.cpu_type);
#endif
			}
#line 3036 "parser.c"
    break;

  case 33: /* line: CPUEMU cpuemu  */
#line 512 "parser.y"
                        {
#ifdef X86_EMULATOR
			config.cpuemu = (yyvsp[0].i_value);
			if (config.cpuemu > 4) {
				config.cpuemu -= 2;
#ifdef HOST_ARCH_X86
				config.cpusim = 1;
#endif
			}
			c_printf("CONF: %s CPUEMU set to %d for %d86\n",
				CONFIG_CPUSIM ? "simulated" : "JIT",
				config.cpuemu, vm86s.cpu_type);
#endif
			}
#line 3055 "parser.c"
    break;

  case 34: /* line: CPUSPEED real_expression  */
#line 527 "parser.y"
                        { 
#if 0 /* no longer used, but left in for dosemu.conf compatibility */
			if (config.realcpu >= CPU_586) {
			  config.cpu_spd = ((double)LLF_US)/(yyvsp[0].r_value);
			  config.cpu_tick_spd = ((double)LLF_TICKS)/(yyvsp[0].r_value);
			  c_printf("CONF: CPU speed = %g\n", ((double)(yyvsp[0].r_value)));
			}
#endif
			}
#line 3069 "parser.c"
    break;

  case 35: /* line: CPUSPEED INTEGER INTEGER  */
#line 537 "parser.y"
                        { 
#if 0 /* no longer used, but left in for dosemu.conf compatibility */
			if (config.realcpu >= CPU_586) {
			  config.cpu_spd = (LLF_US*(yyvsp[0].i_value))/(yyvsp[-1].i_value);
			  config.cpu_tick_spd = (LLF_TICKS*(yyvsp[0].i_value))/(yyvsp[-1].i_value);
			  c_printf("CONF: CPU speed = %d/%d\n", (yyvsp[-1].i_value), (yyvsp[0].i_value));
			}
#endif
			}
#line 3083 "parser.c"
    break;

  case 36: /* line: RDTSC bool  */
#line 547 "parser.y"
                    {
			config.rdtsc = ((yyvsp[0].i_value)!=0);
			c_printf("CONF: %sabling use of pentium timer\n",
				(config.rdtsc?"En":"Dis"));
		    }
#line 3093 "parser.c"
    break;

  case 37: /* line: PCI bool  */
#line 553 "parser.y"
                    { 
		      config.pci_video = ((yyvsp[0].i_value)!=0);
		      IFCLASS(CL_PCI) {}
		      config.pci = (abs((yyvsp[0].i_value))==2); 
		    }
#line 3103 "parser.c"
    break;

  case 38: /* line: BOOTA  */
#line 559 "parser.y"
                    {
		      config.hdiskboot = 0;
		    }
#line 3111 "parser.c"
    break;

  case 39: /* line: BOOTC  */
#line 563 "parser.y"
                    {
		      config.hdiskboot = 1;
		    }
#line 3119 "parser.c"
    break;

  case 40: /* line: BOOTB  */
#line 567 "parser.y"
                    {
		      config.hdiskboot = 2;
		    }
#line 3127 "parser.c"
    break;

  case 41: /* line: TIMER expression  */
#line 571 "parser.y"
                    {
		    config.freq = (yyvsp[0].i_value);
		    if ((yyvsp[0].i_value)) {
		        config.update = 1000000 / (yyvsp[0].i_value);
		    } else {
			config.update = 54925;
			config.freq = 18;
		    }
		    c_printf("CONF: timer freq=%d, update=%d\n",config.freq,config.update);
		    }
#line 3142 "parser.c"
    break;

  case 42: /* line: LOGBUFSIZE expression  */
#line 582 "parser.y"
                    {
		      char *b;
		      flush_log();
		      b = malloc((yyvsp[0].i_value)+1024);
		      if (!b) {
			error("cannot get logbuffer\n");
			exit(1);
		      }
		      logptr = logbuf = b;
		      logbuf_size = (yyvsp[0].i_value);
		    }
#line 3158 "parser.c"
    break;

  case 43: /* line: LOGFILESIZE expression  */
#line 594 "parser.y"
                    {
		      logfile_limit = (yyvsp[0].i_value);
		    }
#line 3166 "parser.c"
    break;

  case 44: /* line: DOSBANNER bool  */
#line 598 "parser.y"
                    {
		    config.dosbanner = ((yyvsp[0].i_value)!=0);
		    c_printf("CONF: dosbanner %s\n", ((yyvsp[0].i_value)) ? "on" : "off");
		    }
#line 3175 "parser.c"
    break;

  case 45: /* line: EMURETRACE bool  */
#line 603 "parser.y"
                    { IFCLASS(CL_VPORT){
		    if ((yyvsp[0].i_value) && !config.emuretrace && priv_lvl)
		      yyerror("Can not modify video port access in user config file");
		    config.emuretrace = ((yyvsp[0].i_value)!=0);
		    c_printf("CONF: emu_retrace %s\n", ((yyvsp[0].i_value)) ? "on" : "off");
		    }}
#line 3186 "parser.c"
    break;

  case 47: /* line: L_EMS int_bool  */
#line 611 "parser.y"
                    {
		    if ((yyvsp[0].i_value) >= 0) config.ems_size = (yyvsp[0].i_value);
		    if ((yyvsp[0].i_value) > 0) c_printf("CONF: %dk bytes EMS memory\n", (yyvsp[0].i_value));
		    }
#line 3195 "parser.c"
    break;

  case 48: /* line: L_UMB bool  */
#line 616 "parser.y"
                    {
		    config.max_umb = ((yyvsp[0].i_value)!=0);
		    if ((yyvsp[0].i_value) > 0) c_printf("CONF: maximize umb's %s\n", ((yyvsp[0].i_value)) ? "on" : "off");
		    }
#line 3204 "parser.c"
    break;

  case 49: /* line: L_DPMI int_bool  */
#line 621 "parser.y"
                    {
		    if ((yyvsp[0].i_value)>=0) config.dpmi = (yyvsp[0].i_value);
		    c_printf("CONF: DPMI-Server %s (%#x)\n", ((yyvsp[0].i_value)) ? "on" : "off", ((yyvsp[0].i_value)));
		    }
#line 3213 "parser.c"
    break;

  case 50: /* line: DPMI_BASE int_bool  */
#line 626 "parser.y"
                    {
		    config.dpmi_base = (yyvsp[0].i_value);
		    c_printf("CONF: DPMI base addr = %#x\n", (yyvsp[0].i_value));
		    }
#line 3222 "parser.c"
    break;

  case 51: /* line: PM_DOS_API bool  */
#line 631 "parser.y"
                    {
		    config.pm_dos_api = ((yyvsp[0].i_value)!=0);
		    c_printf("CONF: PM DOS API Translator %s\n", ((yyvsp[0].i_value)) ? "on" : "off");
		    }
#line 3231 "parser.c"
    break;

  case 52: /* line: NO_NULL_CHECKS bool  */
#line 636 "parser.y"
                    {
		    config.no_null_checks = ((yyvsp[0].i_value)!=0);
		    c_printf("CONF: No DJGPP NULL deref checks: %s\n", ((yyvsp[0].i_value)) ? "on" : "off");
		    }
#line 3240 "parser.c"
    break;

  case 53: /* line: DOSMEM int_bool  */
#line 640 "parser.y"
                                        { if ((yyvsp[0].i_value)>=0) config.mem_size = (yyvsp[0].i_value); }
#line 3246 "parser.c"
    break;

  case 54: /* line: EXT_MEM int_bool  */
#line 642 "parser.y"
                    {
		    if ((yyvsp[0].i_value)>=0) config.ext_mem = (yyvsp[0].i_value);
		    if ((yyvsp[0].i_value) > 0) c_printf("CONF: %dk bytes XMS memory\n", (yyvsp[0].i_value));
		    }
#line 3255 "parser.c"
    break;

  case 55: /* line: MATHCO bool  */
#line 646 "parser.y"
                                        { config.mathco = ((yyvsp[0].i_value)!=0); }
#line 3261 "parser.c"
    break;

  case 56: /* line: IPXSUPPORT bool  */
#line 648 "parser.y"
                    {
		    config.ipxsup = ((yyvsp[0].i_value)!=0);
		    c_printf("CONF: IPX support %s\n", ((yyvsp[0].i_value)) ? "on" : "off");
		    }
#line 3270 "parser.c"
    break;

  case 57: /* line: IPXNETWORK int_bool  */
#line 652 "parser.y"
                                        { config.ipx_net = (yyvsp[0].i_value); }
#line 3276 "parser.c"
    break;

  case 58: /* line: PKTDRIVER bool  */
#line 654 "parser.y"
                    {
		      if (config.vnet == VNET_TYPE_TAP || config.vnet == VNET_TYPE_VDE || (yyvsp[0].i_value) == 0 || is_in_allowed_classes(CL_NET)) {
			config.pktdrv = ((yyvsp[0].i_value)!=0);
			c_printf("CONF: Packet Driver %s.\n", 
				((yyvsp[0].i_value)) ? "enabled" : "disabled");
		      }
		    }
#line 3288 "parser.c"
    break;

  case 59: /* line: ETHDEV string_expr  */
#line 661 "parser.y"
                                        { free(config.ethdev); config.ethdev = (yyvsp[0].s_value); }
#line 3294 "parser.c"
    break;

  case 60: /* line: TAPDEV string_expr  */
#line 662 "parser.y"
                                        { free(config.tapdev); config.tapdev = (yyvsp[0].s_value); }
#line 3300 "parser.c"
    break;

  case 61: /* line: VDESWITCH string_expr  */
#line 663 "parser.y"
                                        { free(config.vdeswitch); config.vdeswitch = (yyvsp[0].s_value); }
#line 3306 "parser.c"
    break;

  case 62: /* line: SLIRPARGS string_expr  */
#line 664 "parser.y"
                                        { free(config.slirp_args); config.slirp_args = (yyvsp[0].s_value); }
#line 3312 "parser.c"
    break;

  case 63: /* line: NOVELLHACK bool  */
#line 665 "parser.y"
                                        { config.pktflags = ((yyvsp[0].i_value)!=0); }
#line 3318 "parser.c"
    break;

  case 64: /* line: VNET string_expr  */
#line 666 "parser.y"
                                        { start_vnet((yyvsp[0].s_value)); free((yyvsp[0].s_value)); }
#line 3324 "parser.c"
    break;

  case 65: /* line: SPEAKER speaker  */
#line 668 "parser.y"
                    {
		    if ((yyvsp[0].i_value) == SPKR_NATIVE) {
		      if (can_do_root_stuff) {
                        c_printf("CONF: allowing speaker port access!\n");
		      } else {
                        c_printf("CONF: native speaker not allowed: emulate\n");
			(yyvsp[0].i_value) = SPKR_EMULATED;
		      }
		    }
		    else
                      c_printf("CONF: not allowing speaker port access\n");
		    config.speaker = (yyvsp[0].i_value);
		    }
#line 3342 "parser.c"
    break;

  case 66: /* $@1: %empty  */
#line 682 "parser.y"
                    { start_video(); }
#line 3348 "parser.c"
    break;

  case 67: /* line: VIDEO $@1 '{' video_flags '}'  */
#line 684 "parser.y"
                    { stop_video(); }
#line 3354 "parser.c"
    break;

  case 68: /* line: XTERM_TITLE string_expr  */
#line 685 "parser.y"
                                          { free(config.xterm_title); config.xterm_title = (yyvsp[0].s_value); }
#line 3360 "parser.c"
    break;

  case 69: /* line: TERMINAL '{' term_flags '}'  */
#line 688 "parser.y"
                    { stop_terminal(); }
#line 3366 "parser.c"
    break;

  case 70: /* line: DEBUG strarglist  */
#line 689 "parser.y"
                                   {
			parse_debugflags((yyvsp[0].s_value), 1);
			free((yyvsp[0].s_value));
		}
#line 3375 "parser.c"
    break;

  case 71: /* $@2: %empty  */
#line 694 "parser.y"
                    { start_debug(); }
#line 3381 "parser.c"
    break;

  case 73: /* $@3: %empty  */
#line 697 "parser.y"
                    { start_mouse(); }
#line 3387 "parser.c"
    break;

  case 74: /* line: MOUSE $@3 '{' mouse_flags '}'  */
#line 699 "parser.y"
                    { stop_mouse(); }
#line 3393 "parser.c"
    break;

  case 75: /* line: TTYLOCKS '{' ttylocks_flags '}'  */
#line 702 "parser.y"
                    { stop_ttylocks(); }
#line 3399 "parser.c"
    break;

  case 76: /* $@4: %empty  */
#line 704 "parser.y"
                    { start_serial(); }
#line 3405 "parser.c"
    break;

  case 77: /* line: SERIAL $@4 '{' serial_flags '}'  */
#line 706 "parser.y"
                    { stop_serial(); }
#line 3411 "parser.c"
    break;

  case 78: /* $@5: %empty  */
#line 708 "parser.y"
                    { start_keyboard(); }
#line 3417 "parser.c"
    break;

  case 80: /* $@6: %empty  */
#line 711 "parser.y"
                        {keytable_start((yyvsp[0].i_value));}
#line 3423 "parser.c"
    break;

  case 81: /* line: KEYTABLE KEYB_LAYOUT $@6 '{' keyboard_mods '}'  */
#line 713 "parser.y"
                        {keytable_stop();}
#line 3429 "parser.c"
    break;

  case 82: /* line: PRESTROKE string_expr  */
#line 715 "parser.y"
                    {
		    append_pre_strokes((yyvsp[0].s_value));
		    c_printf("CONF: appending pre-strokes '%s'\n", (yyvsp[0].s_value));
		    free((yyvsp[0].s_value));
		    }
#line 3439 "parser.c"
    break;

  case 83: /* line: KEYTABLE DUMP string_expr  */
#line 720 "parser.y"
                                            {
			dump_keytables_to_file((yyvsp[0].s_value));
			free((yyvsp[0].s_value));
		    }
#line 3448 "parser.c"
    break;

  case 84: /* $@7: %empty  */
#line 725 "parser.y"
                    { IFCLASS(CL_PORT) start_ports(); }
#line 3454 "parser.c"
    break;

  case 87: /* $@8: %empty  */
#line 729 "parser.y"
                    { start_disk(); }
#line 3460 "parser.c"
    break;

  case 88: /* line: DISK $@8 '{' disk_flags '}'  */
#line 731 "parser.y"
                    { stop_disk(DISK); }
#line 3466 "parser.c"
    break;

  case 89: /* $@9: %empty  */
#line 733 "parser.y"
                    { start_bootdisk(); }
#line 3472 "parser.c"
    break;

  case 90: /* line: BOOTDISK $@9 '{' disk_flags '}'  */
#line 735 "parser.y"
                    { stop_disk(BOOTDISK); }
#line 3478 "parser.c"
    break;

  case 91: /* $@10: %empty  */
#line 737 "parser.y"
                    { start_floppy(); }
#line 3484 "parser.c"
    break;

  case 92: /* line: L_FLOPPY $@10 '{' disk_flags '}'  */
#line 739 "parser.y"
                    { stop_disk(L_FLOPPY); }
#line 3490 "parser.c"
    break;

  case 93: /* line: CDROM '{' string_expr '}'  */
#line 741 "parser.y"
                    {
		    static int which = 0;
		    if (which >= 3) {
			c_printf("CONF: too many cdrom drives defined\n");
			free((yyvsp[-1].s_value));
		    }
		    else {
			Path_cdrom[which] = (yyvsp[-1].s_value);
			c_printf("CONF: cdrom MSCD000%d on %s\n", which+1 ,(yyvsp[-1].s_value));
			which++;
		    }
		    }
#line 3507 "parser.c"
    break;

  case 94: /* line: ASPI '{' string_expr DEVICETYPE string_expr TARGET expression '}'  */
#line 754 "parser.y"
                    {
#ifdef ASPI_SUPPORT
		    char *s = aspi_add_device((yyvsp[-5].s_value), (yyvsp[-3].s_value), (yyvsp[-1].i_value));
		    if (s) {
			c_printf("CONF: aspi available for %s\n", s);
			free(s);
		    }
		    else c_printf("CONF: aspi device %s not available\n", (yyvsp[-5].s_value));
#endif
		    free((yyvsp[-5].s_value));
		    free((yyvsp[-3].s_value));
		    }
#line 3524 "parser.c"
    break;

  case 95: /* $@11: %empty  */
#line 767 "parser.y"
                    { start_printer(); }
#line 3530 "parser.c"
    break;

  case 96: /* line: PRINTER $@11 '{' printer_flags '}'  */
#line 769 "parser.y"
                    { stop_printer(); }
#line 3536 "parser.c"
    break;

  case 98: /* line: L_SOUND bool  */
#line 771 "parser.y"
                                { config.sound = (yyvsp[0].i_value)==-1 ? -1 : (yyvsp[0].i_value)==2 ? 2 : (yyvsp[0].i_value)==0 ? 0 : 1; }
#line 3542 "parser.c"
    break;

  case 99: /* $@12: %empty  */
#line 772 "parser.y"
                          { config.sound = 1; }
#line 3548 "parser.c"
    break;

  case 102: /* line: L_JOYSTICK bool  */
#line 774 "parser.y"
                                  { if (! (yyvsp[0].i_value)) { config.joy_device[0] = config.joy_device[1] = NULL; } }
#line 3554 "parser.c"
    break;

  case 104: /* $@13: %empty  */
#line 777 "parser.y"
                    { IFCLASS(CL_IRQ) config.sillyint=0; }
#line 3560 "parser.c"
    break;

  case 106: /* line: SILLYINT irq_bool  */
#line 780 "parser.y"
                    { IFCLASS(CL_IRQ) if ((yyvsp[0].i_value)) {
		        config.sillyint = 1 << (yyvsp[0].i_value);
		        c_printf("CONF: IRQ %d for irqpassing\n", (yyvsp[0].i_value));
		      }
		    }
#line 3570 "parser.c"
    break;

  case 108: /* $@14: %empty  */
#line 787 "parser.y"
                    { IFCLASS(CL_HARDRAM) {}
		    if (priv_lvl)
		      yyerror("Can not change hardware ram access settings in user config file");
		    }
#line 3579 "parser.c"
    break;

  case 110: /* line: FEATURE '{' expression '=' expression '}'  */
#line 793 "parser.y"
                    {
			handle_features((yyvsp[-3].i_value), (yyvsp[-1].i_value));
		    }
#line 3587 "parser.c"
    break;

  case 111: /* line: CLI_TIMEOUT int_bool  */
#line 797 "parser.y"
                    { config.cli_timeout = (yyvsp[0].i_value); }
#line 3593 "parser.c"
    break;

  case 112: /* line: PIC_WATCHDOG int_bool  */
#line 799 "parser.y"
                    { config.pic_watchdog = (yyvsp[0].i_value); }
#line 3599 "parser.c"
    break;

  case 113: /* line: TIMEMODE string_expr  */
#line 801 "parser.y"
                    {
		    config.timemode = parse_timemode((yyvsp[0].s_value));
		    c_printf("CONF: time mode = '%s'\n", (yyvsp[0].s_value));
		    free((yyvsp[0].s_value));
		    }
#line 3609 "parser.c"
    break;

  case 114: /* line: STRING  */
#line 807 "parser.y"
                    { yyerror("unrecognized command '%s'", (yyvsp[0].s_value)); free((yyvsp[0].s_value)); }
#line 3615 "parser.c"
    break;

  case 116: /* expression: typed_expr  */
#line 811 "parser.y"
                           { (yyval.i_value) = TOF((yyvsp[0].t_value)); }
#line 3621 "parser.c"
    break;

  case 117: /* real_expression: typed_expr  */
#line 814 "parser.y"
                           { (yyval.r_value) = TOF((yyvsp[0].t_value)); }
#line 3627 "parser.c"
    break;

  case 118: /* typed_expr: int_expr  */
#line 819 "parser.y"
                           {(yyval.t_value).type = TYPE_INTEGER; (yyval.t_value).value.i=(yyvsp[0].i_value);}
#line 3633 "parser.c"
    break;

  case 119: /* typed_expr: bool_expr  */
#line 820 "parser.y"
                            {(yyval.t_value).type = TYPE_BOOLEAN; (yyval.t_value).value.i=(yyvsp[0].i_value);}
#line 3639 "parser.c"
    break;

  case 120: /* typed_expr: real_expr  */
#line 821 "parser.y"
                            {(yyval.t_value).type = TYPE_REAL; (yyval.t_value).value.r=(yyvsp[0].r_value);}
#line 3645 "parser.c"
    break;

  case 121: /* typed_expr: typed_expr '+' typed_expr  */
#line 823 "parser.y"
                        {V_VAL((yyval.t_value),(yyvsp[-2].t_value),TOF((yyvsp[-2].t_value)) + TOF((yyvsp[0].t_value))); }
#line 3651 "parser.c"
    break;

  case 122: /* typed_expr: typed_expr '-' typed_expr  */
#line 825 "parser.y"
                        {V_VAL((yyval.t_value),(yyvsp[-2].t_value),TOF((yyvsp[-2].t_value)) - TOF((yyvsp[0].t_value))); }
#line 3657 "parser.c"
    break;

  case 123: /* typed_expr: typed_expr '*' typed_expr  */
#line 827 "parser.y"
                        {V_VAL((yyval.t_value),(yyvsp[-2].t_value),TOF((yyvsp[-2].t_value)) * TOF((yyvsp[0].t_value))); }
#line 3663 "parser.c"
    break;

  case 124: /* typed_expr: typed_expr '/' typed_expr  */
#line 828 "parser.y"
                                            {
			if (TOF((yyvsp[0].t_value)))	V_VAL((yyval.t_value),(yyvsp[-2].t_value),TOF((yyvsp[-2].t_value)) / TOF((yyvsp[0].t_value)));
			else V_VAL((yyval.t_value),(yyvsp[-2].t_value),TOF((yyvsp[0].t_value)));
		}
#line 3672 "parser.c"
    break;

  case 125: /* typed_expr: '-' typed_expr  */
#line 833 "parser.y"
                        {V_VAL((yyval.t_value),(yyvsp[0].t_value),-TOF((yyvsp[0].t_value))); }
#line 3678 "parser.c"
    break;

  case 126: /* typed_expr: '+' typed_expr  */
#line 835 "parser.y"
                        {V_VAL((yyval.t_value),(yyvsp[0].t_value),TOF((yyvsp[0].t_value))); }
#line 3684 "parser.c"
    break;

  case 127: /* typed_expr: typed_expr SHR_OP typed_expr  */
#line 837 "parser.y"
                        { unsigned int shift = (1 << (int)TOF((yyvsp[0].t_value)));
			if (!shift) (yyval.t_value) = (yyvsp[-2].t_value);
			else V_VAL((yyval.t_value), (yyvsp[-2].t_value), TOF((yyvsp[-2].t_value)) / shift);}
#line 3692 "parser.c"
    break;

  case 128: /* typed_expr: typed_expr SHL_OP typed_expr  */
#line 841 "parser.y"
                        { unsigned int shift = (1 << (int)TOF((yyvsp[0].t_value)));
			if (!shift) (yyval.t_value) = (yyvsp[-2].t_value);
			else V_VAL((yyval.t_value), (yyvsp[-2].t_value), TOF((yyvsp[-2].t_value)) * shift);}
#line 3700 "parser.c"
    break;

  case 129: /* typed_expr: variable_content  */
#line 844 "parser.y"
                                   {
			char *s;
			(yyval.t_value).type = TYPE_INTEGER;
			(yyval.t_value).value.i = strtoul((yyvsp[0].s_value),&s,0);
			switch (*s) {
				case '.':  case 'e':  case 'E':
				/* we assume a real number */
				(yyval.t_value).type = TYPE_REAL;
				(yyval.t_value).value.r = strtod((yyvsp[0].s_value),0);
			}
			free((yyvsp[0].s_value));
		}
#line 3717 "parser.c"
    break;

  case 130: /* typed_expr: '(' typed_expr ')'  */
#line 856 "parser.y"
                                     {(yyval.t_value) = (yyvsp[-1].t_value);}
#line 3723 "parser.c"
    break;

  case 132: /* int_expr: typed_expr AND_OP typed_expr  */
#line 861 "parser.y"
                        {(yyval.i_value) = (int)TOF((yyvsp[-2].t_value)) & (int)TOF((yyvsp[0].t_value)); }
#line 3729 "parser.c"
    break;

  case 133: /* int_expr: typed_expr OR_OP typed_expr  */
#line 863 "parser.y"
                        {(yyval.i_value) = (int)TOF((yyvsp[-2].t_value)) | (int)TOF((yyvsp[0].t_value)); }
#line 3735 "parser.c"
    break;

  case 134: /* int_expr: typed_expr XOR_OP typed_expr  */
#line 865 "parser.y"
                        {(yyval.i_value) = (int)TOF((yyvsp[-2].t_value)) ^ (int)TOF((yyvsp[0].t_value)); }
#line 3741 "parser.c"
    break;

  case 135: /* int_expr: BIT_NOT_OP typed_expr  */
#line 867 "parser.y"
                        {(yyval.i_value) = (int)TOF((yyvsp[0].t_value)) ^ (-1); }
#line 3747 "parser.c"
    break;

  case 136: /* int_expr: L_AUTO  */
#line 868 "parser.y"
                                {(yyval.i_value) = -1; }
#line 3753 "parser.c"
    break;

  case 137: /* int_expr: INTCAST '(' typed_expr ')'  */
#line 869 "parser.y"
                                             {(yyval.i_value) = TOF((yyvsp[-1].t_value));}
#line 3759 "parser.c"
    break;

  case 138: /* int_expr: STRTOL '(' string_expr ')'  */
#line 870 "parser.y"
                                             {
			(yyval.i_value) = strtol((yyvsp[-1].s_value),0,0);
			free((yyvsp[-1].s_value));
		}
#line 3768 "parser.c"
    break;

  case 139: /* int_expr: STRLEN '(' string_expr ')'  */
#line 874 "parser.y"
                                             {
			(yyval.i_value) = strlen((yyvsp[-1].s_value));
			free((yyvsp[-1].s_value));
		}
#line 3777 "parser.c"
    break;

  case 140: /* int_expr: STRNCMP '(' string_expr ',' string_expr ',' expression ')'  */
#line 878 "parser.y"
                                                                             {
			(yyval.i_value) = strncmp((yyvsp[-5].s_value),(yyvsp[-3].s_value),(yyvsp[-1].i_value));
			free((yyvsp[-5].s_value)); free((yyvsp[-3].s_value));
		}
#line 3786 "parser.c"
    break;

  case 141: /* int_expr: STRPBRK '(' string_expr ',' string_expr ')'  */
#line 882 "parser.y"
                                                              {
			char *s = strpbrk((yyvsp[-3].s_value),(yyvsp[-1].s_value));
			if (s) (yyval.i_value) = s - (yyvsp[-3].s_value);
			else (yyval.i_value) = -1;
			free((yyvsp[-3].s_value)); free((yyvsp[-1].s_value));
		}
#line 3797 "parser.c"
    break;

  case 142: /* int_expr: STRCHR '(' string_expr ',' string_expr ')'  */
#line 888 "parser.y"
                                                             {
			char *s = strchr((yyvsp[-3].s_value),(yyvsp[-1].s_value)[0]);
			if (s) (yyval.i_value) = s - (yyvsp[-3].s_value);
			else (yyval.i_value) = -1;
			free((yyvsp[-3].s_value)); free((yyvsp[-1].s_value));
		}
#line 3808 "parser.c"
    break;

  case 143: /* int_expr: STRRCHR '(' string_expr ',' string_expr ')'  */
#line 894 "parser.y"
                                                              {
			char *s = strrchr((yyvsp[-3].s_value),(yyvsp[-1].s_value)[0]);
			if (s) (yyval.i_value) = s - (yyvsp[-3].s_value);
			else (yyval.i_value) = -1;
			free((yyvsp[-3].s_value)); free((yyvsp[-1].s_value));
		}
#line 3819 "parser.c"
    break;

  case 144: /* int_expr: STRSTR '(' string_expr ',' string_expr ')'  */
#line 900 "parser.y"
                                                             {
			char *s = strstr((yyvsp[-3].s_value),(yyvsp[-1].s_value));
			if (s) (yyval.i_value) = s - (yyvsp[-3].s_value);
			else (yyval.i_value) = -1;
			free((yyvsp[-3].s_value)); free((yyvsp[-1].s_value));
		}
#line 3830 "parser.c"
    break;

  case 145: /* int_expr: STRSPN '(' string_expr ',' string_expr ')'  */
#line 906 "parser.y"
                                                             {
			(yyval.i_value) = strspn((yyvsp[-3].s_value),(yyvsp[-1].s_value));
			free((yyvsp[-3].s_value)); free((yyvsp[-1].s_value));
		}
#line 3839 "parser.c"
    break;

  case 146: /* int_expr: STRCSPN '(' string_expr ',' string_expr ')'  */
#line 910 "parser.y"
                                                              {
			(yyval.i_value) = strcspn((yyvsp[-3].s_value),(yyvsp[-1].s_value));
			free((yyvsp[-3].s_value)); free((yyvsp[-1].s_value));
		}
#line 3848 "parser.c"
    break;

  case 147: /* int_expr: STRING  */
#line 914 "parser.y"
                         {
			if ( (yyvsp[0].s_value)[0] == '\'' && (yyvsp[0].s_value)[1] && (yyvsp[0].s_value)[2] == '\'' && !(yyvsp[0].s_value)[3] )
				(yyval.i_value) = (yyvsp[0].s_value)[1];
			else	yyerror("unrecognized expression '%s'", (yyvsp[0].s_value));
			free((yyvsp[0].s_value));
		}
#line 3859 "parser.c"
    break;

  case 148: /* bool_expr: typed_expr EQ_OP typed_expr  */
#line 923 "parser.y"
                        {(yyval.i_value) = TOF((yyvsp[-2].t_value)) == TOF((yyvsp[0].t_value)); }
#line 3865 "parser.c"
    break;

  case 149: /* bool_expr: typed_expr NEQ_OP typed_expr  */
#line 925 "parser.y"
                        {(yyval.i_value) = TOF((yyvsp[-2].t_value)) != TOF((yyvsp[0].t_value)); }
#line 3871 "parser.c"
    break;

  case 150: /* bool_expr: typed_expr GE_OP typed_expr  */
#line 927 "parser.y"
                        {(yyval.i_value) = TOF((yyvsp[-2].t_value)) >= TOF((yyvsp[0].t_value)); }
#line 3877 "parser.c"
    break;

  case 151: /* bool_expr: typed_expr LE_OP typed_expr  */
#line 929 "parser.y"
                        {(yyval.i_value) = TOF((yyvsp[-2].t_value)) <= TOF((yyvsp[0].t_value)); }
#line 3883 "parser.c"
    break;

  case 152: /* bool_expr: typed_expr '<' typed_expr  */
#line 931 "parser.y"
                        {(yyval.i_value) = TOF((yyvsp[-2].t_value)) < TOF((yyvsp[0].t_value)); }
#line 3889 "parser.c"
    break;

  case 153: /* bool_expr: typed_expr '>' typed_expr  */
#line 933 "parser.y"
                        {(yyval.i_value) = TOF((yyvsp[-2].t_value)) > TOF((yyvsp[0].t_value)); }
#line 3895 "parser.c"
    break;

  case 154: /* bool_expr: typed_expr L_AND_OP typed_expr  */
#line 935 "parser.y"
                        {(yyval.i_value) = TOF((yyvsp[-2].t_value)) && TOF((yyvsp[0].t_value)); }
#line 3901 "parser.c"
    break;

  case 155: /* bool_expr: typed_expr L_OR_OP typed_expr  */
#line 937 "parser.y"
                        {(yyval.i_value) = TOF((yyvsp[-2].t_value)) || TOF((yyvsp[0].t_value)); }
#line 3907 "parser.c"
    break;

  case 156: /* bool_expr: string_expr STR_EQ_OP string_expr  */
#line 939 "parser.y"
                        {(yyval.i_value) = strcmp((yyvsp[-2].s_value),(yyvsp[0].s_value)) == 0; free((yyvsp[-2].s_value)); free((yyvsp[0].s_value)); }
#line 3913 "parser.c"
    break;

  case 157: /* bool_expr: string_expr STR_NEQ_OP string_expr  */
#line 941 "parser.y"
                        {(yyval.i_value) = strcmp((yyvsp[-2].s_value),(yyvsp[0].s_value)) != 0; free((yyvsp[-2].s_value)); free((yyvsp[0].s_value)); }
#line 3919 "parser.c"
    break;

  case 158: /* bool_expr: NOT_OP typed_expr  */
#line 942 "parser.y"
                                    {(yyval.i_value) = (TOF((yyvsp[0].t_value)) ? 0:1); }
#line 3925 "parser.c"
    break;

  case 159: /* bool_expr: L_YES  */
#line 943 "parser.y"
                                {(yyval.i_value) = -2; }
#line 3931 "parser.c"
    break;

  case 160: /* bool_expr: L_NO  */
#line 944 "parser.y"
                                {(yyval.i_value) = 0; }
#line 3937 "parser.c"
    break;

  case 161: /* bool_expr: L_ON  */
#line 945 "parser.y"
                                {(yyval.i_value) = -2; }
#line 3943 "parser.c"
    break;

  case 162: /* bool_expr: L_OFF  */
#line 946 "parser.y"
                                {(yyval.i_value) = 0; }
#line 3949 "parser.c"
    break;

  case 163: /* bool_expr: DEFINED '(' string_unquoted ')'  */
#line 947 "parser.y"
                                                  {
			(yyval.i_value) = get_config_variable((yyvsp[-1].s_value)) !=0;
			free((yyvsp[-1].s_value));
		}
#line 3958 "parser.c"
    break;

  case 165: /* real_expr: REALCAST '(' typed_expr ')'  */
#line 954 "parser.y"
                                              {(yyval.r_value) = TOF((yyvsp[-1].t_value));}
#line 3964 "parser.c"
    break;

  case 166: /* variable_content: VARIABLE  */
#line 958 "parser.y"
                         {
			char *s = (yyvsp[0].s_value);
			if (get_config_variable(s))
				s = "1";
			else if (strncmp("c_",s,2)
					&& strncmp("u_",s,2)
					&& strncmp("h_",s,2) ) {
				s = checked_getenv(s);
				if (!s) s = "";
			}
			else
				s = "0";
			(yyval.s_value) = strdup(s);
			free((yyvsp[0].s_value));
		}
#line 3984 "parser.c"
    break;

  case 167: /* string_unquoted: STRING  */
#line 975 "parser.y"
                       {
			(yyval.s_value) = (yyvsp[0].s_value);
			if ((yyval.s_value)[0] == '\'' || (yyval.s_value)[0] == '\"') {
				size_t len = strlen((yyvsp[0].s_value)) - 2;
				memmove((yyval.s_value), (yyval.s_value)+1, len);
				(yyval.s_value)[len] = '\0';
			}
		}
#line 3997 "parser.c"
    break;

  case 169: /* string_expr: STRCAT '(' strarglist ')'  */
#line 986 "parser.y"
                                            {(yyval.s_value) = (yyvsp[-1].s_value); }
#line 4003 "parser.c"
    break;

  case 170: /* string_expr: STRSPLIT '(' string_expr ',' expression ',' expression ')'  */
#line 987 "parser.y"
                                                                             {
			int i = (yyvsp[-3].i_value);
			int len = (yyvsp[-1].i_value);
			int slen = strlen((yyvsp[-5].s_value));
			if ((i >=0) && (i < slen) && (len > 0)) {
				if ((i+len) > slen) len = slen - i;
				(yyvsp[-5].s_value)[i+len] = 0;
				(yyval.s_value) = strdup((yyvsp[-5].s_value) + i);
			}
			else
				(yyval.s_value) = strdup("");
			free((yyvsp[-5].s_value));
		}
#line 4021 "parser.c"
    break;

  case 171: /* string_expr: STRDEL '(' string_expr ',' expression ',' expression ')'  */
#line 1000 "parser.y"
                                                                           {
			int i = (yyvsp[-3].i_value);
			int len = (yyvsp[-1].i_value);
			int slen = strlen((yyvsp[-5].s_value));
			char *s = strdup((yyvsp[-5].s_value));
			if ((i >=0) && (i < slen) && (len > 0)) {
				if ((i+len) > slen) s[i] = 0;
				else memmove(s+i, s+i+len, slen-i-len+1);
			}
			free((yyvsp[-5].s_value));
			(yyval.s_value) = s;
		}
#line 4038 "parser.c"
    break;

  case 172: /* string_expr: SHELL '(' strarglist ')'  */
#line 1012 "parser.y"
                                           {
			(yyval.s_value) = run_shell((yyvsp[-1].s_value));
			free((yyvsp[-1].s_value));
		}
#line 4047 "parser.c"
    break;

  case 173: /* string_expr: variable_content  */
#line 1016 "parser.y"
                                   {(yyval.s_value) = (yyvsp[0].s_value);}
#line 4053 "parser.c"
    break;

  case 175: /* strarglist: strarglist ',' strarglist_item  */
#line 1020 "parser.y"
                                                 {
			char *s = malloc(strlen((yyvsp[-2].s_value))+strlen((yyvsp[0].s_value))+1);
			strcpy(s, (yyvsp[-2].s_value));
			strcat(s, (yyvsp[0].s_value));
			(yyval.s_value) = s;
			free((yyvsp[-2].s_value)); free((yyvsp[0].s_value));
		}
#line 4065 "parser.c"
    break;

  case 177: /* strarglist_item: '(' typed_expr ')'  */
#line 1030 "parser.y"
                                     {
			if ((yyvsp[-1].t_value).type == TYPE_REAL)
				asprintf(&(yyval.s_value), "%g", (yyvsp[-1].t_value).value.r);
			else
				asprintf(&(yyval.s_value), "%d", (yyvsp[-1].t_value).value.i);
		}
#line 4076 "parser.c"
    break;

  case 178: /* check_user_var_list: VARIABLE  */
#line 1039 "parser.y"
                         {
			check_user_var((yyvsp[0].s_value));
			free((yyvsp[0].s_value));
		}
#line 4085 "parser.c"
    break;

  case 179: /* check_user_var_list: check_user_var_list ',' VARIABLE  */
#line 1043 "parser.y"
                                                   {
			check_user_var((yyvsp[0].s_value));
			free((yyvsp[0].s_value));
		}
#line 4094 "parser.c"
    break;

  case 182: /* x_flag: UPDATELINES expression  */
#line 1054 "parser.y"
                                                { config.X_updatelines = (yyvsp[0].i_value); }
#line 4100 "parser.c"
    break;

  case 183: /* x_flag: UPDATEFREQ expression  */
#line 1055 "parser.y"
                                        { config.X_updatefreq = (yyvsp[0].i_value); }
#line 4106 "parser.c"
    break;

  case 184: /* x_flag: L_DISPLAY string_expr  */
#line 1056 "parser.y"
                                        { free(config.X_display); config.X_display = (yyvsp[0].s_value); }
#line 4112 "parser.c"
    break;

  case 185: /* x_flag: L_TITLE string_expr  */
#line 1057 "parser.y"
                                        { free(config.X_title); config.X_title = (yyvsp[0].s_value); }
#line 4118 "parser.c"
    break;

  case 186: /* x_flag: X_TITLE_SHOW_APPNAME bool  */
#line 1058 "parser.y"
                                                { config.X_title_show_appname = ((yyvsp[0].i_value)!=0); }
#line 4124 "parser.c"
    break;

  case 187: /* x_flag: ICON_NAME string_expr  */
#line 1059 "parser.y"
                                        { free(config.X_icon_name); config.X_icon_name = (yyvsp[0].s_value); }
#line 4130 "parser.c"
    break;

  case 188: /* x_flag: X_KEYCODE expression  */
#line 1060 "parser.y"
                                        { config.X_keycode = (yyvsp[0].i_value); }
#line 4136 "parser.c"
    break;

  case 189: /* x_flag: X_BLINKRATE expression  */
#line 1061 "parser.y"
                                                { config.X_blinkrate = (yyvsp[0].i_value); }
#line 4142 "parser.c"
    break;

  case 190: /* x_flag: X_SHARECMAP  */
#line 1062 "parser.y"
                                        { config.X_sharecmap = 1; }
#line 4148 "parser.c"
    break;

  case 191: /* x_flag: X_MITSHM  */
#line 1063 "parser.y"
                                        { config.X_mitshm = 1; }
#line 4154 "parser.c"
    break;

  case 192: /* x_flag: X_MITSHM bool  */
#line 1064 "parser.y"
                                        { config.X_mitshm = ((yyvsp[0].i_value)!=0); }
#line 4160 "parser.c"
    break;

  case 193: /* x_flag: X_FONT string_expr  */
#line 1065 "parser.y"
                                                { free(config.X_font); config.X_font = (yyvsp[0].s_value); }
#line 4166 "parser.c"
    break;

  case 194: /* x_flag: X_FIXED_ASPECT bool  */
#line 1066 "parser.y"
                                        { config.X_fixed_aspect = ((yyvsp[0].i_value)!=0); }
#line 4172 "parser.c"
    break;

  case 195: /* x_flag: X_ASPECT_43  */
#line 1067 "parser.y"
                                        { config.X_aspect_43 = 1; }
#line 4178 "parser.c"
    break;

  case 196: /* x_flag: X_LIN_FILT  */
#line 1068 "parser.y"
                                        { config.X_lin_filt = 1; }
#line 4184 "parser.c"
    break;

  case 197: /* x_flag: X_BILIN_FILT  */
#line 1069 "parser.y"
                                        { config.X_bilin_filt = 1; }
#line 4190 "parser.c"
    break;

  case 198: /* x_flag: X_MODE13FACT expression  */
#line 1070 "parser.y"
                                           { config.X_mode13fact = (yyvsp[0].i_value); }
#line 4196 "parser.c"
    break;

  case 199: /* x_flag: X_WINSIZE INTEGER INTEGER  */
#line 1072 "parser.y"
                   {
                     config.X_winsize_x = (yyvsp[-1].i_value);
                     config.X_winsize_y = (yyvsp[0].i_value);
                   }
#line 4205 "parser.c"
    break;

  case 200: /* x_flag: X_WINSIZE expression ',' expression  */
#line 1077 "parser.y"
                   {
                     config.X_winsize_x = (yyvsp[-2].i_value);
                     config.X_winsize_y = (yyvsp[0].i_value);
                   }
#line 4214 "parser.c"
    break;

  case 201: /* x_flag: X_GAMMA expression  */
#line 1081 "parser.y"
                                      { config.X_gamma = (yyvsp[0].i_value); }
#line 4220 "parser.c"
    break;

  case 202: /* x_flag: X_FULLSCREEN bool  */
#line 1082 "parser.y"
                                      { config.X_fullscreen = (yyvsp[0].i_value); }
#line 4226 "parser.c"
    break;

  case 203: /* x_flag: VGAEMU_MEMSIZE expression  */
#line 1083 "parser.y"
                                                { config.vgaemu_memsize = (yyvsp[0].i_value); }
#line 4232 "parser.c"
    break;

  case 204: /* x_flag: VESAMODE INTEGER INTEGER  */
#line 1084 "parser.y"
                                           { set_vesamodes((yyvsp[-1].i_value),(yyvsp[0].i_value),0);}
#line 4238 "parser.c"
    break;

  case 205: /* x_flag: VESAMODE INTEGER INTEGER INTEGER  */
#line 1085 "parser.y"
                                                   { set_vesamodes((yyvsp[-2].i_value),(yyvsp[-1].i_value),(yyvsp[0].i_value));}
#line 4244 "parser.c"
    break;

  case 206: /* x_flag: VESAMODE expression ',' expression  */
#line 1086 "parser.y"
                                                     { set_vesamodes((yyvsp[-2].i_value),(yyvsp[0].i_value),0);}
#line 4250 "parser.c"
    break;

  case 207: /* x_flag: VESAMODE expression ',' expression ',' expression  */
#line 1088 "parser.y"
                        { set_vesamodes((yyvsp[-4].i_value),(yyvsp[-2].i_value),(yyvsp[0].i_value));}
#line 4256 "parser.c"
    break;

  case 208: /* x_flag: X_LFB bool  */
#line 1089 "parser.y"
                                        { config.X_lfb = ((yyvsp[0].i_value)!=0); }
#line 4262 "parser.c"
    break;

  case 209: /* x_flag: X_PM_INTERFACE bool  */
#line 1090 "parser.y"
                                        { config.X_pm_interface = ((yyvsp[0].i_value)!=0); }
#line 4268 "parser.c"
    break;

  case 210: /* x_flag: X_MGRAB_KEY string_expr  */
#line 1091 "parser.y"
                                          { free(config.X_mgrab_key); config.X_mgrab_key = (yyvsp[0].s_value); }
#line 4274 "parser.c"
    break;

  case 211: /* x_flag: X_BACKGROUND_PAUSE bool  */
#line 1092 "parser.y"
                                                { config.X_background_pause = ((yyvsp[0].i_value)!=0); }
#line 4280 "parser.c"
    break;

  case 214: /* dexeflag: ALLOWDISK  */
#line 1099 "parser.y"
                                { if (!priv_lvl) dexe_forbid_disk = 0; }
#line 4286 "parser.c"
    break;

  case 215: /* dexeflag: FORCEXDOS  */
#line 1100 "parser.y"
                                {
			char *env = getenv("DISPLAY");
			if (env && env[0] && dexe_running) config.X = 1;
		}
#line 4295 "parser.c"
    break;

  case 216: /* dexeflag: XDOSONLY  */
#line 1104 "parser.y"
                                {
			char *env = getenv("DISPLAY");
			if (env && env[0] && dexe_running) config.X = 1;
			else if (dexe_running) {
			  yyerror("this DEXE requires X, giving up");
			  exit(99);
			}
		}
#line 4308 "parser.c"
    break;

  case 219: /* sound_flag: SB_BASE expression  */
#line 1119 "parser.y"
                                        { config.sb_base = (yyvsp[0].i_value); }
#line 4314 "parser.c"
    break;

  case 220: /* sound_flag: SB_DMA expression  */
#line 1120 "parser.y"
                                        { config.sb_dma = (yyvsp[0].i_value); }
#line 4320 "parser.c"
    break;

  case 221: /* sound_flag: SB_HDMA expression  */
#line 1121 "parser.y"
                                     { config.sb_hdma = (yyvsp[0].i_value); }
#line 4326 "parser.c"
    break;

  case 222: /* sound_flag: SB_IRQ expression  */
#line 1122 "parser.y"
                                        { config.sb_irq = (yyvsp[0].i_value); }
#line 4332 "parser.c"
    break;

  case 223: /* sound_flag: SB_MIXER string_expr  */
#line 1123 "parser.y"
                                             { free(config.sb_mixer); config.sb_mixer = (yyvsp[0].s_value); }
#line 4338 "parser.c"
    break;

  case 224: /* sound_flag: SB_DSP string_expr  */
#line 1124 "parser.y"
                                             { free(config.sb_dsp); config.sb_dsp = (yyvsp[0].s_value); }
#line 4344 "parser.c"
    break;

  case 225: /* sound_flag: MPU_BASE expression  */
#line 1125 "parser.y"
                                        { config.mpu401_base = (yyvsp[0].i_value); }
#line 4350 "parser.c"
    break;

  case 226: /* sound_flag: SOUND_DRIVER string_expr  */
#line 1126 "parser.y"
                                                { free(config.sound_driver); config.sound_driver = (yyvsp[0].s_value); }
#line 4356 "parser.c"
    break;

  case 229: /* snd_oss_flag: OSS_MIN_FRAGS expression  */
#line 1131 "parser.y"
                                                { config.oss_min_frags = (yyvsp[0].i_value); }
#line 4362 "parser.c"
    break;

  case 230: /* snd_oss_flag: OSS_MAX_FRAGS expression  */
#line 1132 "parser.y"
                                                { config.oss_max_frags = (yyvsp[0].i_value); }
#line 4368 "parser.c"
    break;

  case 231: /* snd_oss_flag: OSS_STALLED_FRAGS expression  */
#line 1133 "parser.y"
                                                { config.oss_stalled_frags = (yyvsp[0].i_value); }
#line 4374 "parser.c"
    break;

  case 232: /* snd_oss_flag: OSS_DO_POST bool  */
#line 1134 "parser.y"
                                                { config.oss_do_post = (yyvsp[0].i_value); }
#line 4380 "parser.c"
    break;

  case 233: /* snd_oss_flag: OSS_MIN_EXTRA_FRAGS expression  */
#line 1135 "parser.y"
                                                 { config.oss_min_extra_frags = (yyvsp[0].i_value); }
#line 4386 "parser.c"
    break;

  case 234: /* snd_oss_flag: OSS_DAC_FREQ expression  */
#line 1136 "parser.y"
                                                 { config.oss_dac_freq = (yyvsp[0].i_value); }
#line 4392 "parser.c"
    break;

  case 237: /* joystick_flag: JOY_DEVICE string_expr  */
#line 1144 "parser.y"
                                                { set_joy_device((yyvsp[0].s_value)); }
#line 4398 "parser.c"
    break;

  case 238: /* joystick_flag: JOY_DOS_MIN expression  */
#line 1145 "parser.y"
                                                { config.joy_dos_min = (yyvsp[0].i_value); }
#line 4404 "parser.c"
    break;

  case 239: /* joystick_flag: JOY_DOS_MAX expression  */
#line 1146 "parser.y"
                                                { config.joy_dos_max = (yyvsp[0].i_value); }
#line 4410 "parser.c"
    break;

  case 240: /* joystick_flag: JOY_GRANULARITY expression  */
#line 1147 "parser.y"
                                                { config.joy_granularity = (yyvsp[0].i_value); }
#line 4416 "parser.c"
    break;

  case 241: /* joystick_flag: JOY_LATENCY expression  */
#line 1148 "parser.y"
                                                { config.joy_latency = (yyvsp[0].i_value); }
#line 4422 "parser.c"
    break;

  case 244: /* video_flag: VGA  */
#line 1156 "parser.y"
                                        { config.cardtype = CARD_VGA; }
#line 4428 "parser.c"
    break;

  case 245: /* video_flag: MGA  */
#line 1157 "parser.y"
                                        { config.cardtype = CARD_MDA; }
#line 4434 "parser.c"
    break;

  case 246: /* video_flag: CGA  */
#line 1158 "parser.y"
                                        { config.cardtype = CARD_CGA; }
#line 4440 "parser.c"
    break;

  case 247: /* video_flag: EGA  */
#line 1159 "parser.y"
                                        { config.cardtype = CARD_EGA; }
#line 4446 "parser.c"
    break;

  case 248: /* video_flag: NONE  */
#line 1160 "parser.y"
                                        { config.cardtype = CARD_NONE; }
#line 4452 "parser.c"
    break;

  case 249: /* video_flag: CHIPSET CHIPSET_TYPE  */
#line 1162 "parser.y"
                    {
		    config.chipset = (yyvsp[0].i_value);
                    c_printf("CHIPSET: %d\n", (yyvsp[0].i_value));
		    }
#line 4461 "parser.c"
    break;

  case 250: /* video_flag: MEMSIZE expression  */
#line 1166 "parser.y"
                                        { config.gfxmemsize = (yyvsp[0].i_value); }
#line 4467 "parser.c"
    break;

  case 251: /* video_flag: GRAPHICS  */
#line 1168 "parser.y"
                    { config.vga = 1;
		    }
#line 4474 "parser.c"
    break;

  case 252: /* video_flag: GRAPHICS L_AUTO  */
#line 1171 "parser.y"
                    { config.vga = -1;
		    }
#line 4481 "parser.c"
    break;

  case 253: /* video_flag: CONSOLE  */
#line 1174 "parser.y"
                    { config.console_video = 1;
		    }
#line 4488 "parser.c"
    break;

  case 254: /* video_flag: CONSOLE L_AUTO  */
#line 1177 "parser.y"
                    { config.console_video = -1;
		    }
#line 4495 "parser.c"
    break;

  case 255: /* video_flag: FULLREST  */
#line 1179 "parser.y"
                                        { config.fullrestore = 1; }
#line 4501 "parser.c"
    break;

  case 256: /* video_flag: PARTREST  */
#line 1180 "parser.y"
                                        { config.fullrestore = 0; }
#line 4507 "parser.c"
    break;

  case 257: /* video_flag: VBIOS_FILE string_expr  */
#line 1181 "parser.y"
                                                { free(config.vbios_file); config.vbios_file = (yyvsp[0].s_value);
					  config.mapped_bios = 1;
					  config.vbios_copy = 0; }
#line 4515 "parser.c"
    break;

  case 258: /* video_flag: VGAEMUBIOS_FILE string_expr  */
#line 1184 "parser.y"
                                                { free(config.vgaemubios_file); config.vgaemubios_file = (yyvsp[0].s_value); }
#line 4521 "parser.c"
    break;

  case 259: /* video_flag: VBIOS_COPY  */
#line 1185 "parser.y"
                                        { free(config.vbios_file);
					  config.vbios_file = NULL;
					  config.mapped_bios = 1;
					  config.vbios_copy = 1; }
#line 4530 "parser.c"
    break;

  case 260: /* video_flag: VBIOS_MMAP  */
#line 1189 "parser.y"
                                        { free(config.vbios_file);
					  config.vbios_file = NULL;
					  config.mapped_bios = 1;
					  config.vbios_copy = 1; }
#line 4539 "parser.c"
    break;

  case 261: /* video_flag: VBIOS_SEG expression  */
#line 1194 "parser.y"
                   {
		   config.vbios_seg = (yyvsp[0].i_value);
		   c_printf("CONF: VGA-BIOS-Segment %x\n", (yyvsp[0].i_value));
		   if (((yyvsp[0].i_value) != 0xe000) && ((yyvsp[0].i_value) != 0xc000))
		      {
		      config.vbios_seg = detect_vbios_seg();
		      if (config.vbios_seg == -1) config.vbios_seg = 0xc000;
		      c_printf("CONF: VGA-BIOS-Segment set to 0x%x\n", config.vbios_seg);
		      }
		   }
#line 4554 "parser.c"
    break;

  case 262: /* video_flag: VBIOS_SIZE_TOK expression  */
#line 1205 "parser.y"
                   {
		   config.vbios_size = (yyvsp[0].i_value);
		   c_printf("CONF: VGA-BIOS-Size %x\n", (yyvsp[0].i_value));
		   if (((yyvsp[0].i_value) != 0x8000) && ((yyvsp[0].i_value) != 0x10000))
		      {
		      config.vbios_size = detect_vbios_size();
		      if (config.vbios_size == -1) config.vbios_size = 0x10000;
		      c_printf("CONF: VGA-BIOS-Size set to 0x%x\n", config.vbios_size);
		      }
		   }
#line 4569 "parser.c"
    break;

  case 263: /* video_flag: VBIOS_POST  */
#line 1215 "parser.y"
                                        { config.vbios_post = 1; }
#line 4575 "parser.c"
    break;

  case 264: /* video_flag: DUALMON  */
#line 1216 "parser.y"
                                        { config.dualmon = 1; }
#line 4581 "parser.c"
    break;

  case 265: /* video_flag: FORCE_VT_SWITCH  */
#line 1217 "parser.y"
                                        { config.force_vt_switch = 1; }
#line 4587 "parser.c"
    break;

  case 266: /* video_flag: PCI  */
#line 1218 "parser.y"
                                        { config.pci_video = 1; }
#line 4593 "parser.c"
    break;

  case 267: /* video_flag: STRING  */
#line 1220 "parser.y"
                    { yyerror("unrecognized video option '%s'", (yyvsp[0].s_value));
		      free((yyvsp[0].s_value)); }
#line 4600 "parser.c"
    break;

  case 271: /* term_flag: ESCCHAR expression  */
#line 1230 "parser.y"
                                           { config.term_esc_char = (yyvsp[0].i_value); }
#line 4606 "parser.c"
    break;

  case 272: /* term_flag: UPDATEFREQ expression  */
#line 1231 "parser.y"
                                        { config.term_updatefreq = (yyvsp[0].i_value); }
#line 4612 "parser.c"
    break;

  case 273: /* term_flag: COLOR bool  */
#line 1232 "parser.y"
                                        { config.term_color = ((yyvsp[0].i_value)!=0); }
#line 4618 "parser.c"
    break;

  case 274: /* term_flag: STRING  */
#line 1234 "parser.y"
                    { yyerror("unrecognized terminal option '%s'", (yyvsp[0].s_value));
		      free((yyvsp[0].s_value)); }
#line 4625 "parser.c"
    break;

  case 278: /* debug_flag: VIDEO bool  */
#line 1248 "parser.y"
                                        { set_debug_level('v', ((yyvsp[0].i_value)!=0)); }
#line 4631 "parser.c"
    break;

  case 279: /* debug_flag: L_OFF  */
#line 1249 "parser.y"
                                        { set_debug_level('a', 0); }
#line 4637 "parser.c"
    break;

  case 280: /* debug_flag: SERIAL bool  */
#line 1250 "parser.y"
                                        { set_debug_level('s', ((yyvsp[0].i_value)!=0)); }
#line 4643 "parser.c"
    break;

  case 281: /* debug_flag: CONFIG bool  */
#line 1251 "parser.y"
                                        { set_debug_level('c', ((yyvsp[0].i_value)!=0)); }
#line 4649 "parser.c"
    break;

  case 282: /* debug_flag: DISK bool  */
#line 1252 "parser.y"
                                        { set_debug_level('d', ((yyvsp[0].i_value)!=0)); }
#line 4655 "parser.c"
    break;

  case 283: /* debug_flag: READ bool  */
#line 1253 "parser.y"
                                        { set_debug_level('R', ((yyvsp[0].i_value)!=0)); }
#line 4661 "parser.c"
    break;

  case 284: /* debug_flag: WRITE bool  */
#line 1254 "parser.y"
                                        { set_debug_level('W', ((yyvsp[0].i_value)!=0)); }
#line 4667 "parser.c"
    break;

  case 285: /* debug_flag: KEYB bool  */
#line 1255 "parser.y"
                                        { set_debug_level('k', ((yyvsp[0].i_value)!=0)); }
#line 4673 "parser.c"
    break;

  case 286: /* debug_flag: KEYBOARD bool  */
#line 1256 "parser.y"
                                        { set_debug_level('k', ((yyvsp[0].i_value)!=0)); }
#line 4679 "parser.c"
    break;

  case 287: /* debug_flag: PRINTER bool  */
#line 1257 "parser.y"
                                        { set_debug_level('p', ((yyvsp[0].i_value)!=0)); }
#line 4685 "parser.c"
    break;

  case 288: /* debug_flag: IO bool  */
#line 1258 "parser.y"
                                        { set_debug_level('i', ((yyvsp[0].i_value)!=0)); }
#line 4691 "parser.c"
    break;

  case 289: /* debug_flag: PORT bool  */
#line 1259 "parser.y"
                                        { set_debug_level('i', ((yyvsp[0].i_value)!=0)); }
#line 4697 "parser.c"
    break;

  case 290: /* debug_flag: WARNING bool  */
#line 1260 "parser.y"
                                        { set_debug_level('w', ((yyvsp[0].i_value)!=0)); }
#line 4703 "parser.c"
    break;

  case 291: /* debug_flag: GENERAL bool  */
#line 1261 "parser.y"
                                        { set_debug_level('g', ((yyvsp[0].i_value)!=0)); }
#line 4709 "parser.c"
    break;

  case 292: /* debug_flag: L_XMS bool  */
#line 1262 "parser.y"
                                        { set_debug_level('X', ((yyvsp[0].i_value)!=0)); }
#line 4715 "parser.c"
    break;

  case 293: /* debug_flag: L_DPMI bool  */
#line 1263 "parser.y"
                                        { set_debug_level('M', ((yyvsp[0].i_value)!=0)); }
#line 4721 "parser.c"
    break;

  case 294: /* debug_flag: MOUSE bool  */
#line 1264 "parser.y"
                                        { set_debug_level('m', ((yyvsp[0].i_value)!=0)); }
#line 4727 "parser.c"
    break;

  case 295: /* debug_flag: HARDWARE bool  */
#line 1265 "parser.y"
                                        { set_debug_level('h', ((yyvsp[0].i_value)!=0)); }
#line 4733 "parser.c"
    break;

  case 296: /* debug_flag: L_IPC bool  */
#line 1266 "parser.y"
                                        { set_debug_level('I', ((yyvsp[0].i_value)!=0)); }
#line 4739 "parser.c"
    break;

  case 297: /* debug_flag: L_EMS bool  */
#line 1267 "parser.y"
                                        { set_debug_level('E', ((yyvsp[0].i_value)!=0)); }
#line 4745 "parser.c"
    break;

  case 298: /* debug_flag: NETWORK bool  */
#line 1268 "parser.y"
                                        { set_debug_level('n', ((yyvsp[0].i_value)!=0)); }
#line 4751 "parser.c"
    break;

  case 299: /* debug_flag: L_X bool  */
#line 1269 "parser.y"
                                        { set_debug_level('X', ((yyvsp[0].i_value)!=0)); }
#line 4757 "parser.c"
    break;

  case 300: /* debug_flag: SOUND bool  */
#line 1270 "parser.y"
                                        { set_debug_level('S', ((yyvsp[0].i_value)!=0)); }
#line 4763 "parser.c"
    break;

  case 301: /* debug_flag: JOYSTICK bool  */
#line 1271 "parser.y"
                                        { set_debug_level('j', ((yyvsp[0].i_value)!=0)); }
#line 4769 "parser.c"
    break;

  case 302: /* debug_flag: STRING  */
#line 1273 "parser.y"
                    { yyerror("unrecognized debug flag '%s'", (yyvsp[0].s_value)); free((yyvsp[0].s_value)); }
#line 4775 "parser.c"
    break;

  case 306: /* mouse_flag: DEVICE string_expr  */
#line 1282 "parser.y"
                                        { free(mptr->dev); mptr->dev = (yyvsp[0].s_value); }
#line 4781 "parser.c"
    break;

  case 307: /* mouse_flag: INTERNALDRIVER  */
#line 1283 "parser.y"
                                        { mptr->intdrv = TRUE; }
#line 4787 "parser.c"
    break;

  case 308: /* mouse_flag: EMULATE3BUTTONS  */
#line 1284 "parser.y"
                                        { mptr->emulate3buttons = TRUE; }
#line 4793 "parser.c"
    break;

  case 309: /* mouse_flag: BAUDRATE expression  */
#line 1285 "parser.y"
                                        { mptr->baudRate = (yyvsp[0].i_value); }
#line 4799 "parser.c"
    break;

  case 310: /* mouse_flag: CLEARDTR  */
#line 1287 "parser.y"
                    { if (mptr->type == MOUSE_MOUSESYSTEMS)
			 mptr->cleardtr = TRUE;
		      else
			 yyerror("option CLEARDTR is only valid for MicroSystems-mice");
		    }
#line 4809 "parser.c"
    break;

  case 311: /* mouse_flag: MICROSOFT  */
#line 1293 "parser.y"
                  {
		  mptr->type = MOUSE_MICROSOFT;
		  mptr->flags = CS7 | CREAD | CLOCAL | HUPCL;
		  }
#line 4818 "parser.c"
    break;

  case 312: /* mouse_flag: MS3BUTTON  */
#line 1298 "parser.y"
                  {
		  mptr->type = MOUSE_MS3BUTTON;
		  mptr->flags = CS7 | CREAD | CLOCAL | HUPCL;
		  }
#line 4827 "parser.c"
    break;

  case 313: /* mouse_flag: MOUSESYSTEMS  */
#line 1303 "parser.y"
                  {
		  mptr->type = MOUSE_MOUSESYSTEMS;
		  mptr->flags = CS8 | CREAD | CLOCAL | HUPCL;
/* is cstopb needed?  mptr->flags = CS8 | CSTOPB | CREAD | CLOCAL | HUPCL; */
		  }
#line 4837 "parser.c"
    break;

  case 314: /* mouse_flag: MMSERIES  */
#line 1309 "parser.y"
                  {
		  mptr->type = MOUSE_MMSERIES;
		  mptr->flags = CS8 | PARENB | PARODD | CREAD | CLOCAL | HUPCL;
		  }
#line 4846 "parser.c"
    break;

  case 315: /* mouse_flag: LOGITECH  */
#line 1314 "parser.y"
                  {
		  mptr->type = MOUSE_LOGITECH;
		  mptr->flags = CS8 | CSTOPB | CREAD | CLOCAL | HUPCL;
		  }
#line 4855 "parser.c"
    break;

  case 316: /* mouse_flag: PS2  */
#line 1319 "parser.y"
                  {
		  mptr->type = MOUSE_PS2;
		  mptr->flags = 0;
		  }
#line 4864 "parser.c"
    break;

  case 317: /* mouse_flag: IMPS2  */
#line 1324 "parser.y"
                  {
		  mptr->type = MOUSE_IMPS2;
		  mptr->flags = 0;
		  }
#line 4873 "parser.c"
    break;

  case 318: /* mouse_flag: MOUSEMAN  */
#line 1329 "parser.y"
                  {
		  mptr->type = MOUSE_MOUSEMAN;
		  mptr->flags = CS7 | CREAD | CLOCAL | HUPCL;
		  }
#line 4882 "parser.c"
    break;

  case 319: /* mouse_flag: HITACHI  */
#line 1334 "parser.y"
                  {
		  mptr->type = MOUSE_HITACHI;
		  mptr->flags = CS8 | CREAD | CLOCAL | HUPCL;
		  }
#line 4891 "parser.c"
    break;

  case 320: /* mouse_flag: BUSMOUSE  */
#line 1339 "parser.y"
                  {
		  mptr->type = MOUSE_BUSMOUSE;
		  mptr->flags = 0;
		  }
#line 4900 "parser.c"
    break;

  case 321: /* mouse_flag: STRING  */
#line 1344 "parser.y"
                    { yyerror("unrecognized mouse flag '%s'", (yyvsp[0].s_value)); free((yyvsp[0].s_value)); }
#line 4906 "parser.c"
    break;

  case 325: /* keyboard_flag: LAYOUT KEYB_LAYOUT  */
#line 1353 "parser.y"
                                        { keyb_layout((yyvsp[0].i_value)); }
#line 4912 "parser.c"
    break;

  case 326: /* $@15: %empty  */
#line 1354 "parser.y"
                                     {keyb_layout((yyvsp[0].i_value));}
#line 4918 "parser.c"
    break;

  case 328: /* keyboard_flag: LAYOUT L_NO  */
#line 1355 "parser.y"
                                        { keyb_layout(KEYB_NO); }
#line 4924 "parser.c"
    break;

  case 329: /* keyboard_flag: LAYOUT L_AUTO  */
#line 1356 "parser.y"
                                        { keyb_layout(-1); }
#line 4930 "parser.c"
    break;

  case 330: /* keyboard_flag: RAWKEYBOARD bool  */
#line 1357 "parser.y"
                                        { config.console_keyb = (yyvsp[0].i_value); }
#line 4936 "parser.c"
    break;

  case 331: /* keyboard_flag: STRING  */
#line 1359 "parser.y"
                    { yyerror("unrecognized keyboard flag '%s'", (yyvsp[0].s_value));
		      free((yyvsp[0].s_value));}
#line 4943 "parser.c"
    break;

  case 335: /* $@16: %empty  */
#line 1368 "parser.y"
                                          { keyb_mod('C', (yyvsp[-1].i_value), 0); }
#line 4949 "parser.c"
    break;

  case 337: /* $@17: %empty  */
#line 1369 "parser.y"
                                               { keyb_mod('a', (yyvsp[-1].i_value), 0); }
#line 4955 "parser.c"
    break;

  case 339: /* $@18: %empty  */
#line 1370 "parser.y"
                                              { keyb_mod('c', (yyvsp[-1].i_value), 0); }
#line 4961 "parser.c"
    break;

  case 341: /* $@19: %empty  */
#line 1371 "parser.y"
                                 { keyb_mod(' ', (yyvsp[-1].i_value), 0); }
#line 4967 "parser.c"
    break;

  case 343: /* $@20: %empty  */
#line 1372 "parser.y"
                                           { keyb_mod('S', (yyvsp[-1].i_value), 0); }
#line 4973 "parser.c"
    break;

  case 345: /* $@21: %empty  */
#line 1373 "parser.y"
                                         { keyb_mod('A', (yyvsp[-1].i_value), 0); }
#line 4979 "parser.c"
    break;

  case 347: /* $@22: %empty  */
#line 1374 "parser.y"
                                            { keyb_mod('N', (yyvsp[-1].i_value), 0); }
#line 4985 "parser.c"
    break;

  case 351: /* keyboard_modval: UNICODE  */
#line 1381 "parser.y"
                          { keyb_mod(0, (yyvsp[0].i_value), 1); }
#line 4991 "parser.c"
    break;

  case 352: /* keyboard_modval: DGRAVE  */
#line 1382 "parser.y"
                         { keyb_mod(0, KEY_DEAD_GRAVE, 1); }
#line 4997 "parser.c"
    break;

  case 353: /* keyboard_modval: DACUTE  */
#line 1383 "parser.y"
                         { keyb_mod(0, KEY_DEAD_ACUTE, 1); }
#line 5003 "parser.c"
    break;

  case 354: /* keyboard_modval: DCIRCUM  */
#line 1384 "parser.y"
                          { keyb_mod(0, KEY_DEAD_CIRCUMFLEX, 1); }
#line 5009 "parser.c"
    break;

  case 355: /* keyboard_modval: DTILDE  */
#line 1385 "parser.y"
                         { keyb_mod(0, KEY_DEAD_TILDE, 1); }
#line 5015 "parser.c"
    break;

  case 356: /* keyboard_modval: DBREVE  */
#line 1386 "parser.y"
                         { keyb_mod(0, KEY_DEAD_BREVE, 1); }
#line 5021 "parser.c"
    break;

  case 357: /* keyboard_modval: DABOVED  */
#line 1387 "parser.y"
                          { keyb_mod(0, KEY_DEAD_ABOVEDOT, 1); }
#line 5027 "parser.c"
    break;

  case 358: /* keyboard_modval: DDIARES  */
#line 1388 "parser.y"
                          { keyb_mod(0, KEY_DEAD_DIAERESIS, 1); }
#line 5033 "parser.c"
    break;

  case 359: /* keyboard_modval: DABOVER  */
#line 1389 "parser.y"
                          { keyb_mod(0, KEY_DEAD_ABOVERING, 1); }
#line 5039 "parser.c"
    break;

  case 360: /* keyboard_modval: DDACUTE  */
#line 1390 "parser.y"
                          { keyb_mod(0, KEY_DEAD_DOUBLEACUTE, 1); }
#line 5045 "parser.c"
    break;

  case 361: /* keyboard_modval: DCEDILLA  */
#line 1391 "parser.y"
                           { keyb_mod(0, KEY_DEAD_CEDILLA, 1); }
#line 5051 "parser.c"
    break;

  case 362: /* keyboard_modval: DIOTA  */
#line 1392 "parser.y"
                        { keyb_mod(0, KEY_VOID, 1); }
#line 5057 "parser.c"
    break;

  case 363: /* keyboard_modval: DOGONEK  */
#line 1393 "parser.y"
                          { keyb_mod(0,KEY_DEAD_OGONEK, 1); }
#line 5063 "parser.c"
    break;

  case 364: /* keyboard_modval: DCARON  */
#line 1394 "parser.y"
                         { keyb_mod(0, KEY_DEAD_CARON, 1); }
#line 5069 "parser.c"
    break;

  case 365: /* keyboard_modval: INTEGER  */
#line 1395 "parser.y"
                          { keyb_mod(0, (yyvsp[0].i_value), 0); }
#line 5075 "parser.c"
    break;

  case 366: /* keyboard_modval: '(' expression ')'  */
#line 1396 "parser.y"
                                     { keyb_mod(0, (yyvsp[-1].i_value), 0); }
#line 5081 "parser.c"
    break;

  case 367: /* keyboard_modval: string_unquoted  */
#line 1397 "parser.y"
                                  {
			char *p = (yyvsp[0].s_value);
			while (*p) keyb_mod(0, *p++, 0);
			free((yyvsp[0].s_value));
		}
#line 5091 "parser.c"
    break;

  case 370: /* ttylocks_flag: DIRECTORY string_expr  */
#line 1409 "parser.y"
                                        { free(config.tty_lockdir); config.tty_lockdir = (yyvsp[0].s_value); }
#line 5097 "parser.c"
    break;

  case 371: /* ttylocks_flag: NAMESTUB string_expr  */
#line 1410 "parser.y"
                                        { free(config.tty_lockfile); config.tty_lockfile = (yyvsp[0].s_value); }
#line 5103 "parser.c"
    break;

  case 372: /* ttylocks_flag: BINARY  */
#line 1411 "parser.y"
                                        { config.tty_lockbinary = TRUE; }
#line 5109 "parser.c"
    break;

  case 373: /* ttylocks_flag: STRING  */
#line 1413 "parser.y"
                    { yyerror("unrecognized ttylocks flag '%s'", (yyvsp[0].s_value)); free((yyvsp[0].s_value)); }
#line 5115 "parser.c"
    break;

  case 377: /* serial_flag: DEVICE string_expr  */
#line 1422 "parser.y"
                                                { free(sptr->dev); sptr->dev = (yyvsp[0].s_value);
					  if (!strcmp("/dev/mouse",sptr->dev)) sptr->mouse=1; }
#line 5122 "parser.c"
    break;

  case 378: /* serial_flag: VIRTUAL  */
#line 1424 "parser.y"
                                          {
					   if (isatty(0)) {
					     sptr->virtual = TRUE;
					     sptr->pseudo = TRUE;
					     no_local_video = 1;
					     sptr->dev = strdup(ttyname(0));
					   } else {
					     error("FD 0 is not a tty, can't "
					           "use a virtual com port\n");
					     exit(1);
					   }
					  }
#line 5139 "parser.c"
    break;

  case 379: /* serial_flag: PSEUDO  */
#line 1436 "parser.y"
                                          { sptr->pseudo = TRUE; }
#line 5145 "parser.c"
    break;

  case 380: /* serial_flag: RTSCTS  */
#line 1437 "parser.y"
                                          { sptr->system_rtscts = TRUE; }
#line 5151 "parser.c"
    break;

  case 381: /* serial_flag: LOWLAT  */
#line 1438 "parser.y"
                                          { sptr->low_latency = TRUE; }
#line 5157 "parser.c"
    break;

  case 382: /* serial_flag: PCCOM  */
#line 1439 "parser.y"
                                          { sptr->custom = SER_CUSTOM_PCCOM; }
#line 5163 "parser.c"
    break;

  case 383: /* serial_flag: COM expression  */
#line 1440 "parser.y"
                                          { sptr->real_comport = (yyvsp[0].i_value); }
#line 5169 "parser.c"
    break;

  case 384: /* serial_flag: BASE expression  */
#line 1441 "parser.y"
                                                { sptr->base_port = (yyvsp[0].i_value); }
#line 5175 "parser.c"
    break;

  case 385: /* serial_flag: IRQ expression  */
#line 1442 "parser.y"
                                                { sptr->irq = (yyvsp[0].i_value); }
#line 5181 "parser.c"
    break;

  case 386: /* serial_flag: MOUSE  */
#line 1443 "parser.y"
                                        { sptr->mouse = 1; }
#line 5187 "parser.c"
    break;

  case 387: /* serial_flag: STRING  */
#line 1445 "parser.y"
                    { yyerror("unrecognized serial flag '%s'", (yyvsp[0].s_value)); free((yyvsp[0].s_value)); }
#line 5193 "parser.c"
    break;

  case 391: /* printer_flag: LPT expression  */
#line 1454 "parser.y"
                                        { c_printers = (yyvsp[0].i_value) - 1; }
#line 5199 "parser.c"
    break;

  case 392: /* printer_flag: COMMAND string_expr  */
#line 1455 "parser.y"
                                        { pptr->prtcmd = (yyvsp[0].s_value); }
#line 5205 "parser.c"
    break;

  case 393: /* printer_flag: TIMEOUT expression  */
#line 1456 "parser.y"
                                        { pptr->delay = (yyvsp[0].i_value); }
#line 5211 "parser.c"
    break;

  case 394: /* printer_flag: L_FILE string_expr  */
#line 1457 "parser.y"
                                                { pptr->dev = (yyvsp[0].s_value); }
#line 5217 "parser.c"
    break;

  case 395: /* printer_flag: BASE expression  */
#line 1458 "parser.y"
                                                { pptr->base_port = (yyvsp[0].i_value); }
#line 5223 "parser.c"
    break;

  case 396: /* printer_flag: STRING  */
#line 1460 "parser.y"
                    { yyerror("unrecognized printer flag %s", (yyvsp[0].s_value)); free((yyvsp[0].s_value)); }
#line 5229 "parser.c"
    break;

  case 398: /* optbootfile: BOOTFILE string_expr  */
#line 1467 "parser.y"
                  {
		  if (dptr->boot_name != NULL)
		    yyerror("Two names for a boot-image file or device given.");
		  dptr->boot_name = (yyvsp[0].s_value);
                  }
#line 5239 "parser.c"
    break;

  case 402: /* disk_flag: READONLY  */
#line 1478 "parser.y"
                                        { dptr->wantrdonly = 1; }
#line 5245 "parser.c"
    break;

  case 403: /* disk_flag: THREEINCH  */
#line 1479 "parser.y"
                                { dptr->default_cmos = THREE_INCH_FLOPPY; }
#line 5251 "parser.c"
    break;

  case 404: /* disk_flag: THREEINCH_2880  */
#line 1480 "parser.y"
                                        { dptr->default_cmos = THREE_INCH_288MFLOP; }
#line 5257 "parser.c"
    break;

  case 405: /* disk_flag: THREEINCH_720  */
#line 1481 "parser.y"
                                { dptr->default_cmos = THREE_INCH_720KFLOP; }
#line 5263 "parser.c"
    break;

  case 406: /* disk_flag: ATAPI  */
#line 1482 "parser.y"
                                { dptr->default_cmos = ATAPI_FLOPPY; }
#line 5269 "parser.c"
    break;

  case 407: /* disk_flag: FIVEINCH  */
#line 1483 "parser.y"
                                { dptr->default_cmos = FIVE_INCH_FLOPPY; }
#line 5275 "parser.c"
    break;

  case 408: /* disk_flag: FIVEINCH_360  */
#line 1484 "parser.y"
                                { dptr->default_cmos = FIVE_INCH_360KFLOP; }
#line 5281 "parser.c"
    break;

  case 409: /* disk_flag: DISKCYL4096  */
#line 1485 "parser.y"
                                { dptr->diskcyl4096 = 1; }
#line 5287 "parser.c"
    break;

  case 410: /* disk_flag: SECTORS expression  */
#line 1486 "parser.y"
                                        { dptr->sectors = (yyvsp[0].i_value); }
#line 5293 "parser.c"
    break;

  case 411: /* disk_flag: CYLINDERS expression  */
#line 1487 "parser.y"
                                        { dptr->tracks = (yyvsp[0].i_value); }
#line 5299 "parser.c"
    break;

  case 412: /* disk_flag: TRACKS expression  */
#line 1488 "parser.y"
                                        { dptr->tracks = (yyvsp[0].i_value); }
#line 5305 "parser.c"
    break;

  case 413: /* disk_flag: HEADS expression  */
#line 1489 "parser.y"
                                                { dptr->heads = (yyvsp[0].i_value); }
#line 5311 "parser.c"
    break;

  case 414: /* disk_flag: OFFSET expression  */
#line 1490 "parser.y"
                                        { dptr->header = (yyvsp[0].i_value); }
#line 5317 "parser.c"
    break;

  case 415: /* disk_flag: DEVICE string_expr optbootfile  */
#line 1492 "parser.y"
                  {
		  if (dptr->dev_name != NULL)
		    yyerror("Two names for a disk-image file or device given.");
		  dptr->dev_name = (yyvsp[-1].s_value);
		  }
#line 5327 "parser.c"
    break;

  case 416: /* disk_flag: L_FILE string_expr  */
#line 1498 "parser.y"
                  {
		  if (dptr->dev_name != NULL)
		    yyerror("Two names for a disk-image file or device given.");
		  dptr->dev_name = (yyvsp[0].s_value);
		  }
#line 5337 "parser.c"
    break;

  case 417: /* disk_flag: HDIMAGE string_expr  */
#line 1504 "parser.y"
                  {
		  if (dptr->dev_name != NULL)
		    yyerror("Two names for a harddisk-image file given.");
		  dptr->type = IMAGE;
		  dptr->header = HEADER_SIZE;
		  dptr->dev_name = (yyvsp[0].s_value);
		  }
#line 5349 "parser.c"
    break;

  case 418: /* disk_flag: WHOLEDISK STRING optbootfile  */
#line 1512 "parser.y"
                  {
		  if (dptr->dev_name != NULL)
		    yyerror("Two names for a harddisk given.");
		  dptr->type = HDISK;
		  dptr->dev_name = (yyvsp[-1].s_value);
		  }
#line 5360 "parser.c"
    break;

  case 419: /* disk_flag: L_FLOPPY string_expr  */
#line 1519 "parser.y"
                  {
		  if (dptr->dev_name != NULL)
		    yyerror("Two names for a floppy-device given.");
		  dptr->type = FLOPPY;
		  dptr->dev_name = (yyvsp[0].s_value);
		  }
#line 5371 "parser.c"
    break;

  case 420: /* disk_flag: L_PARTITION string_expr INTEGER optbootfile  */
#line 1526 "parser.y"
                  {
                  yywarn("{ partition \"%s\" %d } the"
			 " token '%d' is ignored and can be removed.",
			 (yyvsp[-2].s_value),(yyvsp[-1].i_value),(yyvsp[-1].i_value));
		  do_part((yyvsp[-2].s_value));
		  }
#line 5382 "parser.c"
    break;

  case 421: /* disk_flag: L_PARTITION string_expr optbootfile  */
#line 1533 "parser.y"
                  { do_part((yyvsp[-1].s_value)); }
#line 5388 "parser.c"
    break;

  case 422: /* disk_flag: DIRECTORY string_expr  */
#line 1535 "parser.y"
                  {
		  if (dptr->dev_name != NULL)
		    yyerror("Two names for a directory given.");
		  dptr->type = DIR_TYPE;
		  dptr->dev_name = (yyvsp[0].s_value);
		  }
#line 5399 "parser.c"
    break;

  case 423: /* disk_flag: STRING  */
#line 1542 "parser.y"
                    { yyerror("unrecognized disk flag '%s'\n", (yyvsp[0].s_value)); free((yyvsp[0].s_value)); }
#line 5405 "parser.c"
    break;

  case 427: /* port_flag: INTEGER  */
#line 1552 "parser.y"
                   {
		   c_printf("CONF: I/O port 0x%04x\n", (unsigned short)(yyvsp[0].i_value));
	           allow_io((yyvsp[0].i_value), 1, ports_permission, ports_ormask,
	                    ports_andmask, portspeed, (char*)dev_name);
		   if (abs(portspeed)) portspeed += ((portspeed>0) ? 1 : -1);
	           }
#line 5416 "parser.c"
    break;

  case 428: /* port_flag: '(' expression ')'  */
#line 1559 "parser.y"
                   {
	           allow_io((yyvsp[-1].i_value), 1, ports_permission, ports_ormask,
	                    ports_andmask, portspeed, (char*)dev_name);
		   if (abs(portspeed)) portspeed += ((portspeed>0) ? 1 : -1);
	           }
#line 5426 "parser.c"
    break;

  case 429: /* port_flag: RANGE INTEGER INTEGER  */
#line 1565 "parser.y"
                   {
		   if (abs(portspeed) > 1) portspeed = 0;
		   c_printf("CONF: range of I/O ports 0x%04x-0x%04x\n",
			    (unsigned short)(yyvsp[-1].i_value), (unsigned short)(yyvsp[0].i_value));
		   allow_io((yyvsp[-1].i_value), (yyvsp[0].i_value) - (yyvsp[-1].i_value) + 1, ports_permission, ports_ormask,
			    ports_andmask, portspeed, (char*)dev_name);
		   portspeed=0;
		   strcpy(dev_name,"");
		   }
#line 5440 "parser.c"
    break;

  case 430: /* port_flag: RANGE expression ',' expression  */
#line 1575 "parser.y"
                   {
		   if (abs(portspeed) > 1) portspeed = 0;
		   c_printf("CONF: range of I/O ports 0x%04x-0x%04x\n",
			    (unsigned short)(yyvsp[-2].i_value), (unsigned short)(yyvsp[0].i_value));
		   allow_io((yyvsp[-2].i_value), (yyvsp[0].i_value) - (yyvsp[-2].i_value) + 1, ports_permission, ports_ormask,
			    ports_andmask, portspeed, (char*)dev_name);
		   portspeed=0;
		   strcpy(dev_name,"");
		   }
#line 5454 "parser.c"
    break;

  case 431: /* port_flag: RDONLY  */
#line 1584 "parser.y"
                                        { ports_permission = IO_READ; }
#line 5460 "parser.c"
    break;

  case 432: /* port_flag: WRONLY  */
#line 1585 "parser.y"
                                        { ports_permission = IO_WRITE; }
#line 5466 "parser.c"
    break;

  case 433: /* port_flag: RDWR  */
#line 1586 "parser.y"
                                        { ports_permission = IO_RDWR; }
#line 5472 "parser.c"
    break;

  case 434: /* port_flag: ORMASK expression  */
#line 1587 "parser.y"
                                        { ports_ormask = (yyvsp[0].i_value); }
#line 5478 "parser.c"
    break;

  case 435: /* port_flag: ANDMASK expression  */
#line 1588 "parser.y"
                                        { ports_andmask = (yyvsp[0].i_value); }
#line 5484 "parser.c"
    break;

  case 436: /* port_flag: FAST  */
#line 1589 "parser.y"
                                        { portspeed = 1; }
#line 5490 "parser.c"
    break;

  case 437: /* port_flag: SLOW  */
#line 1590 "parser.y"
                                        { portspeed = -1; }
#line 5496 "parser.c"
    break;

  case 438: /* port_flag: DEVICE string_expr  */
#line 1591 "parser.y"
                                             { strcpy(dev_name,(yyvsp[0].s_value)); free((yyvsp[0].s_value)); }
#line 5502 "parser.c"
    break;

  case 439: /* port_flag: STRING  */
#line 1593 "parser.y"
                    { yyerror("unrecognized port command '%s'", (yyvsp[0].s_value));
		      free((yyvsp[0].s_value)); }
#line 5509 "parser.c"
    break;

  case 443: /* trace_port_flag: INTEGER  */
#line 1602 "parser.y"
                        { register_port_traceing((yyvsp[0].i_value), (yyvsp[0].i_value)); }
#line 5515 "parser.c"
    break;

  case 444: /* trace_port_flag: '(' expression ')'  */
#line 1604 "parser.y"
                        { register_port_traceing((yyvsp[-1].i_value), (yyvsp[-1].i_value)); }
#line 5521 "parser.c"
    break;

  case 445: /* trace_port_flag: RANGE INTEGER INTEGER  */
#line 1606 "parser.y"
                        { register_port_traceing((yyvsp[-1].i_value), (yyvsp[0].i_value)); }
#line 5527 "parser.c"
    break;

  case 446: /* trace_port_flag: RANGE expression ',' expression  */
#line 1608 "parser.y"
                        { register_port_traceing((yyvsp[-2].i_value), (yyvsp[0].i_value)); }
#line 5533 "parser.c"
    break;

  case 447: /* trace_port_flag: CLEAR  */
#line 1609 "parser.y"
                        { clear_port_traceing(); }
#line 5539 "parser.c"
    break;

  case 448: /* trace_port_flag: STRING  */
#line 1611 "parser.y"
                    { yyerror("unrecognized port trace command '%s'", (yyvsp[0].s_value));
		      free((yyvsp[0].s_value)); }
#line 5546 "parser.c"
    break;

  case 452: /* sillyint_flag: INTEGER  */
#line 1621 "parser.y"
                          { set_irq_value(1, (yyvsp[0].i_value)); }
#line 5552 "parser.c"
    break;

  case 453: /* sillyint_flag: '(' expression ')'  */
#line 1622 "parser.y"
                                     { set_irq_value(1, (yyvsp[-1].i_value)); }
#line 5558 "parser.c"
    break;

  case 454: /* sillyint_flag: USE_SIGIO expression  */
#line 1623 "parser.y"
                                       { set_irq_value(0x10001, (yyvsp[0].i_value)); }
#line 5564 "parser.c"
    break;

  case 455: /* sillyint_flag: RANGE INTEGER INTEGER  */
#line 1624 "parser.y"
                                        { set_irq_range(1, (yyvsp[-1].i_value), (yyvsp[0].i_value)); }
#line 5570 "parser.c"
    break;

  case 456: /* sillyint_flag: RANGE expression ',' expression  */
#line 1625 "parser.y"
                                                  { set_irq_range(1, (yyvsp[-2].i_value), (yyvsp[0].i_value)); }
#line 5576 "parser.c"
    break;

  case 457: /* sillyint_flag: USE_SIGIO RANGE INTEGER INTEGER  */
#line 1626 "parser.y"
                                                  { set_irq_range(0x10001, (yyvsp[-1].i_value), (yyvsp[0].i_value)); }
#line 5582 "parser.c"
    break;

  case 458: /* sillyint_flag: USE_SIGIO RANGE expression ',' expression  */
#line 1627 "parser.y"
                                                            { set_irq_range(0x10001, (yyvsp[-2].i_value), (yyvsp[0].i_value)); }
#line 5588 "parser.c"
    break;

  case 459: /* sillyint_flag: STRING  */
#line 1629 "parser.y"
                    { yyerror("unrecognized irqpassing command '%s'", (yyvsp[0].s_value));
		      free((yyvsp[0].s_value)); }
#line 5595 "parser.c"
    break;

  case 463: /* ems_flag: INTEGER  */
#line 1640 "parser.y"
                   {
		     config.ems_size = (yyvsp[0].i_value);
		     if ((yyvsp[0].i_value) > 0) c_printf("CONF: %dk bytes EMS memory\n", (yyvsp[0].i_value));
	           }
#line 5604 "parser.c"
    break;

  case 464: /* ems_flag: '(' expression ')'  */
#line 1645 "parser.y"
                   {
		     config.ems_size = (yyvsp[-1].i_value);
		     if ((yyvsp[-1].i_value) > 0) c_printf("CONF: %dk bytes EMS memory\n", (yyvsp[-1].i_value));
	           }
#line 5613 "parser.c"
    break;

  case 465: /* ems_flag: EMS_SIZE expression  */
#line 1650 "parser.y"
                   {
		     config.ems_size = (yyvsp[0].i_value);
		     if ((yyvsp[0].i_value) > 0) c_printf("CONF: %dk bytes EMS memory\n", (yyvsp[0].i_value));
		   }
#line 5622 "parser.c"
    break;

  case 466: /* ems_flag: EMS_FRAME expression  */
#line 1655 "parser.y"
                   {
/* is there a technical reason why the EMS frame can't be at 0xC0000 or
   0xA0000 if there's space? */
#if 0
		     if ( (((yyvsp[0].i_value) & 0xfc00)>=0xc800) && (((yyvsp[0].i_value) & 0xfc00)<=0xe000) ) {
		       config.ems_frame = (yyvsp[0].i_value) & 0xfc00;
		       c_printf("CONF: EMS-frame = 0x%04x\n", config.ems_frame);
		     }
		     else yyerror("wrong EMS-frame: 0x%04x", (yyvsp[0].i_value));
#endif
	             config.ems_frame = (yyvsp[0].i_value) & 0xfc00;
		     c_printf("CONF: EMS-frame = 0x%04x\n", config.ems_frame);
		   }
#line 5640 "parser.c"
    break;

  case 467: /* ems_flag: EMS_UMA_PAGES expression  */
#line 1669 "parser.y"
                   {
		     config.ems_uma_pages = (yyvsp[0].i_value);
		   }
#line 5648 "parser.c"
    break;

  case 468: /* ems_flag: EMS_CONV_PAGES expression  */
#line 1673 "parser.y"
                   {
		     config.ems_cnv_pages = (yyvsp[0].i_value);
		   }
#line 5656 "parser.c"
    break;

  case 469: /* ems_flag: STRING  */
#line 1677 "parser.y"
                    { yyerror("unrecognized ems command '%s'", (yyvsp[0].s_value));
		      free((yyvsp[0].s_value)); }
#line 5663 "parser.c"
    break;

  case 473: /* hardware_ram_flag: INTEGER  */
#line 1688 "parser.y"
                   {
                     if (!register_hardware_ram('h', (yyvsp[0].i_value), PAGE_SIZE)) {
                       yyerror("wrong hardware ram address : 0x%08x", (yyvsp[0].i_value));
                     }
	           }
#line 5673 "parser.c"
    break;

  case 474: /* hardware_ram_flag: '(' expression ')'  */
#line 1694 "parser.y"
                   {
                     if (!register_hardware_ram('h', (yyvsp[-1].i_value), PAGE_SIZE)) {
                       yyerror("wrong hardware ram address : 0x%08x", (yyvsp[-1].i_value));
                     }
	           }
#line 5683 "parser.c"
    break;

  case 475: /* hardware_ram_flag: RANGE INTEGER INTEGER  */
#line 1700 "parser.y"
                   {
                     if (register_hardware_ram('h', (yyvsp[-1].i_value), (yyvsp[0].i_value) - (yyvsp[-1].i_value)))
	               c_printf("CONF: hardware ram pages at 0x%08x-%08x\n", (yyvsp[-1].i_value), (yyvsp[0].i_value));
                     else
                       yyerror("wrong hardware ram address : 0x%08x", (yyvsp[-1].i_value));
		   }
#line 5694 "parser.c"
    break;

  case 476: /* hardware_ram_flag: RANGE expression ',' expression  */
#line 1707 "parser.y"
                   {
                     if (register_hardware_ram('h', (yyvsp[-2].i_value), (yyvsp[0].i_value) - (yyvsp[-2].i_value)))
	               c_printf("CONF: hardware ram pages at 0x%08x-%08x\n", (yyvsp[-2].i_value), (yyvsp[0].i_value));
                     else
                       yyerror("wrong hardware ram address : 0x%08x", (yyvsp[-2].i_value));
		   }
#line 5705 "parser.c"
    break;

  case 477: /* hardware_ram_flag: STRING  */
#line 1714 "parser.y"
                    { yyerror("unrecognized hardware ram command '%s'", (yyvsp[0].s_value));
		      free((yyvsp[0].s_value)); }
#line 5712 "parser.c"
    break;

  case 481: /* int_bool: expression  */
#line 1728 "parser.y"
                {
			if ((yyvsp[0].i_value) == -2) {
				yyerror("got 'on', expected 'off' or an integer");
			}
		}
#line 5722 "parser.c"
    break;

  case 482: /* irq_bool: expression  */
#line 1735 "parser.y"
                           {
			if ( (yyvsp[0].i_value) && (((yyvsp[0].i_value) < 2) || ((yyvsp[0].i_value) > 15)) ) {
				yyerror("got '%d', expected 'off' or an integer 2..15", (yyvsp[0].i_value));
			} 
		}
#line 5732 "parser.c"
    break;

  case 483: /* speaker: L_OFF  */
#line 1744 "parser.y"
                                { (yyval.i_value) = SPKR_OFF; }
#line 5738 "parser.c"
    break;

  case 484: /* speaker: NATIVE  */
#line 1745 "parser.y"
                                { (yyval.i_value) = SPKR_NATIVE; }
#line 5744 "parser.c"
    break;

  case 485: /* speaker: EMULATED  */
#line 1746 "parser.y"
                                { (yyval.i_value) = SPKR_EMULATED; }
#line 5750 "parser.c"
    break;

  case 486: /* speaker: STRING  */
#line 1747 "parser.y"
                                { yyerror("got '%s', expected 'emulated' or 'native'", (yyvsp[0].s_value));
				  free((yyvsp[0].s_value)); }
#line 5757 "parser.c"
    break;

  case 487: /* speaker: error  */
#line 1749 "parser.y"
                                { yyerror("expected 'emulated' or 'native'"); }
#line 5763 "parser.c"
    break;

  case 488: /* cpuemu: L_OFF  */
#line 1754 "parser.y"
                                { (yyval.i_value) = 0; }
#line 5769 "parser.c"
    break;

  case 489: /* cpuemu: VM86  */
#line 1755 "parser.y"
                                { (yyval.i_value) = 3; }
#line 5775 "parser.c"
    break;

  case 490: /* cpuemu: FULL  */
#line 1756 "parser.y"
                                { (yyval.i_value) = 4; }
#line 5781 "parser.c"
    break;

  case 491: /* cpuemu: VM86SIM  */
#line 1757 "parser.y"
                                { (yyval.i_value) = 5; }
#line 5787 "parser.c"
    break;

  case 492: /* cpuemu: FULLSIM  */
#line 1758 "parser.y"
                                { (yyval.i_value) = 6; }
#line 5793 "parser.c"
    break;

  case 493: /* cpuemu: STRING  */
#line 1759 "parser.y"
                                { yyerror("got '%s', expected 'off', 'vm86' or 'full'", (yyvsp[0].s_value));
				  free((yyvsp[0].s_value)); }
#line 5800 "parser.c"
    break;

  case 494: /* cpuemu: error  */
#line 1761 "parser.y"
                                { yyerror("expected 'off', 'vm86' or 'full'"); }
#line 5806 "parser.c"
    break;

  case 497: /* charset_flag: INTERNAL STRING  */
#line 1768 "parser.y"
                                  { set_internal_charset ((yyvsp[0].s_value)); free((yyvsp[0].s_value)); }
#line 5812 "parser.c"
    break;

  case 498: /* charset_flag: EXTERNAL STRING  */
#line 1769 "parser.y"
                                  { set_external_charset ((yyvsp[0].s_value)); free((yyvsp[0].s_value)); }
#line 5818 "parser.c"
    break;


#line 5822 "parser.c"

      default: break;
    }
  /* User semantic actions sometimes alter yychar, and that requires
     that yytoken be updated with the new translation.  We take the
     approach of translating immediately before every use of yytoken.
     One alternative is translating here after every semantic action,
     but that translation would be missed if the semantic action invokes
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
     incorrect destructor might then be invoked immediately.  In the
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
     to an incorrect destructor call or verbose syntax error message
     before the lookahead is translated.  */
  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);

  YYPOPSTACK (yylen);
  yylen = 0;

  *++yyvsp = yyval;

  /* Now 'shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */
  {
    const int yylhs = yyr1[yyn] - YYNTOKENS;
    const int yyi = yypgoto[yylhs] + *yyssp;
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
               ? yytable[yyi]
               : yydefgoto[yylhs]);
  }

  goto yynewstate;


/*--------------------------------------.
| yyerrlab -- here on detecting error.  |
`--------------------------------------*/
yyerrlab:
  /* Make sure we have latest lookahead translation.  See comments at
     user semantic actions for why this is necessary.  */
  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
      yyerror (YY_("syntax error"));
    }

  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
         error, discard it.  */

      if (yychar <= YYEOF)
        {
          /* Return failure if at end of input.  */
          if (yychar == YYEOF)
            YYABORT;
        }
      else
        {
          yydestruct ("Error: discarding",
                      yytoken, &yylval);
          yychar = YYEMPTY;
        }
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */
  goto yyerrlab1;


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:
  /* Pacify compilers when the user code never invokes YYERROR and the
     label yyerrorlab therefore never appears in user code.  */
  if (0)
    YYERROR;
  ++yynerrs;

  /* Do not reclaim the symbols of the rule whose action triggered
     this YYERROR.  */
  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
  yystate = *yyssp;
  goto yyerrlab1;


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */

  /* Pop stack until we find a state that shifts the error token.  */
  for (;;)
    {
      yyn = yypact[yystate];
      if (!yypact_value_is_default (yyn))
        {
          yyn += YYSYMBOL_YYerror;
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
            {
              yyn = yytable[yyn];
              if (0 < yyn)
                break;
            }
        }

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
        YYABORT;


      yydestruct ("Error: popping",
                  YY_ACCESSING_SYMBOL (yystate), yyvsp);
      YYPOPSTACK (1);
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
    }

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END


  /* Shift the error token.  */
  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturnlab;


/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturnlab;


/*-----------------------------------------------------------.
| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
`-----------------------------------------------------------*/
yyexhaustedlab:
  yyerror (YY_("memory exhausted"));
  yyresult = 2;
  goto yyreturnlab;


/*----------------------------------------------------------.
| yyreturnlab -- parsing is finished, clean up and return.  |
`----------------------------------------------------------*/
yyreturnlab:
  if (yychar != YYEMPTY)
    {
      /* Make sure we have latest lookahead translation.  See comments at
         user semantic actions for why this is necessary.  */
      yytoken = YYTRANSLATE (yychar);
      yydestruct ("Cleanup: discarding lookahead",
                  yytoken, &yylval);
    }
  /* Do not reclaim the symbols of the rule whose action triggered
     this YYABORT or YYACCEPT.  */
  YYPOPSTACK (yylen);
  YY_STACK_PRINT (yyss, yyssp);
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
                  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
      YYPOPSTACK (1);
    }
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif

  return yyresult;
}

#line 1772 "parser.y"


	/* features */

static void handle_features(int which, int value)
{
  if ((which < 0)
	|| (which >= (sizeof(config.features) / sizeof(config.features[0])))) {
    c_printf("CONF: wrong feature number %d\n", which);
    return;
  }
  config.features[which] = value;
  c_printf("CONF: feature %d set to %d\n", which, value);
}

	/* joystick */

static void set_joy_device(char *devstring)
{
  char *spacepos;

  free(config.joy_device[0]);
  config.joy_device[0] = devstring;
  config.joy_device[1] = NULL;
  spacepos = strchr(devstring, ' ');
  if (spacepos != NULL) {
    *spacepos = '\0';
    config.joy_device[1] = spacepos + 1;
  }
}

	/* mouse */

static void start_mouse(void)
{
  mptr = &config.mouse;
  mptr->fd = -1;
}

static void stop_mouse(void)
{
  c_printf("MOUSE: %s, type %x using internaldriver: %s, emulate3buttons: %s baudrate: %d\n", 
        mptr->dev && mptr->dev[0] ? mptr->dev : "no device specified",
        mptr->type, mptr->intdrv ? "yes" : "no", 
        mptr->emulate3buttons ? "yes" : "no", mptr->baudRate);
}

	/* debug */

static void start_ports(void)
{
  if (priv_lvl)
    yyerror("Can not change port privileges in user config file");
  ports_permission = IO_RDWR;
  ports_ormask = 0;
  ports_andmask = 0xFFFF;
}

	/* debug */

static void start_debug(void)
{
  set_debug_level('a', 0);	      /* Default is no debugging output at all */
}

	/* video */

static void start_video(void)
{
  free(config.vbios_file);
  config.vbios_file = NULL;
  config.vbios_copy = 0;
  config.vbios_seg  = 0xc000;
  config.vbios_size = 0x10000;
  config.console_video = 0;
  config.cardtype = CARD_NONE;
  config.chipset = PLAINVGA;
  config.mapped_bios = 0;
  config.vga = 0;
  config.gfxmemsize = 256;
  config.fullrestore = 0;
  config.dualmon = 0;
  config.force_vt_switch = 0;
}

static void stop_video(void)
{
  if (priv_lvl)
    config.console_video = 0;

  if ((config.cardtype != CARD_VGA) || !config.console_video) {
    config.vga = 0;
  }
}

	/* vesa modes */
static void set_vesamodes(int width, int height, int color_bits)
{
  vesamode_type *vmt = malloc(sizeof *vmt);
  if(vmt != NULL) {
    vmt->width = width;
    vmt->height = height;
    vmt->color_bits = color_bits;
    vmt->next = config.vesamode_list;
    config.vesamode_list = vmt;
  }
}

	/* vbios detection */
static int auto_vbios_seg = -1;
static int auto_vbios_size = -1;

static void detect_vbios(void)
{
  unsigned char c[0x21];
  int foffset;

  if (auto_vbios_seg != -1) return;
  if (!can_do_root_stuff || config.vbios_file) return;
  for (foffset = 0xc0000; foffset < 0xf0000; foffset += 0x800) {
    load_file("/dev/mem", foffset, c, sizeof(c));
    if (c[0]==0x55 && c[1]==0xaa
        && c[0x1e]=='I' && c[0x1f]=='B' && c[0x20]=='M') {
      auto_vbios_seg = foffset >> 4;
      auto_vbios_size = c[2]*0x200;
      break;
    }
  }
}

static int detect_vbios_seg(void)
{
  detect_vbios();
  return auto_vbios_seg;
}

static int detect_vbios_size(void)
{
  detect_vbios();
  return auto_vbios_size;
}

static void stop_ttylocks(void)
{
  c_printf("SER: directory %s namestub %s binary %s\n", config.tty_lockdir,
	   config.tty_lockfile,(config.tty_lockbinary?"Yes":"No"));
}

	/* serial */

static void start_serial(void)
{
  if (c_ser >= MAX_SER)
    sptr = &nullser;
  else {
    /* The defaults for interrupt, base_port, real_comport and dev are 
    ** automatically filled in inside the do_ser_init routine of serial.c
    */
    sptr = &com_cfg[c_ser];
    sptr->dev = NULL;
    sptr->irq = 0; 
    sptr->base_port = 0;
    sptr->real_comport = 0;
    sptr->mouse = 0;
    sptr->virtual = FALSE;
    sptr->pseudo = FALSE;
    sptr->system_rtscts = FALSE;
    sptr->low_latency = FALSE;
    sptr->dmx_port = 0;
    sptr->custom = SER_CUSTOM_NONE;
  }
}


static void stop_serial(void)
{
  if (sptr->dev[0] == '\0')
    return;
  if (c_ser >= MAX_SER) {
    c_printf("SER: too many ports, ignoring %s\n", sptr->dev);
    return;
  }
  c_printf("SER%d: %s", c_ser, sptr->dev);
  if (sptr->base_port)
    c_printf(" port %x", sptr->base_port);
  if (sptr->irq)
    c_printf(" irq %x", sptr->irq);
  c_printf("\n");
  c_ser++;
  config.num_ser = c_ser;
}

	/* keyboard */

static int keyboard_statement_already = 0;

static void start_keyboard(void)
{
  keyb_layout(KEYB_USER); /* NOTE: the default has changed, --Hans, 971204 */
  config.console_keyb = 0;
  keyboard_statement_already = 1;
}

static void stop_terminal(void)
{
  if (config.term_updatefreq > 100) {
    yywarn("terminal updatefreq too large (too slow)!");
    config.term_updatefreq = 100;
  } 
}

	/* printer */

static void start_printer(void)
{
  pptr->prtcmd = NULL;
  pptr->dev = NULL;
  pptr->remaining = -1;
  pptr->delay = 10;
}

static void stop_printer(void)
{
  printer_config(c_printers, pptr);
  c_printf("CONF(LPT%d) f: %s   c: %s  t: %d  port: %x\n",
           c_printers, pptr->dev, pptr->prtcmd,
           pptr->delay, pptr->base_port);
  c_printers++;
  if (c_printers > config.num_lpt)
    config.num_lpt = c_printers;
}

	/* disk */

static void start_bootdisk(void)
{
  if (config.bootdisk)           /* Already a bootdisk configured ? */
    yyerror("There is already a bootdisk configured");
      
  dptr = &bootdisk;              /* set pointer do bootdisk-struct */
      
  dptr->diskcyl4096 = 0;
  dptr->sectors = 0;             /* setup default-values           */
  dptr->heads   = 0;
  dptr->tracks  = 0;
  dptr->type    = FLOPPY;
  dptr->default_cmos = THREE_INCH_FLOPPY;
  dptr->timeout = 0;
  dptr->dev_name = NULL;              /* default-values */
  dptr->boot_name = NULL;
  dptr->wantrdonly = 0;
  dptr->header = 0;
}

static void start_floppy(void)
{
  if (c_fdisks >= MAX_FDISKS)
    {
    yyerror("There are too many floppy disks defined");
    dptr = &nulldisk;          /* Dummy-Entry to avoid core-dumps */
    }
  else
    dptr = &disktab[c_fdisks];

  dptr->sectors = 0;             /* setup default values */
  dptr->heads   = 0;
  dptr->tracks  = 0;
  dptr->type    = FLOPPY;
  dptr->default_cmos = THREE_INCH_FLOPPY;
  dptr->timeout = 0;
  dptr->dev_name = NULL;              /* default-values */
  dptr->boot_name = NULL;
  dptr->wantrdonly = 0;
  dptr->header = 0;
}

static void start_disk(void)
{
  if (c_hdisks >= MAX_HDISKS) 
    {
    yyerror("There are too many hard disks defined");
    dptr = &nulldisk;          /* Dummy-Entry to avoid core-dumps */
    }
  else
    dptr = &hdisktab[c_hdisks];
      
  dptr->type    =  NODISK;
  dptr->sectors = -1;
  dptr->heads   = -1;
  dptr->tracks  = -1;
  dptr->timeout = 0;
  dptr->dev_name = NULL;              /* default-values */
  dptr->boot_name = NULL;
  dptr->wantrdonly = 0;
  dptr->header = 0;
  dptr->dexeflags = 0;
}

static void start_vnet(char *mode) {
  if (strcmp(mode, "tap") == 0) {
    config.vnet = VNET_TYPE_TAP;
    return;
  }
  if (strcmp(mode, "vde") == 0) {
    config.vnet = VNET_TYPE_VDE;
    return;
  }
  IFCLASS(CL_NET) {}
  if (strcmp(mode, "eth") == 0)
    config.vnet = VNET_TYPE_ETH;
  else {
    error("Unknown vnet mode \"%s\"\n", mode);
    config.exitearly = 1;
  } 
}

static void do_part(char *dev)
{
  if (dptr->dev_name != NULL)
    yyerror("Two names for a partition given.");
  dptr->type = PARTITION;
  dptr->dev_name = dev;
#ifdef __linux__
  dptr->part_info.number = atoi(dptr->dev_name+8);
#endif
  if (dptr->part_info.number == 0) 
    yyerror("%s must be a PARTITION, can't find number suffix!\n",
   	    dptr->dev_name);
}

static void stop_disk(int token)
{
#ifdef __linux__
  FILE   *f;
  struct mntent *mtab;
#endif
  int    mounted_rw;

  if (dexe_running && dexe_forbid_disk)
    return;
  if (dptr == &nulldisk)              /* is there any disk? */
    return;                           /* no, nothing to do */

  if (!dptr->dev_name)                /* Is there a file/device-name? */
    yyerror("disk: no device/file-name given!");
  else                                /* check the file/device for existance */
    {
      struct stat file_status;        /* date for checking that file */

      c_printf("device: %s ", dptr->dev_name);
      if (stat(dptr->dev_name,&file_status) != 0) { /* Does this file exist? */
	 if (config.install ||
	     strcmp(dptr->dev_name, DOSEMUHDIMAGE_DEFAULT"/drives/*") == 0) {
	    /* default setting: display a menu */
	    dptr->type = DIR_TYPE;
	    if (!config.install)
	       config.install = "";
	 } else
	    yyerror("Disk-device/file %s doesn't exist.",dptr->dev_name);
      }
    }

  if (dptr->type == NODISK)    /* Is it one of bootdisk, floppy, harddisk ? */
    yyerror("disk: no device/file-name given!"); /* No, error */
  else
    c_printf("type %d ", dptr->type);

  if (dptr->type == PARTITION) {
    c_printf("partition# %d ", dptr->part_info.number);
#ifdef __linux__
    mtab = NULL;
    if ((f = setmntent(MOUNTED, "r")) != NULL) {
      while ((mtab = getmntent(f)))
        if (!strcmp(dptr->dev_name, mtab->mnt_fsname)) break;
      endmntent(f);
    }
    if (mtab) {
      mounted_rw = ( hasmntopt(mtab, MNTOPT_RW) != NULL );
      if (mounted_rw && !dptr->wantrdonly) 
        yyerror("\n\nYou specified '%s' for read-write Direct Partition Access,"
                "\nit is currently mounted read-write on '%s' !!!\n",
                dptr->dev_name, mtab->mnt_dir);
      else if (mounted_rw) 
        yywarn("You specified '%s' for read-only Direct Partition Access,"
               "\n         it is currently mounted read-write on '%s'.\n",
               dptr->dev_name, mtab->mnt_dir);
      else if (!dptr->wantrdonly) 
        yywarn("You specified '%s' for read-write Direct Partition Access,"
               "\n         it is currently mounted read-only on '%s'.\n",
               dptr->dev_name, mtab->mnt_dir);
    }
#endif
  }

  if (dptr->header)
    c_printf("header_size: %ld ", (long) dptr->header);

  c_printf("h: %d  s: %d   t: %d", dptr->heads, dptr->sectors,
	   dptr->tracks);

  if (token == BOOTDISK) {
    config.bootdisk = 1;
    use_bootdisk = 1;
    c_printf(" bootdisk\n");
  }
  else if (token == L_FLOPPY) {
    c_printf(" floppy %c:\n", 'A'+c_fdisks);
    c_fdisks++;
    config.fdisks = c_fdisks;
  }
  else {
    c_printf(" drive %c:\n", 'C'+c_hdisks);
    c_hdisks++;
    config.hdisks = c_hdisks;
  }
}

	/* keyboard */

void keyb_layout(int layout)
{
  struct keytable_entry *kt = keytable_list;
  if (layout == -1) {
    /* auto: do it later */
    config.keytable = NULL;
    return;
  }
  while (kt->name) {
    if (kt->keyboard == layout) {
      if (kt->flags & KT_ALTERNATE) {
        c_printf("CONF: Alternate keyboard-layout %s\n", kt->name);
        config.altkeytable = kt;
      } else {
      c_printf("CONF: Keyboard-layout %s\n", kt->name);
      config.keytable = kt;
      }
      return;
    }
    kt++;
  }
  c_printf("CONF: ERROR -- Keyboard has incorrect number!!!\n");
}

static void keytable_start(int layout)
{
  static struct keytable_entry *saved_kt = 0;
  if (layout == -1) {
    if (keyboard_statement_already) {
      if (config.keytable != saved_kt) {
        yywarn("keytable changed to %s table, but previously was defined %s\n",
                config.keytable->name, saved_kt->name);
      }
    }
  }
  else {
    saved_kt = config.keytable;
    keyb_layout(layout);
  }
}

static void keytable_stop(void)
{
  keytable_start(-1);
}

static void dump_keytables_to_file(char *name)
{
  FILE * f;
  struct keytable_entry *kt = keytable_list;

  f = fopen(name, "w");
  if (!f) {
    error("cannot create keytable file %s\n", name);
    exit(1);
  }
  
  while (kt->name) {
    dump_keytable(f, kt);
    kt++;
  }
  fclose(f);
  exit(0);
}

static void set_irq_value(int bits, int i1)
{
  if ((i1>2) && (i1<=15)) {
    config.sillyint |= (bits << i1);
    c_printf("CONF: IRQ %d for irqpassing", i1);
    if (bits & 0x10000)  c_printf(" uses SIGIO\n");
    else c_printf("\n");
  }
  else yyerror("wrong IRQ for irqpassing command: %d", i1);
}

static void set_irq_range(int bits, int i1, int i2) {
  int i;
  if ( (i1<3) || (i1>15) || (i2<3) || (i2>15) || (i1 > i2 ) ) {
    yyerror("wrong IRQ range for irqpassing command: %d .. %d", i1, i2);
  }
  else {
    for (i=i1; i<=i2; i++) config.sillyint |= (bits << i);
    c_printf("CONF: range of IRQs for irqpassing %d .. %d", i1, i2);
    if (bits & 0x10000)  c_printf(" uses SIGIO\n");
    else c_printf("\n");
  }
}


	/* errors & warnings */

void yywarn(char* string, ...)
{
  va_list vars;
  va_start(vars, string);
  fprintf(stderr, "Warning: ");
  vfprintf(stderr, string, vars);
  fprintf(stderr, "\n");
  va_end(vars);
  warnings++;
}

void yyerror(char* string, ...)
{
  va_list vars;
  va_start(vars, string);
  if (include_stack_ptr != 0 && !last_include) {
	  int i;
	  fprintf(stderr, "In file included from %s:%d\n",
		  include_fnames[0], include_lines[0]);
	  for(i = 1; i < include_stack_ptr; i++) {
		  fprintf(stderr, "                 from %s:%d\n",
			  include_fnames[i], include_lines[i]);
	  }
	  last_include = 1;
  }
  fprintf(stderr, "Error in %s: (line %.3d) ", 
	  include_fnames[include_stack_ptr], line_count);
  vfprintf(stderr, string, vars);
  fprintf(stderr, "\n");
  va_end(vars);
  errors++;
}


/*
 * open_file - opens the configuration-file named *filename and returns
 *             a file-pointer. The error/warning-counters are reset to zero.
 */

static FILE *open_file(char *filename)
{
  errors   = 0;                  /* Reset error counter */
  warnings = 0;                  /* Reset counter for warnings */

  if (!filename) return 0;
  return fopen(filename, "r"); /* Open config-file */
}

/*
 * close_file - Close the configuration file and issue a message about
 *              errors/warnings that occured. If there were errors, the
 *              flag early-exit is that, so dosemu won't really.
 */

static void close_file(FILE * file)
{
  if (file) fclose(file);                  /* Close the config-file */

  if(errors)
    fprintf(stderr, "%d error(s) detected while parsing the configuration-file\n",
	    errors);
  if(warnings)
    fprintf(stderr, "%d warning(s) detected while parsing the configuration-file\n",
	    warnings);

  if (errors != 0)               /* Exit dosemu on errors */
    {
      config.exitearly = TRUE;
    }
}

/* write_to_syslog */
static void write_to_syslog(char *message)
{
  openlog("dosemu", LOG_PID, LOG_USER | LOG_NOTICE);
  syslog(LOG_PID | LOG_USER | LOG_NOTICE, "%s", message);
  closelog();
}

static void move_dosemu_lib_dir(char *path)
{
  if (dosemu_lib_dir_path != path) {
    if (dosemu_lib_dir_path != dosemulib_default)
      free(dosemu_lib_dir_path);
    dosemu_lib_dir_path = strdup(path);
  }
  setenv("DOSEMU_LIB_DIR", dosemu_lib_dir_path, 1);
  if (keymap_load_base_path != keymaploadbase_default)
    free(keymap_load_base_path);
  keymap_load_base_path = assemble_path(path, "", 0);
}

static FILE *open_dosemu_users(void)
{
  FILE *fp;
  fp = open_file(DOSEMU_USERS_FILE);
  if (fp) return fp;
  return 0;
}

static void setup_home_directories(void)
{
  setenv("DOSEMU_HDIMAGE_DIR", dosemu_hdimage_dir_path, 1);
  LOCALDIR = get_dosemu_local_home();
  RUNDIR = mkdir_under(LOCALDIR, "run", 0);
  DOSEMU_MIDI_PATH = assemble_path(RUNDIR, DOSEMU_MIDI, 0);
  DOSEMU_MIDI_IN_PATH = assemble_path(RUNDIR, DOSEMU_MIDI_IN, 0);
}

static void lax_user_checking(void)
{
  char *p;
  define_config_variable("c_all");
  p = getenv("USER");
  if (!p) p = "guest";
  setenv("DOSEMU_USER", p, 1);
  setenv("DOSEMU_REAL_USER", p, 1);
  setup_home_directories();
}

/* Parse TimeMode, Paul Crawford and Andrew Brooks 2004-08-01 */
/* Accepts "bios", "pit", "linux", default is "bios". Use with TIMEMODE token */
int parse_timemode(const char *timemodestr)
{
   if (timemodestr == NULL || timemodestr[0] == '\0')
     return(TM_BIOS); /* default */
   if (strcmp(timemodestr, "linux")==0)
     return(TM_LINUX);
   if (strcmp(timemodestr, "pit")==0)
     return(TM_PIT);
   if (strcmp(timemodestr, "bios")==0)
     return(TM_BIOS);
   yyerror("Unrecognised time mode (not bios, pit or linux)");
   return(TM_BIOS);
}

/* Parse Users for DOSEMU, by Alan Hourihane, alanh@fairlite.demon.co.uk */
/* Jan-17-1996: Erik Mouw (J.A.K.Mouw@et.tudelft.nl)
 *  - added logging facilities
 * In 1998:     Hans
 *  - havy changes and re-arangments
 */
void
parse_dosemu_users(void)
{
#define ALL_USERS "all"
#define PBUFLEN 256

  FILE *volatile fp;
  struct passwd *pwd;
  char buf[PBUFLEN];
  int userok = 0;
  char *ustr;
  int uid;
  int have_vars=0;

  /* We come here _very_ early (at top of main()) to avoid security conflicts.
   * priv_init() has already been called, but nothing more.
   *
   * We will exit, if /etc/dosemu.users says that the user has no right
   * to run a suid root dosemu (and we are on), but will continue, if the user
   * is running a non-suid copy _and_ is mentioned in dosemu users.
   * The dosemu.users entry for such a user is:
   *
   *      joeodd  ... nosuidroot
   *
   * The functions we call rely on the following setting:
   */
  after_secure_check = 0;
  priv_lvl = 0;

  /* We first have to find out where the dosemu.users file is placed
   * by the system administrator.
   * We first look for /etc/dosemu.users, then for /etc/dosemu/dosemu.users
   * Once we know that, most other pathes are runtime configurable:
   *
   *  - dosemu.users tells were to find the dosemu-lib-dir
   *    (DOSEMULIB_DEFAULT per default)
   *  - global.conf includes $DOSEMU_CONF_DIR/dosemu.conf
   *    (which could be changed by the owner of global.conf).
   */

  if (DOSEMU_USERS_FILE == NULL) {
    setenv("DOSEMU_CONF_DIR", "", 1);
  } else if (!exists_file(DOSEMU_USERS_FILE)) {
    DOSEMU_USERS_FILE = ALTERNATE_ETC "/" DOSEMU_USERS;
    DOSEMU_LOGLEVEL_FILE = ALTERNATE_ETC "/" DOSEMU_LOGLEVEL;
    setenv("DOSEMU_CONF_DIR", ALTERNATE_ETC, 1);
  }
  else setenv("DOSEMU_CONF_DIR", "/etc", 1);
	
  /* we check for some vital global settings
   * which we need before proceeding
   */
  setenv("DOSEMU_LIB_DIR", dosemulib_default, 1);
  move_dosemu_lib_dir(dosemu_lib_dir_path);

  fp = open_dosemu_users();
  if (fp) while (fgets(buf, PBUFLEN, fp) != NULL) {
    int l = strlen(buf);
    if (l && (buf[l-1] == '\n')) buf[l-1] = 0;
    ustr = strtok(buf, " \t\n=,;:");
    if (ustr && (ustr[0] != '#')) {
      if (!strcmp(ustr, "default_lib_dir")) {
        ustr=strtok(0, " \t\n=,;:");
        if (ustr) {
          if (!exists_dir(ustr)) {
            char *tx = "default_lib_dir %s does not exist\n";
            fprintf(stderr, tx, ustr);
            fprintf(stdout, tx, ustr);
            exit(1);
          }
          move_dosemu_lib_dir(ustr);
        }
      }
      if (!strcmp(ustr, "default_hdimage_dir")) {
        ustr=strtok(0, " \t\n=,;:");
        if (ustr) {
          if (!exists_dir(ustr)) {
            char *tx = "default_hdimage_dir %s does not exist\n";
            fprintf(stderr, tx, ustr);
            fprintf(stdout, tx, ustr);
            exit(1);
          }
          if (dosemu_hdimage_dir_path != dosemuhdimage_default)
            free(dosemu_hdimage_dir_path);
          dosemu_hdimage_dir_path = strdup(ustr);
	  dexe_load_path = dosemu_hdimage_dir_path;
        }
      }
      else if (!strcmp(ustr, "log_level")) {
        int ll = 0;
        ustr=strtok(0, " \t\n=,;:");
        if (ustr) {
          ll = atoi(ustr);
          if (ll < 0) ll = 0;
          if (ll > 2) ll = 2;
        }
      }
      else if (!strcmp(ustr, "config_script")) {
        ustr=strtok(0, " \t\n=,;:");
        if (ustr && strcmp(ustr, DEFAULT_CONFIG_SCRIPT)) {
          config_script_path = strdup(ustr);
          if (!exists_file(config_script_path)) {
            char *tx = "config_script %s does not exist\n";
            fprintf(stderr, tx, ustr);
            fprintf(stdout, tx, ustr);
            exit(1);
          }
	  config_script_name = strdup(ustr);
	}
      }
    }
  }
  if (fp) fclose(fp);

  if (!can_do_root_stuff || under_root_login) {
     /* simply ignore -- we're not suid-root */
     lax_user_checking();
     after_secure_check = 1;
     return;
  }

  /* We want to test if the _user_ is allowed to do certain privileged    */
  /* things, o check if the username connected to the get_orig_uid() is   */
  /* in the DOSEMU_USERS_FILE file (usually /etc/dosemu.users).           */
   
  uid = get_orig_uid();

  errno = 0; /* man says this is necessary?! */
  pwd = getpwuid(uid);

  /* Sanity Check, Shouldn't be anyone logged in without a userid */
  if (!pwd) 
     {
       error("Illegal User: uid=%i, error=%s\n", uid, strerror(errno));
       sprintf(buf, "Illegal DOSEMU user: uid=%i", uid);
       write_to_syslog(buf);
       exit(1);
     }

  /* preset DOSEMU_*USER env, such that a user can't fake it */
  setenv("DOSEMU_USER", "unknown", 1);
  setenv("DOSEMU_REAL_USER", pwd->pw_name, 1);

  {
       int can_have_privsetup = 0;
       fp = open_dosemu_users();
       if (fp) {
	   for(userok=0; fgets(buf, PBUFLEN, fp) != NULL && !userok; ) {
	     int l = strlen(buf);
	     if (l && (buf[l-1] == '\n')) buf[l-1] = 0;
	     ustr = strtok(buf, " \t\n,;:");
	     if (ustr && (ustr[0] != '#')) {
	       if (strcmp(ustr, pwd->pw_name)== 0) 
		 userok = 1;
	       else if (strcmp(ustr, ALL_USERS)== 0)
		 userok = 1;
	       if (userok) {
		 setenv("DOSEMU_USER", ustr, 1);
		 while ((ustr=strtok(0, " \t,;:")) !=0) {
		   if (ustr[0] == '#') break;
		   define_config_variable(ustr);
		   have_vars = 1;
                   if (!strcmp(ustr,"private_setup")) {
                     can_have_privsetup = 1;
                   }
		 }
	         if (!have_vars && !using_sudo)
		   define_config_variable("restricted");
	       }
	     }
	   }
           fclose(fp);
       }
       

       if (can_have_privsetup
              && (   get_config_variable("unrestricted")
                  || under_root_login || !can_do_root_stuff)) {
         /* this user is allowed to have a privat ~/.dosemu/lib
          * (which replaces DOSEMULIB_DEFAULT if existing).
          * Hence this user can have its own global.conf e.t.c.
          * However, this is only possible with non-suid-root
          * binary or when running under root loggin or when 'unrestricted'
          * also is set.       -- Hans
          */
         char *lpath = get_path_in_HOME(LOCALDIR_BASE_NAME "/lib");
         if (exists_dir(lpath)) move_dosemu_lib_dir(lpath);
         free(lpath);
       }
  }

  define_config_variable("c_all");
  if(userok==0 && !using_sudo) {
    define_config_variable("restricted");
  }
  if (get_config_variable("nosuidroot") || (get_config_variable("restricted") && !on_console())) {
    fprintf(stderr, "Dropping root privileges: guest or a restricted user not on console.\n");
    priv_drop();
    lax_user_checking();
    after_secure_check = 1;
    return;
  }

  /* now we setup up our local DOSEMU home directory, where we
   * have (among other things) all temporary stuff in
   * (since 0.97.10.2)
   */
  setup_home_directories();
  after_secure_check = 1;
}


char *commandline_statements=0;

static int has_dexe_magic(char *name)
{
  int fd, magic, ret;
  fd = open(name, O_RDONLY);
  if (fd <0) return 0;
  ret = (read(fd, &magic, 4) == 4) && (magic == DEXE_MAGIC);
  close(fd);
  return ret;
}

static int stat_dexe(char *name)
{
  struct stat s;
  if (stat(name, &s)) return 0;
  if ( ! S_ISREG(s.st_mode)) return 0;
  if ((s.st_mode & S_IXUSR) && (s.st_uid == get_orig_uid()))
    return has_dexe_magic(name);
  if ((s.st_mode & S_IXGRP) && (is_in_groups(s.st_gid)))
    return  has_dexe_magic(name); 
  if (s.st_mode & S_IXOTH) return has_dexe_magic(name);
  return 0;
}

static char *resolve_exec_path(char *dexename, char *ext)
{
  enum { maxn=0x255 };
  static char n[maxn+1];
  static char name[maxn+1];
  char *p, *path=getenv("PATH");

  strncpy(name,dexename,maxn);
  name[maxn] = 0;
  n[maxn] = 0;
  p = rindex(name, '.');
  if ( ext && ((p && strcmp(p, ext)) || !p) )
    strncat(name,ext,maxn);


  /* first try the pure file name */
  if (!path || (name[0] == '/') || (!strncmp(name, "./", 2))) {
    if (stat_dexe(name)) return name;
    return 0;
  }

  /* next try the standard path for DEXE files */
  snprintf(n, maxn, "%s/%s", dexe_load_path, name);
  if (stat_dexe(n)) return n;

  /* now search in the users normal PATH */
  path = strdup(path);
  p= strtok(path,":");
  while (p) {
    snprintf(n, maxn, "%s/%s", p, name);
    if (stat_dexe(n)) {
      free(path);
      return n;
    }
    p=strtok(0,":");
  }
  free(path);
  return 0;
}

void prepare_dexe_load(char *name)
{
  char *n, *cbuf;
  int fd, csize;
  struct image_header ihdr;

  n = resolve_exec_path(name, ".dexe");
  if (!n) {
    n = resolve_exec_path(name, 0);
    if (!n) {
      error("DEXE file not found or not executable\n");
      exit(1);
    }
  }

  /* now we extract the configuration file and the access flags */
  fd = open(n, O_RDONLY);
  if (read(fd, &ihdr, sizeof(struct image_header)) != sizeof(struct image_header)) {
    error("broken DEXE format, can't read image header\n");
    close(fd);
    exit(1);
  }

  lseek(fd, HEADER_SIZE + 0x200, SEEK_SET); /* just behind the MBR */
  if ((read(fd, &csize, 4) != 4) || (csize > 0x2000)) {
    error("broken DEXE format, configuration not found\n");
    close(fd);
    exit(1);
  }
  
  /* we use the -I option to feed in the configuration,
   * and we put ours in front of eventually existing options
   */
  if (commandline_statements) {
    cbuf = malloc(csize+1+strlen(commandline_statements)+1);
    read(fd, cbuf, csize);
    cbuf[csize] = '\n';
    strcpy(cbuf+csize+1, commandline_statements);
  }
  else {
    cbuf = malloc(csize+1);
    read(fd, cbuf, csize);
    cbuf[csize] = 0;
  }
  commandline_statements = cbuf;
  close(fd);

  start_disk();
  dptr->type = IMAGE;
  dptr->header = HEADER_SIZE;
  dptr->dev_name = n;
  dptr->dexeflags = ihdr.dexeflags | DISK_IS_DEXE;
  stop_disk(DISK);
  dexe_running = 1;
}


static void do_parse(FILE* fp, char *confname, char *errtx)
{
        yyin = fp;
        line_count = 1;
	include_stack_ptr = 0;
        c_printf("CONF: Parsing %s file.\n", confname);
	file_being_parsed = strdup(confname);
	include_fnames[include_stack_ptr] = file_being_parsed;
	yyrestart(fp);
        if (yyparse()) yyerror(errtx, confname);
        close_file(fp);
	include_stack_ptr = 0;
	include_fnames[include_stack_ptr] = 0;
	free(file_being_parsed);
}

int parse_config(char *confname, char *dosrcname)
{
  FILE *fd;
  int is_user_config;
#if YYDEBUG != 0
  yydebug  = 1;
#endif

  define_config_variable(PARSER_VERSION_STRING);

  /* Let's try confname if not null, and fail if not found */
  /* Else try the user's own .dosrc (old) or .dosemurc (new) */
  /* If that doesn't exist we will default to CONFIG_FILE */

  { 
    if (!dosrcname) {
      char *name = get_path_in_HOME(DOSEMU_RC);
      setenv("DOSEMU_RC", name, 1);
      free(name);
    }
    else {
      setenv("DOSEMU_RC",dosrcname,1);
    }

    /* privileged options allowed? */
    is_user_config = (confname && config_script_path && strcmp(confname, config_script_path));
    priv_lvl = !under_root_login && can_do_root_stuff && is_user_config;

    /* DEXE together with option F ? */
    if (priv_lvl && dexe_running) {
      /* for security reasons we cannot allow this */
      fprintf(stderr, "user cannot load DEXE file together with option -F\n");
      exit(1);
    }

    if (is_user_config) define_config_variable("c_user");
    else define_config_variable("c_system");
    if (dexe_running) define_config_variable("c_dexerun");

    yy_vbuffer = dosemu_conf;
    do_parse(NULL, "built-in dosemu.conf", "error in built-in dosemu.conf");
    yy_vbuffer = global_conf;
    do_parse(NULL, "built-in global.conf", "error in built-in global.conf");
    if (confname) {
      yy_vbuffer = NULL;
      fd = open_file(confname);
      if (!fd) {
        if (!dexe_running) {
          fprintf(stderr, "Cannot open base config file %s, Aborting DOSEMU.\n",confname);
          exit(1);
        }
      }
      do_parse(fd, confname, "error in configuration file %s");
    }

    if (priv_lvl) undefine_config_variable("c_user");
    else undefine_config_variable("c_system");

    if (!get_config_variable(CONFNAME_V3USED)) {
	/* we obviously have an old configuration file
         * ( or a too simple one )
	 * giving up
	 */
	yyerror("\nYour %s script or configuration file is obviously\n"
		"an old style or a too simple one\n"
		"Please read README.txt on how to upgrade\n", confname);
	exit(1);
    }

    /* privileged options allowed for user's config? */
    priv_lvl = !under_root_login && can_do_root_stuff;
    if (priv_lvl) define_config_variable("c_user");

    /* Now we parse any commandline statements from option '-I'
     * We do this under priv_lvl set above, so we have the same secure level
     * as with .dosrc
     */

    if (commandline_statements) {
      #define XX_NAME "commandline"

      open_file(0);
      define_config_variable("c_comline");
      c_printf("Parsing " XX_NAME  " statements.\n");
      yyin=0;				 /* say: we have no input file */
      yy_vbuffer=commandline_statements; /* this is the input to scan */
      do_parse(0, XX_NAME, "error in user's %s statement");
      undefine_config_variable("c_comline");
    }
  }

  /* check for global settings, that should know the whole settings
   * This we only can do, after having parsed all statements
   */

  if (dexe_running) {
    /* force a BootC,
     * regardless what ever was set in the config files
     */
    config.hdiskboot = 1;
  }
  else {
    if (get_config_variable("c_dexeonly")) {
       c_printf("CONF: only execution of DEXE files allowed\n");
       fprintf(stderr, "only execution of DEXE files allowed\n");
       exit(99);
    }
  }

#ifdef TESTING
  error("TESTING: parser is terminating program\n");
  exit(0);
#endif
  return 1;
}

#define MAX_CONFIGVARIABLES 128
char *config_variables[MAX_CONFIGVARIABLES+1] = {0};
static int config_variables_count = 0;
static int config_variables_last = 0;
static int allowed_classes = -1;
static int saved_allowed_classes = -1;



static int is_in_allowed_classes(int mask)
{
  if (!(allowed_classes & mask)) {
    yyerror("insufficient class privilege to use this configuration option\n");
    exit(99);
  }
  return 1;
}

struct config_classes {
	char *class;
	int mask;
} config_classes[] = {
	{"c_all", CL_ALL},
	{"c_normal", CL_ALL & (~(CL_VAR | CL_VPORT | CL_IRQ | CL_HARDRAM | CL_PCI | CL_NET))},
	{"c_var", CL_VAR},
	{"c_system", CL_ALL},
	{"c_vport", CL_VPORT},
	{"c_port", CL_PORT},
	{"c_irq", CL_IRQ},
	{"c_pci", CL_PCI},
	{"c_hardram", CL_HARDRAM},
	{"c_net", CL_NET},
	{0,0}
};

static int get_class_mask(char *name)
{
  struct config_classes *p = &config_classes[0];
  while (p->class) {
    if (!strcmp(p->class,name)) return p->mask;
    p++;
  }
  return 0;
}

static void update_class_mask(void)
{
  int i, m;
  allowed_classes = 0;
  for (i=0; i< config_variables_count; i++) {
    if ((m=get_class_mask(config_variables[i])) != 0) {
      allowed_classes |= m;
    }
  }
}

static void enter_user_scope(int incstackptr)
{
  if (user_scope_level) return;
  saved_priv_lvl = priv_lvl;
  priv_lvl = 1;
  saved_allowed_classes = allowed_classes;
  allowed_classes = 0;
  user_scope_level = incstackptr;
  c_printf("CONF: entered user scope, includelevel %d\n", incstackptr-1);
}

static void leave_user_scope(int incstackptr)
{
  if (user_scope_level != incstackptr) return;
  priv_lvl = saved_priv_lvl;
  allowed_classes = saved_allowed_classes;
  user_scope_level = 0;
  c_printf("CONF: left user scope, includelevel %d\n", incstackptr-1);
}

char *get_config_variable(char *name)
{
  int i;
  for (i=0; i< config_variables_count; i++) {
    if (!strcmp(name, config_variables[i])) {
      config_variables_last = i;
      return config_variables[i];
    }
  }
  return 0;
}

int define_config_variable(char *name)
{
  if (priv_lvl) {
    if (strcmp(name, CONFNAME_V3USED) && strncmp(name, "u_", 2)) {
      c_printf("CONF: not enough privilege to define config variable %s\n", name);
      return 0;
    }
  }
  if (!get_config_variable(name)) {
    if (config_variables_count < MAX_CONFIGVARIABLES) {
      config_variables[config_variables_count++] = strdup(name);
      if (!priv_lvl) update_class_mask();
    }
    else {
      if (after_secure_check)
        c_printf("CONF: overflow on config variable list\n");
      return 0;
    }
  }
  if (after_secure_check)
    c_printf("CONF: config variable %s set\n", name);
  return 1;
}

static int undefine_config_variable(char *name)
{
  if (priv_lvl) {
    if (strncmp(name, "u_", 2)) {
      c_printf("CONF: not enough privilege to undefine config variable %s\n", name);
      return 0;
    }
  }
  if (get_config_variable(name)) {
    int i;
    if (!strcmp(name, CONFNAME_V3USED)) parser_version_3_style_used = 0;
    free(config_variables[config_variables_last]);
    for (i=config_variables_last; i<(config_variables_count-1); i++) {
      config_variables[i] = config_variables[i+1];
    }
    config_variables_count--;
    if (!priv_lvl) update_class_mask();
    c_printf("CONF: config variable %s unset\n", name);
    return 1;
  }
  return 0;
}

char *checked_getenv(const char *name)
{
  if (user_scope_level) {
     char *s, *name_ = malloc(strlen(name)+sizeof(USERVAR_PREF));
     strcpy(name_, USERVAR_PREF);
     strcat(name_, name);
     s = getenv(name_);
     free(name_);
     if (s) return s;
  }
  return getenv(name);
}

static void check_user_var(char *name)
{
	char *name_;
	char *s;

	if (user_scope_level) return;
	name_ = malloc(strlen(name)+sizeof(USERVAR_PREF));
	strcpy(name_, USERVAR_PREF);
	strcat(name_, name);
	s = getenv(name_);
	if (s) {
		if (getenv(name))
			c_printf("CONF: variable %s replaced by user\n", name);
		setenv(name, s, 1);
		unsetenv(name_);
	}
	free(name_);
}


static char *run_shell(char *command)
{
	int pipefds[2];
	pid_t pid;
	char excode[16] = "1";

	setenv("DOSEMU_SHELL_RETURN", excode, 1);
	if (pipe(pipefds)) return strdup("");
	pid = fork();
	if (pid == -1) return strdup("");
	if (!pid) {
		/* child */
		int ret;
		close(pipefds[0]);	/* we won't read from the pipe */
		dup2(pipefds[1], 1);	/* make the pipe child's stdout */
		priv_drop();	/* drop any priviledges */
		ret = system(command);
			/* tell the parent: "we have finished",
			 * this way we need not to play games with select()
			 */
		if (ret == -1) ret = errno;
		else ret >>=8;
		write(pipefds[1],"\0\0\0",4);
		close(pipefds[1]);
		_exit(ret);
	}
	else {
		/* parent */
		char *buf = 0;
		int recsize = 128;
		int bufsize = 0;
		int ptr =0;
		int ret;
		int status;

		close(pipefds[1]);	/* we won't write to the pipe */
		do {
			bufsize = ptr + recsize;
			if (!buf) buf = malloc(bufsize);
			else buf = realloc(buf, bufsize);
			ret = read(pipefds[0], buf+ptr, recsize -1);
			if (ret > 0) {
				ptr += ret;
			}
		} while (ret >0 && (ret < 4 || memcmp(buf+ptr-4,"\0\0\0",4)));
		close(pipefds[0]);
		waitpid(pid, &status, 0);
		buf[ptr] = 0;
		if (!buf[0]) {
			free(buf);
			buf = strdup("");
		}
		sprintf(excode, "%d", WEXITSTATUS(status));
		setenv("DOSEMU_SHELL_RETURN", excode, 1);
		return buf;
	}
}


struct for_each_entry {
	char *list;
	char *ptr;
	int skip_restart;
};

#define FOR_EACH_DEPTH	16
static struct for_each_entry *for_each_list = 0;

static int for_each_handling(int loopid, char *varname, char *delim, char *list)
{
	struct for_each_entry *fe;
	char * new;
	char saved;
	if (!for_each_list) {
		int size = FOR_EACH_DEPTH * sizeof(struct for_each_entry);
		for_each_list = malloc(size);
		memset(for_each_list, 0, size);
	}
	if (loopid > FOR_EACH_DEPTH) {
		yyerror("too deeply nested foreach\n");
		return 0;
	}
	fe = for_each_list + loopid;
	if (!fe->list) {
		/* starting the loop */
		fe->ptr = fe->list = strdup(list);
		fe->skip_restart = 0;
		if (loopid) {
			/* in inner loops we need to skip the restart */
			fe->skip_restart = 1;
		}
	}
	else {
		if (fe->skip_restart) {
			fe->skip_restart = 0;
			return 1;
		}
	}
	while (fe->ptr[0] && strchr(delim,fe->ptr[0])) fe->ptr++;
	/* subsequent call */
	if (!fe->ptr[0]) {
		/* loop end */
		free(fe->list);
		fe->list = 0;
		return (0);
	}
	new = strpbrk(fe->ptr, delim);
	if (!new) new = strchr(fe->ptr,0);
	saved = *new;
	*new = 0;
	setenv(varname,fe->ptr,1);
	if (saved) new++;
	fe->ptr = new;
	return (1);
}

#ifdef TESTING_MAIN

static void die(char *reason)
{
  error("par dead: %s\n", reason);
  exit(0);
}

int
main(int argc, char **argv)
{
  if (argc != 2)
    die("no filename!");

  if (!parse_config(argv[1], argv[2] /* will be NULL if not given */))
    die("parse failed!\n");
}

#endif

/* for keyboard plugin */



static void keyb_mod(int wich, t_keysym keynum, int unicode)
{
	static t_keysym *table = 0;
	static int count = 0;
	
	if (wich == ' ') {
		switch (keynum & 0xFF00) {
		case 0x000: wich = ' '; break;
		case 0x100: wich = 'S'; break;
		case 0x200: wich = 'A'; break;
		case 0x300: wich = 'N'; break;
		case 0x400: wich = 'C'; break;
		case 0x500: wich = 'a'; break;
		case 0x600: wich = 'c'; break;
		default: 
			/* It's a bad value ditch it */
			wich ='X'; table = 0; count = 0; break;
		}
		keynum &= 0xFF;
	}

	switch (wich) {
	case ' ': table = config.keytable->key_map;
		count=config.keytable->sizemap;
		break;
	case 'S': table = config.keytable->shift_map;
		count=config.keytable->sizemap;
		break;
	case 'A': table = config.keytable->alt_map;
		count=config.keytable->sizemap;
		break;
	case 'C': table = config.keytable->ctrl_map;
		count=config.keytable->sizemap;
		break;
	case 'a': table = config.keytable->shift_alt_map;
		count=config.keytable->sizemap;
		break;
	case 'c': table = config.keytable->ctrl_alt_map;
		count=config.keytable->sizemap;
		break;
	case 'N': table = config.keytable->num_table;
		count=config.keytable->sizepad;
		break;
	}


	if (!table || (count == 0) || (wich != 0 && keynum >= count)) {
		count = 0;
		table = 0;
		return;
	}
	if (wich != 0) {
		table += keynum;
		count -= keynum;
		return;
	}
	if (!unicode) {
		if (keynum == 0) {
			keynum = KEY_VOID;
		} else {
			keynum = keynum + 0xEF00;
		}
	}
	if (count > 0) {
		*table++ = keynum;
		count--;
	}
}


static char *get_key_name(t_keysym key)
{
	struct key_names {
		t_keysym key;
		char *name;
	};
	static struct key_names names[] =
	{
		{ KEY_DEAD_GRAVE,	"dgrave"},
		{ KEY_DEAD_ACUTE,	"dacute"},
		{ KEY_DEAD_CIRCUMFLEX,	"dcircum"},
		{ KEY_DEAD_TILDE,	"dtilde"},
		{ KEY_DEAD_BREVE,	"dbreve"},
		{ KEY_DEAD_ABOVEDOT,	"daboved"},
		{ KEY_DEAD_DIAERESIS,	"ddiares"},
		{ KEY_DEAD_ABOVERING,	"dabover"},
		{ KEY_DEAD_DOUBLEACUTE,	"ddacute"},
		{ KEY_DEAD_CEDILLA,	"dcedilla"},
		{ KEY_DEAD_OGONEK,	"dogonek"},
		{ KEY_DEAD_CARON,	"dcaron"},
	};
	int i;
	for(i = 0; i < sizeof(names)/sizeof(names[0]); i++) {
		if (names[i].key == key) {
			return names[i].name;
		}
	}
	return 0;
}

static void dump_keytable_part(FILE *f, t_keysym *map, int size)
{
  int i, in_string=0;
  t_keysym c;
  char *cc, comma=' ', buf[16];

  /* Note: This code assumes every font is a superset of ascii */
  if (!map) {
	  return;
  }
  size--;
  for (i=0; i<=size; i++) {
    c = map[i];
    if (!(i & 15)) fprintf(f,"    ");
    cc = get_key_name(c);
    if (!cc && (c < 128) && isprint(c) && !strchr("\\\"\'`", c)) {
      if (in_string) fputc(c,f);
      else {
        fprintf(f, "%c\"%c", comma, c);
        in_string = 1;
      }
    }
    else {
      if (!cc) {
	if (((c > 0) && (c < 128)) || ((c >= 0xEF00) && (c <= 0xEFFF))) {
	  sprintf(buf, "%d", c & 0xFF);
	} else if (c == KEY_VOID) {
	  strcpy(buf, "0");
	} else {
	  sprintf(buf, "\\u%04x", c);
	}
	cc = buf;
      }
      if (!in_string) fprintf(f, "%c%s", comma, cc);
      else {
        fprintf(f, "\",%s", cc);
        in_string = 0;
      }
    }
    if ((i & 15) == 15) {
      if (in_string) fputc('"', f);
      if (i < size) fputc(',', f);
      fputc('\n', f);
      in_string = 0;
      comma = ' ';
    }
    else comma = ',';
  }
  if (in_string) fputc('"', f);
  fputc('\n', f);
}


void dump_keytable(FILE *f, struct keytable_entry *kt)
{
    fprintf(f, "keytable %s {\n", kt->name);
    fprintf(f, "  0=\n");
    dump_keytable_part(f, kt->key_map, kt->sizemap);
    fprintf(f, "  shift 0=\n");
    dump_keytable_part(f, kt->shift_map, kt->sizemap);
    fprintf(f, "  alt 0=\n");
    dump_keytable_part(f, kt->alt_map, kt->sizemap);
    fprintf(f, "  numpad 0=\n");
    dump_keytable_part(f, kt->num_table, kt->sizepad-1);
    fprintf(f, "  ctrl 0=\n");
    dump_keytable_part(f, kt->ctrl_map, kt->sizemap);
    fprintf(f, "  shift-alt 0=\n");
    dump_keytable_part(f, kt->shift_alt_map, kt->sizemap);
    fprintf(f, "  ctrl-alt 0=\n");
    dump_keytable_part(f, kt->ctrl_alt_map, kt->sizemap);
    fprintf(f, "}\n\n\n");
}



	/* charset */
static struct char_set *get_charset(char *name)
{
	struct char_set *charset;

	charset = lookup_charset(name);
	if (!charset) {
		yyerror("Can't find charset %s", name);
	}
	return charset;

}

static void set_external_charset(char *charset_name)
{
	struct char_set *charset;
	charset = get_charset(charset_name);
	charset = get_terminal_charset(charset);
	if (charset) {
		if (!trconfig.output_charset) {
			trconfig.output_charset = charset;
		}
		if (!trconfig.keyb_charset) {
			trconfig.keyb_charset = charset;
		}
	}
	return;
}

static void set_internal_charset(char *charset_name)
{
	struct char_set *charset_video, *charset_config;
	charset_video = get_charset(charset_name);
	if (!is_display_charset(charset_video)) {
		yyerror("%s not suitable as an internal charset", charset_name);
	}
	charset_config = get_terminal_charset(charset_video);
	if (charset_video && !trconfig.video_mem_charset) {
		trconfig.video_mem_charset = charset_video;
	}
	if (charset_config && !trconfig.keyb_config_charset) {
		trconfig.keyb_config_charset = charset_config;
	}
	if (charset_config && !trconfig.dos_charset) {
		trconfig.dos_charset = charset_config;
	}
	return;
}

