Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2

This commit is contained in:
nhmall
2019-01-01 19:51:05 -05:00
8 changed files with 2070 additions and 1419 deletions
+73 -56
View File
@@ -1,3 +1,4 @@
sh: dat/GENFILES: No such file or directory
This is a listing of all files in a full NetHack 3.6 distribution, organized This is a listing of all files in a full NetHack 3.6 distribution, organized
in their standard manner on a UNIX system. It indicates which files are in their standard manner on a UNIX system. It indicates which files are
necessary for which versions, so that you can tell which files may be deleted necessary for which versions, so that you can tell which files may be deleted
@@ -7,7 +8,7 @@ from or not transferred to your system if you wish.
.: .:
(files in top directory) (files in top directory)
.clang-format Files Porting README .clang-format .travis.yml Files Porting README
DEVEL: DEVEL:
(files for people developing changes to NetHack) (files for people developing changes to NetHack)
@@ -81,8 +82,8 @@ qtext.h quest.h rect.h region.h rm.h
skills.h sp_lev.h spell.h sys.h system.h skills.h sp_lev.h spell.h sys.h system.h
tcap.h tileset.h timeout.h tosconf.h tradstdc.h tcap.h tileset.h timeout.h tosconf.h tradstdc.h
trampoli.h trap.h unixconf.h vision.h vmsconf.h trampoli.h trap.h unixconf.h vision.h vmsconf.h
wceconf.h winami.h winprocs.h wintype.h you.h wceconf.h winami.h wincurs.h winprocs.h wintype.h
youprop.h you.h youprop.h
(file for tty versions) (file for tty versions)
wintty.h wintty.h
@@ -163,7 +164,7 @@ random.c
(Berkeley uudecode file, which may be used in build process of any version) (Berkeley uudecode file, which may be used in build process of any version)
uudecode.c uudecode.c
(file for MSDOS, OS/2, NT, Amiga, and Atari versions - untested for 3.6.2) (file for MSDOS, OS/2, Amiga, and Atari versions - untested for 3.6.2)
pcmain.c pcmain.c
(file for MSDOS, OS/2, and Atari versions - untested for 3.6.2) (file for MSDOS, OS/2, and Atari versions - untested for 3.6.2)
@@ -181,7 +182,7 @@ tclib.c
(files for MSDOS and OS/2 versions - untested for 3.6.2) (files for MSDOS and OS/2 versions - untested for 3.6.2)
Makefile.lib termcap.uu Makefile.lib termcap.uu
(files for MSDOS, OS/2, NT, and Atari versions - untested for 3.6.2) (files for MSDOS, OS/2 and Atari versions - untested for 3.6.2)
pcsys.c pcunix.c pcsys.c pcunix.c
(files for UNIX and Be versions) (files for UNIX and Be versions)
@@ -208,9 +209,9 @@ sys/unix:
(files for UNIX versions) (files for UNIX versions)
Install.unx Makefile.dat Makefile.doc Makefile.src Install.unx Makefile.dat Makefile.doc Makefile.src
Makefile.top Makefile.utl NewInstall.unx README.linux Makefile.top Makefile.utl NewInstall.unx README.linux
depend.awk gitinfo.sh mkmkfile.sh nethack.sh README.xcode XCode.xcconfig depend.awk gitinfo.sh
setup.sh sysconf unixmain.c unixres.c mkmkfile.sh nethack.sh setup.sh sysconf
unixunix.c unixmain.c unixres.c unixunix.c
(files for replacement cpp, only needed by some ancient UNIX systems) (files for replacement cpp, only needed by some ancient UNIX systems)
cpp1.shr cpp2.shr cpp3.shr cpp1.shr cpp2.shr cpp3.shr
@@ -218,12 +219,28 @@ cpp1.shr cpp2.shr cpp3.shr
(file for sound driver for 386 UNIX) (file for sound driver for 386 UNIX)
snd86unx.shr snd86unx.shr
sys/unix/NetHack.xcodeproj:
(file for UNIX versions)
project.pbxproj
sys/unix/NetHack.xcodeproj/project.xcworkspace:
(file for UNIX versions)
contents.xcworkspacedata
sys/unix/NetHack.xcodeproj/project.xcworkspace/xcshareddata:
(files for UNIX versions)
IDEWorkspaceChecks.plist WorkspaceSettings.xcsettings
sys/unix/NetHack.xcodeproj/xcshareddata/xcschemes:
(files for UNIX versions)
NetHack.xcscheme makedefs.xcscheme recover.xcscheme
sys/unix/hints: sys/unix/hints:
(files for configuring UNIX NetHack versions) (files for configuring UNIX NetHack versions)
linux linux-chroot linux-qt4 linux-qt5 linux linux-chroot linux-minimal linux-qt4
linux-x11 macosx macosx.sh macosx10.5 linux-qt5 linux-x11 macosx macosx.sh
macosx10.7 macosx10.8 macosx10.10 macosx10.10-qt macosx10.5 macosx10.7 macosx10.8 macosx10.10
unix macosx10.10-qt macosx10.14 unix
sys/vms: sys/vms:
(files for VMS version) (files for VMS version)
@@ -255,10 +272,12 @@ stat.h
sys/winnt: sys/winnt:
(files for Windows 7/8.x/10 version) (files for Windows 7/8.x/10 version)
Install.nt Makefile.gcc Makefile.msc console.rc defaults.nh Install.nt Makefile.gcc Makefile.msc console.rc
nethack.def nh340key.c nhdefkey.c nhico.uu nhraykey.c defaults.nh nethack.def nh340key.c nhdefkey.c
nhsetup.bat ntsound.c nttty.c porthelp stubs.c nhico.uu nhraykey.c nhsetup.bat ntsound.c
sysconf win10.c win10.h win32api.h winnt.c nttty.c porthelp stub-pdcscrn.c stubs.c
sysconf win10.c win10.h win32api.h
windmain.c winnt.c winos.h
util: util:
(files for all versions) (files for all versions)
@@ -301,6 +320,12 @@ win/chain:
(files for stacking window systems) (files for stacking window systems)
wc_chainin.c wc_chainout.c wc_trace.c wc_chainin.c wc_chainout.c wc_trace.c
win/curses:
(files in top directory)
Bugs.txt Readme.txt Todo.txt cursdial.c cursdial.h cursinit.c
cursinit.h cursinvt.c cursinvt.h cursmain.c cursmesg.c cursmesg.h
cursmisc.c cursmisc.h cursstat.c cursstat.h curswins.c curswins.h
win/gem: win/gem:
(files for GEM versions - untested for 3.6.2) (files for GEM versions - untested for 3.6.2)
Install.gem bitmfile.c gem_rsc.uu gem_rso.uu gr_rect.c gr_rect.h Install.gem bitmfile.c gem_rsc.uu gem_rso.uu gr_rect.c gr_rect.h
@@ -323,8 +348,9 @@ NetHackTerm.applescript recover.pl
win/share: win/share:
(files for versions using optional tiles) (files for versions using optional tiles)
bmptiles.c gifread.c giftiles.c monsters.txt objects.txt bmptiles.c gifread.c giftiles.c monsters.txt objects.txt
other.txt ppmwrite.c renumtiles.pl thintile.c tile.doc other.txt ppmwrite.c renumtiles.pl safeproc.c thintile.c
tile.h tile2bmp.c tilemap.c tileset.c tiletext.c tile.doc tile.h tile2bmp.c tilemap.c tileset.c
tiletext.c
win/tty: win/tty:
(files for tty versions) (files for tty versions)
@@ -332,47 +358,38 @@ getline.c termcap.c topl.c wintty.c
win/win32: win/win32:
(files for Windows versions - tested up to Windows 10) (files for Windows versions - tested up to Windows 10)
dgnstuff.mak levstuff.mak mhaskyn.c mhaskyn.h mhdlg.c NetHackW.exe.manifest dgnstuff-mingw32.mak dgnstuff.mak
mhdlg.h mhfont.c mhfont.h mhinput.c mhinput.h levstuff-mingw32.mak levstuff.mak mhaskyn.c
mhmain.c mhmain.h mhmap.c mhmap.h mhmenu.c mhaskyn.h mhdlg.c mhdlg.h
mhmenu.h mhmsg.h mhmsgwnd.c mhmsgwnd.h mhrip.c mhfont.c mhfont.h mhinput.c
mhrip.h mhsplash.c mhsplash.h mhstatus.c mhstatus.h mhinput.h mhmain.c mhmain.h
mhtext.c mhtext.h mnsel.uu mnselcnt.uu mnunsel.uu mhmap.c mhmap.h mhmenu.c
mswproc.c nethack.rc nhresource.h petmark.uu pilemark.uu mhmenu.h mhmsg.h mhmsgwnd.c
record.uu resource.h rip.uu splash.uu tiles.mak mhmsgwnd.h mhrip.c mhrip.h
winMS.h winhack.c winhack.rc mhsplash.c mhsplash.h mhstatus.c
mhstatus.h mhtext.c mhtext.h
win/win32/vs2015: mnsel.uu mnselcnt.uu mnunsel.uu
(files for Windows versions - tested up to Windows 10) mswproc.c nethack.rc nhresource.h
NetHack.sln NetHack.vcxproj NetHackW.vcxproj petmark.uu pilemark.uu record.uu
afterdgncomp.proj afterdlb.proj afterlevcomp.proj resource.h rip.uu splash.uu
aftermakedefs.proj afternethack.proj afterrecover.proj tiles-mingw32.mak tiles.mak winMS.h
aftertile2bmp.proj aftertilemap.proj afteruudecode.proj winhack.c winhack.rc
build.bat common.props config.props
console.props default.props default_dll.props
dgncomp.vcxproj dirs.props dlb.vcxproj
dll.props files.props levcomp.vcxproj
makedefs.vcxproj nh340key.def nh340key.vcxproj
nhdefkey.def nhdefkey.vcxproj nhraykey.def
nhraykey.vcxproj notes.txt recover.vcxproj
tile2bmp.vcxproj tilemap.vcxproj tiles.vcxproj
uudecode.vcxproj
win/win32/vs2017: win/win32/vs2017:
(files for Visual Studio 2017 Community Edition builds) (files for Visual Studio 2017 Community Edition builds)
NetHack.sln NetHack.vcxproj NetHackW.exe.manifest NetHack.sln NetHack.vcxproj NetHackW.vcxproj
NetHackW.vcxproj afterdgncomp.proj afterdlb.proj PDCurses.vcxproj afterdgncomp.proj afterdlb.proj
afterlevcomp.proj aftermakedefs.proj afternethack.proj afterlevcomp.proj aftermakedefs.proj afternethack.proj
afterrecover.proj aftertile2bmp.proj aftertilemap.proj afterrecover.proj aftertile2bmp.proj aftertilemap.proj
afteruudecode.proj build.bat common.props afteruudecode.proj build.bat common.props
config.props console.props default.props config.props console.props default.props
default_dll.props dgncomp.vcxproj dirs.props default_dll.props default_lib.props dgncomp.vcxproj
dlb.vcxproj dll.props files.props dirs.props dlb.vcxproj dll.props
levcomp.vcxproj makedefs.vcxproj nh340key.def files.props levcomp.vcxproj makedefs.vcxproj
nh340key.vcxproj nhdefkey.def nhdefkey.vcxproj nh340key.def nh340key.vcxproj nhdefkey.def
nhraykey.def nhraykey.vcxproj recover.vcxproj nhdefkey.vcxproj nhraykey.def nhraykey.vcxproj
tile2bmp.vcxproj tilemap.vcxproj tiles.vcxproj recover.vcxproj tile2bmp.vcxproj tilemap.vcxproj
uudecode.vcxproj tiles.vcxproj uudecode.vcxproj
This is a list of files produced by auxiliary programs. They can all be This is a list of files produced by auxiliary programs. They can all be
regenerated from the files in the distribution. regenerated from the files in the distribution.
+2 -2
View File
@@ -4,7 +4,7 @@ NetHack 3.6 is an enhancement to the dungeon exploration game NetHack,
which is a distant descendent of Rogue and Hack, and a direct descendent of which is a distant descendent of Rogue and Hack, and a direct descendent of
NetHack 3.4 as there was no NetHack 3.5 release. NetHack 3.4 as there was no NetHack 3.5 release.
NetHack 3.6.2 contains a collection of more than 15 bug fixes to NetHack 3.6.1. NetHack 3.6.2 contains a collection of more than 220 bug fixes to NetHack 3.6.1.
The file doc/fixes36.2 in the source distribution has a full list of them. The The file doc/fixes36.2 in the source distribution has a full list of them. The
text in there was written for the development team's own use and is provided text in there was written for the development team's own use and is provided
"as is", so please do not ask us to further explain the entries in that file. "as is", so please do not ask us to further explain the entries in that file.
@@ -166,6 +166,6 @@ In our own patches, we will assume that your code is synchronized with ours.
-- Good luck, and happy Hacking -- -- Good luck, and happy Hacking --
# $NHDT-Date: 1533602460 2018/08/07 00:41:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.46 $ # $NHDT-Date: 1546383333 2019/01/01 22:55:33 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.48 $
# Copyright (c) 2012 by Michael Allison # Copyright (c) 2012 by Michael Allison
# NetHack may be freely redistributed. See license for details. # NetHack may be freely redistributed. See license for details.
+391 -391
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -16,7 +16,7 @@
*/ */
#define EDITLEVEL 0 #define EDITLEVEL 0
#define COPYRIGHT_BANNER_A "NetHack, Copyright 1985-2018" #define COPYRIGHT_BANNER_A "NetHack, Copyright 1985-2019"
#define COPYRIGHT_BANNER_B \ #define COPYRIGHT_BANNER_B \
" By Stichting Mathematisch Centrum and M. Stephenson." " By Stichting Mathematisch Centrum and M. Stephenson."
/* COPYRIGHT_BANNER_C is generated by makedefs into date.h */ /* COPYRIGHT_BANNER_C is generated by makedefs into date.h */
@@ -38,14 +38,14 @@
/* Patch 2, <insert date here> /* Patch 2, <insert date here>
* *
* Performance optimizations for tty including the ability to * Over 220 bug fixes including a couple of crash bug fixes
* do per field updating * More than 15 enhancements or improvements
* Significant performance improvements in sys/winnt/nttty mainly through
* the introduction of a back buffer approach
* A couple of windows crash bug fixes during early game startup
* Ensuring that unix Makefiles do not rely on features unique to gnu make * Ensuring that unix Makefiles do not rely on features unique to gnu make
* Improvements to hilite_status parsing in an effort to ensure that expected * Improvements to hilite_status parsing in an effort to ensure that expected
* and sensible values ranges are more easily specified and accepted * and sensible values ranges are more easily specified and accepted
* Performance optimizations for tty
* Windows console tty via use of a back buffer
* Mac OS X build improvements and inclusion of an Xcode project
*/ */
/* Patch 1, April 27, 2018 /* Patch 1, April 27, 2018
+7
View File
@@ -19,9 +19,16 @@
#define NO_DOWN 275 #define NO_DOWN 275
#define PORTAL 276 #define PORTAL 276
#define STRING 277 #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 typedef union
{ {
int i; int i;
char* str; char* str;
} YYSTYPE; } YYSTYPE;
#endif /* !YYSTYPE_IS_DECLARED */
extern YYSTYPE yylval; extern YYSTYPE yylval;
+371 -193
View File
@@ -1,17 +1,26 @@
#ifndef lint /* original parser id follows */
/* static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; */ /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
/* static char nhsccsid[] = "@(#)yaccpar 1.9.0-nh (NetHack) 12/03/2015"; */ /* nhsccsid[] = \"@(#)yaccpar 1.9.0-nh2 (NetHack) 11/22/2018\"; */
#endif /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
#define YYBYACC 1 #define YYBYACC 1
#define YYMAJOR 1 #define YYMAJOR 1
#define YYMINOR 9 #define YYMINOR 9
#define YYSUBMINOR "0-nh" #define YYSUBMINOR "0-nh2"
#define YYPATCH 20160324
#define yyclearin (yychar=(-1)) #define YYEMPTY (-1)
#define yyerrok (yyerrflag=0) #define yyclearin (yychar = YYEMPTY)
#define YYRECOVERING (yyerrflag!=0) #define yyerrok (yyerrflag = 0)
#define YYRECOVERING() (yyerrflag != 0)
#define YYENOMEM (-2)
#define YYEOF 0
#define YYPREFIX "yy" #define YYPREFIX "yy"
/* NetHack 3.6 dgn_comp.y $NHDT-Date: 1455415237 2016/02/14 02:00:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.13 $ */
#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 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1989 by Jean-Christophe Collet */
/* Copyright (c) 1990 by M. Stephenson */ /* Copyright (c) 1990 by M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -73,11 +82,55 @@ extern int fatal_error;
extern const char *fname; extern const char *fname;
extern FILE *yyin, *yyout; /* from dgn_lex.c */ 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 typedef union
{ {
int i; int i;
char* str; char* str;
} YYSTYPE; } 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 INTEGER 257
#define A_DUNGEON 258 #define A_DUNGEON 258
#define BRANCH 259 #define BRANCH 259
@@ -100,21 +153,22 @@ typedef union
#define PORTAL 276 #define PORTAL 276
#define STRING 277 #define STRING 277
#define YYERRCODE 256 #define YYERRCODE 256
short yylhs[] = { -1, typedef short YYINT;
YYINT yylhs[] = { -1,
0, 0, 5, 5, 6, 6, 6, 6, 7, 1, 0, 0, 5, 5, 6, 6, 6, 6, 7, 1,
1, 8, 8, 8, 12, 13, 15, 15, 14, 10, 1, 8, 8, 8, 12, 13, 15, 15, 14, 10,
10, 10, 10, 10, 16, 16, 17, 17, 18, 18, 10, 10, 10, 10, 16, 16, 17, 17, 18, 18,
19, 19, 20, 20, 9, 9, 22, 23, 3, 3, 19, 19, 20, 20, 9, 9, 22, 23, 3, 3,
3, 3, 3, 2, 2, 4, 21, 11, 3, 3, 3, 2, 2, 4, 21, 11,
}; };
short yylen[] = { 2, YYINT yylen[] = { 2,
0, 1, 1, 2, 1, 1, 1, 1, 6, 0, 0, 1, 1, 2, 1, 1, 1, 1, 6, 0,
1, 1, 1, 1, 3, 1, 3, 3, 3, 1, 1, 1, 1, 1, 3, 1, 3, 3, 3, 1,
1, 1, 1, 1, 6, 7, 7, 8, 3, 3, 1, 1, 1, 1, 6, 7, 7, 8, 3, 3,
7, 8, 8, 9, 1, 1, 7, 8, 0, 1, 7, 8, 8, 9, 1, 1, 7, 8, 0, 1,
1, 1, 1, 0, 1, 1, 5, 5, 1, 1, 1, 0, 1, 1, 5, 5,
}; };
short yydefred[] = { 0, YYINT yydefred[] = { 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 3, 5, 6, 7, 8, 0, 0, 0, 0, 0, 3, 5, 6, 7, 8,
12, 13, 14, 16, 20, 21, 22, 23, 24, 35, 12, 13, 14, 16, 20, 21, 22, 23, 24, 35,
@@ -127,12 +181,12 @@ short yydefred[] = { 0,
0, 45, 37, 0, 27, 0, 0, 0, 0, 0, 0, 45, 37, 0, 27, 0, 0, 0, 0, 0,
38, 28, 33, 0, 48, 47, 34, 38, 28, 33, 0, 48, 47, 34,
}; };
short yydgoto[] = { 14, YYINT yydgoto[] = { 14,
78, 93, 84, 60, 15, 16, 17, 18, 19, 20, 78, 93, 84, 60, 15, 16, 17, 18, 19, 20,
68, 21, 22, 23, 24, 25, 26, 27, 28, 29, 68, 21, 22, 23, 24, 25, 26, 27, 28, 29,
70, 30, 31, 70, 30, 31,
}; };
short yysindex[] = { -237, YYINT yysindex[] = { -237,
-46, -45, -44, -39, -38, -30, -22, -21, -20, -19, -46, -45, -44, -39, -38, -30, -22, -21, -20, -19,
-18, -17, -16, 0, -237, 0, 0, 0, 0, 0, -18, -17, -16, 0, -237, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -145,7 +199,7 @@ short yysindex[] = { -237,
-178, 0, 0, -193, 0, -177, -176, -175, 42, 43, -178, 0, 0, -193, 0, -177, -176, -175, 42, 43,
0, 0, 0, -172, 0, 0, 0, 0, 0, 0, -172, 0, 0, 0,
}; };
short yyrindex[] = { 86, YYINT yyrindex[] = { 86,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 87, 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,
@@ -158,13 +212,13 @@ short yyrindex[] = { 86,
0, 0, 0, 31, 0, 61, 76, 0, 0, 0, 0, 0, 0, 31, 0, 61, 76, 0, 0, 0,
0, 0, 0, 91, 0, 0, 0, 0, 0, 0, 91, 0, 0, 0,
}; };
short yygindex[] = { 0, YYINT yygindex[] = { 0,
0, -6, 4, -43, 0, 75, 0, 0, 0, 0, 0, -6, 4, -43, 0, 75, 0, 0, 0, 0,
-71, 0, 0, 0, 0, 0, 0, 0, 0, 0, -71, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-62, 0, 0, -62, 0, 0,
}; };
#define YYTABLESIZE 363 #define YYTABLESIZE 363
short yytable[] = { 85, YYINT yytable[] = { 85,
39, 80, 81, 82, 83, 63, 64, 65, 66, 86, 39, 80, 81, 82, 83, 63, 64, 65, 66, 86,
87, 32, 33, 34, 46, 10, 97, 98, 35, 36, 87, 32, 33, 34, 46, 10, 97, 98, 35, 36,
1, 2, 3, 4, 5, 6, 7, 37, 8, 9, 1, 2, 3, 4, 5, 6, 7, 37, 8, 9,
@@ -203,7 +257,7 @@ short yytable[] = { 85,
32, 32, 32, 32, 32, 0, 32, 32, 0, 32, 32, 32, 32, 32, 32, 0, 32, 32, 0, 32,
32, 32, 32, 32, 32, 32,
}; };
short yycheck[] = { 71, YYINT yycheck[] = { 71,
0, 273, 274, 275, 276, 49, 50, 51, 52, 72, 0, 273, 274, 275, 276, 49, 50, 51, 52, 72,
73, 58, 58, 58, 277, 0, 88, 89, 58, 58, 73, 58, 58, 58, 277, 0, 88, 89, 58, 58,
258, 259, 260, 261, 262, 263, 264, 58, 266, 267, 258, 259, 260, 261, 262, 263, 264, 58, 266, 267,
@@ -247,8 +301,11 @@ short yycheck[] = { 71,
#define YYDEBUG 0 #define YYDEBUG 0
#endif #endif
#define YYMAXTOKEN 277 #define YYMAXTOKEN 277
#define YYUNDFTOKEN 303
#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
#if YYDEBUG #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, "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,
@@ -258,9 +315,10 @@ char *yyname[] = {
0,0,0,0,0,0,0,0,0,0,0,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", 0,0,0,0,0,0,0,0,0,0,0,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", "A_DUNGEON","BRANCH","CHBRANCH","LEVEL","RNDLEVEL","CHLEVEL","RNDCHLEVEL",
"UP_OR_DOWN","PROTOFILE","DESCRIPTION","DESCRIPTOR","LEVELDESC","ALIGNMENT", "UP_OR_DOWN","PROTOFILE","DESCRIPTION","DESCRIPTOR","LEVELDESC","ALIGNMENT",
"LEVALIGN","ENTRY","STAIR","NO_UP","NO_DOWN","PORTAL","STRING", "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",
}; };
char *yyrule[] = { char * yyrule[] = {
"$accept : file", "$accept : file",
"file :", "file :",
"file : dungeons", "file : dungeons",
@@ -310,30 +368,44 @@ char *yyrule[] = {
"bones_tag : STRING", "bones_tag : STRING",
"acouple : '(' INTEGER ',' INTEGER ')'", "acouple : '(' INTEGER ',' INTEGER ')'",
"rcouple : '(' INTEGER ',' INTEGER ')'", "rcouple : '(' INTEGER ',' INTEGER ')'",
}; };
#endif #endif
int yydebug;
int yynerrs;
int yyerrflag;
int yychar;
YYSTYPE yyval;
YYSTYPE yylval;
/* define the initial stack-sizes */
#ifdef YYSTACKSIZE #ifdef YYSTACKSIZE
#undef YYMAXDEPTH #undef YYMAXDEPTH
#define YYMAXDEPTH YYSTACKSIZE #define YYMAXDEPTH YYSTACKSIZE
#else #else
#ifdef YYMAXDEPTH #ifdef YYMAXDEPTH
#define YYSTACKSIZE YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH
#else #else
#define YYSTACKSIZE 500 #define YYSTACKSIZE 10000
#define YYMAXDEPTH 500 #define YYMAXDEPTH 10000
#endif #endif
#endif #endif
int yydebug;
int yynerrs; #define YYINITSTACKSIZE 200
int yyerrflag;
int yychar; typedef struct {
short *yyssp; unsigned stacksize;
YYSTYPE *yyvsp; YYINT *s_base;
YYSTYPE yyval; YYINT *s_mark;
YYSTYPE yylval; YYINT *s_last;
short yyss[YYSTACKSIZE]; YYSTYPE *l_base;
YYSTYPE yyvs[YYSTACKSIZE]; YYSTYPE *l_mark;
#define yystacksize YYSTACKSIZE } YYSTACKDATA;
/* variables for the parser stack */
static YYSTACKDATA yystack;
#line 433 "util/dgn_comp.y"
void void
init_dungeon() init_dungeon()
@@ -580,17 +652,78 @@ output_dgn()
} }
/*dgn_comp.y*/ /*dgn_comp.y*/
#define YYABORT goto yyabort #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 YYREJECT goto yyabort #define YYREJECT goto yyabort
#define YYACCEPT goto yyaccept #define YYACCEPT goto yyaccept
#define YYERROR goto yyerrlab #define YYERROR goto yyerrlab
int int
yyparse() YYPARSE_DECL()
{ {
register int yym, yyn, yystate; int yym, yyn, yystate;
#if YYDEBUG #if YYDEBUG
register char *yys; CONST char *yys;
extern char *getenv();
if ((yys = getenv("YYDEBUG")) != 0) if ((yys = getenv("YYDEBUG")) != 0)
{ {
@@ -602,23 +735,28 @@ yyparse()
yynerrs = 0; yynerrs = 0;
yyerrflag = 0; yyerrflag = 0;
yychar = (-1); yychar = YYEMPTY;
yystate = 0;
yyssp = yyss; #if YYPURE
yyvsp = yyvs; memset(&yystack, 0, sizeof(yystack));
*yyssp = yystate = 0; #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;
yyloop: yyloop:
if ((yyn = yydefred[yystate]) != 0) goto yyreduce; if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
if (yychar < 0) if (yychar < 0)
{ {
if ((yychar = yylex()) < 0) yychar = 0; if ((yychar = YYLEX) < 0) yychar = YYEOF;
#if YYDEBUG #if YYDEBUG
if (yydebug) if (yydebug)
{ {
yys = 0; yys = yyname[YYTRANSLATE(yychar)];
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
printf("%sdebug: state %d, reading %d (%s)\n", printf("%sdebug: state %d, reading %d (%s)\n",
YYPREFIX, yystate, yychar, yys); YYPREFIX, yystate, yychar, yys);
} }
@@ -632,13 +770,14 @@ yyloop:
printf("%sdebug: state %d, shifting to state %d\n", printf("%sdebug: state %d, shifting to state %d\n",
YYPREFIX, yystate, yytable[yyn]); YYPREFIX, yystate, yytable[yyn]);
#endif #endif
if (yyssp >= yyss + yystacksize - 1) if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
{ {
goto yyoverflow; goto yyoverflow;
} }
*++yyssp = yystate = yytable[yyn]; yystate = yytable[yyn];
*++yyvsp = yylval; *++yystack.s_mark = yytable[yyn];
yychar = (-1); *++yystack.l_mark = yylval;
yychar = YYEMPTY;
if (yyerrflag > 0) --yyerrflag; if (yyerrflag > 0) --yyerrflag;
goto yyloop; goto yyloop;
} }
@@ -649,32 +788,35 @@ yyloop:
goto yyreduce; goto yyreduce;
} }
if (yyerrflag) goto yyinrecovery; if (yyerrflag) goto yyinrecovery;
goto yynewerror;
yynewerror: YYERROR_CALL("syntax error");
yyerror("syntax error");
goto yyerrlab; goto yyerrlab;
yyerrlab: yyerrlab:
++yynerrs; ++yynerrs;
yyinrecovery: yyinrecovery:
if (yyerrflag < 3) if (yyerrflag < 3)
{ {
yyerrflag = 3; yyerrflag = 3;
for (;;) for (;;)
{ {
if ((yyn = yysindex[*yyssp]) != 0 && (yyn += YYERRCODE) >= 0 && if ((yyn = yysindex[*yystack.s_mark]) != 0 && (yyn += YYERRCODE) >= 0 &&
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
{ {
#if YYDEBUG #if YYDEBUG
if (yydebug) if (yydebug)
printf("%sdebug: state %d, error recovery shifting\ printf("%sdebug: state %d, error recovery shifting\
to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
#endif #endif
if (yyssp >= yyss + yystacksize - 1) if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
{ {
goto yyoverflow; goto yyoverflow;
} }
*++yyssp = yystate = yytable[yyn]; yystate = yytable[yyn];
*++yyvsp = yylval; *++yystack.s_mark = yytable[yyn];
*++yystack.l_mark = yylval;
goto yyloop; goto yyloop;
} }
else else
@@ -682,30 +824,29 @@ yyinrecovery:
#if YYDEBUG #if YYDEBUG
if (yydebug) if (yydebug)
printf("%sdebug: error recovery discarding state %d\n", printf("%sdebug: error recovery discarding state %d\n",
YYPREFIX, *yyssp); YYPREFIX, *yystack.s_mark);
#endif #endif
if (yyssp <= yyss) goto yyabort; if (yystack.s_mark <= yystack.s_base) goto yyabort;
--yyssp; --yystack.s_mark;
--yyvsp; --yystack.l_mark;
} }
} }
} }
else else
{ {
if (yychar == 0) goto yyabort; if (yychar == YYEOF) goto yyabort;
#if YYDEBUG #if YYDEBUG
if (yydebug) if (yydebug)
{ {
yys = 0; yys = yyname[YYTRANSLATE(yychar)];
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
printf("%sdebug: state %d, error recovery discards token %d (%s)\n", printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
YYPREFIX, yystate, yychar, yys); YYPREFIX, yystate, yychar, yys);
} }
#endif #endif
yychar = (-1); yychar = YYEMPTY;
goto yyloop; goto yyloop;
} }
yyreduce: yyreduce:
#if YYDEBUG #if YYDEBUG
if (yydebug) if (yydebug)
@@ -713,252 +854,283 @@ yyreduce:
YYPREFIX, yystate, yyn, yyrule[yyn]); YYPREFIX, yystate, yyn, yyrule[yyn]);
#endif #endif
yym = yylen[yyn]; yym = yylen[yyn];
yyval = yyvsp[1-yym]; if (yym)
yyval = yystack.l_mark[1-yym];
else
memset(&yyval, 0, sizeof yyval);
switch (yyn) switch (yyn)
{ {
case 2: case 2:
{ #line 83 "util/dgn_comp.y"
{
output_dgn(); output_dgn();
} }
break; break;
case 9: case 9:
{ #line 99 "util/dgn_comp.y"
{
init_dungeon(); init_dungeon();
Strcpy(tmpdungeon[n_dgns].name, yyvsp[-3].str); Strcpy(tmpdungeon[n_dgns].name, yystack.l_mark[-3].str);
tmpdungeon[n_dgns].boneschar = (char)yyvsp[-2].i; tmpdungeon[n_dgns].boneschar = (char)yystack.l_mark[-2].i;
tmpdungeon[n_dgns].lev.base = couple.base; tmpdungeon[n_dgns].lev.base = couple.base;
tmpdungeon[n_dgns].lev.rand = couple.rand; tmpdungeon[n_dgns].lev.rand = couple.rand;
tmpdungeon[n_dgns].chance = yyvsp[0].i; tmpdungeon[n_dgns].chance = yystack.l_mark[0].i;
Free(yyvsp[-3].str); Free(yystack.l_mark[-3].str);
} }
break; break;
case 10: case 10:
{ #line 111 "util/dgn_comp.y"
{
yyval.i = 0; yyval.i = 0;
} }
break; break;
case 11: case 11:
{ #line 115 "util/dgn_comp.y"
yyval.i = yyvsp[0].i; {
yyval.i = yystack.l_mark[0].i;
} }
break; break;
case 15: case 15:
{ #line 126 "util/dgn_comp.y"
tmpdungeon[n_dgns].entry_lev = yyvsp[0].i; {
tmpdungeon[n_dgns].entry_lev = yystack.l_mark[0].i;
} }
break; break;
case 17: case 17:
{ #line 135 "util/dgn_comp.y"
if(yyvsp[0].i <= TOWN || yyvsp[0].i >= D_ALIGN_CHAOTIC) {
if(yystack.l_mark[0].i <= TOWN || yystack.l_mark[0].i >= D_ALIGN_CHAOTIC)
yyerror("Illegal description - ignoring!"); yyerror("Illegal description - ignoring!");
else else
tmpdungeon[n_dgns].flags |= yyvsp[0].i ; tmpdungeon[n_dgns].flags |= yystack.l_mark[0].i ;
} }
break; break;
case 18: case 18:
{ #line 142 "util/dgn_comp.y"
if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC) {
if(yystack.l_mark[0].i && yystack.l_mark[0].i < D_ALIGN_CHAOTIC)
yyerror("Illegal alignment - ignoring!"); yyerror("Illegal alignment - ignoring!");
else else
tmpdungeon[n_dgns].flags |= yyvsp[0].i ; tmpdungeon[n_dgns].flags |= yystack.l_mark[0].i ;
} }
break; break;
case 19: case 19:
{ #line 151 "util/dgn_comp.y"
Strcpy(tmpdungeon[n_dgns].protoname, yyvsp[0].str); {
Free(yyvsp[0].str); Strcpy(tmpdungeon[n_dgns].protoname, yystack.l_mark[0].str);
Free(yystack.l_mark[0].str);
} }
break; break;
case 25: case 25:
{ #line 165 "util/dgn_comp.y"
{
init_level(); init_level();
Strcpy(tmplevel[n_levs].name, yyvsp[-3].str); Strcpy(tmplevel[n_levs].name, yystack.l_mark[-3].str);
tmplevel[n_levs].boneschar = (char)yyvsp[-2].i; tmplevel[n_levs].boneschar = (char)yystack.l_mark[-2].i;
tmplevel[n_levs].lev.base = couple.base; tmplevel[n_levs].lev.base = couple.base;
tmplevel[n_levs].lev.rand = couple.rand; tmplevel[n_levs].lev.rand = couple.rand;
tmpdungeon[n_dgns].levels++; tmpdungeon[n_dgns].levels++;
Free(yyvsp[-3].str); Free(yystack.l_mark[-3].str);
} }
break; break;
case 26: case 26:
{ #line 175 "util/dgn_comp.y"
{
init_level(); init_level();
Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); Strcpy(tmplevel[n_levs].name, yystack.l_mark[-4].str);
tmplevel[n_levs].boneschar = (char)yyvsp[-3].i; tmplevel[n_levs].boneschar = (char)yystack.l_mark[-3].i;
tmplevel[n_levs].lev.base = couple.base; tmplevel[n_levs].lev.base = couple.base;
tmplevel[n_levs].lev.rand = couple.rand; tmplevel[n_levs].lev.rand = couple.rand;
tmplevel[n_levs].rndlevs = yyvsp[0].i; tmplevel[n_levs].rndlevs = yystack.l_mark[0].i;
tmpdungeon[n_dgns].levels++; tmpdungeon[n_dgns].levels++;
Free(yyvsp[-4].str); Free(yystack.l_mark[-4].str);
} }
break; break;
case 27: case 27:
{ #line 188 "util/dgn_comp.y"
{
init_level(); init_level();
Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); Strcpy(tmplevel[n_levs].name, yystack.l_mark[-4].str);
tmplevel[n_levs].boneschar = (char)yyvsp[-3].i; tmplevel[n_levs].boneschar = (char)yystack.l_mark[-3].i;
tmplevel[n_levs].lev.base = couple.base; tmplevel[n_levs].lev.base = couple.base;
tmplevel[n_levs].lev.rand = couple.rand; tmplevel[n_levs].lev.rand = couple.rand;
tmplevel[n_levs].chance = yyvsp[0].i; tmplevel[n_levs].chance = yystack.l_mark[0].i;
tmpdungeon[n_dgns].levels++; tmpdungeon[n_dgns].levels++;
Free(yyvsp[-4].str); Free(yystack.l_mark[-4].str);
} }
break; break;
case 28: case 28:
{ #line 199 "util/dgn_comp.y"
{
init_level(); init_level();
Strcpy(tmplevel[n_levs].name, yyvsp[-5].str); Strcpy(tmplevel[n_levs].name, yystack.l_mark[-5].str);
tmplevel[n_levs].boneschar = (char)yyvsp[-4].i; tmplevel[n_levs].boneschar = (char)yystack.l_mark[-4].i;
tmplevel[n_levs].lev.base = couple.base; tmplevel[n_levs].lev.base = couple.base;
tmplevel[n_levs].lev.rand = couple.rand; tmplevel[n_levs].lev.rand = couple.rand;
tmplevel[n_levs].chance = yyvsp[-1].i; tmplevel[n_levs].chance = yystack.l_mark[-1].i;
tmplevel[n_levs].rndlevs = yyvsp[0].i; tmplevel[n_levs].rndlevs = yystack.l_mark[0].i;
tmpdungeon[n_dgns].levels++; tmpdungeon[n_dgns].levels++;
Free(yyvsp[-5].str); Free(yystack.l_mark[-5].str);
} }
break; break;
case 29: case 29:
{ #line 213 "util/dgn_comp.y"
if(yyvsp[0].i >= D_ALIGN_CHAOTIC) {
if(yystack.l_mark[0].i >= D_ALIGN_CHAOTIC)
yyerror("Illegal description - ignoring!"); yyerror("Illegal description - ignoring!");
else else
tmplevel[n_levs].flags |= yyvsp[0].i ; tmplevel[n_levs].flags |= yystack.l_mark[0].i ;
} }
break; break;
case 30: case 30:
{ #line 220 "util/dgn_comp.y"
if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC) {
if(yystack.l_mark[0].i && yystack.l_mark[0].i < D_ALIGN_CHAOTIC)
yyerror("Illegal alignment - ignoring!"); yyerror("Illegal alignment - ignoring!");
else else
tmplevel[n_levs].flags |= yyvsp[0].i ; tmplevel[n_levs].flags |= yystack.l_mark[0].i ;
} }
break; break;
case 31: case 31:
{ #line 229 "util/dgn_comp.y"
{
init_level(); init_level();
Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); Strcpy(tmplevel[n_levs].name, yystack.l_mark[-4].str);
tmplevel[n_levs].boneschar = (char)yyvsp[-3].i; tmplevel[n_levs].boneschar = (char)yystack.l_mark[-3].i;
tmplevel[n_levs].chain = getchain(yyvsp[-2].str); tmplevel[n_levs].chain = getchain(yystack.l_mark[-2].str);
tmplevel[n_levs].lev.base = couple.base; tmplevel[n_levs].lev.base = couple.base;
tmplevel[n_levs].lev.rand = couple.rand; tmplevel[n_levs].lev.rand = couple.rand;
if(!check_level()) n_levs--; if(!check_level()) n_levs--;
else tmpdungeon[n_dgns].levels++; else tmpdungeon[n_dgns].levels++;
Free(yyvsp[-4].str); Free(yystack.l_mark[-4].str);
Free(yyvsp[-2].str); Free(yystack.l_mark[-2].str);
} }
break; break;
case 32: case 32:
{ #line 242 "util/dgn_comp.y"
{
init_level(); init_level();
Strcpy(tmplevel[n_levs].name, yyvsp[-5].str); Strcpy(tmplevel[n_levs].name, yystack.l_mark[-5].str);
tmplevel[n_levs].boneschar = (char)yyvsp[-4].i; tmplevel[n_levs].boneschar = (char)yystack.l_mark[-4].i;
tmplevel[n_levs].chain = getchain(yyvsp[-3].str); tmplevel[n_levs].chain = getchain(yystack.l_mark[-3].str);
tmplevel[n_levs].lev.base = couple.base; tmplevel[n_levs].lev.base = couple.base;
tmplevel[n_levs].lev.rand = couple.rand; tmplevel[n_levs].lev.rand = couple.rand;
tmplevel[n_levs].rndlevs = yyvsp[0].i; tmplevel[n_levs].rndlevs = yystack.l_mark[0].i;
if(!check_level()) n_levs--; if(!check_level()) n_levs--;
else tmpdungeon[n_dgns].levels++; else tmpdungeon[n_dgns].levels++;
Free(yyvsp[-5].str); Free(yystack.l_mark[-5].str);
Free(yyvsp[-3].str); Free(yystack.l_mark[-3].str);
} }
break; break;
case 33: case 33:
{ #line 258 "util/dgn_comp.y"
{
init_level(); init_level();
Strcpy(tmplevel[n_levs].name, yyvsp[-5].str); Strcpy(tmplevel[n_levs].name, yystack.l_mark[-5].str);
tmplevel[n_levs].boneschar = (char)yyvsp[-4].i; tmplevel[n_levs].boneschar = (char)yystack.l_mark[-4].i;
tmplevel[n_levs].chain = getchain(yyvsp[-3].str); tmplevel[n_levs].chain = getchain(yystack.l_mark[-3].str);
tmplevel[n_levs].lev.base = couple.base; tmplevel[n_levs].lev.base = couple.base;
tmplevel[n_levs].lev.rand = couple.rand; tmplevel[n_levs].lev.rand = couple.rand;
tmplevel[n_levs].chance = yyvsp[0].i; tmplevel[n_levs].chance = yystack.l_mark[0].i;
if(!check_level()) n_levs--; if(!check_level()) n_levs--;
else tmpdungeon[n_dgns].levels++; else tmpdungeon[n_dgns].levels++;
Free(yyvsp[-5].str); Free(yystack.l_mark[-5].str);
Free(yyvsp[-3].str); Free(yystack.l_mark[-3].str);
} }
break; break;
case 34: case 34:
{ #line 272 "util/dgn_comp.y"
{
init_level(); init_level();
Strcpy(tmplevel[n_levs].name, yyvsp[-6].str); Strcpy(tmplevel[n_levs].name, yystack.l_mark[-6].str);
tmplevel[n_levs].boneschar = (char)yyvsp[-5].i; tmplevel[n_levs].boneschar = (char)yystack.l_mark[-5].i;
tmplevel[n_levs].chain = getchain(yyvsp[-4].str); tmplevel[n_levs].chain = getchain(yystack.l_mark[-4].str);
tmplevel[n_levs].lev.base = couple.base; tmplevel[n_levs].lev.base = couple.base;
tmplevel[n_levs].lev.rand = couple.rand; tmplevel[n_levs].lev.rand = couple.rand;
tmplevel[n_levs].chance = yyvsp[-1].i; tmplevel[n_levs].chance = yystack.l_mark[-1].i;
tmplevel[n_levs].rndlevs = yyvsp[0].i; tmplevel[n_levs].rndlevs = yystack.l_mark[0].i;
if(!check_level()) n_levs--; if(!check_level()) n_levs--;
else tmpdungeon[n_dgns].levels++; else tmpdungeon[n_dgns].levels++;
Free(yyvsp[-6].str); Free(yystack.l_mark[-6].str);
Free(yyvsp[-4].str); Free(yystack.l_mark[-4].str);
} }
break; break;
case 37: case 37:
{ #line 293 "util/dgn_comp.y"
{
init_branch(); init_branch();
Strcpy(tmpbranch[n_brs].name, yyvsp[-4].str); Strcpy(tmpbranch[n_brs].name, yystack.l_mark[-4].str);
tmpbranch[n_brs].lev.base = couple.base; tmpbranch[n_brs].lev.base = couple.base;
tmpbranch[n_brs].lev.rand = couple.rand; tmpbranch[n_brs].lev.rand = couple.rand;
tmpbranch[n_brs].type = yyvsp[-1].i; tmpbranch[n_brs].type = yystack.l_mark[-1].i;
tmpbranch[n_brs].up = yyvsp[0].i; tmpbranch[n_brs].up = yystack.l_mark[0].i;
if(!check_branch()) n_brs--; if(!check_branch()) n_brs--;
else tmpdungeon[n_dgns].branches++; else tmpdungeon[n_dgns].branches++;
Free(yyvsp[-4].str); Free(yystack.l_mark[-4].str);
} }
break; break;
case 38: case 38:
{ #line 307 "util/dgn_comp.y"
{
init_branch(); init_branch();
Strcpy(tmpbranch[n_brs].name, yyvsp[-5].str); Strcpy(tmpbranch[n_brs].name, yystack.l_mark[-5].str);
tmpbranch[n_brs].chain = getchain(yyvsp[-4].str); tmpbranch[n_brs].chain = getchain(yystack.l_mark[-4].str);
tmpbranch[n_brs].lev.base = couple.base; tmpbranch[n_brs].lev.base = couple.base;
tmpbranch[n_brs].lev.rand = couple.rand; tmpbranch[n_brs].lev.rand = couple.rand;
tmpbranch[n_brs].type = yyvsp[-1].i; tmpbranch[n_brs].type = yystack.l_mark[-1].i;
tmpbranch[n_brs].up = yyvsp[0].i; tmpbranch[n_brs].up = yystack.l_mark[0].i;
if(!check_branch()) n_brs--; if(!check_branch()) n_brs--;
else tmpdungeon[n_dgns].branches++; else tmpdungeon[n_dgns].branches++;
Free(yyvsp[-5].str); Free(yystack.l_mark[-5].str);
Free(yyvsp[-4].str); Free(yystack.l_mark[-4].str);
} }
break; break;
case 39: case 39:
{ #line 323 "util/dgn_comp.y"
{
yyval.i = TBR_STAIR; /* two way stair */ yyval.i = TBR_STAIR; /* two way stair */
} }
break; break;
case 40: case 40:
{ #line 327 "util/dgn_comp.y"
{
yyval.i = TBR_STAIR; /* two way stair */ yyval.i = TBR_STAIR; /* two way stair */
} }
break; break;
case 41: case 41:
{ #line 331 "util/dgn_comp.y"
{
yyval.i = TBR_NO_UP; /* no up staircase */ yyval.i = TBR_NO_UP; /* no up staircase */
} }
break; break;
case 42: case 42:
{ #line 335 "util/dgn_comp.y"
{
yyval.i = TBR_NO_DOWN; /* no down staircase */ yyval.i = TBR_NO_DOWN; /* no down staircase */
} }
break; break;
case 43: case 43:
{ #line 339 "util/dgn_comp.y"
{
yyval.i = TBR_PORTAL; /* portal connection */ yyval.i = TBR_PORTAL; /* portal connection */
} }
break; break;
case 44: case 44:
{ #line 345 "util/dgn_comp.y"
{
yyval.i = 0; /* defaults to down */ yyval.i = 0; /* defaults to down */
} }
break; break;
case 45: case 45:
{ #line 349 "util/dgn_comp.y"
yyval.i = yyvsp[0].i; {
yyval.i = yystack.l_mark[0].i;
} }
break; break;
case 46: case 46:
{ #line 355 "util/dgn_comp.y"
char *p = yyvsp[0].str; {
char *p = yystack.l_mark[0].str;
if (strlen(p) != 1) { if (strlen(p) != 1) {
if (strcmp(p, "none") != 0) if (strcmp(p, "none") != 0)
yyerror("Bones marker must be a single char, or \"none\"!"); yyerror("Bones marker must be a single char, or \"none\"!");
@@ -969,36 +1141,39 @@ case 46:
} }
break; break;
case 47: case 47:
{ #line 385 "util/dgn_comp.y"
if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) { {
if (yystack.l_mark[-3].i < -MAXLEVEL || yystack.l_mark[-3].i > MAXLEVEL) {
yyerror("Abs base out of dlevel range - zeroing!"); yyerror("Abs base out of dlevel range - zeroing!");
couple.base = couple.rand = 0; couple.base = couple.rand = 0;
} else if (yyvsp[-1].i < -1 || } else if (yystack.l_mark[-1].i < -1 ||
((yyvsp[-3].i < 0) ? (MAXLEVEL + yyvsp[-3].i + yyvsp[-1].i + 1) > MAXLEVEL : ((yystack.l_mark[-3].i < 0) ? (MAXLEVEL + yystack.l_mark[-3].i + yystack.l_mark[-1].i + 1) > MAXLEVEL :
(yyvsp[-3].i + yyvsp[-1].i) > MAXLEVEL)) { (yystack.l_mark[-3].i + yystack.l_mark[-1].i) > MAXLEVEL)) {
yyerror("Abs range out of dlevel range - zeroing!"); yyerror("Abs range out of dlevel range - zeroing!");
couple.base = couple.rand = 0; couple.base = couple.rand = 0;
} else { } else {
couple.base = yyvsp[-3].i; couple.base = yystack.l_mark[-3].i;
couple.rand = yyvsp[-1].i; couple.rand = yystack.l_mark[-1].i;
} }
} }
break; break;
case 48: case 48:
{ #line 422 "util/dgn_comp.y"
if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) { {
if (yystack.l_mark[-3].i < -MAXLEVEL || yystack.l_mark[-3].i > MAXLEVEL) {
yyerror("Rel base out of dlevel range - zeroing!"); yyerror("Rel base out of dlevel range - zeroing!");
couple.base = couple.rand = 0; couple.base = couple.rand = 0;
} else { } else {
couple.base = yyvsp[-3].i; couple.base = yystack.l_mark[-3].i;
couple.rand = yyvsp[-1].i; couple.rand = yystack.l_mark[-1].i;
} }
} }
break; break;
#line 1173 ""
} }
yyssp -= yym; yystack.s_mark -= yym;
yystate = *yyssp; yystate = *yystack.s_mark;
yyvsp -= yym; yystack.l_mark -= yym;
yym = yylhs[yyn]; yym = yylhs[yyn];
if (yystate == 0 && yym == 0) if (yystate == 0 && yym == 0)
{ {
@@ -1008,23 +1183,21 @@ break;
state %d\n", YYPREFIX, YYFINAL); state %d\n", YYPREFIX, YYFINAL);
#endif #endif
yystate = YYFINAL; yystate = YYFINAL;
*++yyssp = YYFINAL; *++yystack.s_mark = YYFINAL;
*++yyvsp = yyval; *++yystack.l_mark = yyval;
if (yychar < 0) if (yychar < 0)
{ {
if ((yychar = yylex()) < 0) yychar = 0; if ((yychar = YYLEX) < 0) yychar = YYEOF;
#if YYDEBUG #if YYDEBUG
if (yydebug) if (yydebug)
{ {
yys = 0; yys = yyname[YYTRANSLATE(yychar)];
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
printf("%sdebug: state %d, reading %d (%s)\n", printf("%sdebug: state %d, reading %d (%s)\n",
YYPREFIX, YYFINAL, yychar, yys); YYPREFIX, YYFINAL, yychar, yys);
} }
#endif #endif
} }
if (yychar == 0) goto yyaccept; if (yychar == YYEOF) goto yyaccept;
goto yyloop; goto yyloop;
} }
if ((yyn = yygindex[yym]) != 0 && (yyn += yystate) >= 0 && if ((yyn = yygindex[yym]) != 0 && (yyn += yystate) >= 0 &&
@@ -1035,19 +1208,24 @@ break;
#if YYDEBUG #if YYDEBUG
if (yydebug) if (yydebug)
printf("%sdebug: after reduction, shifting from state %d \ printf("%sdebug: after reduction, shifting from state %d \
to state %d\n", YYPREFIX, *yyssp, yystate); to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
#endif #endif
if (yyssp >= yyss + yystacksize - 1) if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
{ {
goto yyoverflow; goto yyoverflow;
} }
*++yyssp = yystate; *++yystack.s_mark = (YYINT) yystate;
*++yyvsp = yyval; *++yystack.l_mark = yyval;
goto yyloop; goto yyloop;
yyoverflow: yyoverflow:
yyerror("yacc stack overflow"); YYERROR_CALL("yacc stack overflow");
yyabort: yyabort:
yyfreestack(&yystack);
return (1); return (1);
yyaccept: yyaccept:
yyfreestack(&yystack);
return (0); return (0);
} }
+7
View File
@@ -172,6 +172,12 @@
#define METHOD_SEL 428 #define METHOD_SEL 428
#define METHOD_SEL_ARRAY 429 #define METHOD_SEL_ARRAY 429
#define DICE 430 #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 typedef union
{ {
long i; long i;
@@ -209,4 +215,5 @@ typedef union
char *varstr; char *varstr;
} meth; } meth;
} YYSTYPE; } YYSTYPE;
#endif /* !YYSTYPE_IS_DECLARED */
extern YYSTYPE yylval; extern YYSTYPE yylval;
+1213 -771
View File
File diff suppressed because it is too large Load Diff