From a2649ae879d45d5d569d398ed62f2d91023dca2d Mon Sep 17 00:00:00 2001 From: nhw_cron Date: Tue, 1 Jan 2019 17:19:11 -0500 Subject: [PATCH 1/4] This is cron-daily v1-Dec-30-2019. dgncomp updated: sys/share/dgn_comp.h sys/share/dgn_yacc.c --- sys/share/dgn_comp.h | 7 + sys/share/dgn_yacc.c | 564 ++++++++++++++++++++++++++++--------------- 2 files changed, 378 insertions(+), 193 deletions(-) diff --git a/sys/share/dgn_comp.h b/sys/share/dgn_comp.h index 8f3ecfd64..7ed4b920a 100644 --- a/sys/share/dgn_comp.h +++ b/sys/share/dgn_comp.h @@ -19,9 +19,16 @@ #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; diff --git a/sys/share/dgn_yacc.c b/sys/share/dgn_yacc.c index 5cedec915..4db0ceeab 100644 --- a/sys/share/dgn_yacc.c +++ b/sys/share/dgn_yacc.c @@ -1,17 +1,26 @@ -#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 +/* 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) */ + #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 -#define YYSUBMINOR "0-nh" +#define YYSUBMINOR "0-nh2" +#define YYPATCH 20160324 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) +#define YYENOMEM (-2) +#define YYEOF 0 #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) 1990 by M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -73,11 +82,55 @@ 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 @@ -100,21 +153,22 @@ typedef union #define PORTAL 276 #define STRING 277 #define YYERRCODE 256 -short yylhs[] = { -1, +typedef short YYINT; + YYINT 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, }; -short yylen[] = { 2, + YYINT 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, + YYINT 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, @@ -127,12 +181,12 @@ short yydefred[] = { 0, 0, 45, 37, 0, 27, 0, 0, 0, 0, 0, 38, 28, 33, 0, 48, 47, 34, }; -short yydgoto[] = { 14, + YYINT 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, + YYINT 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, @@ -145,7 +199,7 @@ short yysindex[] = { -237, -178, 0, 0, -193, 0, -177, -176, -175, 42, 43, 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, 87, 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, 91, 0, 0, 0, }; -short yygindex[] = { 0, + YYINT 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, + YYINT 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, @@ -203,7 +257,7 @@ short yytable[] = { 85, 32, 32, 32, 32, 32, 0, 32, 32, 0, 32, 32, 32, 32, }; -short yycheck[] = { 71, + YYINT 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, @@ -247,8 +301,11 @@ short yycheck[] = { 71, #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, @@ -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", "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", +"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", "file :", "file : dungeons", @@ -310,30 +368,44 @@ char *yyrule[] = { "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 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -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 + +#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" void init_dungeon() @@ -580,17 +652,78 @@ output_dgn() } /*dgn_comp.y*/ -#define YYABORT goto yyabort +#line 656 "" + +#if YYDEBUG +#include /* needed for printf */ +#endif + +#if YYNHXFLAG +extern char *getenv(); +#define CONST +#else +#include /* needed for malloc, etc */ +#include /* 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 YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab +#define YYERROR goto yyerrlab + int -yyparse() +YYPARSE_DECL() { - register int yym, yyn, yystate; + int yym, yyn, yystate; #if YYDEBUG - register char *yys; - extern char *getenv(); + CONST char *yys; if ((yys = getenv("YYDEBUG")) != 0) { @@ -602,23 +735,28 @@ yyparse() yynerrs = 0; yyerrflag = 0; - yychar = (-1); + yychar = YYEMPTY; + yystate = 0; - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; +#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; yyloop: if ((yyn = yydefred[yystate]) != 0) goto yyreduce; if (yychar < 0) { - if ((yychar = yylex()) < 0) yychar = 0; + if ((yychar = YYLEX) < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -632,13 +770,14 @@ yyloop: printf("%sdebug: state %d, shifting to state %d\n", YYPREFIX, yystate, yytable[yyn]); #endif - if (yyssp >= yyss + yystacksize - 1) + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); + yystate = yytable[yyn]; + *++yystack.s_mark = yytable[yyn]; + *++yystack.l_mark = yylval; + yychar = YYEMPTY; if (yyerrflag > 0) --yyerrflag; goto yyloop; } @@ -649,32 +788,35 @@ yyloop: goto yyreduce; } if (yyerrflag) goto yyinrecovery; - goto yynewerror; -yynewerror: - yyerror("syntax error"); + + YYERROR_CALL("syntax error"); + goto yyerrlab; + yyerrlab: ++yynerrs; + yyinrecovery: if (yyerrflag < 3) { yyerrflag = 3; for (;;) { - if ((yyn = yysindex[*yyssp]) != 0 && (yyn += YYERRCODE) >= 0 && + if ((yyn = yysindex[*yystack.s_mark]) != 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]); + to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); #endif - if (yyssp >= yyss + yystacksize - 1) + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; + yystate = yytable[yyn]; + *++yystack.s_mark = yytable[yyn]; + *++yystack.l_mark = yylval; goto yyloop; } else @@ -682,30 +824,29 @@ yyinrecovery: #if YYDEBUG if (yydebug) printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); + YYPREFIX, *yystack.s_mark); #endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; + if (yystack.s_mark <= yystack.s_base) goto yyabort; + --yystack.s_mark; + --yystack.l_mark; } } } else { - if (yychar == 0) goto yyabort; + if (yychar == YYEOF) goto yyabort; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif - yychar = (-1); + yychar = YYEMPTY; goto yyloop; } + yyreduce: #if YYDEBUG if (yydebug) @@ -713,252 +854,283 @@ yyreduce: YYPREFIX, yystate, yyn, yyrule[yyn]); #endif yym = yylen[yyn]; - yyval = yyvsp[1-yym]; + if (yym) + yyval = yystack.l_mark[1-yym]; + else + memset(&yyval, 0, sizeof yyval); 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, yyvsp[-3].str); - tmpdungeon[n_dgns].boneschar = (char)yyvsp[-2].i; + Strcpy(tmpdungeon[n_dgns].name, yystack.l_mark[-3].str); + tmpdungeon[n_dgns].boneschar = (char)yystack.l_mark[-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); + tmpdungeon[n_dgns].chance = yystack.l_mark[0].i; + Free(yystack.l_mark[-3].str); } break; case 10: -{ +#line 111 "util/dgn_comp.y" + { yyval.i = 0; } break; case 11: -{ - yyval.i = yyvsp[0].i; +#line 115 "util/dgn_comp.y" + { + yyval.i = yystack.l_mark[0].i; } break; case 15: -{ - tmpdungeon[n_dgns].entry_lev = yyvsp[0].i; +#line 126 "util/dgn_comp.y" + { + tmpdungeon[n_dgns].entry_lev = yystack.l_mark[0].i; } break; case 17: -{ - if(yyvsp[0].i <= TOWN || yyvsp[0].i >= D_ALIGN_CHAOTIC) +#line 135 "util/dgn_comp.y" + { + if(yystack.l_mark[0].i <= TOWN || yystack.l_mark[0].i >= D_ALIGN_CHAOTIC) yyerror("Illegal description - ignoring!"); else - tmpdungeon[n_dgns].flags |= yyvsp[0].i ; + tmpdungeon[n_dgns].flags |= yystack.l_mark[0].i ; } break; case 18: -{ - if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC) +#line 142 "util/dgn_comp.y" + { + if(yystack.l_mark[0].i && yystack.l_mark[0].i < D_ALIGN_CHAOTIC) yyerror("Illegal alignment - ignoring!"); else - tmpdungeon[n_dgns].flags |= yyvsp[0].i ; + tmpdungeon[n_dgns].flags |= yystack.l_mark[0].i ; } break; case 19: -{ - Strcpy(tmpdungeon[n_dgns].protoname, yyvsp[0].str); - Free(yyvsp[0].str); +#line 151 "util/dgn_comp.y" + { + Strcpy(tmpdungeon[n_dgns].protoname, yystack.l_mark[0].str); + Free(yystack.l_mark[0].str); } break; case 25: -{ +#line 165 "util/dgn_comp.y" + { init_level(); - Strcpy(tmplevel[n_levs].name, yyvsp[-3].str); - tmplevel[n_levs].boneschar = (char)yyvsp[-2].i; + Strcpy(tmplevel[n_levs].name, yystack.l_mark[-3].str); + tmplevel[n_levs].boneschar = (char)yystack.l_mark[-2].i; tmplevel[n_levs].lev.base = couple.base; tmplevel[n_levs].lev.rand = couple.rand; tmpdungeon[n_dgns].levels++; - Free(yyvsp[-3].str); + Free(yystack.l_mark[-3].str); } break; case 26: -{ +#line 175 "util/dgn_comp.y" + { init_level(); - Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); - tmplevel[n_levs].boneschar = (char)yyvsp[-3].i; + Strcpy(tmplevel[n_levs].name, yystack.l_mark[-4].str); + tmplevel[n_levs].boneschar = (char)yystack.l_mark[-3].i; tmplevel[n_levs].lev.base = couple.base; 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++; - Free(yyvsp[-4].str); + Free(yystack.l_mark[-4].str); } break; case 27: -{ +#line 188 "util/dgn_comp.y" + { init_level(); - Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); - tmplevel[n_levs].boneschar = (char)yyvsp[-3].i; + Strcpy(tmplevel[n_levs].name, yystack.l_mark[-4].str); + tmplevel[n_levs].boneschar = (char)yystack.l_mark[-3].i; tmplevel[n_levs].lev.base = couple.base; 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++; - Free(yyvsp[-4].str); + Free(yystack.l_mark[-4].str); } break; case 28: -{ +#line 199 "util/dgn_comp.y" + { init_level(); - Strcpy(tmplevel[n_levs].name, yyvsp[-5].str); - tmplevel[n_levs].boneschar = (char)yyvsp[-4].i; + Strcpy(tmplevel[n_levs].name, yystack.l_mark[-5].str); + tmplevel[n_levs].boneschar = (char)yystack.l_mark[-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; + tmplevel[n_levs].chance = yystack.l_mark[-1].i; + tmplevel[n_levs].rndlevs = yystack.l_mark[0].i; tmpdungeon[n_dgns].levels++; - Free(yyvsp[-5].str); + Free(yystack.l_mark[-5].str); } break; case 29: -{ - if(yyvsp[0].i >= D_ALIGN_CHAOTIC) +#line 213 "util/dgn_comp.y" + { + if(yystack.l_mark[0].i >= D_ALIGN_CHAOTIC) yyerror("Illegal description - ignoring!"); else - tmplevel[n_levs].flags |= yyvsp[0].i ; + tmplevel[n_levs].flags |= yystack.l_mark[0].i ; } break; case 30: -{ - if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC) +#line 220 "util/dgn_comp.y" + { + if(yystack.l_mark[0].i && yystack.l_mark[0].i < D_ALIGN_CHAOTIC) yyerror("Illegal alignment - ignoring!"); else - tmplevel[n_levs].flags |= yyvsp[0].i ; + tmplevel[n_levs].flags |= yystack.l_mark[0].i ; } break; case 31: -{ +#line 229 "util/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); + 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); 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); + Free(yystack.l_mark[-4].str); + Free(yystack.l_mark[-2].str); } break; case 32: -{ +#line 242 "util/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); + 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); tmplevel[n_levs].lev.base = couple.base; 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--; else tmpdungeon[n_dgns].levels++; - Free(yyvsp[-5].str); - Free(yyvsp[-3].str); + Free(yystack.l_mark[-5].str); + Free(yystack.l_mark[-3].str); } break; case 33: -{ +#line 258 "util/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); + 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); tmplevel[n_levs].lev.base = couple.base; 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--; else tmpdungeon[n_dgns].levels++; - Free(yyvsp[-5].str); - Free(yyvsp[-3].str); + Free(yystack.l_mark[-5].str); + Free(yystack.l_mark[-3].str); } break; case 34: -{ +#line 272 "util/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); + 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); 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; + tmplevel[n_levs].chance = yystack.l_mark[-1].i; + tmplevel[n_levs].rndlevs = yystack.l_mark[0].i; if(!check_level()) n_levs--; else tmpdungeon[n_dgns].levels++; - Free(yyvsp[-6].str); - Free(yyvsp[-4].str); + Free(yystack.l_mark[-6].str); + Free(yystack.l_mark[-4].str); } break; case 37: -{ +#line 293 "util/dgn_comp.y" + { 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.rand = couple.rand; - tmpbranch[n_brs].type = yyvsp[-1].i; - tmpbranch[n_brs].up = yyvsp[0].i; + tmpbranch[n_brs].type = yystack.l_mark[-1].i; + tmpbranch[n_brs].up = yystack.l_mark[0].i; if(!check_branch()) n_brs--; else tmpdungeon[n_dgns].branches++; - Free(yyvsp[-4].str); + Free(yystack.l_mark[-4].str); } break; case 38: -{ +#line 307 "util/dgn_comp.y" + { init_branch(); - Strcpy(tmpbranch[n_brs].name, yyvsp[-5].str); - tmpbranch[n_brs].chain = getchain(yyvsp[-4].str); + Strcpy(tmpbranch[n_brs].name, yystack.l_mark[-5].str); + tmpbranch[n_brs].chain = getchain(yystack.l_mark[-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; + tmpbranch[n_brs].type = yystack.l_mark[-1].i; + tmpbranch[n_brs].up = yystack.l_mark[0].i; if(!check_branch()) n_brs--; else tmpdungeon[n_dgns].branches++; - Free(yyvsp[-5].str); - Free(yyvsp[-4].str); + Free(yystack.l_mark[-5].str); + Free(yystack.l_mark[-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: -{ - yyval.i = yyvsp[0].i; +#line 349 "util/dgn_comp.y" + { + yyval.i = yystack.l_mark[0].i; } break; case 46: -{ - char *p = yyvsp[0].str; +#line 355 "util/dgn_comp.y" + { + char *p = yystack.l_mark[0].str; if (strlen(p) != 1) { if (strcmp(p, "none") != 0) yyerror("Bones marker must be a single char, or \"none\"!"); @@ -969,36 +1141,39 @@ case 46: } break; case 47: -{ - if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) { +#line 385 "util/dgn_comp.y" + { + if (yystack.l_mark[-3].i < -MAXLEVEL || yystack.l_mark[-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)) { + } 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)) { yyerror("Abs range out of dlevel range - zeroing!"); couple.base = couple.rand = 0; } else { - couple.base = yyvsp[-3].i; - couple.rand = yyvsp[-1].i; + couple.base = yystack.l_mark[-3].i; + couple.rand = yystack.l_mark[-1].i; } } break; case 48: -{ - if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) { +#line 422 "util/dgn_comp.y" + { + if (yystack.l_mark[-3].i < -MAXLEVEL || yystack.l_mark[-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; + couple.base = yystack.l_mark[-3].i; + couple.rand = yystack.l_mark[-1].i; } } break; +#line 1173 "" } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; + yystack.s_mark -= yym; + yystate = *yystack.s_mark; + yystack.l_mark -= yym; yym = yylhs[yyn]; if (yystate == 0 && yym == 0) { @@ -1008,23 +1183,21 @@ break; state %d\n", YYPREFIX, YYFINAL); #endif yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; + *++yystack.s_mark = YYFINAL; + *++yystack.l_mark = yyval; if (yychar < 0) { - if ((yychar = yylex()) < 0) yychar = 0; + if ((yychar = YYLEX) < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } #endif } - if (yychar == 0) goto yyaccept; + if (yychar == YYEOF) goto yyaccept; goto yyloop; } if ((yyn = yygindex[yym]) != 0 && (yyn += yystate) >= 0 && @@ -1035,19 +1208,24 @@ break; #if YYDEBUG if (yydebug) 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 - if (yyssp >= yyss + yystacksize - 1) + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } - *++yyssp = yystate; - *++yyvsp = yyval; + *++yystack.s_mark = (YYINT) yystate; + *++yystack.l_mark = yyval; goto yyloop; + yyoverflow: - yyerror("yacc stack overflow"); + YYERROR_CALL("yacc stack overflow"); + yyabort: + yyfreestack(&yystack); return (1); + yyaccept: + yyfreestack(&yystack); return (0); } From 55e6a0986c4f353a7d0c3a016bcbecabe9b523d6 Mon Sep 17 00:00:00 2001 From: nhw_cron Date: Tue, 1 Jan 2019 17:19:13 -0500 Subject: [PATCH 2/4] This is cron-daily v1-Dec-30-2019. guidebook updated: doc/Guidebook.txt --- doc/Guidebook.txt | 782 +++++++++++++++++++++++----------------------- 1 file changed, 391 insertions(+), 391 deletions(-) diff --git a/doc/Guidebook.txt b/doc/Guidebook.txt index 4f96aae71..430cdf62a 100644 --- a/doc/Guidebook.txt +++ b/doc/Guidebook.txt @@ -126,7 +126,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -192,7 +192,7 @@ you have seen on the current dungeon level; as you explore more - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -258,7 +258,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -324,7 +324,7 @@ Intelligence affects your ability to cast spells and read - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -390,7 +390,7 @@ ical attacks. Many dungeons show only your experience level - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -456,7 +456,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -522,7 +522,7 @@ nasty and vicious. Sometimes, however, they can be helpful. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -588,7 +588,7 @@ symbol at the chosen location, conditionally check for "More - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -654,7 +654,7 @@ if you remember a monster there). - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -720,7 +720,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -786,7 +786,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -852,7 +852,7 @@ visited. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -918,7 +918,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -984,7 +984,7 @@ Some characters can wield two weapons at once; use the `X' - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1050,7 +1050,7 @@ (R)UNIX is a registered trademark of The Open Group. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1116,7 +1116,7 @@ tures the game was compiled with. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1182,7 +1182,7 @@ Call (name) a monster, or an object in inventory, on the - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1248,7 +1248,7 @@ Show what type of thing a map symbol corresponds to. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1314,7 +1314,7 @@ also `l' if number_pad is on. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1380,7 +1380,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1446,7 +1446,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1512,7 +1512,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1578,7 +1578,7 @@ Go up a staircase. Default key is `<'. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1644,7 +1644,7 @@ mode only. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1710,7 +1710,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1776,7 +1776,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1842,7 +1842,7 @@ the classic computer game "Sokoban." The goal is to push the - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1908,7 +1908,7 @@ told that the shopkeeper isn't interested (generally, your item - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -1974,7 +1974,7 @@ name which is just a space will remove any prior name. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2040,7 +2040,7 @@ with it even if adjacent at the time. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2106,7 +2106,7 @@ to pick it up. In NetHack, this is accomplished automatically by - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2172,7 +2172,7 @@ your hand when wielded, so you cannot unwield them. Any cursed - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2238,7 +2238,7 @@ like rust. Such "erosion" damage can be repaired. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2304,7 +2304,7 @@ time you use `f'. There is also an option, autoquiver, which has - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2370,7 +2370,7 @@ the amount of damage done when you do hit; at basic level, there - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2436,7 +2436,7 @@ protection than others. Your armor class is a measure of this - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2502,7 +2502,7 @@ open. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2568,7 +2568,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2634,7 +2634,7 @@ the attempt backfires. Reading a cursed spellbook or one with - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2700,7 +2700,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2766,7 +2766,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2832,7 +2832,7 @@ fungi (`F') are also considered to be vegetable matter. Certain - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2898,7 +2898,7 @@ of item; or fight with your hands and feet. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -2964,7 +2964,7 @@ On UNIX, Linux, and Mac OS X it is ".nethackrc" in the user's - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -3030,7 +3030,7 @@ Defaults to HACKDIR, must be writable. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -3096,7 +3096,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -3162,7 +3162,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -3228,7 +3228,7 @@ Persistent. See pickup_types to refine the behavior. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -3294,7 +3294,7 @@ Have user confirm attacks on pets, shopkeepers, and other - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -3360,7 +3360,7 @@ veal things about them that you hadn't discovered. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -3426,7 +3426,7 @@ aren't interrupted with the "More info?" prompt, but it also - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -3492,7 +3492,7 @@ Enable mail delivery during the game (default on). Persistent. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -3558,7 +3558,7 @@ - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -3606,10 +3606,34 @@ Prompt for new form whenever any monster changes shape (default off). Debug mode only. + mouse_support + Allow use of the mouse for input and travel. Valid settings + are: + + 0 - disabled + 1 - enabled and make OS adjustments to support mouse use in + the game. + 2 - like 1 but does not make any OS adjustments + + For backward compatibility, omitting a value is the same as + specifying 1 and negating mouse_support is the same as specify- + ing 0. + msghistory The number of top line messages to keep (and be able to recall with `^P') (default 20). Cannot be set with the `O' command. + + NetHack 3.6 December 15, 2018 + + + + + + NetHack Guidebook 56 + + + msg_window Allows you to change the way recalled messages are displayed. (It is currently implemented for tty only.) The possible val- @@ -3622,18 +3646,6 @@ For backward compatibility, no value needs to be specified (which defaults to "full"), or it can be negated (which - - - NetHack 3.6 October 16, 2018 - - - - - - NetHack Guidebook 56 - - - defaults to "single"). name @@ -3677,6 +3689,17 @@ to search twelve times), precede it with the letter `n' ("n12s"). + + NetHack 3.6 December 15, 2018 + + + + + + NetHack Guidebook 57 + + + packorder Specify the order to list object types in (default "")[%?+!=/(*`0_"). The value of this option should be a string @@ -3688,18 +3711,6 @@ prompting is desired. The default is paranoid_confirma- tion:pray. - - - NetHack 3.6 October 16, 2018 - - - - - - NetHack Guidebook 57 - - - Confirm - for any prompts which are set to require "yes" rather than `y', also require "no" to reject in- stead of accepting any non-yes response as no @@ -3743,6 +3754,18 @@ "horse", and "none". If the choice is not allowed for the role you are currently playing, it will be silently ignored. For example, "horse" will only be honored when playing a knight. + + + NetHack 3.6 December 15, 2018 + + + + + + NetHack Guidebook 58 + + + Cannot be set with the `O' command. pickup_burden @@ -3754,18 +3777,6 @@ pickup_thrown If this option is on and autopickup is also on, try to pick up things that you threw, even if they aren't in pickup_types or - - - NetHack 3.6 October 16, 2018 - - - - - - NetHack Guidebook 58 - - - match an autopickup exception. Default is on. Persistent. pickup_types @@ -3809,6 +3820,18 @@ Make the space bar a synonym for the `.' (#wait) command (de- fault off). Persistent. + + + NetHack 3.6 December 15, 2018 + + + + + + NetHack Guidebook 59 + + + role Pick your type of character (ex. "role:Samurai"); synonym for "character". See "name" for an alternate method of specifying @@ -3820,18 +3843,6 @@ roguesymset This option may be used to select one of the named symbol sets - - - NetHack 3.6 October 16, 2018 - - - - - - NetHack Guidebook 59 - - - found within "symbols" to alter the symbols displayed on the screen on the rogue level. @@ -3875,6 +3886,18 @@ Show your accumulated experience points on bottom line (default off). Persistent. + + + NetHack 3.6 December 15, 2018 + + + + + + NetHack Guidebook 60 + + + showrace Display yourself as the glyph for your race, rather than the glyph for your role (default off). Note that this setting af- @@ -3885,19 +3908,6 @@ Show your approximate accumulated score on bottom line (default off). Persistent. - - - - NetHack 3.6 October 16, 2018 - - - - - - NetHack Guidebook 60 - - - silent Suppress terminal beeps (default on). Persistent. @@ -3943,18 +3953,8 @@ screen. Use "symset:default" to explicitly select the default symbols. - time - Show the elapsed game time in turns on bottom line (default - off). Persistent. - timed_delay - When pausing momentarily for display effect, such as with ex- - plosions and moving objects, use a timer rather than sending - extra characters to the screen. (Applies to "tty" interface - only; "X11" interface always uses a timer based delay. The - - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -3964,7 +3964,16 @@ - default is on if configured into the program.) Persistent. + time + Show the elapsed game time in turns on bottom line (default + off). Persistent. + + timed_delay + When pausing momentarily for display effect, such as with ex- + plosions and moving objects, use a timer rather than sending + extra characters to the screen. (Applies to "tty" interface + only; "X11" interface always uses a timer based delay. The de- + fault is on if configured into the program.) Persistent. tombstone Draw a tombstone graphic upon your death (default on). Persis- @@ -4011,16 +4020,7 @@ - n - no filtering [default] - v - in view only - a - in same area only - - The area-filter tries to be slightly predictive -- if you're - standing on a doorway, it will consider the area on the side of - the door you were last moving towards. - - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -4030,6 +4030,16 @@ + + + n - no filtering [default] + v - in view only + a - in same area only + + The area-filter tries to be slightly predictive -- if you're + standing on a doorway, it will consider the area on the side of + the door you were last moving towards. + Filtering can also be changed when getting a location with the "getpos.filter" key. @@ -4073,6 +4083,19 @@ dynamic and can be specified during the game with the `O' com- mand. + + + + NetHack 3.6 December 15, 2018 + + + + + + NetHack Guidebook 63 + + + align_message Where to align or place the message window (top, bottom, left, or right) @@ -4085,17 +4108,6 @@ If NetHack can, it should display an ascii character map if it can. - - NetHack 3.6 October 16, 2018 - - - - - - NetHack Guidebook 63 - - - color If NetHack can, it should display color if it can for different monsters, objects, and dungeon features. @@ -4138,6 +4150,18 @@ font_size_status If NetHack can, it should use this size font for the status + + + NetHack 3.6 December 15, 2018 + + + + + + NetHack Guidebook 64 + + + window. font_size_text @@ -4150,25 +4174,10 @@ large_font If NetHack can, it should use a large font. - - - NetHack 3.6 October 16, 2018 - - - - - - NetHack Guidebook 64 - - - map_mode If NetHack can, it should display the map in the manner speci- fied. - mouse_support - Allow use of the mouse for input and travel. - player_selection If NetHack can, it should pop up dialog boxes, or use prompts for character selection. @@ -4208,17 +4217,8 @@ tiled_map If NetHack can, it should display a tiled map if it can. - tile_file - Specify the name of an alternative tile file to override the - default. - tile_height - Specify the preferred height of each tile in a tile capable - port. - - - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -4228,6 +4228,14 @@ + tile_file + Specify the name of an alternative tile file to override the + default. + + tile_height + Specify the preferred height of each tile in a tile capable + port. + tile_width Specify the preferred width of each tile in a tile capable port @@ -4275,16 +4283,8 @@ the .dll extension and without any path information. Cannot be set with the `O' command. - altmeta - On Amiga, this option controls whether typing "Alt" plus anoth- - er key functions as a meta-shift for that key (default on). - altmeta - On other (non-Amiga) systems where this option is available, it - can be set to tell NetHack to convert a two character sequence - - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -4294,6 +4294,13 @@ + altmeta + On Amiga, this option controls whether typing "Alt" plus anoth- + er key functions as a meta-shift for that key (default on). + + altmeta + On other (non-Amiga) systems where this option is available, it + can be set to tell NetHack to convert a two character sequence beginning with ESC into a meta-shifted version of the second character (default off). @@ -4341,16 +4348,9 @@ ments in the config file if needed. Cannot be set with the `O' command. - video - Set the video mode used (PC NetHack only). Values are "autode- - tect", "default", or "vga". Setting "vga" (or "autodetect" - with vga hardware present) will cause the game to display - tiles. Cannot be set with the `O' command. - - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -4360,6 +4360,12 @@ + video + Set the video mode used (PC NetHack only). Values are "autode- + tect", "default", or "vga". Setting "vga" (or "autodetect" + with vga hardware present) will cause the game to display + tiles. Cannot be set with the `O' command. + videocolors Set the color palette for PC systems using NO_TERMS (default 4-2-6-1-5-3-15-12-10-14-9-13-11, (PC NetHack only). The order @@ -4409,14 +4415,8 @@ A "never pickup" rule takes precedence over an "always pickup" rule if both match. - Exceptions can be set with the `O' command, but ones set that - way will not be preserved across saves and restores. - Here are some examples: - - - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -4426,6 +4426,11 @@ + Exceptions can be set with the `O' command, but ones set that + way will not be preserved across saves and restores. + + Here are some examples: + autopickup_exception="<*arrow" autopickup_exception=">*corpse" autopickup_exception=">* cursed*" @@ -4475,14 +4480,9 @@ doinv Show inventory. With number_pad only. Default is `0'. - fight - Prefix key to force fight a direction. Default is `F'. - - fight.numpad - Prefix key to force fight a direction. With number_pad only. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -4492,6 +4492,11 @@ + fight + Prefix key to force fight a direction. Default is `F'. + + fight.numpad + Prefix key to force fight a direction. With number_pad only. Default is `-'. getdir.help @@ -4542,13 +4547,8 @@ When asked for a location, the key to go to next closest ob- ject. Default is `o'. - getpos.obj.prev - When asked for a location, the key to go to previous closest - object. Default is `O'. - - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -4558,6 +4558,10 @@ + getpos.obj.prev + When asked for a location, the key to go to previous closest + object. Default is `O'. + getpos.menu When asked for a location, and using one of the next or previ- ous keys to cycle through targets, toggle showing a menu in- @@ -4607,14 +4611,10 @@ When asked for a location, the key to go to show valid target locations. Default is `$'. - getpos.valid.next - When asked for a location, the key to go to next closest valid - location. Default is `z'. - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -4624,6 +4624,10 @@ + getpos.valid.next + When asked for a location, the key to go to next closest valid + location. Default is `z'. + getpos.valid.prev When asked for a location, the key to go to previous closest valid location. Default is `Z'. @@ -4674,13 +4678,9 @@ Allowed types are: show - show message normally; - hide - never show the message; - stop - wait for user with more-prompt; - norep - show the message once, but not again if no other mes- - sage is shown in between. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -4690,6 +4690,11 @@ + hide - never show the message; + stop - wait for user with more-prompt; + norep - show the message once, but not again if no other mes- + sage is shown in between. + Here's an example of message types using NetHack's internal pattern matching facility: @@ -4737,16 +4742,11 @@ Here's an example of menu colors using NetHack's internal pat- tern matching facility: - MENUCOLOR="* blessed *"=green - MENUCOLOR="* cursed *"=red - MENUCOLOR="* cursed *(being worn)"=red&underline - - specifies that any menu line with " blessed " contained in it - will be shown in green color, lines with " cursed " will be - shown in red, and lines with " cursed " followed by "(being - NetHack 3.6 October 16, 2018 + + + NetHack 3.6 December 15, 2018 @@ -4756,6 +4756,13 @@ + MENUCOLOR="* blessed *"=green + MENUCOLOR="* cursed *"=red + MENUCOLOR="* cursed *(being worn)"=red&underline + + specifies that any menu line with " blessed " contained in it + will be shown in green color, lines with " cursed " will be + shown in red, and lines with " cursed " followed by "(being worn)" on the same line will be shown in red color and under- lined. You can have multiple MENUCOLOR entries in your config file, and the last MENUCOLOR-line in your config file that @@ -4803,16 +4810,9 @@ OPTION=hilite_status: field-name/behavior/color&attributes - For example, the following line in your config file will - cause the hitpoints field to display in the color red if your - hitpoints drop to or below a threshold of 30%: - - OPTION=hilite_status: hitpoints/<30%/red/normal - - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -4822,6 +4822,12 @@ + For example, the following line in your config file will + cause the hitpoints field to display in the color red if your + hitpoints drop to or below a threshold of 30%: + + OPTION=hilite_status: hitpoints/<=30%/red/normal + For another example, the following line in your config file will cause wisdom to be displayed red if it drops and green if it rises. @@ -4870,15 +4876,9 @@ matches the percentage. It is specified as a number be- tween 0 and 100, followed by `%' (percent sign). If the percentage is prefixed with `<=' or `>=', it also matches - when value is below or above the percentage. Use prefix - `<' or `>' to match when strictly below or above. (The - numeric limit is relaxed slightly for those: >-1% and - <101% are allowed.) Only valid for "power" and "hit- - points" fields. - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -4888,6 +4888,12 @@ + when value is below or above the percentage. Use prefix + `<' or `>' to match when strictly below or above. (The + numeric limit is relaxed slightly for those: >-1% and + <101% are allowed.) Only valid for "power" and "hit- + points" fields. + * absolute value sets the attribute when the field value matches that number. The number must be 0 or higher, ex- cept for "armor-class' which allows negative values. If @@ -4935,16 +4941,10 @@ The options that are used to select a particular symbol set from the symbol file are: - symset - Set the name of the symbol set that you want to load. - - roguesymset - Set the name of the symbol set that you want to load for dis- - play on the rogue level. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -4954,6 +4954,13 @@ + symset + Set the name of the symbol set that you want to load. + + roguesymset + Set the name of the symbol set that you want to load for dis- + play on the rogue level. + You can also override one or more symbols using the SYMBOLS config file option. Symbols are specified as name:value pairs. Note that NetHack escape-processes the value string in conven- @@ -5000,17 +5007,10 @@ > S_dnladder (ladder down) > S_dnstair (staircase down) d S_dog (dog or other canine) - D S_dragon (dragon) - ; S_eel (sea monster) - E S_elemental (elemental) - / S_explode1 (explosion top left) - - S_explode2 (explosion top center) - \ S_explode3 (explosion top right) - | S_explode4 (explosion middle left) - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -5020,6 +5020,13 @@ + D S_dragon (dragon) + ; S_eel (sea monster) + E S_elemental (elemental) + / S_explode1 (explosion top left) + - S_explode2 (explosion top center) + \ S_explode3 (explosion top right) + | S_explode4 (explosion middle left) S_explode5 (explosion middle center) | S_explode6 (explosion middle right) \ S_explode7 (explosion bottom left) @@ -5066,17 +5073,10 @@ : S_lizard (lizard) \ S_lslant (diagonal beam [zap animation]) ^ S_magic_portal (magic portal) - ^ S_magic_trap (magic trap) - m S_mimic (mimic) - ] S_mimic_def (mimic) - M S_mummy (mummy) - N S_naga (naga) - . S_ndoor (doorway without door) - n S_nymph (nymph) - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -5086,6 +5086,13 @@ + ^ S_magic_trap (magic trap) + m S_mimic (mimic) + ] S_mimic_def (mimic) + M S_mummy (mummy) + N S_naga (naga) + . S_ndoor (doorway without door) + n S_nymph (nymph) O S_ogre (ogre) o S_orc (orc) p S_piercer (piercer) @@ -5132,17 +5139,10 @@ \ S_throne (opulent throne) - S_tlcorn (top left corner) | S_tlwall (wall) - ( S_tool (useful item (pick-axe key lamp...)) - ^ S_trap_door (trap door) - t S_trapper (trapper or lurker above) - - S_trcorn (top right corner) - # S_tree (tree) - T S_troll (troll) - | S_trwall (wall) - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -5152,6 +5152,13 @@ + ( S_tool (useful item (pick-axe key lamp...)) + ^ S_trap_door (trap door) + t S_trapper (trapper or lurker above) + - S_trcorn (top right corner) + # S_tree (tree) + T S_troll (troll) + | S_trwall (wall) - S_tuwall (wall) U S_umber (umber hulk) u S_unicorn (unicorn or horse) @@ -5199,16 +5206,9 @@ character by character. They will also find the search capabili- ties of their screen-readers to be quite valuable. Be certain to examine this Guidebook before playing so you have an idea what - the screen layout is like. You'll also need to be able to locate - the PC cursor. It is always where your character is located. - Merely searching for an @-sign will not always find your charac- - ter since there are other humanoids represented by the same sign. - Your screen-reader should also have a function which gives you - the row and column of your review cursor and the PC cursor. - These co-ordinates are often useful in giving players a better - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -5218,6 +5218,13 @@ + the screen layout is like. You'll also need to be able to locate + the PC cursor. It is always where your character is located. + Merely searching for an @-sign will not always find your charac- + ter since there are other humanoids represented by the same sign. + Your screen-reader should also have a function which gives you + the row and column of your review cursor and the PC cursor. + These co-ordinates are often useful in giving players a better sense of the overall location of items on the screen. NetHack can also be compiled with support for sending the @@ -5265,16 +5272,9 @@ mention_walls Give feedback messages when walking towards a wall or when - travel command was interrupted. - - whatis_coord:compass - When targeting with cursor, describe the cursor position with - coordinates relative to your character. - - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -5284,6 +5284,12 @@ + travel command was interrupted. + + whatis_coord:compass + When targeting with cursor, describe the cursor position with + coordinates relative to your character. + whatis_filter:area When targeting with cursor, filter possible locations so only those in the same area (eg. same room, or same corridor) are @@ -5332,15 +5338,9 @@ SEDUCE = 0 or 1 to disable or enable, respectively, the SEDUCE option. When disabled, incubi and succubi behave like nymphs. - CHECK_PLNAME = Setting this to 1 will make the EXPLORERS, WIZ- - ARDS, and SHELLERS check for the player name instead of the us- - er's login name. - - CHECK_SAVE_UID = 0 or 1 to disable or enable, respectively, the - UID (used identification number) checking for save files (to - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -5350,6 +5350,12 @@ + CHECK_PLNAME = Setting this to 1 will make the EXPLORERS, WIZ- + ARDS, and SHELLERS check for the player name instead of the us- + er's login name. + + CHECK_SAVE_UID = 0 or 1 to disable or enable, respectively, the + UID (used identification number) checking for save files (to verify that the user who is restoring is the same one who saved). @@ -5398,15 +5404,9 @@ how the game ended. If you quit the game, you escape with all of your gold intact. If, however, you get killed in the Mazes of Menace, the guild will only hear about 90% of your gold when your - corpse is discovered (adventurers have been known to collect - finder's fees). So, consider whether you want to take one last - hit at that monster and possibly live, or quit and stop with - whatever you have. If you quit, you keep all your gold, but if - you swing and live, you might find more. - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -5416,6 +5416,12 @@ + corpse is discovered (adventurers have been known to collect + finder's fees). So, consider whether you want to take one last + hit at that monster and possibly live, or quit and stop with + whatever you have. If you quit, you keep all your gold, but if + you swing and live, you might find more. + If you just want to see what the current top players/games list is, you can type nethack -s all on most versions. @@ -5464,15 +5470,9 @@ and Kenneth C. R. C. Arnold. Small portions were adapted from Further Exploration of the Dungeons of Doom, by Ken Arromdee. - NetHack is the product of literally dozens of people's work. - Main events in the course of the game development are described - below: - - Jay Fenlason wrote the original Hack, with help from Kenny - Woodland, Mike Thome and Jon Payne. - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -5482,6 +5482,13 @@ + NetHack is the product of literally dozens of people's work. + Main events in the course of the game development are described + below: + + Jay Fenlason wrote the original Hack, with help from Kenny + Woodland, Mike Thome and Jon Payne. + Andries Brouwer did a major re-write, transforming Hack into a very different game, and published (at least) three versions (1.0.1, 1.0.2, and 1.0.3) for UNIX machines to the Usenet. @@ -5530,15 +5537,8 @@ Richard Addison, Mike Passaretti, and Olaf Seibert, developed NetHack 3.1 for the Amiga. - Norm Meluch and Kevin Smolkowski, with help from Carl Sche- - lin, Stephen Spackman, Steve VanDevender, and Paul Winner, ported - NetHack 3.1 to the PC. - Jon W{tte and Hao-yang Wang, with help from Ross Brown, Mike - Engber, David Hairston, Michael Hamel, Jonathan Handler, Johnny - - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -5548,6 +5548,12 @@ + Norm Meluch and Kevin Smolkowski, with help from Carl Sche- + lin, Stephen Spackman, Steve VanDevender, and Paul Winner, ported + NetHack 3.1 to the PC. + + Jon W{tte and Hao-yang Wang, with help from Ross Brown, Mike + Engber, David Hairston, Michael Hamel, Jonathan Handler, Johnny Lee, Tim Lennan, Rob Menke, and Andy Swanson, developed NetHack 3.1 for the Macintosh, porting it for MPW. Building on their de- velopment, Barton House added a Think C port. @@ -5596,15 +5602,9 @@ The final update to 3.2 was the bug fix release 3.2.3, which was released simultaneously with 3.3.0 in December 1999 just in - time for the Year 2000. - - The 3.3 development team, consisting of Michael Allison, Ken - Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, - Timo Hakulinen, Kevin Hugo, Steve Linhart, Ken Lorber, Dean - Luick, Pat Rankin, Eric Smith, Mike Stephenson, Janet Walz, and - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -5614,6 +5614,12 @@ + time for the Year 2000. + + The 3.3 development team, consisting of Michael Allison, Ken + Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, + Timo Hakulinen, Kevin Hugo, Steve Linhart, Ken Lorber, Dean + Luick, Pat Rankin, Eric Smith, Mike Stephenson, Janet Walz, and Paul Winner, released 3.3.0 in December 1999 and 3.3.1 in August of 2000. @@ -5663,14 +5669,8 @@ the Amiga port of 3.4 after Janne Salmijarvi resurrected it for 3.3.1. - Christian "Marvin" Bressler maintained 3.4 for the Atari af- - ter he resurrected it for 3.3.1. - The release of NetHack 3.4.3 in December 2003 marked the be- - ginning of a long release hiatus. 3.4.3 proved to be a remarkably - - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -5680,6 +5680,11 @@ + Christian "Marvin" Bressler maintained 3.4 for the Atari af- + ter he resurrected it for 3.3.1. + + The release of NetHack 3.4.3 in December 2003 marked the be- + ginning of a long release hiatus. 3.4.3 proved to be a remarkably stable version that provided continued enjoyment by the community for more than a decade. The devteam slowly and quietly continued to work on the game behind the scenes during the tenure of 3.4.3. @@ -5729,14 +5734,9 @@ Mueller, Pat Rankin, Derek S. Ray, Alex Smith, Mike Stephenson, Janet Walz, and Paul Winner. - The development team, as well as Steve VanDevender and Kevin - Smolkowski, ensured that NetHack 3.6 continued to operate on var- - ious UNIX flavors and maintained the X11 interface. - - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -5746,6 +5746,10 @@ + The development team, as well as Steve VanDevender and Kevin + Smolkowski, ensured that NetHack 3.6 continued to operate on var- + ious UNIX flavors and maintained the X11 interface. + Ken Lorber, Haoyang Wang, Pat Rankin, and Dean Luick main- tained the port of NetHack 3.6 for Mac OSX. @@ -5772,37 +5776,33 @@ NetHack server at nethack.alt.org. Thanks to Keith Simpson and Andy Thomson for hardfought.org. Thanks to all those unnamed dun- geoneers who invest their time and effort into annual NetHack - tournaments such as Junethack and in days past, devnull.net (gone - for now, but not forgotten). + tournaments such as Junethack, The November NetHack Tournament + and in days past, devnull.net (gone for now, but not forgotten). - - - - - - - - - - - From time to time, some depraved individual out there in - netland sends a particularly intriguing modification to help out - with the game. The Gods of the Dungeon sometimes make note of - the names of the worst of these miscreants in this, the list of + From time to time, some depraved individual out there in + netland sends a particularly intriguing modification to help out + with the game. The Gods of the Dungeon sometimes make note of + the names of the worst of these miscreants in this, the list of Dungeoneers: - Adam Aronow J. Ali Harlow Mikko Juola - Alex Kompel Janet Walz Nathan Eady - Alex Smith Janne Salmijarvi Norm Meluch - Andreas Dorn Jean-Christophe Collet Olaf Seibert - Andy Church Jeff Bailey Pasi Kallinen - Andy Swanson Jochen Erwied Pat Rankin - Ari Huttunen John Kallen Patric Mueller - Barton House John Rupley Paul Winner - Benson I. Margulies John S. Bien Pierre Martineau - Bill Dyer Johnny Lee Ralf Brown - Boudewijn Waijers Jon W{tte Ray Chason - Bruce Cox Jonathan Handler Richard Addison - Bruce Holloway Joshua Delahunty Richard Beigel - Bruce Mewborne Keizo Yamamoto Richard P. Hughey - Carl Schelin Ken Arnold Rob Menke - Chris Russo Ken Arromdee Robin Bandy - David Cohrs Ken Lorber Robin Johnson + Adam Aronow Janet Walz Nathan Eady + Alex Kompel Janne Salmijarvi Norm Meluch + Alex Smith Jean-Christophe Collet Olaf Seibert + Andreas Dorn Jeff Bailey Pasi Kallinen + Andy Church Jochen Erwied Pat Rankin + Andy Swanson John Kallen Patric Mueller + Ari Huttunen John Rupley Paul Winner + Barton House John S. Bien Pierre Martineau + Benson I. Margulies Johnny Lee Ralf Brown + Bill Dyer Jon W{tte Ray Chason + Boudewijn Waijers Jonathan Handler Richard Addison + Bruce Cox Joshua Delahunty Richard Beigel + Bruce Holloway Karl Garrison Richard P. Hughey - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 @@ -5812,31 +5812,36 @@ - David Damerell Ken Washikita Roderick Schertler - David Gentzel Kevin Darcy Roland McGrath - David Hairston Kevin Hugo Ron Van Iwaarden - Dean Luick Kevin Sitze Ronnen Miller - Del Lamb Kevin Smolkowski Ross Brown - Derek S. Ray Kevin Sweet Sascha Wostmann - Deron Meranda Lars Huttar Scott Bigham - Dion Nicolaas Leon Arnott Scott R. Turner - Dylan O'Donnell M. Drew Streib Sean Hunt - Eric Backus Malcolm Ryan Stephen Spackman - Eric Hendrickson Mark Gooderum Stefan Thielscher - Eric R. Smith Mark Modrall Stephen White - Eric S. Raymond Marvin Bressler Steve Creps - Erik Andersen Matthew Day Steve Linhart - Frederick Roeber Merlyn LeRoy Steve VanDevender - Gil Neiger Michael Allison Teemu Suikki - Greg Laskin Michael Feir Tim Lennan - Greg Olson Michael Hamel Timo Hakulinen - Gregg Wonderly Michael Sokolov Tom Almy - Hao-yang Wang Mike Engber Tom West - Helge Hafting Mike Gallop Warren Cheung - Irina Rempt-Drijfhout Mike Passaretti Warwick Allison - Izchak Miller Mike Stephenson Yitzhak Sapir + Bruce Mewborne Keizo Yamamoto Rob Menke + Carl Schelin Ken Arnold Robin Bandy + Chris Russo Ken Arromdee Robin Johnson + David Cohrs Ken Lorber Roderick Schertler + David Damerell Ken Washikita Roland McGrath + David Gentzel Kevin Darcy Ron Van Iwaarden + David Hairston Kevin Hugo Ronnen Miller + Dean Luick Kevin Sitze Ross Brown + Del Lamb Kevin Smolkowski Sascha Wostmann + Derek S. Ray Kevin Sweet Scott Bigham + Deron Meranda Lars Huttar Scott R. Turner + Dion Nicolaas Leon Arnott Sean Hunt + Dylan O'Donnell M. Drew Streib Stephen Spackman + Eric Backus Malcolm Ryan Stefan Thielscher + Eric Hendrickson Mark Gooderum Stephen White + Eric R. Smith Mark Modrall Steve Creps + Eric S. Raymond Marvin Bressler Steve Linhart + Erik Andersen Matthew Day Steve VanDevender + Frederick Roeber Merlyn LeRoy Teemu Suikki + Gil Neiger Michael Allison Tim Lennan + Greg Laskin Michael Feir Timo Hakulinen + Greg Olson Michael Hamel Tom Almy + Gregg Wonderly Michael Sokolov Tom West + Hao-yang Wang Mike Engber Warren Cheung + Helge Hafting Mike Gallop Warwick Allison + Irina Rempt-Drijfhout Mike Passaretti Yitzhak Sapir + Izchak Miller Mike Stephenson + J. Ali Harlow Mikko Juola - Brand and product names are trademarks or registered trade- + Brand and product names are trademarks or registered trade- marks of their respective holders. @@ -5863,12 +5868,7 @@ - - - - - - NetHack 3.6 October 16, 2018 + NetHack 3.6 December 15, 2018 From b2b5a7a257df04cbe9734d4db811a2a57da95202 Mon Sep 17 00:00:00 2001 From: nhw_cron Date: Tue, 1 Jan 2019 17:19:19 -0500 Subject: [PATCH 3/4] This is cron-daily v1-Dec-30-2019. files updated: Files --- Files | 129 +++++++++++++++++++++++++++++++++------------------------- 1 file changed, 73 insertions(+), 56 deletions(-) diff --git a/Files b/Files index 62ac59fac..d11fc53a7 100644 --- a/Files +++ b/Files @@ -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 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 @@ -7,7 +8,7 @@ from or not transferred to your system if you wish. .: (files in top directory) -.clang-format Files Porting README +.clang-format .travis.yml Files Porting README DEVEL: (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 tcap.h tileset.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 +wceconf.h winami.h wincurs.h winprocs.h wintype.h +you.h youprop.h (file for tty versions) wintty.h @@ -163,7 +164,7 @@ random.c (Berkeley uudecode file, which may be used in build process of any version) 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 (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) 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 (files for UNIX and Be versions) @@ -208,9 +209,9 @@ sys/unix: (files for UNIX versions) Install.unx Makefile.dat Makefile.doc Makefile.src Makefile.top Makefile.utl NewInstall.unx README.linux -depend.awk gitinfo.sh mkmkfile.sh nethack.sh -setup.sh sysconf unixmain.c unixres.c -unixunix.c +README.xcode XCode.xcconfig depend.awk gitinfo.sh +mkmkfile.sh nethack.sh 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 @@ -218,12 +219,28 @@ cpp1.shr cpp2.shr cpp3.shr (file for sound driver for 386 UNIX) 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: (files for configuring UNIX NetHack versions) -linux linux-chroot linux-qt4 linux-qt5 -linux-x11 macosx macosx.sh macosx10.5 -macosx10.7 macosx10.8 macosx10.10 macosx10.10-qt -unix +linux linux-chroot linux-minimal linux-qt4 +linux-qt5 linux-x11 macosx macosx.sh +macosx10.5 macosx10.7 macosx10.8 macosx10.10 +macosx10.10-qt macosx10.14 unix sys/vms: (files for VMS version) @@ -255,10 +272,12 @@ stat.h sys/winnt: (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 -sysconf win10.c win10.h win32api.h winnt.c +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 stub-pdcscrn.c stubs.c +sysconf win10.c win10.h win32api.h +windmain.c winnt.c winos.h util: (files for all versions) @@ -301,6 +320,12 @@ win/chain: (files for stacking window systems) 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: (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 @@ -323,8 +348,9 @@ NetHackTerm.applescript recover.pl win/share: (files for versions using optional tiles) bmptiles.c gifread.c giftiles.c monsters.txt objects.txt -other.txt ppmwrite.c renumtiles.pl thintile.c tile.doc -tile.h tile2bmp.c tilemap.c tileset.c tiletext.c +other.txt ppmwrite.c renumtiles.pl safeproc.c thintile.c +tile.doc tile.h tile2bmp.c tilemap.c tileset.c +tiletext.c win/tty: (files for tty versions) @@ -332,47 +358,38 @@ getline.c termcap.c topl.c wintty.c win/win32: (files for Windows versions - tested up to Windows 10) -dgnstuff.mak levstuff.mak mhaskyn.c mhaskyn.h mhdlg.c -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 mhsplash.c mhsplash.h mhstatus.c mhstatus.h -mhtext.c mhtext.h mnsel.uu mnselcnt.uu mnunsel.uu -mswproc.c nethack.rc nhresource.h petmark.uu pilemark.uu -record.uu resource.h rip.uu splash.uu tiles.mak -winMS.h winhack.c winhack.rc - -win/win32/vs2015: -(files for Windows versions - tested up to Windows 10) -NetHack.sln NetHack.vcxproj NetHackW.vcxproj -afterdgncomp.proj afterdlb.proj afterlevcomp.proj -aftermakedefs.proj afternethack.proj afterrecover.proj -aftertile2bmp.proj aftertilemap.proj afteruudecode.proj -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 +NetHackW.exe.manifest dgnstuff-mingw32.mak dgnstuff.mak +levstuff-mingw32.mak levstuff.mak mhaskyn.c +mhaskyn.h mhdlg.c 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 +mhsplash.c mhsplash.h mhstatus.c +mhstatus.h mhtext.c mhtext.h +mnsel.uu mnselcnt.uu mnunsel.uu +mswproc.c nethack.rc nhresource.h +petmark.uu pilemark.uu record.uu +resource.h rip.uu splash.uu +tiles-mingw32.mak tiles.mak winMS.h +winhack.c winhack.rc win/win32/vs2017: (files for Visual Studio 2017 Community Edition builds) -NetHack.sln NetHack.vcxproj NetHackW.exe.manifest -NetHackW.vcxproj afterdgncomp.proj afterdlb.proj -afterlevcomp.proj aftermakedefs.proj afternethack.proj -afterrecover.proj aftertile2bmp.proj aftertilemap.proj -afteruudecode.proj 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 recover.vcxproj -tile2bmp.vcxproj tilemap.vcxproj tiles.vcxproj -uudecode.vcxproj +NetHack.sln NetHack.vcxproj NetHackW.vcxproj +PDCurses.vcxproj afterdgncomp.proj afterdlb.proj +afterlevcomp.proj aftermakedefs.proj afternethack.proj +afterrecover.proj aftertile2bmp.proj aftertilemap.proj +afteruudecode.proj build.bat common.props +config.props console.props default.props +default_dll.props default_lib.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 +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. From 94aecd5ca0847e28b59b13f0d5d417449edb5742 Mon Sep 17 00:00:00 2001 From: nhw_cron Date: Tue, 1 Jan 2019 17:19:21 -0500 Subject: [PATCH 4/4] This is cron-daily v1-Dec-30-2019. levcomp updated: sys/share/lev_comp.h sys/share/lev_yacc.c --- sys/share/lev_comp.h | 7 + sys/share/lev_yacc.c | 1984 ++++++++++++++++++++++++++---------------- 2 files changed, 1220 insertions(+), 771 deletions(-) diff --git a/sys/share/lev_comp.h b/sys/share/lev_comp.h index 1e3f16fa4..2f4ae4d13 100644 --- a/sys/share/lev_comp.h +++ b/sys/share/lev_comp.h @@ -172,6 +172,12 @@ #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; @@ -209,4 +215,5 @@ typedef union char *varstr; } meth; } YYSTYPE; +#endif /* !YYSTYPE_IS_DECLARED */ extern YYSTYPE yylval; diff --git a/sys/share/lev_yacc.c b/sys/share/lev_yacc.c index 3742bd990..812aa48b1 100644 --- a/sys/share/lev_yacc.c +++ b/sys/share/lev_yacc.c @@ -1,17 +1,26 @@ -#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 +/* 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) */ + #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 -#define YYSUBMINOR "0-nh" +#define YYSUBMINOR "0-nh2" +#define YYPATCH 20160324 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) +#define YYENOMEM (-2) +#define YYEOF 0 #define YYPREFIX "yy" -/* NetHack 3.6 lev_comp.y $NHDT-Date: 1543372951 2018/11/28 02:42:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.23 $ */ + +#define YYPURE 0 + +#line 2 "util/lev_comp.y" +/* NetHack 3.6 lev_comp.y $NHDT-Date: 1543371691 2018/11/28 02:21:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.22 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -157,6 +166,13 @@ extern const char *fname; extern char curr_token[512]; +#line 150 "util/lev_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 { long i; @@ -194,6 +210,43 @@ typedef union char *varstr; } meth; } YYSTYPE; +#endif /* !YYSTYPE_IS_DECLARED */ +#line 215 "" + +/* 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 CHAR 257 #define INTEGER 258 #define BOOLEAN 259 @@ -369,7 +422,8 @@ typedef union #define METHOD_SEL_ARRAY 429 #define DICE 430 #define YYERRCODE 256 -short yylhs[] = { -1, +typedef short YYINT; + YYINT 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, @@ -412,7 +466,7 @@ short yylhs[] = { -1, 153, 153, 153, 153, 51, 51, 52, 52, 53, 53, 25, 25, 67, 67, 66, }; -short yylen[] = { 2, + YYINT 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, @@ -455,7 +509,7 @@ short yylen[] = { 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 9, }; -short yydefred[] = { 0, + YYINT 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, @@ -544,7 +598,7 @@ short yydefred[] = { 0, 171, 142, 0, 0, 0, 0, 20, 21, 0, 0, 0, 13, 17, 381, }; -short yydgoto[] = { 3, + YYINT 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, @@ -562,7 +616,7 @@ short yydgoto[] = { 3, 521, 319, 401, 295, 517, 272, 800, 841, 230, 359, 220, 355, 580, 790, 196, 182, 530, 531, }; -short yysindex[] = { 68, + YYINT 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, @@ -651,7 +705,7 @@ short yysindex[] = { 68, 0, 0, 1024, 109, -149, 1026, 0, 0, 876, 109, 1028, 0, 0, 0, }; -short yyrindex[] = { 1071, + YYINT 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, @@ -740,7 +794,7 @@ short yyrindex[] = { 1071, 0, 0, 0, 0, 0, 1043, 0, 0, 4715, 0, 0, 0, 0, 0, }; -short yygindex[] = { 0, + YYINT 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, @@ -759,7 +813,7 @@ short yygindex[] = { 0, 975, 0, 0, 0, 792, 680, 504, 0, }; #define YYTABLESIZE 6091 -short yytable[] = { 186, + YYINT 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, @@ -1371,7 +1425,7 @@ short yytable[] = { 186, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, }; -short yycheck[] = { 86, + YYINT 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, @@ -1988,8 +2042,11 @@ short yycheck[] = { 86, #define YYDEBUG 0 #endif #define YYMAXTOKEN 430 +#define YYUNDFTOKEN 591 +#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, @@ -2031,9 +2088,13 @@ char *yyname[] = { "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", +"METHOD_SEL","METHOD_SEL_ARRAY","DICE",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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", "file :", "file : levels", @@ -2440,43 +2501,118 @@ char *yyrule[] = { "lev_region : region", "lev_region : LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'", "region : '(' INTEGER ',' INTEGER ',' 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 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -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 + +#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 2720 "util/lev_comp.y" /*lev_comp.y*/ -#define YYABORT goto yyabort +#line 2545 "" + +#if YYDEBUG +#include /* needed for printf */ +#endif + +#if YYNHXFLAG +extern char *getenv(); +#define CONST +#else +#include /* needed for malloc, etc */ +#include /* 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 YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab +#define YYERROR goto yyerrlab + int -yyparse() +YYPARSE_DECL() { - register int yym, yyn, yystate; + int yym, yyn, yystate; #if YYDEBUG - register char *yys; - extern char *getenv(); + CONST char *yys; if ((yys = getenv("YYDEBUG")) != 0) { @@ -2488,23 +2624,28 @@ yyparse() yynerrs = 0; yyerrflag = 0; - yychar = (-1); + yychar = YYEMPTY; + yystate = 0; - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; +#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; yyloop: if ((yyn = yydefred[yystate]) != 0) goto yyreduce; if (yychar < 0) { - if ((yychar = yylex()) < 0) yychar = 0; + if ((yychar = YYLEX) < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -2518,13 +2659,14 @@ yyloop: printf("%sdebug: state %d, shifting to state %d\n", YYPREFIX, yystate, yytable[yyn]); #endif - if (yyssp >= yyss + yystacksize - 1) + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); + yystate = yytable[yyn]; + *++yystack.s_mark = yytable[yyn]; + *++yystack.l_mark = yylval; + yychar = YYEMPTY; if (yyerrflag > 0) --yyerrflag; goto yyloop; } @@ -2535,32 +2677,35 @@ yyloop: goto yyreduce; } if (yyerrflag) goto yyinrecovery; - goto yynewerror; -yynewerror: - yyerror("syntax error"); + + YYERROR_CALL("syntax error"); + goto yyerrlab; + yyerrlab: ++yynerrs; + yyinrecovery: if (yyerrflag < 3) { yyerrflag = 3; for (;;) { - if ((yyn = yysindex[*yyssp]) != 0 && (yyn += YYERRCODE) >= 0 && + if ((yyn = yysindex[*yystack.s_mark]) != 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]); + to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); #endif - if (yyssp >= yyss + yystacksize - 1) + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; + yystate = yytable[yyn]; + *++yystack.s_mark = yytable[yyn]; + *++yystack.l_mark = yylval; goto yyloop; } else @@ -2568,30 +2713,29 @@ yyinrecovery: #if YYDEBUG if (yydebug) printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); + YYPREFIX, *yystack.s_mark); #endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; + if (yystack.s_mark <= yystack.s_base) goto yyabort; + --yystack.s_mark; + --yystack.l_mark; } } } else { - if (yychar == 0) goto yyabort; + if (yychar == YYEOF) goto yyabort; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif - yychar = (-1); + yychar = YYEMPTY; goto yyloop; } + yyreduce: #if YYDEBUG if (yydebug) @@ -2599,25 +2743,29 @@ yyreduce: YYPREFIX, yystate, yyn, yyrule[yyn]); #endif yym = yylen[yyn]; - yyval = yyvsp[1-yym]; + if (yym) + yyval = yystack.l_mark[1-yym]; + else + memset(&yyval, 0, sizeof yyval); switch (yyn) { case 5: -{ +#line 290 "util/lev_comp.y" + { 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, yystack.l_mark[-2].map); fatal_error = 0; got_errors++; } else if (!got_errors) { - if (!write_level_file(yyvsp[-2].map, splev)) { + if (!write_level_file(yystack.l_mark[-2].map, splev)) { lc_error("Can't write output file for '%s'!", - yyvsp[-2].map); + yystack.l_mark[-2].map); exit(EXIT_FAILURE); } } - Free(yyvsp[-2].map); + Free(yystack.l_mark[-2].map); Free(splev); splev = NULL; vardef_free_all(vardefs); @@ -2625,20 +2773,22 @@ case 5: } break; case 6: -{ - start_level_def(&splev, yyvsp[0].map); - yyval.map = yyvsp[0].map; +#line 313 "util/lev_comp.y" + { + start_level_def(&splev, yystack.l_mark[0].map); + yyval.map = yystack.l_mark[0].map; } break; case 7: -{ - start_level_def(&splev, yyvsp[-2].map); - if (yyvsp[0].i == -1) { +#line 318 "util/lev_comp.y" + { + start_level_def(&splev, yystack.l_mark[-2].map); + if (yystack.l_mark[0].i == -1) { add_opvars(splev, "iiiiiiiio", VA_PASS9(LVLINIT_MAZEGRID, HWALL, 0,0, 0,0,0,0, SPO_INITLEVEL)); } else { - int bg = (int) what_map_char((char) yyvsp[0].i); + int bg = (int) what_map_char((char) yystack.l_mark[0].i); add_opvars(splev, "iiiiiiiio", VA_PASS9(LVLINIT_SOLIDFILL, bg, 0,0, @@ -2648,36 +2798,40 @@ case 7: VA_PASS2(MAZELEVEL, SPO_LEVEL_FLAGS)); max_x_map = COLNO-1; max_y_map = ROWNO; - yyval.map = yyvsp[-2].map; + yyval.map = yystack.l_mark[-2].map; } break; case 8: -{ +#line 340 "util/lev_comp.y" + { yyval.i = -1; } break; case 9: -{ - yyval.i = what_map_char((char) yyvsp[0].i); +#line 344 "util/lev_comp.y" + { + yyval.i = what_map_char((char) yystack.l_mark[0].i); } break; case 10: -{ - int filling = (int) yyvsp[0].terr.ter; +#line 350 "util/lev_comp.y" + { + int filling = (int) yystack.l_mark[0].terr.ter; if (filling == INVALID_TYPE || filling >= MAX_TYPE) lc_error("INIT_MAP: Invalid fill char type."); add_opvars(splev, "iiiiiiiio", VA_PASS9(LVLINIT_SOLIDFILL, filling, - 0, (int) yyvsp[0].terr.lit, + 0, (int) yystack.l_mark[0].terr.lit, 0,0,0,0, SPO_INITLEVEL)); max_x_map = COLNO-1; max_y_map = ROWNO; } break; case 11: -{ - int filling = (int) what_map_char((char) yyvsp[0].i); +#line 363 "util/lev_comp.y" + { + int filling = (int) what_map_char((char) yystack.l_mark[0].i); if (filling == INVALID_TYPE || filling >= MAX_TYPE) lc_error("INIT_MAP: Invalid fill char type."); @@ -2689,21 +2843,23 @@ case 11: } break; case 12: -{ +#line 375 "util/lev_comp.y" + { add_opvars(splev, "iiiiiiiio", VA_PASS9(LVLINIT_ROGUE,0,0,0, 0,0,0,0, SPO_INITLEVEL)); } break; case 13: -{ - int fg = (int) what_map_char((char) yyvsp[-11].i), - bg = (int) what_map_char((char) yyvsp[-9].i); - int smoothed = (int) yyvsp[-7].i, - joined = (int) yyvsp[-5].i, - lit = (int) yyvsp[-3].i, - walled = (int) yyvsp[-1].i, - filling = (int) yyvsp[0].i; +#line 381 "util/lev_comp.y" + { + int fg = (int) what_map_char((char) yystack.l_mark[-11].i), + bg = (int) what_map_char((char) yystack.l_mark[-9].i); + int smoothed = (int) yystack.l_mark[-7].i, + joined = (int) yystack.l_mark[-5].i, + lit = (int) yystack.l_mark[-3].i, + walled = (int) yystack.l_mark[-1].i, + filling = (int) yystack.l_mark[0].i; if (fg == INVALID_TYPE || fg >= MAX_TYPE) lc_error("INIT_MAP: Invalid foreground type."); @@ -2724,328 +2880,374 @@ case 13: } break; case 14: -{ +#line 410 "util/lev_comp.y" + { yyval.i = 0; } break; case 15: -{ - yyval.i = yyvsp[0].i; +#line 414 "util/lev_comp.y" + { + yyval.i = yystack.l_mark[0].i; } break; case 16: -{ +#line 420 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_COPY)); yyval.i = 0; } break; case 17: -{ +#line 425 "util/lev_comp.y" + { yyval.i = 1; } break; case 18: -{ +#line 431 "util/lev_comp.y" + { yyval.i = -1; } break; case 19: -{ - yyval.i = what_map_char((char) yyvsp[0].i); +#line 435 "util/lev_comp.y" + { + yyval.i = what_map_char((char) yystack.l_mark[0].i); } break; case 22: -{ +#line 446 "util/lev_comp.y" + { add_opvars(splev, "io", VA_PASS2(0, SPO_LEVEL_FLAGS)); } break; case 23: -{ +#line 450 "util/lev_comp.y" + { add_opvars(splev, "io", - VA_PASS2((int) yyvsp[0].i, SPO_LEVEL_FLAGS)); + VA_PASS2((int) yystack.l_mark[0].i, SPO_LEVEL_FLAGS)); } break; case 24: -{ - yyval.i = (yyvsp[-2].i | yyvsp[0].i); +#line 457 "util/lev_comp.y" + { + yyval.i = (yystack.l_mark[-2].i | yystack.l_mark[0].i); } break; case 25: -{ - yyval.i = yyvsp[0].i; +#line 461 "util/lev_comp.y" + { + yyval.i = yystack.l_mark[0].i; } break; case 26: -{ +#line 467 "util/lev_comp.y" + { yyval.i = 0; } break; case 27: -{ - yyval.i = 1 + yyvsp[0].i; +#line 471 "util/lev_comp.y" + { + yyval.i = 1 + yystack.l_mark[0].i; } break; case 28: -{ - yyval.i = yyvsp[-1].i; +#line 477 "util/lev_comp.y" + { + yyval.i = yystack.l_mark[-1].i; } break; case 96: -{ +#line 560 "util/lev_comp.y" + { struct lc_vardefs *vd; - if ((vd = vardef_defined(vardefs, yyvsp[0].map, 1))) { + if ((vd = vardef_defined(vardefs, yystack.l_mark[0].map, 1))) { if (!(vd->var_type & SPOVAR_ARRAY)) lc_error("Trying to shuffle non-array variable '%s'", - yyvsp[0].map); + yystack.l_mark[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); + yystack.l_mark[0].map); + add_opvars(splev, "so", VA_PASS2(yystack.l_mark[0].map, SPO_SHUFFLE_ARRAY)); + Free(yystack.l_mark[0].map); } break; case 97: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-2].map, SPOVAR_INT); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT)); - Free(yyvsp[-2].map); +#line 576 "util/lev_comp.y" + { + vardefs = add_vardef_type(vardefs, yystack.l_mark[-2].map, SPOVAR_INT); + add_opvars(splev, "iso", VA_PASS3(0, yystack.l_mark[-2].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-2].map); } break; case 98: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_SEL); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); - Free(yyvsp[-4].map); +#line 582 "util/lev_comp.y" + { + vardefs = add_vardef_type(vardefs, yystack.l_mark[-4].map, SPOVAR_SEL); + add_opvars(splev, "iso", VA_PASS3(0, yystack.l_mark[-4].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-4].map); } break; case 99: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-2].map, SPOVAR_STRING); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT)); - Free(yyvsp[-2].map); +#line 588 "util/lev_comp.y" + { + vardefs = add_vardef_type(vardefs, yystack.l_mark[-2].map, SPOVAR_STRING); + add_opvars(splev, "iso", VA_PASS3(0, yystack.l_mark[-2].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-2].map); } break; case 100: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_MAPCHAR); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); - Free(yyvsp[-4].map); +#line 594 "util/lev_comp.y" + { + vardefs = add_vardef_type(vardefs, yystack.l_mark[-4].map, SPOVAR_MAPCHAR); + add_opvars(splev, "iso", VA_PASS3(0, yystack.l_mark[-4].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-4].map); } break; case 101: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_MONST); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); - Free(yyvsp[-4].map); +#line 600 "util/lev_comp.y" + { + vardefs = add_vardef_type(vardefs, yystack.l_mark[-4].map, SPOVAR_MONST); + add_opvars(splev, "iso", VA_PASS3(0, yystack.l_mark[-4].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-4].map); } break; case 102: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_OBJ); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); - Free(yyvsp[-4].map); +#line 606 "util/lev_comp.y" + { + vardefs = add_vardef_type(vardefs, yystack.l_mark[-4].map, SPOVAR_OBJ); + add_opvars(splev, "iso", VA_PASS3(0, yystack.l_mark[-4].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-4].map); } break; case 103: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-2].map, SPOVAR_COORD); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT)); - Free(yyvsp[-2].map); +#line 612 "util/lev_comp.y" + { + vardefs = add_vardef_type(vardefs, yystack.l_mark[-2].map, SPOVAR_COORD); + add_opvars(splev, "iso", VA_PASS3(0, yystack.l_mark[-2].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-2].map); } break; case 104: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-2].map, SPOVAR_REGION); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT)); - Free(yyvsp[-2].map); +#line 618 "util/lev_comp.y" + { + vardefs = add_vardef_type(vardefs, yystack.l_mark[-2].map, SPOVAR_REGION); + add_opvars(splev, "iso", VA_PASS3(0, yystack.l_mark[-2].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-2].map); } break; case 105: -{ - int n_items = (int) yyvsp[-1].i; +#line 624 "util/lev_comp.y" + { + int n_items = (int) yystack.l_mark[-1].i; - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, + vardefs = add_vardef_type(vardefs, yystack.l_mark[-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, yystack.l_mark[-4].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-4].map); } break; case 106: -{ - int n_items = (int) yyvsp[-1].i; +#line 634 "util/lev_comp.y" + { + int n_items = (int) yystack.l_mark[-1].i; - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, + vardefs = add_vardef_type(vardefs, yystack.l_mark[-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, yystack.l_mark[-4].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-4].map); } break; case 107: -{ - int n_items = (int) yyvsp[-1].i; +#line 644 "util/lev_comp.y" + { + int n_items = (int) yystack.l_mark[-1].i; - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, + vardefs = add_vardef_type(vardefs, yystack.l_mark[-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, yystack.l_mark[-4].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-4].map); } break; case 108: -{ - int n_items = (int) yyvsp[-1].i; +#line 654 "util/lev_comp.y" + { + int n_items = (int) yystack.l_mark[-1].i; - vardefs = add_vardef_type(vardefs, yyvsp[-6].map, + vardefs = add_vardef_type(vardefs, yystack.l_mark[-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, yystack.l_mark[-6].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-6].map); } break; case 109: -{ - int n_items = (int) yyvsp[-1].i; +#line 664 "util/lev_comp.y" + { + int n_items = (int) yystack.l_mark[-1].i; - vardefs = add_vardef_type(vardefs, yyvsp[-6].map, + vardefs = add_vardef_type(vardefs, yystack.l_mark[-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, yystack.l_mark[-6].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-6].map); } break; case 110: -{ - int n_items = (int) yyvsp[-1].i; +#line 674 "util/lev_comp.y" + { + int n_items = (int) yystack.l_mark[-1].i; - vardefs = add_vardef_type(vardefs, yyvsp[-6].map, + vardefs = add_vardef_type(vardefs, yystack.l_mark[-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, yystack.l_mark[-6].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-6].map); } break; case 111: -{ - int n_items = (int) yyvsp[-1].i; +#line 684 "util/lev_comp.y" + { + int n_items = (int) yystack.l_mark[-1].i; - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, + vardefs = add_vardef_type(vardefs, yystack.l_mark[-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, yystack.l_mark[-4].map, SPO_VAR_INIT)); + Free(yystack.l_mark[-4].map); } break; case 112: -{ - add_opvars(splev, "O", VA_PASS1(yyvsp[0].i)); +#line 696 "util/lev_comp.y" + { + add_opvars(splev, "O", VA_PASS1(yystack.l_mark[0].i)); yyval.i = 1; } break; case 113: -{ - add_opvars(splev, "O", VA_PASS1(yyvsp[0].i)); - yyval.i = 1 + yyvsp[-2].i; +#line 701 "util/lev_comp.y" + { + add_opvars(splev, "O", VA_PASS1(yystack.l_mark[0].i)); + yyval.i = 1 + yystack.l_mark[-2].i; } break; case 114: -{ - add_opvars(splev, "M", VA_PASS1(yyvsp[0].i)); +#line 708 "util/lev_comp.y" + { + add_opvars(splev, "M", VA_PASS1(yystack.l_mark[0].i)); yyval.i = 1; } break; case 115: -{ - add_opvars(splev, "M", VA_PASS1(yyvsp[0].i)); - yyval.i = 1 + yyvsp[-2].i; +#line 713 "util/lev_comp.y" + { + add_opvars(splev, "M", VA_PASS1(yystack.l_mark[0].i)); + yyval.i = 1 + yystack.l_mark[-2].i; } break; case 116: -{ - add_opvars(splev, "m", VA_PASS1(yyvsp[0].i)); +#line 720 "util/lev_comp.y" + { + add_opvars(splev, "m", VA_PASS1(yystack.l_mark[0].i)); yyval.i = 1; } break; case 117: -{ - add_opvars(splev, "m", VA_PASS1(yyvsp[0].i)); - yyval.i = 1 + yyvsp[-2].i; +#line 725 "util/lev_comp.y" + { + add_opvars(splev, "m", VA_PASS1(yystack.l_mark[0].i)); + yyval.i = 1 + yystack.l_mark[-2].i; } break; case 118: -{ +#line 732 "util/lev_comp.y" + { yyval.i = 1; } break; case 119: -{ - yyval.i = 1 + yyvsp[-2].i; +#line 736 "util/lev_comp.y" + { + yyval.i = 1 + yystack.l_mark[-2].i; } break; case 120: -{ - add_opvars(splev, "c", VA_PASS1(yyvsp[0].i)); +#line 742 "util/lev_comp.y" + { + add_opvars(splev, "c", VA_PASS1(yystack.l_mark[0].i)); yyval.i = 1; } break; case 121: -{ - add_opvars(splev, "c", VA_PASS1(yyvsp[0].i)); - yyval.i = 1 + yyvsp[-2].i; +#line 747 "util/lev_comp.y" + { + add_opvars(splev, "c", VA_PASS1(yystack.l_mark[0].i)); + yyval.i = 1 + yystack.l_mark[-2].i; } break; case 122: -{ +#line 754 "util/lev_comp.y" + { yyval.i = 1; } break; case 123: -{ - yyval.i = 1 + yyvsp[-2].i; +#line 758 "util/lev_comp.y" + { + yyval.i = 1 + yystack.l_mark[-2].i; } break; case 124: -{ +#line 764 "util/lev_comp.y" + { yyval.i = 1; } break; case 125: -{ - yyval.i = 1 + yyvsp[-2].i; +#line 768 "util/lev_comp.y" + { + yyval.i = 1 + yystack.l_mark[-2].i; } break; case 126: -{ +#line 774 "util/lev_comp.y" + { 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).", yystack.l_mark[-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, yystack.l_mark[-1].map, 1)) + lc_error("Function '%s' already defined once.", yystack.l_mark[-1].map); - funcdef = funcdef_new(-1, yyvsp[-1].map); + funcdef = funcdef_new(-1, yystack.l_mark[-1].map); funcdef->next = function_definitions; function_definitions = funcdef; function_splev_backup = splev; splev = &(funcdef->code); - Free(yyvsp[-1].map); + Free(yystack.l_mark[-1].map); curr_function = funcdef; function_tmp_var_defs = vardefs; vardefs = NULL; } break; case 127: -{ +#line 796 "util/lev_comp.y" + { /* nothing */ } break; case 128: -{ +#line 800 "util/lev_comp.y" + { add_opvars(splev, "io", VA_PASS2(0, SPO_RETURN)); splev = function_splev_backup; in_function_definition--; @@ -3055,24 +3257,25 @@ case 128: } break; case 129: -{ +#line 811 "util/lev_comp.y" + { struct lc_funcdefs *tmpfunc; - tmpfunc = funcdef_defined(function_definitions, yyvsp[-3].map, 1); + tmpfunc = funcdef_defined(function_definitions, yystack.l_mark[-3].map, 1); if (tmpfunc) { int l; - int nparams = (int) strlen(yyvsp[-1].map); + int nparams = (int) strlen(yystack.l_mark[-1].map); char *fparamstr = funcdef_paramtypes(tmpfunc); - if (strcmp(yyvsp[-1].map, fparamstr)) { + if (strcmp(yystack.l_mark[-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)); + yystack.l_mark[-3].map, tmps, decode_parm_str(yystack.l_mark[-1].map)); Free(tmps); } Free(fparamstr); - Free(yyvsp[-1].map); + Free(yystack.l_mark[-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); @@ -3103,53 +3306,61 @@ case 129: 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.", yystack.l_mark[-3].map); } - Free(yyvsp[-3].map); + Free(yystack.l_mark[-3].map); } break; case 130: -{ +#line 866 "util/lev_comp.y" + { add_opcode(splev, SPO_EXIT, NULL); } break; case 131: -{ +#line 872 "util/lev_comp.y" + { yyval.i = 100; } break; case 132: -{ - yyval.i = yyvsp[0].i; +#line 876 "util/lev_comp.y" + { + yyval.i = yystack.l_mark[0].i; } break; case 133: -{ +#line 882 "util/lev_comp.y" + { /* val > rn2(100) */ add_opvars(splev, "iio", - VA_PASS3((int) yyvsp[0].i, 100, SPO_RN2)); + VA_PASS3((int) yystack.l_mark[0].i, 100, SPO_RN2)); yyval.i = SPO_JG; } break; case 134: -{ - yyval.i = yyvsp[-2].i; +#line 889 "util/lev_comp.y" + { + yyval.i = yystack.l_mark[-2].i; } break; case 135: -{ +#line 893 "util/lev_comp.y" + { /* boolean, explicit foo != 0 */ add_opvars(splev, "i", VA_PASS1(0)); yyval.i = SPO_JNE; } break; case 136: -{ +#line 901 "util/lev_comp.y" + { is_inconstant_number = 0; } break; case 137: -{ +#line 905 "util/lev_comp.y" + { struct opvar *chkjmp; if (in_switch_statement > 0) @@ -3173,7 +3384,8 @@ case 137: } break; case 138: -{ +#line 928 "util/lev_comp.y" + { struct opvar *endjump = New(struct opvar); int i; @@ -3213,22 +3425,25 @@ case 138: } break; case 141: -{ +#line 973 "util/lev_comp.y" + { 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] = yystack.l_mark[-1].i; switch_case_list[n_switch_case_list++] = tmppush; } else lc_error("Too many cases in a switch."); } break; case 142: -{ +#line 983 "util/lev_comp.y" + { } break; case 143: -{ +#line 986 "util/lev_comp.y" + { struct opvar *tmppush = New(struct opvar); if (switch_default_case) @@ -3239,11 +3454,13 @@ case 143: } break; case 144: -{ +#line 996 "util/lev_comp.y" + { } break; case 145: -{ +#line 1001 "util/lev_comp.y" + { if (!allow_break_statements) lc_error("Cannot use BREAK outside a statement block."); else { @@ -3252,7 +3469,8 @@ case 145: } break; case 148: -{ +#line 1015 "util/lev_comp.y" + { char buf[256], buf2[256]; if (n_forloops >= MAX_NESTED_IFS) { @@ -3261,40 +3479,42 @@ case 148: } /* first, define a variable for the for-loop end value */ - Sprintf(buf, "%s end", yyvsp[-4].map); + Sprintf(buf, "%s end", yystack.l_mark[-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)); - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_INT); + vardefs = add_vardef_type(vardefs, yystack.l_mark[-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, yystack.l_mark[-4].map, SPO_VAR_INIT)); /* calculate value for the loop "step" variable */ - Sprintf(buf2, "%s step", yyvsp[-4].map); + Sprintf(buf2, "%s step", yystack.l_mark[-4].map); /* end - start */ add_opvars(splev, "vvo", - VA_PASS3(buf, yyvsp[-4].map, SPO_MATH_SUB)); + VA_PASS3(buf, yystack.l_mark[-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(yystack.l_mark[-4].map); forloop_list[n_forloops].jmp_point = splev->n_opcodes; n_forloops++; - Free(yyvsp[-4].map); + Free(yystack.l_mark[-4].map); } break; case 149: -{ +#line 1052 "util/lev_comp.y" + { /* nothing */ break_stmt_start(); } break; case 150: -{ +#line 1057 "util/lev_comp.y" + { int l; char buf[256], buf2[256]; @@ -3322,7 +3542,8 @@ case 150: } break; case 151: -{ +#line 1086 "util/lev_comp.y" + { struct opvar *tmppush = New(struct opvar); if (n_if_list >= MAX_NESTED_IFS) { @@ -3337,7 +3558,8 @@ case 151: } break; case 152: -{ +#line 1100 "util/lev_comp.y" + { struct opvar *tmppush; add_opvars(splev, "oio", VA_PASS3(SPO_COPY, 0, SPO_CMP)); @@ -3352,7 +3574,8 @@ case 152: } break; case 153: -{ +#line 1116 "util/lev_comp.y" + { struct opvar *tmppush2 = New(struct opvar); if (n_if_list >= MAX_NESTED_IFS) { @@ -3368,12 +3591,13 @@ case 153: add_opcode(splev, SPO_PUSH, tmppush2); - add_opcode(splev, reverse_jmp_opcode( yyvsp[-1].i ), NULL); + add_opcode(splev, reverse_jmp_opcode( yystack.l_mark[-1].i ), NULL); } break; case 154: -{ +#line 1136 "util/lev_comp.y" + { if (n_if_list > 0) { struct opvar *tmppush; @@ -3384,7 +3608,8 @@ case 154: } break; case 155: -{ +#line 1148 "util/lev_comp.y" + { struct opvar *tmppush2 = New(struct opvar); if (n_if_list >= MAX_NESTED_IFS) { @@ -3400,17 +3625,19 @@ case 155: add_opcode(splev, SPO_PUSH, tmppush2); - add_opcode(splev, reverse_jmp_opcode( yyvsp[0].i ), NULL); + add_opcode(splev, reverse_jmp_opcode( yystack.l_mark[0].i ), NULL); } break; case 156: -{ +#line 1168 "util/lev_comp.y" + { /* do nothing */ } break; case 157: -{ +#line 1174 "util/lev_comp.y" + { if (n_if_list > 0) { struct opvar *tmppush; @@ -3421,7 +3648,8 @@ case 157: } break; case 158: -{ +#line 1184 "util/lev_comp.y" + { if (n_if_list > 0) { struct opvar *tmppush = New(struct opvar); struct opvar *tmppush2; @@ -3440,7 +3668,8 @@ case 158: } break; case 159: -{ +#line 1202 "util/lev_comp.y" + { if (n_if_list > 0) { struct opvar *tmppush; tmppush = (struct opvar *) if_list[--n_if_list]; @@ -3449,189 +3678,216 @@ case 159: } break; case 160: -{ +#line 1212 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_MESSAGE)); } break; case 161: -{ +#line 1218 "util/lev_comp.y" + { add_opvars(splev, "iiiiiio", VA_PASS7(-1, 0, -1, -1, -1, -1, SPO_CORRIDOR)); } break; case 162: -{ +#line 1223 "util/lev_comp.y" + { add_opvars(splev, "iiiiiio", - VA_PASS7(-1, yyvsp[0].i, -1, -1, -1, -1, SPO_CORRIDOR)); + VA_PASS7(-1, yystack.l_mark[0].i, -1, -1, -1, -1, SPO_CORRIDOR)); } break; case 163: -{ +#line 1228 "util/lev_comp.y" + { add_opvars(splev, "iiiiiio", VA_PASS7(-1, -1, -1, -1, -1, -1, SPO_CORRIDOR)); } break; case 164: -{ +#line 1235 "util/lev_comp.y" + { 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(yystack.l_mark[-2].corpos.room, yystack.l_mark[-2].corpos.door, yystack.l_mark[-2].corpos.wall, + yystack.l_mark[0].corpos.room, yystack.l_mark[0].corpos.door, yystack.l_mark[0].corpos.wall, SPO_CORRIDOR)); } break; case 165: -{ +#line 1242 "util/lev_comp.y" + { 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(yystack.l_mark[-2].corpos.room, yystack.l_mark[-2].corpos.door, yystack.l_mark[-2].corpos.wall, + -1, -1, (long)yystack.l_mark[0].i, SPO_CORRIDOR)); } break; case 166: -{ - yyval.corpos.room = yyvsp[-5].i; - yyval.corpos.wall = yyvsp[-3].i; - yyval.corpos.door = yyvsp[-1].i; +#line 1251 "util/lev_comp.y" + { + yyval.corpos.room = yystack.l_mark[-5].i; + yyval.corpos.wall = yystack.l_mark[-3].i; + yyval.corpos.door = yystack.l_mark[-1].i; } break; case 167: -{ - if ((yyvsp[-2].i < 100) && (yyvsp[-3].i == OROOM)) +#line 1259 "util/lev_comp.y" + { + if ((yystack.l_mark[-2].i < 100) && (yystack.l_mark[-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)yystack.l_mark[-3].i, (long)yystack.l_mark[-2].i, (long)yystack.l_mark[0].i)); } } break; case 168: -{ - long rflags = yyvsp[0].i; +#line 1270 "util/lev_comp.y" + { + long rflags = yystack.l_mark[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, + yystack.l_mark[-3].crd.x, yystack.l_mark[-3].crd.y, yystack.l_mark[-1].sze.width, yystack.l_mark[-1].sze.height, SPO_SUBROOM)); break_stmt_start(); } break; case 169: -{ +#line 1281 "util/lev_comp.y" + { break_stmt_end(splev); add_opcode(splev, SPO_ENDROOM, NULL); } break; case 170: -{ - long rflags = yyvsp[-2].i; +#line 1288 "util/lev_comp.y" + { + long rflags = yystack.l_mark[-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)); + yystack.l_mark[-3].crd.x, yystack.l_mark[-3].crd.y, yystack.l_mark[-5].crd.x, yystack.l_mark[-5].crd.y, + yystack.l_mark[-1].sze.width, yystack.l_mark[-1].sze.height, SPO_ROOM)); break_stmt_start(); } break; case 171: -{ +#line 1299 "util/lev_comp.y" + { break_stmt_end(splev); add_opcode(splev, SPO_ENDROOM, NULL); } break; case 172: -{ +#line 1306 "util/lev_comp.y" + { yyval.i = 1; } break; case 173: -{ - yyval.i = yyvsp[0].i; +#line 1310 "util/lev_comp.y" + { + yyval.i = yystack.l_mark[0].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); +#line 1316 "util/lev_comp.y" + { + if ( yystack.l_mark[-3].i < 1 || yystack.l_mark[-3].i > 5 || + yystack.l_mark[-1].i < 1 || yystack.l_mark[-1].i > 5 ) { + lc_error("Room positions should be between 1-5: (%li,%li)!", yystack.l_mark[-3].i, yystack.l_mark[-1].i); } else { - yyval.crd.x = yyvsp[-3].i; - yyval.crd.y = yyvsp[-1].i; + yyval.crd.x = yystack.l_mark[-3].i; + yyval.crd.y = yystack.l_mark[-1].i; } } break; case 175: -{ +#line 1326 "util/lev_comp.y" + { yyval.crd.x = yyval.crd.y = ERR; } 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); +#line 1332 "util/lev_comp.y" + { + if ( yystack.l_mark[-3].i < 0 || yystack.l_mark[-1].i < 0) { + lc_error("Invalid subroom position (%li,%li)!", yystack.l_mark[-3].i, yystack.l_mark[-1].i); } else { - yyval.crd.x = yyvsp[-3].i; - yyval.crd.y = yyvsp[-1].i; + yyval.crd.x = yystack.l_mark[-3].i; + yyval.crd.y = yystack.l_mark[-1].i; } } break; case 177: -{ +#line 1341 "util/lev_comp.y" + { yyval.crd.x = yyval.crd.y = ERR; } break; case 178: -{ - yyval.crd.x = yyvsp[-3].i; - yyval.crd.y = yyvsp[-1].i; +#line 1347 "util/lev_comp.y" + { + yyval.crd.x = yystack.l_mark[-3].i; + yyval.crd.y = yystack.l_mark[-1].i; } break; case 179: -{ +#line 1352 "util/lev_comp.y" + { yyval.crd.x = yyval.crd.y = ERR; } break; case 180: -{ - yyval.sze.width = yyvsp[-3].i; - yyval.sze.height = yyvsp[-1].i; +#line 1358 "util/lev_comp.y" + { + yyval.sze.width = yystack.l_mark[-3].i; + yyval.sze.height = yystack.l_mark[-1].i; } break; case 181: -{ +#line 1363 "util/lev_comp.y" + { yyval.sze.height = yyval.sze.width = ERR; } break; case 182: -{ +#line 1369 "util/lev_comp.y" + { /* ERR means random here */ - if (yyvsp[-2].i == ERR && yyvsp[0].i != ERR) { + if (yystack.l_mark[-2].i == ERR && yystack.l_mark[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)yystack.l_mark[0].i, (long)yystack.l_mark[-4].i, (long)yystack.l_mark[-6].i, + (long)yystack.l_mark[-2].i, SPO_ROOM_DOOR)); } } break; case 183: -{ - add_opvars(splev, "io", VA_PASS2((long)yyvsp[-2].i, SPO_DOOR)); +#line 1380 "util/lev_comp.y" + { + add_opvars(splev, "io", VA_PASS2((long)yystack.l_mark[-2].i, SPO_DOOR)); } break; case 188: -{ - yyval.i = yyvsp[0].i; +#line 1394 "util/lev_comp.y" + { + yyval.i = yystack.l_mark[0].i; } break; case 189: -{ - yyval.i = (yyvsp[-2].i | yyvsp[0].i); +#line 1398 "util/lev_comp.y" + { + yyval.i = (yystack.l_mark[-2].i | yystack.l_mark[0].i); } break; case 192: -{ +#line 1408 "util/lev_comp.y" + { add_opvars(splev, "ciisiio", VA_PASS7(0, 0, 1, (char *) 0, 0, 0, SPO_MAP)); max_x_map = COLNO-1; @@ -3639,47 +3895,54 @@ case 192: } break; case 193: -{ +#line 1415 "util/lev_comp.y" + { add_opvars(splev, "cii", - VA_PASS3(SP_COORD_PACK((yyvsp[-4].i), (yyvsp[-2].i)), - 1, (int) yyvsp[-1].i)); - scan_map(yyvsp[0].map, splev); - Free(yyvsp[0].map); + VA_PASS3(SP_COORD_PACK((yystack.l_mark[-4].i), (yystack.l_mark[-2].i)), + 1, (int) yystack.l_mark[-1].i)); + scan_map(yystack.l_mark[0].map, splev); + Free(yystack.l_mark[0].map); } break; case 194: -{ - add_opvars(splev, "ii", VA_PASS2(2, (int) yyvsp[-1].i)); - scan_map(yyvsp[0].map, splev); - Free(yyvsp[0].map); +#line 1423 "util/lev_comp.y" + { + add_opvars(splev, "ii", VA_PASS2(2, (int) yystack.l_mark[-1].i)); + scan_map(yystack.l_mark[0].map, splev); + Free(yystack.l_mark[0].map); } break; case 199: -{ +#line 1439 "util/lev_comp.y" + { add_opvars(splev, "io", VA_PASS2(0, SPO_MONSTER)); } break; case 200: -{ +#line 1443 "util/lev_comp.y" + { add_opvars(splev, "io", VA_PASS2(1, SPO_MONSTER)); in_container_obj++; break_stmt_start(); } break; case 201: -{ +#line 1449 "util/lev_comp.y" + { break_stmt_end(splev); in_container_obj--; add_opvars(splev, "o", VA_PASS1(SPO_END_MONINVENT)); } break; case 202: -{ +#line 1457 "util/lev_comp.y" + { /* nothing */ } break; case 203: -{ +#line 1463 "util/lev_comp.y" + { struct opvar *stopit = New(struct opvar); set_opvar_int(stopit, SP_M_V_END); @@ -3688,142 +3951,163 @@ case 203: } break; case 204: -{ - if (( yyvsp[-2].i & yyvsp[0].i )) +#line 1471 "util/lev_comp.y" + { + if (( yystack.l_mark[-2].i & yystack.l_mark[0].i )) lc_error("MONSTER extra info defined twice."); - yyval.i = ( yyvsp[-2].i | yyvsp[0].i ); + yyval.i = ( yystack.l_mark[-2].i | yystack.l_mark[0].i ); } break; case 205: -{ +#line 1479 "util/lev_comp.y" + { add_opvars(splev, "i", VA_PASS1(SP_M_V_NAME)); yyval.i = 0x0001; } break; case 206: -{ +#line 1484 "util/lev_comp.y" + { add_opvars(splev, "ii", - VA_PASS2((int) yyvsp[0].i, SP_M_V_PEACEFUL)); + VA_PASS2((int) yystack.l_mark[0].i, SP_M_V_PEACEFUL)); yyval.i = 0x0002; } break; case 207: -{ +#line 1490 "util/lev_comp.y" + { add_opvars(splev, "ii", - VA_PASS2((int) yyvsp[0].i, SP_M_V_ASLEEP)); + VA_PASS2((int) yystack.l_mark[0].i, SP_M_V_ASLEEP)); yyval.i = 0x0004; } break; case 208: -{ +#line 1496 "util/lev_comp.y" + { add_opvars(splev, "ii", - VA_PASS2((int) yyvsp[0].i, SP_M_V_ALIGN)); + VA_PASS2((int) yystack.l_mark[0].i, SP_M_V_ALIGN)); yyval.i = 0x0008; } break; case 209: -{ +#line 1502 "util/lev_comp.y" + { add_opvars(splev, "ii", - VA_PASS2((int) yyvsp[-1].i, SP_M_V_APPEAR)); + VA_PASS2((int) yystack.l_mark[-1].i, SP_M_V_APPEAR)); yyval.i = 0x0010; } break; case 210: -{ +#line 1508 "util/lev_comp.y" + { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_FEMALE)); yyval.i = 0x0020; } break; case 211: -{ +#line 1513 "util/lev_comp.y" + { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_INVIS)); yyval.i = 0x0040; } break; case 212: -{ +#line 1518 "util/lev_comp.y" + { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_CANCELLED)); yyval.i = 0x0080; } break; case 213: -{ +#line 1523 "util/lev_comp.y" + { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_REVIVED)); yyval.i = 0x0100; } break; case 214: -{ +#line 1528 "util/lev_comp.y" + { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_AVENGE)); yyval.i = 0x0200; } break; case 215: -{ +#line 1533 "util/lev_comp.y" + { add_opvars(splev, "i", VA_PASS1(SP_M_V_FLEEING)); yyval.i = 0x0400; } break; case 216: -{ +#line 1538 "util/lev_comp.y" + { add_opvars(splev, "i", VA_PASS1(SP_M_V_BLINDED)); yyval.i = 0x0800; } break; case 217: -{ +#line 1543 "util/lev_comp.y" + { add_opvars(splev, "i", VA_PASS1(SP_M_V_PARALYZED)); yyval.i = 0x1000; } break; case 218: -{ +#line 1548 "util/lev_comp.y" + { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_STUNNED)); yyval.i = 0x2000; } break; case 219: -{ +#line 1553 "util/lev_comp.y" + { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_CONFUSED)); yyval.i = 0x4000; } break; case 220: -{ +#line 1558 "util/lev_comp.y" + { add_opvars(splev, "ii", - VA_PASS2((int) yyvsp[0].i, SP_M_V_SEENTRAPS)); + VA_PASS2((int) yystack.l_mark[0].i, SP_M_V_SEENTRAPS)); yyval.i = 0x8000; } break; case 221: -{ - int token = get_trap_type(yyvsp[0].map); +#line 1566 "util/lev_comp.y" + { + int token = get_trap_type(yystack.l_mark[0].map); if (token == ERR || token == 0) - lc_error("Unknown trap type '%s'!", yyvsp[0].map); - Free(yyvsp[0].map); + lc_error("Unknown trap type '%s'!", yystack.l_mark[0].map); + Free(yystack.l_mark[0].map); yyval.i = (1L << (token - 1)); } break; case 222: -{ +#line 1575 "util/lev_comp.y" + { yyval.i = (long) ~0; } break; case 223: -{ - int token = get_trap_type(yyvsp[-2].map); +#line 1579 "util/lev_comp.y" + { + int token = get_trap_type(yystack.l_mark[-2].map); if (token == ERR || token == 0) - lc_error("Unknown trap type '%s'!", yyvsp[-2].map); + lc_error("Unknown trap type '%s'!", yystack.l_mark[-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)) & yystack.l_mark[0].i) + lc_error("Monster seen_traps, trap '%s' listed twice.", yystack.l_mark[-2].map); + Free(yystack.l_mark[-2].map); + yyval.i = ((1L << (token - 1)) | yystack.l_mark[0].i); } break; case 224: -{ +#line 1592 "util/lev_comp.y" + { int cnt = 0; if (in_container_obj) @@ -3832,7 +4116,8 @@ case 224: } break; case 225: -{ +#line 1600 "util/lev_comp.y" + { int cnt = SP_OBJ_CONTAINER; if (in_container_obj) @@ -3843,22 +4128,25 @@ case 225: } break; case 226: -{ +#line 1610 "util/lev_comp.y" + { break_stmt_end(splev); in_container_obj--; add_opcode(splev, SPO_POP_CONTAINER, NULL); } break; case 227: -{ - if (( yyvsp[0].i & 0x4000) && in_container_obj) +#line 1618 "util/lev_comp.y" + { + if (( yystack.l_mark[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 (!( yystack.l_mark[0].i & 0x4000) && !in_container_obj) lc_error("Object needs a coord when not contained."); } break; case 228: -{ +#line 1627 "util/lev_comp.y" + { struct opvar *stopit = New(struct opvar); set_opvar_int(stopit, SP_O_V_END); add_opcode(splev, SPO_PUSH, stopit); @@ -3866,73 +4154,84 @@ case 228: } break; case 229: -{ - if (( yyvsp[-2].i & yyvsp[0].i )) +#line 1634 "util/lev_comp.y" + { + if (( yystack.l_mark[-2].i & yystack.l_mark[0].i )) lc_error("OBJECT extra info '%s' defined twice.", curr_token); - yyval.i = ( yyvsp[-2].i | yyvsp[0].i ); + yyval.i = ( yystack.l_mark[-2].i | yystack.l_mark[0].i ); } break; case 230: -{ +#line 1642 "util/lev_comp.y" + { add_opvars(splev, "ii", - VA_PASS2((int) yyvsp[0].i, SP_O_V_CURSE)); + VA_PASS2((int) yystack.l_mark[0].i, SP_O_V_CURSE)); yyval.i = 0x0001; } break; case 231: -{ +#line 1648 "util/lev_comp.y" + { add_opvars(splev, "i", VA_PASS1(SP_O_V_CORPSENM)); yyval.i = 0x0002; } break; case 232: -{ +#line 1653 "util/lev_comp.y" + { add_opvars(splev, "i", VA_PASS1(SP_O_V_SPE)); yyval.i = 0x0004; } break; case 233: -{ +#line 1658 "util/lev_comp.y" + { add_opvars(splev, "i", VA_PASS1(SP_O_V_NAME)); yyval.i = 0x0008; } break; case 234: -{ +#line 1663 "util/lev_comp.y" + { add_opvars(splev, "i", VA_PASS1(SP_O_V_QUAN)); yyval.i = 0x0010; } break; case 235: -{ +#line 1668 "util/lev_comp.y" + { add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_BURIED)); yyval.i = 0x0020; } break; case 236: -{ - add_opvars(splev, "ii", VA_PASS2((int) yyvsp[0].i, SP_O_V_LIT)); +#line 1673 "util/lev_comp.y" + { + add_opvars(splev, "ii", VA_PASS2((int) yystack.l_mark[0].i, SP_O_V_LIT)); yyval.i = 0x0040; } break; case 237: -{ +#line 1678 "util/lev_comp.y" + { add_opvars(splev, "i", VA_PASS1(SP_O_V_ERODED)); yyval.i = 0x0080; } break; case 238: -{ +#line 1683 "util/lev_comp.y" + { add_opvars(splev, "ii", VA_PASS2(-1, SP_O_V_ERODED)); yyval.i = 0x0080; } break; case 239: -{ - if (yyvsp[0].i == D_LOCKED) { +#line 1688 "util/lev_comp.y" + { + if (yystack.l_mark[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) { + } else if (yystack.l_mark[0].i == D_BROKEN) { add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_BROKEN)); yyval.i = 0x0200; } else @@ -3940,47 +4239,54 @@ case 239: } break; case 240: -{ +#line 1699 "util/lev_comp.y" + { add_opvars(splev, "ii", - VA_PASS2((int) (yyvsp[0].i), SP_O_V_TRAPPED)); + VA_PASS2((int) yystack.l_mark[0].i, SP_O_V_TRAPPED)); yyval.i = 0x0400; } break; case 241: -{ +#line 1705 "util/lev_comp.y" + { add_opvars(splev, "i", VA_PASS1(SP_O_V_RECHARGED)); yyval.i = 0x0800; } break; case 242: -{ +#line 1710 "util/lev_comp.y" + { add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_INVIS)); yyval.i = 0x1000; } break; case 243: -{ +#line 1715 "util/lev_comp.y" + { add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_GREASED)); yyval.i = 0x2000; } break; case 244: -{ +#line 1720 "util/lev_comp.y" + { add_opvars(splev, "i", VA_PASS1(SP_O_V_COORD)); yyval.i = 0x4000; } break; case 245: -{ - add_opvars(splev, "io", VA_PASS2((int) yyvsp[-2].i, SPO_TRAP)); +#line 1727 "util/lev_comp.y" + { + add_opvars(splev, "io", VA_PASS2((int) yystack.l_mark[-2].i, SPO_TRAP)); } break; case 246: -{ +#line 1733 "util/lev_comp.y" + { long dir, state = 0; /* convert dir from a DIRECTION to a DB_DIR */ - dir = yyvsp[-2].i; + dir = yystack.l_mark[-2].i; switch (dir) { case W_NORTH: dir = DB_NORTH; break; case W_SOUTH: dir = DB_SOUTH; break; @@ -3991,11 +4297,11 @@ case 246: break; } - if ( yyvsp[0].i == D_ISOPEN ) + if ( yystack.l_mark[0].i == D_ISOPEN ) state = 1; - else if ( yyvsp[0].i == D_CLOSED ) + else if ( yystack.l_mark[0].i == D_CLOSED ) state = 0; - else if ( yyvsp[0].i == -1 ) + else if ( yystack.l_mark[0].i == -1 ) state = -1; else lc_error("A drawbridge can only be open, closed or random!"); @@ -4004,662 +4310,759 @@ case 246: } break; case 247: -{ +#line 1762 "util/lev_comp.y" + { add_opvars(splev, "iiio", - VA_PASS4((int) yyvsp[0].i, 1, 0, SPO_MAZEWALK)); + VA_PASS4((int) yystack.l_mark[0].i, 1, 0, SPO_MAZEWALK)); } break; case 248: -{ +#line 1767 "util/lev_comp.y" + { add_opvars(splev, "iiio", - VA_PASS4((int) yyvsp[-3].i, (int) yyvsp[-1].i, - (int) yyvsp[0].i, SPO_MAZEWALK)); + VA_PASS4((int) yystack.l_mark[-3].i, (int) yystack.l_mark[-1].i, + (int) yystack.l_mark[0].i, SPO_MAZEWALK)); } break; case 249: -{ +#line 1775 "util/lev_comp.y" + { add_opvars(splev, "rio", VA_PASS3(SP_REGION_PACK(-1,-1,-1,-1), 0, SPO_WALLIFY)); } break; case 250: -{ +#line 1781 "util/lev_comp.y" + { add_opvars(splev, "io", VA_PASS2(1, SPO_WALLIFY)); } break; case 251: -{ +#line 1787 "util/lev_comp.y" + { add_opvars(splev, "io", - VA_PASS2((int) yyvsp[0].i, SPO_LADDER)); + VA_PASS2((int) yystack.l_mark[0].i, SPO_LADDER)); } break; case 252: -{ +#line 1794 "util/lev_comp.y" + { add_opvars(splev, "io", - VA_PASS2((int) yyvsp[0].i, SPO_STAIR)); + VA_PASS2((int) yystack.l_mark[0].i, SPO_STAIR)); } break; case 253: -{ +#line 1801 "util/lev_comp.y" + { 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(yystack.l_mark[-4].lregn.x1, yystack.l_mark[-4].lregn.y1, yystack.l_mark[-4].lregn.x2, yystack.l_mark[-4].lregn.y2, yystack.l_mark[-4].lregn.area, + yystack.l_mark[-2].lregn.x1, yystack.l_mark[-2].lregn.y1, yystack.l_mark[-2].lregn.x2, yystack.l_mark[-2].lregn.y2, yystack.l_mark[-2].lregn.area, + (long) ((yystack.l_mark[0].i) ? LR_UPSTAIR : LR_DOWNSTAIR), 0, (char *) 0, SPO_LEVREGION)); } break; case 254: -{ +#line 1811 "util/lev_comp.y" + { 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(yystack.l_mark[-4].lregn.x1, yystack.l_mark[-4].lregn.y1, yystack.l_mark[-4].lregn.x2, yystack.l_mark[-4].lregn.y2, yystack.l_mark[-4].lregn.area, + yystack.l_mark[-2].lregn.x1, yystack.l_mark[-2].lregn.y1, yystack.l_mark[-2].lregn.x2, yystack.l_mark[-2].lregn.y2, yystack.l_mark[-2].lregn.area, + LR_PORTAL, 0, yystack.l_mark[0].map, SPO_LEVREGION)); + Free(yystack.l_mark[0].map); } break; case 255: -{ +#line 1821 "util/lev_comp.y" + { long rtyp = 0; - switch(yyvsp[0].i) { + switch(yystack.l_mark[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(yystack.l_mark[-3].lregn.x1, yystack.l_mark[-3].lregn.y1, yystack.l_mark[-3].lregn.x2, yystack.l_mark[-3].lregn.y2, yystack.l_mark[-3].lregn.area, + yystack.l_mark[-1].lregn.x1, yystack.l_mark[-1].lregn.y1, yystack.l_mark[-1].lregn.x2, yystack.l_mark[-1].lregn.y2, yystack.l_mark[-1].lregn.area, rtyp, 0, (char *)0, SPO_LEVREGION)); } break; case 256: -{ +#line 1836 "util/lev_comp.y" + { 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(yystack.l_mark[-2].lregn.x1, yystack.l_mark[-2].lregn.y1, yystack.l_mark[-2].lregn.x2, yystack.l_mark[-2].lregn.y2, yystack.l_mark[-2].lregn.area, + yystack.l_mark[0].lregn.x1, yystack.l_mark[0].lregn.y1, yystack.l_mark[0].lregn.x2, yystack.l_mark[0].lregn.y2, yystack.l_mark[0].lregn.area, (long) LR_BRANCH, 0, (char *) 0, SPO_LEVREGION)); } break; case 257: -{ +#line 1846 "util/lev_comp.y" + { yyval.i = -1; } break; case 258: -{ - yyval.i = yyvsp[0].i; +#line 1850 "util/lev_comp.y" + { + yyval.i = yystack.l_mark[0].i; } break; case 259: -{ +#line 1856 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_FOUNTAIN)); } break; case 260: -{ +#line 1862 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_SINK)); } break; case 261: -{ +#line 1868 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_POOL)); } break; case 262: -{ +#line 1874 "util/lev_comp.y" + { yyval.terr.lit = -2; - yyval.terr.ter = what_map_char((char) yyvsp[0].i); + yyval.terr.ter = what_map_char((char) yystack.l_mark[0].i); } break; case 263: -{ - yyval.terr.lit = yyvsp[-1].i; - yyval.terr.ter = what_map_char((char) yyvsp[-3].i); +#line 1879 "util/lev_comp.y" + { + yyval.terr.lit = yystack.l_mark[-1].i; + yyval.terr.ter = what_map_char((char) yystack.l_mark[-3].i); } break; case 264: -{ +#line 1886 "util/lev_comp.y" + { add_opvars(splev, "io", - VA_PASS2(yyvsp[0].i, SPO_REPLACETERRAIN)); + VA_PASS2(yystack.l_mark[0].i, SPO_REPLACETERRAIN)); } break; case 265: -{ +#line 1893 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_TERRAIN)); } break; case 266: -{ +#line 1899 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_NON_DIGGABLE)); } break; case 267: -{ +#line 1905 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_NON_PASSWALL)); } break; case 268: -{ +#line 1911 "util/lev_comp.y" + { long irr; - long rt = yyvsp[-1].i; - long rflags = yyvsp[0].i; + long rt = yystack.l_mark[-1].i; + long rflags = yystack.l_mark[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)); + VA_PASS4((long)yystack.l_mark[-3].i, rt, rflags, SPO_REGION)); yyval.i = (irr || (rflags & 1) || rt != OROOM); break_stmt_start(); } break; case 269: -{ +#line 1925 "util/lev_comp.y" + { break_stmt_end(splev); - if ( yyvsp[-1].i ) { + if ( yystack.l_mark[-1].i ) { add_opcode(splev, SPO_ENDROOM, NULL); - } else if ( yyvsp[0].i ) + } else if ( yystack.l_mark[0].i ) lc_error("Cannot use lev statements in non-permanent REGION"); } break; case 270: -{ +#line 1935 "util/lev_comp.y" + { yyval.i = 0; } break; case 271: -{ - yyval.i = yyvsp[0].i; +#line 1939 "util/lev_comp.y" + { + yyval.i = yystack.l_mark[0].i; } break; case 272: -{ +#line 1945 "util/lev_comp.y" + { add_opvars(splev, "iio", - VA_PASS3((long)yyvsp[0].i, (long)yyvsp[-2].i, SPO_ALTAR)); + VA_PASS3((long)yystack.l_mark[0].i, (long)yystack.l_mark[-2].i, SPO_ALTAR)); } break; case 273: -{ +#line 1952 "util/lev_comp.y" + { add_opvars(splev, "io", VA_PASS2(2, SPO_GRAVE)); } break; case 274: -{ +#line 1956 "util/lev_comp.y" + { add_opvars(splev, "sio", VA_PASS3((char *)0, 1, SPO_GRAVE)); } break; case 275: -{ +#line 1961 "util/lev_comp.y" + { add_opvars(splev, "sio", VA_PASS3((char *)0, 0, SPO_GRAVE)); } break; case 276: -{ +#line 1968 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_GOLD)); } break; case 277: -{ +#line 1974 "util/lev_comp.y" + { add_opvars(splev, "io", - VA_PASS2((long)yyvsp[-2].i, SPO_ENGRAVING)); + VA_PASS2((long)yystack.l_mark[-2].i, SPO_ENGRAVING)); } break; case 278: -{ +#line 1981 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_MINERALIZE)); } break; case 279: -{ +#line 1985 "util/lev_comp.y" + { add_opvars(splev, "iiiio", VA_PASS5(-1L, -1L, -1L, -1L, SPO_MINERALIZE)); } break; case 280: -{ - int token = get_trap_type(yyvsp[0].map); +#line 1992 "util/lev_comp.y" + { + int token = get_trap_type(yystack.l_mark[0].map); if (token == ERR) - lc_error("Unknown trap type '%s'!", yyvsp[0].map); + lc_error("Unknown trap type '%s'!", yystack.l_mark[0].map); yyval.i = token; - Free(yyvsp[0].map); + Free(yystack.l_mark[0].map); } break; case 282: -{ - int token = get_room_type(yyvsp[0].map); +#line 2003 "util/lev_comp.y" + { + int token = get_room_type(yystack.l_mark[0].map); if (token == ERR) { - lc_warning("Unknown room type \"%s\"! Making ordinary room...", yyvsp[0].map); + lc_warning("Unknown room type \"%s\"! Making ordinary room...", yystack.l_mark[0].map); yyval.i = OROOM; } else yyval.i = token; - Free(yyvsp[0].map); + Free(yystack.l_mark[0].map); } break; case 284: -{ +#line 2016 "util/lev_comp.y" + { yyval.i = -1; } break; case 285: -{ - yyval.i = yyvsp[0].i; +#line 2020 "util/lev_comp.y" + { + yyval.i = yystack.l_mark[0].i; } break; case 286: -{ - yyval.i = yyvsp[0].i; +#line 2026 "util/lev_comp.y" + { + yyval.i = yystack.l_mark[0].i; } break; case 287: -{ - yyval.i = yyvsp[-2].i | yyvsp[0].i; +#line 2030 "util/lev_comp.y" + { + yyval.i = yystack.l_mark[-2].i | yystack.l_mark[0].i; } break; case 288: -{ - yyval.i = (yyvsp[0].i << 0); +#line 2037 "util/lev_comp.y" + { + yyval.i = (yystack.l_mark[0].i << 0); } break; case 289: -{ - yyval.i = (yyvsp[0].i << 1); +#line 2041 "util/lev_comp.y" + { + yyval.i = (yystack.l_mark[0].i << 1); } break; case 290: -{ - yyval.i = (yyvsp[0].i << 2); +#line 2045 "util/lev_comp.y" + { + yyval.i = (yystack.l_mark[0].i << 2); } break; case 297: -{ +#line 2061 "util/lev_comp.y" + { yyval.i = - MAX_REGISTERS - 1; } break; case 300: -{ +#line 2069 "util/lev_comp.y" + { yyval.i = - MAX_REGISTERS - 1; } break; case 303: -{ - if ( yyvsp[-1].i >= 3 ) +#line 2079 "util/lev_comp.y" + { + if ( yystack.l_mark[-1].i >= 3 ) lc_error("Register Index overflow!"); else - yyval.i = - yyvsp[-1].i - 1; + yyval.i = - yystack.l_mark[-1].i - 1; } break; case 304: -{ - add_opvars(splev, "s", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); +#line 2088 "util/lev_comp.y" + { + add_opvars(splev, "s", VA_PASS1(yystack.l_mark[0].map)); + Free(yystack.l_mark[0].map); } break; case 305: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_STRING); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); +#line 2093 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[0].map, SPOVAR_STRING); + vardef_used(vardefs, yystack.l_mark[0].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[0].map)); + Free(yystack.l_mark[0].map); } break; case 306: -{ - check_vardef_type(vardefs, yyvsp[-3].map, +#line 2100 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[-3].map, SPOVAR_STRING | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); + vardef_used(vardefs, yystack.l_mark[-3].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[-3].map)); + Free(yystack.l_mark[-3].map); } break; case 307: -{ +#line 2111 "util/lev_comp.y" + { /* nothing */ } break; case 308: -{ - add_opvars(splev, "c", VA_PASS1(yyvsp[0].i)); +#line 2117 "util/lev_comp.y" + { + add_opvars(splev, "c", VA_PASS1(yystack.l_mark[0].i)); } break; case 309: -{ +#line 2121 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_SEL_RNDCOORD)); } break; case 310: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_COORD); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); +#line 2125 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[0].map, SPOVAR_COORD); + vardef_used(vardefs, yystack.l_mark[0].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[0].map)); + Free(yystack.l_mark[0].map); } break; case 311: -{ - check_vardef_type(vardefs, yyvsp[-3].map, +#line 2132 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[-3].map, SPOVAR_COORD | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); + vardef_used(vardefs, yystack.l_mark[-3].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[-3].map)); + Free(yystack.l_mark[-3].map); } break; case 312: -{ - if (yyvsp[-3].i < 0 || yyvsp[-1].i < 0 || yyvsp[-3].i >= COLNO || yyvsp[-1].i >= ROWNO) +#line 2142 "util/lev_comp.y" + { + if (yystack.l_mark[-3].i < 0 || yystack.l_mark[-1].i < 0 || yystack.l_mark[-3].i >= COLNO || yystack.l_mark[-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); + yystack.l_mark[-3].i, yystack.l_mark[-1].i); + yyval.i = SP_COORD_PACK(yystack.l_mark[-3].i, yystack.l_mark[-1].i); } break; case 313: -{ +#line 2149 "util/lev_comp.y" + { yyval.i = SP_COORD_PACK_RANDOM(0); } break; case 314: -{ - yyval.i = SP_COORD_PACK_RANDOM(yyvsp[-1].i); +#line 2153 "util/lev_comp.y" + { + yyval.i = SP_COORD_PACK_RANDOM(yystack.l_mark[-1].i); } break; case 315: -{ - yyval.i = yyvsp[0].i; +#line 2159 "util/lev_comp.y" + { + yyval.i = yystack.l_mark[0].i; } break; case 316: -{ - if ((yyvsp[-2].i & yyvsp[0].i)) +#line 2163 "util/lev_comp.y" + { + if ((yystack.l_mark[-2].i & yystack.l_mark[0].i)) lc_warning("Humidity flag used twice."); - yyval.i = (yyvsp[-2].i | yyvsp[0].i); + yyval.i = (yystack.l_mark[-2].i | yystack.l_mark[0].i); } break; case 317: -{ +#line 2171 "util/lev_comp.y" + { /* nothing */ } break; case 318: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_REGION); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); +#line 2175 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[0].map, SPOVAR_REGION); + vardef_used(vardefs, yystack.l_mark[0].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[0].map)); + Free(yystack.l_mark[0].map); } break; case 319: -{ - check_vardef_type(vardefs, yyvsp[-3].map, +#line 2182 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[-3].map, SPOVAR_REGION | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); + vardef_used(vardefs, yystack.l_mark[-3].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[-3].map)); + Free(yystack.l_mark[-3].map); } break; case 320: -{ - long r = SP_REGION_PACK(yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); +#line 2192 "util/lev_comp.y" + { + long r = SP_REGION_PACK(yystack.l_mark[-7].i, yystack.l_mark[-5].i, yystack.l_mark[-3].i, yystack.l_mark[-1].i); - if (yyvsp[-7].i > yyvsp[-3].i || yyvsp[-5].i > yyvsp[-1].i) + if (yystack.l_mark[-7].i > yystack.l_mark[-3].i || yystack.l_mark[-5].i > yystack.l_mark[-1].i) lc_error("Region start > end: (%ld,%ld,%ld,%ld)!", - yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); + yystack.l_mark[-7].i, yystack.l_mark[-5].i, yystack.l_mark[-3].i, yystack.l_mark[-1].i); add_opvars(splev, "r", VA_PASS1(r)); yyval.i = r; } break; case 321: -{ - add_opvars(splev, "m", VA_PASS1(yyvsp[0].i)); +#line 2205 "util/lev_comp.y" + { + add_opvars(splev, "m", VA_PASS1(yystack.l_mark[0].i)); } break; case 322: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_MAPCHAR); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); +#line 2209 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[0].map, SPOVAR_MAPCHAR); + vardef_used(vardefs, yystack.l_mark[0].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[0].map)); + Free(yystack.l_mark[0].map); } break; case 323: -{ - check_vardef_type(vardefs, yyvsp[-3].map, +#line 2216 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[-3].map, SPOVAR_MAPCHAR | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); + vardef_used(vardefs, yystack.l_mark[-3].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[-3].map)); + Free(yystack.l_mark[-3].map); } 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); +#line 2226 "util/lev_comp.y" + { + if (what_map_char((char) yystack.l_mark[0].i) != INVALID_TYPE) + yyval.i = SP_MAPCHAR_PACK(what_map_char((char) yystack.l_mark[0].i), -2); else { - lc_error("Unknown map char type '%c'!", yyvsp[0].i); + lc_error("Unknown map char type '%c'!", yystack.l_mark[0].i); yyval.i = SP_MAPCHAR_PACK(STONE, -2); } } 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); +#line 2235 "util/lev_comp.y" + { + if (what_map_char((char) yystack.l_mark[-3].i) != INVALID_TYPE) + yyval.i = SP_MAPCHAR_PACK(what_map_char((char) yystack.l_mark[-3].i), yystack.l_mark[-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'!", yystack.l_mark[-3].i); + yyval.i = SP_MAPCHAR_PACK(STONE, yystack.l_mark[-1].i); } } break; case 326: -{ - add_opvars(splev, "M", VA_PASS1(yyvsp[0].i)); +#line 2246 "util/lev_comp.y" + { + add_opvars(splev, "M", VA_PASS1(yystack.l_mark[0].i)); } break; case 327: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_MONST); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); +#line 2250 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[0].map, SPOVAR_MONST); + vardef_used(vardefs, yystack.l_mark[0].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[0].map)); + Free(yystack.l_mark[0].map); } break; case 328: -{ - check_vardef_type(vardefs, yyvsp[-3].map, +#line 2257 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[-3].map, SPOVAR_MONST | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); + vardef_used(vardefs, yystack.l_mark[-3].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[-3].map)); + Free(yystack.l_mark[-3].map); } break; case 329: -{ - long m = get_monster_id(yyvsp[0].map, (char)0); +#line 2267 "util/lev_comp.y" + { + long m = get_monster_id(yystack.l_mark[0].map, (char)0); if (m == ERR) { - lc_error("Unknown monster \"%s\"!", yyvsp[0].map); + lc_error("Unknown monster \"%s\"!", yystack.l_mark[0].map); yyval.i = -1; } else yyval.i = SP_MONST_PACK(m, def_monsyms[(int) mons[m].mlet].sym); - Free(yyvsp[0].map); + Free(yystack.l_mark[0].map); } break; case 330: -{ - if (check_monster_char((char) yyvsp[0].i)) - yyval.i = SP_MONST_PACK(-1, yyvsp[0].i); +#line 2278 "util/lev_comp.y" + { + if (check_monster_char((char) yystack.l_mark[0].i)) + yyval.i = SP_MONST_PACK(-1, yystack.l_mark[0].i); else { - lc_error("Unknown monster class '%c'!", yyvsp[0].i); + lc_error("Unknown monster class '%c'!", yystack.l_mark[0].i); yyval.i = -1; } } break; case 331: -{ - long m = get_monster_id(yyvsp[-1].map, (char) yyvsp[-3].i); +#line 2287 "util/lev_comp.y" + { + long m = get_monster_id(yystack.l_mark[-1].map, (char) yystack.l_mark[-3].i); if (m == ERR) { - lc_error("Unknown monster ('%c', \"%s\")!", yyvsp[-3].i, yyvsp[-1].map); + lc_error("Unknown monster ('%c', \"%s\")!", yystack.l_mark[-3].i, yystack.l_mark[-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, yystack.l_mark[-3].i); + Free(yystack.l_mark[-1].map); } break; case 332: -{ +#line 2297 "util/lev_comp.y" + { yyval.i = -1; } break; case 333: -{ - add_opvars(splev, "O", VA_PASS1(yyvsp[0].i)); +#line 2303 "util/lev_comp.y" + { + add_opvars(splev, "O", VA_PASS1(yystack.l_mark[0].i)); } break; case 334: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_OBJ); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); +#line 2307 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[0].map, SPOVAR_OBJ); + vardef_used(vardefs, yystack.l_mark[0].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[0].map)); + Free(yystack.l_mark[0].map); } break; case 335: -{ - check_vardef_type(vardefs, yyvsp[-3].map, +#line 2314 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[-3].map, SPOVAR_OBJ | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); + vardef_used(vardefs, yystack.l_mark[-3].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[-3].map)); + Free(yystack.l_mark[-3].map); } break; case 336: -{ - long m = get_object_id(yyvsp[0].map, (char)0); +#line 2324 "util/lev_comp.y" + { + long m = get_object_id(yystack.l_mark[0].map, (char)0); if (m == ERR) { - lc_error("Unknown object \"%s\"!", yyvsp[0].map); + lc_error("Unknown object \"%s\"!", yystack.l_mark[0].map); yyval.i = -1; } else /* obj class != 0 to force generation of a specific item */ yyval.i = SP_OBJ_PACK(m, 1); - Free(yyvsp[0].map); + Free(yystack.l_mark[0].map); } break; case 337: -{ - if (check_object_char((char) yyvsp[0].i)) - yyval.i = SP_OBJ_PACK(-1, yyvsp[0].i); +#line 2335 "util/lev_comp.y" + { + if (check_object_char((char) yystack.l_mark[0].i)) + yyval.i = SP_OBJ_PACK(-1, yystack.l_mark[0].i); else { - lc_error("Unknown object class '%c'!", yyvsp[0].i); + lc_error("Unknown object class '%c'!", yystack.l_mark[0].i); yyval.i = -1; } } break; case 338: -{ - long m = get_object_id(yyvsp[-1].map, (char) yyvsp[-3].i); +#line 2344 "util/lev_comp.y" + { + long m = get_object_id(yystack.l_mark[-1].map, (char) yystack.l_mark[-3].i); if (m == ERR) { - lc_error("Unknown object ('%c', \"%s\")!", yyvsp[-3].i, yyvsp[-1].map); + lc_error("Unknown object ('%c', \"%s\")!", yystack.l_mark[-3].i, yystack.l_mark[-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, yystack.l_mark[-3].i); + Free(yystack.l_mark[-1].map); } break; case 339: -{ +#line 2354 "util/lev_comp.y" + { yyval.i = -1; } break; case 340: -{ } +#line 2360 "util/lev_comp.y" + { } break; case 341: -{ +#line 2362 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_MATH_ADD)); } break; case 342: -{ - add_opvars(splev, "i", VA_PASS1(yyvsp[0].i)); +#line 2368 "util/lev_comp.y" + { + add_opvars(splev, "i", VA_PASS1(yystack.l_mark[0].i)); } break; case 343: -{ +#line 2372 "util/lev_comp.y" + { is_inconstant_number = 1; } break; case 344: -{ - add_opvars(splev, "i", VA_PASS1(yyvsp[-1].i)); +#line 2376 "util/lev_comp.y" + { + add_opvars(splev, "i", VA_PASS1(yystack.l_mark[-1].i)); } break; case 345: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_INT); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); +#line 2380 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[0].map, SPOVAR_INT); + vardef_used(vardefs, yystack.l_mark[0].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[0].map)); + Free(yystack.l_mark[0].map); is_inconstant_number = 1; } break; case 346: -{ - check_vardef_type(vardefs, yyvsp[-3].map, +#line 2388 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[-3].map, SPOVAR_INT | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); + vardef_used(vardefs, yystack.l_mark[-3].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[-3].map)); + Free(yystack.l_mark[-3].map); is_inconstant_number = 1; } break; case 347: -{ +#line 2397 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_MATH_ADD)); } break; case 348: -{ +#line 2401 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_MATH_SUB)); } break; case 349: -{ +#line 2405 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_MATH_MUL)); } break; case 350: -{ +#line 2409 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_MATH_DIV)); } break; case 351: -{ +#line 2413 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_MATH_MOD)); } break; case 352: -{ } +#line 2416 "util/lev_comp.y" + { } break; case 353: -{ - if (!strcmp("int", yyvsp[0].map) || !strcmp("integer", yyvsp[0].map)) { +#line 2420 "util/lev_comp.y" + { + if (!strcmp("int", yystack.l_mark[0].map) || !strcmp("integer", yystack.l_mark[0].map)) { yyval.i = (int)'i'; } else - lc_error("Unknown function parameter type '%s'", yyvsp[0].map); + lc_error("Unknown function parameter type '%s'", yystack.l_mark[0].map); } break; case 354: -{ - if (!strcmp("str", yyvsp[0].map) || !strcmp("string", yyvsp[0].map)) { +#line 2427 "util/lev_comp.y" + { + if (!strcmp("str", yystack.l_mark[0].map) || !strcmp("string", yystack.l_mark[0].map)) { yyval.i = (int)'s'; } else - lc_error("Unknown function parameter type '%s'", yyvsp[0].map); + lc_error("Unknown function parameter type '%s'", yystack.l_mark[0].map); } break; case 355: -{ +#line 2436 "util/lev_comp.y" + { struct lc_funcdefs_parm *tmp = New(struct lc_funcdefs_parm); if (!curr_function) { @@ -4669,8 +5072,8 @@ case 355: } else { long vt = SPOVAR_NULL; - tmp->name = strdup(yyvsp[-2].map); - tmp->parmtype = (char) yyvsp[0].i; + tmp->name = strdup(yystack.l_mark[-2].map); + tmp->parmtype = (char) yystack.l_mark[0].i; tmp->next = curr_function->params; curr_function->params = tmp; curr_function->n_params++; @@ -4685,252 +5088,288 @@ case 355: lc_error("Unknown func param conversion."); break; } - vardefs = add_vardef_type( vardefs, yyvsp[-2].map, vt); + vardefs = add_vardef_type( vardefs, yystack.l_mark[-2].map, vt); } - Free(yyvsp[-2].map); + Free(yystack.l_mark[-2].map); } break; case 360: -{ +#line 2477 "util/lev_comp.y" + { yyval.i = (int)'i'; } break; case 361: -{ +#line 2481 "util/lev_comp.y" + { yyval.i = (int)'s'; } break; case 362: -{ +#line 2488 "util/lev_comp.y" + { char tmpbuf[2]; - tmpbuf[0] = (char) yyvsp[0].i; + tmpbuf[0] = (char) yystack.l_mark[0].i; tmpbuf[1] = '\0'; yyval.map = strdup(tmpbuf); } break; case 363: -{ - long len = strlen( yyvsp[-2].map ); +#line 2495 "util/lev_comp.y" + { + long len = strlen( yystack.l_mark[-2].map ); char *tmp = (char *) alloc(len + 2); - sprintf(tmp, "%c%s", (char) yyvsp[0].i, yyvsp[-2].map ); - Free( yyvsp[-2].map ); + sprintf(tmp, "%c%s", (char) yystack.l_mark[0].i, yystack.l_mark[-2].map ); + Free( yystack.l_mark[-2].map ); yyval.map = tmp; } break; case 364: -{ +#line 2505 "util/lev_comp.y" + { yyval.map = strdup(""); } break; case 365: -{ - char *tmp = strdup( yyvsp[0].map ); - Free( yyvsp[0].map ); +#line 2509 "util/lev_comp.y" + { + char *tmp = strdup( yystack.l_mark[0].map ); + Free( yystack.l_mark[0].map ); yyval.map = tmp; } break; case 366: -{ +#line 2517 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_SEL_POINT)); } break; case 367: -{ +#line 2521 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_SEL_RECT)); } break; case 368: -{ +#line 2525 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_SEL_FILLRECT)); } break; case 369: -{ +#line 2529 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_SEL_LINE)); } break; case 370: -{ +#line 2533 "util/lev_comp.y" + { /* randline (x1,y1),(x2,y2), roughness */ add_opvars(splev, "o", VA_PASS1(SPO_SEL_RNDLINE)); } break; case 371: -{ +#line 2538 "util/lev_comp.y" + { add_opvars(splev, "io", VA_PASS2(W_ANY, SPO_SEL_GROW)); } break; case 372: -{ - add_opvars(splev, "io", VA_PASS2(yyvsp[-3].i, SPO_SEL_GROW)); +#line 2542 "util/lev_comp.y" + { + add_opvars(splev, "io", VA_PASS2(yystack.l_mark[-3].i, SPO_SEL_GROW)); } break; case 373: -{ +#line 2546 "util/lev_comp.y" + { add_opvars(splev, "iio", - VA_PASS3(yyvsp[-3].i, SPOFILTER_PERCENT, SPO_SEL_FILTER)); + VA_PASS3(yystack.l_mark[-3].i, SPOFILTER_PERCENT, SPO_SEL_FILTER)); } break; case 374: -{ +#line 2551 "util/lev_comp.y" + { add_opvars(splev, "io", VA_PASS2(SPOFILTER_SELECTION, SPO_SEL_FILTER)); } break; case 375: -{ +#line 2556 "util/lev_comp.y" + { add_opvars(splev, "io", VA_PASS2(SPOFILTER_MAPCHAR, SPO_SEL_FILTER)); } break; case 376: -{ +#line 2561 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_SEL_FLOOD)); } break; case 377: -{ +#line 2565 "util/lev_comp.y" + { add_opvars(splev, "oio", VA_PASS3(SPO_COPY, 1, SPO_SEL_ELLIPSE)); } break; case 378: -{ +#line 2570 "util/lev_comp.y" + { add_opvars(splev, "oio", - VA_PASS3(SPO_COPY, yyvsp[-1].i, SPO_SEL_ELLIPSE)); + VA_PASS3(SPO_COPY, yystack.l_mark[-1].i, SPO_SEL_ELLIPSE)); } break; case 379: -{ +#line 2575 "util/lev_comp.y" + { add_opvars(splev, "io", VA_PASS2(1, SPO_SEL_ELLIPSE)); } break; case 380: -{ - add_opvars(splev, "io", VA_PASS2(yyvsp[-1].i, SPO_SEL_ELLIPSE)); +#line 2579 "util/lev_comp.y" + { + add_opvars(splev, "io", VA_PASS2(yystack.l_mark[-1].i, SPO_SEL_ELLIPSE)); } break; case 381: -{ +#line 2583 "util/lev_comp.y" + { add_opvars(splev, "iio", - VA_PASS3(yyvsp[-5].i, yyvsp[-11].i, SPO_SEL_GRADIENT)); + VA_PASS3(yystack.l_mark[-5].i, yystack.l_mark[-11].i, SPO_SEL_GRADIENT)); } break; case 382: -{ +#line 2588 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_SEL_COMPLEMENT)); } break; case 383: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_SEL); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); +#line 2592 "util/lev_comp.y" + { + check_vardef_type(vardefs, yystack.l_mark[0].map, SPOVAR_SEL); + vardef_used(vardefs, yystack.l_mark[0].map); + add_opvars(splev, "v", VA_PASS1(yystack.l_mark[0].map)); + Free(yystack.l_mark[0].map); } break; case 384: -{ +#line 2599 "util/lev_comp.y" + { /* nothing */ } break; case 385: -{ +#line 2605 "util/lev_comp.y" + { /* nothing */ } break; case 386: -{ +#line 2609 "util/lev_comp.y" + { add_opvars(splev, "o", VA_PASS1(SPO_SEL_ADD)); } break; case 387: -{ +#line 2615 "util/lev_comp.y" + { add_opvars(splev, "iio", - VA_PASS3(yyvsp[0].dice.num, yyvsp[0].dice.die, SPO_DICE)); + VA_PASS3(yystack.l_mark[0].dice.num, yystack.l_mark[0].dice.die, SPO_DICE)); } break; case 391: -{ - add_opvars(splev, "i", VA_PASS1(yyvsp[0].i)); +#line 2627 "util/lev_comp.y" + { + add_opvars(splev, "i", VA_PASS1(yystack.l_mark[0].i)); } break; case 392: -{ - add_opvars(splev, "i", VA_PASS1(yyvsp[0].i)); +#line 2631 "util/lev_comp.y" + { + add_opvars(splev, "i", VA_PASS1(yystack.l_mark[0].i)); } break; case 393: -{ - add_opvars(splev, "i", VA_PASS1(yyvsp[0].i)); +#line 2635 "util/lev_comp.y" + { + add_opvars(splev, "i", VA_PASS1(yystack.l_mark[0].i)); } break; case 394: -{ +#line 2639 "util/lev_comp.y" + { /* nothing */ } break; case 403: -{ - yyval.lregn = yyvsp[0].lregn; +#line 2661 "util/lev_comp.y" + { + yyval.lregn = yystack.l_mark[0].lregn; } break; case 404: -{ - if (yyvsp[-7].i <= 0 || yyvsp[-7].i >= COLNO) +#line 2665 "util/lev_comp.y" + { + if (yystack.l_mark[-7].i <= 0 || yystack.l_mark[-7].i >= COLNO) lc_error( "Region (%ld,%ld,%ld,%ld) 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) + yystack.l_mark[-7].i, yystack.l_mark[-5].i, yystack.l_mark[-3].i, yystack.l_mark[-1].i); + else if (yystack.l_mark[-5].i < 0 || yystack.l_mark[-5].i >= ROWNO) lc_error( "Region (%ld,%ld,%ld,%ld) 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) + yystack.l_mark[-7].i, yystack.l_mark[-5].i, yystack.l_mark[-3].i, yystack.l_mark[-1].i); + else if (yystack.l_mark[-3].i <= 0 || yystack.l_mark[-3].i >= COLNO) lc_error( "Region (%ld,%ld,%ld,%ld) 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) + yystack.l_mark[-7].i, yystack.l_mark[-5].i, yystack.l_mark[-3].i, yystack.l_mark[-1].i); + else if (yystack.l_mark[-1].i < 0 || yystack.l_mark[-1].i >= ROWNO) lc_error( "Region (%ld,%ld,%ld,%ld) 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; + yystack.l_mark[-7].i, yystack.l_mark[-5].i, yystack.l_mark[-3].i, yystack.l_mark[-1].i); + yyval.lregn.x1 = yystack.l_mark[-7].i; + yyval.lregn.y1 = yystack.l_mark[-5].i; + yyval.lregn.x2 = yystack.l_mark[-3].i; + yyval.lregn.y2 = yystack.l_mark[-1].i; yyval.lregn.area = 1; } break; case 405: -{ +#line 2691 "util/lev_comp.y" + { /* 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) + if (yystack.l_mark[-7].i < 0 || yystack.l_mark[-7].i > (int) max_x_map) lc_error( "Region (%ld,%ld,%ld,%ld) 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) + yystack.l_mark[-7].i, yystack.l_mark[-5].i, yystack.l_mark[-3].i, yystack.l_mark[-1].i); + else if (yystack.l_mark[-5].i < 0 || yystack.l_mark[-5].i > (int) max_y_map) lc_error( "Region (%ld,%ld,%ld,%ld) 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) + yystack.l_mark[-7].i, yystack.l_mark[-5].i, yystack.l_mark[-3].i, yystack.l_mark[-1].i); + else if (yystack.l_mark[-3].i < 0 || yystack.l_mark[-3].i > (int) max_x_map) lc_error( "Region (%ld,%ld,%ld,%ld) 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) + yystack.l_mark[-7].i, yystack.l_mark[-5].i, yystack.l_mark[-3].i, yystack.l_mark[-1].i); + else if (yystack.l_mark[-1].i < 0 || yystack.l_mark[-1].i > (int) max_y_map) lc_error( "Region (%ld,%ld,%ld,%ld) out of map range (y2)!", - yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); + yystack.l_mark[-7].i, yystack.l_mark[-5].i, yystack.l_mark[-3].i, yystack.l_mark[-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; + yyval.lregn.x1 = yystack.l_mark[-7].i; + yyval.lregn.y1 = yystack.l_mark[-5].i; + yyval.lregn.x2 = yystack.l_mark[-3].i; + yyval.lregn.y2 = yystack.l_mark[-1].i; } break; +#line 5369 "" } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; + yystack.s_mark -= yym; + yystate = *yystack.s_mark; + yystack.l_mark -= yym; yym = yylhs[yyn]; if (yystate == 0 && yym == 0) { @@ -4940,23 +5379,21 @@ break; state %d\n", YYPREFIX, YYFINAL); #endif yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; + *++yystack.s_mark = YYFINAL; + *++yystack.l_mark = yyval; if (yychar < 0) { - if ((yychar = yylex()) < 0) yychar = 0; + if ((yychar = YYLEX) < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } #endif } - if (yychar == 0) goto yyaccept; + if (yychar == YYEOF) goto yyaccept; goto yyloop; } if ((yyn = yygindex[yym]) != 0 && (yyn += yystate) >= 0 && @@ -4967,19 +5404,24 @@ break; #if YYDEBUG if (yydebug) 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 - if (yyssp >= yyss + yystacksize - 1) + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } - *++yyssp = yystate; - *++yyvsp = yyval; + *++yystack.s_mark = (YYINT) yystate; + *++yystack.l_mark = yyval; goto yyloop; + yyoverflow: - yyerror("yacc stack overflow"); + YYERROR_CALL("yacc stack overflow"); + yyabort: + yyfreestack(&yystack); return (1); + yyaccept: + yyfreestack(&yystack); return (0); }