sys/share/{dgn,lev}_{lex,yacc}.c
This regenerates the scanner and parser files. I'm checking them into master only. If they work for everyone using them, they can be merged into 3.6.0. dgn_yacc.c: I reconstructed our 3.4.3 patch for byacc 1.9 (the original, not the one used to create the set of files being replaced here) by comparing dgn_yacc.c made with vanilla byacc and dgn_yacc.c from 3.4.3. (Unlike lev_comp.l, dgn_comp.l has hardly changed at all.) There's no dynamic memory use in that version, so declarations for malloc and/or realloc and/or inclusion of <stdlib.h> aren't an issue. The fixed size stack it uses is big enough for 'make update' to run to completion. lev_yacc: I built it with [modified] byacc to replace one built with bison. sys/share/lev_comp.h was from byacc, not bison, so something has gotten screwed up recently. *_lex.c: I used the same version of flex (2.5.37) as the one used to create the set being replaced, so build prospects are the same. But I used -L to suppress #line directives and my Makefile has an extra 'sed' pass that strips trailing spaces, producing extra bands in the diff. *_comp.h: They're the same as far as git is concerned (ie, only the file creation/modification dates changed), so there's no update.
This commit is contained in:
+41
-90
@@ -33,7 +33,7 @@
|
|||||||
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||||
|
|
||||||
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
|
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
|
||||||
* if you want the limit (max/min) macros for int types.
|
* if you want the limit (max/min) macros for int types.
|
||||||
*/
|
*/
|
||||||
#ifndef __STDC_LIMIT_MACROS
|
#ifndef __STDC_LIMIT_MACROS
|
||||||
#define __STDC_LIMIT_MACROS 1
|
#define __STDC_LIMIT_MACROS 1
|
||||||
@@ -50,7 +50,7 @@ typedef uint32_t flex_uint32_t;
|
|||||||
typedef signed char flex_int8_t;
|
typedef signed char flex_int8_t;
|
||||||
typedef short int flex_int16_t;
|
typedef short int flex_int16_t;
|
||||||
typedef int flex_int32_t;
|
typedef int flex_int32_t;
|
||||||
typedef unsigned char flex_uint8_t;
|
typedef unsigned char flex_uint8_t;
|
||||||
typedef unsigned short int flex_uint16_t;
|
typedef unsigned short int flex_uint16_t;
|
||||||
typedef unsigned int flex_uint32_t;
|
typedef unsigned int flex_uint32_t;
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ extern FILE *yyin, *yyout;
|
|||||||
#define EOB_ACT_LAST_MATCH 2
|
#define EOB_ACT_LAST_MATCH 2
|
||||||
|
|
||||||
#define YY_LESS_LINENO(n)
|
#define YY_LESS_LINENO(n)
|
||||||
|
|
||||||
/* Return all but the first "n" matched characters back to the input stream. */
|
/* Return all but the first "n" matched characters back to the input stream. */
|
||||||
#define yyless(n) \
|
#define yyless(n) \
|
||||||
do \
|
do \
|
||||||
@@ -224,7 +224,7 @@ struct yy_buffer_state
|
|||||||
|
|
||||||
int yy_bs_lineno; /**< The line count. */
|
int yy_bs_lineno; /**< The line count. */
|
||||||
int yy_bs_column; /**< The column count. */
|
int yy_bs_column; /**< The column count. */
|
||||||
|
|
||||||
/* Whether to try to fill the input buffer when we reach the
|
/* Whether to try to fill the input buffer when we reach the
|
||||||
* end of it.
|
* end of it.
|
||||||
*/
|
*/
|
||||||
@@ -568,9 +568,7 @@ int yy_flex_debug = 0;
|
|||||||
#define YY_MORE_ADJ 0
|
#define YY_MORE_ADJ 0
|
||||||
#define YY_RESTORE_YY_MORE_OFFSET
|
#define YY_RESTORE_YY_MORE_OFFSET
|
||||||
char *yytext;
|
char *yytext;
|
||||||
#line 1 "dgn_comp.l"
|
/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1449188839 2015/12/04 00:27:19 $ $NHDT-Branch: master $:$NHDT-Revision: 1.15 $ */
|
||||||
#line 2 "dgn_comp.l"
|
|
||||||
/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1448710672 2015/11/28 11:37:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ */
|
|
||||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||||
/* Copyright (c) 1990 by M. Stephenson */
|
/* Copyright (c) 1990 by M. Stephenson */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -638,7 +636,6 @@ int FDECL(yyoutput, (int));
|
|||||||
genericptr_t FDECL(realloc, (genericptr_t,size_t));
|
genericptr_t FDECL(realloc, (genericptr_t,size_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void FDECL(init_yyin, (FILE *));
|
void FDECL(init_yyin, (FILE *));
|
||||||
void FDECL(init_yyout, (FILE *));
|
void FDECL(init_yyout, (FILE *));
|
||||||
|
|
||||||
@@ -650,8 +647,6 @@ extern YYSTYPE yylval;
|
|||||||
|
|
||||||
int nh_line_number = 1;
|
int nh_line_number = 1;
|
||||||
|
|
||||||
#line 654 "dgn_lex.c"
|
|
||||||
|
|
||||||
#define INITIAL 0
|
#define INITIAL 0
|
||||||
|
|
||||||
#ifndef YY_NO_UNISTD_H
|
#ifndef YY_NO_UNISTD_H
|
||||||
@@ -710,7 +705,7 @@ extern int yywrap (void );
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void yyunput (int c,char *buf_ptr );
|
static void yyunput (int c,char *buf_ptr );
|
||||||
|
|
||||||
#ifndef yytext_ptr
|
#ifndef yytext_ptr
|
||||||
static void yy_flex_strncpy (char *,yyconst char *,int );
|
static void yy_flex_strncpy (char *,yyconst char *,int );
|
||||||
#endif
|
#endif
|
||||||
@@ -834,10 +829,6 @@ YY_DECL
|
|||||||
register yy_state_type yy_current_state;
|
register yy_state_type yy_current_state;
|
||||||
register char *yy_cp, *yy_bp;
|
register char *yy_cp, *yy_bp;
|
||||||
register int yy_act;
|
register int yy_act;
|
||||||
|
|
||||||
#line 83 "dgn_comp.l"
|
|
||||||
|
|
||||||
#line 841 "dgn_lex.c"
|
|
||||||
|
|
||||||
if ( !(yy_init) )
|
if ( !(yy_init) )
|
||||||
{
|
{
|
||||||
@@ -923,153 +914,123 @@ do_action: /* This label is used only to access EOF actions. */
|
|||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 84 "dgn_comp.l"
|
|
||||||
return(A_DUNGEON);
|
return(A_DUNGEON);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 2:
|
case 2:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 85 "dgn_comp.l"
|
|
||||||
{ yylval.i=1; return(UP_OR_DOWN); }
|
{ yylval.i=1; return(UP_OR_DOWN); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 3:
|
case 3:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 86 "dgn_comp.l"
|
|
||||||
{ yylval.i=0; return(UP_OR_DOWN); }
|
{ yylval.i=0; return(UP_OR_DOWN); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 4:
|
case 4:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 87 "dgn_comp.l"
|
|
||||||
return(ENTRY);
|
return(ENTRY);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 5:
|
case 5:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 88 "dgn_comp.l"
|
|
||||||
return(STAIR);
|
return(STAIR);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 6:
|
case 6:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 89 "dgn_comp.l"
|
|
||||||
return(NO_UP);
|
return(NO_UP);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 7:
|
case 7:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 90 "dgn_comp.l"
|
|
||||||
return(NO_DOWN);
|
return(NO_DOWN);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 8:
|
case 8:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 91 "dgn_comp.l"
|
|
||||||
return(PORTAL);
|
return(PORTAL);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 9:
|
case 9:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 92 "dgn_comp.l"
|
|
||||||
return(PROTOFILE);
|
return(PROTOFILE);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 10:
|
case 10:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 93 "dgn_comp.l"
|
|
||||||
return(DESCRIPTION);
|
return(DESCRIPTION);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 11:
|
case 11:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 94 "dgn_comp.l"
|
|
||||||
return(LEVELDESC);
|
return(LEVELDESC);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 12:
|
case 12:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 95 "dgn_comp.l"
|
|
||||||
return(ALIGNMENT);
|
return(ALIGNMENT);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 13:
|
case 13:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 96 "dgn_comp.l"
|
|
||||||
return(LEVALIGN);
|
return(LEVALIGN);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 14:
|
case 14:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 97 "dgn_comp.l"
|
|
||||||
{ yylval.i=TOWN ; return(DESCRIPTOR); }
|
{ yylval.i=TOWN ; return(DESCRIPTOR); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 15:
|
case 15:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 98 "dgn_comp.l"
|
|
||||||
{ yylval.i=HELLISH ; return(DESCRIPTOR); }
|
{ yylval.i=HELLISH ; return(DESCRIPTOR); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 16:
|
case 16:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 99 "dgn_comp.l"
|
|
||||||
{ yylval.i=MAZELIKE ; return(DESCRIPTOR); }
|
{ yylval.i=MAZELIKE ; return(DESCRIPTOR); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 17:
|
case 17:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 100 "dgn_comp.l"
|
|
||||||
{ yylval.i=ROGUELIKE ; return(DESCRIPTOR); }
|
{ yylval.i=ROGUELIKE ; return(DESCRIPTOR); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 18:
|
case 18:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 101 "dgn_comp.l"
|
|
||||||
{ yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); }
|
{ yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 19:
|
case 19:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 102 "dgn_comp.l"
|
|
||||||
{ yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); }
|
{ yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 20:
|
case 20:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 103 "dgn_comp.l"
|
|
||||||
{ yylval.i=D_ALIGN_LAWFUL ; return(DESCRIPTOR); }
|
{ yylval.i=D_ALIGN_LAWFUL ; return(DESCRIPTOR); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 21:
|
case 21:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 104 "dgn_comp.l"
|
|
||||||
{ yylval.i=D_ALIGN_NEUTRAL ; return(DESCRIPTOR); }
|
{ yylval.i=D_ALIGN_NEUTRAL ; return(DESCRIPTOR); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 22:
|
case 22:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 105 "dgn_comp.l"
|
|
||||||
{ yylval.i=D_ALIGN_CHAOTIC ; return(DESCRIPTOR); }
|
{ yylval.i=D_ALIGN_CHAOTIC ; return(DESCRIPTOR); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 23:
|
case 23:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 106 "dgn_comp.l"
|
|
||||||
return(BRANCH);
|
return(BRANCH);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 24:
|
case 24:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 107 "dgn_comp.l"
|
|
||||||
return(CHBRANCH);
|
return(CHBRANCH);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 25:
|
case 25:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 108 "dgn_comp.l"
|
|
||||||
return(LEVEL);
|
return(LEVEL);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 26:
|
case 26:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 109 "dgn_comp.l"
|
|
||||||
return(RNDLEVEL);
|
return(RNDLEVEL);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 27:
|
case 27:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 110 "dgn_comp.l"
|
|
||||||
return(CHLEVEL);
|
return(CHLEVEL);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 28:
|
case 28:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 111 "dgn_comp.l"
|
|
||||||
return(RNDCHLEVEL);
|
return(RNDCHLEVEL);
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 29:
|
case 29:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 112 "dgn_comp.l"
|
|
||||||
{ yylval.i=atoi(yytext); return(INTEGER); }
|
{ yylval.i=atoi(yytext); return(INTEGER); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 30:
|
case 30:
|
||||||
/* rule 30 can match eol */
|
/* rule 30 can match eol */
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 113 "dgn_comp.l"
|
|
||||||
{ yytext[yyleng - 1] = '\0'; /* discard the trailing \" */
|
{ yytext[yyleng - 1] = '\0'; /* discard the trailing \" */
|
||||||
yylval.str = dupstr(yytext + 1); /* skip the first \" */
|
yylval.str = dupstr(yytext + 1); /* skip the first \" */
|
||||||
return STRING; }
|
return STRING; }
|
||||||
@@ -1077,31 +1038,25 @@ YY_RULE_SETUP
|
|||||||
case 31:
|
case 31:
|
||||||
/* rule 31 can match eol */
|
/* rule 31 can match eol */
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 116 "dgn_comp.l"
|
|
||||||
{ nh_line_number++; }
|
{ nh_line_number++; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 32:
|
case 32:
|
||||||
/* rule 32 can match eol */
|
/* rule 32 can match eol */
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 117 "dgn_comp.l"
|
|
||||||
{ nh_line_number++; }
|
{ nh_line_number++; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 33:
|
case 33:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 118 "dgn_comp.l"
|
|
||||||
; /* skip trailing tabs & spaces */
|
; /* skip trailing tabs & spaces */
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 34:
|
case 34:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 119 "dgn_comp.l"
|
|
||||||
{ return yytext[0]; }
|
{ return yytext[0]; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 35:
|
case 35:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 120 "dgn_comp.l"
|
|
||||||
ECHO;
|
ECHO;
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
#line 1105 "dgn_lex.c"
|
|
||||||
case YY_STATE_EOF(INITIAL):
|
case YY_STATE_EOF(INITIAL):
|
||||||
yyterminate();
|
yyterminate();
|
||||||
|
|
||||||
@@ -1379,7 +1334,7 @@ static int yy_get_next_buffer (void)
|
|||||||
{
|
{
|
||||||
register yy_state_type yy_current_state;
|
register yy_state_type yy_current_state;
|
||||||
register char *yy_cp;
|
register char *yy_cp;
|
||||||
|
|
||||||
yy_current_state = (yy_start);
|
yy_current_state = (yy_start);
|
||||||
yy_current_state += YY_AT_BOL();
|
yy_current_state += YY_AT_BOL();
|
||||||
|
|
||||||
@@ -1434,7 +1389,7 @@ static int yy_get_next_buffer (void)
|
|||||||
static void yyunput (int c, register char * yy_bp )
|
static void yyunput (int c, register char * yy_bp )
|
||||||
{
|
{
|
||||||
register char *yy_cp;
|
register char *yy_cp;
|
||||||
|
|
||||||
yy_cp = (yy_c_buf_p);
|
yy_cp = (yy_c_buf_p);
|
||||||
|
|
||||||
/* undo effects of setting up yytext */
|
/* undo effects of setting up yytext */
|
||||||
@@ -1477,7 +1432,7 @@ static int yy_get_next_buffer (void)
|
|||||||
|
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
*(yy_c_buf_p) = (yy_hold_char);
|
*(yy_c_buf_p) = (yy_hold_char);
|
||||||
|
|
||||||
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
|
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
|
||||||
@@ -1546,12 +1501,12 @@ static int yy_get_next_buffer (void)
|
|||||||
|
|
||||||
/** Immediately switch to a different input stream.
|
/** Immediately switch to a different input stream.
|
||||||
* @param input_file A readable stream.
|
* @param input_file A readable stream.
|
||||||
*
|
*
|
||||||
* @note This function does not reset the start condition to @c INITIAL .
|
* @note This function does not reset the start condition to @c INITIAL .
|
||||||
*/
|
*/
|
||||||
void yyrestart (FILE * input_file )
|
void yyrestart (FILE * input_file )
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( ! YY_CURRENT_BUFFER ){
|
if ( ! YY_CURRENT_BUFFER ){
|
||||||
yyensure_buffer_stack ();
|
yyensure_buffer_stack ();
|
||||||
YY_CURRENT_BUFFER_LVALUE =
|
YY_CURRENT_BUFFER_LVALUE =
|
||||||
@@ -1564,11 +1519,11 @@ static int yy_get_next_buffer (void)
|
|||||||
|
|
||||||
/** Switch to a different input buffer.
|
/** Switch to a different input buffer.
|
||||||
* @param new_buffer The new input buffer.
|
* @param new_buffer The new input buffer.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
|
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
|
||||||
{
|
{
|
||||||
|
|
||||||
/* TODO. We should be able to replace this entire function body
|
/* TODO. We should be able to replace this entire function body
|
||||||
* with
|
* with
|
||||||
* yypop_buffer_state();
|
* yypop_buffer_state();
|
||||||
@@ -1608,13 +1563,13 @@ static void yy_load_buffer_state (void)
|
|||||||
/** Allocate and initialize an input buffer state.
|
/** Allocate and initialize an input buffer state.
|
||||||
* @param file A readable stream.
|
* @param file A readable stream.
|
||||||
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
|
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
|
||||||
*
|
*
|
||||||
* @return the allocated buffer state.
|
* @return the allocated buffer state.
|
||||||
*/
|
*/
|
||||||
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
|
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
|
||||||
{
|
{
|
||||||
YY_BUFFER_STATE b;
|
YY_BUFFER_STATE b;
|
||||||
|
|
||||||
b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
|
b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
|
||||||
if ( ! b )
|
if ( ! b )
|
||||||
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
||||||
@@ -1637,11 +1592,11 @@ static void yy_load_buffer_state (void)
|
|||||||
|
|
||||||
/** Destroy the buffer.
|
/** Destroy the buffer.
|
||||||
* @param b a buffer created with yy_create_buffer()
|
* @param b a buffer created with yy_create_buffer()
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void yy_delete_buffer (YY_BUFFER_STATE b )
|
void yy_delete_buffer (YY_BUFFER_STATE b )
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( ! b )
|
if ( ! b )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1662,7 +1617,7 @@ static void yy_load_buffer_state (void)
|
|||||||
|
|
||||||
{
|
{
|
||||||
int oerrno = errno;
|
int oerrno = errno;
|
||||||
|
|
||||||
yy_flush_buffer(b );
|
yy_flush_buffer(b );
|
||||||
|
|
||||||
b->yy_input_file = file;
|
b->yy_input_file = file;
|
||||||
@@ -1678,13 +1633,13 @@ static void yy_load_buffer_state (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
|
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
|
||||||
|
|
||||||
errno = oerrno;
|
errno = oerrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
|
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
|
||||||
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
|
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void yy_flush_buffer (YY_BUFFER_STATE b )
|
void yy_flush_buffer (YY_BUFFER_STATE b )
|
||||||
{
|
{
|
||||||
@@ -1713,7 +1668,7 @@ static void yy_load_buffer_state (void)
|
|||||||
* the current state. This function will allocate the stack
|
* the current state. This function will allocate the stack
|
||||||
* if necessary.
|
* if necessary.
|
||||||
* @param new_buffer The new state.
|
* @param new_buffer The new state.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
|
void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
|
||||||
{
|
{
|
||||||
@@ -1743,7 +1698,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
|
|||||||
|
|
||||||
/** Removes and deletes the top of the stack, if present.
|
/** Removes and deletes the top of the stack, if present.
|
||||||
* The next element becomes the new top.
|
* The next element becomes the new top.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void yypop_buffer_state (void)
|
void yypop_buffer_state (void)
|
||||||
{
|
{
|
||||||
@@ -1767,7 +1722,7 @@ void yypop_buffer_state (void)
|
|||||||
static void yyensure_buffer_stack (void)
|
static void yyensure_buffer_stack (void)
|
||||||
{
|
{
|
||||||
yy_size_t num_to_alloc;
|
yy_size_t num_to_alloc;
|
||||||
|
|
||||||
if (!(yy_buffer_stack)) {
|
if (!(yy_buffer_stack)) {
|
||||||
|
|
||||||
/* First allocation is just for 2 elements, since we don't know if this
|
/* First allocation is just for 2 elements, since we don't know if this
|
||||||
@@ -1780,7 +1735,7 @@ static void yyensure_buffer_stack (void)
|
|||||||
);
|
);
|
||||||
if ( ! (yy_buffer_stack) )
|
if ( ! (yy_buffer_stack) )
|
||||||
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
|
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
|
||||||
|
|
||||||
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
|
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
|
||||||
|
|
||||||
(yy_buffer_stack_max) = num_to_alloc;
|
(yy_buffer_stack_max) = num_to_alloc;
|
||||||
@@ -1810,13 +1765,13 @@ static void yyensure_buffer_stack (void)
|
|||||||
/** Setup the input buffer state to scan directly from a user-specified character buffer.
|
/** Setup the input buffer state to scan directly from a user-specified character buffer.
|
||||||
* @param base the character buffer
|
* @param base the character buffer
|
||||||
* @param size the size in bytes of the character buffer
|
* @param size the size in bytes of the character buffer
|
||||||
*
|
*
|
||||||
* @return the newly allocated buffer state object.
|
* @return the newly allocated buffer state object.
|
||||||
*/
|
*/
|
||||||
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
|
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
|
||||||
{
|
{
|
||||||
YY_BUFFER_STATE b;
|
YY_BUFFER_STATE b;
|
||||||
|
|
||||||
if ( size < 2 ||
|
if ( size < 2 ||
|
||||||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
|
base[size-2] != YY_END_OF_BUFFER_CHAR ||
|
||||||
base[size-1] != YY_END_OF_BUFFER_CHAR )
|
base[size-1] != YY_END_OF_BUFFER_CHAR )
|
||||||
@@ -1845,14 +1800,14 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
|
|||||||
/** Setup the input buffer state to scan a string. The next call to yylex() will
|
/** Setup the input buffer state to scan a string. The next call to yylex() will
|
||||||
* scan from a @e copy of @a str.
|
* scan from a @e copy of @a str.
|
||||||
* @param yystr a NUL-terminated string to scan
|
* @param yystr a NUL-terminated string to scan
|
||||||
*
|
*
|
||||||
* @return the newly allocated buffer state object.
|
* @return the newly allocated buffer state object.
|
||||||
* @note If you want to scan bytes that may contain NUL values, then use
|
* @note If you want to scan bytes that may contain NUL values, then use
|
||||||
* yy_scan_bytes() instead.
|
* yy_scan_bytes() instead.
|
||||||
*/
|
*/
|
||||||
YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
|
YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
|
||||||
{
|
{
|
||||||
|
|
||||||
return yy_scan_bytes(yystr,strlen(yystr) );
|
return yy_scan_bytes(yystr,strlen(yystr) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1860,7 +1815,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
|
|||||||
* scan from a @e copy of @a bytes.
|
* scan from a @e copy of @a bytes.
|
||||||
* @param yybytes the byte buffer to scan
|
* @param yybytes the byte buffer to scan
|
||||||
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
|
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
|
||||||
*
|
*
|
||||||
* @return the newly allocated buffer state object.
|
* @return the newly allocated buffer state object.
|
||||||
*/
|
*/
|
||||||
YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
|
YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
|
||||||
@@ -1869,7 +1824,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len
|
|||||||
char *buf;
|
char *buf;
|
||||||
yy_size_t n;
|
yy_size_t n;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Get memory for full buffer, including space for trailing EOB's. */
|
/* Get memory for full buffer, including space for trailing EOB's. */
|
||||||
n = _yybytes_len + 2;
|
n = _yybytes_len + 2;
|
||||||
buf = (char *) yyalloc(n );
|
buf = (char *) yyalloc(n );
|
||||||
@@ -1923,16 +1878,16 @@ static void yy_fatal_error (yyconst char* msg )
|
|||||||
/* Accessor methods (get/set functions) to struct members. */
|
/* Accessor methods (get/set functions) to struct members. */
|
||||||
|
|
||||||
/** Get the current line number.
|
/** Get the current line number.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int yyget_lineno (void)
|
int yyget_lineno (void)
|
||||||
{
|
{
|
||||||
|
|
||||||
return yylineno;
|
return yylineno;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get the input stream.
|
/** Get the input stream.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
FILE *yyget_in (void)
|
FILE *yyget_in (void)
|
||||||
{
|
{
|
||||||
@@ -1940,7 +1895,7 @@ FILE *yyget_in (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Get the output stream.
|
/** Get the output stream.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
FILE *yyget_out (void)
|
FILE *yyget_out (void)
|
||||||
{
|
{
|
||||||
@@ -1948,7 +1903,7 @@ FILE *yyget_out (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Get the length of the current token.
|
/** Get the length of the current token.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
yy_size_t yyget_leng (void)
|
yy_size_t yyget_leng (void)
|
||||||
{
|
{
|
||||||
@@ -1956,7 +1911,7 @@ yy_size_t yyget_leng (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Get the current token.
|
/** Get the current token.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char *yyget_text (void)
|
char *yyget_text (void)
|
||||||
@@ -1966,18 +1921,18 @@ char *yyget_text (void)
|
|||||||
|
|
||||||
/** Set the current line number.
|
/** Set the current line number.
|
||||||
* @param line_number
|
* @param line_number
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void yyset_lineno (int line_number )
|
void yyset_lineno (int line_number )
|
||||||
{
|
{
|
||||||
|
|
||||||
yylineno = line_number;
|
yylineno = line_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set the input stream. This does not discard the current
|
/** Set the input stream. This does not discard the current
|
||||||
* input buffer.
|
* input buffer.
|
||||||
* @param in_str A readable stream.
|
* @param in_str A readable stream.
|
||||||
*
|
*
|
||||||
* @see yy_switch_to_buffer
|
* @see yy_switch_to_buffer
|
||||||
*/
|
*/
|
||||||
void yyset_in (FILE * in_str )
|
void yyset_in (FILE * in_str )
|
||||||
@@ -2031,7 +1986,7 @@ static int yy_init_globals (void)
|
|||||||
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
|
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
|
||||||
int yylex_destroy (void)
|
int yylex_destroy (void)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Pop the buffer stack, destroying each element. */
|
/* Pop the buffer stack, destroying each element. */
|
||||||
while(YY_CURRENT_BUFFER){
|
while(YY_CURRENT_BUFFER){
|
||||||
yy_delete_buffer(YY_CURRENT_BUFFER );
|
yy_delete_buffer(YY_CURRENT_BUFFER );
|
||||||
@@ -2098,10 +2053,6 @@ void yyfree (void * ptr )
|
|||||||
|
|
||||||
#define YYTABLES_NAME "yytables"
|
#define YYTABLES_NAME "yytables"
|
||||||
|
|
||||||
#line 120 "dgn_comp.l"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* routine to switch to another input file; needed for flex */
|
/* routine to switch to another input file; needed for flex */
|
||||||
void
|
void
|
||||||
init_yyin( input_f )
|
init_yyin( input_f )
|
||||||
|
|||||||
+36
-138
@@ -1,26 +1,17 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
|
/* static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; */
|
||||||
|
/* static char nhsccsid[] = "@(#)yaccpar 1.9.0-nh (NetHack) 12/03/2015"; */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#define YYBYACC 1
|
#define YYBYACC 1
|
||||||
#define YYMAJOR 1
|
#define YYMAJOR 1
|
||||||
#define YYMINOR 9
|
#define YYMINOR 9
|
||||||
#define YYPATCH 20070509
|
#define YYSUBMINOR "0-nh"
|
||||||
|
|
||||||
#define YYEMPTY (-1)
|
#define yyclearin (yychar=(-1))
|
||||||
#define yyclearin (yychar = YYEMPTY)
|
#define yyerrok (yyerrflag=0)
|
||||||
#define yyerrok (yyerrflag = 0)
|
#define YYRECOVERING (yyerrflag!=0)
|
||||||
#define YYRECOVERING (yyerrflag != 0)
|
|
||||||
|
|
||||||
extern int yyparse(void);
|
|
||||||
|
|
||||||
static int yygrowstack(void);
|
|
||||||
#define YYPREFIX "yy"
|
#define YYPREFIX "yy"
|
||||||
#line 2 "dgn_comp.y"
|
/* NetHack 3.6 dgn_comp.y $NHDT-Date: 1449188840 2015/12/04 00:27:20 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ */
|
||||||
/* NetHack 3.6 dgn_comp.y $NHDT-Date: 1432512785 2015/05/25 00:13:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
|
||||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||||
/* Copyright (c) 1990 by M. Stephenson */
|
/* Copyright (c) 1990 by M. Stephenson */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -82,13 +73,11 @@ extern int fatal_error;
|
|||||||
extern const char *fname;
|
extern const char *fname;
|
||||||
extern FILE *yyin, *yyout; /* from dgn_lex.c */
|
extern FILE *yyin, *yyout; /* from dgn_lex.c */
|
||||||
|
|
||||||
#line 66 "dgn_comp.y"
|
|
||||||
typedef union
|
typedef union
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char* str;
|
char* str;
|
||||||
} YYSTYPE;
|
} YYSTYPE;
|
||||||
#line 92 "y.tab.c"
|
|
||||||
#define INTEGER 257
|
#define INTEGER 257
|
||||||
#define A_DUNGEON 258
|
#define A_DUNGEON 258
|
||||||
#define BRANCH 259
|
#define BRANCH 259
|
||||||
@@ -323,40 +312,28 @@ char *yyrule[] = {
|
|||||||
"rcouple : '(' INTEGER ',' INTEGER ')'",
|
"rcouple : '(' INTEGER ',' INTEGER ')'",
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if YYDEBUG
|
|
||||||
#include <stdio.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* define the initial stack-sizes */
|
|
||||||
#ifdef YYSTACKSIZE
|
#ifdef YYSTACKSIZE
|
||||||
#undef YYMAXDEPTH
|
#undef YYMAXDEPTH
|
||||||
#define YYMAXDEPTH YYSTACKSIZE
|
#define YYMAXDEPTH YYSTACKSIZE
|
||||||
#else
|
#else
|
||||||
#ifdef YYMAXDEPTH
|
#ifdef YYMAXDEPTH
|
||||||
#define YYSTACKSIZE YYMAXDEPTH
|
#define YYSTACKSIZE YYMAXDEPTH
|
||||||
#else
|
#else
|
||||||
#define YYSTACKSIZE 10000
|
#define YYSTACKSIZE 500
|
||||||
#define YYMAXDEPTH 10000
|
#define YYMAXDEPTH 500
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
int yydebug;
|
||||||
#define YYINITSTACKSIZE 500
|
int yynerrs;
|
||||||
|
int yyerrflag;
|
||||||
int yydebug;
|
int yychar;
|
||||||
int yynerrs;
|
short *yyssp;
|
||||||
int yyerrflag;
|
|
||||||
int yychar;
|
|
||||||
short *yyssp;
|
|
||||||
YYSTYPE *yyvsp;
|
YYSTYPE *yyvsp;
|
||||||
YYSTYPE yyval;
|
YYSTYPE yyval;
|
||||||
YYSTYPE yylval;
|
YYSTYPE yylval;
|
||||||
|
short yyss[YYSTACKSIZE];
|
||||||
/* variables for the parser stack */
|
YYSTYPE yyvs[YYSTACKSIZE];
|
||||||
static short *yyss;
|
#define yystacksize YYSTACKSIZE
|
||||||
static short *yysslim;
|
|
||||||
static YYSTYPE *yyvs;
|
|
||||||
static int yystacksize;
|
|
||||||
#line 433 "dgn_comp.y"
|
|
||||||
|
|
||||||
void
|
void
|
||||||
init_dungeon()
|
init_dungeon()
|
||||||
@@ -603,53 +580,17 @@ output_dgn()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*dgn_comp.y*/
|
/*dgn_comp.y*/
|
||||||
#line 607 "y.tab.c"
|
|
||||||
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
|
|
||||||
static int yygrowstack(void)
|
|
||||||
{
|
|
||||||
int newsize, i;
|
|
||||||
short *newss;
|
|
||||||
YYSTYPE *newvs;
|
|
||||||
|
|
||||||
if ((newsize = yystacksize) == 0)
|
|
||||||
newsize = YYINITSTACKSIZE;
|
|
||||||
else if (newsize >= YYMAXDEPTH)
|
|
||||||
return -1;
|
|
||||||
else if ((newsize *= 2) > YYMAXDEPTH)
|
|
||||||
newsize = YYMAXDEPTH;
|
|
||||||
|
|
||||||
i = yyssp - yyss;
|
|
||||||
newss = (yyss != 0)
|
|
||||||
? (short *)realloc(yyss, newsize * sizeof(*newss))
|
|
||||||
: (short *)malloc(newsize * sizeof(*newss));
|
|
||||||
if (newss == 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
yyss = newss;
|
|
||||||
yyssp = newss + i;
|
|
||||||
newvs = (yyvs != 0)
|
|
||||||
? (YYSTYPE *)realloc(yyvs, newsize * sizeof(*newvs))
|
|
||||||
: (YYSTYPE *)malloc(newsize * sizeof(*newvs));
|
|
||||||
if (newvs == 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
yyvs = newvs;
|
|
||||||
yyvsp = newvs + i;
|
|
||||||
yystacksize = newsize;
|
|
||||||
yysslim = yyss + newsize - 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define YYABORT goto yyabort
|
#define YYABORT goto yyabort
|
||||||
#define YYREJECT goto yyabort
|
#define YYREJECT goto yyabort
|
||||||
#define YYACCEPT goto yyaccept
|
#define YYACCEPT goto yyaccept
|
||||||
#define YYERROR goto yyerrlab
|
#define YYERROR goto yyerrlab
|
||||||
int
|
int
|
||||||
yyparse(void)
|
yyparse()
|
||||||
{
|
{
|
||||||
register int yym, yyn, yystate;
|
register int yym, yyn, yystate;
|
||||||
#if YYDEBUG
|
#if YYDEBUG
|
||||||
register const char *yys;
|
register char *yys;
|
||||||
|
extern char *getenv();
|
||||||
|
|
||||||
if ((yys = getenv("YYDEBUG")) != 0)
|
if ((yys = getenv("YYDEBUG")) != 0)
|
||||||
{
|
{
|
||||||
@@ -661,9 +602,8 @@ yyparse(void)
|
|||||||
|
|
||||||
yynerrs = 0;
|
yynerrs = 0;
|
||||||
yyerrflag = 0;
|
yyerrflag = 0;
|
||||||
yychar = YYEMPTY;
|
yychar = (-1);
|
||||||
|
|
||||||
if (yyss == NULL && yygrowstack()) goto yyoverflow;
|
|
||||||
yyssp = yyss;
|
yyssp = yyss;
|
||||||
yyvsp = yyvs;
|
yyvsp = yyvs;
|
||||||
*yyssp = yystate = 0;
|
*yyssp = yystate = 0;
|
||||||
@@ -684,7 +624,7 @@ yyloop:
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
|
if ((yyn = yysindex[yystate]) != 0 && (yyn += yychar) >= 0 &&
|
||||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||||
{
|
{
|
||||||
#if YYDEBUG
|
#if YYDEBUG
|
||||||
@@ -692,40 +632,36 @@ yyloop:
|
|||||||
printf("%sdebug: state %d, shifting to state %d\n",
|
printf("%sdebug: state %d, shifting to state %d\n",
|
||||||
YYPREFIX, yystate, yytable[yyn]);
|
YYPREFIX, yystate, yytable[yyn]);
|
||||||
#endif
|
#endif
|
||||||
if (yyssp >= yysslim && yygrowstack())
|
if (yyssp >= yyss + yystacksize - 1)
|
||||||
{
|
{
|
||||||
goto yyoverflow;
|
goto yyoverflow;
|
||||||
}
|
}
|
||||||
*++yyssp = yystate = yytable[yyn];
|
*++yyssp = yystate = yytable[yyn];
|
||||||
*++yyvsp = yylval;
|
*++yyvsp = yylval;
|
||||||
yychar = YYEMPTY;
|
yychar = (-1);
|
||||||
if (yyerrflag > 0) --yyerrflag;
|
if (yyerrflag > 0) --yyerrflag;
|
||||||
goto yyloop;
|
goto yyloop;
|
||||||
}
|
}
|
||||||
if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
|
if ((yyn = yyrindex[yystate]) != 0 && (yyn += yychar) >= 0 &&
|
||||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||||
{
|
{
|
||||||
yyn = yytable[yyn];
|
yyn = yytable[yyn];
|
||||||
goto yyreduce;
|
goto yyreduce;
|
||||||
}
|
}
|
||||||
if (yyerrflag) goto yyinrecovery;
|
if (yyerrflag) goto yyinrecovery;
|
||||||
|
goto yynewerror;
|
||||||
|
yynewerror:
|
||||||
yyerror("syntax error");
|
yyerror("syntax error");
|
||||||
|
|
||||||
#ifdef lint
|
|
||||||
goto yyerrlab;
|
goto yyerrlab;
|
||||||
#endif
|
|
||||||
|
|
||||||
yyerrlab:
|
yyerrlab:
|
||||||
++yynerrs;
|
++yynerrs;
|
||||||
|
|
||||||
yyinrecovery:
|
yyinrecovery:
|
||||||
if (yyerrflag < 3)
|
if (yyerrflag < 3)
|
||||||
{
|
{
|
||||||
yyerrflag = 3;
|
yyerrflag = 3;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
|
if ((yyn = yysindex[*yyssp]) != 0 && (yyn += YYERRCODE) >= 0 &&
|
||||||
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
|
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
|
||||||
{
|
{
|
||||||
#if YYDEBUG
|
#if YYDEBUG
|
||||||
@@ -733,7 +669,7 @@ yyinrecovery:
|
|||||||
printf("%sdebug: state %d, error recovery shifting\
|
printf("%sdebug: state %d, error recovery shifting\
|
||||||
to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
|
to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
|
||||||
#endif
|
#endif
|
||||||
if (yyssp >= yysslim && yygrowstack())
|
if (yyssp >= yyss + yystacksize - 1)
|
||||||
{
|
{
|
||||||
goto yyoverflow;
|
goto yyoverflow;
|
||||||
}
|
}
|
||||||
@@ -767,10 +703,9 @@ yyinrecovery:
|
|||||||
YYPREFIX, yystate, yychar, yys);
|
YYPREFIX, yystate, yychar, yys);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
yychar = YYEMPTY;
|
yychar = (-1);
|
||||||
goto yyloop;
|
goto yyloop;
|
||||||
}
|
}
|
||||||
|
|
||||||
yyreduce:
|
yyreduce:
|
||||||
#if YYDEBUG
|
#if YYDEBUG
|
||||||
if (yydebug)
|
if (yydebug)
|
||||||
@@ -778,20 +713,15 @@ yyreduce:
|
|||||||
YYPREFIX, yystate, yyn, yyrule[yyn]);
|
YYPREFIX, yystate, yyn, yyrule[yyn]);
|
||||||
#endif
|
#endif
|
||||||
yym = yylen[yyn];
|
yym = yylen[yyn];
|
||||||
if (yym)
|
yyval = yyvsp[1-yym];
|
||||||
yyval = yyvsp[1-yym];
|
|
||||||
else
|
|
||||||
memset(&yyval, 0, sizeof yyval);
|
|
||||||
switch (yyn)
|
switch (yyn)
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
#line 83 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
output_dgn();
|
output_dgn();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
#line 99 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
init_dungeon();
|
init_dungeon();
|
||||||
Strcpy(tmpdungeon[n_dgns].name, yyvsp[-3].str);
|
Strcpy(tmpdungeon[n_dgns].name, yyvsp[-3].str);
|
||||||
@@ -803,25 +733,21 @@ case 9:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
#line 111 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
yyval.i = 0;
|
yyval.i = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
#line 115 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
yyval.i = yyvsp[0].i;
|
yyval.i = yyvsp[0].i;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
#line 126 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
tmpdungeon[n_dgns].entry_lev = yyvsp[0].i;
|
tmpdungeon[n_dgns].entry_lev = yyvsp[0].i;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
#line 135 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
if(yyvsp[0].i <= TOWN || yyvsp[0].i >= D_ALIGN_CHAOTIC)
|
if(yyvsp[0].i <= TOWN || yyvsp[0].i >= D_ALIGN_CHAOTIC)
|
||||||
yyerror("Illegal description - ignoring!");
|
yyerror("Illegal description - ignoring!");
|
||||||
@@ -830,7 +756,6 @@ case 17:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 18:
|
case 18:
|
||||||
#line 142 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC)
|
if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC)
|
||||||
yyerror("Illegal alignment - ignoring!");
|
yyerror("Illegal alignment - ignoring!");
|
||||||
@@ -839,14 +764,12 @@ case 18:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 19:
|
case 19:
|
||||||
#line 151 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
Strcpy(tmpdungeon[n_dgns].protoname, yyvsp[0].str);
|
Strcpy(tmpdungeon[n_dgns].protoname, yyvsp[0].str);
|
||||||
Free(yyvsp[0].str);
|
Free(yyvsp[0].str);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 25:
|
case 25:
|
||||||
#line 165 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
init_level();
|
init_level();
|
||||||
Strcpy(tmplevel[n_levs].name, yyvsp[-3].str);
|
Strcpy(tmplevel[n_levs].name, yyvsp[-3].str);
|
||||||
@@ -858,7 +781,6 @@ case 25:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 26:
|
case 26:
|
||||||
#line 175 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
init_level();
|
init_level();
|
||||||
Strcpy(tmplevel[n_levs].name, yyvsp[-4].str);
|
Strcpy(tmplevel[n_levs].name, yyvsp[-4].str);
|
||||||
@@ -871,7 +793,6 @@ case 26:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 27:
|
case 27:
|
||||||
#line 188 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
init_level();
|
init_level();
|
||||||
Strcpy(tmplevel[n_levs].name, yyvsp[-4].str);
|
Strcpy(tmplevel[n_levs].name, yyvsp[-4].str);
|
||||||
@@ -884,7 +805,6 @@ case 27:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 28:
|
case 28:
|
||||||
#line 199 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
init_level();
|
init_level();
|
||||||
Strcpy(tmplevel[n_levs].name, yyvsp[-5].str);
|
Strcpy(tmplevel[n_levs].name, yyvsp[-5].str);
|
||||||
@@ -898,7 +818,6 @@ case 28:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 29:
|
case 29:
|
||||||
#line 213 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
if(yyvsp[0].i >= D_ALIGN_CHAOTIC)
|
if(yyvsp[0].i >= D_ALIGN_CHAOTIC)
|
||||||
yyerror("Illegal description - ignoring!");
|
yyerror("Illegal description - ignoring!");
|
||||||
@@ -907,7 +826,6 @@ case 29:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 30:
|
case 30:
|
||||||
#line 220 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC)
|
if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC)
|
||||||
yyerror("Illegal alignment - ignoring!");
|
yyerror("Illegal alignment - ignoring!");
|
||||||
@@ -916,7 +834,6 @@ case 30:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 31:
|
case 31:
|
||||||
#line 229 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
init_level();
|
init_level();
|
||||||
Strcpy(tmplevel[n_levs].name, yyvsp[-4].str);
|
Strcpy(tmplevel[n_levs].name, yyvsp[-4].str);
|
||||||
@@ -931,7 +848,6 @@ case 31:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
#line 242 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
init_level();
|
init_level();
|
||||||
Strcpy(tmplevel[n_levs].name, yyvsp[-5].str);
|
Strcpy(tmplevel[n_levs].name, yyvsp[-5].str);
|
||||||
@@ -947,7 +863,6 @@ case 32:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 33:
|
case 33:
|
||||||
#line 258 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
init_level();
|
init_level();
|
||||||
Strcpy(tmplevel[n_levs].name, yyvsp[-5].str);
|
Strcpy(tmplevel[n_levs].name, yyvsp[-5].str);
|
||||||
@@ -963,7 +878,6 @@ case 33:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 34:
|
case 34:
|
||||||
#line 272 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
init_level();
|
init_level();
|
||||||
Strcpy(tmplevel[n_levs].name, yyvsp[-6].str);
|
Strcpy(tmplevel[n_levs].name, yyvsp[-6].str);
|
||||||
@@ -980,7 +894,6 @@ case 34:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 37:
|
case 37:
|
||||||
#line 293 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
init_branch();
|
init_branch();
|
||||||
Strcpy(tmpbranch[n_brs].name, yyvsp[-4].str);
|
Strcpy(tmpbranch[n_brs].name, yyvsp[-4].str);
|
||||||
@@ -994,7 +907,6 @@ case 37:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 38:
|
case 38:
|
||||||
#line 307 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
init_branch();
|
init_branch();
|
||||||
Strcpy(tmpbranch[n_brs].name, yyvsp[-5].str);
|
Strcpy(tmpbranch[n_brs].name, yyvsp[-5].str);
|
||||||
@@ -1010,49 +922,41 @@ case 38:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 39:
|
case 39:
|
||||||
#line 323 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
yyval.i = TBR_STAIR; /* two way stair */
|
yyval.i = TBR_STAIR; /* two way stair */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 40:
|
case 40:
|
||||||
#line 327 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
yyval.i = TBR_STAIR; /* two way stair */
|
yyval.i = TBR_STAIR; /* two way stair */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 41:
|
case 41:
|
||||||
#line 331 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
yyval.i = TBR_NO_UP; /* no up staircase */
|
yyval.i = TBR_NO_UP; /* no up staircase */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 42:
|
case 42:
|
||||||
#line 335 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
yyval.i = TBR_NO_DOWN; /* no down staircase */
|
yyval.i = TBR_NO_DOWN; /* no down staircase */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 43:
|
case 43:
|
||||||
#line 339 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
yyval.i = TBR_PORTAL; /* portal connection */
|
yyval.i = TBR_PORTAL; /* portal connection */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 44:
|
case 44:
|
||||||
#line 345 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
yyval.i = 0; /* defaults to down */
|
yyval.i = 0; /* defaults to down */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 45:
|
case 45:
|
||||||
#line 349 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
yyval.i = yyvsp[0].i;
|
yyval.i = yyvsp[0].i;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 46:
|
case 46:
|
||||||
#line 355 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
char *p = yyvsp[0].str;
|
char *p = yyvsp[0].str;
|
||||||
if (strlen(p) != 1) {
|
if (strlen(p) != 1) {
|
||||||
@@ -1065,7 +969,6 @@ case 46:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 47:
|
case 47:
|
||||||
#line 385 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) {
|
if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) {
|
||||||
yyerror("Abs base out of dlevel range - zeroing!");
|
yyerror("Abs base out of dlevel range - zeroing!");
|
||||||
@@ -1082,7 +985,6 @@ case 47:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 48:
|
case 48:
|
||||||
#line 422 "dgn_comp.y"
|
|
||||||
{
|
{
|
||||||
if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) {
|
if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) {
|
||||||
yyerror("Rel base out of dlevel range - zeroing!");
|
yyerror("Rel base out of dlevel range - zeroing!");
|
||||||
@@ -1093,7 +995,6 @@ case 48:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#line 1097 "y.tab.c"
|
|
||||||
}
|
}
|
||||||
yyssp -= yym;
|
yyssp -= yym;
|
||||||
yystate = *yyssp;
|
yystate = *yyssp;
|
||||||
@@ -1126,7 +1027,7 @@ break;
|
|||||||
if (yychar == 0) goto yyaccept;
|
if (yychar == 0) goto yyaccept;
|
||||||
goto yyloop;
|
goto yyloop;
|
||||||
}
|
}
|
||||||
if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
|
if ((yyn = yygindex[yym]) != 0 && (yyn += yystate) >= 0 &&
|
||||||
yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
|
yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
|
||||||
yystate = yytable[yyn];
|
yystate = yytable[yyn];
|
||||||
else
|
else
|
||||||
@@ -1136,20 +1037,17 @@ break;
|
|||||||
printf("%sdebug: after reduction, shifting from state %d \
|
printf("%sdebug: after reduction, shifting from state %d \
|
||||||
to state %d\n", YYPREFIX, *yyssp, yystate);
|
to state %d\n", YYPREFIX, *yyssp, yystate);
|
||||||
#endif
|
#endif
|
||||||
if (yyssp >= yysslim && yygrowstack())
|
if (yyssp >= yyss + yystacksize - 1)
|
||||||
{
|
{
|
||||||
goto yyoverflow;
|
goto yyoverflow;
|
||||||
}
|
}
|
||||||
*++yyssp = yystate;
|
*++yyssp = yystate;
|
||||||
*++yyvsp = yyval;
|
*++yyvsp = yyval;
|
||||||
goto yyloop;
|
goto yyloop;
|
||||||
|
|
||||||
yyoverflow:
|
yyoverflow:
|
||||||
yyerror("yacc stack overflow");
|
yyerror("yacc stack overflow");
|
||||||
|
|
||||||
yyabort:
|
yyabort:
|
||||||
return (1);
|
return (1);
|
||||||
|
|
||||||
yyaccept:
|
yyaccept:
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|||||||
+41
-254
File diff suppressed because it is too large
Load Diff
+3797
-4689
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user