From ad50501872f2e1c9a0f4d5e4b45334a3ef503d49 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 2 Dec 2015 19:10:12 -0500 Subject: [PATCH 01/18] Release prep 1 Changes to be committed: modified: include/global.h modified: include/patchlevel.h --- include/global.h | 2 +- include/patchlevel.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/global.h b/include/global.h index 42be8902d..73a2c1802 100644 --- a/include/global.h +++ b/include/global.h @@ -7,7 +7,7 @@ #include -#define BETA /* development or beta testing [MRS] */ +/* #define BETA /* development or beta testing [MRS] */ #define DEBUG diff --git a/include/patchlevel.h b/include/patchlevel.h index 33fc0f606..64cc5e4a4 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -36,8 +36,12 @@ /* Version 3.6.x */ /* - * NetHack 3.6.0, June NN, NNNN + * NetHack 3.6.0, December 7, 2015 * + * Hundreds of bug fixes. + * Some code reorganization. + * Some new features. + * Variations of some community patches rolled in. */ /****************************************************************************/ From 8bd70be165d12d1a667801cf6c4956367d56a332 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 2 Dec 2015 23:19:04 -0500 Subject: [PATCH 02/18] windows build without DEBUG defined in global.h Changes to be committed: modified: include/global.h modified: sys/share/pcmain.c modified: win/win32/mswproc.c --- include/global.h | 6 +++--- sys/share/pcmain.c | 4 +++- win/win32/mswproc.c | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/global.h b/include/global.h index 73a2c1802..b7a61bd16 100644 --- a/include/global.h +++ b/include/global.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 global.h $NHDT-Date: 1432512780 2015/05/25 00:13:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.44 $ */ +/* NetHack 3.6 global.h $NHDT-Date: 1449116298 2015/12/03 04:18:18 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.46 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -7,9 +7,9 @@ #include -/* #define BETA /* development or beta testing [MRS] */ +/* #define BETA */ /* development or beta testing [MRS] */ -#define DEBUG +/* #define DEBUG */ /* * Files expected to exist in the playground directory. diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 5a78fb696..0276d61f8 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 pcmain.c $NHDT-Date: 1434999947 2015/06/22 19:05:47 $ $NHDT-Branch: master $:$NHDT-Revision: 1.65 $ */ +/* NetHack 3.6 pcmain.c $NHDT-Date: 1449116336 2015/12/03 04:18:56 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.66 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -123,6 +123,7 @@ char *argv[]; boolean resuming = FALSE; /* assume new game */ #ifdef _MSC_VER +# ifdef DEBUG /* set these appropriately for VS debugging */ _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG); _CrtSetReportMode(_CRT_ERROR, @@ -132,6 +133,7 @@ char *argv[]; /* use STDERR by default _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ +# endif #endif #if defined(__BORLANDC__) && !defined(_WIN32) diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index f4eb6a0fb..7bd28ebbe 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mswproc.c $NHDT-Date: 1433806620 2015/06/08 23:37:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.90 $ */ +/* NetHack 3.6 mswproc.c $NHDT-Date: 1449116317 2015/12/03 04:18:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.93 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ @@ -31,9 +31,11 @@ #define NHTRACE_LOG "nhtrace.log" -#ifdef _DEBUG +#ifdef DEBUG +# ifdef _DEBUG static FILE* _s_debugfp = NULL; extern void logDebug(const char *fmt, ...); +# endif #else void logDebug(const char *fmt, ...) From d267cb1b0f12d74945b61add7fa4289eebbbd089 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 2 Dec 2015 23:24:34 -0500 Subject: [PATCH 03/18] more windows DEBUG --- win/win32/mswproc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 7bd28ebbe..593131ad5 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mswproc.c $NHDT-Date: 1449116317 2015/12/03 04:18:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.93 $ */ +/* NetHack 3.6 mswproc.c $NHDT-Date: 1449116670 2015/12/03 04:24:30 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.94 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ @@ -134,11 +134,13 @@ mswin_init_nhwindows(int *argc, char **argv) UNREFERENCED_PARAMETER(argc); UNREFERENCED_PARAMETER(argv); -#ifdef _DEBUG +#ifdef DEBUG +# ifdef _DEBUG if (showdebug(NHTRACE_LOG) && !_s_debugfp) { /* truncate trace file */ _s_debugfp = fopen(NHTRACE_LOG, "w"); } +# endif #endif logDebug("mswin_init_nhwindows()\n"); @@ -2194,7 +2196,8 @@ mswin_popup_destroy(HWND hWnd) SetFocus(GetNHApp()->hMainWnd); } -#ifdef _DEBUG +#ifdef DEBUG +# ifdef _DEBUG #include void @@ -2210,7 +2213,7 @@ logDebug(const char *fmt, ...) va_end(args); fflush(_s_debugfp); } - +# endif #endif /* Reading and writing settings from the registry. */ From 786ac8abe6a8c32eebe1eb6fd4e11fa1d83d01f5 Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 3 Dec 2015 04:23:53 -0500 Subject: [PATCH 04/18] 'Merge' prebuilts from master --- sys/share/dgn_comp.h | 130 +- sys/share/dgn_lex.c | 1555 +++++++++++++---------- sys/share/dgn_yacc.c | 2863 ++++++++++++------------------------------ sys/share/lev_comp.h | 589 +++------ sys/share/lev_lex.c | 38 +- 5 files changed, 1928 insertions(+), 3247 deletions(-) diff --git a/sys/share/dgn_comp.h b/sys/share/dgn_comp.h index 39a15c077..8f3ecfd64 100644 --- a/sys/share/dgn_comp.h +++ b/sys/share/dgn_comp.h @@ -1,113 +1,27 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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 . */ - -/* 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. */ - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - INTEGER = 258, - A_DUNGEON = 259, - BRANCH = 260, - CHBRANCH = 261, - LEVEL = 262, - RNDLEVEL = 263, - CHLEVEL = 264, - RNDCHLEVEL = 265, - UP_OR_DOWN = 266, - PROTOFILE = 267, - DESCRIPTION = 268, - DESCRIPTOR = 269, - LEVELDESC = 270, - ALIGNMENT = 271, - LEVALIGN = 272, - ENTRY = 273, - STAIR = 274, - NO_UP = 275, - NO_DOWN = 276, - PORTAL = 277, - STRING = 278 - }; -#endif -/* Tokens. */ -#define INTEGER 258 -#define A_DUNGEON 259 -#define BRANCH 260 -#define CHBRANCH 261 -#define LEVEL 262 -#define RNDLEVEL 263 -#define CHLEVEL 264 -#define RNDCHLEVEL 265 -#define UP_OR_DOWN 266 -#define PROTOFILE 267 -#define DESCRIPTION 268 -#define DESCRIPTOR 269 -#define LEVELDESC 270 -#define ALIGNMENT 271 -#define LEVALIGN 272 -#define ENTRY 273 -#define STAIR 274 -#define NO_UP 275 -#define NO_DOWN 276 -#define PORTAL 277 -#define STRING 278 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +#define INTEGER 257 +#define A_DUNGEON 258 +#define BRANCH 259 +#define CHBRANCH 260 +#define LEVEL 261 +#define RNDLEVEL 262 +#define CHLEVEL 263 +#define RNDCHLEVEL 264 +#define UP_OR_DOWN 265 +#define PROTOFILE 266 +#define DESCRIPTION 267 +#define DESCRIPTOR 268 +#define LEVELDESC 269 +#define ALIGNMENT 270 +#define LEVALIGN 271 +#define ENTRY 272 +#define STAIR 273 +#define NO_UP 274 +#define NO_DOWN 275 +#define PORTAL 276 +#define STRING 277 +typedef union { - -/* Line 1676 of yacc.c */ -#line 67 "dgn_comp.y" - int i; char* str; - - - -/* Line 1676 of yacc.c */ -#line 105 "y.tab.h" } YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - extern YYSTYPE yylval; - - diff --git a/sys/share/dgn_lex.c b/sys/share/dgn_lex.c index 6af484b14..5129b03ff 100644 --- a/sys/share/dgn_lex.c +++ b/sys/share/dgn_lex.c @@ -1,67 +1,113 @@ -/* A lexical scanner generated by flex */ -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ - */ +#line 3 "dgn_lex.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 37 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ #include +#include +#include +#include +/* end standard C headers. */ -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 #endif +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ #ifdef __cplusplus -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) -#define YY_USE_PROTOS #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - /* Returned upon end-of-file. */ #define YY_NULL 0 @@ -76,71 +122,70 @@ * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ -#define BEGIN yy_start = 1 + 2 * +#define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ -#define YY_START ((yy_start - 1) / 2) +#define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) +#define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ +#ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 +#endif +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t yyleng; -extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - +#define unput(c) yyunput( c, (yytext_ptr) ) +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; @@ -156,7 +201,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -177,12 +222,16 @@ struct yy_buffer_state */ int yy_at_bol; + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; + #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process @@ -196,28 +245,38 @@ struct yy_buffer_state * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 - }; -static YY_BUFFER_STATE yy_current_buffer = 0; + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". + * + * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER yy_current_buffer +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ +static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches @@ -225,66 +284,92 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart YY_PROTO(( FILE *input_file )); +void yyrestart (FILE *input_file ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); +void yy_delete_buffer (YY_BUFFER_STATE b ); +void yy_flush_buffer (YY_BUFFER_STATE b ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state (void ); -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) +static void yyensure_buffer_stack (void ); +static void yy_load_buffer_state (void ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); + +void *yyalloc (yy_size_t ); +void *yyrealloc (void *,yy_size_t ); +void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ typedef unsigned char YY_CHAR; + FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + typedef int yy_state_type; + +extern int yylineno; + +int yylineno = 1; + extern char *yytext; #define yytext_ptr yytext -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; + (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 35 #define YY_END_OF_BUFFER 36 -static yyconst short int yy_accept[196] = +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[196] = { 0, 0, 0, 36, 34, 33, 32, 34, 34, 29, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, @@ -310,7 +395,7 @@ static yyconst short int yy_accept[196] = } ; -static yyconst int yy_ec[256] = +static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -342,7 +427,7 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[49] = +static yyconst flex_int32_t yy_meta[49] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -351,7 +436,7 @@ static yyconst int yy_meta[49] = 1, 1, 1, 1, 1, 1, 1, 1 } ; -static yyconst short int yy_base[198] = +static yyconst flex_int16_t yy_base[198] = { 0, 0, 213, 218, 220, 215, 220, 213, 210, 207, 196, 190, 196, 37, 191, 197, 186, 188, 171, 164, 172, @@ -377,7 +462,7 @@ static yyconst short int yy_base[198] = } ; -static yyconst short int yy_def[198] = +static yyconst flex_int16_t yy_def[198] = { 0, 195, 1, 195, 195, 195, 195, 195, 196, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, @@ -403,7 +488,7 @@ static yyconst short int yy_def[198] = } ; -static yyconst short int yy_nxt[269] = +static yyconst flex_int16_t yy_nxt[269] = { 0, 4, 5, 6, 7, 8, 4, 9, 10, 11, 12, 13, 14, 4, 4, 4, 4, 15, 4, 4, 4, @@ -436,7 +521,7 @@ static yyconst short int yy_nxt[269] = 195, 195, 195, 195, 195, 195, 195, 195 } ; -static yyconst short int yy_chk[269] = +static yyconst flex_int16_t yy_chk[269] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -472,6 +557,9 @@ static yyconst short int yy_chk[269] = static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; +extern int yy_flex_debug; +int yy_flex_debug = 0; + /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ @@ -481,9 +569,8 @@ static char *yy_last_accepting_cpos; #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "dgn_comp.l" -#define INITIAL 0 #line 2 "dgn_comp.l" -/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1432512785 2015/05/25 00:13:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */ +/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1448710672 2015/11/28 11:37:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1990 by M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -539,7 +626,11 @@ void FDECL(yyoutput, (int)); int FDECL(yyunput, (int)); int FDECL(yyoutput, (int)); # endif -#endif /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ + +#else /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ +/* most recent flex allows suppressing yyunput() altogether when not needed */ +#define YY_NO_UNPUT +#endif #ifdef FLEX_SCANNER #define YY_MALLOC_DECL \ @@ -559,7 +650,52 @@ extern YYSTYPE yylval; int nh_line_number = 1; -#line 563 "lex.yy.c" +#line 654 "dgn_lex.c" + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (void ); + +int yyget_debug (void ); + +void yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE yyget_extra (void ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in (void ); + +void yyset_in (FILE * in_str ); + +FILE *yyget_out (void ); + +void yyset_out (FILE * out_str ); + +yy_size_t yyget_leng (void ); + +char *yyget_text (void ); + +int yyget_lineno (void ); + +void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -567,65 +703,30 @@ int nh_line_number = 1; #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); +extern "C" int yywrap (void ); #else -extern int yywrap YY_PROTO(( void )); +extern int yywrap (void ); #endif #endif -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - + static void yyunput (int c,char *buf_ptr ); + #ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); +static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT + #ifdef __cplusplus -static int yyinput YY_PROTO(( void )); +static int yyinput (void ); #else -static int input YY_PROTO(( void )); -#endif +static int input (void ); #endif -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif #endif /* Amount of stuff to slurp up with each read. */ @@ -634,12 +735,11 @@ YY_MALLOC_DECL #endif /* Copy whatever the last rule matched to the standard output. */ - #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -647,9 +747,10 @@ YY_MALLOC_DECL */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ - int c = '*', n; \ + int c = '*'; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -659,9 +760,22 @@ YY_MALLOC_DECL YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -682,12 +796,18 @@ YY_MALLOC_DECL #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif +/* end tables serialization structures and prototypes */ + /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif +#define YY_DECL_IS_OURS 1 + +extern int yylex (void); + +#define YY_DECL int yylex (void) +#endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. @@ -703,30 +823,32 @@ YY_MALLOC_DECL #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION +/** The main scanner function which does all the work. + */ YY_DECL - { +{ register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; + +#line 83 "dgn_comp.l" -#line 79 "dgn_comp.l" +#line 841 "dgn_lex.c" -#line 719 "lex.yy.c" - - if ( yy_init ) + if ( !(yy_init) ) { - yy_init = 0; + (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif - if ( ! yy_start ) - yy_start = 1; /* first start state */ + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; @@ -734,26 +856,28 @@ YY_DECL if ( ! yyout ) yyout = stdout; - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } - yy_load_buffer_state(); + yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { - yy_cp = yy_c_buf_p; + yy_cp = (yy_c_buf_p); /* Support of yytext. */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; - yy_current_state = yy_start; + yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); yy_match: do @@ -761,8 +885,8 @@ yy_match: register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { @@ -779,231 +903,231 @@ yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; - do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP -#line 80 "dgn_comp.l" +#line 84 "dgn_comp.l" return(A_DUNGEON); YY_BREAK case 2: YY_RULE_SETUP -#line 81 "dgn_comp.l" +#line 85 "dgn_comp.l" { yylval.i=1; return(UP_OR_DOWN); } YY_BREAK case 3: YY_RULE_SETUP -#line 82 "dgn_comp.l" +#line 86 "dgn_comp.l" { yylval.i=0; return(UP_OR_DOWN); } YY_BREAK case 4: YY_RULE_SETUP -#line 83 "dgn_comp.l" +#line 87 "dgn_comp.l" return(ENTRY); YY_BREAK case 5: YY_RULE_SETUP -#line 84 "dgn_comp.l" +#line 88 "dgn_comp.l" return(STAIR); YY_BREAK case 6: YY_RULE_SETUP -#line 85 "dgn_comp.l" +#line 89 "dgn_comp.l" return(NO_UP); YY_BREAK case 7: YY_RULE_SETUP -#line 86 "dgn_comp.l" +#line 90 "dgn_comp.l" return(NO_DOWN); YY_BREAK case 8: YY_RULE_SETUP -#line 87 "dgn_comp.l" +#line 91 "dgn_comp.l" return(PORTAL); YY_BREAK case 9: YY_RULE_SETUP -#line 88 "dgn_comp.l" +#line 92 "dgn_comp.l" return(PROTOFILE); YY_BREAK case 10: YY_RULE_SETUP -#line 89 "dgn_comp.l" +#line 93 "dgn_comp.l" return(DESCRIPTION); YY_BREAK case 11: YY_RULE_SETUP -#line 90 "dgn_comp.l" +#line 94 "dgn_comp.l" return(LEVELDESC); YY_BREAK case 12: YY_RULE_SETUP -#line 91 "dgn_comp.l" +#line 95 "dgn_comp.l" return(ALIGNMENT); YY_BREAK case 13: YY_RULE_SETUP -#line 92 "dgn_comp.l" +#line 96 "dgn_comp.l" return(LEVALIGN); YY_BREAK case 14: YY_RULE_SETUP -#line 93 "dgn_comp.l" +#line 97 "dgn_comp.l" { yylval.i=TOWN ; return(DESCRIPTOR); } YY_BREAK case 15: YY_RULE_SETUP -#line 94 "dgn_comp.l" +#line 98 "dgn_comp.l" { yylval.i=HELLISH ; return(DESCRIPTOR); } YY_BREAK case 16: YY_RULE_SETUP -#line 95 "dgn_comp.l" +#line 99 "dgn_comp.l" { yylval.i=MAZELIKE ; return(DESCRIPTOR); } YY_BREAK case 17: YY_RULE_SETUP -#line 96 "dgn_comp.l" +#line 100 "dgn_comp.l" { yylval.i=ROGUELIKE ; return(DESCRIPTOR); } YY_BREAK case 18: YY_RULE_SETUP -#line 97 "dgn_comp.l" +#line 101 "dgn_comp.l" { yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); } YY_BREAK case 19: YY_RULE_SETUP -#line 98 "dgn_comp.l" +#line 102 "dgn_comp.l" { yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); } YY_BREAK case 20: YY_RULE_SETUP -#line 99 "dgn_comp.l" +#line 103 "dgn_comp.l" { yylval.i=D_ALIGN_LAWFUL ; return(DESCRIPTOR); } YY_BREAK case 21: YY_RULE_SETUP -#line 100 "dgn_comp.l" +#line 104 "dgn_comp.l" { yylval.i=D_ALIGN_NEUTRAL ; return(DESCRIPTOR); } YY_BREAK case 22: YY_RULE_SETUP -#line 101 "dgn_comp.l" +#line 105 "dgn_comp.l" { yylval.i=D_ALIGN_CHAOTIC ; return(DESCRIPTOR); } YY_BREAK case 23: YY_RULE_SETUP -#line 102 "dgn_comp.l" +#line 106 "dgn_comp.l" return(BRANCH); YY_BREAK case 24: YY_RULE_SETUP -#line 103 "dgn_comp.l" +#line 107 "dgn_comp.l" return(CHBRANCH); YY_BREAK case 25: YY_RULE_SETUP -#line 104 "dgn_comp.l" +#line 108 "dgn_comp.l" return(LEVEL); YY_BREAK case 26: YY_RULE_SETUP -#line 105 "dgn_comp.l" +#line 109 "dgn_comp.l" return(RNDLEVEL); YY_BREAK case 27: YY_RULE_SETUP -#line 106 "dgn_comp.l" +#line 110 "dgn_comp.l" return(CHLEVEL); YY_BREAK case 28: YY_RULE_SETUP -#line 107 "dgn_comp.l" +#line 111 "dgn_comp.l" return(RNDCHLEVEL); YY_BREAK case 29: YY_RULE_SETUP -#line 108 "dgn_comp.l" +#line 112 "dgn_comp.l" { yylval.i=atoi(yytext); return(INTEGER); } YY_BREAK case 30: -YY_RULE_SETUP -#line 109 "dgn_comp.l" -{ yytext[yyleng-1] = 0; /* Discard the trailing \" */ - yylval.str = (char *) alloc(strlen(yytext+1)+1); - Strcpy(yylval.str, yytext+1); /* Discard the first \" */ - return(STRING); } - YY_BREAK -case 31: +/* rule 30 can match eol */ YY_RULE_SETUP #line 113 "dgn_comp.l" +{ yytext[yyleng - 1] = '\0'; /* discard the trailing \" */ + yylval.str = dupstr(yytext + 1); /* skip the first \" */ + return STRING; } + YY_BREAK +case 31: +/* rule 31 can match eol */ +YY_RULE_SETUP +#line 116 "dgn_comp.l" { nh_line_number++; } YY_BREAK case 32: +/* rule 32 can match eol */ YY_RULE_SETUP -#line 114 "dgn_comp.l" +#line 117 "dgn_comp.l" { nh_line_number++; } YY_BREAK case 33: YY_RULE_SETUP -#line 115 "dgn_comp.l" +#line 118 "dgn_comp.l" ; /* skip trailing tabs & spaces */ YY_BREAK case 34: YY_RULE_SETUP -#line 116 "dgn_comp.l" +#line 119 "dgn_comp.l" { return yytext[0]; } YY_BREAK case 35: YY_RULE_SETUP -#line 117 "dgn_comp.l" +#line 120 "dgn_comp.l" ECHO; YY_BREAK -#line 981 "lex.yy.c" +#line 1105 "dgn_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our + * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position @@ -1013,13 +1137,13 @@ case YY_STATE_EOF(INITIAL): * end-of-buffer state). Contrast this with the test * in input(). */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have @@ -1032,30 +1156,30 @@ case YY_STATE_EOF(INITIAL): yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; + yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { - yy_cp = yy_c_buf_p; + yy_cp = (yy_c_buf_p); goto yy_find_action; } } - else switch ( yy_get_next_buffer() ) + else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { - yy_did_buffer_switch_on_eof = 0; + (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap() ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -1066,7 +1190,7 @@ case YY_STATE_EOF(INITIAL): * YY_NULL, it'll still work - another * YY_NULL will get returned. */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; @@ -1074,30 +1198,30 @@ case YY_STATE_EOF(INITIAL): else { - if ( ! yy_did_buffer_switch_on_eof ) + if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; @@ -1108,8 +1232,7 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of yylex */ - +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -1118,21 +1241,20 @@ case YY_STATE_EOF(INITIAL): * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); - if ( yy_current_buffer->yy_fill_buffer == 0 ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. @@ -1152,38 +1274,34 @@ static int yy_get_next_buffer() /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); + (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1192,8 +1310,7 @@ static int yy_get_next_buffer() b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -1203,35 +1320,35 @@ static int yy_get_next_buffer() YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = yy_current_buffer->yy_buf_size - + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; -#endif + } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); - yy_current_buffer->yy_n_chars = yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - if ( yy_n_chars == 0 ) + if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); + yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } @@ -1239,33 +1356,40 @@ static int yy_get_next_buffer() else ret_val = EOB_ACT_CONTINUE_SCAN; - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} /* yy_get_previous_state - get the state just before the EOB char was reached */ -static yy_state_type yy_get_previous_state() - { + static yy_state_type yy_get_previous_state (void) +{ register yy_state_type yy_current_state; register char *yy_cp; - - yy_current_state = yy_start; + + yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { @@ -1277,30 +1401,23 @@ static yy_state_type yy_get_previous_state() } return yy_current_state; - } - +} /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; + register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { @@ -1311,81 +1428,74 @@ yy_state_type yy_current_state; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 195); - return yy_is_jam ? 0 : yy_current_state; - } + return yy_is_jam ? 0 : yy_current_state; +} - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; + register yy_size_t number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - while ( source > yy_current_buffer->yy_ch_buf ) + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - +#ifndef YY_NO_INPUT #ifdef __cplusplus -static int yyinput() + static int yyinput (void) #else -static int input() + static int input (void) #endif - { + +{ int c; + + *(yy_c_buf_p) = (yy_hold_char); - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ - *yy_c_buf_p = '\0'; + *(yy_c_buf_p) = '\0'; else { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); - switch ( yy_get_next_buffer() ) + switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() @@ -1399,16 +1509,16 @@ static int input() */ /* Reset buffer status. */ - yyrestart( yyin ); + yyrestart(yyin ); - /* fall through */ + /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap() ) + if ( yywrap( ) ) return EOF; - if ( ! yy_did_buffer_switch_on_eof ) + if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); @@ -1418,91 +1528,94 @@ static int input() } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; + (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); - yy_current_buffer->yy_at_bol = (c == '\n'); + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); } + yy_init_buffer(YY_CURRENT_BUFFER,input_file ); + yy_load_buffer_state( ); +} -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) return; - if ( yy_current_buffer ) + if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - yy_current_buffer = new_buffer; - yy_load_buffer_state(); + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ - yy_did_buffer_switch_on_eof = 1; - } + (yy_did_buffer_switch_on_eof) = 1; +} +static void yy_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +{ YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -1511,80 +1624,71 @@ int size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer( b, file ); + yy_init_buffer(b,file ); return b; - } +} - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) return; - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); + yyfree((void *) b->yy_ch_buf ); - yy_flex_free( (void *) b ); - } + yyfree((void *) b ); +} +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); +{ + int oerrno = errno; + + yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) return; b->yy_n_chars = 0; @@ -1601,29 +1705,125 @@ YY_BUFFER_STATE b; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == yy_current_buffer ) - yy_load_buffer_state(); + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void yypop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (void) +{ + yy_size_t num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; } + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +{ YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); @@ -1637,56 +1837,51 @@ yy_size_t size; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer( b ); + yy_switch_to_buffer(b ); return b; - } -#endif +} +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +{ + + return yy_scan_bytes(yystr,strlen(yystr) ); +} -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +{ YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); + n = _yybytes_len + 2; + buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer( buf, n ); + b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); @@ -1696,78 +1891,17 @@ int len; b->yy_is_our_buffer = 1; return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif +} #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); - } - - +} /* Redefine yyless() so it works in section 3 code. */ @@ -1776,68 +1910,177 @@ char msg[]; do \ { \ /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ } \ while ( 0 ) +/* Accessor methods (get/set functions) to struct members. */ -/* Internal utility routines. */ +/** Get the current line number. + * + */ +int yyget_lineno (void) +{ + + return yylineno; +} + +/** Get the input stream. + * + */ +FILE *yyget_in (void) +{ + return yyin; +} + +/** Get the output stream. + * + */ +FILE *yyget_out (void) +{ + return yyout; +} + +/** Get the length of the current token. + * + */ +yy_size_t yyget_leng (void) +{ + return yyleng; +} + +/** Get the current token. + * + */ + +char *yyget_text (void) +{ + return yytext; +} + +/** Set the current line number. + * @param line_number + * + */ +void yyset_lineno (int line_number ) +{ + + yylineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * in_str ) +{ + yyin = in_str ; +} + +void yyset_out (FILE * out_str ) +{ + yyout = out_str ; +} + +int yyget_debug (void) +{ + return yy_flex_debug; +} + +void yyset_debug (int bdebug ) +{ + yy_flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = (FILE *) 0; + yyout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ #ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; - } +} #endif #ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { +static int yy_flex_strlen (yyconst char * s ) +{ register int n; for ( n = 0; s[n]; ++n ) ; return n; - } +} #endif - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { +void *yyalloc (yy_size_t size ) +{ return (void *) malloc( size ); - } +} -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { +void *yyrealloc (void * ptr, yy_size_t size ) +{ /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -1846,44 +2089,38 @@ yy_size_t size; * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); - } +} -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 120 "dgn_comp.l" -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 117 "dgn_comp.l" /* routine to switch to another input file; needed for flex */ -void init_yyin( input_f ) +void +init_yyin( input_f ) FILE *input_f; { #if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) - if (yyin) - yyrestart(input_f); - else + if (yyin) + yyrestart(input_f); + else #endif - yyin = input_f; + yyin = input_f; } /* analogous routine (for completeness) */ -void init_yyout( output_f ) +void +init_yyout( output_f ) FILE *output_f; { - yyout = output_f; + yyout = output_f; } /*dgn_comp.l*/ + diff --git a/sys/share/dgn_yacc.c b/sys/share/dgn_yacc.c index dfdb781ef..eb7a4e972 100644 --- a/sys/share/dgn_yacc.c +++ b/sys/share/dgn_yacc.c @@ -1,75 +1,25 @@ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif -/* A Bison parser, made by GNU Bison 2.4.1. */ +#include +#include -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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 . */ +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 +#define YYPATCH 20070509 -/* 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. */ +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING (yyerrflag != 0) -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* 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. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Copy the first part of user declarations. */ - -/* Line 189 of yacc.c */ -#line 1 "dgn_comp.y" +extern int yyparse(void); +static int yygrowstack(void); +#define YYPREFIX "yy" +#line 2 "dgn_comp.y" /* NetHack 3.6 dgn_comp.y $NHDT-Date: 1432512785 2015/05/25 00:13:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1990 by M. Stephenson */ @@ -132,1995 +82,281 @@ extern int fatal_error; extern const char *fname; extern FILE *yyin, *yyout; /* from dgn_lex.c */ - - -/* Line 189 of yacc.c */ -#line 139 "y.tab.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - INTEGER = 258, - A_DUNGEON = 259, - BRANCH = 260, - CHBRANCH = 261, - LEVEL = 262, - RNDLEVEL = 263, - CHLEVEL = 264, - RNDCHLEVEL = 265, - UP_OR_DOWN = 266, - PROTOFILE = 267, - DESCRIPTION = 268, - DESCRIPTOR = 269, - LEVELDESC = 270, - ALIGNMENT = 271, - LEVALIGN = 272, - ENTRY = 273, - STAIR = 274, - NO_UP = 275, - NO_DOWN = 276, - PORTAL = 277, - STRING = 278 - }; -#endif -/* Tokens. */ -#define INTEGER 258 -#define A_DUNGEON 259 -#define BRANCH 260 -#define CHBRANCH 261 -#define LEVEL 262 -#define RNDLEVEL 263 -#define CHLEVEL 264 -#define RNDCHLEVEL 265 -#define UP_OR_DOWN 266 -#define PROTOFILE 267 -#define DESCRIPTION 268 -#define DESCRIPTOR 269 -#define LEVELDESC 270 -#define ALIGNMENT 271 -#define LEVALIGN 272 -#define ENTRY 273 -#define STAIR 274 -#define NO_UP 275 -#define NO_DOWN 276 -#define PORTAL 277 -#define STRING 278 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +#line 66 "dgn_comp.y" +typedef union { - -/* Line 214 of yacc.c */ -#line 67 "dgn_comp.y" - int i; char* str; - - - -/* Line 214 of yacc.c */ -#line 228 "y.tab.c" } YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - -/* Copy the second part of user declarations. */ - - -/* Line 264 of yacc.c */ -#line 240 "y.tab.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; -#endif -{ - return yyi; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* 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 /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (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 _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; +#line 92 "y.tab.c" +#define INTEGER 257 +#define A_DUNGEON 258 +#define BRANCH 259 +#define CHBRANCH 260 +#define LEVEL 261 +#define RNDLEVEL 262 +#define CHLEVEL 263 +#define RNDCHLEVEL 264 +#define UP_OR_DOWN 265 +#define PROTOFILE 266 +#define DESCRIPTION 267 +#define DESCRIPTOR 268 +#define LEVELDESC 269 +#define ALIGNMENT 270 +#define LEVALIGN 271 +#define ENTRY 272 +#define STAIR 273 +#define NO_UP 274 +#define NO_DOWN 275 +#define PORTAL 276 +#define STRING 277 +#define YYERRCODE 256 +short yylhs[] = { -1, + 0, 0, 5, 5, 6, 6, 6, 6, 7, 1, + 1, 8, 8, 8, 12, 13, 15, 15, 14, 10, + 10, 10, 10, 10, 16, 16, 17, 17, 18, 18, + 19, 19, 20, 20, 9, 9, 22, 23, 3, 3, + 3, 3, 3, 2, 2, 4, 21, 11, }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* 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 \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 45 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 83 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 30 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 25 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 49 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 109 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 278 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 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, - 27, 29, 2, 26, 28, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 24, 2, - 2, 2, 2, 2, 25, 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, 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 +short yylen[] = { 2, + 0, 1, 1, 2, 1, 1, 1, 1, 6, 0, + 1, 1, 1, 1, 3, 1, 3, 3, 3, 1, + 1, 1, 1, 1, 6, 7, 7, 8, 3, 3, + 7, 8, 8, 9, 1, 1, 7, 8, 0, 1, + 1, 1, 1, 0, 1, 1, 5, 5, }; - +short yydefred[] = { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 5, 6, 7, 8, + 12, 13, 14, 16, 20, 21, 22, 23, 24, 35, + 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, + 0, 0, 19, 17, 29, 18, 30, 15, 46, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 11, 9, 0, 40, + 41, 42, 43, 0, 0, 0, 0, 0, 0, 0, + 0, 45, 37, 0, 27, 0, 0, 0, 0, 0, + 38, 28, 33, 0, 48, 47, 34, +}; +short yydgoto[] = { 14, + 78, 93, 84, 60, 15, 16, 17, 18, 19, 20, + 68, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 70, 30, 31, +}; +short yysindex[] = { -237, + -46, -45, -44, -39, -38, -30, -22, -21, -20, -19, + -18, -17, -16, 0, -237, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -262, -234, -233, -232, -230, -229, -228, -227, -217, + -216, -215, -214, -202, 0, -221, -7, -219, -221, -221, + -221, -221, 0, 0, 0, 0, 0, 0, 0, 19, + 20, 21, -2, -1, -212, -211, -190, -189, -188, -271, + 19, 20, 20, 27, 28, 29, 0, 0, 30, 0, + 0, 0, 0, -193, -271, -182, -180, 19, 19, -179, + -178, 0, 0, -193, 0, -177, -176, -175, 42, 43, + 0, 0, 0, -172, 0, 0, 0, +}; +short yyrindex[] = { 86, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 87, 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, + 0, 0, 0, 0, 0, 0, 0, 16, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 31, 1, 46, 0, 0, 0, 0, + 0, 0, 0, 31, 0, 61, 76, 0, 0, 0, + 0, 0, 0, 91, 0, 0, 0, +}; +short yygindex[] = { 0, + 0, -6, 4, -43, 0, 75, 0, 0, 0, 0, + -71, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -62, 0, 0, +}; +#define YYTABLESIZE 363 +short yytable[] = { 85, + 39, 80, 81, 82, 83, 63, 64, 65, 66, 86, + 87, 32, 33, 34, 46, 10, 97, 98, 35, 36, + 1, 2, 3, 4, 5, 6, 7, 37, 8, 9, + 44, 10, 11, 12, 13, 38, 39, 40, 41, 42, + 43, 44, 47, 48, 49, 25, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 61, 62, 67, 69, + 26, 72, 73, 71, 74, 75, 76, 77, 79, 88, + 89, 92, 90, 91, 95, 31, 96, 99, 100, 102, + 103, 104, 105, 106, 107, 1, 2, 101, 94, 45, + 32, 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, 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, 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, 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, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 0, 39, + 39, 39, 39, 10, 10, 10, 10, 10, 10, 10, + 0, 10, 10, 0, 10, 10, 10, 10, 44, 44, + 44, 44, 44, 44, 44, 0, 44, 44, 0, 44, + 44, 44, 44, 25, 25, 25, 25, 25, 25, 25, + 0, 25, 25, 0, 25, 25, 25, 25, 26, 26, + 26, 26, 26, 26, 26, 0, 26, 26, 0, 26, + 26, 26, 26, 31, 31, 31, 31, 31, 31, 31, + 0, 31, 31, 0, 31, 31, 31, 31, 32, 32, + 32, 32, 32, 32, 32, 0, 32, 32, 0, 32, + 32, 32, 32, +}; +short yycheck[] = { 71, + 0, 273, 274, 275, 276, 49, 50, 51, 52, 72, + 73, 58, 58, 58, 277, 0, 88, 89, 58, 58, + 258, 259, 260, 261, 262, 263, 264, 58, 266, 267, + 0, 269, 270, 271, 272, 58, 58, 58, 58, 58, + 58, 58, 277, 277, 277, 0, 277, 277, 277, 277, + 268, 268, 268, 268, 257, 277, 64, 277, 40, 40, + 0, 64, 64, 43, 277, 277, 257, 257, 257, 43, + 43, 265, 44, 44, 257, 0, 257, 257, 257, 257, + 257, 257, 41, 41, 257, 0, 0, 94, 85, 15, + 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, -1, 269, + 270, 271, 272, 258, 259, 260, 261, 262, 263, 264, + -1, 266, 267, -1, 269, 270, 271, 272, 258, 259, + 260, 261, 262, 263, 264, -1, 266, 267, -1, 269, + 270, 271, 272, 258, 259, 260, 261, 262, 263, 264, + -1, 266, 267, -1, 269, 270, 271, 272, 258, 259, + 260, 261, 262, 263, 264, -1, 266, 267, -1, 269, + 270, 271, 272, 258, 259, 260, 261, 262, 263, 264, + -1, 266, 267, -1, 269, 270, 271, 272, 258, 259, + 260, 261, 262, 263, 264, -1, 266, 267, -1, 269, + 270, 271, 272, +}; +#define YYFINAL 14 +#ifndef YYDEBUG +#define YYDEBUG 0 +#endif +#define YYMAXTOKEN 277 #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 4, 6, 8, 11, 13, 15, 17, - 19, 26, 27, 29, 31, 33, 35, 39, 41, 45, - 49, 53, 55, 57, 59, 61, 63, 70, 78, 86, - 95, 99, 103, 111, 120, 129, 139, 141, 143, 151, - 160, 161, 163, 165, 167, 169, 170, 172, 174, 180 +char *yyname[] = { +"end-of-file",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,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,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, +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,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,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,"INTEGER", +"A_DUNGEON","BRANCH","CHBRANCH","LEVEL","RNDLEVEL","CHLEVEL","RNDCHLEVEL", +"UP_OR_DOWN","PROTOFILE","DESCRIPTION","DESCRIPTOR","LEVELDESC","ALIGNMENT", +"LEVALIGN","ENTRY","STAIR","NO_UP","NO_DOWN","PORTAL","STRING", }; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 31, 0, -1, -1, 32, -1, 33, -1, 32, 33, - -1, 34, -1, 36, -1, 47, -1, 41, -1, 4, - 24, 23, 52, 54, 35, -1, -1, 3, -1, 37, - -1, 38, -1, 40, -1, 18, 24, 3, -1, 39, - -1, 13, 24, 14, -1, 16, 24, 14, -1, 12, - 24, 23, -1, 42, -1, 43, -1, 44, -1, 45, - -1, 46, -1, 7, 24, 23, 52, 25, 53, -1, - 8, 24, 23, 52, 25, 53, 3, -1, 7, 24, - 23, 52, 25, 53, 3, -1, 8, 24, 23, 52, - 25, 53, 3, 3, -1, 15, 24, 14, -1, 17, - 24, 14, -1, 9, 24, 23, 52, 23, 26, 54, - -1, 10, 24, 23, 52, 23, 26, 54, 3, -1, - 9, 24, 23, 52, 23, 26, 54, 3, -1, 10, - 24, 23, 52, 23, 26, 54, 3, 3, -1, 48, - -1, 49, -1, 5, 24, 23, 25, 53, 50, 51, - -1, 6, 24, 23, 23, 26, 54, 50, 51, -1, - -1, 19, -1, 20, -1, 21, -1, 22, -1, -1, - 11, -1, 23, -1, 27, 3, 28, 3, 29, -1, - 27, 3, 28, 3, 29, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 81, 81, 82, 88, 89, 92, 93, 94, 95, - 98, 111, 114, 120, 121, 122, 125, 131, 134, 141, - 150, 157, 158, 159, 160, 161, 164, 174, 187, 198, - 212, 219, 228, 241, 257, 271, 288, 289, 292, 306, - 323, 326, 330, 334, 338, 345, 348, 354, 384, 421 +char *yyrule[] = { +"$accept : file", +"file :", +"file : dungeons", +"dungeons : dungeon", +"dungeons : dungeons dungeon", +"dungeon : dungeonline", +"dungeon : dungeondesc", +"dungeon : branches", +"dungeon : levels", +"dungeonline : A_DUNGEON ':' STRING bones_tag rcouple optional_int", +"optional_int :", +"optional_int : INTEGER", +"dungeondesc : entry", +"dungeondesc : descriptions", +"dungeondesc : prototype", +"entry : ENTRY ':' INTEGER", +"descriptions : desc", +"desc : DESCRIPTION ':' DESCRIPTOR", +"desc : ALIGNMENT ':' DESCRIPTOR", +"prototype : PROTOFILE ':' STRING", +"levels : level1", +"levels : level2", +"levels : levdesc", +"levels : chlevel1", +"levels : chlevel2", +"level1 : LEVEL ':' STRING bones_tag '@' acouple", +"level1 : RNDLEVEL ':' STRING bones_tag '@' acouple INTEGER", +"level2 : LEVEL ':' STRING bones_tag '@' acouple INTEGER", +"level2 : RNDLEVEL ':' STRING bones_tag '@' acouple INTEGER INTEGER", +"levdesc : LEVELDESC ':' DESCRIPTOR", +"levdesc : LEVALIGN ':' DESCRIPTOR", +"chlevel1 : CHLEVEL ':' STRING bones_tag STRING '+' rcouple", +"chlevel1 : RNDCHLEVEL ':' STRING bones_tag STRING '+' rcouple INTEGER", +"chlevel2 : CHLEVEL ':' STRING bones_tag STRING '+' rcouple INTEGER", +"chlevel2 : RNDCHLEVEL ':' STRING bones_tag STRING '+' rcouple INTEGER INTEGER", +"branches : branch", +"branches : chbranch", +"branch : BRANCH ':' STRING '@' acouple branch_type direction", +"chbranch : CHBRANCH ':' STRING STRING '+' rcouple branch_type direction", +"branch_type :", +"branch_type : STAIR", +"branch_type : NO_UP", +"branch_type : NO_DOWN", +"branch_type : PORTAL", +"direction :", +"direction : UP_OR_DOWN", +"bones_tag : STRING", +"acouple : '(' INTEGER ',' INTEGER ')'", +"rcouple : '(' INTEGER ',' INTEGER ')'", }; #endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "INTEGER", "A_DUNGEON", "BRANCH", - "CHBRANCH", "LEVEL", "RNDLEVEL", "CHLEVEL", "RNDCHLEVEL", "UP_OR_DOWN", - "PROTOFILE", "DESCRIPTION", "DESCRIPTOR", "LEVELDESC", "ALIGNMENT", - "LEVALIGN", "ENTRY", "STAIR", "NO_UP", "NO_DOWN", "PORTAL", "STRING", - "':'", "'@'", "'+'", "'('", "','", "')'", "$accept", "file", "dungeons", - "dungeon", "dungeonline", "optional_int", "dungeondesc", "entry", - "descriptions", "desc", "prototype", "levels", "level1", "level2", - "levdesc", "chlevel1", "chlevel2", "branches", "branch", "chbranch", - "branch_type", "direction", "bones_tag", "acouple", "rcouple", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 58, 64, 43, 40, 44, 41 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 30, 31, 31, 32, 32, 33, 33, 33, 33, - 34, 35, 35, 36, 36, 36, 37, 38, 39, 39, - 40, 41, 41, 41, 41, 41, 42, 42, 43, 43, - 44, 44, 45, 45, 46, 46, 47, 47, 48, 49, - 50, 50, 50, 50, 50, 51, 51, 52, 53, 54 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 1, 1, 2, 1, 1, 1, 1, - 6, 0, 1, 1, 1, 1, 3, 1, 3, 3, - 3, 1, 1, 1, 1, 1, 6, 7, 7, 8, - 3, 3, 7, 8, 8, 9, 1, 1, 7, 8, - 0, 1, 1, 1, 1, 0, 1, 1, 5, 5 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 3, 4, 6, 7, 13, - 14, 17, 15, 9, 21, 22, 23, 24, 25, 8, - 36, 37, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 5, 0, 0, 0, - 0, 0, 0, 0, 20, 18, 30, 19, 31, 16, - 47, 0, 0, 0, 0, 0, 0, 0, 0, 11, - 0, 40, 0, 0, 0, 0, 0, 0, 12, 10, - 0, 41, 42, 43, 44, 45, 40, 26, 0, 0, - 0, 0, 0, 46, 38, 45, 28, 27, 32, 0, - 0, 0, 39, 29, 34, 33, 49, 48, 35 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 14, 15, 16, 17, 79, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 85, 94, 61, 71, 69 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -73 -static const yytype_int8 yypact[] = -{ - -3, -16, -13, -8, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 39, -3, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, 17, 18, 19, 20, 21, 22, 23, 24, - 34, 35, 36, 37, 49, -73, -73, 30, 29, 32, - 30, 30, 30, 30, -73, -73, -73, -73, -73, -73, - -73, 31, 33, 38, 40, 41, 44, 45, 53, 54, - 56, 0, 31, 33, 33, 43, 46, 42, -73, -73, - 47, -73, -73, -73, -73, 50, 0, 59, 60, 31, - 31, 68, 70, -73, -73, 50, -73, 71, 73, 74, - 51, 52, -73, -73, -73, 75, -73, -73, -73 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -73, -73, -73, 64, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -4, -12, -27, -46, -72 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const yytype_uint8 yytable[] = -{ - 86, 1, 2, 3, 4, 5, 6, 7, 32, 8, - 9, 33, 10, 11, 12, 13, 34, 98, 99, 81, - 82, 83, 84, 64, 65, 66, 67, 87, 88, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 62, 63, 77, 78, 68, 80, - 70, 93, 96, 97, 72, 73, 74, 75, 76, 89, - 91, 100, 90, 101, 103, 92, 104, 105, 108, 46, - 106, 107, 95, 102 -}; - -static const yytype_uint8 yycheck[] = -{ - 72, 4, 5, 6, 7, 8, 9, 10, 24, 12, - 13, 24, 15, 16, 17, 18, 24, 89, 90, 19, - 20, 21, 22, 50, 51, 52, 53, 73, 74, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 0, - 23, 23, 23, 23, 23, 23, 23, 23, 14, 14, - 14, 14, 3, 23, 25, 23, 3, 3, 27, 3, - 27, 11, 3, 3, 26, 25, 25, 23, 23, 26, - 28, 3, 26, 3, 3, 28, 3, 3, 3, 15, - 29, 29, 86, 95 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 4, 5, 6, 7, 8, 9, 10, 12, 13, - 15, 16, 17, 18, 31, 32, 33, 34, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 0, 33, 23, 23, 23, - 23, 23, 23, 23, 23, 14, 14, 14, 14, 3, - 23, 52, 25, 23, 52, 52, 52, 52, 27, 54, - 27, 53, 26, 25, 25, 23, 23, 3, 3, 35, - 3, 19, 20, 21, 22, 50, 54, 53, 53, 26, - 26, 28, 28, 11, 51, 50, 3, 3, 54, 54, - 3, 3, 51, 3, 3, 3, 29, 29, 3 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ #if YYDEBUG +#include +#endif -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +/* define the initial stack-sizes */ +#ifdef YYSTACKSIZE +#undef YYMAXDEPTH +#define YYMAXDEPTH YYSTACKSIZE #else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#ifdef YYMAXDEPTH +#define YYSTACKSIZE YYMAXDEPTH #else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif -{ - 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 (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, 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 - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -{ - - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#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; - - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - - 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: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef 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. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* 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 * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - 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 (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - 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 (yyn == 0 || yyn == YYTABLE_NINF) - 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); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - 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 3: - -/* Line 1455 of yacc.c */ -#line 83 "dgn_comp.y" - { - output_dgn(); - } - break; - - case 10: - -/* Line 1455 of yacc.c */ -#line 99 "dgn_comp.y" - { - init_dungeon(); - Strcpy(tmpdungeon[n_dgns].name, (yyvsp[(3) - (6)].str)); - tmpdungeon[n_dgns].boneschar = (char)(yyvsp[(4) - (6)].i); - tmpdungeon[n_dgns].lev.base = couple.base; - tmpdungeon[n_dgns].lev.rand = couple.rand; - tmpdungeon[n_dgns].chance = (yyvsp[(6) - (6)].i); - Free((yyvsp[(3) - (6)].str)); - } - break; - - case 11: - -/* Line 1455 of yacc.c */ -#line 111 "dgn_comp.y" - { - (yyval.i) = 0; - } - break; - - case 12: - -/* Line 1455 of yacc.c */ -#line 115 "dgn_comp.y" - { - (yyval.i) = (yyvsp[(1) - (1)].i); - } - break; - - case 16: - -/* Line 1455 of yacc.c */ -#line 126 "dgn_comp.y" - { - tmpdungeon[n_dgns].entry_lev = (yyvsp[(3) - (3)].i); - } - break; - - case 18: - -/* Line 1455 of yacc.c */ -#line 135 "dgn_comp.y" - { - if((yyvsp[(3) - (3)].i) <= TOWN || (yyvsp[(3) - (3)].i) >= D_ALIGN_CHAOTIC) - yyerror("Illegal description - ignoring!"); - else - tmpdungeon[n_dgns].flags |= (yyvsp[(3) - (3)].i) ; - } - break; - - case 19: - -/* Line 1455 of yacc.c */ -#line 142 "dgn_comp.y" - { - if((yyvsp[(3) - (3)].i) && (yyvsp[(3) - (3)].i) < D_ALIGN_CHAOTIC) - yyerror("Illegal alignment - ignoring!"); - else - tmpdungeon[n_dgns].flags |= (yyvsp[(3) - (3)].i) ; - } - break; - - case 20: - -/* Line 1455 of yacc.c */ -#line 151 "dgn_comp.y" - { - Strcpy(tmpdungeon[n_dgns].protoname, (yyvsp[(3) - (3)].str)); - Free((yyvsp[(3) - (3)].str)); - } - break; - - case 26: - -/* Line 1455 of yacc.c */ -#line 165 "dgn_comp.y" - { - init_level(); - Strcpy(tmplevel[n_levs].name, (yyvsp[(3) - (6)].str)); - tmplevel[n_levs].boneschar = (char)(yyvsp[(4) - (6)].i); - tmplevel[n_levs].lev.base = couple.base; - tmplevel[n_levs].lev.rand = couple.rand; - tmpdungeon[n_dgns].levels++; - Free((yyvsp[(3) - (6)].str)); - } - break; - - case 27: - -/* Line 1455 of yacc.c */ -#line 175 "dgn_comp.y" - { - init_level(); - Strcpy(tmplevel[n_levs].name, (yyvsp[(3) - (7)].str)); - tmplevel[n_levs].boneschar = (char)(yyvsp[(4) - (7)].i); - tmplevel[n_levs].lev.base = couple.base; - tmplevel[n_levs].lev.rand = couple.rand; - tmplevel[n_levs].rndlevs = (yyvsp[(7) - (7)].i); - tmpdungeon[n_dgns].levels++; - Free((yyvsp[(3) - (7)].str)); - } - break; - - case 28: - -/* Line 1455 of yacc.c */ -#line 188 "dgn_comp.y" - { - init_level(); - Strcpy(tmplevel[n_levs].name, (yyvsp[(3) - (7)].str)); - tmplevel[n_levs].boneschar = (char)(yyvsp[(4) - (7)].i); - tmplevel[n_levs].lev.base = couple.base; - tmplevel[n_levs].lev.rand = couple.rand; - tmplevel[n_levs].chance = (yyvsp[(7) - (7)].i); - tmpdungeon[n_dgns].levels++; - Free((yyvsp[(3) - (7)].str)); - } - break; - - case 29: - -/* Line 1455 of yacc.c */ -#line 199 "dgn_comp.y" - { - init_level(); - Strcpy(tmplevel[n_levs].name, (yyvsp[(3) - (8)].str)); - tmplevel[n_levs].boneschar = (char)(yyvsp[(4) - (8)].i); - tmplevel[n_levs].lev.base = couple.base; - tmplevel[n_levs].lev.rand = couple.rand; - tmplevel[n_levs].chance = (yyvsp[(7) - (8)].i); - tmplevel[n_levs].rndlevs = (yyvsp[(8) - (8)].i); - tmpdungeon[n_dgns].levels++; - Free((yyvsp[(3) - (8)].str)); - } - break; - - case 30: - -/* Line 1455 of yacc.c */ -#line 213 "dgn_comp.y" - { - if((yyvsp[(3) - (3)].i) >= D_ALIGN_CHAOTIC) - yyerror("Illegal description - ignoring!"); - else - tmplevel[n_levs].flags |= (yyvsp[(3) - (3)].i) ; - } - break; - - case 31: - -/* Line 1455 of yacc.c */ -#line 220 "dgn_comp.y" - { - if((yyvsp[(3) - (3)].i) && (yyvsp[(3) - (3)].i) < D_ALIGN_CHAOTIC) - yyerror("Illegal alignment - ignoring!"); - else - tmplevel[n_levs].flags |= (yyvsp[(3) - (3)].i) ; - } - break; - - case 32: - -/* Line 1455 of yacc.c */ -#line 229 "dgn_comp.y" - { - init_level(); - Strcpy(tmplevel[n_levs].name, (yyvsp[(3) - (7)].str)); - tmplevel[n_levs].boneschar = (char)(yyvsp[(4) - (7)].i); - tmplevel[n_levs].chain = getchain((yyvsp[(5) - (7)].str)); - tmplevel[n_levs].lev.base = couple.base; - tmplevel[n_levs].lev.rand = couple.rand; - if(!check_level()) n_levs--; - else tmpdungeon[n_dgns].levels++; - Free((yyvsp[(3) - (7)].str)); - Free((yyvsp[(5) - (7)].str)); - } - break; - - case 33: - -/* Line 1455 of yacc.c */ -#line 242 "dgn_comp.y" - { - init_level(); - Strcpy(tmplevel[n_levs].name, (yyvsp[(3) - (8)].str)); - tmplevel[n_levs].boneschar = (char)(yyvsp[(4) - (8)].i); - tmplevel[n_levs].chain = getchain((yyvsp[(5) - (8)].str)); - tmplevel[n_levs].lev.base = couple.base; - tmplevel[n_levs].lev.rand = couple.rand; - tmplevel[n_levs].rndlevs = (yyvsp[(8) - (8)].i); - if(!check_level()) n_levs--; - else tmpdungeon[n_dgns].levels++; - Free((yyvsp[(3) - (8)].str)); - Free((yyvsp[(5) - (8)].str)); - } - break; - - case 34: - -/* Line 1455 of yacc.c */ -#line 258 "dgn_comp.y" - { - init_level(); - Strcpy(tmplevel[n_levs].name, (yyvsp[(3) - (8)].str)); - tmplevel[n_levs].boneschar = (char)(yyvsp[(4) - (8)].i); - tmplevel[n_levs].chain = getchain((yyvsp[(5) - (8)].str)); - tmplevel[n_levs].lev.base = couple.base; - tmplevel[n_levs].lev.rand = couple.rand; - tmplevel[n_levs].chance = (yyvsp[(8) - (8)].i); - if(!check_level()) n_levs--; - else tmpdungeon[n_dgns].levels++; - Free((yyvsp[(3) - (8)].str)); - Free((yyvsp[(5) - (8)].str)); - } - break; - - case 35: - -/* Line 1455 of yacc.c */ -#line 272 "dgn_comp.y" - { - init_level(); - Strcpy(tmplevel[n_levs].name, (yyvsp[(3) - (9)].str)); - tmplevel[n_levs].boneschar = (char)(yyvsp[(4) - (9)].i); - tmplevel[n_levs].chain = getchain((yyvsp[(5) - (9)].str)); - tmplevel[n_levs].lev.base = couple.base; - tmplevel[n_levs].lev.rand = couple.rand; - tmplevel[n_levs].chance = (yyvsp[(8) - (9)].i); - tmplevel[n_levs].rndlevs = (yyvsp[(9) - (9)].i); - if(!check_level()) n_levs--; - else tmpdungeon[n_dgns].levels++; - Free((yyvsp[(3) - (9)].str)); - Free((yyvsp[(5) - (9)].str)); - } - break; - - case 38: - -/* Line 1455 of yacc.c */ -#line 293 "dgn_comp.y" - { - init_branch(); - Strcpy(tmpbranch[n_brs].name, (yyvsp[(3) - (7)].str)); - tmpbranch[n_brs].lev.base = couple.base; - tmpbranch[n_brs].lev.rand = couple.rand; - tmpbranch[n_brs].type = (yyvsp[(6) - (7)].i); - tmpbranch[n_brs].up = (yyvsp[(7) - (7)].i); - if(!check_branch()) n_brs--; - else tmpdungeon[n_dgns].branches++; - Free((yyvsp[(3) - (7)].str)); - } - break; - - case 39: - -/* Line 1455 of yacc.c */ -#line 307 "dgn_comp.y" - { - init_branch(); - Strcpy(tmpbranch[n_brs].name, (yyvsp[(3) - (8)].str)); - tmpbranch[n_brs].chain = getchain((yyvsp[(4) - (8)].str)); - tmpbranch[n_brs].lev.base = couple.base; - tmpbranch[n_brs].lev.rand = couple.rand; - tmpbranch[n_brs].type = (yyvsp[(7) - (8)].i); - tmpbranch[n_brs].up = (yyvsp[(8) - (8)].i); - if(!check_branch()) n_brs--; - else tmpdungeon[n_dgns].branches++; - Free((yyvsp[(3) - (8)].str)); - Free((yyvsp[(4) - (8)].str)); - } - break; - - case 40: - -/* Line 1455 of yacc.c */ -#line 323 "dgn_comp.y" - { - (yyval.i) = TBR_STAIR; /* two way stair */ - } - break; - - case 41: - -/* Line 1455 of yacc.c */ -#line 327 "dgn_comp.y" - { - (yyval.i) = TBR_STAIR; /* two way stair */ - } - break; - - case 42: - -/* Line 1455 of yacc.c */ -#line 331 "dgn_comp.y" - { - (yyval.i) = TBR_NO_UP; /* no up staircase */ - } - break; - - case 43: - -/* Line 1455 of yacc.c */ -#line 335 "dgn_comp.y" - { - (yyval.i) = TBR_NO_DOWN; /* no down staircase */ - } - break; - - case 44: - -/* Line 1455 of yacc.c */ -#line 339 "dgn_comp.y" - { - (yyval.i) = TBR_PORTAL; /* portal connection */ - } - break; - - case 45: - -/* Line 1455 of yacc.c */ -#line 345 "dgn_comp.y" - { - (yyval.i) = 0; /* defaults to down */ - } - break; - - case 46: - -/* Line 1455 of yacc.c */ -#line 349 "dgn_comp.y" - { - (yyval.i) = (yyvsp[(1) - (1)].i); - } - break; - - case 47: - -/* Line 1455 of yacc.c */ -#line 355 "dgn_comp.y" - { - char *p = (yyvsp[(1) - (1)].str); - if (strlen(p) != 1) { - if (strcmp(p, "none") != 0) - yyerror("Bones marker must be a single char, or \"none\"!"); - *p = '\0'; - } - (yyval.i) = *p; - Free(p); - } - break; - - case 48: - -/* Line 1455 of yacc.c */ -#line 385 "dgn_comp.y" - { - if ((yyvsp[(2) - (5)].i) < -MAXLEVEL || (yyvsp[(2) - (5)].i) > MAXLEVEL) { - yyerror("Abs base out of dlevel range - zeroing!"); - couple.base = couple.rand = 0; - } else if ((yyvsp[(4) - (5)].i) < -1 || - (((yyvsp[(2) - (5)].i) < 0) ? (MAXLEVEL + (yyvsp[(2) - (5)].i) + (yyvsp[(4) - (5)].i) + 1) > MAXLEVEL : - ((yyvsp[(2) - (5)].i) + (yyvsp[(4) - (5)].i)) > MAXLEVEL)) { - yyerror("Abs range out of dlevel range - zeroing!"); - couple.base = couple.rand = 0; - } else { - couple.base = (yyvsp[(2) - (5)].i); - couple.rand = (yyvsp[(4) - (5)].i); - } - } - break; - - case 49: - -/* Line 1455 of yacc.c */ -#line 422 "dgn_comp.y" - { - if ((yyvsp[(2) - (5)].i) < -MAXLEVEL || (yyvsp[(2) - (5)].i) > MAXLEVEL) { - yyerror("Rel base out of dlevel range - zeroing!"); - couple.base = couple.rand = 0; - } else { - couple.base = (yyvsp[(2) - (5)].i); - couple.rand = (yyvsp[(4) - (5)].i); - } - } - break; - - - -/* Line 1455 of yacc.c */ -#line 1911 "y.tab.c" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++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. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } - - - - 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 like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which 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. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - 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", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined(yyoverflow) || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - - -/* Line 1675 of yacc.c */ -#line 432 "dgn_comp.y" +#define YYINITSTACKSIZE 500 + +int yydebug; +int yynerrs; +int yyerrflag; +int yychar; +short *yyssp; +YYSTYPE *yyvsp; +YYSTYPE yyval; +YYSTYPE yylval; + +/* variables for the parser stack */ +static short *yyss; +static short *yysslim; +static YYSTYPE *yyvs; +static int yystacksize; +#line 433 "dgn_comp.y" void init_dungeon() @@ -2367,4 +603,553 @@ output_dgn() } /*dgn_comp.y*/ +#line 607 "y.tab.c" +/* allocate initial stack or double stack size, up to YYMAXDEPTH */ +static int yygrowstack(void) +{ + int newsize, i; + short *newss; + YYSTYPE *newvs; + if ((newsize = yystacksize) == 0) + newsize = YYINITSTACKSIZE; + else if (newsize >= YYMAXDEPTH) + return -1; + else if ((newsize *= 2) > YYMAXDEPTH) + newsize = YYMAXDEPTH; + + i = yyssp - yyss; + newss = (yyss != 0) + ? (short *)realloc(yyss, newsize * sizeof(*newss)) + : (short *)malloc(newsize * sizeof(*newss)); + if (newss == 0) + return -1; + + yyss = newss; + yyssp = newss + i; + newvs = (yyvs != 0) + ? (YYSTYPE *)realloc(yyvs, newsize * sizeof(*newvs)) + : (YYSTYPE *)malloc(newsize * sizeof(*newvs)); + if (newvs == 0) + return -1; + + yyvs = newvs; + yyvsp = newvs + i; + yystacksize = newsize; + yysslim = yyss + newsize - 1; + return 0; +} + +#define YYABORT goto yyabort +#define YYREJECT goto yyabort +#define YYACCEPT goto yyaccept +#define YYERROR goto yyerrlab +int +yyparse(void) +{ + register int yym, yyn, yystate; +#if YYDEBUG + register const char *yys; + + if ((yys = getenv("YYDEBUG")) != 0) + { + yyn = *yys; + if (yyn >= '0' && yyn <= '9') + yydebug = yyn - '0'; + } +#endif + + yynerrs = 0; + yyerrflag = 0; + yychar = YYEMPTY; + + if (yyss == NULL && yygrowstack()) goto yyoverflow; + yyssp = yyss; + yyvsp = yyvs; + *yyssp = yystate = 0; + +yyloop: + if ((yyn = yydefred[yystate]) != 0) goto yyreduce; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif + } + if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, shifting to state %d\n", + YYPREFIX, yystate, yytable[yyn]); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + yychar = YYEMPTY; + if (yyerrflag > 0) --yyerrflag; + goto yyloop; + } + if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { + yyn = yytable[yyn]; + goto yyreduce; + } + if (yyerrflag) goto yyinrecovery; + + yyerror("syntax error"); + +#ifdef lint + goto yyerrlab; +#endif + +yyerrlab: + ++yynerrs; + +yyinrecovery: + if (yyerrflag < 3) + { + yyerrflag = 3; + for (;;) + { + if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, error recovery shifting\ + to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + goto yyloop; + } + else + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: error recovery discarding state %d\n", + YYPREFIX, *yyssp); +#endif + if (yyssp <= yyss) goto yyabort; + --yyssp; + --yyvsp; + } + } + } + else + { + if (yychar == 0) goto yyabort; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, error recovery discards token %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif + yychar = YYEMPTY; + goto yyloop; + } + +yyreduce: +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, reducing by rule %d (%s)\n", + YYPREFIX, yystate, yyn, yyrule[yyn]); +#endif + yym = yylen[yyn]; + if (yym) + yyval = yyvsp[1-yym]; + else + memset(&yyval, 0, sizeof yyval); + switch (yyn) + { +case 2: +#line 83 "dgn_comp.y" +{ + output_dgn(); + } +break; +case 9: +#line 99 "dgn_comp.y" +{ + init_dungeon(); + Strcpy(tmpdungeon[n_dgns].name, yyvsp[-3].str); + tmpdungeon[n_dgns].boneschar = (char)yyvsp[-2].i; + tmpdungeon[n_dgns].lev.base = couple.base; + tmpdungeon[n_dgns].lev.rand = couple.rand; + tmpdungeon[n_dgns].chance = yyvsp[0].i; + Free(yyvsp[-3].str); + } +break; +case 10: +#line 111 "dgn_comp.y" +{ + yyval.i = 0; + } +break; +case 11: +#line 115 "dgn_comp.y" +{ + yyval.i = yyvsp[0].i; + } +break; +case 15: +#line 126 "dgn_comp.y" +{ + tmpdungeon[n_dgns].entry_lev = yyvsp[0].i; + } +break; +case 17: +#line 135 "dgn_comp.y" +{ + if(yyvsp[0].i <= TOWN || yyvsp[0].i >= D_ALIGN_CHAOTIC) + yyerror("Illegal description - ignoring!"); + else + tmpdungeon[n_dgns].flags |= yyvsp[0].i ; + } +break; +case 18: +#line 142 "dgn_comp.y" +{ + if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC) + yyerror("Illegal alignment - ignoring!"); + else + tmpdungeon[n_dgns].flags |= yyvsp[0].i ; + } +break; +case 19: +#line 151 "dgn_comp.y" +{ + Strcpy(tmpdungeon[n_dgns].protoname, yyvsp[0].str); + Free(yyvsp[0].str); + } +break; +case 25: +#line 165 "dgn_comp.y" +{ + init_level(); + Strcpy(tmplevel[n_levs].name, yyvsp[-3].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-2].i; + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmpdungeon[n_dgns].levels++; + Free(yyvsp[-3].str); + } +break; +case 26: +#line 175 "dgn_comp.y" +{ + init_level(); + Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-3].i; + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmplevel[n_levs].rndlevs = yyvsp[0].i; + tmpdungeon[n_dgns].levels++; + Free(yyvsp[-4].str); + } +break; +case 27: +#line 188 "dgn_comp.y" +{ + init_level(); + Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-3].i; + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmplevel[n_levs].chance = yyvsp[0].i; + tmpdungeon[n_dgns].levels++; + Free(yyvsp[-4].str); + } +break; +case 28: +#line 199 "dgn_comp.y" +{ + init_level(); + Strcpy(tmplevel[n_levs].name, yyvsp[-5].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-4].i; + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmplevel[n_levs].chance = yyvsp[-1].i; + tmplevel[n_levs].rndlevs = yyvsp[0].i; + tmpdungeon[n_dgns].levels++; + Free(yyvsp[-5].str); + } +break; +case 29: +#line 213 "dgn_comp.y" +{ + if(yyvsp[0].i >= D_ALIGN_CHAOTIC) + yyerror("Illegal description - ignoring!"); + else + tmplevel[n_levs].flags |= yyvsp[0].i ; + } +break; +case 30: +#line 220 "dgn_comp.y" +{ + if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC) + yyerror("Illegal alignment - ignoring!"); + else + tmplevel[n_levs].flags |= yyvsp[0].i ; + } +break; +case 31: +#line 229 "dgn_comp.y" +{ + init_level(); + Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-3].i; + tmplevel[n_levs].chain = getchain(yyvsp[-2].str); + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + if(!check_level()) n_levs--; + else tmpdungeon[n_dgns].levels++; + Free(yyvsp[-4].str); + Free(yyvsp[-2].str); + } +break; +case 32: +#line 242 "dgn_comp.y" +{ + init_level(); + Strcpy(tmplevel[n_levs].name, yyvsp[-5].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-4].i; + tmplevel[n_levs].chain = getchain(yyvsp[-3].str); + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmplevel[n_levs].rndlevs = yyvsp[0].i; + if(!check_level()) n_levs--; + else tmpdungeon[n_dgns].levels++; + Free(yyvsp[-5].str); + Free(yyvsp[-3].str); + } +break; +case 33: +#line 258 "dgn_comp.y" +{ + init_level(); + Strcpy(tmplevel[n_levs].name, yyvsp[-5].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-4].i; + tmplevel[n_levs].chain = getchain(yyvsp[-3].str); + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmplevel[n_levs].chance = yyvsp[0].i; + if(!check_level()) n_levs--; + else tmpdungeon[n_dgns].levels++; + Free(yyvsp[-5].str); + Free(yyvsp[-3].str); + } +break; +case 34: +#line 272 "dgn_comp.y" +{ + init_level(); + Strcpy(tmplevel[n_levs].name, yyvsp[-6].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-5].i; + tmplevel[n_levs].chain = getchain(yyvsp[-4].str); + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmplevel[n_levs].chance = yyvsp[-1].i; + tmplevel[n_levs].rndlevs = yyvsp[0].i; + if(!check_level()) n_levs--; + else tmpdungeon[n_dgns].levels++; + Free(yyvsp[-6].str); + Free(yyvsp[-4].str); + } +break; +case 37: +#line 293 "dgn_comp.y" +{ + init_branch(); + Strcpy(tmpbranch[n_brs].name, yyvsp[-4].str); + tmpbranch[n_brs].lev.base = couple.base; + tmpbranch[n_brs].lev.rand = couple.rand; + tmpbranch[n_brs].type = yyvsp[-1].i; + tmpbranch[n_brs].up = yyvsp[0].i; + if(!check_branch()) n_brs--; + else tmpdungeon[n_dgns].branches++; + Free(yyvsp[-4].str); + } +break; +case 38: +#line 307 "dgn_comp.y" +{ + init_branch(); + Strcpy(tmpbranch[n_brs].name, yyvsp[-5].str); + tmpbranch[n_brs].chain = getchain(yyvsp[-4].str); + tmpbranch[n_brs].lev.base = couple.base; + tmpbranch[n_brs].lev.rand = couple.rand; + tmpbranch[n_brs].type = yyvsp[-1].i; + tmpbranch[n_brs].up = yyvsp[0].i; + if(!check_branch()) n_brs--; + else tmpdungeon[n_dgns].branches++; + Free(yyvsp[-5].str); + Free(yyvsp[-4].str); + } +break; +case 39: +#line 323 "dgn_comp.y" +{ + yyval.i = TBR_STAIR; /* two way stair */ + } +break; +case 40: +#line 327 "dgn_comp.y" +{ + yyval.i = TBR_STAIR; /* two way stair */ + } +break; +case 41: +#line 331 "dgn_comp.y" +{ + yyval.i = TBR_NO_UP; /* no up staircase */ + } +break; +case 42: +#line 335 "dgn_comp.y" +{ + yyval.i = TBR_NO_DOWN; /* no down staircase */ + } +break; +case 43: +#line 339 "dgn_comp.y" +{ + yyval.i = TBR_PORTAL; /* portal connection */ + } +break; +case 44: +#line 345 "dgn_comp.y" +{ + yyval.i = 0; /* defaults to down */ + } +break; +case 45: +#line 349 "dgn_comp.y" +{ + yyval.i = yyvsp[0].i; + } +break; +case 46: +#line 355 "dgn_comp.y" +{ + char *p = yyvsp[0].str; + if (strlen(p) != 1) { + if (strcmp(p, "none") != 0) + yyerror("Bones marker must be a single char, or \"none\"!"); + *p = '\0'; + } + yyval.i = *p; + Free(p); + } +break; +case 47: +#line 385 "dgn_comp.y" +{ + if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) { + yyerror("Abs base out of dlevel range - zeroing!"); + couple.base = couple.rand = 0; + } else if (yyvsp[-1].i < -1 || + ((yyvsp[-3].i < 0) ? (MAXLEVEL + yyvsp[-3].i + yyvsp[-1].i + 1) > MAXLEVEL : + (yyvsp[-3].i + yyvsp[-1].i) > MAXLEVEL)) { + yyerror("Abs range out of dlevel range - zeroing!"); + couple.base = couple.rand = 0; + } else { + couple.base = yyvsp[-3].i; + couple.rand = yyvsp[-1].i; + } + } +break; +case 48: +#line 422 "dgn_comp.y" +{ + if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) { + yyerror("Rel base out of dlevel range - zeroing!"); + couple.base = couple.rand = 0; + } else { + couple.base = yyvsp[-3].i; + couple.rand = yyvsp[-1].i; + } + } +break; +#line 1097 "y.tab.c" + } + yyssp -= yym; + yystate = *yyssp; + yyvsp -= yym; + yym = yylhs[yyn]; + if (yystate == 0 && yym == 0) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state 0 to\ + state %d\n", YYPREFIX, YYFINAL); +#endif + yystate = YYFINAL; + *++yyssp = YYFINAL; + *++yyvsp = yyval; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, YYFINAL, yychar, yys); + } +#endif + } + if (yychar == 0) goto yyaccept; + goto yyloop; + } + if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yystate) + yystate = yytable[yyn]; + else + yystate = yydgoto[yym]; +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state %d \ +to state %d\n", YYPREFIX, *yyssp, yystate); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate; + *++yyvsp = yyval; + goto yyloop; + +yyoverflow: + yyerror("yacc stack overflow"); + +yyabort: + return (1); + +yyaccept: + return (0); +} diff --git a/sys/share/lev_comp.h b/sys/share/lev_comp.h index 797ad5a2d..44818699a 100644 --- a/sys/share/lev_comp.h +++ b/sys/share/lev_comp.h @@ -1,406 +1,179 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 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 . */ - -/* 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. */ - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - CHAR = 258, - INTEGER = 259, - BOOLEAN = 260, - PERCENT = 261, - SPERCENT = 262, - MINUS_INTEGER = 263, - PLUS_INTEGER = 264, - MAZE_GRID_ID = 265, - SOLID_FILL_ID = 266, - MINES_ID = 267, - ROGUELEV_ID = 268, - MESSAGE_ID = 269, - MAZE_ID = 270, - LEVEL_ID = 271, - LEV_INIT_ID = 272, - GEOMETRY_ID = 273, - NOMAP_ID = 274, - OBJECT_ID = 275, - COBJECT_ID = 276, - MONSTER_ID = 277, - TRAP_ID = 278, - DOOR_ID = 279, - DRAWBRIDGE_ID = 280, - object_ID = 281, - monster_ID = 282, - terrain_ID = 283, - MAZEWALK_ID = 284, - WALLIFY_ID = 285, - REGION_ID = 286, - FILLING = 287, - IRREGULAR = 288, - JOINED = 289, - ALTAR_ID = 290, - LADDER_ID = 291, - STAIR_ID = 292, - NON_DIGGABLE_ID = 293, - NON_PASSWALL_ID = 294, - ROOM_ID = 295, - PORTAL_ID = 296, - TELEPRT_ID = 297, - BRANCH_ID = 298, - LEV = 299, - MINERALIZE_ID = 300, - CORRIDOR_ID = 301, - GOLD_ID = 302, - ENGRAVING_ID = 303, - FOUNTAIN_ID = 304, - POOL_ID = 305, - SINK_ID = 306, - NONE = 307, - RAND_CORRIDOR_ID = 308, - DOOR_STATE = 309, - LIGHT_STATE = 310, - CURSE_TYPE = 311, - ENGRAVING_TYPE = 312, - DIRECTION = 313, - RANDOM_TYPE = 314, - RANDOM_TYPE_BRACKET = 315, - A_REGISTER = 316, - ALIGNMENT = 317, - LEFT_OR_RIGHT = 318, - CENTER = 319, - TOP_OR_BOT = 320, - ALTAR_TYPE = 321, - UP_OR_DOWN = 322, - SUBROOM_ID = 323, - NAME_ID = 324, - FLAGS_ID = 325, - FLAG_TYPE = 326, - MON_ATTITUDE = 327, - MON_ALERTNESS = 328, - MON_APPEARANCE = 329, - ROOMDOOR_ID = 330, - IF_ID = 331, - ELSE_ID = 332, - TERRAIN_ID = 333, - HORIZ_OR_VERT = 334, - REPLACE_TERRAIN_ID = 335, - EXIT_ID = 336, - SHUFFLE_ID = 337, - QUANTITY_ID = 338, - BURIED_ID = 339, - LOOP_ID = 340, - FOR_ID = 341, - TO_ID = 342, - SWITCH_ID = 343, - CASE_ID = 344, - BREAK_ID = 345, - DEFAULT_ID = 346, - ERODED_ID = 347, - TRAPPED_STATE = 348, - RECHARGED_ID = 349, - INVIS_ID = 350, - GREASED_ID = 351, - FEMALE_ID = 352, - CANCELLED_ID = 353, - REVIVED_ID = 354, - AVENGE_ID = 355, - FLEEING_ID = 356, - BLINDED_ID = 357, - PARALYZED_ID = 358, - STUNNED_ID = 359, - CONFUSED_ID = 360, - SEENTRAPS_ID = 361, - ALL_ID = 362, - MONTYPE_ID = 363, - GRAVE_ID = 364, - ERODEPROOF_ID = 365, - FUNCTION_ID = 366, - MSG_OUTPUT_TYPE = 367, - COMPARE_TYPE = 368, - UNKNOWN_TYPE = 369, - rect_ID = 370, - fillrect_ID = 371, - line_ID = 372, - randline_ID = 373, - grow_ID = 374, - selection_ID = 375, - flood_ID = 376, - rndcoord_ID = 377, - circle_ID = 378, - ellipse_ID = 379, - filter_ID = 380, - complement_ID = 381, - gradient_ID = 382, - GRADIENT_TYPE = 383, - LIMITED = 384, - HUMIDITY_TYPE = 385, - STRING = 386, - MAP_ID = 387, - NQSTRING = 388, - VARSTRING = 389, - CFUNC = 390, - CFUNC_INT = 391, - CFUNC_STR = 392, - CFUNC_COORD = 393, - CFUNC_REGION = 394, - VARSTRING_INT = 395, - VARSTRING_INT_ARRAY = 396, - VARSTRING_STRING = 397, - VARSTRING_STRING_ARRAY = 398, - VARSTRING_VAR = 399, - VARSTRING_VAR_ARRAY = 400, - VARSTRING_COORD = 401, - VARSTRING_COORD_ARRAY = 402, - VARSTRING_REGION = 403, - VARSTRING_REGION_ARRAY = 404, - VARSTRING_MAPCHAR = 405, - VARSTRING_MAPCHAR_ARRAY = 406, - VARSTRING_MONST = 407, - VARSTRING_MONST_ARRAY = 408, - VARSTRING_OBJ = 409, - VARSTRING_OBJ_ARRAY = 410, - VARSTRING_SEL = 411, - VARSTRING_SEL_ARRAY = 412, - METHOD_INT = 413, - METHOD_INT_ARRAY = 414, - METHOD_STRING = 415, - METHOD_STRING_ARRAY = 416, - METHOD_VAR = 417, - METHOD_VAR_ARRAY = 418, - METHOD_COORD = 419, - METHOD_COORD_ARRAY = 420, - METHOD_REGION = 421, - METHOD_REGION_ARRAY = 422, - METHOD_MAPCHAR = 423, - METHOD_MAPCHAR_ARRAY = 424, - METHOD_MONST = 425, - METHOD_MONST_ARRAY = 426, - METHOD_OBJ = 427, - METHOD_OBJ_ARRAY = 428, - METHOD_SEL = 429, - METHOD_SEL_ARRAY = 430, - DICE = 431 - }; -#endif -/* Tokens. */ -#define CHAR 258 -#define INTEGER 259 -#define BOOLEAN 260 -#define PERCENT 261 -#define SPERCENT 262 -#define MINUS_INTEGER 263 -#define PLUS_INTEGER 264 -#define MAZE_GRID_ID 265 -#define SOLID_FILL_ID 266 -#define MINES_ID 267 -#define ROGUELEV_ID 268 -#define MESSAGE_ID 269 -#define MAZE_ID 270 -#define LEVEL_ID 271 -#define LEV_INIT_ID 272 -#define GEOMETRY_ID 273 -#define NOMAP_ID 274 -#define OBJECT_ID 275 -#define COBJECT_ID 276 -#define MONSTER_ID 277 -#define TRAP_ID 278 -#define DOOR_ID 279 -#define DRAWBRIDGE_ID 280 -#define object_ID 281 -#define monster_ID 282 -#define terrain_ID 283 -#define MAZEWALK_ID 284 -#define WALLIFY_ID 285 -#define REGION_ID 286 -#define FILLING 287 -#define IRREGULAR 288 -#define JOINED 289 -#define ALTAR_ID 290 -#define LADDER_ID 291 -#define STAIR_ID 292 -#define NON_DIGGABLE_ID 293 -#define NON_PASSWALL_ID 294 -#define ROOM_ID 295 -#define PORTAL_ID 296 -#define TELEPRT_ID 297 -#define BRANCH_ID 298 -#define LEV 299 -#define MINERALIZE_ID 300 -#define CORRIDOR_ID 301 -#define GOLD_ID 302 -#define ENGRAVING_ID 303 -#define FOUNTAIN_ID 304 -#define POOL_ID 305 -#define SINK_ID 306 -#define NONE 307 -#define RAND_CORRIDOR_ID 308 -#define DOOR_STATE 309 -#define LIGHT_STATE 310 -#define CURSE_TYPE 311 -#define ENGRAVING_TYPE 312 -#define DIRECTION 313 -#define RANDOM_TYPE 314 -#define RANDOM_TYPE_BRACKET 315 -#define A_REGISTER 316 -#define ALIGNMENT 317 -#define LEFT_OR_RIGHT 318 -#define CENTER 319 -#define TOP_OR_BOT 320 -#define ALTAR_TYPE 321 -#define UP_OR_DOWN 322 -#define SUBROOM_ID 323 -#define NAME_ID 324 -#define FLAGS_ID 325 -#define FLAG_TYPE 326 -#define MON_ATTITUDE 327 -#define MON_ALERTNESS 328 -#define MON_APPEARANCE 329 -#define ROOMDOOR_ID 330 -#define IF_ID 331 -#define ELSE_ID 332 -#define TERRAIN_ID 333 -#define HORIZ_OR_VERT 334 -#define REPLACE_TERRAIN_ID 335 -#define EXIT_ID 336 -#define SHUFFLE_ID 337 -#define QUANTITY_ID 338 -#define BURIED_ID 339 -#define LOOP_ID 340 -#define FOR_ID 341 -#define TO_ID 342 -#define SWITCH_ID 343 -#define CASE_ID 344 -#define BREAK_ID 345 -#define DEFAULT_ID 346 -#define ERODED_ID 347 -#define TRAPPED_STATE 348 -#define RECHARGED_ID 349 -#define INVIS_ID 350 -#define GREASED_ID 351 -#define FEMALE_ID 352 -#define CANCELLED_ID 353 -#define REVIVED_ID 354 -#define AVENGE_ID 355 -#define FLEEING_ID 356 -#define BLINDED_ID 357 -#define PARALYZED_ID 358 -#define STUNNED_ID 359 -#define CONFUSED_ID 360 -#define SEENTRAPS_ID 361 -#define ALL_ID 362 -#define MONTYPE_ID 363 -#define GRAVE_ID 364 -#define ERODEPROOF_ID 365 -#define FUNCTION_ID 366 -#define MSG_OUTPUT_TYPE 367 -#define COMPARE_TYPE 368 -#define UNKNOWN_TYPE 369 -#define rect_ID 370 -#define fillrect_ID 371 -#define line_ID 372 -#define randline_ID 373 -#define grow_ID 374 -#define selection_ID 375 -#define flood_ID 376 -#define rndcoord_ID 377 -#define circle_ID 378 -#define ellipse_ID 379 -#define filter_ID 380 -#define complement_ID 381 -#define gradient_ID 382 -#define GRADIENT_TYPE 383 -#define LIMITED 384 -#define HUMIDITY_TYPE 385 -#define STRING 386 -#define MAP_ID 387 -#define NQSTRING 388 -#define VARSTRING 389 -#define CFUNC 390 -#define CFUNC_INT 391 -#define CFUNC_STR 392 -#define CFUNC_COORD 393 -#define CFUNC_REGION 394 -#define VARSTRING_INT 395 -#define VARSTRING_INT_ARRAY 396 -#define VARSTRING_STRING 397 -#define VARSTRING_STRING_ARRAY 398 -#define VARSTRING_VAR 399 -#define VARSTRING_VAR_ARRAY 400 -#define VARSTRING_COORD 401 -#define VARSTRING_COORD_ARRAY 402 -#define VARSTRING_REGION 403 -#define VARSTRING_REGION_ARRAY 404 -#define VARSTRING_MAPCHAR 405 -#define VARSTRING_MAPCHAR_ARRAY 406 -#define VARSTRING_MONST 407 -#define VARSTRING_MONST_ARRAY 408 -#define VARSTRING_OBJ 409 -#define VARSTRING_OBJ_ARRAY 410 -#define VARSTRING_SEL 411 -#define VARSTRING_SEL_ARRAY 412 -#define METHOD_INT 413 -#define METHOD_INT_ARRAY 414 -#define METHOD_STRING 415 -#define METHOD_STRING_ARRAY 416 -#define METHOD_VAR 417 -#define METHOD_VAR_ARRAY 418 -#define METHOD_COORD 419 -#define METHOD_COORD_ARRAY 420 -#define METHOD_REGION 421 -#define METHOD_REGION_ARRAY 422 -#define METHOD_MAPCHAR 423 -#define METHOD_MAPCHAR_ARRAY 424 -#define METHOD_MONST 425 -#define METHOD_MONST_ARRAY 426 -#define METHOD_OBJ 427 -#define METHOD_OBJ_ARRAY 428 -#define METHOD_SEL 429 -#define METHOD_SEL_ARRAY 430 -#define DICE 431 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +#define CHAR 257 +#define INTEGER 258 +#define BOOLEAN 259 +#define PERCENT 260 +#define SPERCENT 261 +#define MINUS_INTEGER 262 +#define PLUS_INTEGER 263 +#define MAZE_GRID_ID 264 +#define SOLID_FILL_ID 265 +#define MINES_ID 266 +#define ROGUELEV_ID 267 +#define MESSAGE_ID 268 +#define MAZE_ID 269 +#define LEVEL_ID 270 +#define LEV_INIT_ID 271 +#define GEOMETRY_ID 272 +#define NOMAP_ID 273 +#define OBJECT_ID 274 +#define COBJECT_ID 275 +#define MONSTER_ID 276 +#define TRAP_ID 277 +#define DOOR_ID 278 +#define DRAWBRIDGE_ID 279 +#define object_ID 280 +#define monster_ID 281 +#define terrain_ID 282 +#define MAZEWALK_ID 283 +#define WALLIFY_ID 284 +#define REGION_ID 285 +#define FILLING 286 +#define IRREGULAR 287 +#define JOINED 288 +#define ALTAR_ID 289 +#define LADDER_ID 290 +#define STAIR_ID 291 +#define NON_DIGGABLE_ID 292 +#define NON_PASSWALL_ID 293 +#define ROOM_ID 294 +#define PORTAL_ID 295 +#define TELEPRT_ID 296 +#define BRANCH_ID 297 +#define LEV 298 +#define MINERALIZE_ID 299 +#define CORRIDOR_ID 300 +#define GOLD_ID 301 +#define ENGRAVING_ID 302 +#define FOUNTAIN_ID 303 +#define POOL_ID 304 +#define SINK_ID 305 +#define NONE 306 +#define RAND_CORRIDOR_ID 307 +#define DOOR_STATE 308 +#define LIGHT_STATE 309 +#define CURSE_TYPE 310 +#define ENGRAVING_TYPE 311 +#define DIRECTION 312 +#define RANDOM_TYPE 313 +#define RANDOM_TYPE_BRACKET 314 +#define A_REGISTER 315 +#define ALIGNMENT 316 +#define LEFT_OR_RIGHT 317 +#define CENTER 318 +#define TOP_OR_BOT 319 +#define ALTAR_TYPE 320 +#define UP_OR_DOWN 321 +#define SUBROOM_ID 322 +#define NAME_ID 323 +#define FLAGS_ID 324 +#define FLAG_TYPE 325 +#define MON_ATTITUDE 326 +#define MON_ALERTNESS 327 +#define MON_APPEARANCE 328 +#define ROOMDOOR_ID 329 +#define IF_ID 330 +#define ELSE_ID 331 +#define TERRAIN_ID 332 +#define HORIZ_OR_VERT 333 +#define REPLACE_TERRAIN_ID 334 +#define EXIT_ID 335 +#define SHUFFLE_ID 336 +#define QUANTITY_ID 337 +#define BURIED_ID 338 +#define LOOP_ID 339 +#define FOR_ID 340 +#define TO_ID 341 +#define SWITCH_ID 342 +#define CASE_ID 343 +#define BREAK_ID 344 +#define DEFAULT_ID 345 +#define ERODED_ID 346 +#define TRAPPED_STATE 347 +#define RECHARGED_ID 348 +#define INVIS_ID 349 +#define GREASED_ID 350 +#define FEMALE_ID 351 +#define CANCELLED_ID 352 +#define REVIVED_ID 353 +#define AVENGE_ID 354 +#define FLEEING_ID 355 +#define BLINDED_ID 356 +#define PARALYZED_ID 357 +#define STUNNED_ID 358 +#define CONFUSED_ID 359 +#define SEENTRAPS_ID 360 +#define ALL_ID 361 +#define MONTYPE_ID 362 +#define GRAVE_ID 363 +#define ERODEPROOF_ID 364 +#define FUNCTION_ID 365 +#define MSG_OUTPUT_TYPE 366 +#define COMPARE_TYPE 367 +#define UNKNOWN_TYPE 368 +#define rect_ID 369 +#define fillrect_ID 370 +#define line_ID 371 +#define randline_ID 372 +#define grow_ID 373 +#define selection_ID 374 +#define flood_ID 375 +#define rndcoord_ID 376 +#define circle_ID 377 +#define ellipse_ID 378 +#define filter_ID 379 +#define complement_ID 380 +#define gradient_ID 381 +#define GRADIENT_TYPE 382 +#define LIMITED 383 +#define HUMIDITY_TYPE 384 +#define STRING 385 +#define MAP_ID 386 +#define NQSTRING 387 +#define VARSTRING 388 +#define CFUNC 389 +#define CFUNC_INT 390 +#define CFUNC_STR 391 +#define CFUNC_COORD 392 +#define CFUNC_REGION 393 +#define VARSTRING_INT 394 +#define VARSTRING_INT_ARRAY 395 +#define VARSTRING_STRING 396 +#define VARSTRING_STRING_ARRAY 397 +#define VARSTRING_VAR 398 +#define VARSTRING_VAR_ARRAY 399 +#define VARSTRING_COORD 400 +#define VARSTRING_COORD_ARRAY 401 +#define VARSTRING_REGION 402 +#define VARSTRING_REGION_ARRAY 403 +#define VARSTRING_MAPCHAR 404 +#define VARSTRING_MAPCHAR_ARRAY 405 +#define VARSTRING_MONST 406 +#define VARSTRING_MONST_ARRAY 407 +#define VARSTRING_OBJ 408 +#define VARSTRING_OBJ_ARRAY 409 +#define VARSTRING_SEL 410 +#define VARSTRING_SEL_ARRAY 411 +#define METHOD_INT 412 +#define METHOD_INT_ARRAY 413 +#define METHOD_STRING 414 +#define METHOD_STRING_ARRAY 415 +#define METHOD_VAR 416 +#define METHOD_VAR_ARRAY 417 +#define METHOD_COORD 418 +#define METHOD_COORD_ARRAY 419 +#define METHOD_REGION 420 +#define METHOD_REGION_ARRAY 421 +#define METHOD_MAPCHAR 422 +#define METHOD_MAPCHAR_ARRAY 423 +#define METHOD_MONST 424 +#define METHOD_MONST_ARRAY 425 +#define METHOD_OBJ 426 +#define METHOD_OBJ_ARRAY 427 +#define METHOD_SEL 428 +#define METHOD_SEL_ARRAY 429 +#define DICE 430 +typedef union { - -/* Line 1676 of yacc.c */ -#line 147 "lev_comp.y" - long i; char* map; struct { @@ -435,17 +208,5 @@ typedef union YYSTYPE long cfunc; char *varstr; } meth; - - - -/* Line 1676 of yacc.c */ -#line 443 "y.tab.h" } YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - extern YYSTYPE yylval; - - diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c index 6848c3662..0be95064a 100644 --- a/sys/share/lev_lex.c +++ b/sys/share/lev_lex.c @@ -1,5 +1,5 @@ -#line 3 "lex.yy.c" +#line 3 "lev_lex.c" #define YY_INT_ALIGNED short int @@ -8,7 +8,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 39 +#define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -141,15 +141,7 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -175,7 +167,6 @@ extern FILE *yyin, *yyout; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -1201,7 +1192,7 @@ FILE *orig_yyin = NULL; #define ST_RETF(y, x) do { savetoken(yytext); y; return x; } while (0); -#line 1205 "lex.yy.c" +#line 1196 "lev_lex.c" #define INITIAL 0 #define MAPC 1 @@ -1283,12 +1274,7 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1392,6 +1378,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; +#line 107 "lev_comp.l" + +#line 1384 "lev_lex.c" + if ( !(yy_init) ) { (yy_init) = 1; @@ -1418,11 +1408,6 @@ YY_DECL yy_load_buffer_state( ); } - { -#line 107 "lev_comp.l" - -#line 1425 "lex.yy.c" - while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -1440,7 +1425,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2522,7 +2507,7 @@ YY_RULE_SETUP #line 345 "lev_comp.l" ECHO; YY_BREAK -#line 2526 "lex.yy.c" +#line 2511 "lev_lex.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(MAPC): yyterminate(); @@ -2654,7 +2639,6 @@ case YY_STATE_EOF(MAPC): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -3291,7 +3275,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len YY_BUFFER_STATE b; char *buf; yy_size_t n; - yy_size_t i; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -3521,7 +3505,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 344 "lev_comp.l" +#line 345 "lev_comp.l" #ifdef AMIGA From eed4549f53ee39e8157c4e2108a82cc2b21be27c Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 4 Dec 2015 07:46:21 -0500 Subject: [PATCH 05/18] 'pull' prebuilts from master into release branch --- sys/share/dgn_lex.c | 131 ++++++------------- sys/share/dgn_yacc.c | 174 ++++++------------------- sys/share/lev_lex.c | 295 ++++++------------------------------------- 3 files changed, 118 insertions(+), 482 deletions(-) diff --git a/sys/share/dgn_lex.c b/sys/share/dgn_lex.c index 5129b03ff..5c06fe634 100644 --- a/sys/share/dgn_lex.c +++ b/sys/share/dgn_lex.c @@ -33,7 +33,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -50,7 +50,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -167,7 +167,7 @@ extern FILE *yyin, *yyout; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -224,7 +224,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -568,9 +568,7 @@ int yy_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "dgn_comp.l" -#line 2 "dgn_comp.l" -/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1448710672 2015/11/28 11:37:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ */ +/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1449233101 2015/12/04 12:45:01 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.15 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1990 by M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -638,7 +636,6 @@ int FDECL(yyoutput, (int)); genericptr_t FDECL(realloc, (genericptr_t,size_t)); #endif - void FDECL(init_yyin, (FILE *)); void FDECL(init_yyout, (FILE *)); @@ -650,8 +647,6 @@ extern YYSTYPE yylval; int nh_line_number = 1; -#line 654 "dgn_lex.c" - #define INITIAL 0 #ifndef YY_NO_UNISTD_H @@ -710,7 +705,7 @@ extern int yywrap (void ); #endif static void yyunput (int c,char *buf_ptr ); - + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -834,10 +829,6 @@ YY_DECL register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - -#line 83 "dgn_comp.l" - -#line 841 "dgn_lex.c" if ( !(yy_init) ) { @@ -923,153 +914,123 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 84 "dgn_comp.l" return(A_DUNGEON); YY_BREAK case 2: YY_RULE_SETUP -#line 85 "dgn_comp.l" { yylval.i=1; return(UP_OR_DOWN); } YY_BREAK case 3: YY_RULE_SETUP -#line 86 "dgn_comp.l" { yylval.i=0; return(UP_OR_DOWN); } YY_BREAK case 4: YY_RULE_SETUP -#line 87 "dgn_comp.l" return(ENTRY); YY_BREAK case 5: YY_RULE_SETUP -#line 88 "dgn_comp.l" return(STAIR); YY_BREAK case 6: YY_RULE_SETUP -#line 89 "dgn_comp.l" return(NO_UP); YY_BREAK case 7: YY_RULE_SETUP -#line 90 "dgn_comp.l" return(NO_DOWN); YY_BREAK case 8: YY_RULE_SETUP -#line 91 "dgn_comp.l" return(PORTAL); YY_BREAK case 9: YY_RULE_SETUP -#line 92 "dgn_comp.l" return(PROTOFILE); YY_BREAK case 10: YY_RULE_SETUP -#line 93 "dgn_comp.l" return(DESCRIPTION); YY_BREAK case 11: YY_RULE_SETUP -#line 94 "dgn_comp.l" return(LEVELDESC); YY_BREAK case 12: YY_RULE_SETUP -#line 95 "dgn_comp.l" return(ALIGNMENT); YY_BREAK case 13: YY_RULE_SETUP -#line 96 "dgn_comp.l" return(LEVALIGN); YY_BREAK case 14: YY_RULE_SETUP -#line 97 "dgn_comp.l" { yylval.i=TOWN ; return(DESCRIPTOR); } YY_BREAK case 15: YY_RULE_SETUP -#line 98 "dgn_comp.l" { yylval.i=HELLISH ; return(DESCRIPTOR); } YY_BREAK case 16: YY_RULE_SETUP -#line 99 "dgn_comp.l" { yylval.i=MAZELIKE ; return(DESCRIPTOR); } YY_BREAK case 17: YY_RULE_SETUP -#line 100 "dgn_comp.l" { yylval.i=ROGUELIKE ; return(DESCRIPTOR); } YY_BREAK case 18: YY_RULE_SETUP -#line 101 "dgn_comp.l" { yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); } YY_BREAK case 19: YY_RULE_SETUP -#line 102 "dgn_comp.l" { yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); } YY_BREAK case 20: YY_RULE_SETUP -#line 103 "dgn_comp.l" { yylval.i=D_ALIGN_LAWFUL ; return(DESCRIPTOR); } YY_BREAK case 21: YY_RULE_SETUP -#line 104 "dgn_comp.l" { yylval.i=D_ALIGN_NEUTRAL ; return(DESCRIPTOR); } YY_BREAK case 22: YY_RULE_SETUP -#line 105 "dgn_comp.l" { yylval.i=D_ALIGN_CHAOTIC ; return(DESCRIPTOR); } YY_BREAK case 23: YY_RULE_SETUP -#line 106 "dgn_comp.l" return(BRANCH); YY_BREAK case 24: YY_RULE_SETUP -#line 107 "dgn_comp.l" return(CHBRANCH); YY_BREAK case 25: YY_RULE_SETUP -#line 108 "dgn_comp.l" return(LEVEL); YY_BREAK case 26: YY_RULE_SETUP -#line 109 "dgn_comp.l" return(RNDLEVEL); YY_BREAK case 27: YY_RULE_SETUP -#line 110 "dgn_comp.l" return(CHLEVEL); YY_BREAK case 28: YY_RULE_SETUP -#line 111 "dgn_comp.l" return(RNDCHLEVEL); YY_BREAK case 29: YY_RULE_SETUP -#line 112 "dgn_comp.l" { yylval.i=atoi(yytext); return(INTEGER); } YY_BREAK case 30: /* rule 30 can match eol */ YY_RULE_SETUP -#line 113 "dgn_comp.l" { yytext[yyleng - 1] = '\0'; /* discard the trailing \" */ yylval.str = dupstr(yytext + 1); /* skip the first \" */ return STRING; } @@ -1077,31 +1038,25 @@ YY_RULE_SETUP case 31: /* rule 31 can match eol */ YY_RULE_SETUP -#line 116 "dgn_comp.l" { nh_line_number++; } YY_BREAK case 32: /* rule 32 can match eol */ YY_RULE_SETUP -#line 117 "dgn_comp.l" { nh_line_number++; } YY_BREAK case 33: YY_RULE_SETUP -#line 118 "dgn_comp.l" ; /* skip trailing tabs & spaces */ YY_BREAK case 34: YY_RULE_SETUP -#line 119 "dgn_comp.l" { return yytext[0]; } YY_BREAK case 35: YY_RULE_SETUP -#line 120 "dgn_comp.l" ECHO; YY_BREAK -#line 1105 "dgn_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1379,7 +1334,7 @@ static int yy_get_next_buffer (void) { register yy_state_type yy_current_state; register char *yy_cp; - + yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); @@ -1434,7 +1389,7 @@ static int yy_get_next_buffer (void) static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; - + yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ @@ -1477,7 +1432,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -1546,12 +1501,12 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -1564,11 +1519,11 @@ static int yy_get_next_buffer (void) /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); @@ -1608,13 +1563,13 @@ static void yy_load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -1637,11 +1592,11 @@ static void yy_load_buffer_state (void) /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() - * + * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -1662,7 +1617,7 @@ static void yy_load_buffer_state (void) { int oerrno = errno; - + yy_flush_buffer(b ); b->yy_input_file = file; @@ -1678,13 +1633,13 @@ static void yy_load_buffer_state (void) } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { @@ -1713,7 +1668,7 @@ static void yy_load_buffer_state (void) * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { @@ -1743,7 +1698,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void yypop_buffer_state (void) { @@ -1767,7 +1722,7 @@ void yypop_buffer_state (void) static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this @@ -1780,7 +1735,7 @@ static void yyensure_buffer_stack (void) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -1810,13 +1765,13 @@ static void yyensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. + * + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -1845,14 +1800,14 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { - + return yy_scan_bytes(yystr,strlen(yystr) ); } @@ -1860,7 +1815,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) @@ -1869,7 +1824,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); @@ -1923,16 +1878,16 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ int yyget_lineno (void) { - + return yylineno; } /** Get the input stream. - * + * */ FILE *yyget_in (void) { @@ -1940,7 +1895,7 @@ FILE *yyget_in (void) } /** Get the output stream. - * + * */ FILE *yyget_out (void) { @@ -1948,7 +1903,7 @@ FILE *yyget_out (void) } /** Get the length of the current token. - * + * */ yy_size_t yyget_leng (void) { @@ -1956,7 +1911,7 @@ yy_size_t yyget_leng (void) } /** Get the current token. - * + * */ char *yyget_text (void) @@ -1966,18 +1921,18 @@ char *yyget_text (void) /** Set the current line number. * @param line_number - * + * */ void yyset_lineno (int line_number ) { - + yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) @@ -2031,7 +1986,7 @@ static int yy_init_globals (void) /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); @@ -2098,10 +2053,6 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 120 "dgn_comp.l" - - - /* routine to switch to another input file; needed for flex */ void init_yyin( input_f ) diff --git a/sys/share/dgn_yacc.c b/sys/share/dgn_yacc.c index eb7a4e972..9339fd578 100644 --- a/sys/share/dgn_yacc.c +++ b/sys/share/dgn_yacc.c @@ -1,26 +1,17 @@ #ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +/* static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; */ +/* static char nhsccsid[] = "@(#)yaccpar 1.9.0-nh (NetHack) 12/03/2015"; */ #endif - -#include -#include - #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 -#define YYPATCH 20070509 +#define YYSUBMINOR "0-nh" -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING (yyerrflag != 0) - -extern int yyparse(void); - -static int yygrowstack(void); +#define yyclearin (yychar=(-1)) +#define yyerrok (yyerrflag=0) +#define YYRECOVERING (yyerrflag!=0) #define YYPREFIX "yy" -#line 2 "dgn_comp.y" -/* NetHack 3.6 dgn_comp.y $NHDT-Date: 1432512785 2015/05/25 00:13:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */ +/* NetHack 3.6 dgn_comp.y $NHDT-Date: 1449233106 2015/12/04 12:45:06 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.11 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1990 by M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -82,13 +73,11 @@ extern int fatal_error; extern const char *fname; extern FILE *yyin, *yyout; /* from dgn_lex.c */ -#line 66 "dgn_comp.y" typedef union { int i; char* str; } YYSTYPE; -#line 92 "y.tab.c" #define INTEGER 257 #define A_DUNGEON 258 #define BRANCH 259 @@ -323,40 +312,28 @@ char *yyrule[] = { "rcouple : '(' INTEGER ',' INTEGER ')'", }; #endif -#if YYDEBUG -#include -#endif - -/* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE +#define YYMAXDEPTH YYSTACKSIZE #else #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 +#define YYSTACKSIZE 500 +#define YYMAXDEPTH 500 #endif #endif - -#define YYINITSTACKSIZE 500 - -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; +int yydebug; +int yynerrs; +int yyerrflag; +int yychar; +short *yyssp; YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; - -/* variables for the parser stack */ -static short *yyss; -static short *yysslim; -static YYSTYPE *yyvs; -static int yystacksize; -#line 433 "dgn_comp.y" +YYSTYPE yyval; +YYSTYPE yylval; +short yyss[YYSTACKSIZE]; +YYSTYPE yyvs[YYSTACKSIZE]; +#define yystacksize YYSTACKSIZE void init_dungeon() @@ -603,53 +580,17 @@ output_dgn() } /*dgn_comp.y*/ -#line 607 "y.tab.c" -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(void) -{ - int newsize, i; - short *newss; - YYSTYPE *newvs; - - if ((newsize = yystacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = yyssp - yyss; - newss = (yyss != 0) - ? (short *)realloc(yyss, newsize * sizeof(*newss)) - : (short *)malloc(newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - yyss = newss; - yyssp = newss + i; - newvs = (yyvs != 0) - ? (YYSTYPE *)realloc(yyvs, newsize * sizeof(*newvs)) - : (YYSTYPE *)malloc(newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - yyvs = newvs; - yyvsp = newvs + i; - yystacksize = newsize; - yysslim = yyss + newsize - 1; - return 0; -} - #define YYABORT goto yyabort #define YYREJECT goto yyabort #define YYACCEPT goto yyaccept #define YYERROR goto yyerrlab int -yyparse(void) +yyparse() { register int yym, yyn, yystate; #if YYDEBUG - register const char *yys; + register char *yys; + extern char *getenv(); if ((yys = getenv("YYDEBUG")) != 0) { @@ -661,9 +602,8 @@ yyparse(void) yynerrs = 0; yyerrflag = 0; - yychar = YYEMPTY; + yychar = (-1); - if (yyss == NULL && yygrowstack()) goto yyoverflow; yyssp = yyss; yyvsp = yyvs; *yyssp = yystate = 0; @@ -684,7 +624,7 @@ yyloop: } #endif } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && + if ((yyn = yysindex[yystate]) != 0 && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { #if YYDEBUG @@ -692,40 +632,36 @@ yyloop: printf("%sdebug: state %d, shifting to state %d\n", YYPREFIX, yystate, yytable[yyn]); #endif - if (yyssp >= yysslim && yygrowstack()) + if (yyssp >= yyss + yystacksize - 1) { goto yyoverflow; } *++yyssp = yystate = yytable[yyn]; *++yyvsp = yylval; - yychar = YYEMPTY; + yychar = (-1); if (yyerrflag > 0) --yyerrflag; goto yyloop; } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && + if ((yyn = yyrindex[yystate]) != 0 && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { yyn = yytable[yyn]; goto yyreduce; } if (yyerrflag) goto yyinrecovery; - + goto yynewerror; +yynewerror: yyerror("syntax error"); - -#ifdef lint goto yyerrlab; -#endif - yyerrlab: ++yynerrs; - yyinrecovery: if (yyerrflag < 3) { yyerrflag = 3; for (;;) { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && + if ((yyn = yysindex[*yyssp]) != 0 && (yyn += YYERRCODE) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) { #if YYDEBUG @@ -733,7 +669,7 @@ yyinrecovery: printf("%sdebug: state %d, error recovery shifting\ to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); #endif - if (yyssp >= yysslim && yygrowstack()) + if (yyssp >= yyss + yystacksize - 1) { goto yyoverflow; } @@ -767,10 +703,9 @@ yyinrecovery: YYPREFIX, yystate, yychar, yys); } #endif - yychar = YYEMPTY; + yychar = (-1); goto yyloop; } - yyreduce: #if YYDEBUG if (yydebug) @@ -778,20 +713,15 @@ yyreduce: YYPREFIX, yystate, yyn, yyrule[yyn]); #endif yym = yylen[yyn]; - if (yym) - yyval = yyvsp[1-yym]; - else - memset(&yyval, 0, sizeof yyval); + yyval = yyvsp[1-yym]; switch (yyn) { case 2: -#line 83 "dgn_comp.y" { output_dgn(); } break; case 9: -#line 99 "dgn_comp.y" { init_dungeon(); Strcpy(tmpdungeon[n_dgns].name, yyvsp[-3].str); @@ -803,25 +733,21 @@ case 9: } break; case 10: -#line 111 "dgn_comp.y" { yyval.i = 0; } break; case 11: -#line 115 "dgn_comp.y" { yyval.i = yyvsp[0].i; } break; case 15: -#line 126 "dgn_comp.y" { tmpdungeon[n_dgns].entry_lev = yyvsp[0].i; } break; case 17: -#line 135 "dgn_comp.y" { if(yyvsp[0].i <= TOWN || yyvsp[0].i >= D_ALIGN_CHAOTIC) yyerror("Illegal description - ignoring!"); @@ -830,7 +756,6 @@ case 17: } break; case 18: -#line 142 "dgn_comp.y" { if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC) yyerror("Illegal alignment - ignoring!"); @@ -839,14 +764,12 @@ case 18: } break; case 19: -#line 151 "dgn_comp.y" { Strcpy(tmpdungeon[n_dgns].protoname, yyvsp[0].str); Free(yyvsp[0].str); } break; case 25: -#line 165 "dgn_comp.y" { init_level(); Strcpy(tmplevel[n_levs].name, yyvsp[-3].str); @@ -858,7 +781,6 @@ case 25: } break; case 26: -#line 175 "dgn_comp.y" { init_level(); Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); @@ -871,7 +793,6 @@ case 26: } break; case 27: -#line 188 "dgn_comp.y" { init_level(); Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); @@ -884,7 +805,6 @@ case 27: } break; case 28: -#line 199 "dgn_comp.y" { init_level(); Strcpy(tmplevel[n_levs].name, yyvsp[-5].str); @@ -898,7 +818,6 @@ case 28: } break; case 29: -#line 213 "dgn_comp.y" { if(yyvsp[0].i >= D_ALIGN_CHAOTIC) yyerror("Illegal description - ignoring!"); @@ -907,7 +826,6 @@ case 29: } break; case 30: -#line 220 "dgn_comp.y" { if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC) yyerror("Illegal alignment - ignoring!"); @@ -916,7 +834,6 @@ case 30: } break; case 31: -#line 229 "dgn_comp.y" { init_level(); Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); @@ -931,7 +848,6 @@ case 31: } break; case 32: -#line 242 "dgn_comp.y" { init_level(); Strcpy(tmplevel[n_levs].name, yyvsp[-5].str); @@ -947,7 +863,6 @@ case 32: } break; case 33: -#line 258 "dgn_comp.y" { init_level(); Strcpy(tmplevel[n_levs].name, yyvsp[-5].str); @@ -963,7 +878,6 @@ case 33: } break; case 34: -#line 272 "dgn_comp.y" { init_level(); Strcpy(tmplevel[n_levs].name, yyvsp[-6].str); @@ -980,7 +894,6 @@ case 34: } break; case 37: -#line 293 "dgn_comp.y" { init_branch(); Strcpy(tmpbranch[n_brs].name, yyvsp[-4].str); @@ -994,7 +907,6 @@ case 37: } break; case 38: -#line 307 "dgn_comp.y" { init_branch(); Strcpy(tmpbranch[n_brs].name, yyvsp[-5].str); @@ -1010,49 +922,41 @@ case 38: } break; case 39: -#line 323 "dgn_comp.y" { yyval.i = TBR_STAIR; /* two way stair */ } break; case 40: -#line 327 "dgn_comp.y" { yyval.i = TBR_STAIR; /* two way stair */ } break; case 41: -#line 331 "dgn_comp.y" { yyval.i = TBR_NO_UP; /* no up staircase */ } break; case 42: -#line 335 "dgn_comp.y" { yyval.i = TBR_NO_DOWN; /* no down staircase */ } break; case 43: -#line 339 "dgn_comp.y" { yyval.i = TBR_PORTAL; /* portal connection */ } break; case 44: -#line 345 "dgn_comp.y" { yyval.i = 0; /* defaults to down */ } break; case 45: -#line 349 "dgn_comp.y" { yyval.i = yyvsp[0].i; } break; case 46: -#line 355 "dgn_comp.y" { char *p = yyvsp[0].str; if (strlen(p) != 1) { @@ -1065,7 +969,6 @@ case 46: } break; case 47: -#line 385 "dgn_comp.y" { if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) { yyerror("Abs base out of dlevel range - zeroing!"); @@ -1082,7 +985,6 @@ case 47: } break; case 48: -#line 422 "dgn_comp.y" { if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) { yyerror("Rel base out of dlevel range - zeroing!"); @@ -1093,7 +995,6 @@ case 48: } } break; -#line 1097 "y.tab.c" } yyssp -= yym; yystate = *yyssp; @@ -1126,7 +1027,7 @@ break; if (yychar == 0) goto yyaccept; goto yyloop; } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && + if ((yyn = yygindex[yym]) != 0 && (yyn += yystate) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yystate) yystate = yytable[yyn]; else @@ -1136,20 +1037,17 @@ break; printf("%sdebug: after reduction, shifting from state %d \ to state %d\n", YYPREFIX, *yyssp, yystate); #endif - if (yyssp >= yysslim && yygrowstack()) + if (yyssp >= yyss + yystacksize - 1) { goto yyoverflow; } *++yyssp = yystate; *++yyvsp = yyval; goto yyloop; - yyoverflow: yyerror("yacc stack overflow"); - yyabort: return (1); - yyaccept: return (0); } diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c index 0be95064a..a3177f0b7 100644 --- a/sys/share/lev_lex.c +++ b/sys/share/lev_lex.c @@ -33,7 +33,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -50,7 +50,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -167,7 +167,7 @@ extern FILE *yyin, *yyout; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -224,7 +224,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -1089,9 +1089,7 @@ int yy_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "lev_comp.l" -#line 2 "lev_comp.l" -/* NetHack 3.6 lev_comp.l $NHDT-Date: 1448710678 2015/11/28 11:37:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.21 $ */ +/* NetHack 3.6 lev_comp.l $NHDT-Date: 1449233107 2015/12/04 12:45:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.22 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -1191,9 +1189,6 @@ FILE *orig_yyin = NULL; #define ST_RET(x) do { savetoken(yytext); return x; } while (0); #define ST_RETF(y, x) do { savetoken(yytext); y; return x; } while (0); - -#line 1196 "lev_lex.c" - #define INITIAL 0 #define MAPC 1 @@ -1253,7 +1248,7 @@ extern int yywrap (void ); #endif static void yyunput (int c,char *buf_ptr ); - + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -1377,10 +1372,6 @@ YY_DECL register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - -#line 107 "lev_comp.l" - -#line 1384 "lev_lex.c" if ( !(yy_init) ) { @@ -1466,7 +1457,6 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 108 "lev_comp.l" { savetoken(yytext); BEGIN(INITIAL); @@ -1480,7 +1470,6 @@ YY_RULE_SETUP case 2: /* rule 2 can match eol */ YY_RULE_SETUP -#line 117 "lev_comp.l" { int len = yyleng; savetoken(yytext); @@ -1497,888 +1486,711 @@ YY_RULE_SETUP case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 129 "lev_comp.l" { savetoken(yytext); newline(); } YY_BREAK case 4: YY_RULE_SETUP -#line 130 "lev_comp.l" ST_RET(MESSAGE_ID); YY_BREAK case 5: YY_RULE_SETUP -#line 131 "lev_comp.l" ST_RET(NOMAP_ID); YY_BREAK case 6: YY_RULE_SETUP -#line 132 "lev_comp.l" ST_RET(MAZE_ID); YY_BREAK case 7: YY_RULE_SETUP -#line 133 "lev_comp.l" ST_RET(LEVEL_ID); YY_BREAK case 8: YY_RULE_SETUP -#line 134 "lev_comp.l" ST_RET(LEV_INIT_ID); YY_BREAK case 9: YY_RULE_SETUP -#line 135 "lev_comp.l" ST_RET(MAZE_GRID_ID); YY_BREAK case 10: YY_RULE_SETUP -#line 136 "lev_comp.l" ST_RET(SOLID_FILL_ID); YY_BREAK case 11: YY_RULE_SETUP -#line 137 "lev_comp.l" ST_RET(MINES_ID); YY_BREAK case 12: YY_RULE_SETUP -#line 138 "lev_comp.l" ST_RET(ROGUELEV_ID); YY_BREAK case 13: YY_RULE_SETUP -#line 139 "lev_comp.l" ST_RET(FLAGS_ID); YY_BREAK case 14: YY_RULE_SETUP -#line 140 "lev_comp.l" ST_RET(GEOMETRY_ID); YY_BREAK case 15: /* rule 15 can match eol */ YY_RULE_SETUP -#line 141 "lev_comp.l" { savetoken(yytext); BEGIN(MAPC); newline(); } YY_BREAK case 16: YY_RULE_SETUP -#line 142 "lev_comp.l" ST_RET(object_ID); YY_BREAK case 17: YY_RULE_SETUP -#line 143 "lev_comp.l" ST_RET(OBJECT_ID); YY_BREAK case 18: YY_RULE_SETUP -#line 144 "lev_comp.l" ST_RET(COBJECT_ID); YY_BREAK case 19: YY_RULE_SETUP -#line 145 "lev_comp.l" ST_RET(MONSTER_ID); YY_BREAK case 20: YY_RULE_SETUP -#line 146 "lev_comp.l" ST_RET(monster_ID); YY_BREAK case 21: YY_RULE_SETUP -#line 147 "lev_comp.l" ST_RET(TRAP_ID); YY_BREAK case 22: YY_RULE_SETUP -#line 148 "lev_comp.l" ST_RET(DOOR_ID); YY_BREAK case 23: YY_RULE_SETUP -#line 149 "lev_comp.l" ST_RET(ROOMDOOR_ID); YY_BREAK case 24: YY_RULE_SETUP -#line 150 "lev_comp.l" ST_RET(DRAWBRIDGE_ID); YY_BREAK case 25: YY_RULE_SETUP -#line 151 "lev_comp.l" ST_RET(MAZEWALK_ID); YY_BREAK case 26: YY_RULE_SETUP -#line 152 "lev_comp.l" ST_RET(WALLIFY_ID); YY_BREAK case 27: YY_RULE_SETUP -#line 153 "lev_comp.l" ST_RET(REGION_ID); YY_BREAK case 28: YY_RULE_SETUP -#line 154 "lev_comp.l" ST_RET(ALTAR_ID); YY_BREAK case 29: YY_RULE_SETUP -#line 155 "lev_comp.l" ST_RET(LADDER_ID); YY_BREAK case 30: YY_RULE_SETUP -#line 156 "lev_comp.l" ST_RET(STAIR_ID); YY_BREAK case 31: YY_RULE_SETUP -#line 157 "lev_comp.l" ST_RET(PORTAL_ID); YY_BREAK case 32: YY_RULE_SETUP -#line 158 "lev_comp.l" ST_RET(TELEPRT_ID); YY_BREAK case 33: YY_RULE_SETUP -#line 159 "lev_comp.l" ST_RET(BRANCH_ID); YY_BREAK case 34: YY_RULE_SETUP -#line 160 "lev_comp.l" ST_RET(FOUNTAIN_ID); YY_BREAK case 35: YY_RULE_SETUP -#line 161 "lev_comp.l" ST_RET(SINK_ID); YY_BREAK case 36: YY_RULE_SETUP -#line 162 "lev_comp.l" ST_RET(POOL_ID); YY_BREAK case 37: YY_RULE_SETUP -#line 163 "lev_comp.l" ST_RET(NON_DIGGABLE_ID); YY_BREAK case 38: YY_RULE_SETUP -#line 164 "lev_comp.l" ST_RET(NON_PASSWALL_ID); YY_BREAK case 39: YY_RULE_SETUP -#line 165 "lev_comp.l" ST_RET(IF_ID); YY_BREAK case 40: YY_RULE_SETUP -#line 166 "lev_comp.l" ST_RET(ELSE_ID); YY_BREAK case 41: YY_RULE_SETUP -#line 167 "lev_comp.l" ST_RET(EXIT_ID); YY_BREAK case 42: YY_RULE_SETUP -#line 168 "lev_comp.l" ST_RET(ROOM_ID); YY_BREAK case 43: YY_RULE_SETUP -#line 169 "lev_comp.l" ST_RET(SUBROOM_ID); YY_BREAK case 44: YY_RULE_SETUP -#line 170 "lev_comp.l" ST_RET(RAND_CORRIDOR_ID); YY_BREAK case 45: YY_RULE_SETUP -#line 171 "lev_comp.l" ST_RET(CORRIDOR_ID); YY_BREAK case 46: YY_RULE_SETUP -#line 172 "lev_comp.l" ST_RET(TERRAIN_ID); YY_BREAK case 47: YY_RULE_SETUP -#line 173 "lev_comp.l" ST_RET(terrain_ID); YY_BREAK case 48: YY_RULE_SETUP -#line 174 "lev_comp.l" ST_RET(REPLACE_TERRAIN_ID); YY_BREAK case 49: YY_RULE_SETUP -#line 175 "lev_comp.l" ST_RET(GOLD_ID); YY_BREAK case 50: YY_RULE_SETUP -#line 176 "lev_comp.l" ST_RET(GRAVE_ID); YY_BREAK case 51: YY_RULE_SETUP -#line 177 "lev_comp.l" ST_RET(ENGRAVING_ID); YY_BREAK case 52: YY_RULE_SETUP -#line 178 "lev_comp.l" ST_RET(MINERALIZE_ID); YY_BREAK case 53: YY_RULE_SETUP -#line 179 "lev_comp.l" ST_RET(NAME_ID); YY_BREAK case 54: YY_RULE_SETUP -#line 180 "lev_comp.l" ST_RET(FOR_ID); YY_BREAK case 55: YY_RULE_SETUP -#line 181 "lev_comp.l" ST_RET(TO_ID); YY_BREAK case 56: YY_RULE_SETUP -#line 182 "lev_comp.l" ST_RET(LOOP_ID); YY_BREAK case 57: YY_RULE_SETUP -#line 183 "lev_comp.l" ST_RET(SWITCH_ID); YY_BREAK case 58: YY_RULE_SETUP -#line 184 "lev_comp.l" ST_RET(CASE_ID); YY_BREAK case 59: YY_RULE_SETUP -#line 185 "lev_comp.l" ST_RET(BREAK_ID); YY_BREAK case 60: YY_RULE_SETUP -#line 186 "lev_comp.l" ST_RET(DEFAULT_ID); YY_BREAK case 61: YY_RULE_SETUP -#line 187 "lev_comp.l" ST_RET(FUNCTION_ID); YY_BREAK case 62: YY_RULE_SETUP -#line 188 "lev_comp.l" ST_RET(SHUFFLE_ID); YY_BREAK case 63: YY_RULE_SETUP -#line 189 "lev_comp.l" ST_RET(MONTYPE_ID); YY_BREAK case 64: YY_RULE_SETUP -#line 190 "lev_comp.l" ST_RET(selection_ID); YY_BREAK case 65: YY_RULE_SETUP -#line 191 "lev_comp.l" ST_RET(rect_ID); YY_BREAK case 66: YY_RULE_SETUP -#line 192 "lev_comp.l" ST_RET(fillrect_ID); YY_BREAK case 67: YY_RULE_SETUP -#line 193 "lev_comp.l" ST_RET(line_ID); YY_BREAK case 68: YY_RULE_SETUP -#line 194 "lev_comp.l" ST_RET(randline_ID); YY_BREAK case 69: YY_RULE_SETUP -#line 195 "lev_comp.l" ST_RET(grow_ID); YY_BREAK case 70: YY_RULE_SETUP -#line 196 "lev_comp.l" ST_RET(flood_ID); YY_BREAK case 71: YY_RULE_SETUP -#line 197 "lev_comp.l" ST_RET(rndcoord_ID); YY_BREAK case 72: YY_RULE_SETUP -#line 198 "lev_comp.l" ST_RET(circle_ID); YY_BREAK case 73: YY_RULE_SETUP -#line 199 "lev_comp.l" ST_RET(ellipse_ID); YY_BREAK case 74: YY_RULE_SETUP -#line 200 "lev_comp.l" ST_RET(filter_ID); YY_BREAK case 75: YY_RULE_SETUP -#line 201 "lev_comp.l" ST_RET(gradient_ID); YY_BREAK case 76: YY_RULE_SETUP -#line 202 "lev_comp.l" ST_RET(complement_ID); YY_BREAK case 77: YY_RULE_SETUP -#line 203 "lev_comp.l" { savetoken(yytext); yylval.i=SEL_GRADIENT_RADIAL; return GRADIENT_TYPE; } YY_BREAK case 78: YY_RULE_SETUP -#line 204 "lev_comp.l" { savetoken(yytext); yylval.i=SEL_GRADIENT_SQUARE; return GRADIENT_TYPE; } YY_BREAK case 79: YY_RULE_SETUP -#line 205 "lev_comp.l" { savetoken(yytext); yylval.i=DRY; return HUMIDITY_TYPE; } YY_BREAK case 80: YY_RULE_SETUP -#line 206 "lev_comp.l" { savetoken(yytext); yylval.i=WET; return HUMIDITY_TYPE; } YY_BREAK case 81: YY_RULE_SETUP -#line 207 "lev_comp.l" { savetoken(yytext); yylval.i=HOT; return HUMIDITY_TYPE; } YY_BREAK case 82: YY_RULE_SETUP -#line 208 "lev_comp.l" { savetoken(yytext); yylval.i=SOLID; return HUMIDITY_TYPE; } YY_BREAK case 83: YY_RULE_SETUP -#line 209 "lev_comp.l" { savetoken(yytext); yylval.i=ANY_LOC; return HUMIDITY_TYPE; } YY_BREAK case 84: YY_RULE_SETUP -#line 210 "lev_comp.l" ST_RET(LEV); YY_BREAK case 85: YY_RULE_SETUP -#line 211 "lev_comp.l" ST_RET(QUANTITY_ID); YY_BREAK case 86: YY_RULE_SETUP -#line 212 "lev_comp.l" ST_RET(BURIED_ID); YY_BREAK case 87: YY_RULE_SETUP -#line 213 "lev_comp.l" ST_RET(ERODED_ID); YY_BREAK case 88: YY_RULE_SETUP -#line 214 "lev_comp.l" ST_RET(ERODEPROOF_ID); YY_BREAK case 89: YY_RULE_SETUP -#line 215 "lev_comp.l" { savetoken(yytext); yylval.i=1; return TRAPPED_STATE; } YY_BREAK case 90: YY_RULE_SETUP -#line 216 "lev_comp.l" { savetoken(yytext); yylval.i=0; return TRAPPED_STATE; } YY_BREAK case 91: YY_RULE_SETUP -#line 217 "lev_comp.l" ST_RET(RECHARGED_ID); YY_BREAK case 92: YY_RULE_SETUP -#line 218 "lev_comp.l" ST_RET(INVIS_ID); YY_BREAK case 93: YY_RULE_SETUP -#line 219 "lev_comp.l" ST_RET(GREASED_ID); YY_BREAK case 94: YY_RULE_SETUP -#line 220 "lev_comp.l" ST_RET(FEMALE_ID); YY_BREAK case 95: YY_RULE_SETUP -#line 221 "lev_comp.l" ST_RET(CANCELLED_ID); YY_BREAK case 96: YY_RULE_SETUP -#line 222 "lev_comp.l" ST_RET(REVIVED_ID); YY_BREAK case 97: YY_RULE_SETUP -#line 223 "lev_comp.l" ST_RET(AVENGE_ID); YY_BREAK case 98: YY_RULE_SETUP -#line 224 "lev_comp.l" ST_RET(FLEEING_ID); YY_BREAK case 99: YY_RULE_SETUP -#line 225 "lev_comp.l" ST_RET(BLINDED_ID); YY_BREAK case 100: YY_RULE_SETUP -#line 226 "lev_comp.l" ST_RET(PARALYZED_ID); YY_BREAK case 101: YY_RULE_SETUP -#line 227 "lev_comp.l" ST_RET(STUNNED_ID); YY_BREAK case 102: YY_RULE_SETUP -#line 228 "lev_comp.l" ST_RET(CONFUSED_ID); YY_BREAK case 103: YY_RULE_SETUP -#line 229 "lev_comp.l" ST_RET(SEENTRAPS_ID); YY_BREAK case 104: YY_RULE_SETUP -#line 230 "lev_comp.l" ST_RET(ALL_ID); YY_BREAK case 105: YY_RULE_SETUP -#line 231 "lev_comp.l" ST_RETF((yylval.i=1), HORIZ_OR_VERT); YY_BREAK case 106: YY_RULE_SETUP -#line 232 "lev_comp.l" { savetoken(yytext); yylval.i=2; return HORIZ_OR_VERT; } YY_BREAK case 107: YY_RULE_SETUP -#line 233 "lev_comp.l" { savetoken(yytext); yylval.i=D_ISOPEN; return DOOR_STATE; } YY_BREAK case 108: YY_RULE_SETUP -#line 234 "lev_comp.l" { savetoken(yytext); yylval.i=D_CLOSED; return DOOR_STATE; } YY_BREAK case 109: YY_RULE_SETUP -#line 235 "lev_comp.l" { savetoken(yytext); yylval.i=D_LOCKED; return DOOR_STATE; } YY_BREAK case 110: YY_RULE_SETUP -#line 236 "lev_comp.l" { savetoken(yytext); yylval.i=D_NODOOR; return DOOR_STATE; } YY_BREAK case 111: YY_RULE_SETUP -#line 237 "lev_comp.l" { savetoken(yytext); yylval.i=D_BROKEN; return DOOR_STATE; } YY_BREAK case 112: YY_RULE_SETUP -#line 238 "lev_comp.l" { savetoken(yytext); yylval.i=D_SECRET; return DOOR_STATE; } YY_BREAK case 113: YY_RULE_SETUP -#line 239 "lev_comp.l" { savetoken(yytext); yylval.i=W_NORTH; return DIRECTION; } YY_BREAK case 114: YY_RULE_SETUP -#line 240 "lev_comp.l" { savetoken(yytext); yylval.i=W_EAST; return DIRECTION; } YY_BREAK case 115: YY_RULE_SETUP -#line 241 "lev_comp.l" { savetoken(yytext); yylval.i=W_SOUTH; return DIRECTION; } YY_BREAK case 116: YY_RULE_SETUP -#line 242 "lev_comp.l" { savetoken(yytext); yylval.i=W_WEST; return DIRECTION; } YY_BREAK case 117: YY_RULE_SETUP -#line 243 "lev_comp.l" { savetoken(yytext); yylval.i = -1; return RANDOM_TYPE; } YY_BREAK case 118: YY_RULE_SETUP -#line 244 "lev_comp.l" { savetoken(yytext); yylval.i = -1; return RANDOM_TYPE_BRACKET; } YY_BREAK case 119: YY_RULE_SETUP -#line 245 "lev_comp.l" { savetoken(yytext); yylval.i = -2; return NONE; } YY_BREAK case 120: YY_RULE_SETUP -#line 246 "lev_comp.l" ST_RET(A_REGISTER); YY_BREAK case 121: YY_RULE_SETUP -#line 247 "lev_comp.l" { savetoken(yytext); yylval.i=1; return LEFT_OR_RIGHT; } YY_BREAK case 122: YY_RULE_SETUP -#line 248 "lev_comp.l" { savetoken(yytext); yylval.i=2; return LEFT_OR_RIGHT; } YY_BREAK case 123: YY_RULE_SETUP -#line 249 "lev_comp.l" { savetoken(yytext); yylval.i=3; return CENTER; } YY_BREAK case 124: YY_RULE_SETUP -#line 250 "lev_comp.l" { savetoken(yytext); yylval.i=4; return LEFT_OR_RIGHT; } YY_BREAK case 125: YY_RULE_SETUP -#line 251 "lev_comp.l" { savetoken(yytext); yylval.i=5; return LEFT_OR_RIGHT; } YY_BREAK case 126: YY_RULE_SETUP -#line 252 "lev_comp.l" { savetoken(yytext); yylval.i=1; return TOP_OR_BOT; } YY_BREAK case 127: YY_RULE_SETUP -#line 253 "lev_comp.l" { savetoken(yytext); yylval.i=5; return TOP_OR_BOT; } YY_BREAK case 128: YY_RULE_SETUP -#line 254 "lev_comp.l" { savetoken(yytext); yylval.i=1; return LIGHT_STATE; } YY_BREAK case 129: YY_RULE_SETUP -#line 255 "lev_comp.l" { savetoken(yytext); yylval.i=0; return LIGHT_STATE; } YY_BREAK case 130: YY_RULE_SETUP -#line 256 "lev_comp.l" { savetoken(yytext); yylval.i=1; return FILLING; } YY_BREAK case 131: YY_RULE_SETUP -#line 257 "lev_comp.l" { savetoken(yytext); yylval.i=0; return FILLING; } YY_BREAK case 132: YY_RULE_SETUP -#line 258 "lev_comp.l" { savetoken(yytext); yylval.i=0; return IRREGULAR; } YY_BREAK case 133: YY_RULE_SETUP -#line 259 "lev_comp.l" { savetoken(yytext); yylval.i=1; return IRREGULAR; } YY_BREAK case 134: YY_RULE_SETUP -#line 260 "lev_comp.l" { savetoken(yytext); yylval.i=1; return JOINED; } YY_BREAK case 135: YY_RULE_SETUP -#line 261 "lev_comp.l" { savetoken(yytext); yylval.i=0; return JOINED; } YY_BREAK case 136: YY_RULE_SETUP -#line 262 "lev_comp.l" { savetoken(yytext); yylval.i=1; return LIMITED; } YY_BREAK case 137: YY_RULE_SETUP -#line 263 "lev_comp.l" { savetoken(yytext); yylval.i=0; return LIMITED; } YY_BREAK case 138: YY_RULE_SETUP -#line 264 "lev_comp.l" { savetoken(yytext); yylval.i= AM_NONE; return ALIGNMENT; } YY_BREAK case 139: YY_RULE_SETUP -#line 265 "lev_comp.l" { savetoken(yytext); yylval.i= AM_LAWFUL; return ALIGNMENT; } YY_BREAK case 140: YY_RULE_SETUP -#line 266 "lev_comp.l" { savetoken(yytext); yylval.i= AM_NEUTRAL; return ALIGNMENT; } YY_BREAK case 141: YY_RULE_SETUP -#line 267 "lev_comp.l" { savetoken(yytext); yylval.i= AM_CHAOTIC; return ALIGNMENT; } YY_BREAK case 142: YY_RULE_SETUP -#line 268 "lev_comp.l" { savetoken(yytext); yylval.i= AM_SPLEV_CO; return ALIGNMENT; } YY_BREAK case 143: YY_RULE_SETUP -#line 269 "lev_comp.l" { savetoken(yytext); yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; } YY_BREAK case 144: YY_RULE_SETUP -#line 270 "lev_comp.l" { savetoken(yytext); yylval.i=1; return MON_ATTITUDE; } YY_BREAK case 145: YY_RULE_SETUP -#line 271 "lev_comp.l" { savetoken(yytext); yylval.i=0; return MON_ATTITUDE; } YY_BREAK case 146: YY_RULE_SETUP -#line 272 "lev_comp.l" { savetoken(yytext); yylval.i=1; return MON_ALERTNESS; } YY_BREAK case 147: YY_RULE_SETUP -#line 273 "lev_comp.l" { savetoken(yytext); yylval.i=0; return MON_ALERTNESS; } YY_BREAK case 148: YY_RULE_SETUP -#line 274 "lev_comp.l" { savetoken(yytext); yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; } YY_BREAK case 149: YY_RULE_SETUP -#line 275 "lev_comp.l" { savetoken(yytext); yylval.i= M_AP_MONSTER; return MON_APPEARANCE; } YY_BREAK case 150: YY_RULE_SETUP -#line 276 "lev_comp.l" { savetoken(yytext); yylval.i= M_AP_OBJECT; return MON_APPEARANCE; } YY_BREAK case 151: YY_RULE_SETUP -#line 277 "lev_comp.l" { savetoken(yytext); yylval.i=2; return ALTAR_TYPE; } YY_BREAK case 152: YY_RULE_SETUP -#line 278 "lev_comp.l" { savetoken(yytext); yylval.i=1; return ALTAR_TYPE; } YY_BREAK case 153: YY_RULE_SETUP -#line 279 "lev_comp.l" { savetoken(yytext); yylval.i=0; return ALTAR_TYPE; } YY_BREAK case 154: YY_RULE_SETUP -#line 280 "lev_comp.l" { savetoken(yytext); yylval.i=1; return UP_OR_DOWN; } YY_BREAK case 155: YY_RULE_SETUP -#line 281 "lev_comp.l" { savetoken(yytext); yylval.i=0; return UP_OR_DOWN; } YY_BREAK case 156: YY_RULE_SETUP -#line 282 "lev_comp.l" { savetoken(yytext); yylval.i=0; return BOOLEAN; } YY_BREAK case 157: YY_RULE_SETUP -#line 283 "lev_comp.l" { savetoken(yytext); yylval.i=1; return BOOLEAN; } YY_BREAK case 158: YY_RULE_SETUP -#line 284 "lev_comp.l" { savetoken(yytext); yylval.i=DUST; return ENGRAVING_TYPE; } YY_BREAK case 159: YY_RULE_SETUP -#line 285 "lev_comp.l" { savetoken(yytext); yylval.i=ENGRAVE; return ENGRAVING_TYPE; } YY_BREAK case 160: YY_RULE_SETUP -#line 286 "lev_comp.l" { savetoken(yytext); yylval.i=BURN; return ENGRAVING_TYPE; } YY_BREAK case 161: YY_RULE_SETUP -#line 287 "lev_comp.l" { savetoken(yytext); yylval.i=MARK; return ENGRAVING_TYPE; } YY_BREAK case 162: YY_RULE_SETUP -#line 288 "lev_comp.l" { savetoken(yytext); yylval.i=ENGR_BLOOD; return ENGRAVING_TYPE; } YY_BREAK case 163: YY_RULE_SETUP -#line 289 "lev_comp.l" { savetoken(yytext); yylval.i=1; return CURSE_TYPE; } YY_BREAK case 164: YY_RULE_SETUP -#line 290 "lev_comp.l" { savetoken(yytext); yylval.i=2; return CURSE_TYPE; } YY_BREAK case 165: YY_RULE_SETUP -#line 291 "lev_comp.l" { savetoken(yytext); yylval.i=3; return CURSE_TYPE; } YY_BREAK case 166: YY_RULE_SETUP -#line 292 "lev_comp.l" { savetoken(yytext); yylval.i=NOTELEPORT; return FLAG_TYPE; } YY_BREAK case 167: YY_RULE_SETUP -#line 293 "lev_comp.l" { savetoken(yytext); yylval.i=HARDFLOOR; return FLAG_TYPE; } YY_BREAK case 168: YY_RULE_SETUP -#line 294 "lev_comp.l" { savetoken(yytext); yylval.i=NOMMAP; return FLAG_TYPE; } YY_BREAK case 169: YY_RULE_SETUP -#line 295 "lev_comp.l" { savetoken(yytext); yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */ YY_BREAK case 170: YY_RULE_SETUP -#line 296 "lev_comp.l" { savetoken(yytext); yylval.i=SHORTSIGHTED; return FLAG_TYPE; } YY_BREAK case 171: YY_RULE_SETUP -#line 297 "lev_comp.l" { savetoken(yytext); yylval.i=MAZELEVEL; return FLAG_TYPE; } YY_BREAK case 172: YY_RULE_SETUP -#line 298 "lev_comp.l" { savetoken(yytext); yylval.i=PREMAPPED; return FLAG_TYPE; } YY_BREAK case 173: YY_RULE_SETUP -#line 299 "lev_comp.l" { savetoken(yytext); yylval.i=SHROUD; return FLAG_TYPE; } YY_BREAK case 174: YY_RULE_SETUP -#line 300 "lev_comp.l" { savetoken(yytext); yylval.i=GRAVEYARD; return FLAG_TYPE; } YY_BREAK case 175: YY_RULE_SETUP -#line 301 "lev_comp.l" { savetoken(yytext); yylval.i=ICEDPOOLS; return FLAG_TYPE; } YY_BREAK case 176: YY_RULE_SETUP -#line 302 "lev_comp.l" { savetoken(yytext); yylval.i=SOLIDIFY; return FLAG_TYPE; } YY_BREAK case 177: YY_RULE_SETUP -#line 303 "lev_comp.l" { savetoken(yytext); yylval.i=CORRMAZE; return FLAG_TYPE; } YY_BREAK case 178: YY_RULE_SETUP -#line 304 "lev_comp.l" { savetoken(yytext); yylval.i=CHECK_INACCESSIBLES; return FLAG_TYPE; } YY_BREAK case 179: YY_RULE_SETUP -#line 305 "lev_comp.l" { char *p = index(yytext, 'd'); savetoken(yytext); if (p) { @@ -2393,7 +2205,6 @@ YY_RULE_SETUP YY_BREAK case 180: YY_RULE_SETUP -#line 316 "lev_comp.l" { savetoken(yytext); yylval.i = atoi(yytext + 1); if (yylval.i < 0 || yylval.i > 100) lc_error("Unexpected percentile '%li%%'", yylval.i); @@ -2401,17 +2212,14 @@ YY_RULE_SETUP YY_BREAK case 181: YY_RULE_SETUP -#line 320 "lev_comp.l" { savetoken(yytext); yylval.i=atoi(yytext); return MINUS_INTEGER; } YY_BREAK case 182: YY_RULE_SETUP -#line 321 "lev_comp.l" { savetoken(yytext); yylval.i=atoi(yytext); return PLUS_INTEGER; } YY_BREAK case 183: YY_RULE_SETUP -#line 322 "lev_comp.l" { savetoken(yytext); yylval.i = atoi(yytext); if (yylval.i < 0 || yylval.i > 100) lc_error("Unexpected percentile '%li%%'", yylval.i); @@ -2419,13 +2227,11 @@ YY_RULE_SETUP YY_BREAK case 184: YY_RULE_SETUP -#line 326 "lev_comp.l" { savetoken(yytext); yylval.i=atoi(yytext); return INTEGER; } YY_BREAK case 185: /* rule 185 can match eol */ YY_RULE_SETUP -#line 327 "lev_comp.l" { savetoken(yytext); yytext[yyleng - 1] = '\0'; /* discard the trailing \" */ yylval.map = dupstr(yytext + 1); /* skip the first \" */ @@ -2433,81 +2239,65 @@ YY_RULE_SETUP YY_BREAK case 186: YY_RULE_SETUP -#line 331 "lev_comp.l" { savetoken(yytext); return handle_varstring_check(); } YY_BREAK case 187: YY_RULE_SETUP -#line 332 "lev_comp.l" { savetoken(yytext); yylval.i = SPO_JE; return COMPARE_TYPE; } YY_BREAK case 188: YY_RULE_SETUP -#line 333 "lev_comp.l" { savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } YY_BREAK case 189: YY_RULE_SETUP -#line 334 "lev_comp.l" { savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } YY_BREAK case 190: YY_RULE_SETUP -#line 335 "lev_comp.l" { savetoken(yytext); yylval.i = SPO_JLE; return COMPARE_TYPE; } YY_BREAK case 191: YY_RULE_SETUP -#line 336 "lev_comp.l" { savetoken(yytext); yylval.i = SPO_JGE; return COMPARE_TYPE; } YY_BREAK case 192: YY_RULE_SETUP -#line 337 "lev_comp.l" { savetoken(yytext); yylval.i = SPO_JL; return COMPARE_TYPE; } YY_BREAK case 193: YY_RULE_SETUP -#line 338 "lev_comp.l" { savetoken(yytext); yylval.i = SPO_JG; return COMPARE_TYPE; } YY_BREAK case 194: /* rule 194 can match eol */ YY_RULE_SETUP -#line 339 "lev_comp.l" { newline(); } YY_BREAK case 195: YY_RULE_SETUP -#line 340 "lev_comp.l" { advancepos(yytext); } YY_BREAK case 196: YY_RULE_SETUP -#line 341 "lev_comp.l" { savetoken(yytext); yylval.i = yytext[2]; return CHAR; } YY_BREAK case 197: YY_RULE_SETUP -#line 342 "lev_comp.l" { savetoken(yytext); yylval.i = yytext[1]; return CHAR; } YY_BREAK case 198: YY_RULE_SETUP -#line 343 "lev_comp.l" ST_RET(UNKNOWN_TYPE); YY_BREAK case 199: YY_RULE_SETUP -#line 344 "lev_comp.l" { savetoken(yytext); return yytext[0]; } YY_BREAK case 200: YY_RULE_SETUP -#line 345 "lev_comp.l" ECHO; YY_BREAK -#line 2511 "lev_lex.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(MAPC): yyterminate(); @@ -2786,7 +2576,7 @@ static int yy_get_next_buffer (void) { register yy_state_type yy_current_state; register char *yy_cp; - + yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); @@ -2841,7 +2631,7 @@ static int yy_get_next_buffer (void) static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; - + yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ @@ -2884,7 +2674,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -2953,12 +2743,12 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -2971,11 +2761,11 @@ static int yy_get_next_buffer (void) /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); @@ -3015,13 +2805,13 @@ static void yy_load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -3044,11 +2834,11 @@ static void yy_load_buffer_state (void) /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() - * + * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -3069,7 +2859,7 @@ static void yy_load_buffer_state (void) { int oerrno = errno; - + yy_flush_buffer(b ); b->yy_input_file = file; @@ -3085,13 +2875,13 @@ static void yy_load_buffer_state (void) } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { @@ -3120,7 +2910,7 @@ static void yy_load_buffer_state (void) * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { @@ -3150,7 +2940,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void yypop_buffer_state (void) { @@ -3174,7 +2964,7 @@ void yypop_buffer_state (void) static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this @@ -3187,7 +2977,7 @@ static void yyensure_buffer_stack (void) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -3217,13 +3007,13 @@ static void yyensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. + * + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -3252,14 +3042,14 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { - + return yy_scan_bytes(yystr,strlen(yystr) ); } @@ -3267,7 +3057,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) @@ -3276,7 +3066,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); @@ -3330,16 +3120,16 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ int yyget_lineno (void) { - + return yylineno; } /** Get the input stream. - * + * */ FILE *yyget_in (void) { @@ -3347,7 +3137,7 @@ FILE *yyget_in (void) } /** Get the output stream. - * + * */ FILE *yyget_out (void) { @@ -3355,7 +3145,7 @@ FILE *yyget_out (void) } /** Get the length of the current token. - * + * */ yy_size_t yyget_leng (void) { @@ -3363,7 +3153,7 @@ yy_size_t yyget_leng (void) } /** Get the current token. - * + * */ char *yyget_text (void) @@ -3373,18 +3163,18 @@ char *yyget_text (void) /** Set the current line number. * @param line_number - * + * */ void yyset_lineno (int line_number ) { - + yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) @@ -3438,7 +3228,7 @@ static int yy_init_globals (void) /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); @@ -3505,9 +3295,6 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 345 "lev_comp.l" - - #ifdef AMIGA long * alloc(n) From 6cfa4bbbe517828cd32c1eacd728837f2a3ecf70 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 4 Dec 2015 07:57:35 -0500 Subject: [PATCH 06/18] lev_yacc and lev_lex from master --- sys/share/lev_lex.c | 2 +- sys/share/lev_yacc.c | 8486 +++++++++++++++++++----------------------- 2 files changed, 3798 insertions(+), 4690 deletions(-) diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c index a3177f0b7..dd76b8484 100644 --- a/sys/share/lev_lex.c +++ b/sys/share/lev_lex.c @@ -1089,7 +1089,7 @@ int yy_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -/* NetHack 3.6 lev_comp.l $NHDT-Date: 1449233107 2015/12/04 12:45:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.22 $ */ +/* NetHack 3.6 lev_comp.l $NHDT-Date: 1449188840 2015/12/04 00:27:20 $ $NHDT-Branch: master $:$NHDT-Revision: 1.22 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/lev_yacc.c b/sys/share/lev_yacc.c index 2beac8408..62e1f2042 100644 --- a/sys/share/lev_yacc.c +++ b/sys/share/lev_yacc.c @@ -1,70 +1,17 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +#ifndef lint +/* static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; */ +/* static char nhsccsid[] = "@(#)yaccpar 1.9.0-nh (NetHack) 12/03/2015"; */ +#endif +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 +#define YYSUBMINOR "0-nh" -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 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 . */ - -/* 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. */ - -/* 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. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.0.2" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - - - -/* Copy the first part of user declarations. */ -#line 1 "lev_comp.y" /* yacc.c:339 */ - -/* NetHack 3.6 lev_comp.y $NHDT-Date: 1448074095 2015/11/21 02:48:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $ */ +#define yyclearin (yychar=(-1)) +#define yyerrok (yyerrflag=0) +#define YYRECOVERING (yyerrflag!=0) +#define YYPREFIX "yy" +/* NetHack 3.6 lev_comp.y $NHDT-Date: 1449233826 2015/12/04 12:57:06 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.19 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -206,401 +153,8 @@ extern const char *fname; extern char curr_token[512]; - -#line 211 "y.tab.c" /* yacc.c:339 */ - -# ifndef YY_NULLPTR -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "y.tab.h". */ -#ifndef YY_YY_Y_TAB_H_INCLUDED -# define YY_YY_Y_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int yydebug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - CHAR = 258, - INTEGER = 259, - BOOLEAN = 260, - PERCENT = 261, - SPERCENT = 262, - MINUS_INTEGER = 263, - PLUS_INTEGER = 264, - MAZE_GRID_ID = 265, - SOLID_FILL_ID = 266, - MINES_ID = 267, - ROGUELEV_ID = 268, - MESSAGE_ID = 269, - MAZE_ID = 270, - LEVEL_ID = 271, - LEV_INIT_ID = 272, - GEOMETRY_ID = 273, - NOMAP_ID = 274, - OBJECT_ID = 275, - COBJECT_ID = 276, - MONSTER_ID = 277, - TRAP_ID = 278, - DOOR_ID = 279, - DRAWBRIDGE_ID = 280, - object_ID = 281, - monster_ID = 282, - terrain_ID = 283, - MAZEWALK_ID = 284, - WALLIFY_ID = 285, - REGION_ID = 286, - FILLING = 287, - IRREGULAR = 288, - JOINED = 289, - ALTAR_ID = 290, - LADDER_ID = 291, - STAIR_ID = 292, - NON_DIGGABLE_ID = 293, - NON_PASSWALL_ID = 294, - ROOM_ID = 295, - PORTAL_ID = 296, - TELEPRT_ID = 297, - BRANCH_ID = 298, - LEV = 299, - MINERALIZE_ID = 300, - CORRIDOR_ID = 301, - GOLD_ID = 302, - ENGRAVING_ID = 303, - FOUNTAIN_ID = 304, - POOL_ID = 305, - SINK_ID = 306, - NONE = 307, - RAND_CORRIDOR_ID = 308, - DOOR_STATE = 309, - LIGHT_STATE = 310, - CURSE_TYPE = 311, - ENGRAVING_TYPE = 312, - DIRECTION = 313, - RANDOM_TYPE = 314, - RANDOM_TYPE_BRACKET = 315, - A_REGISTER = 316, - ALIGNMENT = 317, - LEFT_OR_RIGHT = 318, - CENTER = 319, - TOP_OR_BOT = 320, - ALTAR_TYPE = 321, - UP_OR_DOWN = 322, - SUBROOM_ID = 323, - NAME_ID = 324, - FLAGS_ID = 325, - FLAG_TYPE = 326, - MON_ATTITUDE = 327, - MON_ALERTNESS = 328, - MON_APPEARANCE = 329, - ROOMDOOR_ID = 330, - IF_ID = 331, - ELSE_ID = 332, - TERRAIN_ID = 333, - HORIZ_OR_VERT = 334, - REPLACE_TERRAIN_ID = 335, - EXIT_ID = 336, - SHUFFLE_ID = 337, - QUANTITY_ID = 338, - BURIED_ID = 339, - LOOP_ID = 340, - FOR_ID = 341, - TO_ID = 342, - SWITCH_ID = 343, - CASE_ID = 344, - BREAK_ID = 345, - DEFAULT_ID = 346, - ERODED_ID = 347, - TRAPPED_STATE = 348, - RECHARGED_ID = 349, - INVIS_ID = 350, - GREASED_ID = 351, - FEMALE_ID = 352, - CANCELLED_ID = 353, - REVIVED_ID = 354, - AVENGE_ID = 355, - FLEEING_ID = 356, - BLINDED_ID = 357, - PARALYZED_ID = 358, - STUNNED_ID = 359, - CONFUSED_ID = 360, - SEENTRAPS_ID = 361, - ALL_ID = 362, - MONTYPE_ID = 363, - GRAVE_ID = 364, - ERODEPROOF_ID = 365, - FUNCTION_ID = 366, - MSG_OUTPUT_TYPE = 367, - COMPARE_TYPE = 368, - UNKNOWN_TYPE = 369, - rect_ID = 370, - fillrect_ID = 371, - line_ID = 372, - randline_ID = 373, - grow_ID = 374, - selection_ID = 375, - flood_ID = 376, - rndcoord_ID = 377, - circle_ID = 378, - ellipse_ID = 379, - filter_ID = 380, - complement_ID = 381, - gradient_ID = 382, - GRADIENT_TYPE = 383, - LIMITED = 384, - HUMIDITY_TYPE = 385, - STRING = 386, - MAP_ID = 387, - NQSTRING = 388, - VARSTRING = 389, - CFUNC = 390, - CFUNC_INT = 391, - CFUNC_STR = 392, - CFUNC_COORD = 393, - CFUNC_REGION = 394, - VARSTRING_INT = 395, - VARSTRING_INT_ARRAY = 396, - VARSTRING_STRING = 397, - VARSTRING_STRING_ARRAY = 398, - VARSTRING_VAR = 399, - VARSTRING_VAR_ARRAY = 400, - VARSTRING_COORD = 401, - VARSTRING_COORD_ARRAY = 402, - VARSTRING_REGION = 403, - VARSTRING_REGION_ARRAY = 404, - VARSTRING_MAPCHAR = 405, - VARSTRING_MAPCHAR_ARRAY = 406, - VARSTRING_MONST = 407, - VARSTRING_MONST_ARRAY = 408, - VARSTRING_OBJ = 409, - VARSTRING_OBJ_ARRAY = 410, - VARSTRING_SEL = 411, - VARSTRING_SEL_ARRAY = 412, - METHOD_INT = 413, - METHOD_INT_ARRAY = 414, - METHOD_STRING = 415, - METHOD_STRING_ARRAY = 416, - METHOD_VAR = 417, - METHOD_VAR_ARRAY = 418, - METHOD_COORD = 419, - METHOD_COORD_ARRAY = 420, - METHOD_REGION = 421, - METHOD_REGION_ARRAY = 422, - METHOD_MAPCHAR = 423, - METHOD_MAPCHAR_ARRAY = 424, - METHOD_MONST = 425, - METHOD_MONST_ARRAY = 426, - METHOD_OBJ = 427, - METHOD_OBJ_ARRAY = 428, - METHOD_SEL = 429, - METHOD_SEL_ARRAY = 430, - DICE = 431 - }; -#endif -/* Tokens. */ -#define CHAR 258 -#define INTEGER 259 -#define BOOLEAN 260 -#define PERCENT 261 -#define SPERCENT 262 -#define MINUS_INTEGER 263 -#define PLUS_INTEGER 264 -#define MAZE_GRID_ID 265 -#define SOLID_FILL_ID 266 -#define MINES_ID 267 -#define ROGUELEV_ID 268 -#define MESSAGE_ID 269 -#define MAZE_ID 270 -#define LEVEL_ID 271 -#define LEV_INIT_ID 272 -#define GEOMETRY_ID 273 -#define NOMAP_ID 274 -#define OBJECT_ID 275 -#define COBJECT_ID 276 -#define MONSTER_ID 277 -#define TRAP_ID 278 -#define DOOR_ID 279 -#define DRAWBRIDGE_ID 280 -#define object_ID 281 -#define monster_ID 282 -#define terrain_ID 283 -#define MAZEWALK_ID 284 -#define WALLIFY_ID 285 -#define REGION_ID 286 -#define FILLING 287 -#define IRREGULAR 288 -#define JOINED 289 -#define ALTAR_ID 290 -#define LADDER_ID 291 -#define STAIR_ID 292 -#define NON_DIGGABLE_ID 293 -#define NON_PASSWALL_ID 294 -#define ROOM_ID 295 -#define PORTAL_ID 296 -#define TELEPRT_ID 297 -#define BRANCH_ID 298 -#define LEV 299 -#define MINERALIZE_ID 300 -#define CORRIDOR_ID 301 -#define GOLD_ID 302 -#define ENGRAVING_ID 303 -#define FOUNTAIN_ID 304 -#define POOL_ID 305 -#define SINK_ID 306 -#define NONE 307 -#define RAND_CORRIDOR_ID 308 -#define DOOR_STATE 309 -#define LIGHT_STATE 310 -#define CURSE_TYPE 311 -#define ENGRAVING_TYPE 312 -#define DIRECTION 313 -#define RANDOM_TYPE 314 -#define RANDOM_TYPE_BRACKET 315 -#define A_REGISTER 316 -#define ALIGNMENT 317 -#define LEFT_OR_RIGHT 318 -#define CENTER 319 -#define TOP_OR_BOT 320 -#define ALTAR_TYPE 321 -#define UP_OR_DOWN 322 -#define SUBROOM_ID 323 -#define NAME_ID 324 -#define FLAGS_ID 325 -#define FLAG_TYPE 326 -#define MON_ATTITUDE 327 -#define MON_ALERTNESS 328 -#define MON_APPEARANCE 329 -#define ROOMDOOR_ID 330 -#define IF_ID 331 -#define ELSE_ID 332 -#define TERRAIN_ID 333 -#define HORIZ_OR_VERT 334 -#define REPLACE_TERRAIN_ID 335 -#define EXIT_ID 336 -#define SHUFFLE_ID 337 -#define QUANTITY_ID 338 -#define BURIED_ID 339 -#define LOOP_ID 340 -#define FOR_ID 341 -#define TO_ID 342 -#define SWITCH_ID 343 -#define CASE_ID 344 -#define BREAK_ID 345 -#define DEFAULT_ID 346 -#define ERODED_ID 347 -#define TRAPPED_STATE 348 -#define RECHARGED_ID 349 -#define INVIS_ID 350 -#define GREASED_ID 351 -#define FEMALE_ID 352 -#define CANCELLED_ID 353 -#define REVIVED_ID 354 -#define AVENGE_ID 355 -#define FLEEING_ID 356 -#define BLINDED_ID 357 -#define PARALYZED_ID 358 -#define STUNNED_ID 359 -#define CONFUSED_ID 360 -#define SEENTRAPS_ID 361 -#define ALL_ID 362 -#define MONTYPE_ID 363 -#define GRAVE_ID 364 -#define ERODEPROOF_ID 365 -#define FUNCTION_ID 366 -#define MSG_OUTPUT_TYPE 367 -#define COMPARE_TYPE 368 -#define UNKNOWN_TYPE 369 -#define rect_ID 370 -#define fillrect_ID 371 -#define line_ID 372 -#define randline_ID 373 -#define grow_ID 374 -#define selection_ID 375 -#define flood_ID 376 -#define rndcoord_ID 377 -#define circle_ID 378 -#define ellipse_ID 379 -#define filter_ID 380 -#define complement_ID 381 -#define gradient_ID 382 -#define GRADIENT_TYPE 383 -#define LIMITED 384 -#define HUMIDITY_TYPE 385 -#define STRING 386 -#define MAP_ID 387 -#define NQSTRING 388 -#define VARSTRING 389 -#define CFUNC 390 -#define CFUNC_INT 391 -#define CFUNC_STR 392 -#define CFUNC_COORD 393 -#define CFUNC_REGION 394 -#define VARSTRING_INT 395 -#define VARSTRING_INT_ARRAY 396 -#define VARSTRING_STRING 397 -#define VARSTRING_STRING_ARRAY 398 -#define VARSTRING_VAR 399 -#define VARSTRING_VAR_ARRAY 400 -#define VARSTRING_COORD 401 -#define VARSTRING_COORD_ARRAY 402 -#define VARSTRING_REGION 403 -#define VARSTRING_REGION_ARRAY 404 -#define VARSTRING_MAPCHAR 405 -#define VARSTRING_MAPCHAR_ARRAY 406 -#define VARSTRING_MONST 407 -#define VARSTRING_MONST_ARRAY 408 -#define VARSTRING_OBJ 409 -#define VARSTRING_OBJ_ARRAY 410 -#define VARSTRING_SEL 411 -#define VARSTRING_SEL_ARRAY 412 -#define METHOD_INT 413 -#define METHOD_INT_ARRAY 414 -#define METHOD_STRING 415 -#define METHOD_STRING_ARRAY 416 -#define METHOD_VAR 417 -#define METHOD_VAR_ARRAY 418 -#define METHOD_COORD 419 -#define METHOD_COORD_ARRAY 420 -#define METHOD_REGION 421 -#define METHOD_REGION_ARRAY 422 -#define METHOD_MAPCHAR 423 -#define METHOD_MAPCHAR_ARRAY 424 -#define METHOD_MONST 425 -#define METHOD_MONST_ARRAY 426 -#define METHOD_OBJ 427 -#define METHOD_OBJ_ARRAY 428 -#define METHOD_SEL 429 -#define METHOD_SEL_ARRAY 430 -#define DICE 431 - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; -union YYSTYPE +typedef union { -#line 147 "lev_comp.y" /* yacc.c:355 */ - long i; char* map; struct { @@ -635,1854 +189,2451 @@ union YYSTYPE long cfunc; char *varstr; } meth; - -#line 640 "y.tab.c" /* yacc.c:355 */ +} YYSTYPE; +#define CHAR 257 +#define INTEGER 258 +#define BOOLEAN 259 +#define PERCENT 260 +#define SPERCENT 261 +#define MINUS_INTEGER 262 +#define PLUS_INTEGER 263 +#define MAZE_GRID_ID 264 +#define SOLID_FILL_ID 265 +#define MINES_ID 266 +#define ROGUELEV_ID 267 +#define MESSAGE_ID 268 +#define MAZE_ID 269 +#define LEVEL_ID 270 +#define LEV_INIT_ID 271 +#define GEOMETRY_ID 272 +#define NOMAP_ID 273 +#define OBJECT_ID 274 +#define COBJECT_ID 275 +#define MONSTER_ID 276 +#define TRAP_ID 277 +#define DOOR_ID 278 +#define DRAWBRIDGE_ID 279 +#define object_ID 280 +#define monster_ID 281 +#define terrain_ID 282 +#define MAZEWALK_ID 283 +#define WALLIFY_ID 284 +#define REGION_ID 285 +#define FILLING 286 +#define IRREGULAR 287 +#define JOINED 288 +#define ALTAR_ID 289 +#define LADDER_ID 290 +#define STAIR_ID 291 +#define NON_DIGGABLE_ID 292 +#define NON_PASSWALL_ID 293 +#define ROOM_ID 294 +#define PORTAL_ID 295 +#define TELEPRT_ID 296 +#define BRANCH_ID 297 +#define LEV 298 +#define MINERALIZE_ID 299 +#define CORRIDOR_ID 300 +#define GOLD_ID 301 +#define ENGRAVING_ID 302 +#define FOUNTAIN_ID 303 +#define POOL_ID 304 +#define SINK_ID 305 +#define NONE 306 +#define RAND_CORRIDOR_ID 307 +#define DOOR_STATE 308 +#define LIGHT_STATE 309 +#define CURSE_TYPE 310 +#define ENGRAVING_TYPE 311 +#define DIRECTION 312 +#define RANDOM_TYPE 313 +#define RANDOM_TYPE_BRACKET 314 +#define A_REGISTER 315 +#define ALIGNMENT 316 +#define LEFT_OR_RIGHT 317 +#define CENTER 318 +#define TOP_OR_BOT 319 +#define ALTAR_TYPE 320 +#define UP_OR_DOWN 321 +#define SUBROOM_ID 322 +#define NAME_ID 323 +#define FLAGS_ID 324 +#define FLAG_TYPE 325 +#define MON_ATTITUDE 326 +#define MON_ALERTNESS 327 +#define MON_APPEARANCE 328 +#define ROOMDOOR_ID 329 +#define IF_ID 330 +#define ELSE_ID 331 +#define TERRAIN_ID 332 +#define HORIZ_OR_VERT 333 +#define REPLACE_TERRAIN_ID 334 +#define EXIT_ID 335 +#define SHUFFLE_ID 336 +#define QUANTITY_ID 337 +#define BURIED_ID 338 +#define LOOP_ID 339 +#define FOR_ID 340 +#define TO_ID 341 +#define SWITCH_ID 342 +#define CASE_ID 343 +#define BREAK_ID 344 +#define DEFAULT_ID 345 +#define ERODED_ID 346 +#define TRAPPED_STATE 347 +#define RECHARGED_ID 348 +#define INVIS_ID 349 +#define GREASED_ID 350 +#define FEMALE_ID 351 +#define CANCELLED_ID 352 +#define REVIVED_ID 353 +#define AVENGE_ID 354 +#define FLEEING_ID 355 +#define BLINDED_ID 356 +#define PARALYZED_ID 357 +#define STUNNED_ID 358 +#define CONFUSED_ID 359 +#define SEENTRAPS_ID 360 +#define ALL_ID 361 +#define MONTYPE_ID 362 +#define GRAVE_ID 363 +#define ERODEPROOF_ID 364 +#define FUNCTION_ID 365 +#define MSG_OUTPUT_TYPE 366 +#define COMPARE_TYPE 367 +#define UNKNOWN_TYPE 368 +#define rect_ID 369 +#define fillrect_ID 370 +#define line_ID 371 +#define randline_ID 372 +#define grow_ID 373 +#define selection_ID 374 +#define flood_ID 375 +#define rndcoord_ID 376 +#define circle_ID 377 +#define ellipse_ID 378 +#define filter_ID 379 +#define complement_ID 380 +#define gradient_ID 381 +#define GRADIENT_TYPE 382 +#define LIMITED 383 +#define HUMIDITY_TYPE 384 +#define STRING 385 +#define MAP_ID 386 +#define NQSTRING 387 +#define VARSTRING 388 +#define CFUNC 389 +#define CFUNC_INT 390 +#define CFUNC_STR 391 +#define CFUNC_COORD 392 +#define CFUNC_REGION 393 +#define VARSTRING_INT 394 +#define VARSTRING_INT_ARRAY 395 +#define VARSTRING_STRING 396 +#define VARSTRING_STRING_ARRAY 397 +#define VARSTRING_VAR 398 +#define VARSTRING_VAR_ARRAY 399 +#define VARSTRING_COORD 400 +#define VARSTRING_COORD_ARRAY 401 +#define VARSTRING_REGION 402 +#define VARSTRING_REGION_ARRAY 403 +#define VARSTRING_MAPCHAR 404 +#define VARSTRING_MAPCHAR_ARRAY 405 +#define VARSTRING_MONST 406 +#define VARSTRING_MONST_ARRAY 407 +#define VARSTRING_OBJ 408 +#define VARSTRING_OBJ_ARRAY 409 +#define VARSTRING_SEL 410 +#define VARSTRING_SEL_ARRAY 411 +#define METHOD_INT 412 +#define METHOD_INT_ARRAY 413 +#define METHOD_STRING 414 +#define METHOD_STRING_ARRAY 415 +#define METHOD_VAR 416 +#define METHOD_VAR_ARRAY 417 +#define METHOD_COORD 418 +#define METHOD_COORD_ARRAY 419 +#define METHOD_REGION 420 +#define METHOD_REGION_ARRAY 421 +#define METHOD_MAPCHAR 422 +#define METHOD_MAPCHAR_ARRAY 423 +#define METHOD_MONST 424 +#define METHOD_MONST_ARRAY 425 +#define METHOD_OBJ 426 +#define METHOD_OBJ_ARRAY 427 +#define METHOD_SEL 428 +#define METHOD_SEL_ARRAY 429 +#define DICE 430 +#define YYERRCODE 256 +short yylhs[] = { -1, + 0, 0, 73, 73, 74, 57, 57, 56, 56, 76, + 76, 76, 76, 55, 55, 54, 54, 46, 46, 14, + 14, 75, 75, 26, 26, 22, 22, 23, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 59, 59, 59, 59, 59, 59, 59, 59, + 59, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 60, 60, 60, 61, 61, 85, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 38, 38, 44, 44, 43, 43, 42, 42, 41, + 41, 39, 39, 40, 40, 129, 130, 100, 101, 98, + 45, 45, 31, 31, 31, 131, 133, 93, 134, 134, + 136, 135, 137, 135, 99, 138, 138, 139, 140, 94, + 141, 95, 142, 97, 144, 96, 143, 145, 143, 79, + 110, 110, 110, 83, 83, 65, 146, 147, 113, 148, + 112, 10, 10, 68, 68, 69, 69, 70, 70, 71, + 71, 87, 87, 15, 15, 13, 13, 16, 16, 11, + 11, 103, 103, 103, 1, 1, 2, 2, 105, 150, + 105, 149, 20, 20, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 35, 35, 35, 106, 152, 106, 151, 18, 18, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 120, 88, 104, 104, 121, 121, + 102, 117, 118, 109, 119, 82, 17, 17, 91, 114, + 108, 72, 72, 116, 115, 86, 107, 154, 111, 24, + 24, 80, 81, 81, 81, 92, 89, 90, 90, 3, + 3, 4, 4, 29, 29, 28, 28, 27, 27, 27, + 5, 5, 6, 6, 7, 7, 7, 12, 12, 12, + 8, 8, 9, 155, 155, 155, 132, 77, 77, 77, + 77, 32, 32, 32, 30, 30, 127, 127, 127, 33, + 124, 124, 124, 34, 34, 125, 125, 125, 36, 36, + 36, 36, 126, 126, 126, 37, 37, 37, 37, 123, + 123, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 50, 50, 157, 158, 158, 128, 128, 64, + 64, 63, 63, 62, 62, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 48, 48, 156, 47, 47, 47, + 153, 153, 153, 153, 51, 51, 52, 52, 53, 53, + 25, 25, 67, 67, 66, }; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE yylval; - -int yyparse (void); - -#endif /* !YY_YY_Y_TAB_H_INCLUDED */ - -/* Copy the second part of user declarations. */ - -#line 655 "y.tab.c" /* yacc.c:358 */ - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* 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 -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# 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 yyoverflow || YYERROR_VERBOSE - -/* 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 /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* 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 /* 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 || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; +short yylen[] = { 2, + 0, 1, 1, 2, 3, 3, 5, 1, 1, 5, + 5, 3, 16, 0, 2, 0, 2, 0, 2, 1, + 1, 0, 3, 3, 1, 0, 2, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 3, 5, 3, 5, + 5, 5, 3, 3, 5, 5, 5, 7, 7, 7, + 5, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 0, 0, 8, 4, 1, + 0, 1, 1, 5, 3, 0, 0, 9, 0, 2, + 0, 5, 0, 4, 1, 2, 1, 6, 0, 3, + 0, 6, 0, 4, 0, 4, 1, 0, 4, 3, + 1, 3, 3, 5, 5, 7, 4, 0, 10, 0, + 12, 0, 2, 5, 1, 5, 1, 5, 1, 5, + 1, 9, 5, 1, 1, 1, 1, 1, 3, 1, + 1, 1, 7, 5, 1, 1, 1, 1, 3, 0, + 5, 4, 0, 3, 1, 1, 1, 1, 2, 1, + 1, 1, 1, 1, 3, 3, 3, 1, 1, 3, + 1, 1, 3, 3, 0, 5, 2, 0, 3, 1, + 3, 1, 3, 3, 1, 1, 3, 1, 1, 1, + 3, 1, 1, 1, 5, 7, 5, 8, 1, 3, + 5, 5, 7, 7, 6, 5, 0, 2, 3, 3, + 3, 1, 5, 9, 5, 3, 3, 0, 10, 0, + 1, 7, 5, 5, 3, 5, 7, 9, 1, 1, + 1, 1, 1, 0, 2, 1, 3, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, + 4, 5, 1, 3, 1, 3, 1, 1, 4, 9, + 1, 1, 4, 1, 5, 1, 1, 4, 1, 1, + 5, 1, 1, 1, 4, 1, 1, 5, 1, 1, + 3, 1, 1, 3, 1, 4, 3, 3, 3, 3, + 3, 3, 1, 1, 3, 1, 3, 0, 1, 1, + 1, 1, 3, 0, 1, 1, 2, 2, 4, 6, + 4, 6, 6, 6, 6, 2, 6, 8, 8, 10, + 14, 2, 1, 3, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 10, 9, }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (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 \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*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, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_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 9 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1033 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 194 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 160 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 406 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 866 - -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 431 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ -static const yytype_uint8 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, 189, 193, 2, - 133, 134, 187, 185, 131, 186, 191, 188, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 132, 2, - 2, 190, 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, 135, 2, 136, 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, 137, 192, 138, 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, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 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, 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 +short yydefred[] = { 0, + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, + 4, 0, 6, 0, 133, 0, 0, 0, 192, 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, + 130, 0, 0, 0, 136, 145, 0, 0, 0, 0, + 93, 82, 73, 83, 74, 84, 75, 85, 76, 86, + 77, 87, 78, 88, 79, 89, 80, 90, 81, 5, + 0, 92, 91, 0, 30, 0, 29, 31, 32, 33, + 34, 35, 36, 37, 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, 149, + 0, 0, 23, 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, 155, 0, 0, 0, 0, 94, + 95, 0, 0, 0, 0, 342, 0, 345, 0, 387, + 0, 343, 0, 153, 0, 27, 0, 9, 8, 7, + 0, 304, 305, 0, 0, 340, 0, 0, 0, 12, + 313, 0, 195, 196, 0, 0, 310, 0, 0, 308, + 0, 337, 339, 0, 336, 334, 0, 333, 228, 224, + 225, 330, 332, 0, 329, 327, 0, 326, 0, 0, + 281, 280, 0, 291, 292, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 383, 250, 0, 366, 0, 318, 0, 317, 0, 0, + 0, 0, 0, 403, 0, 0, 266, 267, 283, 282, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 259, 261, 260, 390, 388, 389, 163, 162, + 0, 184, 185, 0, 0, 0, 0, 96, 0, 0, + 0, 0, 126, 0, 0, 0, 0, 135, 0, 0, + 0, 0, 0, 0, 0, 362, 0, 0, 0, 396, + 398, 395, 397, 399, 400, 0, 0, 0, 0, 0, + 0, 103, 0, 0, 104, 0, 150, 24, 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, 367, 368, 0, 0, 0, 376, 0, + 0, 0, 382, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 132, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 156, 0, 0, 151, 0, 0, 0, 0, 344, 352, + 0, 0, 0, 0, 349, 350, 351, 129, 0, 154, + 0, 0, 120, 118, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 341, 11, 262, 0, 10, + 0, 0, 314, 0, 0, 0, 198, 197, 0, 173, + 194, 0, 0, 0, 226, 0, 0, 203, 201, 245, + 183, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 324, 0, 0, 322, 0, 321, 0, 0, 0, 384, + 386, 0, 0, 293, 294, 0, 297, 0, 295, 0, + 296, 251, 0, 0, 0, 252, 0, 175, 0, 0, + 0, 0, 0, 256, 0, 0, 165, 164, 276, 401, + 402, 0, 177, 0, 0, 0, 0, 0, 265, 0, + 0, 147, 0, 0, 137, 274, 0, 0, 0, 356, + 0, 346, 134, 363, 98, 0, 0, 105, 0, 111, + 0, 106, 0, 107, 0, 102, 0, 101, 0, 100, + 28, 306, 0, 0, 316, 309, 0, 311, 0, 0, + 335, 393, 391, 392, 239, 236, 230, 0, 0, 235, + 0, 240, 0, 242, 243, 0, 238, 229, 244, 232, + 394, 0, 328, 0, 0, 0, 369, 0, 0, 0, + 371, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 319, 0, 0, 0, 0, 0, 0, 167, 0, 0, + 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, + 0, 0, 152, 146, 0, 0, 0, 127, 0, 0, + 0, 0, 121, 119, 112, 0, 114, 0, 116, 0, + 0, 0, 312, 193, 338, 0, 0, 0, 0, 0, + 331, 0, 246, 0, 0, 189, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 302, 301, + 272, 0, 0, 253, 0, 179, 0, 0, 254, 258, + 0, 0, 0, 0, 181, 0, 0, 187, 0, 186, + 159, 0, 0, 353, 354, 355, 0, 357, 0, 110, + 0, 109, 0, 108, 0, 0, 0, 234, 237, 241, + 231, 0, 298, 206, 207, 0, 211, 210, 212, 213, + 214, 0, 0, 0, 218, 219, 0, 299, 208, 204, + 0, 0, 248, 0, 372, 0, 377, 0, 373, 0, + 323, 374, 375, 0, 0, 0, 268, 303, 0, 0, + 0, 0, 0, 0, 190, 191, 0, 0, 0, 168, + 0, 0, 0, 0, 0, 0, 128, 113, 115, 117, + 263, 0, 0, 0, 0, 0, 0, 0, 19, 0, + 0, 325, 0, 0, 288, 289, 290, 0, 285, 0, + 0, 0, 174, 0, 0, 278, 166, 176, 0, 0, + 182, 264, 0, 143, 138, 140, 0, 300, 215, 216, + 217, 222, 0, 220, 378, 0, 379, 0, 0, 0, + 271, 269, 0, 0, 0, 170, 0, 169, 141, 0, + 0, 0, 0, 0, 0, 320, 287, 0, 405, 178, + 0, 180, 0, 144, 0, 223, 380, 15, 0, 404, + 171, 142, 0, 0, 0, 0, 20, 21, 0, 0, + 0, 13, 17, 381, }; - +short yydgoto[] = { 3, + 209, 449, 233, 271, 236, 486, 490, 671, 491, 351, + 757, 729, 689, 859, 294, 467, 614, 354, 578, 584, + 730, 80, 337, 822, 512, 133, 788, 789, 747, 345, + 81, 210, 258, 476, 814, 228, 218, 636, 425, 426, + 427, 428, 640, 638, 387, 733, 290, 375, 253, 696, + 329, 330, 331, 861, 835, 190, 4, 82, 83, 84, + 172, 314, 315, 316, 280, 264, 265, 500, 515, 678, + 687, 440, 5, 6, 10, 85, 254, 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, 277, 318, 478, 229, 219, 259, 529, 408, 697, + 173, 278, 626, 765, 766, 843, 830, 524, 130, 187, + 521, 319, 401, 295, 517, 272, 800, 841, 230, 359, + 220, 355, 580, 790, 196, 182, 530, 531, +}; +short yysindex[] = { 68, + 17, 31, 0, -217, 0, 68, -257, -226, 112, 5680, + 0, 136, 0, -136, 0, 170, 185, 201, 0, 225, + 229, 238, 244, 248, 251, 255, 266, 272, 275, 283, + 304, 309, 346, 366, 378, 380, 382, 383, 396, 397, + 398, 400, 401, 404, 405, 413, 415, -46, 417, 420, + 0, 426, 108, 489, 0, 0, 428, 101, -35, 449, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 432, 0, 0, 430, 0, 5680, 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, + -190, 450, 0, -234, 62, -13, 41, 41, 40, -252, + -121, 109, 109, 1644, -34, 109, 109, 92, -34, -34, + -249, -20, -20, -20, -35, 458, -35, 109, 1644, 1644, + 1644, -160, -249, -174, 0, 1644, -34, 288, -35, 0, + 0, 439, 414, 109, 467, 0, -22, 0, 421, 0, + -9, 0, -14, 0, 163, 0, 385, 0, 0, 0, + -136, 0, 0, 423, 465, 0, 471, 473, 475, 0, + 0, 137, 0, 0, 490, 271, 0, 441, 496, 0, + 503, 0, 0, 276, 0, 0, 452, 0, 0, 0, + 0, 0, 0, 292, 0, 0, 470, 0, 512, 0, + 0, 0, 518, 0, 0, 523, 524, 526, -34, -34, + 109, 109, 540, 109, 542, 544, 545, 1644, 548, 5537, + 0, 0, 533, 0, 331, 0, 500, 0, 555, 558, + 559, 564, 347, 0, 571, 582, 0, 0, 0, 0, + 367, 584, 379, 592, 594, 595, 141, 596, 402, 597, + 588, 611, 0, 0, 0, 0, 0, 0, 0, 0, + 617, 0, 0, 628, 385, 638, 640, 0, 593, -35, + -35, 644, 0, 649, 159, -35, -35, 0, -35, -35, + -35, -35, -35, 651, 650, 0, 141, 465, 5680, 0, + 0, 0, 0, 0, 0, 642, -1, 4, 643, 647, + 653, 0, 141, 465, 0, 5680, 0, 0, -35, -234, + 445, 14, 455, 654, 614, 1644, 678, -35, 38, 476, + 338, 682, -35, 688, 385, 690, -35, 109, 385, 109, + 1644, 424, 431, 0, 0, 694, 696, 1298, 0, 109, + 109, 5435, 0, 360, 704, 1644, 702, -35, -165, -83, + 429, 491, 703, -20, 433, 0, 707, -24, 708, -20, + -20, -20, -35, 709, 10, 109, -91, -19, -121, 0, + 0, 9, 9, 0, 45, 655, -254, 560, 0, 0, + 75, 148, 79, 79, 0, 0, 0, 0, -14, 0, + 1644, 711, 0, 0, 16, 25, 27, 29, 141, 465, + 22, -10, -28, 631, 427, 0, 0, 0, 501, 0, + 715, 137, 0, 719, 505, 459, 0, 0, 503, 0, + 0, 381, 499, 2, 0, 403, 508, 0, 0, 0, + 0, 721, 723, 109, 109, 662, 743, 748, 746, 749, + 0, 750, 5448, 0, 701, 0, 751, 752, 753, 0, + 0, 554, 536, 0, 0, 754, 0, 726, 0, 774, + 0, 0, 775, 579, 785, 0, -165, 0, 581, 796, + 583, 798, 800, 0, 802, 535, 0, 0, 0, 0, + 0, 804, 0, 591, 806, 807, 521, 598, 0, 810, + 385, 0, 811, -35, 0, 0, 465, 801, 815, 0, + 814, 0, 0, 0, 0, 604, -35, 0, -234, 0, + -21, 0, 824, 0, 57, 0, 98, 0, 23, 0, + 0, 0, 825, 621, 0, 0, 827, 0, 493, 839, + 0, 0, 0, 0, 0, 0, 0, 823, 826, 0, + 828, 0, 830, 0, 0, 832, 0, 0, 0, 0, + 0, 841, 0, 848, -121, 641, 0, 857, 590, 1644, + 0, -35, -35, 1644, 859, -35, 1644, 1644, 864, 861, + 0, -249, 648, -148, 652, 135, 586, 0, 867, -5, + 868, 528, 587, 0, -35, 870, -234, 871, 6, 72, + 385, 9, 0, 0, 141, 793, 1, 0, 560, 166, + 141, 465, 0, 0, 0, 32, 0, 33, 0, 35, + -165, 873, 0, 0, 0, -234, -35, -35, -35, 40, + 0, 5526, 0, 876, -35, 0, 880, 174, 686, 881, + -165, 569, 882, 883, -35, 685, 900, 852, 0, 0, + 0, 902, 691, 0, 693, 0, 110, 908, 0, 0, + 928, -184, 465, 716, 0, 717, 900, 0, 929, 0, + 0, 932, 90, 0, 0, 0, 385, 0, 57, 0, + 98, 0, 23, 0, 936, 722, 465, 0, 0, 0, + 0, 56, 0, 0, 0, -234, 0, 0, 0, 0, + 0, 920, 921, 924, 0, 0, 925, 0, 0, 0, + 465, 727, 0, 141, 0, 699, 0, -35, 0, 945, + 0, 0, 0, 481, 943, 59, 0, 0, 744, 957, + 965, 963, 6, -35, 0, 0, 967, 977, 982, 0, + -184, 767, -50, 971, 905, 90, 0, 0, 0, 0, + 0, 987, 724, 465, -35, -35, -35, -261, 0, 991, + 576, 0, -35, 777, 0, 0, 0, 989, 0, 385, + 992, 780, 0, 38, 900, 0, 0, 0, 781, 385, + 0, 0, 983, 0, 0, 0, 784, 0, 0, 0, + 0, 0, 916, 0, 0, 758, 0, 93, 1004, 59, + 0, 0, 788, 1006, 1007, 0, 1010, 0, 0, 5680, + 1009, -261, 1016, 675, 1020, 0, 0, 1025, 0, 0, + 385, 0, 5680, 0, -165, 0, 0, 0, 1023, 0, + 0, 0, 1024, 109, -149, 1026, 0, 0, 876, 109, + 1028, 0, 0, 0, +}; +short yyrindex[] = { 1071, + 0, 0, 0, 5225, 0, 1072, 0, 0, 0, 53, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 2985, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3174, 0, 0, + 0, 0, 0, 0, 3331, 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, 182, 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, 5382, 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, 0, 0, 0, + 0, 0, 1032, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3520, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 689, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1947, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 136, 0, 0, 0, 0, 0, 720, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3677, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1033, 0, 241, 247, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3866, 4023, 0, 951, 0, 0, 0, 0, + 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 2136, 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, 2293, + 0, 0, 0, 0, 0, 0, 0, 1037, 0, 0, + 0, 0, 374, 531, 0, 0, 0, 0, 0, 0, + 0, 553, 0, 0, 0, 0, 0, 0, 42, 49, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 689, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 4212, 0, 0, 1035, 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, 4369, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 4558, 0, 0, 0, + 1039, 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, 0, 0, 0, 0, + 0, 0, 0, 2482, 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, 958, 0, 0, 0, 0, 0, + 50, 52, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 4715, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 2639, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 4904, 0, 0, 0, 959, 0, 0, 0, + 0, 0, 961, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1444, 0, 0, 909, 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, 961, 0, 0, 0, 0, + 0, 0, 0, 1601, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 2828, 0, 5061, + 0, 0, 0, 0, 959, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1790, 0, 0, 0, 0, 128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, -69, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -69, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1043, 0, 0, 4715, 0, + 0, 0, 0, 0, +}; +short yygindex[] = { 0, + 410, 294, 0, 487, -329, -480, 0, 0, 438, 645, + 330, 0, 0, 0, 0, -474, 0, 0, 0, 0, + 0, -86, -287, 0, 0, 901, 0, 273, -629, 657, + 1047, -296, -297, -509, 264, -504, -494, 0, 0, 0, + 0, 0, 0, 0, 0, 242, -384, -137, 849, 0, + 0, 0, 0, 0, 0, 0, 0, 1046, 934, -371, + 0, 0, 0, 684, 710, 0, -48, 0, 0, 0, + 351, 0, 1100, 0, 0, 0, -133, 790, 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, -58, -130, -355, -375, 679, -84, 0, 0, 0, + 0, -167, 0, 345, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 949, 0, 0, 0, 0, + 975, 0, 0, 0, 792, 680, 504, 0, +}; +#define YYTABLESIZE 6091 +short yytable[] = { 186, + 181, 299, 211, 195, 177, 255, 252, 400, 237, 238, + 507, 518, 260, 261, 266, 499, 608, 177, 206, 273, + 514, 283, 284, 285, 282, 177, 206, 313, 296, 224, + 424, 423, 311, 309, 677, 310, 528, 312, 177, 639, + 302, 206, 637, 327, 59, 686, 519, 520, 518, 279, + 635, 332, 26, 439, 334, 26, 548, 760, 526, 537, + 231, 214, 518, 269, 267, 268, 188, 455, 539, 516, + 541, 459, 543, 755, 7, 699, 701, 550, 703, 224, + 214, 313, 297, 308, 292, 122, 311, 309, 8, 310, + 523, 312, 124, 123, 549, 125, 214, 286, 281, 812, + 335, 287, 288, 274, 275, 276, 9, 366, 367, 857, + 369, 313, 547, 773, 656, 313, 311, 309, 305, 310, + 311, 312, 189, 813, 317, 312, 333, 12, 756, 313, + 192, 263, 232, 406, 311, 270, 834, 224, 293, 312, + 538, 193, 194, 484, 545, 690, 603, 485, 206, 540, + 192, 542, 289, 544, 364, 365, 700, 702, 13, 704, + 705, 193, 194, 858, 669, 826, 122, 532, 14, 14, + 348, 670, 348, 124, 123, 643, 125, 313, 673, 131, + 740, 26, 311, 309, 313, 310, 234, 312, 132, 311, + 309, 235, 310, 770, 312, 313, 769, 430, 169, 410, + 311, 309, 327, 310, 768, 312, 643, 286, 444, 666, + 313, 287, 288, 15, 737, 311, 309, 736, 310, 510, + 312, 511, 176, 461, 458, 505, 460, 134, 471, 487, + 468, 488, 489, 623, 477, 176, 469, 470, 481, 304, + 533, 405, 135, 176, 633, 634, 222, 411, 412, 434, + 413, 414, 415, 416, 417, 653, 422, 528, 136, 562, + 304, 176, 509, 563, 564, 471, 692, 286, 305, 429, + 438, 287, 288, 26, 711, 26, 527, 262, 212, 471, + 435, 360, 137, 535, 360, 328, 138, 361, 498, 446, + 361, 201, 202, 513, 453, 139, 222, 212, 457, 201, + 202, 140, 223, 203, 204, 141, 26, 676, 142, 565, + 566, 567, 143, 212, 201, 202, 201, 202, 685, 483, + 579, 26, 26, 144, 568, 197, 198, 199, 200, 145, + 587, 588, 146, 691, 213, 495, 1, 2, 569, 570, + 147, 502, 503, 504, 785, 786, 787, 571, 572, 573, + 574, 575, 223, 213, 222, 447, 448, 307, 178, 179, + 317, 148, 205, 576, 853, 577, 149, 256, 257, 213, + 192, 178, 179, 347, 225, 474, 475, 205, 803, 178, + 179, 193, 194, 466, 688, 522, 207, 208, 192, 262, + 694, 695, 178, 179, 180, 226, 227, 178, 179, 193, + 194, 207, 208, 150, 201, 202, 215, 180, 632, 767, + 223, 347, 474, 475, 347, 180, 347, 347, 347, 347, + 176, 201, 202, 151, 225, 215, 203, 204, 180, 216, + 217, 180, 763, 180, 764, 152, 320, 153, 321, 154, + 155, 215, 322, 323, 324, 226, 227, 681, 216, 217, + 26, 26, 657, 156, 157, 158, 660, 159, 160, 663, + 664, 161, 162, 313, 347, 625, 347, 205, 311, 309, + 163, 310, 164, 312, 166, 201, 202, 167, 631, 708, + 709, 710, 225, 168, 205, 174, 683, 175, 183, 184, + 185, 207, 208, 191, 325, 313, 347, 279, 347, 300, + 311, 309, 821, 310, 301, 312, 303, 336, 207, 208, + 340, 306, 828, 339, 341, 707, 342, 313, 343, 552, + 344, 731, 311, 309, 26, 783, 26, 312, 347, 346, + 348, 348, 352, 658, 659, 313, 326, 662, 205, 349, + 311, 309, 353, 310, 313, 312, 350, 192, 356, 311, + 309, 558, 310, 851, 312, 358, 178, 179, 193, 194, + 357, 360, 207, 208, 256, 257, 361, 362, 348, 363, + 376, 348, 313, 348, 348, 348, 348, 311, 309, 368, + 310, 370, 312, 371, 372, 774, 796, 374, 377, 342, + 378, 561, 180, 342, 342, 342, 734, 342, 379, 342, + 583, 380, 381, 382, 383, 313, 744, 809, 810, 811, + 311, 309, 313, 310, 384, 312, 817, 311, 309, 816, + 310, 348, 312, 348, 313, 385, 386, 388, 601, 311, + 309, 396, 310, 347, 312, 390, 389, 391, 392, 393, + 395, 347, 347, 347, 347, 347, 347, 347, 347, 347, + 347, 347, 347, 348, 397, 348, 347, 347, 347, 394, + 398, 741, 347, 347, 347, 347, 347, 347, 347, 347, + 347, 399, 347, 347, 347, 347, 347, 347, 347, 781, + 347, 402, 63, 403, 65, 404, 67, 407, 69, 409, + 71, 418, 73, 419, 75, 347, 77, 442, 79, 421, + 431, 437, 347, 347, 432, 347, 443, 347, 347, 347, + 433, 441, 347, 347, 347, 347, 347, 347, 347, 307, + 856, 445, 313, 451, 818, 452, 863, 311, 309, 738, + 310, 454, 312, 456, 450, 462, 347, 464, 347, 465, + 347, 479, 463, 844, 480, 482, 494, 525, 493, 492, + 497, 501, 506, 496, 536, 551, 852, 553, 554, 556, + 347, 347, 557, 307, 585, 560, 586, 347, 347, 347, + 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + 347, 347, 347, 347, 347, 589, 590, 582, 591, 592, + 348, 596, 593, 594, 597, 598, 599, 602, 348, 348, + 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, + 307, 600, 307, 348, 348, 348, 603, 604, 605, 348, + 348, 348, 348, 348, 348, 348, 348, 348, 607, 348, + 348, 348, 348, 348, 348, 348, 606, 348, 609, 610, + 611, 612, 307, 613, 307, 615, 616, 617, 618, 619, + 620, 621, 348, 622, 595, 628, 624, 629, 627, 348, + 348, 630, 348, 255, 348, 348, 348, 643, 641, 348, + 348, 348, 348, 348, 348, 348, 170, 642, 644, 645, + 646, 651, 62, 647, 64, 648, 66, 649, 68, 650, + 70, 652, 72, 348, 74, 348, 76, 348, 78, 654, + 655, 466, 661, 665, 666, 668, 674, 680, 370, 672, + 675, 673, 679, 682, 684, 693, 706, 348, 348, 732, + 735, 739, 742, 743, 348, 348, 348, 348, 348, 348, + 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, + 348, 348, 745, 746, 748, 749, 370, 61, 750, 370, + 751, 753, 370, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 754, 761, 758, 759, 762, 771, 775, 776, 307, + 772, 777, 778, 779, 780, 782, 784, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 307, 370, + 792, 791, 307, 307, 307, 793, 794, 797, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 798, 307, 307, + 307, 307, 307, 307, 307, 799, 307, 802, 804, 805, + 807, 815, 820, 370, 819, 823, 808, 824, 827, 832, + 829, 307, 831, 833, 836, 838, 839, 840, 307, 307, + 842, 307, 845, 307, 307, 307, 847, 848, 307, 307, + 849, 307, 307, 307, 307, 850, 854, 855, 864, 860, + 1, 3, 364, 365, 172, 26, 315, 358, 188, 359, + 148, 284, 307, 16, 307, 139, 752, 825, 667, 728, + 801, 338, 837, 559, 165, 846, 373, 385, 555, 171, + 862, 298, 534, 795, 508, 11, 307, 307, 420, 546, + 806, 291, 221, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 436, 698, 581, 0, 0, 0, 0, 385, 0, + 0, 385, 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, 370, 0, + 0, 0, 0, 0, 0, 0, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 385, 0, + 0, 370, 370, 370, 0, 0, 0, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 0, 370, 370, 370, + 370, 370, 370, 370, 0, 370, 0, 0, 0, 0, + 0, 0, 385, 0, 0, 0, 0, 0, 0, 0, + 370, 0, 0, 0, 0, 0, 0, 370, 370, 0, + 370, 0, 370, 370, 370, 0, 0, 370, 370, 0, + 370, 370, 370, 370, 233, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 370, 0, 370, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 370, 370, 0, 233, 0, + 0, 0, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 250, 0, 0, + 0, 0, 0, 0, 0, 233, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 385, 0, 0, + 0, 0, 0, 0, 0, 385, 385, 385, 385, 385, + 385, 385, 385, 385, 385, 385, 385, 233, 0, 233, + 385, 385, 385, 0, 0, 0, 385, 385, 385, 385, + 385, 385, 385, 385, 385, 0, 385, 385, 385, 385, + 385, 385, 385, 0, 385, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 385, + 0, 0, 0, 0, 0, 0, 385, 385, 0, 385, + 0, 385, 385, 385, 0, 0, 385, 385, 0, 385, + 385, 385, 385, 205, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 385, 0, 385, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 385, 385, 0, 205, 0, 0, + 0, 385, 385, 385, 385, 385, 385, 385, 385, 385, + 385, 385, 385, 385, 385, 385, 385, 385, 385, 0, + 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, + 0, 0, 233, 233, 233, 233, 233, 233, 233, 233, + 233, 233, 233, 233, 205, 0, 0, 233, 233, 233, + 0, 0, 0, 233, 233, 233, 233, 233, 233, 233, + 233, 233, 0, 233, 233, 233, 233, 233, 233, 233, + 0, 233, 0, 0, 0, 0, 205, 0, 205, 0, + 0, 0, 0, 0, 0, 0, 233, 0, 0, 0, + 0, 0, 0, 233, 233, 0, 233, 0, 233, 233, + 233, 0, 0, 233, 233, 0, 233, 233, 233, 233, + 209, 0, 0, 0, 0, 0, 0, 0, 0, 466, + 201, 202, 0, 0, 0, 0, 0, 233, 0, 233, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 233, 233, 0, 209, 0, 0, 0, 233, 233, + 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, + 233, 233, 233, 233, 233, 233, 239, 240, 241, 242, + 243, 0, 244, 205, 245, 246, 247, 248, 249, 0, + 0, 0, 0, 250, 0, 0, 0, 0, 0, 0, + 0, 209, 0, 0, 0, 0, 0, 207, 208, 0, + 0, 0, 0, 205, 0, 0, 0, 251, 0, 0, + 0, 205, 205, 205, 205, 205, 205, 205, 205, 205, + 205, 205, 205, 209, 0, 209, 205, 205, 205, 0, + 0, 0, 205, 205, 205, 205, 205, 205, 205, 205, + 205, 0, 205, 205, 205, 205, 205, 205, 205, 0, + 205, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, + 0, 0, 205, 205, 0, 205, 0, 205, 205, 205, + 0, 0, 205, 205, 0, 205, 205, 205, 205, 221, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 205, 0, 205, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 205, 205, 0, 221, 0, 0, 0, 205, 205, 205, + 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, + 205, 205, 205, 205, 205, 0, 0, 0, 0, 0, + 209, 0, 0, 0, 0, 0, 0, 0, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 221, 0, 0, 209, 209, 209, 0, 0, 0, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 0, 209, + 209, 209, 209, 209, 209, 209, 0, 209, 0, 0, + 0, 0, 221, 0, 221, 0, 0, 0, 0, 0, + 0, 0, 209, 0, 0, 0, 0, 0, 0, 209, + 209, 0, 209, 0, 209, 209, 209, 0, 0, 209, + 209, 0, 209, 209, 209, 209, 199, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 201, 202, 0, 0, + 0, 0, 0, 209, 0, 209, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 209, 209, 0, + 0, 0, 0, 0, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 239, 240, 241, 242, 243, 0, 244, 205, + 245, 246, 247, 248, 249, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 199, 0, 0, + 0, 0, 0, 207, 208, 0, 0, 0, 0, 221, + 0, 0, 0, 251, 0, 0, 0, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 200, + 0, 199, 221, 221, 221, 0, 0, 0, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 0, 221, 221, + 221, 221, 221, 221, 221, 0, 221, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 221, 0, 0, 0, 0, 0, 0, 221, 221, + 0, 221, 0, 221, 221, 221, 0, 0, 221, 221, + 0, 221, 221, 221, 221, 227, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 221, 0, 221, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 221, 221, 0, 0, + 0, 0, 0, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 0, 0, 0, 0, 0, 199, 0, 0, 0, + 0, 0, 0, 0, 199, 199, 199, 199, 199, 199, + 199, 199, 199, 199, 199, 199, 227, 0, 0, 199, + 199, 199, 0, 0, 0, 199, 199, 199, 199, 199, + 199, 199, 199, 199, 0, 199, 199, 199, 199, 199, + 199, 199, 0, 199, 0, 0, 0, 0, 227, 0, + 227, 0, 0, 0, 0, 0, 0, 0, 199, 0, + 0, 0, 0, 0, 0, 199, 199, 0, 199, 0, + 199, 199, 199, 0, 0, 199, 199, 0, 199, 199, + 199, 199, 157, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, + 0, 199, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 199, 199, 0, 0, 0, 0, 0, + 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, + 199, 199, 199, 199, 199, 199, 199, 199, 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, 157, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 227, 0, 0, 0, 0, + 0, 0, 0, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 227, 227, 227, 0, 0, 157, 227, 227, + 227, 0, 0, 0, 227, 227, 227, 227, 227, 227, + 227, 227, 227, 0, 227, 227, 227, 227, 227, 227, + 227, 0, 227, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 227, 0, 0, + 0, 0, 0, 0, 227, 227, 0, 227, 0, 227, + 227, 227, 0, 0, 227, 227, 0, 227, 227, 227, + 227, 202, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 227, 0, + 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 227, 227, 0, 0, 0, 0, 0, 227, + 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 0, 0, 0, + 0, 0, 157, 0, 0, 0, 0, 0, 0, 0, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 202, 0, 0, 157, 157, 157, 0, 0, + 0, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 0, 157, 157, 157, 157, 157, 157, 157, 0, 157, + 0, 0, 0, 0, 202, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 157, 0, 0, 0, 0, 0, + 0, 157, 157, 158, 157, 0, 157, 157, 157, 0, + 0, 157, 157, 0, 157, 157, 157, 157, 284, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 157, 0, 157, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, + 157, 0, 0, 0, 0, 0, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 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, 284, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 202, 0, 0, 0, 0, 0, 0, 0, 202, + 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, + 202, 284, 0, 284, 202, 202, 202, 0, 0, 0, + 202, 202, 202, 202, 202, 202, 202, 202, 202, 0, + 202, 202, 202, 202, 202, 202, 202, 0, 202, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 202, 0, 0, 0, 0, 0, 0, + 202, 202, 0, 202, 0, 202, 202, 202, 0, 0, + 202, 202, 0, 202, 202, 202, 202, 286, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 202, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 202, 202, + 0, 0, 0, 0, 0, 202, 202, 202, 202, 202, + 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, + 202, 202, 202, 0, 0, 0, 0, 0, 284, 0, + 0, 0, 0, 0, 0, 0, 284, 284, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, 286, 0, + 0, 284, 284, 284, 0, 0, 0, 284, 284, 284, + 284, 284, 284, 284, 284, 284, 0, 284, 284, 284, + 284, 284, 284, 284, 0, 284, 0, 0, 0, 0, + 286, 0, 286, 0, 0, 0, 0, 0, 0, 0, + 284, 0, 0, 0, 0, 0, 0, 284, 284, 0, + 284, 0, 284, 284, 284, 0, 0, 284, 284, 0, + 284, 284, 284, 284, 249, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 284, 0, 284, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 284, 284, 0, 0, 0, + 0, 0, 284, 284, 284, 284, 284, 284, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, + 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, 249, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 286, 0, 0, + 0, 0, 0, 0, 0, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 0, 0, 249, + 286, 286, 286, 0, 0, 0, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 0, 286, 286, 286, 286, + 286, 286, 286, 0, 286, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 286, + 0, 0, 0, 0, 0, 0, 286, 286, 0, 286, + 0, 286, 286, 286, 0, 0, 286, 286, 0, 286, + 286, 286, 286, 279, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 286, 0, 286, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 286, 286, 0, 0, 0, 0, + 0, 286, 286, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 0, + 0, 0, 0, 0, 249, 0, 0, 0, 0, 0, + 0, 0, 249, 249, 249, 249, 249, 249, 249, 249, + 249, 249, 249, 249, 279, 0, 0, 249, 249, 249, + 0, 0, 0, 249, 249, 249, 249, 249, 249, 249, + 249, 249, 0, 249, 249, 249, 249, 249, 249, 249, + 0, 249, 0, 0, 0, 0, 0, 0, 279, 0, + 0, 0, 0, 0, 0, 0, 249, 0, 0, 0, + 0, 0, 0, 249, 249, 0, 249, 0, 249, 249, + 249, 0, 0, 249, 249, 0, 249, 249, 249, 249, + 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 249, 0, 249, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 249, 249, 0, 0, 0, 0, 0, 249, 249, + 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, + 249, 249, 249, 249, 249, 249, 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, 161, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 279, 0, 0, 0, 0, 0, 0, + 0, 279, 279, 279, 279, 279, 279, 279, 279, 279, + 279, 279, 279, 0, 0, 161, 279, 279, 279, 0, + 0, 0, 279, 279, 279, 279, 279, 279, 279, 279, + 279, 0, 279, 279, 279, 279, 279, 279, 279, 0, + 279, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 279, 0, 0, 0, 0, + 0, 0, 279, 279, 0, 279, 0, 279, 279, 279, + 0, 0, 279, 279, 0, 279, 279, 279, 279, 160, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 279, 0, 279, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 279, 279, 0, 0, 0, 0, 0, 279, 279, 279, + 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, + 279, 279, 279, 279, 279, 0, 0, 0, 0, 0, + 161, 0, 0, 0, 0, 0, 0, 0, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 160, 0, 0, 161, 161, 161, 0, 0, 0, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 0, 161, + 161, 161, 161, 161, 161, 161, 0, 161, 0, 0, + 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, + 0, 0, 161, 0, 0, 0, 0, 0, 0, 161, + 161, 0, 161, 0, 161, 161, 161, 0, 0, 161, + 161, 0, 161, 161, 161, 161, 275, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 161, 0, 161, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 161, 161, 0, + 0, 0, 0, 0, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 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, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, + 0, 0, 0, 0, 0, 0, 0, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 0, + 0, 275, 160, 160, 160, 0, 0, 0, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 0, 160, 160, + 160, 160, 160, 160, 160, 0, 160, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 160, 0, 0, 0, 0, 0, 0, 160, 160, + 0, 160, 0, 160, 160, 160, 0, 0, 160, 160, + 0, 160, 160, 160, 160, 97, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 160, 0, 160, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 160, 160, 0, 0, + 0, 0, 0, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 0, 0, 0, 0, 0, 275, 0, 0, 0, + 0, 0, 0, 0, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 97, 0, 0, 275, + 275, 275, 0, 0, 0, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 0, 275, 275, 275, 275, 275, + 275, 275, 0, 275, 0, 0, 0, 0, 0, 0, + 97, 0, 0, 0, 0, 0, 0, 0, 275, 0, + 0, 0, 0, 0, 0, 275, 275, 0, 275, 0, + 275, 275, 275, 0, 0, 275, 275, 0, 275, 275, + 275, 275, 99, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 275, + 0, 275, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 275, 275, 0, 0, 0, 0, 0, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 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, 99, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 0, 0, 0, + 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 0, 0, 99, 97, 97, + 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, + 97, 0, 97, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, + 0, 0, 0, 0, 97, 97, 0, 97, 0, 97, + 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, + 97, 247, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 97, 0, + 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 97, 97, 0, 0, 0, 0, 0, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, + 0, 0, 99, 0, 0, 0, 0, 0, 0, 0, + 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 247, 0, 0, 99, 99, 99, 0, 0, + 0, 99, 99, 99, 99, 99, 99, 99, 99, 99, + 0, 99, 99, 99, 99, 99, 99, 99, 0, 99, + 0, 0, 0, 0, 0, 0, 247, 0, 0, 0, + 0, 0, 0, 0, 99, 0, 0, 0, 0, 0, + 0, 99, 99, 0, 99, 0, 99, 99, 99, 0, + 0, 99, 99, 0, 99, 99, 99, 99, 257, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 99, 0, 99, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, + 99, 0, 0, 0, 0, 0, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 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, 257, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 247, 0, 0, 0, 0, 0, 0, 0, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 0, 0, 257, 247, 247, 247, 0, 0, 0, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 0, + 247, 247, 247, 247, 247, 247, 247, 0, 247, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 247, 0, 0, 0, 0, 0, 0, + 247, 247, 0, 247, 0, 247, 247, 247, 0, 0, + 247, 247, 0, 247, 247, 247, 247, 273, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 247, 0, 247, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, + 0, 0, 0, 0, 0, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 0, 0, 0, 0, 0, 257, 0, + 0, 0, 0, 0, 0, 0, 257, 257, 257, 257, + 257, 257, 257, 257, 257, 257, 257, 257, 273, 0, + 0, 257, 257, 257, 0, 0, 0, 257, 257, 257, + 257, 257, 257, 257, 257, 257, 0, 257, 257, 257, + 257, 257, 257, 257, 0, 257, 0, 0, 0, 0, + 0, 0, 273, 0, 0, 0, 0, 0, 0, 0, + 257, 0, 0, 0, 0, 0, 0, 257, 257, 0, + 257, 0, 257, 257, 257, 0, 0, 257, 257, 0, + 257, 257, 257, 257, 18, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 257, 0, 257, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 257, 257, 0, 0, 0, + 0, 0, 257, 257, 257, 257, 257, 257, 257, 257, + 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, + 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, 18, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 273, 0, 0, + 0, 0, 0, 0, 0, 273, 273, 273, 273, 273, + 273, 273, 273, 273, 273, 273, 273, 0, 0, 18, + 273, 273, 273, 0, 0, 0, 273, 273, 273, 273, + 273, 273, 273, 273, 273, 0, 273, 273, 273, 273, + 273, 273, 273, 0, 273, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 273, + 0, 0, 0, 0, 0, 0, 273, 273, 0, 273, + 0, 273, 273, 273, 0, 0, 273, 273, 0, 273, + 273, 273, 273, 277, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 273, 0, 273, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 273, 273, 0, 0, 0, 0, + 0, 273, 273, 273, 273, 273, 273, 273, 273, 273, + 273, 273, 273, 273, 273, 273, 273, 273, 273, 0, + 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, + 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 277, 0, 0, 18, 18, 18, + 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 0, 18, 18, 18, 18, 18, 18, 18, + 0, 18, 0, 0, 0, 0, 0, 0, 277, 0, + 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 18, 18, 0, 18, 0, 18, 18, + 18, 0, 0, 18, 18, 0, 18, 18, 18, 18, + 270, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 18, 0, 18, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 18, 18, 0, 0, 0, 0, 0, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 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, 270, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 277, 0, 0, 0, 0, 0, 0, + 0, 277, 277, 277, 277, 277, 277, 277, 277, 277, + 277, 277, 277, 0, 0, 270, 277, 277, 277, 0, + 0, 0, 277, 277, 277, 277, 277, 277, 277, 277, + 277, 0, 277, 277, 277, 277, 277, 277, 277, 0, + 277, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 22, 277, 0, 0, 0, 0, + 0, 0, 277, 277, 0, 277, 0, 277, 277, 277, + 0, 0, 277, 277, 0, 277, 277, 277, 277, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 277, 0, 277, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 277, 277, 0, 0, 0, 0, 0, 277, 277, 277, + 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, + 277, 277, 277, 277, 277, 22, 0, 0, 0, 0, + 270, 0, 0, 0, 0, 0, 0, 0, 270, 270, + 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, + 0, 0, 0, 270, 270, 270, 0, 0, 0, 270, + 270, 270, 270, 270, 270, 270, 270, 270, 0, 270, + 270, 270, 270, 270, 270, 270, 0, 270, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 25, 270, 0, 0, 0, 0, 0, 0, 270, + 270, 0, 270, 0, 270, 270, 270, 0, 0, 270, + 270, 0, 270, 270, 270, 270, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 270, 0, 270, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 270, 270, 0, + 0, 0, 0, 0, 270, 270, 270, 270, 270, 270, + 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, + 270, 270, 25, 0, 473, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 22, 0, 0, 250, 0, 0, + 0, 0, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 0, 0, 0, 22, 22, 22, + 0, 0, 0, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 0, 22, 22, 22, 22, 22, 22, 22, + 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, + 0, 0, 0, 22, 22, 0, 22, 0, 22, 22, + 22, 0, 0, 22, 22, 0, 22, 0, 22, 0, + 0, 0, 0, 0, 0, 0, 250, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 22, 0, 22, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 22, 22, 0, 0, 0, 0, 0, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 0, 0, 0, 0, + 0, 25, 0, 0, 0, 0, 0, 0, 0, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 0, 0, 0, 25, 25, 25, 0, 0, 0, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, + 25, 25, 25, 25, 25, 25, 25, 0, 25, 0, + 0, 471, 0, 0, 0, 472, 0, 0, 0, 0, + 0, 0, 0, 25, 595, 347, 0, 0, 0, 0, + 25, 25, 0, 25, 0, 25, 25, 25, 0, 0, + 25, 25, 0, 25, 0, 25, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 25, 0, 25, 201, 202, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 201, 202, 0, 0, 0, 0, 0, 0, 25, 25, + 59, 0, 0, 0, 0, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 0, 347, 0, 0, 0, 0, 0, + 0, 0, 0, 239, 240, 241, 242, 243, 0, 244, + 205, 245, 246, 247, 248, 249, 239, 240, 241, 242, + 243, 0, 244, 205, 245, 246, 247, 248, 249, 0, + 0, 0, 0, 0, 207, 208, 0, 0, 474, 475, + 712, 713, 0, 0, 251, 0, 0, 207, 208, 201, + 202, 714, 715, 716, 0, 0, 0, 251, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 717, 0, 718, 719, 720, 721, + 722, 723, 724, 725, 726, 727, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 239, 240, 241, 242, 243, + 192, 244, 205, 245, 246, 247, 248, 249, 0, 0, + 0, 193, 194, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 207, 208, 0, 15, + 0, 0, 0, 0, 0, 0, 251, 16, 0, 0, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, + 0, 0, 26, 27, 28, 0, 0, 0, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 0, 38, 39, + 40, 41, 42, 43, 44, 0, 45, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 46, 0, 0, 0, 0, 0, 0, 47, 48, + 0, 49, 0, 50, 51, 52, 0, 0, 53, 54, + 0, 55, 0, 56, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 57, 0, 58, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 60, 61, 0, 0, + 0, 0, 0, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, +}; +short yycheck[] = { 86, + 59, 169, 136, 134, 40, 40, 144, 295, 142, 143, + 395, 40, 146, 147, 148, 40, 497, 40, 40, 40, + 40, 159, 160, 161, 158, 40, 40, 37, 166, 40, + 328, 328, 42, 43, 40, 45, 408, 47, 40, 549, + 174, 40, 547, 40, 91, 40, 402, 403, 40, 40, + 545, 185, 0, 40, 185, 125, 432, 687, 313, 44, + 313, 40, 40, 313, 149, 150, 257, 355, 44, 399, + 44, 359, 44, 258, 58, 44, 44, 433, 44, 40, + 40, 37, 167, 93, 259, 44, 42, 43, 58, 45, + 46, 47, 44, 44, 123, 44, 40, 258, 157, 361, + 185, 262, 263, 152, 153, 154, 324, 241, 242, 259, + 244, 37, 123, 58, 589, 37, 42, 43, 177, 45, + 42, 47, 313, 385, 183, 47, 185, 385, 313, 37, + 385, 40, 385, 301, 42, 385, 44, 40, 313, 47, + 125, 396, 397, 309, 123, 620, 91, 313, 40, 125, + 385, 125, 313, 125, 239, 240, 125, 125, 385, 125, + 641, 396, 397, 313, 313, 795, 125, 93, 41, 58, + 43, 320, 45, 125, 125, 41, 125, 37, 44, 44, + 661, 0, 42, 43, 37, 45, 308, 47, 325, 42, + 43, 313, 45, 703, 47, 37, 701, 328, 91, 41, + 42, 43, 40, 45, 699, 47, 41, 258, 346, 44, + 37, 262, 263, 260, 41, 42, 43, 44, 45, 311, + 47, 313, 258, 361, 358, 393, 360, 58, 257, 313, + 368, 315, 316, 521, 372, 258, 370, 371, 376, 262, + 93, 300, 58, 258, 541, 543, 257, 306, 307, 336, + 309, 310, 311, 312, 313, 585, 258, 629, 58, 258, + 262, 258, 396, 262, 263, 257, 622, 258, 327, 328, + 257, 262, 263, 343, 650, 345, 407, 298, 257, 257, + 339, 41, 58, 421, 44, 123, 58, 41, 313, 348, + 44, 313, 314, 313, 353, 58, 257, 257, 357, 313, + 314, 58, 313, 317, 318, 58, 125, 313, 58, 308, + 309, 310, 58, 257, 313, 314, 313, 314, 313, 378, + 454, 269, 270, 58, 323, 264, 265, 266, 267, 58, + 464, 465, 58, 621, 313, 384, 269, 270, 337, 338, + 58, 390, 391, 392, 286, 287, 288, 346, 347, 348, + 349, 350, 313, 313, 257, 318, 319, 367, 394, 395, + 419, 58, 376, 362, 845, 364, 58, 402, 403, 313, + 385, 394, 395, 0, 385, 404, 405, 376, 763, 394, + 395, 396, 397, 312, 313, 341, 400, 401, 385, 298, + 390, 391, 394, 395, 430, 406, 407, 394, 395, 396, + 397, 400, 401, 58, 313, 314, 385, 430, 539, 697, + 313, 38, 404, 405, 41, 430, 43, 44, 45, 46, + 258, 313, 314, 58, 385, 385, 317, 318, 430, 408, + 409, 430, 343, 430, 345, 58, 274, 58, 276, 58, + 58, 385, 280, 281, 282, 406, 407, 615, 408, 409, + 269, 270, 590, 58, 58, 58, 594, 58, 58, 597, + 598, 58, 58, 37, 91, 524, 93, 376, 42, 43, + 58, 45, 58, 47, 58, 313, 314, 58, 537, 647, + 648, 649, 385, 58, 376, 58, 617, 387, 40, 58, + 61, 400, 401, 44, 332, 37, 123, 40, 125, 61, + 42, 43, 790, 45, 91, 47, 40, 123, 400, 401, + 46, 91, 800, 91, 44, 646, 44, 37, 44, 93, + 384, 652, 42, 43, 343, 45, 345, 47, 258, 40, + 0, 91, 257, 592, 593, 37, 374, 596, 376, 44, + 42, 43, 91, 45, 37, 47, 44, 385, 257, 42, + 43, 93, 45, 841, 47, 44, 394, 395, 396, 397, + 91, 44, 400, 401, 402, 403, 44, 44, 38, 44, + 38, 41, 37, 43, 44, 45, 46, 42, 43, 40, + 45, 40, 47, 40, 40, 716, 754, 40, 258, 37, + 91, 93, 430, 41, 42, 43, 655, 45, 44, 47, + 93, 44, 44, 40, 258, 37, 665, 775, 776, 777, + 42, 43, 37, 45, 44, 47, 41, 42, 43, 44, + 45, 91, 47, 93, 37, 44, 260, 44, 93, 42, + 43, 44, 45, 260, 47, 44, 258, 44, 44, 44, + 44, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 123, 44, 125, 283, 284, 285, 258, + 44, 93, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 44, 299, 300, 301, 302, 303, 304, 305, 738, + 307, 44, 395, 44, 397, 93, 399, 44, 401, 41, + 403, 41, 405, 44, 407, 322, 409, 44, 411, 58, + 58, 257, 329, 330, 58, 332, 93, 334, 335, 336, + 58, 257, 339, 340, 341, 342, 343, 344, 345, 0, + 854, 44, 37, 386, 783, 44, 860, 42, 43, 44, + 45, 44, 47, 44, 259, 312, 363, 44, 365, 44, + 367, 382, 312, 830, 41, 44, 44, 93, 258, 321, + 44, 44, 44, 321, 44, 125, 843, 257, 44, 41, + 387, 388, 258, 44, 44, 385, 44, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 124, 44, 385, 41, 44, + 260, 91, 44, 44, 44, 44, 44, 44, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 91, 258, 93, 283, 284, 285, 91, 44, 44, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 44, 299, + 300, 301, 302, 303, 304, 305, 258, 307, 258, 44, + 258, 44, 123, 44, 125, 44, 312, 44, 258, 44, + 44, 331, 322, 44, 257, 41, 46, 44, 58, 329, + 330, 258, 332, 40, 334, 335, 336, 41, 44, 339, + 340, 341, 342, 343, 344, 345, 388, 257, 386, 41, + 58, 41, 394, 58, 396, 58, 398, 58, 400, 58, + 402, 44, 404, 363, 406, 365, 408, 367, 410, 259, + 44, 312, 44, 40, 44, 258, 321, 321, 0, 258, + 44, 44, 385, 44, 44, 123, 44, 387, 388, 44, + 41, 41, 41, 41, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 258, 44, 93, 44, 38, 388, 258, 41, + 258, 44, 44, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 44, 44, 258, 258, 44, 41, 58, 58, 260, + 259, 58, 58, 257, 286, 41, 44, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 91, + 44, 258, 283, 284, 285, 41, 44, 41, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 41, 299, 300, + 301, 302, 303, 304, 305, 44, 307, 261, 58, 125, + 44, 41, 44, 125, 258, 44, 313, 258, 258, 124, + 58, 322, 259, 286, 41, 258, 41, 41, 329, 330, + 41, 332, 44, 334, 335, 336, 41, 383, 339, 340, + 41, 342, 343, 344, 345, 41, 44, 44, 41, 44, + 0, 0, 41, 41, 386, 125, 93, 41, 44, 41, + 123, 123, 363, 41, 365, 125, 677, 794, 602, 652, + 761, 191, 820, 449, 48, 832, 248, 0, 442, 54, + 859, 168, 419, 753, 395, 6, 387, 388, 319, 431, + 766, 163, 138, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 340, 629, 454, -1, -1, -1, -1, 41, -1, + -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 260, -1, + -1, -1, -1, -1, -1, -1, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 91, -1, + -1, 283, 284, 285, -1, -1, -1, 289, 290, 291, + 292, 293, 294, 295, 296, 297, -1, 299, 300, 301, + 302, 303, 304, 305, -1, 307, -1, -1, -1, -1, + -1, -1, 125, -1, -1, -1, -1, -1, -1, -1, + 322, -1, -1, -1, -1, -1, -1, 329, 330, -1, + 332, -1, 334, 335, 336, -1, -1, 339, 340, -1, + 342, 343, 344, 345, 0, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 363, -1, 365, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 387, 388, -1, 44, -1, + -1, -1, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, + -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 260, -1, -1, + -1, -1, -1, -1, -1, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 123, -1, 125, + 283, 284, 285, -1, -1, -1, 289, 290, 291, 292, + 293, 294, 295, 296, 297, -1, 299, 300, 301, 302, + 303, 304, 305, -1, 307, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 322, + -1, -1, -1, -1, -1, -1, 329, 330, -1, 332, + -1, 334, 335, 336, -1, -1, 339, 340, -1, 342, + 343, 344, 345, 0, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 363, -1, 365, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 387, 388, -1, 44, -1, -1, + -1, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, + -1, -1, -1, -1, 260, -1, -1, -1, -1, -1, + -1, -1, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 91, -1, -1, 283, 284, 285, + -1, -1, -1, 289, 290, 291, 292, 293, 294, 295, + 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, + -1, 307, -1, -1, -1, -1, 123, -1, 125, -1, + -1, -1, -1, -1, -1, -1, 322, -1, -1, -1, + -1, -1, -1, 329, 330, -1, 332, -1, 334, 335, + 336, -1, -1, 339, 340, -1, 342, 343, 344, 345, + 0, -1, -1, -1, -1, -1, -1, -1, -1, 312, + 313, 314, -1, -1, -1, -1, -1, 363, -1, 365, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 387, 388, -1, 44, -1, -1, -1, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 369, 370, 371, 372, + 373, -1, 375, 376, 377, 378, 379, 380, 381, -1, + -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, + -1, 91, -1, -1, -1, -1, -1, 400, 401, -1, + -1, -1, -1, 260, -1, -1, -1, 410, -1, -1, + -1, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 123, -1, 125, 283, 284, 285, -1, + -1, -1, 289, 290, 291, 292, 293, 294, 295, 296, + 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, + 307, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 322, -1, -1, -1, -1, + -1, -1, 329, 330, -1, 332, -1, 334, 335, 336, + -1, -1, 339, 340, -1, 342, 343, 344, 345, 0, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 363, -1, 365, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 387, 388, -1, 44, -1, -1, -1, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, -1, -1, -1, -1, -1, + 260, -1, -1, -1, -1, -1, -1, -1, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 91, -1, -1, 283, 284, 285, -1, -1, -1, 289, + 290, 291, 292, 293, 294, 295, 296, 297, -1, 299, + 300, 301, 302, 303, 304, 305, -1, 307, -1, -1, + -1, -1, 123, -1, 125, -1, -1, -1, -1, -1, + -1, -1, 322, -1, -1, -1, -1, -1, -1, 329, + 330, -1, 332, -1, 334, 335, 336, -1, -1, 339, + 340, -1, 342, 343, 344, 345, 0, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 313, 314, -1, -1, + -1, -1, -1, 363, -1, 365, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 387, 388, -1, + -1, -1, -1, -1, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 369, 370, 371, 372, 373, -1, 375, 376, + 377, 378, 379, 380, 381, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 91, -1, -1, + -1, -1, -1, 400, 401, -1, -1, -1, -1, 260, + -1, -1, -1, 410, -1, -1, -1, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 123, + -1, 125, 283, 284, 285, -1, -1, -1, 289, 290, + 291, 292, 293, 294, 295, 296, 297, -1, 299, 300, + 301, 302, 303, 304, 305, -1, 307, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 322, -1, -1, -1, -1, -1, -1, 329, 330, + -1, 332, -1, 334, 335, 336, -1, -1, 339, 340, + -1, 342, 343, 344, 345, 0, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 363, -1, 365, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 387, 388, -1, -1, + -1, -1, -1, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, -1, -1, -1, -1, -1, 260, -1, -1, -1, + -1, -1, -1, -1, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 91, -1, -1, 283, + 284, 285, -1, -1, -1, 289, 290, 291, 292, 293, + 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, + 304, 305, -1, 307, -1, -1, -1, -1, 123, -1, + 125, -1, -1, -1, -1, -1, -1, -1, 322, -1, + -1, -1, -1, -1, -1, 329, 330, -1, 332, -1, + 334, 335, 336, -1, -1, 339, 340, -1, 342, 343, + 344, 345, 0, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 363, + -1, 365, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 387, 388, -1, -1, -1, -1, -1, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 260, -1, -1, -1, -1, + -1, -1, -1, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, -1, -1, 125, 283, 284, + 285, -1, -1, -1, 289, 290, 291, 292, 293, 294, + 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, + 305, -1, 307, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 322, -1, -1, + -1, -1, -1, -1, 329, 330, -1, 332, -1, 334, + 335, 336, -1, -1, 339, 340, -1, 342, 343, 344, + 345, 0, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 363, -1, + 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 387, 388, -1, -1, -1, -1, -1, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, -1, -1, -1, + -1, -1, 260, -1, -1, -1, -1, -1, -1, -1, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 91, -1, -1, 283, 284, 285, -1, -1, + -1, 289, 290, 291, 292, 293, 294, 295, 296, 297, + -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, + -1, -1, -1, -1, 123, -1, 125, -1, -1, -1, + -1, -1, -1, -1, 322, -1, -1, -1, -1, -1, + -1, 329, 330, 331, 332, -1, 334, 335, 336, -1, + -1, 339, 340, -1, 342, 343, 344, 345, 0, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 363, -1, 365, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 387, + 388, -1, -1, -1, -1, -1, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 260, -1, -1, -1, -1, -1, -1, -1, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 123, -1, 125, 283, 284, 285, -1, -1, -1, + 289, 290, 291, 292, 293, 294, 295, 296, 297, -1, + 299, 300, 301, 302, 303, 304, 305, -1, 307, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 322, -1, -1, -1, -1, -1, -1, + 329, 330, -1, 332, -1, 334, 335, 336, -1, -1, + 339, 340, -1, 342, 343, 344, 345, 0, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 363, -1, 365, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 387, 388, + -1, -1, -1, -1, -1, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, -1, -1, -1, -1, -1, 260, -1, + -1, -1, -1, -1, -1, -1, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 91, -1, + -1, 283, 284, 285, -1, -1, -1, 289, 290, 291, + 292, 293, 294, 295, 296, 297, -1, 299, 300, 301, + 302, 303, 304, 305, -1, 307, -1, -1, -1, -1, + 123, -1, 125, -1, -1, -1, -1, -1, -1, -1, + 322, -1, -1, -1, -1, -1, -1, 329, 330, -1, + 332, -1, 334, 335, 336, -1, -1, 339, 340, -1, + 342, 343, 344, 345, 0, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 363, -1, 365, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 387, 388, -1, -1, -1, + -1, -1, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 260, -1, -1, + -1, -1, -1, -1, -1, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, -1, -1, 125, + 283, 284, 285, -1, -1, -1, 289, 290, 291, 292, + 293, 294, 295, 296, 297, -1, 299, 300, 301, 302, + 303, 304, 305, -1, 307, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 322, + -1, -1, -1, -1, -1, -1, 329, 330, -1, 332, + -1, 334, 335, 336, -1, -1, 339, 340, -1, 342, + 343, 344, 345, 0, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 363, -1, 365, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 387, 388, -1, -1, -1, -1, + -1, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, + -1, -1, -1, -1, 260, -1, -1, -1, -1, -1, + -1, -1, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 91, -1, -1, 283, 284, 285, + -1, -1, -1, 289, 290, 291, 292, 293, 294, 295, + 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, + -1, 307, -1, -1, -1, -1, -1, -1, 125, -1, + -1, -1, -1, -1, -1, -1, 322, -1, -1, -1, + -1, -1, -1, 329, 330, -1, 332, -1, 334, 335, + 336, -1, -1, 339, 340, -1, 342, 343, 344, 345, + 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 363, -1, 365, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 387, 388, -1, -1, -1, -1, -1, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 260, -1, -1, -1, -1, -1, -1, + -1, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, -1, -1, 125, 283, 284, 285, -1, + -1, -1, 289, 290, 291, 292, 293, 294, 295, 296, + 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, + 307, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 322, -1, -1, -1, -1, + -1, -1, 329, 330, -1, 332, -1, 334, 335, 336, + -1, -1, 339, 340, -1, 342, 343, 344, 345, 0, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 363, -1, 365, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 387, 388, -1, -1, -1, -1, -1, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, -1, -1, -1, -1, -1, + 260, -1, -1, -1, -1, -1, -1, -1, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 91, -1, -1, 283, 284, 285, -1, -1, -1, 289, + 290, 291, 292, 293, 294, 295, 296, 297, -1, 299, + 300, 301, 302, 303, 304, 305, -1, 307, -1, -1, + -1, -1, -1, -1, 125, -1, -1, -1, -1, -1, + -1, -1, 322, -1, -1, -1, -1, -1, -1, 329, + 330, -1, 332, -1, 334, 335, 336, -1, -1, 339, + 340, -1, 342, 343, 344, 345, 0, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 363, -1, 365, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 387, 388, -1, + -1, -1, -1, -1, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 91, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 260, + -1, -1, -1, -1, -1, -1, -1, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, + -1, 125, 283, 284, 285, -1, -1, -1, 289, 290, + 291, 292, 293, 294, 295, 296, 297, -1, 299, 300, + 301, 302, 303, 304, 305, -1, 307, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 322, -1, -1, -1, -1, -1, -1, 329, 330, + -1, 332, -1, 334, 335, 336, -1, -1, 339, 340, + -1, 342, 343, 344, 345, 0, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 363, -1, 365, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 387, 388, -1, -1, + -1, -1, -1, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, -1, -1, -1, -1, -1, 260, -1, -1, -1, + -1, -1, -1, -1, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 91, -1, -1, 283, + 284, 285, -1, -1, -1, 289, 290, 291, 292, 293, + 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, + 304, 305, -1, 307, -1, -1, -1, -1, -1, -1, + 125, -1, -1, -1, -1, -1, -1, -1, 322, -1, + -1, -1, -1, -1, -1, 329, 330, -1, 332, -1, + 334, 335, 336, -1, -1, 339, 340, -1, 342, 343, + 344, 345, 0, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 363, + -1, 365, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 387, 388, -1, -1, -1, -1, -1, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 260, -1, -1, -1, -1, + -1, -1, -1, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, -1, -1, 125, 283, 284, + 285, -1, -1, -1, 289, 290, 291, 292, 293, 294, + 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, + 305, -1, 307, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 322, -1, -1, + -1, -1, -1, -1, 329, 330, -1, 332, -1, 334, + 335, 336, -1, -1, 339, 340, -1, 342, 343, 344, + 345, 0, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 363, -1, + 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 387, 388, -1, -1, -1, -1, -1, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, -1, -1, -1, + -1, -1, 260, -1, -1, -1, -1, -1, -1, -1, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 91, -1, -1, 283, 284, 285, -1, -1, + -1, 289, 290, 291, 292, 293, 294, 295, 296, 297, + -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, + -1, -1, -1, -1, -1, -1, 125, -1, -1, -1, + -1, -1, -1, -1, 322, -1, -1, -1, -1, -1, + -1, 329, 330, -1, 332, -1, 334, 335, 336, -1, + -1, 339, 340, -1, 342, 343, 344, 345, 0, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 363, -1, 365, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 387, + 388, -1, -1, -1, -1, -1, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 260, -1, -1, -1, -1, -1, -1, -1, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, -1, -1, 125, 283, 284, 285, -1, -1, -1, + 289, 290, 291, 292, 293, 294, 295, 296, 297, -1, + 299, 300, 301, 302, 303, 304, 305, -1, 307, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 322, -1, -1, -1, -1, -1, -1, + 329, 330, -1, 332, -1, 334, 335, 336, -1, -1, + 339, 340, -1, 342, 343, 344, 345, 0, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 363, -1, 365, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 387, 388, + -1, -1, -1, -1, -1, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, -1, -1, -1, -1, -1, 260, -1, + -1, -1, -1, -1, -1, -1, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 91, -1, + -1, 283, 284, 285, -1, -1, -1, 289, 290, 291, + 292, 293, 294, 295, 296, 297, -1, 299, 300, 301, + 302, 303, 304, 305, -1, 307, -1, -1, -1, -1, + -1, -1, 125, -1, -1, -1, -1, -1, -1, -1, + 322, -1, -1, -1, -1, -1, -1, 329, 330, -1, + 332, -1, 334, 335, 336, -1, -1, 339, 340, -1, + 342, 343, 344, 345, 0, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 363, -1, 365, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 387, 388, -1, -1, -1, + -1, -1, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 260, -1, -1, + -1, -1, -1, -1, -1, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, -1, -1, 125, + 283, 284, 285, -1, -1, -1, 289, 290, 291, 292, + 293, 294, 295, 296, 297, -1, 299, 300, 301, 302, + 303, 304, 305, -1, 307, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 322, + -1, -1, -1, -1, -1, -1, 329, 330, -1, 332, + -1, 334, 335, 336, -1, -1, 339, 340, -1, 342, + 343, 344, 345, 0, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 363, -1, 365, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 387, 388, -1, -1, -1, -1, + -1, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, + -1, -1, -1, -1, 260, -1, -1, -1, -1, -1, + -1, -1, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 91, -1, -1, 283, 284, 285, + -1, -1, -1, 289, 290, 291, 292, 293, 294, 295, + 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, + -1, 307, -1, -1, -1, -1, -1, -1, 125, -1, + -1, -1, -1, -1, -1, -1, 322, -1, -1, -1, + -1, -1, -1, 329, 330, -1, 332, -1, 334, 335, + 336, -1, -1, 339, 340, -1, 342, 343, 344, 345, + 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 363, -1, 365, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 387, 388, -1, -1, -1, -1, -1, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 260, -1, -1, -1, -1, -1, -1, + -1, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, -1, -1, 125, 283, 284, 285, -1, + -1, -1, 289, 290, 291, 292, 293, 294, 295, 296, + 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, + 307, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 0, 322, -1, -1, -1, -1, + -1, -1, 329, 330, -1, 332, -1, 334, 335, 336, + -1, -1, 339, 340, -1, 342, 343, 344, 345, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 363, -1, 365, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 387, 388, -1, -1, -1, -1, -1, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 91, -1, -1, -1, -1, + 260, -1, -1, -1, -1, -1, -1, -1, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + -1, -1, -1, 283, 284, 285, -1, -1, -1, 289, + 290, 291, 292, 293, 294, 295, 296, 297, -1, 299, + 300, 301, 302, 303, 304, 305, -1, 307, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 0, 322, -1, -1, -1, -1, -1, -1, 329, + 330, -1, 332, -1, 334, 335, 336, -1, -1, 339, + 340, -1, 342, 343, 344, 345, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 363, -1, 365, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 387, 388, -1, + -1, -1, -1, -1, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 91, -1, 40, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 260, -1, -1, 40, -1, -1, + -1, -1, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, -1, -1, -1, 283, 284, 285, + -1, -1, -1, 289, 290, 291, 292, 293, 294, 295, + 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, + -1, 307, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 322, -1, -1, -1, + -1, -1, -1, 329, 330, -1, 332, -1, 334, 335, + 336, -1, -1, 339, 340, -1, 342, -1, 344, -1, + -1, -1, -1, -1, -1, -1, 40, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 363, -1, 365, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 387, 388, -1, -1, -1, -1, -1, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, -1, -1, -1, -1, + -1, 260, -1, -1, -1, -1, -1, -1, -1, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, -1, -1, -1, 283, 284, 285, -1, -1, -1, + 289, 290, 291, 292, 293, 294, 295, 296, 297, -1, + 299, 300, 301, 302, 303, 304, 305, -1, 307, -1, + -1, 257, -1, -1, -1, 261, -1, -1, -1, -1, + -1, -1, -1, 322, 257, 258, -1, -1, -1, -1, + 329, 330, -1, 332, -1, 334, 335, 336, -1, -1, + 339, 340, -1, 342, -1, 344, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 363, -1, 365, 313, 314, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 313, 314, -1, -1, -1, -1, -1, -1, 387, 388, + 91, -1, -1, -1, -1, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, -1, 258, -1, -1, -1, -1, -1, + -1, -1, -1, 369, 370, 371, 372, 373, -1, 375, + 376, 377, 378, 379, 380, 381, 369, 370, 371, 372, + 373, -1, 375, 376, 377, 378, 379, 380, 381, -1, + -1, -1, -1, -1, 400, 401, -1, -1, 404, 405, + 315, 316, -1, -1, 410, -1, -1, 400, 401, 313, + 314, 326, 327, 328, -1, -1, -1, 410, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 349, -1, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 369, 370, 371, 372, 373, + 385, 375, 376, 377, 378, 379, 380, 381, -1, -1, + -1, 396, 397, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 400, 401, -1, 260, + -1, -1, -1, -1, -1, -1, 410, 268, -1, -1, + 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, + -1, -1, 283, 284, 285, -1, -1, -1, 289, 290, + 291, 292, 293, 294, 295, 296, 297, -1, 299, 300, + 301, 302, 303, 304, 305, -1, 307, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 322, -1, -1, -1, -1, -1, -1, 329, 330, + -1, 332, -1, 334, 335, 336, -1, -1, 339, 340, + -1, 342, -1, 344, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 363, -1, 365, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 387, 388, -1, -1, + -1, -1, -1, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, +}; +#define YYFINAL 3 +#ifndef YYDEBUG +#define YYDEBUG 0 +#endif +#define YYMAXTOKEN 430 #if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 274, 274, 275, 278, 279, 282, 304, 309, 330, - 334, 340, 350, 361, 367, 396, 399, 406, 410, 417, - 420, 427, 428, 432, 435, 441, 445, 452, 455, 461, - 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 513, 514, 515, 516, 517, 518, - 519, 520, 521, 524, 525, 526, 527, 528, 529, 530, - 531, 532, 535, 536, 537, 540, 541, 544, 556, 562, - 568, 574, 580, 586, 592, 598, 604, 612, 620, 628, - 636, 644, 652, 662, 667, 674, 679, 686, 691, 698, - 702, 708, 713, 720, 724, 730, 734, 741, 763, 740, - 777, 825, 832, 835, 841, 848, 852, 861, 865, 860, - 927, 928, 932, 931, 944, 943, 958, 968, 969, 972, - 1011, 1010, 1044, 1043, 1073, 1072, 1103, 1102, 1128, 1137, - 1136, 1163, 1169, 1174, 1179, 1186, 1193, 1202, 1210, 1222, - 1221, 1240, 1239, 1258, 1261, 1267, 1277, 1283, 1292, 1298, - 1303, 1309, 1314, 1320, 1331, 1337, 1338, 1341, 1342, 1345, - 1349, 1355, 1356, 1359, 1366, 1374, 1382, 1383, 1386, 1387, - 1390, 1395, 1394, 1408, 1415, 1421, 1429, 1434, 1440, 1446, - 1452, 1458, 1463, 1468, 1473, 1478, 1483, 1488, 1493, 1498, - 1503, 1508, 1516, 1524, 1528, 1541, 1548, 1547, 1563, 1573, - 1579, 1587, 1593, 1598, 1603, 1608, 1613, 1618, 1623, 1628, - 1633, 1644, 1649, 1654, 1659, 1664, 1671, 1677, 1706, 1711, - 1719, 1725, 1731, 1738, 1745, 1755, 1765, 1780, 1791, 1794, - 1800, 1806, 1812, 1818, 1823, 1830, 1837, 1843, 1849, 1856, - 1855, 1880, 1883, 1889, 1896, 1900, 1905, 1912, 1918, 1925, - 1929, 1936, 1944, 1947, 1957, 1961, 1964, 1970, 1974, 1981, - 1985, 1989, 1995, 1996, 1999, 2000, 2003, 2004, 2005, 2011, - 2012, 2013, 2019, 2020, 2023, 2032, 2037, 2044, 2054, 2060, - 2064, 2068, 2075, 2084, 2090, 2094, 2100, 2104, 2112, 2116, - 2123, 2132, 2143, 2147, 2154, 2163, 2172, 2183, 2187, 2194, - 2203, 2213, 2222, 2232, 2238, 2242, 2249, 2258, 2268, 2277, - 2287, 2294, 2295, 2301, 2305, 2309, 2313, 2321, 2330, 2334, - 2338, 2342, 2346, 2350, 2353, 2360, 2369, 2397, 2398, 2401, - 2402, 2405, 2409, 2416, 2423, 2434, 2437, 2445, 2449, 2453, - 2457, 2461, 2466, 2470, 2474, 2479, 2484, 2489, 2493, 2498, - 2503, 2507, 2511, 2516, 2520, 2527, 2533, 2537, 2543, 2550, - 2551, 2552, 2555, 2559, 2563, 2567, 2573, 2574, 2577, 2578, - 2581, 2582, 2585, 2586, 2589, 2593, 2611 +char *yyname[] = { +"end-of-file",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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"CHAR","INTEGER","BOOLEAN","PERCENT", +"SPERCENT","MINUS_INTEGER","PLUS_INTEGER","MAZE_GRID_ID","SOLID_FILL_ID", +"MINES_ID","ROGUELEV_ID","MESSAGE_ID","MAZE_ID","LEVEL_ID","LEV_INIT_ID", +"GEOMETRY_ID","NOMAP_ID","OBJECT_ID","COBJECT_ID","MONSTER_ID","TRAP_ID", +"DOOR_ID","DRAWBRIDGE_ID","object_ID","monster_ID","terrain_ID","MAZEWALK_ID", +"WALLIFY_ID","REGION_ID","FILLING","IRREGULAR","JOINED","ALTAR_ID","LADDER_ID", +"STAIR_ID","NON_DIGGABLE_ID","NON_PASSWALL_ID","ROOM_ID","PORTAL_ID", +"TELEPRT_ID","BRANCH_ID","LEV","MINERALIZE_ID","CORRIDOR_ID","GOLD_ID", +"ENGRAVING_ID","FOUNTAIN_ID","POOL_ID","SINK_ID","NONE","RAND_CORRIDOR_ID", +"DOOR_STATE","LIGHT_STATE","CURSE_TYPE","ENGRAVING_TYPE","DIRECTION", +"RANDOM_TYPE","RANDOM_TYPE_BRACKET","A_REGISTER","ALIGNMENT","LEFT_OR_RIGHT", +"CENTER","TOP_OR_BOT","ALTAR_TYPE","UP_OR_DOWN","SUBROOM_ID","NAME_ID", +"FLAGS_ID","FLAG_TYPE","MON_ATTITUDE","MON_ALERTNESS","MON_APPEARANCE", +"ROOMDOOR_ID","IF_ID","ELSE_ID","TERRAIN_ID","HORIZ_OR_VERT", +"REPLACE_TERRAIN_ID","EXIT_ID","SHUFFLE_ID","QUANTITY_ID","BURIED_ID","LOOP_ID", +"FOR_ID","TO_ID","SWITCH_ID","CASE_ID","BREAK_ID","DEFAULT_ID","ERODED_ID", +"TRAPPED_STATE","RECHARGED_ID","INVIS_ID","GREASED_ID","FEMALE_ID", +"CANCELLED_ID","REVIVED_ID","AVENGE_ID","FLEEING_ID","BLINDED_ID", +"PARALYZED_ID","STUNNED_ID","CONFUSED_ID","SEENTRAPS_ID","ALL_ID","MONTYPE_ID", +"GRAVE_ID","ERODEPROOF_ID","FUNCTION_ID","MSG_OUTPUT_TYPE","COMPARE_TYPE", +"UNKNOWN_TYPE","rect_ID","fillrect_ID","line_ID","randline_ID","grow_ID", +"selection_ID","flood_ID","rndcoord_ID","circle_ID","ellipse_ID","filter_ID", +"complement_ID","gradient_ID","GRADIENT_TYPE","LIMITED","HUMIDITY_TYPE", +"STRING","MAP_ID","NQSTRING","VARSTRING","CFUNC","CFUNC_INT","CFUNC_STR", +"CFUNC_COORD","CFUNC_REGION","VARSTRING_INT","VARSTRING_INT_ARRAY", +"VARSTRING_STRING","VARSTRING_STRING_ARRAY","VARSTRING_VAR", +"VARSTRING_VAR_ARRAY","VARSTRING_COORD","VARSTRING_COORD_ARRAY", +"VARSTRING_REGION","VARSTRING_REGION_ARRAY","VARSTRING_MAPCHAR", +"VARSTRING_MAPCHAR_ARRAY","VARSTRING_MONST","VARSTRING_MONST_ARRAY", +"VARSTRING_OBJ","VARSTRING_OBJ_ARRAY","VARSTRING_SEL","VARSTRING_SEL_ARRAY", +"METHOD_INT","METHOD_INT_ARRAY","METHOD_STRING","METHOD_STRING_ARRAY", +"METHOD_VAR","METHOD_VAR_ARRAY","METHOD_COORD","METHOD_COORD_ARRAY", +"METHOD_REGION","METHOD_REGION_ARRAY","METHOD_MAPCHAR","METHOD_MAPCHAR_ARRAY", +"METHOD_MONST","METHOD_MONST_ARRAY","METHOD_OBJ","METHOD_OBJ_ARRAY", +"METHOD_SEL","METHOD_SEL_ARRAY","DICE", +}; +char *yyrule[] = { +"$accept : file", +"file :", +"file : levels", +"levels : level", +"levels : level levels", +"level : level_def flags levstatements", +"level_def : LEVEL_ID ':' STRING", +"level_def : MAZE_ID ':' STRING ',' mazefiller", +"mazefiller : RANDOM_TYPE", +"mazefiller : CHAR", +"lev_init : LEV_INIT_ID ':' SOLID_FILL_ID ',' terrain_type", +"lev_init : LEV_INIT_ID ':' MAZE_GRID_ID ',' CHAR", +"lev_init : LEV_INIT_ID ':' ROGUELEV_ID", +"lev_init : LEV_INIT_ID ':' MINES_ID ',' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled opt_fillchar", +"opt_limited :", +"opt_limited : ',' LIMITED", +"opt_coord_or_var :", +"opt_coord_or_var : ',' coord_or_var", +"opt_fillchar :", +"opt_fillchar : ',' CHAR", +"walled : BOOLEAN", +"walled : RANDOM_TYPE", +"flags :", +"flags : FLAGS_ID ':' flag_list", +"flag_list : FLAG_TYPE ',' flag_list", +"flag_list : FLAG_TYPE", +"levstatements :", +"levstatements : levstatement levstatements", +"stmt_block : '{' levstatements '}'", +"levstatement : message", +"levstatement : lev_init", +"levstatement : altar_detail", +"levstatement : grave_detail", +"levstatement : branch_region", +"levstatement : corridor", +"levstatement : variable_define", +"levstatement : shuffle_detail", +"levstatement : diggable_detail", +"levstatement : door_detail", +"levstatement : drawbridge_detail", +"levstatement : engraving_detail", +"levstatement : mineralize", +"levstatement : fountain_detail", +"levstatement : gold_detail", +"levstatement : switchstatement", +"levstatement : forstatement", +"levstatement : loopstatement", +"levstatement : ifstatement", +"levstatement : chancestatement", +"levstatement : exitstatement", +"levstatement : breakstatement", +"levstatement : function_define", +"levstatement : function_call", +"levstatement : ladder_detail", +"levstatement : map_definition", +"levstatement : mazewalk_detail", +"levstatement : monster_detail", +"levstatement : object_detail", +"levstatement : passwall_detail", +"levstatement : pool_detail", +"levstatement : portal_region", +"levstatement : random_corridors", +"levstatement : region_detail", +"levstatement : room_def", +"levstatement : subroom_def", +"levstatement : sink_detail", +"levstatement : terrain_detail", +"levstatement : replace_terrain_detail", +"levstatement : stair_detail", +"levstatement : stair_region", +"levstatement : teleprt_region", +"levstatement : trap_detail", +"levstatement : wallify_detail", +"any_var_array : VARSTRING_INT_ARRAY", +"any_var_array : VARSTRING_STRING_ARRAY", +"any_var_array : VARSTRING_VAR_ARRAY", +"any_var_array : VARSTRING_COORD_ARRAY", +"any_var_array : VARSTRING_REGION_ARRAY", +"any_var_array : VARSTRING_MAPCHAR_ARRAY", +"any_var_array : VARSTRING_MONST_ARRAY", +"any_var_array : VARSTRING_OBJ_ARRAY", +"any_var_array : VARSTRING_SEL_ARRAY", +"any_var : VARSTRING_INT", +"any_var : VARSTRING_STRING", +"any_var : VARSTRING_VAR", +"any_var : VARSTRING_COORD", +"any_var : VARSTRING_REGION", +"any_var : VARSTRING_MAPCHAR", +"any_var : VARSTRING_MONST", +"any_var : VARSTRING_OBJ", +"any_var : VARSTRING_SEL", +"any_var_or_arr : any_var_array", +"any_var_or_arr : any_var", +"any_var_or_arr : VARSTRING", +"any_var_or_unk : VARSTRING", +"any_var_or_unk : any_var", +"shuffle_detail : SHUFFLE_ID ':' any_var_array", +"variable_define : any_var_or_arr '=' math_expr_var", +"variable_define : any_var_or_arr '=' selection_ID ':' ter_selection", +"variable_define : any_var_or_arr '=' string_expr", +"variable_define : any_var_or_arr '=' terrainid ':' mapchar_or_var", +"variable_define : any_var_or_arr '=' monsterid ':' monster_or_var", +"variable_define : any_var_or_arr '=' objectid ':' object_or_var", +"variable_define : any_var_or_arr '=' coord_or_var", +"variable_define : any_var_or_arr '=' region_or_var", +"variable_define : any_var_or_arr '=' '{' integer_list '}'", +"variable_define : any_var_or_arr '=' '{' encodecoord_list '}'", +"variable_define : any_var_or_arr '=' '{' encoderegion_list '}'", +"variable_define : any_var_or_arr '=' terrainid ':' '{' mapchar_list '}'", +"variable_define : any_var_or_arr '=' monsterid ':' '{' encodemonster_list '}'", +"variable_define : any_var_or_arr '=' objectid ':' '{' encodeobj_list '}'", +"variable_define : any_var_or_arr '=' '{' string_list '}'", +"encodeobj_list : encodeobj", +"encodeobj_list : encodeobj_list ',' encodeobj", +"encodemonster_list : encodemonster", +"encodemonster_list : encodemonster_list ',' encodemonster", +"mapchar_list : mapchar", +"mapchar_list : mapchar_list ',' mapchar", +"encoderegion_list : encoderegion", +"encoderegion_list : encoderegion_list ',' encoderegion", +"encodecoord_list : encodecoord", +"encodecoord_list : encodecoord_list ',' encodecoord", +"integer_list : math_expr_var", +"integer_list : integer_list ',' math_expr_var", +"string_list : string_expr", +"string_list : string_list ',' string_expr", +"$$1 :", +"$$2 :", +"function_define : FUNCTION_ID NQSTRING '(' $$1 func_params_list ')' $$2 stmt_block", +"function_call : NQSTRING '(' func_call_params_list ')'", +"exitstatement : EXIT_ID", +"opt_percent :", +"opt_percent : PERCENT", +"comparestmt : PERCENT", +"comparestmt : '[' math_expr_var COMPARE_TYPE math_expr_var ']'", +"comparestmt : '[' math_expr_var ']'", +"$$3 :", +"$$4 :", +"switchstatement : SWITCH_ID $$3 '[' integer_or_var ']' $$4 '{' switchcases '}'", +"switchcases :", +"switchcases : switchcase switchcases", +"$$5 :", +"switchcase : CASE_ID all_integers ':' $$5 levstatements", +"$$6 :", +"switchcase : DEFAULT_ID ':' $$6 levstatements", +"breakstatement : BREAK_ID", +"for_to_span : '.' '.'", +"for_to_span : TO_ID", +"forstmt_start : FOR_ID any_var_or_unk '=' math_expr_var for_to_span math_expr_var", +"$$7 :", +"forstatement : forstmt_start $$7 stmt_block", +"$$8 :", +"loopstatement : LOOP_ID '[' integer_or_var ']' $$8 stmt_block", +"$$9 :", +"chancestatement : comparestmt ':' $$9 levstatement", +"$$10 :", +"ifstatement : IF_ID comparestmt $$10 if_ending", +"if_ending : stmt_block", +"$$11 :", +"if_ending : stmt_block $$11 ELSE_ID stmt_block", +"message : MESSAGE_ID ':' string_expr", +"random_corridors : RAND_CORRIDOR_ID", +"random_corridors : RAND_CORRIDOR_ID ':' all_integers", +"random_corridors : RAND_CORRIDOR_ID ':' RANDOM_TYPE", +"corridor : CORRIDOR_ID ':' corr_spec ',' corr_spec", +"corridor : CORRIDOR_ID ':' corr_spec ',' all_integers", +"corr_spec : '(' INTEGER ',' DIRECTION ',' door_pos ')'", +"room_begin : room_type opt_percent ',' light_state", +"$$12 :", +"subroom_def : SUBROOM_ID ':' room_begin ',' subroom_pos ',' room_size optroomregionflags $$12 stmt_block", +"$$13 :", +"room_def : ROOM_ID ':' room_begin ',' room_pos ',' room_align ',' room_size optroomregionflags $$13 stmt_block", +"roomfill :", +"roomfill : ',' BOOLEAN", +"room_pos : '(' INTEGER ',' INTEGER ')'", +"room_pos : RANDOM_TYPE", +"subroom_pos : '(' INTEGER ',' INTEGER ')'", +"subroom_pos : RANDOM_TYPE", +"room_align : '(' h_justif ',' v_justif ')'", +"room_align : RANDOM_TYPE", +"room_size : '(' INTEGER ',' INTEGER ')'", +"room_size : RANDOM_TYPE", +"door_detail : ROOMDOOR_ID ':' secret ',' door_state ',' door_wall ',' door_pos", +"door_detail : DOOR_ID ':' door_state ',' ter_selection", +"secret : BOOLEAN", +"secret : RANDOM_TYPE", +"door_wall : dir_list", +"door_wall : RANDOM_TYPE", +"dir_list : DIRECTION", +"dir_list : DIRECTION '|' dir_list", +"door_pos : INTEGER", +"door_pos : RANDOM_TYPE", +"map_definition : NOMAP_ID", +"map_definition : GEOMETRY_ID ':' h_justif ',' v_justif roomfill MAP_ID", +"map_definition : GEOMETRY_ID ':' coord_or_var roomfill MAP_ID", +"h_justif : LEFT_OR_RIGHT", +"h_justif : CENTER", +"v_justif : TOP_OR_BOT", +"v_justif : CENTER", +"monster_detail : MONSTER_ID ':' monster_desc", +"$$14 :", +"monster_detail : MONSTER_ID ':' monster_desc $$14 stmt_block", +"monster_desc : monster_or_var ',' coord_or_var monster_infos", +"monster_infos :", +"monster_infos : monster_infos ',' monster_info", +"monster_info : string_expr", +"monster_info : MON_ATTITUDE", +"monster_info : MON_ALERTNESS", +"monster_info : alignment_prfx", +"monster_info : MON_APPEARANCE string_expr", +"monster_info : FEMALE_ID", +"monster_info : INVIS_ID", +"monster_info : CANCELLED_ID", +"monster_info : REVIVED_ID", +"monster_info : AVENGE_ID", +"monster_info : FLEEING_ID ':' integer_or_var", +"monster_info : BLINDED_ID ':' integer_or_var", +"monster_info : PARALYZED_ID ':' integer_or_var", +"monster_info : STUNNED_ID", +"monster_info : CONFUSED_ID", +"monster_info : SEENTRAPS_ID ':' seen_trap_mask", +"seen_trap_mask : STRING", +"seen_trap_mask : ALL_ID", +"seen_trap_mask : STRING '|' seen_trap_mask", +"object_detail : OBJECT_ID ':' object_desc", +"$$15 :", +"object_detail : COBJECT_ID ':' object_desc $$15 stmt_block", +"object_desc : object_or_var object_infos", +"object_infos :", +"object_infos : object_infos ',' object_info", +"object_info : CURSE_TYPE", +"object_info : MONTYPE_ID ':' monster_or_var", +"object_info : all_ints_push", +"object_info : NAME_ID ':' string_expr", +"object_info : QUANTITY_ID ':' integer_or_var", +"object_info : BURIED_ID", +"object_info : LIGHT_STATE", +"object_info : ERODED_ID ':' integer_or_var", +"object_info : ERODEPROOF_ID", +"object_info : DOOR_STATE", +"object_info : TRAPPED_STATE", +"object_info : RECHARGED_ID ':' integer_or_var", +"object_info : INVIS_ID", +"object_info : GREASED_ID", +"object_info : coord_or_var", +"trap_detail : TRAP_ID ':' trap_name ',' coord_or_var", +"drawbridge_detail : DRAWBRIDGE_ID ':' coord_or_var ',' DIRECTION ',' door_state", +"mazewalk_detail : MAZEWALK_ID ':' coord_or_var ',' DIRECTION", +"mazewalk_detail : MAZEWALK_ID ':' coord_or_var ',' DIRECTION ',' BOOLEAN opt_fillchar", +"wallify_detail : WALLIFY_ID", +"wallify_detail : WALLIFY_ID ':' ter_selection", +"ladder_detail : LADDER_ID ':' coord_or_var ',' UP_OR_DOWN", +"stair_detail : STAIR_ID ':' coord_or_var ',' UP_OR_DOWN", +"stair_region : STAIR_ID ':' lev_region ',' lev_region ',' UP_OR_DOWN", +"portal_region : PORTAL_ID ':' lev_region ',' lev_region ',' STRING", +"teleprt_region : TELEPRT_ID ':' lev_region ',' lev_region teleprt_detail", +"branch_region : BRANCH_ID ':' lev_region ',' lev_region", +"teleprt_detail :", +"teleprt_detail : ',' UP_OR_DOWN", +"fountain_detail : FOUNTAIN_ID ':' ter_selection", +"sink_detail : SINK_ID ':' ter_selection", +"pool_detail : POOL_ID ':' ter_selection", +"terrain_type : CHAR", +"terrain_type : '(' CHAR ',' light_state ')'", +"replace_terrain_detail : REPLACE_TERRAIN_ID ':' region_or_var ',' mapchar_or_var ',' mapchar_or_var ',' SPERCENT", +"terrain_detail : TERRAIN_ID ':' ter_selection ',' mapchar_or_var", +"diggable_detail : NON_DIGGABLE_ID ':' region_or_var", +"passwall_detail : NON_PASSWALL_ID ':' region_or_var", +"$$16 :", +"region_detail : REGION_ID ':' region_or_var ',' light_state ',' room_type optroomregionflags $$16 region_detail_end", +"region_detail_end :", +"region_detail_end : stmt_block", +"altar_detail : ALTAR_ID ':' coord_or_var ',' alignment ',' altar_type", +"grave_detail : GRAVE_ID ':' coord_or_var ',' string_expr", +"grave_detail : GRAVE_ID ':' coord_or_var ',' RANDOM_TYPE", +"grave_detail : GRAVE_ID ':' coord_or_var", +"gold_detail : GOLD_ID ':' math_expr_var ',' coord_or_var", +"engraving_detail : ENGRAVING_ID ':' coord_or_var ',' engraving_type ',' string_expr", +"mineralize : MINERALIZE_ID ':' integer_or_var ',' integer_or_var ',' integer_or_var ',' integer_or_var", +"mineralize : MINERALIZE_ID", +"trap_name : STRING", +"trap_name : RANDOM_TYPE", +"room_type : STRING", +"room_type : RANDOM_TYPE", +"optroomregionflags :", +"optroomregionflags : ',' roomregionflags", +"roomregionflags : roomregionflag", +"roomregionflags : roomregionflag ',' roomregionflags", +"roomregionflag : FILLING", +"roomregionflag : IRREGULAR", +"roomregionflag : JOINED", +"door_state : DOOR_STATE", +"door_state : RANDOM_TYPE", +"light_state : LIGHT_STATE", +"light_state : RANDOM_TYPE", +"alignment : ALIGNMENT", +"alignment : a_register", +"alignment : RANDOM_TYPE", +"alignment_prfx : ALIGNMENT", +"alignment_prfx : a_register", +"alignment_prfx : A_REGISTER ':' RANDOM_TYPE", +"altar_type : ALTAR_TYPE", +"altar_type : RANDOM_TYPE", +"a_register : A_REGISTER '[' INTEGER ']'", +"string_or_var : STRING", +"string_or_var : VARSTRING_STRING", +"string_or_var : VARSTRING_STRING_ARRAY '[' math_expr_var ']'", +"integer_or_var : math_expr_var", +"coord_or_var : encodecoord", +"coord_or_var : rndcoord_ID '(' ter_selection ')'", +"coord_or_var : VARSTRING_COORD", +"coord_or_var : VARSTRING_COORD_ARRAY '[' math_expr_var ']'", +"encodecoord : '(' INTEGER ',' INTEGER ')'", +"encodecoord : RANDOM_TYPE", +"encodecoord : RANDOM_TYPE_BRACKET humidity_flags ']'", +"humidity_flags : HUMIDITY_TYPE", +"humidity_flags : HUMIDITY_TYPE ',' humidity_flags", +"region_or_var : encoderegion", +"region_or_var : VARSTRING_REGION", +"region_or_var : VARSTRING_REGION_ARRAY '[' math_expr_var ']'", +"encoderegion : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'", +"mapchar_or_var : mapchar", +"mapchar_or_var : VARSTRING_MAPCHAR", +"mapchar_or_var : VARSTRING_MAPCHAR_ARRAY '[' math_expr_var ']'", +"mapchar : CHAR", +"mapchar : '(' CHAR ',' light_state ')'", +"monster_or_var : encodemonster", +"monster_or_var : VARSTRING_MONST", +"monster_or_var : VARSTRING_MONST_ARRAY '[' math_expr_var ']'", +"encodemonster : STRING", +"encodemonster : CHAR", +"encodemonster : '(' CHAR ',' STRING ')'", +"encodemonster : RANDOM_TYPE", +"object_or_var : encodeobj", +"object_or_var : VARSTRING_OBJ", +"object_or_var : VARSTRING_OBJ_ARRAY '[' math_expr_var ']'", +"encodeobj : STRING", +"encodeobj : CHAR", +"encodeobj : '(' CHAR ',' STRING ')'", +"encodeobj : RANDOM_TYPE", +"string_expr : string_or_var", +"string_expr : string_expr '.' string_or_var", +"math_expr_var : INTEGER", +"math_expr_var : dice", +"math_expr_var : '(' MINUS_INTEGER ')'", +"math_expr_var : VARSTRING_INT", +"math_expr_var : VARSTRING_INT_ARRAY '[' math_expr_var ']'", +"math_expr_var : math_expr_var '+' math_expr_var", +"math_expr_var : math_expr_var '-' math_expr_var", +"math_expr_var : math_expr_var '*' math_expr_var", +"math_expr_var : math_expr_var '/' math_expr_var", +"math_expr_var : math_expr_var '%' math_expr_var", +"math_expr_var : '(' math_expr_var ')'", +"func_param_type : CFUNC_INT", +"func_param_type : CFUNC_STR", +"func_param_part : any_var_or_arr ':' func_param_type", +"func_param_list : func_param_part", +"func_param_list : func_param_list ',' func_param_part", +"func_params_list :", +"func_params_list : func_param_list", +"func_call_param_part : math_expr_var", +"func_call_param_part : string_expr", +"func_call_param_list : func_call_param_part", +"func_call_param_list : func_call_param_list ',' func_call_param_part", +"func_call_params_list :", +"func_call_params_list : func_call_param_list", +"ter_selection_x : coord_or_var", +"ter_selection_x : rect_ID region_or_var", +"ter_selection_x : fillrect_ID region_or_var", +"ter_selection_x : line_ID coord_or_var ',' coord_or_var", +"ter_selection_x : randline_ID coord_or_var ',' coord_or_var ',' math_expr_var", +"ter_selection_x : grow_ID '(' ter_selection ')'", +"ter_selection_x : grow_ID '(' dir_list ',' ter_selection ')'", +"ter_selection_x : filter_ID '(' SPERCENT ',' ter_selection ')'", +"ter_selection_x : filter_ID '(' ter_selection ',' ter_selection ')'", +"ter_selection_x : filter_ID '(' mapchar_or_var ',' ter_selection ')'", +"ter_selection_x : flood_ID coord_or_var", +"ter_selection_x : circle_ID '(' coord_or_var ',' math_expr_var ')'", +"ter_selection_x : circle_ID '(' coord_or_var ',' math_expr_var ',' FILLING ')'", +"ter_selection_x : ellipse_ID '(' coord_or_var ',' math_expr_var ',' math_expr_var ')'", +"ter_selection_x : ellipse_ID '(' coord_or_var ',' math_expr_var ',' math_expr_var ',' FILLING ')'", +"ter_selection_x : gradient_ID '(' GRADIENT_TYPE ',' '(' math_expr_var '-' math_expr_var opt_limited ')' ',' coord_or_var opt_coord_or_var ')'", +"ter_selection_x : complement_ID ter_selection_x", +"ter_selection_x : VARSTRING_SEL", +"ter_selection_x : '(' ter_selection ')'", +"ter_selection : ter_selection_x", +"ter_selection : ter_selection_x '&' ter_selection", +"dice : DICE", +"all_integers : MINUS_INTEGER", +"all_integers : PLUS_INTEGER", +"all_integers : INTEGER", +"all_ints_push : MINUS_INTEGER", +"all_ints_push : PLUS_INTEGER", +"all_ints_push : INTEGER", +"all_ints_push : dice", +"objectid : object_ID", +"objectid : OBJECT_ID", +"monsterid : monster_ID", +"monsterid : MONSTER_ID", +"terrainid : terrain_ID", +"terrainid : TERRAIN_ID", +"engraving_type : ENGRAVING_TYPE", +"engraving_type : RANDOM_TYPE", +"lev_region : region", +"lev_region : LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'", +"region : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'", }; #endif - -#if YYDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "CHAR", "INTEGER", "BOOLEAN", "PERCENT", - "SPERCENT", "MINUS_INTEGER", "PLUS_INTEGER", "MAZE_GRID_ID", - "SOLID_FILL_ID", "MINES_ID", "ROGUELEV_ID", "MESSAGE_ID", "MAZE_ID", - "LEVEL_ID", "LEV_INIT_ID", "GEOMETRY_ID", "NOMAP_ID", "OBJECT_ID", - "COBJECT_ID", "MONSTER_ID", "TRAP_ID", "DOOR_ID", "DRAWBRIDGE_ID", - "object_ID", "monster_ID", "terrain_ID", "MAZEWALK_ID", "WALLIFY_ID", - "REGION_ID", "FILLING", "IRREGULAR", "JOINED", "ALTAR_ID", "LADDER_ID", - "STAIR_ID", "NON_DIGGABLE_ID", "NON_PASSWALL_ID", "ROOM_ID", "PORTAL_ID", - "TELEPRT_ID", "BRANCH_ID", "LEV", "MINERALIZE_ID", "CORRIDOR_ID", - "GOLD_ID", "ENGRAVING_ID", "FOUNTAIN_ID", "POOL_ID", "SINK_ID", "NONE", - "RAND_CORRIDOR_ID", "DOOR_STATE", "LIGHT_STATE", "CURSE_TYPE", - "ENGRAVING_TYPE", "DIRECTION", "RANDOM_TYPE", "RANDOM_TYPE_BRACKET", - "A_REGISTER", "ALIGNMENT", "LEFT_OR_RIGHT", "CENTER", "TOP_OR_BOT", - "ALTAR_TYPE", "UP_OR_DOWN", "SUBROOM_ID", "NAME_ID", "FLAGS_ID", - "FLAG_TYPE", "MON_ATTITUDE", "MON_ALERTNESS", "MON_APPEARANCE", - "ROOMDOOR_ID", "IF_ID", "ELSE_ID", "TERRAIN_ID", "HORIZ_OR_VERT", - "REPLACE_TERRAIN_ID", "EXIT_ID", "SHUFFLE_ID", "QUANTITY_ID", - "BURIED_ID", "LOOP_ID", "FOR_ID", "TO_ID", "SWITCH_ID", "CASE_ID", - "BREAK_ID", "DEFAULT_ID", "ERODED_ID", "TRAPPED_STATE", "RECHARGED_ID", - "INVIS_ID", "GREASED_ID", "FEMALE_ID", "CANCELLED_ID", "REVIVED_ID", - "AVENGE_ID", "FLEEING_ID", "BLINDED_ID", "PARALYZED_ID", "STUNNED_ID", - "CONFUSED_ID", "SEENTRAPS_ID", "ALL_ID", "MONTYPE_ID", "GRAVE_ID", - "ERODEPROOF_ID", "FUNCTION_ID", "MSG_OUTPUT_TYPE", "COMPARE_TYPE", - "UNKNOWN_TYPE", "rect_ID", "fillrect_ID", "line_ID", "randline_ID", - "grow_ID", "selection_ID", "flood_ID", "rndcoord_ID", "circle_ID", - "ellipse_ID", "filter_ID", "complement_ID", "gradient_ID", - "GRADIENT_TYPE", "LIMITED", "HUMIDITY_TYPE", "','", "':'", "'('", "')'", - "'['", "']'", "'{'", "'}'", "STRING", "MAP_ID", "NQSTRING", "VARSTRING", - "CFUNC", "CFUNC_INT", "CFUNC_STR", "CFUNC_COORD", "CFUNC_REGION", - "VARSTRING_INT", "VARSTRING_INT_ARRAY", "VARSTRING_STRING", - "VARSTRING_STRING_ARRAY", "VARSTRING_VAR", "VARSTRING_VAR_ARRAY", - "VARSTRING_COORD", "VARSTRING_COORD_ARRAY", "VARSTRING_REGION", - "VARSTRING_REGION_ARRAY", "VARSTRING_MAPCHAR", "VARSTRING_MAPCHAR_ARRAY", - "VARSTRING_MONST", "VARSTRING_MONST_ARRAY", "VARSTRING_OBJ", - "VARSTRING_OBJ_ARRAY", "VARSTRING_SEL", "VARSTRING_SEL_ARRAY", - "METHOD_INT", "METHOD_INT_ARRAY", "METHOD_STRING", "METHOD_STRING_ARRAY", - "METHOD_VAR", "METHOD_VAR_ARRAY", "METHOD_COORD", "METHOD_COORD_ARRAY", - "METHOD_REGION", "METHOD_REGION_ARRAY", "METHOD_MAPCHAR", - "METHOD_MAPCHAR_ARRAY", "METHOD_MONST", "METHOD_MONST_ARRAY", - "METHOD_OBJ", "METHOD_OBJ_ARRAY", "METHOD_SEL", "METHOD_SEL_ARRAY", - "DICE", "'+'", "'-'", "'*'", "'/'", "'%'", "'='", "'.'", "'|'", "'&'", - "$accept", "file", "levels", "level", "level_def", "mazefiller", - "lev_init", "opt_limited", "opt_coord_or_var", "opt_fillchar", "walled", - "flags", "flag_list", "levstatements", "stmt_block", "levstatement", - "any_var_array", "any_var", "any_var_or_arr", "any_var_or_unk", - "shuffle_detail", "variable_define", "encodeobj_list", - "encodemonster_list", "mapchar_list", "encoderegion_list", - "encodecoord_list", "integer_list", "string_list", "function_define", - "$@1", "$@2", "function_call", "exitstatement", "opt_percent", - "comparestmt", "switchstatement", "$@3", "$@4", "switchcases", - "switchcase", "$@5", "$@6", "breakstatement", "for_to_span", - "forstmt_start", "forstatement", "$@7", "loopstatement", "$@8", - "chancestatement", "$@9", "ifstatement", "$@10", "if_ending", "$@11", - "message", "random_corridors", "corridor", "corr_spec", "room_begin", - "subroom_def", "$@12", "room_def", "$@13", "roomfill", "room_pos", - "subroom_pos", "room_align", "room_size", "door_detail", "secret", - "door_wall", "dir_list", "door_pos", "map_definition", "h_justif", - "v_justif", "monster_detail", "$@14", "monster_desc", "monster_infos", - "monster_info", "seen_trap_mask", "object_detail", "$@15", "object_desc", - "object_infos", "object_info", "trap_detail", "drawbridge_detail", - "mazewalk_detail", "wallify_detail", "ladder_detail", "stair_detail", - "stair_region", "portal_region", "teleprt_region", "branch_region", - "teleprt_detail", "fountain_detail", "sink_detail", "pool_detail", - "terrain_type", "replace_terrain_detail", "terrain_detail", - "diggable_detail", "passwall_detail", "region_detail", "@16", - "region_detail_end", "altar_detail", "grave_detail", "gold_detail", - "engraving_detail", "mineralize", "trap_name", "room_type", - "optroomregionflags", "roomregionflags", "roomregionflag", "door_state", - "light_state", "alignment", "alignment_prfx", "altar_type", "a_register", - "string_or_var", "integer_or_var", "coord_or_var", "encodecoord", - "humidity_flags", "region_or_var", "encoderegion", "mapchar_or_var", - "mapchar", "monster_or_var", "encodemonster", "object_or_var", - "encodeobj", "string_expr", "math_expr_var", "func_param_type", - "func_param_part", "func_param_list", "func_params_list", - "func_call_param_part", "func_call_param_list", "func_call_params_list", - "ter_selection_x", "ter_selection", "dice", "all_integers", - "all_ints_push", "objectid", "monsterid", "terrainid", "engraving_type", - "lev_region", "region", YY_NULLPTR -}; +#ifdef YYSTACKSIZE +#undef YYMAXDEPTH +#define YYMAXDEPTH YYSTACKSIZE +#else +#ifdef YYMAXDEPTH +#define YYSTACKSIZE YYMAXDEPTH +#else +#define YYSTACKSIZE 500 +#define YYMAXDEPTH 500 #endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 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, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 44, 58, 40, 41, 91, 93, 123, 125, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 43, 45, 42, 47, 37, - 61, 46, 124, 38 -}; -# endif - -#define YYPACT_NINF -654 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-654))) - -#define YYTABLE_NINF -202 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - 137, 7, 27, 83, -654, 137, 24, -15, 37, -654, - -654, 91, 733, -10, -654, 113, -654, 99, 131, 133, - -654, 161, 164, 166, 174, 183, 199, 214, 231, 233, - 239, 241, 243, 245, 247, 250, 268, 269, 275, 276, - 281, 295, 305, 317, 322, 323, 325, 326, 327, 28, - 340, 343, -654, 345, 205, 757, -654, -654, 346, 49, - 66, 265, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, 733, -654, -654, 190, -654, -654, -654, - -654, -654, 353, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, 59, 308, -654, -31, 406, 351, 58, 58, - 144, -11, 57, -18, -18, 672, -57, -18, -18, 248, - -57, -57, -6, -1, -1, -1, 66, 303, 66, -18, - 672, 672, 672, 319, -6, 51, -654, 672, -57, 751, - 66, -654, -654, 279, 339, -18, 355, -654, 29, -654, - 344, -654, 198, -654, 56, -654, 18, -654, 359, -654, - -654, -654, 113, -654, -654, 360, -654, 309, 368, 371, - 372, -654, -654, 374, -654, -654, 375, 503, -654, 378, - 379, 383, -654, -654, -654, 506, -654, -654, 402, -654, - -654, -654, -654, -654, -654, 537, -654, -654, 413, 404, - 418, -654, -654, -654, 420, -654, -654, 427, 439, 446, - -57, -57, -18, -18, 417, -18, 436, 445, 449, 672, - 450, 508, -654, -654, 391, -654, 582, -654, 453, 458, - -654, 459, 460, 466, 599, 473, 474, -654, -654, -654, - -654, -654, 475, 601, 608, 482, 483, 489, 490, 387, - 618, 526, 208, 529, -654, -654, -654, -654, -654, -654, - -654, -654, 530, -654, -654, 534, 359, 538, 539, -654, - 523, 66, 66, 540, -654, 548, 342, 66, 66, -654, - 66, 66, 66, 66, 66, 309, 387, -654, 542, 549, - -654, -654, -654, -654, -654, -654, 554, 60, 32, -654, - -654, 309, 387, 555, 556, 558, 733, 733, -654, -654, - 66, -31, 671, 46, 698, 571, 567, 672, 573, 66, - 215, 700, 566, 581, 66, 587, 359, 589, 66, 359, - -18, -18, 672, 663, 664, -654, -654, 592, 593, 521, - -654, -18, -18, 307, -654, 598, 596, 672, 597, 66, - 67, 186, 660, 730, 604, 669, -1, 8, -654, 606, - 607, -1, -1, -1, 66, 609, 89, -18, 141, 12, - 57, 665, -654, 52, 52, -654, 156, 605, -38, 697, - -654, -654, 331, 347, 168, 168, -654, -654, -654, 56, - -654, 672, 612, -52, -50, 4, 140, -654, -654, 309, - 387, 55, 127, 158, -654, 611, 358, -654, -654, -654, - 743, -654, 628, 374, -654, 626, 761, 430, -654, -654, - 383, -654, -654, 627, 464, 266, -654, 638, 492, -654, - -654, -654, -654, 636, 654, -18, -18, 600, 673, 666, - 675, 676, -654, 679, 438, -654, 667, 681, -654, 685, - 686, -654, -654, 799, 522, -654, -654, 689, -654, 687, - -654, 693, -654, -654, 694, 824, -654, 699, -654, 825, - 701, 67, 827, 702, 703, -654, 704, 779, -654, -654, - -654, -654, -654, 707, -654, 836, 710, 712, 786, 861, - -654, 734, 359, -654, 678, 66, -654, -654, 309, 735, - -654, 739, 732, -654, -654, -654, -654, 867, 740, -654, - -8, -654, 66, -654, -31, -654, 21, -654, 25, -654, - 54, -654, -654, -654, 741, 873, -654, -654, 744, -654, - 737, 745, -654, -654, -654, -654, -654, -654, -654, 748, - 769, -654, 771, -654, 788, -654, -654, 790, -654, -654, - -654, -654, -654, 784, -654, 792, 57, 919, -654, 794, - 868, 672, -654, 66, 66, 672, 796, 66, 672, 672, - 795, 798, -654, -6, 926, 90, 927, -49, 865, 802, - 13, -654, 803, 797, 870, -654, 66, 804, -31, 807, - 15, 254, 359, 52, -654, -654, 387, 805, 224, 697, - -654, -29, -654, -654, 387, 309, 151, -654, 159, -654, - 171, -654, 67, 808, -654, -654, -654, -31, 66, 66, - 66, 144, -654, 594, -654, 809, 66, -654, 810, 258, - 337, 811, 67, 528, 812, 813, 66, 937, 817, 814, - -654, -654, -654, 818, 939, -654, 947, -654, 289, 821, - -654, -654, 822, 85, 309, 950, -654, 951, 817, -654, - 826, -654, -654, 828, 160, -654, -654, -654, -654, 359, - 21, -654, 25, -654, 54, -654, 829, 953, 309, -654, - -654, -654, -654, 149, -654, -654, -654, -31, -654, -654, - -654, -654, -654, 830, 832, 833, -654, -654, 834, -654, - -654, -654, 309, 957, -654, 387, -654, 924, -654, 66, - -654, 835, -654, -654, -654, 409, 837, 419, -654, -654, - 963, 839, 838, 840, 15, 66, -654, -654, 841, 842, - 843, -654, 85, 954, 329, 845, 844, 160, -654, -654, - -654, -654, -654, 847, 914, 309, 66, 66, 66, -44, - -654, 846, 304, -654, 66, 975, -654, -654, -654, -654, - 850, 359, 852, 980, -654, 215, 817, -654, -654, -654, - 981, 359, -654, -654, 854, -654, -654, -654, 982, -654, - -654, -654, -654, -654, 800, -654, -654, 956, -654, 217, - 855, 419, -654, -654, 986, 857, 859, -654, 860, -654, - -654, 733, 864, -44, 862, 869, 863, -654, -654, 866, - -654, -654, 359, -654, 733, -654, 67, -654, -654, -654, - 871, -654, -654, -654, 872, -18, 68, 874, -654, -654, - 809, -18, 875, -654, -654, -654 -}; - - /* 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_uint16 yydefact[] = -{ - 2, 0, 0, 0, 3, 4, 23, 0, 0, 1, - 5, 0, 27, 0, 7, 0, 134, 0, 0, 0, - 193, 0, 0, 0, 0, 0, 0, 0, 250, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 280, - 0, 0, 0, 0, 0, 0, 162, 0, 0, 0, - 0, 0, 131, 0, 0, 0, 137, 146, 0, 0, - 0, 0, 94, 83, 74, 84, 75, 85, 76, 86, - 77, 87, 78, 88, 79, 89, 80, 90, 81, 91, - 82, 31, 6, 27, 92, 93, 0, 37, 36, 52, - 53, 50, 0, 45, 51, 150, 46, 47, 49, 48, - 30, 62, 35, 65, 64, 39, 55, 57, 58, 72, - 40, 56, 73, 54, 69, 70, 61, 71, 34, 43, - 66, 60, 68, 67, 38, 59, 63, 32, 33, 44, - 41, 42, 0, 26, 24, 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, 156, 0, 0, 0, - 0, 95, 96, 0, 0, 0, 0, 343, 0, 346, - 0, 388, 0, 344, 365, 28, 0, 154, 0, 10, - 9, 8, 0, 305, 306, 0, 341, 161, 0, 0, - 0, 13, 314, 0, 196, 197, 0, 0, 311, 0, - 0, 173, 309, 338, 340, 0, 337, 335, 0, 225, - 229, 334, 226, 331, 333, 0, 330, 328, 0, 200, - 0, 327, 282, 281, 0, 292, 293, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 384, 367, 386, 251, 0, 319, 0, 0, - 318, 0, 0, 0, 0, 0, 0, 404, 267, 268, - 284, 283, 0, 132, 0, 0, 0, 0, 0, 308, - 0, 0, 0, 0, 260, 262, 261, 391, 389, 390, - 164, 163, 0, 185, 186, 0, 0, 0, 0, 97, - 0, 0, 0, 276, 127, 0, 0, 0, 0, 136, - 0, 0, 0, 0, 0, 362, 361, 363, 366, 0, - 397, 399, 396, 398, 400, 401, 0, 0, 0, 104, - 105, 100, 98, 0, 0, 0, 0, 27, 151, 25, - 0, 0, 0, 0, 0, 316, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 228, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 368, 369, 0, 0, 0, - 377, 0, 0, 0, 383, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 133, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 158, 157, 0, 0, 152, 0, 0, 0, 359, - 345, 353, 0, 0, 348, 349, 350, 351, 352, 0, - 130, 0, 343, 0, 0, 0, 0, 121, 119, 125, - 123, 0, 0, 0, 155, 0, 0, 342, 12, 263, - 0, 11, 0, 0, 315, 0, 0, 0, 199, 198, - 173, 174, 195, 0, 0, 0, 227, 0, 0, 202, - 204, 246, 184, 0, 248, 0, 0, 189, 0, 0, - 0, 0, 325, 0, 0, 323, 0, 0, 322, 0, - 0, 385, 387, 0, 0, 294, 295, 0, 298, 0, - 296, 0, 297, 252, 0, 0, 253, 0, 176, 0, - 0, 0, 0, 0, 258, 257, 0, 0, 165, 166, - 277, 402, 403, 0, 178, 0, 0, 0, 0, 0, - 266, 0, 0, 148, 0, 0, 138, 275, 274, 0, - 357, 360, 0, 347, 135, 364, 99, 0, 0, 108, - 0, 107, 0, 106, 0, 112, 0, 103, 0, 102, - 0, 101, 29, 307, 0, 0, 317, 310, 0, 312, - 0, 0, 336, 394, 392, 393, 240, 237, 231, 0, - 0, 236, 0, 241, 0, 243, 244, 0, 239, 230, - 245, 395, 233, 0, 329, 203, 0, 0, 370, 0, - 0, 0, 372, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 320, 0, 0, 0, 0, 0, 0, 0, - 0, 168, 0, 0, 0, 256, 0, 0, 0, 0, - 0, 0, 0, 0, 153, 147, 149, 0, 0, 0, - 128, 0, 120, 122, 124, 126, 0, 113, 0, 115, - 0, 117, 0, 0, 313, 194, 339, 0, 0, 0, - 0, 0, 332, 0, 247, 19, 0, 190, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 285, 0, - 303, 302, 273, 0, 0, 254, 0, 180, 0, 0, - 255, 259, 0, 0, 278, 0, 182, 0, 285, 188, - 0, 187, 160, 0, 140, 354, 355, 356, 358, 0, - 0, 111, 0, 110, 0, 109, 0, 0, 234, 235, - 238, 242, 232, 0, 299, 207, 208, 0, 212, 211, - 213, 214, 215, 0, 0, 0, 219, 220, 0, 205, - 209, 300, 206, 0, 249, 371, 373, 0, 378, 0, - 374, 0, 324, 376, 375, 0, 0, 0, 269, 304, - 0, 0, 0, 0, 0, 0, 191, 192, 0, 0, - 0, 169, 0, 0, 0, 0, 0, 140, 129, 114, - 116, 118, 264, 0, 0, 210, 0, 0, 0, 0, - 20, 0, 0, 326, 0, 0, 289, 290, 291, 286, - 287, 271, 0, 0, 175, 0, 285, 279, 167, 177, - 0, 0, 183, 265, 0, 144, 139, 141, 0, 301, - 216, 217, 218, 223, 222, 221, 379, 0, 380, 349, - 0, 0, 272, 270, 0, 0, 0, 171, 0, 170, - 142, 27, 0, 0, 0, 0, 0, 321, 288, 0, - 406, 179, 0, 181, 27, 145, 0, 224, 381, 16, - 0, 405, 172, 143, 0, 0, 0, 17, 21, 22, - 19, 0, 0, 14, 18, 382 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -654, -654, 994, -654, -654, -654, -654, -654, -654, 146, - -654, -654, 815, -83, -290, 668, 848, 946, -390, -654, - -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, -654, -654, 959, -654, -654, -654, 244, - -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, -654, -654, -654, -654, -654, -654, 614, - 849, -654, -654, -654, -654, 562, -654, -654, -654, 260, - -654, -654, -654, -531, 253, -654, 338, 223, -654, -654, - -654, -654, -654, 187, -654, -654, 880, -654, -654, -654, - -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, - -654, -654, -654, -654, -654, -654, -654, 421, -653, 200, - -654, -385, -492, -654, -654, -654, 369, 682, -168, -136, - -312, 583, 150, -308, -386, -485, -418, -473, 602, -459, - -132, -55, -654, 396, -654, -654, 610, -654, -654, 778, - -135, 575, -392, -654, -654, -654, -654, -654, -124, -654 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 3, 4, 5, 6, 191, 81, 836, 862, 734, - 860, 12, 134, 82, 338, 83, 84, 85, 86, 173, - 87, 88, 636, 638, 640, 423, 424, 425, 426, 89, - 409, 699, 90, 91, 389, 92, 93, 174, 627, 766, - 767, 844, 831, 94, 525, 95, 96, 188, 97, 522, - 98, 336, 99, 296, 402, 518, 100, 101, 102, 281, - 272, 103, 801, 104, 842, 352, 500, 516, 679, 688, - 105, 295, 690, 468, 758, 106, 210, 450, 107, 359, - 229, 585, 729, 815, 108, 356, 219, 355, 579, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 615, - 119, 120, 121, 441, 122, 123, 124, 125, 126, 791, - 823, 127, 128, 129, 130, 131, 234, 273, 748, 789, - 790, 237, 487, 491, 730, 672, 492, 196, 278, 253, - 212, 346, 259, 260, 477, 478, 230, 231, 220, 221, - 315, 279, 697, 530, 531, 532, 317, 318, 319, 254, - 376, 183, 291, 582, 333, 334, 335, 513, 266, 267 -}; - - /* 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[] = -{ - 185, 211, 300, 197, 509, 182, 401, 238, 239, 611, - 255, 261, 262, 265, 549, 517, 427, 520, 521, 529, - 428, 527, 177, 283, 213, 284, 285, 286, 223, 275, - 276, 277, 297, 177, 16, 761, 177, 305, 320, 303, - 321, 202, 203, 263, 322, 323, 324, 551, 232, 439, - 329, 202, 203, 270, 331, 472, 293, 472, 213, 657, - 177, 213, 189, 813, 422, 641, 456, 498, 305, 459, - 177, 514, 677, 858, 686, 639, 256, 202, 203, 538, - 214, 540, 674, 9, 224, 644, 539, 637, 541, 756, - 691, 202, 203, 287, 11, 814, 325, 288, 289, 257, - 258, 193, 667, 282, 206, 644, 367, 368, 193, 370, - 294, 235, 194, 195, 214, 207, 236, 214, 190, 194, - 195, 132, 485, 306, 13, 207, 486, 859, 233, 316, - 223, 332, 274, 271, 407, 542, 208, 209, 326, 7, - 206, 499, 543, 827, 757, 515, 678, 223, 687, 670, - 706, 327, 1, 2, 215, 328, 671, 193, 225, 8, - 216, 472, 178, 60, 226, 327, 179, 180, 194, 195, - 741, 193, 208, 209, 257, 258, 14, 179, 180, 440, - 179, 180, 194, 195, 133, 519, 224, 519, 215, 178, - 176, 215, 546, 178, 216, 193, 429, 216, 511, 178, - 512, 654, 181, 224, 179, 180, 194, 195, 179, 180, - 475, 476, 445, 181, 179, 180, 181, 217, 218, 771, - 217, 218, 280, 15, 460, 461, 506, 462, 633, 770, - 632, 135, 624, 712, 469, 470, 471, 693, 479, 529, - 181, 769, 482, 523, 181, 488, 406, 489, 490, 764, - 181, 765, 412, 413, 435, 414, 415, 416, 417, 418, - 225, 510, 497, 136, 548, 137, 226, 503, 504, 505, - 563, 544, 306, 430, 564, 565, 528, 225, 545, 448, - 449, 774, 700, 226, 604, 436, 536, 227, 228, 701, - 702, 519, 263, 138, 447, 550, 139, 703, 140, 454, - 268, 269, 704, 458, 227, 228, 141, 202, 203, 705, - 472, 308, 467, 689, 473, 142, 475, 476, 298, 580, - 566, 567, 568, 287, 484, 202, 203, 288, 289, 588, - 589, 143, 692, 287, 309, 569, 330, 288, 289, 397, - 170, 310, 311, 312, 313, 314, 144, 524, 835, 570, - 571, -15, 204, 205, 854, 312, 313, 314, 572, 573, - 574, 575, 576, 145, 316, 146, 202, 203, 695, 696, - 206, 147, 804, 148, 577, 149, 578, 150, 290, 151, - 186, 264, 152, 310, 311, 312, 313, 314, 206, 737, - 365, 366, 738, 310, 311, 312, 313, 314, 184, 207, - 153, 154, 208, 209, 312, 313, 314, 155, 156, 768, - 202, 203, 635, 157, 204, 205, 198, 199, 200, 201, - 208, 209, 240, 241, 242, 243, 244, 158, 245, 206, - 246, 247, 248, 249, 250, 817, 280, 159, 818, 192, - 474, 596, 348, 310, 311, 312, 313, 314, 682, 160, - 181, 786, 787, 788, 161, 162, 658, 163, 164, 165, - 661, 208, 209, 664, 665, 475, 476, 533, 739, 301, - 626, 252, 167, 206, 302, 168, 411, 169, 175, 307, - 709, 710, 711, 534, 207, 187, 684, 634, 304, 310, - 311, 312, 313, 314, 553, 340, 337, 202, 203, 342, - 341, 822, 343, 344, 345, 208, 209, 348, 347, 353, - 350, 829, 348, 349, 351, 708, 310, 311, 312, 313, - 314, 732, 310, 311, 312, 313, 314, 310, 311, 312, - 313, 314, 310, 311, 312, 313, 314, 354, 659, 660, - 357, -201, 663, 310, 311, 312, 313, 314, 358, 360, - 369, 361, 852, 240, 241, 242, 243, 244, 362, 245, - 206, 246, 247, 248, 249, 250, 559, 202, 203, 371, - 363, 251, 310, 311, 312, 313, 314, 364, 372, 467, - 202, 203, 373, 375, 377, 775, 378, 797, 379, 380, - 381, 382, 208, 209, 310, 784, 312, 313, 314, 383, - 562, 735, 252, 384, 385, 386, 387, 388, 810, 811, - 812, 745, 390, 391, 392, 310, 311, 312, 313, 314, - 393, 394, 395, 240, 241, 242, 243, 244, 584, 245, - 206, 246, 247, 248, 249, 250, 240, 241, 242, 243, - 244, 251, 245, 206, 246, 247, 248, 249, 250, 310, - 311, 312, 313, 314, 251, 713, 714, 396, 602, 405, - 398, 399, 208, 209, 742, 400, 715, 716, 717, 403, - 404, 408, 252, 419, 438, 208, 209, 310, 311, 312, - 313, 314, 410, 420, 782, 252, 421, 431, 432, 718, - 433, 719, 720, 721, 722, 723, 724, 725, 726, 727, - 728, 442, 443, 444, 446, 451, 452, 310, 311, 312, - 313, 314, 453, 310, 311, 312, 313, 314, 455, 857, - 457, 463, 464, 465, 466, 864, 480, 493, 483, 819, - 481, 202, 203, 193, 494, 495, 496, 501, 502, 16, - 507, 526, -159, 537, 194, 195, 554, 17, 845, 552, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 555, - 557, 853, 27, 28, 29, 558, 561, 586, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 583, 39, 40, - 41, 42, 43, 44, 45, 587, 46, 240, 241, 242, - 243, 244, 590, 245, 206, 246, 247, 248, 249, 250, - 592, 47, 597, 601, 591, 251, 593, 594, 48, 49, - 595, 50, 598, 51, 52, 53, 599, 600, 54, 55, - 603, 56, 604, 57, 605, 606, 208, 209, 607, 609, - 608, 612, 610, 613, 614, 616, 252, 617, 618, 62, - 619, 620, 58, 621, 59, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 622, 596, 623, 630, 628, 60, 625, - 629, 631, 642, 256, 61, 62, 643, 645, 644, 646, - 647, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 171, - 64, 648, 66, 649, 68, 63, 70, 65, 72, 67, - 74, 69, 76, 71, 78, 73, 80, 75, 652, 77, - 650, 79, 651, 653, 655, 656, 467, 662, 666, 667, - 669, 673, 675, 676, 674, 683, 680, 681, 685, 707, - 733, 746, 694, 751, 736, 740, 743, 744, 747, 750, - 749, 752, 754, 755, 759, 760, 781, 762, 773, 763, - 780, 803, 776, 772, 777, 778, 779, 792, 785, 783, - 793, 795, 794, 809, 800, 798, 799, 805, 808, 820, - 816, 821, 806, 824, 825, 828, 830, 832, 834, 837, - 839, 840, 833, 841, 843, 846, 848, 850, 849, 10, - 851, 172, 855, 856, 434, 861, 863, 339, 166, 865, - 508, 807, 560, 292, 796, 802, 753, 299, 826, 222, - 847, 838, 731, 437, 668, 698, 556, 374, 0, 535, - 581, 0, 0, 547 -}; - -static const yytype_int16 yycheck[] = -{ - 83, 137, 170, 135, 396, 60, 296, 143, 144, 501, - 145, 147, 148, 149, 432, 400, 328, 403, 404, 409, - 328, 59, 4, 159, 3, 160, 161, 162, 3, 153, - 154, 155, 167, 4, 6, 688, 4, 8, 20, 175, - 22, 59, 60, 44, 26, 27, 28, 433, 59, 3, - 186, 59, 60, 59, 186, 3, 5, 3, 3, 590, - 4, 3, 3, 107, 4, 550, 356, 59, 8, 359, - 4, 59, 59, 5, 59, 548, 133, 59, 60, 131, - 59, 131, 131, 0, 59, 134, 138, 546, 138, 4, - 621, 59, 60, 4, 70, 139, 78, 8, 9, 156, - 157, 139, 131, 158, 122, 134, 242, 243, 139, 245, - 59, 54, 150, 151, 59, 133, 59, 59, 59, 150, - 151, 131, 55, 178, 139, 133, 59, 59, 139, 184, - 3, 186, 133, 139, 302, 131, 154, 155, 120, 132, - 122, 133, 138, 796, 59, 133, 133, 3, 133, 59, - 642, 133, 15, 16, 133, 137, 66, 139, 133, 132, - 139, 3, 133, 135, 139, 133, 148, 149, 150, 151, - 662, 139, 154, 155, 156, 157, 139, 148, 149, 133, - 148, 149, 150, 151, 71, 133, 59, 133, 133, 133, - 141, 133, 137, 133, 139, 139, 328, 139, 57, 133, - 59, 586, 184, 59, 148, 149, 150, 151, 148, 149, - 158, 159, 347, 184, 148, 149, 184, 162, 163, 704, - 162, 163, 133, 132, 360, 361, 394, 362, 540, 702, - 538, 132, 522, 651, 369, 371, 372, 623, 373, 629, - 184, 700, 377, 87, 184, 59, 301, 61, 62, 89, - 184, 91, 307, 308, 337, 310, 311, 312, 313, 314, - 133, 397, 386, 132, 137, 132, 139, 391, 392, 393, - 4, 131, 327, 328, 8, 9, 408, 133, 138, 64, - 65, 132, 131, 139, 135, 340, 421, 160, 161, 138, - 131, 133, 44, 132, 349, 137, 132, 138, 132, 354, - 150, 151, 131, 358, 160, 161, 132, 59, 60, 138, - 3, 113, 58, 59, 7, 132, 158, 159, 168, 455, - 54, 55, 56, 4, 379, 59, 60, 8, 9, 465, - 466, 132, 622, 4, 136, 69, 186, 8, 9, 131, - 135, 185, 186, 187, 188, 189, 132, 191, 131, 83, - 84, 134, 63, 64, 846, 187, 188, 189, 92, 93, - 94, 95, 96, 132, 419, 132, 59, 60, 144, 145, - 122, 132, 764, 132, 108, 132, 110, 132, 59, 132, - 190, 133, 132, 185, 186, 187, 188, 189, 122, 131, - 240, 241, 134, 185, 186, 187, 188, 189, 133, 133, - 132, 132, 154, 155, 187, 188, 189, 132, 132, 699, - 59, 60, 544, 132, 63, 64, 10, 11, 12, 13, - 154, 155, 115, 116, 117, 118, 119, 132, 121, 122, - 123, 124, 125, 126, 127, 131, 133, 132, 134, 131, - 133, 3, 4, 185, 186, 187, 188, 189, 616, 132, - 184, 32, 33, 34, 132, 132, 591, 132, 132, 132, - 595, 154, 155, 598, 599, 158, 159, 136, 131, 190, - 525, 164, 132, 122, 135, 132, 134, 132, 132, 135, - 648, 649, 650, 136, 133, 132, 618, 542, 133, 185, - 186, 187, 188, 189, 136, 135, 137, 59, 60, 131, - 191, 791, 131, 131, 130, 154, 155, 4, 133, 3, - 131, 801, 4, 135, 131, 647, 185, 186, 187, 188, - 189, 653, 185, 186, 187, 188, 189, 185, 186, 187, - 188, 189, 185, 186, 187, 188, 189, 135, 593, 594, - 3, 137, 597, 185, 186, 187, 188, 189, 135, 131, - 133, 131, 842, 115, 116, 117, 118, 119, 131, 121, - 122, 123, 124, 125, 126, 127, 136, 59, 60, 133, - 131, 133, 185, 186, 187, 188, 189, 131, 133, 58, - 59, 60, 133, 133, 193, 717, 4, 755, 135, 131, - 131, 131, 154, 155, 185, 186, 187, 188, 189, 133, - 136, 656, 164, 4, 131, 131, 131, 6, 776, 777, - 778, 666, 4, 131, 131, 185, 186, 187, 188, 189, - 131, 131, 4, 115, 116, 117, 118, 119, 136, 121, - 122, 123, 124, 125, 126, 127, 115, 116, 117, 118, - 119, 133, 121, 122, 123, 124, 125, 126, 127, 185, - 186, 187, 188, 189, 133, 61, 62, 131, 136, 136, - 131, 131, 154, 155, 136, 131, 72, 73, 74, 131, - 131, 131, 164, 131, 3, 154, 155, 185, 186, 187, - 188, 189, 134, 134, 739, 164, 132, 132, 132, 95, - 132, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 3, 131, 136, 131, 5, 140, 185, 186, 187, - 188, 189, 131, 185, 186, 187, 188, 189, 131, 855, - 131, 58, 58, 131, 131, 861, 128, 67, 131, 784, - 134, 59, 60, 139, 4, 131, 67, 131, 131, 6, - 131, 136, 77, 131, 150, 151, 3, 14, 831, 138, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 131, - 134, 844, 29, 30, 31, 4, 139, 131, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 139, 45, 46, - 47, 48, 49, 50, 51, 131, 53, 115, 116, 117, - 118, 119, 192, 121, 122, 123, 124, 125, 126, 127, - 134, 68, 135, 4, 131, 133, 131, 131, 75, 76, - 131, 78, 131, 80, 81, 82, 131, 131, 85, 86, - 131, 88, 135, 90, 131, 131, 154, 155, 4, 4, - 131, 4, 131, 131, 131, 131, 164, 58, 131, 142, - 4, 131, 109, 131, 111, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 77, 3, 131, 134, 132, 135, 191, - 131, 4, 131, 133, 141, 142, 3, 140, 134, 134, - 132, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 142, - 149, 132, 151, 132, 153, 148, 155, 150, 157, 152, - 159, 154, 161, 156, 163, 158, 165, 160, 134, 162, - 132, 164, 132, 131, 5, 131, 58, 131, 133, 131, - 4, 4, 67, 131, 131, 131, 139, 67, 131, 131, - 131, 4, 137, 4, 134, 134, 134, 134, 131, 131, - 136, 4, 131, 131, 4, 4, 32, 131, 5, 131, - 3, 7, 132, 134, 132, 132, 132, 4, 131, 134, - 131, 131, 134, 59, 131, 134, 134, 132, 131, 4, - 134, 131, 138, 131, 4, 4, 132, 5, 32, 134, - 4, 134, 192, 134, 134, 131, 134, 134, 129, 5, - 134, 55, 131, 131, 336, 131, 860, 192, 49, 134, - 396, 767, 450, 164, 754, 762, 678, 169, 795, 139, - 833, 821, 653, 341, 603, 629, 443, 249, -1, 419, - 455, -1, -1, 431 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint16 yystos[] = -{ - 0, 15, 16, 195, 196, 197, 198, 132, 132, 0, - 196, 70, 205, 139, 139, 132, 6, 14, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 29, 30, 31, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, - 46, 47, 48, 49, 50, 51, 53, 68, 75, 76, - 78, 80, 81, 82, 85, 86, 88, 90, 109, 111, - 135, 141, 142, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 200, 207, 209, 210, 211, 212, 214, 215, 223, - 226, 227, 229, 230, 237, 239, 240, 242, 244, 246, - 250, 251, 252, 255, 257, 264, 269, 272, 278, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 294, - 295, 296, 298, 299, 300, 301, 302, 305, 306, 307, - 308, 309, 131, 71, 206, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 229, 132, 132, 132, - 135, 142, 211, 213, 231, 132, 141, 4, 133, 148, - 149, 184, 335, 345, 133, 207, 190, 132, 241, 3, - 59, 199, 131, 139, 150, 151, 321, 334, 10, 11, - 12, 13, 59, 60, 63, 64, 122, 133, 154, 155, - 270, 323, 324, 3, 59, 133, 139, 162, 163, 280, - 332, 333, 280, 3, 59, 133, 139, 160, 161, 274, - 330, 331, 59, 139, 310, 54, 59, 315, 323, 323, - 115, 116, 117, 118, 119, 121, 123, 124, 125, 126, - 127, 133, 164, 323, 343, 344, 133, 156, 157, 326, - 327, 323, 323, 44, 133, 323, 352, 353, 326, 326, - 59, 139, 254, 311, 133, 352, 352, 352, 322, 335, - 133, 253, 335, 323, 344, 344, 344, 4, 8, 9, - 59, 346, 254, 5, 59, 265, 247, 344, 326, 210, - 322, 190, 135, 323, 133, 8, 335, 135, 113, 136, - 185, 186, 187, 188, 189, 334, 335, 340, 341, 342, - 20, 22, 26, 27, 28, 78, 120, 133, 137, 323, - 326, 334, 335, 348, 349, 350, 245, 137, 208, 206, - 135, 191, 131, 131, 131, 130, 325, 133, 4, 135, - 131, 131, 259, 3, 135, 281, 279, 3, 135, 273, - 131, 131, 131, 131, 131, 326, 326, 323, 323, 133, - 323, 133, 133, 133, 343, 133, 344, 193, 4, 135, - 131, 131, 131, 133, 4, 131, 131, 131, 6, 228, - 4, 131, 131, 131, 131, 4, 131, 131, 131, 131, - 131, 208, 248, 131, 131, 136, 335, 322, 131, 224, - 134, 134, 335, 335, 335, 335, 335, 335, 335, 131, - 134, 132, 4, 219, 220, 221, 222, 324, 327, 334, - 335, 132, 132, 132, 209, 207, 335, 321, 3, 3, - 133, 297, 3, 131, 136, 344, 131, 335, 64, 65, - 271, 5, 140, 131, 335, 131, 208, 131, 335, 208, - 323, 323, 344, 58, 58, 131, 131, 58, 267, 344, - 323, 323, 3, 7, 133, 158, 159, 328, 329, 344, - 128, 134, 344, 131, 335, 55, 59, 316, 59, 61, - 62, 317, 320, 67, 4, 131, 67, 352, 59, 133, - 260, 131, 131, 352, 352, 352, 322, 131, 253, 346, - 323, 57, 59, 351, 59, 133, 261, 315, 249, 133, - 328, 328, 243, 87, 191, 238, 136, 59, 334, 212, - 337, 338, 339, 136, 136, 340, 344, 131, 131, 138, - 131, 138, 131, 138, 131, 138, 137, 332, 137, 330, - 137, 328, 138, 136, 3, 131, 325, 134, 4, 136, - 259, 139, 136, 4, 8, 9, 54, 55, 56, 69, - 83, 84, 92, 93, 94, 95, 96, 108, 110, 282, - 323, 345, 347, 139, 136, 275, 131, 131, 323, 323, - 192, 131, 134, 131, 131, 131, 3, 135, 131, 131, - 131, 4, 136, 131, 135, 131, 131, 4, 131, 4, - 131, 316, 4, 131, 131, 293, 131, 58, 131, 4, - 131, 131, 77, 131, 208, 191, 335, 232, 132, 131, - 134, 4, 327, 324, 335, 334, 216, 333, 217, 331, - 218, 329, 131, 3, 134, 140, 134, 132, 132, 132, - 132, 132, 134, 131, 315, 5, 131, 267, 344, 335, - 335, 344, 131, 335, 344, 344, 133, 131, 311, 4, - 59, 66, 319, 4, 131, 67, 131, 59, 133, 262, - 139, 67, 322, 131, 334, 131, 59, 133, 263, 59, - 266, 267, 208, 328, 137, 144, 145, 336, 337, 225, - 131, 138, 131, 138, 131, 138, 316, 131, 334, 322, - 322, 322, 330, 61, 62, 72, 73, 74, 95, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 276, - 318, 320, 334, 131, 203, 335, 134, 131, 134, 131, - 134, 316, 136, 134, 134, 335, 4, 131, 312, 136, - 131, 4, 4, 270, 131, 131, 4, 59, 268, 4, - 4, 312, 131, 131, 89, 91, 233, 234, 208, 333, - 331, 329, 134, 5, 132, 334, 132, 132, 132, 132, - 3, 32, 335, 134, 186, 131, 32, 33, 34, 313, - 314, 303, 4, 131, 134, 131, 263, 322, 134, 134, - 131, 256, 268, 7, 346, 132, 138, 233, 131, 59, - 322, 322, 322, 107, 139, 277, 134, 131, 134, 335, - 4, 131, 208, 304, 131, 4, 271, 312, 4, 208, - 132, 236, 5, 192, 32, 131, 201, 134, 313, 4, - 134, 134, 258, 134, 235, 207, 131, 277, 134, 129, - 134, 134, 208, 207, 316, 131, 131, 323, 5, 59, - 204, 131, 202, 203, 323, 134 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint16 yyr1[] = -{ - 0, 194, 195, 195, 196, 196, 197, 198, 198, 199, - 199, 200, 200, 200, 200, 201, 201, 202, 202, 203, - 203, 204, 204, 205, 205, 206, 206, 207, 207, 208, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 212, 212, 212, 213, 213, 214, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 216, 216, 217, 217, 218, 218, 219, - 219, 220, 220, 221, 221, 222, 222, 224, 225, 223, - 226, 227, 228, 228, 229, 229, 229, 231, 232, 230, - 233, 233, 235, 234, 236, 234, 237, 238, 238, 239, - 241, 240, 243, 242, 245, 244, 247, 246, 248, 249, - 248, 250, 251, 251, 251, 252, 252, 253, 254, 256, - 255, 258, 257, 259, 259, 260, 260, 261, 261, 262, - 262, 263, 263, 264, 264, 265, 265, 266, 266, 267, - 267, 268, 268, 269, 269, 269, 270, 270, 271, 271, - 272, 273, 272, 274, 275, 275, 276, 276, 276, 276, - 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, - 276, 276, 277, 277, 277, 278, 279, 278, 280, 281, - 281, 282, 282, 282, 282, 282, 282, 282, 282, 282, - 282, 282, 282, 282, 282, 282, 283, 284, 285, 285, - 286, 286, 287, 288, 289, 290, 291, 292, 293, 293, - 294, 295, 296, 297, 297, 298, 299, 300, 301, 303, - 302, 304, 304, 305, 306, 306, 306, 307, 308, 309, - 309, 310, 310, 311, 311, 312, 312, 313, 313, 314, - 314, 314, 315, 315, 316, 316, 317, 317, 317, 318, - 318, 318, 319, 319, 320, 321, 321, 321, 322, 323, - 323, 323, 323, 324, 324, 324, 325, 325, 326, 326, - 326, 327, 328, 328, 328, 329, 329, 330, 330, 330, - 331, 331, 331, 331, 332, 332, 332, 333, 333, 333, - 333, 334, 334, 335, 335, 335, 335, 335, 335, 335, - 335, 335, 335, 335, 336, 336, 337, 338, 338, 339, - 339, 340, 340, 341, 341, 342, 342, 343, 343, 343, - 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, - 343, 343, 343, 343, 343, 343, 344, 344, 345, 346, - 346, 346, 347, 347, 347, 347, 348, 348, 349, 349, - 350, 350, 351, 351, 352, 352, 353 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 1, 1, 2, 3, 3, 5, 1, - 1, 5, 5, 3, 16, 0, 2, 0, 2, 0, - 2, 1, 1, 0, 3, 3, 1, 0, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 3, 5, - 3, 5, 5, 5, 3, 3, 5, 5, 5, 7, - 7, 7, 5, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 1, 3, 0, 0, 8, - 4, 1, 0, 1, 1, 5, 3, 0, 0, 9, - 0, 2, 0, 5, 0, 4, 1, 2, 1, 6, - 0, 3, 0, 6, 0, 4, 0, 4, 1, 0, - 4, 3, 1, 3, 3, 5, 5, 7, 4, 0, - 10, 0, 12, 0, 2, 5, 1, 5, 1, 5, - 1, 5, 1, 9, 5, 1, 1, 1, 1, 1, - 3, 1, 1, 1, 7, 5, 1, 1, 1, 1, - 3, 0, 5, 4, 0, 3, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 1, 3, 3, 3, 1, - 1, 3, 1, 1, 3, 3, 0, 5, 2, 0, - 3, 1, 3, 1, 3, 3, 1, 1, 3, 1, - 1, 1, 3, 1, 1, 1, 5, 7, 5, 8, - 1, 3, 5, 5, 7, 7, 6, 5, 0, 2, - 3, 3, 3, 1, 5, 9, 5, 3, 3, 0, - 10, 0, 1, 7, 5, 5, 3, 5, 7, 9, - 1, 1, 1, 1, 1, 0, 2, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 1, 4, 1, 1, 4, 1, 1, - 4, 1, 4, 5, 1, 3, 1, 3, 1, 1, - 4, 9, 1, 1, 4, 1, 5, 1, 1, 4, - 1, 1, 5, 1, 1, 1, 4, 1, 1, 5, - 1, 1, 3, 1, 1, 3, 1, 4, 3, 3, - 3, 3, 3, 3, 1, 1, 3, 1, 3, 0, - 1, 1, 1, 1, 3, 0, 1, 1, 2, 2, - 4, 6, 4, 6, 6, 6, 6, 2, 6, 8, - 8, 10, 14, 2, 1, 3, 1, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 10, 9 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#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) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -{ - YYFPRINTF (yyoutput, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *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 (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) -{ - unsigned long int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[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) -# define YY_SYMBOL_PRINT(Title, Type, 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 - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -{ - YYUSE (yyvaluep); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; -/* Number of syntax errors so far. */ int yynerrs; +int yyerrflag; +int yychar; +short *yyssp; +YYSTYPE *yyvsp; +YYSTYPE yyval; +YYSTYPE yylval; +short yyss[YYSTACKSIZE]; +YYSTYPE yyvs[YYSTACKSIZE]; +#define yystacksize YYSTACKSIZE - -/*----------. -| yyparse. | -`----------*/ - +/*lev_comp.y*/ +#define YYABORT goto yyabort +#define YYREJECT goto yyabort +#define YYACCEPT goto yyaccept +#define YYERROR goto yyerrlab int -yyparse (void) +yyparse() { - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; + register int yym, yyn, yystate; +#if YYDEBUG + register char *yys; + extern char *getenv(); - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; + if ((yys = getenv("YYDEBUG")) != 0) + { + yyn = *yys; + if (yyn >= '0' && yyn <= '9') + yydebug = yyn - '0'; + } #endif -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + yynerrs = 0; + yyerrflag = 0; + yychar = (-1); - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; + yyssp = yyss; + yyvsp = yyvs; + *yyssp = yystate = 0; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - 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: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) +yyloop: + if ((yyn = yydefred[yystate]) != 0) goto yyreduce; + if (yychar < 0) { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef 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. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* 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 * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - 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 YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) + if ((yyn = yysindex[yystate]) != 0 && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (); +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, shifting to state %d\n", + YYPREFIX, yystate, yytable[yyn]); +#endif + if (yyssp >= yyss + yystacksize - 1) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + yychar = (-1); + if (yyerrflag > 0) --yyerrflag; + goto yyloop; } - - if (yychar <= YYEOF) + if ((yyn = yyrindex[yystate]) != 0 && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); + yyn = yytable[yyn]; + goto yyreduce; } - 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); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) + if (yyerrflag) goto yyinrecovery; + goto yynewerror; +yynewerror: + yyerror("syntax error"); goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ +yyerrlab: + ++yynerrs; +yyinrecovery: + if (yyerrflag < 3) + { + yyerrflag = 3; + for (;;) + { + if ((yyn = yysindex[*yyssp]) != 0 && (yyn += YYERRCODE) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, error recovery shifting\ + to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); +#endif + if (yyssp >= yyss + yystacksize - 1) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + goto yyloop; + } + else + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: error recovery discarding state %d\n", + YYPREFIX, *yyssp); +#endif + if (yyssp <= yyss) goto yyabort; + --yyssp; + --yyvsp; + } + } + } + else + { + if (yychar == 0) goto yyabort; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, error recovery discards token %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif + yychar = (-1); + goto yyloop; + } 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 6: -#line 283 "lev_comp.y" /* yacc.c:1646 */ +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, reducing by rule %d (%s)\n", + YYPREFIX, yystate, yyn, yyrule[yyn]); +#endif + yym = yylen[yyn]; + yyval = yyvsp[1-yym]; + switch (yyn) { +case 5: +{ if (fatal_error > 0) { (void) fprintf(stderr, "%s: %d errors detected for level \"%s\". No output created!\n", - fname, fatal_error, (yyvsp[-2].map)); + fname, fatal_error, yyvsp[-2].map); fatal_error = 0; got_errors++; } else if (!got_errors) { - if (!write_level_file((yyvsp[-2].map), splev)) { - lc_error("Can't write output file for '%s'!", (yyvsp[-2].map)); + if (!write_level_file(yyvsp[-2].map, splev)) { + lc_error("Can't write output file for '%s'!", yyvsp[-2].map); exit(EXIT_FAILURE); } } - Free((yyvsp[-2].map)); + Free(yyvsp[-2].map); Free(splev); splev = NULL; vardef_free_all(variable_definitions); variable_definitions = NULL; } -#line 2465 "y.tab.c" /* yacc.c:1646 */ - break; - - case 7: -#line 305 "lev_comp.y" /* yacc.c:1646 */ - { - start_level_def(&splev, (yyvsp[0].map)); - (yyval.map) = (yyvsp[0].map); +break; +case 6: +{ + start_level_def(&splev, yyvsp[0].map); + yyval.map = yyvsp[0].map; } -#line 2474 "y.tab.c" /* yacc.c:1646 */ - break; - - case 8: -#line 310 "lev_comp.y" /* yacc.c:1646 */ - { - start_level_def(&splev, (yyvsp[-2].map)); - if ((yyvsp[0].i) == -1) { +break; +case 7: +{ + start_level_def(&splev, yyvsp[-2].map); + if (yyvsp[0].i == -1) { add_opvars(splev, "iiiiiiiio", VA_PASS9(LVLINIT_MAZEGRID,HWALL,0,0, 0,0,0,0, SPO_INITLEVEL)); } else { - long bg = what_map_char((char) (yyvsp[0].i)); + long bg = what_map_char((char) yyvsp[0].i); add_opvars(splev, "iiiiiiiio", VA_PASS9(LVLINIT_SOLIDFILL, bg, 0,0, 0,0,0,0, SPO_INITLEVEL)); @@ -2491,45 +2642,33 @@ yyreduce: VA_PASS2(MAZELEVEL, SPO_LEVEL_FLAGS)); max_x_map = COLNO-1; max_y_map = ROWNO; - (yyval.map) = (yyvsp[-2].map); + yyval.map = yyvsp[-2].map; } -#line 2497 "y.tab.c" /* yacc.c:1646 */ - break; - - case 9: -#line 331 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = -1; +break; +case 8: +{ + yyval.i = -1; } -#line 2505 "y.tab.c" /* yacc.c:1646 */ - break; - - case 10: -#line 335 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = what_map_char((char) (yyvsp[0].i)); +break; +case 9: +{ + yyval.i = what_map_char((char) yyvsp[0].i); } -#line 2513 "y.tab.c" /* yacc.c:1646 */ - break; - - case 11: -#line 341 "lev_comp.y" /* yacc.c:1646 */ - { - long filling = (yyvsp[0].terr).ter; +break; +case 10: +{ + long filling = yyvsp[0].terr.ter; if (filling == INVALID_TYPE || filling >= MAX_TYPE) lc_error("INIT_MAP: Invalid fill char type."); add_opvars(splev, "iiiiiiiio", - LVLINIT_SOLIDFILL,filling,0,(long)(yyvsp[0].terr).lit, 0,0,0,0, SPO_INITLEVEL); + LVLINIT_SOLIDFILL,filling,0,(long)yyvsp[0].terr.lit, 0,0,0,0, SPO_INITLEVEL); max_x_map = COLNO-1; max_y_map = ROWNO; } -#line 2527 "y.tab.c" /* yacc.c:1646 */ - break; - - case 12: -#line 351 "lev_comp.y" /* yacc.c:1646 */ - { - long filling = what_map_char((char) (yyvsp[0].i)); +break; +case 11: +{ + long filling = what_map_char((char) yyvsp[0].i); if (filling == INVALID_TYPE || filling >= MAX_TYPE) lc_error("INIT_MAP: Invalid fill char type."); add_opvars(splev, "iiiiiiiio", @@ -2538,29 +2677,23 @@ yyreduce: max_x_map = COLNO-1; max_y_map = ROWNO; } -#line 2542 "y.tab.c" /* yacc.c:1646 */ - break; - - case 13: -#line 362 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 12: +{ add_opvars(splev, "iiiiiiiio", VA_PASS9(LVLINIT_ROGUE,0,0,0, 0,0,0,0, SPO_INITLEVEL)); } -#line 2552 "y.tab.c" /* yacc.c:1646 */ - break; - - case 14: -#line 368 "lev_comp.y" /* yacc.c:1646 */ - { - long fg = what_map_char((char) (yyvsp[-11].i)); - long bg = what_map_char((char) (yyvsp[-9].i)); - long smoothed = (yyvsp[-7].i); - long joined = (yyvsp[-5].i); - long lit = (yyvsp[-3].i); - long walled = (yyvsp[-1].i); - long filling = (yyvsp[0].i); +break; +case 13: +{ + long fg = what_map_char((char) yyvsp[-11].i); + long bg = what_map_char((char) yyvsp[-9].i); + long smoothed = yyvsp[-7].i; + long joined = yyvsp[-5].i; + long lit = yyvsp[-3].i; + long walled = yyvsp[-1].i; + long filling = yyvsp[0].i; if (fg == INVALID_TYPE || fg >= MAX_TYPE) lc_error("INIT_MAP: Invalid foreground type."); if (bg == INVALID_TYPE || bg >= MAX_TYPE) @@ -2578,449 +2711,311 @@ yyreduce: max_x_map = COLNO-1; max_y_map = ROWNO; } -#line 2582 "y.tab.c" /* yacc.c:1646 */ - break; - - case 15: -#line 396 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = 0; +break; +case 14: +{ + yyval.i = 0; } -#line 2590 "y.tab.c" /* yacc.c:1646 */ - break; - - case 16: -#line 400 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (yyvsp[0].i); +break; +case 15: +{ + yyval.i = yyvsp[0].i; } -#line 2598 "y.tab.c" /* yacc.c:1646 */ - break; - - case 17: -#line 406 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 16: +{ add_opvars(splev, "o", VA_PASS1(SPO_COPY)); - (yyval.i) = 0; + yyval.i = 0; } -#line 2607 "y.tab.c" /* yacc.c:1646 */ - break; - - case 18: -#line 411 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = 1; +break; +case 17: +{ + yyval.i = 1; } -#line 2615 "y.tab.c" /* yacc.c:1646 */ - break; - - case 19: -#line 417 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = -1; +break; +case 18: +{ + yyval.i = -1; } -#line 2623 "y.tab.c" /* yacc.c:1646 */ - break; - - case 20: -#line 421 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = what_map_char((char) (yyvsp[0].i)); +break; +case 19: +{ + yyval.i = what_map_char((char) yyvsp[0].i); } -#line 2631 "y.tab.c" /* yacc.c:1646 */ - break; - - case 23: -#line 432 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 22: +{ add_opvars(splev, "io", VA_PASS2(0, SPO_LEVEL_FLAGS)); } -#line 2639 "y.tab.c" /* yacc.c:1646 */ - break; - - case 24: -#line 436 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "io", VA_PASS2((yyvsp[0].i), SPO_LEVEL_FLAGS)); +break; +case 23: +{ + add_opvars(splev, "io", VA_PASS2(yyvsp[0].i, SPO_LEVEL_FLAGS)); } -#line 2647 "y.tab.c" /* yacc.c:1646 */ - break; - - case 25: -#line 442 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = ((yyvsp[-2].i) | (yyvsp[0].i)); +break; +case 24: +{ + yyval.i = (yyvsp[-2].i | yyvsp[0].i); } -#line 2655 "y.tab.c" /* yacc.c:1646 */ - break; - - case 26: -#line 446 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (yyvsp[0].i); +break; +case 25: +{ + yyval.i = yyvsp[0].i; } -#line 2663 "y.tab.c" /* yacc.c:1646 */ - break; - - case 27: -#line 452 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = 0; +break; +case 26: +{ + yyval.i = 0; } -#line 2671 "y.tab.c" /* yacc.c:1646 */ - break; - - case 28: -#line 456 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = 1 + (yyvsp[0].i); +break; +case 27: +{ + yyval.i = 1 + yyvsp[0].i; } -#line 2679 "y.tab.c" /* yacc.c:1646 */ - break; - - case 29: -#line 462 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (yyvsp[-1].i); +break; +case 28: +{ + yyval.i = yyvsp[-1].i; } -#line 2687 "y.tab.c" /* yacc.c:1646 */ - break; - - case 97: -#line 545 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 96: +{ struct lc_vardefs *vd; - if ((vd = vardef_defined(variable_definitions, (yyvsp[0].map), 1))) { + if ((vd = vardef_defined(variable_definitions, yyvsp[0].map, 1))) { if (!(vd->var_type & SPOVAR_ARRAY)) - lc_error("Trying to shuffle non-array variable '%s'", (yyvsp[0].map)); - } else lc_error("Trying to shuffle undefined variable '%s'", (yyvsp[0].map)); - add_opvars(splev, "so", VA_PASS2((yyvsp[0].map), SPO_SHUFFLE_ARRAY)); - Free((yyvsp[0].map)); + lc_error("Trying to shuffle non-array variable '%s'", yyvsp[0].map); + } else lc_error("Trying to shuffle undefined variable '%s'", yyvsp[0].map); + add_opvars(splev, "so", VA_PASS2(yyvsp[0].map, SPO_SHUFFLE_ARRAY)); + Free(yyvsp[0].map); } -#line 2701 "y.tab.c" /* yacc.c:1646 */ - break; - - case 98: -#line 557 "lev_comp.y" /* yacc.c:1646 */ - { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_INT); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-2].map), SPO_VAR_INIT)); - Free((yyvsp[-2].map)); +break; +case 97: +{ + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-2].map, SPOVAR_INT); + add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT)); + Free(yyvsp[-2].map); } -#line 2711 "y.tab.c" /* yacc.c:1646 */ - break; - - case 99: -#line 563 "lev_comp.y" /* yacc.c:1646 */ - { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_SEL); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-4].map), SPO_VAR_INIT)); - Free((yyvsp[-4].map)); +break; +case 98: +{ + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_SEL); + add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); + Free(yyvsp[-4].map); } -#line 2721 "y.tab.c" /* yacc.c:1646 */ - break; - - case 100: -#line 569 "lev_comp.y" /* yacc.c:1646 */ - { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_STRING); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-2].map), SPO_VAR_INIT)); - Free((yyvsp[-2].map)); +break; +case 99: +{ + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-2].map, SPOVAR_STRING); + add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT)); + Free(yyvsp[-2].map); } -#line 2731 "y.tab.c" /* yacc.c:1646 */ - break; - - case 101: -#line 575 "lev_comp.y" /* yacc.c:1646 */ - { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_MAPCHAR); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-4].map), SPO_VAR_INIT)); - Free((yyvsp[-4].map)); +break; +case 100: +{ + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_MAPCHAR); + add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); + Free(yyvsp[-4].map); } -#line 2741 "y.tab.c" /* yacc.c:1646 */ - break; - - case 102: -#line 581 "lev_comp.y" /* yacc.c:1646 */ - { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_MONST); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-4].map), SPO_VAR_INIT)); - Free((yyvsp[-4].map)); +break; +case 101: +{ + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_MONST); + add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); + Free(yyvsp[-4].map); } -#line 2751 "y.tab.c" /* yacc.c:1646 */ - break; - - case 103: -#line 587 "lev_comp.y" /* yacc.c:1646 */ - { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_OBJ); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-4].map), SPO_VAR_INIT)); - Free((yyvsp[-4].map)); +break; +case 102: +{ + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_OBJ); + add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); + Free(yyvsp[-4].map); } -#line 2761 "y.tab.c" /* yacc.c:1646 */ - break; - - case 104: -#line 593 "lev_comp.y" /* yacc.c:1646 */ - { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_COORD); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-2].map), SPO_VAR_INIT)); - Free((yyvsp[-2].map)); +break; +case 103: +{ + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-2].map, SPOVAR_COORD); + add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT)); + Free(yyvsp[-2].map); } -#line 2771 "y.tab.c" /* yacc.c:1646 */ - break; - - case 105: -#line 599 "lev_comp.y" /* yacc.c:1646 */ - { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_REGION); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-2].map), SPO_VAR_INIT)); - Free((yyvsp[-2].map)); +break; +case 104: +{ + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-2].map, SPOVAR_REGION); + add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT)); + Free(yyvsp[-2].map); } -#line 2781 "y.tab.c" /* yacc.c:1646 */ - break; - - case 106: -#line 605 "lev_comp.y" /* yacc.c:1646 */ - { - long n_items = (yyvsp[-1].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_INT|SPOVAR_ARRAY); +break; +case 105: +{ + long n_items = yyvsp[-1].i; + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_INT|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[-4].map), SPO_VAR_INIT)); - Free((yyvsp[-4].map)); + VA_PASS3(n_items, yyvsp[-4].map, SPO_VAR_INIT)); + Free(yyvsp[-4].map); } -#line 2793 "y.tab.c" /* yacc.c:1646 */ - break; - - case 107: -#line 613 "lev_comp.y" /* yacc.c:1646 */ - { - long n_items = (yyvsp[-1].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_COORD|SPOVAR_ARRAY); +break; +case 106: +{ + long n_items = yyvsp[-1].i; + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_COORD|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[-4].map), SPO_VAR_INIT)); - Free((yyvsp[-4].map)); + VA_PASS3(n_items, yyvsp[-4].map, SPO_VAR_INIT)); + Free(yyvsp[-4].map); } -#line 2805 "y.tab.c" /* yacc.c:1646 */ - break; - - case 108: -#line 621 "lev_comp.y" /* yacc.c:1646 */ - { - long n_items = (yyvsp[-1].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_REGION|SPOVAR_ARRAY); +break; +case 107: +{ + long n_items = yyvsp[-1].i; + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_REGION|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[-4].map), SPO_VAR_INIT)); - Free((yyvsp[-4].map)); + VA_PASS3(n_items, yyvsp[-4].map, SPO_VAR_INIT)); + Free(yyvsp[-4].map); } -#line 2817 "y.tab.c" /* yacc.c:1646 */ - break; - - case 109: -#line 629 "lev_comp.y" /* yacc.c:1646 */ - { - long n_items = (yyvsp[-1].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-6].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); +break; +case 108: +{ + long n_items = yyvsp[-1].i; + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-6].map, SPOVAR_MAPCHAR|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[-6].map), SPO_VAR_INIT)); - Free((yyvsp[-6].map)); + VA_PASS3(n_items, yyvsp[-6].map, SPO_VAR_INIT)); + Free(yyvsp[-6].map); } -#line 2829 "y.tab.c" /* yacc.c:1646 */ - break; - - case 110: -#line 637 "lev_comp.y" /* yacc.c:1646 */ - { - long n_items = (yyvsp[-1].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-6].map), SPOVAR_MONST|SPOVAR_ARRAY); +break; +case 109: +{ + long n_items = yyvsp[-1].i; + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-6].map, SPOVAR_MONST|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[-6].map), SPO_VAR_INIT)); - Free((yyvsp[-6].map)); + VA_PASS3(n_items, yyvsp[-6].map, SPO_VAR_INIT)); + Free(yyvsp[-6].map); } -#line 2841 "y.tab.c" /* yacc.c:1646 */ - break; - - case 111: -#line 645 "lev_comp.y" /* yacc.c:1646 */ - { - long n_items = (yyvsp[-1].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-6].map), SPOVAR_OBJ|SPOVAR_ARRAY); +break; +case 110: +{ + long n_items = yyvsp[-1].i; + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-6].map, SPOVAR_OBJ|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[-6].map), SPO_VAR_INIT)); - Free((yyvsp[-6].map)); + VA_PASS3(n_items, yyvsp[-6].map, SPO_VAR_INIT)); + Free(yyvsp[-6].map); } -#line 2853 "y.tab.c" /* yacc.c:1646 */ - break; - - case 112: -#line 653 "lev_comp.y" /* yacc.c:1646 */ - { - long n_items = (yyvsp[-1].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_STRING|SPOVAR_ARRAY); +break; +case 111: +{ + long n_items = yyvsp[-1].i; + variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_STRING|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[-4].map), SPO_VAR_INIT)); - Free((yyvsp[-4].map)); + VA_PASS3(n_items, yyvsp[-4].map, SPO_VAR_INIT)); + Free(yyvsp[-4].map); } -#line 2865 "y.tab.c" /* yacc.c:1646 */ - break; - - case 113: -#line 663 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "O", VA_PASS1((yyvsp[0].i))); - (yyval.i) = 1; +break; +case 112: +{ + add_opvars(splev, "O", VA_PASS1(yyvsp[0].i)); + yyval.i = 1; } -#line 2874 "y.tab.c" /* yacc.c:1646 */ - break; - - case 114: -#line 668 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "O", VA_PASS1((yyvsp[0].i))); - (yyval.i) = 1 + (yyvsp[-2].i); +break; +case 113: +{ + add_opvars(splev, "O", VA_PASS1(yyvsp[0].i)); + yyval.i = 1 + yyvsp[-2].i; } -#line 2883 "y.tab.c" /* yacc.c:1646 */ - break; - - case 115: -#line 675 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "M", VA_PASS1((yyvsp[0].i))); - (yyval.i) = 1; +break; +case 114: +{ + add_opvars(splev, "M", VA_PASS1(yyvsp[0].i)); + yyval.i = 1; } -#line 2892 "y.tab.c" /* yacc.c:1646 */ - break; - - case 116: -#line 680 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "M", VA_PASS1((yyvsp[0].i))); - (yyval.i) = 1 + (yyvsp[-2].i); +break; +case 115: +{ + add_opvars(splev, "M", VA_PASS1(yyvsp[0].i)); + yyval.i = 1 + yyvsp[-2].i; } -#line 2901 "y.tab.c" /* yacc.c:1646 */ - break; - - case 117: -#line 687 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "m", VA_PASS1((yyvsp[0].i))); - (yyval.i) = 1; +break; +case 116: +{ + add_opvars(splev, "m", VA_PASS1(yyvsp[0].i)); + yyval.i = 1; } -#line 2910 "y.tab.c" /* yacc.c:1646 */ - break; - - case 118: -#line 692 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "m", VA_PASS1((yyvsp[0].i))); - (yyval.i) = 1 + (yyvsp[-2].i); +break; +case 117: +{ + add_opvars(splev, "m", VA_PASS1(yyvsp[0].i)); + yyval.i = 1 + yyvsp[-2].i; } -#line 2919 "y.tab.c" /* yacc.c:1646 */ - break; - - case 119: -#line 699 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = 1; +break; +case 118: +{ + yyval.i = 1; } -#line 2927 "y.tab.c" /* yacc.c:1646 */ - break; - - case 120: -#line 703 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = 1 + (yyvsp[-2].i); +break; +case 119: +{ + yyval.i = 1 + yyvsp[-2].i; } -#line 2935 "y.tab.c" /* yacc.c:1646 */ - break; - - case 121: -#line 709 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "c", VA_PASS1((yyvsp[0].i))); - (yyval.i) = 1; +break; +case 120: +{ + add_opvars(splev, "c", VA_PASS1(yyvsp[0].i)); + yyval.i = 1; } -#line 2944 "y.tab.c" /* yacc.c:1646 */ - break; - - case 122: -#line 714 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "c", VA_PASS1((yyvsp[0].i))); - (yyval.i) = 1 + (yyvsp[-2].i); +break; +case 121: +{ + add_opvars(splev, "c", VA_PASS1(yyvsp[0].i)); + yyval.i = 1 + yyvsp[-2].i; } -#line 2953 "y.tab.c" /* yacc.c:1646 */ - break; - - case 123: -#line 721 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = 1; +break; +case 122: +{ + yyval.i = 1; } -#line 2961 "y.tab.c" /* yacc.c:1646 */ - break; - - case 124: -#line 725 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = 1 + (yyvsp[-2].i); +break; +case 123: +{ + yyval.i = 1 + yyvsp[-2].i; } -#line 2969 "y.tab.c" /* yacc.c:1646 */ - break; - - case 125: -#line 731 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = 1; +break; +case 124: +{ + yyval.i = 1; } -#line 2977 "y.tab.c" /* yacc.c:1646 */ - break; - - case 126: -#line 735 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = 1 + (yyvsp[-2].i); +break; +case 125: +{ + yyval.i = 1 + yyvsp[-2].i; } -#line 2985 "y.tab.c" /* yacc.c:1646 */ - break; - - case 127: -#line 741 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 126: +{ struct lc_funcdefs *funcdef; if (in_function_definition) - lc_error("Recursively defined functions not allowed (function %s).", (yyvsp[-1].map)); + lc_error("Recursively defined functions not allowed (function %s).", yyvsp[-1].map); in_function_definition++; - if (funcdef_defined(function_definitions, (yyvsp[-1].map), 1)) - lc_error("Function '%s' already defined once.", (yyvsp[-1].map)); + if (funcdef_defined(function_definitions, yyvsp[-1].map, 1)) + lc_error("Function '%s' already defined once.", yyvsp[-1].map); - funcdef = funcdef_new(-1, (yyvsp[-1].map)); + funcdef = funcdef_new(-1, yyvsp[-1].map); funcdef->next = function_definitions; function_definitions = funcdef; function_splev_backup = splev; splev = &(funcdef->code); - Free((yyvsp[-1].map)); + Free(yyvsp[-1].map); curr_function = funcdef; function_tmp_var_defs = variable_definitions; variable_definitions = NULL; } -#line 3011 "y.tab.c" /* yacc.c:1646 */ - break; - - case 128: -#line 763 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 127: +{ /* nothing */ } -#line 3019 "y.tab.c" /* yacc.c:1646 */ - break; - - case 129: -#line 767 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 128: +{ add_opvars(splev, "io", VA_PASS2(0, SPO_RETURN)); splev = function_splev_backup; in_function_definition--; @@ -3028,25 +3023,22 @@ yyreduce: vardef_free_all(variable_definitions); variable_definitions = function_tmp_var_defs; } -#line 3032 "y.tab.c" /* yacc.c:1646 */ - break; - - case 130: -#line 778 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 129: +{ struct lc_funcdefs *tmpfunc; - tmpfunc = funcdef_defined(function_definitions, (yyvsp[-3].map), 1); + tmpfunc = funcdef_defined(function_definitions, yyvsp[-3].map, 1); if (tmpfunc) { long l; - long nparams = strlen( (yyvsp[-1].map) ); + long nparams = strlen( yyvsp[-1].map ); char *fparamstr = funcdef_paramtypes(tmpfunc); - if (strcmp((yyvsp[-1].map), fparamstr)) { + if (strcmp(yyvsp[-1].map, fparamstr)) { char *tmps = strdup(decode_parm_str(fparamstr)); - lc_error("Function '%s' requires params '%s', got '%s' instead.", (yyvsp[-3].map), tmps, decode_parm_str((yyvsp[-1].map))); + lc_error("Function '%s' requires params '%s', got '%s' instead.", yyvsp[-3].map, tmps, decode_parm_str(yyvsp[-1].map)); Free(tmps); } Free(fparamstr); - Free((yyvsp[-1].map)); + Free(yyvsp[-1].map); if (!(tmpfunc->n_called)) { /* we haven't called the function yet, so insert it in the code */ struct opvar *jmp = New(struct opvar); @@ -3074,77 +3066,53 @@ yyreduce: VA_PASS3(nparams, l, SPO_CALL)); tmpfunc->n_called++; } else { - lc_error("Function '%s' not defined.", (yyvsp[-3].map)); + lc_error("Function '%s' not defined.", yyvsp[-3].map); } - Free((yyvsp[-3].map)); + Free(yyvsp[-3].map); } -#line 3082 "y.tab.c" /* yacc.c:1646 */ - break; - - case 131: -#line 826 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 130: +{ add_opcode(splev, SPO_EXIT, NULL); } -#line 3090 "y.tab.c" /* yacc.c:1646 */ - break; - - case 132: -#line 832 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = 100; +break; +case 131: +{ + yyval.i = 100; } -#line 3098 "y.tab.c" /* yacc.c:1646 */ - break; - - case 133: -#line 836 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (yyvsp[0].i); +break; +case 132: +{ + yyval.i = yyvsp[0].i; } -#line 3106 "y.tab.c" /* yacc.c:1646 */ - break; - - case 134: -#line 842 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 133: +{ /* val > rn2(100) */ add_opvars(splev, "iio", - VA_PASS3((long)(yyvsp[0].i), 100, SPO_RN2)); - (yyval.i) = SPO_JG; + VA_PASS3((long)yyvsp[0].i, 100, SPO_RN2)); + yyval.i = SPO_JG; } -#line 3117 "y.tab.c" /* yacc.c:1646 */ - break; - - case 135: -#line 849 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (yyvsp[-2].i); +break; +case 134: +{ + yyval.i = yyvsp[-2].i; } -#line 3125 "y.tab.c" /* yacc.c:1646 */ - break; - - case 136: -#line 853 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 135: +{ /* boolean, explicit foo != 0 */ add_opvars(splev, "i", VA_PASS1(0)); - (yyval.i) = SPO_JNE; + yyval.i = SPO_JNE; } -#line 3135 "y.tab.c" /* yacc.c:1646 */ - break; - - case 137: -#line 861 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 136: +{ is_inconstant_number = 0; } -#line 3143 "y.tab.c" /* yacc.c:1646 */ - break; - - case 138: -#line 865 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 137: +{ struct opvar *chkjmp; if (in_switch_statement > 0) lc_error("Cannot nest switch-statements."); @@ -3165,12 +3133,9 @@ yyreduce: add_opcode(splev, SPO_JMP, NULL); break_stmt_start(); } -#line 3169 "y.tab.c" /* yacc.c:1646 */ - break; - - case 139: -#line 887 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 138: +{ struct opvar *endjump = New(struct opvar); int i; @@ -3208,32 +3173,23 @@ yyreduce: } -#line 3212 "y.tab.c" /* yacc.c:1646 */ - break; - - case 142: -#line 932 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 141: +{ if (n_switch_case_list < MAX_SWITCH_CASES) { struct opvar *tmppush = New(struct opvar); set_opvar_int(tmppush, splev->n_opcodes); - switch_case_value[n_switch_case_list] = (yyvsp[-1].i); + switch_case_value[n_switch_case_list] = yyvsp[-1].i; switch_case_list[n_switch_case_list++] = tmppush; } else lc_error("Too many cases in a switch."); } -#line 3225 "y.tab.c" /* yacc.c:1646 */ - break; - - case 143: -#line 941 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 142: +{ } -#line 3232 "y.tab.c" /* yacc.c:1646 */ - break; - - case 144: -#line 944 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 143: +{ struct opvar *tmppush = New(struct opvar); if (switch_default_case) @@ -3242,31 +3198,22 @@ yyreduce: set_opvar_int(tmppush, splev->n_opcodes); switch_default_case = tmppush; } -#line 3246 "y.tab.c" /* yacc.c:1646 */ - break; - - case 145: -#line 954 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 144: +{ } -#line 3253 "y.tab.c" /* yacc.c:1646 */ - break; - - case 146: -#line 959 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 145: +{ if (!allow_break_statements) lc_error("Cannot use BREAK outside a statement block."); else { break_stmt_new(splev, splev->n_opcodes); } } -#line 3265 "y.tab.c" /* yacc.c:1646 */ - break; - - case 149: -#line 973 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 148: +{ char buf[256], buf2[256]; if (n_forloops >= MAX_NESTED_IFS) { @@ -3275,47 +3222,41 @@ yyreduce: } /* first, define a variable for the for-loop end value */ - snprintf(buf, 255, "%s end", (yyvsp[-4].map)); + snprintf(buf, 255, "%s end", yyvsp[-4].map); /* the value of which is already in stack (the 2nd math_expr) */ add_opvars(splev, "iso", VA_PASS3(0, buf, SPO_VAR_INIT)); variable_definitions = add_vardef_type(variable_definitions, - (yyvsp[-4].map), SPOVAR_INT); + yyvsp[-4].map, SPOVAR_INT); /* define the for-loop variable. value is in stack (1st math_expr) */ - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-4].map), SPO_VAR_INIT)); + add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); /* calculate value for the loop "step" variable */ - snprintf(buf2, 255, "%s step", (yyvsp[-4].map)); + snprintf(buf2, 255, "%s step", yyvsp[-4].map); /* end - start */ add_opvars(splev, "vvo", - VA_PASS3(buf, (yyvsp[-4].map), SPO_MATH_SUB)); + VA_PASS3(buf, yyvsp[-4].map, SPO_MATH_SUB)); /* sign of that */ add_opvars(splev, "o", VA_PASS1(SPO_MATH_SIGN)); /* save the sign into the step var */ add_opvars(splev, "iso", VA_PASS3(0, buf2, SPO_VAR_INIT)); - forloop_list[n_forloops].varname = strdup((yyvsp[-4].map)); + forloop_list[n_forloops].varname = strdup(yyvsp[-4].map); forloop_list[n_forloops].jmp_point = splev->n_opcodes; n_forloops++; - Free((yyvsp[-4].map)); + Free(yyvsp[-4].map); } -#line 3305 "y.tab.c" /* yacc.c:1646 */ - break; - - case 150: -#line 1011 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 149: +{ /* nothing */ break_stmt_start(); } -#line 3314 "y.tab.c" /* yacc.c:1646 */ - break; - - case 151: -#line 1016 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 150: +{ char buf[256], buf2[256]; n_forloops--; snprintf(buf, 255, "%s step", forloop_list[n_forloops].varname); @@ -3340,12 +3281,9 @@ yyreduce: Free(forloop_list[n_forloops].varname); break_stmt_end(splev); } -#line 3344 "y.tab.c" /* yacc.c:1646 */ - break; - - case 152: -#line 1044 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 151: +{ struct opvar *tmppush = New(struct opvar); if (n_if_list >= MAX_NESTED_IFS) { @@ -3358,12 +3296,9 @@ yyreduce: add_opvars(splev, "o", VA_PASS1(SPO_DEC)); break_stmt_start(); } -#line 3362 "y.tab.c" /* yacc.c:1646 */ - break; - - case 153: -#line 1058 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 152: +{ struct opvar *tmppush; add_opvars(splev, "oio", VA_PASS3(SPO_COPY, 0, SPO_CMP)); @@ -3375,12 +3310,9 @@ yyreduce: add_opcode(splev, SPO_POP, NULL); /* get rid of the count value in stack */ break_stmt_end(splev); } -#line 3379 "y.tab.c" /* yacc.c:1646 */ - break; - - case 154: -#line 1073 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 153: +{ struct opvar *tmppush2 = New(struct opvar); if (n_if_list >= MAX_NESTED_IFS) { @@ -3396,27 +3328,21 @@ yyreduce: add_opcode(splev, SPO_PUSH, tmppush2); - add_opcode(splev, reverse_jmp_opcode( (yyvsp[-1].i) ), NULL); + add_opcode(splev, reverse_jmp_opcode( yyvsp[-1].i ), NULL); } -#line 3403 "y.tab.c" /* yacc.c:1646 */ - break; - - case 155: -#line 1093 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 154: +{ if (n_if_list > 0) { struct opvar *tmppush; tmppush = (struct opvar *) if_list[--n_if_list]; set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); } else lc_error("IF: Huh?! No start address?"); } -#line 3415 "y.tab.c" /* yacc.c:1646 */ - break; - - case 156: -#line 1103 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 155: +{ struct opvar *tmppush2 = New(struct opvar); if (n_if_list >= MAX_NESTED_IFS) { @@ -3432,35 +3358,26 @@ yyreduce: add_opcode(splev, SPO_PUSH, tmppush2); - add_opcode(splev, reverse_jmp_opcode( (yyvsp[0].i) ), NULL); + add_opcode(splev, reverse_jmp_opcode( yyvsp[0].i ), NULL); } -#line 3439 "y.tab.c" /* yacc.c:1646 */ - break; - - case 157: -#line 1123 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 156: +{ /* do nothing */ } -#line 3447 "y.tab.c" /* yacc.c:1646 */ - break; - - case 158: -#line 1129 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 157: +{ if (n_if_list > 0) { struct opvar *tmppush; tmppush = (struct opvar *) if_list[--n_if_list]; set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); } else lc_error("IF: Huh?! No start address?"); } -#line 3459 "y.tab.c" /* yacc.c:1646 */ - break; - - case 159: -#line 1137 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 158: +{ if (n_if_list > 0) { struct opvar *tmppush = New(struct opvar); struct opvar *tmppush2; @@ -3476,776 +3393,542 @@ yyreduce: if_list[n_if_list++] = tmppush; } else lc_error("IF: Huh?! No else-part address?"); } -#line 3480 "y.tab.c" /* yacc.c:1646 */ - break; - - case 160: -#line 1154 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 159: +{ if (n_if_list > 0) { struct opvar *tmppush; tmppush = (struct opvar *) if_list[--n_if_list]; set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); } else lc_error("IF: Huh?! No end address?"); } -#line 3492 "y.tab.c" /* yacc.c:1646 */ - break; - - case 161: -#line 1164 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 160: +{ add_opvars(splev, "o", VA_PASS1(SPO_MESSAGE)); } -#line 3500 "y.tab.c" /* yacc.c:1646 */ - break; - - case 162: -#line 1170 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 161: +{ add_opvars(splev, "iiiiiio", VA_PASS7(-1, 0, -1, -1, -1, -1, SPO_CORRIDOR)); } -#line 3509 "y.tab.c" /* yacc.c:1646 */ - break; - - case 163: -#line 1175 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 162: +{ add_opvars(splev, "iiiiiio", - VA_PASS7(-1, (yyvsp[0].i), -1, -1, -1, -1, SPO_CORRIDOR)); + VA_PASS7(-1, yyvsp[0].i, -1, -1, -1, -1, SPO_CORRIDOR)); } -#line 3518 "y.tab.c" /* yacc.c:1646 */ - break; - - case 164: -#line 1180 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 163: +{ add_opvars(splev, "iiiiiio", VA_PASS7(-1, -1, -1, -1, -1, -1, SPO_CORRIDOR)); } -#line 3527 "y.tab.c" /* yacc.c:1646 */ - break; - - case 165: -#line 1187 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 164: +{ add_opvars(splev, "iiiiiio", - VA_PASS7((yyvsp[-2].corpos).room, (yyvsp[-2].corpos).door, (yyvsp[-2].corpos).wall, - (yyvsp[0].corpos).room, (yyvsp[0].corpos).door, (yyvsp[0].corpos).wall, + VA_PASS7(yyvsp[-2].corpos.room, yyvsp[-2].corpos.door, yyvsp[-2].corpos.wall, + yyvsp[0].corpos.room, yyvsp[0].corpos.door, yyvsp[0].corpos.wall, SPO_CORRIDOR)); } -#line 3538 "y.tab.c" /* yacc.c:1646 */ - break; - - case 166: -#line 1194 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 165: +{ add_opvars(splev, "iiiiiio", - VA_PASS7((yyvsp[-2].corpos).room, (yyvsp[-2].corpos).door, (yyvsp[-2].corpos).wall, - -1, -1, (long)(yyvsp[0].i), + VA_PASS7(yyvsp[-2].corpos.room, yyvsp[-2].corpos.door, yyvsp[-2].corpos.wall, + -1, -1, (long)yyvsp[0].i, SPO_CORRIDOR)); } -#line 3549 "y.tab.c" /* yacc.c:1646 */ - break; - - case 167: -#line 1203 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.corpos).room = (yyvsp[-5].i); - (yyval.corpos).wall = (yyvsp[-3].i); - (yyval.corpos).door = (yyvsp[-1].i); +break; +case 166: +{ + yyval.corpos.room = yyvsp[-5].i; + yyval.corpos.wall = yyvsp[-3].i; + yyval.corpos.door = yyvsp[-1].i; } -#line 3559 "y.tab.c" /* yacc.c:1646 */ - break; - - case 168: -#line 1211 "lev_comp.y" /* yacc.c:1646 */ - { - if (((yyvsp[-2].i) < 100) && ((yyvsp[-3].i) == OROOM)) +break; +case 167: +{ + if ((yyvsp[-2].i < 100) && (yyvsp[-3].i == OROOM)) lc_error("Only typed rooms can have a chance."); else { add_opvars(splev, "iii", - VA_PASS3((long)(yyvsp[-3].i), (long)(yyvsp[-2].i), (long)(yyvsp[0].i))); + VA_PASS3((long)yyvsp[-3].i, (long)yyvsp[-2].i, (long)yyvsp[0].i)); } } -#line 3572 "y.tab.c" /* yacc.c:1646 */ - break; - - case 169: -#line 1222 "lev_comp.y" /* yacc.c:1646 */ - { - long rflags = (yyvsp[0].i); +break; +case 168: +{ + long rflags = yyvsp[0].i; if (rflags == -1) rflags = (1 << 0); add_opvars(splev, "iiiiiiio", VA_PASS8(rflags, ERR, ERR, - (yyvsp[-3].crd).x, (yyvsp[-3].crd).y, (yyvsp[-1].sze).width, (yyvsp[-1].sze).height, + yyvsp[-3].crd.x, yyvsp[-3].crd.y, yyvsp[-1].sze.width, yyvsp[-1].sze.height, SPO_SUBROOM)); break_stmt_start(); } -#line 3587 "y.tab.c" /* yacc.c:1646 */ - break; - - case 170: -#line 1233 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 169: +{ break_stmt_end(splev); add_opcode(splev, SPO_ENDROOM, NULL); } -#line 3596 "y.tab.c" /* yacc.c:1646 */ - break; - - case 171: -#line 1240 "lev_comp.y" /* yacc.c:1646 */ - { - long rflags = (yyvsp[-2].i); +break; +case 170: +{ + long rflags = yyvsp[-2].i; if (rflags == -1) rflags = (1 << 0); add_opvars(splev, "iiiiiiio", VA_PASS8(rflags, - (yyvsp[-3].crd).x, (yyvsp[-3].crd).y, (yyvsp[-5].crd).x, (yyvsp[-5].crd).y, - (yyvsp[-1].sze).width, (yyvsp[-1].sze).height, SPO_ROOM)); + yyvsp[-3].crd.x, yyvsp[-3].crd.y, yyvsp[-5].crd.x, yyvsp[-5].crd.y, + yyvsp[-1].sze.width, yyvsp[-1].sze.height, SPO_ROOM)); break_stmt_start(); } -#line 3611 "y.tab.c" /* yacc.c:1646 */ - break; - - case 172: -#line 1251 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 171: +{ break_stmt_end(splev); add_opcode(splev, SPO_ENDROOM, NULL); } -#line 3620 "y.tab.c" /* yacc.c:1646 */ - break; - - case 173: -#line 1258 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = 1; +break; +case 172: +{ + yyval.i = 1; } -#line 3628 "y.tab.c" /* yacc.c:1646 */ - break; - - case 174: -#line 1262 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (yyvsp[0].i); +break; +case 173: +{ + yyval.i = yyvsp[0].i; } -#line 3636 "y.tab.c" /* yacc.c:1646 */ - break; - - case 175: -#line 1268 "lev_comp.y" /* yacc.c:1646 */ - { - if ( (yyvsp[-3].i) < 1 || (yyvsp[-3].i) > 5 || - (yyvsp[-1].i) < 1 || (yyvsp[-1].i) > 5 ) { - lc_error("Room positions should be between 1-5: (%li,%li)!", (yyvsp[-3].i), (yyvsp[-1].i)); +break; +case 174: +{ + if ( yyvsp[-3].i < 1 || yyvsp[-3].i > 5 || + yyvsp[-1].i < 1 || yyvsp[-1].i > 5 ) { + lc_error("Room positions should be between 1-5: (%li,%li)!", yyvsp[-3].i, yyvsp[-1].i); } else { - (yyval.crd).x = (yyvsp[-3].i); - (yyval.crd).y = (yyvsp[-1].i); + yyval.crd.x = yyvsp[-3].i; + yyval.crd.y = yyvsp[-1].i; } } -#line 3650 "y.tab.c" /* yacc.c:1646 */ - break; - - case 176: -#line 1278 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.crd).x = (yyval.crd).y = ERR; +break; +case 175: +{ + yyval.crd.x = yyval.crd.y = ERR; } -#line 3658 "y.tab.c" /* yacc.c:1646 */ - break; - - case 177: -#line 1284 "lev_comp.y" /* yacc.c:1646 */ - { - if ( (yyvsp[-3].i) < 0 || (yyvsp[-1].i) < 0) { - lc_error("Invalid subroom position (%li,%li)!", (yyvsp[-3].i), (yyvsp[-1].i)); +break; +case 176: +{ + if ( yyvsp[-3].i < 0 || yyvsp[-1].i < 0) { + lc_error("Invalid subroom position (%li,%li)!", yyvsp[-3].i, yyvsp[-1].i); } else { - (yyval.crd).x = (yyvsp[-3].i); - (yyval.crd).y = (yyvsp[-1].i); + yyval.crd.x = yyvsp[-3].i; + yyval.crd.y = yyvsp[-1].i; } } -#line 3671 "y.tab.c" /* yacc.c:1646 */ - break; - - case 178: -#line 1293 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.crd).x = (yyval.crd).y = ERR; +break; +case 177: +{ + yyval.crd.x = yyval.crd.y = ERR; } -#line 3679 "y.tab.c" /* yacc.c:1646 */ - break; - - case 179: -#line 1299 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.crd).x = (yyvsp[-3].i); - (yyval.crd).y = (yyvsp[-1].i); +break; +case 178: +{ + yyval.crd.x = yyvsp[-3].i; + yyval.crd.y = yyvsp[-1].i; } -#line 3688 "y.tab.c" /* yacc.c:1646 */ - break; - - case 180: -#line 1304 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.crd).x = (yyval.crd).y = ERR; +break; +case 179: +{ + yyval.crd.x = yyval.crd.y = ERR; } -#line 3696 "y.tab.c" /* yacc.c:1646 */ - break; - - case 181: -#line 1310 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.sze).width = (yyvsp[-3].i); - (yyval.sze).height = (yyvsp[-1].i); +break; +case 180: +{ + yyval.sze.width = yyvsp[-3].i; + yyval.sze.height = yyvsp[-1].i; } -#line 3705 "y.tab.c" /* yacc.c:1646 */ - break; - - case 182: -#line 1315 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.sze).height = (yyval.sze).width = ERR; +break; +case 181: +{ + yyval.sze.height = yyval.sze.width = ERR; } -#line 3713 "y.tab.c" /* yacc.c:1646 */ - break; - - case 183: -#line 1321 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 182: +{ /* ERR means random here */ - if ((yyvsp[-2].i) == ERR && (yyvsp[0].i) != ERR) { + if (yyvsp[-2].i == ERR && yyvsp[0].i != ERR) { lc_error("If the door wall is random, so must be its pos!"); } else { add_opvars(splev, "iiiio", - VA_PASS5((long)(yyvsp[0].i), (long)(yyvsp[-4].i), (long)(yyvsp[-6].i), - (long)(yyvsp[-2].i), SPO_ROOM_DOOR)); + VA_PASS5((long)yyvsp[0].i, (long)yyvsp[-4].i, (long)yyvsp[-6].i, + (long)yyvsp[-2].i, SPO_ROOM_DOOR)); } } -#line 3728 "y.tab.c" /* yacc.c:1646 */ - break; - - case 184: -#line 1332 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "io", VA_PASS2((long)(yyvsp[-2].i), SPO_DOOR)); +break; +case 183: +{ + add_opvars(splev, "io", VA_PASS2((long)yyvsp[-2].i, SPO_DOOR)); } -#line 3736 "y.tab.c" /* yacc.c:1646 */ - break; - - case 189: -#line 1346 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (yyvsp[0].i); +break; +case 188: +{ + yyval.i = yyvsp[0].i; } -#line 3744 "y.tab.c" /* yacc.c:1646 */ - break; - - case 190: -#line 1350 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = ((yyvsp[-2].i) | (yyvsp[0].i)); +break; +case 189: +{ + yyval.i = (yyvsp[-2].i | yyvsp[0].i); } -#line 3752 "y.tab.c" /* yacc.c:1646 */ - break; - - case 193: -#line 1360 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 192: +{ add_opvars(splev, "ciisiio", VA_PASS7(0, 0, 1, (char *)0, 0, 0, SPO_MAP)); max_x_map = COLNO-1; max_y_map = ROWNO; } -#line 3763 "y.tab.c" /* yacc.c:1646 */ - break; - - case 194: -#line 1367 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 193: +{ add_opvars(splev, "cii", - VA_PASS3(SP_COORD_PACK(((yyvsp[-4].i)),((yyvsp[-2].i))), - 1, (long)(yyvsp[-1].i))); - scan_map((yyvsp[0].map), splev); - Free((yyvsp[0].map)); + VA_PASS3(SP_COORD_PACK((yyvsp[-4].i),(yyvsp[-2].i)), + 1, (long)yyvsp[-1].i)); + scan_map(yyvsp[0].map, splev); + Free(yyvsp[0].map); } -#line 3775 "y.tab.c" /* yacc.c:1646 */ - break; - - case 195: -#line 1375 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "ii", VA_PASS2(2, (long)(yyvsp[-1].i))); - scan_map((yyvsp[0].map), splev); - Free((yyvsp[0].map)); +break; +case 194: +{ + add_opvars(splev, "ii", VA_PASS2(2, (long)yyvsp[-1].i)); + scan_map(yyvsp[0].map, splev); + Free(yyvsp[0].map); } -#line 3785 "y.tab.c" /* yacc.c:1646 */ - break; - - case 200: -#line 1391 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 199: +{ add_opvars(splev, "io", VA_PASS2(0, SPO_MONSTER)); } -#line 3793 "y.tab.c" /* yacc.c:1646 */ - break; - - case 201: -#line 1395 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 200: +{ add_opvars(splev, "io", VA_PASS2(1, SPO_MONSTER)); in_container_obj++; break_stmt_start(); } -#line 3803 "y.tab.c" /* yacc.c:1646 */ - break; - - case 202: -#line 1401 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 201: +{ break_stmt_end(splev); in_container_obj--; add_opvars(splev, "o", VA_PASS1(SPO_END_MONINVENT)); } -#line 3813 "y.tab.c" /* yacc.c:1646 */ - break; - - case 203: -#line 1409 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 202: +{ /* nothing */ } -#line 3821 "y.tab.c" /* yacc.c:1646 */ - break; - - case 204: -#line 1415 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 203: +{ struct opvar *stopit = New(struct opvar); set_opvar_int(stopit, SP_M_V_END); add_opcode(splev, SPO_PUSH, stopit); - (yyval.i) = 0x0000; + yyval.i = 0x0000; } -#line 3832 "y.tab.c" /* yacc.c:1646 */ - break; - - case 205: -#line 1422 "lev_comp.y" /* yacc.c:1646 */ - { - if (( (yyvsp[-2].i) & (yyvsp[0].i) )) +break; +case 204: +{ + if (( yyvsp[-2].i & yyvsp[0].i )) lc_error("MONSTER extra info defined twice."); - (yyval.i) = ( (yyvsp[-2].i) | (yyvsp[0].i) ); + yyval.i = ( yyvsp[-2].i | yyvsp[0].i ); } -#line 3842 "y.tab.c" /* yacc.c:1646 */ - break; - - case 206: -#line 1430 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 205: +{ add_opvars(splev, "i", VA_PASS1(SP_M_V_NAME)); - (yyval.i) = 0x0001; + yyval.i = 0x0001; } -#line 3851 "y.tab.c" /* yacc.c:1646 */ - break; - - case 207: -#line 1435 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 206: +{ add_opvars(splev, "ii", - VA_PASS2((long)(yyvsp[0].i), SP_M_V_PEACEFUL)); - (yyval.i) = 0x0002; + VA_PASS2((long)yyvsp[0].i, SP_M_V_PEACEFUL)); + yyval.i = 0x0002; } -#line 3861 "y.tab.c" /* yacc.c:1646 */ - break; - - case 208: -#line 1441 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 207: +{ add_opvars(splev, "ii", - VA_PASS2((long)(yyvsp[0].i), SP_M_V_ASLEEP)); - (yyval.i) = 0x0004; + VA_PASS2((long)yyvsp[0].i, SP_M_V_ASLEEP)); + yyval.i = 0x0004; } -#line 3871 "y.tab.c" /* yacc.c:1646 */ - break; - - case 209: -#line 1447 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 208: +{ add_opvars(splev, "ii", - VA_PASS2((long)(yyvsp[0].i), SP_M_V_ALIGN)); - (yyval.i) = 0x0008; + VA_PASS2((long)yyvsp[0].i, SP_M_V_ALIGN)); + yyval.i = 0x0008; } -#line 3881 "y.tab.c" /* yacc.c:1646 */ - break; - - case 210: -#line 1453 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 209: +{ add_opvars(splev, "ii", - VA_PASS2((long)(yyvsp[-1].i), SP_M_V_APPEAR)); - (yyval.i) = 0x0010; + VA_PASS2((long)yyvsp[-1].i, SP_M_V_APPEAR)); + yyval.i = 0x0010; } -#line 3891 "y.tab.c" /* yacc.c:1646 */ - break; - - case 211: -#line 1459 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 210: +{ add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_FEMALE)); - (yyval.i) = 0x0020; + yyval.i = 0x0020; } -#line 3900 "y.tab.c" /* yacc.c:1646 */ - break; - - case 212: -#line 1464 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 211: +{ add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_INVIS)); - (yyval.i) = 0x0040; + yyval.i = 0x0040; } -#line 3909 "y.tab.c" /* yacc.c:1646 */ - break; - - case 213: -#line 1469 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 212: +{ add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_CANCELLED)); - (yyval.i) = 0x0080; + yyval.i = 0x0080; } -#line 3918 "y.tab.c" /* yacc.c:1646 */ - break; - - case 214: -#line 1474 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 213: +{ add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_REVIVED)); - (yyval.i) = 0x0100; + yyval.i = 0x0100; } -#line 3927 "y.tab.c" /* yacc.c:1646 */ - break; - - case 215: -#line 1479 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 214: +{ add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_AVENGE)); - (yyval.i) = 0x0200; + yyval.i = 0x0200; } -#line 3936 "y.tab.c" /* yacc.c:1646 */ - break; - - case 216: -#line 1484 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 215: +{ add_opvars(splev, "i", VA_PASS1(SP_M_V_FLEEING)); - (yyval.i) = 0x0400; + yyval.i = 0x0400; } -#line 3945 "y.tab.c" /* yacc.c:1646 */ - break; - - case 217: -#line 1489 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 216: +{ add_opvars(splev, "i", VA_PASS1(SP_M_V_BLINDED)); - (yyval.i) = 0x0800; + yyval.i = 0x0800; } -#line 3954 "y.tab.c" /* yacc.c:1646 */ - break; - - case 218: -#line 1494 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 217: +{ add_opvars(splev, "i", VA_PASS1(SP_M_V_PARALYZED)); - (yyval.i) = 0x1000; + yyval.i = 0x1000; } -#line 3963 "y.tab.c" /* yacc.c:1646 */ - break; - - case 219: -#line 1499 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 218: +{ add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_STUNNED)); - (yyval.i) = 0x2000; + yyval.i = 0x2000; } -#line 3972 "y.tab.c" /* yacc.c:1646 */ - break; - - case 220: -#line 1504 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 219: +{ add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_CONFUSED)); - (yyval.i) = 0x4000; + yyval.i = 0x4000; } -#line 3981 "y.tab.c" /* yacc.c:1646 */ - break; - - case 221: -#line 1509 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 220: +{ add_opvars(splev, "ii", - VA_PASS2((long)(yyvsp[0].i), SP_M_V_SEENTRAPS)); - (yyval.i) = 0x8000; + VA_PASS2((long)yyvsp[0].i, SP_M_V_SEENTRAPS)); + yyval.i = 0x8000; } -#line 3991 "y.tab.c" /* yacc.c:1646 */ - break; - - case 222: -#line 1517 "lev_comp.y" /* yacc.c:1646 */ - { - int token = get_trap_type((yyvsp[0].map)); +break; +case 221: +{ + int token = get_trap_type(yyvsp[0].map); if (token == ERR || token == 0) - lc_error("Unknown trap type '%s'!", (yyvsp[0].map)); - Free((yyvsp[0].map)); - (yyval.i) = (1L << (token - 1)); + lc_error("Unknown trap type '%s'!", yyvsp[0].map); + Free(yyvsp[0].map); + yyval.i = (1L << (token - 1)); } -#line 4003 "y.tab.c" /* yacc.c:1646 */ - break; - - case 223: -#line 1525 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (long) ~0; +break; +case 222: +{ + yyval.i = (long) ~0; } -#line 4011 "y.tab.c" /* yacc.c:1646 */ - break; - - case 224: -#line 1529 "lev_comp.y" /* yacc.c:1646 */ - { - int token = get_trap_type((yyvsp[-2].map)); +break; +case 223: +{ + int token = get_trap_type(yyvsp[-2].map); if (token == ERR || token == 0) - lc_error("Unknown trap type '%s'!", (yyvsp[-2].map)); + lc_error("Unknown trap type '%s'!", yyvsp[-2].map); - if ((1L << (token - 1)) & (yyvsp[0].i)) - lc_error("Monster seen_traps, trap '%s' listed twice.", (yyvsp[-2].map)); - Free((yyvsp[-2].map)); - (yyval.i) = ((1L << (token - 1)) | (yyvsp[0].i)); + if ((1L << (token - 1)) & yyvsp[0].i) + lc_error("Monster seen_traps, trap '%s' listed twice.", yyvsp[-2].map); + Free(yyvsp[-2].map); + yyval.i = ((1L << (token - 1)) | yyvsp[0].i); } -#line 4026 "y.tab.c" /* yacc.c:1646 */ - break; - - case 225: -#line 1542 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 224: +{ long cnt = 0; if (in_container_obj) cnt |= SP_OBJ_CONTENT; add_opvars(splev, "io", VA_PASS2(cnt, SPO_OBJECT)); } -#line 4036 "y.tab.c" /* yacc.c:1646 */ - break; - - case 226: -#line 1548 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 225: +{ long cnt = SP_OBJ_CONTAINER; if (in_container_obj) cnt |= SP_OBJ_CONTENT; add_opvars(splev, "io", VA_PASS2(cnt, SPO_OBJECT)); in_container_obj++; break_stmt_start(); } -#line 4048 "y.tab.c" /* yacc.c:1646 */ - break; - - case 227: -#line 1556 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 226: +{ break_stmt_end(splev); in_container_obj--; add_opcode(splev, SPO_POP_CONTAINER, NULL); } -#line 4058 "y.tab.c" /* yacc.c:1646 */ - break; - - case 228: -#line 1564 "lev_comp.y" /* yacc.c:1646 */ - { - if (( (yyvsp[0].i) & 0x4000) && in_container_obj) +break; +case 227: +{ + if (( yyvsp[0].i & 0x4000) && in_container_obj) lc_error("Object cannot have a coord when contained."); - else if (!( (yyvsp[0].i) & 0x4000) && !in_container_obj) + else if (!( yyvsp[0].i & 0x4000) && !in_container_obj) lc_error("Object needs a coord when not contained."); } -#line 4069 "y.tab.c" /* yacc.c:1646 */ - break; - - case 229: -#line 1573 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 228: +{ struct opvar *stopit = New(struct opvar); set_opvar_int(stopit, SP_O_V_END); add_opcode(splev, SPO_PUSH, stopit); - (yyval.i) = 0x00; + yyval.i = 0x00; } -#line 4080 "y.tab.c" /* yacc.c:1646 */ - break; - - case 230: -#line 1580 "lev_comp.y" /* yacc.c:1646 */ - { - if (( (yyvsp[-2].i) & (yyvsp[0].i) )) +break; +case 229: +{ + if (( yyvsp[-2].i & yyvsp[0].i )) lc_error("OBJECT extra info '%s' defined twice.", curr_token); - (yyval.i) = ( (yyvsp[-2].i) | (yyvsp[0].i) ); + yyval.i = ( yyvsp[-2].i | yyvsp[0].i ); } -#line 4090 "y.tab.c" /* yacc.c:1646 */ - break; - - case 231: -#line 1588 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 230: +{ add_opvars(splev, "ii", - VA_PASS2((long)(yyvsp[0].i), SP_O_V_CURSE)); - (yyval.i) = 0x0001; + VA_PASS2((long)yyvsp[0].i, SP_O_V_CURSE)); + yyval.i = 0x0001; } -#line 4100 "y.tab.c" /* yacc.c:1646 */ - break; - - case 232: -#line 1594 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 231: +{ add_opvars(splev, "i", VA_PASS1(SP_O_V_CORPSENM)); - (yyval.i) = 0x0002; + yyval.i = 0x0002; } -#line 4109 "y.tab.c" /* yacc.c:1646 */ - break; - - case 233: -#line 1599 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 232: +{ add_opvars(splev, "i", VA_PASS1(SP_O_V_SPE)); - (yyval.i) = 0x0004; + yyval.i = 0x0004; } -#line 4118 "y.tab.c" /* yacc.c:1646 */ - break; - - case 234: -#line 1604 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 233: +{ add_opvars(splev, "i", VA_PASS1(SP_O_V_NAME)); - (yyval.i) = 0x0008; + yyval.i = 0x0008; } -#line 4127 "y.tab.c" /* yacc.c:1646 */ - break; - - case 235: -#line 1609 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 234: +{ add_opvars(splev, "i", VA_PASS1(SP_O_V_QUAN)); - (yyval.i) = 0x0010; + yyval.i = 0x0010; } -#line 4136 "y.tab.c" /* yacc.c:1646 */ - break; - - case 236: -#line 1614 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 235: +{ add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_BURIED)); - (yyval.i) = 0x0020; + yyval.i = 0x0020; } -#line 4145 "y.tab.c" /* yacc.c:1646 */ - break; - - case 237: -#line 1619 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "ii", VA_PASS2((long)(yyvsp[0].i), SP_O_V_LIT)); - (yyval.i) = 0x0040; +break; +case 236: +{ + add_opvars(splev, "ii", VA_PASS2((long)yyvsp[0].i, SP_O_V_LIT)); + yyval.i = 0x0040; } -#line 4154 "y.tab.c" /* yacc.c:1646 */ - break; - - case 238: -#line 1624 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 237: +{ add_opvars(splev, "i", VA_PASS1(SP_O_V_ERODED)); - (yyval.i) = 0x0080; + yyval.i = 0x0080; } -#line 4163 "y.tab.c" /* yacc.c:1646 */ - break; - - case 239: -#line 1629 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 238: +{ add_opvars(splev, "ii", VA_PASS2(-1, SP_O_V_ERODED)); - (yyval.i) = 0x0080; + yyval.i = 0x0080; } -#line 4172 "y.tab.c" /* yacc.c:1646 */ - break; - - case 240: -#line 1634 "lev_comp.y" /* yacc.c:1646 */ - { - if ((yyvsp[0].i) == D_LOCKED) { +break; +case 239: +{ + if (yyvsp[0].i == D_LOCKED) { add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_LOCKED)); - (yyval.i) = 0x0100; - } else if ((yyvsp[0].i) == D_BROKEN) { + yyval.i = 0x0100; + } else if (yyvsp[0].i == D_BROKEN) { add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_BROKEN)); - (yyval.i) = 0x0200; + yyval.i = 0x0200; } else lc_error("DOOR state can only be locked or broken."); } -#line 4187 "y.tab.c" /* yacc.c:1646 */ - break; - - case 241: -#line 1645 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "ii", VA_PASS2((yyvsp[0].i), SP_O_V_TRAPPED)); - (yyval.i) = 0x0400; +break; +case 240: +{ + add_opvars(splev, "ii", VA_PASS2(yyvsp[0].i, SP_O_V_TRAPPED)); + yyval.i = 0x0400; } -#line 4196 "y.tab.c" /* yacc.c:1646 */ - break; - - case 242: -#line 1650 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 241: +{ add_opvars(splev, "i", VA_PASS1(SP_O_V_RECHARGED)); - (yyval.i) = 0x0800; + yyval.i = 0x0800; } -#line 4205 "y.tab.c" /* yacc.c:1646 */ - break; - - case 243: -#line 1655 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 242: +{ add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_INVIS)); - (yyval.i) = 0x1000; + yyval.i = 0x1000; } -#line 4214 "y.tab.c" /* yacc.c:1646 */ - break; - - case 244: -#line 1660 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 243: +{ add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_GREASED)); - (yyval.i) = 0x2000; + yyval.i = 0x2000; } -#line 4223 "y.tab.c" /* yacc.c:1646 */ - break; - - case 245: -#line 1665 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 244: +{ add_opvars(splev, "i", VA_PASS1(SP_O_V_COORD)); - (yyval.i) = 0x4000; + yyval.i = 0x4000; } -#line 4232 "y.tab.c" /* yacc.c:1646 */ - break; - - case 246: -#line 1672 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "io", VA_PASS2((long)(yyvsp[-2].i), SPO_TRAP)); +break; +case 245: +{ + add_opvars(splev, "io", VA_PASS2((long)yyvsp[-2].i, SPO_TRAP)); } -#line 4240 "y.tab.c" /* yacc.c:1646 */ - break; - - case 247: -#line 1678 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 246: +{ long dir, state = 0; /* convert dir from a DIRECTION to a DB_DIR */ - dir = (yyvsp[-2].i); + dir = yyvsp[-2].i; switch (dir) { case W_NORTH: dir = DB_NORTH; break; case W_SOUTH: dir = DB_SOUTH; break; @@ -4256,955 +3939,664 @@ yyreduce: break; } - if ( (yyvsp[0].i) == D_ISOPEN ) + if ( yyvsp[0].i == D_ISOPEN ) state = 1; - else if ( (yyvsp[0].i) == D_CLOSED ) + else if ( yyvsp[0].i == D_CLOSED ) state = 0; - else if ( (yyvsp[0].i) == -1 ) + else if ( yyvsp[0].i == -1 ) state = -1; else lc_error("A drawbridge can only be open, closed or random!"); add_opvars(splev, "iio", VA_PASS3(state, dir, SPO_DRAWBRIDGE)); } -#line 4271 "y.tab.c" /* yacc.c:1646 */ - break; - - case 248: -#line 1707 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 247: +{ add_opvars(splev, "iiio", - VA_PASS4((long)(yyvsp[0].i), 1, 0, SPO_MAZEWALK)); + VA_PASS4((long)yyvsp[0].i, 1, 0, SPO_MAZEWALK)); } -#line 4280 "y.tab.c" /* yacc.c:1646 */ - break; - - case 249: -#line 1712 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 248: +{ add_opvars(splev, "iiio", - VA_PASS4((long)(yyvsp[-3].i), (long)(yyvsp[-1].i), - (long)(yyvsp[0].i), SPO_MAZEWALK)); + VA_PASS4((long)yyvsp[-3].i, (long)yyvsp[-1].i, + (long)yyvsp[0].i, SPO_MAZEWALK)); } -#line 4290 "y.tab.c" /* yacc.c:1646 */ - break; - - case 250: -#line 1720 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 249: +{ add_opvars(splev, "rio", VA_PASS3(SP_REGION_PACK(-1,-1,-1,-1), 0, SPO_WALLIFY)); } -#line 4300 "y.tab.c" /* yacc.c:1646 */ - break; - - case 251: -#line 1726 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 250: +{ add_opvars(splev, "io", VA_PASS2(1, SPO_WALLIFY)); } -#line 4308 "y.tab.c" /* yacc.c:1646 */ - break; - - case 252: -#line 1732 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 251: +{ add_opvars(splev, "io", - VA_PASS2((long)(yyvsp[0].i), SPO_LADDER)); + VA_PASS2((long)yyvsp[0].i, SPO_LADDER)); } -#line 4317 "y.tab.c" /* yacc.c:1646 */ - break; - - case 253: -#line 1739 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 252: +{ add_opvars(splev, "io", - VA_PASS2((long)(yyvsp[0].i), SPO_STAIR)); + VA_PASS2((long)yyvsp[0].i, SPO_STAIR)); } -#line 4326 "y.tab.c" /* yacc.c:1646 */ - break; - - case 254: -#line 1746 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 253: +{ add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14((yyvsp[-4].lregn).x1, (yyvsp[-4].lregn).y1, (yyvsp[-4].lregn).x2, (yyvsp[-4].lregn).y2, (yyvsp[-4].lregn).area, - (yyvsp[-2].lregn).x1, (yyvsp[-2].lregn).y1, (yyvsp[-2].lregn).x2, (yyvsp[-2].lregn).y2, (yyvsp[-2].lregn).area, - (long)(((yyvsp[0].i)) ? LR_UPSTAIR : LR_DOWNSTAIR), + VA_PASS14(yyvsp[-4].lregn.x1, yyvsp[-4].lregn.y1, yyvsp[-4].lregn.x2, yyvsp[-4].lregn.y2, yyvsp[-4].lregn.area, + yyvsp[-2].lregn.x1, yyvsp[-2].lregn.y1, yyvsp[-2].lregn.x2, yyvsp[-2].lregn.y2, yyvsp[-2].lregn.area, + (long)((yyvsp[0].i) ? LR_UPSTAIR : LR_DOWNSTAIR), 0, (char *)0, SPO_LEVREGION)); } -#line 4338 "y.tab.c" /* yacc.c:1646 */ - break; - - case 255: -#line 1756 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 254: +{ add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14((yyvsp[-4].lregn).x1, (yyvsp[-4].lregn).y1, (yyvsp[-4].lregn).x2, (yyvsp[-4].lregn).y2, (yyvsp[-4].lregn).area, - (yyvsp[-2].lregn).x1, (yyvsp[-2].lregn).y1, (yyvsp[-2].lregn).x2, (yyvsp[-2].lregn).y2, (yyvsp[-2].lregn).area, - LR_PORTAL, 0, (yyvsp[0].map), SPO_LEVREGION)); - Free((yyvsp[0].map)); + VA_PASS14(yyvsp[-4].lregn.x1, yyvsp[-4].lregn.y1, yyvsp[-4].lregn.x2, yyvsp[-4].lregn.y2, yyvsp[-4].lregn.area, + yyvsp[-2].lregn.x1, yyvsp[-2].lregn.y1, yyvsp[-2].lregn.x2, yyvsp[-2].lregn.y2, yyvsp[-2].lregn.area, + LR_PORTAL, 0, yyvsp[0].map, SPO_LEVREGION)); + Free(yyvsp[0].map); } -#line 4350 "y.tab.c" /* yacc.c:1646 */ - break; - - case 256: -#line 1766 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 255: +{ long rtyp = 0; - switch((yyvsp[0].i)) { + switch(yyvsp[0].i) { case -1: rtyp = LR_TELE; break; case 0: rtyp = LR_DOWNTELE; break; case 1: rtyp = LR_UPTELE; break; } add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14((yyvsp[-3].lregn).x1, (yyvsp[-3].lregn).y1, (yyvsp[-3].lregn).x2, (yyvsp[-3].lregn).y2, (yyvsp[-3].lregn).area, - (yyvsp[-1].lregn).x1, (yyvsp[-1].lregn).y1, (yyvsp[-1].lregn).x2, (yyvsp[-1].lregn).y2, (yyvsp[-1].lregn).area, + VA_PASS14(yyvsp[-3].lregn.x1, yyvsp[-3].lregn.y1, yyvsp[-3].lregn.x2, yyvsp[-3].lregn.y2, yyvsp[-3].lregn.area, + yyvsp[-1].lregn.x1, yyvsp[-1].lregn.y1, yyvsp[-1].lregn.x2, yyvsp[-1].lregn.y2, yyvsp[-1].lregn.area, rtyp, 0, (char *)0, SPO_LEVREGION)); } -#line 4367 "y.tab.c" /* yacc.c:1646 */ - break; - - case 257: -#line 1781 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 256: +{ add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14((yyvsp[-2].lregn).x1, (yyvsp[-2].lregn).y1, (yyvsp[-2].lregn).x2, (yyvsp[-2].lregn).y2, (yyvsp[-2].lregn).area, - (yyvsp[0].lregn).x1, (yyvsp[0].lregn).y1, (yyvsp[0].lregn).x2, (yyvsp[0].lregn).y2, (yyvsp[0].lregn).area, + VA_PASS14(yyvsp[-2].lregn.x1, yyvsp[-2].lregn.y1, yyvsp[-2].lregn.x2, yyvsp[-2].lregn.y2, yyvsp[-2].lregn.area, + yyvsp[0].lregn.x1, yyvsp[0].lregn.y1, yyvsp[0].lregn.x2, yyvsp[0].lregn.y2, yyvsp[0].lregn.area, (long)LR_BRANCH, 0, (char *)0, SPO_LEVREGION)); } -#line 4379 "y.tab.c" /* yacc.c:1646 */ - break; - - case 258: -#line 1791 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = -1; +break; +case 257: +{ + yyval.i = -1; } -#line 4387 "y.tab.c" /* yacc.c:1646 */ - break; - - case 259: -#line 1795 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (yyvsp[0].i); +break; +case 258: +{ + yyval.i = yyvsp[0].i; } -#line 4395 "y.tab.c" /* yacc.c:1646 */ - break; - - case 260: -#line 1801 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 259: +{ add_opvars(splev, "o", VA_PASS1(SPO_FOUNTAIN)); } -#line 4403 "y.tab.c" /* yacc.c:1646 */ - break; - - case 261: -#line 1807 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 260: +{ add_opvars(splev, "o", VA_PASS1(SPO_SINK)); } -#line 4411 "y.tab.c" /* yacc.c:1646 */ - break; - - case 262: -#line 1813 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 261: +{ add_opvars(splev, "o", VA_PASS1(SPO_POOL)); } -#line 4419 "y.tab.c" /* yacc.c:1646 */ - break; - - case 263: -#line 1819 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.terr).lit = -2; - (yyval.terr).ter = what_map_char((char) (yyvsp[0].i)); +break; +case 262: +{ + yyval.terr.lit = -2; + yyval.terr.ter = what_map_char((char) yyvsp[0].i); } -#line 4428 "y.tab.c" /* yacc.c:1646 */ - break; - - case 264: -#line 1824 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.terr).lit = (yyvsp[-1].i); - (yyval.terr).ter = what_map_char((char) (yyvsp[-3].i)); +break; +case 263: +{ + yyval.terr.lit = yyvsp[-1].i; + yyval.terr.ter = what_map_char((char) yyvsp[-3].i); } -#line 4437 "y.tab.c" /* yacc.c:1646 */ - break; - - case 265: -#line 1831 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 264: +{ add_opvars(splev, "io", - VA_PASS2((yyvsp[0].i), SPO_REPLACETERRAIN)); + VA_PASS2(yyvsp[0].i, SPO_REPLACETERRAIN)); } -#line 4446 "y.tab.c" /* yacc.c:1646 */ - break; - - case 266: -#line 1838 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 265: +{ add_opvars(splev, "o", VA_PASS1(SPO_TERRAIN)); } -#line 4454 "y.tab.c" /* yacc.c:1646 */ - break; - - case 267: -#line 1844 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 266: +{ add_opvars(splev, "o", VA_PASS1(SPO_NON_DIGGABLE)); } -#line 4462 "y.tab.c" /* yacc.c:1646 */ - break; - - case 268: -#line 1850 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 267: +{ add_opvars(splev, "o", VA_PASS1(SPO_NON_PASSWALL)); } -#line 4470 "y.tab.c" /* yacc.c:1646 */ - break; - - case 269: -#line 1856 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 268: +{ long irr; - long rt = (yyvsp[-1].i); - long rflags = (yyvsp[0].i); + long rt = yyvsp[-1].i; + long rflags = yyvsp[0].i; if (rflags == -1) rflags = (1 << 0); if (!(rflags & 1)) rt += MAXRTYPE+1; irr = ((rflags & 2) != 0); add_opvars(splev, "iiio", - VA_PASS4((long)(yyvsp[-3].i), rt, rflags, SPO_REGION)); - (yyval.i) = (irr || (rflags & 1) || rt != OROOM); + VA_PASS4((long)yyvsp[-3].i, rt, rflags, SPO_REGION)); + yyval.i = (irr || (rflags & 1) || rt != OROOM); break_stmt_start(); } -#line 4488 "y.tab.c" /* yacc.c:1646 */ - break; - - case 270: -#line 1870 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 269: +{ break_stmt_end(splev); - if ( (yyvsp[-1].i) ) { + if ( yyvsp[-1].i ) { add_opcode(splev, SPO_ENDROOM, NULL); - } else if ( (yyvsp[0].i) ) + } else if ( yyvsp[0].i ) lc_error("Cannot use lev statements in non-permanent REGION"); } -#line 4500 "y.tab.c" /* yacc.c:1646 */ - break; - - case 271: -#line 1880 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = 0; +break; +case 270: +{ + yyval.i = 0; } -#line 4508 "y.tab.c" /* yacc.c:1646 */ - break; - - case 272: -#line 1884 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (yyvsp[0].i); +break; +case 271: +{ + yyval.i = yyvsp[0].i; } -#line 4516 "y.tab.c" /* yacc.c:1646 */ - break; - - case 273: -#line 1890 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 272: +{ add_opvars(splev, "iio", - VA_PASS3((long)(yyvsp[0].i), (long)(yyvsp[-2].i), SPO_ALTAR)); + VA_PASS3((long)yyvsp[0].i, (long)yyvsp[-2].i, SPO_ALTAR)); } -#line 4525 "y.tab.c" /* yacc.c:1646 */ - break; - - case 274: -#line 1897 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 273: +{ add_opvars(splev, "io", VA_PASS2(2, SPO_GRAVE)); } -#line 4533 "y.tab.c" /* yacc.c:1646 */ - break; - - case 275: -#line 1901 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 274: +{ add_opvars(splev, "sio", VA_PASS3((char *)0, 1, SPO_GRAVE)); } -#line 4542 "y.tab.c" /* yacc.c:1646 */ - break; - - case 276: -#line 1906 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 275: +{ add_opvars(splev, "sio", VA_PASS3((char *)0, 0, SPO_GRAVE)); } -#line 4551 "y.tab.c" /* yacc.c:1646 */ - break; - - case 277: -#line 1913 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 276: +{ add_opvars(splev, "o", VA_PASS1(SPO_GOLD)); } -#line 4559 "y.tab.c" /* yacc.c:1646 */ - break; - - case 278: -#line 1919 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 277: +{ add_opvars(splev, "io", - VA_PASS2((long)(yyvsp[-2].i), SPO_ENGRAVING)); + VA_PASS2((long)yyvsp[-2].i, SPO_ENGRAVING)); } -#line 4568 "y.tab.c" /* yacc.c:1646 */ - break; - - case 279: -#line 1926 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 278: +{ add_opvars(splev, "o", VA_PASS1(SPO_MINERALIZE)); } -#line 4576 "y.tab.c" /* yacc.c:1646 */ - break; - - case 280: -#line 1930 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 279: +{ add_opvars(splev, "iiiio", VA_PASS5(-1L, -1L, -1L, -1L, SPO_MINERALIZE)); } -#line 4585 "y.tab.c" /* yacc.c:1646 */ - break; - - case 281: -#line 1937 "lev_comp.y" /* yacc.c:1646 */ - { - int token = get_trap_type((yyvsp[0].map)); +break; +case 280: +{ + int token = get_trap_type(yyvsp[0].map); if (token == ERR) - lc_error("Unknown trap type '%s'!", (yyvsp[0].map)); - (yyval.i) = token; - Free((yyvsp[0].map)); + lc_error("Unknown trap type '%s'!", yyvsp[0].map); + yyval.i = token; + Free(yyvsp[0].map); } -#line 4597 "y.tab.c" /* yacc.c:1646 */ - break; - - case 283: -#line 1948 "lev_comp.y" /* yacc.c:1646 */ - { - int token = get_room_type((yyvsp[0].map)); +break; +case 282: +{ + int token = get_room_type(yyvsp[0].map); if (token == ERR) { - lc_warning("Unknown room type \"%s\"! Making ordinary room...", (yyvsp[0].map)); - (yyval.i) = OROOM; + lc_warning("Unknown room type \"%s\"! Making ordinary room...", yyvsp[0].map); + yyval.i = OROOM; } else - (yyval.i) = token; - Free((yyvsp[0].map)); + yyval.i = token; + Free(yyvsp[0].map); } -#line 4611 "y.tab.c" /* yacc.c:1646 */ - break; - - case 285: -#line 1961 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = -1; +break; +case 284: +{ + yyval.i = -1; } -#line 4619 "y.tab.c" /* yacc.c:1646 */ - break; - - case 286: -#line 1965 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (yyvsp[0].i); +break; +case 285: +{ + yyval.i = yyvsp[0].i; } -#line 4627 "y.tab.c" /* yacc.c:1646 */ - break; - - case 287: -#line 1971 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (yyvsp[0].i); +break; +case 286: +{ + yyval.i = yyvsp[0].i; } -#line 4635 "y.tab.c" /* yacc.c:1646 */ - break; - - case 288: -#line 1975 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (yyvsp[-2].i) | (yyvsp[0].i); +break; +case 287: +{ + yyval.i = yyvsp[-2].i | yyvsp[0].i; } -#line 4643 "y.tab.c" /* yacc.c:1646 */ - break; - - case 289: -#line 1982 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = ((yyvsp[0].i) << 0); +break; +case 288: +{ + yyval.i = (yyvsp[0].i << 0); } -#line 4651 "y.tab.c" /* yacc.c:1646 */ - break; - - case 290: -#line 1986 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = ((yyvsp[0].i) << 1); +break; +case 289: +{ + yyval.i = (yyvsp[0].i << 1); } -#line 4659 "y.tab.c" /* yacc.c:1646 */ - break; - - case 291: -#line 1990 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = ((yyvsp[0].i) << 2); +break; +case 290: +{ + yyval.i = (yyvsp[0].i << 2); } -#line 4667 "y.tab.c" /* yacc.c:1646 */ - break; - - case 298: -#line 2006 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = - MAX_REGISTERS - 1; +break; +case 297: +{ + yyval.i = - MAX_REGISTERS - 1; } -#line 4675 "y.tab.c" /* yacc.c:1646 */ - break; - - case 301: -#line 2014 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = - MAX_REGISTERS - 1; +break; +case 300: +{ + yyval.i = - MAX_REGISTERS - 1; } -#line 4683 "y.tab.c" /* yacc.c:1646 */ - break; - - case 304: -#line 2024 "lev_comp.y" /* yacc.c:1646 */ - { - if ( (yyvsp[-1].i) >= 3 ) +break; +case 303: +{ + if ( yyvsp[-1].i >= 3 ) lc_error("Register Index overflow!"); else - (yyval.i) = - (yyvsp[-1].i) - 1; + yyval.i = - yyvsp[-1].i - 1; } -#line 4694 "y.tab.c" /* yacc.c:1646 */ - break; - - case 305: -#line 2033 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "s", VA_PASS1((yyvsp[0].map))); - Free((yyvsp[0].map)); +break; +case 304: +{ + add_opvars(splev, "s", VA_PASS1(yyvsp[0].map)); + Free(yyvsp[0].map); } -#line 4703 "y.tab.c" /* yacc.c:1646 */ - break; - - case 306: -#line 2038 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_STRING); - vardef_used(variable_definitions, (yyvsp[0].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); - Free((yyvsp[0].map)); +break; +case 305: +{ + check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_STRING); + vardef_used(variable_definitions, yyvsp[0].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); + Free(yyvsp[0].map); } -#line 4714 "y.tab.c" /* yacc.c:1646 */ - break; - - case 307: -#line 2045 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_STRING|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[-3].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); - Free((yyvsp[-3].map)); +break; +case 306: +{ + check_vardef_type(variable_definitions, yyvsp[-3].map, SPOVAR_STRING|SPOVAR_ARRAY); + vardef_used(variable_definitions, yyvsp[-3].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); + Free(yyvsp[-3].map); } -#line 4725 "y.tab.c" /* yacc.c:1646 */ - break; - - case 308: -#line 2055 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 307: +{ /* nothing */ } -#line 4733 "y.tab.c" /* yacc.c:1646 */ - break; - - case 309: -#line 2061 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "c", VA_PASS1((yyvsp[0].i))); +break; +case 308: +{ + add_opvars(splev, "c", VA_PASS1(yyvsp[0].i)); } -#line 4741 "y.tab.c" /* yacc.c:1646 */ - break; - - case 310: -#line 2065 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 309: +{ add_opvars(splev, "o", VA_PASS1(SPO_SEL_RNDCOORD)); } -#line 4749 "y.tab.c" /* yacc.c:1646 */ - break; - - case 311: -#line 2069 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_COORD); - vardef_used(variable_definitions, (yyvsp[0].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); - Free((yyvsp[0].map)); +break; +case 310: +{ + check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_COORD); + vardef_used(variable_definitions, yyvsp[0].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); + Free(yyvsp[0].map); } -#line 4760 "y.tab.c" /* yacc.c:1646 */ - break; - - case 312: -#line 2076 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_COORD|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[-3].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); - Free((yyvsp[-3].map)); +break; +case 311: +{ + check_vardef_type(variable_definitions, yyvsp[-3].map, SPOVAR_COORD|SPOVAR_ARRAY); + vardef_used(variable_definitions, yyvsp[-3].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); + Free(yyvsp[-3].map); } -#line 4771 "y.tab.c" /* yacc.c:1646 */ - break; - - case 313: -#line 2085 "lev_comp.y" /* yacc.c:1646 */ - { - if ((yyvsp[-3].i) < 0 || (yyvsp[-1].i) < 0 || (yyvsp[-3].i) >= COLNO || (yyvsp[-1].i) >= ROWNO) - lc_error("Coordinates (%li,%li) out of map range!", (yyvsp[-3].i), (yyvsp[-1].i)); - (yyval.i) = SP_COORD_PACK((yyvsp[-3].i), (yyvsp[-1].i)); +break; +case 312: +{ + if (yyvsp[-3].i < 0 || yyvsp[-1].i < 0 || yyvsp[-3].i >= COLNO || yyvsp[-1].i >= ROWNO) + lc_error("Coordinates (%li,%li) out of map range!", yyvsp[-3].i, yyvsp[-1].i); + yyval.i = SP_COORD_PACK(yyvsp[-3].i, yyvsp[-1].i); } -#line 4781 "y.tab.c" /* yacc.c:1646 */ - break; - - case 314: -#line 2091 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = SP_COORD_PACK_RANDOM(0); +break; +case 313: +{ + yyval.i = SP_COORD_PACK_RANDOM(0); } -#line 4789 "y.tab.c" /* yacc.c:1646 */ - break; - - case 315: -#line 2095 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = SP_COORD_PACK_RANDOM( (yyvsp[-1].i) ); +break; +case 314: +{ + yyval.i = SP_COORD_PACK_RANDOM( yyvsp[-1].i ); } -#line 4797 "y.tab.c" /* yacc.c:1646 */ - break; - - case 316: -#line 2101 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (yyvsp[0].i); +break; +case 315: +{ + yyval.i = yyvsp[0].i; } -#line 4805 "y.tab.c" /* yacc.c:1646 */ - break; - - case 317: -#line 2105 "lev_comp.y" /* yacc.c:1646 */ - { - if (((yyvsp[-2].i) & (yyvsp[0].i))) +break; +case 316: +{ + if ((yyvsp[-2].i & yyvsp[0].i)) lc_warning("Humidity flag used twice."); - (yyval.i) = ((yyvsp[-2].i) | (yyvsp[0].i)); + yyval.i = (yyvsp[-2].i | yyvsp[0].i); } -#line 4815 "y.tab.c" /* yacc.c:1646 */ - break; - - case 318: -#line 2113 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 317: +{ /* nothing */ } -#line 4823 "y.tab.c" /* yacc.c:1646 */ - break; - - case 319: -#line 2117 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_REGION); - vardef_used(variable_definitions, (yyvsp[0].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); - Free((yyvsp[0].map)); +break; +case 318: +{ + check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_REGION); + vardef_used(variable_definitions, yyvsp[0].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); + Free(yyvsp[0].map); } -#line 4834 "y.tab.c" /* yacc.c:1646 */ - break; - - case 320: -#line 2124 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_REGION|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[-3].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); - Free((yyvsp[-3].map)); +break; +case 319: +{ + check_vardef_type(variable_definitions, yyvsp[-3].map, SPOVAR_REGION|SPOVAR_ARRAY); + vardef_used(variable_definitions, yyvsp[-3].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); + Free(yyvsp[-3].map); } -#line 4845 "y.tab.c" /* yacc.c:1646 */ - break; - - case 321: -#line 2133 "lev_comp.y" /* yacc.c:1646 */ - { - long r = SP_REGION_PACK((yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); - if ( (yyvsp[-7].i) > (yyvsp[-3].i) || (yyvsp[-5].i) > (yyvsp[-1].i) ) - lc_error("Region start > end: (%li,%li,%li,%li)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); +break; +case 320: +{ + long r = SP_REGION_PACK(yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); + if ( yyvsp[-7].i > yyvsp[-3].i || yyvsp[-5].i > yyvsp[-1].i ) + lc_error("Region start > end: (%li,%li,%li,%li)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); add_opvars(splev, "r", VA_PASS1(r)); - (yyval.i) = r; + yyval.i = r; } -#line 4858 "y.tab.c" /* yacc.c:1646 */ - break; - - case 322: -#line 2144 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "m", VA_PASS1((yyvsp[0].i))); +break; +case 321: +{ + add_opvars(splev, "m", VA_PASS1(yyvsp[0].i)); } -#line 4866 "y.tab.c" /* yacc.c:1646 */ - break; - - case 323: -#line 2148 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_MAPCHAR); - vardef_used(variable_definitions, (yyvsp[0].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); - Free((yyvsp[0].map)); +break; +case 322: +{ + check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_MAPCHAR); + vardef_used(variable_definitions, yyvsp[0].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); + Free(yyvsp[0].map); } -#line 4877 "y.tab.c" /* yacc.c:1646 */ - break; - - case 324: -#line 2155 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[-3].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); - Free((yyvsp[-3].map)); +break; +case 323: +{ + check_vardef_type(variable_definitions, yyvsp[-3].map, SPOVAR_MAPCHAR|SPOVAR_ARRAY); + vardef_used(variable_definitions, yyvsp[-3].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); + Free(yyvsp[-3].map); } -#line 4888 "y.tab.c" /* yacc.c:1646 */ - break; - - case 325: -#line 2164 "lev_comp.y" /* yacc.c:1646 */ - { - if (what_map_char((char) (yyvsp[0].i)) != INVALID_TYPE) - (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[0].i)), -2); +break; +case 324: +{ + if (what_map_char((char) yyvsp[0].i) != INVALID_TYPE) + yyval.i = SP_MAPCHAR_PACK(what_map_char((char) yyvsp[0].i), -2); else { - lc_error("Unknown map char type '%c'!", (yyvsp[0].i)); - (yyval.i) = SP_MAPCHAR_PACK(STONE, -2); + lc_error("Unknown map char type '%c'!", yyvsp[0].i); + yyval.i = SP_MAPCHAR_PACK(STONE, -2); } } -#line 4901 "y.tab.c" /* yacc.c:1646 */ - break; - - case 326: -#line 2173 "lev_comp.y" /* yacc.c:1646 */ - { - if (what_map_char((char) (yyvsp[-3].i)) != INVALID_TYPE) - (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[-3].i)), (yyvsp[-1].i)); +break; +case 325: +{ + if (what_map_char((char) yyvsp[-3].i) != INVALID_TYPE) + yyval.i = SP_MAPCHAR_PACK(what_map_char((char) yyvsp[-3].i), yyvsp[-1].i); else { - lc_error("Unknown map char type '%c'!", (yyvsp[-3].i)); - (yyval.i) = SP_MAPCHAR_PACK(STONE, (yyvsp[-1].i)); + lc_error("Unknown map char type '%c'!", yyvsp[-3].i); + yyval.i = SP_MAPCHAR_PACK(STONE, yyvsp[-1].i); } } -#line 4914 "y.tab.c" /* yacc.c:1646 */ - break; - - case 327: -#line 2184 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "M", VA_PASS1((yyvsp[0].i))); +break; +case 326: +{ + add_opvars(splev, "M", VA_PASS1(yyvsp[0].i)); } -#line 4922 "y.tab.c" /* yacc.c:1646 */ - break; - - case 328: -#line 2188 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_MONST); - vardef_used(variable_definitions, (yyvsp[0].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); - Free((yyvsp[0].map)); +break; +case 327: +{ + check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_MONST); + vardef_used(variable_definitions, yyvsp[0].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); + Free(yyvsp[0].map); } -#line 4933 "y.tab.c" /* yacc.c:1646 */ - break; - - case 329: -#line 2195 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_MONST|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[-3].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); - Free((yyvsp[-3].map)); +break; +case 328: +{ + check_vardef_type(variable_definitions, yyvsp[-3].map, SPOVAR_MONST|SPOVAR_ARRAY); + vardef_used(variable_definitions, yyvsp[-3].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); + Free(yyvsp[-3].map); } -#line 4944 "y.tab.c" /* yacc.c:1646 */ - break; - - case 330: -#line 2204 "lev_comp.y" /* yacc.c:1646 */ - { - long m = get_monster_id((yyvsp[0].map), (char)0); +break; +case 329: +{ + long m = get_monster_id(yyvsp[0].map, (char)0); if (m == ERR) { - lc_error("Unknown monster \"%s\"!", (yyvsp[0].map)); - (yyval.i) = -1; + lc_error("Unknown monster \"%s\"!", yyvsp[0].map); + yyval.i = -1; } else - (yyval.i) = SP_MONST_PACK(m, def_monsyms[(int)mons[m].mlet].sym); - Free((yyvsp[0].map)); + yyval.i = SP_MONST_PACK(m, def_monsyms[(int)mons[m].mlet].sym); + Free(yyvsp[0].map); } -#line 4958 "y.tab.c" /* yacc.c:1646 */ - break; - - case 331: -#line 2214 "lev_comp.y" /* yacc.c:1646 */ - { - if (check_monster_char((char) (yyvsp[0].i))) - (yyval.i) = SP_MONST_PACK(-1, (yyvsp[0].i)); +break; +case 330: +{ + if (check_monster_char((char) yyvsp[0].i)) + yyval.i = SP_MONST_PACK(-1, yyvsp[0].i); else { - lc_error("Unknown monster class '%c'!", (yyvsp[0].i)); - (yyval.i) = -1; + lc_error("Unknown monster class '%c'!", yyvsp[0].i); + yyval.i = -1; } } -#line 4971 "y.tab.c" /* yacc.c:1646 */ - break; - - case 332: -#line 2223 "lev_comp.y" /* yacc.c:1646 */ - { - long m = get_monster_id((yyvsp[-1].map), (char) (yyvsp[-3].i)); +break; +case 331: +{ + long m = get_monster_id(yyvsp[-1].map, (char) yyvsp[-3].i); if (m == ERR) { - lc_error("Unknown monster ('%c', \"%s\")!", (yyvsp[-3].i), (yyvsp[-1].map)); - (yyval.i) = -1; + lc_error("Unknown monster ('%c', \"%s\")!", yyvsp[-3].i, yyvsp[-1].map); + yyval.i = -1; } else - (yyval.i) = SP_MONST_PACK(m, (yyvsp[-3].i)); - Free((yyvsp[-1].map)); + yyval.i = SP_MONST_PACK(m, yyvsp[-3].i); + Free(yyvsp[-1].map); } -#line 4985 "y.tab.c" /* yacc.c:1646 */ - break; - - case 333: -#line 2233 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = -1; +break; +case 332: +{ + yyval.i = -1; } -#line 4993 "y.tab.c" /* yacc.c:1646 */ - break; - - case 334: -#line 2239 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "O", VA_PASS1((yyvsp[0].i))); +break; +case 333: +{ + add_opvars(splev, "O", VA_PASS1(yyvsp[0].i)); } -#line 5001 "y.tab.c" /* yacc.c:1646 */ - break; - - case 335: -#line 2243 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_OBJ); - vardef_used(variable_definitions, (yyvsp[0].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); - Free((yyvsp[0].map)); +break; +case 334: +{ + check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_OBJ); + vardef_used(variable_definitions, yyvsp[0].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); + Free(yyvsp[0].map); } -#line 5012 "y.tab.c" /* yacc.c:1646 */ - break; - - case 336: -#line 2250 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_OBJ|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[-3].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); - Free((yyvsp[-3].map)); +break; +case 335: +{ + check_vardef_type(variable_definitions, yyvsp[-3].map, SPOVAR_OBJ|SPOVAR_ARRAY); + vardef_used(variable_definitions, yyvsp[-3].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); + Free(yyvsp[-3].map); } -#line 5023 "y.tab.c" /* yacc.c:1646 */ - break; - - case 337: -#line 2259 "lev_comp.y" /* yacc.c:1646 */ - { - long m = get_object_id((yyvsp[0].map), (char)0); +break; +case 336: +{ + long m = get_object_id(yyvsp[0].map, (char)0); if (m == ERR) { - lc_error("Unknown object \"%s\"!", (yyvsp[0].map)); - (yyval.i) = -1; + lc_error("Unknown object \"%s\"!", yyvsp[0].map); + yyval.i = -1; } else - (yyval.i) = SP_OBJ_PACK(m, 1); /* obj class != 0 to force generation of a specific item */ - Free((yyvsp[0].map)); + yyval.i = SP_OBJ_PACK(m, 1); /* obj class != 0 to force generation of a specific item */ + Free(yyvsp[0].map); } -#line 5037 "y.tab.c" /* yacc.c:1646 */ - break; - - case 338: -#line 2269 "lev_comp.y" /* yacc.c:1646 */ - { - if (check_object_char((char) (yyvsp[0].i))) - (yyval.i) = SP_OBJ_PACK(-1, (yyvsp[0].i)); +break; +case 337: +{ + if (check_object_char((char) yyvsp[0].i)) + yyval.i = SP_OBJ_PACK(-1, yyvsp[0].i); else { - lc_error("Unknown object class '%c'!", (yyvsp[0].i)); - (yyval.i) = -1; + lc_error("Unknown object class '%c'!", yyvsp[0].i); + yyval.i = -1; } } -#line 5050 "y.tab.c" /* yacc.c:1646 */ - break; - - case 339: -#line 2278 "lev_comp.y" /* yacc.c:1646 */ - { - long m = get_object_id((yyvsp[-1].map), (char) (yyvsp[-3].i)); +break; +case 338: +{ + long m = get_object_id(yyvsp[-1].map, (char) yyvsp[-3].i); if (m == ERR) { - lc_error("Unknown object ('%c', \"%s\")!", (yyvsp[-3].i), (yyvsp[-1].map)); - (yyval.i) = -1; + lc_error("Unknown object ('%c', \"%s\")!", yyvsp[-3].i, yyvsp[-1].map); + yyval.i = -1; } else - (yyval.i) = SP_OBJ_PACK(m, (yyvsp[-3].i)); - Free((yyvsp[-1].map)); + yyval.i = SP_OBJ_PACK(m, yyvsp[-3].i); + Free(yyvsp[-1].map); } -#line 5064 "y.tab.c" /* yacc.c:1646 */ - break; - - case 340: -#line 2288 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = -1; +break; +case 339: +{ + yyval.i = -1; } -#line 5072 "y.tab.c" /* yacc.c:1646 */ - break; - - case 341: -#line 2294 "lev_comp.y" /* yacc.c:1646 */ - { } -#line 5078 "y.tab.c" /* yacc.c:1646 */ - break; - - case 342: -#line 2296 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 340: +{ } +break; +case 341: +{ add_opvars(splev, "o", VA_PASS1(SPO_MATH_ADD)); } -#line 5086 "y.tab.c" /* yacc.c:1646 */ - break; - - case 343: -#line 2302 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "i", VA_PASS1((yyvsp[0].i))); +break; +case 342: +{ + add_opvars(splev, "i", VA_PASS1(yyvsp[0].i)); } -#line 5094 "y.tab.c" /* yacc.c:1646 */ - break; - - case 344: -#line 2306 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 343: +{ is_inconstant_number = 1; } -#line 5102 "y.tab.c" /* yacc.c:1646 */ - break; - - case 345: -#line 2310 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "i", VA_PASS1((yyvsp[-1].i))); +break; +case 344: +{ + add_opvars(splev, "i", VA_PASS1(yyvsp[-1].i)); } -#line 5110 "y.tab.c" /* yacc.c:1646 */ - break; - - case 346: -#line 2314 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_INT); - vardef_used(variable_definitions, (yyvsp[0].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); - Free((yyvsp[0].map)); +break; +case 345: +{ + check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_INT); + vardef_used(variable_definitions, yyvsp[0].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); + Free(yyvsp[0].map); is_inconstant_number = 1; } -#line 5122 "y.tab.c" /* yacc.c:1646 */ - break; - - case 347: -#line 2322 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 346: +{ check_vardef_type(variable_definitions, - (yyvsp[-3].map), SPOVAR_INT|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[-3].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); - Free((yyvsp[-3].map)); + yyvsp[-3].map, SPOVAR_INT|SPOVAR_ARRAY); + vardef_used(variable_definitions, yyvsp[-3].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); + Free(yyvsp[-3].map); is_inconstant_number = 1; } -#line 5135 "y.tab.c" /* yacc.c:1646 */ - break; - - case 348: -#line 2331 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 347: +{ add_opvars(splev, "o", VA_PASS1(SPO_MATH_ADD)); } -#line 5143 "y.tab.c" /* yacc.c:1646 */ - break; - - case 349: -#line 2335 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 348: +{ add_opvars(splev, "o", VA_PASS1(SPO_MATH_SUB)); } -#line 5151 "y.tab.c" /* yacc.c:1646 */ - break; - - case 350: -#line 2339 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 349: +{ add_opvars(splev, "o", VA_PASS1(SPO_MATH_MUL)); } -#line 5159 "y.tab.c" /* yacc.c:1646 */ - break; - - case 351: -#line 2343 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 350: +{ add_opvars(splev, "o", VA_PASS1(SPO_MATH_DIV)); } -#line 5167 "y.tab.c" /* yacc.c:1646 */ - break; - - case 352: -#line 2347 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 351: +{ add_opvars(splev, "o", VA_PASS1(SPO_MATH_MOD)); } -#line 5175 "y.tab.c" /* yacc.c:1646 */ - break; - - case 353: -#line 2350 "lev_comp.y" /* yacc.c:1646 */ - { } -#line 5181 "y.tab.c" /* yacc.c:1646 */ - break; - - case 354: -#line 2354 "lev_comp.y" /* yacc.c:1646 */ - { - if (!strcmp("int", (yyvsp[0].map)) || !strcmp("integer", (yyvsp[0].map))) { - (yyval.i) = (int)'i'; +break; +case 352: +{ } +break; +case 353: +{ + if (!strcmp("int", yyvsp[0].map) || !strcmp("integer", yyvsp[0].map)) { + yyval.i = (int)'i'; } else - lc_error("Unknown function parameter type '%s'", (yyvsp[0].map)); + lc_error("Unknown function parameter type '%s'", yyvsp[0].map); } -#line 5192 "y.tab.c" /* yacc.c:1646 */ - break; - - case 355: -#line 2361 "lev_comp.y" /* yacc.c:1646 */ - { - if (!strcmp("str", (yyvsp[0].map)) || !strcmp("string", (yyvsp[0].map))) { - (yyval.i) = (int)'s'; +break; +case 354: +{ + if (!strcmp("str", yyvsp[0].map) || !strcmp("string", yyvsp[0].map)) { + yyval.i = (int)'s'; } else - lc_error("Unknown function parameter type '%s'", (yyvsp[0].map)); + lc_error("Unknown function parameter type '%s'", yyvsp[0].map); } -#line 5203 "y.tab.c" /* yacc.c:1646 */ - break; - - case 356: -#line 2370 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 355: +{ struct lc_funcdefs_parm *tmp = New(struct lc_funcdefs_parm); if (!curr_function) { @@ -5213,8 +4605,8 @@ yyreduce: lc_error("Could not alloc function params."); } else { long vt; - tmp->name = strdup((yyvsp[-2].map)); - tmp->parmtype = (char) (yyvsp[0].i); + tmp->name = strdup(yyvsp[-2].map); + tmp->parmtype = (char) yyvsp[0].i; tmp->next = curr_function->params; curr_function->params = tmp; curr_function->n_params++; @@ -5225,569 +4617,285 @@ yyreduce: } variable_definitions = add_vardef_type( variable_definitions, - (yyvsp[-2].map), vt); + yyvsp[-2].map, vt); } - Free((yyvsp[-2].map)); + Free(yyvsp[-2].map); } -#line 5233 "y.tab.c" /* yacc.c:1646 */ - break; - - case 361: -#line 2406 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (int)'i'; +break; +case 360: +{ + yyval.i = (int)'i'; } -#line 5241 "y.tab.c" /* yacc.c:1646 */ - break; - - case 362: -#line 2410 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.i) = (int)'s'; +break; +case 361: +{ + yyval.i = (int)'s'; } -#line 5249 "y.tab.c" /* yacc.c:1646 */ - break; - - case 363: -#line 2417 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 362: +{ char tmpbuf[2]; - tmpbuf[0] = (char) (yyvsp[0].i); + tmpbuf[0] = (char) yyvsp[0].i; tmpbuf[1] = '\0'; - (yyval.map) = strdup(tmpbuf); + yyval.map = strdup(tmpbuf); } -#line 5260 "y.tab.c" /* yacc.c:1646 */ - break; - - case 364: -#line 2424 "lev_comp.y" /* yacc.c:1646 */ - { - long len = strlen( (yyvsp[-2].map) ); +break; +case 363: +{ + long len = strlen( yyvsp[-2].map ); char *tmp = (char *)alloc(len + 2); - sprintf(tmp, "%c%s", (char) (yyvsp[0].i), (yyvsp[-2].map) ); - Free( (yyvsp[-2].map) ); - (yyval.map) = tmp; + sprintf(tmp, "%c%s", (char) yyvsp[0].i, yyvsp[-2].map ); + Free( yyvsp[-2].map ); + yyval.map = tmp; } -#line 5272 "y.tab.c" /* yacc.c:1646 */ - break; - - case 365: -#line 2434 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.map) = strdup(""); +break; +case 364: +{ + yyval.map = strdup(""); } -#line 5280 "y.tab.c" /* yacc.c:1646 */ - break; - - case 366: -#line 2438 "lev_comp.y" /* yacc.c:1646 */ - { - char *tmp = strdup( (yyvsp[0].map) ); - Free( (yyvsp[0].map) ); - (yyval.map) = tmp; +break; +case 365: +{ + char *tmp = strdup( yyvsp[0].map ); + Free( yyvsp[0].map ); + yyval.map = tmp; } -#line 5290 "y.tab.c" /* yacc.c:1646 */ - break; - - case 367: -#line 2446 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 366: +{ add_opvars(splev, "o", VA_PASS1(SPO_SEL_POINT)); } -#line 5298 "y.tab.c" /* yacc.c:1646 */ - break; - - case 368: -#line 2450 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 367: +{ add_opvars(splev, "o", VA_PASS1(SPO_SEL_RECT)); } -#line 5306 "y.tab.c" /* yacc.c:1646 */ - break; - - case 369: -#line 2454 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 368: +{ add_opvars(splev, "o", VA_PASS1(SPO_SEL_FILLRECT)); } -#line 5314 "y.tab.c" /* yacc.c:1646 */ - break; - - case 370: -#line 2458 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 369: +{ add_opvars(splev, "o", VA_PASS1(SPO_SEL_LINE)); } -#line 5322 "y.tab.c" /* yacc.c:1646 */ - break; - - case 371: -#line 2462 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 370: +{ /* randline (x1,y1),(x2,y2), roughness */ add_opvars(splev, "o", VA_PASS1(SPO_SEL_RNDLINE)); } -#line 5331 "y.tab.c" /* yacc.c:1646 */ - break; - - case 372: -#line 2467 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 371: +{ add_opvars(splev, "io", VA_PASS2(W_ANY, SPO_SEL_GROW)); } -#line 5339 "y.tab.c" /* yacc.c:1646 */ - break; - - case 373: -#line 2471 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "io", VA_PASS2((yyvsp[-3].i), SPO_SEL_GROW)); +break; +case 372: +{ + add_opvars(splev, "io", VA_PASS2(yyvsp[-3].i, SPO_SEL_GROW)); } -#line 5347 "y.tab.c" /* yacc.c:1646 */ - break; - - case 374: -#line 2475 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 373: +{ add_opvars(splev, "iio", - VA_PASS3((yyvsp[-3].i), SPOFILTER_PERCENT, SPO_SEL_FILTER)); + VA_PASS3(yyvsp[-3].i, SPOFILTER_PERCENT, SPO_SEL_FILTER)); } -#line 5356 "y.tab.c" /* yacc.c:1646 */ - break; - - case 375: -#line 2480 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 374: +{ add_opvars(splev, "io", VA_PASS2(SPOFILTER_SELECTION, SPO_SEL_FILTER)); } -#line 5365 "y.tab.c" /* yacc.c:1646 */ - break; - - case 376: -#line 2485 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 375: +{ add_opvars(splev, "io", VA_PASS2(SPOFILTER_MAPCHAR, SPO_SEL_FILTER)); } -#line 5374 "y.tab.c" /* yacc.c:1646 */ - break; - - case 377: -#line 2490 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 376: +{ add_opvars(splev, "o", VA_PASS1(SPO_SEL_FLOOD)); } -#line 5382 "y.tab.c" /* yacc.c:1646 */ - break; - - case 378: -#line 2494 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 377: +{ add_opvars(splev, "oio", VA_PASS3(SPO_COPY, 1, SPO_SEL_ELLIPSE)); } -#line 5391 "y.tab.c" /* yacc.c:1646 */ - break; - - case 379: -#line 2499 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 378: +{ add_opvars(splev, "oio", - VA_PASS3(SPO_COPY, (yyvsp[-1].i), SPO_SEL_ELLIPSE)); + VA_PASS3(SPO_COPY, yyvsp[-1].i, SPO_SEL_ELLIPSE)); } -#line 5400 "y.tab.c" /* yacc.c:1646 */ - break; - - case 380: -#line 2504 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 379: +{ add_opvars(splev, "io", VA_PASS2(1, SPO_SEL_ELLIPSE)); } -#line 5408 "y.tab.c" /* yacc.c:1646 */ - break; - - case 381: -#line 2508 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "io", VA_PASS2((yyvsp[-1].i), SPO_SEL_ELLIPSE)); +break; +case 380: +{ + add_opvars(splev, "io", VA_PASS2(yyvsp[-1].i, SPO_SEL_ELLIPSE)); } -#line 5416 "y.tab.c" /* yacc.c:1646 */ - break; - - case 382: -#line 2512 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 381: +{ add_opvars(splev, "iio", - VA_PASS3((yyvsp[-5].i), (yyvsp[-11].i), SPO_SEL_GRADIENT)); + VA_PASS3(yyvsp[-5].i, yyvsp[-11].i, SPO_SEL_GRADIENT)); } -#line 5425 "y.tab.c" /* yacc.c:1646 */ - break; - - case 383: -#line 2517 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 382: +{ add_opvars(splev, "o", VA_PASS1(SPO_SEL_COMPLEMENT)); } -#line 5433 "y.tab.c" /* yacc.c:1646 */ - break; - - case 384: -#line 2521 "lev_comp.y" /* yacc.c:1646 */ - { - check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_SEL); - vardef_used(variable_definitions, (yyvsp[0].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); - Free((yyvsp[0].map)); +break; +case 383: +{ + check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_SEL); + vardef_used(variable_definitions, yyvsp[0].map); + add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); + Free(yyvsp[0].map); } -#line 5444 "y.tab.c" /* yacc.c:1646 */ - break; - - case 385: -#line 2528 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 384: +{ /* nothing */ } -#line 5452 "y.tab.c" /* yacc.c:1646 */ - break; - - case 386: -#line 2534 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 385: +{ /* nothing */ } -#line 5460 "y.tab.c" /* yacc.c:1646 */ - break; - - case 387: -#line 2538 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 386: +{ add_opvars(splev, "o", VA_PASS1(SPO_SEL_ADD)); } -#line 5468 "y.tab.c" /* yacc.c:1646 */ - break; - - case 388: -#line 2544 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 387: +{ add_opvars(splev, "iio", - VA_PASS3((yyvsp[0].dice).num, (yyvsp[0].dice).die, SPO_DICE)); + VA_PASS3(yyvsp[0].dice.num, yyvsp[0].dice.die, SPO_DICE)); } -#line 5477 "y.tab.c" /* yacc.c:1646 */ - break; - - case 392: -#line 2556 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "i", VA_PASS1((yyvsp[0].i))); +break; +case 391: +{ + add_opvars(splev, "i", VA_PASS1(yyvsp[0].i)); } -#line 5485 "y.tab.c" /* yacc.c:1646 */ - break; - - case 393: -#line 2560 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "i", VA_PASS1((yyvsp[0].i))); +break; +case 392: +{ + add_opvars(splev, "i", VA_PASS1(yyvsp[0].i)); } -#line 5493 "y.tab.c" /* yacc.c:1646 */ - break; - - case 394: -#line 2564 "lev_comp.y" /* yacc.c:1646 */ - { - add_opvars(splev, "i", VA_PASS1((yyvsp[0].i))); +break; +case 393: +{ + add_opvars(splev, "i", VA_PASS1(yyvsp[0].i)); } -#line 5501 "y.tab.c" /* yacc.c:1646 */ - break; - - case 395: -#line 2568 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 394: +{ /* nothing */ } -#line 5509 "y.tab.c" /* yacc.c:1646 */ - break; - - case 404: -#line 2590 "lev_comp.y" /* yacc.c:1646 */ - { - (yyval.lregn) = (yyvsp[0].lregn); +break; +case 403: +{ + yyval.lregn = yyvsp[0].lregn; } -#line 5517 "y.tab.c" /* yacc.c:1646 */ - break; - - case 405: -#line 2594 "lev_comp.y" /* yacc.c:1646 */ - { - if ((yyvsp[-7].i) <= 0 || (yyvsp[-7].i) >= COLNO) - lc_error("Region (%li,%li,%li,%li) out of level range (x1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); - else if ((yyvsp[-5].i) < 0 || (yyvsp[-5].i) >= ROWNO) - lc_error("Region (%li,%li,%li,%li) out of level range (y1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); - else if ((yyvsp[-3].i) <= 0 || (yyvsp[-3].i) >= COLNO) - lc_error("Region (%li,%li,%li,%li) out of level range (x2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); - else if ((yyvsp[-1].i) < 0 || (yyvsp[-1].i) >= ROWNO) - lc_error("Region (%li,%li,%li,%li) out of level range (y2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); - (yyval.lregn).x1 = (yyvsp[-7].i); - (yyval.lregn).y1 = (yyvsp[-5].i); - (yyval.lregn).x2 = (yyvsp[-3].i); - (yyval.lregn).y2 = (yyvsp[-1].i); - (yyval.lregn).area = 1; +break; +case 404: +{ + if (yyvsp[-7].i <= 0 || yyvsp[-7].i >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x1)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); + else if (yyvsp[-5].i < 0 || yyvsp[-5].i >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y1)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); + else if (yyvsp[-3].i <= 0 || yyvsp[-3].i >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x2)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); + else if (yyvsp[-1].i < 0 || yyvsp[-1].i >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y2)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); + yyval.lregn.x1 = yyvsp[-7].i; + yyval.lregn.y1 = yyvsp[-5].i; + yyval.lregn.x2 = yyvsp[-3].i; + yyval.lregn.y2 = yyvsp[-1].i; + yyval.lregn.area = 1; } -#line 5537 "y.tab.c" /* yacc.c:1646 */ - break; - - case 406: -#line 2612 "lev_comp.y" /* yacc.c:1646 */ - { +break; +case 405: +{ /* This series of if statements is a hack for MSC 5.1. It seems that its tiny little brain cannot compile if these are all one big if statement. */ - if ((yyvsp[-7].i) < 0 || (yyvsp[-7].i) > (int)max_x_map) - lc_error("Region (%li,%li,%li,%li) out of map range (x1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); - else if ((yyvsp[-5].i) < 0 || (yyvsp[-5].i) > (int)max_y_map) - lc_error("Region (%li,%li,%li,%li) out of map range (y1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); - else if ((yyvsp[-3].i) < 0 || (yyvsp[-3].i) > (int)max_x_map) - lc_error("Region (%li,%li,%li,%li) out of map range (x2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); - else if ((yyvsp[-1].i) < 0 || (yyvsp[-1].i) > (int)max_y_map) - lc_error("Region (%li,%li,%li,%li) out of map range (y2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); - (yyval.lregn).area = 0; - (yyval.lregn).x1 = (yyvsp[-7].i); - (yyval.lregn).y1 = (yyvsp[-5].i); - (yyval.lregn).x2 = (yyvsp[-3].i); - (yyval.lregn).y2 = (yyvsp[-1].i); + if (yyvsp[-7].i < 0 || yyvsp[-7].i > (int)max_x_map) + lc_error("Region (%li,%li,%li,%li) out of map range (x1)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); + else if (yyvsp[-5].i < 0 || yyvsp[-5].i > (int)max_y_map) + lc_error("Region (%li,%li,%li,%li) out of map range (y1)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); + else if (yyvsp[-3].i < 0 || yyvsp[-3].i > (int)max_x_map) + lc_error("Region (%li,%li,%li,%li) out of map range (x2)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); + else if (yyvsp[-1].i < 0 || yyvsp[-1].i > (int)max_y_map) + lc_error("Region (%li,%li,%li,%li) out of map range (y2)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); + yyval.lregn.area = 0; + yyval.lregn.x1 = yyvsp[-7].i; + yyval.lregn.y1 = yyvsp[-5].i; + yyval.lregn.x2 = yyvsp[-3].i; + yyval.lregn.y2 = yyvsp[-1].i; } -#line 5559 "y.tab.c" /* yacc.c:1646 */ - break; - - -#line 5563 "y.tab.c" /* yacc.c:1646 */ - default: break; +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 ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++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. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - 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 ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) + yyssp -= yym; + yystate = *yyssp; + yyvsp -= yym; + yym = yylhs[yyn]; + if (yystate == 0 && yym == 0) { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state 0 to\ + state %d\n", YYPREFIX, YYFINAL); #endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) + yystate = YYFINAL; + *++yyssp = YYFINAL; + *++yyvsp = yyval; + if (yychar < 0) { - /* 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 like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* 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. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) { - yyn = yytable[yyn]; - if (0 < yyn) - break; + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, YYFINAL, yychar, yys); } +#endif } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); + if (yychar == 0) goto yyaccept; + goto yyloop; } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ + if ((yyn = yygindex[yym]) != 0 && (yyn += yystate) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yystate) + yystate = yytable[yyn]; + else + yystate = yydgoto[yym]; +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state %d \ +to state %d\n", YYPREFIX, *yyssp, yystate); #endif - -yyreturn: - if (yychar != YYEMPTY) + if (yyssp >= yyss + yystacksize - 1) { - /* 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); + goto yyoverflow; } - /* 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", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; + *++yyssp = yystate; + *++yyvsp = yyval; + goto yyloop; +yyoverflow: + yyerror("yacc stack overflow"); +yyabort: + return (1); +yyaccept: + return (0); } -#line 2632 "lev_comp.y" /* yacc.c:1906 */ - - -/*lev_comp.y*/ From 3c5cb6ae5c18bbf16fff68a87a99e20ebeea043c Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 4 Dec 2015 14:56:14 -0800 Subject: [PATCH 07/18] malloc/realloc for makedefs Use of malloc() and realloc() has been added to makedefs but they weren't being declared anywhere if is not available. --- include/system.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/system.h b/include/system.h index 59a1ce23b..21ccf8b72 100644 --- a/include/system.h +++ b/include/system.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 system.h $NHDT-Date: 1432512775 2015/05/25 00:12:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ */ +/* NetHack 3.6 system.h $NHDT-Date: 1449269772 2015/12/04 22:56:12 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.12 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -514,8 +514,9 @@ E char *FDECL(tgetstr, (const char *, char **)); E char *FDECL(tgoto, (const char *, int, int)); #endif -#ifdef ALLOC_C +#if defined(ALLOC_C) || defined(MAKEDEFS_C) E genericptr_t FDECL(malloc, (size_t)); +E genericptr_t FDECL(realloc, (genericptr_t, size_t)); #endif /* time functions */ From 171fb90746b9634dc3411b23afc5fcdf607f7121 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 4 Dec 2015 14:58:49 -0800 Subject: [PATCH 08/18] !DEBUG warnings With DEBUG suppressed, I started getting 16 warning: empty body in an if-statement and 2 warning: empty body in an else-statement from gcc. Using braces for an empty block instead of just ';' avoids the warning: if (foo) debugpline("foo"); is bad, if (bar) { debugpline("bar"); } is good. ;-) The changes to lint.h are just precautionary. modified: include/lint.h src/attrib.c, bones.c, dbridge.c, dig.c, eat.c, makemon.c, mkmaze.c, mon.c, sp_lev.c --- include/lint.h | 22 ++++++++++++---------- src/attrib.c | 10 ++++++---- src/bones.c | 5 +++-- src/dbridge.c | 19 +++++++++++-------- src/dig.c | 5 +++-- src/eat.c | 39 ++++++++++++++++++++------------------- src/makemon.c | 8 +++++--- src/mkmaze.c | 9 +++++---- src/mon.c | 4 ++-- src/sp_lev.c | 5 +++-- 10 files changed, 70 insertions(+), 56 deletions(-) diff --git a/include/lint.h b/include/lint.h index 8fb79b4a9..c50446405 100644 --- a/include/lint.h +++ b/include/lint.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 lint.h $NHDT-Date: 1430897871 2015/05/06 07:37:51 $ $NHDT-Branch: master $:$NHDT-Revision: 1.0 $ */ +/* NetHack 3.6 lint.h $NHDT-Date: 1449269910 2015/12/04 22:58:30 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.3 $ */ /* NetHack may be freely redistributed. See license for details. */ /* @@ -36,19 +36,21 @@ extern unsigned nhUse_dummy; #ifdef DEBUG #define showdebug(file) debugcore(file, TRUE) #define explicitdebug(file) debugcore(file, FALSE) -#define ifdebug(stmt) \ - do { \ - if (showdebug(__FILE__)) \ - stmt; \ +#define ifdebug(stmt) \ + do { \ + if (showdebug(__FILE__)) { \ + stmt; \ + } \ } while (0) #ifdef _MSC_VER /* if we have microsoft's C runtime we can use these instead */ #include -#define crtdebug(stmt) \ - do { \ - if (showdebug(__FILE__)) \ - stmt; \ - _RPT0(_CRT_WARN, "\n"); \ +#define crtdebug(stmt) \ + do { \ + if (showdebug(__FILE__)) { \ + stmt; \ + } \ + _RPT0(_CRT_WARN, "\n"); \ } while (0) #define debugpline0(str) crtdebug(_RPT0(_CRT_WARN, str)) #define debugpline1(fmt, arg) crtdebug(_RPT1(_CRT_WARN, fmt, arg)) diff --git a/src/attrib.c b/src/attrib.c index b0ee0fc11..3866dbf26 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 attrib.c $NHDT-Date: 1446975460 2015/11/08 09:37:40 $ $NHDT-Branch: master $:$NHDT-Revision: 1.49 $ */ +/* NetHack 3.6 attrib.c $NHDT-Date: 1449269911 2015/12/04 22:58:31 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.51 $ */ /* Copyright 1988, 1989, 1990, 1992, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -470,8 +470,9 @@ exerchk() /* Check out the periodic accumulations */ exerper(); - if (moves >= context.next_attrib_check) + if (moves >= context.next_attrib_check) { debugpline1("exerchk: ready to test. multi = %d.", multi); + } /* Are we ready for a test? */ if (moves >= context.next_attrib_check && !multi) { debugpline0("exerchk: testing."); @@ -515,8 +516,9 @@ exerchk() ? "Dex" : (i == A_CON) ? "Con" - : (i == A_CHA) ? "Cha?" - : "???", + : (i == A_CHA) + ? "Cha?" + : "???", ax); /* * Law of diminishing returns (Part III): diff --git a/src/bones.c b/src/bones.c index b068e751a..7ca192599 100644 --- a/src/bones.c +++ b/src/bones.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 bones.c $NHDT-Date: 1446369463 2015/11/01 09:17:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.65 $ */ +/* NetHack 3.6 bones.c $NHDT-Date: 1449269914 2015/12/04 22:58:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.66 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985,1993. */ /* NetHack may be freely redistributed. See license for details. */ @@ -608,9 +608,10 @@ getbones() if (has_mname(mtmp)) sanitize_name(MNAME(mtmp)); if (mtmp->mhpmax == DEFUNCT_MONSTER) { - if (wizard) + if (wizard) { debugpline1("Removing defunct monster %s from bones.", mtmp->data->mname); + } mongone(mtmp); } else /* to correctly reset named artifacts on the level */ diff --git a/src/dbridge.c b/src/dbridge.c index 1dc43ad4b..7d6bda397 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 dbridge.c $NHDT-Date: 1446955279 2015/11/08 04:01:19 $ $NHDT-Branch: master $:$NHDT-Revision: 1.33 $ */ +/* NetHack 3.6 dbridge.c $NHDT-Date: 1449269914 2015/12/04 22:58:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.35 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -509,8 +509,9 @@ boolean chunks; { int misses; - if (chunks) + if (chunks) { debugpline0("Do chunks miss?"); + } if (automiss(etmp)) return TRUE; @@ -590,13 +591,14 @@ struct entity *etmp; return; } if (e_missed(etmp, FALSE)) { - if (at_portcullis) + if (at_portcullis) { pline_The("portcullis misses %s!", e_nam(etmp)); - else + } else { debugpline1("The drawbridge misses %s!", e_nam(etmp)); - if (e_survives_at(etmp, oldx, oldy)) + } + if (e_survives_at(etmp, oldx, oldy)) { return; - else { + } else { debugpline0("Mon can't survive here"); if (at_portcullis) must_jump = TRUE; @@ -978,10 +980,11 @@ int x, y; pline("%s hit by a huge chunk of metal!", E_phrase(etmp1, "are")); } else { - if (!Deaf && !is_u(etmp1) && !is_pool(x, y)) + if (!Deaf && !is_u(etmp1) && !is_pool(x, y)) { You_hear("a crushing sound."); - else + } else { debugpline1("%s from shrapnel", E_phrase(etmp1, "die")); + } } killer.format = KILLED_BY_AN; Strcpy(killer.name, "collapsing drawbridge"); diff --git a/src/dig.c b/src/dig.c index 0d1c24187..bbfef5d0b 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 dig.c $NHDT-Date: 1446369465 2015/11/01 09:17:45 $ $NHDT-Branch: master $:$NHDT-Revision: 1.99 $ */ +/* NetHack 3.6 dig.c $NHDT-Date: 1449269915 2015/12/04 22:58:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.103 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1864,8 +1864,9 @@ int x, y; { struct obj *otmp, *otmp2; - if (level.objects[x][y] != (struct obj *) 0) + if (level.objects[x][y] != (struct obj *) 0) { debugpline2("bury_objs: at <%d,%d>", x, y); + } for (otmp = level.objects[x][y]; otmp; otmp = otmp2) otmp2 = bury_an_obj(otmp, (boolean *) 0); diff --git a/src/eat.c b/src/eat.c index 8056cc190..fe3e4e071 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 eat.c $NHDT-Date: 1446854226 2015/11/06 23:57:06 $ $NHDT-Branch: master $:$NHDT-Revision: 1.152 $ */ +/* NetHack 3.6 eat.c $NHDT-Date: 1449269916 2015/12/04 22:58:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.154 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -728,56 +728,57 @@ register struct permonst *ptr; { int res = 0; +#ifdef DEBUG +#define ifdebugresist(Msg) \ + do { \ + if (res) \ + debugpline0(Msg); \ + } while (0) +#else +#define ifdebugresist(Msg) /*empty*/ +#endif switch (type) { case FIRE_RES: res = (ptr->mconveys & MR_FIRE) != 0; - if (res) - debugpline0("can get fire resistance"); + ifdebugresist("can get fire resistance"); break; case SLEEP_RES: res = (ptr->mconveys & MR_SLEEP) != 0; - if (res) - debugpline0("can get sleep resistance"); + ifdebugresist("can get sleep resistance"); break; case COLD_RES: res = (ptr->mconveys & MR_COLD) != 0; - if (res) - debugpline0("can get cold resistance"); + ifdebugresist("can get cold resistance"); break; case DISINT_RES: res = (ptr->mconveys & MR_DISINT) != 0; - if (res) - debugpline0("can get disintegration resistance"); + ifdebugresist("can get disintegration resistance"); break; case SHOCK_RES: /* shock (electricity) resistance */ res = (ptr->mconveys & MR_ELEC) != 0; - if (res) - debugpline0("can get shock resistance"); + ifdebugresist("can get shock resistance"); break; case POISON_RES: res = (ptr->mconveys & MR_POISON) != 0; - if (res) - debugpline0("can get poison resistance"); + ifdebugresist("can get poison resistance"); break; case TELEPORT: res = can_teleport(ptr); - if (res) - debugpline0("can get teleport"); + ifdebugresist("can get teleport"); break; case TELEPORT_CONTROL: res = control_teleport(ptr); - if (res) - debugpline0("can get teleport control"); + ifdebugresist("can get teleport control"); break; case TELEPAT: res = telepathic(ptr); - if (res) - debugpline0("can get telepathy"); + ifdebugresist("can get telepathy"); break; default: /* res stays 0 */ break; } +#undef ifdebugresist return res; } diff --git a/src/makemon.c b/src/makemon.c index c2db6f5d1..102379e4a 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 makemon.c $NHDT-Date: 1449052582 2015/12/02 10:36:22 $ $NHDT-Branch: master $:$NHDT-Revision: 1.104 $ */ +/* NetHack 3.6 makemon.c $NHDT-Date: 1449269917 2015/12/04 22:58:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.105 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -857,9 +857,10 @@ boolean ghostly; mvitals[mndx].born++; if ((int) mvitals[mndx].born >= lim && !(mons[mndx].geno & G_NOGEN) && !(mvitals[mndx].mvflags & G_EXTINCT)) { - if (wizard) + if (wizard) { debugpline1("Automatically extinguished %s.", makeplural(mons[mndx].mname)); + } mvitals[mndx].mvflags |= G_EXTINCT; reset_rndmonst(mndx); } @@ -1072,9 +1073,10 @@ int mmflags; already been genocided, return */ if (mvitals[mndx].mvflags & G_GENOD) return (struct monst *) 0; - if (wizard && (mvitals[mndx].mvflags & G_EXTINCT)) + if (wizard && (mvitals[mndx].mvflags & G_EXTINCT)) { debugpline1("Explicitly creating extinct monster %s.", mons[mndx].mname); + } } else { /* make a random (common) monster that can survive here. * (the special levels ask for random monsters at specific diff --git a/src/mkmaze.c b/src/mkmaze.c index d1f372b64..eddf6fbd1 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mkmaze.c $NHDT-Date: 1448013594 2015/11/20 09:59:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.41 $ */ +/* NetHack 3.6 mkmaze.c $NHDT-Date: 1449269918 2015/12/04 22:58:38 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.42 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -616,9 +616,10 @@ register const char *s; y_range = y_maze_max - y_maze_min - 2 * INVPOS_Y_MARGIN - 1; if (x_range <= INVPOS_X_MARGIN || y_range <= INVPOS_Y_MARGIN - || (x_range * y_range) <= (INVPOS_DISTANCE * INVPOS_DISTANCE)) - debugpline2("inv_pos: maze is too small! (%d x %d)", x_maze_max, - y_maze_max); + || (x_range * y_range) <= (INVPOS_DISTANCE * INVPOS_DISTANCE)) { + debugpline2("inv_pos: maze is too small! (%d x %d)", + x_maze_max, y_maze_max); + } inv_pos.x = inv_pos.y = 0; /*{occupied() => invocation_pos()}*/ do { x = rn1(x_range, x_maze_min + INVPOS_X_MARGIN + 1); diff --git a/src/mon.c b/src/mon.c index 8116d7877..ade596810 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mon.c $NHDT-Date: 1447475944 2015/11/14 04:39:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.196 $ */ +/* NetHack 3.6 mon.c $NHDT-Date: 1449269918 2015/12/04 22:58:38 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.199 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1470,7 +1470,7 @@ struct monst *mtmp, *mtmp2; /* transfer the monster's inventory */ for (otmp = mtmp2->minvent; otmp; otmp = otmp->nobj) { if (otmp->where != OBJ_MINVENT || otmp->ocarry != mtmp) - debugpline0("replmon: minvent inconsistency"); + impossible("replmon: minvent inconsistency"); otmp->ocarry = mtmp2; } mtmp->minvent = 0; diff --git a/src/sp_lev.c b/src/sp_lev.c index eb0c65793..dc454128a 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 sp_lev.c $NHDT-Date: 1449051497 2015/12/02 10:18:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.76 $ */ +/* NetHack 3.6 sp_lev.c $NHDT-Date: 1449269920 2015/12/04 22:58:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.77 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -1033,8 +1033,9 @@ chk: lev = &levl[x][y]; for (; y <= ymax; y++) { if (lev++->typ) { - if (!vault) + if (!vault) { debugpline2("strange area [%d,%d] in check_room.", x, y); + } if (!rn2(3)) return FALSE; if (x < *lowx) From 6156522eb07a2ea5c57cb9d9b9bcde582abc80b0 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 4 Dec 2015 20:03:38 -0500 Subject: [PATCH 09/18] Try to be consistent in declared O/S versions Changes to be committed: modified: README --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index f3f9b78bc..8013ec6f2 100644 --- a/README +++ b/README @@ -61,7 +61,7 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. on: Intel Pentium or better (or clone) running Linux, BSDI, or - Windows (XP through 10) + Windows (7 through 10) Intel 80386 or greater (or clone) boxes running Linux, or BSDI Mac OS X 10.9 OpenVMS (aka VMS) V8.4 on Alpha and on Integrity/Itanium/IA64 From 841662ff3200402fa3cae0b940b33daa885fa2a4 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 4 Dec 2015 18:52:51 -0800 Subject: [PATCH 10/18] "Bad option line" formatting Change |Bad option line: "foo |" to |Bad option line: "foo" by stripping away the input line's newline before processing it. (This doesn't address the PANICTRACE options processing issue.) --- src/files.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/files.c b/src/files.c index 1ce0c872e..6a74de52c 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 files.c $NHDT-Date: 1448323244 2015/11/24 00:00:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.190 $ */ +/* NetHack 3.6 files.c $NHDT-Date: 1449283964 2015/12/05 02:52:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.191 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2559,7 +2559,7 @@ read_config_file(filename, src) const char *filename; int src; { - char buf[4 * BUFSZ]; + char buf[4 * BUFSZ], *p; FILE *fp; boolean rv = TRUE; /* assume successful parse */ @@ -2577,8 +2577,16 @@ line at this level. OR: Forbid multiline stuff for alternate config sources. */ #endif + if ((p = index(buf, '\n')) != 0) + *p = '\0'; if (!parse_config_line(fp, buf, src)) { - raw_printf("Bad option line: \"%.50s\"", buf); + static const char badoptionline[] = "Bad option line: \"%s\""; + + /* truncate buffer if it's long; this is actually conservative */ + if (strlen(buf) > BUFSZ - sizeof badoptionline) + buf[BUFSZ - sizeof badoptionline] = '\0'; + + raw_printf(badoptionline, buf); wait_synch(); rv = FALSE; } From 9f6f3f5180764f6a13c3f34a6481e0c8f5db23a6 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 4 Dec 2015 22:18:17 -0800 Subject: [PATCH 11/18] PANICTRACE option parsing Fix the situation where disabling PANICTRACE, which happened implicitly when BETA got disabled, caused SYSCF option processing to complain and quit if the 'sysconf' file contained any PANICTRACE settings. Now accept all the PANICTRACE options (assuming SYSCF is defined) even if PANICTRACE is not defined. Their values are recorded in the 'sysopt' struct, but only validated when the appropriate macros (PANICTRACE, PANICTRACE_LIB) are defined. --- include/sys.h | 12 +++++------- src/files.c | 24 ++++++++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/include/sys.h b/include/sys.h index 6755c9619..10b7c3c5f 100644 --- a/include/sys.h +++ b/include/sys.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 sys.h $NHDT-Date: 1448241778 2015/11/23 01:22:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ */ +/* NetHack 3.6 sys.h $NHDT-Date: 1449296291 2015/12/05 06:18:11 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.27 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -20,23 +20,21 @@ struct sysopt { * -1: getenv() didn't find a value for DEBUGFILES. */ int maxplayers; + int seduce; + int check_save_uid; /* restoring savefile checks UID? */ + /* record file */ int persmax; int pers_is_uid; int entrymax; int pointsmin; int tt_oname_maxrank; -#ifdef PANICTRACE + /* panic options */ char *gdbpath; char *greppath; int panictrace_gdb; -#ifdef PANICTRACE_LIBC int panictrace_libc; -#endif -#endif - int seduce; - int check_save_uid; /* restoring savefile checks UID? */ }; extern struct sysopt sysopt; diff --git a/src/files.c b/src/files.c index 6a74de52c..1b74a56b4 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 files.c $NHDT-Date: 1449283964 2015/12/05 02:52:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.191 $ */ +/* NetHack 3.6 files.c $NHDT-Date: 1449296293 2015/12/05 06:18:13 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.192 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2224,6 +2224,7 @@ int src; (void) strncpy(dogname, bufp, PL_PSIZ - 1); } else if (match_varname(buf, "CATNAME", 3)) { (void) strncpy(catname, bufp, PL_PSIZ - 1); + #ifdef SYSCF } else if (src == SET_IN_SYS && match_varname(buf, "WIZARDS", 7)) { if (sysopt.wizards) @@ -2249,7 +2250,7 @@ int src; /* if showdebug() has already been called (perhaps we've added some debugpline() calls to option processing) and has found a value for getenv("DEBUGFILES"), don't override that */ - if (sysopt.env_dbgfl == 0) { + if (sysopt.env_dbgfl <= 0) { if (sysopt.debugfiles) free((genericptr_t) sysopt.debugfiles); sysopt.debugfiles = dupstr(bufp); @@ -2320,47 +2321,50 @@ int src; return 0; } sysopt.tt_oname_maxrank = n; -#ifdef PANICTRACE + + /* SYSCF PANICTRACE options */ } else if (src == SET_IN_SYS && match_varname(buf, "PANICTRACE_LIBC", 15)) { -#ifdef PANICTRACE_LIBC n = atoi(bufp); +#if defined(PANICTRACE) && defined(PANICTRACE_LIBC) if (n < 0 || n > 2) { raw_printf("Illegal value in PANICTRACE_LIBC (not 0,1,2)."); return 0; } +#endif sysopt.panictrace_libc = n; -#endif /* PANICTRACE_LIBC */ } else if (src == SET_IN_SYS && match_varname(buf, "PANICTRACE_GDB", 14)) { n = atoi(bufp); +#if defined(PANICTRACE) if (n < 0 || n > 2) { raw_printf("Illegal value in PANICTRACE_GDB (not 0,1,2)."); return 0; } +#endif sysopt.panictrace_gdb = n; } else if (src == SET_IN_SYS && match_varname(buf, "GDBPATH", 7)) { -#ifndef VMS /* VMS panictrace support doesn't use gdb or grep */ +#if defined(PANICTRACE) && !defined(VMS) if (!file_exists(bufp)) { raw_printf("File specified in GDBPATH does not exist."); return 0; } +#endif if (sysopt.gdbpath) free((genericptr_t) sysopt.gdbpath); sysopt.gdbpath = dupstr(bufp); -#endif } else if (src == SET_IN_SYS && match_varname(buf, "GREPPATH", 7)) { -#ifndef VMS /* VMS panictrace support doesn't use gdb or grep */ +#if defined(PANICTRACE) && !defined(VMS) if (!file_exists(bufp)) { raw_printf("File specified in GREPPATH does not exist."); return 0; } +#endif if (sysopt.greppath) free((genericptr_t) sysopt.greppath); sysopt.greppath = dupstr(bufp); -#endif /* !VMS */ -#endif /* PANICTRACE */ #endif /* SYSCF */ + } else if (match_varname(buf, "BOULDER", 3)) { (void) get_uchars(fp, buf, bufp, &iflags.bouldersym, TRUE, 1, "BOULDER"); From c1a5895f3a7e5ee2e43b3ec94da067152ecd0301 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 5 Dec 2015 10:09:28 -0500 Subject: [PATCH 12/18] Release prep step - set BETA_INFO to empty string Changes to be committed: modified: src/version.c --- src/version.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.c b/src/version.c index 76492bb80..97c8d0321 100644 --- a/src/version.c +++ b/src/version.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 version.c $NHDT-Date: 1446887538 2015/11/07 09:12:18 $ $NHDT-Branch: master $:$NHDT-Revision: 1.40 $ */ +/* NetHack 3.6 version.c $NHDT-Date: 1449328116 2015/12/05 15:08:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.41 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -15,7 +15,7 @@ #include "patchlevel.h" #endif -#define BETA_INFO "Beta5" +#define BETA_INFO "" STATIC_DCL void FDECL(insert_rtoptions, (winid,char *,const char *)); From ea6c2a49fe38e6a979140ac8a08c8ecbbb74ccc0 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 5 Dec 2015 22:59:56 -0800 Subject: [PATCH 13/18] util/???_comp.l A couple of minor changes, perparatory to regenerating sys/share/???_lex.c with flex-latest plus new custom skeleton for same. --- util/dgn_comp.l | 15 ++++++++------- util/lev_comp.l | 12 +++++++----- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/util/dgn_comp.l b/util/dgn_comp.l index 73c7054f9..a18b5fefc 100644 --- a/util/dgn_comp.l +++ b/util/dgn_comp.l @@ -1,5 +1,5 @@ %{ -/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1448710672 2015/11/28 11:37:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ */ +/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1449385184 2015/12/06 06:59:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.12 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1990 by M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -61,20 +61,20 @@ int FDECL(yyoutput, (int)); #define YY_NO_UNPUT #endif -#ifdef FLEX_SCANNER -#define YY_MALLOC_DECL \ - genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t,size_t)); +#if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) +/* older flex wants this */ +#define YY_MALLOC_DECL genericptr_t FDECL(malloc, (size_t)); \ + genericptr_t FDECL(realloc, (genericptr_t, size_t)); +/* newer flex assumes so needs this in case it's been suppressed */ +YY_MALLOC_DECL #endif - void FDECL(init_yyin, (FILE *)); void FDECL(init_yyout, (FILE *)); /* this doesn't always get put in dgn_comp.h * (esp. when using older versions of bison) */ - extern YYSTYPE yylval; int nh_line_number = 1; @@ -131,6 +131,7 @@ FILE *input_f; #endif yyin = input_f; } + /* analogous routine (for completeness) */ void init_yyout( output_f ) diff --git a/util/lev_comp.l b/util/lev_comp.l index 44805e0ef..c70c48148 100644 --- a/util/lev_comp.l +++ b/util/lev_comp.l @@ -1,5 +1,5 @@ %{ -/* NetHack 3.6 lev_comp.l $NHDT-Date: 1448710678 2015/11/28 11:37:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.21 $ */ +/* NetHack 3.6 lev_comp.l $NHDT-Date: 1449385191 2015/12/06 06:59:51 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.22 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -59,10 +59,12 @@ int FDECL(yyoutput, (int)); #define YY_NO_UNPUT #endif -#ifdef FLEX_SCANNER -#define YY_MALLOC_DECL \ - genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t,size_t)); +#if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) +/* older flex wants this */ +#define YY_MALLOC_DECL genericptr_t FDECL(malloc, (size_t)); \ + genericptr_t FDECL(realloc, (genericptr_t, size_t)); +/* newer flex assumes so needs this in case it's been suppressed */ +YY_MALLOC_DECL #endif void FDECL(init_yyin, (FILE *)); From c964ae023bb001e7e668e0bf4370301d2c84db20 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 5 Dec 2015 23:02:35 -0800 Subject: [PATCH 14/18] sys/share/???_lex.c Generated with flex 2.6.0 and a new custom skeleton for that version (which almost certainly won't work with any older or newer version of flex, but that limitation has no effect on the usefulness of the generated scanner code). Function definitions are oldstyle: int foo(bar) char *bar; {...} rather than ANSI, like nethack's core code. Advance declarations use FDECL for prototypes, so should also fit nethack, although the usage 'FDECL(, (arglist))' makes me feel a bit uneasy. gcc doesn't mind the omitted first argument but other compilers might not like it. The system headers (stdlib.h and a few others) that flex has been insisting on including are gone (with this skeleton). It starts out including "config.h" and that header has the responsibility for any definitions and declarations necessary. That shouldn't be a big deal since config.h -> XXXconf.h -> system.h is what we're already relying on for everything else, but it does need testing for any configuration that uses sys/share/{dgn,lev}_{lex,yacc}.c. I'll be checking the skeleton into the NHinternals repository after adding some documentation, but I'm wondering whether it should really become part of the source distribution. --- sys/share/dgn_lex.c | 850 ++++++++++++++++++++------------------------ sys/share/lev_lex.c | 848 ++++++++++++++++++++----------------------- 2 files changed, 771 insertions(+), 927 deletions(-) diff --git a/sys/share/dgn_lex.c b/sys/share/dgn_lex.c index 5c06fe634..44ddfc5b3 100644 --- a/sys/share/dgn_lex.c +++ b/sys/share/dgn_lex.c @@ -3,110 +3,37 @@ #define YY_INT_ALIGNED short int -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. +/* A lexical scanner generated by flex via 'flex -S flexhack.skl' + * where flexhack.skl is a nethack-specific alternate skeleton derived + * from flex 2.6.0's skel.c (which in turn was generated from flex.skl). + * + * Support for C++, re-entrancy, and table serialization stripped out. + * NetHack's usage doesn't need them and we want to reduce the size and + * complexity of this skeleton as well as of the generated scanner code. */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif +#define FLEXHACK_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; +#include "config.h" + +#include + +/* we don't care if actual types happen to have more bits than their names; + the tables will just take up more space, possibly slowing the parse; + still, allow config.h to override these via typedef+#define if desired */ +#ifndef FLEX_INT32_T typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +#endif +#ifndef FLEX_INT16_T +typedef short int flex_int16_t; +#endif +#ifndef FLEX_UINT16_T typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST #define yyconst const -#else -#define yyconst -#endif /* Returned upon end-of-file. */ #define YY_NULL 0 @@ -116,7 +43,7 @@ typedef unsigned int flex_uint32_t; * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((unsigned int) (uchar) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less @@ -141,10 +68,19 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif -/* The state buf must be large enough to hold one state per character in the main buffer. +/* The state buf must be large enough to hold one state per character + * in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) @@ -159,35 +95,32 @@ typedef size_t yy_size_t; #endif extern yy_size_t yyleng; - extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - #define YY_LESS_LINENO(n) +#define YY_LESS_LINENO(n) +#define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ + do { \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) + YY_LESS_LINENO(yyless_macro_arg); \ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { +struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ @@ -222,8 +155,8 @@ struct yy_buffer_state */ int yy_at_bol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. @@ -246,7 +179,7 @@ struct yy_buffer_state */ #define YY_BUFFER_EOF_PENDING 2 - }; +}; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ @@ -271,7 +204,7 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ @@ -284,50 +217,47 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); +void yyrestart FDECL(, (FILE *input_file )); +void yy_switch_to_buffer FDECL(, (YY_BUFFER_STATE new_buffer )); +YY_BUFFER_STATE yy_create_buffer FDECL(, (FILE *file,int size )); +void yy_delete_buffer FDECL(, (YY_BUFFER_STATE b )); +void yy_flush_buffer FDECL(, (YY_BUFFER_STATE b )); +void yypush_buffer_state FDECL(, (YY_BUFFER_STATE new_buffer )); +void yypop_buffer_state FDECL(, (void )); -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack FDECL(, (void )); +static void yy_load_buffer_state FDECL(, (void )); +static void yy_init_buffer FDECL(, (YY_BUFFER_STATE b,FILE *file )); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); +YY_BUFFER_STATE yy_scan_buffer FDECL(, (char *base,yy_size_t size )); +YY_BUFFER_STATE yy_scan_string FDECL(, (yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes FDECL(, (yyconst char *bytes,yy_size_t len )); -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); +void *yyalloc FDECL(, (yy_size_t )); +void *yyrealloc FDECL(, (void *,yy_size_t )); +void yyfree FDECL(, (void * )); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + if ( ! YY_CURRENT_BUFFER ) { \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + if ( ! YY_CURRENT_BUFFER ) { \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ @@ -343,12 +273,15 @@ extern int yylineno; int yylineno = 1; extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static yy_state_type yy_get_previous_state FDECL(, (void )); +static yy_state_type yy_try_NUL_trans FDECL(, (yy_state_type current_state )); +static int yy_get_next_buffer FDECL(, (void )); +static void yy_fatal_error FDECL(, (yyconst char msg[] )) NORETURN; /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. @@ -395,7 +328,7 @@ static yyconst flex_int16_t yy_accept[196] = } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -427,7 +360,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[49] = +static yyconst YY_CHAR yy_meta[49] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -436,7 +369,7 @@ static yyconst flex_int32_t yy_meta[49] = 1, 1, 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[198] = +static yyconst flex_uint16_t yy_base[198] = { 0, 0, 213, 218, 220, 215, 220, 213, 210, 207, 196, 190, 196, 37, 191, 197, 186, 188, 171, 164, 172, @@ -488,7 +421,7 @@ static yyconst flex_int16_t yy_def[198] = } ; -static yyconst flex_int16_t yy_nxt[269] = +static yyconst flex_uint16_t yy_nxt[269] = { 0, 4, 5, 6, 7, 8, 4, 9, 10, 11, 12, 13, 14, 4, 4, 4, 4, 15, 4, 4, 4, @@ -568,7 +501,7 @@ int yy_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1449233101 2015/12/04 12:45:01 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.15 $ */ +/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1449385342 2015/12/06 07:02:22 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.16 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1990 by M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -630,10 +563,12 @@ int FDECL(yyoutput, (int)); #define YY_NO_UNPUT #endif -#ifdef FLEX_SCANNER -#define YY_MALLOC_DECL \ - genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t,size_t)); +#if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) +/* older flex wants this */ +#define YY_MALLOC_DECL genericptr_t FDECL(malloc, (size_t)); \ + genericptr_t FDECL(realloc, (genericptr_t, size_t)); +/* newer flex assumes so needs this in case it's been suppressed */ +YY_MALLOC_DECL #endif void FDECL(init_yyin, (FILE *)); @@ -642,91 +577,68 @@ void FDECL(init_yyout, (FILE *)); /* this doesn't always get put in dgn_comp.h * (esp. when using older versions of bison) */ - extern YYSTYPE yylval; int nh_line_number = 1; #define INITIAL 0 -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); - /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy (void ); - -int yyget_debug (void ); - -void yyset_debug (int debug_flag ); - -YY_EXTRA_TYPE yyget_extra (void ); - -void yyset_extra (YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in (void ); - -void yyset_in (FILE * in_str ); - -FILE *yyget_out (void ); - -void yyset_out (FILE * out_str ); - -yy_size_t yyget_leng (void ); - -char *yyget_text (void ); - -int yyget_lineno (void ); - -void yyset_lineno (int line_number ); +int yylex_destroy FDECL(, (void )); +int yyget_debug FDECL(, (void )); +void yyset_debug FDECL(, (int debug_flag )); +YY_EXTRA_TYPE yyget_extra FDECL(, (void )); +void yyset_extra FDECL(, (YY_EXTRA_TYPE user_defined )); +FILE *yyget_in FDECL(, (void )); +void yyset_in FDECL(, (FILE * _in_str )); +FILE *yyget_out FDECL(, (void )); +void yyset_out FDECL(, (FILE * _out_str )); +yy_size_t yyget_leng FDECL(, (void )); +char *yyget_text FDECL(, (void )); +int yyget_lineno FDECL(, (void )); +void yyset_lineno FDECL(, (int _line_number )); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap (void ); -#else -extern int yywrap (void ); -#endif +extern int yywrap FDECL(, (void )); #endif - static void yyunput (int c,char *buf_ptr ); +#ifndef YY_NO_UNPUT + +static void yyunput FDECL(, (int c,char *buf_ptr )); +#endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy FDECL(, (char *,yyconst char *,int )); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen FDECL(, (yyconst char * )); #endif #ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput (void ); -#else -static int input (void ); -#endif +static int input FDECL(, (void )); #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -769,7 +681,6 @@ static int input (void ); clearerr(yyin); \ } \ }\ -\ #endif @@ -791,17 +702,15 @@ static int input (void ); #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif -/* end tables serialization structures and prototypes */ - /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int yylex (void); +extern int yylex FDECL(, (void)); -#define YY_DECL int yylex (void) +#define YY_DECL int yylex () #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng @@ -813,7 +722,7 @@ extern int yylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -826,9 +735,9 @@ extern int yylex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; if ( !(yy_init) ) { @@ -856,7 +765,9 @@ YY_DECL yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -873,7 +784,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1187,6 +1098,7 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1196,151 +1108,132 @@ case YY_STATE_EOF(INITIAL): * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ -static int yy_get_next_buffer (void) +static int yy_get_next_buffer () { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + yy_size_t number_to_move, i; + int ret_val; - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); + if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1]) + YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed"); - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } + if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) { + /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } else { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } + /* Try to read more data. */ - /* Try to read more data. */ + /* First move last chars to start of buffer. */ + number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + for (i = 0; i < number_to_move; ++i) + *(dest++) = *(source++); - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); + if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING) { + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + } else { + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + while (num_to_read <= 0) { + /* Not enough room in the buffer - grow it. */ - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ + if ( b->yy_is_our_buffer ) { + yy_size_t new_size = b->yy_buf_size * 2; - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; + if (! b->yy_ch_buf) + YY_FATAL_ERROR("fatal error - scanner input buffer overflow" ); - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); + } - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; + /* Read in more data. */ + YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } - } + if ((yy_n_chars) == 0) { + if (number_to_move == YY_MORE_ADJ) { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart(yyin ); + } else { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; + } + } else + ret_val = EOB_ACT_CONTINUE_SCAN; - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; + if ((yy_size_t) ((yy_n_chars) + number_to_move) + > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) + yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if (! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()"); + } - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; + return ret_val; } -/* yy_get_previous_state - get the state just before the EOB char was reached */ +/* yy_get_previous_state - get the state just before EOB char was reached */ - static yy_state_type yy_get_previous_state (void) +static yy_state_type yy_get_previous_state () { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) { + + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1353,9 +1246,9 @@ static int yy_get_next_buffer (void) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } + } - return yy_current_state; + return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character @@ -1363,12 +1256,14 @@ static int yy_get_next_buffer (void) * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; +static yy_state_type yy_try_NUL_trans (yy_current_state ) + yy_state_type yy_current_state; +{ + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); + + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1386,9 +1281,13 @@ static int yy_get_next_buffer (void) return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) +#ifndef YY_NO_UNPUT + +static void yyunput (c,yy_bp ) + int c; + char * yy_bp; { - register char *yy_cp; + char *yy_cp; yy_cp = (yy_c_buf_p); @@ -1398,10 +1297,10 @@ static int yy_get_next_buffer (void) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + yy_size_t number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1423,13 +1322,10 @@ static int yy_get_next_buffer (void) (yy_c_buf_p) = yy_cp; } -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) #endif +#ifndef YY_NO_INPUT +static int input () { int c; @@ -1475,11 +1371,7 @@ static int yy_get_next_buffer (void) if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else return input(); -#endif } case EOB_ACT_CONTINUE_SCAN: @@ -1489,7 +1381,7 @@ static int yy_get_next_buffer (void) } } - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + c = *(uchar *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); @@ -1504,7 +1396,9 @@ static int yy_get_next_buffer (void) * * @note This function does not reset the start condition to @c INITIAL . */ - void yyrestart (FILE * input_file ) + +void yyrestart (input_file ) + FILE * input_file; { if ( ! YY_CURRENT_BUFFER ){ @@ -1521,14 +1415,15 @@ static int yy_get_next_buffer (void) * @param new_buffer The new input buffer. * */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +void yy_switch_to_buffer (new_buffer ) + YY_BUFFER_STATE new_buffer; { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); - */ + */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -1552,7 +1447,7 @@ static int yy_get_next_buffer (void) (yy_did_buffer_switch_on_eof) = 1; } -static void yy_load_buffer_state (void) +static void yy_load_buffer_state () { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; @@ -1566,7 +1461,9 @@ static void yy_load_buffer_state (void) * * @return the allocated buffer state. */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +YY_BUFFER_STATE yy_create_buffer (file,size ) + FILE * file; + int size; { YY_BUFFER_STATE b; @@ -1574,7 +1471,7 @@ static void yy_load_buffer_state (void) if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. @@ -1594,7 +1491,8 @@ static void yy_load_buffer_state (void) * @param b a buffer created with yy_create_buffer() * */ - void yy_delete_buffer (YY_BUFFER_STATE b ) +void yy_delete_buffer (b ) + YY_BUFFER_STATE b; { if ( ! b ) @@ -1613,8 +1511,9 @@ static void yy_load_buffer_state (void) * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - +static void yy_init_buffer (b,file ) + YY_BUFFER_STATE b; + FILE * file; { int oerrno = errno; @@ -1641,7 +1540,8 @@ static void yy_load_buffer_state (void) * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ - void yy_flush_buffer (YY_BUFFER_STATE b ) +void yy_flush_buffer (b ) + YY_BUFFER_STATE b; { if ( ! b ) return; @@ -1670,7 +1570,8 @@ static void yy_load_buffer_state (void) * @param new_buffer The new state. * */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +void yypush_buffer_state (new_buffer ) + YY_BUFFER_STATE new_buffer; { if (new_buffer == NULL) return; @@ -1700,7 +1601,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) * The next element becomes the new top. * */ -void yypop_buffer_state (void) +void yypop_buffer_state () { if (!YY_CURRENT_BUFFER) return; @@ -1719,56 +1620,60 @@ void yypop_buffer_state (void) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void yyensure_buffer_stack (void) +static void yyensure_buffer_stack () { - yy_size_t num_to_alloc; + yy_size_t num_to_alloc; - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. + if (!(yy_buffer_stack)) { + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } +#if 1 /* [PR] avoid C++-style comment; older C compilers choke on it */ + num_to_alloc = 2; /* also changed to match the comment... */ +#else + num_to_alloc = 1; // After all that talk, this was set to 1 anyways... +#endif + (yy_buffer_stack) = (struct yy_buffer_state**) + yyalloc(num_to_alloc * sizeof(struct yy_buffer_state*) ); + if (!(yy_buffer_stack)) + YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + (void) memset((yy_buffer_stack), 0, + num_to_alloc * sizeof(struct yy_buffer_state*)); - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) { + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**) + yyrealloc((yy_buffer_stack),num_to_alloc * sizeof(struct yy_buffer_state*) ); + if (!(yy_buffer_stack)) + YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); + + /* zero only the new slots.*/ + (void) memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, + grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } } -/** Setup the input buffer state to scan directly from a user-specified character buffer. +/** Setup the input buffer state to scan directly from a user-specified + * character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +YY_BUFFER_STATE yy_scan_buffer (base,size ) + char * base; + yy_size_t size; { YY_BUFFER_STATE b; @@ -1797,33 +1702,37 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) return b; } -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. +/** Setup the input buffer state to scan a string. The next call to yylex() + * will scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (yystr ) + yyconst char * yystr; { return yy_scan_bytes(yystr,strlen(yystr) ); } -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. +/** Setup the input buffer state to scan the given bytes. The next call to + * yylex() will scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param _yybytes_len the number of bytes in the buffer pointed to by @a + * bytes. * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (yybytes,_yybytes_len ) + yyconst char * yybytes; + yy_size_t _yybytes_len; { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -1852,9 +1761,10 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yy_fatal_error (msg ) + yyconst char* msg; { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -1862,25 +1772,23 @@ static void yy_fatal_error (yyconst char* msg ) #undef yyless #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ + do { \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) + YY_LESS_LINENO(yyless_macro_arg); \ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ -int yyget_lineno (void) +int yyget_lineno () { return yylineno; @@ -1889,7 +1797,7 @@ int yyget_lineno (void) /** Get the input stream. * */ -FILE *yyget_in (void) +FILE *yyget_in () { return yyin; } @@ -1897,7 +1805,7 @@ FILE *yyget_in (void) /** Get the output stream. * */ -FILE *yyget_out (void) +FILE *yyget_out () { return yyout; } @@ -1905,7 +1813,7 @@ FILE *yyget_out (void) /** Get the length of the current token. * */ -yy_size_t yyget_leng (void) +yy_size_t yyget_leng () { return yyleng; } @@ -1914,48 +1822,52 @@ yy_size_t yyget_leng (void) * */ -char *yyget_text (void) +char *yyget_text () { return yytext; } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void yyset_lineno (int line_number ) +void yyset_lineno (_line_number ) + int _line_number; { - yylineno = line_number; + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str ) +void yyset_in (_in_str ) + FILE * _in_str; { - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str ) +void yyset_out (_out_str ) + FILE * _out_str; { - yyout = out_str ; + yyout = _out_str ; } -int yyget_debug (void) +int yyget_debug () { return yy_flex_debug; } -void yyset_debug (int bdebug ) +void yyset_debug (_bdebug ) + int _bdebug; { - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } -static int yy_init_globals (void) +static int yy_init_globals () { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. @@ -1984,22 +1896,21 @@ static int yy_init_globals (void) } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) +int yylex_destroy () { /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } + while (YY_CURRENT_BUFFER) { + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ + /* Reset the globals. This is important in a non-reentrant scanner + * so the next time yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; @@ -2010,18 +1921,23 @@ int yylex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (s1,s2,n ) + char* s1; + yyconst char * s2; + int n; { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (s ) + yyconst char * s; { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -2029,13 +1945,18 @@ static int yy_flex_strlen (yyconst char * s ) } #endif -void *yyalloc (yy_size_t size ) +void *yyalloc (size ) + yy_size_t size; { + return (void *) malloc( size ); } -void *yyrealloc (void * ptr, yy_size_t size ) +void *yyrealloc (ptr,size ) + void * ptr; + yy_size_t size; { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2046,13 +1967,13 @@ void *yyrealloc (void * ptr, yy_size_t size ) return (void *) realloc( (char *) ptr, size ); } -void yyfree (void * ptr ) +void yyfree (ptr ) + void * ptr; { + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } -#define YYTABLES_NAME "yytables" - /* routine to switch to another input file; needed for flex */ void init_yyin( input_f ) @@ -2065,6 +1986,7 @@ FILE *input_f; #endif yyin = input_f; } + /* analogous routine (for completeness) */ void init_yyout( output_f ) diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c index dd76b8484..b34ae0091 100644 --- a/sys/share/lev_lex.c +++ b/sys/share/lev_lex.c @@ -3,110 +3,37 @@ #define YY_INT_ALIGNED short int -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. +/* A lexical scanner generated by flex via 'flex -S flexhack.skl' + * where flexhack.skl is a nethack-specific alternate skeleton derived + * from flex 2.6.0's skel.c (which in turn was generated from flex.skl). + * + * Support for C++, re-entrancy, and table serialization stripped out. + * NetHack's usage doesn't need them and we want to reduce the size and + * complexity of this skeleton as well as of the generated scanner code. */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif +#define FLEXHACK_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; +#include "config.h" + +#include + +/* we don't care if actual types happen to have more bits than their names; + the tables will just take up more space, possibly slowing the parse; + still, allow config.h to override these via typedef+#define if desired */ +#ifndef FLEX_INT32_T typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +#endif +#ifndef FLEX_INT16_T +typedef short int flex_int16_t; +#endif +#ifndef FLEX_UINT16_T typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST #define yyconst const -#else -#define yyconst -#endif /* Returned upon end-of-file. */ #define YY_NULL 0 @@ -116,7 +43,7 @@ typedef unsigned int flex_uint32_t; * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((unsigned int) (uchar) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less @@ -141,10 +68,19 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif -/* The state buf must be large enough to hold one state per character in the main buffer. +/* The state buf must be large enough to hold one state per character + * in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) @@ -159,35 +95,32 @@ typedef size_t yy_size_t; #endif extern yy_size_t yyleng; - extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - #define YY_LESS_LINENO(n) +#define YY_LESS_LINENO(n) +#define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ + do { \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) + YY_LESS_LINENO(yyless_macro_arg); \ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { +struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ @@ -222,8 +155,8 @@ struct yy_buffer_state */ int yy_at_bol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. @@ -246,7 +179,7 @@ struct yy_buffer_state */ #define YY_BUFFER_EOF_PENDING 2 - }; +}; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ @@ -271,7 +204,7 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ @@ -284,50 +217,47 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); +void yyrestart FDECL(, (FILE *input_file )); +void yy_switch_to_buffer FDECL(, (YY_BUFFER_STATE new_buffer )); +YY_BUFFER_STATE yy_create_buffer FDECL(, (FILE *file,int size )); +void yy_delete_buffer FDECL(, (YY_BUFFER_STATE b )); +void yy_flush_buffer FDECL(, (YY_BUFFER_STATE b )); +void yypush_buffer_state FDECL(, (YY_BUFFER_STATE new_buffer )); +void yypop_buffer_state FDECL(, (void )); -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack FDECL(, (void )); +static void yy_load_buffer_state FDECL(, (void )); +static void yy_init_buffer FDECL(, (YY_BUFFER_STATE b,FILE *file )); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); +YY_BUFFER_STATE yy_scan_buffer FDECL(, (char *base,yy_size_t size )); +YY_BUFFER_STATE yy_scan_string FDECL(, (yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes FDECL(, (yyconst char *bytes,yy_size_t len )); -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); +void *yyalloc FDECL(, (yy_size_t )); +void *yyrealloc FDECL(, (void *,yy_size_t )); +void yyfree FDECL(, (void * )); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + if ( ! YY_CURRENT_BUFFER ) { \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + if ( ! YY_CURRENT_BUFFER ) { \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ @@ -343,12 +273,15 @@ extern int yylineno; int yylineno = 1; extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static yy_state_type yy_get_previous_state FDECL(, (void )); +static yy_state_type yy_try_NUL_trans FDECL(, (yy_state_type current_state )); +static int yy_get_next_buffer FDECL(, (void )); +static void yy_fatal_error FDECL(, (yyconst char msg[] )) NORETURN; /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. @@ -489,7 +422,7 @@ static yyconst flex_int16_t yy_accept[1057] = 198, 198, 48, 32, 44, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -521,7 +454,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[75] = +static yyconst YY_CHAR yy_meta[75] = { 0, 1, 2, 3, 2, 2, 1, 1, 2, 1, 1, 1, 2, 4, 2, 4, 1, 1, 1, 5, 5, @@ -533,7 +466,7 @@ static yyconst flex_int32_t yy_meta[75] = 6, 5, 6, 6 } ; -static yyconst flex_int16_t yy_base[1064] = +static yyconst flex_uint16_t yy_base[1064] = { 0, 0, 73, 102, 77, 1254, 1255, 75, 1255, 1250, 1235, 1244, 0, 1204, 1234, 1233, 78, 66, 1230, 1229, 1215, @@ -775,7 +708,7 @@ static yyconst flex_int16_t yy_def[1064] = 1056, 1056, 1056 } ; -static yyconst flex_int16_t yy_nxt[1330] = +static yyconst flex_uint16_t yy_nxt[1330] = { 0, 6, 7, 8, 9, 7, 10, 11, 6, 12, 6, 13, 14, 15, 6, 16, 17, 18, 19, 20, 21, @@ -1089,7 +1022,7 @@ int yy_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -/* NetHack 3.6 lev_comp.l $NHDT-Date: 1449188840 2015/12/04 00:27:20 $ $NHDT-Branch: master $:$NHDT-Revision: 1.22 $ */ +/* NetHack 3.6 lev_comp.l $NHDT-Date: 1449385344 2015/12/06 07:02:24 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.24 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -1149,10 +1082,12 @@ int FDECL(yyoutput, (int)); #define YY_NO_UNPUT #endif -#ifdef FLEX_SCANNER -#define YY_MALLOC_DECL \ - genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t,size_t)); +#if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) +/* older flex wants this */ +#define YY_MALLOC_DECL genericptr_t FDECL(malloc, (size_t)); \ + genericptr_t FDECL(realloc, (genericptr_t, size_t)); +/* newer flex assumes so needs this in case it's been suppressed */ +YY_MALLOC_DECL #endif void FDECL(init_yyin, (FILE *)); @@ -1192,84 +1127,62 @@ FILE *orig_yyin = NULL; #define INITIAL 0 #define MAPC 1 -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); - /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy (void ); - -int yyget_debug (void ); - -void yyset_debug (int debug_flag ); - -YY_EXTRA_TYPE yyget_extra (void ); - -void yyset_extra (YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in (void ); - -void yyset_in (FILE * in_str ); - -FILE *yyget_out (void ); - -void yyset_out (FILE * out_str ); - -yy_size_t yyget_leng (void ); - -char *yyget_text (void ); - -int yyget_lineno (void ); - -void yyset_lineno (int line_number ); +int yylex_destroy FDECL(, (void )); +int yyget_debug FDECL(, (void )); +void yyset_debug FDECL(, (int debug_flag )); +YY_EXTRA_TYPE yyget_extra FDECL(, (void )); +void yyset_extra FDECL(, (YY_EXTRA_TYPE user_defined )); +FILE *yyget_in FDECL(, (void )); +void yyset_in FDECL(, (FILE * _in_str )); +FILE *yyget_out FDECL(, (void )); +void yyset_out FDECL(, (FILE * _out_str )); +yy_size_t yyget_leng FDECL(, (void )); +char *yyget_text FDECL(, (void )); +int yyget_lineno FDECL(, (void )); +void yyset_lineno FDECL(, (int _line_number )); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap (void ); -#else -extern int yywrap (void ); -#endif +extern int yywrap FDECL(, (void )); #endif - static void yyunput (int c,char *buf_ptr ); +#ifndef YY_NO_UNPUT + +static void yyunput FDECL(, (int c,char *buf_ptr )); +#endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy FDECL(, (char *,yyconst char *,int )); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen FDECL(, (yyconst char * )); #endif #ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput (void ); -#else -static int input (void ); -#endif +static int input FDECL(, (void )); #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1312,7 +1225,6 @@ static int input (void ); clearerr(yyin); \ } \ }\ -\ #endif @@ -1334,17 +1246,15 @@ static int input (void ); #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif -/* end tables serialization structures and prototypes */ - /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int yylex (void); +extern int yylex FDECL(, (void)); -#define YY_DECL int yylex (void) +#define YY_DECL int yylex () #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng @@ -1356,7 +1266,7 @@ extern int yylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -1369,9 +1279,9 @@ extern int yylex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; if ( !(yy_init) ) { @@ -1399,7 +1309,9 @@ YY_DECL yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -1416,7 +1328,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2429,6 +2341,7 @@ case YY_STATE_EOF(MAPC): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -2438,151 +2351,132 @@ case YY_STATE_EOF(MAPC): * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ -static int yy_get_next_buffer (void) +static int yy_get_next_buffer () { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + yy_size_t number_to_move, i; + int ret_val; - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); + if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1]) + YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed"); - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } + if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) { + /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } else { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } + /* Try to read more data. */ - /* Try to read more data. */ + /* First move last chars to start of buffer. */ + number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + for (i = 0; i < number_to_move; ++i) + *(dest++) = *(source++); - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); + if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING) { + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + } else { + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + while (num_to_read <= 0) { + /* Not enough room in the buffer - grow it. */ - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ + if ( b->yy_is_our_buffer ) { + yy_size_t new_size = b->yy_buf_size * 2; - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; + if (! b->yy_ch_buf) + YY_FATAL_ERROR("fatal error - scanner input buffer overflow" ); - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); + } - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; + /* Read in more data. */ + YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } - } + if ((yy_n_chars) == 0) { + if (number_to_move == YY_MORE_ADJ) { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart(yyin ); + } else { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; + } + } else + ret_val = EOB_ACT_CONTINUE_SCAN; - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; + if ((yy_size_t) ((yy_n_chars) + number_to_move) + > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) + yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if (! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()"); + } - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; + return ret_val; } -/* yy_get_previous_state - get the state just before the EOB char was reached */ +/* yy_get_previous_state - get the state just before EOB char was reached */ - static yy_state_type yy_get_previous_state (void) +static yy_state_type yy_get_previous_state () { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) { + + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2595,9 +2489,9 @@ static int yy_get_next_buffer (void) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } + } - return yy_current_state; + return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character @@ -2605,12 +2499,14 @@ static int yy_get_next_buffer (void) * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; +static yy_state_type yy_try_NUL_trans (yy_current_state ) + yy_state_type yy_current_state; +{ + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); + + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2628,9 +2524,13 @@ static int yy_get_next_buffer (void) return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) +#ifndef YY_NO_UNPUT + +static void yyunput (c,yy_bp ) + int c; + char * yy_bp; { - register char *yy_cp; + char *yy_cp; yy_cp = (yy_c_buf_p); @@ -2640,10 +2540,10 @@ static int yy_get_next_buffer (void) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + yy_size_t number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -2665,13 +2565,10 @@ static int yy_get_next_buffer (void) (yy_c_buf_p) = yy_cp; } -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) #endif +#ifndef YY_NO_INPUT +static int input () { int c; @@ -2717,11 +2614,7 @@ static int yy_get_next_buffer (void) if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else return input(); -#endif } case EOB_ACT_CONTINUE_SCAN: @@ -2731,7 +2624,7 @@ static int yy_get_next_buffer (void) } } - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + c = *(uchar *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); @@ -2746,7 +2639,9 @@ static int yy_get_next_buffer (void) * * @note This function does not reset the start condition to @c INITIAL . */ - void yyrestart (FILE * input_file ) + +void yyrestart (input_file ) + FILE * input_file; { if ( ! YY_CURRENT_BUFFER ){ @@ -2763,14 +2658,15 @@ static int yy_get_next_buffer (void) * @param new_buffer The new input buffer. * */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +void yy_switch_to_buffer (new_buffer ) + YY_BUFFER_STATE new_buffer; { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); - */ + */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -2794,7 +2690,7 @@ static int yy_get_next_buffer (void) (yy_did_buffer_switch_on_eof) = 1; } -static void yy_load_buffer_state (void) +static void yy_load_buffer_state () { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; @@ -2808,7 +2704,9 @@ static void yy_load_buffer_state (void) * * @return the allocated buffer state. */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +YY_BUFFER_STATE yy_create_buffer (file,size ) + FILE * file; + int size; { YY_BUFFER_STATE b; @@ -2816,7 +2714,7 @@ static void yy_load_buffer_state (void) if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. @@ -2836,7 +2734,8 @@ static void yy_load_buffer_state (void) * @param b a buffer created with yy_create_buffer() * */ - void yy_delete_buffer (YY_BUFFER_STATE b ) +void yy_delete_buffer (b ) + YY_BUFFER_STATE b; { if ( ! b ) @@ -2855,8 +2754,9 @@ static void yy_load_buffer_state (void) * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - +static void yy_init_buffer (b,file ) + YY_BUFFER_STATE b; + FILE * file; { int oerrno = errno; @@ -2883,7 +2783,8 @@ static void yy_load_buffer_state (void) * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ - void yy_flush_buffer (YY_BUFFER_STATE b ) +void yy_flush_buffer (b ) + YY_BUFFER_STATE b; { if ( ! b ) return; @@ -2912,7 +2813,8 @@ static void yy_load_buffer_state (void) * @param new_buffer The new state. * */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +void yypush_buffer_state (new_buffer ) + YY_BUFFER_STATE new_buffer; { if (new_buffer == NULL) return; @@ -2942,7 +2844,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) * The next element becomes the new top. * */ -void yypop_buffer_state (void) +void yypop_buffer_state () { if (!YY_CURRENT_BUFFER) return; @@ -2961,56 +2863,60 @@ void yypop_buffer_state (void) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void yyensure_buffer_stack (void) +static void yyensure_buffer_stack () { - yy_size_t num_to_alloc; + yy_size_t num_to_alloc; - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. + if (!(yy_buffer_stack)) { + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } +#if 1 /* [PR] avoid C++-style comment; older C compilers choke on it */ + num_to_alloc = 2; /* also changed to match the comment... */ +#else + num_to_alloc = 1; // After all that talk, this was set to 1 anyways... +#endif + (yy_buffer_stack) = (struct yy_buffer_state**) + yyalloc(num_to_alloc * sizeof(struct yy_buffer_state*) ); + if (!(yy_buffer_stack)) + YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + (void) memset((yy_buffer_stack), 0, + num_to_alloc * sizeof(struct yy_buffer_state*)); - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) { + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**) + yyrealloc((yy_buffer_stack),num_to_alloc * sizeof(struct yy_buffer_state*) ); + if (!(yy_buffer_stack)) + YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); + + /* zero only the new slots.*/ + (void) memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, + grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } } -/** Setup the input buffer state to scan directly from a user-specified character buffer. +/** Setup the input buffer state to scan directly from a user-specified + * character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +YY_BUFFER_STATE yy_scan_buffer (base,size ) + char * base; + yy_size_t size; { YY_BUFFER_STATE b; @@ -3039,33 +2945,37 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) return b; } -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. +/** Setup the input buffer state to scan a string. The next call to yylex() + * will scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (yystr ) + yyconst char * yystr; { return yy_scan_bytes(yystr,strlen(yystr) ); } -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. +/** Setup the input buffer state to scan the given bytes. The next call to + * yylex() will scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param _yybytes_len the number of bytes in the buffer pointed to by @a + * bytes. * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (yybytes,_yybytes_len ) + yyconst char * yybytes; + yy_size_t _yybytes_len; { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -3094,9 +3004,10 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yy_fatal_error (msg ) + yyconst char* msg; { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -3104,25 +3015,23 @@ static void yy_fatal_error (yyconst char* msg ) #undef yyless #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ + do { \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) + YY_LESS_LINENO(yyless_macro_arg); \ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ -int yyget_lineno (void) +int yyget_lineno () { return yylineno; @@ -3131,7 +3040,7 @@ int yyget_lineno (void) /** Get the input stream. * */ -FILE *yyget_in (void) +FILE *yyget_in () { return yyin; } @@ -3139,7 +3048,7 @@ FILE *yyget_in (void) /** Get the output stream. * */ -FILE *yyget_out (void) +FILE *yyget_out () { return yyout; } @@ -3147,7 +3056,7 @@ FILE *yyget_out (void) /** Get the length of the current token. * */ -yy_size_t yyget_leng (void) +yy_size_t yyget_leng () { return yyleng; } @@ -3156,48 +3065,52 @@ yy_size_t yyget_leng (void) * */ -char *yyget_text (void) +char *yyget_text () { return yytext; } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void yyset_lineno (int line_number ) +void yyset_lineno (_line_number ) + int _line_number; { - yylineno = line_number; + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str ) +void yyset_in (_in_str ) + FILE * _in_str; { - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str ) +void yyset_out (_out_str ) + FILE * _out_str; { - yyout = out_str ; + yyout = _out_str ; } -int yyget_debug (void) +int yyget_debug () { return yy_flex_debug; } -void yyset_debug (int bdebug ) +void yyset_debug (_bdebug ) + int _bdebug; { - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } -static int yy_init_globals (void) +static int yy_init_globals () { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. @@ -3226,22 +3139,21 @@ static int yy_init_globals (void) } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) +int yylex_destroy () { /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } + while (YY_CURRENT_BUFFER) { + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ + /* Reset the globals. This is important in a non-reentrant scanner + * so the next time yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; @@ -3252,18 +3164,23 @@ int yylex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (s1,s2,n ) + char* s1; + yyconst char * s2; + int n; { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (s ) + yyconst char * s; { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -3271,13 +3188,18 @@ static int yy_flex_strlen (yyconst char * s ) } #endif -void *yyalloc (yy_size_t size ) +void *yyalloc (size ) + yy_size_t size; { + return (void *) malloc( size ); } -void *yyrealloc (void * ptr, yy_size_t size ) +void *yyrealloc (ptr,size ) + void * ptr; + yy_size_t size; { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -3288,13 +3210,13 @@ void *yyrealloc (void * ptr, yy_size_t size ) return (void *) realloc( (char *) ptr, size ); } -void yyfree (void * ptr ) +void yyfree (ptr ) + void * ptr; { + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } -#define YYTABLES_NAME "yytables" - #ifdef AMIGA long * alloc(n) From 996c0a3741930d078b2ba1689cee3913bf605c4a Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 5 Dec 2015 23:26:41 -0800 Subject: [PATCH 15/18] unix/Makefile.utl: tweak lex/yacc postprocessing --- sys/unix/Makefile.utl | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl index ef1a496da..d5d30426b 100644 --- a/sys/unix/Makefile.utl +++ b/sys/unix/Makefile.utl @@ -1,5 +1,5 @@ # Makefile for NetHack's utility programs. -# NetHack 3.6 Makefile.utl $NHDT-Date: 1448711183 2015/11/28 11:46:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ +# NetHack 3.6 Makefile.utl $NHDT-Date: 1449386560 2015/12/06 07:22:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.27 $ # Root of source tree: NHSROOT=.. @@ -235,13 +235,19 @@ lev_lex.o: lev_lex.c $(HACK_H) ../include/lev_comp.h ../include/sp_lev.h lev_yacc.c: lev_comp.y $(YACC) $(YACCDIST) -d lev_comp.y - sed -e 's#"$(YTABC)"#"$@"#' $(YTABC) > $@ && rm $(YTABC) + sed -e 's#"$(YTABC)"#"$@"#' -e 's#$(YTABC):#$@:#' $(YTABC) > $@ \ + && rm $(YTABC) sed -e 's#"$(YTABH)"#"lev_comp.h"#' $(YTABH) > ../include/lev_comp.h \ && rm $(YTABH) lev_lex.c: lev_comp.l $(LEX) $(FLEXDIST) lev_comp.l - sed -e 's#"$(LEXYYC)"#"$@"#' $(LEXYYC) > $@ && rm $(LEXYYC) + sed -e 's#"$(LEXYYC)"#"$@"#' -e 's# *$$##' $(LEXYYC) > $@ \ + && rm $(LEXYYC) +# note: flex code construction using m4 macros results in some trailing +# spaces; is basic RE substitute for +# and we don't bother stripping trailing tabs because that gets messy; +# make expands into which is RE end-of-line. # with all of extern.h's functions to complain about, we drown in # 'defined but not used' without -u @@ -267,13 +273,16 @@ dgn_lex.o: dgn_lex.c $(CONFIG_H) ../include/dgn_comp.h ../include/dgn_file.h dgn_yacc.c: dgn_comp.y $(YACC) $(YACCDIST) -d dgn_comp.y - sed -e 's#"$(YTABC)"#"$@"#' $(YTABC) > $@ && rm $(YTABC) + sed -e 's#"$(YTABC)"#"$@"#' -e 's#$(YTABC):#$@:#' $(YTABC) > $@ \ + && rm $(YTABC) sed -e 's#"$(YTABH)"#"dgn_comp.h"#' $(YTABH) > ../include/dgn_comp.h \ && rm $(YTABH) dgn_lex.c: dgn_comp.l $(LEX) $(FLEXDIST) dgn_comp.l - sed -e 's#"$(LEXYYC)"#"$@"#' $(LEXYYC) > $@ && rm $(LEXYYC) + sed -e 's#"$(LEXYYC)"#"$@"#' -e 's# *$$##' $(LEXYYC) > $@ \ + && rm $(LEXYYC) +# note: is basic RE substitute for # with all of extern.h's functions to complain about, we drown in # 'defined but not used' without -u From 71c5bab0c36de4dc73d70c8209f08ccf59579385 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 6 Dec 2015 11:50:39 -0500 Subject: [PATCH 16/18] Update Guidebook dates to reflect release Changes to be committed: modified: doc/Guidebook.mn modified: doc/Guidebook.tex modified: doc/Guidebook.txt --- doc/Guidebook.mn | 4 +- doc/Guidebook.tex | 2 +- doc/Guidebook.txt | 136 +++++++++++++++++++++++----------------------- 3 files changed, 71 insertions(+), 71 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 29b83d34e..1e56a790e 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1,11 +1,11 @@ -.\" $NHDT-Branch: master $:$NHDT-Revision: 1.187 $ $NHDT-Date: 1448920179 2015/11/30 21:49:39 $ +.\" $NHDT-Branch: master $:$NHDT-Revision: 1.188 $ $NHDT-Date: 1449420465 2015/12/06 16:47:45 $ .ds h0 "NetHack Guidebook .ds h1 .ds h2 % .ds vr "NetHack 3.6 .ds f0 "\*(vr .ds f1 -.ds f2 "June 22, 2015 +.ds f2 "December 7, 2015 .\" labeled paragraph start (should be part of tmac.n, but I don't want to .\" make changes to that file) .\" .PS word diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 94d4dd4bc..7a0603431 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -45,7 +45,7 @@ %.au \author{Original version - Eric S. Raymond\\ (Edited and expanded for 3.6 by Mike Stephenson and others)} -\date{June 22, 2015} +\date{December 7, 2015} \maketitle diff --git a/doc/Guidebook.txt b/doc/Guidebook.txt index 1be4abc86..a4f7f68e6 100644 --- a/doc/Guidebook.txt +++ b/doc/Guidebook.txt @@ -126,7 +126,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -192,7 +192,7 @@ thing (including other orcs). Above all others, Orcs hate Elves - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -258,7 +258,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -324,7 +324,7 @@ Intelligence affects your ability to cast spells and read - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -390,7 +390,7 @@ ical attacks. Many dungeons show only your experience level - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -456,7 +456,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -522,7 +522,7 @@ additional information, for example a direction, or an object to - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -588,7 +588,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -654,7 +654,7 @@ click takes place on a location other than the current - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -720,7 +720,7 @@ E- - write in the dust with your fingers. - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -786,7 +786,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -852,7 +852,7 @@ off.) - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -918,7 +918,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -984,7 +984,7 @@ (R)UNIX is a registered trademark of AT&T. - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1050,7 +1050,7 @@ ster form). - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1116,7 +1116,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1182,7 +1182,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1248,7 +1248,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1314,7 +1314,7 @@ the player gets stuck; however, they will lower your luck. - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1380,7 +1380,7 @@ needs to be compatible with the type of merchandise carried by - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1446,7 +1446,7 @@ which is just a space will remove any prior name. - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1512,7 +1512,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1578,7 +1578,7 @@ your condition. - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1644,7 +1644,7 @@ distinguished in your inventory by the presence of the word - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1710,7 +1710,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1776,7 +1776,7 @@ in the same direction; if the first ones kill a monster, the - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1842,7 +1842,7 @@ one is considered secondary. The most noticeable difference is - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1908,7 +1908,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -1974,7 +1974,7 @@ ancient wizards for their amusement value (ex. ``READ ME,'' or - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2040,7 +2040,7 @@ such an explosion starts out very small and increases each time - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2106,7 +2106,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2172,7 +2172,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2238,7 +2238,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2304,7 +2304,7 @@ that playing Monk or Priest characters should violate this - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2370,7 +2370,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2436,7 +2436,7 @@ ent operating systems, but NETHACKOPTIONS can also be set to the - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2502,7 +2502,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2568,7 +2568,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2634,7 +2634,7 @@ Name a fruit after something you enjoy eating (ex. - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2700,7 +2700,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2766,7 +2766,7 @@ Controls how the headings in a menu are highlighted. Values - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2832,7 +2832,7 @@ r - full window reversed, newest message first. - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2898,7 +2898,7 @@ A space separated list of specific situations where alternate - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -2964,7 +2964,7 @@ Specify the object types to be picked up when autopickup is on. - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3030,7 +3030,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3096,7 +3096,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3162,7 +3162,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3228,7 +3228,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3294,7 +3294,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3360,7 +3360,7 @@ NetHack should display windows with the specified - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3426,7 +3426,7 @@ proof input (MS-DOS sometimes treats `^P' as a printer toggle - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3492,7 +3492,7 @@ file, you can define patterns to be checked when the game is - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3558,7 +3558,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3624,7 +3624,7 @@ file, and the last MENUCOLOR-line in your config file that - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3690,7 +3690,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3756,7 +3756,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3822,7 +3822,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3888,7 +3888,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -3954,7 +3954,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -4020,7 +4020,7 @@ in the same format as the traditional per-user configuration file - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -4086,7 +4086,7 @@ list, or better your previous score, you will be inserted in the - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -4152,7 +4152,7 @@ in falling back to explore mode instead. - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -4218,7 +4218,7 @@ Day, Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Eric - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -4284,7 +4284,7 @@ wick Allison improved the spell casting system with the Wizard - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -4350,7 +4350,7 @@ face for the Windows port. Alex Kompel also contributed a - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -4416,7 +4416,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -4482,7 +4482,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 @@ -4548,7 +4548,7 @@ - NetHack 3.6 June 22, 2015 + NetHack 3.6 December 7, 2015 From d1a15731bd82532d8a22d4d82ca5569b0c21ef5f Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 6 Dec 2015 12:49:59 -0500 Subject: [PATCH 17/18] update Files to reflect tarball Changes to be committed: modified: Files --- Files | 98 +++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 59 insertions(+), 39 deletions(-) diff --git a/Files b/Files index c0710ff98..777fb3b07 100644 --- a/Files +++ b/Files @@ -6,7 +6,7 @@ from or not transferred to your system if you wish. .: (files in top directory) -DEVEL Files Porting README +Files Porting README dat: (files for all versions) @@ -26,7 +26,7 @@ Guidebook.mn Guidebook.tex Guidebook.txt dgn_comp.6 dgn_comp.txt dlb.6 dlb.txt fixes22.0 fixes30.0 fixes31.1 fixes31.2 fixes31.3 fixes32.0 fixes32.1 fixes32.2 fixes32.3 fixes33.0 fixes33.1 fixes34.0 fixes34.1 -fixes34.2 fixes34.3 fixes34.4 fixes36.0 lev_comp.6 +fixes34.2 fixes34.3 fixes35.0 fixes36.0 lev_comp.6 lev_comp.txt makedefs.6 makedefs.txt nethack.6 nethack.txt recover.6 recover.txt tmac.n window.doc @@ -42,10 +42,10 @@ mkroom.h monattk.h mondata.h monflag.h monst.h monsym.h ntconf.h obj.h objclass.h os2conf.h patchlevel.h pcconf.h permonst.h prop.h qtext.h quest.h rect.h region.h rm.h skills.h -sp_lev.h spell.h system.h tcap.h timeout.h -tosconf.h tradstdc.h trampoli.h trap.h unixconf.h -vision.h vmsconf.h wceconf.h winami.h winprocs.h -wintype.h you.h youprop.h +sp_lev.h spell.h sys.h system.h tcap.h +timeout.h tosconf.h tradstdc.h trampoli.h trap.h +unixconf.h vision.h vmsconf.h wceconf.h winami.h +winprocs.h wintype.h you.h youprop.h (file for tty versions) wintty.h (files for X versions) @@ -79,11 +79,11 @@ potion.c pray.c priest.c quest.c questpgr.c read.c rect.c region.c restore.c rip.c rnd.c role.c rumors.c save.c shk.c shknam.c sit.c sounds.c sp_lev.c spell.c -steal.c steed.c teleport.c timeout.c topten.c -track.c trap.c u_init.c uhitm.c vault.c -version.c vision.c weapon.c were.c wield.c -windows.c wizard.c worm.c worn.c write.c -zap.c +steal.c steed.c sys.c teleport.c timeout.c +topten.c track.c trap.c u_init.c uhitm.c +vault.c version.c vision.c weapon.c were.c +wield.c windows.c wizard.c worm.c worn.c +write.c zap.c sys/amiga: (files for Amiga versions - untested for 3.6.0) @@ -119,8 +119,8 @@ sys/msdos: Install.dos Makefile.BC Makefile.GCC Makefile.MSC moveinit.pat msdos.c msdoshlp.txt ovlinit.c pckeys.c pctiles.c pctiles.h pcvideo.h portio.h schema1.BC schema2.BC -schema3.MSC setup.bat sound.c tile2bin.c video.c -vidtxt.c vidvga.c +schema3.MSC SCHEMA35.MSC setup.bat sound.c tile2bin.c +video.c vidtxt.c vidvga.c (files for running MSDOS binary under Windows) nhico.uu nhpif.uu @@ -169,7 +169,8 @@ sys/unix: (files for UNIX versions) Install.unx Makefile.dat Makefile.doc Makefile.src Makefile.top Makefile.utl README.linux depend.awk mkmkfile.sh nethack.sh -setup.sh sysconf unixmain.c unixres.c unixunix.c +NewInstall.unx setup.sh sysconf unixmain.c unixres.c +unixunix.c (files for replacement cpp, only needed by some ancient UNIX systems) cpp1.shr cpp2.shr cpp3.shr (file for sound driver for 386 UNIX) @@ -177,8 +178,8 @@ snd86unx.shr sys/unix/hints: (files for configuring UNIX NetHack versions) -linux linux-x11 macosx macosx10.5 macosx10.7 -macosx10.10 unix +linux linux-chroot linux-x11 macosx macosx10.5 +macosx10.7 macosx.sh macosx10.10 unix sys/vms: (files for VMS version - untested for 3.6.0) @@ -196,8 +197,9 @@ mhdlg.h mhfont.c mhfont.h mhinput.c mhinput.h mhmain.c mhmain.h mhmap.c mhmap.h mhmenu.c mhmenu.h mhmsg.h mhmsgwnd.c mhmsgwnd.h mhrip.c mhrip.h mhstatus.c mhstatus.h mhtext.c mhtext.h -mhtxtbuf.c mhtxtbuf.h mswproc.c newres.h resource.h -winMS.h winhack.c winhack.rc winhcksp.rc winmain.c +mhtxtbuf.c mhtxtbuf.h mswproc.c newres.h nhico.uu +resource.h winMS.h winhack.c winhack.rc winhcksp.rc +winmain.c sys/wince/ceinc: (header files for Windows CE and PocketPC) @@ -211,13 +213,13 @@ sys/winnt: (files for Windows 9x, NT and Windows2000 version) Install.nt Makefile.gcc Makefile.msc console.rc defaults.nh nethack.def nh340key.c nhdefkey.c nhico.uu nhraykey.c -nhsetup.bat ntsound.c nttty.c porthelp sysconf -win32api.h winnt.c +nhsetup.bat ntsound.c nttty.c porthelp stubs.c +sysconf win32api.h winnt.c util: (files for all versions) -dgn_main.c dlb_main.c lev_main.c makedefs.c panic.c -recover.c +dgn_main.c dlb_main.c lev_main.c makedefs.c mdgrep.h +mdgrep.pl panic.c recover.c (lex/yacc input for special level and dungeon compilers) dgn_comp.l dgn_comp.y lev_comp.l lev_comp.y @@ -235,6 +237,10 @@ nh_icon.xpm pet_mark.xbm pilemark.xbm rip.xpm tile2x11.c winX.c winmap.c winmenu.c winmesg.c winmisc.c winstat.c wintext.c winval.c +win/chain: +(files for win/chain) +wc_chainin.c wc_chainout.c wc_trace.c + win/gem: (files for GEM versions) Install.gem bitmfile.c gem_rsc.uu gem_rso.uu gr_rect.c @@ -251,11 +257,16 @@ gnplayer.h gnsignal.c gnsignal.h gnstatus.c gnstatus.h gntext.c gntext.h gnworn.c gnworn.h gnyesno.c gnyesno.h mapbg.xpm +win/macosx: +(files for macosx versions) +NetHackGuidebook.applescript NetHackRecover.applescript +NetHackTerm.applescript recover.pl + win/share: (files for versions using optional tiles) gifread.c monsters.txt objects.txt other.txt ppmwrite.c -thintile.c tile.doc tile.h tile2bmp.c tilemap.c -tiletext.c +renumtiles.pl thintile.c tile.doc tile.h tile2bmp.c +tilemap.c tiletext.c win/tty: (files for tty versions) @@ -271,11 +282,20 @@ mhsplash.h mhstatus.c mhstatus.h mhtext.c mhtext.h mnsel.uu mnselcnt.uu mnunsel.uu mswproc.c petmark.uu pilemark.uu resource.h rip.uu splash.uu tiles.mak winMS.h winhack.c winhack.rc + +win/win32/vs2010: (files for Visual Studio 2010 Express Edition builds) -dgncomp.vcxproj dgnstuff.vcxproj dgnstuff.mak dlb_main.vcxproj -levcomp.vcxproj levstuff.vcxproj levstuff.mak makedefs.vcxproj -NetHack.sln uudecode.vcxproj NetHackW.vcxproj tile2bmp.vcxproj -recover.vcxproj tilemap.vcxproj tiles.vcxproj +dgncomp.vcxproj dgnstuff.vcxproj dlb_main.vcxproj levcomp.vcxproj +levstuff.vcxproj makedefs.vcxproj NetHack.sln NetHackW.vcxproj +recover.vcxproj tile2bmp.vcxproj tilemap.vcxproj tiles.vcxproj +uudecode.vcxproj + +win/win32/vs2013: +(files for Visual Studio 2013 Express Edition builds) +dgncomp.vcxproj dgnstuff.vcxproj dlb_main.vcxproj levcomp.vcxproj +levstuff.vcxproj makedefs.vcxproj NetHack.sln NetHack.vcxproj +NetHackW.vcxproj nhdefkey.vcxproj recover.vcxproj tile2bmp.vcxproj +tilemap.vcxproj tiles.vcxproj uudecode.vcxproj This is a list of files produced by auxiliary programs. They can all be regenerated from the files in the distribution. @@ -355,22 +375,22 @@ uudecode.exe DEVEL: (files for people developing changes to NetHack) -DOTGIT code_style.txt nhgitset.pl -Developer.txt git_recipes.txt -code_features.txt hooksdir +code_features.txt code_style.txt Developer.txt git_recipes.txt +nhgitset.pl + +DEVEL/DOTGIT: +TARGET DEVEL/hooksdir: -NHadd nhsub pre-auto-gc -NHgithook.pm post-applypatch pre-commit -NHsubst post-checkout pre-push -NHtext post-commit pre-rebase -TARGET post-merge prepare-commit-msg -applypatch-msg post-rewrite -commit-msg pre-applypatch +applypatch-msg commit-msg NHadd NHgithook.pm +nhsub NHsubst NHtext post-applypatch +post-checkout post-commit post-merge post-rewrite +pre-applypatch pre-auto-gc pre-commit pre-push +pre-rebase prepare-commit-msg TARGET .: (files for win32 that are moved into . at compile time) -nethack.dsw +NetHack.dsw NOTE: If your binaries were compiled with the data librarian (DLB) option, your playground will not contain all of the files listed here. All From 7079c0a3a5291d2a17239fe2a6b1a4a741b6f496 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 6 Dec 2015 13:06:59 -0500 Subject: [PATCH 18/18] mark some as untested Changes to be committed: modified: Files Also: vms was already listed as "untested in 3.6.0", but should it be? --- Files | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Files b/Files index 777fb3b07..f73471fab 100644 --- a/Files +++ b/Files @@ -129,13 +129,13 @@ sys/os2: Install.os2 Makefile.os2 nhpmico.uu os2.c sys/share: -(files for MSDOS and OS/2 versions) +(files for MSDOS and OS/2 versions - untested for 3.6.0) Makefile.lib termcap.uu -(file for MSDOS, OS/2, NT, Amiga, and Atari versions) +(file for MSDOS, OS/2, NT, Amiga, and Atari versions - untested for 3.6.0) pcmain.c -(files for MSDOS, OS/2, NT, and Atari versions) +(files for MSDOS, OS/2, NT, and Atari versions - untested for 3.6.0) pcsys.c pcunix.c -(file for MSDOS, OS/2, and Atari versions) +(file for MSDOS, OS/2, and Atari versions - untested for 3.6.0) NetHack.cnf pctty.c (files for UNIX and Be versions) ioctl.c unixtty.c @@ -202,15 +202,15 @@ resource.h winMS.h winhack.c winhack.rc winhcksp.rc winmain.c sys/wince/ceinc: -(header files for Windows CE and PocketPC) +(header files for Windows CE and PocketPC - untested for 3.6.0) assert.h errno.h fcntl.h sys/wince/ceinc/sys: -(sys/stat.h for Windows CE and PocketPC) +(sys/stat.h for Windows CE and PocketPC - untested for 3.6.0) stat.h sys/winnt: -(files for Windows 9x, NT and Windows2000 version) +(files for Windows 7/8.x/10 version) Install.nt Makefile.gcc Makefile.msc console.rc defaults.nh nethack.def nh340key.c nhdefkey.c nhico.uu nhraykey.c nhsetup.bat ntsound.c nttty.c porthelp stubs.c @@ -242,13 +242,13 @@ win/chain: wc_chainin.c wc_chainout.c wc_trace.c win/gem: -(files for GEM versions) +(files for GEM versions - untested for 3.6.0) Install.gem bitmfile.c gem_rsc.uu gem_rso.uu gr_rect.c gr_rect.h load_img.c tile2img.c title.uu wingem.c wingem1.c xpm2img.c win/gnome: -(files for GNOME versions) +(files for GNOME versions - untested for 3.6.0) README gn_xpms.h gnaskstr.c gnaskstr.h gnbind.c gnbind.h gnglyph.c gnglyph.h gnmain.c gnmain.h gnmap.c gnmap.h gnmenu.c gnmenu.h gnmesg.c