Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2019-03-08 10:38:18 -05:00
11 changed files with 1080 additions and 1638 deletions

View File

@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.269 $ $NHDT-Date: 1551739190 2019/03/04 22:39:50 $
$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.270 $ $NHDT-Date: 1551920371 2019/03/07 00:59:31 $
This fixes36.2 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.1 in April 2018. Please note, however,
@@ -389,6 +389,9 @@ wand or spell of undead turning handled messages and wand-discovery in a
non-intuitive manner biased toward healers
if steed ate a mimic corpse and began masquerading as something, hero could
keep riding it; force dismount
kicking an object stack moves the topmost 1, but range calculation used the
weight of the whole stack to decide how far it would move, possibly
yielding "thump" result with no movement despite being a light item
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 config1.h $NHDT-Date: 1432512781 2015/05/25 00:13:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $ */
/* NetHack 3.6 config1.h $NHDT-Date: 1552007489 2019/03/08 01:11:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.20 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -146,7 +146,9 @@
#undef UNIX
#ifdef __DECC
#ifndef __DECC_VER /* buggy early versions want widened prototypes */
#define NOTSTDC /* except when typedefs are involved */
#define NOTSTDC /* except when typedefs are involved */
/* [25 or so years later... That was probably uchar widening to */
/* 'unsigned int' rather than anything to do with typedefs. pr] */
#define USE_VARARGS
#else
#define NHSTDC
@@ -200,10 +202,10 @@
/* Because:
* #define FOO => FOO={} => defined( ) => (-1 != - - 1) => 1
* #define FOO 1 or on command-line -DFOO
* => defined(1) => (-1 != - 1 - 1) => 1
* => defined(1) => (-1 != - 1 - 1) => 1
* if FOO isn't defined, FOO=0. But some compilers default to 0 instead of 1
* for -DFOO, oh well.
* => defined(0) => (-1 != - 0 - 1) => 0
* => defined(0) => (-1 != - 0 - 1) => 0
*
* But:
* defined("") => (-1 != - "" - 1)

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 integer.h $NHDT-Date: 1524689514 2018/04/25 20:51:54 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.0 $ */
/* NetHack 3.6 integer.h $NHDT-Date: 1551901047 2019/03/06 19:37:27 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.7 $ */
/* Copyright (c) 2016 by Michael Allison */
/* NetHack may be freely redistributed. See license for details. */
@@ -32,21 +32,33 @@
#ifndef INTEGER_H
#define INTEGER_H
#if (defined(__STDC__) && __STDC_VERSION__ >= 199901L)
/* DEC C (aka Compaq C for a while, HP C these days) for VMS is
classified as a freestanding implementation rather than a hosted one
and even though it claims to be C99, it does not provide <stdint.h>. */
#if defined(__DECC) && defined(VMS) && !defined(HAS_STDINT_H)
#define HAS_INTTYPES_H
#else /*!__DECC*/
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
&& !defined(HAS_STDINT_H)
/* The compiler claims to conform to C99. Use stdint.h */
#include <stdint.h>
#define SKIP_STDINT_WORKAROUND
#else
# if defined(HAS_STDINT_H)
/* Some compilers have stdint.h but don't conform to all of C99. */
#include <stdint.h>
#define SKIP_STDINT_WORKAROUND
# endif
# if defined(__GNUC__) && defined(__INT64_MAX__)
# include <stdint.h>
# define SKIP_STDINT_WORKAROUND
# endif
#define HAS_STDINT_H
#endif
#if defined(__GNUC__) && defined(__INT64_MAX__) && !defined(HAS_STDINT_H)
#define HAS_STDINT_H
#endif
#endif /*?__DECC*/
#ifdef HAS_STDINT_H
#include <stdint.h>
#define SKIP_STDINT_WORKAROUND
#else /*!stdint*/
#ifdef HAS_INTTYPES_H
#include <inttypes.h>
#define SKIP_STDINT_WORKAROUND
#endif
#endif /*?stdint*/
#ifndef SKIP_STDINT_WORKAROUND /* !C99 */
/*
@@ -59,8 +71,8 @@ typedef unsigned short uint16_t;
#if defined(__WATCOMC__) && !defined(__386__)
/* Open Watcom providing a 16 bit build for MS-DOS or OS/2 */
/* int is 16 bits; use long for 32 bits */
typedef long int32_t;
typedef unsigned long uint32_t;
typedef long int int32_t;
typedef unsigned long int uint32_t;
#else
/* Otherwise, assume either a 32- or 64-bit compiler */
/* long may be 64 bits; use int for 32 bits */
@@ -68,8 +80,13 @@ typedef int int32_t;
typedef unsigned int uint32_t;
#endif
typedef long long int64_t;
typedef unsigned long long uint64_t;
/* The only place where nethack cares about 64-bit integers is in the
Isaac64 random number generator. If your environment can't support
64-bit integers, you should comment out USE_ISAAC64 in config.h so
that the previous RNG gets used instead. Then this file will be
inhibited and it won't matter what the int64_t and uint64_t lines are. */
typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#endif /* !C99 */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 tradstdc.h $NHDT-Date: 1545270756 2018/12/20 01:52:36 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.34 $ */
/* NetHack 3.6 tradstdc.h $NHDT-Date: 1552007504 2019/03/08 01:11:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.35 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2006. */
/* NetHack may be freely redistributed. See license for details. */
@@ -278,12 +278,16 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
#endif
/*
* According to ANSI, prototypes for old-style declarations must widen the
* arguments to int. However, the MSDOS compilers accept shorter arguments
* (char, short, etc.) in prototypes and do typechecking with them. Therefore
* this mess to allow the better typechecking while also allowing some
* prototypes for the ANSI compilers so people quit trying to fix the
* prototypes to match the standard and thus lose the typechecking.
* According to ANSI C, prototypes for old-style function definitions like
* int func(arg) short arg; { ... }
* must specify widened arguments (char and short to int, float to double),
* int func(int);
* same as how narrow arguments get passed when there is no prototype info.
* However, various compilers accept shorter arguments (char, short, etc.)
* in prototypes and do typechecking with them. Therefore this mess to
* allow the better typechecking while also allowing some prototypes for
* the ANSI compilers so people quit trying to fix the prototypes to match
* the standard and thus lose the typechecking.
*/
#if defined(MSDOS) && !defined(__GO32__)
#define UNWIDENED_PROTOTYPES
@@ -332,7 +336,9 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
#ifdef WIDENED_PROTOTYPES
#define CHAR_P int
#define SCHAR_P int
#ifndef UCHAR_P
#define UCHAR_P int
#endif
#define XCHAR_P int
#define SHORT_P int
#define BOOLEAN_P int

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 unixconf.h $NHDT-Date: 1550532737 2019/02/18 23:32:17 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.39 $ */
/* NetHack 3.6 unixconf.h $NHDT-Date: 1552007506 2019/03/08 01:11:46 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.40 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2018. */
/* NetHack may be freely redistributed. See license for details. */
@@ -271,6 +271,13 @@
#endif
#endif
/* Digital Unix/HP Tru64 -- see vmsconf.h for explanation */
#if defined(__DECC) && (!defined(__STDC__) || !__STDC__)
#define UCHAR_P unsigned int
#else
#define UCHAR_P int
#endif
/*
* BSD/ULTRIX systems are normally the only ones that can suspend processes.
* Suspending NetHack processes cleanly should be easy to add to other systems

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 vmsconf.h $NHDT-Date: 1432512780 2015/05/25 00:13:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.22 $ */
/* NetHack 3.6 vmsconf.h $NHDT-Date: 1552007507 2019/03/08 01:11:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.28 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -160,6 +160,12 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then
#define RANDOM /* use sys/share/random.c instead of vaxcrtl rand */
/* config.h defines USE_ISAAC64; we'll use it on Alpha or IA64 but not VAX;
it overrides RANDOM */
#if (defined(VAX) || defined(vax) || defined(__vax)) && defined(USE_ISAAC64)
#undef ISAAC64
#endif
#define FCMASK 0660 /* file creation mask */
/*
@@ -186,6 +192,21 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then
#endif
#endif
/* ANSI C uses "value preserving rules", where 'unsigned char' and
'unsigned short' promote to 'int' if signed int is big enough to hold
all possible values, rather than traditional "sign preserving rules"
where 'unsigned char' and 'unsigned short' promote to 'unsigned int'.
However, the ANSI C rules aren't binding on non-ANSI compilers.
When DEC C (aka Compaq C, then HP C) is in non-standard 'common' mode
it supports prototypes that expect widened types, but it uses the old
sign preserving rules for how to widen narrow unsigned types. (In its
default 'relaxed' mode, __STDC__ is 1 and uchar widens to 'int'.) */
#if defined(__DECC) && (!defined(__STDC__) || !__STDC__)
#define UCHAR_P unsigned int
#else
#define UCHAR_P int
#endif
#ifdef __DECC
#define STRICT_REF_DEF /* used in lev_main.c */
#endif
@@ -237,6 +258,12 @@ typedef __mode_t mode_t;
#define tgetch vms_getchar
#if defined(__DECC_VER) && (__DECC_VER >= 50000000)
/* for cc/Standard=ANSI89, suppress notification that '$' in identifiers
is an extension; sys/vms/*.c needs it regardless of strict ANSI mode */
#pragma message disable DOLLARID
#endif
#include "system.h"
#define index strchr
@@ -247,8 +274,7 @@ typedef __mode_t mode_t;
# if defined(RANDOM)
# define Rand() random()
/* VMS V7 adds these entry points to DECC$SHR; stick with the nethack-supplied
code to avoid having to deal with version-specific conditionalized builds
*/
code to avoid having to deal with version-specific conditionalized builds */
# define random nh_random
# define srandom nh_srandom
# define initstate nh_initstate
@@ -270,7 +296,7 @@ typedef __mode_t mode_t;
#define link(f1, f2) vms_link(f1, f2) /* vmsfiles.c */
#define open(f, k, m) vms_open(f, k, m) /* vmsfiles.c */
#define fopen(f, m) vms_fopen(f, m) /* vmsfiles.c */
/* #define unlink(f0) vms_unlink(f0) /* vmsfiles.c */
/* #define unlink(f0) vms_unlink(f0) /* vmsfiles.c */
#ifdef VERYOLD_VMS
#define unlink(f0) delete (f0) /* vaxcrtl */
#else

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 dokick.c $NHDT-Date: 1548209738 2019/01/23 02:15:38 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.130 $ */
/* NetHack 3.6 dokick.c $NHDT-Date: 1551920353 2019/03/07 00:59:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.131 $ */
/* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -524,9 +524,25 @@ xchar x, y;
}
}
/* range < 2 means the object will not move. */
/* maybe dexterity should also figure here. */
range = (int) ((ACURRSTR) / 2 - g.kickedobj->owt / 40);
isgold = (g.kickedobj->oclass == COIN_CLASS);
{
int k_owt = (int) g.kickedobj->owt;
/* for non-gold stack, 1 item will be split off below (unless an
early return occurs, so we aren't moving the split to here);
calculate the range for that 1 rather than for the whole stack */
if (g.kickedobj->quan > 1L && !isgold) {
long save_quan = g.kickedobj->quan;
g.kickedobj->quan = 1L;
k_owt = weight(g.kickedobj);
g.kickedobj->quan = save_quan;
}
/* range < 2 means the object will not move
(maybe dexterity should also figure here) */
range = ((int) ACURRSTR) / 2 - k_owt / 40;
}
if (martial())
range += rnd(3);
@@ -556,7 +572,6 @@ xchar x, y;
costly = (!(g.kickedobj->no_charge && !Has_contents(g.kickedobj))
&& (shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) != 0
&& costly_spot(x, y));
isgold = (g.kickedobj->oclass == COIN_CLASS);
if (IS_ROCK(levl[x][y].typ) || closed_door(x, y)) {
if ((!martial() && rn2(20) > ACURR(A_DEX))

View File

@@ -19,16 +19,9 @@
#define NO_DOWN 275
#define PORTAL 276
#define STRING 277
#ifdef YYSTYPE
#undef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
#endif
#ifndef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
typedef union
{
int i;
char* str;
} YYSTYPE;
#endif /* !YYSTYPE_IS_DECLARED */
extern YYSTYPE yylval;

View File

@@ -1,26 +1,17 @@
/* original parser id follows */
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
/* nhsccsid[] = \"@(#)yaccpar 1.9.0-nh2 (NetHack) 11/22/2018\"; */
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
#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-nh2"
#define YYPATCH 20160324
#define YYSUBMINOR "0-nh"
#define YYEMPTY (-1)
#define yyclearin (yychar = YYEMPTY)
#define yyerrok (yyerrflag = 0)
#define YYRECOVERING() (yyerrflag != 0)
#define YYENOMEM (-2)
#define YYEOF 0
#define yyclearin (yychar=(-1))
#define yyerrok (yyerrflag=0)
#define YYRECOVERING (yyerrflag!=0)
#define YYPREFIX "yy"
#define YYPURE 0
#line 2 "util/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: 1551901399 2019/03/06 19:43:19 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$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. */
@@ -82,55 +73,11 @@ extern int fatal_error;
extern const char *fname;
extern FILE *yyin, *yyout; /* from dgn_lex.c */
#line 66 "util/dgn_comp.y"
#ifdef YYSTYPE
#undef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
#endif
#ifndef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
typedef union
{
int i;
char* str;
} YYSTYPE;
#endif /* !YYSTYPE_IS_DECLARED */
#line 99 ""
/* compatibility with bison */
#ifdef YYPARSE_PARAM
/* compatibility with FreeBSD */
# ifdef YYPARSE_PARAM_TYPE
# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
# else
# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
# endif
#else
# define YYPARSE_DECL() yyparse(void)
#endif
/* Parameters sent to lex. */
#ifdef YYLEX_PARAM
# define YYLEX_DECL() yylex(void *YYLEX_PARAM)
# define YYLEX yylex(YYLEX_PARAM)
#else
# define YYLEX_DECL() yylex(void)
# define YYLEX yylex()
#endif
/* Parameters sent to yyerror. */
#ifndef YYERROR_DECL
#define YYERROR_DECL() yyerror(const char *s)
#endif
#ifndef YYERROR_CALL
#define YYERROR_CALL(msg) yyerror(msg)
#endif
extern int YYPARSE_DECL();
#define YYNHXFLAG 1
#define YYSTACKSIZE 500
#define YYMAXDEPTH 500
#define INTEGER 257
#define A_DUNGEON 258
#define BRANCH 259
@@ -153,22 +100,21 @@ extern int YYPARSE_DECL();
#define PORTAL 276
#define STRING 277
#define YYERRCODE 256
typedef short YYINT;
YYINT yylhs[] = { -1,
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,
};
YYINT yylen[] = { 2,
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,
};
YYINT yydefred[] = { 0,
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,
@@ -181,12 +127,12 @@ typedef short YYINT;
0, 45, 37, 0, 27, 0, 0, 0, 0, 0,
38, 28, 33, 0, 48, 47, 34,
};
YYINT yydgoto[] = { 14,
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,
};
YYINT yysindex[] = { -237,
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,
@@ -199,7 +145,7 @@ typedef short YYINT;
-178, 0, 0, -193, 0, -177, -176, -175, 42, 43,
0, 0, 0, -172, 0, 0, 0,
};
YYINT yyrindex[] = { 86,
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,
@@ -212,13 +158,13 @@ typedef short YYINT;
0, 0, 0, 31, 0, 61, 76, 0, 0, 0,
0, 0, 0, 91, 0, 0, 0,
};
YYINT yygindex[] = { 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
YYINT yytable[] = { 85,
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,
@@ -257,7 +203,7 @@ typedef short YYINT;
32, 32, 32, 32, 32, 0, 32, 32, 0, 32,
32, 32, 32,
};
YYINT yycheck[] = { 71,
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,
@@ -301,11 +247,8 @@ typedef short YYINT;
#define YYDEBUG 0
#endif
#define YYMAXTOKEN 277
#define YYUNDFTOKEN 303
#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
#if YYDEBUG
char * yyname[] = {
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,
@@ -315,10 +258,9 @@ typedef short YYINT;
0,0,0,0,0,0,0,0,0,0,0,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",0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"illegal-symbol",
"LEVALIGN","ENTRY","STAIR","NO_UP","NO_DOWN","PORTAL","STRING",
};
char * yyrule[] = {
char *yyrule[] = {
"$accept : file",
"file :",
"file : dungeons",
@@ -368,44 +310,30 @@ typedef short YYINT;
"bones_tag : STRING",
"acouple : '(' INTEGER ',' INTEGER ')'",
"rcouple : '(' INTEGER ',' INTEGER ')'",
};
#endif
int yydebug;
int yynerrs;
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
/* 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 200
typedef struct {
unsigned stacksize;
YYINT *s_base;
YYINT *s_mark;
YYINT *s_last;
YYSTYPE *l_base;
YYSTYPE *l_mark;
} YYSTACKDATA;
/* variables for the parser stack */
static YYSTACKDATA yystack;
#line 433 "util/dgn_comp.y"
int yydebug;
int yynerrs;
int yyerrflag;
int yychar;
short *yyssp;
YYSTYPE *yyvsp;
YYSTYPE yyval;
YYSTYPE yylval;
short yyss[YYSTACKSIZE];
YYSTYPE yyvs[YYSTACKSIZE];
#define yystacksize YYSTACKSIZE
void
init_dungeon()
@@ -652,78 +580,17 @@ output_dgn()
}
/*dgn_comp.y*/
#line 656 ""
#if YYDEBUG
#include <stdio.h> /* needed for printf */
#endif
#if YYNHXFLAG
extern char *getenv();
#define CONST
#else
#include <stdlib.h> /* needed for malloc, etc */
#include <string.h> /* needed for memset */
#define CONST const
#endif
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
static int yygrowstack(YYSTACKDATA *data)
{
int i;
unsigned newsize;
YYINT *newss;
YYSTYPE *newvs;
if ((newsize = data->stacksize) == 0)
newsize = YYINITSTACKSIZE;
else if (newsize >= YYMAXDEPTH)
return YYENOMEM;
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = (int) (data->s_mark - data->s_base);
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return YYENOMEM;
data->s_base = newss;
data->s_mark = newss + i;
newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
if (newvs == 0)
return YYENOMEM;
data->l_base = newvs;
data->l_mark = newvs + i;
data->stacksize = newsize;
data->s_last = data->s_base + newsize - 1;
return 0;
}
#if YYPURE || defined(YY_NO_LEAKS)
static void yyfreestack(YYSTACKDATA *data)
{
free(data->s_base);
free(data->l_base);
memset(data, 0, sizeof(*data));
}
#else
#define yyfreestack(data) /* nothing */
#endif
#define YYABORT goto yyabort
#define YYABORT goto yyabort
#define YYREJECT goto yyabort
#define YYACCEPT goto yyaccept
#define YYERROR goto yyerrlab
#define YYERROR goto yyerrlab
int
YYPARSE_DECL()
yyparse()
{
int yym, yyn, yystate;
register int yym, yyn, yystate;
#if YYDEBUG
CONST char *yys;
register char *yys;
extern char *getenv();
if ((yys = getenv("YYDEBUG")) != 0)
{
@@ -735,28 +602,23 @@ YYPARSE_DECL()
yynerrs = 0;
yyerrflag = 0;
yychar = YYEMPTY;
yystate = 0;
yychar = (-1);
#if YYPURE
memset(&yystack, 0, sizeof(yystack));
#endif
if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
yystack.s_mark = yystack.s_base;
yystack.l_mark = yystack.l_base;
yystate = 0;
*yystack.s_mark = 0;
yyssp = yyss;
yyvsp = yyvs;
*yyssp = yystate = 0;
yyloop:
if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
if (yychar < 0)
{
if ((yychar = YYLEX) < 0) yychar = YYEOF;
if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
if (yydebug)
{
yys = yyname[YYTRANSLATE(yychar)];
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);
}
@@ -770,14 +632,13 @@ yyloop:
printf("%sdebug: state %d, shifting to state %d\n",
YYPREFIX, yystate, yytable[yyn]);
#endif
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
if (yyssp >= yyss + yystacksize - 1)
{
goto yyoverflow;
}
yystate = yytable[yyn];
*++yystack.s_mark = yytable[yyn];
*++yystack.l_mark = yylval;
yychar = YYEMPTY;
*++yyssp = yystate = yytable[yyn];
*++yyvsp = yylval;
yychar = (-1);
if (yyerrflag > 0) --yyerrflag;
goto yyloop;
}
@@ -788,35 +649,32 @@ yyloop:
goto yyreduce;
}
if (yyerrflag) goto yyinrecovery;
YYERROR_CALL("syntax error");
goto yynewerror;
yynewerror:
yyerror("syntax error");
goto yyerrlab;
yyerrlab:
++yynerrs;
yyinrecovery:
if (yyerrflag < 3)
{
yyerrflag = 3;
for (;;)
{
if ((yyn = yysindex[*yystack.s_mark]) != 0 && (yyn += YYERRCODE) >= 0 &&
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, *yystack.s_mark, yytable[yyn]);
to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
#endif
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
if (yyssp >= yyss + yystacksize - 1)
{
goto yyoverflow;
}
yystate = yytable[yyn];
*++yystack.s_mark = yytable[yyn];
*++yystack.l_mark = yylval;
*++yyssp = yystate = yytable[yyn];
*++yyvsp = yylval;
goto yyloop;
}
else
@@ -824,29 +682,30 @@ yyinrecovery:
#if YYDEBUG
if (yydebug)
printf("%sdebug: error recovery discarding state %d\n",
YYPREFIX, *yystack.s_mark);
YYPREFIX, *yyssp);
#endif
if (yystack.s_mark <= yystack.s_base) goto yyabort;
--yystack.s_mark;
--yystack.l_mark;
if (yyssp <= yyss) goto yyabort;
--yyssp;
--yyvsp;
}
}
}
else
{
if (yychar == YYEOF) goto yyabort;
if (yychar == 0) goto yyabort;
#if YYDEBUG
if (yydebug)
{
yys = yyname[YYTRANSLATE(yychar)];
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;
yychar = (-1);
goto yyloop;
}
yyreduce:
#if YYDEBUG
if (yydebug)
@@ -854,283 +713,252 @@ yyreduce:
YYPREFIX, yystate, yyn, yyrule[yyn]);
#endif
yym = yylen[yyn];
if (yym)
yyval = yystack.l_mark[1-yym];
else
memset(&yyval, 0, sizeof yyval);
yyval = yyvsp[1-yym];
switch (yyn)
{
case 2:
#line 83 "util/dgn_comp.y"
{
{
output_dgn();
}
break;
case 9:
#line 99 "util/dgn_comp.y"
{
{
init_dungeon();
Strcpy(tmpdungeon[n_dgns].name, yystack.l_mark[-3].str);
tmpdungeon[n_dgns].boneschar = (char)yystack.l_mark[-2].i;
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 = yystack.l_mark[0].i;
Free(yystack.l_mark[-3].str);
tmpdungeon[n_dgns].chance = yyvsp[0].i;
Free(yyvsp[-3].str);
}
break;
case 10:
#line 111 "util/dgn_comp.y"
{
{
yyval.i = 0;
}
break;
case 11:
#line 115 "util/dgn_comp.y"
{
yyval.i = yystack.l_mark[0].i;
{
yyval.i = yyvsp[0].i;
}
break;
case 15:
#line 126 "util/dgn_comp.y"
{
tmpdungeon[n_dgns].entry_lev = yystack.l_mark[0].i;
{
tmpdungeon[n_dgns].entry_lev = yyvsp[0].i;
}
break;
case 17:
#line 135 "util/dgn_comp.y"
{
if(yystack.l_mark[0].i <= TOWN || yystack.l_mark[0].i >= D_ALIGN_CHAOTIC)
{
if(yyvsp[0].i <= TOWN || yyvsp[0].i >= D_ALIGN_CHAOTIC)
yyerror("Illegal description - ignoring!");
else
tmpdungeon[n_dgns].flags |= yystack.l_mark[0].i ;
tmpdungeon[n_dgns].flags |= yyvsp[0].i ;
}
break;
case 18:
#line 142 "util/dgn_comp.y"
{
if(yystack.l_mark[0].i && yystack.l_mark[0].i < D_ALIGN_CHAOTIC)
{
if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC)
yyerror("Illegal alignment - ignoring!");
else
tmpdungeon[n_dgns].flags |= yystack.l_mark[0].i ;
tmpdungeon[n_dgns].flags |= yyvsp[0].i ;
}
break;
case 19:
#line 151 "util/dgn_comp.y"
{
Strcpy(tmpdungeon[n_dgns].protoname, yystack.l_mark[0].str);
Free(yystack.l_mark[0].str);
{
Strcpy(tmpdungeon[n_dgns].protoname, yyvsp[0].str);
Free(yyvsp[0].str);
}
break;
case 25:
#line 165 "util/dgn_comp.y"
{
{
init_level();
Strcpy(tmplevel[n_levs].name, yystack.l_mark[-3].str);
tmplevel[n_levs].boneschar = (char)yystack.l_mark[-2].i;
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(yystack.l_mark[-3].str);
Free(yyvsp[-3].str);
}
break;
case 26:
#line 175 "util/dgn_comp.y"
{
{
init_level();
Strcpy(tmplevel[n_levs].name, yystack.l_mark[-4].str);
tmplevel[n_levs].boneschar = (char)yystack.l_mark[-3].i;
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 = yystack.l_mark[0].i;
tmplevel[n_levs].rndlevs = yyvsp[0].i;
tmpdungeon[n_dgns].levels++;
Free(yystack.l_mark[-4].str);
Free(yyvsp[-4].str);
}
break;
case 27:
#line 188 "util/dgn_comp.y"
{
{
init_level();
Strcpy(tmplevel[n_levs].name, yystack.l_mark[-4].str);
tmplevel[n_levs].boneschar = (char)yystack.l_mark[-3].i;
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 = yystack.l_mark[0].i;
tmplevel[n_levs].chance = yyvsp[0].i;
tmpdungeon[n_dgns].levels++;
Free(yystack.l_mark[-4].str);
Free(yyvsp[-4].str);
}
break;
case 28:
#line 199 "util/dgn_comp.y"
{
{
init_level();
Strcpy(tmplevel[n_levs].name, yystack.l_mark[-5].str);
tmplevel[n_levs].boneschar = (char)yystack.l_mark[-4].i;
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 = yystack.l_mark[-1].i;
tmplevel[n_levs].rndlevs = yystack.l_mark[0].i;
tmplevel[n_levs].chance = yyvsp[-1].i;
tmplevel[n_levs].rndlevs = yyvsp[0].i;
tmpdungeon[n_dgns].levels++;
Free(yystack.l_mark[-5].str);
Free(yyvsp[-5].str);
}
break;
case 29:
#line 213 "util/dgn_comp.y"
{
if(yystack.l_mark[0].i >= D_ALIGN_CHAOTIC)
{
if(yyvsp[0].i >= D_ALIGN_CHAOTIC)
yyerror("Illegal description - ignoring!");
else
tmplevel[n_levs].flags |= yystack.l_mark[0].i ;
tmplevel[n_levs].flags |= yyvsp[0].i ;
}
break;
case 30:
#line 220 "util/dgn_comp.y"
{
if(yystack.l_mark[0].i && yystack.l_mark[0].i < D_ALIGN_CHAOTIC)
{
if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC)
yyerror("Illegal alignment - ignoring!");
else
tmplevel[n_levs].flags |= yystack.l_mark[0].i ;
tmplevel[n_levs].flags |= yyvsp[0].i ;
}
break;
case 31:
#line 229 "util/dgn_comp.y"
{
{
init_level();
Strcpy(tmplevel[n_levs].name, yystack.l_mark[-4].str);
tmplevel[n_levs].boneschar = (char)yystack.l_mark[-3].i;
tmplevel[n_levs].chain = getchain(yystack.l_mark[-2].str);
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(yystack.l_mark[-4].str);
Free(yystack.l_mark[-2].str);
Free(yyvsp[-4].str);
Free(yyvsp[-2].str);
}
break;
case 32:
#line 242 "util/dgn_comp.y"
{
{
init_level();
Strcpy(tmplevel[n_levs].name, yystack.l_mark[-5].str);
tmplevel[n_levs].boneschar = (char)yystack.l_mark[-4].i;
tmplevel[n_levs].chain = getchain(yystack.l_mark[-3].str);
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 = yystack.l_mark[0].i;
tmplevel[n_levs].rndlevs = yyvsp[0].i;
if(!check_level()) n_levs--;
else tmpdungeon[n_dgns].levels++;
Free(yystack.l_mark[-5].str);
Free(yystack.l_mark[-3].str);
Free(yyvsp[-5].str);
Free(yyvsp[-3].str);
}
break;
case 33:
#line 258 "util/dgn_comp.y"
{
{
init_level();
Strcpy(tmplevel[n_levs].name, yystack.l_mark[-5].str);
tmplevel[n_levs].boneschar = (char)yystack.l_mark[-4].i;
tmplevel[n_levs].chain = getchain(yystack.l_mark[-3].str);
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 = yystack.l_mark[0].i;
tmplevel[n_levs].chance = yyvsp[0].i;
if(!check_level()) n_levs--;
else tmpdungeon[n_dgns].levels++;
Free(yystack.l_mark[-5].str);
Free(yystack.l_mark[-3].str);
Free(yyvsp[-5].str);
Free(yyvsp[-3].str);
}
break;
case 34:
#line 272 "util/dgn_comp.y"
{
{
init_level();
Strcpy(tmplevel[n_levs].name, yystack.l_mark[-6].str);
tmplevel[n_levs].boneschar = (char)yystack.l_mark[-5].i;
tmplevel[n_levs].chain = getchain(yystack.l_mark[-4].str);
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 = yystack.l_mark[-1].i;
tmplevel[n_levs].rndlevs = yystack.l_mark[0].i;
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(yystack.l_mark[-6].str);
Free(yystack.l_mark[-4].str);
Free(yyvsp[-6].str);
Free(yyvsp[-4].str);
}
break;
case 37:
#line 293 "util/dgn_comp.y"
{
{
init_branch();
Strcpy(tmpbranch[n_brs].name, yystack.l_mark[-4].str);
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 = yystack.l_mark[-1].i;
tmpbranch[n_brs].up = yystack.l_mark[0].i;
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(yystack.l_mark[-4].str);
Free(yyvsp[-4].str);
}
break;
case 38:
#line 307 "util/dgn_comp.y"
{
{
init_branch();
Strcpy(tmpbranch[n_brs].name, yystack.l_mark[-5].str);
tmpbranch[n_brs].chain = getchain(yystack.l_mark[-4].str);
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 = yystack.l_mark[-1].i;
tmpbranch[n_brs].up = yystack.l_mark[0].i;
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(yystack.l_mark[-5].str);
Free(yystack.l_mark[-4].str);
Free(yyvsp[-5].str);
Free(yyvsp[-4].str);
}
break;
case 39:
#line 323 "util/dgn_comp.y"
{
{
yyval.i = TBR_STAIR; /* two way stair */
}
break;
case 40:
#line 327 "util/dgn_comp.y"
{
{
yyval.i = TBR_STAIR; /* two way stair */
}
break;
case 41:
#line 331 "util/dgn_comp.y"
{
{
yyval.i = TBR_NO_UP; /* no up staircase */
}
break;
case 42:
#line 335 "util/dgn_comp.y"
{
{
yyval.i = TBR_NO_DOWN; /* no down staircase */
}
break;
case 43:
#line 339 "util/dgn_comp.y"
{
{
yyval.i = TBR_PORTAL; /* portal connection */
}
break;
case 44:
#line 345 "util/dgn_comp.y"
{
{
yyval.i = 0; /* defaults to down */
}
break;
case 45:
#line 349 "util/dgn_comp.y"
{
yyval.i = yystack.l_mark[0].i;
{
yyval.i = yyvsp[0].i;
}
break;
case 46:
#line 355 "util/dgn_comp.y"
{
char *p = yystack.l_mark[0].str;
{
char *p = yyvsp[0].str;
if (strlen(p) != 1) {
if (strcmp(p, "none") != 0)
yyerror("Bones marker must be a single char, or \"none\"!");
@@ -1141,39 +969,36 @@ case 46:
}
break;
case 47:
#line 385 "util/dgn_comp.y"
{
if (yystack.l_mark[-3].i < -MAXLEVEL || yystack.l_mark[-3].i > MAXLEVEL) {
{
if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) {
yyerror("Abs base out of dlevel range - zeroing!");
couple.base = couple.rand = 0;
} else if (yystack.l_mark[-1].i < -1 ||
((yystack.l_mark[-3].i < 0) ? (MAXLEVEL + yystack.l_mark[-3].i + yystack.l_mark[-1].i + 1) > MAXLEVEL :
(yystack.l_mark[-3].i + yystack.l_mark[-1].i) > MAXLEVEL)) {
} 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 = yystack.l_mark[-3].i;
couple.rand = yystack.l_mark[-1].i;
couple.base = yyvsp[-3].i;
couple.rand = yyvsp[-1].i;
}
}
break;
case 48:
#line 422 "util/dgn_comp.y"
{
if (yystack.l_mark[-3].i < -MAXLEVEL || yystack.l_mark[-3].i > MAXLEVEL) {
{
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 = yystack.l_mark[-3].i;
couple.rand = yystack.l_mark[-1].i;
couple.base = yyvsp[-3].i;
couple.rand = yyvsp[-1].i;
}
}
break;
#line 1173 ""
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
yystack.l_mark -= yym;
yyssp -= yym;
yystate = *yyssp;
yyvsp -= yym;
yym = yylhs[yyn];
if (yystate == 0 && yym == 0)
{
@@ -1183,21 +1008,23 @@ break;
state %d\n", YYPREFIX, YYFINAL);
#endif
yystate = YYFINAL;
*++yystack.s_mark = YYFINAL;
*++yystack.l_mark = yyval;
*++yyssp = YYFINAL;
*++yyvsp = yyval;
if (yychar < 0)
{
if ((yychar = YYLEX) < 0) yychar = YYEOF;
if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
if (yydebug)
{
yys = yyname[YYTRANSLATE(yychar)];
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 == YYEOF) goto yyaccept;
if (yychar == 0) goto yyaccept;
goto yyloop;
}
if ((yyn = yygindex[yym]) != 0 && (yyn += yystate) >= 0 &&
@@ -1208,24 +1035,19 @@ break;
#if YYDEBUG
if (yydebug)
printf("%sdebug: after reduction, shifting from state %d \
to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
to state %d\n", YYPREFIX, *yyssp, yystate);
#endif
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
if (yyssp >= yyss + yystacksize - 1)
{
goto yyoverflow;
}
*++yystack.s_mark = (YYINT) yystate;
*++yystack.l_mark = yyval;
*++yyssp = yystate;
*++yyvsp = yyval;
goto yyloop;
yyoverflow:
YYERROR_CALL("yacc stack overflow");
yyerror("yacc stack overflow");
yyabort:
yyfreestack(&yystack);
return (1);
yyaccept:
yyfreestack(&yystack);
return (0);
}

View File

@@ -172,12 +172,6 @@
#define METHOD_SEL 428
#define METHOD_SEL_ARRAY 429
#define DICE 430
#ifdef YYSTYPE
#undef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
#endif
#ifndef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
typedef union
{
long i;
@@ -215,5 +209,4 @@ typedef union
char *varstr;
} meth;
} YYSTYPE;
#endif /* !YYSTYPE_IS_DECLARED */
extern YYSTYPE yylval;

File diff suppressed because it is too large Load Diff