diff --git a/.gitignore b/.gitignore index 302497de0..4f8be313f 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ Makefile # Win32-specific ignores binary/ build/ +ipch/ Nethack.sln Nethack.sdf Nethack.opensdf diff --git a/dat/mines.des b/dat/mines.des index 8382ac777..151026ff1 100644 --- a/dat/mines.des +++ b/dat/mines.des @@ -131,7 +131,7 @@ OBJECT:('%',"corpse"),random,montype:"watch captain" # Rubble! LOOP [9 + 2d5] { - OBJECT[90%]:('`',"boulder"),random + [90%]: OBJECT:('`',"boulder"),random OBJECT:('*',"rock"),random } @@ -158,9 +158,15 @@ $inside = selection: floodfill(18,8) $near_temple = selection: filter(fillrect(17,8, 23,14), $inside) LOOP [5 + 1d10] { - MONSTER[50%]: ('o', "orc-captain"), rndcoord($inside), hostile - MONSTER[80%]: ('o', "Uruk-hai"), rndcoord($inside), hostile - MONSTER: ('o', "Mordor orc"), rndcoord($inside), hostile + IF [50%] { + MONSTER: ('o', "orc-captain"), rndcoord($inside), hostile + } ELSE { + IF [80%] { + MONSTER: ('o', "Uruk-hai"), rndcoord($inside), hostile + } ELSE { + MONSTER: ('o', "Mordor orc"), rndcoord($inside), hostile + } + } } # shamans can be hanging out in/near the temple LOOP [2d3] { @@ -169,11 +175,14 @@ LOOP [2d3] { # these are not such a big deal # to run into outside the bars LOOP [9 + 2d5] { - MONSTER[90%]: ('o', "hill orc"), random, hostile - MONSTER: ('o', "goblin"), random, hostile + IF [90%] { + MONSTER: ('o', "hill orc"), random, hostile + } ELSE { + MONSTER: ('o', "goblin"), random, hostile + } } -WALLIFY:(1,0, 70,20) +WALLIFY # Minetown variant 2 diff --git a/include/ntconf.h b/include/ntconf.h index 95a506635..6a22e1cf3 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -124,8 +124,15 @@ extern void FDECL(interject, (int)); #define strncmpi(a,b,c) strnicmp(a,b,c) #endif +/* Visual Studio defines this in their own headers, which we don't use */ +#ifndef snprintf +#define snprintf _snprintf +#pragma warning(disable:4996) /* deprecation warning suggesting snprintf_s */ +#endif + #include #include +#include #ifdef __BORLANDC__ #undef randomize #undef random diff --git a/src/sp_lev.c b/src/sp_lev.c index 46334a4ab..c779d700e 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -3440,20 +3440,21 @@ line_dist_coord(x1,y1, x2,y2, x3,y3) { long px = x2-x1; long py = y2-y1; + long s = px*px + py*py; + long x, y, dx, dy, dist = 0; + float u = 0; if (x1 == x2 && y1 == y2) return isqrt(dist2(x1,y1, x3,y3)); - long s = px*px + py*py; - float u = ((x3 - x1) * px + (y3 - y1) * py) / (float)s; - + u = ((x3 - x1) * px + (y3 - y1) * py) / (float)s; if (u > 1) u = 1; else if (u < 0) u = 0; - long x = x1 + u * px; - long y = y1 + u * py; - long dx = x - x3; - long dy = y - y3; - long dist = isqrt(dx*dx + dy*dy); + x = x1 + u * px; + y = y1 + u * py; + dx = x - x3; + dy = y - y3; + dist = isqrt(dx*dx + dy*dy); return dist; } diff --git a/sys/share/lev_comp.h b/sys/share/lev_comp.h index 8152d608a..2ea389931 100644 --- a/sys/share/lev_comp.h +++ b/sys/share/lev_comp.h @@ -1,79 +1,451 @@ -#define CHAR 257 -#define INTEGER 258 -#define BOOLEAN 259 -#define PERCENT 260 -#define MESSAGE_ID 261 -#define MAZE_ID 262 -#define LEVEL_ID 263 -#define LEV_INIT_ID 264 -#define GEOMETRY_ID 265 -#define NOMAP_ID 266 -#define OBJECT_ID 267 -#define COBJECT_ID 268 -#define MONSTER_ID 269 -#define TRAP_ID 270 -#define DOOR_ID 271 -#define DRAWBRIDGE_ID 272 -#define MAZEWALK_ID 273 -#define WALLIFY_ID 274 -#define REGION_ID 275 -#define FILLING 276 -#define RANDOM_OBJECTS_ID 277 -#define RANDOM_MONSTERS_ID 278 -#define RANDOM_PLACES_ID 279 -#define ALTAR_ID 280 -#define LADDER_ID 281 -#define STAIR_ID 282 -#define NON_DIGGABLE_ID 283 -#define NON_PASSWALL_ID 284 -#define ROOM_ID 285 -#define PORTAL_ID 286 -#define TELEPRT_ID 287 -#define BRANCH_ID 288 -#define LEV 289 -#define CHANCE_ID 290 -#define CORRIDOR_ID 291 -#define GOLD_ID 292 -#define ENGRAVING_ID 293 -#define FOUNTAIN_ID 294 -#define POOL_ID 295 -#define SINK_ID 296 -#define NONE 297 -#define RAND_CORRIDOR_ID 298 -#define DOOR_STATE 299 -#define LIGHT_STATE 300 -#define CURSE_TYPE 301 -#define ENGRAVING_TYPE 302 -#define DIRECTION 303 -#define RANDOM_TYPE 304 -#define O_REGISTER 305 -#define M_REGISTER 306 -#define P_REGISTER 307 -#define A_REGISTER 308 -#define ALIGNMENT 309 -#define LEFT_OR_RIGHT 310 -#define CENTER 311 -#define TOP_OR_BOT 312 -#define ALTAR_TYPE 313 -#define UP_OR_DOWN 314 -#define SUBROOM_ID 315 -#define NAME_ID 316 -#define FLAGS_ID 317 -#define FLAG_TYPE 318 -#define MON_ATTITUDE 319 -#define MON_ALERTNESS 320 -#define MON_APPEARANCE 321 -#define CONTAINED 322 -#define STRING 323 -#define MAP_ID 324 -typedef union + +/* A Bison parser, made by GNU Bison 2.4.1. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + CHAR = 258, + INTEGER = 259, + BOOLEAN = 260, + PERCENT = 261, + SPERCENT = 262, + MINUS_INTEGER = 263, + PLUS_INTEGER = 264, + MAZE_GRID_ID = 265, + SOLID_FILL_ID = 266, + MINES_ID = 267, + ROGUELEV_ID = 268, + MESSAGE_ID = 269, + MAZE_ID = 270, + LEVEL_ID = 271, + LEV_INIT_ID = 272, + GEOMETRY_ID = 273, + NOMAP_ID = 274, + OBJECT_ID = 275, + COBJECT_ID = 276, + MONSTER_ID = 277, + TRAP_ID = 278, + DOOR_ID = 279, + DRAWBRIDGE_ID = 280, + object_ID = 281, + monster_ID = 282, + terrain_ID = 283, + MAZEWALK_ID = 284, + WALLIFY_ID = 285, + REGION_ID = 286, + FILLING = 287, + IRREGULAR = 288, + JOINED = 289, + ALTAR_ID = 290, + LADDER_ID = 291, + STAIR_ID = 292, + NON_DIGGABLE_ID = 293, + NON_PASSWALL_ID = 294, + ROOM_ID = 295, + PORTAL_ID = 296, + TELEPRT_ID = 297, + BRANCH_ID = 298, + LEV = 299, + MINERALIZE_ID = 300, + CORRIDOR_ID = 301, + GOLD_ID = 302, + ENGRAVING_ID = 303, + FOUNTAIN_ID = 304, + POOL_ID = 305, + SINK_ID = 306, + NONE = 307, + RAND_CORRIDOR_ID = 308, + DOOR_STATE = 309, + LIGHT_STATE = 310, + CURSE_TYPE = 311, + ENGRAVING_TYPE = 312, + DIRECTION = 313, + RANDOM_TYPE = 314, + RANDOM_TYPE_BRACKET = 315, + A_REGISTER = 316, + ALIGNMENT = 317, + LEFT_OR_RIGHT = 318, + CENTER = 319, + TOP_OR_BOT = 320, + ALTAR_TYPE = 321, + UP_OR_DOWN = 322, + SUBROOM_ID = 323, + NAME_ID = 324, + FLAGS_ID = 325, + FLAG_TYPE = 326, + MON_ATTITUDE = 327, + MON_ALERTNESS = 328, + MON_APPEARANCE = 329, + ROOMDOOR_ID = 330, + IF_ID = 331, + ELSE_ID = 332, + TERRAIN_ID = 333, + HORIZ_OR_VERT = 334, + REPLACE_TERRAIN_ID = 335, + EXIT_ID = 336, + SHUFFLE_ID = 337, + QUANTITY_ID = 338, + BURIED_ID = 339, + LOOP_ID = 340, + FOR_ID = 341, + TO_ID = 342, + SWITCH_ID = 343, + CASE_ID = 344, + BREAK_ID = 345, + DEFAULT_ID = 346, + ERODED_ID = 347, + TRAPPED_ID = 348, + RECHARGED_ID = 349, + INVIS_ID = 350, + GREASED_ID = 351, + FEMALE_ID = 352, + CANCELLED_ID = 353, + REVIVED_ID = 354, + AVENGE_ID = 355, + FLEEING_ID = 356, + BLINDED_ID = 357, + PARALYZED_ID = 358, + STUNNED_ID = 359, + CONFUSED_ID = 360, + SEENTRAPS_ID = 361, + ALL_ID = 362, + MONTYPE_ID = 363, + GRAVE_ID = 364, + ERODEPROOF_ID = 365, + FUNCTION_ID = 366, + MSG_OUTPUT_TYPE = 367, + COMPARE_TYPE = 368, + UNKNOWN_TYPE = 369, + rect_ID = 370, + fillrect_ID = 371, + line_ID = 372, + randline_ID = 373, + grow_ID = 374, + selection_ID = 375, + flood_ID = 376, + rndcoord_ID = 377, + circle_ID = 378, + ellipse_ID = 379, + filter_ID = 380, + complement_ID = 381, + gradient_ID = 382, + GRADIENT_TYPE = 383, + LIMITED = 384, + HUMIDITY_TYPE = 385, + STRING = 386, + MAP_ID = 387, + NQSTRING = 388, + VARSTRING = 389, + CFUNC = 390, + CFUNC_INT = 391, + CFUNC_STR = 392, + CFUNC_COORD = 393, + CFUNC_REGION = 394, + VARSTRING_INT = 395, + VARSTRING_INT_ARRAY = 396, + VARSTRING_STRING = 397, + VARSTRING_STRING_ARRAY = 398, + VARSTRING_VAR = 399, + VARSTRING_VAR_ARRAY = 400, + VARSTRING_COORD = 401, + VARSTRING_COORD_ARRAY = 402, + VARSTRING_REGION = 403, + VARSTRING_REGION_ARRAY = 404, + VARSTRING_MAPCHAR = 405, + VARSTRING_MAPCHAR_ARRAY = 406, + VARSTRING_MONST = 407, + VARSTRING_MONST_ARRAY = 408, + VARSTRING_OBJ = 409, + VARSTRING_OBJ_ARRAY = 410, + VARSTRING_SEL = 411, + VARSTRING_SEL_ARRAY = 412, + METHOD_INT = 413, + METHOD_INT_ARRAY = 414, + METHOD_STRING = 415, + METHOD_STRING_ARRAY = 416, + METHOD_VAR = 417, + METHOD_VAR_ARRAY = 418, + METHOD_COORD = 419, + METHOD_COORD_ARRAY = 420, + METHOD_REGION = 421, + METHOD_REGION_ARRAY = 422, + METHOD_MAPCHAR = 423, + METHOD_MAPCHAR_ARRAY = 424, + METHOD_MONST = 425, + METHOD_MONST_ARRAY = 426, + METHOD_OBJ = 427, + METHOD_OBJ_ARRAY = 428, + METHOD_SEL = 429, + METHOD_SEL_ARRAY = 430, + DICE = 431 + }; +#endif +/* Tokens. */ +#define CHAR 258 +#define INTEGER 259 +#define BOOLEAN 260 +#define PERCENT 261 +#define SPERCENT 262 +#define MINUS_INTEGER 263 +#define PLUS_INTEGER 264 +#define MAZE_GRID_ID 265 +#define SOLID_FILL_ID 266 +#define MINES_ID 267 +#define ROGUELEV_ID 268 +#define MESSAGE_ID 269 +#define MAZE_ID 270 +#define LEVEL_ID 271 +#define LEV_INIT_ID 272 +#define GEOMETRY_ID 273 +#define NOMAP_ID 274 +#define OBJECT_ID 275 +#define COBJECT_ID 276 +#define MONSTER_ID 277 +#define TRAP_ID 278 +#define DOOR_ID 279 +#define DRAWBRIDGE_ID 280 +#define object_ID 281 +#define monster_ID 282 +#define terrain_ID 283 +#define MAZEWALK_ID 284 +#define WALLIFY_ID 285 +#define REGION_ID 286 +#define FILLING 287 +#define IRREGULAR 288 +#define JOINED 289 +#define ALTAR_ID 290 +#define LADDER_ID 291 +#define STAIR_ID 292 +#define NON_DIGGABLE_ID 293 +#define NON_PASSWALL_ID 294 +#define ROOM_ID 295 +#define PORTAL_ID 296 +#define TELEPRT_ID 297 +#define BRANCH_ID 298 +#define LEV 299 +#define MINERALIZE_ID 300 +#define CORRIDOR_ID 301 +#define GOLD_ID 302 +#define ENGRAVING_ID 303 +#define FOUNTAIN_ID 304 +#define POOL_ID 305 +#define SINK_ID 306 +#define NONE 307 +#define RAND_CORRIDOR_ID 308 +#define DOOR_STATE 309 +#define LIGHT_STATE 310 +#define CURSE_TYPE 311 +#define ENGRAVING_TYPE 312 +#define DIRECTION 313 +#define RANDOM_TYPE 314 +#define RANDOM_TYPE_BRACKET 315 +#define A_REGISTER 316 +#define ALIGNMENT 317 +#define LEFT_OR_RIGHT 318 +#define CENTER 319 +#define TOP_OR_BOT 320 +#define ALTAR_TYPE 321 +#define UP_OR_DOWN 322 +#define SUBROOM_ID 323 +#define NAME_ID 324 +#define FLAGS_ID 325 +#define FLAG_TYPE 326 +#define MON_ATTITUDE 327 +#define MON_ALERTNESS 328 +#define MON_APPEARANCE 329 +#define ROOMDOOR_ID 330 +#define IF_ID 331 +#define ELSE_ID 332 +#define TERRAIN_ID 333 +#define HORIZ_OR_VERT 334 +#define REPLACE_TERRAIN_ID 335 +#define EXIT_ID 336 +#define SHUFFLE_ID 337 +#define QUANTITY_ID 338 +#define BURIED_ID 339 +#define LOOP_ID 340 +#define FOR_ID 341 +#define TO_ID 342 +#define SWITCH_ID 343 +#define CASE_ID 344 +#define BREAK_ID 345 +#define DEFAULT_ID 346 +#define ERODED_ID 347 +#define TRAPPED_ID 348 +#define RECHARGED_ID 349 +#define INVIS_ID 350 +#define GREASED_ID 351 +#define FEMALE_ID 352 +#define CANCELLED_ID 353 +#define REVIVED_ID 354 +#define AVENGE_ID 355 +#define FLEEING_ID 356 +#define BLINDED_ID 357 +#define PARALYZED_ID 358 +#define STUNNED_ID 359 +#define CONFUSED_ID 360 +#define SEENTRAPS_ID 361 +#define ALL_ID 362 +#define MONTYPE_ID 363 +#define GRAVE_ID 364 +#define ERODEPROOF_ID 365 +#define FUNCTION_ID 366 +#define MSG_OUTPUT_TYPE 367 +#define COMPARE_TYPE 368 +#define UNKNOWN_TYPE 369 +#define rect_ID 370 +#define fillrect_ID 371 +#define line_ID 372 +#define randline_ID 373 +#define grow_ID 374 +#define selection_ID 375 +#define flood_ID 376 +#define rndcoord_ID 377 +#define circle_ID 378 +#define ellipse_ID 379 +#define filter_ID 380 +#define complement_ID 381 +#define gradient_ID 382 +#define GRADIENT_TYPE 383 +#define LIMITED 384 +#define HUMIDITY_TYPE 385 +#define STRING 386 +#define MAP_ID 387 +#define NQSTRING 388 +#define VARSTRING 389 +#define CFUNC 390 +#define CFUNC_INT 391 +#define CFUNC_STR 392 +#define CFUNC_COORD 393 +#define CFUNC_REGION 394 +#define VARSTRING_INT 395 +#define VARSTRING_INT_ARRAY 396 +#define VARSTRING_STRING 397 +#define VARSTRING_STRING_ARRAY 398 +#define VARSTRING_VAR 399 +#define VARSTRING_VAR_ARRAY 400 +#define VARSTRING_COORD 401 +#define VARSTRING_COORD_ARRAY 402 +#define VARSTRING_REGION 403 +#define VARSTRING_REGION_ARRAY 404 +#define VARSTRING_MAPCHAR 405 +#define VARSTRING_MAPCHAR_ARRAY 406 +#define VARSTRING_MONST 407 +#define VARSTRING_MONST_ARRAY 408 +#define VARSTRING_OBJ 409 +#define VARSTRING_OBJ_ARRAY 410 +#define VARSTRING_SEL 411 +#define VARSTRING_SEL_ARRAY 412 +#define METHOD_INT 413 +#define METHOD_INT_ARRAY 414 +#define METHOD_STRING 415 +#define METHOD_STRING_ARRAY 416 +#define METHOD_VAR 417 +#define METHOD_VAR_ARRAY 418 +#define METHOD_COORD 419 +#define METHOD_COORD_ARRAY 420 +#define METHOD_REGION 421 +#define METHOD_REGION_ARRAY 422 +#define METHOD_MAPCHAR 423 +#define METHOD_MAPCHAR_ARRAY 424 +#define METHOD_MONST 425 +#define METHOD_MONST_ARRAY 426 +#define METHOD_OBJ 427 +#define METHOD_OBJ_ARRAY 428 +#define METHOD_SEL 429 +#define METHOD_SEL_ARRAY 430 +#define DICE 431 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE { - int i; + +/* Line 1676 of yacc.c */ +#line 146 "lev_comp.y" + + long i; char* map; struct { - xchar room; - xchar wall; - xchar door; + long room; + long wall; + long door; } corpos; + struct { + long area; + long x1; + long y1; + long x2; + long y2; + } lregn; + struct { + long x; + long y; + } crd; + struct { + long ter; + long lit; + } terr; + struct { + long height; + long width; + } sze; + struct { + long die; + long num; + } dice; + struct { + long cfunc; + char *varstr; + } meth; + + + +/* Line 1676 of yacc.c */ +#line 443 "y.tab.h" } YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + extern YYSTYPE yylval; + + diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c index 929d3b3b7..b4cb65d97 100644 --- a/sys/share/lev_lex.c +++ b/sys/share/lev_lex.c @@ -1,14 +1,66 @@ -/* A lexical scanner for NetHack generated by flex */ +/* A lexical scanner generated by flex */ /* Scanner skeleton version: - * flexhack.skl 3.3.0 (from .../flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47) + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ -#define FLEXHACK_SCANNER + +#define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#include "config.h" -#define yyconst const /* some code inserted by flex will refer to yyconst */ +#include + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif /* Returned upon end-of-file. */ #define YY_NULL 0 @@ -53,12 +105,28 @@ extern FILE *yyin, *yyout; #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + /* Return all but the first 'n' matched characters back to the input stream. */ + #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ @@ -138,11 +206,13 @@ static YY_BUFFER_STATE yy_current_buffer = 0; */ #define YY_CURRENT_BUFFER yy_current_buffer + /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ + int yyleng; /* Points to current character in buffer. */ @@ -155,19 +225,23 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void FDECL(yyrestart, (FILE *)); +void yyrestart YY_PROTO(( FILE *input_file )); -void FDECL(yy_switch_to_buffer, (YY_BUFFER_STATE)); -void NDECL(yy_load_buffer_state); -YY_BUFFER_STATE FDECL(yy_create_buffer, (FILE *,int)); -void FDECL(yy_delete_buffer, (YY_BUFFER_STATE)); -void FDECL(yy_init_buffer, (YY_BUFFER_STATE,FILE *)); -void FDECL(yy_flush_buffer, (YY_BUFFER_STATE)); +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) -static genericptr_t FDECL(yy_flex_alloc, (yy_size_t)); -static genericptr_t FDECL(yy_flex_realloc2, (genericptr_t,yy_size_t,int)); -static void FDECL(yy_flex_free, (genericptr_t)); +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer @@ -193,10 +267,10 @@ typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext -static yy_state_type NDECL(yy_get_previous_state); -static yy_state_type FDECL(yy_try_NUL_trans, (yy_state_type)); -static int NDECL(yy_get_next_buffer); -static void FDECL(yy_fatal_error, (const char *)); +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. @@ -208,81 +282,124 @@ static void FDECL(yy_fatal_error, (const char *)); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 113 -#define YY_END_OF_BUFFER 114 -static yyconst short int yy_accept[643] = +#define YY_NUM_RULES 195 +#define YY_END_OF_BUFFER 196 +static yyconst short int yy_accept[1038] = { 0, - 0, 0, 0, 0, 114, 112, 109, 108, 112, 112, - 112, 112, 106, 4, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 2, 112, 109, 112, 112, 106, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 109, - 108, 0, 107, 0, 0, 106, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 196, 194, 190, 189, 194, 194, + 194, 194, 194, 194, 193, 179, 187, 194, 188, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 194, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 190, 194, 193, 2, 194, 190, 194, 194, 193, 179, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 190, 194, 193, 190, 189, 183, + 0, 180, 181, 0, 0, 177, 193, 176, 178, 179, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 87, 0, 0, 3, 0, 2, 2, 0, 109, 0, - 106, 0, 0, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 111, 0, 111, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 193, 185, 184, 182, 186, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 39, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 55, 193, 193, 0, 0, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 72, 0, 0, 67, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, - 17, 0, 0, 0, 0, 0, 40, 0, 0, 0, - 6, 0, 0, 42, 0, 0, 0, 33, 0, 0, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 153, 193, 193, 190, 0, 0, + 3, 193, 2, 2, 0, 190, 0, 177, 193, 176, + 179, 193, 193, 193, 193, 193, 39, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 190, 0, 2, 0, + 0, 193, 192, 0, 192, 174, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 54, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 0, 36, 32, 0, 0, 0, 16, 0, 0, 105, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 0, 0, 0, 0, 88, 91, 51, 0, - 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, - 0, 94, 0, 0, 0, 0, 0, 0, 55, 0, - 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, - 0, 90, 0, 0, 0, 53, 12, 0, 0, 0, - 0, 0, 25, 0, 0, 0, 0, 0, 0, 10, - 0, 0, 0, 0, 8, 0, 0, 0, 7, 0, - 0, 0, 0, 0, 0, 27, 0, 0, 0, 59, + 193, 193, 0, 193, 103, 193, 83, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 79, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 81, 193, 193, 193, 138, + 193, 193, 193, 193, 127, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 16, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 125, 193, 193, 193, - 86, 0, 0, 80, 0, 95, 0, 0, 0, 74, - 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 50, 0, 0, 0, 58, 0, 64, 0, 0, - 0, 52, 0, 0, 68, 0, 0, 30, 43, 0, - 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, - 0, 0, 13, 28, 0, 21, 0, 0, 0, 0, - 79, 0, 66, 49, 62, 46, 0, 0, 98, 0, - 69, 0, 0, 0, 0, 0, 47, 0, 0, 0, - 0, 0, 0, 48, 102, 0, 0, 56, 0, 54, + 193, 193, 193, 193, 193, 80, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 191, 193, 193, + 193, 58, 193, 193, 193, 22, 193, 40, 193, 41, + 193, 193, 193, 193, 49, 193, 193, 193, 193, 56, + 6, 193, 193, 193, 53, 193, 193, 193, 36, 193, + 193, 193, 193, 42, 193, 35, 193, 193, 193, 193, + 193, 21, 193, 0, 175, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 159, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 154, 157, 113, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 0, 0, 85, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 5, 15, 0, 0, 0, - 37, 0, 20, 0, 96, 0, 0, 92, 0, 0, - 0, 78, 0, 0, 0, 0, 57, 73, 71, 0, - 0, 0, 84, 0, 0, 0, 0, 39, 0, 0, - 31, 11, 9, 19, 0, 0, 0, 0, 0, 0, - 0, 103, 0, 0, 0, 0, 0, 0, 0, 0, - 83, 0, 0, 77, 0, 97, 70, 14, 0, 41, - 0, 0, 0, 0, 0, 0, 0, 75, 99, 61, - 0, 101, 44, 81, 82, 0, 0, 0, 18, 0, + 193, 193, 69, 193, 193, 193, 193, 193, 193, 193, + 120, 193, 193, 67, 193, 193, 193, 193, 160, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 118, 193, + 193, 193, 106, 193, 193, 193, 193, 193, 193, 193, + 65, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 156, + 193, 193, 193, 193, 193, 115, 15, 0, 193, 193, + 193, 193, 193, 193, 2, 0, 28, 193, 59, 193, + 193, 193, 193, 193, 13, 193, 193, 193, 50, 193, + 193, 7, 193, 193, 193, 193, 5, 193, 193, 193, - 0, 0, 0, 0, 0, 0, 63, 0, 100, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, - 35, 0, 0, 0, 0, 0, 76, 104, 0, 0, - 0, 24, 0, 0, 0, 22, 0, 0, 23, 29, - 38, 0 + 193, 193, 193, 193, 193, 193, 30, 193, 193, 193, + 193, 193, 119, 152, 193, 193, 193, 146, 193, 193, + 161, 193, 193, 193, 193, 193, 140, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 155, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 11, 193, 193, 193, 193, 193, 193, 193, 112, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 124, 193, 12, 193, 193, 193, 193, 193, + 193, 193, 82, 114, 193, 193, 193, 193, 193, 193, + + 193, 193, 128, 193, 193, 193, 193, 193, 33, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 29, 193, + 193, 193, 193, 193, 193, 17, 31, 193, 27, 193, + 193, 193, 193, 57, 193, 193, 193, 193, 145, 96, + 193, 193, 126, 110, 86, 193, 122, 72, 107, 193, + 193, 193, 164, 193, 193, 87, 193, 93, 129, 193, + 74, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 134, 193, 193, 108, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 109, 167, 193, 193, + 16, 193, 193, 193, 193, 77, 193, 116, 193, 193, + + 193, 193, 193, 111, 193, 193, 193, 151, 172, 193, + 78, 193, 193, 193, 193, 193, 193, 193, 193, 1, + 193, 57, 193, 193, 193, 60, 193, 193, 193, 193, + 193, 193, 193, 4, 193, 19, 193, 193, 193, 193, + 193, 62, 43, 193, 46, 26, 193, 162, 98, 193, + 193, 193, 193, 73, 158, 193, 193, 97, 193, 193, + 193, 92, 193, 193, 193, 193, 144, 193, 193, 193, + 135, 193, 193, 193, 193, 193, 20, 63, 139, 137, + 193, 193, 193, 193, 193, 193, 193, 117, 193, 131, + 95, 193, 150, 193, 193, 193, 193, 100, 47, 89, + + 193, 193, 193, 193, 193, 26, 193, 45, 193, 193, + 34, 61, 14, 8, 25, 193, 193, 193, 193, 193, + 23, 193, 168, 193, 193, 193, 101, 193, 66, 193, + 75, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 149, 9, 193, 193, 193, 193, 143, 193, 85, + 68, 193, 71, 193, 193, 193, 193, 163, 130, 133, + 193, 105, 18, 193, 51, 193, 193, 193, 193, 193, + 193, 94, 141, 193, 193, 70, 173, 121, 193, 166, + 193, 91, 132, 84, 147, 148, 170, 193, 193, 99, + 171, 90, 193, 64, 193, 10, 136, 24, 52, 193, + + 193, 193, 193, 193, 76, 88, 123, 104, 193, 165, + 102, 193, 193, 193, 193, 193, 193, 193, 193, 37, + 38, 193, 193, 193, 142, 169, 193, 193, 193, 193, + 193, 193, 193, 48, 32, 44, 0 } ; static yyconst int yy_ec[256] = @@ -290,17 +407,17 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 1, 6, 7, 1, 8, 1, 9, 1, - 1, 1, 10, 1, 11, 12, 1, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 14, 1, 1, - 1, 1, 1, 1, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 1, 31, 32, 33, 34, 35, 36, 1, 37, 38, - 39, 40, 41, 1, 42, 1, 43, 44, 45, 46, + 1, 5, 6, 7, 8, 9, 10, 1, 11, 1, + 1, 1, 12, 1, 13, 14, 1, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 1, 1, 16, + 17, 18, 1, 1, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 1, 48, 1, 49, 50, 51, 52, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 1, 59, 60, 61, 62, 63, 64, 1, - 1, 1, 12, 12, 12, 1, 1, 1, 1, 1, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 14, 14, 14, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -317,267 +434,410 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[65] = +static yyconst int yy_meta[75] = { 0, - 1, 2, 3, 2, 2, 1, 2, 1, 1, 2, - 2, 2, 2, 1, 2, 2, 2, 1, 1, 2, - 1, 2, 2, 1, 2, 2, 1, 1, 1, 2, - 1, 2, 2, 1, 1, 2, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1 + 1, 2, 3, 2, 2, 1, 1, 2, 1, 1, + 1, 2, 4, 2, 4, 1, 1, 1, 5, 5, + 5, 6, 6, 5, 6, 5, 5, 6, 5, 5, + 5, 6, 6, 5, 6, 6, 5, 5, 5, 6, + 5, 6, 5, 6, 1, 2, 1, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 5, 6, 6, + 6, 5, 6, 6 } ; -static yyconst short int yy_base[648] = +static yyconst short int yy_base[1045] = { 0, - 0, 58, 83, 62, 799, 800, 65, 800, 795, 791, - 756, 782, 781, 800, 767, 761, 44, 43, 763, 42, - 62, 762, 60, 63, 68, 773, 759, 92, 91, 91, - 772, 71, 72, 76, 87, 55, 84, 77, 61, 96, - 103, 95, 104, 103, 108, 111, 99, 107, 739, 782, - 151, 800, 781, 169, 173, 179, 182, 185, 194, 197, - 755, 180, 185, 193, 181, 194, 202, 214, 241, 75, - 800, 776, 800, 772, 771, 766, 745, 762, 761, 136, - 746, 759, 752, 757, 737, 741, 743, 745, 749, 731, - 727, 732, 735, 735, 151, 737, 162, 732, 738, 729, + 0, 73, 102, 77, 1276, 1277, 75, 1277, 1272, 1257, + 1266, 0, 1226, 1256, 1255, 78, 66, 1252, 1251, 1237, + 1230, 57, 63, 59, 64, 101, 0, 63, 79, 119, + 94, 1245, 1231, 128, 127, 126, 1244, 104, 109, 118, + 133, 94, 139, 151, 1196, 95, 111, 1198, 157, 146, + 163, 100, 164, 1191, 166, 169, 178, 56, 1206, 1205, + 219, 1254, 216, 1277, 1253, 243, 248, 251, 264, 223, + 168, 120, 241, 229, 267, 1240, 249, 289, 294, 152, + 299, 308, 221, 296, 343, 360, 301, 260, 1277, 1277, + 1247, 1277, 0, 1242, 1241, 1236, 0, 1235, 1277, 277, - 729, 741, 739, 728, 738, 726, 225, 224, 143, 707, - 696, 706, 192, 687, 690, 687, 689, 701, 686, 162, - 683, 677, 680, 679, 689, 683, 682, 181, 675, 670, - 199, 672, 687, 221, 672, 674, 667, 229, 676, 680, - 683, 682, 668, 674, 666, 211, 659, 662, 657, 235, - 800, 658, 714, 800, 204, 800, 800, 713, 277, 264, - 274, 269, 279, 274, 282, 287, 285, 295, 293, 800, - 712, 0, 800, 705, 704, 697, 683, 682, 676, 677, - 676, 670, 674, 683, 675, 675, 683, 667, 681, 679, - 678, 664, 663, 675, 678, 650, 672, 664, 656, 670, + 1234, 1277, 1277, 1277, 1277, 1210, 296, 1210, 303, 1222, + 1212, 1225, 1206, 1217, 1214, 1221, 250, 1207, 1205, 1207, + 1217, 0, 1208, 1212, 1193, 1199, 1187, 1193, 1197, 1196, + 1196, 160, 1198, 263, 1193, 308, 1191, 1184, 1190, 1202, + 1200, 1192, 227, 0, 1199, 1187, 192, 340, 301, 1143, + 1165, 1154, 1160, 1163, 303, 1143, 1147, 1143, 1146, 1145, + 1157, 1139, 1141, 321, 1137, 1131, 1128, 1133, 1132, 1138, + 1142, 1133, 1135, 1133, 1133, 217, 304, 311, 341, 1122, + 1125, 1133, 1118, 188, 334, 1137, 350, 26, 1125, 1124, + 1124, 1115, 363, 1125, 1129, 1115, 1131, 1126, 1129, 326, - 664, 659, 660, 661, 652, 663, 651, 654, 295, 630, - 635, 620, 629, 622, 614, 616, 611, 618, 614, 608, - 611, 607, 612, 604, 604, 607, 601, 600, 601, 599, - 604, 609, 610, 594, 800, 593, 594, 800, 599, 604, - 593, 605, 595, 587, 585, 591, 587, 588, 273, 581, - 594, 593, 583, 593, 592, 590, 585, 589, 574, 581, - 570, 800, 583, 567, 577, 576, 565, 256, 306, 301, - 598, 304, 309, 315, 800, 593, 606, 605, 606, 597, - 800, 603, 603, 585, 583, 596, 800, 572, 594, 586, - 575, 595, 576, 800, 578, 309, 590, 800, 591, 576, + 363, 1122, 1124, 1120, 1112, 366, 357, 283, 1104, 1103, + 1105, 1106, 336, 376, 0, 1103, 325, 433, 1165, 1164, + 1277, 366, 1277, 1277, 1163, 440, 444, 447, 1150, 0, + 406, 422, 339, 430, 438, 140, 1149, 439, 424, 441, + 425, 444, 448, 450, 303, 451, 475, 0, 1277, 1160, + 0, 454, 1277, 1151, 1150, 1145, 1140, 1126, 1138, 1133, + 1117, 1118, 1134, 1116, 1110, 1127, 1113, 1110, 1122, 0, + 1114, 1124, 1113, 1121, 1102, 1103, 1118, 1116, 1104, 1114, + 1099, 1112, 1097, 1110, 1113, 1083, 1107, 1099, 1090, 1105, + 1099, 1095, 1093, 1099, 1093, 1094, 1084, 1081, 1095, 1081, - 575, 800, 800, 572, 573, 571, 800, 577, 307, 800, - 543, 539, 538, 549, 548, 534, 547, 535, 544, 800, - 543, 529, 541, 536, 543, 538, 800, 800, 800, 541, - 536, 535, 570, 532, 528, 800, 531, 530, 533, 519, - 522, 800, 512, 513, 520, 513, 526, 511, 800, 517, - 512, 520, 800, 517, 516, 505, 500, 499, 498, 502, - 507, 800, 497, 501, 493, 800, 800, 550, 318, 537, - 321, 331, 800, 529, 531, 526, 530, 516, 511, 800, - 530, 511, 516, 511, 800, 526, 519, 520, 800, 515, - 522, 503, 509, 507, 505, 800, 503, 502, 510, 800, + 1082, 1085, 466, 1059, 0, 1064, 0, 1049, 1058, 1048, + 1050, 1041, 1045, 1043, 1037, 1045, 425, 1052, 1034, 1038, + 1049, 1032, 1038, 1033, 1042, 1028, 1032, 0, 1025, 1024, + 1034, 1024, 1037, 1021, 1038, 424, 1033, 1022, 420, 1035, + 1012, 1028, 1029, 1023, 1011, 0, 1021, 1024, 1014, 0, + 1007, 1008, 1016, 1019, 0, 1012, 1017, 1006, 1018, 1008, + 1013, 1012, 407, 1011, 995, 1002, 998, 999, 438, 991, + 1005, 1004, 994, 1006, 1003, 992, 990, 994, 998, 429, + 980, 991, 991, 995, 976, 993, 977, 980, 988, 974, + 436, 982, 970, 988, 974, 969, 0, 970, 980, 963, - 800, 482, 470, 800, 480, 800, 471, 469, 465, 800, - 477, 473, 470, 474, 456, 800, 472, 196, 463, 462, - 466, 468, 452, 452, 464, 463, 466, 459, 448, 448, - 462, 800, 457, 442, 454, 800, 446, 800, 438, 439, - 451, 800, 437, 442, 800, 465, 335, 800, 800, 466, - 464, 469, 468, 467, 458, 473, 800, 461, 467, 454, - 463, 451, 800, 800, 440, 800, 454, 449, 442, 435, - 800, 431, 800, 800, 800, 800, 420, 419, 800, 427, - 800, 426, 421, 414, 423, 418, 800, 406, 406, 421, - 406, 410, 407, 800, 800, 408, 403, 800, 398, 800, + 974, 967, 972, 960, 959, 0, 491, 481, 486, 995, + 487, 490, 488, 471, 489, 491, 507, 1277, 989, 1003, + 994, 0, 1003, 994, 981, 0, 999, 0, 999, 0, + 980, 978, 977, 991, 0, 990, 964, 988, 980, 0, + 968, 989, 971, 968, 0, 971, 486, 983, 0, 984, + 969, 968, 981, 977, 974, 0, 961, 963, 974, 960, + 974, 0, 965, 511, 1277, 929, 924, 923, 935, 932, + 933, 918, 932, 931, 919, 928, 927, 0, 926, 925, + 910, 916, 922, 917, 913, 903, 918, 0, 0, 0, + 906, 920, 915, 914, 906, 464, 912, 907, 911, 905, - 404, 407, 800, 410, 409, 800, 329, 436, 423, 435, - 424, 423, 413, 419, 423, 800, 800, 426, 414, 342, - 800, 412, 800, 390, 800, 396, 395, 800, 393, 391, - 382, 800, 381, 378, 389, 374, 800, 800, 800, 383, - 376, 378, 800, 382, 384, 383, 397, 800, 406, 405, - 800, 800, 800, 800, 410, 388, 394, 393, 405, 394, - 377, 800, 372, 371, 355, 365, 355, 357, 365, 352, - 800, 361, 350, 800, 358, 800, 800, 800, 388, 800, - 390, 390, 373, 375, 378, 386, 369, 800, 800, 800, - 338, 800, 800, 800, 800, 342, 336, 335, 800, 369, + 908, 893, 0, 946, 904, 883, 899, 888, 899, 900, + 0, 899, 883, 0, 897, 900, 886, 889, 0, 463, + 879, 877, 871, 877, 885, 878, 891, 876, 0, 882, + 877, 885, 0, 875, 881, 884, 864, 882, 465, 881, + 0, 869, 858, 859, 863, 872, 856, 870, 874, 870, + 852, 857, 849, 865, 860, 849, 852, 864, 848, 0, + 845, 850, 852, 458, 851, 0, 1277, 904, 509, 887, + 514, 516, 518, 517, 1277, 902, 0, 878, 0, 876, + 880, 871, 864, 859, 0, 879, 870, 858, 0, 864, + 858, 0, 874, 867, 872, 867, 0, 862, 869, 849, - 368, 362, 360, 372, 373, 370, 800, 341, 800, 340, - 367, 359, 347, 335, 350, 346, 342, 316, 315, 800, - 800, 338, 327, 312, 310, 311, 800, 800, 236, 210, - 188, 800, 161, 138, 123, 800, 101, 69, 800, 800, - 800, 800, 372, 375, 377, 379, 382 + 856, 854, 852, 862, 849, 851, 0, 847, 853, 845, + 850, 852, 0, 0, 822, 810, 820, 0, 819, 818, + 0, 809, 807, 816, 807, 800, 0, 812, 812, 808, + 809, 794, 808, 792, 788, 482, 0, 804, 804, 802, + 788, 791, 798, 798, 777, 796, 475, 788, 784, 786, + 788, 775, 791, 787, 788, 788, 771, 771, 784, 770, + 782, 0, 781, 769, 783, 776, 764, 765, 779, 0, + 774, 758, 752, 770, 759, 765, 761, 763, 758, 752, + 768, 763, 0, 752, 0, 745, 745, 744, 743, 743, + 756, 756, 753, 0, 753, 752, 747, 750, 735, 741, + + 738, 742, 0, 747, 763, 521, 522, 525, 0, 764, + 762, 756, 766, 765, 764, 757, 753, 769, 0, 757, + 763, 755, 748, 758, 745, 0, 0, 733, 0, 757, + 743, 734, 80, 0, 386, 510, 500, 498, 0, 0, + 498, 501, 0, 0, 0, 494, 0, 0, 0, 493, + 495, 504, 0, 506, 507, 0, 495, 0, 0, 511, + 0, 508, 507, 503, 517, 515, 515, 512, 507, 509, + 519, 523, 514, 0, 518, 524, 0, 508, 510, 528, + 523, 511, 516, 530, 524, 523, 0, 0, 526, 523, + 0, 514, 520, 526, 523, 0, 530, 548, 539, 529, + + 544, 531, 537, 0, 533, 543, 544, 0, 0, 545, + 0, 551, 542, 553, 553, 554, 555, 541, 561, 0, + 596, 597, 598, 591, 579, 0, 594, 585, 586, 588, + 578, 588, 594, 0, 597, 0, 600, 589, 606, 580, + 593, 0, 0, 592, 0, 0, 571, 0, 0, 579, + 580, 581, 583, 0, 0, 573, 569, 0, 578, 571, + 574, 0, 588, 588, 581, 577, 0, 586, 598, 585, + 0, 583, 597, 583, 600, 600, 0, 0, 0, 0, + 597, 592, 603, 597, 605, 586, 607, 1277, 608, 0, + 0, 610, 0, 614, 601, 610, 606, 0, 0, 0, + + 615, 616, 617, 617, 611, 657, 637, 0, 649, 650, + 0, 0, 0, 0, 0, 632, 658, 637, 646, 642, + 0, 633, 0, 630, 631, 622, 0, 622, 0, 626, + 0, 635, 620, 633, 624, 642, 639, 627, 632, 642, + 630, 0, 0, 637, 643, 633, 648, 0, 649, 0, + 0, 650, 0, 639, 642, 649, 646, 0, 0, 0, + 655, 0, 0, 685, 0, 686, 690, 692, 676, 690, + 678, 0, 0, 647, 662, 0, 0, 0, 649, 0, + 658, 0, 0, 0, 0, 0, 0, 657, 652, 0, + 0, 0, 654, 0, 654, 0, 0, 0, 0, 693, + + 694, 689, 690, 704, 0, 0, 0, 0, 675, 0, + 0, 676, 707, 701, 705, 697, 709, 683, 684, 0, + 0, 715, 719, 712, 0, 0, 707, 714, 709, 707, + 712, 713, 709, 0, 0, 0, 1277, 746, 748, 754, + 757, 763, 768, 773 } ; -static yyconst short int yy_def[648] = +static yyconst short int yy_def[1045] = { 0, - 642, 1, 1, 3, 642, 642, 642, 642, 642, 643, - 644, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 645, - 642, 642, 642, 646, 646, 646, 646, 646, 646, 646, - 642, 60, 60, 60, 60, 60, 60, 60, 645, 642, - 642, 643, 642, 642, 647, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 1037, 1, 1, 3, 1037, 1037, 1037, 1037, 1037, 1037, + 1038, 1039, 1040, 1037, 1041, 1041, 1037, 1037, 1037, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1037, 1042, 1041, 1037, 1037, 1043, 1043, 1043, 1041, 69, + 69, 69, 69, 1041, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 1043, 1042, 69, 1037, 1037, 1037, + 1038, 1037, 1039, 1037, 1044, 1037, 1041, 1041, 1037, 1041, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 645, 642, 642, 642, 642, 642, 60, 60, - 60, 60, 60, 642, 60, 60, 60, 60, 60, 642, - 645, 69, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 1041, 1037, 1037, 1037, 1037, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1037, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 60, 60, - 642, 60, 60, 60, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1042, 1042, + 1037, 1041, 1037, 1037, 1037, 1043, 1043, 1043, 69, 69, + 69, 69, 69, 1041, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 1043, 86, 1037, 1042, + 86, 69, 1037, 1037, 1037, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 60, 642, - 60, 60, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 1041, 1041, 1037, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 60, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 69, 69, 1041, + 69, 69, 69, 69, 69, 69, 69, 1037, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1037, 1037, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 642, 642, 642, 642, 642, 642, 60, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1037, 69, 1041, + 69, 69, 69, 69, 1037, 1037, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 0, 642, 642, 642, 642, 642 + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + + 1041, 1041, 1041, 1041, 1041, 69, 69, 69, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 69, 69, 69, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + + 1041, 1041, 1041, 1041, 1041, 69, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 0, 1037, 1037, 1037, + 1037, 1037, 1037, 1037 } ; -static yyconst short int yy_nxt[865] = +static yyconst short int yy_nxt[1352] = { 0, - 6, 7, 8, 9, 7, 10, 6, 6, 11, 12, - 12, 6, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 6, 22, 6, 6, 23, 24, 25, 26, 27, - 28, 29, 30, 6, 6, 31, 6, 6, 32, 6, - 6, 6, 33, 34, 35, 36, 37, 38, 6, 39, - 6, 6, 6, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 6, 49, 50, 79, 70, 84, 69, 70, - 85, 81, 80, 82, 89, 107, 70, 91, 90, 70, - 86, 92, 94, 108, 51, 52, 53, 54, 51, 55, - 87, 93, 56, 56, 55, 57, 95, 58, 59, 60, + 6, 7, 8, 9, 7, 10, 11, 6, 12, 6, + 13, 14, 15, 6, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 27, 27, 29, + 30, 31, 32, 33, 27, 34, 35, 36, 27, 27, + 37, 27, 27, 27, 38, 6, 6, 27, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 27, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 27, 27, 27, 61, 108, 88, 61, 61, 88, + 62, 85, 102, 103, 86, 110, 122, 99, 113, 109, + 114, 360, 100, 116, 123, 111, 117, 124, 112, 361, - 641, 61, 62, 128, 55, 63, 98, 55, 64, 104, - 99, 122, 65, 101, 66, 67, 123, 129, 68, 126, - 100, 105, 55, 102, 103, 109, 124, 127, 640, 113, - 110, 111, 114, 117, 115, 112, 118, 116, 130, 125, - 119, 137, 131, 120, 134, 135, 132, 139, 121, 141, - 143, 138, 133, 145, 639, 148, 142, 149, 144, 136, - 146, 140, 150, 179, 151, 155, 180, 147, 638, 92, - 70, 157, 158, 159, 642, 157, 158, 195, 196, 93, - 642, 157, 158, 642, 157, 158, 642, 157, 158, 637, - 198, 161, 199, 210, 161, 642, 157, 158, 642, 157, + 115, 125, 118, 63, 64, 65, 66, 87, 147, 67, + 843, 126, 131, 68, 69, 67, 70, 214, 148, 215, + 71, 72, 73, 119, 74, 75, 132, 76, 77, 101, + 76, 78, 79, 120, 229, 80, 121, 127, 81, 82, + 76, 128, 83, 178, 76, 129, 135, 67, 143, 194, + 136, 130, 138, 139, 229, 107, 166, 179, 144, 167, + 137, 145, 168, 195, 140, 141, 229, 142, 149, 84, + 150, 272, 180, 76, 151, 152, 181, 155, 153, 154, + 156, 159, 229, 157, 134, 160, 158, 169, 161, 162, + 285, 286, 163, 187, 188, 164, 147, 232, 170, 173, - 158, 160, 160, 211, 223, 165, 160, 166, 85, 97, - 162, 90, 88, 642, 160, 160, 167, 224, 163, 636, - 104, 642, 642, 160, 78, 80, 168, 103, 169, 107, - 642, 209, 105, 268, 232, 160, 108, 108, 215, 233, - 635, 191, 642, 170, 171, 172, 236, 172, 216, 482, - 172, 172, 172, 172, 483, 172, 172, 172, 367, 368, - 172, 237, 172, 172, 634, 172, 172, 259, 240, 260, - 172, 246, 172, 172, 247, 241, 172, 242, 70, 264, - 172, 159, 265, 248, 249, 160, 161, 250, 266, 251, - 160, 271, 642, 270, 183, 160, 272, 642, 160, 309, + 171, 165, 189, 174, 172, 183, 148, 175, 190, 184, + 176, 191, 196, 185, 200, 192, 197, 205, 201, 186, + 218, 206, 202, 218, 207, 193, 219, 203, 204, 198, + 211, 208, 99, 209, 222, 229, 210, 231, 128, 246, + 212, 351, 129, 213, 88, 224, 225, 226, 130, 1037, + 224, 225, 1037, 224, 225, 229, 299, 352, 113, 233, + 234, 88, 300, 229, 88, 228, 224, 225, 227, 337, + 115, 227, 237, 109, 101, 227, 229, 227, 230, 338, + 123, 229, 229, 229, 229, 270, 99, 229, 271, 229, + 229, 100, 229, 229, 229, 288, 235, 229, 289, 117, - 160, 269, 642, 160, 189, 642, 160, 642, 160, 273, - 642, 309, 203, 642, 160, 642, 160, 348, 274, 349, - 369, 642, 160, 642, 284, 160, 390, 160, 278, 642, - 160, 371, 642, 633, 642, 310, 160, 642, 391, 160, - 372, 632, 160, 642, 631, 630, 642, 310, 373, 642, - 160, 396, 160, 447, 507, 629, 160, 642, 557, 642, - 628, 627, 626, 642, 625, 523, 624, 623, 558, 622, - 559, 560, 72, 72, 72, 74, 74, 153, 153, 153, - 160, 160, 174, 174, 621, 620, 619, 618, 617, 616, - 615, 614, 613, 612, 611, 610, 609, 608, 607, 606, + 229, 229, 229, 229, 229, 236, 229, 238, 229, 227, + 229, 125, 239, 229, 258, 229, 128, 229, 259, 252, + 240, 126, 229, 128, 241, 242, 130, 240, 101, 415, + 143, 229, 291, 130, 261, 229, 243, 244, 262, 245, + 144, 292, 392, 145, 218, 224, 225, 247, 211, 303, + 248, 393, 339, 229, 148, 312, 340, 304, 212, 313, + 305, 213, 249, 250, 251, 314, 341, 251, 306, 323, + 342, 251, 251, 251, 251, 409, 343, 378, 251, 251, + 251, 324, 325, 251, 398, 251, 251, 379, 251, 251, + 251, 405, 406, 251, 353, 354, 251, 251, 251, 407, - 605, 604, 603, 602, 601, 600, 599, 598, 597, 596, - 595, 594, 593, 592, 591, 590, 589, 588, 587, 586, - 585, 584, 583, 582, 581, 580, 579, 578, 577, 576, - 575, 574, 573, 572, 571, 570, 569, 568, 567, 566, - 565, 564, 563, 562, 561, 556, 555, 554, 553, 552, - 551, 550, 549, 548, 547, 546, 545, 544, 543, 542, - 541, 540, 539, 538, 537, 536, 535, 534, 533, 532, - 531, 530, 529, 528, 527, 526, 525, 524, 523, 522, - 521, 520, 519, 518, 517, 516, 515, 514, 513, 512, - 511, 510, 509, 508, 506, 505, 504, 503, 502, 501, + 251, 355, 251, 357, 399, 251, 344, 345, 346, 280, + 358, 366, 359, 380, 367, 99, 387, 381, 388, 390, + 231, 844, 391, 368, 369, 389, 400, 251, 370, 401, + 371, 251, 382, 402, 218, 403, 229, 218, 229, 229, + 219, 88, 224, 225, 226, 1037, 224, 225, 1037, 224, + 225, 410, 229, 229, 267, 229, 411, 101, 229, 408, + 277, 228, 229, 412, 229, 229, 413, 280, 229, 414, + 464, 500, 282, 522, 523, 295, 218, 224, 225, 247, + 416, 477, 248, 496, 540, 229, 478, 417, 528, 501, + 529, 497, 552, 567, 568, 229, 541, 280, 553, 569, - 500, 499, 498, 497, 496, 495, 494, 493, 492, 491, - 490, 489, 488, 487, 486, 485, 484, 481, 480, 479, - 478, 477, 476, 475, 474, 473, 472, 471, 470, 469, - 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, - 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, - 448, 446, 367, 445, 444, 443, 442, 441, 440, 439, - 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, - 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, - 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, - 408, 407, 406, 405, 404, 403, 402, 401, 400, 399, + 229, 229, 229, 229, 229, 229, 458, 598, 422, 575, + 576, 431, 465, 571, 572, 464, 639, 660, 702, 599, + 574, 229, 661, 229, 678, 703, 573, 679, 229, 640, + 229, 229, 229, 756, 767, 229, 229, 706, 707, 229, + 768, 845, 846, 708, 577, 757, 847, 822, 823, 848, + 821, 607, 849, 850, 851, 852, 853, 465, 854, 855, + 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, + 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, + 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, + 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, - 398, 397, 396, 395, 394, 393, 392, 389, 388, 387, - 386, 385, 384, 383, 382, 381, 380, 379, 378, 377, - 376, 375, 374, 373, 370, 366, 365, 364, 363, 362, - 361, 360, 359, 358, 357, 356, 355, 354, 353, 352, - 351, 350, 347, 346, 345, 344, 343, 342, 341, 340, - 339, 338, 337, 336, 335, 334, 333, 332, 331, 330, - 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, - 319, 318, 317, 316, 315, 314, 313, 312, 311, 308, - 307, 306, 305, 304, 303, 302, 301, 300, 299, 298, - 297, 296, 295, 294, 293, 292, 291, 290, 289, 288, + 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, + 229, 229, 229, 907, 908, 909, 910, 911, 842, 912, + 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, + 906, 933, 934, 935, 936, 937, 938, 939, 940, 941, + 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, + 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 229, 963, 964, 965, 966, 967, 968, 969, 970, + 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, + 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, - 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, - 277, 276, 275, 275, 170, 157, 154, 267, 263, 262, - 261, 258, 257, 256, 255, 254, 253, 252, 245, 244, - 243, 239, 238, 235, 234, 231, 230, 229, 228, 227, - 226, 225, 222, 221, 220, 219, 218, 217, 214, 213, - 212, 208, 207, 206, 205, 204, 203, 202, 201, 200, - 197, 194, 193, 192, 191, 190, 189, 188, 187, 186, - 185, 184, 183, 182, 181, 178, 177, 176, 76, 175, - 173, 73, 164, 156, 154, 152, 106, 97, 96, 88, - 83, 78, 77, 76, 76, 75, 73, 71, 642, 5, + 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 91, 91, 91, 91, + 91, 91, 93, 93, 94, 94, 842, 94, 94, 94, + 97, 97, 97, 220, 220, 220, 220, 220, 220, 227, + 227, 227, 227, 254, 254, 841, 254, 254, 254, 840, + 839, 838, 837, 836, 835, 834, 833, 832, 831, 830, + 829, 828, 827, 826, 825, 824, 820, 819, 818, 817, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642 + 816, 815, 814, 813, 812, 811, 810, 809, 808, 807, + 806, 805, 804, 803, 802, 801, 800, 799, 798, 797, + 796, 795, 794, 793, 792, 791, 790, 789, 788, 787, + 786, 785, 784, 783, 782, 781, 780, 779, 778, 777, + 776, 775, 774, 773, 772, 771, 770, 769, 766, 765, + 764, 763, 762, 761, 760, 759, 758, 755, 754, 753, + 752, 751, 750, 749, 748, 747, 746, 745, 744, 743, + 742, 741, 740, 739, 738, 737, 736, 735, 734, 733, + 732, 731, 730, 729, 728, 727, 726, 725, 724, 723, + 722, 721, 720, 719, 718, 717, 716, 715, 714, 713, + + 712, 711, 710, 709, 575, 705, 567, 704, 701, 700, + 699, 698, 697, 696, 695, 694, 693, 692, 691, 690, + 689, 688, 687, 686, 685, 684, 683, 682, 681, 680, + 677, 676, 675, 674, 673, 672, 671, 670, 669, 668, + 667, 666, 665, 664, 663, 662, 659, 658, 657, 656, + 655, 654, 653, 652, 651, 650, 649, 648, 647, 646, + 645, 644, 643, 642, 641, 638, 637, 636, 635, 634, + 633, 632, 631, 630, 629, 628, 627, 626, 625, 624, + 623, 622, 621, 620, 619, 618, 617, 616, 615, 614, + 613, 612, 611, 610, 609, 608, 607, 606, 605, 604, + + 603, 602, 601, 600, 597, 596, 595, 594, 593, 592, + 591, 590, 589, 588, 587, 586, 585, 584, 583, 582, + 581, 580, 579, 578, 577, 570, 566, 565, 564, 563, + 562, 561, 560, 559, 558, 557, 556, 555, 554, 551, + 550, 549, 548, 547, 546, 545, 544, 543, 542, 539, + 538, 537, 536, 535, 534, 533, 532, 531, 530, 527, + 526, 525, 524, 445, 521, 520, 519, 518, 517, 516, + 515, 514, 513, 512, 511, 510, 509, 508, 507, 506, + 505, 504, 503, 502, 499, 498, 495, 494, 493, 492, + 491, 490, 489, 488, 487, 486, 485, 484, 483, 482, + + 481, 480, 479, 476, 475, 474, 473, 472, 471, 470, + 469, 468, 467, 466, 463, 462, 461, 460, 459, 458, + 457, 456, 455, 454, 453, 452, 451, 450, 449, 448, + 447, 446, 445, 444, 443, 442, 441, 440, 439, 438, + 437, 436, 435, 434, 433, 432, 431, 430, 429, 428, + 427, 426, 425, 424, 423, 422, 421, 420, 419, 256, + 418, 418, 249, 229, 229, 224, 221, 221, 404, 397, + 396, 395, 394, 386, 385, 384, 383, 377, 376, 375, + 374, 373, 372, 365, 364, 363, 362, 356, 350, 349, + 348, 347, 336, 335, 334, 333, 332, 331, 330, 329, + + 328, 327, 326, 322, 321, 320, 319, 318, 317, 316, + 315, 311, 310, 309, 308, 307, 302, 301, 298, 297, + 296, 295, 294, 293, 290, 287, 284, 283, 282, 281, + 280, 279, 278, 277, 276, 275, 274, 273, 272, 269, + 268, 267, 266, 265, 264, 263, 260, 257, 256, 98, + 96, 255, 253, 92, 229, 223, 221, 217, 216, 199, + 182, 177, 146, 134, 133, 107, 106, 105, 104, 98, + 96, 95, 92, 90, 89, 1037, 5, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037 } ; -static yyconst short int yy_chk[865] = +static yyconst short int yy_chk[1352] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -585,95 +845,149 @@ static yyconst short int yy_chk[865] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 17, 7, 20, 4, 7, - 20, 18, 17, 18, 23, 32, 70, 24, 23, 70, - 21, 24, 25, 32, 2, 3, 3, 3, 4, 3, - 21, 24, 3, 3, 3, 3, 25, 3, 3, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 22, 7, 2, 4, 7, + 2, 4, 17, 17, 4, 23, 28, 16, 24, 22, + 24, 188, 16, 25, 28, 23, 25, 29, 23, 188, - 638, 3, 3, 39, 3, 3, 28, 3, 3, 30, - 28, 36, 3, 29, 3, 3, 36, 39, 3, 38, - 28, 30, 3, 29, 29, 33, 37, 38, 637, 34, - 33, 33, 34, 35, 34, 33, 35, 34, 40, 37, - 35, 42, 40, 35, 41, 41, 40, 43, 35, 44, - 45, 42, 40, 46, 635, 47, 44, 47, 45, 41, - 46, 43, 48, 80, 48, 51, 80, 46, 634, 51, - 54, 54, 54, 54, 55, 55, 55, 95, 95, 51, - 56, 56, 56, 57, 57, 57, 58, 58, 58, 633, - 97, 56, 97, 109, 57, 59, 59, 59, 60, 60, + 24, 29, 25, 2, 3, 3, 3, 4, 38, 3, + 733, 29, 31, 3, 3, 3, 3, 58, 38, 58, + 3, 3, 3, 26, 3, 3, 31, 3, 3, 16, + 3, 3, 3, 26, 72, 3, 26, 30, 3, 3, + 3, 30, 3, 46, 3, 30, 34, 3, 36, 52, + 34, 30, 35, 35, 236, 72, 42, 46, 36, 42, + 34, 36, 42, 52, 35, 35, 80, 35, 39, 3, + 39, 236, 47, 3, 39, 39, 47, 40, 39, 39, + 40, 41, 71, 40, 80, 41, 40, 43, 41, 41, + 132, 132, 41, 50, 50, 41, 147, 71, 43, 44, - 60, 62, 65, 109, 120, 62, 63, 64, 62, 65, - 58, 64, 63, 63, 64, 66, 66, 120, 60, 631, - 67, 64, 66, 67, 59, 60, 66, 66, 68, 107, - 67, 108, 67, 155, 128, 68, 108, 107, 113, 128, - 630, 155, 68, 69, 69, 69, 131, 69, 113, 418, - 69, 69, 69, 69, 418, 69, 69, 69, 268, 268, - 69, 131, 69, 69, 629, 69, 69, 146, 134, 146, - 69, 138, 69, 69, 138, 134, 69, 134, 159, 150, - 69, 159, 150, 138, 138, 160, 161, 138, 150, 138, - 162, 164, 160, 163, 164, 161, 165, 162, 159, 209, + 43, 41, 50, 44, 43, 49, 147, 44, 50, 49, + 44, 51, 53, 49, 55, 51, 53, 56, 55, 49, + 61, 56, 55, 61, 56, 51, 61, 55, 55, 53, + 57, 56, 70, 56, 63, 83, 56, 70, 63, 83, + 57, 184, 63, 57, 66, 66, 66, 66, 63, 67, + 67, 67, 68, 68, 68, 73, 143, 184, 74, 73, + 74, 88, 143, 77, 88, 68, 69, 69, 69, 176, + 74, 69, 77, 73, 70, 69, 69, 69, 69, 176, + 77, 75, 69, 69, 69, 117, 100, 69, 117, 69, + 69, 100, 69, 69, 69, 134, 75, 69, 134, 75, - 163, 162, 161, 165, 166, 159, 167, 163, 166, 168, - 165, 309, 167, 167, 169, 166, 168, 249, 169, 249, - 269, 169, 270, 168, 272, 272, 296, 269, 270, 270, - 273, 273, 272, 626, 269, 209, 274, 273, 296, 369, - 274, 625, 371, 274, 624, 623, 369, 309, 369, 371, - 507, 371, 372, 372, 447, 622, 447, 507, 520, 372, - 619, 618, 617, 447, 616, 507, 615, 614, 520, 613, - 520, 520, 643, 643, 643, 644, 644, 645, 645, 645, - 646, 646, 647, 647, 612, 611, 610, 608, 606, 605, - 604, 603, 602, 601, 600, 598, 597, 596, 591, 587, + 69, 69, 69, 78, 69, 75, 69, 78, 79, 69, + 84, 78, 79, 81, 107, 87, 79, 245, 107, 87, + 79, 78, 82, 87, 81, 81, 79, 87, 100, 245, + 82, 69, 136, 87, 109, 69, 81, 81, 109, 81, + 82, 136, 208, 82, 85, 85, 85, 85, 84, 148, + 85, 208, 177, 233, 148, 155, 177, 149, 84, 155, + 149, 84, 86, 86, 86, 155, 177, 86, 149, 164, + 178, 86, 86, 86, 86, 233, 178, 200, 86, 86, + 86, 164, 164, 86, 213, 86, 86, 200, 86, 86, + 86, 217, 217, 86, 185, 185, 86, 86, 86, 222, - 586, 585, 584, 583, 582, 581, 579, 575, 573, 572, - 570, 569, 568, 567, 566, 565, 564, 563, 561, 560, - 559, 558, 557, 556, 555, 550, 549, 547, 546, 545, - 544, 542, 541, 540, 536, 535, 534, 533, 531, 530, - 529, 527, 526, 524, 522, 519, 518, 515, 514, 513, - 512, 511, 510, 509, 508, 505, 504, 502, 501, 499, - 497, 496, 493, 492, 491, 490, 489, 488, 486, 485, - 484, 483, 482, 480, 478, 477, 472, 470, 469, 468, - 467, 465, 462, 461, 460, 459, 458, 456, 455, 454, - 453, 452, 451, 450, 446, 444, 443, 441, 440, 439, + 86, 185, 86, 187, 213, 86, 179, 179, 179, 222, + 187, 193, 187, 201, 193, 231, 206, 201, 206, 207, + 231, 735, 207, 193, 193, 206, 214, 86, 193, 214, + 193, 86, 201, 214, 218, 214, 232, 218, 239, 241, + 218, 226, 226, 226, 226, 227, 227, 227, 228, 228, + 228, 234, 235, 238, 234, 240, 235, 231, 242, 232, + 238, 228, 243, 241, 244, 246, 243, 239, 252, 244, + 303, 339, 240, 363, 363, 242, 247, 247, 247, 247, + 246, 317, 247, 336, 380, 414, 317, 252, 369, 339, + 369, 336, 391, 407, 407, 408, 380, 252, 391, 408, - 437, 435, 434, 433, 431, 430, 429, 428, 427, 426, - 425, 424, 423, 422, 421, 420, 419, 417, 415, 414, - 413, 412, 411, 409, 408, 407, 405, 403, 402, 399, - 398, 397, 395, 394, 393, 392, 391, 390, 388, 387, - 386, 384, 383, 382, 381, 379, 378, 377, 376, 375, - 374, 370, 368, 365, 364, 363, 361, 360, 359, 358, - 357, 356, 355, 354, 352, 351, 350, 348, 347, 346, - 345, 344, 343, 341, 340, 339, 338, 337, 335, 334, - 333, 332, 331, 330, 326, 325, 324, 323, 322, 321, - 319, 318, 317, 316, 315, 314, 313, 312, 311, 308, + 409, 411, 413, 415, 412, 416, 414, 447, 409, 417, + 417, 411, 303, 412, 413, 464, 496, 520, 564, 447, + 416, 417, 520, 569, 539, 564, 415, 539, 571, 496, + 572, 574, 573, 636, 647, 706, 707, 571, 573, 708, + 647, 736, 737, 574, 569, 636, 738, 707, 708, 741, + 706, 572, 742, 746, 750, 751, 752, 464, 754, 755, + 757, 760, 762, 763, 764, 765, 766, 767, 768, 769, + 770, 771, 772, 773, 775, 776, 778, 779, 780, 781, + 782, 783, 784, 785, 786, 789, 790, 792, 793, 794, + 795, 797, 798, 799, 800, 801, 802, 803, 805, 806, - 306, 305, 304, 301, 300, 299, 297, 295, 293, 292, - 291, 290, 289, 288, 286, 285, 284, 283, 282, 280, - 279, 278, 277, 276, 271, 267, 266, 265, 264, 263, - 261, 260, 259, 258, 257, 256, 255, 254, 253, 252, - 251, 250, 248, 247, 246, 245, 244, 243, 242, 241, - 240, 239, 237, 236, 234, 233, 232, 231, 230, 229, - 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, - 218, 217, 216, 215, 214, 213, 212, 211, 210, 208, - 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, - 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, + 807, 810, 812, 813, 814, 815, 816, 817, 818, 819, + 821, 822, 823, 824, 825, 827, 828, 829, 821, 830, + 831, 832, 833, 835, 837, 838, 839, 840, 841, 844, + 847, 850, 851, 852, 853, 856, 857, 859, 860, 861, + 823, 863, 864, 865, 866, 868, 869, 870, 872, 873, + 874, 875, 876, 881, 882, 883, 884, 885, 886, 887, + 889, 892, 894, 895, 896, 897, 901, 902, 903, 904, + 905, 906, 907, 909, 910, 916, 917, 918, 919, 920, + 922, 924, 925, 926, 928, 930, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 944, 945, 946, 947, - 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, - 177, 176, 175, 174, 171, 158, 153, 152, 149, 148, - 147, 145, 144, 143, 142, 141, 140, 139, 137, 136, - 135, 133, 132, 130, 129, 127, 126, 125, 124, 123, - 122, 121, 119, 118, 117, 116, 115, 114, 112, 111, - 110, 106, 105, 104, 103, 102, 101, 100, 99, 98, - 96, 94, 93, 92, 91, 90, 89, 88, 87, 86, - 85, 84, 83, 82, 81, 79, 78, 77, 76, 75, - 74, 72, 61, 53, 50, 49, 31, 27, 26, 22, - 19, 16, 15, 13, 12, 11, 10, 9, 5, 642, + 949, 952, 954, 955, 956, 957, 961, 964, 966, 967, + 968, 969, 970, 971, 974, 975, 979, 981, 988, 989, + 993, 995, 1000, 1001, 1002, 1003, 1004, 1009, 1012, 1013, + 1014, 1015, 1016, 1017, 1018, 1019, 1022, 1023, 1024, 1027, + 1028, 1029, 1030, 1031, 1032, 1033, 1038, 1038, 1038, 1038, + 1038, 1038, 1039, 1039, 1040, 1040, 732, 1040, 1040, 1040, + 1041, 1041, 1041, 1042, 1042, 1042, 1042, 1042, 1042, 1043, + 1043, 1043, 1043, 1044, 1044, 731, 1044, 1044, 1044, 730, + 728, 725, 724, 723, 722, 721, 720, 718, 717, 716, + 715, 714, 713, 712, 711, 710, 705, 704, 702, 701, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642 + 700, 699, 698, 697, 696, 695, 693, 692, 691, 690, + 689, 688, 687, 686, 684, 682, 681, 680, 679, 678, + 677, 676, 675, 674, 673, 672, 671, 669, 668, 667, + 666, 665, 664, 663, 661, 660, 659, 658, 657, 656, + 655, 654, 653, 652, 651, 650, 649, 648, 646, 645, + 644, 643, 642, 641, 640, 639, 638, 635, 634, 633, + 632, 631, 630, 629, 628, 626, 625, 624, 623, 622, + 620, 619, 617, 616, 615, 612, 611, 610, 609, 608, + 606, 605, 604, 603, 602, 601, 600, 599, 598, 596, + 595, 594, 593, 591, 590, 588, 587, 586, 584, 583, + + 582, 581, 580, 578, 576, 570, 568, 565, 563, 562, + 561, 559, 558, 557, 556, 555, 554, 553, 552, 551, + 550, 549, 548, 547, 546, 545, 544, 543, 542, 540, + 538, 537, 536, 535, 534, 532, 531, 530, 528, 527, + 526, 525, 524, 523, 522, 521, 518, 517, 516, 515, + 513, 512, 510, 509, 508, 507, 506, 505, 504, 502, + 501, 500, 499, 498, 497, 495, 494, 493, 492, 491, + 487, 486, 485, 484, 483, 482, 481, 480, 479, 477, + 476, 475, 474, 473, 472, 471, 470, 469, 468, 467, + 466, 463, 461, 460, 459, 458, 457, 455, 454, 453, + + 452, 451, 450, 448, 446, 444, 443, 442, 441, 439, + 438, 437, 436, 434, 433, 432, 431, 429, 427, 425, + 424, 423, 421, 420, 419, 410, 405, 404, 403, 402, + 401, 400, 399, 398, 396, 395, 394, 393, 392, 390, + 389, 388, 387, 386, 385, 384, 383, 382, 381, 379, + 378, 377, 376, 375, 374, 373, 372, 371, 370, 368, + 367, 366, 365, 364, 362, 361, 360, 359, 358, 357, + 356, 354, 353, 352, 351, 349, 348, 347, 345, 344, + 343, 342, 341, 340, 338, 337, 335, 334, 333, 332, + 331, 330, 329, 327, 326, 325, 324, 323, 322, 321, + + 320, 319, 318, 316, 315, 314, 313, 312, 311, 310, + 309, 308, 306, 304, 302, 301, 300, 299, 298, 297, + 296, 295, 294, 293, 292, 291, 290, 289, 288, 287, + 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, + 276, 275, 274, 273, 272, 271, 269, 268, 267, 266, + 265, 264, 263, 262, 261, 260, 259, 258, 257, 256, + 255, 254, 250, 237, 229, 225, 220, 219, 216, 212, + 211, 210, 209, 205, 204, 203, 202, 199, 198, 197, + 196, 195, 194, 192, 191, 190, 189, 186, 183, 182, + 181, 180, 175, 174, 173, 172, 171, 170, 169, 168, + + 167, 166, 165, 163, 162, 161, 160, 159, 158, 157, + 156, 154, 153, 152, 151, 150, 146, 145, 142, 141, + 140, 139, 138, 137, 135, 133, 131, 130, 129, 128, + 127, 126, 125, 124, 123, 121, 120, 119, 118, 116, + 115, 114, 113, 112, 111, 110, 108, 106, 101, 98, + 96, 95, 94, 91, 76, 65, 62, 60, 59, 54, + 48, 45, 37, 33, 32, 21, 20, 19, 18, 15, + 14, 13, 11, 10, 9, 5, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037 } ; static yy_state_type yy_last_accepting_state; @@ -685,10 +999,12 @@ static char *yy_last_accepting_cpos; #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET char *yytext; +#line 1 "lev_comp.l" #define INITIAL 0 -/* NetHack 3.5 lev_comp.l $Date: 2009/05/11 22:53:51 $ $Revision: 1.12 $ */ -/* SCCS Id: @(#)lev_lex.c 3.5 2002/03/27 */ +#line 2 "lev_comp.l" +/* SCCS Id: @(#)lev_lex.c 3.4 2002/03/27 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -753,37 +1069,105 @@ int FDECL(yyoutput, (int)); void FDECL(init_yyin, (FILE *)); void FDECL(init_yyout, (FILE *)); +long NDECL(handle_varstring_check); +long FDECL(corefunc_str_check, (char *, long)); + +extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); + +extern struct lc_vardefs *variable_definitions; + +extern long FDECL(method_defined, (char *, long, long *)); + +void FDECL(savetoken, (char *)); +void NDECL(newline); +void FDECL(advancepos, (char *)); + /* * This doesn't always get put in lev_comp.h * (esp. when using older versions of bison). */ extern YYSTYPE yylval; -int nh_line_number = 1, colon_line_number = 1; +int nh_line_number = 1; +int token_start_pos = 0; +char curr_token[512]; static char map[4096]; static int map_cnt = 0; +FILE *orig_yyin = NULL; + +#define ST_RET(x) do { savetoken(yytext); return x; } while (0); +#define ST_RETF(y, x) do { savetoken(yytext); y; return x; } while (0); + #define MAPC 1 +#line 1105 "lex.yy.c" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP -extern int NDECL(yywrap); +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif #endif #ifndef YY_NO_UNPUT -static void FDECL(yyunput, (int,char *)); +static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr -static void FDECL(yy_flex_strncpy, (char *,const char *,int)); +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT -static int NDECL(input); +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif #endif /* Amount of stuff to slurp up with each read. */ @@ -840,6 +1224,13 @@ static int NDECL(input); #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ @@ -858,14 +1249,15 @@ static int NDECL(input); (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION -int NDECL(yylex); -int yylex() +YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; +#line 102 "lev_comp.l" +#line 1261 "lex.yy.c" if ( yy_init ) { @@ -917,13 +1309,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 643 ) + if ( yy_current_state >= 1038 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 800 ); + while ( yy_base[yy_current_state] != 1277 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -951,7 +1343,9 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP +#line 103 "lev_comp.l" { + savetoken(yytext); BEGIN(INITIAL); yylval.map = (char *) alloc(map_cnt + 1); (void) strncpy(yylval.map, map, map_cnt); @@ -962,464 +1356,1004 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP +#line 112 "lev_comp.l" { int len = yyleng; + savetoken(yytext); /* convert \r\n to \n */ if (len >= 2 && yytext[len - 2] == '\r') len -= 1; - nh_line_number++; (void) strncpy(map + map_cnt, yytext, len); map_cnt += len; map[map_cnt - 1] = '\n'; map[map_cnt] = '\0'; + newline(); } YY_BREAK case 3: YY_RULE_SETUP -{ nh_line_number++; } +#line 123 "lev_comp.l" +{ savetoken(yytext); newline(); } YY_BREAK case 4: YY_RULE_SETUP -{ colon_line_number = nh_line_number; return ':'; } +#line 124 "lev_comp.l" +ST_RET(MESSAGE_ID); YY_BREAK case 5: YY_RULE_SETUP -return MESSAGE_ID; +#line 125 "lev_comp.l" +ST_RET(NOMAP_ID); YY_BREAK case 6: YY_RULE_SETUP -return MAZE_ID; +#line 126 "lev_comp.l" +ST_RET(MAZE_ID); YY_BREAK case 7: YY_RULE_SETUP -return NOMAP_ID; +#line 127 "lev_comp.l" +ST_RET(LEVEL_ID); YY_BREAK case 8: YY_RULE_SETUP -return LEVEL_ID; +#line 128 "lev_comp.l" +ST_RET(LEV_INIT_ID); YY_BREAK case 9: YY_RULE_SETUP -return LEV_INIT_ID; +#line 129 "lev_comp.l" +ST_RET(MAZE_GRID_ID); YY_BREAK case 10: YY_RULE_SETUP -return FLAGS_ID; +#line 130 "lev_comp.l" +ST_RET(SOLID_FILL_ID); YY_BREAK case 11: YY_RULE_SETUP -return GEOMETRY_ID; +#line 131 "lev_comp.l" +ST_RET(MINES_ID); YY_BREAK case 12: YY_RULE_SETUP -{ BEGIN(MAPC); nh_line_number++; } +#line 132 "lev_comp.l" +ST_RET(ROGUELEV_ID); YY_BREAK case 13: YY_RULE_SETUP -return OBJECT_ID; +#line 133 "lev_comp.l" +ST_RET(FLAGS_ID); YY_BREAK case 14: YY_RULE_SETUP -return COBJECT_ID; +#line 134 "lev_comp.l" +ST_RET(GEOMETRY_ID); YY_BREAK case 15: YY_RULE_SETUP -return MONSTER_ID; +#line 135 "lev_comp.l" +{ savetoken(yytext); BEGIN(MAPC); newline(); } YY_BREAK case 16: YY_RULE_SETUP -return TRAP_ID; +#line 136 "lev_comp.l" +ST_RET(object_ID); YY_BREAK case 17: YY_RULE_SETUP -return DOOR_ID; +#line 137 "lev_comp.l" +ST_RET(OBJECT_ID); YY_BREAK case 18: YY_RULE_SETUP -return DRAWBRIDGE_ID; +#line 138 "lev_comp.l" +ST_RET(COBJECT_ID); YY_BREAK case 19: YY_RULE_SETUP -return MAZEWALK_ID; +#line 139 "lev_comp.l" +ST_RET(MONSTER_ID); YY_BREAK case 20: YY_RULE_SETUP -return WALLIFY_ID; +#line 140 "lev_comp.l" +ST_RET(monster_ID); YY_BREAK case 21: YY_RULE_SETUP -return REGION_ID; +#line 141 "lev_comp.l" +ST_RET(TRAP_ID); YY_BREAK case 22: YY_RULE_SETUP -return RANDOM_OBJECTS_ID; +#line 142 "lev_comp.l" +ST_RET(DOOR_ID); YY_BREAK case 23: YY_RULE_SETUP -return RANDOM_MONSTERS_ID; +#line 143 "lev_comp.l" +ST_RET(ROOMDOOR_ID); YY_BREAK case 24: YY_RULE_SETUP -return RANDOM_PLACES_ID; +#line 144 "lev_comp.l" +ST_RET(DRAWBRIDGE_ID); YY_BREAK case 25: YY_RULE_SETUP -return ALTAR_ID; +#line 145 "lev_comp.l" +ST_RET(MAZEWALK_ID); YY_BREAK case 26: YY_RULE_SETUP -return LADDER_ID; +#line 146 "lev_comp.l" +ST_RET(WALLIFY_ID); YY_BREAK case 27: YY_RULE_SETUP -return STAIR_ID; +#line 147 "lev_comp.l" +ST_RET(REGION_ID); YY_BREAK case 28: YY_RULE_SETUP -return PORTAL_ID; +#line 148 "lev_comp.l" +ST_RET(ALTAR_ID); YY_BREAK case 29: YY_RULE_SETUP -return TELEPRT_ID; +#line 149 "lev_comp.l" +ST_RET(LADDER_ID); YY_BREAK case 30: YY_RULE_SETUP -return BRANCH_ID; +#line 150 "lev_comp.l" +ST_RET(STAIR_ID); YY_BREAK case 31: YY_RULE_SETUP -return FOUNTAIN_ID; +#line 151 "lev_comp.l" +ST_RET(PORTAL_ID); YY_BREAK case 32: YY_RULE_SETUP -return SINK_ID; +#line 152 "lev_comp.l" +ST_RET(TELEPRT_ID); YY_BREAK case 33: YY_RULE_SETUP -return POOL_ID; +#line 153 "lev_comp.l" +ST_RET(BRANCH_ID); YY_BREAK case 34: YY_RULE_SETUP -return NON_DIGGABLE_ID; +#line 154 "lev_comp.l" +ST_RET(FOUNTAIN_ID); YY_BREAK case 35: YY_RULE_SETUP -return NON_PASSWALL_ID; +#line 155 "lev_comp.l" +ST_RET(SINK_ID); YY_BREAK case 36: YY_RULE_SETUP -return ROOM_ID; +#line 156 "lev_comp.l" +ST_RET(POOL_ID); YY_BREAK case 37: YY_RULE_SETUP -return SUBROOM_ID; +#line 157 "lev_comp.l" +ST_RET(NON_DIGGABLE_ID); YY_BREAK case 38: YY_RULE_SETUP -return RAND_CORRIDOR_ID; +#line 158 "lev_comp.l" +ST_RET(NON_PASSWALL_ID); YY_BREAK case 39: YY_RULE_SETUP -return CORRIDOR_ID; +#line 159 "lev_comp.l" +ST_RET(IF_ID); YY_BREAK case 40: YY_RULE_SETUP -return GOLD_ID; +#line 160 "lev_comp.l" +ST_RET(ELSE_ID); YY_BREAK case 41: YY_RULE_SETUP -return ENGRAVING_ID; +#line 161 "lev_comp.l" +ST_RET(EXIT_ID); YY_BREAK case 42: YY_RULE_SETUP -return NAME_ID; +#line 162 "lev_comp.l" +ST_RET(ROOM_ID); YY_BREAK case 43: YY_RULE_SETUP -return CHANCE_ID; +#line 163 "lev_comp.l" +ST_RET(SUBROOM_ID); YY_BREAK case 44: YY_RULE_SETUP -return LEV; +#line 164 "lev_comp.l" +ST_RET(RAND_CORRIDOR_ID); YY_BREAK case 45: YY_RULE_SETUP -{ yylval.i=D_ISOPEN; return DOOR_STATE; } +#line 165 "lev_comp.l" +ST_RET(CORRIDOR_ID); YY_BREAK case 46: YY_RULE_SETUP -{ yylval.i=D_CLOSED; return DOOR_STATE; } +#line 166 "lev_comp.l" +ST_RET(TERRAIN_ID); YY_BREAK case 47: YY_RULE_SETUP -{ yylval.i=D_LOCKED; return DOOR_STATE; } +#line 167 "lev_comp.l" +ST_RET(terrain_ID); YY_BREAK case 48: YY_RULE_SETUP -{ yylval.i=D_NODOOR; return DOOR_STATE; } +#line 168 "lev_comp.l" +ST_RET(REPLACE_TERRAIN_ID); YY_BREAK case 49: YY_RULE_SETUP -{ yylval.i=D_BROKEN; return DOOR_STATE; } +#line 169 "lev_comp.l" +ST_RET(GOLD_ID); YY_BREAK case 50: YY_RULE_SETUP -{ yylval.i=W_NORTH; return DIRECTION; } +#line 170 "lev_comp.l" +ST_RET(GRAVE_ID); YY_BREAK case 51: YY_RULE_SETUP -{ yylval.i=W_EAST; return DIRECTION; } +#line 171 "lev_comp.l" +ST_RET(ENGRAVING_ID); YY_BREAK case 52: YY_RULE_SETUP -{ yylval.i=W_SOUTH; return DIRECTION; } +#line 172 "lev_comp.l" +ST_RET(MINERALIZE_ID); YY_BREAK case 53: YY_RULE_SETUP -{ yylval.i=W_WEST; return DIRECTION; } +#line 173 "lev_comp.l" +ST_RET(NAME_ID); YY_BREAK case 54: YY_RULE_SETUP -{ yylval.i = -1; return RANDOM_TYPE; } +#line 174 "lev_comp.l" +ST_RET(FOR_ID); YY_BREAK case 55: YY_RULE_SETUP -{ yylval.i = -2; return NONE; } +#line 175 "lev_comp.l" +ST_RET(TO_ID); YY_BREAK case 56: YY_RULE_SETUP -return O_REGISTER; +#line 176 "lev_comp.l" +ST_RET(LOOP_ID); YY_BREAK case 57: YY_RULE_SETUP -return M_REGISTER; +#line 177 "lev_comp.l" +ST_RET(SWITCH_ID); YY_BREAK case 58: YY_RULE_SETUP -return P_REGISTER; +#line 178 "lev_comp.l" +ST_RET(CASE_ID); YY_BREAK case 59: YY_RULE_SETUP -return A_REGISTER; +#line 179 "lev_comp.l" +ST_RET(BREAK_ID); YY_BREAK case 60: YY_RULE_SETUP -{ yylval.i=1; return LEFT_OR_RIGHT; } +#line 180 "lev_comp.l" +ST_RET(DEFAULT_ID); YY_BREAK case 61: YY_RULE_SETUP -{ yylval.i=2; return LEFT_OR_RIGHT; } +#line 181 "lev_comp.l" +ST_RET(FUNCTION_ID); YY_BREAK case 62: YY_RULE_SETUP -{ yylval.i=3; return CENTER; } +#line 182 "lev_comp.l" +ST_RET(SHUFFLE_ID); YY_BREAK case 63: YY_RULE_SETUP -{ yylval.i=4; return LEFT_OR_RIGHT; } +#line 183 "lev_comp.l" +ST_RET(MONTYPE_ID); YY_BREAK case 64: YY_RULE_SETUP -{ yylval.i=5; return LEFT_OR_RIGHT; } +#line 184 "lev_comp.l" +ST_RET(selection_ID); YY_BREAK case 65: YY_RULE_SETUP -{ yylval.i=1; return TOP_OR_BOT; } +#line 185 "lev_comp.l" +ST_RET(rect_ID); YY_BREAK case 66: YY_RULE_SETUP -{ yylval.i=5; return TOP_OR_BOT; } +#line 186 "lev_comp.l" +ST_RET(fillrect_ID); YY_BREAK case 67: YY_RULE_SETUP -{ yylval.i=1; return LIGHT_STATE; } +#line 187 "lev_comp.l" +ST_RET(line_ID); YY_BREAK case 68: YY_RULE_SETUP -{ yylval.i=0; return LIGHT_STATE; } +#line 188 "lev_comp.l" +ST_RET(randline_ID); YY_BREAK case 69: YY_RULE_SETUP -{ yylval.i=0; return FILLING; } +#line 189 "lev_comp.l" +ST_RET(grow_ID); YY_BREAK case 70: YY_RULE_SETUP -{ yylval.i=1; return FILLING; } +#line 190 "lev_comp.l" +ST_RET(flood_ID); YY_BREAK case 71: YY_RULE_SETUP -{ yylval.i= AM_NONE; return ALIGNMENT; } +#line 191 "lev_comp.l" +ST_RET(rndcoord_ID); YY_BREAK case 72: YY_RULE_SETUP -{ yylval.i= AM_LAWFUL; return ALIGNMENT; } +#line 192 "lev_comp.l" +ST_RET(circle_ID); YY_BREAK case 73: YY_RULE_SETUP -{ yylval.i= AM_NEUTRAL; return ALIGNMENT; } +#line 193 "lev_comp.l" +ST_RET(ellipse_ID); YY_BREAK case 74: YY_RULE_SETUP -{ yylval.i= AM_CHAOTIC; return ALIGNMENT; } +#line 194 "lev_comp.l" +ST_RET(filter_ID); YY_BREAK case 75: YY_RULE_SETUP -{ yylval.i= AM_SPLEV_CO; return ALIGNMENT; } +#line 195 "lev_comp.l" +ST_RET(gradient_ID); YY_BREAK case 76: YY_RULE_SETUP -{ yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; } +#line 196 "lev_comp.l" +ST_RET(complement_ID); YY_BREAK case 77: YY_RULE_SETUP -{ yylval.i=1; return MON_ATTITUDE; } +#line 197 "lev_comp.l" +{ savetoken(yytext); yylval.i=SEL_GRADIENT_RADIAL; return GRADIENT_TYPE; } YY_BREAK case 78: YY_RULE_SETUP -{ yylval.i=0; return MON_ATTITUDE; } +#line 198 "lev_comp.l" +{ savetoken(yytext); yylval.i=SEL_GRADIENT_SQUARE; return GRADIENT_TYPE; } YY_BREAK case 79: YY_RULE_SETUP -{ yylval.i=1; return MON_ALERTNESS; } +#line 199 "lev_comp.l" +{ savetoken(yytext); yylval.i=DRY; return HUMIDITY_TYPE; } YY_BREAK case 80: YY_RULE_SETUP -{ yylval.i=0; return MON_ALERTNESS; } +#line 200 "lev_comp.l" +{ savetoken(yytext); yylval.i=WET; return HUMIDITY_TYPE; } YY_BREAK case 81: YY_RULE_SETUP -{ yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; } +#line 201 "lev_comp.l" +{ savetoken(yytext); yylval.i=HOT; return HUMIDITY_TYPE; } YY_BREAK case 82: YY_RULE_SETUP -{ yylval.i= M_AP_MONSTER; return MON_APPEARANCE; } +#line 202 "lev_comp.l" +{ savetoken(yytext); yylval.i=SOLID; return HUMIDITY_TYPE; } YY_BREAK case 83: YY_RULE_SETUP -{ yylval.i= M_AP_OBJECT; return MON_APPEARANCE; } +#line 203 "lev_comp.l" +{ savetoken(yytext); yylval.i=ANY_LOC; return HUMIDITY_TYPE; } YY_BREAK case 84: YY_RULE_SETUP -{ yylval.i=2; return ALTAR_TYPE; } +#line 204 "lev_comp.l" +ST_RET(LEV); YY_BREAK case 85: YY_RULE_SETUP -{ yylval.i=1; return ALTAR_TYPE; } +#line 205 "lev_comp.l" +ST_RET(QUANTITY_ID); YY_BREAK case 86: YY_RULE_SETUP -{ yylval.i=0; return ALTAR_TYPE; } +#line 206 "lev_comp.l" +ST_RET(BURIED_ID); YY_BREAK case 87: YY_RULE_SETUP -{ yylval.i=1; return UP_OR_DOWN; } +#line 207 "lev_comp.l" +ST_RET(ERODED_ID); YY_BREAK case 88: YY_RULE_SETUP -{ yylval.i=0; return UP_OR_DOWN; } +#line 208 "lev_comp.l" +ST_RET(ERODEPROOF_ID); YY_BREAK case 89: YY_RULE_SETUP -{ yylval.i=0; return BOOLEAN; } +#line 209 "lev_comp.l" +ST_RET(TRAPPED_ID); YY_BREAK case 90: YY_RULE_SETUP -{ yylval.i=1; return BOOLEAN; } +#line 210 "lev_comp.l" +ST_RET(RECHARGED_ID); YY_BREAK case 91: YY_RULE_SETUP -{ yylval.i=DUST; return ENGRAVING_TYPE; } +#line 211 "lev_comp.l" +ST_RET(INVIS_ID); YY_BREAK case 92: YY_RULE_SETUP -{ yylval.i=ENGRAVE; return ENGRAVING_TYPE; } +#line 212 "lev_comp.l" +ST_RET(GREASED_ID); YY_BREAK case 93: YY_RULE_SETUP -{ yylval.i=BURN; return ENGRAVING_TYPE; } +#line 213 "lev_comp.l" +ST_RET(FEMALE_ID); YY_BREAK case 94: YY_RULE_SETUP -{ yylval.i=MARK; return ENGRAVING_TYPE; } +#line 214 "lev_comp.l" +ST_RET(CANCELLED_ID); YY_BREAK case 95: YY_RULE_SETUP -{ yylval.i=ENGR_BLOOD; return ENGRAVING_TYPE; } +#line 215 "lev_comp.l" +ST_RET(REVIVED_ID); YY_BREAK case 96: YY_RULE_SETUP -{ yylval.i=1; return CURSE_TYPE; } +#line 216 "lev_comp.l" +ST_RET(AVENGE_ID); YY_BREAK case 97: YY_RULE_SETUP -{ yylval.i=2; return CURSE_TYPE; } +#line 217 "lev_comp.l" +ST_RET(FLEEING_ID); YY_BREAK case 98: YY_RULE_SETUP -{ yylval.i=3; return CURSE_TYPE; } +#line 218 "lev_comp.l" +ST_RET(BLINDED_ID); YY_BREAK case 99: YY_RULE_SETUP -{ return CONTAINED; } +#line 219 "lev_comp.l" +ST_RET(PARALYZED_ID); YY_BREAK case 100: YY_RULE_SETUP -{ yylval.i=NOTELEPORT; return FLAG_TYPE; } +#line 220 "lev_comp.l" +ST_RET(STUNNED_ID); YY_BREAK case 101: YY_RULE_SETUP -{ yylval.i=HARDFLOOR; return FLAG_TYPE; } +#line 221 "lev_comp.l" +ST_RET(CONFUSED_ID); YY_BREAK case 102: YY_RULE_SETUP -{ yylval.i=NOMMAP; return FLAG_TYPE; } +#line 222 "lev_comp.l" +ST_RET(SEENTRAPS_ID); YY_BREAK case 103: YY_RULE_SETUP -{ yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */ +#line 223 "lev_comp.l" +ST_RET(ALL_ID); YY_BREAK case 104: YY_RULE_SETUP -{ yylval.i=SHORTSIGHTED; return FLAG_TYPE; } +#line 224 "lev_comp.l" +ST_RETF((yylval.i=1), HORIZ_OR_VERT); YY_BREAK case 105: YY_RULE_SETUP -{ yylval.i = atoi(yytext + 1); return PERCENT; } +#line 225 "lev_comp.l" +{ savetoken(yytext); yylval.i=2; return HORIZ_OR_VERT; } YY_BREAK case 106: YY_RULE_SETUP -{ yylval.i=atoi(yytext); return INTEGER; } +#line 226 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_ISOPEN; return DOOR_STATE; } YY_BREAK case 107: YY_RULE_SETUP -{ yytext[yyleng-1] = 0; /* Discard the trailing \" */ +#line 227 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_CLOSED; return DOOR_STATE; } + YY_BREAK +case 108: +YY_RULE_SETUP +#line 228 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_LOCKED; return DOOR_STATE; } + YY_BREAK +case 109: +YY_RULE_SETUP +#line 229 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_NODOOR; return DOOR_STATE; } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 230 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_BROKEN; return DOOR_STATE; } + YY_BREAK +case 111: +YY_RULE_SETUP +#line 231 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_SECRET; return DOOR_STATE; } + YY_BREAK +case 112: +YY_RULE_SETUP +#line 232 "lev_comp.l" +{ savetoken(yytext); yylval.i=W_NORTH; return DIRECTION; } + YY_BREAK +case 113: +YY_RULE_SETUP +#line 233 "lev_comp.l" +{ savetoken(yytext); yylval.i=W_EAST; return DIRECTION; } + YY_BREAK +case 114: +YY_RULE_SETUP +#line 234 "lev_comp.l" +{ savetoken(yytext); yylval.i=W_SOUTH; return DIRECTION; } + YY_BREAK +case 115: +YY_RULE_SETUP +#line 235 "lev_comp.l" +{ savetoken(yytext); yylval.i=W_WEST; return DIRECTION; } + YY_BREAK +case 116: +YY_RULE_SETUP +#line 236 "lev_comp.l" +{ savetoken(yytext); yylval.i = -1; return RANDOM_TYPE; } + YY_BREAK +case 117: +YY_RULE_SETUP +#line 237 "lev_comp.l" +{ savetoken(yytext); yylval.i = -1; return RANDOM_TYPE_BRACKET; } + YY_BREAK +case 118: +YY_RULE_SETUP +#line 238 "lev_comp.l" +{ savetoken(yytext); yylval.i = -2; return NONE; } + YY_BREAK +case 119: +YY_RULE_SETUP +#line 239 "lev_comp.l" +ST_RET(A_REGISTER); + YY_BREAK +case 120: +YY_RULE_SETUP +#line 240 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return LEFT_OR_RIGHT; } + YY_BREAK +case 121: +YY_RULE_SETUP +#line 241 "lev_comp.l" +{ savetoken(yytext); yylval.i=2; return LEFT_OR_RIGHT; } + YY_BREAK +case 122: +YY_RULE_SETUP +#line 242 "lev_comp.l" +{ savetoken(yytext); yylval.i=3; return CENTER; } + YY_BREAK +case 123: +YY_RULE_SETUP +#line 243 "lev_comp.l" +{ savetoken(yytext); yylval.i=4; return LEFT_OR_RIGHT; } + YY_BREAK +case 124: +YY_RULE_SETUP +#line 244 "lev_comp.l" +{ savetoken(yytext); yylval.i=5; return LEFT_OR_RIGHT; } + YY_BREAK +case 125: +YY_RULE_SETUP +#line 245 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return TOP_OR_BOT; } + YY_BREAK +case 126: +YY_RULE_SETUP +#line 246 "lev_comp.l" +{ savetoken(yytext); yylval.i=5; return TOP_OR_BOT; } + YY_BREAK +case 127: +YY_RULE_SETUP +#line 247 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return LIGHT_STATE; } + YY_BREAK +case 128: +YY_RULE_SETUP +#line 248 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return LIGHT_STATE; } + YY_BREAK +case 129: +YY_RULE_SETUP +#line 249 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return FILLING; } + YY_BREAK +case 130: +YY_RULE_SETUP +#line 250 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return FILLING; } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 251 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return IRREGULAR; } + YY_BREAK +case 132: +YY_RULE_SETUP +#line 252 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return IRREGULAR; } + YY_BREAK +case 133: +YY_RULE_SETUP +#line 253 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return JOINED; } + YY_BREAK +case 134: +YY_RULE_SETUP +#line 254 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return JOINED; } + YY_BREAK +case 135: +YY_RULE_SETUP +#line 255 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return LIMITED; } + YY_BREAK +case 136: +YY_RULE_SETUP +#line 256 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return LIMITED; } + YY_BREAK +case 137: +YY_RULE_SETUP +#line 257 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_NONE; return ALIGNMENT; } + YY_BREAK +case 138: +YY_RULE_SETUP +#line 258 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_LAWFUL; return ALIGNMENT; } + YY_BREAK +case 139: +YY_RULE_SETUP +#line 259 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_NEUTRAL; return ALIGNMENT; } + YY_BREAK +case 140: +YY_RULE_SETUP +#line 260 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_CHAOTIC; return ALIGNMENT; } + YY_BREAK +case 141: +YY_RULE_SETUP +#line 261 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_SPLEV_CO; return ALIGNMENT; } + YY_BREAK +case 142: +YY_RULE_SETUP +#line 262 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; } + YY_BREAK +case 143: +YY_RULE_SETUP +#line 263 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return MON_ATTITUDE; } + YY_BREAK +case 144: +YY_RULE_SETUP +#line 264 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return MON_ATTITUDE; } + YY_BREAK +case 145: +YY_RULE_SETUP +#line 265 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return MON_ALERTNESS; } + YY_BREAK +case 146: +YY_RULE_SETUP +#line 266 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return MON_ALERTNESS; } + YY_BREAK +case 147: +YY_RULE_SETUP +#line 267 "lev_comp.l" +{ savetoken(yytext); yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; } + YY_BREAK +case 148: +YY_RULE_SETUP +#line 268 "lev_comp.l" +{ savetoken(yytext); yylval.i= M_AP_MONSTER; return MON_APPEARANCE; } + YY_BREAK +case 149: +YY_RULE_SETUP +#line 269 "lev_comp.l" +{ savetoken(yytext); yylval.i= M_AP_OBJECT; return MON_APPEARANCE; } + YY_BREAK +case 150: +YY_RULE_SETUP +#line 270 "lev_comp.l" +{ savetoken(yytext); yylval.i=2; return ALTAR_TYPE; } + YY_BREAK +case 151: +YY_RULE_SETUP +#line 271 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return ALTAR_TYPE; } + YY_BREAK +case 152: +YY_RULE_SETUP +#line 272 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return ALTAR_TYPE; } + YY_BREAK +case 153: +YY_RULE_SETUP +#line 273 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return UP_OR_DOWN; } + YY_BREAK +case 154: +YY_RULE_SETUP +#line 274 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return UP_OR_DOWN; } + YY_BREAK +case 155: +YY_RULE_SETUP +#line 275 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return BOOLEAN; } + YY_BREAK +case 156: +YY_RULE_SETUP +#line 276 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return BOOLEAN; } + YY_BREAK +case 157: +YY_RULE_SETUP +#line 277 "lev_comp.l" +{ savetoken(yytext); yylval.i=DUST; return ENGRAVING_TYPE; } + YY_BREAK +case 158: +YY_RULE_SETUP +#line 278 "lev_comp.l" +{ savetoken(yytext); yylval.i=ENGRAVE; return ENGRAVING_TYPE; } + YY_BREAK +case 159: +YY_RULE_SETUP +#line 279 "lev_comp.l" +{ savetoken(yytext); yylval.i=BURN; return ENGRAVING_TYPE; } + YY_BREAK +case 160: +YY_RULE_SETUP +#line 280 "lev_comp.l" +{ savetoken(yytext); yylval.i=MARK; return ENGRAVING_TYPE; } + YY_BREAK +case 161: +YY_RULE_SETUP +#line 281 "lev_comp.l" +{ savetoken(yytext); yylval.i=ENGR_BLOOD; return ENGRAVING_TYPE; } + YY_BREAK +case 162: +YY_RULE_SETUP +#line 282 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return CURSE_TYPE; } + YY_BREAK +case 163: +YY_RULE_SETUP +#line 283 "lev_comp.l" +{ savetoken(yytext); yylval.i=2; return CURSE_TYPE; } + YY_BREAK +case 164: +YY_RULE_SETUP +#line 284 "lev_comp.l" +{ savetoken(yytext); yylval.i=3; return CURSE_TYPE; } + YY_BREAK +case 165: +YY_RULE_SETUP +#line 285 "lev_comp.l" +{ savetoken(yytext); yylval.i=NOTELEPORT; return FLAG_TYPE; } + YY_BREAK +case 166: +YY_RULE_SETUP +#line 286 "lev_comp.l" +{ savetoken(yytext); yylval.i=HARDFLOOR; return FLAG_TYPE; } + YY_BREAK +case 167: +YY_RULE_SETUP +#line 287 "lev_comp.l" +{ savetoken(yytext); yylval.i=NOMMAP; return FLAG_TYPE; } + YY_BREAK +case 168: +YY_RULE_SETUP +#line 288 "lev_comp.l" +{ savetoken(yytext); yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */ + YY_BREAK +case 169: +YY_RULE_SETUP +#line 289 "lev_comp.l" +{ savetoken(yytext); yylval.i=SHORTSIGHTED; return FLAG_TYPE; } + YY_BREAK +case 170: +YY_RULE_SETUP +#line 290 "lev_comp.l" +{ savetoken(yytext); yylval.i=MAZELEVEL; return FLAG_TYPE; } + YY_BREAK +case 171: +YY_RULE_SETUP +#line 291 "lev_comp.l" +{ savetoken(yytext); yylval.i=PREMAPPED; return FLAG_TYPE; } + YY_BREAK +case 172: +YY_RULE_SETUP +#line 292 "lev_comp.l" +{ savetoken(yytext); yylval.i=SHROUD; return FLAG_TYPE; } + YY_BREAK +case 173: +YY_RULE_SETUP +#line 293 "lev_comp.l" +{ savetoken(yytext); yylval.i=GRAVEYARD; return FLAG_TYPE; } + YY_BREAK +case 174: +YY_RULE_SETUP +#line 294 "lev_comp.l" +{ char *p = strchr(yytext, 'd'); + savetoken(yytext); + if (p) { + *p = '\0'; + p++; + yylval.dice.num=atoi(yytext); + yylval.dice.die=atoi(p); + } else { yylval.dice.num = yylval.dice.die = 1; } + return DICE; + } + YY_BREAK +case 175: +YY_RULE_SETUP +#line 304 "lev_comp.l" +{ savetoken(yytext); yylval.i = atoi(yytext + 1); + if (yylval.i < 0 || yylval.i > 100) + lc_error("Unexpected percentile '%li%%'", yylval.i); + return PERCENT; } + YY_BREAK +case 176: +YY_RULE_SETUP +#line 308 "lev_comp.l" +{ savetoken(yytext); yylval.i=atoi(yytext); return MINUS_INTEGER; } + YY_BREAK +case 177: +YY_RULE_SETUP +#line 309 "lev_comp.l" +{ savetoken(yytext); yylval.i=atoi(yytext); return PLUS_INTEGER; } + YY_BREAK +case 178: +YY_RULE_SETUP +#line 310 "lev_comp.l" +{ savetoken(yytext); yylval.i = atoi(yytext); + if (yylval.i < 0 || yylval.i > 100) + lc_error("Unexpected percentile '%li%%'", yylval.i); + return SPERCENT; } + YY_BREAK +case 179: +YY_RULE_SETUP +#line 314 "lev_comp.l" +{ savetoken(yytext); yylval.i=atoi(yytext); return INTEGER; } + YY_BREAK +case 180: +YY_RULE_SETUP +#line 315 "lev_comp.l" +{ savetoken(yytext); + yytext[yyleng-1] = 0; /* Discard the trailing \" */ yylval.map = (char *) alloc(strlen(yytext+1)+1); Strcpy(yylval.map, yytext+1); /* Discard the first \" */ return STRING; } YY_BREAK -case 108: +case 181: YY_RULE_SETUP -{ nh_line_number++; } +#line 320 "lev_comp.l" +{ savetoken(yytext); return handle_varstring_check(); } YY_BREAK -case 109: +case 182: YY_RULE_SETUP -; +#line 321 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JE; return COMPARE_TYPE; } YY_BREAK -case 110: +case 183: YY_RULE_SETUP -{ yylval.i = yytext[2]; return CHAR; } +#line 322 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } YY_BREAK -case 111: +case 184: YY_RULE_SETUP -{ yylval.i = yytext[1]; return CHAR; } +#line 323 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } YY_BREAK -case 112: +case 185: YY_RULE_SETUP -{ return yytext[0]; } +#line 324 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JLE; return COMPARE_TYPE; } YY_BREAK -case 113: +case 186: YY_RULE_SETUP +#line 325 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JGE; return COMPARE_TYPE; } + YY_BREAK +case 187: +YY_RULE_SETUP +#line 326 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JL; return COMPARE_TYPE; } + YY_BREAK +case 188: +YY_RULE_SETUP +#line 327 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JG; return COMPARE_TYPE; } + YY_BREAK +case 189: +YY_RULE_SETUP +#line 328 "lev_comp.l" +{ newline(); } + YY_BREAK +case 190: +YY_RULE_SETUP +#line 329 "lev_comp.l" +{ advancepos(yytext); } + YY_BREAK +case 191: +YY_RULE_SETUP +#line 330 "lev_comp.l" +{ savetoken(yytext); yylval.i = yytext[2]; return CHAR; } + YY_BREAK +case 192: +YY_RULE_SETUP +#line 331 "lev_comp.l" +{ savetoken(yytext); yylval.i = yytext[1]; return CHAR; } + YY_BREAK +case 193: +YY_RULE_SETUP +#line 332 "lev_comp.l" +ST_RET(UNKNOWN_TYPE); + YY_BREAK +case 194: +YY_RULE_SETUP +#line 333 "lev_comp.l" +{ savetoken(yytext); return yytext[0]; } + YY_BREAK +case 195: +YY_RULE_SETUP +#line 334 "lev_comp.l" ECHO; YY_BREAK +#line 2357 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(MAPC): yyterminate(); @@ -1431,6 +2365,7 @@ case YY_STATE_EOF(MAPC): /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { @@ -1576,7 +2511,7 @@ static int yy_get_next_buffer() { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { - /* We matched a singled characater, the EOB, so + /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; @@ -1603,7 +2538,7 @@ static int yy_get_next_buffer() /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - yy_n_chars = 0; + yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { @@ -1625,7 +2560,6 @@ static int yy_get_next_buffer() if ( b->yy_is_our_buffer ) { - int old_size = b->yy_buf_size + 2; int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) @@ -1635,8 +2569,8 @@ static int yy_get_next_buffer() b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yy_flex_realloc2( (genericptr_t) b->yy_ch_buf, - b->yy_buf_size + 2, old_size ); + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -1659,6 +2593,8 @@ static int yy_get_next_buffer() /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) @@ -1711,7 +2647,7 @@ static yy_state_type yy_get_previous_state() while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 643 ) + if ( yy_current_state >= 1038 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1727,8 +2663,12 @@ static yy_state_type yy_get_previous_state() * next_state = yy_try_NUL_trans( current_state ); */ +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; +#endif { register int yy_is_jam; register char *yy_cp = yy_c_buf_p; @@ -1742,20 +2682,24 @@ yy_state_type yy_current_state; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 643 ) + if ( yy_current_state >= 1038 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 642); + yy_is_jam = (yy_current_state == 1037); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else static void yyunput( c, yy_bp ) int c; register char *yy_bp; +#endif { register char *yy_cp = yy_c_buf_p; @@ -1776,7 +2720,8 @@ register char *yy_bp; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -1792,7 +2737,11 @@ register char *yy_bp; #endif /* ifndef YY_NO_UNPUT */ +#ifdef __cplusplus +static int yyinput() +#else static int input() +#endif { int c; @@ -1810,32 +2759,44 @@ static int input() else { /* need more input */ - yytext_ptr = yy_c_buf_p; + int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + case EOB_ACT_END_OF_FILE: { if ( yywrap() ) - { - yy_c_buf_p = - yytext_ptr + YY_MORE_ADJ; return EOF; - } if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else return input(); +#endif } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + yy_c_buf_p = yytext_ptr + offset; break; - - case EOB_ACT_LAST_MATCH: - YY_FATAL_ERROR( - "unexpected last match in input()" ); } } } @@ -1850,8 +2811,12 @@ static int input() } +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else void yyrestart( input_file ) FILE *input_file; +#endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); @@ -1861,8 +2826,12 @@ FILE *input_file; } +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; +#endif { if ( yy_current_buffer == new_buffer ) return; @@ -1887,7 +2856,11 @@ YY_BUFFER_STATE new_buffer; } +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else void yy_load_buffer_state() +#endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; @@ -1896,9 +2869,13 @@ void yy_load_buffer_state() } +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; +#endif { YY_BUFFER_STATE b; @@ -1923,8 +2900,12 @@ int size; } +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else void yy_delete_buffer( b ) YY_BUFFER_STATE b; +#endif { if ( ! b ) return; @@ -1933,31 +2914,37 @@ YY_BUFFER_STATE b; yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yy_flex_free( (genericptr_t) b->yy_ch_buf ); + yy_flex_free( (void *) b->yy_ch_buf ); - yy_flex_free( (genericptr_t) b ); + yy_flex_free( (void *) b ); } #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE -extern int FDECL(isatty, (int)); +extern int isatty YY_PROTO(( int )); #endif #endif +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; +#endif + + { yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; -#ifdef YY_ALWAYS_INTERACTIVE +#if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else -#ifdef YY_NEVER_INTERACTIVE +#if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; @@ -1966,9 +2953,17 @@ FILE *file; } +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else void yy_flush_buffer( b ) YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes @@ -1988,13 +2983,162 @@ YY_BUFFER_STATE b; } +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else static void yy_fatal_error( msg ) -const char msg[]; +char msg[]; +#endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); @@ -2010,7 +3154,7 @@ const char msg[]; { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n - YY_MORE_ADJ; \ + yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ @@ -2021,10 +3165,14 @@ const char msg[]; /* Internal utility routines. */ #ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else static void yy_flex_strncpy( s1, s2, n ) char *s1; -const char *s2; +yyconst char *s2; int n; +#endif { register int i; for ( i = 0; i < n; ++i ) @@ -2032,38 +3180,69 @@ int n; } #endif - -static genericptr_t yy_flex_alloc( size ) -yy_size_t size; +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif { - return (genericptr_t) alloc((unsigned)size); - } + register int n; + for ( n = 0; s[n]; ++n ) + ; -/* we want to avoid use of realloc(), so we require that caller supply the - size of the old block of memory */ -static genericptr_t yy_flex_realloc2( ptr, size, old_size ) -genericptr_t ptr; + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) yy_size_t size; -int old_size; +#endif { - genericptr_t outptr = yy_flex_alloc(size); - - if (ptr) { - char *p = (char *) outptr, *q = (char *) ptr; - - while (--old_size >= 0) *p++ = *q++; - yy_flex_free(ptr); - } - return outptr; + return (void *) malloc( size ); } +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else static void yy_flex_free( ptr ) -genericptr_t ptr; +void *ptr; +#endif { free( ptr ); } -/*flexhack.skl*/ +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 334 "lev_comp.l" #ifdef AMIGA long *alloc(n) @@ -2083,6 +3262,7 @@ FILE *input_f; else #endif yyin = input_f; + if (!orig_yyin) orig_yyin = yyin; } /* analogous routine (for completeness) */ void init_yyout( output_f ) @@ -2091,4 +3271,51 @@ FILE *output_f; yyout = output_f; } +long +handle_varstring_check() +{ + struct lc_vardefs *vd; + yylval.map = (char *) alloc(strlen(yytext)+1); + Strcpy(yylval.map, yytext); + if ((vd = vardef_defined(variable_definitions, yytext, 1))) { + long l = vd->var_type; + long a = ((l & SPOVAR_ARRAY) == SPOVAR_ARRAY); + l = (l & ~SPOVAR_ARRAY); + if (l == SPOVAR_INT) return (a ? VARSTRING_INT_ARRAY : VARSTRING_INT); + if (l == SPOVAR_STRING) return (a ? VARSTRING_STRING_ARRAY : VARSTRING_STRING); + if (l == SPOVAR_VARIABLE) return (a ? VARSTRING_VAR_ARRAY : VARSTRING_VAR); + if (l == SPOVAR_COORD) return (a ? VARSTRING_COORD_ARRAY : VARSTRING_COORD); + if (l == SPOVAR_REGION) return (a ? VARSTRING_REGION_ARRAY : VARSTRING_REGION); + if (l == SPOVAR_MAPCHAR) return (a ? VARSTRING_MAPCHAR_ARRAY : VARSTRING_MAPCHAR); + if (l == SPOVAR_MONST) return (a ? VARSTRING_MONST_ARRAY : VARSTRING_MONST); + if (l == SPOVAR_OBJ) return (a ? VARSTRING_OBJ_ARRAY : VARSTRING_OBJ); + if (l == SPOVAR_SEL) return (a ? VARSTRING_SEL_ARRAY : VARSTRING_SEL); + } + return VARSTRING; +} + + +void +newline() +{ + nh_line_number++; + token_start_pos = 0; + memset(curr_token, 0, 512); +} + +void +savetoken(s) +char *s; +{ + sprintf(curr_token, "%s", s); + advancepos(s); +} + +void +advancepos(s) +char *s; +{ + token_start_pos += strlen(s); +} + /*lev_comp.l*/ diff --git a/sys/share/lev_yacc.c b/sys/share/lev_yacc.c index 02aaf1938..f247c880b 100644 --- a/sys/share/lev_yacc.c +++ b/sys/share/lev_yacc.c @@ -1,15 +1,76 @@ -#ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) -#define YYPREFIX "yy" -/* NetHack 3.5 lev_comp.y $Date: 2009/05/11 22:53:51 $ $Revision: 1.10 $ */ -/* SCCS Id: @(#)lev_yacc.c 3.5 2007/08/01 */ + +/* A Bison parser, made by GNU Bison 2.4.1. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.4.1" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Copy the first part of user declarations. */ + +/* Line 189 of yacc.c */ +#line 1 "lev_comp.y" + +/* SCCS Id: @(#)lev_yacc.c 3.4 2000/01/17 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -34,7 +95,6 @@ static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #include "hack.h" #include "sp_lev.h" -#define MAX_REGISTERS 10 #define ERR (-1) /* many types of things are put in chars for transference to NetHack. * since some systems will use signed chars, limit everybody to the @@ -42,11 +102,16 @@ static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; */ #define MAX_OF_TYPE 128 +#define MAX_NESTED_IFS 20 +#define MAX_SWITCH_CASES 20 + #define New(type) \ (type *) memset((genericptr_t)alloc(sizeof(type)), 0, sizeof(type)) #define NewTab(type, size) (type **) alloc(sizeof(type *) * size) #define Free(ptr) free((genericptr_t)ptr) +extern void VDECL(lc_error, (const char *, ...)); +extern void VDECL(lc_warning, (const char *, ...)); extern void FDECL(yyerror, (const char *)); extern void FDECL(yywarning, (const char *)); extern int NDECL(yylex); @@ -60,2392 +125,6131 @@ extern int FDECL(get_object_id, (char *,CHAR_P)); extern boolean FDECL(check_monster_char, (CHAR_P)); extern boolean FDECL(check_object_char, (CHAR_P)); extern char FDECL(what_map_char, (CHAR_P)); -extern void FDECL(scan_map, (char *)); -extern void NDECL(wallify_map); -extern boolean NDECL(check_subrooms); -extern void FDECL(check_coord, (int,int,const char *)); -extern void NDECL(store_part); -extern void NDECL(store_room); -extern boolean FDECL(write_level_file, (char *,splev *,specialmaze *)); -extern void FDECL(free_rooms, (splev *)); +extern void FDECL(scan_map, (char *, sp_lev *)); +extern void FDECL(add_opcode, (sp_lev *, int, genericptr_t)); +extern genericptr_t FDECL(get_last_opcode_data1, (sp_lev *, int)); +extern genericptr_t FDECL(get_last_opcode_data2, (sp_lev *, int,int)); +extern boolean FDECL(check_subrooms, (sp_lev *)); +extern boolean FDECL(write_level_file, (char *,sp_lev *)); +extern struct opvar *FDECL(set_opvar_int, (struct opvar *, long)); +extern void VDECL(add_opvars, (sp_lev *, const char *, ...)); +extern void FDECL(start_level_def, (sp_lev * *, char *)); -static struct reg { - int x1, y1; - int x2, y2; -} current_region; +extern struct lc_funcdefs *FDECL(funcdef_new,(long,char *)); +extern void FDECL(funcdef_free_all,(struct lc_funcdefs *)); +extern struct lc_funcdefs *FDECL(funcdef_defined,(struct lc_funcdefs *,char *, int)); +extern char *FDECL(funcdef_paramtypes, (struct lc_funcdefs *)); +extern char *FDECL(decode_parm_str, (char *)); -static struct coord { - int x; - int y; -} current_coord, current_align; +extern struct lc_vardefs *FDECL(vardef_new,(long,char *)); +extern void FDECL(vardef_free_all,(struct lc_vardefs *)); +extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); -static struct size { - int height; - int width; -} current_size; +extern void NDECL(break_stmt_start); +extern void FDECL(break_stmt_end, (sp_lev *)); +extern void FDECL(break_stmt_new, (sp_lev *, long)); -char tmpmessage[256]; -digpos *tmppass[32]; -char *tmpmap[ROWNO]; +extern void FDECL(splev_add_from, (sp_lev *, sp_lev *)); -digpos *tmpdig[MAX_OF_TYPE]; -region *tmpreg[MAX_OF_TYPE]; -lev_region *tmplreg[MAX_OF_TYPE]; -door *tmpdoor[MAX_OF_TYPE]; -drawbridge *tmpdb[MAX_OF_TYPE]; -walk *tmpwalk[MAX_OF_TYPE]; +extern void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long)); +extern void FDECL(vardef_used, (struct lc_vardefs *, char *)); +extern struct lc_vardefs *FDECL(add_vardef_type, (struct lc_vardefs *, char *, long)); -room_door *tmprdoor[MAX_OF_TYPE]; -trap *tmptrap[MAX_OF_TYPE]; -monster *tmpmonst[MAX_OF_TYPE]; -object *tmpobj[MAX_OF_TYPE]; -altar *tmpaltar[MAX_OF_TYPE]; -lad *tmplad[MAX_OF_TYPE]; -stair *tmpstair[MAX_OF_TYPE]; -gold *tmpgold[MAX_OF_TYPE]; -engraving *tmpengraving[MAX_OF_TYPE]; -fountain *tmpfountain[MAX_OF_TYPE]; -sink *tmpsink[MAX_OF_TYPE]; -pool *tmppool[MAX_OF_TYPE]; +extern int FDECL(reverse_jmp_opcode, (int)); -mazepart *tmppart[10]; -room *tmproom[MAXNROFROOMS*2]; -corridor *tmpcor[MAX_OF_TYPE]; +struct coord { + long x; + long y; +}; -static specialmaze maze; -static splev special_lev; -static lev_init init_lev; +struct forloopdef { + char *varname; + long jmp_point; +}; +static struct forloopdef forloop_list[MAX_NESTED_IFS]; +static short n_forloops = 0; -static char olist[MAX_REGISTERS], mlist[MAX_REGISTERS]; -static struct coord plist[MAX_REGISTERS]; -int n_olist = 0, n_mlist = 0, n_plist = 0; +sp_lev *splev = NULL; -unsigned int nlreg = 0, nreg = 0, ndoor = 0, ntrap = 0, nmons = 0, nobj = 0; -unsigned int ndb = 0, nwalk = 0, npart = 0, ndig = 0, nlad = 0, nstair = 0; -unsigned int naltar = 0, ncorridor = 0, nrooms = 0, ngold = 0, nengraving = 0; -unsigned int nfountain = 0, npool = 0, nsink = 0, npass = 0; +static struct opvar *if_list[MAX_NESTED_IFS]; -static int lev_flags = 0; +static short n_if_list = 0; unsigned int max_x_map, max_y_map; +int obj_containment = 0; -static xchar in_room; +int in_container_obj = 0; + +/* integer value is possibly an inconstant value (eg. dice notation or a variable) */ +int is_inconstant_number = 0; + +int in_switch_statement = 0; +static struct opvar *switch_check_jump = NULL; +static struct opvar *switch_default_case = NULL; +static struct opvar *switch_case_list[MAX_SWITCH_CASES]; +static long switch_case_value[MAX_SWITCH_CASES]; +int n_switch_case_list = 0; + +int allow_break_statements = 0; +struct lc_breakdef *break_list = NULL; + +extern struct lc_vardefs *variable_definitions; + + +struct lc_vardefs *function_tmp_var_defs = NULL; +extern struct lc_funcdefs *function_definitions; +struct lc_funcdefs *curr_function = NULL; +struct lc_funcdefs_parm * curr_function_param = NULL; +int in_function_definition = 0; +sp_lev *function_splev_backup = NULL; extern int fatal_error; -extern int want_warnings; +extern int got_errors; +extern int line_number; extern const char *fname; -typedef union +extern char curr_token[512]; + + + +/* Line 189 of yacc.c */ +#line 218 "y.tab.c" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + CHAR = 258, + INTEGER = 259, + BOOLEAN = 260, + PERCENT = 261, + SPERCENT = 262, + MINUS_INTEGER = 263, + PLUS_INTEGER = 264, + MAZE_GRID_ID = 265, + SOLID_FILL_ID = 266, + MINES_ID = 267, + ROGUELEV_ID = 268, + MESSAGE_ID = 269, + MAZE_ID = 270, + LEVEL_ID = 271, + LEV_INIT_ID = 272, + GEOMETRY_ID = 273, + NOMAP_ID = 274, + OBJECT_ID = 275, + COBJECT_ID = 276, + MONSTER_ID = 277, + TRAP_ID = 278, + DOOR_ID = 279, + DRAWBRIDGE_ID = 280, + object_ID = 281, + monster_ID = 282, + terrain_ID = 283, + MAZEWALK_ID = 284, + WALLIFY_ID = 285, + REGION_ID = 286, + FILLING = 287, + IRREGULAR = 288, + JOINED = 289, + ALTAR_ID = 290, + LADDER_ID = 291, + STAIR_ID = 292, + NON_DIGGABLE_ID = 293, + NON_PASSWALL_ID = 294, + ROOM_ID = 295, + PORTAL_ID = 296, + TELEPRT_ID = 297, + BRANCH_ID = 298, + LEV = 299, + MINERALIZE_ID = 300, + CORRIDOR_ID = 301, + GOLD_ID = 302, + ENGRAVING_ID = 303, + FOUNTAIN_ID = 304, + POOL_ID = 305, + SINK_ID = 306, + NONE = 307, + RAND_CORRIDOR_ID = 308, + DOOR_STATE = 309, + LIGHT_STATE = 310, + CURSE_TYPE = 311, + ENGRAVING_TYPE = 312, + DIRECTION = 313, + RANDOM_TYPE = 314, + RANDOM_TYPE_BRACKET = 315, + A_REGISTER = 316, + ALIGNMENT = 317, + LEFT_OR_RIGHT = 318, + CENTER = 319, + TOP_OR_BOT = 320, + ALTAR_TYPE = 321, + UP_OR_DOWN = 322, + SUBROOM_ID = 323, + NAME_ID = 324, + FLAGS_ID = 325, + FLAG_TYPE = 326, + MON_ATTITUDE = 327, + MON_ALERTNESS = 328, + MON_APPEARANCE = 329, + ROOMDOOR_ID = 330, + IF_ID = 331, + ELSE_ID = 332, + TERRAIN_ID = 333, + HORIZ_OR_VERT = 334, + REPLACE_TERRAIN_ID = 335, + EXIT_ID = 336, + SHUFFLE_ID = 337, + QUANTITY_ID = 338, + BURIED_ID = 339, + LOOP_ID = 340, + FOR_ID = 341, + TO_ID = 342, + SWITCH_ID = 343, + CASE_ID = 344, + BREAK_ID = 345, + DEFAULT_ID = 346, + ERODED_ID = 347, + TRAPPED_ID = 348, + RECHARGED_ID = 349, + INVIS_ID = 350, + GREASED_ID = 351, + FEMALE_ID = 352, + CANCELLED_ID = 353, + REVIVED_ID = 354, + AVENGE_ID = 355, + FLEEING_ID = 356, + BLINDED_ID = 357, + PARALYZED_ID = 358, + STUNNED_ID = 359, + CONFUSED_ID = 360, + SEENTRAPS_ID = 361, + ALL_ID = 362, + MONTYPE_ID = 363, + GRAVE_ID = 364, + ERODEPROOF_ID = 365, + FUNCTION_ID = 366, + MSG_OUTPUT_TYPE = 367, + COMPARE_TYPE = 368, + UNKNOWN_TYPE = 369, + rect_ID = 370, + fillrect_ID = 371, + line_ID = 372, + randline_ID = 373, + grow_ID = 374, + selection_ID = 375, + flood_ID = 376, + rndcoord_ID = 377, + circle_ID = 378, + ellipse_ID = 379, + filter_ID = 380, + complement_ID = 381, + gradient_ID = 382, + GRADIENT_TYPE = 383, + LIMITED = 384, + HUMIDITY_TYPE = 385, + STRING = 386, + MAP_ID = 387, + NQSTRING = 388, + VARSTRING = 389, + CFUNC = 390, + CFUNC_INT = 391, + CFUNC_STR = 392, + CFUNC_COORD = 393, + CFUNC_REGION = 394, + VARSTRING_INT = 395, + VARSTRING_INT_ARRAY = 396, + VARSTRING_STRING = 397, + VARSTRING_STRING_ARRAY = 398, + VARSTRING_VAR = 399, + VARSTRING_VAR_ARRAY = 400, + VARSTRING_COORD = 401, + VARSTRING_COORD_ARRAY = 402, + VARSTRING_REGION = 403, + VARSTRING_REGION_ARRAY = 404, + VARSTRING_MAPCHAR = 405, + VARSTRING_MAPCHAR_ARRAY = 406, + VARSTRING_MONST = 407, + VARSTRING_MONST_ARRAY = 408, + VARSTRING_OBJ = 409, + VARSTRING_OBJ_ARRAY = 410, + VARSTRING_SEL = 411, + VARSTRING_SEL_ARRAY = 412, + METHOD_INT = 413, + METHOD_INT_ARRAY = 414, + METHOD_STRING = 415, + METHOD_STRING_ARRAY = 416, + METHOD_VAR = 417, + METHOD_VAR_ARRAY = 418, + METHOD_COORD = 419, + METHOD_COORD_ARRAY = 420, + METHOD_REGION = 421, + METHOD_REGION_ARRAY = 422, + METHOD_MAPCHAR = 423, + METHOD_MAPCHAR_ARRAY = 424, + METHOD_MONST = 425, + METHOD_MONST_ARRAY = 426, + METHOD_OBJ = 427, + METHOD_OBJ_ARRAY = 428, + METHOD_SEL = 429, + METHOD_SEL_ARRAY = 430, + DICE = 431 + }; +#endif +/* Tokens. */ +#define CHAR 258 +#define INTEGER 259 +#define BOOLEAN 260 +#define PERCENT 261 +#define SPERCENT 262 +#define MINUS_INTEGER 263 +#define PLUS_INTEGER 264 +#define MAZE_GRID_ID 265 +#define SOLID_FILL_ID 266 +#define MINES_ID 267 +#define ROGUELEV_ID 268 +#define MESSAGE_ID 269 +#define MAZE_ID 270 +#define LEVEL_ID 271 +#define LEV_INIT_ID 272 +#define GEOMETRY_ID 273 +#define NOMAP_ID 274 +#define OBJECT_ID 275 +#define COBJECT_ID 276 +#define MONSTER_ID 277 +#define TRAP_ID 278 +#define DOOR_ID 279 +#define DRAWBRIDGE_ID 280 +#define object_ID 281 +#define monster_ID 282 +#define terrain_ID 283 +#define MAZEWALK_ID 284 +#define WALLIFY_ID 285 +#define REGION_ID 286 +#define FILLING 287 +#define IRREGULAR 288 +#define JOINED 289 +#define ALTAR_ID 290 +#define LADDER_ID 291 +#define STAIR_ID 292 +#define NON_DIGGABLE_ID 293 +#define NON_PASSWALL_ID 294 +#define ROOM_ID 295 +#define PORTAL_ID 296 +#define TELEPRT_ID 297 +#define BRANCH_ID 298 +#define LEV 299 +#define MINERALIZE_ID 300 +#define CORRIDOR_ID 301 +#define GOLD_ID 302 +#define ENGRAVING_ID 303 +#define FOUNTAIN_ID 304 +#define POOL_ID 305 +#define SINK_ID 306 +#define NONE 307 +#define RAND_CORRIDOR_ID 308 +#define DOOR_STATE 309 +#define LIGHT_STATE 310 +#define CURSE_TYPE 311 +#define ENGRAVING_TYPE 312 +#define DIRECTION 313 +#define RANDOM_TYPE 314 +#define RANDOM_TYPE_BRACKET 315 +#define A_REGISTER 316 +#define ALIGNMENT 317 +#define LEFT_OR_RIGHT 318 +#define CENTER 319 +#define TOP_OR_BOT 320 +#define ALTAR_TYPE 321 +#define UP_OR_DOWN 322 +#define SUBROOM_ID 323 +#define NAME_ID 324 +#define FLAGS_ID 325 +#define FLAG_TYPE 326 +#define MON_ATTITUDE 327 +#define MON_ALERTNESS 328 +#define MON_APPEARANCE 329 +#define ROOMDOOR_ID 330 +#define IF_ID 331 +#define ELSE_ID 332 +#define TERRAIN_ID 333 +#define HORIZ_OR_VERT 334 +#define REPLACE_TERRAIN_ID 335 +#define EXIT_ID 336 +#define SHUFFLE_ID 337 +#define QUANTITY_ID 338 +#define BURIED_ID 339 +#define LOOP_ID 340 +#define FOR_ID 341 +#define TO_ID 342 +#define SWITCH_ID 343 +#define CASE_ID 344 +#define BREAK_ID 345 +#define DEFAULT_ID 346 +#define ERODED_ID 347 +#define TRAPPED_ID 348 +#define RECHARGED_ID 349 +#define INVIS_ID 350 +#define GREASED_ID 351 +#define FEMALE_ID 352 +#define CANCELLED_ID 353 +#define REVIVED_ID 354 +#define AVENGE_ID 355 +#define FLEEING_ID 356 +#define BLINDED_ID 357 +#define PARALYZED_ID 358 +#define STUNNED_ID 359 +#define CONFUSED_ID 360 +#define SEENTRAPS_ID 361 +#define ALL_ID 362 +#define MONTYPE_ID 363 +#define GRAVE_ID 364 +#define ERODEPROOF_ID 365 +#define FUNCTION_ID 366 +#define MSG_OUTPUT_TYPE 367 +#define COMPARE_TYPE 368 +#define UNKNOWN_TYPE 369 +#define rect_ID 370 +#define fillrect_ID 371 +#define line_ID 372 +#define randline_ID 373 +#define grow_ID 374 +#define selection_ID 375 +#define flood_ID 376 +#define rndcoord_ID 377 +#define circle_ID 378 +#define ellipse_ID 379 +#define filter_ID 380 +#define complement_ID 381 +#define gradient_ID 382 +#define GRADIENT_TYPE 383 +#define LIMITED 384 +#define HUMIDITY_TYPE 385 +#define STRING 386 +#define MAP_ID 387 +#define NQSTRING 388 +#define VARSTRING 389 +#define CFUNC 390 +#define CFUNC_INT 391 +#define CFUNC_STR 392 +#define CFUNC_COORD 393 +#define CFUNC_REGION 394 +#define VARSTRING_INT 395 +#define VARSTRING_INT_ARRAY 396 +#define VARSTRING_STRING 397 +#define VARSTRING_STRING_ARRAY 398 +#define VARSTRING_VAR 399 +#define VARSTRING_VAR_ARRAY 400 +#define VARSTRING_COORD 401 +#define VARSTRING_COORD_ARRAY 402 +#define VARSTRING_REGION 403 +#define VARSTRING_REGION_ARRAY 404 +#define VARSTRING_MAPCHAR 405 +#define VARSTRING_MAPCHAR_ARRAY 406 +#define VARSTRING_MONST 407 +#define VARSTRING_MONST_ARRAY 408 +#define VARSTRING_OBJ 409 +#define VARSTRING_OBJ_ARRAY 410 +#define VARSTRING_SEL 411 +#define VARSTRING_SEL_ARRAY 412 +#define METHOD_INT 413 +#define METHOD_INT_ARRAY 414 +#define METHOD_STRING 415 +#define METHOD_STRING_ARRAY 416 +#define METHOD_VAR 417 +#define METHOD_VAR_ARRAY 418 +#define METHOD_COORD 419 +#define METHOD_COORD_ARRAY 420 +#define METHOD_REGION 421 +#define METHOD_REGION_ARRAY 422 +#define METHOD_MAPCHAR 423 +#define METHOD_MAPCHAR_ARRAY 424 +#define METHOD_MONST 425 +#define METHOD_MONST_ARRAY 426 +#define METHOD_OBJ 427 +#define METHOD_OBJ_ARRAY 428 +#define METHOD_SEL 429 +#define METHOD_SEL_ARRAY 430 +#define DICE 431 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE { - int i; + +/* Line 214 of yacc.c */ +#line 146 "lev_comp.y" + + long i; char* map; struct { - xchar room; - xchar wall; - xchar door; + long room; + long wall; + long door; } corpos; + struct { + long area; + long x1; + long y1; + long x2; + long y2; + } lregn; + struct { + long x; + long y; + } crd; + struct { + long ter; + long lit; + } terr; + struct { + long height; + long width; + } sze; + struct { + long die; + long num; + } dice; + struct { + long cfunc; + char *varstr; + } meth; + + + +/* Line 214 of yacc.c */ +#line 645 "y.tab.c" } YYSTYPE; -#define CHAR 257 -#define INTEGER 258 -#define BOOLEAN 259 -#define PERCENT 260 -#define MESSAGE_ID 261 -#define MAZE_ID 262 -#define LEVEL_ID 263 -#define LEV_INIT_ID 264 -#define GEOMETRY_ID 265 -#define NOMAP_ID 266 -#define OBJECT_ID 267 -#define COBJECT_ID 268 -#define MONSTER_ID 269 -#define TRAP_ID 270 -#define DOOR_ID 271 -#define DRAWBRIDGE_ID 272 -#define MAZEWALK_ID 273 -#define WALLIFY_ID 274 -#define REGION_ID 275 -#define FILLING 276 -#define RANDOM_OBJECTS_ID 277 -#define RANDOM_MONSTERS_ID 278 -#define RANDOM_PLACES_ID 279 -#define ALTAR_ID 280 -#define LADDER_ID 281 -#define STAIR_ID 282 -#define NON_DIGGABLE_ID 283 -#define NON_PASSWALL_ID 284 -#define ROOM_ID 285 -#define PORTAL_ID 286 -#define TELEPRT_ID 287 -#define BRANCH_ID 288 -#define LEV 289 -#define CHANCE_ID 290 -#define CORRIDOR_ID 291 -#define GOLD_ID 292 -#define ENGRAVING_ID 293 -#define FOUNTAIN_ID 294 -#define POOL_ID 295 -#define SINK_ID 296 -#define NONE 297 -#define RAND_CORRIDOR_ID 298 -#define DOOR_STATE 299 -#define LIGHT_STATE 300 -#define CURSE_TYPE 301 -#define ENGRAVING_TYPE 302 -#define DIRECTION 303 -#define RANDOM_TYPE 304 -#define O_REGISTER 305 -#define M_REGISTER 306 -#define P_REGISTER 307 -#define A_REGISTER 308 -#define ALIGNMENT 309 -#define LEFT_OR_RIGHT 310 -#define CENTER 311 -#define TOP_OR_BOT 312 -#define ALTAR_TYPE 313 -#define UP_OR_DOWN 314 -#define SUBROOM_ID 315 -#define NAME_ID 316 -#define FLAGS_ID 317 -#define FLAG_TYPE 318 -#define MON_ATTITUDE 319 -#define MON_ALERTNESS 320 -#define MON_APPEARANCE 321 -#define CONTAINED 322 -#define STRING 323 -#define MAP_ID 324 -#define YYERRCODE 256 -short yylhs[] = { -1, - 0, 0, 36, 36, 37, 37, 38, 39, 32, 23, - 23, 23, 14, 14, 19, 19, 20, 20, 40, 40, - 45, 42, 42, 46, 46, 43, 43, 49, 49, 44, - 44, 51, 52, 52, 53, 53, 35, 50, 50, 56, - 54, 10, 10, 59, 59, 57, 57, 60, 60, 58, - 58, 55, 55, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 61, 61, 61, 61, 62, 63, 64, 15, - 15, 13, 13, 12, 12, 31, 11, 11, 41, 41, - 75, 76, 76, 79, 1, 1, 2, 2, 77, 77, - 80, 80, 80, 47, 47, 48, 48, 81, 83, 81, - 78, 78, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 99, 65, 98, 98, 100, 100, 100, 100, - 100, 66, 66, 102, 101, 103, 103, 104, 104, 104, - 104, 105, 105, 106, 107, 107, 108, 108, 108, 85, - 67, 86, 92, 93, 94, 74, 109, 88, 110, 89, - 111, 113, 90, 114, 91, 112, 112, 22, 22, 69, - 70, 71, 95, 96, 87, 68, 72, 73, 25, 25, - 25, 28, 28, 28, 33, 33, 34, 34, 3, 3, - 4, 4, 21, 21, 21, 97, 97, 97, 5, 5, - 6, 6, 7, 7, 7, 8, 8, 117, 29, 26, - 9, 82, 24, 27, 30, 16, 16, 17, 17, 18, - 18, 116, 115, -}; -short yylen[] = { 2, - 0, 1, 1, 2, 1, 1, 5, 7, 3, 0, - 13, 15, 1, 1, 0, 3, 3, 1, 0, 2, - 3, 0, 2, 3, 3, 0, 1, 1, 2, 1, - 1, 1, 0, 2, 5, 5, 7, 2, 2, 12, - 12, 0, 2, 5, 1, 5, 1, 5, 1, 5, - 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 3, 9, 1, - 1, 1, 1, 1, 1, 5, 1, 1, 1, 2, - 3, 1, 2, 5, 1, 1, 1, 1, 0, 2, - 3, 3, 3, 1, 3, 1, 3, 1, 0, 4, - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 10, 0, 2, 2, 2, 2, 2, - 3, 2, 2, 0, 9, 1, 1, 0, 7, 5, - 5, 1, 1, 1, 1, 1, 0, 2, 2, 5, - 6, 7, 5, 1, 5, 5, 0, 8, 0, 8, - 0, 0, 8, 0, 6, 0, 2, 1, 10, 3, - 3, 3, 3, 3, 8, 7, 5, 7, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 2, 4, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, - 4, 1, 1, 1, 1, 1, 1, 0, 1, 1, - 1, 5, 9, -}; -short yydefred[] = { 0, - 0, 0, 0, 0, 0, 2, 0, 5, 6, 0, - 0, 0, 0, 0, 4, 215, 0, 9, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 0, 0, 22, - 77, 78, 76, 0, 0, 0, 0, 82, 7, 0, - 89, 0, 20, 0, 17, 0, 21, 0, 80, 0, - 83, 0, 0, 0, 0, 0, 23, 27, 0, 52, - 52, 0, 85, 86, 0, 0, 0, 0, 0, 90, - 0, 0, 0, 0, 32, 8, 30, 0, 29, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 154, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 103, 104, 106, 113, - 114, 119, 120, 118, 102, 105, 107, 108, 109, 110, - 111, 112, 115, 116, 117, 121, 122, 214, 0, 24, - 213, 0, 25, 192, 0, 191, 0, 0, 34, 0, - 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, - 88, 87, 84, 91, 93, 0, 92, 0, 212, 219, - 0, 132, 133, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 199, 200, 0, - 198, 0, 0, 196, 197, 0, 0, 0, 0, 0, - 0, 0, 157, 0, 168, 173, 174, 159, 161, 164, - 216, 217, 0, 0, 170, 95, 97, 201, 202, 0, - 0, 0, 0, 70, 71, 0, 68, 172, 171, 67, - 0, 0, 0, 183, 0, 182, 0, 184, 180, 0, - 179, 0, 181, 190, 0, 189, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 100, 0, 0, 0, 0, 0, 150, 0, 0, 153, - 0, 0, 205, 0, 203, 0, 204, 155, 0, 0, - 0, 156, 0, 0, 0, 177, 220, 221, 0, 45, - 0, 0, 47, 0, 0, 0, 36, 35, 0, 0, - 222, 0, 188, 187, 134, 0, 186, 185, 0, 151, - 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 162, 165, 0, 0, 0, 0, 0, 0, 0, 0, - 209, 0, 210, 0, 152, 0, 0, 0, 207, 206, - 176, 0, 0, 0, 0, 178, 0, 49, 0, 0, - 0, 51, 0, 0, 0, 72, 73, 0, 13, 14, - 0, 0, 123, 0, 0, 175, 211, 0, 158, 160, - 0, 163, 0, 0, 0, 0, 0, 0, 74, 75, - 0, 0, 0, 137, 136, 0, 125, 0, 0, 0, - 167, 44, 0, 0, 46, 0, 0, 37, 69, 12, - 0, 135, 0, 0, 0, 0, 0, 0, 41, 0, - 40, 143, 142, 144, 0, 0, 0, 126, 223, 195, - 0, 48, 43, 50, 0, 0, 128, 129, 0, 130, - 127, 169, 146, 145, 0, 0, 0, 131, 0, 0, - 140, 141, 0, 148, 149, 139, -}; -short yydgoto[] = { 3, - 65, 163, 265, 135, 210, 240, 306, 371, 307, 439, - 33, 411, 388, 391, 246, 233, 171, 319, 13, 25, - 396, 223, 21, 132, 262, 263, 129, 257, 258, 136, - 4, 5, 339, 335, 243, 6, 7, 8, 9, 28, - 39, 44, 56, 76, 29, 57, 130, 133, 58, 59, - 77, 78, 139, 60, 80, 61, 325, 384, 322, 380, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 40, 41, 50, 69, 42, 70, - 167, 168, 204, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 224, 433, 417, 448, - 172, 362, 416, 432, 445, 446, 466, 471, 277, 279, - 280, 402, 375, 281, 225, 214, 215, -}; -short yysindex[] = { -149, - -5, 1, 0, -269, -269, 0, -149, 0, 0, -242, - -242, 12, -154, -154, 0, 0, 50, 0, -200, 41, - -137, -137, -232, 103, 0, -103, 99, -132, -137, 0, - 0, 0, 0, -200, 126, -141, 128, 0, 0, -132, - 0, -136, 0, -251, 0, -68, 0, -158, 0, -139, - 0, 129, 132, 134, 135, -100, 0, 0, -253, 0, - 0, 151, 0, 0, 155, 144, 146, 147, -109, 0, - -51, -50, -260, -260, 0, 0, 0, -83, 0, -165, - -165, -49, -162, -51, -50, 174, -44, -44, -44, -44, - 159, 160, 161, 0, 162, 163, 166, 167, 168, 170, - 171, 172, 173, 175, 176, 177, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 165, 0, - 0, 183, 0, 0, 188, 0, 192, 179, 0, 180, - 181, 182, 185, 186, 187, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 197, - 0, 0, 0, 0, 0, -12, 0, 0, 0, 0, - 189, 0, 0, 190, 191, -212, 46, 46, 210, 46, - 46, 58, 210, 210, -37, -37, -37, -230, 46, 46, - -51, -50, -193, -193, 211, -237, 46, -4, 46, 46, - -242, -6, 212, 213, -221, -233, -258, 0, 0, 214, - 0, 164, 215, 0, 0, 216, 3, 218, 219, 226, - 267, 96, 0, 312, 0, 0, 0, 0, 0, 0, - 0, 0, 313, 317, 0, 0, 0, 0, 0, 319, - 322, 110, 325, 0, 0, 326, 0, 0, 0, 0, - 329, 130, 174, 0, 296, 0, 365, 0, 0, 321, - 0, 369, 0, 0, 376, 0, 46, 178, 119, 120, - 383, -193, -208, 115, 193, 403, 404, 136, 409, 410, - 411, 46, -161, -1, 28, 412, -35, -212, -193, 416, - 0, 194, -257, 200, -228, 46, 0, 366, 417, 0, - 202, 418, 0, 388, 0, 423, 0, 0, 448, 235, - -37, 0, -37, -37, -37, 0, 0, 0, 454, 0, - 241, 456, 0, 244, 459, 228, 0, 0, 488, 493, - 0, 449, 0, 0, 0, 458, 0, 0, 494, 0, - 0, -212, 497, -260, 291, -259, 294, 49, 509, 510, - 0, 0, -242, 511, 40, 512, 42, 514, -148, -219, - 0, 517, 0, 46, 0, 304, 519, 471, 0, 0, - 0, 521, 252, -242, 524, 0, 311, 0, -158, 526, - 316, 0, 318, 527, -227, 0, 0, 531, 0, 0, - 533, 38, 0, 534, 303, 0, 0, 323, 0, 0, - 268, 0, 542, 540, 42, 544, 543, -242, 0, 0, - 545, -227, 330, 0, 0, 546, 0, 333, 548, 549, - 0, 0, -162, 550, 0, 337, 550, 0, 0, 0, - -263, 0, 552, 547, 339, 341, 559, 345, 0, 567, - 0, 0, 0, 0, 565, 570, -108, 0, 0, 0, - 574, 0, 0, 0, -235, -225, 0, 0, -242, 0, - 0, 0, 0, 0, 575, 576, 576, 0, -225, -262, - 0, 0, 576, 0, 0, 0, -}; -short yyrindex[] = { 616, - 0, 0, 0, -129, 349, 0, 621, 0, 0, 0, - 0, 0, -210, 406, 0, 0, 0, 0, 0, 0, - -98, 408, 0, 282, 0, 0, 0, 0, 367, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 57, 0, 0, 0, 0, 0, 539, - 0, 0, 0, 0, 0, 4, 0, 0, 123, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 169, 0, - 0, 0, 0, 0, 0, 0, 0, 89, 0, 426, - 445, 0, 0, 0, 0, 0, 564, 564, 564, 564, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 203, 0, - 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 506, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 572, 0, 0, 0, - 0, 0, 0, 0, 607, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 6, 0, 0, 641, 0, - 0, 0, 0, 148, 0, 0, 148, 0, 0, 0, - 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 109, 109, 0, 0, 0, - 0, 0, 109, 0, 0, 0, -}; -short yygindex[] = { 0, - 245, 205, 0, -60, -267, -181, 195, 0, 0, 196, - 0, 223, 0, 0, 0, 0, 91, 0, 631, 603, - 0, -169, 625, 437, 0, 0, 441, 0, 0, -10, - 0, 0, 0, 0, 361, 642, 0, 0, 0, 20, - 610, 0, 0, 0, 0, 0, -72, -70, 592, 0, - 0, 0, 0, 0, 593, 0, 0, 248, 0, 0, - 0, 0, 0, 0, 587, 588, 590, 591, 594, 0, - 0, 597, 604, 605, 0, 0, 0, 0, 0, 0, - 419, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -170, 0, 0, 0, - 573, 0, 0, 0, 0, 207, -419, -415, 0, 0, - 0, 0, 0, 0, -63, -77, 0, -}; -#define YYTABLESIZE 935 -short yytable[] = { 17, - 18, 79, 217, 33, 242, 138, 213, 216, 169, 219, - 220, 164, 241, 137, 165, 228, 229, 230, 234, 235, - 329, 244, 463, 131, 31, 52, 53, 231, 248, 249, - 409, 54, 463, 54, 474, 128, 467, 442, 321, 389, - 443, 30, 124, 134, 369, 264, 333, 12, 43, 473, - 10, 472, 10, 370, 10, 10, 26, 476, 11, 444, - 475, 55, 16, 55, 16, 16, 245, 324, 464, 19, - 259, 32, 260, 232, 365, 337, 410, 166, 464, 379, - 16, 383, 254, 255, 390, 166, 208, 444, 31, 331, - 302, 209, 366, 23, 16, 303, 297, 222, 26, 304, - 305, 87, 88, 89, 90, 140, 238, 330, 147, 20, - 239, 316, 1, 2, 96, 218, 141, 24, 236, 226, - 227, 237, 28, 27, 142, 340, 104, 105, 106, 143, - 144, 15, 37, 38, 15, 15, 15, 66, 67, 68, - 317, 349, 318, 350, 351, 352, 34, 42, 161, 162, - 145, 63, 64, 35, 386, 387, 36, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 19, 19, 81, 46, - 96, 97, 98, 99, 100, 169, 101, 102, 103, 174, - 175, 47, 104, 105, 106, 48, 71, 51, 62, 72, - 250, 73, 74, 393, 82, 303, 266, 75, 83, 304, - 305, 84, 94, 85, 86, 128, 131, 138, 191, 160, - 457, 458, 459, 166, 16, 170, 176, 177, 178, 179, - 180, 415, 327, 181, 182, 183, 192, 184, 185, 186, - 187, 193, 188, 189, 190, 194, 195, 196, 197, 198, - 202, 96, 199, 200, 201, 203, 205, 206, 207, 217, - 242, 221, 251, 247, 268, 252, 253, 267, 269, 270, - 271, 272, 273, 79, 79, 33, 33, 138, 138, 274, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 18, 334, 367, 338, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 33, 138, 138, 138, 138, 138, - 138, 138, 320, 138, 124, 124, 275, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 26, 26, - 138, 138, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 323, 124, 124, 124, 124, 124, 124, 124, 11, - 124, 211, 376, 378, 212, 382, 221, 26, 15, 211, - 31, 31, 212, 276, 26, 278, 282, 124, 124, 414, - 283, 211, 284, 400, 212, 285, 19, 286, 287, 288, - 147, 147, 289, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 28, 28, 292, 290, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 427, 147, 147, - 147, 147, 147, 147, 147, 10, 147, 19, 293, 42, - 42, 294, 295, 28, 42, 42, 42, 42, 42, 296, - 28, 299, 300, 147, 147, 38, 301, 42, 308, 42, - 81, 81, 42, 81, 81, 298, 461, 42, 42, 42, - 42, 42, 42, 42, 39, 42, 310, 311, 468, 312, - 309, 332, 313, 314, 315, 326, 331, 336, 341, 343, - 342, 344, 42, 42, 94, 94, 346, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 345, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 347, 348, 94, 94, 94, 94, 353, 354, 355, - 94, 356, 357, 96, 96, 98, 96, 96, 96, 96, - 96, 96, 96, 96, 96, 96, 96, 94, 96, 96, - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, - 358, 359, 96, 96, 96, 96, 360, 364, 101, 96, - 366, 361, 18, 18, 18, 18, 18, 18, 368, 99, - 363, 372, 373, 374, 377, 381, 96, 385, 18, 18, - 392, 394, 395, 397, 398, 399, 18, 401, 403, 405, - 408, 193, 18, 406, 412, 407, 413, 418, 419, 18, - 420, 421, 422, 423, 425, 428, 426, 449, 430, 431, - 434, 435, 436, 438, 440, 447, 18, 450, 451, 452, - 11, 11, 11, 453, 11, 11, 166, 454, 455, 15, - 15, 15, 15, 456, 462, 1, 11, 11, 469, 470, - 3, 218, 441, 404, 11, 15, 15, 437, 19, 19, - 11, 19, 19, 15, 429, 14, 45, 11, 22, 15, - 194, 460, 261, 19, 19, 256, 15, 328, 15, 49, - 79, 19, 424, 81, 11, 107, 108, 19, 109, 110, - 173, 465, 111, 15, 19, 112, 10, 10, 10, 19, - 19, 291, 113, 114, 0, 0, 0, 0, 0, 0, - 0, 19, 10, 10, 19, 19, 0, 38, 38, 0, - 10, 0, 19, 0, 0, 0, 10, 0, 19, 0, - 0, 0, 0, 10, 0, 19, 39, 39, 0, 0, - 38, 0, 0, 0, 0, 0, 38, 0, 0, 0, - 10, 0, 19, 38, 0, 0, 0, 0, 0, 39, - 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, - 38, 0, 39, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, - 0, 0, 0, 0, 0, 0, 0, 98, 98, 0, - 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, - 98, 0, 98, 98, 98, 98, 98, 98, 98, 98, - 0, 98, 98, 98, 0, 0, 0, 98, 98, 98, - 101, 101, 0, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 0, 0, 0, 0, 101, 101, - 101, 101, 101, 0, 101, 101, 101, 0, 0, 0, - 101, 101, 101, 193, 193, 0, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 0, 0, 0, - 0, 193, 193, 193, 193, 193, 0, 193, 193, 193, - 0, 0, 0, 193, 193, 193, 0, 0, 166, 166, - 0, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 0, 0, 0, 0, 166, 166, 166, 166, - 166, 0, 166, 166, 166, 0, 0, 0, 166, 166, - 166, 0, 194, 194, 0, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 0, 0, 0, 0, - 194, 194, 194, 194, 194, 0, 194, 194, 194, 0, - 0, 0, 194, 194, 194, -}; -short yycheck[] = { 10, - 11, 0, 40, 0, 40, 0, 177, 178, 86, 180, - 181, 84, 194, 74, 85, 185, 186, 187, 189, 190, - 288, 259, 258, 257, 257, 277, 278, 258, 199, 200, - 258, 285, 258, 285, 297, 257, 456, 301, 40, 259, - 304, 22, 0, 304, 304, 304, 304, 317, 29, 469, - 261, 467, 58, 313, 265, 266, 0, 473, 58, 323, - 323, 315, 323, 315, 323, 323, 304, 40, 304, 58, - 304, 304, 306, 304, 342, 304, 304, 40, 304, 40, - 323, 40, 304, 305, 304, 40, 299, 323, 0, 41, - 272, 304, 44, 44, 323, 304, 267, 40, 58, 308, - 309, 267, 268, 269, 270, 271, 300, 289, 0, 264, - 304, 282, 262, 263, 280, 179, 282, 318, 191, 183, - 184, 192, 0, 261, 290, 296, 292, 293, 294, 295, - 296, 261, 265, 266, 264, 265, 266, 277, 278, 279, - 302, 311, 304, 313, 314, 315, 44, 0, 311, 312, - 316, 310, 311, 257, 303, 304, 58, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 265, 266, 0, 44, - 280, 281, 282, 283, 284, 253, 286, 287, 288, 89, - 90, 323, 292, 293, 294, 58, 58, 324, 257, 58, - 201, 58, 58, 364, 44, 304, 207, 298, 44, 308, - 309, 58, 0, 58, 58, 257, 257, 291, 44, 259, - 319, 320, 321, 40, 323, 260, 58, 58, 58, 58, - 58, 392, 258, 58, 58, 58, 44, 58, 58, 58, - 58, 44, 58, 58, 58, 44, 58, 58, 58, 58, - 44, 0, 58, 58, 58, 258, 58, 58, 58, 40, - 40, 289, 259, 258, 91, 44, 44, 44, 44, 44, - 258, 44, 44, 262, 263, 262, 263, 262, 263, 44, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 0, 293, 344, 295, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 291, 290, 291, 292, 293, 294, - 295, 296, 304, 298, 262, 263, 40, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 262, 263, - 315, 316, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 304, 290, 291, 292, 293, 294, 295, 296, 0, - 298, 304, 353, 304, 307, 304, 289, 291, 0, 304, - 262, 263, 307, 258, 298, 44, 44, 315, 316, 322, - 44, 304, 44, 374, 307, 44, 0, 258, 44, 44, - 262, 263, 44, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 262, 263, 91, 258, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 408, 290, 291, - 292, 293, 294, 295, 296, 0, 298, 0, 44, 262, - 263, 91, 44, 291, 267, 268, 269, 270, 271, 44, - 298, 303, 303, 315, 316, 0, 44, 280, 314, 282, - 262, 263, 285, 265, 266, 258, 447, 290, 291, 292, - 293, 294, 295, 296, 0, 298, 44, 44, 459, 314, - 258, 258, 44, 44, 44, 44, 41, 258, 93, 258, - 44, 44, 315, 316, 262, 263, 44, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 91, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 44, 258, 291, 292, 293, 294, 44, 258, 44, - 298, 258, 44, 262, 263, 0, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 315, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 303, 44, 291, 292, 293, 294, 44, 44, 0, 298, - 44, 93, 261, 262, 263, 264, 265, 266, 258, 44, - 93, 258, 44, 44, 44, 44, 315, 44, 277, 278, - 44, 258, 44, 93, 44, 314, 285, 44, 258, 44, - 44, 0, 291, 258, 44, 258, 44, 44, 276, 298, - 258, 314, 41, 44, 41, 41, 44, 41, 259, 44, - 258, 44, 44, 44, 258, 44, 315, 259, 258, 41, - 261, 262, 263, 259, 265, 266, 0, 41, 44, 261, - 262, 263, 264, 44, 41, 0, 277, 278, 44, 44, - 0, 58, 427, 379, 285, 277, 278, 423, 262, 263, - 291, 265, 266, 285, 412, 5, 34, 298, 14, 291, - 0, 447, 206, 277, 278, 205, 298, 287, 7, 40, - 59, 285, 405, 61, 315, 69, 69, 291, 69, 69, - 88, 455, 69, 315, 298, 69, 261, 262, 263, 262, - 263, 253, 69, 69, -1, -1, -1, -1, -1, -1, - -1, 315, 277, 278, 277, 278, -1, 262, 263, -1, - 285, -1, 285, -1, -1, -1, 291, -1, 291, -1, - -1, -1, -1, 298, -1, 298, 262, 263, -1, -1, - 285, -1, -1, -1, -1, -1, 291, -1, -1, -1, - 315, -1, 315, 298, -1, -1, -1, -1, -1, 285, - -1, -1, -1, -1, -1, 291, -1, -1, -1, -1, - 315, -1, 298, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 315, - -1, -1, -1, -1, -1, -1, -1, 262, 263, -1, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, -1, 277, 278, 279, 280, 281, 282, 283, 284, - -1, 286, 287, 288, -1, -1, -1, 292, 293, 294, - 262, 263, -1, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, -1, -1, -1, -1, 280, 281, - 282, 283, 284, -1, 286, 287, 288, -1, -1, -1, - 292, 293, 294, 262, 263, -1, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, -1, -1, -1, - -1, 280, 281, 282, 283, 284, -1, 286, 287, 288, - -1, -1, -1, 292, 293, 294, -1, -1, 262, 263, - -1, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, -1, -1, -1, -1, 280, 281, 282, 283, - 284, -1, 286, 287, 288, -1, -1, -1, 292, 293, - 294, -1, 262, 263, -1, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, -1, -1, -1, -1, - 280, 281, 282, 283, 284, -1, 286, 287, 288, -1, - -1, -1, 292, 293, 294, -}; -#define YYFINAL 3 -#ifndef YYDEBUG -#define YYDEBUG 0 +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 #endif -#define YYMAXTOKEN 324 + + +/* Copy the second part of user declarations. */ + + +/* Line 264 of yacc.c */ +#line 657 "y.tab.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; +#endif +{ + return yyi; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 9 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 1031 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 194 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 160 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 406 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 866 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 431 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 189, 193, 2, + 133, 134, 187, 185, 131, 186, 191, 188, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 132, 2, + 2, 190, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 135, 2, 136, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 137, 192, 138, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184 +}; + #if YYDEBUG -char *yyname[] = { -"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"'('","')'",0,0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,"':'",0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,"']'",0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"CHAR", -"INTEGER","BOOLEAN","PERCENT","MESSAGE_ID","MAZE_ID","LEVEL_ID","LEV_INIT_ID", -"GEOMETRY_ID","NOMAP_ID","OBJECT_ID","COBJECT_ID","MONSTER_ID","TRAP_ID", -"DOOR_ID","DRAWBRIDGE_ID","MAZEWALK_ID","WALLIFY_ID","REGION_ID","FILLING", -"RANDOM_OBJECTS_ID","RANDOM_MONSTERS_ID","RANDOM_PLACES_ID","ALTAR_ID", -"LADDER_ID","STAIR_ID","NON_DIGGABLE_ID","NON_PASSWALL_ID","ROOM_ID", -"PORTAL_ID","TELEPRT_ID","BRANCH_ID","LEV","CHANCE_ID","CORRIDOR_ID","GOLD_ID", -"ENGRAVING_ID","FOUNTAIN_ID","POOL_ID","SINK_ID","NONE","RAND_CORRIDOR_ID", -"DOOR_STATE","LIGHT_STATE","CURSE_TYPE","ENGRAVING_TYPE","DIRECTION", -"RANDOM_TYPE","O_REGISTER","M_REGISTER","P_REGISTER","A_REGISTER","ALIGNMENT", -"LEFT_OR_RIGHT","CENTER","TOP_OR_BOT","ALTAR_TYPE","UP_OR_DOWN","SUBROOM_ID", -"NAME_ID","FLAGS_ID","FLAG_TYPE","MON_ATTITUDE","MON_ALERTNESS", -"MON_APPEARANCE","CONTAINED","STRING","MAP_ID", +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 4, 6, 8, 11, 15, 19, 25, + 27, 29, 35, 41, 45, 62, 63, 66, 67, 70, + 71, 74, 76, 78, 79, 83, 87, 89, 90, 93, + 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, + 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, + 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, + 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, + 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, + 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, + 217, 219, 221, 223, 225, 227, 229, 231, 235, 239, + 245, 249, 255, 261, 267, 271, 275, 281, 287, 293, + 301, 309, 317, 323, 325, 329, 331, 335, 337, 341, + 343, 347, 349, 353, 355, 359, 361, 365, 366, 367, + 376, 381, 383, 384, 386, 388, 394, 398, 399, 400, + 410, 411, 414, 415, 421, 422, 427, 429, 432, 434, + 441, 442, 446, 447, 454, 455, 460, 461, 466, 468, + 469, 474, 478, 480, 484, 488, 494, 500, 508, 513, + 514, 525, 526, 539, 540, 543, 549, 551, 557, 559, + 565, 567, 573, 575, 585, 591, 593, 595, 597, 599, + 601, 605, 607, 609, 611, 619, 625, 627, 629, 631, + 633, 637, 638, 644, 649, 650, 654, 656, 658, 660, + 662, 665, 667, 669, 671, 673, 675, 679, 683, 687, + 689, 691, 695, 697, 699, 703, 707, 708, 714, 717, + 718, 722, 724, 728, 730, 734, 738, 740, 742, 746, + 748, 750, 752, 756, 758, 760, 762, 768, 776, 782, + 791, 793, 797, 803, 809, 817, 825, 832, 838, 839, + 842, 846, 850, 854, 856, 862, 872, 878, 882, 886, + 887, 898, 899, 901, 909, 915, 921, 925, 931, 939, + 949, 951, 953, 955, 957, 959, 960, 963, 965, 969, + 971, 973, 975, 977, 979, 981, 983, 985, 987, 989, + 991, 993, 997, 999, 1001, 1006, 1008, 1010, 1015, 1017, + 1019, 1024, 1026, 1031, 1037, 1039, 1043, 1045, 1049, 1051, + 1053, 1058, 1068, 1070, 1072, 1077, 1079, 1085, 1087, 1089, + 1094, 1096, 1098, 1104, 1106, 1108, 1110, 1115, 1117, 1119, + 1125, 1127, 1129, 1133, 1135, 1137, 1141, 1143, 1148, 1152, + 1156, 1160, 1164, 1168, 1172, 1174, 1176, 1180, 1182, 1186, + 1187, 1189, 1191, 1193, 1195, 1199, 1200, 1202, 1204, 1207, + 1210, 1215, 1222, 1227, 1234, 1241, 1248, 1255, 1258, 1265, + 1274, 1283, 1294, 1309, 1312, 1314, 1318, 1320, 1324, 1326, + 1328, 1330, 1332, 1334, 1336, 1338, 1340, 1342, 1344, 1346, + 1348, 1350, 1352, 1354, 1356, 1358, 1369 }; -char *yyrule[] = { -"$accept : file", -"file :", -"file : levels", -"levels : level", -"levels : level levels", -"level : maze_level", -"level : room_level", -"maze_level : maze_def flags lev_init messages regions", -"room_level : level_def flags lev_init messages rreg_init rooms corridors_def", -"level_def : LEVEL_ID ':' string", -"lev_init :", -"lev_init : LEV_INIT_ID ':' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled", -"lev_init : LEV_INIT_ID ':' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled ',' BOOLEAN", -"walled : BOOLEAN", -"walled : RANDOM_TYPE", -"flags :", -"flags : FLAGS_ID ':' flag_list", -"flag_list : FLAG_TYPE ',' flag_list", -"flag_list : FLAG_TYPE", -"messages :", -"messages : message messages", -"message : MESSAGE_ID ':' STRING", -"rreg_init :", -"rreg_init : rreg_init init_rreg", -"init_rreg : RANDOM_OBJECTS_ID ':' object_list", -"init_rreg : RANDOM_MONSTERS_ID ':' monster_list", -"rooms :", -"rooms : roomlist", -"roomlist : aroom", -"roomlist : aroom roomlist", -"corridors_def : random_corridors", -"corridors_def : corridors", -"random_corridors : RAND_CORRIDOR_ID", -"corridors :", -"corridors : corridors corridor", -"corridor : CORRIDOR_ID ':' corr_spec ',' corr_spec", -"corridor : CORRIDOR_ID ':' corr_spec ',' INTEGER", -"corr_spec : '(' INTEGER ',' DIRECTION ',' door_pos ')'", -"aroom : room_def room_details", -"aroom : subroom_def room_details", -"subroom_def : SUBROOM_ID ':' room_type ',' light_state ',' subroom_pos ',' room_size ',' string roomfill", -"room_def : ROOM_ID ':' room_type ',' light_state ',' room_pos ',' room_align ',' room_size roomfill", -"roomfill :", -"roomfill : ',' BOOLEAN", -"room_pos : '(' INTEGER ',' INTEGER ')'", -"room_pos : RANDOM_TYPE", -"subroom_pos : '(' INTEGER ',' INTEGER ')'", -"subroom_pos : RANDOM_TYPE", -"room_align : '(' h_justif ',' v_justif ')'", -"room_align : RANDOM_TYPE", -"room_size : '(' INTEGER ',' INTEGER ')'", -"room_size : RANDOM_TYPE", -"room_details :", -"room_details : room_details room_detail", -"room_detail : room_name", -"room_detail : room_chance", -"room_detail : room_door", -"room_detail : monster_detail", -"room_detail : object_detail", -"room_detail : trap_detail", -"room_detail : altar_detail", -"room_detail : fountain_detail", -"room_detail : sink_detail", -"room_detail : pool_detail", -"room_detail : gold_detail", -"room_detail : engraving_detail", -"room_detail : stair_detail", -"room_name : NAME_ID ':' string", -"room_chance : CHANCE_ID ':' INTEGER", -"room_door : DOOR_ID ':' secret ',' door_state ',' door_wall ',' door_pos", -"secret : BOOLEAN", -"secret : RANDOM_TYPE", -"door_wall : DIRECTION", -"door_wall : RANDOM_TYPE", -"door_pos : INTEGER", -"door_pos : RANDOM_TYPE", -"maze_def : MAZE_ID ':' string ',' filling", -"filling : CHAR", -"filling : RANDOM_TYPE", -"regions : aregion", -"regions : aregion regions", -"aregion : map_definition reg_init map_details", -"map_definition : NOMAP_ID", -"map_definition : map_geometry MAP_ID", -"map_geometry : GEOMETRY_ID ':' h_justif ',' v_justif", -"h_justif : LEFT_OR_RIGHT", -"h_justif : CENTER", -"v_justif : TOP_OR_BOT", -"v_justif : CENTER", -"reg_init :", -"reg_init : reg_init init_reg", -"init_reg : RANDOM_OBJECTS_ID ':' object_list", -"init_reg : RANDOM_PLACES_ID ':' place_list", -"init_reg : RANDOM_MONSTERS_ID ':' monster_list", -"object_list : object", -"object_list : object ',' object_list", -"monster_list : monster", -"monster_list : monster ',' monster_list", -"place_list : place", -"$$1 :", -"place_list : place $$1 ',' place_list", -"map_details :", -"map_details : map_details map_detail", -"map_detail : monster_detail", -"map_detail : object_detail", -"map_detail : door_detail", -"map_detail : trap_detail", -"map_detail : drawbridge_detail", -"map_detail : region_detail", -"map_detail : stair_region", -"map_detail : portal_region", -"map_detail : teleprt_region", -"map_detail : branch_region", -"map_detail : altar_detail", -"map_detail : fountain_detail", -"map_detail : mazewalk_detail", -"map_detail : wallify_detail", -"map_detail : ladder_detail", -"map_detail : stair_detail", -"map_detail : gold_detail", -"map_detail : engraving_detail", -"map_detail : diggable_detail", -"map_detail : passwall_detail", -"$$2 :", -"monster_detail : MONSTER_ID chance ':' monster_c ',' m_name ',' coordinate $$2 monster_infos", -"monster_infos :", -"monster_infos : monster_infos monster_info", -"monster_info : ',' string", -"monster_info : ',' MON_ATTITUDE", -"monster_info : ',' MON_ALERTNESS", -"monster_info : ',' alignment", -"monster_info : ',' MON_APPEARANCE string", -"object_detail : OBJECT_ID object_desc", -"object_detail : COBJECT_ID object_desc", -"$$3 :", -"object_desc : chance ':' object_c ',' o_name $$3 ',' object_where object_infos", -"object_where : coordinate", -"object_where : CONTAINED", -"object_infos :", -"object_infos : ',' curse_state ',' monster_id ',' enchantment optional_name", -"object_infos : ',' curse_state ',' enchantment optional_name", -"object_infos : ',' monster_id ',' enchantment optional_name", -"curse_state : RANDOM_TYPE", -"curse_state : CURSE_TYPE", -"monster_id : STRING", -"enchantment : RANDOM_TYPE", -"enchantment : INTEGER", -"optional_name :", -"optional_name : ',' NONE", -"optional_name : ',' STRING", -"door_detail : DOOR_ID ':' door_state ',' coordinate", -"trap_detail : TRAP_ID chance ':' trap_name ',' coordinate", -"drawbridge_detail : DRAWBRIDGE_ID ':' coordinate ',' DIRECTION ',' door_state", -"mazewalk_detail : MAZEWALK_ID ':' coordinate ',' DIRECTION", -"wallify_detail : WALLIFY_ID", -"ladder_detail : LADDER_ID ':' coordinate ',' UP_OR_DOWN", -"stair_detail : STAIR_ID ':' coordinate ',' UP_OR_DOWN", -"$$4 :", -"stair_region : STAIR_ID ':' lev_region $$4 ',' lev_region ',' UP_OR_DOWN", -"$$5 :", -"portal_region : PORTAL_ID ':' lev_region $$5 ',' lev_region ',' string", -"$$6 :", -"$$7 :", -"teleprt_region : TELEPRT_ID ':' lev_region $$6 ',' lev_region $$7 teleprt_detail", -"$$8 :", -"branch_region : BRANCH_ID ':' lev_region $$8 ',' lev_region", -"teleprt_detail :", -"teleprt_detail : ',' UP_OR_DOWN", -"lev_region : region", -"lev_region : LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'", -"fountain_detail : FOUNTAIN_ID ':' coordinate", -"sink_detail : SINK_ID ':' coordinate", -"pool_detail : POOL_ID ':' coordinate", -"diggable_detail : NON_DIGGABLE_ID ':' region", -"passwall_detail : NON_PASSWALL_ID ':' region", -"region_detail : REGION_ID ':' region ',' light_state ',' room_type prefilled", -"altar_detail : ALTAR_ID ':' coordinate ',' alignment ',' altar_type", -"gold_detail : GOLD_ID ':' amount ',' coordinate", -"engraving_detail : ENGRAVING_ID ':' coordinate ',' engraving_type ',' string", -"monster_c : monster", -"monster_c : RANDOM_TYPE", -"monster_c : m_register", -"object_c : object", -"object_c : RANDOM_TYPE", -"object_c : o_register", -"m_name : string", -"m_name : RANDOM_TYPE", -"o_name : string", -"o_name : RANDOM_TYPE", -"trap_name : string", -"trap_name : RANDOM_TYPE", -"room_type : string", -"room_type : RANDOM_TYPE", -"prefilled :", -"prefilled : ',' FILLING", -"prefilled : ',' FILLING ',' BOOLEAN", -"coordinate : coord", -"coordinate : p_register", -"coordinate : RANDOM_TYPE", -"door_state : DOOR_STATE", -"door_state : RANDOM_TYPE", -"light_state : LIGHT_STATE", -"light_state : RANDOM_TYPE", -"alignment : ALIGNMENT", -"alignment : a_register", -"alignment : RANDOM_TYPE", -"altar_type : ALTAR_TYPE", -"altar_type : RANDOM_TYPE", -"p_register : P_REGISTER '[' INTEGER ']'", -"o_register : O_REGISTER '[' INTEGER ']'", -"m_register : M_REGISTER '[' INTEGER ']'", -"a_register : A_REGISTER '[' INTEGER ']'", -"place : coord", -"monster : CHAR", -"object : CHAR", -"string : STRING", -"amount : INTEGER", -"amount : RANDOM_TYPE", -"chance :", -"chance : PERCENT", -"engraving_type : ENGRAVING_TYPE", -"engraving_type : RANDOM_TYPE", -"coord : '(' INTEGER ',' INTEGER ')'", -"region : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'", + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 195, 0, -1, -1, 196, -1, 197, -1, 197, 196, + -1, 198, 205, 207, -1, 16, 132, 139, -1, 15, + 132, 139, 131, 199, -1, 59, -1, 3, -1, 17, + 132, 11, 131, 297, -1, 17, 132, 10, 131, 3, + -1, 17, 132, 13, -1, 17, 132, 12, 131, 3, + 131, 3, 131, 5, 131, 5, 131, 316, 131, 204, + 203, -1, -1, 131, 129, -1, -1, 131, 323, -1, + -1, 131, 3, -1, 5, -1, 59, -1, -1, 70, + 132, 206, -1, 71, 131, 206, -1, 71, -1, -1, + 209, 207, -1, 137, 207, 138, -1, 250, -1, 200, + -1, 305, -1, 306, -1, 292, -1, 252, -1, 215, + -1, 214, -1, 300, -1, 264, -1, 284, -1, 308, + -1, 309, -1, 294, -1, 307, -1, 230, -1, 240, + -1, 242, -1, 246, -1, 244, -1, 227, -1, 237, + -1, 223, -1, 226, -1, 287, -1, 269, -1, 285, + -1, 272, -1, 278, -1, 301, -1, 296, -1, 290, + -1, 251, -1, 302, -1, 257, -1, 255, -1, 295, + -1, 299, -1, 298, -1, 288, -1, 289, -1, 291, + -1, 283, -1, 286, -1, 149, -1, 151, -1, 153, + -1, 155, -1, 157, -1, 159, -1, 161, -1, 163, + -1, 165, -1, 148, -1, 150, -1, 152, -1, 154, + -1, 156, -1, 158, -1, 160, -1, 162, -1, 164, + -1, 210, -1, 211, -1, 142, -1, 142, -1, 211, + -1, 82, 132, 210, -1, 212, 190, 335, -1, 212, + 190, 120, 132, 344, -1, 212, 190, 334, -1, 212, + 190, 350, 132, 328, -1, 212, 190, 349, 132, 330, + -1, 212, 190, 348, 132, 332, -1, 212, 190, 323, + -1, 212, 190, 326, -1, 212, 190, 137, 221, 138, + -1, 212, 190, 137, 220, 138, -1, 212, 190, 137, + 219, 138, -1, 212, 190, 350, 132, 137, 218, 138, + -1, 212, 190, 349, 132, 137, 217, 138, -1, 212, + 190, 348, 132, 137, 216, 138, -1, 212, 190, 137, + 222, 138, -1, 333, -1, 216, 131, 333, -1, 331, + -1, 217, 131, 331, -1, 329, -1, 218, 131, 329, + -1, 327, -1, 219, 131, 327, -1, 324, -1, 220, + 131, 324, -1, 335, -1, 221, 131, 335, -1, 334, + -1, 222, 131, 334, -1, -1, -1, 111, 141, 133, + 224, 339, 134, 225, 208, -1, 141, 133, 342, 134, + -1, 81, -1, -1, 6, -1, 6, -1, 135, 335, + 113, 335, 136, -1, 135, 335, 136, -1, -1, -1, + 88, 231, 135, 322, 136, 232, 137, 233, 138, -1, + -1, 234, 233, -1, -1, 89, 346, 132, 235, 207, + -1, -1, 91, 132, 236, 207, -1, 90, -1, 191, + 191, -1, 87, -1, 86, 213, 190, 335, 238, 335, + -1, -1, 239, 241, 208, -1, -1, 85, 135, 322, + 136, 243, 208, -1, -1, 229, 132, 245, 209, -1, + -1, 76, 229, 247, 248, -1, 208, -1, -1, 208, + 249, 77, 208, -1, 14, 132, 334, -1, 53, -1, + 53, 132, 346, -1, 53, 132, 59, -1, 46, 132, + 253, 131, 253, -1, 46, 132, 253, 131, 346, -1, + 133, 4, 131, 58, 131, 268, 134, -1, 311, 228, + 131, 316, -1, -1, 68, 132, 254, 131, 261, 131, + 263, 312, 256, 208, -1, -1, 40, 132, 254, 131, + 260, 131, 262, 131, 263, 312, 258, 208, -1, -1, + 131, 5, -1, 133, 4, 131, 4, 134, -1, 59, + -1, 133, 4, 131, 4, 134, -1, 59, -1, 133, + 270, 131, 271, 134, -1, 59, -1, 133, 4, 131, + 4, 134, -1, 59, -1, 75, 132, 265, 131, 315, + 131, 266, 131, 268, -1, 24, 132, 315, 131, 344, + -1, 5, -1, 59, -1, 267, -1, 59, -1, 58, + -1, 58, 192, 267, -1, 4, -1, 59, -1, 19, + -1, 18, 132, 270, 131, 271, 259, 140, -1, 18, + 132, 323, 259, 140, -1, 63, -1, 64, -1, 65, + -1, 64, -1, 22, 132, 274, -1, -1, 22, 132, + 274, 273, 208, -1, 330, 131, 323, 275, -1, -1, + 275, 131, 276, -1, 334, -1, 72, -1, 73, -1, + 318, -1, 74, 334, -1, 97, -1, 95, -1, 98, + -1, 99, -1, 100, -1, 101, 132, 322, -1, 102, + 132, 322, -1, 103, 132, 322, -1, 104, -1, 105, + -1, 106, 132, 277, -1, 139, -1, 107, -1, 139, + 192, 277, -1, 20, 132, 280, -1, -1, 21, 132, + 280, 279, 208, -1, 332, 281, -1, -1, 281, 131, + 282, -1, 56, -1, 108, 132, 330, -1, 347, -1, + 69, 132, 334, -1, 83, 132, 322, -1, 84, -1, + 55, -1, 92, 132, 322, -1, 110, -1, 54, -1, + 93, -1, 94, 132, 322, -1, 95, -1, 96, -1, + 323, -1, 23, 132, 310, 131, 323, -1, 25, 132, + 323, 131, 58, 131, 315, -1, 29, 132, 323, 131, + 58, -1, 29, 132, 323, 131, 58, 131, 5, 203, + -1, 30, -1, 30, 132, 344, -1, 36, 132, 323, + 131, 67, -1, 37, 132, 323, 131, 67, -1, 37, + 132, 352, 131, 352, 131, 67, -1, 41, 132, 352, + 131, 352, 131, 139, -1, 42, 132, 352, 131, 352, + 293, -1, 43, 132, 352, 131, 352, -1, -1, 131, + 67, -1, 49, 132, 344, -1, 51, 132, 344, -1, + 50, 132, 344, -1, 3, -1, 133, 3, 131, 316, + 134, -1, 80, 132, 326, 131, 328, 131, 328, 131, + 7, -1, 78, 132, 344, 131, 328, -1, 38, 132, + 326, -1, 39, 132, 326, -1, -1, 31, 132, 326, + 131, 316, 131, 311, 312, 303, 304, -1, -1, 208, + -1, 35, 132, 323, 131, 317, 131, 319, -1, 109, + 132, 323, 131, 334, -1, 109, 132, 323, 131, 59, + -1, 109, 132, 323, -1, 47, 132, 335, 131, 323, + -1, 48, 132, 323, 131, 351, 131, 334, -1, 45, + 132, 322, 131, 322, 131, 322, 131, 322, -1, 45, + -1, 139, -1, 59, -1, 139, -1, 59, -1, -1, + 131, 313, -1, 314, -1, 314, 131, 313, -1, 32, + -1, 33, -1, 34, -1, 54, -1, 59, -1, 55, + -1, 59, -1, 62, -1, 320, -1, 59, -1, 62, + -1, 320, -1, 61, 132, 59, -1, 66, -1, 59, + -1, 61, 135, 4, 136, -1, 139, -1, 150, -1, + 151, 135, 335, 136, -1, 335, -1, 324, -1, 122, + 133, 344, 134, -1, 154, -1, 155, 135, 335, 136, + -1, 133, 4, 131, 4, 134, -1, 59, -1, 60, + 325, 136, -1, 130, -1, 130, 131, 325, -1, 327, + -1, 156, -1, 157, 135, 335, 136, -1, 133, 4, + 131, 4, 131, 4, 131, 4, 134, -1, 329, -1, + 158, -1, 159, 135, 335, 136, -1, 3, -1, 133, + 3, 131, 316, 134, -1, 331, -1, 160, -1, 161, + 135, 335, 136, -1, 139, -1, 3, -1, 133, 3, + 131, 139, 134, -1, 59, -1, 333, -1, 162, -1, + 163, 135, 335, 136, -1, 139, -1, 3, -1, 133, + 3, 131, 139, 134, -1, 59, -1, 321, -1, 334, + 191, 321, -1, 4, -1, 345, -1, 133, 8, 134, + -1, 148, -1, 149, 135, 335, 136, -1, 335, 185, + 335, -1, 335, 186, 335, -1, 335, 187, 335, -1, + 335, 188, 335, -1, 335, 189, 335, -1, 133, 335, + 134, -1, 144, -1, 145, -1, 212, 132, 336, -1, + 337, -1, 338, 131, 337, -1, -1, 338, -1, 335, + -1, 334, -1, 340, -1, 341, 131, 340, -1, -1, + 341, -1, 323, -1, 115, 326, -1, 116, 326, -1, + 117, 323, 186, 323, -1, 118, 323, 186, 323, 131, + 335, -1, 119, 133, 344, 134, -1, 119, 133, 267, + 131, 344, 134, -1, 125, 133, 7, 131, 344, 134, + -1, 125, 133, 344, 131, 344, 134, -1, 125, 133, + 328, 131, 344, 134, -1, 121, 323, -1, 123, 133, + 323, 131, 335, 134, -1, 123, 133, 323, 131, 335, + 131, 32, 134, -1, 124, 133, 323, 131, 335, 131, + 335, 134, -1, 124, 133, 323, 131, 335, 131, 335, + 131, 32, 134, -1, 127, 133, 128, 131, 133, 335, + 186, 335, 201, 134, 131, 323, 202, 134, -1, 126, + 343, -1, 164, -1, 133, 344, 134, -1, 343, -1, + 343, 193, 344, -1, 184, -1, 8, -1, 9, -1, + 4, -1, 8, -1, 9, -1, 4, -1, 345, -1, + 26, -1, 20, -1, 27, -1, 22, -1, 28, -1, + 78, -1, 57, -1, 59, -1, 353, -1, 44, 133, + 4, 131, 4, 131, 4, 131, 4, 134, -1, 133, + 4, 131, 4, 131, 4, 131, 4, 134, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 273, 273, 274, 277, 278, 281, 303, 308, 324, + 328, 334, 343, 352, 356, 382, 385, 392, 396, 403, + 406, 413, 414, 418, 421, 427, 431, 438, 441, 447, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 499, 500, 501, 502, 503, 504, + 505, 506, 507, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 521, 522, 523, 526, 527, 530, 542, 548, + 554, 560, 566, 572, 578, 584, 590, 597, 604, 611, + 618, 625, 632, 641, 646, 653, 658, 665, 670, 677, + 681, 687, 692, 699, 703, 709, 713, 720, 742, 719, + 756, 801, 808, 811, 817, 823, 827, 836, 840, 835, + 897, 898, 902, 901, 914, 913, 928, 938, 939, 942, + 975, 974, 1000, 999, 1029, 1028, 1059, 1058, 1084, 1093, + 1092, 1119, 1125, 1129, 1133, 1139, 1146, 1155, 1163, 1174, + 1173, 1189, 1188, 1205, 1208, 1214, 1224, 1230, 1239, 1245, + 1250, 1256, 1261, 1267, 1276, 1282, 1283, 1286, 1287, 1290, + 1294, 1300, 1301, 1304, 1310, 1316, 1324, 1325, 1328, 1329, + 1332, 1337, 1336, 1350, 1357, 1363, 1371, 1376, 1381, 1386, + 1391, 1396, 1401, 1406, 1411, 1416, 1421, 1426, 1431, 1436, + 1441, 1446, 1453, 1460, 1464, 1477, 1484, 1483, 1499, 1507, + 1513, 1521, 1526, 1531, 1536, 1541, 1546, 1551, 1556, 1561, + 1566, 1577, 1582, 1587, 1592, 1597, 1604, 1610, 1637, 1642, + 1649, 1653, 1659, 1665, 1671, 1681, 1691, 1706, 1716, 1719, + 1725, 1731, 1737, 1743, 1748, 1755, 1761, 1767, 1773, 1780, + 1779, 1803, 1806, 1812, 1818, 1822, 1827, 1834, 1840, 1847, + 1851, 1857, 1865, 1868, 1878, 1882, 1885, 1891, 1895, 1902, + 1906, 1910, 1916, 1917, 1920, 1921, 1924, 1925, 1926, 1932, + 1933, 1934, 1940, 1941, 1944, 1953, 1958, 1965, 1975, 1981, + 1985, 1989, 1996, 2005, 2011, 2015, 2021, 2025, 2033, 2037, + 2044, 2053, 2064, 2068, 2075, 2084, 2093, 2104, 2108, 2115, + 2124, 2133, 2142, 2151, 2157, 2161, 2168, 2177, 2187, 2196, + 2205, 2212, 2213, 2219, 2220, 2221, 2222, 2230, 2238, 2239, + 2240, 2241, 2242, 2243, 2246, 2252, 2260, 2289, 2290, 2293, + 2294, 2297, 2301, 2308, 2315, 2326, 2329, 2337, 2341, 2345, + 2349, 2353, 2358, 2362, 2366, 2370, 2374, 2378, 2382, 2386, + 2390, 2394, 2398, 2402, 2406, 2413, 2419, 2423, 2429, 2435, + 2436, 2437, 2440, 2444, 2448, 2452, 2458, 2459, 2462, 2463, + 2466, 2467, 2470, 2471, 2474, 2478, 2496 }; #endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "CHAR", "INTEGER", "BOOLEAN", "PERCENT", + "SPERCENT", "MINUS_INTEGER", "PLUS_INTEGER", "MAZE_GRID_ID", + "SOLID_FILL_ID", "MINES_ID", "ROGUELEV_ID", "MESSAGE_ID", "MAZE_ID", + "LEVEL_ID", "LEV_INIT_ID", "GEOMETRY_ID", "NOMAP_ID", "OBJECT_ID", + "COBJECT_ID", "MONSTER_ID", "TRAP_ID", "DOOR_ID", "DRAWBRIDGE_ID", + "object_ID", "monster_ID", "terrain_ID", "MAZEWALK_ID", "WALLIFY_ID", + "REGION_ID", "FILLING", "IRREGULAR", "JOINED", "ALTAR_ID", "LADDER_ID", + "STAIR_ID", "NON_DIGGABLE_ID", "NON_PASSWALL_ID", "ROOM_ID", "PORTAL_ID", + "TELEPRT_ID", "BRANCH_ID", "LEV", "MINERALIZE_ID", "CORRIDOR_ID", + "GOLD_ID", "ENGRAVING_ID", "FOUNTAIN_ID", "POOL_ID", "SINK_ID", "NONE", + "RAND_CORRIDOR_ID", "DOOR_STATE", "LIGHT_STATE", "CURSE_TYPE", + "ENGRAVING_TYPE", "DIRECTION", "RANDOM_TYPE", "RANDOM_TYPE_BRACKET", + "A_REGISTER", "ALIGNMENT", "LEFT_OR_RIGHT", "CENTER", "TOP_OR_BOT", + "ALTAR_TYPE", "UP_OR_DOWN", "SUBROOM_ID", "NAME_ID", "FLAGS_ID", + "FLAG_TYPE", "MON_ATTITUDE", "MON_ALERTNESS", "MON_APPEARANCE", + "ROOMDOOR_ID", "IF_ID", "ELSE_ID", "TERRAIN_ID", "HORIZ_OR_VERT", + "REPLACE_TERRAIN_ID", "EXIT_ID", "SHUFFLE_ID", "QUANTITY_ID", + "BURIED_ID", "LOOP_ID", "FOR_ID", "TO_ID", "SWITCH_ID", "CASE_ID", + "BREAK_ID", "DEFAULT_ID", "ERODED_ID", "TRAPPED_ID", "RECHARGED_ID", + "INVIS_ID", "GREASED_ID", "FEMALE_ID", "CANCELLED_ID", "REVIVED_ID", + "AVENGE_ID", "FLEEING_ID", "BLINDED_ID", "PARALYZED_ID", "STUNNED_ID", + "CONFUSED_ID", "SEENTRAPS_ID", "ALL_ID", "MONTYPE_ID", "GRAVE_ID", + "ERODEPROOF_ID", "FUNCTION_ID", "MSG_OUTPUT_TYPE", "COMPARE_TYPE", + "UNKNOWN_TYPE", "rect_ID", "fillrect_ID", "line_ID", "randline_ID", + "grow_ID", "selection_ID", "flood_ID", "rndcoord_ID", "circle_ID", + "ellipse_ID", "filter_ID", "complement_ID", "gradient_ID", + "GRADIENT_TYPE", "LIMITED", "HUMIDITY_TYPE", "','", "':'", "'('", "')'", + "'['", "']'", "'{'", "'}'", "STRING", "MAP_ID", "NQSTRING", "VARSTRING", + "CFUNC", "CFUNC_INT", "CFUNC_STR", "CFUNC_COORD", "CFUNC_REGION", + "VARSTRING_INT", "VARSTRING_INT_ARRAY", "VARSTRING_STRING", + "VARSTRING_STRING_ARRAY", "VARSTRING_VAR", "VARSTRING_VAR_ARRAY", + "VARSTRING_COORD", "VARSTRING_COORD_ARRAY", "VARSTRING_REGION", + "VARSTRING_REGION_ARRAY", "VARSTRING_MAPCHAR", "VARSTRING_MAPCHAR_ARRAY", + "VARSTRING_MONST", "VARSTRING_MONST_ARRAY", "VARSTRING_OBJ", + "VARSTRING_OBJ_ARRAY", "VARSTRING_SEL", "VARSTRING_SEL_ARRAY", + "METHOD_INT", "METHOD_INT_ARRAY", "METHOD_STRING", "METHOD_STRING_ARRAY", + "METHOD_VAR", "METHOD_VAR_ARRAY", "METHOD_COORD", "METHOD_COORD_ARRAY", + "METHOD_REGION", "METHOD_REGION_ARRAY", "METHOD_MAPCHAR", + "METHOD_MAPCHAR_ARRAY", "METHOD_MONST", "METHOD_MONST_ARRAY", + "METHOD_OBJ", "METHOD_OBJ_ARRAY", "METHOD_SEL", "METHOD_SEL_ARRAY", + "DICE", "'+'", "'-'", "'*'", "'/'", "'%'", "'='", "'.'", "'|'", "'&'", + "$accept", "file", "levels", "level", "level_def", "mazefiller", + "lev_init", "opt_limited", "opt_coord_or_var", "opt_fillchar", "walled", + "flags", "flag_list", "levstatements", "stmt_block", "levstatement", + "any_var_array", "any_var", "any_var_or_arr", "any_var_or_unk", + "shuffle_detail", "variable_define", "encodeobj_list", + "encodemonster_list", "mapchar_list", "encoderegion_list", + "encodecoord_list", "integer_list", "string_list", "function_define", + "$@1", "$@2", "function_call", "exitstatement", "opt_percent", + "comparestmt", "switchstatement", "$@3", "$@4", "switchcases", + "switchcase", "$@5", "$@6", "breakstatement", "for_to_span", + "forstmt_start", "forstatement", "$@7", "loopstatement", "$@8", + "chancestatement", "$@9", "ifstatement", "$@10", "if_ending", "$@11", + "message", "random_corridors", "corridor", "corr_spec", "room_begin", + "subroom_def", "$@12", "room_def", "$@13", "roomfill", "room_pos", + "subroom_pos", "room_align", "room_size", "door_detail", "secret", + "door_wall", "dir_list", "door_pos", "map_definition", "h_justif", + "v_justif", "monster_detail", "$@14", "monster_desc", "monster_infos", + "monster_info", "seen_trap_mask", "object_detail", "$@15", "object_desc", + "object_infos", "object_info", "trap_detail", "drawbridge_detail", + "mazewalk_detail", "wallify_detail", "ladder_detail", "stair_detail", + "stair_region", "portal_region", "teleprt_region", "branch_region", + "teleprt_detail", "fountain_detail", "sink_detail", "pool_detail", + "terrain_type", "replace_terrain_detail", "terrain_detail", + "diggable_detail", "passwall_detail", "region_detail", "@16", + "region_detail_end", "altar_detail", "grave_detail", "gold_detail", + "engraving_detail", "mineralize", "trap_name", "room_type", + "optroomregionflags", "roomregionflags", "roomregionflag", "door_state", + "light_state", "alignment", "alignment_prfx", "altar_type", "a_register", + "string_or_var", "integer_or_var", "coord_or_var", "encodecoord", + "humidity_flags", "region_or_var", "encoderegion", "mapchar_or_var", + "mapchar", "monster_or_var", "encodemonster", "object_or_var", + "encodeobj", "string_expr", "math_expr_var", "func_param_type", + "func_param_part", "func_param_list", "func_params_list", + "func_call_param_part", "func_call_param_list", "func_call_params_list", + "ter_selection_x", "ter_selection", "dice", "all_integers", + "all_ints_push", "objectid", "monsterid", "terrainid", "engraving_type", + "lev_region", "region", 0 +}; #endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 44, 58, 40, 41, 91, 93, 123, 125, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 43, 45, 42, 47, 37, + 61, 46, 124, 38 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint16 yyr1[] = +{ + 0, 194, 195, 195, 196, 196, 197, 198, 198, 199, + 199, 200, 200, 200, 200, 201, 201, 202, 202, 203, + 203, 204, 204, 205, 205, 206, 206, 207, 207, 208, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 210, 210, 210, 210, 210, 210, + 210, 210, 210, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 212, 212, 212, 213, 213, 214, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 216, 216, 217, 217, 218, 218, 219, + 219, 220, 220, 221, 221, 222, 222, 224, 225, 223, + 226, 227, 228, 228, 229, 229, 229, 231, 232, 230, + 233, 233, 235, 234, 236, 234, 237, 238, 238, 239, + 241, 240, 243, 242, 245, 244, 247, 246, 248, 249, + 248, 250, 251, 251, 251, 252, 252, 253, 254, 256, + 255, 258, 257, 259, 259, 260, 260, 261, 261, 262, + 262, 263, 263, 264, 264, 265, 265, 266, 266, 267, + 267, 268, 268, 269, 269, 269, 270, 270, 271, 271, + 272, 273, 272, 274, 275, 275, 276, 276, 276, 276, + 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, + 276, 276, 277, 277, 277, 278, 279, 278, 280, 281, + 281, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 283, 284, 285, 285, + 286, 286, 287, 288, 289, 290, 291, 292, 293, 293, + 294, 295, 296, 297, 297, 298, 299, 300, 301, 303, + 302, 304, 304, 305, 306, 306, 306, 307, 308, 309, + 309, 310, 310, 311, 311, 312, 312, 313, 313, 314, + 314, 314, 315, 315, 316, 316, 317, 317, 317, 318, + 318, 318, 319, 319, 320, 321, 321, 321, 322, 323, + 323, 323, 323, 324, 324, 324, 325, 325, 326, 326, + 326, 327, 328, 328, 328, 329, 329, 330, 330, 330, + 331, 331, 331, 331, 332, 332, 332, 333, 333, 333, + 333, 334, 334, 335, 335, 335, 335, 335, 335, 335, + 335, 335, 335, 335, 336, 336, 337, 338, 338, 339, + 339, 340, 340, 341, 341, 342, 342, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 344, 344, 345, 346, + 346, 346, 347, 347, 347, 347, 348, 348, 349, 349, + 350, 350, 351, 351, 352, 352, 353 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 1, 1, 2, 3, 3, 5, 1, + 1, 5, 5, 3, 16, 0, 2, 0, 2, 0, + 2, 1, 1, 0, 3, 3, 1, 0, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 3, 5, + 3, 5, 5, 5, 3, 3, 5, 5, 5, 7, + 7, 7, 5, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 0, 0, 8, + 4, 1, 0, 1, 1, 5, 3, 0, 0, 9, + 0, 2, 0, 5, 0, 4, 1, 2, 1, 6, + 0, 3, 0, 6, 0, 4, 0, 4, 1, 0, + 4, 3, 1, 3, 3, 5, 5, 7, 4, 0, + 10, 0, 12, 0, 2, 5, 1, 5, 1, 5, + 1, 5, 1, 9, 5, 1, 1, 1, 1, 1, + 3, 1, 1, 1, 7, 5, 1, 1, 1, 1, + 3, 0, 5, 4, 0, 3, 1, 1, 1, 1, + 2, 1, 1, 1, 1, 1, 3, 3, 3, 1, + 1, 3, 1, 1, 3, 3, 0, 5, 2, 0, + 3, 1, 3, 1, 3, 3, 1, 1, 3, 1, + 1, 1, 3, 1, 1, 1, 5, 7, 5, 8, + 1, 3, 5, 5, 7, 7, 6, 5, 0, 2, + 3, 3, 3, 1, 5, 9, 5, 3, 3, 0, + 10, 0, 1, 7, 5, 5, 3, 5, 7, 9, + 1, 1, 1, 1, 1, 0, 2, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 1, 4, 1, 1, 4, 1, 1, + 4, 1, 4, 5, 1, 3, 1, 3, 1, 1, + 4, 9, 1, 1, 4, 1, 5, 1, 1, 4, + 1, 1, 5, 1, 1, 1, 4, 1, 1, 5, + 1, 1, 3, 1, 1, 3, 1, 4, 3, 3, + 3, 3, 3, 3, 1, 1, 3, 1, 3, 0, + 1, 1, 1, 1, 3, 0, 1, 1, 2, 2, + 4, 6, 4, 6, 6, 6, 6, 2, 6, 8, + 8, 10, 14, 2, 1, 3, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 10, 9 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 2, 0, 0, 0, 3, 4, 23, 0, 0, 1, + 5, 0, 27, 0, 7, 0, 134, 0, 0, 0, + 193, 0, 0, 0, 0, 0, 0, 0, 250, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 280, + 0, 0, 0, 0, 0, 0, 162, 0, 0, 0, + 0, 0, 131, 0, 0, 0, 137, 146, 0, 0, + 0, 0, 94, 83, 74, 84, 75, 85, 76, 86, + 77, 87, 78, 88, 79, 89, 80, 90, 81, 91, + 82, 31, 6, 27, 92, 93, 0, 37, 36, 52, + 53, 50, 0, 45, 51, 150, 46, 47, 49, 48, + 30, 62, 35, 65, 64, 39, 55, 57, 58, 72, + 40, 56, 73, 54, 69, 70, 61, 71, 34, 43, + 66, 60, 68, 67, 38, 59, 63, 32, 33, 44, + 41, 42, 0, 26, 24, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, + 0, 95, 96, 0, 0, 0, 0, 343, 0, 346, + 0, 388, 0, 344, 365, 28, 0, 154, 0, 10, + 9, 8, 0, 305, 306, 0, 341, 161, 0, 0, + 0, 13, 314, 0, 196, 197, 0, 0, 311, 0, + 0, 173, 309, 338, 340, 0, 337, 335, 0, 225, + 229, 334, 226, 331, 333, 0, 330, 328, 0, 200, + 0, 327, 282, 281, 0, 292, 293, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 384, 367, 386, 251, 0, 319, 0, 0, + 318, 0, 0, 0, 0, 0, 0, 404, 267, 268, + 284, 283, 0, 132, 0, 0, 0, 0, 0, 308, + 0, 0, 0, 0, 260, 262, 261, 391, 389, 390, + 164, 163, 0, 185, 186, 0, 0, 0, 0, 97, + 0, 0, 0, 276, 127, 0, 0, 0, 0, 136, + 0, 0, 0, 0, 0, 362, 361, 363, 366, 0, + 397, 399, 396, 398, 400, 401, 0, 0, 0, 104, + 105, 100, 98, 0, 0, 0, 0, 27, 151, 25, + 0, 0, 0, 0, 0, 316, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 228, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 368, 369, 0, 0, 0, + 377, 0, 0, 0, 383, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 133, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 158, 157, 0, 0, 152, 0, 0, 0, 359, + 345, 353, 0, 0, 348, 349, 350, 351, 352, 0, + 130, 0, 343, 0, 0, 0, 0, 121, 119, 125, + 123, 0, 0, 0, 155, 0, 0, 342, 12, 263, + 0, 11, 0, 0, 315, 0, 0, 0, 199, 198, + 173, 174, 195, 0, 0, 0, 227, 0, 0, 202, + 204, 246, 184, 0, 248, 0, 0, 189, 0, 0, + 0, 0, 325, 0, 0, 323, 0, 0, 322, 0, + 0, 385, 387, 0, 0, 294, 295, 0, 298, 0, + 296, 0, 297, 252, 0, 0, 253, 0, 176, 0, + 0, 0, 0, 0, 258, 257, 0, 0, 165, 166, + 277, 402, 403, 0, 178, 0, 0, 0, 0, 0, + 266, 0, 0, 148, 0, 0, 138, 275, 274, 0, + 357, 360, 0, 347, 135, 364, 99, 0, 0, 108, + 0, 107, 0, 106, 0, 112, 0, 103, 0, 102, + 0, 101, 29, 307, 0, 0, 317, 310, 0, 312, + 0, 0, 336, 394, 392, 393, 240, 237, 231, 0, + 0, 236, 0, 241, 0, 243, 244, 0, 239, 230, + 245, 395, 233, 0, 329, 203, 0, 0, 370, 0, + 0, 0, 372, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 320, 0, 0, 0, 0, 0, 0, 0, + 0, 168, 0, 0, 0, 256, 0, 0, 0, 0, + 0, 0, 0, 0, 153, 147, 149, 0, 0, 0, + 128, 0, 120, 122, 124, 126, 0, 113, 0, 115, + 0, 117, 0, 0, 313, 194, 339, 0, 0, 0, + 0, 0, 332, 0, 247, 19, 0, 190, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 285, 0, + 303, 302, 273, 0, 0, 254, 0, 180, 0, 0, + 255, 259, 0, 0, 278, 0, 182, 0, 285, 188, + 0, 187, 160, 0, 140, 354, 355, 356, 358, 0, + 0, 111, 0, 110, 0, 109, 0, 0, 234, 235, + 238, 242, 232, 0, 299, 207, 208, 0, 212, 211, + 213, 214, 215, 0, 0, 0, 219, 220, 0, 205, + 209, 300, 206, 0, 249, 371, 373, 0, 378, 0, + 374, 0, 324, 376, 375, 0, 0, 0, 269, 304, + 0, 0, 0, 0, 0, 0, 191, 192, 0, 0, + 0, 169, 0, 0, 0, 0, 0, 140, 129, 114, + 116, 118, 264, 0, 0, 210, 0, 0, 0, 0, + 20, 0, 0, 326, 0, 0, 289, 290, 291, 286, + 287, 271, 0, 0, 175, 0, 285, 279, 167, 177, + 0, 0, 183, 265, 0, 144, 139, 141, 0, 301, + 216, 217, 218, 223, 222, 221, 379, 0, 380, 349, + 0, 0, 272, 270, 0, 0, 0, 171, 0, 170, + 142, 27, 0, 0, 0, 0, 0, 321, 288, 0, + 406, 179, 0, 181, 27, 145, 0, 224, 381, 16, + 0, 405, 172, 143, 0, 0, 0, 17, 21, 22, + 19, 0, 0, 14, 18, 382 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 3, 4, 5, 6, 191, 81, 836, 862, 734, + 860, 12, 134, 82, 338, 83, 84, 85, 86, 173, + 87, 88, 636, 638, 640, 423, 424, 425, 426, 89, + 409, 699, 90, 91, 389, 92, 93, 174, 627, 766, + 767, 844, 831, 94, 525, 95, 96, 188, 97, 522, + 98, 336, 99, 296, 402, 518, 100, 101, 102, 281, + 272, 103, 801, 104, 842, 352, 500, 516, 679, 688, + 105, 295, 690, 468, 758, 106, 210, 450, 107, 359, + 229, 585, 729, 815, 108, 356, 219, 355, 579, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 615, + 119, 120, 121, 441, 122, 123, 124, 125, 126, 791, + 823, 127, 128, 129, 130, 131, 234, 273, 748, 789, + 790, 237, 487, 491, 730, 672, 492, 196, 278, 253, + 212, 346, 259, 260, 477, 478, 230, 231, 220, 221, + 315, 279, 697, 530, 531, 532, 317, 318, 319, 254, + 376, 183, 291, 582, 333, 334, 335, 513, 266, 267 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -654 +static const yytype_int16 yypact[] = +{ + 137, 7, 27, 83, -654, 137, 24, -15, 37, -654, + -654, 91, 733, -10, -654, 113, -654, 99, 131, 133, + -654, 161, 164, 166, 174, 183, 199, 214, 231, 233, + 239, 241, 243, 245, 247, 250, 268, 269, 275, 276, + 281, 295, 305, 317, 322, 323, 325, 326, 327, 28, + 340, 343, -654, 345, 205, 757, -654, -654, 346, 49, + 66, 265, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, 733, -654, -654, 190, -654, -654, -654, + -654, -654, 353, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, 59, 308, -654, -31, 406, 351, 58, 58, + 144, -11, 57, -18, -18, 672, -57, -18, -18, 248, + -57, -57, -6, -1, -1, -1, 66, 303, 66, -18, + 672, 672, 672, 319, -6, 51, -654, 672, -57, 751, + 66, -654, -654, 279, 339, -18, 355, -654, 29, -654, + 344, -654, 198, -654, 56, -654, 18, -654, 359, -654, + -654, -654, 113, -654, -654, 360, -654, 309, 368, 371, + 372, -654, -654, 374, -654, -654, 375, 503, -654, 378, + 379, 383, -654, -654, -654, 506, -654, -654, 402, -654, + -654, -654, -654, -654, -654, 537, -654, -654, 413, 404, + 418, -654, -654, -654, 420, -654, -654, 427, 439, 446, + -57, -57, -18, -18, 417, -18, 436, 445, 449, 672, + 450, 508, -654, -654, 391, -654, 582, -654, 453, 458, + -654, 459, 460, 466, 599, 473, 474, -654, -654, -654, + -654, -654, 475, 601, 608, 482, 483, 489, 490, 387, + 618, 526, 208, 529, -654, -654, -654, -654, -654, -654, + -654, -654, 530, -654, -654, 534, 359, 538, 539, -654, + 523, 66, 66, 540, -654, 548, 342, 66, 66, -654, + 66, 66, 66, 66, 66, 309, 387, -654, 542, 549, + -654, -654, -654, -654, -654, -654, 554, 60, 32, -654, + -654, 309, 387, 555, 556, 558, 733, 733, -654, -654, + 66, -31, 671, 46, 698, 571, 567, 672, 573, 66, + 215, 700, 566, 581, 66, 587, 359, 589, 66, 359, + -18, -18, 672, 663, 664, -654, -654, 541, 544, 521, + -654, -18, -18, 307, -654, 595, 590, 672, 597, 66, + 67, 186, 659, 730, 604, 669, -1, 8, -654, 606, + 607, -1, -1, -1, 66, 609, 89, -18, 141, 12, + 57, 665, -654, 52, 52, -654, 156, 605, -38, 697, + -654, -654, 331, 347, 168, 168, -654, -654, -654, 56, + -654, 672, 612, -52, -50, 4, 140, -654, -654, 309, + 387, 55, 127, 158, -654, 611, 358, -654, -654, -654, + 743, -654, 628, 374, -654, 626, 761, 430, -654, -654, + 383, -654, -654, 627, 464, 266, -654, 638, 492, -654, + -654, -654, -654, 636, 654, -18, -18, 600, 673, 666, + 675, 676, -654, 679, 438, -654, 667, 681, -654, 685, + 686, -654, -654, 799, 522, -654, -654, 689, -654, 687, + -654, 693, -654, -654, 694, 824, -654, 699, -654, 825, + 701, 67, 827, 702, 703, -654, 704, 779, -654, -654, + -654, -654, -654, 707, -654, 836, 710, 712, 786, 861, + -654, 734, 359, -654, 678, 66, -654, -654, 309, 735, + -654, 739, 732, -654, -654, -654, -654, 867, 740, -654, + -8, -654, 66, -654, -31, -654, 21, -654, 25, -654, + 54, -654, -654, -654, 741, 873, -654, -654, 744, -654, + 737, 745, -654, -654, -654, -654, -654, -654, -654, 748, + 769, -654, 771, -654, 788, -654, -654, 790, -654, -654, + -654, -654, -654, 784, -654, 792, 57, 919, -654, 794, + 868, 672, -654, 66, 66, 672, 796, 66, 672, 672, + 795, 798, -654, -6, 926, 90, 927, -49, 865, 802, + 13, -654, 803, 797, 870, -654, 66, 804, -31, 807, + 15, 254, 359, 52, -654, -654, 387, 805, 224, 697, + -654, -29, -654, -654, 387, 309, 151, -654, 159, -654, + 171, -654, 67, 808, -654, -654, -654, -31, 66, 66, + 66, 144, -654, 594, -654, 809, 66, -654, 810, 258, + 337, 811, 67, 528, 812, 813, 66, 937, 817, 814, + -654, -654, -654, 818, 939, -654, 947, -654, 289, 821, + -654, -654, 822, 85, 309, 950, -654, 951, 817, -654, + 826, -654, -654, 828, 160, -654, -654, -654, -654, 359, + 21, -654, 25, -654, 54, -654, 829, 953, 309, -654, + -654, -654, -654, 149, -654, -654, -654, -31, -654, -654, + -654, -654, -654, 830, 832, 833, -654, -654, 834, -654, + -654, -654, 309, 957, -654, 387, -654, 924, -654, 66, + -654, 835, -654, -654, -654, 409, 837, 419, -654, -654, + 963, 839, 838, 840, 15, 66, -654, -654, 841, 842, + 843, -654, 85, 954, 329, 845, 844, 160, -654, -654, + -654, -654, -654, 847, 914, 309, 66, 66, 66, -44, + -654, 846, 304, -654, 66, 975, -654, -654, -654, -654, + 850, 359, 852, 980, -654, 215, 817, -654, -654, -654, + 981, 359, -654, -654, 854, -654, -654, -654, 982, -654, + -654, -654, -654, -654, 800, -654, -654, 956, -654, 217, + 855, 419, -654, -654, 986, 857, 859, -654, 860, -654, + -654, 733, 864, -44, 862, 869, 863, -654, -654, 866, + -654, -654, 359, -654, 733, -654, 67, -654, -654, -654, + 871, -654, -654, -654, 872, -18, 68, 874, -654, -654, + 809, -18, 875, -654, -654, -654 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -654, -654, 994, -654, -654, -654, -654, -654, -654, 146, + -654, -654, 815, -83, -290, 668, 848, 946, -390, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, 959, -654, -654, -654, 244, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, 614, + 849, -654, -654, -654, -654, 562, -654, -654, -654, 260, + -654, -654, -654, -531, 253, -654, 338, 223, -654, -654, + -654, -654, -654, 187, -654, -654, 880, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, 421, -653, 200, + -654, -385, -492, -654, -654, -654, 369, 682, -168, -136, + -312, 583, 150, -308, -386, -485, -418, -473, 596, -459, + -132, -55, -654, 396, -654, -654, 610, -654, -654, 781, + -135, 576, -392, -654, -654, -654, -654, -654, -124, -654 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -202 +static const yytype_int16 yytable[] = +{ + 185, 211, 300, 197, 509, 182, 401, 238, 239, 611, + 255, 261, 262, 265, 549, 517, 427, 520, 521, 529, + 428, 527, 177, 283, 213, 284, 285, 286, 223, 275, + 276, 277, 297, 177, 16, 761, 177, 305, 320, 303, + 321, 202, 203, 263, 322, 323, 324, 551, 232, 439, + 329, 202, 203, 270, 331, 472, 293, 472, 213, 657, + 177, 213, 189, 813, 422, 641, 456, 498, 305, 459, + 177, 514, 677, 858, 686, 639, 256, 202, 203, 538, + 214, 540, 674, 9, 224, 644, 539, 637, 541, 756, + 691, 202, 203, 287, 11, 814, 325, 288, 289, 257, + 258, 193, 667, 282, 206, 644, 367, 368, 193, 370, + 294, 235, 194, 195, 214, 207, 236, 214, 190, 194, + 195, 132, 485, 306, 13, 207, 486, 859, 233, 316, + 223, 332, 274, 271, 407, 542, 208, 209, 326, 7, + 206, 499, 543, 827, 757, 515, 678, 223, 687, 670, + 706, 327, 1, 2, 215, 328, 671, 193, 225, 8, + 216, 472, 178, 60, 226, 327, 179, 180, 194, 195, + 741, 193, 208, 209, 257, 258, 14, 179, 180, 440, + 179, 180, 194, 195, 133, 519, 224, 519, 215, 178, + 176, 215, 546, 178, 216, 193, 429, 216, 511, 178, + 512, 654, 181, 224, 179, 180, 194, 195, 179, 180, + 475, 476, 445, 181, 179, 180, 181, 217, 218, 771, + 217, 218, 280, 15, 460, 461, 506, 462, 633, 770, + 632, 135, 624, 712, 469, 470, 471, 693, 479, 529, + 181, 769, 482, 523, 181, 488, 406, 489, 490, 764, + 181, 765, 412, 413, 435, 414, 415, 416, 417, 418, + 225, 510, 497, 136, 548, 137, 226, 503, 504, 505, + 563, 544, 306, 430, 564, 565, 528, 225, 545, 448, + 449, 774, 700, 226, 604, 436, 536, 227, 228, 701, + 702, 519, 263, 138, 447, 550, 139, 703, 140, 454, + 268, 269, 704, 458, 227, 228, 141, 202, 203, 705, + 472, 308, 467, 689, 473, 142, 475, 476, 298, 580, + 566, 567, 568, 287, 484, 202, 203, 288, 289, 588, + 589, 143, 692, 287, 309, 569, 330, 288, 289, 397, + 170, 310, 311, 312, 313, 314, 144, 524, 835, 570, + 571, -15, 204, 205, 854, 312, 313, 314, 572, 573, + 574, 575, 576, 145, 316, 146, 202, 203, 695, 696, + 206, 147, 804, 148, 577, 149, 578, 150, 290, 151, + 186, 264, 152, 310, 311, 312, 313, 314, 206, 737, + 365, 366, 738, 310, 311, 312, 313, 314, 184, 207, + 153, 154, 208, 209, 312, 313, 314, 155, 156, 768, + 202, 203, 635, 157, 204, 205, 198, 199, 200, 201, + 208, 209, 240, 241, 242, 243, 244, 158, 245, 206, + 246, 247, 248, 249, 250, 817, 280, 159, 818, 192, + 474, 596, 348, 310, 311, 312, 313, 314, 682, 160, + 181, 786, 787, 788, 161, 162, 658, 163, 164, 165, + 661, 208, 209, 664, 665, 475, 476, 533, 739, 301, + 626, 252, 167, 206, 302, 168, 411, 169, 175, 307, + 709, 710, 711, 534, 207, 187, 684, 634, 304, 310, + 311, 312, 313, 314, 553, 340, 337, 202, 203, 342, + 341, 822, 343, 344, 345, 208, 209, 348, 347, 353, + 350, 829, 348, 349, 351, 708, 310, 311, 312, 313, + 314, 732, 310, 311, 312, 313, 314, 310, 311, 312, + 313, 314, 310, 311, 312, 313, 314, 354, 659, 660, + 357, -201, 663, 310, 311, 312, 313, 314, 358, 360, + 369, 361, 852, 240, 241, 242, 243, 244, 362, 245, + 206, 246, 247, 248, 249, 250, 559, 202, 203, 371, + 363, 251, 310, 311, 312, 313, 314, 364, 372, 467, + 202, 203, 373, 375, 377, 775, 378, 797, 379, 380, + 381, 382, 208, 209, 310, 784, 312, 313, 314, 383, + 562, 735, 252, 384, 385, 386, 387, 388, 810, 811, + 812, 745, 390, 391, 392, 310, 311, 312, 313, 314, + 393, 394, 395, 240, 241, 242, 243, 244, 584, 245, + 206, 246, 247, 248, 249, 250, 240, 241, 242, 243, + 244, 251, 245, 206, 246, 247, 248, 249, 250, 310, + 311, 312, 313, 314, 251, 713, 714, 396, 602, 405, + 398, 399, 208, 209, 742, 400, 715, 716, 717, 403, + 404, 408, 252, 419, 438, 208, 209, 310, 311, 312, + 313, 314, 410, 420, 782, 252, 421, 431, 432, 718, + 433, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 442, 443, 444, 446, 451, 452, 310, 311, 312, + 313, 314, 453, 310, 311, 312, 313, 314, 455, 857, + 457, 463, 464, 480, 481, 864, 493, 465, 483, 819, + 466, 202, 203, 193, 494, 495, 496, 501, 502, 16, + 507, 526, -159, 537, 194, 195, 554, 17, 845, 552, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 555, + 557, 853, 27, 28, 29, 558, 561, 586, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 583, 39, 40, + 41, 42, 43, 44, 45, 587, 46, 240, 241, 242, + 243, 244, 590, 245, 206, 246, 247, 248, 249, 250, + 592, 47, 597, 601, 591, 251, 593, 594, 48, 49, + 595, 50, 598, 51, 52, 53, 599, 600, 54, 55, + 603, 56, 604, 57, 605, 606, 208, 209, 607, 609, + 608, 612, 610, 613, 614, 616, 252, 617, 618, 62, + 619, 620, 58, 621, 59, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 622, 596, 623, 630, 628, 60, 625, + 629, 631, 642, 256, 61, 62, 643, 645, 644, 646, + 647, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 171, + 64, 648, 66, 649, 68, 63, 70, 65, 72, 67, + 74, 69, 76, 71, 78, 73, 80, 75, 652, 77, + 650, 79, 651, 653, 655, 656, 467, 662, 666, 667, + 669, 673, 675, 676, 674, 683, 680, 681, 685, 707, + 733, 746, 694, 751, 736, 740, 743, 744, 747, 750, + 749, 752, 754, 755, 759, 760, 781, 762, 773, 763, + 780, 803, 776, 772, 777, 778, 779, 792, 785, 783, + 793, 795, 794, 809, 800, 798, 799, 805, 808, 820, + 816, 821, 806, 824, 825, 828, 830, 832, 834, 837, + 839, 840, 833, 841, 843, 846, 848, 850, 849, 10, + 851, 172, 855, 856, 434, 861, 863, 339, 166, 865, + 508, 807, 560, 292, 796, 802, 753, 299, 826, 222, + 847, 838, 731, 437, 668, 698, 556, 547, 0, 535, + 374, 581 +}; + +static const yytype_int16 yycheck[] = +{ + 83, 137, 170, 135, 396, 60, 296, 143, 144, 501, + 145, 147, 148, 149, 432, 400, 328, 403, 404, 409, + 328, 59, 4, 159, 3, 160, 161, 162, 3, 153, + 154, 155, 167, 4, 6, 688, 4, 8, 20, 175, + 22, 59, 60, 44, 26, 27, 28, 433, 59, 3, + 186, 59, 60, 59, 186, 3, 5, 3, 3, 590, + 4, 3, 3, 107, 4, 550, 356, 59, 8, 359, + 4, 59, 59, 5, 59, 548, 133, 59, 60, 131, + 59, 131, 131, 0, 59, 134, 138, 546, 138, 4, + 621, 59, 60, 4, 70, 139, 78, 8, 9, 156, + 157, 139, 131, 158, 122, 134, 242, 243, 139, 245, + 59, 54, 150, 151, 59, 133, 59, 59, 59, 150, + 151, 131, 55, 178, 139, 133, 59, 59, 139, 184, + 3, 186, 133, 139, 302, 131, 154, 155, 120, 132, + 122, 133, 138, 796, 59, 133, 133, 3, 133, 59, + 642, 133, 15, 16, 133, 137, 66, 139, 133, 132, + 139, 3, 133, 135, 139, 133, 148, 149, 150, 151, + 662, 139, 154, 155, 156, 157, 139, 148, 149, 133, + 148, 149, 150, 151, 71, 133, 59, 133, 133, 133, + 141, 133, 137, 133, 139, 139, 328, 139, 57, 133, + 59, 586, 184, 59, 148, 149, 150, 151, 148, 149, + 158, 159, 347, 184, 148, 149, 184, 162, 163, 704, + 162, 163, 133, 132, 360, 361, 394, 362, 540, 702, + 538, 132, 522, 651, 369, 371, 372, 623, 373, 629, + 184, 700, 377, 87, 184, 59, 301, 61, 62, 89, + 184, 91, 307, 308, 337, 310, 311, 312, 313, 314, + 133, 397, 386, 132, 137, 132, 139, 391, 392, 393, + 4, 131, 327, 328, 8, 9, 408, 133, 138, 64, + 65, 132, 131, 139, 135, 340, 421, 160, 161, 138, + 131, 133, 44, 132, 349, 137, 132, 138, 132, 354, + 150, 151, 131, 358, 160, 161, 132, 59, 60, 138, + 3, 113, 58, 59, 7, 132, 158, 159, 168, 455, + 54, 55, 56, 4, 379, 59, 60, 8, 9, 465, + 466, 132, 622, 4, 136, 69, 186, 8, 9, 131, + 135, 185, 186, 187, 188, 189, 132, 191, 131, 83, + 84, 134, 63, 64, 846, 187, 188, 189, 92, 93, + 94, 95, 96, 132, 419, 132, 59, 60, 144, 145, + 122, 132, 764, 132, 108, 132, 110, 132, 59, 132, + 190, 133, 132, 185, 186, 187, 188, 189, 122, 131, + 240, 241, 134, 185, 186, 187, 188, 189, 133, 133, + 132, 132, 154, 155, 187, 188, 189, 132, 132, 699, + 59, 60, 544, 132, 63, 64, 10, 11, 12, 13, + 154, 155, 115, 116, 117, 118, 119, 132, 121, 122, + 123, 124, 125, 126, 127, 131, 133, 132, 134, 131, + 133, 3, 4, 185, 186, 187, 188, 189, 616, 132, + 184, 32, 33, 34, 132, 132, 591, 132, 132, 132, + 595, 154, 155, 598, 599, 158, 159, 136, 131, 190, + 525, 164, 132, 122, 135, 132, 134, 132, 132, 135, + 648, 649, 650, 136, 133, 132, 618, 542, 133, 185, + 186, 187, 188, 189, 136, 135, 137, 59, 60, 131, + 191, 791, 131, 131, 130, 154, 155, 4, 133, 3, + 131, 801, 4, 135, 131, 647, 185, 186, 187, 188, + 189, 653, 185, 186, 187, 188, 189, 185, 186, 187, + 188, 189, 185, 186, 187, 188, 189, 135, 593, 594, + 3, 137, 597, 185, 186, 187, 188, 189, 135, 131, + 133, 131, 842, 115, 116, 117, 118, 119, 131, 121, + 122, 123, 124, 125, 126, 127, 136, 59, 60, 133, + 131, 133, 185, 186, 187, 188, 189, 131, 133, 58, + 59, 60, 133, 133, 193, 717, 4, 755, 135, 131, + 131, 131, 154, 155, 185, 186, 187, 188, 189, 133, + 136, 656, 164, 4, 131, 131, 131, 6, 776, 777, + 778, 666, 4, 131, 131, 185, 186, 187, 188, 189, + 131, 131, 4, 115, 116, 117, 118, 119, 136, 121, + 122, 123, 124, 125, 126, 127, 115, 116, 117, 118, + 119, 133, 121, 122, 123, 124, 125, 126, 127, 185, + 186, 187, 188, 189, 133, 61, 62, 131, 136, 136, + 131, 131, 154, 155, 136, 131, 72, 73, 74, 131, + 131, 131, 164, 131, 3, 154, 155, 185, 186, 187, + 188, 189, 134, 134, 739, 164, 132, 132, 132, 95, + 132, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 3, 131, 136, 131, 5, 140, 185, 186, 187, + 188, 189, 131, 185, 186, 187, 188, 189, 131, 855, + 131, 58, 58, 128, 134, 861, 67, 186, 131, 784, + 186, 59, 60, 139, 4, 131, 67, 131, 131, 6, + 131, 136, 77, 131, 150, 151, 3, 14, 831, 138, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 131, + 134, 844, 29, 30, 31, 4, 139, 131, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 139, 45, 46, + 47, 48, 49, 50, 51, 131, 53, 115, 116, 117, + 118, 119, 192, 121, 122, 123, 124, 125, 126, 127, + 134, 68, 135, 4, 131, 133, 131, 131, 75, 76, + 131, 78, 131, 80, 81, 82, 131, 131, 85, 86, + 131, 88, 135, 90, 131, 131, 154, 155, 4, 4, + 131, 4, 131, 131, 131, 131, 164, 58, 131, 142, + 4, 131, 109, 131, 111, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 77, 3, 131, 134, 132, 135, 191, + 131, 4, 131, 133, 141, 142, 3, 140, 134, 134, + 132, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 142, + 149, 132, 151, 132, 153, 148, 155, 150, 157, 152, + 159, 154, 161, 156, 163, 158, 165, 160, 134, 162, + 132, 164, 132, 131, 5, 131, 58, 131, 133, 131, + 4, 4, 67, 131, 131, 131, 139, 67, 131, 131, + 131, 4, 137, 4, 134, 134, 134, 134, 131, 131, + 136, 4, 131, 131, 4, 4, 32, 131, 5, 131, + 3, 7, 132, 134, 132, 132, 132, 4, 131, 134, + 131, 131, 134, 59, 131, 134, 134, 132, 131, 4, + 134, 131, 138, 131, 4, 4, 132, 5, 32, 134, + 4, 134, 192, 134, 134, 131, 134, 134, 129, 5, + 134, 55, 131, 131, 336, 131, 860, 192, 49, 134, + 396, 767, 450, 164, 754, 762, 678, 169, 795, 139, + 833, 821, 653, 341, 603, 629, 443, 431, -1, 419, + 249, 455 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint16 yystos[] = +{ + 0, 15, 16, 195, 196, 197, 198, 132, 132, 0, + 196, 70, 205, 139, 139, 132, 6, 14, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 29, 30, 31, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, + 46, 47, 48, 49, 50, 51, 53, 68, 75, 76, + 78, 80, 81, 82, 85, 86, 88, 90, 109, 111, + 135, 141, 142, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 200, 207, 209, 210, 211, 212, 214, 215, 223, + 226, 227, 229, 230, 237, 239, 240, 242, 244, 246, + 250, 251, 252, 255, 257, 264, 269, 272, 278, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 294, + 295, 296, 298, 299, 300, 301, 302, 305, 306, 307, + 308, 309, 131, 71, 206, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 229, 132, 132, 132, + 135, 142, 211, 213, 231, 132, 141, 4, 133, 148, + 149, 184, 335, 345, 133, 207, 190, 132, 241, 3, + 59, 199, 131, 139, 150, 151, 321, 334, 10, 11, + 12, 13, 59, 60, 63, 64, 122, 133, 154, 155, + 270, 323, 324, 3, 59, 133, 139, 162, 163, 280, + 332, 333, 280, 3, 59, 133, 139, 160, 161, 274, + 330, 331, 59, 139, 310, 54, 59, 315, 323, 323, + 115, 116, 117, 118, 119, 121, 123, 124, 125, 126, + 127, 133, 164, 323, 343, 344, 133, 156, 157, 326, + 327, 323, 323, 44, 133, 323, 352, 353, 326, 326, + 59, 139, 254, 311, 133, 352, 352, 352, 322, 335, + 133, 253, 335, 323, 344, 344, 344, 4, 8, 9, + 59, 346, 254, 5, 59, 265, 247, 344, 326, 210, + 322, 190, 135, 323, 133, 8, 335, 135, 113, 136, + 185, 186, 187, 188, 189, 334, 335, 340, 341, 342, + 20, 22, 26, 27, 28, 78, 120, 133, 137, 323, + 326, 334, 335, 348, 349, 350, 245, 137, 208, 206, + 135, 191, 131, 131, 131, 130, 325, 133, 4, 135, + 131, 131, 259, 3, 135, 281, 279, 3, 135, 273, + 131, 131, 131, 131, 131, 326, 326, 323, 323, 133, + 323, 133, 133, 133, 343, 133, 344, 193, 4, 135, + 131, 131, 131, 133, 4, 131, 131, 131, 6, 228, + 4, 131, 131, 131, 131, 4, 131, 131, 131, 131, + 131, 208, 248, 131, 131, 136, 335, 322, 131, 224, + 134, 134, 335, 335, 335, 335, 335, 335, 335, 131, + 134, 132, 4, 219, 220, 221, 222, 324, 327, 334, + 335, 132, 132, 132, 209, 207, 335, 321, 3, 3, + 133, 297, 3, 131, 136, 344, 131, 335, 64, 65, + 271, 5, 140, 131, 335, 131, 208, 131, 335, 208, + 323, 323, 344, 58, 58, 186, 186, 58, 267, 344, + 323, 323, 3, 7, 133, 158, 159, 328, 329, 344, + 128, 134, 344, 131, 335, 55, 59, 316, 59, 61, + 62, 317, 320, 67, 4, 131, 67, 352, 59, 133, + 260, 131, 131, 352, 352, 352, 322, 131, 253, 346, + 323, 57, 59, 351, 59, 133, 261, 315, 249, 133, + 328, 328, 243, 87, 191, 238, 136, 59, 334, 212, + 337, 338, 339, 136, 136, 340, 344, 131, 131, 138, + 131, 138, 131, 138, 131, 138, 137, 332, 137, 330, + 137, 328, 138, 136, 3, 131, 325, 134, 4, 136, + 259, 139, 136, 4, 8, 9, 54, 55, 56, 69, + 83, 84, 92, 93, 94, 95, 96, 108, 110, 282, + 323, 345, 347, 139, 136, 275, 131, 131, 323, 323, + 192, 131, 134, 131, 131, 131, 3, 135, 131, 131, + 131, 4, 136, 131, 135, 131, 131, 4, 131, 4, + 131, 316, 4, 131, 131, 293, 131, 58, 131, 4, + 131, 131, 77, 131, 208, 191, 335, 232, 132, 131, + 134, 4, 327, 324, 335, 334, 216, 333, 217, 331, + 218, 329, 131, 3, 134, 140, 134, 132, 132, 132, + 132, 132, 134, 131, 315, 5, 131, 267, 344, 335, + 335, 344, 131, 335, 344, 344, 133, 131, 311, 4, + 59, 66, 319, 4, 131, 67, 131, 59, 133, 262, + 139, 67, 322, 131, 334, 131, 59, 133, 263, 59, + 266, 267, 208, 328, 137, 144, 145, 336, 337, 225, + 131, 138, 131, 138, 131, 138, 316, 131, 334, 322, + 322, 322, 330, 61, 62, 72, 73, 74, 95, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 276, + 318, 320, 334, 131, 203, 335, 134, 131, 134, 131, + 134, 316, 136, 134, 134, 335, 4, 131, 312, 136, + 131, 4, 4, 270, 131, 131, 4, 59, 268, 4, + 4, 312, 131, 131, 89, 91, 233, 234, 208, 333, + 331, 329, 134, 5, 132, 334, 132, 132, 132, 132, + 3, 32, 335, 134, 186, 131, 32, 33, 34, 313, + 314, 303, 4, 131, 134, 131, 263, 322, 134, 134, + 131, 256, 268, 7, 346, 132, 138, 233, 131, 59, + 322, 322, 322, 107, 139, 277, 134, 131, 134, 335, + 4, 131, 208, 304, 131, 4, 271, 312, 4, 208, + 132, 236, 5, 192, 32, 131, 201, 134, 313, 4, + 134, 134, 258, 134, 235, 207, 131, 277, 134, 129, + 134, 134, 208, 207, 316, 131, 131, 323, 5, 59, + 204, 131, 202, 203, 323, 134 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) #endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +#else +static void +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ int yydebug; -int yynerrs; -int yyerrflag; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + +/* Prevent warnings from -Wmissing-prototypes. */ +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + +/* The lookahead symbol. */ int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; + +/* The semantic value of the lookahead symbol. */ YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE -/*lev_comp.y*/ -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int -yyparse() +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif { - register int yym, yyn, yystate; -#if YYDEBUG - register char *yys; - extern char *getenv(); - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; } - if ((yyn = yysindex[yystate]) != 0 && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; } - if ((yyn = yyrindex[yystate]) != 0 && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + + if (yychar <= YYEOF) { - yyn = yytable[yyn]; - goto yyreduce; + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); } - if (yyerrflag) goto yyinrecovery; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) != 0 && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 7: -{ - unsigned i; + goto yyreduce; + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 6: + +/* Line 1455 of yacc.c */ +#line 282 "lev_comp.y" + { if (fatal_error > 0) { (void) fprintf(stderr, - "%s : %d errors detected. No output created!\n", - fname, fatal_error); - } else { - maze.flags = yyvsp[-3].i; - (void) memcpy((genericptr_t)&(maze.init_lev), - (genericptr_t)&(init_lev), - sizeof(lev_init)); - maze.numpart = npart; - maze.parts = NewTab(mazepart, npart); - for(i=0;i 0) { - (void) fprintf(stderr, - "%s : %d errors detected. No output created!\n", - fname, fatal_error); - } else { - special_lev.flags = (long) yyvsp[-5].i; - (void) memcpy( - (genericptr_t)&(special_lev.init_lev), - (genericptr_t)&(init_lev), - sizeof(lev_init)); - special_lev.nroom = nrooms; - special_lev.rooms = NewTab(room, nrooms); - for(i=0; i 8) - yyerror("Level names limited to 8 characters."); - yyval.map = yyvsp[0].map; - special_lev.nrmonst = special_lev.nrobjects = 0; - n_mlist = n_olist = 0; - } -break; -case 10: -{ - /* in case we're processing multiple files, - explicitly clear any stale settings */ - (void) memset((genericptr_t) &init_lev, 0, - sizeof init_lev); - init_lev.init_present = FALSE; - yyval.i = 0; - } -break; -case 11: -{ - init_lev.init_present = TRUE; - init_lev.fg = what_map_char((char) yyvsp[-10].i); - if (init_lev.fg == INVALID_TYPE) - yyerror("Invalid foreground type."); - init_lev.bg = what_map_char((char) yyvsp[-8].i); - if (init_lev.bg == INVALID_TYPE) - yyerror("Invalid background type."); - init_lev.smoothed = yyvsp[-6].i; - init_lev.joined = yyvsp[-4].i; - if (init_lev.joined && - init_lev.fg != CORR && init_lev.fg != ROOM) - yyerror("Invalid foreground type for joined map."); - init_lev.lit = yyvsp[-2].i; - init_lev.walled = yyvsp[0].i; - init_lev.icedpools = FALSE; - yyval.i = 1; - } -break; -case 12: -{ - init_lev.init_present = TRUE; - init_lev.fg = what_map_char((char) yyvsp[-12].i); - if (init_lev.fg == INVALID_TYPE) - yyerror("Invalid foreground type."); - init_lev.bg = what_map_char((char) yyvsp[-10].i); - if (init_lev.bg == INVALID_TYPE) - yyerror("Invalid background type."); - init_lev.smoothed = yyvsp[-8].i; - init_lev.joined = yyvsp[-6].i; - if (init_lev.joined && - init_lev.fg != CORR && init_lev.fg != ROOM) - yyerror("Invalid foreground type for joined map."); - init_lev.lit = yyvsp[-4].i; - init_lev.walled = yyvsp[-2].i; - init_lev.icedpools = yyvsp[0].i; - yyval.i = 1; - } -break; -case 15: -{ - yyval.i = 0; - } -break; -case 16: -{ - yyval.i = lev_flags; - lev_flags = 0; /* clear for next user */ - } -break; -case 17: -{ - lev_flags |= yyvsp[-2].i; - } -break; -case 18: -{ - lev_flags |= yyvsp[0].i; - } -break; -case 21: -{ - int i, j; + case 7: - i = (int) strlen(yyvsp[0].map) + 1; - j = (int) strlen(tmpmessage); - if (i + j > 255) { - yyerror("Message string too long (>256 characters)"); - } else { - if (j) tmpmessage[j++] = '\n'; - (void) strncpy(tmpmessage+j, yyvsp[0].map, i - 1); - tmpmessage[j + i - 1] = 0; - } - Free(yyvsp[0].map); +/* Line 1455 of yacc.c */ +#line 304 "lev_comp.y" + { + start_level_def(&splev, (yyvsp[(3) - (3)].map)); + (yyval.map) = (yyvsp[(3) - (3)].map); } -break; -case 24: -{ - if(special_lev.nrobjects) { - yyerror("Object registers already initialized!"); - } else { - special_lev.nrobjects = n_olist; - special_lev.robjects = (char *) alloc(n_olist); - (void) memcpy((genericptr_t)special_lev.robjects, - (genericptr_t)olist, n_olist); - } + break; + + case 8: + +/* Line 1455 of yacc.c */ +#line 309 "lev_comp.y" + { + start_level_def(&splev, (yyvsp[(3) - (5)].map)); + if ((yyvsp[(5) - (5)].i) == -1) { + add_opvars(splev, "iiiiiiiio", LVLINIT_MAZEGRID,HWALL,0,0, 0,0,0,0, SPO_INITLEVEL); + } else { + long bg = what_map_char((char) (yyvsp[(5) - (5)].i)); + add_opvars(splev, "iiiiiiiio", LVLINIT_SOLIDFILL, bg, 0,0, 0,0,0,0, SPO_INITLEVEL); + } + add_opvars(splev, "io", MAZELEVEL, SPO_LEVEL_FLAGS); + max_x_map = COLNO-1; + max_y_map = ROWNO; + (yyval.map) = (yyvsp[(3) - (5)].map); } -break; -case 25: -{ - if(special_lev.nrmonst) { - yyerror("Monster registers already initialized!"); - } else { - special_lev.nrmonst = n_mlist; - special_lev.rmonst = (char *) alloc(n_mlist); - (void) memcpy((genericptr_t)special_lev.rmonst, - (genericptr_t)mlist, n_mlist); - } + break; + + case 9: + +/* Line 1455 of yacc.c */ +#line 325 "lev_comp.y" + { + (yyval.i) = -1; } -break; -case 26: -{ - tmproom[nrooms] = New(room); - tmproom[nrooms]->name = (char *) 0; - tmproom[nrooms]->parent = (char *) 0; - tmproom[nrooms]->rtype = 0; - tmproom[nrooms]->rlit = 0; - tmproom[nrooms]->xalign = ERR; - tmproom[nrooms]->yalign = ERR; - tmproom[nrooms]->x = 0; - tmproom[nrooms]->y = 0; - tmproom[nrooms]->w = 2; - tmproom[nrooms]->h = 2; - in_room = 1; + break; + + case 10: + +/* Line 1455 of yacc.c */ +#line 329 "lev_comp.y" + { + (yyval.i) = what_map_char((char) (yyvsp[(1) - (1)].i)); } -break; -case 32: -{ - tmpcor[0] = New(corridor); - tmpcor[0]->src.room = -1; - ncorridor = 1; + break; + + case 11: + +/* Line 1455 of yacc.c */ +#line 335 "lev_comp.y" + { + long filling = (yyvsp[(5) - (5)].terr).ter; + if (filling == INVALID_TYPE || filling >= MAX_TYPE) + lc_error("INIT_MAP: Invalid fill char type."); + add_opvars(splev, "iiiiiiiio", LVLINIT_SOLIDFILL,filling,0,(long)(yyvsp[(5) - (5)].terr).lit, 0,0,0,0, SPO_INITLEVEL); + max_x_map = COLNO-1; + max_y_map = ROWNO; } -break; -case 35: -{ - tmpcor[ncorridor] = New(corridor); - tmpcor[ncorridor]->src.room = yyvsp[-2].corpos.room; - tmpcor[ncorridor]->src.wall = yyvsp[-2].corpos.wall; - tmpcor[ncorridor]->src.door = yyvsp[-2].corpos.door; - tmpcor[ncorridor]->dest.room = yyvsp[0].corpos.room; - tmpcor[ncorridor]->dest.wall = yyvsp[0].corpos.wall; - tmpcor[ncorridor]->dest.door = yyvsp[0].corpos.door; - ncorridor++; - if (ncorridor >= MAX_OF_TYPE) { - yyerror("Too many corridors in level!"); - ncorridor--; - } + break; + + case 12: + +/* Line 1455 of yacc.c */ +#line 344 "lev_comp.y" + { + long filling = what_map_char((char) (yyvsp[(5) - (5)].i)); + if (filling == INVALID_TYPE || filling >= MAX_TYPE) + lc_error("INIT_MAP: Invalid fill char type."); + add_opvars(splev, "iiiiiiiio", LVLINIT_MAZEGRID,filling,0,0, 0,0,0,0, SPO_INITLEVEL); + max_x_map = COLNO-1; + max_y_map = ROWNO; } -break; -case 36: -{ - tmpcor[ncorridor] = New(corridor); - tmpcor[ncorridor]->src.room = yyvsp[-2].corpos.room; - tmpcor[ncorridor]->src.wall = yyvsp[-2].corpos.wall; - tmpcor[ncorridor]->src.door = yyvsp[-2].corpos.door; - tmpcor[ncorridor]->dest.room = -1; - tmpcor[ncorridor]->dest.wall = yyvsp[0].i; - ncorridor++; - if (ncorridor >= MAX_OF_TYPE) { - yyerror("Too many corridors in level!"); - ncorridor--; - } + break; + + case 13: + +/* Line 1455 of yacc.c */ +#line 353 "lev_comp.y" + { + add_opvars(splev, "iiiiiiiio", LVLINIT_ROGUE,0,0,0,0,0,0,0, SPO_INITLEVEL); } -break; -case 37: -{ - if ((unsigned) yyvsp[-5].i >= nrooms) - yyerror("Wrong room number!"); - yyval.corpos.room = yyvsp[-5].i; - yyval.corpos.wall = yyvsp[-3].i; - yyval.corpos.door = yyvsp[-1].i; - } -break; -case 38: -{ - store_room(); - } -break; -case 39: -{ - store_room(); - } -break; -case 40: -{ - tmproom[nrooms] = New(room); - tmproom[nrooms]->parent = yyvsp[-1].map; - tmproom[nrooms]->name = (char *) 0; - tmproom[nrooms]->rtype = yyvsp[-9].i; - tmproom[nrooms]->rlit = yyvsp[-7].i; - tmproom[nrooms]->filled = yyvsp[0].i; - tmproom[nrooms]->xalign = ERR; - tmproom[nrooms]->yalign = ERR; - tmproom[nrooms]->x = current_coord.x; - tmproom[nrooms]->y = current_coord.y; - tmproom[nrooms]->w = current_size.width; - tmproom[nrooms]->h = current_size.height; - in_room = 1; - } -break; -case 41: -{ - tmproom[nrooms] = New(room); - tmproom[nrooms]->name = (char *) 0; - tmproom[nrooms]->parent = (char *) 0; - tmproom[nrooms]->rtype = yyvsp[-9].i; - tmproom[nrooms]->rlit = yyvsp[-7].i; - tmproom[nrooms]->filled = yyvsp[0].i; - tmproom[nrooms]->xalign = current_align.x; - tmproom[nrooms]->yalign = current_align.y; - tmproom[nrooms]->x = current_coord.x; - tmproom[nrooms]->y = current_coord.y; - tmproom[nrooms]->w = current_size.width; - tmproom[nrooms]->h = current_size.height; - in_room = 1; - } -break; -case 42: -{ - yyval.i = 1; - } -break; -case 43: -{ - yyval.i = yyvsp[0].i; - } -break; -case 44: -{ - if ( yyvsp[-3].i < 1 || yyvsp[-3].i > 5 || - yyvsp[-1].i < 1 || yyvsp[-1].i > 5 ) { - yyerror("Room position should be between 1 & 5!"); - } else { - current_coord.x = yyvsp[-3].i; - current_coord.y = yyvsp[-1].i; - } - } -break; -case 45: -{ - current_coord.x = current_coord.y = ERR; - } -break; -case 46: -{ - if ( yyvsp[-3].i < 0 || yyvsp[-1].i < 0) { - yyerror("Invalid subroom position !"); - } else { - current_coord.x = yyvsp[-3].i; - current_coord.y = yyvsp[-1].i; - } - } -break; -case 47: -{ - current_coord.x = current_coord.y = ERR; - } -break; -case 48: -{ - current_align.x = yyvsp[-3].i; - current_align.y = yyvsp[-1].i; - } -break; -case 49: -{ - current_align.x = current_align.y = ERR; - } -break; -case 50: -{ - current_size.width = yyvsp[-3].i; - current_size.height = yyvsp[-1].i; - } -break; -case 51: -{ - current_size.height = current_size.width = ERR; - } -break; -case 67: -{ - if (tmproom[nrooms]->name) - yyerror("This room already has a name!"); - else - tmproom[nrooms]->name = yyvsp[0].map; - } -break; -case 68: -{ - if (tmproom[nrooms]->chance) - yyerror("This room already assigned a chance!"); - else if (tmproom[nrooms]->rtype == OROOM) - yyerror("Only typed rooms can have a chance!"); - else if (yyvsp[0].i < 1 || yyvsp[0].i > 99) - yyerror("The chance is supposed to be percentile."); - else - tmproom[nrooms]->chance = yyvsp[0].i; - } -break; -case 69: -{ - /* ERR means random here */ - if (yyvsp[-2].i == ERR && yyvsp[0].i != ERR) { - yyerror("If the door wall is random, so must be its pos!"); - } else { - tmprdoor[ndoor] = New(room_door); - tmprdoor[ndoor]->secret = yyvsp[-6].i; - tmprdoor[ndoor]->mask = yyvsp[-4].i; - tmprdoor[ndoor]->wall = yyvsp[-2].i; - tmprdoor[ndoor]->pos = yyvsp[0].i; - ndoor++; - if (ndoor >= MAX_OF_TYPE) { - yyerror("Too many doors in room!"); - ndoor--; - } - } - } -break; -case 76: -{ - maze.filling = (schar) yyvsp[0].i; - if (index(yyvsp[-2].map, '.')) - yyerror("Invalid dot ('.') in level name."); - if ((int) strlen(yyvsp[-2].map) > 8) - yyerror("Level names limited to 8 characters."); - yyval.map = yyvsp[-2].map; - in_room = 0; - n_plist = n_mlist = n_olist = 0; - } -break; -case 77: -{ - yyval.i = get_floor_type((char)yyvsp[0].i); - } -break; -case 78: -{ - yyval.i = -1; - } -break; -case 81: -{ - store_part(); - } -break; -case 82: -{ - tmppart[npart] = New(mazepart); - tmppart[npart]->halign = 1; - tmppart[npart]->valign = 1; - tmppart[npart]->nrobjects = 0; - tmppart[npart]->nloc = 0; - tmppart[npart]->nrmonst = 0; - tmppart[npart]->xsize = 1; - tmppart[npart]->ysize = 1; - tmppart[npart]->map = (char **) alloc(sizeof(char *)); - tmppart[npart]->map[0] = (char *) alloc(1); - tmppart[npart]->map[0][0] = STONE; + break; + + case 14: + +/* Line 1455 of yacc.c */ +#line 357 "lev_comp.y" + { + long fg = what_map_char((char) (yyvsp[(5) - (16)].i)); + long bg = what_map_char((char) (yyvsp[(7) - (16)].i)); + long smoothed = (yyvsp[(9) - (16)].i); + long joined = (yyvsp[(11) - (16)].i); + long lit = (yyvsp[(13) - (16)].i); + long walled = (yyvsp[(15) - (16)].i); + long filling = (yyvsp[(16) - (16)].i); + if (fg == INVALID_TYPE || fg >= MAX_TYPE) + lc_error("INIT_MAP: Invalid foreground type."); + if (bg == INVALID_TYPE || bg >= MAX_TYPE) + lc_error("INIT_MAP: Invalid background type."); + if (joined && fg != CORR && fg != ROOM) + lc_error("INIT_MAP: Invalid foreground type for joined map."); + + if (filling == INVALID_TYPE) + lc_error("INIT_MAP: Invalid fill char type."); + + add_opvars(splev, "iiiiiiiio", LVLINIT_MINES,filling,walled,lit, joined,smoothed,bg,fg, SPO_INITLEVEL); max_x_map = COLNO-1; max_y_map = ROWNO; } -break; -case 83: -{ - tmppart[npart] = New(mazepart); - tmppart[npart]->halign = yyvsp[-1].i % 10; - tmppart[npart]->valign = yyvsp[-1].i / 10; - tmppart[npart]->nrobjects = 0; - tmppart[npart]->nloc = 0; - tmppart[npart]->nrmonst = 0; - scan_map(yyvsp[0].map); - Free(yyvsp[0].map); - } -break; -case 84: -{ - yyval.i = yyvsp[-2].i + (yyvsp[0].i * 10); - } -break; -case 91: -{ - if (tmppart[npart]->nrobjects) { - yyerror("Object registers already initialized!"); - } else { - tmppart[npart]->robjects = (char *)alloc(n_olist); - (void) memcpy((genericptr_t)tmppart[npart]->robjects, - (genericptr_t)olist, n_olist); - tmppart[npart]->nrobjects = n_olist; - } - } -break; -case 92: -{ - if (tmppart[npart]->nloc) { - yyerror("Location registers already initialized!"); - } else { - register int i; - tmppart[npart]->rloc_x = (char *) alloc(n_plist); - tmppart[npart]->rloc_y = (char *) alloc(n_plist); - for(i=0;irloc_x[i] = plist[i].x; - tmppart[npart]->rloc_y[i] = plist[i].y; - } - tmppart[npart]->nloc = n_plist; - } - } -break; -case 93: -{ - if (tmppart[npart]->nrmonst) { - yyerror("Monster registers already initialized!"); - } else { - tmppart[npart]->rmonst = (char *) alloc(n_mlist); - (void) memcpy((genericptr_t)tmppart[npart]->rmonst, - (genericptr_t)mlist, n_mlist); - tmppart[npart]->nrmonst = n_mlist; - } - } -break; -case 94: -{ - if (n_olist < MAX_REGISTERS) - olist[n_olist++] = yyvsp[0].i; - else - yyerror("Object list too long!"); - } -break; -case 95: -{ - if (n_olist < MAX_REGISTERS) - olist[n_olist++] = yyvsp[-2].i; - else - yyerror("Object list too long!"); - } -break; -case 96: -{ - if (n_mlist < MAX_REGISTERS) - mlist[n_mlist++] = yyvsp[0].i; - else - yyerror("Monster list too long!"); - } -break; -case 97: -{ - if (n_mlist < MAX_REGISTERS) - mlist[n_mlist++] = yyvsp[-2].i; - else - yyerror("Monster list too long!"); - } -break; -case 98: -{ - if (n_plist < MAX_REGISTERS) - plist[n_plist++] = current_coord; - else - yyerror("Location list too long!"); - } -break; -case 99: -{ - if (n_plist < MAX_REGISTERS) - plist[n_plist++] = current_coord; - else - yyerror("Location list too long!"); - } -break; -case 123: -{ - tmpmonst[nmons] = New(monster); - tmpmonst[nmons]->x = current_coord.x; - tmpmonst[nmons]->y = current_coord.y; - tmpmonst[nmons]->class = yyvsp[-4].i; - tmpmonst[nmons]->peaceful = -1; /* no override */ - tmpmonst[nmons]->asleep = -1; - tmpmonst[nmons]->align = - MAX_REGISTERS - 2; - tmpmonst[nmons]->name.str = 0; - tmpmonst[nmons]->appear = 0; - tmpmonst[nmons]->appear_as.str = 0; - tmpmonst[nmons]->chance = yyvsp[-6].i; - tmpmonst[nmons]->id = NON_PM; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Monster"); - if (yyvsp[-2].map) { - int token = get_monster_id(yyvsp[-2].map, (char) yyvsp[-4].i); - if (token == ERR) - yywarning( - "Invalid monster name! Making random monster."); - else - tmpmonst[nmons]->id = token; - Free(yyvsp[-2].map); - } - } -break; -case 124: -{ - if (++nmons >= MAX_OF_TYPE) { - yyerror("Too many monsters in room or mazepart!"); - nmons--; - } - } -break; -case 127: -{ - tmpmonst[nmons]->name.str = yyvsp[0].map; - } -break; -case 128: -{ - tmpmonst[nmons]->peaceful = yyvsp[0].i; - } -break; -case 129: -{ - tmpmonst[nmons]->asleep = yyvsp[0].i; - } -break; -case 130: -{ - tmpmonst[nmons]->align = yyvsp[0].i; - } -break; -case 131: -{ - tmpmonst[nmons]->appear = yyvsp[-1].i; - tmpmonst[nmons]->appear_as.str = yyvsp[0].map; - } -break; -case 132: -{ - } -break; -case 133: -{ - /* 1: is contents of preceeding object with 2 */ - /* 2: is a container */ - /* 0: neither */ - tmpobj[nobj-1]->containment = 2; - } -break; -case 134: -{ - tmpobj[nobj] = New(object); - tmpobj[nobj]->class = yyvsp[-2].i; - tmpobj[nobj]->corpsenm = NON_PM; - tmpobj[nobj]->curse_state = -1; - tmpobj[nobj]->name.str = 0; - tmpobj[nobj]->chance = yyvsp[-4].i; - tmpobj[nobj]->id = -1; - if (yyvsp[0].map) { - int token = get_object_id(yyvsp[0].map, yyvsp[-2].i); - if (token == ERR) - yywarning( - "Illegal object name! Making random object."); - else - tmpobj[nobj]->id = token; - Free(yyvsp[0].map); - } - } -break; -case 135: -{ - if (++nobj >= MAX_OF_TYPE) { - yyerror("Too many objects in room or mazepart!"); - nobj--; - } - } -break; -case 136: -{ - tmpobj[nobj]->containment = 0; - tmpobj[nobj]->x = current_coord.x; - tmpobj[nobj]->y = current_coord.y; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Object"); - } -break; -case 137: -{ - tmpobj[nobj]->containment = 1; - /* random coordinate, will be overridden anyway */ - tmpobj[nobj]->x = -MAX_REGISTERS-1; - tmpobj[nobj]->y = -MAX_REGISTERS-1; - } -break; -case 138: -{ - tmpobj[nobj]->spe = -127; - /* Note below: we're trying to make as many of these optional as - * possible. We clearly can't make curse_state, enchantment, and - * monster_id _all_ optional, since ",random" would be ambiguous. - * We can't even just make enchantment mandatory, since if we do that - * alone, ",random" requires too much lookahead to parse. - */ - } -break; -case 139: -{ - } -break; -case 140: -{ - } -break; -case 141: -{ - } -break; -case 142: -{ - tmpobj[nobj]->curse_state = -1; - } -break; -case 143: -{ - tmpobj[nobj]->curse_state = yyvsp[0].i; - } -break; -case 144: -{ - int token = get_monster_id(yyvsp[0].map, (char)0); - if (token == ERR) /* "random" */ - tmpobj[nobj]->corpsenm = NON_PM - 1; - else - tmpobj[nobj]->corpsenm = token; - Free(yyvsp[0].map); - } -break; -case 145: -{ - tmpobj[nobj]->spe = -127; - } -break; -case 146: -{ - tmpobj[nobj]->spe = yyvsp[0].i; - } -break; -case 148: -{ - } -break; -case 149: -{ - tmpobj[nobj]->name.str = yyvsp[0].map; - } -break; -case 150: -{ - tmpdoor[ndoor] = New(door); - tmpdoor[ndoor]->x = current_coord.x; - tmpdoor[ndoor]->y = current_coord.y; - tmpdoor[ndoor]->mask = yyvsp[-2].i; - if(current_coord.x >= 0 && current_coord.y >= 0 && - tmpmap[current_coord.y][current_coord.x] != DOOR && - tmpmap[current_coord.y][current_coord.x] != SDOOR) - yyerror("Door decl doesn't match the map"); - ndoor++; - if (ndoor >= MAX_OF_TYPE) { - yyerror("Too many doors in mazepart!"); - ndoor--; - } - } -break; -case 151: -{ - tmptrap[ntrap] = New(trap); - tmptrap[ntrap]->x = current_coord.x; - tmptrap[ntrap]->y = current_coord.y; - tmptrap[ntrap]->type = yyvsp[-2].i; - tmptrap[ntrap]->chance = yyvsp[-4].i; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Trap"); - if (++ntrap >= MAX_OF_TYPE) { - yyerror("Too many traps in room or mazepart!"); - ntrap--; - } - } -break; -case 152: -{ - int x, y, dir; + break; - tmpdb[ndb] = New(drawbridge); - x = tmpdb[ndb]->x = current_coord.x; - y = tmpdb[ndb]->y = current_coord.y; - /* convert dir from a DIRECTION to a DB_DIR */ - dir = yyvsp[-2].i; - switch(dir) { - case W_NORTH: dir = DB_NORTH; y--; break; - case W_SOUTH: dir = DB_SOUTH; y++; break; - case W_EAST: dir = DB_EAST; x++; break; - case W_WEST: dir = DB_WEST; x--; break; - default: - yyerror("Invalid drawbridge direction"); - break; - } - tmpdb[ndb]->dir = dir; - if (current_coord.x >= 0 && current_coord.y >= 0 && - !IS_WALL(tmpmap[y][x])) { - char ebuf[60]; - Sprintf(ebuf, - "Wall needed for drawbridge (%02d, %02d)", - current_coord.x, current_coord.y); - yyerror(ebuf); - } + case 15: - if ( yyvsp[0].i == D_ISOPEN ) - tmpdb[ndb]->db_open = 1; - else if ( yyvsp[0].i == D_CLOSED ) - tmpdb[ndb]->db_open = 0; - else if (yyvsp[0].i == -1) /* RANDOM_TYPE */ - tmpdb[ndb]->db_open = 127; /* random */ - else - yyerror("A drawbridge can only be open, closed, or random!"); - ndb++; - if (ndb >= MAX_OF_TYPE) { - yyerror("Too many drawbridges in mazepart!"); - ndb--; +/* Line 1455 of yacc.c */ +#line 382 "lev_comp.y" + { + (yyval.i) = 0; + } + break; + + case 16: + +/* Line 1455 of yacc.c */ +#line 386 "lev_comp.y" + { + (yyval.i) = (yyvsp[(2) - (2)].i); + } + break; + + case 17: + +/* Line 1455 of yacc.c */ +#line 392 "lev_comp.y" + { + add_opvars(splev, "o", SPO_COPY); + (yyval.i) = 0; + } + break; + + case 18: + +/* Line 1455 of yacc.c */ +#line 397 "lev_comp.y" + { + (yyval.i) = 1; + } + break; + + case 19: + +/* Line 1455 of yacc.c */ +#line 403 "lev_comp.y" + { + (yyval.i) = -1; + } + break; + + case 20: + +/* Line 1455 of yacc.c */ +#line 407 "lev_comp.y" + { + (yyval.i) = what_map_char((char) (yyvsp[(2) - (2)].i)); + } + break; + + case 23: + +/* Line 1455 of yacc.c */ +#line 418 "lev_comp.y" + { + add_opvars(splev, "io", 0, SPO_LEVEL_FLAGS); + } + break; + + case 24: + +/* Line 1455 of yacc.c */ +#line 422 "lev_comp.y" + { + add_opvars(splev, "io", (yyvsp[(3) - (3)].i), SPO_LEVEL_FLAGS); + } + break; + + case 25: + +/* Line 1455 of yacc.c */ +#line 428 "lev_comp.y" + { + (yyval.i) = ((yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i)); + } + break; + + case 26: + +/* Line 1455 of yacc.c */ +#line 432 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (1)].i); + } + break; + + case 27: + +/* Line 1455 of yacc.c */ +#line 438 "lev_comp.y" + { + (yyval.i) = 0; + } + break; + + case 28: + +/* Line 1455 of yacc.c */ +#line 442 "lev_comp.y" + { + (yyval.i) = 1 + (yyvsp[(2) - (2)].i); + } + break; + + case 29: + +/* Line 1455 of yacc.c */ +#line 448 "lev_comp.y" + { + (yyval.i) = (yyvsp[(2) - (3)].i); + } + break; + + case 97: + +/* Line 1455 of yacc.c */ +#line 531 "lev_comp.y" + { + struct lc_vardefs *vd; + if ((vd = vardef_defined(variable_definitions, (yyvsp[(3) - (3)].map), 1))) { + if (!(vd->var_type & SPOVAR_ARRAY)) + lc_error("Trying to shuffle non-array variable '%s'", (yyvsp[(3) - (3)].map)); + } else lc_error("Trying to shuffle undefined variable '%s'", (yyvsp[(3) - (3)].map)); + add_opvars(splev, "so", (yyvsp[(3) - (3)].map), SPO_SHUFFLE_ARRAY); + Free((yyvsp[(3) - (3)].map)); + } + break; + + case 98: + +/* Line 1455 of yacc.c */ +#line 543 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_INT); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (3)].map)); + } + break; + + case 99: + +/* Line 1455 of yacc.c */ +#line 549 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_SEL); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 100: + +/* Line 1455 of yacc.c */ +#line 555 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_STRING); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (3)].map)); + } + break; + + case 101: + +/* Line 1455 of yacc.c */ +#line 561 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_MAPCHAR); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 102: + +/* Line 1455 of yacc.c */ +#line 567 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_MONST); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 103: + +/* Line 1455 of yacc.c */ +#line 573 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_OBJ); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 104: + +/* Line 1455 of yacc.c */ +#line 579 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_COORD); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (3)].map)); + } + break; + + case 105: + +/* Line 1455 of yacc.c */ +#line 585 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_REGION); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (3)].map)); + } + break; + + case 106: + +/* Line 1455 of yacc.c */ +#line 591 "lev_comp.y" + { + long n_items = (yyvsp[(4) - (5)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_INT|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 107: + +/* Line 1455 of yacc.c */ +#line 598 "lev_comp.y" + { + long n_items = (yyvsp[(4) - (5)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_COORD|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 108: + +/* Line 1455 of yacc.c */ +#line 605 "lev_comp.y" + { + long n_items = (yyvsp[(4) - (5)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_REGION|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 109: + +/* Line 1455 of yacc.c */ +#line 612 "lev_comp.y" + { + long n_items = (yyvsp[(6) - (7)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (7)].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (7)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (7)].map)); + } + break; + + case 110: + +/* Line 1455 of yacc.c */ +#line 619 "lev_comp.y" + { + long n_items = (yyvsp[(6) - (7)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (7)].map), SPOVAR_MONST|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (7)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (7)].map)); + } + break; + + case 111: + +/* Line 1455 of yacc.c */ +#line 626 "lev_comp.y" + { + long n_items = (yyvsp[(6) - (7)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (7)].map), SPOVAR_OBJ|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (7)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (7)].map)); + } + break; + + case 112: + +/* Line 1455 of yacc.c */ +#line 633 "lev_comp.y" + { + long n_items = (yyvsp[(4) - (5)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_STRING|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 113: + +/* Line 1455 of yacc.c */ +#line 642 "lev_comp.y" + { + add_opvars(splev, "O", (yyvsp[(1) - (1)].i)); + (yyval.i) = 1; + } + break; + + case 114: + +/* Line 1455 of yacc.c */ +#line 647 "lev_comp.y" + { + add_opvars(splev, "O", (yyvsp[(3) - (3)].i)); + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 115: + +/* Line 1455 of yacc.c */ +#line 654 "lev_comp.y" + { + add_opvars(splev, "M", (yyvsp[(1) - (1)].i)); + (yyval.i) = 1; + } + break; + + case 116: + +/* Line 1455 of yacc.c */ +#line 659 "lev_comp.y" + { + add_opvars(splev, "M", (yyvsp[(3) - (3)].i)); + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 117: + +/* Line 1455 of yacc.c */ +#line 666 "lev_comp.y" + { + add_opvars(splev, "m", (yyvsp[(1) - (1)].i)); + (yyval.i) = 1; + } + break; + + case 118: + +/* Line 1455 of yacc.c */ +#line 671 "lev_comp.y" + { + add_opvars(splev, "m", (yyvsp[(3) - (3)].i)); + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 119: + +/* Line 1455 of yacc.c */ +#line 678 "lev_comp.y" + { + (yyval.i) = 1; + } + break; + + case 120: + +/* Line 1455 of yacc.c */ +#line 682 "lev_comp.y" + { + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 121: + +/* Line 1455 of yacc.c */ +#line 688 "lev_comp.y" + { + add_opvars(splev, "c", (yyvsp[(1) - (1)].i)); + (yyval.i) = 1; + } + break; + + case 122: + +/* Line 1455 of yacc.c */ +#line 693 "lev_comp.y" + { + add_opvars(splev, "c", (yyvsp[(3) - (3)].i)); + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 123: + +/* Line 1455 of yacc.c */ +#line 700 "lev_comp.y" + { + (yyval.i) = 1; + } + break; + + case 124: + +/* Line 1455 of yacc.c */ +#line 704 "lev_comp.y" + { + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 125: + +/* Line 1455 of yacc.c */ +#line 710 "lev_comp.y" + { + (yyval.i) = 1; + } + break; + + case 126: + +/* Line 1455 of yacc.c */ +#line 714 "lev_comp.y" + { + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 127: + +/* Line 1455 of yacc.c */ +#line 720 "lev_comp.y" + { + struct lc_funcdefs *funcdef; + + if (in_function_definition) + lc_error("Recursively defined functions not allowed (function %s).", (yyvsp[(2) - (3)].map)); + + in_function_definition++; + + if (funcdef_defined(function_definitions, (yyvsp[(2) - (3)].map), 1)) + lc_error("Function '%s' already defined once.", (yyvsp[(2) - (3)].map)); + + funcdef = funcdef_new(-1, (yyvsp[(2) - (3)].map)); + funcdef->next = function_definitions; + function_definitions = funcdef; + function_splev_backup = splev; + splev = &(funcdef->code); + Free((yyvsp[(2) - (3)].map)); + curr_function = funcdef; + function_tmp_var_defs = variable_definitions; + variable_definitions = NULL; + } + break; + + case 128: + +/* Line 1455 of yacc.c */ +#line 742 "lev_comp.y" + { + /* nothing */ + } + break; + + case 129: + +/* Line 1455 of yacc.c */ +#line 746 "lev_comp.y" + { + add_opvars(splev, "io", 0, SPO_RETURN); + splev = function_splev_backup; + in_function_definition--; + curr_function = NULL; + vardef_free_all(variable_definitions); + variable_definitions = function_tmp_var_defs; + } + break; + + case 130: + +/* Line 1455 of yacc.c */ +#line 757 "lev_comp.y" + { + struct lc_funcdefs *tmpfunc; + tmpfunc = funcdef_defined(function_definitions, (yyvsp[(1) - (4)].map), 1); + if (tmpfunc) { + long l; + long nparams = strlen( (yyvsp[(3) - (4)].map) ); + char *fparamstr = funcdef_paramtypes(tmpfunc); + if (strcmp((yyvsp[(3) - (4)].map), fparamstr)) { + char *tmps = strdup(decode_parm_str(fparamstr)); + lc_error("Function '%s' requires params '%s', got '%s' instead.", (yyvsp[(1) - (4)].map), tmps, decode_parm_str((yyvsp[(3) - (4)].map))); + Free(tmps); + } + Free(fparamstr); + Free((yyvsp[(3) - (4)].map)); + if (!(tmpfunc->n_called)) { + /* we haven't called the function yet, so insert it in the code */ + struct opvar *jmp = New(struct opvar); + set_opvar_int(jmp, splev->n_opcodes+1); + add_opcode(splev, SPO_PUSH, jmp); + add_opcode(splev, SPO_JMP, NULL); /* we must jump past it first, then CALL it, due to RETURN. */ + + tmpfunc->addr = splev->n_opcodes; + + { /* init function parameter variables */ + struct lc_funcdefs_parm *tfp = tmpfunc->params; + while (tfp) { + add_opvars(splev, "iso", 0, tfp->name, SPO_VAR_INIT); + tfp = tfp->next; + } + } + + splev_add_from(splev, &(tmpfunc->code)); + set_opvar_int(jmp, splev->n_opcodes - jmp->vardata.l); + } + l = tmpfunc->addr - splev->n_opcodes - 2; + add_opvars(splev, "iio", nparams, l, SPO_CALL); + tmpfunc->n_called++; + } else { + lc_error("Function '%s' not defined.", (yyvsp[(1) - (4)].map)); + } + Free((yyvsp[(1) - (4)].map)); + } + break; + + case 131: + +/* Line 1455 of yacc.c */ +#line 802 "lev_comp.y" + { + add_opcode(splev, SPO_EXIT, NULL); + } + break; + + case 132: + +/* Line 1455 of yacc.c */ +#line 808 "lev_comp.y" + { + (yyval.i) = 100; + } + break; + + case 133: + +/* Line 1455 of yacc.c */ +#line 812 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (1)].i); + } + break; + + case 134: + +/* Line 1455 of yacc.c */ +#line 818 "lev_comp.y" + { + /* val > rn2(100) */ + add_opvars(splev, "iio", (long)(yyvsp[(1) - (1)].i), 100, SPO_RN2); + (yyval.i) = SPO_JG; + } + break; + + case 135: + +/* Line 1455 of yacc.c */ +#line 824 "lev_comp.y" + { + (yyval.i) = (yyvsp[(3) - (5)].i); + } + break; + + case 136: + +/* Line 1455 of yacc.c */ +#line 828 "lev_comp.y" + { + /* boolean, explicit foo != 0 */ + add_opvars(splev, "i", 0); + (yyval.i) = SPO_JNE; + } + break; + + case 137: + +/* Line 1455 of yacc.c */ +#line 836 "lev_comp.y" + { + is_inconstant_number = 0; + } + break; + + case 138: + +/* Line 1455 of yacc.c */ +#line 840 "lev_comp.y" + { + struct opvar *chkjmp; + if (in_switch_statement > 0) + lc_error("Cannot nest switch-statements."); + + in_switch_statement++; + + n_switch_case_list = 0; + switch_default_case = NULL; + + if (!is_inconstant_number) + add_opvars(splev, "o", SPO_RN2); + is_inconstant_number = 0; + + chkjmp = New(struct opvar); + set_opvar_int(chkjmp, splev->n_opcodes+1); + switch_check_jump = chkjmp; + add_opcode(splev, SPO_PUSH, chkjmp); + add_opcode(splev, SPO_JMP, NULL); + break_stmt_start(); + } + break; + + case 139: + +/* Line 1455 of yacc.c */ +#line 862 "lev_comp.y" + { + struct opvar *endjump = New(struct opvar); + int i; + + set_opvar_int(endjump, splev->n_opcodes+1); + + add_opcode(splev, SPO_PUSH, endjump); + add_opcode(splev, SPO_JMP, NULL); + + set_opvar_int(switch_check_jump, splev->n_opcodes - switch_check_jump->vardata.l); + + for (i = 0; i < n_switch_case_list; i++) { + add_opvars(splev, "oio", SPO_COPY, switch_case_value[i], SPO_CMP); + set_opvar_int(switch_case_list[i], switch_case_list[i]->vardata.l - splev->n_opcodes-1); + add_opcode(splev, SPO_PUSH, switch_case_list[i]); + add_opcode(splev, SPO_JE, NULL); + } + + if (switch_default_case) { + set_opvar_int(switch_default_case, switch_default_case->vardata.l - splev->n_opcodes-1); + add_opcode(splev, SPO_PUSH, switch_default_case); + add_opcode(splev, SPO_JMP, NULL); + } + + set_opvar_int(endjump, splev->n_opcodes - endjump->vardata.l); + + break_stmt_end(splev); + + add_opcode(splev, SPO_POP, NULL); /* get rid of the value in stack */ + in_switch_statement--; + + + } + break; + + case 142: + +/* Line 1455 of yacc.c */ +#line 902 "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[(2) - (3)].i); + switch_case_list[n_switch_case_list++] = tmppush; + } else lc_error("Too many cases in a switch."); + } + break; + + case 143: + +/* Line 1455 of yacc.c */ +#line 911 "lev_comp.y" + { + } + break; + + case 144: + +/* Line 1455 of yacc.c */ +#line 914 "lev_comp.y" + { + struct opvar *tmppush = New(struct opvar); + + if (switch_default_case) + lc_error("Switch default case already used."); + + set_opvar_int(tmppush, splev->n_opcodes); + switch_default_case = tmppush; + } + break; + + case 145: + +/* Line 1455 of yacc.c */ +#line 924 "lev_comp.y" + { + } + break; + + case 146: + +/* Line 1455 of yacc.c */ +#line 929 "lev_comp.y" + { + if (!allow_break_statements) + lc_error("Cannot use BREAK outside a statement block."); + else { + break_stmt_new(splev, splev->n_opcodes); + } + } + break; + + case 149: + +/* Line 1455 of yacc.c */ +#line 943 "lev_comp.y" + { + char buf[256], buf2[256]; + + if (n_forloops >= MAX_NESTED_IFS) { + lc_error("FOR: Too deeply nested loops."); + n_forloops = MAX_NESTED_IFS - 1; + } + + /* first, define a variable for the for-loop end value */ + snprintf(buf, 255, "%s end", (yyvsp[(2) - (6)].map)); + /* the value of which is already in stack (the 2nd math_expr) */ + add_opvars(splev, "iso", 0, buf, SPO_VAR_INIT); + + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(2) - (6)].map), SPOVAR_INT); + /* define the for-loop variable. value is in stack (1st math_expr) */ + add_opvars(splev, "iso", 0, (yyvsp[(2) - (6)].map), SPO_VAR_INIT); + + /* calculate value for the loop "step" variable */ + snprintf(buf2, 255, "%s step", (yyvsp[(2) - (6)].map)); + add_opvars(splev, "vvo", buf, (yyvsp[(2) - (6)].map), SPO_MATH_SUB); /* end - start */ + add_opvars(splev, "o", SPO_MATH_SIGN); /* sign of that */ + add_opvars(splev, "iso", 0, buf2, SPO_VAR_INIT); /* save the sign into the step var */ + + forloop_list[n_forloops].varname = strdup((yyvsp[(2) - (6)].map)); + forloop_list[n_forloops].jmp_point = splev->n_opcodes; + + n_forloops++; + Free((yyvsp[(2) - (6)].map)); + } + break; + + case 150: + +/* Line 1455 of yacc.c */ +#line 975 "lev_comp.y" + { + /* nothing */ + break_stmt_start(); + } + break; + + case 151: + +/* Line 1455 of yacc.c */ +#line 980 "lev_comp.y" + { + char buf[256], buf2[256]; + n_forloops--; + snprintf(buf, 255, "%s step", forloop_list[n_forloops].varname); + snprintf(buf2, 255, "%s end", forloop_list[n_forloops].varname); + /* compare for-loop var to end value */ + add_opvars(splev, "vvo", forloop_list[n_forloops].varname, buf2, SPO_CMP); + /* var + step */ + add_opvars(splev, "vvo", buf, + forloop_list[n_forloops].varname, SPO_MATH_ADD); + /* for-loop var = (for-loop var + step) */ + add_opvars(splev, "iso", 0, forloop_list[n_forloops].varname, SPO_VAR_INIT); + /* jump back if compared values were not equal */ + add_opvars(splev, "io", forloop_list[n_forloops].jmp_point - splev->n_opcodes - 1, SPO_JNE); + Free(forloop_list[n_forloops].varname); + break_stmt_end(splev); + } + break; + + case 152: + +/* Line 1455 of yacc.c */ +#line 1000 "lev_comp.y" + { + struct opvar *tmppush = New(struct opvar); + + if (n_if_list >= MAX_NESTED_IFS) { + lc_error("LOOP: Too deeply nested conditionals."); + n_if_list = MAX_NESTED_IFS - 1; + } + set_opvar_int(tmppush, splev->n_opcodes); + if_list[n_if_list++] = tmppush; + + add_opvars(splev, "o", SPO_DEC); + break_stmt_start(); + } + break; + + case 153: + +/* Line 1455 of yacc.c */ +#line 1014 "lev_comp.y" + { + struct opvar *tmppush; + + add_opvars(splev, "oio", SPO_COPY, 0, SPO_CMP); + + tmppush = (struct opvar *) if_list[--n_if_list]; + set_opvar_int(tmppush, tmppush->vardata.l - splev->n_opcodes-1); + add_opcode(splev, SPO_PUSH, tmppush); + add_opcode(splev, SPO_JG, NULL); + add_opcode(splev, SPO_POP, NULL); /* get rid of the count value in stack */ + break_stmt_end(splev); + } + break; + + case 154: + +/* Line 1455 of yacc.c */ +#line 1029 "lev_comp.y" + { + struct opvar *tmppush2 = New(struct opvar); + + if (n_if_list >= MAX_NESTED_IFS) { + lc_error("IF: Too deeply nested conditionals."); + n_if_list = MAX_NESTED_IFS - 1; + } + + add_opcode(splev, SPO_CMP, NULL); + + set_opvar_int(tmppush2, splev->n_opcodes+1); + + if_list[n_if_list++] = tmppush2; + + add_opcode(splev, SPO_PUSH, tmppush2); + + add_opcode(splev, reverse_jmp_opcode( (yyvsp[(1) - (2)].i) ), NULL); + + } + break; + + case 155: + +/* Line 1455 of yacc.c */ +#line 1049 "lev_comp.y" + { + if (n_if_list > 0) { + struct opvar *tmppush; + tmppush = (struct opvar *) if_list[--n_if_list]; + set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); + } else lc_error("IF: Huh?! No start address?"); + } + break; + + case 156: + +/* Line 1455 of yacc.c */ +#line 1059 "lev_comp.y" + { + struct opvar *tmppush2 = New(struct opvar); + + if (n_if_list >= MAX_NESTED_IFS) { + lc_error("IF: Too deeply nested conditionals."); + n_if_list = MAX_NESTED_IFS - 1; + } + + add_opcode(splev, SPO_CMP, NULL); + + set_opvar_int(tmppush2, splev->n_opcodes+1); + + if_list[n_if_list++] = tmppush2; + + add_opcode(splev, SPO_PUSH, tmppush2); + + add_opcode(splev, reverse_jmp_opcode( (yyvsp[(2) - (2)].i) ), NULL); + + } + break; + + case 157: + +/* Line 1455 of yacc.c */ +#line 1079 "lev_comp.y" + { + /* do nothing */ + } + break; + + case 158: + +/* Line 1455 of yacc.c */ +#line 1085 "lev_comp.y" + { + if (n_if_list > 0) { + struct opvar *tmppush; + tmppush = (struct opvar *) if_list[--n_if_list]; + set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); + } else lc_error("IF: Huh?! No start address?"); + } + break; + + case 159: + +/* Line 1455 of yacc.c */ +#line 1093 "lev_comp.y" + { + if (n_if_list > 0) { + struct opvar *tmppush = New(struct opvar); + struct opvar *tmppush2; + + set_opvar_int(tmppush, splev->n_opcodes+1); + add_opcode(splev, SPO_PUSH, tmppush); + + add_opcode(splev, SPO_JMP, NULL); + + tmppush2 = (struct opvar *) if_list[--n_if_list]; + + set_opvar_int(tmppush2, splev->n_opcodes - tmppush2->vardata.l); + if_list[n_if_list++] = tmppush; + } else lc_error("IF: Huh?! No else-part address?"); + } + break; + + case 160: + +/* Line 1455 of yacc.c */ +#line 1110 "lev_comp.y" + { + if (n_if_list > 0) { + struct opvar *tmppush; + tmppush = (struct opvar *) if_list[--n_if_list]; + set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); + } else lc_error("IF: Huh?! No end address?"); + } + break; + + case 161: + +/* Line 1455 of yacc.c */ +#line 1120 "lev_comp.y" + { + add_opvars(splev, "o", SPO_MESSAGE); + } + break; + + case 162: + +/* Line 1455 of yacc.c */ +#line 1126 "lev_comp.y" + { + add_opvars(splev, "iiiiiio", -1, 0, -1, -1, -1, -1, SPO_CORRIDOR); + } + break; + + case 163: + +/* Line 1455 of yacc.c */ +#line 1130 "lev_comp.y" + { + add_opvars(splev, "iiiiiio", -1, (yyvsp[(3) - (3)].i), -1, -1, -1, -1, SPO_CORRIDOR); + } + break; + + case 164: + +/* Line 1455 of yacc.c */ +#line 1134 "lev_comp.y" + { + add_opvars(splev, "iiiiiio", -1, -1, -1, -1, -1, -1, SPO_CORRIDOR); + } + break; + + case 165: + +/* Line 1455 of yacc.c */ +#line 1140 "lev_comp.y" + { + add_opvars(splev, "iiiiiio", + (yyvsp[(3) - (5)].corpos).room, (yyvsp[(3) - (5)].corpos).door, (yyvsp[(3) - (5)].corpos).wall, + (yyvsp[(5) - (5)].corpos).room, (yyvsp[(5) - (5)].corpos).door, (yyvsp[(5) - (5)].corpos).wall, + SPO_CORRIDOR); + } + break; + + case 166: + +/* Line 1455 of yacc.c */ +#line 1147 "lev_comp.y" + { + add_opvars(splev, "iiiiiio", + (yyvsp[(3) - (5)].corpos).room, (yyvsp[(3) - (5)].corpos).door, (yyvsp[(3) - (5)].corpos).wall, + -1, -1, (long)(yyvsp[(5) - (5)].i), + SPO_CORRIDOR); + } + break; + + case 167: + +/* Line 1455 of yacc.c */ +#line 1156 "lev_comp.y" + { + (yyval.corpos).room = (yyvsp[(2) - (7)].i); + (yyval.corpos).wall = (yyvsp[(4) - (7)].i); + (yyval.corpos).door = (yyvsp[(6) - (7)].i); + } + break; + + case 168: + +/* Line 1455 of yacc.c */ +#line 1164 "lev_comp.y" + { + if (((yyvsp[(2) - (4)].i) < 100) && ((yyvsp[(1) - (4)].i) == OROOM)) + lc_error("Only typed rooms can have a chance."); + else { + add_opvars(splev, "iii", (long)(yyvsp[(1) - (4)].i), (long)(yyvsp[(2) - (4)].i), (long)(yyvsp[(4) - (4)].i)); + } + } + break; + + case 169: + +/* Line 1455 of yacc.c */ +#line 1174 "lev_comp.y" + { + long flags = (yyvsp[(8) - (8)].i); + if (flags == -1) flags = (1 << 0); + add_opvars(splev, "iiiiiiio", flags, ERR, ERR, + (yyvsp[(5) - (8)].crd).x, (yyvsp[(5) - (8)].crd).y, (yyvsp[(7) - (8)].sze).width, (yyvsp[(7) - (8)].sze).height, SPO_SUBROOM); + break_stmt_start(); + } + break; + + case 170: + +/* Line 1455 of yacc.c */ +#line 1182 "lev_comp.y" + { + break_stmt_end(splev); + add_opcode(splev, SPO_ENDROOM, NULL); + } + break; + + case 171: + +/* Line 1455 of yacc.c */ +#line 1189 "lev_comp.y" + { + long flags = (yyvsp[(8) - (10)].i); + if (flags == -1) flags = (1 << 0); + add_opvars(splev, "iiiiiiio", flags, + (yyvsp[(7) - (10)].crd).x, (yyvsp[(7) - (10)].crd).y, (yyvsp[(5) - (10)].crd).x, (yyvsp[(5) - (10)].crd).y, + (yyvsp[(9) - (10)].sze).width, (yyvsp[(9) - (10)].sze).height, SPO_ROOM); + break_stmt_start(); + } + break; + + case 172: + +/* Line 1455 of yacc.c */ +#line 1198 "lev_comp.y" + { + break_stmt_end(splev); + add_opcode(splev, SPO_ENDROOM, NULL); + } + break; + + case 173: + +/* Line 1455 of yacc.c */ +#line 1205 "lev_comp.y" + { + (yyval.i) = 1; + } + break; + + case 174: + +/* Line 1455 of yacc.c */ +#line 1209 "lev_comp.y" + { + (yyval.i) = (yyvsp[(2) - (2)].i); + } + break; + + case 175: + +/* Line 1455 of yacc.c */ +#line 1215 "lev_comp.y" + { + if ( (yyvsp[(2) - (5)].i) < 1 || (yyvsp[(2) - (5)].i) > 5 || + (yyvsp[(4) - (5)].i) < 1 || (yyvsp[(4) - (5)].i) > 5 ) { + lc_error("Room positions should be between 1-5: (%li,%li)!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + } else { + (yyval.crd).x = (yyvsp[(2) - (5)].i); + (yyval.crd).y = (yyvsp[(4) - (5)].i); } + } + break; + + case 176: + +/* Line 1455 of yacc.c */ +#line 1225 "lev_comp.y" + { + (yyval.crd).x = (yyval.crd).y = ERR; + } + break; + + case 177: + +/* Line 1455 of yacc.c */ +#line 1231 "lev_comp.y" + { + if ( (yyvsp[(2) - (5)].i) < 0 || (yyvsp[(4) - (5)].i) < 0) { + lc_error("Invalid subroom position (%li,%li)!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + } else { + (yyval.crd).x = (yyvsp[(2) - (5)].i); + (yyval.crd).y = (yyvsp[(4) - (5)].i); + } + } + break; + + case 178: + +/* Line 1455 of yacc.c */ +#line 1240 "lev_comp.y" + { + (yyval.crd).x = (yyval.crd).y = ERR; + } + break; + + case 179: + +/* Line 1455 of yacc.c */ +#line 1246 "lev_comp.y" + { + (yyval.crd).x = (yyvsp[(2) - (5)].i); + (yyval.crd).y = (yyvsp[(4) - (5)].i); + } + break; + + case 180: + +/* Line 1455 of yacc.c */ +#line 1251 "lev_comp.y" + { + (yyval.crd).x = (yyval.crd).y = ERR; + } + break; + + case 181: + +/* Line 1455 of yacc.c */ +#line 1257 "lev_comp.y" + { + (yyval.sze).width = (yyvsp[(2) - (5)].i); + (yyval.sze).height = (yyvsp[(4) - (5)].i); + } + break; + + case 182: + +/* Line 1455 of yacc.c */ +#line 1262 "lev_comp.y" + { + (yyval.sze).height = (yyval.sze).width = ERR; + } + break; + + case 183: + +/* Line 1455 of yacc.c */ +#line 1268 "lev_comp.y" + { + /* ERR means random here */ + if ((yyvsp[(7) - (9)].i) == ERR && (yyvsp[(9) - (9)].i) != ERR) { + lc_error("If the door wall is random, so must be its pos!"); + } else { + add_opvars(splev, "iiiio", (long)(yyvsp[(9) - (9)].i), (long)(yyvsp[(5) - (9)].i), (long)(yyvsp[(3) - (9)].i), (long)(yyvsp[(7) - (9)].i), SPO_ROOM_DOOR); + } + } + break; + + case 184: + +/* Line 1455 of yacc.c */ +#line 1277 "lev_comp.y" + { + add_opvars(splev, "io", (long)(yyvsp[(3) - (5)].i), SPO_DOOR); + } + break; + + case 189: + +/* Line 1455 of yacc.c */ +#line 1291 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (1)].i); + } + break; + + case 190: + +/* Line 1455 of yacc.c */ +#line 1295 "lev_comp.y" + { + (yyval.i) = ((yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i)); + } + break; + + case 193: + +/* Line 1455 of yacc.c */ +#line 1305 "lev_comp.y" + { + add_opvars(splev, "ciisiio", 0, 0, 1, (char *)0, 0, 0, SPO_MAP); + max_x_map = COLNO-1; + max_y_map = ROWNO; + } + break; + + case 194: + +/* Line 1455 of yacc.c */ +#line 1311 "lev_comp.y" + { + add_opvars(splev, "cii", SP_COORD_PACK(((yyvsp[(3) - (7)].i)),((yyvsp[(5) - (7)].i))), 1, (long)(yyvsp[(6) - (7)].i)); + scan_map((yyvsp[(7) - (7)].map), splev); + Free((yyvsp[(7) - (7)].map)); + } + break; + + case 195: + +/* Line 1455 of yacc.c */ +#line 1317 "lev_comp.y" + { + add_opvars(splev, "ii", 2, (long)(yyvsp[(4) - (5)].i)); + scan_map((yyvsp[(5) - (5)].map), splev); + Free((yyvsp[(5) - (5)].map)); + } + break; + + case 200: + +/* Line 1455 of yacc.c */ +#line 1333 "lev_comp.y" + { + add_opvars(splev, "io", 0, SPO_MONSTER); + } + break; + + case 201: + +/* Line 1455 of yacc.c */ +#line 1337 "lev_comp.y" + { + add_opvars(splev, "io", 1, SPO_MONSTER); + in_container_obj++; + break_stmt_start(); + } + break; + + case 202: + +/* Line 1455 of yacc.c */ +#line 1343 "lev_comp.y" + { + break_stmt_end(splev); + in_container_obj--; + add_opvars(splev, "o", SPO_END_MONINVENT); + } + break; + + case 203: + +/* Line 1455 of yacc.c */ +#line 1351 "lev_comp.y" + { + /* nothing */ + } + break; + + case 204: + +/* Line 1455 of yacc.c */ +#line 1357 "lev_comp.y" + { + struct opvar *stopit = New(struct opvar); + set_opvar_int(stopit, SP_M_V_END); + add_opcode(splev, SPO_PUSH, stopit); + (yyval.i) = 0x0000; + } + break; + + case 205: + +/* Line 1455 of yacc.c */ +#line 1364 "lev_comp.y" + { + if (( (yyvsp[(1) - (3)].i) & (yyvsp[(3) - (3)].i) )) + lc_error("MONSTER extra info defined twice."); + (yyval.i) = ( (yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i) ); + } + break; + + case 206: + +/* Line 1455 of yacc.c */ +#line 1372 "lev_comp.y" + { + add_opvars(splev, "i", SP_M_V_NAME); + (yyval.i) = 0x0001; + } + break; + + case 207: + +/* Line 1455 of yacc.c */ +#line 1377 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_M_V_PEACEFUL); + (yyval.i) = 0x0002; + } + break; + + case 208: + +/* Line 1455 of yacc.c */ +#line 1382 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_M_V_ASLEEP); + (yyval.i) = 0x0004; + } + break; + + case 209: + +/* Line 1455 of yacc.c */ +#line 1387 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_M_V_ALIGN); + (yyval.i) = 0x0008; + } + break; + + case 210: + +/* Line 1455 of yacc.c */ +#line 1392 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(1) - (2)].i), SP_M_V_APPEAR); + (yyval.i) = 0x0010; + } + break; + + case 211: + +/* Line 1455 of yacc.c */ +#line 1397 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_FEMALE); + (yyval.i) = 0x0020; + } + break; + + case 212: + +/* Line 1455 of yacc.c */ +#line 1402 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_INVIS); + (yyval.i) = 0x0040; + } + break; + + case 213: + +/* Line 1455 of yacc.c */ +#line 1407 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_CANCELLED); + (yyval.i) = 0x0080; + } + break; + + case 214: + +/* Line 1455 of yacc.c */ +#line 1412 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_REVIVED); + (yyval.i) = 0x0100; + } + break; + + case 215: + +/* Line 1455 of yacc.c */ +#line 1417 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_AVENGE); + (yyval.i) = 0x0200; + } + break; + + case 216: + +/* Line 1455 of yacc.c */ +#line 1422 "lev_comp.y" + { + add_opvars(splev, "i", SP_M_V_FLEEING); + (yyval.i) = 0x0400; + } + break; + + case 217: + +/* Line 1455 of yacc.c */ +#line 1427 "lev_comp.y" + { + add_opvars(splev, "i", SP_M_V_BLINDED); + (yyval.i) = 0x0800; + } + break; + + case 218: + +/* Line 1455 of yacc.c */ +#line 1432 "lev_comp.y" + { + add_opvars(splev, "i", SP_M_V_PARALYZED); + (yyval.i) = 0x1000; + } + break; + + case 219: + +/* Line 1455 of yacc.c */ +#line 1437 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_STUNNED); + (yyval.i) = 0x2000; + } + break; + + case 220: + +/* Line 1455 of yacc.c */ +#line 1442 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_CONFUSED); + (yyval.i) = 0x4000; + } + break; + + case 221: + +/* Line 1455 of yacc.c */ +#line 1447 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(3) - (3)].i), SP_M_V_SEENTRAPS); + (yyval.i) = 0x8000; + } + break; + + case 222: + +/* Line 1455 of yacc.c */ +#line 1454 "lev_comp.y" + { + int token = get_trap_type((yyvsp[(1) - (1)].map)); + if (token == ERR || token == 0) + lc_error("Unknown trap type '%s'!", (yyvsp[(1) - (1)].map)); + (yyval.i) = (1L << (token - 1)); + } + break; + + case 223: + +/* Line 1455 of yacc.c */ +#line 1461 "lev_comp.y" + { + (yyval.i) = (long) ~0; + } + break; + + case 224: + +/* Line 1455 of yacc.c */ +#line 1465 "lev_comp.y" + { + int token = get_trap_type((yyvsp[(1) - (3)].map)); + if (token == ERR || token == 0) + lc_error("Unknown trap type '%s'!", (yyvsp[(1) - (3)].map)); + + if ((1L << (token - 1)) & (yyvsp[(3) - (3)].i)) + lc_error("Monster seen_traps, trap '%s' listed twice.", (yyvsp[(1) - (3)].map)); + + (yyval.i) = ((1L << (token - 1)) | (yyvsp[(3) - (3)].i)); + } + break; + + case 225: + +/* Line 1455 of yacc.c */ +#line 1478 "lev_comp.y" + { + long cnt = 0; + if (in_container_obj) cnt |= SP_OBJ_CONTENT; + add_opvars(splev, "io", cnt, SPO_OBJECT); + } + break; + + case 226: + +/* Line 1455 of yacc.c */ +#line 1484 "lev_comp.y" + { + long cnt = SP_OBJ_CONTAINER; + if (in_container_obj) cnt |= SP_OBJ_CONTENT; + add_opvars(splev, "io", cnt, SPO_OBJECT); + in_container_obj++; + break_stmt_start(); + } + break; + + case 227: + +/* Line 1455 of yacc.c */ +#line 1492 "lev_comp.y" + { + break_stmt_end(splev); + in_container_obj--; + add_opcode(splev, SPO_POP_CONTAINER, NULL); + } + break; + + case 228: + +/* Line 1455 of yacc.c */ +#line 1500 "lev_comp.y" + { + if (( (yyvsp[(2) - (2)].i) & 0x4000) && in_container_obj) lc_error("Object cannot have a coord when contained."); + else if (!( (yyvsp[(2) - (2)].i) & 0x4000) && !in_container_obj) lc_error("Object needs a coord when not contained."); + } + break; + + case 229: + +/* Line 1455 of yacc.c */ +#line 1507 "lev_comp.y" + { + struct opvar *stopit = New(struct opvar); + set_opvar_int(stopit, SP_O_V_END); + add_opcode(splev, SPO_PUSH, stopit); + (yyval.i) = 0x00; + } + break; + + case 230: + +/* Line 1455 of yacc.c */ +#line 1514 "lev_comp.y" + { + if (( (yyvsp[(1) - (3)].i) & (yyvsp[(3) - (3)].i) )) + lc_error("OBJECT extra info '%s' defined twice.", curr_token); + (yyval.i) = ( (yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i) ); + } + break; + + case 231: + +/* Line 1455 of yacc.c */ +#line 1522 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_O_V_CURSE); + (yyval.i) = 0x0001; + } + break; + + case 232: + +/* Line 1455 of yacc.c */ +#line 1527 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_CORPSENM); + (yyval.i) = 0x0002; + } + break; + + case 233: + +/* Line 1455 of yacc.c */ +#line 1532 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_SPE); + (yyval.i) = 0x0004; + } + break; + + case 234: + +/* Line 1455 of yacc.c */ +#line 1537 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_NAME); + (yyval.i) = 0x0008; + } + break; + + case 235: + +/* Line 1455 of yacc.c */ +#line 1542 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_QUAN); + (yyval.i) = 0x0010; + } + break; + + case 236: + +/* Line 1455 of yacc.c */ +#line 1547 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_O_V_BURIED); + (yyval.i) = 0x0020; + } + break; + + case 237: + +/* Line 1455 of yacc.c */ +#line 1552 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_O_V_LIT); + (yyval.i) = 0x0040; + } + break; + + case 238: + +/* Line 1455 of yacc.c */ +#line 1557 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_ERODED); + (yyval.i) = 0x0080; + } + break; + + case 239: + +/* Line 1455 of yacc.c */ +#line 1562 "lev_comp.y" + { + add_opvars(splev, "ii", -1, SP_O_V_ERODED); + (yyval.i) = 0x0080; + } + break; + + case 240: + +/* Line 1455 of yacc.c */ +#line 1567 "lev_comp.y" + { + if ((yyvsp[(1) - (1)].i) == D_LOCKED) { + add_opvars(splev, "ii", 1, SP_O_V_LOCKED); + (yyval.i) = 0x0100; + } else if ((yyvsp[(1) - (1)].i) == D_BROKEN) { + add_opvars(splev, "ii", 1, SP_O_V_BROKEN); + (yyval.i) = 0x0200; + } else + lc_error("OBJECT state can only be locked or broken."); + } + break; + + case 241: + +/* Line 1455 of yacc.c */ +#line 1578 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_O_V_TRAPPED); + (yyval.i) = 0x0400; + } + break; + + case 242: + +/* Line 1455 of yacc.c */ +#line 1583 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_RECHARGED); + (yyval.i) = 0x0800; + } + break; + + case 243: + +/* Line 1455 of yacc.c */ +#line 1588 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_O_V_INVIS); + (yyval.i) = 0x1000; + } + break; + + case 244: + +/* Line 1455 of yacc.c */ +#line 1593 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_O_V_GREASED); + (yyval.i) = 0x2000; + } + break; + + case 245: + +/* Line 1455 of yacc.c */ +#line 1598 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_COORD); + (yyval.i) = 0x4000; + } + break; + + case 246: + +/* Line 1455 of yacc.c */ +#line 1605 "lev_comp.y" + { + add_opvars(splev, "io", (long)(yyvsp[(3) - (5)].i), SPO_TRAP); + } + break; + + case 247: + +/* Line 1455 of yacc.c */ +#line 1611 "lev_comp.y" + { + long d, state = 0; + /* convert dir from a DIRECTION to a DB_DIR */ + d = (yyvsp[(5) - (7)].i); + switch(d) { + case W_NORTH: d = DB_NORTH; break; + case W_SOUTH: d = DB_SOUTH; break; + case W_EAST: d = DB_EAST; break; + case W_WEST: d = DB_WEST; break; + default: + lc_error("Invalid drawbridge direction."); + break; + } + + if ( (yyvsp[(7) - (7)].i) == D_ISOPEN ) + state = 1; + else if ( (yyvsp[(7) - (7)].i) == D_CLOSED ) + state = 0; + else if ( (yyvsp[(7) - (7)].i) == -1 ) + state = -1; + else + lc_error("A drawbridge can only be open, closed or random!"); + add_opvars(splev, "iio", state, d, SPO_DRAWBRIDGE); } -break; -case 153: -{ - tmpwalk[nwalk] = New(walk); - tmpwalk[nwalk]->x = current_coord.x; - tmpwalk[nwalk]->y = current_coord.y; - tmpwalk[nwalk]->dir = yyvsp[0].i; - nwalk++; - if (nwalk >= MAX_OF_TYPE) { - yyerror("Too many mazewalks in mazepart!"); - nwalk--; - } - } -break; -case 154: -{ - wallify_map(); - } -break; -case 155: -{ - tmplad[nlad] = New(lad); - tmplad[nlad]->x = current_coord.x; - tmplad[nlad]->y = current_coord.y; - tmplad[nlad]->up = yyvsp[0].i; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Ladder"); - nlad++; - if (nlad >= MAX_OF_TYPE) { - yyerror("Too many ladders in mazepart!"); - nlad--; - } - } -break; -case 156: -{ - tmpstair[nstair] = New(stair); - tmpstair[nstair]->x = current_coord.x; - tmpstair[nstair]->y = current_coord.y; - tmpstair[nstair]->up = yyvsp[0].i; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Stairway"); - nstair++; - if (nstair >= MAX_OF_TYPE) { - yyerror("Too many stairs in room or mazepart!"); - nstair--; - } - } -break; -case 157: -{ - tmplreg[nlreg] = New(lev_region); - tmplreg[nlreg]->in_islev = yyvsp[0].i; - tmplreg[nlreg]->inarea.x1 = current_region.x1; - tmplreg[nlreg]->inarea.y1 = current_region.y1; - tmplreg[nlreg]->inarea.x2 = current_region.x2; - tmplreg[nlreg]->inarea.y2 = current_region.y2; - } -break; -case 158: -{ - tmplreg[nlreg]->del_islev = yyvsp[-2].i; - tmplreg[nlreg]->delarea.x1 = current_region.x1; - tmplreg[nlreg]->delarea.y1 = current_region.y1; - tmplreg[nlreg]->delarea.x2 = current_region.x2; - tmplreg[nlreg]->delarea.y2 = current_region.y2; - if(yyvsp[0].i) - tmplreg[nlreg]->rtype = LR_UPSTAIR; - else - tmplreg[nlreg]->rtype = LR_DOWNSTAIR; - tmplreg[nlreg]->rname.str = 0; - nlreg++; - if (nlreg >= MAX_OF_TYPE) { - yyerror("Too many levregions in mazepart!"); - nlreg--; - } - } -break; -case 159: -{ - tmplreg[nlreg] = New(lev_region); - tmplreg[nlreg]->in_islev = yyvsp[0].i; - tmplreg[nlreg]->inarea.x1 = current_region.x1; - tmplreg[nlreg]->inarea.y1 = current_region.y1; - tmplreg[nlreg]->inarea.x2 = current_region.x2; - tmplreg[nlreg]->inarea.y2 = current_region.y2; - } -break; -case 160: -{ - tmplreg[nlreg]->del_islev = yyvsp[-2].i; - tmplreg[nlreg]->delarea.x1 = current_region.x1; - tmplreg[nlreg]->delarea.y1 = current_region.y1; - tmplreg[nlreg]->delarea.x2 = current_region.x2; - tmplreg[nlreg]->delarea.y2 = current_region.y2; - tmplreg[nlreg]->rtype = LR_PORTAL; - tmplreg[nlreg]->rname.str = yyvsp[0].map; - nlreg++; - if (nlreg >= MAX_OF_TYPE) { - yyerror("Too many levregions in mazepart!"); - nlreg--; - } - } -break; -case 161: -{ - tmplreg[nlreg] = New(lev_region); - tmplreg[nlreg]->in_islev = yyvsp[0].i; - tmplreg[nlreg]->inarea.x1 = current_region.x1; - tmplreg[nlreg]->inarea.y1 = current_region.y1; - tmplreg[nlreg]->inarea.x2 = current_region.x2; - tmplreg[nlreg]->inarea.y2 = current_region.y2; - } -break; -case 162: -{ - tmplreg[nlreg]->del_islev = yyvsp[0].i; - tmplreg[nlreg]->delarea.x1 = current_region.x1; - tmplreg[nlreg]->delarea.y1 = current_region.y1; - tmplreg[nlreg]->delarea.x2 = current_region.x2; - tmplreg[nlreg]->delarea.y2 = current_region.y2; - } -break; -case 163: -{ - switch(yyvsp[0].i) { - case -1: tmplreg[nlreg]->rtype = LR_TELE; break; - case 0: tmplreg[nlreg]->rtype = LR_DOWNTELE; break; - case 1: tmplreg[nlreg]->rtype = LR_UPTELE; break; - } - tmplreg[nlreg]->rname.str = 0; - nlreg++; - if (nlreg >= MAX_OF_TYPE) { - yyerror("Too many levregions in mazepart!"); - nlreg--; - } - } -break; -case 164: -{ - tmplreg[nlreg] = New(lev_region); - tmplreg[nlreg]->in_islev = yyvsp[0].i; - tmplreg[nlreg]->inarea.x1 = current_region.x1; - tmplreg[nlreg]->inarea.y1 = current_region.y1; - tmplreg[nlreg]->inarea.x2 = current_region.x2; - tmplreg[nlreg]->inarea.y2 = current_region.y2; - } -break; -case 165: -{ - tmplreg[nlreg]->del_islev = yyvsp[0].i; - tmplreg[nlreg]->delarea.x1 = current_region.x1; - tmplreg[nlreg]->delarea.y1 = current_region.y1; - tmplreg[nlreg]->delarea.x2 = current_region.x2; - tmplreg[nlreg]->delarea.y2 = current_region.y2; - tmplreg[nlreg]->rtype = LR_BRANCH; - tmplreg[nlreg]->rname.str = 0; - nlreg++; - if (nlreg >= MAX_OF_TYPE) { - yyerror("Too many levregions in mazepart!"); - nlreg--; - } - } -break; -case 166: -{ - yyval.i = -1; - } -break; -case 167: -{ - yyval.i = yyvsp[0].i; - } -break; -case 168: -{ - yyval.i = 0; - } -break; -case 169: -{ -/* 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 >= COLNO) - yyerror("Region out of level range!"); - else if (yyvsp[-5].i < 0 || yyvsp[-5].i >= ROWNO) - yyerror("Region out of level range!"); - else if (yyvsp[-3].i <= 0 || yyvsp[-3].i >= COLNO) - yyerror("Region out of level range!"); - else if (yyvsp[-1].i < 0 || yyvsp[-1].i >= ROWNO) - yyerror("Region out of level range!"); - current_region.x1 = yyvsp[-7].i; - current_region.y1 = yyvsp[-5].i; - current_region.x2 = yyvsp[-3].i; - current_region.y2 = yyvsp[-1].i; - yyval.i = 1; - } -break; -case 170: -{ - tmpfountain[nfountain] = New(fountain); - tmpfountain[nfountain]->x = current_coord.x; - tmpfountain[nfountain]->y = current_coord.y; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Fountain"); - nfountain++; - if (nfountain >= MAX_OF_TYPE) { - yyerror("Too many fountains in room or mazepart!"); - nfountain--; - } - } -break; -case 171: -{ - tmpsink[nsink] = New(sink); - tmpsink[nsink]->x = current_coord.x; - tmpsink[nsink]->y = current_coord.y; - nsink++; - if (nsink >= MAX_OF_TYPE) { - yyerror("Too many sinks in room!"); - nsink--; - } - } -break; -case 172: -{ - tmppool[npool] = New(pool); - tmppool[npool]->x = current_coord.x; - tmppool[npool]->y = current_coord.y; - npool++; - if (npool >= MAX_OF_TYPE) { - yyerror("Too many pools in room!"); - npool--; - } - } -break; -case 173: -{ - tmpdig[ndig] = New(digpos); - tmpdig[ndig]->x1 = current_region.x1; - tmpdig[ndig]->y1 = current_region.y1; - tmpdig[ndig]->x2 = current_region.x2; - tmpdig[ndig]->y2 = current_region.y2; - ndig++; - if (ndig >= MAX_OF_TYPE) { - yyerror("Too many diggables in mazepart!"); - ndig--; - } - } -break; -case 174: -{ - tmppass[npass] = New(digpos); - tmppass[npass]->x1 = current_region.x1; - tmppass[npass]->y1 = current_region.y1; - tmppass[npass]->x2 = current_region.x2; - tmppass[npass]->y2 = current_region.y2; - npass++; - if (npass >= 32) { - yyerror("Too many passwalls in mazepart!"); - npass--; - } - } -break; -case 175: -{ - tmpreg[nreg] = New(region); - tmpreg[nreg]->x1 = current_region.x1; - tmpreg[nreg]->y1 = current_region.y1; - tmpreg[nreg]->x2 = current_region.x2; - tmpreg[nreg]->y2 = current_region.y2; - tmpreg[nreg]->rlit = yyvsp[-3].i; - tmpreg[nreg]->rtype = yyvsp[-1].i; - if(yyvsp[0].i & 1) tmpreg[nreg]->rtype += MAXRTYPE+1; - tmpreg[nreg]->rirreg = ((yyvsp[0].i & 2) != 0); - if(current_region.x1 > current_region.x2 || - current_region.y1 > current_region.y2) - yyerror("Region start > end!"); - if(tmpreg[nreg]->rtype == VAULT && - (tmpreg[nreg]->rirreg || - (tmpreg[nreg]->x2 - tmpreg[nreg]->x1 != 1) || - (tmpreg[nreg]->y2 - tmpreg[nreg]->y1 != 1))) - yyerror("Vaults must be exactly 2x2!"); - if(want_warnings && !tmpreg[nreg]->rirreg && - current_region.x1 > 0 && current_region.y1 > 0 && - current_region.x2 < (int)max_x_map && - current_region.y2 < (int)max_y_map) { - /* check for walls in the room */ - char ebuf[60]; - register int x, y, nrock = 0; + break; - for(y=current_region.y1; y<=current_region.y2; y++) - for(x=current_region.x1; - x<=current_region.x2; x++) - if(IS_ROCK(tmpmap[y][x]) || - IS_DOOR(tmpmap[y][x])) nrock++; - if(nrock) { - Sprintf(ebuf, - "Rock in room (%02d,%02d,%02d,%02d)?!", - current_region.x1, current_region.y1, - current_region.x2, current_region.y2); - yywarning(ebuf); - } - if ( - !IS_ROCK(tmpmap[current_region.y1-1][current_region.x1-1]) || - !IS_ROCK(tmpmap[current_region.y2+1][current_region.x1-1]) || - !IS_ROCK(tmpmap[current_region.y1-1][current_region.x2+1]) || - !IS_ROCK(tmpmap[current_region.y2+1][current_region.x2+1])) { - Sprintf(ebuf, - "NonRock edge in room (%02d,%02d,%02d,%02d)?!", - current_region.x1, current_region.y1, - current_region.x2, current_region.y2); - yywarning(ebuf); - } - } else if(tmpreg[nreg]->rirreg && - !IS_ROOM(tmpmap[current_region.y1][current_region.x1])) { - char ebuf[60]; - Sprintf(ebuf, - "Rock in irregular room (%02d,%02d)?!", - current_region.x1, current_region.y1); - yyerror(ebuf); - } - nreg++; - if (nreg >= MAX_OF_TYPE) { - yyerror("Too many regions in mazepart!"); - nreg--; - } + case 248: + +/* Line 1455 of yacc.c */ +#line 1638 "lev_comp.y" + { + add_opvars(splev, "iiio", + (long)(yyvsp[(5) - (5)].i), 1, 0, SPO_MAZEWALK); } -break; -case 176: -{ - tmpaltar[naltar] = New(altar); - tmpaltar[naltar]->x = current_coord.x; - tmpaltar[naltar]->y = current_coord.y; - tmpaltar[naltar]->align = yyvsp[-2].i; - tmpaltar[naltar]->shrine = yyvsp[0].i; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Altar"); - naltar++; - if (naltar >= MAX_OF_TYPE) { - yyerror("Too many altars in room or mazepart!"); - naltar--; - } + break; + + case 249: + +/* Line 1455 of yacc.c */ +#line 1643 "lev_comp.y" + { + add_opvars(splev, "iiio", + (long)(yyvsp[(5) - (8)].i), (long)(yyvsp[(7) - (8)].i), (long)(yyvsp[(8) - (8)].i), SPO_MAZEWALK); } -break; -case 177: -{ - tmpgold[ngold] = New(gold); - tmpgold[ngold]->x = current_coord.x; - tmpgold[ngold]->y = current_coord.y; - tmpgold[ngold]->amount = yyvsp[-2].i; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Gold"); - ngold++; - if (ngold >= MAX_OF_TYPE) { - yyerror("Too many golds in room or mazepart!"); - ngold--; - } + break; + + case 250: + +/* Line 1455 of yacc.c */ +#line 1650 "lev_comp.y" + { + add_opvars(splev, "rio", SP_REGION_PACK(-1,-1,-1,-1), 0, SPO_WALLIFY); } -break; -case 178: -{ - tmpengraving[nengraving] = New(engraving); - tmpengraving[nengraving]->x = current_coord.x; - tmpengraving[nengraving]->y = current_coord.y; - tmpengraving[nengraving]->engr.str = yyvsp[0].map; - tmpengraving[nengraving]->etype = yyvsp[-2].i; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Engraving"); - nengraving++; - if (nengraving >= MAX_OF_TYPE) { - yyerror("Too many engravings in room or mazepart!"); - nengraving--; - } + break; + + case 251: + +/* Line 1455 of yacc.c */ +#line 1654 "lev_comp.y" + { + add_opvars(splev, "io", 1, SPO_WALLIFY); } -break; -case 180: -{ - yyval.i = - MAX_REGISTERS - 1; + break; + + case 252: + +/* Line 1455 of yacc.c */ +#line 1660 "lev_comp.y" + { + add_opvars(splev, "io", (long)(yyvsp[(5) - (5)].i), SPO_LADDER); } -break; -case 183: -{ - yyval.i = - MAX_REGISTERS - 1; + break; + + case 253: + +/* Line 1455 of yacc.c */ +#line 1666 "lev_comp.y" + { + add_opvars(splev, "io", (long)(yyvsp[(5) - (5)].i), SPO_STAIR); } -break; -case 186: -{ - yyval.map = (char *) 0; + break; + + case 254: + +/* Line 1455 of yacc.c */ +#line 1672 "lev_comp.y" + { + add_opvars(splev, "iiiii iiiii iiso", + (yyvsp[(3) - (7)].lregn).x1, (yyvsp[(3) - (7)].lregn).y1, (yyvsp[(3) - (7)].lregn).x2, (yyvsp[(3) - (7)].lregn).y2, (yyvsp[(3) - (7)].lregn).area, + (yyvsp[(5) - (7)].lregn).x1, (yyvsp[(5) - (7)].lregn).y1, (yyvsp[(5) - (7)].lregn).x2, (yyvsp[(5) - (7)].lregn).y2, (yyvsp[(5) - (7)].lregn).area, + (long)(((yyvsp[(7) - (7)].i)) ? LR_UPSTAIR : LR_DOWNSTAIR), + 0, (char *)0, SPO_LEVREGION); } -break; -case 188: -{ - yyval.map = (char *) 0; + break; + + case 255: + +/* Line 1455 of yacc.c */ +#line 1682 "lev_comp.y" + { + add_opvars(splev, "iiiii iiiii iiso", + (yyvsp[(3) - (7)].lregn).x1, (yyvsp[(3) - (7)].lregn).y1, (yyvsp[(3) - (7)].lregn).x2, (yyvsp[(3) - (7)].lregn).y2, (yyvsp[(3) - (7)].lregn).area, + (yyvsp[(5) - (7)].lregn).x1, (yyvsp[(5) - (7)].lregn).y1, (yyvsp[(5) - (7)].lregn).x2, (yyvsp[(5) - (7)].lregn).y2, (yyvsp[(5) - (7)].lregn).area, + LR_PORTAL, 0, (yyvsp[(7) - (7)].map), SPO_LEVREGION); + Free((yyvsp[(7) - (7)].map)); } -break; -case 189: -{ - int token = get_trap_type(yyvsp[0].map); + break; + + case 256: + +/* Line 1455 of yacc.c */ +#line 1692 "lev_comp.y" + { + long rtype = 0; + switch((yyvsp[(6) - (6)].i)) { + case -1: rtype = LR_TELE; break; + case 0: rtype = LR_DOWNTELE; break; + case 1: rtype = LR_UPTELE; break; + } + add_opvars(splev, "iiiii iiiii iiso", + (yyvsp[(3) - (6)].lregn).x1, (yyvsp[(3) - (6)].lregn).y1, (yyvsp[(3) - (6)].lregn).x2, (yyvsp[(3) - (6)].lregn).y2, (yyvsp[(3) - (6)].lregn).area, + (yyvsp[(5) - (6)].lregn).x1, (yyvsp[(5) - (6)].lregn).y1, (yyvsp[(5) - (6)].lregn).x2, (yyvsp[(5) - (6)].lregn).y2, (yyvsp[(5) - (6)].lregn).area, + rtype, 0, (char *)0, SPO_LEVREGION); + } + break; + + case 257: + +/* Line 1455 of yacc.c */ +#line 1707 "lev_comp.y" + { + add_opvars(splev, "iiiii iiiii iiso", + (yyvsp[(3) - (5)].lregn).x1, (yyvsp[(3) - (5)].lregn).y1, (yyvsp[(3) - (5)].lregn).x2, (yyvsp[(3) - (5)].lregn).y2, (yyvsp[(3) - (5)].lregn).area, + (yyvsp[(5) - (5)].lregn).x1, (yyvsp[(5) - (5)].lregn).y1, (yyvsp[(5) - (5)].lregn).x2, (yyvsp[(5) - (5)].lregn).y2, (yyvsp[(5) - (5)].lregn).area, + (long)LR_BRANCH, 0, (char *)0, SPO_LEVREGION); + } + break; + + case 258: + +/* Line 1455 of yacc.c */ +#line 1716 "lev_comp.y" + { + (yyval.i) = -1; + } + break; + + case 259: + +/* Line 1455 of yacc.c */ +#line 1720 "lev_comp.y" + { + (yyval.i) = (yyvsp[(2) - (2)].i); + } + break; + + case 260: + +/* Line 1455 of yacc.c */ +#line 1726 "lev_comp.y" + { + add_opvars(splev, "o", SPO_FOUNTAIN); + } + break; + + case 261: + +/* Line 1455 of yacc.c */ +#line 1732 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SINK); + } + break; + + case 262: + +/* Line 1455 of yacc.c */ +#line 1738 "lev_comp.y" + { + add_opvars(splev, "o", SPO_POOL); + } + break; + + case 263: + +/* Line 1455 of yacc.c */ +#line 1744 "lev_comp.y" + { + (yyval.terr).lit = -2; + (yyval.terr).ter = what_map_char((char) (yyvsp[(1) - (1)].i)); + } + break; + + case 264: + +/* Line 1455 of yacc.c */ +#line 1749 "lev_comp.y" + { + (yyval.terr).lit = (yyvsp[(4) - (5)].i); + (yyval.terr).ter = what_map_char((char) (yyvsp[(2) - (5)].i)); + } + break; + + case 265: + +/* Line 1455 of yacc.c */ +#line 1756 "lev_comp.y" + { + add_opvars(splev, "io", (yyvsp[(9) - (9)].i), SPO_REPLACETERRAIN); + } + break; + + case 266: + +/* Line 1455 of yacc.c */ +#line 1762 "lev_comp.y" + { + add_opvars(splev, "o", SPO_TERRAIN); + } + break; + + case 267: + +/* Line 1455 of yacc.c */ +#line 1768 "lev_comp.y" + { + add_opvars(splev, "o", SPO_NON_DIGGABLE); + } + break; + + case 268: + +/* Line 1455 of yacc.c */ +#line 1774 "lev_comp.y" + { + add_opvars(splev, "o", SPO_NON_PASSWALL); + } + break; + + case 269: + +/* Line 1455 of yacc.c */ +#line 1780 "lev_comp.y" + { + long irr; + long rt = (yyvsp[(7) - (8)].i); + long flags = (yyvsp[(8) - (8)].i); + if (flags == -1) flags = (1 << 0); + if (!(( flags ) & 1)) rt += MAXRTYPE+1; + irr = ((( flags ) & 2) != 0); + add_opvars(splev, "iiio", + (long)(yyvsp[(5) - (8)].i), rt, flags, SPO_REGION); + (yyval.i) = (irr || (flags & 1) || rt != OROOM); + break_stmt_start(); + } + break; + + case 270: + +/* Line 1455 of yacc.c */ +#line 1793 "lev_comp.y" + { + break_stmt_end(splev); + if ( (yyvsp[(9) - (10)].i) ) { + add_opcode(splev, SPO_ENDROOM, NULL); + } else if ( (yyvsp[(10) - (10)].i) ) + lc_error("Cannot use lev statements in non-permanent REGION"); + } + break; + + case 271: + +/* Line 1455 of yacc.c */ +#line 1803 "lev_comp.y" + { + (yyval.i) = 0; + } + break; + + case 272: + +/* Line 1455 of yacc.c */ +#line 1807 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (1)].i); + } + break; + + case 273: + +/* Line 1455 of yacc.c */ +#line 1813 "lev_comp.y" + { + add_opvars(splev, "iio", (long)(yyvsp[(7) - (7)].i), (long)(yyvsp[(5) - (7)].i), SPO_ALTAR); + } + break; + + case 274: + +/* Line 1455 of yacc.c */ +#line 1819 "lev_comp.y" + { + add_opvars(splev, "io", 2, SPO_GRAVE); + } + break; + + case 275: + +/* Line 1455 of yacc.c */ +#line 1823 "lev_comp.y" + { + add_opvars(splev, "sio", + (char *)0, 1, SPO_GRAVE); + } + break; + + case 276: + +/* Line 1455 of yacc.c */ +#line 1828 "lev_comp.y" + { + add_opvars(splev, "sio", + (char *)0, 0, SPO_GRAVE); + } + break; + + case 277: + +/* Line 1455 of yacc.c */ +#line 1835 "lev_comp.y" + { + add_opvars(splev, "o", SPO_GOLD); + } + break; + + case 278: + +/* Line 1455 of yacc.c */ +#line 1841 "lev_comp.y" + { + add_opvars(splev, "io", + (long)(yyvsp[(5) - (7)].i), SPO_ENGRAVING); + } + break; + + case 279: + +/* Line 1455 of yacc.c */ +#line 1848 "lev_comp.y" + { + add_opvars(splev, "o", SPO_MINERALIZE); + } + break; + + case 280: + +/* Line 1455 of yacc.c */ +#line 1852 "lev_comp.y" + { + add_opvars(splev, "iiiio", -1L, -1L, -1L, -1L, SPO_MINERALIZE); + } + break; + + case 281: + +/* Line 1455 of yacc.c */ +#line 1858 "lev_comp.y" + { + int token = get_trap_type((yyvsp[(1) - (1)].map)); if (token == ERR) - yyerror("Unknown trap type!"); - yyval.i = token; - Free(yyvsp[0].map); + lc_error("Unknown trap type '%s'!", (yyvsp[(1) - (1)].map)); + (yyval.i) = token; + Free((yyvsp[(1) - (1)].map)); } -break; -case 191: -{ - int token = get_room_type(yyvsp[0].map); + break; + + case 283: + +/* Line 1455 of yacc.c */ +#line 1869 "lev_comp.y" + { + int token = get_room_type((yyvsp[(1) - (1)].map)); if (token == ERR) { - yywarning("Unknown room type! Making ordinary room..."); - yyval.i = OROOM; + lc_warning("Unknown room type \"%s\"! Making ordinary room...", (yyvsp[(1) - (1)].map)); + (yyval.i) = OROOM; } else - yyval.i = token; - Free(yyvsp[0].map); + (yyval.i) = token; + Free((yyvsp[(1) - (1)].map)); } -break; -case 193: -{ - yyval.i = 0; + break; + + case 285: + +/* Line 1455 of yacc.c */ +#line 1882 "lev_comp.y" + { + (yyval.i) = -1; } -break; -case 194: -{ - yyval.i = yyvsp[0].i; + break; + + case 286: + +/* Line 1455 of yacc.c */ +#line 1886 "lev_comp.y" + { + (yyval.i) = (yyvsp[(2) - (2)].i); } -break; -case 195: -{ - yyval.i = yyvsp[-2].i + (yyvsp[0].i << 1); + break; + + case 287: + +/* Line 1455 of yacc.c */ +#line 1892 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (1)].i); } -break; -case 198: -{ - current_coord.x = current_coord.y = -MAX_REGISTERS-1; + break; + + case 288: + +/* Line 1455 of yacc.c */ +#line 1896 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i); } -break; -case 205: -{ - yyval.i = - MAX_REGISTERS - 1; + break; + + case 289: + +/* Line 1455 of yacc.c */ +#line 1903 "lev_comp.y" + { + (yyval.i) = ((yyvsp[(1) - (1)].i) << 0); } -break; -case 208: -{ - if ( yyvsp[-1].i >= MAX_REGISTERS ) - yyerror("Register Index overflow!"); + break; + + case 290: + +/* Line 1455 of yacc.c */ +#line 1907 "lev_comp.y" + { + (yyval.i) = ((yyvsp[(1) - (1)].i) << 1); + } + break; + + case 291: + +/* Line 1455 of yacc.c */ +#line 1911 "lev_comp.y" + { + (yyval.i) = ((yyvsp[(1) - (1)].i) << 2); + } + break; + + case 298: + +/* Line 1455 of yacc.c */ +#line 1927 "lev_comp.y" + { + (yyval.i) = - MAX_REGISTERS - 1; + } + break; + + case 301: + +/* Line 1455 of yacc.c */ +#line 1935 "lev_comp.y" + { + (yyval.i) = - MAX_REGISTERS - 1; + } + break; + + case 304: + +/* Line 1455 of yacc.c */ +#line 1945 "lev_comp.y" + { + if ( (yyvsp[(3) - (4)].i) >= 3 ) + lc_error("Register Index overflow!"); else - current_coord.x = current_coord.y = - yyvsp[-1].i - 1; + (yyval.i) = - (yyvsp[(3) - (4)].i) - 1; } -break; -case 209: -{ - if ( yyvsp[-1].i >= MAX_REGISTERS ) - yyerror("Register Index overflow!"); - else - yyval.i = - yyvsp[-1].i - 1; + break; + + case 305: + +/* Line 1455 of yacc.c */ +#line 1954 "lev_comp.y" + { + add_opvars(splev, "s", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); } -break; -case 210: -{ - if ( yyvsp[-1].i >= MAX_REGISTERS ) - yyerror("Register Index overflow!"); - else - yyval.i = - yyvsp[-1].i - 1; + break; + + case 306: + +/* Line 1455 of yacc.c */ +#line 1959 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_STRING); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); } -break; -case 211: -{ - if ( yyvsp[-1].i >= 3 ) - yyerror("Register Index overflow!"); - else - yyval.i = - yyvsp[-1].i - 1; + break; + + case 307: + +/* Line 1455 of yacc.c */ +#line 1966 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_STRING|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); } -break; -case 213: -{ - if (check_monster_char((char) yyvsp[0].i)) - yyval.i = yyvsp[0].i ; + break; + + case 308: + +/* Line 1455 of yacc.c */ +#line 1976 "lev_comp.y" + { + /* nothing */ + } + break; + + case 309: + +/* Line 1455 of yacc.c */ +#line 1982 "lev_comp.y" + { + add_opvars(splev, "c", (yyvsp[(1) - (1)].i)); + } + break; + + case 310: + +/* Line 1455 of yacc.c */ +#line 1986 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_RNDCOORD); + } + break; + + case 311: + +/* Line 1455 of yacc.c */ +#line 1990 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_COORD); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + } + break; + + case 312: + +/* Line 1455 of yacc.c */ +#line 1997 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_COORD|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); + } + break; + + case 313: + +/* Line 1455 of yacc.c */ +#line 2006 "lev_comp.y" + { + if ((yyvsp[(2) - (5)].i) < 0 || (yyvsp[(4) - (5)].i) < 0 || (yyvsp[(2) - (5)].i) >= COLNO || (yyvsp[(4) - (5)].i) >= ROWNO) + lc_error("Coordinates (%li,%li) out of map range!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + (yyval.i) = SP_COORD_PACK((yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + } + break; + + case 314: + +/* Line 1455 of yacc.c */ +#line 2012 "lev_comp.y" + { + (yyval.i) = SP_COORD_PACK_RANDOM(0); + } + break; + + case 315: + +/* Line 1455 of yacc.c */ +#line 2016 "lev_comp.y" + { + (yyval.i) = SP_COORD_PACK_RANDOM( (yyvsp[(2) - (3)].i) ); + } + break; + + case 316: + +/* Line 1455 of yacc.c */ +#line 2022 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (1)].i); + } + break; + + case 317: + +/* Line 1455 of yacc.c */ +#line 2026 "lev_comp.y" + { + if (((yyvsp[(1) - (3)].i) & (yyvsp[(3) - (3)].i))) + lc_warning("Humidity flag used twice."); + (yyval.i) = ((yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i)); + } + break; + + case 318: + +/* Line 1455 of yacc.c */ +#line 2034 "lev_comp.y" + { + /* nothing */ + } + break; + + case 319: + +/* Line 1455 of yacc.c */ +#line 2038 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_REGION); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + } + break; + + case 320: + +/* Line 1455 of yacc.c */ +#line 2045 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_REGION|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); + } + break; + + case 321: + +/* Line 1455 of yacc.c */ +#line 2054 "lev_comp.y" + { + long r = SP_REGION_PACK((yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + if ( (yyvsp[(2) - (9)].i) > (yyvsp[(6) - (9)].i) || (yyvsp[(4) - (9)].i) > (yyvsp[(8) - (9)].i) ) + lc_error("Region start > end: (%li,%li,%li,%li)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + + add_opvars(splev, "r", r); + (yyval.i) = r; + } + break; + + case 322: + +/* Line 1455 of yacc.c */ +#line 2065 "lev_comp.y" + { + add_opvars(splev, "m", (yyvsp[(1) - (1)].i)); + } + break; + + case 323: + +/* Line 1455 of yacc.c */ +#line 2069 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_MAPCHAR); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + } + break; + + case 324: + +/* Line 1455 of yacc.c */ +#line 2076 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); + } + break; + + case 325: + +/* Line 1455 of yacc.c */ +#line 2085 "lev_comp.y" + { + if (what_map_char((char) (yyvsp[(1) - (1)].i)) != INVALID_TYPE) + (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[(1) - (1)].i)), -2); + else { + lc_error("Unknown map char type '%c'!", (yyvsp[(1) - (1)].i)); + (yyval.i) = SP_MAPCHAR_PACK(STONE, -2); + } + } + break; + + case 326: + +/* Line 1455 of yacc.c */ +#line 2094 "lev_comp.y" + { + if (what_map_char((char) (yyvsp[(2) - (5)].i)) != INVALID_TYPE) + (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[(2) - (5)].i)), (yyvsp[(4) - (5)].i)); + else { + lc_error("Unknown map char type '%c'!", (yyvsp[(2) - (5)].i)); + (yyval.i) = SP_MAPCHAR_PACK(STONE, (yyvsp[(4) - (5)].i)); + } + } + break; + + case 327: + +/* Line 1455 of yacc.c */ +#line 2105 "lev_comp.y" + { + add_opvars(splev, "M", (yyvsp[(1) - (1)].i)); + } + break; + + case 328: + +/* Line 1455 of yacc.c */ +#line 2109 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_MONST); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + } + break; + + case 329: + +/* Line 1455 of yacc.c */ +#line 2116 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_MONST|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); + } + break; + + case 330: + +/* Line 1455 of yacc.c */ +#line 2125 "lev_comp.y" + { + long m = get_monster_id((yyvsp[(1) - (1)].map), (char)0); + if (m == ERR) { + lc_error("Unknown monster \"%s\"!", (yyvsp[(1) - (1)].map)); + (yyval.i) = -1; + } else + (yyval.i) = SP_MONST_PACK(m, def_monsyms[(int)mons[m].mlet].sym); + } + break; + + case 331: + +/* Line 1455 of yacc.c */ +#line 2134 "lev_comp.y" + { + if (check_monster_char((char) (yyvsp[(1) - (1)].i))) + (yyval.i) = SP_MONST_PACK(-1, (yyvsp[(1) - (1)].i)); + else { + lc_error("Unknown monster class '%c'!", (yyvsp[(1) - (1)].i)); + (yyval.i) = -1; + } + } + break; + + case 332: + +/* Line 1455 of yacc.c */ +#line 2143 "lev_comp.y" + { + long m = get_monster_id((yyvsp[(4) - (5)].map), (char) (yyvsp[(2) - (5)].i)); + if (m == ERR) { + lc_error("Unknown monster ('%c', \"%s\")!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].map)); + (yyval.i) = -1; + } else + (yyval.i) = SP_MONST_PACK(m, (yyvsp[(2) - (5)].i)); + } + break; + + case 333: + +/* Line 1455 of yacc.c */ +#line 2152 "lev_comp.y" + { + (yyval.i) = -1; + } + break; + + case 334: + +/* Line 1455 of yacc.c */ +#line 2158 "lev_comp.y" + { + add_opvars(splev, "O", (yyvsp[(1) - (1)].i)); + } + break; + + case 335: + +/* Line 1455 of yacc.c */ +#line 2162 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_OBJ); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + } + break; + + case 336: + +/* Line 1455 of yacc.c */ +#line 2169 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_OBJ|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); + } + break; + + case 337: + +/* Line 1455 of yacc.c */ +#line 2178 "lev_comp.y" + { + long m = get_object_id((yyvsp[(1) - (1)].map), (char)0); + if (m == ERR) { + lc_error("Unknown object \"%s\"!", (yyvsp[(1) - (1)].map)); + (yyval.i) = -1; + } else + (yyval.i) = SP_OBJ_PACK(m, 1); /* obj class != 0 to force generation of a specific item */ + + } + break; + + case 338: + +/* Line 1455 of yacc.c */ +#line 2188 "lev_comp.y" + { + if (check_object_char((char) (yyvsp[(1) - (1)].i))) + (yyval.i) = SP_OBJ_PACK(-1, (yyvsp[(1) - (1)].i)); else { - yyerror("Unknown monster class!"); - yyval.i = ERR; + lc_error("Unknown object class '%c'!", (yyvsp[(1) - (1)].i)); + (yyval.i) = -1; } } -break; -case 214: -{ - char c = yyvsp[0].i; - if (check_object_char(c)) - yyval.i = c; - else { - yyerror("Unknown char class!"); - yyval.i = ERR; - } + break; + + case 339: + +/* Line 1455 of yacc.c */ +#line 2197 "lev_comp.y" + { + long m = get_object_id((yyvsp[(4) - (5)].map), (char) (yyvsp[(2) - (5)].i)); + if (m == ERR) { + lc_error("Unknown object ('%c', \"%s\")!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].map)); + (yyval.i) = -1; + } else + (yyval.i) = SP_OBJ_PACK(m, (yyvsp[(2) - (5)].i)); } -break; -case 218: -{ - yyval.i = 100; /* default is 100% */ + break; + + case 340: + +/* Line 1455 of yacc.c */ +#line 2206 "lev_comp.y" + { + (yyval.i) = -1; } -break; -case 219: -{ - if (yyvsp[0].i <= 0 || yyvsp[0].i > 100) - yyerror("Expected percentile chance."); - yyval.i = yyvsp[0].i; + break; + + case 341: + +/* Line 1455 of yacc.c */ +#line 2212 "lev_comp.y" + { } + break; + + case 342: + +/* Line 1455 of yacc.c */ +#line 2214 "lev_comp.y" + { + add_opvars(splev, "o", SPO_MATH_ADD); } -break; -case 222: -{ - if (!in_room && !init_lev.init_present && - (yyvsp[-3].i < 0 || yyvsp[-3].i > (int)max_x_map || - yyvsp[-1].i < 0 || yyvsp[-1].i > (int)max_y_map)) - yyerror("Coordinates out of map range!"); - current_coord.x = yyvsp[-3].i; - current_coord.y = yyvsp[-1].i; + break; + + case 343: + +/* Line 1455 of yacc.c */ +#line 2219 "lev_comp.y" + { add_opvars(splev, "i", (yyvsp[(1) - (1)].i) ); } + break; + + case 344: + +/* Line 1455 of yacc.c */ +#line 2220 "lev_comp.y" + { is_inconstant_number = 1; } + break; + + case 345: + +/* Line 1455 of yacc.c */ +#line 2221 "lev_comp.y" + { add_opvars(splev, "i", (yyvsp[(2) - (3)].i) ); } + break; + + case 346: + +/* Line 1455 of yacc.c */ +#line 2223 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_INT); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + is_inconstant_number = 1; } -break; -case 223: -{ + break; + + case 347: + +/* Line 1455 of yacc.c */ +#line 2231 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_INT|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); + is_inconstant_number = 1; + } + break; + + case 348: + +/* Line 1455 of yacc.c */ +#line 2238 "lev_comp.y" + { add_opvars(splev, "o", SPO_MATH_ADD); } + break; + + case 349: + +/* Line 1455 of yacc.c */ +#line 2239 "lev_comp.y" + { add_opvars(splev, "o", SPO_MATH_SUB); } + break; + + case 350: + +/* Line 1455 of yacc.c */ +#line 2240 "lev_comp.y" + { add_opvars(splev, "o", SPO_MATH_MUL); } + break; + + case 351: + +/* Line 1455 of yacc.c */ +#line 2241 "lev_comp.y" + { add_opvars(splev, "o", SPO_MATH_DIV); } + break; + + case 352: + +/* Line 1455 of yacc.c */ +#line 2242 "lev_comp.y" + { add_opvars(splev, "o", SPO_MATH_MOD); } + break; + + case 353: + +/* Line 1455 of yacc.c */ +#line 2243 "lev_comp.y" + { } + break; + + case 354: + +/* Line 1455 of yacc.c */ +#line 2247 "lev_comp.y" + { + if (!strcmp("int", (yyvsp[(1) - (1)].map)) || !strcmp("integer", (yyvsp[(1) - (1)].map))) { + (yyval.i) = (int)'i'; + } else lc_error("Unknown function parameter type '%s'", (yyvsp[(1) - (1)].map)); + } + break; + + case 355: + +/* Line 1455 of yacc.c */ +#line 2253 "lev_comp.y" + { + if (!strcmp("str", (yyvsp[(1) - (1)].map)) || !strcmp("string", (yyvsp[(1) - (1)].map))) { + (yyval.i) = (int)'s'; + } else lc_error("Unknown function parameter type '%s'", (yyvsp[(1) - (1)].map)); + } + break; + + case 356: + +/* Line 1455 of yacc.c */ +#line 2261 "lev_comp.y" + { + struct lc_funcdefs_parm *tmp = New(struct lc_funcdefs_parm); + + if (!curr_function) + lc_error("Function parameters outside function definition."); + else if (!tmp) + lc_error("Could not alloc function params."); + else { + tmp->name = strdup((yyvsp[(1) - (3)].map)); + tmp->parmtype = (char) (yyvsp[(3) - (3)].i); + tmp->next = curr_function->params; + curr_function->params = tmp; + curr_function->n_params++; + { + long vt; + switch (tmp->parmtype) { + case 'i': vt = SPOVAR_INT; break; + case 's': vt = SPOVAR_STRING; break; + default: lc_error("Unknown func param conversion."); break; + } + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), vt); + } + } + Free((yyvsp[(1) - (3)].map)); + } + break; + + case 361: + +/* Line 1455 of yacc.c */ +#line 2298 "lev_comp.y" + { + (yyval.i) = (int)'i'; + } + break; + + case 362: + +/* Line 1455 of yacc.c */ +#line 2302 "lev_comp.y" + { + (yyval.i) = (int)'s'; + } + break; + + case 363: + +/* Line 1455 of yacc.c */ +#line 2309 "lev_comp.y" + { + char tmpbuf[2]; + tmpbuf[0] = (char) (yyvsp[(1) - (1)].i); + tmpbuf[1] = '\0'; + (yyval.map) = strdup(tmpbuf); + } + break; + + case 364: + +/* Line 1455 of yacc.c */ +#line 2316 "lev_comp.y" + { + long len = strlen( (yyvsp[(1) - (3)].map) ); + char *tmp = (char *)alloc(len + 2); + sprintf(tmp, "%c%s", (char) (yyvsp[(3) - (3)].i), (yyvsp[(1) - (3)].map) ); + Free( (yyvsp[(1) - (3)].map) ); + (yyval.map) = tmp; + } + break; + + case 365: + +/* Line 1455 of yacc.c */ +#line 2326 "lev_comp.y" + { + (yyval.map) = strdup(""); + } + break; + + case 366: + +/* Line 1455 of yacc.c */ +#line 2330 "lev_comp.y" + { + char *tmp = strdup( (yyvsp[(1) - (1)].map) ); + Free( (yyvsp[(1) - (1)].map) ); + (yyval.map) = tmp; + } + break; + + case 367: + +/* Line 1455 of yacc.c */ +#line 2338 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_POINT); + } + break; + + case 368: + +/* Line 1455 of yacc.c */ +#line 2342 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_RECT); + } + break; + + case 369: + +/* Line 1455 of yacc.c */ +#line 2346 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_FILLRECT); + } + break; + + case 370: + +/* Line 1455 of yacc.c */ +#line 2350 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_LINE); + } + break; + + case 371: + +/* Line 1455 of yacc.c */ +#line 2354 "lev_comp.y" + { + /* randline (x1,y1),(x2,y2), roughness */ + add_opvars(splev, "o", SPO_SEL_RNDLINE); + } + break; + + case 372: + +/* Line 1455 of yacc.c */ +#line 2359 "lev_comp.y" + { + add_opvars(splev, "io", W_ANY, SPO_SEL_GROW); + } + break; + + case 373: + +/* Line 1455 of yacc.c */ +#line 2363 "lev_comp.y" + { + add_opvars(splev, "io", (yyvsp[(3) - (6)].i), SPO_SEL_GROW); + } + break; + + case 374: + +/* Line 1455 of yacc.c */ +#line 2367 "lev_comp.y" + { + add_opvars(splev, "iio", (yyvsp[(3) - (6)].i), SPOFILTER_PERCENT, SPO_SEL_FILTER); + } + break; + + case 375: + +/* Line 1455 of yacc.c */ +#line 2371 "lev_comp.y" + { + add_opvars(splev, "io", SPOFILTER_SELECTION, SPO_SEL_FILTER); + } + break; + + case 376: + +/* Line 1455 of yacc.c */ +#line 2375 "lev_comp.y" + { + add_opvars(splev, "io", SPOFILTER_MAPCHAR, SPO_SEL_FILTER); + } + break; + + case 377: + +/* Line 1455 of yacc.c */ +#line 2379 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_FLOOD); + } + break; + + case 378: + +/* Line 1455 of yacc.c */ +#line 2383 "lev_comp.y" + { + add_opvars(splev, "oio", SPO_COPY, 1, SPO_SEL_ELLIPSE); + } + break; + + case 379: + +/* Line 1455 of yacc.c */ +#line 2387 "lev_comp.y" + { + add_opvars(splev, "oio", SPO_COPY, (yyvsp[(7) - (8)].i), SPO_SEL_ELLIPSE); + } + break; + + case 380: + +/* Line 1455 of yacc.c */ +#line 2391 "lev_comp.y" + { + add_opvars(splev, "io", 1, SPO_SEL_ELLIPSE); + } + break; + + case 381: + +/* Line 1455 of yacc.c */ +#line 2395 "lev_comp.y" + { + add_opvars(splev, "io", (yyvsp[(9) - (10)].i), SPO_SEL_ELLIPSE); + } + break; + + case 382: + +/* Line 1455 of yacc.c */ +#line 2399 "lev_comp.y" + { + add_opvars(splev, "iio", (yyvsp[(9) - (14)].i), (yyvsp[(3) - (14)].i), SPO_SEL_GRADIENT); + } + break; + + case 383: + +/* Line 1455 of yacc.c */ +#line 2403 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_COMPLEMENT); + } + break; + + case 384: + +/* Line 1455 of yacc.c */ +#line 2407 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_SEL); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + } + break; + + case 385: + +/* Line 1455 of yacc.c */ +#line 2414 "lev_comp.y" + { + /* nothing */ + } + break; + + case 386: + +/* Line 1455 of yacc.c */ +#line 2420 "lev_comp.y" + { + /* nothing */ + } + break; + + case 387: + +/* Line 1455 of yacc.c */ +#line 2424 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_ADD); + } + break; + + case 388: + +/* Line 1455 of yacc.c */ +#line 2430 "lev_comp.y" + { + add_opvars(splev, "iio", (yyvsp[(1) - (1)].dice).num, (yyvsp[(1) - (1)].dice).die, SPO_DICE); + } + break; + + case 392: + +/* Line 1455 of yacc.c */ +#line 2441 "lev_comp.y" + { + add_opvars(splev, "i", (yyvsp[(1) - (1)].i) ); + } + break; + + case 393: + +/* Line 1455 of yacc.c */ +#line 2445 "lev_comp.y" + { + add_opvars(splev, "i", (yyvsp[(1) - (1)].i) ); + } + break; + + case 394: + +/* Line 1455 of yacc.c */ +#line 2449 "lev_comp.y" + { + add_opvars(splev, "i", (yyvsp[(1) - (1)].i) ); + } + break; + + case 395: + +/* Line 1455 of yacc.c */ +#line 2453 "lev_comp.y" + { + /* nothing */ + } + break; + + case 404: + +/* Line 1455 of yacc.c */ +#line 2475 "lev_comp.y" + { + (yyval.lregn) = (yyvsp[(1) - (1)].lregn); + } + break; + + case 405: + +/* Line 1455 of yacc.c */ +#line 2479 "lev_comp.y" + { + if ((yyvsp[(3) - (10)].i) <= 0 || (yyvsp[(3) - (10)].i) >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x1)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); + else if ((yyvsp[(5) - (10)].i) < 0 || (yyvsp[(5) - (10)].i) >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y1)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); + else if ((yyvsp[(7) - (10)].i) <= 0 || (yyvsp[(7) - (10)].i) >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x2)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); + else if ((yyvsp[(9) - (10)].i) < 0 || (yyvsp[(9) - (10)].i) >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y2)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); + (yyval.lregn).x1 = (yyvsp[(3) - (10)].i); + (yyval.lregn).y1 = (yyvsp[(5) - (10)].i); + (yyval.lregn).x2 = (yyvsp[(7) - (10)].i); + (yyval.lregn).y2 = (yyvsp[(9) - (10)].i); + (yyval.lregn).area = 1; + } + break; + + case 406: + +/* Line 1455 of yacc.c */ +#line 2497 "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) - yyerror("Region out of map range!"); - else if (yyvsp[-5].i < 0 || yyvsp[-5].i > (int)max_y_map) - yyerror("Region out of map range!"); - else if (yyvsp[-3].i < 0 || yyvsp[-3].i > (int)max_x_map) - yyerror("Region out of map range!"); - else if (yyvsp[-1].i < 0 || yyvsp[-1].i > (int)max_y_map) - yyerror("Region out of map range!"); - current_region.x1 = yyvsp[-7].i; - current_region.y1 = yyvsp[-5].i; - current_region.x2 = yyvsp[-3].i; - current_region.y2 = yyvsp[-1].i; + if ((yyvsp[(2) - (9)].i) < 0 || (yyvsp[(2) - (9)].i) > (int)max_x_map) + lc_error("Region (%li,%li,%li,%li) out of map range (x1)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + else if ((yyvsp[(4) - (9)].i) < 0 || (yyvsp[(4) - (9)].i) > (int)max_y_map) + lc_error("Region (%li,%li,%li,%li) out of map range (y1)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + else if ((yyvsp[(6) - (9)].i) < 0 || (yyvsp[(6) - (9)].i) > (int)max_x_map) + lc_error("Region (%li,%li,%li,%li) out of map range (x2)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + else if ((yyvsp[(8) - (9)].i) < 0 || (yyvsp[(8) - (9)].i) > (int)max_y_map) + lc_error("Region (%li,%li,%li,%li) out of map range (y2)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + (yyval.lregn).area = 0; + (yyval.lregn).x1 = (yyvsp[(2) - (9)].i); + (yyval.lregn).y1 = (yyvsp[(4) - (9)].i); + (yyval.lregn).x2 = (yyvsp[(6) - (9)].i); + (yyval.lregn).y2 = (yyvsp[(8) - (9)].i); } -break; + break; + + + +/* Line 1455 of yacc.c */ +#line 6040 "y.tab.c" + default: break; } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } #endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; } - if ((yyn = yygindex[yym]) != 0 && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) + + + + if (yyerrstatus == 3) { - goto yyoverflow; + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if !defined(yyoverflow) || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } + + + +/* Line 1675 of yacc.c */ +#line 2517 "lev_comp.y" + + +/*lev_comp.y*/ + diff --git a/util/lev_main.c b/util/lev_main.c index 1045bdf34..ce31bb0c8 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -697,7 +697,7 @@ funcdef_defined(f, name, casesense) if (casesense) { if (!strcmp(name, f->name)) return f; } else { - if (!strcasecmp(name, f->name)) return f; + if (!strcmpi(name, f->name)) return f; } f = f->next; } @@ -748,7 +748,7 @@ vardef_defined(f, name, casesense) if (casesense) { if (!strcmp(name, f->name)) return f; } else { - if (!strcasecmp(name, f->name)) return f; + if (!strcmpi(name, f->name)) return f; } f = f->next; } @@ -988,7 +988,7 @@ char c; /* didn't find it; lets try case insensitive search */ for (i = LOW_PM; i < NUMMONS; i++) if (!class || class == mons[i].mlet) - if (!strcasecmp(s, mons[i].mname)) { + if (!strcmpi(s, mons[i].mname)) { if (be_verbose) lc_warning("Monster type \"%s\" matches \"%s\".", s, mons[i].mname); return i; @@ -1020,7 +1020,7 @@ char c; /* class */ for (i = class ? bases[class] : 0; i < NUM_OBJECTS; i++) { if (class && objects[i].oc_class != class) break; objname = obj_descr[i].oc_name; - if (objname && !strcasecmp(s, objname)) { + if (objname && !strcmpi(s, objname)) { if (be_verbose) lc_warning("Object type \"%s\" matches \"%s\".", s, objname); return i; diff --git a/win/win32/levstuff.mak b/win/win32/levstuff.mak index cf749c6ce..2a01e3f1e 100644 --- a/win/win32/levstuff.mak +++ b/win/win32/levstuff.mak @@ -1,26 +1,20 @@ -# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ -# $Date:2002/01/22 22:54:54 $ $Revision: 1.2 $ -#YACC = byacc.exe -#LEX = flex.exe -#YTABC = y_tab.c -#YTABH = y_tab.h -#LEXYYC = lexyy.c - -!IF "$(YACC)"!="" -@echo Yacc-alike set to $(YACC) -@echo YTABC set to $(YTABC) -@echo YTABH set to $(YTABH) -!ENDIF - -!IF "$(LEX)"!="" -@echo Lex-alike set to $(LEX) -@echo LEXYYC set to $(LEXYYC) -!ENDIF +# Uncomment as appropriate for your form of YACC/LEX. +# +#YACC = yacc.exe +#YACC = byacc.exe +YACC = bison.exe -y +# +#LEX = lex.exe +LEX = flex.exe +# these won't have an impact unless YACC/LEX are defined +YTABC = y.tab.c +YTABH = y.tab.h +LEXYYC = lex.yy.c default: all -all: ..\util\lev_yacc.c ..\util\lev_lex.c +all: tools ..\util\lev_yacc.c ..\util\lev_lex.c rebuild: clean all @@ -29,15 +23,29 @@ clean: -del ..\util\lev_yacc.c -del ..\include\lev_comp.h +tools: +!IFDEF YACC + @echo Yacc-alike set to $(YACC) + @echo YTABC set to $(YTABC) + @echo YTABH set to $(YTABH) +!ENDIF + +!IFDEF LEX + @echo Lex-alike set to $(LEX) + @echo LEXYYC set to $(LEXYYC) +!ENDIF + #========================================== # Level Compiler Stuff #========================================== + ..\util\lev_yacc.c ..\include\lev_comp.h: ..\util\lev_comp.y -!IF "$(YACC)"=="" +!IFNDEF YACC @echo Using pre-built lev_yacc.c and lev_comp.h @copy ..\sys\share\lev_yacc.c ..\util\lev_yacc.c @copy ..\sys\share\lev_comp.h ..\include\lev_comp.h !ELSE + @echo Generating lev_yacc.c and lev_comp.h chdir ..\util $(YACC) -d lev_comp.y copy $(YTABC) $@ @@ -48,10 +56,11 @@ clean: !ENDIF ..\util\lev_lex.c: ..\util\lev_comp.l -!IF "$(LEX)"=="" +!IFNDEF LEX @echo Using pre-built lev_lex.c @copy ..\sys\share\lev_lex.c $@ !ELSE + @echo Generating lev_lex.c chdir ..\util $(LEX) lev_comp.l copy $(LEXYYC) $@