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 e9038a200..151026ff1 100644 --- a/dat/mines.des +++ b/dat/mines.des @@ -48,99 +48,141 @@ TRAP: random, random TRAP: random, random +# A tragic accident has occurred in Frontier Town.... +# # Minetown variant 1 -# "Frontier Town" +# Orcish Town - a variant of Frontier Town that has been +# overrun by orcs. Note the barricades (iron bars). # LEVEL: "minetn-1" +FLAGS:mazelevel +INIT_MAP:mines,'.',' ',true,true,random,true +GEOMETRY:center,center +MAP +..................................... +.----------------F------------------. +.|.................................|. +.|.-------------......------------.|. +.|.|...|...|...|......|..|...|...|.|. +.F.|...|...|...|......|..|...|...|.|. +.|.|...|...|...|......|..|...|...|.F. +.|.|...|...|----......------------.|. +.|.---------.......................|. +.|.................................|. +.|.---------.....--...--...........|. +.|.|...|...|----.|.....|.---------.|. +.|.|...|...|...|.|.....|.|..|....|.|. +.|.|...|...|...|.|.....|.|..|....|.|. +.|.|...|...|...|.|.....|.|..|....|.|. +.|.-------------.-------.---------.|. +.|.................................F. +.-----------F------------F----------. +..................................... +ENDMAP -ROOM: "ordinary" , lit, (3,3), (center,center), (31,15) { -FOUNTAIN: (13, 7) -FOUNTAIN: (20, 7) +# Don't let the player fall into his likely death +TELEPORT_REGION:levregion(01,01,20,19),levregion(20,00,70,19) +REGION:(00,00,36,16),lit,"ordinary" +STAIR:levregion(01,03,20,19),(00,00,36,15),up +STAIR:levregion(61,03,75,19),(00,00,36,15),down -# The Town Watch -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watch captain"), random, peaceful +# shame we can't make polluted fountains +FOUNTAIN:(16,09) +FOUNTAIN:(25,09) -SUBROOM: "shop" [90%] , lit, (2,2), (3,4) { - ROOMDOOR: false, closed, south, random +# the altar's defiled; useful for BUC but never coaligned +ALTAR:(20,13),noalign,shrine + +# set up the shop doors; could be broken down +DOOR:random,(5,8) +DOOR:random,(9,8) +DOOR:random,(13,7) +DOOR:random,(22,5) +DOOR:random,(27,7) +DOOR:random,(31,7) +DOOR:random,(5,10) +DOOR:random,(9,10) +DOOR:random,(15,13) +DOOR:random,(25,13) +DOOR:random,(31,11) + +# knock a few holes in the shop interior walls +REPLACE_TERRAIN:(07,04,11,06),'|','.',18% +REPLACE_TERRAIN:(25,04,29,06),'|','.',18% +REPLACE_TERRAIN:(07,12,11,14),'|','.',18% +REPLACE_TERRAIN:(28,12,28,14),'|','.',33% + +# One spot each in most shops... +$place = { (05,04),(09,05),(13,04),(26,04),(31,05),(30,14),(05,14),(10,13),(26,14),(27,13) } +SHUFFLE:$place + +# scatter some bodies +OBJECT:('%',"corpse"),(20,12),montype:"aligned priest" +OBJECT:('%',"corpse"),$place[0],montype:"shopkeeper" +OBJECT:('%',"corpse"),$place[1],montype:"shopkeeper" +OBJECT:('%',"corpse"),$place[2],montype:"shopkeeper" +OBJECT:('%',"corpse"),$place[3],montype:"shopkeeper" +OBJECT:('%',"corpse"),$place[4],montype:"shopkeeper" +OBJECT:('%',"corpse"),random,montype:"watchman" +OBJECT:('%',"corpse"),random,montype:"watchman" +OBJECT:('%',"corpse"),random,montype:"watchman" +OBJECT:('%',"corpse"),random,montype:"watchman" +OBJECT:('%',"corpse"),random,montype:"watch captain" + +# Rubble! +LOOP [9 + 2d5] { + [90%]: OBJECT:('`',"boulder"),random + OBJECT:('*',"rock"),random } -SUBROOM: "tool shop" [90%], lit, (2,9), (3,4) { - ROOMDOOR: false, closed, north, random +# Guarantee 7 candles since we won't have Izchak available +OBJECT:('(',"wax candle"),$place[0],quantity:1d2 +OBJECT:('(',"wax candle"),$place[1],quantity:2d2 +OBJECT:('(',"wax candle"),$place[2],quantity:1d2 +OBJECT:('(',"tallow candle"),$place[3],quantity:1d3 +OBJECT:('(',"tallow candle"),$place[2],quantity:1d2 +OBJECT:('(',"tallow candle"),$place[0],quantity:1d2 + +# go ahead and leave a lamp next to one corpse to be suggestive +# and some empty wands... +OBJECT:('(',"oil lamp"),$place[2] +OBJECT:('/',"striking"),$place[1],uncursed,0 +OBJECT:('/',"striking"),$place[3],uncursed,0 +OBJECT:('/',"striking"),$place[4],uncursed,0 +OBJECT:('/',"magic missile"),$place[4],uncursed,0 +OBJECT:('/',"magic missile"),$place[0],uncursed,0 + +# the Orcish Army + +$inside = selection: floodfill(18,8) +$near_temple = selection: filter(fillrect(17,8, 23,14), $inside) + +LOOP [5 + 1d10] { + 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] { + MONSTER: ('o', "orc shaman"), rndcoord($near_temple), hostile +} +# these are not such a big deal +# to run into outside the bars +LOOP [9 + 2d5] { + IF [90%] { + MONSTER: ('o', "hill orc"), random, hostile + } ELSE { + MONSTER: ('o', "goblin"), random, hostile + } } -SUBROOM: "ordinary", unlit, (6,2), (3,4) { - ROOMDOOR: false, closed, south, random -} - -SUBROOM: "ordinary", lit, (6,9), (3,4) { - ROOMDOOR: false, closed, north, random -} - -SUBROOM: "food shop" [90%], lit, (10,2), (2,3) { - ROOMDOOR: false, closed, south, random -} - -SUBROOM: "candle shop", lit, (22,2), (3,3) { - ROOMDOOR: false, closed, south, random -} - -SUBROOM: "ordinary", unlit, (10,10), (2,3) { - ROOMDOOR: false, locked, east, random - MONSTER: ('G', "gnome"), random -} - -SUBROOM: "ordinary", lit, (19,2), (2,3) { - ROOMDOOR: false, locked, west, random - MONSTER: ('G', "gnome"), random -} - -SUBROOM: "temple", lit, (15,9), (4,4) { - ROOMDOOR: false, closed, north, random - ALTAR:(02,02),align[0],shrine - MONSTER: ('G', "gnomish wizard"), random - MONSTER: ('G', "gnomish wizard"), random -} - -SUBROOM: "ordinary", lit, (22,10), (2,3) { - ROOMDOOR: false, locked, west, random -} - -SUBROOM: "ordinary", lit, (26,2), (3,3) { - ROOMDOOR: false, closed, south, random - MONSTER: ('G', "gnome lord"), random -} - -SUBROOM: "ordinary", unlit, (25,10), (4,3) { - ROOMDOOR: false, closed, north, random -} - -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, up -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, down - TRAP: random, random - MONSTER: ('G', "gnome"), random - MONSTER: ('G', "gnome"), random -} - -ROOM: "ordinary" , random, random, random, random { - MONSTER: ('h', "dwarf"), random -} - -ROOM: "ordinary" , random, random, random, random { - TRAP: random, random - MONSTER: ('G', "gnome"), random -} - -RANDOM_CORRIDORS +WALLIFY # Minetown variant 2 diff --git a/include/ntconf.h b/include/ntconf.h index b51459151..3a02905e5 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -127,8 +127,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/include/obj.h b/include/obj.h index 7af927919..7ee0c4f91 100644 --- a/include/obj.h +++ b/include/obj.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 obj.h $NHDT-Date: 1426949157 2015/03/21 14:45:57 $ $NHDT-Branch: master $:$NHDT-Revision: 1.36 $ */ +/* NetHack 3.5 obj.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 obj.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.31 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/patchlevel.h b/include/patchlevel.h index eab90e89f..57bc6412d 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 patchlevel.h $NHDT-Date: 1426948844 2015/03/21 14:40:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.95 $ */ +/* NetHack 3.5 patchlevel.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 patchlevel.h $Date: 2012/04/14 08:31:03 $ $Revision: 1.93 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/sp_lev.c b/src/sp_lev.c index 8278a344b..6e42b2c31 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -3452,20 +3452,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/src/topten.c b/src/topten.c index b68ad1bce..83fe71737 100644 --- a/src/topten.c +++ b/src/topten.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 topten.c $NHDT-Date: 1426731079 2015/03/19 02:11:19 $ $NHDT-Branch: harder_d8 $:$NHDT-Revision: 1.25 $ */ +/* NetHack 3.5 topten.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 topten.c $Date: 2012/01/24 04:26:15 $ $Revision: 1.23 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/trap.c b/src/trap.c index 60022b955..8ad6ddd83 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 trap.c $NHDT-Date: 1426805491 2015/03/19 22:51:31 $ $NHDT-Branch: water_damage $:$NHDT-Revision: 1.198 $ */ +/* NetHack 3.5 trap.c $NHDT-Date: 1426558928 2015/03/17 02:22:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.195 $ */ /* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/lev_comp.h b/sys/share/lev_comp.h index 8152d608a..bdfa23854 100644 --- a/sys/share/lev_comp.h +++ b/sys/share/lev_comp.h @@ -1,79 +1,453 @@ -#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 3.0.2. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2013 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. */ + +#ifndef YY_YY_Y_TAB_H_INCLUDED +# define YY_YY_Y_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int yydebug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + 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 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { - int i; +#line 148 "lev_comp.y" /* yacc.c:1909 */ + + long i; char* map; struct { - xchar room; - xchar wall; - xchar door; + long room; + long wall; + long door; } corpos; -} YYSTYPE; + 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 443 "y.tab.h" /* yacc.c:1909 */ +}; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + extern YYSTYPE yylval; + +int yyparse (void); + +#endif /* !YY_YY_Y_TAB_H_INCLUDED */ diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c index 929d3b3b7..91f13e8f8 100644 --- a/sys/share/lev_lex.c +++ b/sys/share/lev_lex.c @@ -1,14 +1,112 @@ -/* A lexical scanner for NetHack 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) - */ -#define FLEXHACK_SCANNER +#line 3 "lex.yy.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 39 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif -#include "config.h" -#define yyconst const /* some code inserted by flex will refer to yyconst */ +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif /* Returned upon end-of-file. */ #define YY_NULL 0 @@ -24,55 +122,79 @@ * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ -#define BEGIN yy_start = 1 + 2 * +#define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ -#define YY_START ((yy_start - 1) / 2) +#define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) +#define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t yyleng; -extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 -/* Return all but the first 'n' matched characters back to the input stream. */ + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* 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_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - +#define unput(c) yyunput( c, (yytext_ptr) ) +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; @@ -88,7 +210,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -109,12 +231,16 @@ struct yy_buffer_state */ int yy_at_bol; + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; + #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process @@ -128,26 +254,38 @@ struct yy_buffer_state * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 - }; -static YY_BUFFER_STATE yy_current_buffer = 0; + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". + * + * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER yy_current_buffer +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* 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; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ +static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches @@ -155,152 +293,226 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void FDECL(yyrestart, (FILE *)); +void yyrestart (FILE *input_file ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); +void yy_delete_buffer (YY_BUFFER_STATE b ); +void yy_flush_buffer (YY_BUFFER_STATE b ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state (void ); -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)); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) +static void yyensure_buffer_stack (void ); +static void yy_load_buffer_state (void ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); -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)); +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); + +void *yyalloc (yy_size_t ); +void *yyrealloc (void *,yy_size_t ); +void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ typedef unsigned char YY_CHAR; + FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + typedef int yy_state_type; + +extern int yylineno; + +int yylineno = 1; + 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 (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; + (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 197 +#define YY_END_OF_BUFFER 198 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[1049] = { 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, 198, 196, 192, 191, 196, 196, + 196, 196, 196, 196, 195, 181, 189, 196, 190, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 196, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 192, 196, 195, 2, 196, 192, 196, 196, 195, 181, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 192, 196, 195, 192, 191, 185, + 0, 182, 183, 0, 0, 179, 195, 178, 180, 181, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 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, + 195, 187, 186, 184, 188, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 39, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 55, 195, 195, 0, 0, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 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, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 153, 195, 195, 192, 0, + 0, 3, 195, 2, 2, 0, 192, 0, 179, 195, + 178, 181, 195, 195, 195, 195, 195, 39, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 192, 0, 2, + 0, 0, 195, 194, 0, 194, 176, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 54, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, - 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, + 195, 195, 195, 0, 195, 103, 195, 83, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 79, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 81, 195, 195, 195, + 195, 138, 195, 195, 195, 195, 127, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 16, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 125, 195, - 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, + 195, 195, 195, 195, 195, 195, 195, 80, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 193, + 195, 195, 195, 58, 195, 195, 195, 22, 195, 40, + 195, 41, 195, 195, 195, 195, 49, 195, 195, 195, + 195, 56, 6, 195, 195, 195, 53, 195, 195, 195, + 36, 195, 195, 195, 195, 42, 195, 35, 195, 195, + 195, 195, 195, 21, 195, 0, 177, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 159, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 154, + 157, 113, 195, 195, 195, 195, 195, 195, 195, 195, - 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, + 195, 195, 195, 195, 69, 195, 195, 195, 195, 195, + 195, 195, 195, 120, 195, 195, 67, 195, 195, 195, + 195, 160, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 118, 195, 195, 195, 106, 195, 195, 195, 195, + 195, 195, 195, 65, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 156, 195, 195, 195, 195, 195, 115, 15, + 0, 195, 195, 195, 195, 195, 195, 2, 0, 28, + 195, 59, 195, 195, 195, 195, 195, 13, 195, 195, + 195, 50, 195, 195, 7, 195, 195, 195, 195, 5, - 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 + 195, 195, 195, 195, 195, 195, 195, 195, 195, 30, + 195, 195, 195, 195, 195, 119, 152, 195, 195, 195, + 146, 195, 195, 161, 195, 195, 195, 195, 195, 140, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 155, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 11, 195, 195, 195, 195, + 195, 195, 195, 112, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 124, 195, 12, 195, + 195, 195, 195, 195, 195, 195, 82, 114, 195, 195, + + 195, 195, 195, 195, 195, 195, 128, 195, 195, 195, + 195, 195, 33, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 29, 195, 195, 195, 195, 195, 195, 17, + 31, 195, 27, 195, 195, 195, 195, 57, 195, 195, + 195, 195, 145, 96, 195, 195, 126, 110, 86, 195, + 122, 72, 107, 195, 195, 195, 164, 195, 195, 87, + 195, 93, 129, 195, 74, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 134, 195, + 195, 108, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 109, 167, 195, 195, 16, 195, 195, 195, 195, + + 77, 195, 116, 195, 195, 195, 195, 195, 111, 195, + 195, 195, 151, 172, 195, 195, 78, 195, 195, 195, + 195, 195, 195, 195, 195, 1, 195, 57, 195, 195, + 195, 60, 195, 195, 195, 195, 195, 195, 195, 4, + 195, 19, 195, 195, 195, 195, 195, 62, 43, 195, + 46, 26, 195, 162, 98, 195, 195, 195, 195, 73, + 158, 195, 195, 97, 195, 195, 195, 92, 195, 195, + 195, 195, 144, 195, 195, 195, 195, 135, 195, 195, + 195, 195, 195, 20, 63, 139, 137, 195, 195, 195, + 195, 195, 195, 195, 117, 195, 131, 95, 195, 150, + + 195, 195, 195, 195, 195, 100, 47, 89, 195, 195, + 195, 195, 195, 26, 195, 45, 195, 195, 34, 61, + 14, 8, 25, 195, 195, 195, 195, 195, 23, 195, + 168, 195, 195, 195, 101, 195, 66, 195, 75, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 149, 9, 195, 195, 195, 195, 143, 195, 85, 68, + 195, 71, 195, 195, 195, 195, 175, 163, 130, 133, + 195, 105, 18, 195, 51, 195, 195, 195, 195, 195, + 195, 94, 141, 195, 195, 70, 173, 121, 195, 166, + 195, 174, 91, 132, 84, 147, 148, 170, 195, 195, + + 99, 171, 90, 195, 64, 195, 10, 136, 24, 52, + 195, 195, 195, 195, 195, 76, 88, 123, 104, 195, + 165, 102, 195, 195, 195, 195, 195, 195, 195, 195, + 37, 38, 195, 195, 195, 142, 169, 195, 195, 195, + 195, 195, 195, 195, 48, 32, 44, 0 } ; -static yyconst int yy_ec[256] = +static yyconst flex_int32_t yy_ec[256] = { 0, 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 +529,413 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[65] = +static yyconst flex_int32_t 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 flex_int16_t yy_base[1056] = { 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, 1287, 1288, 75, 1288, 1283, 1268, + 1277, 0, 1237, 1267, 1266, 78, 66, 1263, 1262, 1248, + 1241, 57, 63, 59, 64, 101, 0, 63, 79, 119, + 94, 1256, 1242, 128, 127, 126, 1255, 104, 109, 118, + 133, 94, 139, 151, 1207, 95, 132, 1209, 157, 164, + 154, 100, 166, 1202, 173, 175, 176, 56, 1217, 1216, + 239, 1265, 226, 1288, 1264, 252, 248, 258, 271, 157, + 162, 120, 248, 216, 274, 1251, 201, 249, 296, 140, + 306, 301, 176, 265, 346, 352, 369, 232, 1288, 1288, + 1258, 1288, 0, 1253, 1252, 1247, 0, 1246, 1288, 278, - 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, + 1245, 1288, 1288, 1288, 1288, 1221, 246, 1221, 234, 1233, + 1223, 1236, 1217, 1228, 1225, 1232, 260, 1218, 1216, 1218, + 1228, 0, 1219, 1223, 1204, 1210, 1198, 1204, 1208, 1207, + 1207, 246, 1209, 270, 1204, 301, 1202, 1195, 1201, 1213, + 1211, 1203, 306, 0, 1210, 1198, 347, 208, 301, 1154, + 1176, 1165, 1171, 1174, 317, 1154, 1158, 1154, 1157, 1156, + 1168, 1150, 1152, 338, 1148, 1142, 1139, 1144, 1143, 1149, + 1153, 1144, 1146, 1144, 1144, 300, 348, 280, 337, 1150, + 1132, 1135, 1143, 1128, 217, 345, 1147, 314, 26, 1135, + 1134, 1134, 1125, 360, 1135, 1139, 1125, 1141, 1136, 1139, - 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, + 356, 359, 1132, 1134, 1130, 1122, 372, 259, 325, 1114, + 1113, 1115, 1116, 366, 376, 0, 1113, 349, 435, 1175, + 1174, 1288, 397, 1288, 1288, 1173, 442, 446, 449, 1160, + 0, 423, 404, 424, 316, 439, 440, 1159, 305, 441, + 442, 444, 445, 447, 448, 170, 450, 484, 0, 1288, + 1170, 0, 456, 1288, 1161, 1160, 1155, 1150, 1136, 1148, + 1143, 1127, 1128, 1144, 1126, 1120, 1137, 1123, 1120, 1132, + 0, 1124, 1134, 1123, 1131, 1112, 1113, 1128, 1126, 1114, + 1124, 1109, 1122, 1107, 1120, 1123, 1093, 1117, 1109, 1100, + 1115, 1109, 1105, 1103, 1109, 1103, 1104, 1094, 1091, 1105, - 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, + 1091, 1092, 1095, 462, 1069, 0, 1074, 0, 1059, 1068, + 1058, 1060, 1051, 1055, 1053, 1047, 1055, 416, 1062, 1044, + 1048, 1059, 1042, 1048, 1043, 1052, 1038, 1042, 0, 1035, + 1034, 1044, 1034, 1047, 1031, 1048, 416, 1043, 1032, 427, + 1045, 1022, 1038, 1039, 1033, 1021, 0, 1036, 1030, 1033, + 1023, 0, 1016, 1017, 1025, 1028, 0, 1021, 1026, 1015, + 1027, 1017, 1022, 1021, 402, 1020, 1004, 1011, 1007, 1008, + 440, 1000, 1014, 1013, 1003, 1015, 1012, 1001, 999, 1003, + 1007, 426, 989, 1000, 1000, 1004, 985, 1002, 986, 989, + 997, 983, 438, 991, 979, 997, 983, 978, 0, 979, - 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, + 989, 972, 983, 976, 981, 969, 968, 0, 495, 487, + 481, 1004, 488, 490, 492, 493, 495, 496, 512, 1288, + 998, 1012, 1003, 0, 1012, 1003, 990, 0, 1008, 0, + 1008, 0, 989, 987, 986, 1000, 0, 999, 973, 997, + 989, 0, 977, 998, 980, 977, 0, 980, 490, 992, + 0, 993, 978, 977, 990, 986, 983, 0, 970, 972, + 983, 969, 983, 0, 974, 476, 1288, 938, 933, 932, + 944, 941, 942, 927, 941, 940, 928, 937, 936, 0, + 935, 934, 919, 925, 931, 926, 922, 912, 927, 0, + 0, 0, 915, 929, 924, 923, 915, 464, 921, 916, - 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, + 920, 914, 917, 902, 0, 955, 913, 892, 908, 900, + 896, 907, 908, 0, 907, 891, 0, 905, 908, 894, + 897, 0, 465, 887, 885, 879, 885, 893, 886, 899, + 884, 0, 890, 885, 893, 0, 883, 889, 892, 872, + 890, 458, 889, 0, 877, 866, 867, 871, 880, 864, + 878, 882, 878, 860, 865, 857, 873, 868, 857, 860, + 872, 856, 0, 853, 858, 860, 467, 859, 0, 1288, + 912, 507, 895, 516, 517, 521, 519, 1288, 910, 0, + 886, 0, 884, 888, 879, 872, 867, 0, 887, 878, + 866, 0, 872, 866, 0, 882, 875, 880, 875, 0, - 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 + 870, 877, 857, 864, 862, 860, 870, 857, 859, 0, + 855, 861, 853, 858, 860, 0, 0, 830, 818, 828, + 0, 827, 826, 0, 817, 815, 824, 815, 808, 0, + 820, 820, 816, 817, 802, 816, 800, 796, 485, 0, + 812, 812, 810, 796, 799, 806, 806, 785, 804, 478, + 796, 792, 794, 790, 795, 782, 798, 794, 795, 795, + 778, 778, 791, 777, 789, 0, 788, 776, 790, 783, + 771, 772, 786, 0, 781, 765, 759, 777, 766, 772, + 768, 770, 765, 759, 775, 770, 0, 759, 0, 752, + 752, 751, 750, 750, 763, 763, 491, 0, 761, 760, + + 755, 758, 743, 749, 746, 750, 0, 755, 771, 524, + 526, 532, 0, 772, 770, 764, 774, 773, 772, 765, + 761, 777, 0, 765, 771, 763, 756, 766, 750, 0, + 0, 720, 0, 88, 261, 336, 519, 0, 515, 523, + 514, 509, 0, 0, 507, 508, 0, 0, 0, 501, + 0, 0, 0, 500, 502, 511, 0, 512, 513, 0, + 501, 0, 0, 517, 0, 514, 513, 509, 523, 521, + 521, 518, 513, 515, 525, 516, 530, 521, 0, 525, + 531, 0, 515, 517, 535, 530, 518, 523, 537, 531, + 530, 0, 0, 533, 530, 0, 521, 527, 533, 530, + + 0, 537, 555, 546, 536, 551, 538, 544, 0, 540, + 550, 551, 0, 0, 552, 556, 0, 559, 550, 561, + 561, 562, 563, 549, 569, 0, 604, 605, 606, 599, + 587, 0, 602, 593, 594, 596, 586, 596, 602, 0, + 605, 0, 608, 597, 614, 588, 601, 0, 0, 600, + 0, 0, 579, 0, 0, 587, 588, 589, 591, 0, + 0, 581, 577, 0, 586, 579, 582, 0, 596, 596, + 589, 585, 0, 594, 595, 607, 594, 0, 592, 606, + 592, 609, 609, 0, 0, 0, 0, 606, 601, 612, + 606, 614, 595, 616, 1288, 617, 0, 0, 619, 0, + + 623, 610, 619, 615, 603, 0, 0, 0, 625, 626, + 627, 627, 621, 667, 647, 0, 659, 660, 0, 0, + 0, 0, 0, 642, 668, 647, 656, 652, 0, 643, + 0, 640, 641, 632, 0, 632, 0, 636, 0, 645, + 630, 643, 634, 652, 635, 650, 638, 643, 653, 641, + 0, 0, 648, 654, 644, 659, 0, 660, 0, 0, + 661, 0, 650, 653, 660, 657, 0, 0, 0, 0, + 666, 0, 0, 696, 0, 697, 701, 703, 687, 701, + 689, 0, 0, 658, 673, 0, 0, 0, 660, 0, + 669, 0, 0, 0, 0, 0, 0, 0, 668, 663, + + 0, 0, 0, 665, 0, 665, 0, 0, 0, 0, + 704, 705, 700, 701, 715, 0, 0, 0, 0, 686, + 0, 0, 687, 718, 712, 716, 708, 720, 694, 695, + 0, 0, 726, 730, 723, 0, 0, 718, 725, 720, + 718, 723, 724, 720, 0, 0, 0, 1288, 757, 759, + 765, 768, 774, 779, 784 } ; -static yyconst short int yy_def[648] = +static yyconst flex_int16_t yy_def[1056] = { 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, + 1048, 1, 1, 3, 1048, 1048, 1048, 1048, 1048, 1048, + 1049, 1050, 1051, 1048, 1052, 1052, 1048, 1048, 1048, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1048, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1048, 1053, 1052, 1048, 1048, 1054, 1054, 1054, 1052, 69, + 69, 69, 69, 1052, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 1054, 1053, 69, 1048, 1048, 1048, + 1049, 1048, 1050, 1048, 1055, 1048, 1052, 1052, 1048, 1052, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 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, + 1052, 1048, 1048, 1048, 1048, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1048, 1048, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 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, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1048, 1053, + 1053, 1048, 1052, 1048, 1048, 1048, 1054, 1054, 1054, 69, + 69, 69, 69, 69, 1052, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 1054, 86, 1048, + 1053, 86, 69, 1048, 1048, 1048, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 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, + 1052, 1052, 1052, 1048, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 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, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 69, + 69, 1052, 69, 69, 69, 69, 69, 69, 69, 1048, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1048, 1048, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, - 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, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1048, + 1048, 69, 1052, 69, 69, 69, 69, 1048, 1048, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 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 + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 69, + 69, 69, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 69, 69, 69, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1048, 1052, 1052, 1052, 1052, 1052, + + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 69, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 0, 1048, 1048, + 1048, 1048, 1048, 1048, 1048 } ; -static yyconst short int yy_nxt[865] = +static yyconst flex_int16_t yy_nxt[1363] = { 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, 362, 100, 116, 123, 111, 117, 124, 112, 363, - 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, + 846, 126, 131, 68, 69, 67, 70, 215, 148, 216, + 71, 72, 73, 119, 74, 75, 132, 76, 77, 101, + 76, 78, 79, 120, 230, 80, 121, 127, 81, 82, + 76, 128, 83, 178, 76, 129, 135, 67, 143, 195, + 136, 130, 138, 139, 230, 107, 166, 179, 144, 167, + 137, 145, 168, 196, 140, 141, 99, 142, 149, 84, + 150, 232, 134, 76, 151, 152, 230, 155, 153, 154, + 156, 159, 180, 157, 230, 160, 158, 169, 161, 162, + 230, 233, 163, 181, 247, 164, 417, 182, 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, 192, 174, 172, 184, 193, 175, 101, 185, + 176, 188, 189, 186, 197, 230, 194, 304, 198, 187, + 190, 201, 148, 206, 238, 202, 191, 207, 212, 203, + 208, 199, 123, 88, 204, 205, 88, 209, 213, 210, + 219, 214, 211, 219, 223, 113, 220, 235, 128, 1048, + 225, 226, 129, 88, 225, 226, 227, 115, 130, 1048, + 225, 226, 230, 230, 259, 262, 234, 239, 260, 263, + 353, 125, 229, 225, 226, 228, 286, 287, 228, 230, + 109, 126, 228, 230, 228, 231, 354, 99, 230, 230, + 230, 230, 100, 847, 230, 271, 230, 230, 272, 230, + + 230, 230, 289, 236, 230, 290, 117, 230, 230, 230, + 230, 230, 237, 230, 240, 230, 228, 212, 128, 230, + 230, 392, 241, 143, 393, 292, 278, 213, 130, 101, + 214, 242, 243, 144, 293, 300, 145, 412, 230, 343, + 268, 301, 230, 244, 245, 344, 246, 219, 225, 226, + 248, 147, 338, 249, 250, 251, 252, 305, 848, 252, + 306, 148, 339, 252, 252, 252, 252, 359, 307, 313, + 252, 252, 252, 314, 360, 252, 361, 252, 252, 315, + 252, 252, 252, 230, 394, 252, 324, 253, 252, 252, + 252, 128, 252, 395, 252, 241, 340, 252, 325, 326, + + 341, 130, 345, 346, 347, 355, 356, 380, 368, 382, + 342, 369, 357, 383, 400, 407, 408, 381, 230, 252, + 370, 371, 389, 252, 390, 372, 402, 373, 384, 403, + 409, 391, 99, 404, 401, 405, 219, 232, 230, 219, + 281, 410, 220, 88, 225, 226, 227, 1048, 225, 226, + 1048, 225, 226, 230, 230, 230, 230, 413, 230, 230, + 411, 230, 230, 229, 230, 415, 466, 416, 525, 526, + 230, 273, 479, 283, 101, 498, 296, 480, 502, 418, + 466, 543, 414, 499, 281, 219, 225, 226, 248, 419, + 531, 249, 532, 544, 555, 230, 503, 570, 571, 281, + + 556, 230, 230, 424, 230, 572, 230, 230, 467, 230, + 230, 601, 433, 574, 578, 579, 642, 682, 575, 664, + 683, 230, 467, 602, 665, 577, 230, 706, 460, 643, + 230, 230, 576, 230, 707, 230, 760, 771, 230, 710, + 230, 711, 580, 772, 815, 712, 230, 816, 761, 849, + 850, 828, 610, 827, 851, 829, 852, 853, 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, + + 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, + 906, 907, 908, 909, 910, 911, 912, 913, 230, 230, + 230, 915, 916, 917, 918, 919, 848, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, + 933, 934, 935, 936, 937, 938, 939, 940, 914, 941, + 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, + 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, + 972, 230, 973, 974, 975, 976, 977, 978, 979, 980, + 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, + + 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, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 91, 91, 91, + 91, 91, 91, 93, 93, 94, 94, 845, 94, 94, + 94, 97, 97, 97, 221, 221, 221, 221, 221, 221, + 228, 228, 228, 228, 255, 255, 844, 255, 255, 255, + 843, 842, 841, 840, 839, 838, 837, 836, 835, 834, + + 833, 832, 831, 830, 826, 825, 824, 823, 822, 821, + 820, 819, 818, 817, 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, 770, 769, 768, 767, + 766, 765, 764, 763, 762, 759, 758, 757, 756, 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, 578, 709, 570, 708, 705, 704, 703, 702, + 701, 700, 699, 698, 697, 696, 695, 694, 693, 692, + 691, 690, 689, 688, 687, 686, 685, 684, 681, 680, + 679, 678, 677, 676, 675, 674, 673, 672, 671, 670, + 669, 668, 667, 666, 663, 662, 661, 660, 659, 658, + 657, 656, 655, 654, 653, 652, 651, 650, 649, 648, + 647, 646, 645, 644, 641, 640, 639, 638, 637, 636, + 635, 634, 633, 632, 631, 630, 629, 628, 627, 626, + 625, 624, 623, 622, 621, 620, 619, 618, 617, 616, - 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, + 605, 604, 603, 600, 599, 598, 597, 596, 595, 594, + 593, 592, 591, 590, 589, 588, 587, 586, 585, 584, + 583, 582, 581, 580, 573, 569, 568, 567, 566, 565, + 564, 563, 562, 561, 560, 559, 558, 557, 554, 553, + 552, 551, 550, 549, 548, 547, 546, 545, 542, 541, + 540, 539, 538, 537, 536, 535, 534, 533, 530, 529, + 528, 527, 447, 524, 523, 522, 521, 520, 519, 518, + 517, 516, 515, 514, 513, 512, 511, 510, 509, 508, + 507, 506, 505, 504, 501, 500, 497, 496, 495, 494, - 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, + 493, 492, 491, 490, 489, 488, 487, 486, 485, 484, + 483, 482, 481, 478, 477, 476, 475, 474, 473, 472, + 471, 470, 469, 468, 465, 464, 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, 257, + 420, 420, 250, 230, 230, 225, 222, 222, 406, 399, + 398, 397, 396, 388, 387, 386, 385, 379, 378, 377, + 376, 375, 374, 367, 366, 365, 364, 358, 352, 351, - 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, + 350, 349, 348, 337, 336, 335, 334, 333, 332, 331, + 330, 329, 328, 327, 323, 322, 321, 320, 319, 318, + 317, 316, 312, 311, 310, 309, 308, 303, 302, 299, + 298, 297, 296, 295, 294, 291, 288, 285, 284, 283, + 282, 281, 280, 279, 278, 277, 276, 275, 274, 273, + 270, 269, 268, 267, 266, 265, 264, 261, 258, 257, + 98, 96, 256, 254, 92, 230, 224, 222, 218, 217, + 200, 183, 177, 146, 134, 133, 107, 106, 105, 104, + 98, 96, 95, 92, 90, 89, 1048, 5, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, - 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, - - 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, - - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642 + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048 } ; -static yyconst short int yy_chk[865] = +static yyconst flex_int16_t yy_chk[1363] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -585,109 +943,170 @@ 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, 189, 16, 25, 28, 23, 25, 29, 23, 189, - 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, + 734, 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, 80, 72, 42, 46, 36, 42, + 34, 36, 42, 52, 35, 35, 70, 35, 39, 3, + 39, 70, 80, 3, 39, 39, 71, 40, 39, 39, + 40, 41, 47, 40, 246, 41, 40, 43, 41, 41, + 83, 71, 41, 47, 83, 41, 246, 47, 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, 51, 44, 43, 49, 51, 44, 70, 49, + 44, 50, 50, 49, 53, 77, 51, 148, 53, 49, + 50, 55, 148, 56, 77, 55, 50, 56, 57, 55, + 56, 53, 77, 88, 55, 55, 88, 56, 57, 56, + 61, 57, 56, 61, 63, 74, 61, 74, 63, 67, + 67, 67, 63, 66, 66, 66, 66, 74, 63, 68, + 68, 68, 73, 78, 107, 109, 73, 78, 107, 109, + 185, 78, 68, 69, 69, 69, 132, 132, 69, 84, + 73, 78, 69, 69, 69, 69, 185, 100, 75, 69, + 69, 69, 100, 735, 69, 117, 69, 69, 117, 69, - 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, 134, 75, 69, 134, 75, 69, 69, 69, + 79, 69, 75, 69, 79, 82, 69, 84, 79, 239, + 81, 208, 79, 82, 208, 136, 239, 84, 79, 100, + 84, 81, 81, 82, 136, 143, 82, 235, 69, 178, + 235, 143, 69, 81, 81, 178, 81, 85, 85, 85, + 85, 147, 176, 85, 86, 86, 86, 149, 736, 86, + 149, 147, 176, 86, 86, 86, 86, 188, 149, 155, + 86, 86, 86, 155, 188, 86, 188, 86, 86, 155, + 86, 86, 86, 87, 209, 86, 164, 87, 86, 86, + 86, 87, 86, 209, 86, 87, 177, 86, 164, 164, - 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, + 177, 87, 179, 179, 179, 186, 186, 201, 194, 202, + 177, 194, 186, 202, 214, 218, 218, 201, 233, 86, + 194, 194, 207, 86, 207, 194, 215, 194, 202, 215, + 223, 207, 232, 215, 214, 215, 219, 232, 234, 219, + 223, 233, 219, 227, 227, 227, 227, 228, 228, 228, + 229, 229, 229, 236, 237, 240, 241, 236, 242, 243, + 234, 244, 245, 229, 247, 244, 304, 245, 365, 365, + 253, 237, 318, 241, 232, 337, 243, 318, 340, 247, + 466, 382, 242, 337, 240, 248, 248, 248, 248, 253, + 371, 248, 371, 382, 393, 411, 340, 409, 409, 253, - 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, + 393, 410, 413, 411, 414, 410, 415, 416, 304, 417, + 418, 449, 413, 414, 419, 419, 498, 542, 415, 523, + 542, 572, 466, 449, 523, 418, 419, 567, 416, 498, + 574, 575, 417, 577, 567, 576, 639, 650, 710, 574, + 711, 576, 572, 650, 697, 577, 712, 697, 639, 737, + 739, 711, 575, 710, 740, 712, 741, 742, 745, 746, + 750, 754, 755, 756, 758, 759, 761, 764, 766, 767, + 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, + 778, 780, 781, 783, 784, 785, 786, 787, 788, 789, + 790, 791, 794, 795, 797, 798, 799, 800, 802, 803, - 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, + 804, 805, 806, 807, 808, 810, 811, 812, 815, 816, + 818, 819, 820, 821, 822, 823, 824, 825, 827, 828, + 829, 830, 831, 833, 834, 835, 827, 836, 837, 838, + 839, 841, 843, 844, 845, 846, 847, 850, 853, 856, + 857, 858, 859, 862, 863, 865, 866, 867, 829, 869, + 870, 871, 872, 874, 875, 876, 877, 879, 880, 881, + 882, 883, 888, 889, 890, 891, 892, 893, 894, 896, + 899, 901, 902, 903, 904, 905, 909, 910, 911, 912, + 913, 914, 915, 917, 918, 924, 925, 926, 927, 928, + 930, 932, 933, 934, 936, 938, 940, 941, 942, 943, - 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, + 944, 945, 946, 947, 948, 949, 950, 953, 954, 955, + 956, 958, 961, 963, 964, 965, 966, 971, 974, 976, + 977, 978, 979, 980, 981, 984, 985, 989, 991, 999, + 1000, 1004, 1006, 1011, 1012, 1013, 1014, 1015, 1020, 1023, + 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1033, 1034, 1035, + 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1049, 1049, 1049, + 1049, 1049, 1049, 1050, 1050, 1051, 1051, 732, 1051, 1051, + 1051, 1052, 1052, 1052, 1053, 1053, 1053, 1053, 1053, 1053, + 1054, 1054, 1054, 1054, 1055, 1055, 729, 1055, 1055, 1055, + 728, 727, 726, 725, 724, 722, 721, 720, 719, 718, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642 + 717, 716, 715, 714, 709, 708, 706, 705, 704, 703, + 702, 701, 700, 699, 696, 695, 694, 693, 692, 691, + 690, 688, 686, 685, 684, 683, 682, 681, 680, 679, + 678, 677, 676, 675, 673, 672, 671, 670, 669, 668, + 667, 665, 664, 663, 662, 661, 660, 659, 658, 657, + 656, 655, 654, 653, 652, 651, 649, 648, 647, 646, + 645, 644, 643, 642, 641, 638, 637, 636, 635, 634, + 633, 632, 631, 629, 628, 627, 626, 625, 623, 622, + 620, 619, 618, 615, 614, 613, 612, 611, 609, 608, + 607, 606, 605, 604, 603, 602, 601, 599, 598, 597, + + 596, 594, 593, 591, 590, 589, 587, 586, 585, 584, + 583, 581, 579, 573, 571, 568, 566, 565, 564, 562, + 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, + 551, 550, 549, 548, 547, 546, 545, 543, 541, 540, + 539, 538, 537, 535, 534, 533, 531, 530, 529, 528, + 527, 526, 525, 524, 521, 520, 519, 518, 516, 515, + 513, 512, 511, 510, 509, 508, 507, 506, 504, 503, + 502, 501, 500, 499, 497, 496, 495, 494, 493, 489, + 488, 487, 486, 485, 484, 483, 482, 481, 479, 478, + 477, 476, 475, 474, 473, 472, 471, 470, 469, 468, + + 465, 463, 462, 461, 460, 459, 457, 456, 455, 454, + 453, 452, 450, 448, 446, 445, 444, 443, 441, 440, + 439, 438, 436, 435, 434, 433, 431, 429, 427, 426, + 425, 423, 422, 421, 412, 407, 406, 405, 404, 403, + 402, 401, 400, 398, 397, 396, 395, 394, 392, 391, + 390, 389, 388, 387, 386, 385, 384, 383, 381, 380, + 379, 378, 377, 376, 375, 374, 373, 372, 370, 369, + 368, 367, 366, 364, 363, 362, 361, 360, 359, 358, + 356, 355, 354, 353, 351, 350, 349, 348, 346, 345, + 344, 343, 342, 341, 339, 338, 336, 335, 334, 333, + + 332, 331, 330, 328, 327, 326, 325, 324, 323, 322, + 321, 320, 319, 317, 316, 315, 314, 313, 312, 311, + 310, 309, 307, 305, 303, 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, 270, 269, 268, 267, + 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, + 256, 255, 251, 238, 230, 226, 221, 220, 217, 213, + 212, 211, 210, 206, 205, 204, 203, 200, 199, 198, + 197, 196, 195, 193, 192, 191, 190, 187, 184, 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, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; +extern int yy_flex_debug; +int yy_flex_debug = 0; + /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #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; -#define INITIAL 0 -/* NetHack 3.5 lev_comp.l $Date: 2009/05/11 22:53:51 $ $Revision: 1.12 $ */ +#line 1 "lev_comp.l" +#line 2 "lev_comp.l" +/* NetHack 3.5 lev_comp.l $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_comp.l $Date: 2009/05/06 10:54:31 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)lev_lex.c 3.5 2002/03/27 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -753,51 +1172,133 @@ 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); + + +#line 1207 "lex.yy.c" + +#define INITIAL 0 #define MAPC 1 +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (void ); + +int yyget_debug (void ); + +void yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE yyget_extra (void ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in (void ); + +void yyset_in (FILE * in_str ); + +FILE *yyget_out (void ); + +void yyset_out (FILE * out_str ); + +yy_size_t yyget_leng (void ); + +char *yyget_text (void ); + +int yyget_lineno (void ); + +void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP -extern int NDECL(yywrap); -#endif - -#ifndef YY_NO_UNPUT -static void FDECL(yyunput, (int,char *)); +#ifdef __cplusplus +extern "C" int yywrap (void ); +#else +extern int yywrap (void ); +#endif #endif + static void yyunput (int c,char *buf_ptr ); + #ifndef yytext_ptr -static void FDECL(yy_flex_strncpy, (char *,const char *,int)); +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT -static int NDECL(input); + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ - #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -805,9 +1306,10 @@ static int NDECL(input); */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ - int c = '*', n; \ + int c = '*'; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -817,9 +1319,22 @@ static int NDECL(input); YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -840,6 +1355,19 @@ static int NDECL(input); #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (void); + +#define YY_DECL int yylex (void) +#endif /* !YY_DECL */ + /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ @@ -854,29 +1382,28 @@ static int NDECL(input); #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION -int NDECL(yylex); -int yylex() - { +/** The main scanner function which does all the work. + */ +YY_DECL +{ register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - - - - if ( yy_init ) + + if ( !(yy_init) ) { - yy_init = 0; + (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif - if ( ! yy_start ) - yy_start = 1; /* first start state */ + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; @@ -884,74 +1411,81 @@ int yylex() if ( ! yyout ) yyout = stdout; - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); } + yy_load_buffer_state( ); + } + + { +#line 104 "lev_comp.l" + +#line 1427 "lex.yy.c" + while ( 1 ) /* loops until end-of-file is reached */ { - yy_cp = yy_c_buf_p; + yy_cp = (yy_c_buf_p); /* Support of yytext. */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; - yy_current_state = yy_start; + yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } 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 >= 1049 ) 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] != 1288 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; - do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP +#line 105 "lev_comp.l" { + savetoken(yytext); BEGIN(INITIAL); yylval.map = (char *) alloc(map_cnt + 1); (void) strncpy(yylval.map, map, map_cnt); @@ -961,465 +1495,1020 @@ YY_RULE_SETUP } YY_BREAK case 2: +/* rule 2 can match eol */ YY_RULE_SETUP +#line 114 "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: +/* rule 3 can match eol */ YY_RULE_SETUP -{ nh_line_number++; } +#line 125 "lev_comp.l" +{ savetoken(yytext); newline(); } YY_BREAK case 4: YY_RULE_SETUP -{ colon_line_number = nh_line_number; return ':'; } +#line 126 "lev_comp.l" +ST_RET(MESSAGE_ID); YY_BREAK case 5: YY_RULE_SETUP -return MESSAGE_ID; +#line 127 "lev_comp.l" +ST_RET(NOMAP_ID); YY_BREAK case 6: YY_RULE_SETUP -return MAZE_ID; +#line 128 "lev_comp.l" +ST_RET(MAZE_ID); YY_BREAK case 7: YY_RULE_SETUP -return NOMAP_ID; +#line 129 "lev_comp.l" +ST_RET(LEVEL_ID); YY_BREAK case 8: YY_RULE_SETUP -return LEVEL_ID; +#line 130 "lev_comp.l" +ST_RET(LEV_INIT_ID); YY_BREAK case 9: YY_RULE_SETUP -return LEV_INIT_ID; +#line 131 "lev_comp.l" +ST_RET(MAZE_GRID_ID); YY_BREAK case 10: YY_RULE_SETUP -return FLAGS_ID; +#line 132 "lev_comp.l" +ST_RET(SOLID_FILL_ID); YY_BREAK case 11: YY_RULE_SETUP -return GEOMETRY_ID; +#line 133 "lev_comp.l" +ST_RET(MINES_ID); YY_BREAK case 12: YY_RULE_SETUP -{ BEGIN(MAPC); nh_line_number++; } +#line 134 "lev_comp.l" +ST_RET(ROGUELEV_ID); YY_BREAK case 13: YY_RULE_SETUP -return OBJECT_ID; +#line 135 "lev_comp.l" +ST_RET(FLAGS_ID); YY_BREAK case 14: YY_RULE_SETUP -return COBJECT_ID; +#line 136 "lev_comp.l" +ST_RET(GEOMETRY_ID); YY_BREAK case 15: +/* rule 15 can match eol */ YY_RULE_SETUP -return MONSTER_ID; +#line 137 "lev_comp.l" +{ savetoken(yytext); BEGIN(MAPC); newline(); } YY_BREAK case 16: YY_RULE_SETUP -return TRAP_ID; +#line 138 "lev_comp.l" +ST_RET(object_ID); YY_BREAK case 17: YY_RULE_SETUP -return DOOR_ID; +#line 139 "lev_comp.l" +ST_RET(OBJECT_ID); YY_BREAK case 18: YY_RULE_SETUP -return DRAWBRIDGE_ID; +#line 140 "lev_comp.l" +ST_RET(COBJECT_ID); YY_BREAK case 19: YY_RULE_SETUP -return MAZEWALK_ID; +#line 141 "lev_comp.l" +ST_RET(MONSTER_ID); YY_BREAK case 20: YY_RULE_SETUP -return WALLIFY_ID; +#line 142 "lev_comp.l" +ST_RET(monster_ID); YY_BREAK case 21: YY_RULE_SETUP -return REGION_ID; +#line 143 "lev_comp.l" +ST_RET(TRAP_ID); YY_BREAK case 22: YY_RULE_SETUP -return RANDOM_OBJECTS_ID; +#line 144 "lev_comp.l" +ST_RET(DOOR_ID); YY_BREAK case 23: YY_RULE_SETUP -return RANDOM_MONSTERS_ID; +#line 145 "lev_comp.l" +ST_RET(ROOMDOOR_ID); YY_BREAK case 24: YY_RULE_SETUP -return RANDOM_PLACES_ID; +#line 146 "lev_comp.l" +ST_RET(DRAWBRIDGE_ID); YY_BREAK case 25: YY_RULE_SETUP -return ALTAR_ID; +#line 147 "lev_comp.l" +ST_RET(MAZEWALK_ID); YY_BREAK case 26: YY_RULE_SETUP -return LADDER_ID; +#line 148 "lev_comp.l" +ST_RET(WALLIFY_ID); YY_BREAK case 27: YY_RULE_SETUP -return STAIR_ID; +#line 149 "lev_comp.l" +ST_RET(REGION_ID); YY_BREAK case 28: YY_RULE_SETUP -return PORTAL_ID; +#line 150 "lev_comp.l" +ST_RET(ALTAR_ID); YY_BREAK case 29: YY_RULE_SETUP -return TELEPRT_ID; +#line 151 "lev_comp.l" +ST_RET(LADDER_ID); YY_BREAK case 30: YY_RULE_SETUP -return BRANCH_ID; +#line 152 "lev_comp.l" +ST_RET(STAIR_ID); YY_BREAK case 31: YY_RULE_SETUP -return FOUNTAIN_ID; +#line 153 "lev_comp.l" +ST_RET(PORTAL_ID); YY_BREAK case 32: YY_RULE_SETUP -return SINK_ID; +#line 154 "lev_comp.l" +ST_RET(TELEPRT_ID); YY_BREAK case 33: YY_RULE_SETUP -return POOL_ID; +#line 155 "lev_comp.l" +ST_RET(BRANCH_ID); YY_BREAK case 34: YY_RULE_SETUP -return NON_DIGGABLE_ID; +#line 156 "lev_comp.l" +ST_RET(FOUNTAIN_ID); YY_BREAK case 35: YY_RULE_SETUP -return NON_PASSWALL_ID; +#line 157 "lev_comp.l" +ST_RET(SINK_ID); YY_BREAK case 36: YY_RULE_SETUP -return ROOM_ID; +#line 158 "lev_comp.l" +ST_RET(POOL_ID); YY_BREAK case 37: YY_RULE_SETUP -return SUBROOM_ID; +#line 159 "lev_comp.l" +ST_RET(NON_DIGGABLE_ID); YY_BREAK case 38: YY_RULE_SETUP -return RAND_CORRIDOR_ID; +#line 160 "lev_comp.l" +ST_RET(NON_PASSWALL_ID); YY_BREAK case 39: YY_RULE_SETUP -return CORRIDOR_ID; +#line 161 "lev_comp.l" +ST_RET(IF_ID); YY_BREAK case 40: YY_RULE_SETUP -return GOLD_ID; +#line 162 "lev_comp.l" +ST_RET(ELSE_ID); YY_BREAK case 41: YY_RULE_SETUP -return ENGRAVING_ID; +#line 163 "lev_comp.l" +ST_RET(EXIT_ID); YY_BREAK case 42: YY_RULE_SETUP -return NAME_ID; +#line 164 "lev_comp.l" +ST_RET(ROOM_ID); YY_BREAK case 43: YY_RULE_SETUP -return CHANCE_ID; +#line 165 "lev_comp.l" +ST_RET(SUBROOM_ID); YY_BREAK case 44: YY_RULE_SETUP -return LEV; +#line 166 "lev_comp.l" +ST_RET(RAND_CORRIDOR_ID); YY_BREAK case 45: YY_RULE_SETUP -{ yylval.i=D_ISOPEN; return DOOR_STATE; } +#line 167 "lev_comp.l" +ST_RET(CORRIDOR_ID); YY_BREAK case 46: YY_RULE_SETUP -{ yylval.i=D_CLOSED; return DOOR_STATE; } +#line 168 "lev_comp.l" +ST_RET(TERRAIN_ID); YY_BREAK case 47: YY_RULE_SETUP -{ yylval.i=D_LOCKED; return DOOR_STATE; } +#line 169 "lev_comp.l" +ST_RET(terrain_ID); YY_BREAK case 48: YY_RULE_SETUP -{ yylval.i=D_NODOOR; return DOOR_STATE; } +#line 170 "lev_comp.l" +ST_RET(REPLACE_TERRAIN_ID); YY_BREAK case 49: YY_RULE_SETUP -{ yylval.i=D_BROKEN; return DOOR_STATE; } +#line 171 "lev_comp.l" +ST_RET(GOLD_ID); YY_BREAK case 50: YY_RULE_SETUP -{ yylval.i=W_NORTH; return DIRECTION; } +#line 172 "lev_comp.l" +ST_RET(GRAVE_ID); YY_BREAK case 51: YY_RULE_SETUP -{ yylval.i=W_EAST; return DIRECTION; } +#line 173 "lev_comp.l" +ST_RET(ENGRAVING_ID); YY_BREAK case 52: YY_RULE_SETUP -{ yylval.i=W_SOUTH; return DIRECTION; } +#line 174 "lev_comp.l" +ST_RET(MINERALIZE_ID); YY_BREAK case 53: YY_RULE_SETUP -{ yylval.i=W_WEST; return DIRECTION; } +#line 175 "lev_comp.l" +ST_RET(NAME_ID); YY_BREAK case 54: YY_RULE_SETUP -{ yylval.i = -1; return RANDOM_TYPE; } +#line 176 "lev_comp.l" +ST_RET(FOR_ID); YY_BREAK case 55: YY_RULE_SETUP -{ yylval.i = -2; return NONE; } +#line 177 "lev_comp.l" +ST_RET(TO_ID); YY_BREAK case 56: YY_RULE_SETUP -return O_REGISTER; +#line 178 "lev_comp.l" +ST_RET(LOOP_ID); YY_BREAK case 57: YY_RULE_SETUP -return M_REGISTER; +#line 179 "lev_comp.l" +ST_RET(SWITCH_ID); YY_BREAK case 58: YY_RULE_SETUP -return P_REGISTER; +#line 180 "lev_comp.l" +ST_RET(CASE_ID); YY_BREAK case 59: YY_RULE_SETUP -return A_REGISTER; +#line 181 "lev_comp.l" +ST_RET(BREAK_ID); YY_BREAK case 60: YY_RULE_SETUP -{ yylval.i=1; return LEFT_OR_RIGHT; } +#line 182 "lev_comp.l" +ST_RET(DEFAULT_ID); YY_BREAK case 61: YY_RULE_SETUP -{ yylval.i=2; return LEFT_OR_RIGHT; } +#line 183 "lev_comp.l" +ST_RET(FUNCTION_ID); YY_BREAK case 62: YY_RULE_SETUP -{ yylval.i=3; return CENTER; } +#line 184 "lev_comp.l" +ST_RET(SHUFFLE_ID); YY_BREAK case 63: YY_RULE_SETUP -{ yylval.i=4; return LEFT_OR_RIGHT; } +#line 185 "lev_comp.l" +ST_RET(MONTYPE_ID); YY_BREAK case 64: YY_RULE_SETUP -{ yylval.i=5; return LEFT_OR_RIGHT; } +#line 186 "lev_comp.l" +ST_RET(selection_ID); YY_BREAK case 65: YY_RULE_SETUP -{ yylval.i=1; return TOP_OR_BOT; } +#line 187 "lev_comp.l" +ST_RET(rect_ID); YY_BREAK case 66: YY_RULE_SETUP -{ yylval.i=5; return TOP_OR_BOT; } +#line 188 "lev_comp.l" +ST_RET(fillrect_ID); YY_BREAK case 67: YY_RULE_SETUP -{ yylval.i=1; return LIGHT_STATE; } +#line 189 "lev_comp.l" +ST_RET(line_ID); YY_BREAK case 68: YY_RULE_SETUP -{ yylval.i=0; return LIGHT_STATE; } +#line 190 "lev_comp.l" +ST_RET(randline_ID); YY_BREAK case 69: YY_RULE_SETUP -{ yylval.i=0; return FILLING; } +#line 191 "lev_comp.l" +ST_RET(grow_ID); YY_BREAK case 70: YY_RULE_SETUP -{ yylval.i=1; return FILLING; } +#line 192 "lev_comp.l" +ST_RET(flood_ID); YY_BREAK case 71: YY_RULE_SETUP -{ yylval.i= AM_NONE; return ALIGNMENT; } +#line 193 "lev_comp.l" +ST_RET(rndcoord_ID); YY_BREAK case 72: YY_RULE_SETUP -{ yylval.i= AM_LAWFUL; return ALIGNMENT; } +#line 194 "lev_comp.l" +ST_RET(circle_ID); YY_BREAK case 73: YY_RULE_SETUP -{ yylval.i= AM_NEUTRAL; return ALIGNMENT; } +#line 195 "lev_comp.l" +ST_RET(ellipse_ID); YY_BREAK case 74: YY_RULE_SETUP -{ yylval.i= AM_CHAOTIC; return ALIGNMENT; } +#line 196 "lev_comp.l" +ST_RET(filter_ID); YY_BREAK case 75: YY_RULE_SETUP -{ yylval.i= AM_SPLEV_CO; return ALIGNMENT; } +#line 197 "lev_comp.l" +ST_RET(gradient_ID); YY_BREAK case 76: YY_RULE_SETUP -{ yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; } +#line 198 "lev_comp.l" +ST_RET(complement_ID); YY_BREAK case 77: YY_RULE_SETUP -{ yylval.i=1; return MON_ATTITUDE; } +#line 199 "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 200 "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 201 "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 202 "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 203 "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 204 "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 205 "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 206 "lev_comp.l" +ST_RET(LEV); YY_BREAK case 85: YY_RULE_SETUP -{ yylval.i=1; return ALTAR_TYPE; } +#line 207 "lev_comp.l" +ST_RET(QUANTITY_ID); YY_BREAK case 86: YY_RULE_SETUP -{ yylval.i=0; return ALTAR_TYPE; } +#line 208 "lev_comp.l" +ST_RET(BURIED_ID); YY_BREAK case 87: YY_RULE_SETUP -{ yylval.i=1; return UP_OR_DOWN; } +#line 209 "lev_comp.l" +ST_RET(ERODED_ID); YY_BREAK case 88: YY_RULE_SETUP -{ yylval.i=0; return UP_OR_DOWN; } +#line 210 "lev_comp.l" +ST_RET(ERODEPROOF_ID); YY_BREAK case 89: YY_RULE_SETUP -{ yylval.i=0; return BOOLEAN; } +#line 211 "lev_comp.l" +ST_RET(TRAPPED_ID); YY_BREAK case 90: YY_RULE_SETUP -{ yylval.i=1; return BOOLEAN; } +#line 212 "lev_comp.l" +ST_RET(RECHARGED_ID); YY_BREAK case 91: YY_RULE_SETUP -{ yylval.i=DUST; return ENGRAVING_TYPE; } +#line 213 "lev_comp.l" +ST_RET(INVIS_ID); YY_BREAK case 92: YY_RULE_SETUP -{ yylval.i=ENGRAVE; return ENGRAVING_TYPE; } +#line 214 "lev_comp.l" +ST_RET(GREASED_ID); YY_BREAK case 93: YY_RULE_SETUP -{ yylval.i=BURN; return ENGRAVING_TYPE; } +#line 215 "lev_comp.l" +ST_RET(FEMALE_ID); YY_BREAK case 94: YY_RULE_SETUP -{ yylval.i=MARK; return ENGRAVING_TYPE; } +#line 216 "lev_comp.l" +ST_RET(CANCELLED_ID); YY_BREAK case 95: YY_RULE_SETUP -{ yylval.i=ENGR_BLOOD; return ENGRAVING_TYPE; } +#line 217 "lev_comp.l" +ST_RET(REVIVED_ID); YY_BREAK case 96: YY_RULE_SETUP -{ yylval.i=1; return CURSE_TYPE; } +#line 218 "lev_comp.l" +ST_RET(AVENGE_ID); YY_BREAK case 97: YY_RULE_SETUP -{ yylval.i=2; return CURSE_TYPE; } +#line 219 "lev_comp.l" +ST_RET(FLEEING_ID); YY_BREAK case 98: YY_RULE_SETUP -{ yylval.i=3; return CURSE_TYPE; } +#line 220 "lev_comp.l" +ST_RET(BLINDED_ID); YY_BREAK case 99: YY_RULE_SETUP -{ return CONTAINED; } +#line 221 "lev_comp.l" +ST_RET(PARALYZED_ID); YY_BREAK case 100: YY_RULE_SETUP -{ yylval.i=NOTELEPORT; return FLAG_TYPE; } +#line 222 "lev_comp.l" +ST_RET(STUNNED_ID); YY_BREAK case 101: YY_RULE_SETUP -{ yylval.i=HARDFLOOR; return FLAG_TYPE; } +#line 223 "lev_comp.l" +ST_RET(CONFUSED_ID); YY_BREAK case 102: YY_RULE_SETUP -{ yylval.i=NOMMAP; return FLAG_TYPE; } +#line 224 "lev_comp.l" +ST_RET(SEENTRAPS_ID); YY_BREAK case 103: YY_RULE_SETUP -{ yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */ +#line 225 "lev_comp.l" +ST_RET(ALL_ID); YY_BREAK case 104: YY_RULE_SETUP -{ yylval.i=SHORTSIGHTED; return FLAG_TYPE; } +#line 226 "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 227 "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 228 "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 229 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_CLOSED; return DOOR_STATE; } + YY_BREAK +case 108: +YY_RULE_SETUP +#line 230 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_LOCKED; return DOOR_STATE; } + YY_BREAK +case 109: +YY_RULE_SETUP +#line 231 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_NODOOR; return DOOR_STATE; } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 232 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_BROKEN; return DOOR_STATE; } + YY_BREAK +case 111: +YY_RULE_SETUP +#line 233 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_SECRET; return DOOR_STATE; } + YY_BREAK +case 112: +YY_RULE_SETUP +#line 234 "lev_comp.l" +{ savetoken(yytext); yylval.i=W_NORTH; return DIRECTION; } + YY_BREAK +case 113: +YY_RULE_SETUP +#line 235 "lev_comp.l" +{ savetoken(yytext); yylval.i=W_EAST; return DIRECTION; } + YY_BREAK +case 114: +YY_RULE_SETUP +#line 236 "lev_comp.l" +{ savetoken(yytext); yylval.i=W_SOUTH; return DIRECTION; } + YY_BREAK +case 115: +YY_RULE_SETUP +#line 237 "lev_comp.l" +{ savetoken(yytext); yylval.i=W_WEST; return DIRECTION; } + YY_BREAK +case 116: +YY_RULE_SETUP +#line 238 "lev_comp.l" +{ savetoken(yytext); yylval.i = -1; return RANDOM_TYPE; } + YY_BREAK +case 117: +YY_RULE_SETUP +#line 239 "lev_comp.l" +{ savetoken(yytext); yylval.i = -1; return RANDOM_TYPE_BRACKET; } + YY_BREAK +case 118: +YY_RULE_SETUP +#line 240 "lev_comp.l" +{ savetoken(yytext); yylval.i = -2; return NONE; } + YY_BREAK +case 119: +YY_RULE_SETUP +#line 241 "lev_comp.l" +ST_RET(A_REGISTER); + YY_BREAK +case 120: +YY_RULE_SETUP +#line 242 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return LEFT_OR_RIGHT; } + YY_BREAK +case 121: +YY_RULE_SETUP +#line 243 "lev_comp.l" +{ savetoken(yytext); yylval.i=2; return LEFT_OR_RIGHT; } + YY_BREAK +case 122: +YY_RULE_SETUP +#line 244 "lev_comp.l" +{ savetoken(yytext); yylval.i=3; return CENTER; } + YY_BREAK +case 123: +YY_RULE_SETUP +#line 245 "lev_comp.l" +{ savetoken(yytext); yylval.i=4; return LEFT_OR_RIGHT; } + YY_BREAK +case 124: +YY_RULE_SETUP +#line 246 "lev_comp.l" +{ savetoken(yytext); yylval.i=5; return LEFT_OR_RIGHT; } + YY_BREAK +case 125: +YY_RULE_SETUP +#line 247 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return TOP_OR_BOT; } + YY_BREAK +case 126: +YY_RULE_SETUP +#line 248 "lev_comp.l" +{ savetoken(yytext); yylval.i=5; return TOP_OR_BOT; } + YY_BREAK +case 127: +YY_RULE_SETUP +#line 249 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return LIGHT_STATE; } + YY_BREAK +case 128: +YY_RULE_SETUP +#line 250 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return LIGHT_STATE; } + YY_BREAK +case 129: +YY_RULE_SETUP +#line 251 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return FILLING; } + YY_BREAK +case 130: +YY_RULE_SETUP +#line 252 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return FILLING; } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 253 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return IRREGULAR; } + YY_BREAK +case 132: +YY_RULE_SETUP +#line 254 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return IRREGULAR; } + YY_BREAK +case 133: +YY_RULE_SETUP +#line 255 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return JOINED; } + YY_BREAK +case 134: +YY_RULE_SETUP +#line 256 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return JOINED; } + YY_BREAK +case 135: +YY_RULE_SETUP +#line 257 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return LIMITED; } + YY_BREAK +case 136: +YY_RULE_SETUP +#line 258 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return LIMITED; } + YY_BREAK +case 137: +YY_RULE_SETUP +#line 259 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_NONE; return ALIGNMENT; } + YY_BREAK +case 138: +YY_RULE_SETUP +#line 260 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_LAWFUL; return ALIGNMENT; } + YY_BREAK +case 139: +YY_RULE_SETUP +#line 261 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_NEUTRAL; return ALIGNMENT; } + YY_BREAK +case 140: +YY_RULE_SETUP +#line 262 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_CHAOTIC; return ALIGNMENT; } + YY_BREAK +case 141: +YY_RULE_SETUP +#line 263 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_SPLEV_CO; return ALIGNMENT; } + YY_BREAK +case 142: +YY_RULE_SETUP +#line 264 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; } + YY_BREAK +case 143: +YY_RULE_SETUP +#line 265 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return MON_ATTITUDE; } + YY_BREAK +case 144: +YY_RULE_SETUP +#line 266 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return MON_ATTITUDE; } + YY_BREAK +case 145: +YY_RULE_SETUP +#line 267 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return MON_ALERTNESS; } + YY_BREAK +case 146: +YY_RULE_SETUP +#line 268 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return MON_ALERTNESS; } + YY_BREAK +case 147: +YY_RULE_SETUP +#line 269 "lev_comp.l" +{ savetoken(yytext); yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; } + YY_BREAK +case 148: +YY_RULE_SETUP +#line 270 "lev_comp.l" +{ savetoken(yytext); yylval.i= M_AP_MONSTER; return MON_APPEARANCE; } + YY_BREAK +case 149: +YY_RULE_SETUP +#line 271 "lev_comp.l" +{ savetoken(yytext); yylval.i= M_AP_OBJECT; return MON_APPEARANCE; } + YY_BREAK +case 150: +YY_RULE_SETUP +#line 272 "lev_comp.l" +{ savetoken(yytext); yylval.i=2; return ALTAR_TYPE; } + YY_BREAK +case 151: +YY_RULE_SETUP +#line 273 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return ALTAR_TYPE; } + YY_BREAK +case 152: +YY_RULE_SETUP +#line 274 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return ALTAR_TYPE; } + YY_BREAK +case 153: +YY_RULE_SETUP +#line 275 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return UP_OR_DOWN; } + YY_BREAK +case 154: +YY_RULE_SETUP +#line 276 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return UP_OR_DOWN; } + YY_BREAK +case 155: +YY_RULE_SETUP +#line 277 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return BOOLEAN; } + YY_BREAK +case 156: +YY_RULE_SETUP +#line 278 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return BOOLEAN; } + YY_BREAK +case 157: +YY_RULE_SETUP +#line 279 "lev_comp.l" +{ savetoken(yytext); yylval.i=DUST; return ENGRAVING_TYPE; } + YY_BREAK +case 158: +YY_RULE_SETUP +#line 280 "lev_comp.l" +{ savetoken(yytext); yylval.i=ENGRAVE; return ENGRAVING_TYPE; } + YY_BREAK +case 159: +YY_RULE_SETUP +#line 281 "lev_comp.l" +{ savetoken(yytext); yylval.i=BURN; return ENGRAVING_TYPE; } + YY_BREAK +case 160: +YY_RULE_SETUP +#line 282 "lev_comp.l" +{ savetoken(yytext); yylval.i=MARK; return ENGRAVING_TYPE; } + YY_BREAK +case 161: +YY_RULE_SETUP +#line 283 "lev_comp.l" +{ savetoken(yytext); yylval.i=ENGR_BLOOD; return ENGRAVING_TYPE; } + YY_BREAK +case 162: +YY_RULE_SETUP +#line 284 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return CURSE_TYPE; } + YY_BREAK +case 163: +YY_RULE_SETUP +#line 285 "lev_comp.l" +{ savetoken(yytext); yylval.i=2; return CURSE_TYPE; } + YY_BREAK +case 164: +YY_RULE_SETUP +#line 286 "lev_comp.l" +{ savetoken(yytext); yylval.i=3; return CURSE_TYPE; } + YY_BREAK +case 165: +YY_RULE_SETUP +#line 287 "lev_comp.l" +{ savetoken(yytext); yylval.i=NOTELEPORT; return FLAG_TYPE; } + YY_BREAK +case 166: +YY_RULE_SETUP +#line 288 "lev_comp.l" +{ savetoken(yytext); yylval.i=HARDFLOOR; return FLAG_TYPE; } + YY_BREAK +case 167: +YY_RULE_SETUP +#line 289 "lev_comp.l" +{ savetoken(yytext); yylval.i=NOMMAP; return FLAG_TYPE; } + YY_BREAK +case 168: +YY_RULE_SETUP +#line 290 "lev_comp.l" +{ savetoken(yytext); yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */ + YY_BREAK +case 169: +YY_RULE_SETUP +#line 291 "lev_comp.l" +{ savetoken(yytext); yylval.i=SHORTSIGHTED; return FLAG_TYPE; } + YY_BREAK +case 170: +YY_RULE_SETUP +#line 292 "lev_comp.l" +{ savetoken(yytext); yylval.i=MAZELEVEL; return FLAG_TYPE; } + YY_BREAK +case 171: +YY_RULE_SETUP +#line 293 "lev_comp.l" +{ savetoken(yytext); yylval.i=PREMAPPED; return FLAG_TYPE; } + YY_BREAK +case 172: +YY_RULE_SETUP +#line 294 "lev_comp.l" +{ savetoken(yytext); yylval.i=SHROUD; return FLAG_TYPE; } + YY_BREAK +case 173: +YY_RULE_SETUP +#line 295 "lev_comp.l" +{ savetoken(yytext); yylval.i=GRAVEYARD; return FLAG_TYPE; } + YY_BREAK +case 174: +YY_RULE_SETUP +#line 296 "lev_comp.l" +{ savetoken(yytext); yylval.i=ICEDPOOLS; return FLAG_TYPE; } + YY_BREAK +case 175: +YY_RULE_SETUP +#line 297 "lev_comp.l" +{ savetoken(yytext); yylval.i=SOLIDIFY; return FLAG_TYPE; } + YY_BREAK +case 176: +YY_RULE_SETUP +#line 298 "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 177: +YY_RULE_SETUP +#line 308 "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 178: +YY_RULE_SETUP +#line 312 "lev_comp.l" +{ savetoken(yytext); yylval.i=atoi(yytext); return MINUS_INTEGER; } + YY_BREAK +case 179: +YY_RULE_SETUP +#line 313 "lev_comp.l" +{ savetoken(yytext); yylval.i=atoi(yytext); return PLUS_INTEGER; } + YY_BREAK +case 180: +YY_RULE_SETUP +#line 314 "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 181: +YY_RULE_SETUP +#line 318 "lev_comp.l" +{ savetoken(yytext); yylval.i=atoi(yytext); return INTEGER; } + YY_BREAK +case 182: +/* rule 182 can match eol */ +YY_RULE_SETUP +#line 319 "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 183: YY_RULE_SETUP -{ nh_line_number++; } +#line 324 "lev_comp.l" +{ savetoken(yytext); return handle_varstring_check(); } YY_BREAK -case 109: +case 184: YY_RULE_SETUP -; +#line 325 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JE; return COMPARE_TYPE; } YY_BREAK -case 110: +case 185: YY_RULE_SETUP -{ yylval.i = yytext[2]; return CHAR; } +#line 326 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } YY_BREAK -case 111: +case 186: YY_RULE_SETUP -{ yylval.i = yytext[1]; return CHAR; } +#line 327 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } YY_BREAK -case 112: +case 187: YY_RULE_SETUP -{ return yytext[0]; } +#line 328 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JLE; return COMPARE_TYPE; } YY_BREAK -case 113: +case 188: YY_RULE_SETUP +#line 329 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JGE; return COMPARE_TYPE; } + YY_BREAK +case 189: +YY_RULE_SETUP +#line 330 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JL; return COMPARE_TYPE; } + YY_BREAK +case 190: +YY_RULE_SETUP +#line 331 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JG; return COMPARE_TYPE; } + YY_BREAK +case 191: +/* rule 191 can match eol */ +YY_RULE_SETUP +#line 332 "lev_comp.l" +{ newline(); } + YY_BREAK +case 192: +YY_RULE_SETUP +#line 333 "lev_comp.l" +{ advancepos(yytext); } + YY_BREAK +case 193: +YY_RULE_SETUP +#line 334 "lev_comp.l" +{ savetoken(yytext); yylval.i = yytext[2]; return CHAR; } + YY_BREAK +case 194: +YY_RULE_SETUP +#line 335 "lev_comp.l" +{ savetoken(yytext); yylval.i = yytext[1]; return CHAR; } + YY_BREAK +case 195: +YY_RULE_SETUP +#line 336 "lev_comp.l" +ST_RET(UNKNOWN_TYPE); + YY_BREAK +case 196: +YY_RULE_SETUP +#line 337 "lev_comp.l" +{ savetoken(yytext); return yytext[0]; } + YY_BREAK +case 197: +YY_RULE_SETUP +#line 338 "lev_comp.l" ECHO; YY_BREAK +#line 2512 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(MAPC): yyterminate(); @@ -1427,25 +2516,26 @@ case YY_STATE_EOF(MAPC): case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our + * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position @@ -1455,13 +2545,13 @@ case YY_STATE_EOF(MAPC): * end-of-buffer state). Contrast this with the test * in input(). */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have @@ -1474,30 +2564,30 @@ case YY_STATE_EOF(MAPC): yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; + yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { - yy_cp = yy_c_buf_p; + yy_cp = (yy_c_buf_p); goto yy_find_action; } } - else switch ( yy_get_next_buffer() ) + else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { - yy_did_buffer_switch_on_eof = 0; + (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap() ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -1508,7 +2598,7 @@ case YY_STATE_EOF(MAPC): * YY_NULL, it'll still work - another * YY_NULL will get returned. */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; @@ -1516,30 +2606,30 @@ case YY_STATE_EOF(MAPC): else { - if ( ! yy_did_buffer_switch_on_eof ) + if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; @@ -1550,8 +2640,8 @@ case YY_STATE_EOF(MAPC): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of yylex */ - + } /* end of user's declarations */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -1560,23 +2650,22 @@ case YY_STATE_EOF(MAPC): * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); - if ( yy_current_buffer->yy_fill_buffer == 0 ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + 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; @@ -1594,39 +2683,34 @@ static int yy_get_next_buffer() /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - yy_n_chars = 0; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); + (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int old_size = b->yy_buf_size + 2; - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1635,8 +2719,7 @@ 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 ); + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -1646,33 +2729,35 @@ static int yy_get_next_buffer() YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = yy_current_buffer->yy_buf_size - + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; -#endif + } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - if ( yy_n_chars == 0 ) + if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); + yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } @@ -1680,229 +2765,266 @@ static int yy_get_next_buffer() else ret_val = EOB_ACT_CONTINUE_SCAN; - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} /* yy_get_previous_state - get the state just before the EOB char was reached */ -static yy_state_type yy_get_previous_state() - { + static yy_state_type yy_get_previous_state (void) +{ register yy_state_type yy_current_state; register char *yy_cp; - - yy_current_state = yy_start; + + yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } 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 >= 1049 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; - } - +} /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; - { + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; + register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } 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 >= 1049 ) 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 == 1048); - return yy_is_jam ? 0 : yy_current_state; - } + return yy_is_jam ? 0 : yy_current_state; +} - -#ifndef YY_NO_UNPUT -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; - { - register char *yy_cp = yy_c_buf_p; + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; + register yy_size_t number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - while ( source > yy_current_buffer->yy_ch_buf ) + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif - -static int input() - { +{ int c; + + *(yy_c_buf_p) = (yy_hold_char); - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ - *yy_c_buf_p = '\0'; + *(yy_c_buf_p) = '\0'; else { /* need more input */ - yytext_ptr = yy_c_buf_p; - ++yy_c_buf_p; + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); - switch ( yy_get_next_buffer() ) + 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 ); + + /*FALLTHROUGH*/ + case EOB_ACT_END_OF_FILE: { - if ( yywrap() ) - { - yy_c_buf_p = - yytext_ptr + YY_MORE_ADJ; + if ( yywrap( ) ) return EOF; - } - if ( ! yy_did_buffer_switch_on_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()" ); } } } - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); - yy_current_buffer->yy_at_bol = (c == '\n'); + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); } + yy_init_buffer(YY_CURRENT_BUFFER,input_file ); + yy_load_buffer_state( ); +} -void yyrestart( input_file ) -FILE *input_file; - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; - { - if ( yy_current_buffer == new_buffer ) +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) return; - if ( yy_current_buffer ) + if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - yy_current_buffer = new_buffer; - yy_load_buffer_state(); + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ - yy_did_buffer_switch_on_eof = 1; - } + (yy_did_buffer_switch_on_eof) = 1; +} +static void yy_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} -void yy_load_buffer_state() - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; - { +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +{ YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -1911,64 +3033,73 @@ int size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer( b, file ); + yy_init_buffer(b,file ); return b; - } +} - -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; - { +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) return; - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yy_flex_free( (genericptr_t) b->yy_ch_buf ); + yyfree((void *) b->yy_ch_buf ); - yy_flex_free( (genericptr_t) b ); - } + yyfree((void *) b ); +} +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int FDECL(isatty, (int)); -#endif -#endif - -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; - { - yy_flush_buffer( b ); +{ + int oerrno = errno; + + yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; -#ifdef YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#ifdef YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; - { b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes @@ -1983,24 +3114,203 @@ YY_BUFFER_STATE b; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == yy_current_buffer ) - yy_load_buffer_state(); + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void yypop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (void) +{ + yy_size_t num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; } + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +{ + 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) yyalloc(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; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +{ + + return yy_scan_bytes(yystr,strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + yy_size_t i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) yyalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_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; +} #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error( msg ) -const char msg[]; - { - (void) fprintf( stderr, "%s\n", msg ); +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); - } - - +} /* Redefine yyless() so it works in section 3 code. */ @@ -2009,61 +3319,196 @@ const char msg[]; do \ { \ /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n - YY_MORE_ADJ; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ } \ while ( 0 ) +/* Accessor methods (get/set functions) to struct members. */ -/* Internal utility routines. */ +/** Get the current line number. + * + */ +int yyget_lineno (void) +{ + + return yylineno; +} + +/** Get the input stream. + * + */ +FILE *yyget_in (void) +{ + return yyin; +} + +/** Get the output stream. + * + */ +FILE *yyget_out (void) +{ + return yyout; +} + +/** Get the length of the current token. + * + */ +yy_size_t yyget_leng (void) +{ + return yyleng; +} + +/** Get the current token. + * + */ + +char *yyget_text (void) +{ + return yytext; +} + +/** Set the current line number. + * @param line_number + * + */ +void yyset_lineno (int line_number ) +{ + + yylineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * in_str ) +{ + yyin = in_str ; +} + +void yyset_out (FILE * out_str ) +{ + yyout = out_str ; +} + +int yyget_debug (void) +{ + return yy_flex_debug; +} + +void yyset_debug (int bdebug ) +{ + yy_flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = (FILE *) 0; + yyout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ #ifndef yytext_ptr -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -const char *s2; -int n; - { +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; - } +} #endif +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; -static genericptr_t yy_flex_alloc( size ) -yy_size_t size; - { - return (genericptr_t) alloc((unsigned)size); - } + return n; +} +#endif -/* 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; -yy_size_t size; -int old_size; - { - genericptr_t outptr = yy_flex_alloc(size); +void *yyalloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} - if (ptr) { - char *p = (char *) outptr, *q = (char *) ptr; +void *yyrealloc (void * ptr, yy_size_t size ) +{ + /* 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 ); +} - while (--old_size >= 0) *p++ = *q++; - yy_flex_free(ptr); - } - return outptr; - } +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} -static void yy_flex_free( ptr ) -genericptr_t ptr; - { - free( ptr ); - } +#define YYTABLES_NAME "yytables" + +#line 337 "lev_comp.l" -/*flexhack.skl*/ #ifdef AMIGA long *alloc(n) @@ -2083,6 +3528,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 +3537,52 @@ 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..376c48759 100644 --- a/sys/share/lev_yacc.c +++ b/sys/share/lev_yacc.c @@ -1,14 +1,71 @@ -#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 $ */ +/* A Bison parser, made by GNU Bison 3.0.2. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2013 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 "3.0.2" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + + + + +/* Copy the first part of user declarations. */ +#line 1 "lev_comp.y" /* yacc.c:339 */ + +/* NetHack 3.5 lev_comp.y $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_comp.y $Date: 2009/05/06 10:54:31 $ $Revision: 1.8 $ */ /* SCCS Id: @(#)lev_yacc.c 3.5 2007/08/01 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -34,7 +91,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 +98,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 +121,5567 @@ 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 212 "y.tab.c" /* yacc.c:339 */ + +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* In a future release of Bison, this section will be replaced + by #include "y.tab.h". */ +#ifndef YY_YY_Y_TAB_H_INCLUDED +# define YY_YY_Y_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int yydebug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + 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 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { - int i; +#line 148 "lev_comp.y" /* yacc.c:355 */ + + long i; char* map; struct { - xchar room; - xchar wall; - xchar door; + long room; + long wall; + long door; } corpos; -} 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, + 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 641 "y.tab.c" /* yacc.c:355 */ }; -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_IS_DECLARED 1 #endif -#define YYMAXTOKEN 324 + + +extern YYSTYPE yylval; + +int yyparse (void); + +#endif /* !YY_YY_Y_TAB_H_INCLUDED */ + +/* Copy the second part of user declarations. */ + +#line 656 "y.tab.c" /* yacc.c:358 */ + +#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; +#else +typedef signed char 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 +# 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 defined YYENABLE_NLS && 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 + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# 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 + +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#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 EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (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 EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +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) + +# define YYCOPY_NEEDED 1 + +/* 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 (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* 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 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 866 + +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 431 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ +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", -}; -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 ')'", + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 275, 275, 276, 279, 280, 283, 305, 310, 326, + 330, 336, 345, 354, 358, 384, 387, 394, 398, 405, + 408, 415, 416, 420, 423, 429, 433, 440, 443, 449, + 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, 497, 498, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 512, 513, 514, 515, 516, 517, 518, + 519, 520, 523, 524, 525, 528, 529, 532, 544, 550, + 556, 562, 568, 574, 580, 586, 592, 599, 606, 613, + 620, 627, 634, 643, 648, 655, 660, 667, 672, 679, + 683, 689, 694, 701, 705, 711, 715, 722, 744, 721, + 758, 803, 810, 813, 819, 825, 829, 838, 842, 837, + 899, 900, 904, 903, 916, 915, 930, 940, 941, 944, + 977, 976, 1002, 1001, 1031, 1030, 1061, 1060, 1086, 1095, + 1094, 1121, 1127, 1131, 1135, 1141, 1148, 1157, 1165, 1176, + 1175, 1191, 1190, 1207, 1210, 1216, 1226, 1232, 1241, 1247, + 1252, 1258, 1263, 1269, 1278, 1284, 1285, 1288, 1289, 1292, + 1296, 1302, 1303, 1306, 1312, 1318, 1326, 1327, 1330, 1331, + 1334, 1339, 1338, 1352, 1359, 1365, 1373, 1378, 1383, 1388, + 1393, 1398, 1403, 1408, 1413, 1418, 1423, 1428, 1433, 1438, + 1443, 1448, 1455, 1462, 1466, 1479, 1486, 1485, 1501, 1509, + 1515, 1523, 1528, 1533, 1538, 1543, 1548, 1553, 1558, 1563, + 1568, 1579, 1584, 1589, 1594, 1599, 1606, 1612, 1639, 1644, + 1651, 1655, 1661, 1667, 1673, 1683, 1693, 1708, 1718, 1721, + 1727, 1733, 1739, 1745, 1750, 1757, 1763, 1769, 1775, 1782, + 1781, 1805, 1808, 1814, 1820, 1824, 1829, 1836, 1842, 1849, + 1853, 1859, 1867, 1870, 1880, 1884, 1887, 1893, 1897, 1904, + 1908, 1912, 1918, 1919, 1922, 1923, 1926, 1927, 1928, 1934, + 1935, 1936, 1942, 1943, 1946, 1955, 1960, 1967, 1977, 1983, + 1987, 1991, 1998, 2007, 2013, 2017, 2023, 2027, 2035, 2039, + 2046, 2055, 2066, 2070, 2077, 2086, 2095, 2106, 2110, 2117, + 2126, 2135, 2144, 2153, 2159, 2163, 2170, 2179, 2189, 2198, + 2207, 2214, 2215, 2221, 2222, 2223, 2224, 2232, 2240, 2241, + 2242, 2243, 2244, 2245, 2248, 2254, 2262, 2291, 2292, 2295, + 2296, 2299, 2303, 2310, 2317, 2328, 2331, 2339, 2343, 2347, + 2351, 2355, 2360, 2364, 2368, 2372, 2376, 2380, 2384, 2388, + 2392, 2396, 2400, 2404, 2408, 2415, 2421, 2425, 2431, 2437, + 2438, 2439, 2442, 2446, 2450, 2454, 2460, 2461, 2464, 2465, + 2468, 2469, 2472, 2473, 2476, 2480, 2498 }; #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 || 0 +/* 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", YY_NULLPTR +}; #endif + +# ifdef YYPRINT +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ +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 + +#define YYPACT_NINF -654 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-654))) + +#define YYTABLE_NINF -202 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +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 +}; + + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not 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 +}; + + /* 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 +}; + + /* 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 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +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 +}; + + /* 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 on the 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 +}; + + +#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 + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 + + + +/* 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 (0) + +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif + + +# 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 (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +{ + FILE *yyo = yyoutput; + YYUSE (yyo); + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + YYUSE (yytype); +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +{ + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", 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). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +{ + 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 (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) +{ + unsigned long int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + 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, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE +#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 */ -/*lev_comp.y*/ -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab -int -yyparse() + +/* 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. */ +static YYSIZE_T +yystrlen (const char *yystr) { - register int yym, yyn, yystate; -#if YYDEBUG - register char *yys; - extern char *getenv(); + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif - if ((yys = getenv("YYDEBUG")) != 0) +# 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. */ +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + 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 == '"') { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; + 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: ; } -#endif - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); + if (! yyres) + return yystrlen (yystr); - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; + return yystpcpy (yyres, yystr) - yyres; +} +# endif -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) { - 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 - } - if ((yyn = yysindex[yystate]) != 0 && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#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; - } - if ((yyn = yyrindex[yystate]) != 0 && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint - 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) + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + 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 yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; { - goto yyoverflow; + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; } - *++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; + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* 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 = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; +} +#endif /* YYERROR_VERBOSE */ + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +{ + YYUSE (yyvaluep); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + + + +/* The lookahead symbol. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; +/* Number of syntax errors so far. */ +int yynerrs; + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (void) +{ + 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 through 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 = 0; + /* 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 + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + 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) + { + /* 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; + } + + 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 (yypact_value_is_default (yyn)) + 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) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = yylex (); + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + 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 (yytable_value_is_error (yyn)) + 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; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + 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 284 "lev_comp.y" /* yacc.c:1646 */ + { 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; +#line 2475 "y.tab.c" /* yacc.c:1646 */ + break; - 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); + case 8: +#line 311 "lev_comp.y" /* yacc.c:1646 */ + { + start_level_def(&splev, (yyvsp[-2].map)); + if ((yyvsp[0].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[0].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[-2].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); - } +#line 2493 "y.tab.c" /* yacc.c:1646 */ + break; + + case 9: +#line 327 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = -1; } -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); - } +#line 2501 "y.tab.c" /* yacc.c:1646 */ + break; + + case 10: +#line 331 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = what_map_char((char) (yyvsp[0].i)); } -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; +#line 2509 "y.tab.c" /* yacc.c:1646 */ + break; + + case 11: +#line 337 "lev_comp.y" /* yacc.c:1646 */ + { + long filling = (yyvsp[0].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[0].terr).lit, 0,0,0,0, SPO_INITLEVEL); + max_x_map = COLNO-1; + max_y_map = ROWNO; } -break; -case 32: -{ - tmpcor[0] = New(corridor); - tmpcor[0]->src.room = -1; - ncorridor = 1; +#line 2522 "y.tab.c" /* yacc.c:1646 */ + break; + + case 12: +#line 346 "lev_comp.y" /* yacc.c:1646 */ + { + long filling = what_map_char((char) (yyvsp[0].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 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--; - } +#line 2535 "y.tab.c" /* yacc.c:1646 */ + break; + + case 13: +#line 355 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iiiiiiiio", LVLINIT_ROGUE,0,0,0,0,0,0,0, SPO_INITLEVEL); } -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 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; +#line 2543 "y.tab.c" /* yacc.c:1646 */ + break; + + case 14: +#line 359 "lev_comp.y" /* yacc.c:1646 */ + { + long fg = what_map_char((char) (yyvsp[-11].i)); + long bg = what_map_char((char) (yyvsp[-9].i)); + long smoothed = (yyvsp[-7].i); + long joined = (yyvsp[-5].i); + long lit = (yyvsp[-3].i); + long walled = (yyvsp[-1].i); + long filling = (yyvsp[0].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; +#line 2570 "y.tab.c" /* yacc.c:1646 */ + 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: +#line 384 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = 0; + } +#line 2578 "y.tab.c" /* yacc.c:1646 */ + break; - 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--; + case 16: +#line 388 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (yyvsp[0].i); + } +#line 2586 "y.tab.c" /* yacc.c:1646 */ + break; + + case 17: +#line 394 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_COPY); + (yyval.i) = 0; + } +#line 2595 "y.tab.c" /* yacc.c:1646 */ + break; + + case 18: +#line 399 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = 1; + } +#line 2603 "y.tab.c" /* yacc.c:1646 */ + break; + + case 19: +#line 405 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = -1; + } +#line 2611 "y.tab.c" /* yacc.c:1646 */ + break; + + case 20: +#line 409 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = what_map_char((char) (yyvsp[0].i)); + } +#line 2619 "y.tab.c" /* yacc.c:1646 */ + break; + + case 23: +#line 420 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", 0, SPO_LEVEL_FLAGS); + } +#line 2627 "y.tab.c" /* yacc.c:1646 */ + break; + + case 24: +#line 424 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", (yyvsp[0].i), SPO_LEVEL_FLAGS); + } +#line 2635 "y.tab.c" /* yacc.c:1646 */ + break; + + case 25: +#line 430 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = ((yyvsp[-2].i) | (yyvsp[0].i)); + } +#line 2643 "y.tab.c" /* yacc.c:1646 */ + break; + + case 26: +#line 434 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (yyvsp[0].i); + } +#line 2651 "y.tab.c" /* yacc.c:1646 */ + break; + + case 27: +#line 440 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = 0; + } +#line 2659 "y.tab.c" /* yacc.c:1646 */ + break; + + case 28: +#line 444 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = 1 + (yyvsp[0].i); + } +#line 2667 "y.tab.c" /* yacc.c:1646 */ + break; + + case 29: +#line 450 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (yyvsp[-1].i); + } +#line 2675 "y.tab.c" /* yacc.c:1646 */ + break; + + case 97: +#line 533 "lev_comp.y" /* yacc.c:1646 */ + { + struct lc_vardefs *vd; + if ((vd = vardef_defined(variable_definitions, (yyvsp[0].map), 1))) { + if (!(vd->var_type & SPOVAR_ARRAY)) + lc_error("Trying to shuffle non-array variable '%s'", (yyvsp[0].map)); + } else lc_error("Trying to shuffle undefined variable '%s'", (yyvsp[0].map)); + add_opvars(splev, "so", (yyvsp[0].map), SPO_SHUFFLE_ARRAY); + Free((yyvsp[0].map)); + } +#line 2689 "y.tab.c" /* yacc.c:1646 */ + break; + + case 98: +#line 545 "lev_comp.y" /* yacc.c:1646 */ + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_INT); + add_opvars(splev, "iso", 0, (yyvsp[-2].map), SPO_VAR_INIT); + Free((yyvsp[-2].map)); + } +#line 2699 "y.tab.c" /* yacc.c:1646 */ + break; + + case 99: +#line 551 "lev_comp.y" /* yacc.c:1646 */ + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_SEL); + add_opvars(splev, "iso", 0, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); + } +#line 2709 "y.tab.c" /* yacc.c:1646 */ + break; + + case 100: +#line 557 "lev_comp.y" /* yacc.c:1646 */ + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_STRING); + add_opvars(splev, "iso", 0, (yyvsp[-2].map), SPO_VAR_INIT); + Free((yyvsp[-2].map)); + } +#line 2719 "y.tab.c" /* yacc.c:1646 */ + break; + + case 101: +#line 563 "lev_comp.y" /* yacc.c:1646 */ + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_MAPCHAR); + add_opvars(splev, "iso", 0, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); + } +#line 2729 "y.tab.c" /* yacc.c:1646 */ + break; + + case 102: +#line 569 "lev_comp.y" /* yacc.c:1646 */ + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_MONST); + add_opvars(splev, "iso", 0, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); + } +#line 2739 "y.tab.c" /* yacc.c:1646 */ + break; + + case 103: +#line 575 "lev_comp.y" /* yacc.c:1646 */ + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_OBJ); + add_opvars(splev, "iso", 0, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); + } +#line 2749 "y.tab.c" /* yacc.c:1646 */ + break; + + case 104: +#line 581 "lev_comp.y" /* yacc.c:1646 */ + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_COORD); + add_opvars(splev, "iso", 0, (yyvsp[-2].map), SPO_VAR_INIT); + Free((yyvsp[-2].map)); + } +#line 2759 "y.tab.c" /* yacc.c:1646 */ + break; + + case 105: +#line 587 "lev_comp.y" /* yacc.c:1646 */ + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_REGION); + add_opvars(splev, "iso", 0, (yyvsp[-2].map), SPO_VAR_INIT); + Free((yyvsp[-2].map)); + } +#line 2769 "y.tab.c" /* yacc.c:1646 */ + break; + + case 106: +#line 593 "lev_comp.y" /* yacc.c:1646 */ + { + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_INT|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); + } +#line 2780 "y.tab.c" /* yacc.c:1646 */ + break; + + case 107: +#line 600 "lev_comp.y" /* yacc.c:1646 */ + { + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_COORD|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); + } +#line 2791 "y.tab.c" /* yacc.c:1646 */ + break; + + case 108: +#line 607 "lev_comp.y" /* yacc.c:1646 */ + { + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_REGION|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); + } +#line 2802 "y.tab.c" /* yacc.c:1646 */ + break; + + case 109: +#line 614 "lev_comp.y" /* yacc.c:1646 */ + { + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-6].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-6].map), SPO_VAR_INIT); + Free((yyvsp[-6].map)); + } +#line 2813 "y.tab.c" /* yacc.c:1646 */ + break; + + case 110: +#line 621 "lev_comp.y" /* yacc.c:1646 */ + { + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-6].map), SPOVAR_MONST|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-6].map), SPO_VAR_INIT); + Free((yyvsp[-6].map)); + } +#line 2824 "y.tab.c" /* yacc.c:1646 */ + break; + + case 111: +#line 628 "lev_comp.y" /* yacc.c:1646 */ + { + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-6].map), SPOVAR_OBJ|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-6].map), SPO_VAR_INIT); + Free((yyvsp[-6].map)); + } +#line 2835 "y.tab.c" /* yacc.c:1646 */ + break; + + case 112: +#line 635 "lev_comp.y" /* yacc.c:1646 */ + { + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_STRING|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); + } +#line 2846 "y.tab.c" /* yacc.c:1646 */ + break; + + case 113: +#line 644 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "O", (yyvsp[0].i)); + (yyval.i) = 1; + } +#line 2855 "y.tab.c" /* yacc.c:1646 */ + break; + + case 114: +#line 649 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "O", (yyvsp[0].i)); + (yyval.i) = 1 + (yyvsp[-2].i); + } +#line 2864 "y.tab.c" /* yacc.c:1646 */ + break; + + case 115: +#line 656 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "M", (yyvsp[0].i)); + (yyval.i) = 1; + } +#line 2873 "y.tab.c" /* yacc.c:1646 */ + break; + + case 116: +#line 661 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "M", (yyvsp[0].i)); + (yyval.i) = 1 + (yyvsp[-2].i); + } +#line 2882 "y.tab.c" /* yacc.c:1646 */ + break; + + case 117: +#line 668 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "m", (yyvsp[0].i)); + (yyval.i) = 1; + } +#line 2891 "y.tab.c" /* yacc.c:1646 */ + break; + + case 118: +#line 673 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "m", (yyvsp[0].i)); + (yyval.i) = 1 + (yyvsp[-2].i); + } +#line 2900 "y.tab.c" /* yacc.c:1646 */ + break; + + case 119: +#line 680 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = 1; + } +#line 2908 "y.tab.c" /* yacc.c:1646 */ + break; + + case 120: +#line 684 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = 1 + (yyvsp[-2].i); + } +#line 2916 "y.tab.c" /* yacc.c:1646 */ + break; + + case 121: +#line 690 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "c", (yyvsp[0].i)); + (yyval.i) = 1; + } +#line 2925 "y.tab.c" /* yacc.c:1646 */ + break; + + case 122: +#line 695 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "c", (yyvsp[0].i)); + (yyval.i) = 1 + (yyvsp[-2].i); + } +#line 2934 "y.tab.c" /* yacc.c:1646 */ + break; + + case 123: +#line 702 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = 1; + } +#line 2942 "y.tab.c" /* yacc.c:1646 */ + break; + + case 124: +#line 706 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = 1 + (yyvsp[-2].i); + } +#line 2950 "y.tab.c" /* yacc.c:1646 */ + break; + + case 125: +#line 712 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = 1; + } +#line 2958 "y.tab.c" /* yacc.c:1646 */ + break; + + case 126: +#line 716 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = 1 + (yyvsp[-2].i); + } +#line 2966 "y.tab.c" /* yacc.c:1646 */ + break; + + case 127: +#line 722 "lev_comp.y" /* yacc.c:1646 */ + { + struct lc_funcdefs *funcdef; + + if (in_function_definition) + lc_error("Recursively defined functions not allowed (function %s).", (yyvsp[-1].map)); + + in_function_definition++; + + if (funcdef_defined(function_definitions, (yyvsp[-1].map), 1)) + lc_error("Function '%s' already defined once.", (yyvsp[-1].map)); + + funcdef = funcdef_new(-1, (yyvsp[-1].map)); + funcdef->next = function_definitions; + function_definitions = funcdef; + function_splev_backup = splev; + splev = &(funcdef->code); + Free((yyvsp[-1].map)); + curr_function = funcdef; + function_tmp_var_defs = variable_definitions; + variable_definitions = NULL; + } +#line 2992 "y.tab.c" /* yacc.c:1646 */ + break; + + case 128: +#line 744 "lev_comp.y" /* yacc.c:1646 */ + { + /* nothing */ + } +#line 3000 "y.tab.c" /* yacc.c:1646 */ + break; + + case 129: +#line 748 "lev_comp.y" /* yacc.c:1646 */ + { + 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; + } +#line 3013 "y.tab.c" /* yacc.c:1646 */ + break; + + case 130: +#line 759 "lev_comp.y" /* yacc.c:1646 */ + { + struct lc_funcdefs *tmpfunc; + tmpfunc = funcdef_defined(function_definitions, (yyvsp[-3].map), 1); + if (tmpfunc) { + long l; + long nparams = strlen( (yyvsp[-1].map) ); + char *fparamstr = funcdef_paramtypes(tmpfunc); + if (strcmp((yyvsp[-1].map), fparamstr)) { + char *tmps = strdup(decode_parm_str(fparamstr)); + lc_error("Function '%s' requires params '%s', got '%s' instead.", (yyvsp[-3].map), tmps, decode_parm_str((yyvsp[-1].map))); + Free(tmps); + } + Free(fparamstr); + Free((yyvsp[-1].map)); + if (!(tmpfunc->n_called)) { + /* we haven't called the function yet, so insert it in the code */ + struct opvar *jmp = New(struct opvar); + 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[-3].map)); + } + Free((yyvsp[-3].map)); + } +#line 3060 "y.tab.c" /* yacc.c:1646 */ + break; + + case 131: +#line 804 "lev_comp.y" /* yacc.c:1646 */ + { + add_opcode(splev, SPO_EXIT, NULL); + } +#line 3068 "y.tab.c" /* yacc.c:1646 */ + break; + + case 132: +#line 810 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = 100; + } +#line 3076 "y.tab.c" /* yacc.c:1646 */ + break; + + case 133: +#line 814 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (yyvsp[0].i); + } +#line 3084 "y.tab.c" /* yacc.c:1646 */ + break; + + case 134: +#line 820 "lev_comp.y" /* yacc.c:1646 */ + { + /* val > rn2(100) */ + add_opvars(splev, "iio", (long)(yyvsp[0].i), 100, SPO_RN2); + (yyval.i) = SPO_JG; + } +#line 3094 "y.tab.c" /* yacc.c:1646 */ + break; + + case 135: +#line 826 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (yyvsp[-2].i); + } +#line 3102 "y.tab.c" /* yacc.c:1646 */ + break; + + case 136: +#line 830 "lev_comp.y" /* yacc.c:1646 */ + { + /* boolean, explicit foo != 0 */ + add_opvars(splev, "i", 0); + (yyval.i) = SPO_JNE; + } +#line 3112 "y.tab.c" /* yacc.c:1646 */ + break; + + case 137: +#line 838 "lev_comp.y" /* yacc.c:1646 */ + { + is_inconstant_number = 0; + } +#line 3120 "y.tab.c" /* yacc.c:1646 */ + break; + + case 138: +#line 842 "lev_comp.y" /* yacc.c:1646 */ + { + 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(); + } +#line 3146 "y.tab.c" /* yacc.c:1646 */ + break; + + case 139: +#line 864 "lev_comp.y" /* yacc.c:1646 */ + { + 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--; + + + } +#line 3184 "y.tab.c" /* yacc.c:1646 */ + break; + + case 142: +#line 904 "lev_comp.y" /* yacc.c:1646 */ + { + if (n_switch_case_list < MAX_SWITCH_CASES) { + struct opvar *tmppush = New(struct opvar); + set_opvar_int(tmppush, splev->n_opcodes); + switch_case_value[n_switch_case_list] = (yyvsp[-1].i); + switch_case_list[n_switch_case_list++] = tmppush; + } else lc_error("Too many cases in a switch."); + } +#line 3197 "y.tab.c" /* yacc.c:1646 */ + break; + + case 143: +#line 913 "lev_comp.y" /* yacc.c:1646 */ + { + } +#line 3204 "y.tab.c" /* yacc.c:1646 */ + break; + + case 144: +#line 916 "lev_comp.y" /* yacc.c:1646 */ + { + 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; + } +#line 3218 "y.tab.c" /* yacc.c:1646 */ + break; + + case 145: +#line 926 "lev_comp.y" /* yacc.c:1646 */ + { + } +#line 3225 "y.tab.c" /* yacc.c:1646 */ + break; + + case 146: +#line 931 "lev_comp.y" /* yacc.c:1646 */ + { + if (!allow_break_statements) + lc_error("Cannot use BREAK outside a statement block."); + else { + break_stmt_new(splev, splev->n_opcodes); + } + } +#line 3237 "y.tab.c" /* yacc.c:1646 */ + break; + + case 149: +#line 945 "lev_comp.y" /* yacc.c:1646 */ + { + 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[-4].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[-4].map), SPOVAR_INT); + /* define the for-loop variable. value is in stack (1st math_expr) */ + add_opvars(splev, "iso", 0, (yyvsp[-4].map), SPO_VAR_INIT); + + /* calculate value for the loop "step" variable */ + snprintf(buf2, 255, "%s step", (yyvsp[-4].map)); + add_opvars(splev, "vvo", buf, (yyvsp[-4].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[-4].map)); + forloop_list[n_forloops].jmp_point = splev->n_opcodes; + + n_forloops++; + Free((yyvsp[-4].map)); + } +#line 3271 "y.tab.c" /* yacc.c:1646 */ + break; + + case 150: +#line 977 "lev_comp.y" /* yacc.c:1646 */ + { + /* nothing */ + break_stmt_start(); + } +#line 3280 "y.tab.c" /* yacc.c:1646 */ + break; + + case 151: +#line 982 "lev_comp.y" /* yacc.c:1646 */ + { + 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); + } +#line 3302 "y.tab.c" /* yacc.c:1646 */ + break; + + case 152: +#line 1002 "lev_comp.y" /* yacc.c:1646 */ + { + 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(); + } +#line 3320 "y.tab.c" /* yacc.c:1646 */ + break; + + case 153: +#line 1016 "lev_comp.y" /* yacc.c:1646 */ + { + 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); + } +#line 3337 "y.tab.c" /* yacc.c:1646 */ + break; + + case 154: +#line 1031 "lev_comp.y" /* yacc.c:1646 */ + { + 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].i) ), NULL); + + } +#line 3361 "y.tab.c" /* yacc.c:1646 */ + break; + + case 155: +#line 1051 "lev_comp.y" /* yacc.c:1646 */ + { + 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?"); + } +#line 3373 "y.tab.c" /* yacc.c:1646 */ + break; + + case 156: +#line 1061 "lev_comp.y" /* yacc.c:1646 */ + { + 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[0].i) ), NULL); + + } +#line 3397 "y.tab.c" /* yacc.c:1646 */ + break; + + case 157: +#line 1081 "lev_comp.y" /* yacc.c:1646 */ + { + /* do nothing */ + } +#line 3405 "y.tab.c" /* yacc.c:1646 */ + break; + + case 158: +#line 1087 "lev_comp.y" /* yacc.c:1646 */ + { + 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?"); + } +#line 3417 "y.tab.c" /* yacc.c:1646 */ + break; + + case 159: +#line 1095 "lev_comp.y" /* yacc.c:1646 */ + { + 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?"); + } +#line 3438 "y.tab.c" /* yacc.c:1646 */ + break; + + case 160: +#line 1112 "lev_comp.y" /* yacc.c:1646 */ + { + 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?"); + } +#line 3450 "y.tab.c" /* yacc.c:1646 */ + break; + + case 161: +#line 1122 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_MESSAGE); + } +#line 3458 "y.tab.c" /* yacc.c:1646 */ + break; + + case 162: +#line 1128 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iiiiiio", -1, 0, -1, -1, -1, -1, SPO_CORRIDOR); + } +#line 3466 "y.tab.c" /* yacc.c:1646 */ + break; + + case 163: +#line 1132 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iiiiiio", -1, (yyvsp[0].i), -1, -1, -1, -1, SPO_CORRIDOR); + } +#line 3474 "y.tab.c" /* yacc.c:1646 */ + break; + + case 164: +#line 1136 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iiiiiio", -1, -1, -1, -1, -1, -1, SPO_CORRIDOR); + } +#line 3482 "y.tab.c" /* yacc.c:1646 */ + break; + + case 165: +#line 1142 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iiiiiio", + (yyvsp[-2].corpos).room, (yyvsp[-2].corpos).door, (yyvsp[-2].corpos).wall, + (yyvsp[0].corpos).room, (yyvsp[0].corpos).door, (yyvsp[0].corpos).wall, + SPO_CORRIDOR); + } +#line 3493 "y.tab.c" /* yacc.c:1646 */ + break; + + case 166: +#line 1149 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iiiiiio", + (yyvsp[-2].corpos).room, (yyvsp[-2].corpos).door, (yyvsp[-2].corpos).wall, + -1, -1, (long)(yyvsp[0].i), + SPO_CORRIDOR); + } +#line 3504 "y.tab.c" /* yacc.c:1646 */ + break; + + case 167: +#line 1158 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.corpos).room = (yyvsp[-5].i); + (yyval.corpos).wall = (yyvsp[-3].i); + (yyval.corpos).door = (yyvsp[-1].i); + } +#line 3514 "y.tab.c" /* yacc.c:1646 */ + break; + + case 168: +#line 1166 "lev_comp.y" /* yacc.c:1646 */ + { + if (((yyvsp[-2].i) < 100) && ((yyvsp[-3].i) == OROOM)) + lc_error("Only typed rooms can have a chance."); + else { + add_opvars(splev, "iii", (long)(yyvsp[-3].i), (long)(yyvsp[-2].i), (long)(yyvsp[0].i)); + } + } +#line 3526 "y.tab.c" /* yacc.c:1646 */ + break; + + case 169: +#line 1176 "lev_comp.y" /* yacc.c:1646 */ + { + long flags = (yyvsp[0].i); + if (flags == -1) flags = (1 << 0); + add_opvars(splev, "iiiiiiio", flags, ERR, ERR, + (yyvsp[-3].crd).x, (yyvsp[-3].crd).y, (yyvsp[-1].sze).width, (yyvsp[-1].sze).height, SPO_SUBROOM); + break_stmt_start(); + } +#line 3538 "y.tab.c" /* yacc.c:1646 */ + break; + + case 170: +#line 1184 "lev_comp.y" /* yacc.c:1646 */ + { + break_stmt_end(splev); + add_opcode(splev, SPO_ENDROOM, NULL); + } +#line 3547 "y.tab.c" /* yacc.c:1646 */ + break; + + case 171: +#line 1191 "lev_comp.y" /* yacc.c:1646 */ + { + long flags = (yyvsp[-2].i); + if (flags == -1) flags = (1 << 0); + add_opvars(splev, "iiiiiiio", flags, + (yyvsp[-3].crd).x, (yyvsp[-3].crd).y, (yyvsp[-5].crd).x, (yyvsp[-5].crd).y, + (yyvsp[-1].sze).width, (yyvsp[-1].sze).height, SPO_ROOM); + break_stmt_start(); + } +#line 3560 "y.tab.c" /* yacc.c:1646 */ + break; + + case 172: +#line 1200 "lev_comp.y" /* yacc.c:1646 */ + { + break_stmt_end(splev); + add_opcode(splev, SPO_ENDROOM, NULL); + } +#line 3569 "y.tab.c" /* yacc.c:1646 */ + break; + + case 173: +#line 1207 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = 1; + } +#line 3577 "y.tab.c" /* yacc.c:1646 */ + break; + + case 174: +#line 1211 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (yyvsp[0].i); + } +#line 3585 "y.tab.c" /* yacc.c:1646 */ + break; + + case 175: +#line 1217 "lev_comp.y" /* yacc.c:1646 */ + { + if ( (yyvsp[-3].i) < 1 || (yyvsp[-3].i) > 5 || + (yyvsp[-1].i) < 1 || (yyvsp[-1].i) > 5 ) { + lc_error("Room positions should be between 1-5: (%li,%li)!", (yyvsp[-3].i), (yyvsp[-1].i)); + } else { + (yyval.crd).x = (yyvsp[-3].i); + (yyval.crd).y = (yyvsp[-1].i); } + } +#line 3599 "y.tab.c" /* yacc.c:1646 */ + break; + + case 176: +#line 1227 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.crd).x = (yyval.crd).y = ERR; + } +#line 3607 "y.tab.c" /* yacc.c:1646 */ + break; + + case 177: +#line 1233 "lev_comp.y" /* yacc.c:1646 */ + { + if ( (yyvsp[-3].i) < 0 || (yyvsp[-1].i) < 0) { + lc_error("Invalid subroom position (%li,%li)!", (yyvsp[-3].i), (yyvsp[-1].i)); + } else { + (yyval.crd).x = (yyvsp[-3].i); + (yyval.crd).y = (yyvsp[-1].i); + } + } +#line 3620 "y.tab.c" /* yacc.c:1646 */ + break; + + case 178: +#line 1242 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.crd).x = (yyval.crd).y = ERR; + } +#line 3628 "y.tab.c" /* yacc.c:1646 */ + break; + + case 179: +#line 1248 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.crd).x = (yyvsp[-3].i); + (yyval.crd).y = (yyvsp[-1].i); + } +#line 3637 "y.tab.c" /* yacc.c:1646 */ + break; + + case 180: +#line 1253 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.crd).x = (yyval.crd).y = ERR; + } +#line 3645 "y.tab.c" /* yacc.c:1646 */ + break; + + case 181: +#line 1259 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.sze).width = (yyvsp[-3].i); + (yyval.sze).height = (yyvsp[-1].i); + } +#line 3654 "y.tab.c" /* yacc.c:1646 */ + break; + + case 182: +#line 1264 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.sze).height = (yyval.sze).width = ERR; + } +#line 3662 "y.tab.c" /* yacc.c:1646 */ + break; + + case 183: +#line 1270 "lev_comp.y" /* yacc.c:1646 */ + { + /* ERR means random here */ + if ((yyvsp[-2].i) == ERR && (yyvsp[0].i) != ERR) { + lc_error("If the door wall is random, so must be its pos!"); + } else { + add_opvars(splev, "iiiio", (long)(yyvsp[0].i), (long)(yyvsp[-4].i), (long)(yyvsp[-6].i), (long)(yyvsp[-2].i), SPO_ROOM_DOOR); + } + } +#line 3675 "y.tab.c" /* yacc.c:1646 */ + break; + + case 184: +#line 1279 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", (long)(yyvsp[-2].i), SPO_DOOR); + } +#line 3683 "y.tab.c" /* yacc.c:1646 */ + break; + + case 189: +#line 1293 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (yyvsp[0].i); + } +#line 3691 "y.tab.c" /* yacc.c:1646 */ + break; + + case 190: +#line 1297 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = ((yyvsp[-2].i) | (yyvsp[0].i)); + } +#line 3699 "y.tab.c" /* yacc.c:1646 */ + break; + + case 193: +#line 1307 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ciisiio", 0, 0, 1, (char *)0, 0, 0, SPO_MAP); + max_x_map = COLNO-1; + max_y_map = ROWNO; + } +#line 3709 "y.tab.c" /* yacc.c:1646 */ + break; + + case 194: +#line 1313 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "cii", SP_COORD_PACK(((yyvsp[-4].i)),((yyvsp[-2].i))), 1, (long)(yyvsp[-1].i)); + scan_map((yyvsp[0].map), splev); + Free((yyvsp[0].map)); + } +#line 3719 "y.tab.c" /* yacc.c:1646 */ + break; + + case 195: +#line 1319 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", 2, (long)(yyvsp[-1].i)); + scan_map((yyvsp[0].map), splev); + Free((yyvsp[0].map)); + } +#line 3729 "y.tab.c" /* yacc.c:1646 */ + break; + + case 200: +#line 1335 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", 0, SPO_MONSTER); + } +#line 3737 "y.tab.c" /* yacc.c:1646 */ + break; + + case 201: +#line 1339 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", 1, SPO_MONSTER); + in_container_obj++; + break_stmt_start(); + } +#line 3747 "y.tab.c" /* yacc.c:1646 */ + break; + + case 202: +#line 1345 "lev_comp.y" /* yacc.c:1646 */ + { + break_stmt_end(splev); + in_container_obj--; + add_opvars(splev, "o", SPO_END_MONINVENT); + } +#line 3757 "y.tab.c" /* yacc.c:1646 */ + break; + + case 203: +#line 1353 "lev_comp.y" /* yacc.c:1646 */ + { + /* nothing */ + } +#line 3765 "y.tab.c" /* yacc.c:1646 */ + break; + + case 204: +#line 1359 "lev_comp.y" /* yacc.c:1646 */ + { + struct opvar *stopit = New(struct opvar); + set_opvar_int(stopit, SP_M_V_END); + add_opcode(splev, SPO_PUSH, stopit); + (yyval.i) = 0x0000; + } +#line 3776 "y.tab.c" /* yacc.c:1646 */ + break; + + case 205: +#line 1366 "lev_comp.y" /* yacc.c:1646 */ + { + if (( (yyvsp[-2].i) & (yyvsp[0].i) )) + lc_error("MONSTER extra info defined twice."); + (yyval.i) = ( (yyvsp[-2].i) | (yyvsp[0].i) ); + } +#line 3786 "y.tab.c" /* yacc.c:1646 */ + break; + + case 206: +#line 1374 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", SP_M_V_NAME); + (yyval.i) = 0x0001; + } +#line 3795 "y.tab.c" /* yacc.c:1646 */ + break; + + case 207: +#line 1379 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", (long)(yyvsp[0].i), SP_M_V_PEACEFUL); + (yyval.i) = 0x0002; + } +#line 3804 "y.tab.c" /* yacc.c:1646 */ + break; + + case 208: +#line 1384 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", (long)(yyvsp[0].i), SP_M_V_ASLEEP); + (yyval.i) = 0x0004; + } +#line 3813 "y.tab.c" /* yacc.c:1646 */ + break; + + case 209: +#line 1389 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", (long)(yyvsp[0].i), SP_M_V_ALIGN); + (yyval.i) = 0x0008; + } +#line 3822 "y.tab.c" /* yacc.c:1646 */ + break; + + case 210: +#line 1394 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", (long)(yyvsp[-1].i), SP_M_V_APPEAR); + (yyval.i) = 0x0010; + } +#line 3831 "y.tab.c" /* yacc.c:1646 */ + break; + + case 211: +#line 1399 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", 1, SP_M_V_FEMALE); + (yyval.i) = 0x0020; + } +#line 3840 "y.tab.c" /* yacc.c:1646 */ + break; + + case 212: +#line 1404 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", 1, SP_M_V_INVIS); + (yyval.i) = 0x0040; + } +#line 3849 "y.tab.c" /* yacc.c:1646 */ + break; + + case 213: +#line 1409 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", 1, SP_M_V_CANCELLED); + (yyval.i) = 0x0080; + } +#line 3858 "y.tab.c" /* yacc.c:1646 */ + break; + + case 214: +#line 1414 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", 1, SP_M_V_REVIVED); + (yyval.i) = 0x0100; + } +#line 3867 "y.tab.c" /* yacc.c:1646 */ + break; + + case 215: +#line 1419 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", 1, SP_M_V_AVENGE); + (yyval.i) = 0x0200; + } +#line 3876 "y.tab.c" /* yacc.c:1646 */ + break; + + case 216: +#line 1424 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", SP_M_V_FLEEING); + (yyval.i) = 0x0400; + } +#line 3885 "y.tab.c" /* yacc.c:1646 */ + break; + + case 217: +#line 1429 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", SP_M_V_BLINDED); + (yyval.i) = 0x0800; + } +#line 3894 "y.tab.c" /* yacc.c:1646 */ + break; + + case 218: +#line 1434 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", SP_M_V_PARALYZED); + (yyval.i) = 0x1000; + } +#line 3903 "y.tab.c" /* yacc.c:1646 */ + break; + + case 219: +#line 1439 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", 1, SP_M_V_STUNNED); + (yyval.i) = 0x2000; + } +#line 3912 "y.tab.c" /* yacc.c:1646 */ + break; + + case 220: +#line 1444 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", 1, SP_M_V_CONFUSED); + (yyval.i) = 0x4000; + } +#line 3921 "y.tab.c" /* yacc.c:1646 */ + break; + + case 221: +#line 1449 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", (long)(yyvsp[0].i), SP_M_V_SEENTRAPS); + (yyval.i) = 0x8000; + } +#line 3930 "y.tab.c" /* yacc.c:1646 */ + break; + + case 222: +#line 1456 "lev_comp.y" /* yacc.c:1646 */ + { + int token = get_trap_type((yyvsp[0].map)); + if (token == ERR || token == 0) + lc_error("Unknown trap type '%s'!", (yyvsp[0].map)); + (yyval.i) = (1L << (token - 1)); + } +#line 3941 "y.tab.c" /* yacc.c:1646 */ + break; + + case 223: +#line 1463 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (long) ~0; + } +#line 3949 "y.tab.c" /* yacc.c:1646 */ + break; + + case 224: +#line 1467 "lev_comp.y" /* yacc.c:1646 */ + { + int token = get_trap_type((yyvsp[-2].map)); + if (token == ERR || token == 0) + lc_error("Unknown trap type '%s'!", (yyvsp[-2].map)); + + if ((1L << (token - 1)) & (yyvsp[0].i)) + lc_error("Monster seen_traps, trap '%s' listed twice.", (yyvsp[-2].map)); + + (yyval.i) = ((1L << (token - 1)) | (yyvsp[0].i)); + } +#line 3964 "y.tab.c" /* yacc.c:1646 */ + break; + + case 225: +#line 1480 "lev_comp.y" /* yacc.c:1646 */ + { + long cnt = 0; + if (in_container_obj) cnt |= SP_OBJ_CONTENT; + add_opvars(splev, "io", cnt, SPO_OBJECT); + } +#line 3974 "y.tab.c" /* yacc.c:1646 */ + break; + + case 226: +#line 1486 "lev_comp.y" /* yacc.c:1646 */ + { + 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(); + } +#line 3986 "y.tab.c" /* yacc.c:1646 */ + break; + + case 227: +#line 1494 "lev_comp.y" /* yacc.c:1646 */ + { + break_stmt_end(splev); + in_container_obj--; + add_opcode(splev, SPO_POP_CONTAINER, NULL); + } +#line 3996 "y.tab.c" /* yacc.c:1646 */ + break; + + case 228: +#line 1502 "lev_comp.y" /* yacc.c:1646 */ + { + if (( (yyvsp[0].i) & 0x4000) && in_container_obj) lc_error("Object cannot have a coord when contained."); + else if (!( (yyvsp[0].i) & 0x4000) && !in_container_obj) lc_error("Object needs a coord when not contained."); + } +#line 4005 "y.tab.c" /* yacc.c:1646 */ + break; + + case 229: +#line 1509 "lev_comp.y" /* yacc.c:1646 */ + { + struct opvar *stopit = New(struct opvar); + set_opvar_int(stopit, SP_O_V_END); + add_opcode(splev, SPO_PUSH, stopit); + (yyval.i) = 0x00; + } +#line 4016 "y.tab.c" /* yacc.c:1646 */ + break; + + case 230: +#line 1516 "lev_comp.y" /* yacc.c:1646 */ + { + if (( (yyvsp[-2].i) & (yyvsp[0].i) )) + lc_error("OBJECT extra info '%s' defined twice.", curr_token); + (yyval.i) = ( (yyvsp[-2].i) | (yyvsp[0].i) ); + } +#line 4026 "y.tab.c" /* yacc.c:1646 */ + break; + + case 231: +#line 1524 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", (long)(yyvsp[0].i), SP_O_V_CURSE); + (yyval.i) = 0x0001; + } +#line 4035 "y.tab.c" /* yacc.c:1646 */ + break; + + case 232: +#line 1529 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", SP_O_V_CORPSENM); + (yyval.i) = 0x0002; + } +#line 4044 "y.tab.c" /* yacc.c:1646 */ + break; + + case 233: +#line 1534 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", SP_O_V_SPE); + (yyval.i) = 0x0004; + } +#line 4053 "y.tab.c" /* yacc.c:1646 */ + break; + + case 234: +#line 1539 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", SP_O_V_NAME); + (yyval.i) = 0x0008; + } +#line 4062 "y.tab.c" /* yacc.c:1646 */ + break; + + case 235: +#line 1544 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", SP_O_V_QUAN); + (yyval.i) = 0x0010; + } +#line 4071 "y.tab.c" /* yacc.c:1646 */ + break; + + case 236: +#line 1549 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", 1, SP_O_V_BURIED); + (yyval.i) = 0x0020; + } +#line 4080 "y.tab.c" /* yacc.c:1646 */ + break; + + case 237: +#line 1554 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", (long)(yyvsp[0].i), SP_O_V_LIT); + (yyval.i) = 0x0040; + } +#line 4089 "y.tab.c" /* yacc.c:1646 */ + break; + + case 238: +#line 1559 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", SP_O_V_ERODED); + (yyval.i) = 0x0080; + } +#line 4098 "y.tab.c" /* yacc.c:1646 */ + break; + + case 239: +#line 1564 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", -1, SP_O_V_ERODED); + (yyval.i) = 0x0080; + } +#line 4107 "y.tab.c" /* yacc.c:1646 */ + break; + + case 240: +#line 1569 "lev_comp.y" /* yacc.c:1646 */ + { + if ((yyvsp[0].i) == D_LOCKED) { + add_opvars(splev, "ii", 1, SP_O_V_LOCKED); + (yyval.i) = 0x0100; + } else if ((yyvsp[0].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."); + } +#line 4122 "y.tab.c" /* yacc.c:1646 */ + break; + + case 241: +#line 1580 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", 1, SP_O_V_TRAPPED); + (yyval.i) = 0x0400; + } +#line 4131 "y.tab.c" /* yacc.c:1646 */ + break; + + case 242: +#line 1585 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", SP_O_V_RECHARGED); + (yyval.i) = 0x0800; + } +#line 4140 "y.tab.c" /* yacc.c:1646 */ + break; + + case 243: +#line 1590 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", 1, SP_O_V_INVIS); + (yyval.i) = 0x1000; + } +#line 4149 "y.tab.c" /* yacc.c:1646 */ + break; + + case 244: +#line 1595 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "ii", 1, SP_O_V_GREASED); + (yyval.i) = 0x2000; + } +#line 4158 "y.tab.c" /* yacc.c:1646 */ + break; + + case 245: +#line 1600 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", SP_O_V_COORD); + (yyval.i) = 0x4000; + } +#line 4167 "y.tab.c" /* yacc.c:1646 */ + break; + + case 246: +#line 1607 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", (long)(yyvsp[-2].i), SPO_TRAP); + } +#line 4175 "y.tab.c" /* yacc.c:1646 */ + break; + + case 247: +#line 1613 "lev_comp.y" /* yacc.c:1646 */ + { + long d, state = 0; + /* convert dir from a DIRECTION to a DB_DIR */ + d = (yyvsp[-2].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[0].i) == D_ISOPEN ) + state = 1; + else if ( (yyvsp[0].i) == D_CLOSED ) + state = 0; + else if ( (yyvsp[0].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; +#line 4204 "y.tab.c" /* yacc.c:1646 */ + 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 1640 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iiio", + (long)(yyvsp[0].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--; - } +#line 4213 "y.tab.c" /* yacc.c:1646 */ + break; + + case 249: +#line 1645 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iiio", + (long)(yyvsp[-3].i), (long)(yyvsp[-1].i), (long)(yyvsp[0].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--; - } +#line 4222 "y.tab.c" /* yacc.c:1646 */ + break; + + case 250: +#line 1652 "lev_comp.y" /* yacc.c:1646 */ + { + 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--; - } +#line 4230 "y.tab.c" /* yacc.c:1646 */ + break; + + case 251: +#line 1656 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", 1, SPO_WALLIFY); } -break; -case 180: -{ - yyval.i = - MAX_REGISTERS - 1; +#line 4238 "y.tab.c" /* yacc.c:1646 */ + break; + + case 252: +#line 1662 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", (long)(yyvsp[0].i), SPO_LADDER); } -break; -case 183: -{ - yyval.i = - MAX_REGISTERS - 1; +#line 4246 "y.tab.c" /* yacc.c:1646 */ + break; + + case 253: +#line 1668 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", (long)(yyvsp[0].i), SPO_STAIR); } -break; -case 186: -{ - yyval.map = (char *) 0; +#line 4254 "y.tab.c" /* yacc.c:1646 */ + break; + + case 254: +#line 1674 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iiiii iiiii iiso", + (yyvsp[-4].lregn).x1, (yyvsp[-4].lregn).y1, (yyvsp[-4].lregn).x2, (yyvsp[-4].lregn).y2, (yyvsp[-4].lregn).area, + (yyvsp[-2].lregn).x1, (yyvsp[-2].lregn).y1, (yyvsp[-2].lregn).x2, (yyvsp[-2].lregn).y2, (yyvsp[-2].lregn).area, + (long)(((yyvsp[0].i)) ? LR_UPSTAIR : LR_DOWNSTAIR), + 0, (char *)0, SPO_LEVREGION); } -break; -case 188: -{ - yyval.map = (char *) 0; +#line 4266 "y.tab.c" /* yacc.c:1646 */ + break; + + case 255: +#line 1684 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iiiii iiiii iiso", + (yyvsp[-4].lregn).x1, (yyvsp[-4].lregn).y1, (yyvsp[-4].lregn).x2, (yyvsp[-4].lregn).y2, (yyvsp[-4].lregn).area, + (yyvsp[-2].lregn).x1, (yyvsp[-2].lregn).y1, (yyvsp[-2].lregn).x2, (yyvsp[-2].lregn).y2, (yyvsp[-2].lregn).area, + LR_PORTAL, 0, (yyvsp[0].map), SPO_LEVREGION); + Free((yyvsp[0].map)); } -break; -case 189: -{ - int token = get_trap_type(yyvsp[0].map); +#line 4278 "y.tab.c" /* yacc.c:1646 */ + break; + + case 256: +#line 1694 "lev_comp.y" /* yacc.c:1646 */ + { + long rtype = 0; + switch((yyvsp[0].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].lregn).x1, (yyvsp[-3].lregn).y1, (yyvsp[-3].lregn).x2, (yyvsp[-3].lregn).y2, (yyvsp[-3].lregn).area, + (yyvsp[-1].lregn).x1, (yyvsp[-1].lregn).y1, (yyvsp[-1].lregn).x2, (yyvsp[-1].lregn).y2, (yyvsp[-1].lregn).area, + rtype, 0, (char *)0, SPO_LEVREGION); + } +#line 4295 "y.tab.c" /* yacc.c:1646 */ + break; + + case 257: +#line 1709 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iiiii iiiii iiso", + (yyvsp[-2].lregn).x1, (yyvsp[-2].lregn).y1, (yyvsp[-2].lregn).x2, (yyvsp[-2].lregn).y2, (yyvsp[-2].lregn).area, + (yyvsp[0].lregn).x1, (yyvsp[0].lregn).y1, (yyvsp[0].lregn).x2, (yyvsp[0].lregn).y2, (yyvsp[0].lregn).area, + (long)LR_BRANCH, 0, (char *)0, SPO_LEVREGION); + } +#line 4306 "y.tab.c" /* yacc.c:1646 */ + break; + + case 258: +#line 1718 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = -1; + } +#line 4314 "y.tab.c" /* yacc.c:1646 */ + break; + + case 259: +#line 1722 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (yyvsp[0].i); + } +#line 4322 "y.tab.c" /* yacc.c:1646 */ + break; + + case 260: +#line 1728 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_FOUNTAIN); + } +#line 4330 "y.tab.c" /* yacc.c:1646 */ + break; + + case 261: +#line 1734 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_SINK); + } +#line 4338 "y.tab.c" /* yacc.c:1646 */ + break; + + case 262: +#line 1740 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_POOL); + } +#line 4346 "y.tab.c" /* yacc.c:1646 */ + break; + + case 263: +#line 1746 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.terr).lit = -2; + (yyval.terr).ter = what_map_char((char) (yyvsp[0].i)); + } +#line 4355 "y.tab.c" /* yacc.c:1646 */ + break; + + case 264: +#line 1751 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.terr).lit = (yyvsp[-1].i); + (yyval.terr).ter = what_map_char((char) (yyvsp[-3].i)); + } +#line 4364 "y.tab.c" /* yacc.c:1646 */ + break; + + case 265: +#line 1758 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", (yyvsp[0].i), SPO_REPLACETERRAIN); + } +#line 4372 "y.tab.c" /* yacc.c:1646 */ + break; + + case 266: +#line 1764 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_TERRAIN); + } +#line 4380 "y.tab.c" /* yacc.c:1646 */ + break; + + case 267: +#line 1770 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_NON_DIGGABLE); + } +#line 4388 "y.tab.c" /* yacc.c:1646 */ + break; + + case 268: +#line 1776 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_NON_PASSWALL); + } +#line 4396 "y.tab.c" /* yacc.c:1646 */ + break; + + case 269: +#line 1782 "lev_comp.y" /* yacc.c:1646 */ + { + long irr; + long rt = (yyvsp[-1].i); + long flags = (yyvsp[0].i); + if (flags == -1) flags = (1 << 0); + if (!(( flags ) & 1)) rt += MAXRTYPE+1; + irr = ((( flags ) & 2) != 0); + add_opvars(splev, "iiio", + (long)(yyvsp[-3].i), rt, flags, SPO_REGION); + (yyval.i) = (irr || (flags & 1) || rt != OROOM); + break_stmt_start(); + } +#line 4413 "y.tab.c" /* yacc.c:1646 */ + break; + + case 270: +#line 1795 "lev_comp.y" /* yacc.c:1646 */ + { + break_stmt_end(splev); + if ( (yyvsp[-1].i) ) { + add_opcode(splev, SPO_ENDROOM, NULL); + } else if ( (yyvsp[0].i) ) + lc_error("Cannot use lev statements in non-permanent REGION"); + } +#line 4425 "y.tab.c" /* yacc.c:1646 */ + break; + + case 271: +#line 1805 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = 0; + } +#line 4433 "y.tab.c" /* yacc.c:1646 */ + break; + + case 272: +#line 1809 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (yyvsp[0].i); + } +#line 4441 "y.tab.c" /* yacc.c:1646 */ + break; + + case 273: +#line 1815 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iio", (long)(yyvsp[0].i), (long)(yyvsp[-2].i), SPO_ALTAR); + } +#line 4449 "y.tab.c" /* yacc.c:1646 */ + break; + + case 274: +#line 1821 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", 2, SPO_GRAVE); + } +#line 4457 "y.tab.c" /* yacc.c:1646 */ + break; + + case 275: +#line 1825 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "sio", + (char *)0, 1, SPO_GRAVE); + } +#line 4466 "y.tab.c" /* yacc.c:1646 */ + break; + + case 276: +#line 1830 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "sio", + (char *)0, 0, SPO_GRAVE); + } +#line 4475 "y.tab.c" /* yacc.c:1646 */ + break; + + case 277: +#line 1837 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_GOLD); + } +#line 4483 "y.tab.c" /* yacc.c:1646 */ + break; + + case 278: +#line 1843 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", + (long)(yyvsp[-2].i), SPO_ENGRAVING); + } +#line 4492 "y.tab.c" /* yacc.c:1646 */ + break; + + case 279: +#line 1850 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_MINERALIZE); + } +#line 4500 "y.tab.c" /* yacc.c:1646 */ + break; + + case 280: +#line 1854 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iiiio", -1L, -1L, -1L, -1L, SPO_MINERALIZE); + } +#line 4508 "y.tab.c" /* yacc.c:1646 */ + break; + + case 281: +#line 1860 "lev_comp.y" /* yacc.c:1646 */ + { + int token = get_trap_type((yyvsp[0].map)); if (token == ERR) - yyerror("Unknown trap type!"); - yyval.i = token; - Free(yyvsp[0].map); + lc_error("Unknown trap type '%s'!", (yyvsp[0].map)); + (yyval.i) = token; + Free((yyvsp[0].map)); } -break; -case 191: -{ - int token = get_room_type(yyvsp[0].map); +#line 4520 "y.tab.c" /* yacc.c:1646 */ + break; + + case 283: +#line 1871 "lev_comp.y" /* yacc.c:1646 */ + { + int token = get_room_type((yyvsp[0].map)); if (token == ERR) { - yywarning("Unknown room type! Making ordinary room..."); - yyval.i = OROOM; + lc_warning("Unknown room type \"%s\"! Making ordinary room...", (yyvsp[0].map)); + (yyval.i) = OROOM; } else - yyval.i = token; - Free(yyvsp[0].map); + (yyval.i) = token; + Free((yyvsp[0].map)); } -break; -case 193: -{ - yyval.i = 0; +#line 4534 "y.tab.c" /* yacc.c:1646 */ + break; + + case 285: +#line 1884 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = -1; } -break; -case 194: -{ - yyval.i = yyvsp[0].i; +#line 4542 "y.tab.c" /* yacc.c:1646 */ + break; + + case 286: +#line 1888 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (yyvsp[0].i); } -break; -case 195: -{ - yyval.i = yyvsp[-2].i + (yyvsp[0].i << 1); +#line 4550 "y.tab.c" /* yacc.c:1646 */ + break; + + case 287: +#line 1894 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (yyvsp[0].i); } -break; -case 198: -{ - current_coord.x = current_coord.y = -MAX_REGISTERS-1; +#line 4558 "y.tab.c" /* yacc.c:1646 */ + break; + + case 288: +#line 1898 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (yyvsp[-2].i) | (yyvsp[0].i); } -break; -case 205: -{ - yyval.i = - MAX_REGISTERS - 1; +#line 4566 "y.tab.c" /* yacc.c:1646 */ + break; + + case 289: +#line 1905 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = ((yyvsp[0].i) << 0); } -break; -case 208: -{ - if ( yyvsp[-1].i >= MAX_REGISTERS ) - yyerror("Register Index overflow!"); +#line 4574 "y.tab.c" /* yacc.c:1646 */ + break; + + case 290: +#line 1909 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = ((yyvsp[0].i) << 1); + } +#line 4582 "y.tab.c" /* yacc.c:1646 */ + break; + + case 291: +#line 1913 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = ((yyvsp[0].i) << 2); + } +#line 4590 "y.tab.c" /* yacc.c:1646 */ + break; + + case 298: +#line 1929 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = - MAX_REGISTERS - 1; + } +#line 4598 "y.tab.c" /* yacc.c:1646 */ + break; + + case 301: +#line 1937 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = - MAX_REGISTERS - 1; + } +#line 4606 "y.tab.c" /* yacc.c:1646 */ + break; + + case 304: +#line 1947 "lev_comp.y" /* yacc.c:1646 */ + { + if ( (yyvsp[-1].i) >= 3 ) + lc_error("Register Index overflow!"); else - current_coord.x = current_coord.y = - yyvsp[-1].i - 1; + (yyval.i) = - (yyvsp[-1].i) - 1; } -break; -case 209: -{ - if ( yyvsp[-1].i >= MAX_REGISTERS ) - yyerror("Register Index overflow!"); - else - yyval.i = - yyvsp[-1].i - 1; +#line 4617 "y.tab.c" /* yacc.c:1646 */ + break; + + case 305: +#line 1956 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "s", (yyvsp[0].map)); + Free((yyvsp[0].map)); } -break; -case 210: -{ - if ( yyvsp[-1].i >= MAX_REGISTERS ) - yyerror("Register Index overflow!"); - else - yyval.i = - yyvsp[-1].i - 1; +#line 4626 "y.tab.c" /* yacc.c:1646 */ + break; + + case 306: +#line 1961 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_STRING); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); } -break; -case 211: -{ - if ( yyvsp[-1].i >= 3 ) - yyerror("Register Index overflow!"); - else - yyval.i = - yyvsp[-1].i - 1; +#line 4637 "y.tab.c" /* yacc.c:1646 */ + break; + + case 307: +#line 1968 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_STRING|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); } -break; -case 213: -{ - if (check_monster_char((char) yyvsp[0].i)) - yyval.i = yyvsp[0].i ; +#line 4648 "y.tab.c" /* yacc.c:1646 */ + break; + + case 308: +#line 1978 "lev_comp.y" /* yacc.c:1646 */ + { + /* nothing */ + } +#line 4656 "y.tab.c" /* yacc.c:1646 */ + break; + + case 309: +#line 1984 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "c", (yyvsp[0].i)); + } +#line 4664 "y.tab.c" /* yacc.c:1646 */ + break; + + case 310: +#line 1988 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_SEL_RNDCOORD); + } +#line 4672 "y.tab.c" /* yacc.c:1646 */ + break; + + case 311: +#line 1992 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_COORD); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); + } +#line 4683 "y.tab.c" /* yacc.c:1646 */ + break; + + case 312: +#line 1999 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_COORD|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); + } +#line 4694 "y.tab.c" /* yacc.c:1646 */ + break; + + case 313: +#line 2008 "lev_comp.y" /* yacc.c:1646 */ + { + if ((yyvsp[-3].i) < 0 || (yyvsp[-1].i) < 0 || (yyvsp[-3].i) >= COLNO || (yyvsp[-1].i) >= ROWNO) + lc_error("Coordinates (%li,%li) out of map range!", (yyvsp[-3].i), (yyvsp[-1].i)); + (yyval.i) = SP_COORD_PACK((yyvsp[-3].i), (yyvsp[-1].i)); + } +#line 4704 "y.tab.c" /* yacc.c:1646 */ + break; + + case 314: +#line 2014 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = SP_COORD_PACK_RANDOM(0); + } +#line 4712 "y.tab.c" /* yacc.c:1646 */ + break; + + case 315: +#line 2018 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = SP_COORD_PACK_RANDOM( (yyvsp[-1].i) ); + } +#line 4720 "y.tab.c" /* yacc.c:1646 */ + break; + + case 316: +#line 2024 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (yyvsp[0].i); + } +#line 4728 "y.tab.c" /* yacc.c:1646 */ + break; + + case 317: +#line 2028 "lev_comp.y" /* yacc.c:1646 */ + { + if (((yyvsp[-2].i) & (yyvsp[0].i))) + lc_warning("Humidity flag used twice."); + (yyval.i) = ((yyvsp[-2].i) | (yyvsp[0].i)); + } +#line 4738 "y.tab.c" /* yacc.c:1646 */ + break; + + case 318: +#line 2036 "lev_comp.y" /* yacc.c:1646 */ + { + /* nothing */ + } +#line 4746 "y.tab.c" /* yacc.c:1646 */ + break; + + case 319: +#line 2040 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_REGION); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); + } +#line 4757 "y.tab.c" /* yacc.c:1646 */ + break; + + case 320: +#line 2047 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_REGION|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); + } +#line 4768 "y.tab.c" /* yacc.c:1646 */ + break; + + case 321: +#line 2056 "lev_comp.y" /* yacc.c:1646 */ + { + long r = SP_REGION_PACK((yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + if ( (yyvsp[-7].i) > (yyvsp[-3].i) || (yyvsp[-5].i) > (yyvsp[-1].i) ) + lc_error("Region start > end: (%li,%li,%li,%li)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + + add_opvars(splev, "r", r); + (yyval.i) = r; + } +#line 4781 "y.tab.c" /* yacc.c:1646 */ + break; + + case 322: +#line 2067 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "m", (yyvsp[0].i)); + } +#line 4789 "y.tab.c" /* yacc.c:1646 */ + break; + + case 323: +#line 2071 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_MAPCHAR); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); + } +#line 4800 "y.tab.c" /* yacc.c:1646 */ + break; + + case 324: +#line 2078 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); + } +#line 4811 "y.tab.c" /* yacc.c:1646 */ + break; + + case 325: +#line 2087 "lev_comp.y" /* yacc.c:1646 */ + { + if (what_map_char((char) (yyvsp[0].i)) != INVALID_TYPE) + (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[0].i)), -2); + else { + lc_error("Unknown map char type '%c'!", (yyvsp[0].i)); + (yyval.i) = SP_MAPCHAR_PACK(STONE, -2); + } + } +#line 4824 "y.tab.c" /* yacc.c:1646 */ + break; + + case 326: +#line 2096 "lev_comp.y" /* yacc.c:1646 */ + { + if (what_map_char((char) (yyvsp[-3].i)) != INVALID_TYPE) + (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[-3].i)), (yyvsp[-1].i)); + else { + lc_error("Unknown map char type '%c'!", (yyvsp[-3].i)); + (yyval.i) = SP_MAPCHAR_PACK(STONE, (yyvsp[-1].i)); + } + } +#line 4837 "y.tab.c" /* yacc.c:1646 */ + break; + + case 327: +#line 2107 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "M", (yyvsp[0].i)); + } +#line 4845 "y.tab.c" /* yacc.c:1646 */ + break; + + case 328: +#line 2111 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_MONST); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); + } +#line 4856 "y.tab.c" /* yacc.c:1646 */ + break; + + case 329: +#line 2118 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_MONST|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); + } +#line 4867 "y.tab.c" /* yacc.c:1646 */ + break; + + case 330: +#line 2127 "lev_comp.y" /* yacc.c:1646 */ + { + long m = get_monster_id((yyvsp[0].map), (char)0); + if (m == ERR) { + lc_error("Unknown monster \"%s\"!", (yyvsp[0].map)); + (yyval.i) = -1; + } else + (yyval.i) = SP_MONST_PACK(m, def_monsyms[(int)mons[m].mlet].sym); + } +#line 4880 "y.tab.c" /* yacc.c:1646 */ + break; + + case 331: +#line 2136 "lev_comp.y" /* yacc.c:1646 */ + { + if (check_monster_char((char) (yyvsp[0].i))) + (yyval.i) = SP_MONST_PACK(-1, (yyvsp[0].i)); + else { + lc_error("Unknown monster class '%c'!", (yyvsp[0].i)); + (yyval.i) = -1; + } + } +#line 4893 "y.tab.c" /* yacc.c:1646 */ + break; + + case 332: +#line 2145 "lev_comp.y" /* yacc.c:1646 */ + { + long m = get_monster_id((yyvsp[-1].map), (char) (yyvsp[-3].i)); + if (m == ERR) { + lc_error("Unknown monster ('%c', \"%s\")!", (yyvsp[-3].i), (yyvsp[-1].map)); + (yyval.i) = -1; + } else + (yyval.i) = SP_MONST_PACK(m, (yyvsp[-3].i)); + } +#line 4906 "y.tab.c" /* yacc.c:1646 */ + break; + + case 333: +#line 2154 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = -1; + } +#line 4914 "y.tab.c" /* yacc.c:1646 */ + break; + + case 334: +#line 2160 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "O", (yyvsp[0].i)); + } +#line 4922 "y.tab.c" /* yacc.c:1646 */ + break; + + case 335: +#line 2164 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_OBJ); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); + } +#line 4933 "y.tab.c" /* yacc.c:1646 */ + break; + + case 336: +#line 2171 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_OBJ|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); + } +#line 4944 "y.tab.c" /* yacc.c:1646 */ + break; + + case 337: +#line 2180 "lev_comp.y" /* yacc.c:1646 */ + { + long m = get_object_id((yyvsp[0].map), (char)0); + if (m == ERR) { + lc_error("Unknown object \"%s\"!", (yyvsp[0].map)); + (yyval.i) = -1; + } else + (yyval.i) = SP_OBJ_PACK(m, 1); /* obj class != 0 to force generation of a specific item */ + + } +#line 4958 "y.tab.c" /* yacc.c:1646 */ + break; + + case 338: +#line 2190 "lev_comp.y" /* yacc.c:1646 */ + { + if (check_object_char((char) (yyvsp[0].i))) + (yyval.i) = SP_OBJ_PACK(-1, (yyvsp[0].i)); else { - yyerror("Unknown monster class!"); - yyval.i = ERR; + lc_error("Unknown object class '%c'!", (yyvsp[0].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; - } +#line 4971 "y.tab.c" /* yacc.c:1646 */ + break; + + case 339: +#line 2199 "lev_comp.y" /* yacc.c:1646 */ + { + long m = get_object_id((yyvsp[-1].map), (char) (yyvsp[-3].i)); + if (m == ERR) { + lc_error("Unknown object ('%c', \"%s\")!", (yyvsp[-3].i), (yyvsp[-1].map)); + (yyval.i) = -1; + } else + (yyval.i) = SP_OBJ_PACK(m, (yyvsp[-3].i)); } -break; -case 218: -{ - yyval.i = 100; /* default is 100% */ +#line 4984 "y.tab.c" /* yacc.c:1646 */ + break; + + case 340: +#line 2208 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = -1; } -break; -case 219: -{ - if (yyvsp[0].i <= 0 || yyvsp[0].i > 100) - yyerror("Expected percentile chance."); - yyval.i = yyvsp[0].i; +#line 4992 "y.tab.c" /* yacc.c:1646 */ + break; + + case 341: +#line 2214 "lev_comp.y" /* yacc.c:1646 */ + { } +#line 4998 "y.tab.c" /* yacc.c:1646 */ + break; + + case 342: +#line 2216 "lev_comp.y" /* yacc.c:1646 */ + { + 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; +#line 5006 "y.tab.c" /* yacc.c:1646 */ + break; + + case 343: +#line 2221 "lev_comp.y" /* yacc.c:1646 */ + { add_opvars(splev, "i", (yyvsp[0].i) ); } +#line 5012 "y.tab.c" /* yacc.c:1646 */ + break; + + case 344: +#line 2222 "lev_comp.y" /* yacc.c:1646 */ + { is_inconstant_number = 1; } +#line 5018 "y.tab.c" /* yacc.c:1646 */ + break; + + case 345: +#line 2223 "lev_comp.y" /* yacc.c:1646 */ + { add_opvars(splev, "i", (yyvsp[-1].i) ); } +#line 5024 "y.tab.c" /* yacc.c:1646 */ + break; + + case 346: +#line 2225 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_INT); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); + is_inconstant_number = 1; } -break; -case 223: -{ +#line 5036 "y.tab.c" /* yacc.c:1646 */ + break; + + case 347: +#line 2233 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_INT|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); + is_inconstant_number = 1; + } +#line 5048 "y.tab.c" /* yacc.c:1646 */ + break; + + case 348: +#line 2240 "lev_comp.y" /* yacc.c:1646 */ + { add_opvars(splev, "o", SPO_MATH_ADD); } +#line 5054 "y.tab.c" /* yacc.c:1646 */ + break; + + case 349: +#line 2241 "lev_comp.y" /* yacc.c:1646 */ + { add_opvars(splev, "o", SPO_MATH_SUB); } +#line 5060 "y.tab.c" /* yacc.c:1646 */ + break; + + case 350: +#line 2242 "lev_comp.y" /* yacc.c:1646 */ + { add_opvars(splev, "o", SPO_MATH_MUL); } +#line 5066 "y.tab.c" /* yacc.c:1646 */ + break; + + case 351: +#line 2243 "lev_comp.y" /* yacc.c:1646 */ + { add_opvars(splev, "o", SPO_MATH_DIV); } +#line 5072 "y.tab.c" /* yacc.c:1646 */ + break; + + case 352: +#line 2244 "lev_comp.y" /* yacc.c:1646 */ + { add_opvars(splev, "o", SPO_MATH_MOD); } +#line 5078 "y.tab.c" /* yacc.c:1646 */ + break; + + case 353: +#line 2245 "lev_comp.y" /* yacc.c:1646 */ + { } +#line 5084 "y.tab.c" /* yacc.c:1646 */ + break; + + case 354: +#line 2249 "lev_comp.y" /* yacc.c:1646 */ + { + if (!strcmp("int", (yyvsp[0].map)) || !strcmp("integer", (yyvsp[0].map))) { + (yyval.i) = (int)'i'; + } else lc_error("Unknown function parameter type '%s'", (yyvsp[0].map)); + } +#line 5094 "y.tab.c" /* yacc.c:1646 */ + break; + + case 355: +#line 2255 "lev_comp.y" /* yacc.c:1646 */ + { + if (!strcmp("str", (yyvsp[0].map)) || !strcmp("string", (yyvsp[0].map))) { + (yyval.i) = (int)'s'; + } else lc_error("Unknown function parameter type '%s'", (yyvsp[0].map)); + } +#line 5104 "y.tab.c" /* yacc.c:1646 */ + break; + + case 356: +#line 2263 "lev_comp.y" /* yacc.c:1646 */ + { + 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[-2].map)); + tmp->parmtype = (char) (yyvsp[0].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[-2].map), vt); + } + } + Free((yyvsp[-2].map)); + } +#line 5134 "y.tab.c" /* yacc.c:1646 */ + break; + + case 361: +#line 2300 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (int)'i'; + } +#line 5142 "y.tab.c" /* yacc.c:1646 */ + break; + + case 362: +#line 2304 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.i) = (int)'s'; + } +#line 5150 "y.tab.c" /* yacc.c:1646 */ + break; + + case 363: +#line 2311 "lev_comp.y" /* yacc.c:1646 */ + { + char tmpbuf[2]; + tmpbuf[0] = (char) (yyvsp[0].i); + tmpbuf[1] = '\0'; + (yyval.map) = strdup(tmpbuf); + } +#line 5161 "y.tab.c" /* yacc.c:1646 */ + break; + + case 364: +#line 2318 "lev_comp.y" /* yacc.c:1646 */ + { + long len = strlen( (yyvsp[-2].map) ); + char *tmp = (char *)alloc(len + 2); + sprintf(tmp, "%c%s", (char) (yyvsp[0].i), (yyvsp[-2].map) ); + Free( (yyvsp[-2].map) ); + (yyval.map) = tmp; + } +#line 5173 "y.tab.c" /* yacc.c:1646 */ + break; + + case 365: +#line 2328 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.map) = strdup(""); + } +#line 5181 "y.tab.c" /* yacc.c:1646 */ + break; + + case 366: +#line 2332 "lev_comp.y" /* yacc.c:1646 */ + { + char *tmp = strdup( (yyvsp[0].map) ); + Free( (yyvsp[0].map) ); + (yyval.map) = tmp; + } +#line 5191 "y.tab.c" /* yacc.c:1646 */ + break; + + case 367: +#line 2340 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_SEL_POINT); + } +#line 5199 "y.tab.c" /* yacc.c:1646 */ + break; + + case 368: +#line 2344 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_SEL_RECT); + } +#line 5207 "y.tab.c" /* yacc.c:1646 */ + break; + + case 369: +#line 2348 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_SEL_FILLRECT); + } +#line 5215 "y.tab.c" /* yacc.c:1646 */ + break; + + case 370: +#line 2352 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_SEL_LINE); + } +#line 5223 "y.tab.c" /* yacc.c:1646 */ + break; + + case 371: +#line 2356 "lev_comp.y" /* yacc.c:1646 */ + { + /* randline (x1,y1),(x2,y2), roughness */ + add_opvars(splev, "o", SPO_SEL_RNDLINE); + } +#line 5232 "y.tab.c" /* yacc.c:1646 */ + break; + + case 372: +#line 2361 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", W_ANY, SPO_SEL_GROW); + } +#line 5240 "y.tab.c" /* yacc.c:1646 */ + break; + + case 373: +#line 2365 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", (yyvsp[-3].i), SPO_SEL_GROW); + } +#line 5248 "y.tab.c" /* yacc.c:1646 */ + break; + + case 374: +#line 2369 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iio", (yyvsp[-3].i), SPOFILTER_PERCENT, SPO_SEL_FILTER); + } +#line 5256 "y.tab.c" /* yacc.c:1646 */ + break; + + case 375: +#line 2373 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", SPOFILTER_SELECTION, SPO_SEL_FILTER); + } +#line 5264 "y.tab.c" /* yacc.c:1646 */ + break; + + case 376: +#line 2377 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", SPOFILTER_MAPCHAR, SPO_SEL_FILTER); + } +#line 5272 "y.tab.c" /* yacc.c:1646 */ + break; + + case 377: +#line 2381 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_SEL_FLOOD); + } +#line 5280 "y.tab.c" /* yacc.c:1646 */ + break; + + case 378: +#line 2385 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "oio", SPO_COPY, 1, SPO_SEL_ELLIPSE); + } +#line 5288 "y.tab.c" /* yacc.c:1646 */ + break; + + case 379: +#line 2389 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "oio", SPO_COPY, (yyvsp[-1].i), SPO_SEL_ELLIPSE); + } +#line 5296 "y.tab.c" /* yacc.c:1646 */ + break; + + case 380: +#line 2393 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", 1, SPO_SEL_ELLIPSE); + } +#line 5304 "y.tab.c" /* yacc.c:1646 */ + break; + + case 381: +#line 2397 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "io", (yyvsp[-1].i), SPO_SEL_ELLIPSE); + } +#line 5312 "y.tab.c" /* yacc.c:1646 */ + break; + + case 382: +#line 2401 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iio", (yyvsp[-5].i), (yyvsp[-11].i), SPO_SEL_GRADIENT); + } +#line 5320 "y.tab.c" /* yacc.c:1646 */ + break; + + case 383: +#line 2405 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_SEL_COMPLEMENT); + } +#line 5328 "y.tab.c" /* yacc.c:1646 */ + break; + + case 384: +#line 2409 "lev_comp.y" /* yacc.c:1646 */ + { + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_SEL); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); + } +#line 5339 "y.tab.c" /* yacc.c:1646 */ + break; + + case 385: +#line 2416 "lev_comp.y" /* yacc.c:1646 */ + { + /* nothing */ + } +#line 5347 "y.tab.c" /* yacc.c:1646 */ + break; + + case 386: +#line 2422 "lev_comp.y" /* yacc.c:1646 */ + { + /* nothing */ + } +#line 5355 "y.tab.c" /* yacc.c:1646 */ + break; + + case 387: +#line 2426 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "o", SPO_SEL_ADD); + } +#line 5363 "y.tab.c" /* yacc.c:1646 */ + break; + + case 388: +#line 2432 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "iio", (yyvsp[0].dice).num, (yyvsp[0].dice).die, SPO_DICE); + } +#line 5371 "y.tab.c" /* yacc.c:1646 */ + break; + + case 392: +#line 2443 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", (yyvsp[0].i) ); + } +#line 5379 "y.tab.c" /* yacc.c:1646 */ + break; + + case 393: +#line 2447 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", (yyvsp[0].i) ); + } +#line 5387 "y.tab.c" /* yacc.c:1646 */ + break; + + case 394: +#line 2451 "lev_comp.y" /* yacc.c:1646 */ + { + add_opvars(splev, "i", (yyvsp[0].i) ); + } +#line 5395 "y.tab.c" /* yacc.c:1646 */ + break; + + case 395: +#line 2455 "lev_comp.y" /* yacc.c:1646 */ + { + /* nothing */ + } +#line 5403 "y.tab.c" /* yacc.c:1646 */ + break; + + case 404: +#line 2477 "lev_comp.y" /* yacc.c:1646 */ + { + (yyval.lregn) = (yyvsp[0].lregn); + } +#line 5411 "y.tab.c" /* yacc.c:1646 */ + break; + + case 405: +#line 2481 "lev_comp.y" /* yacc.c:1646 */ + { + if ((yyvsp[-7].i) <= 0 || (yyvsp[-7].i) >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-5].i) < 0 || (yyvsp[-5].i) >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-3].i) <= 0 || (yyvsp[-3].i) >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-1].i) < 0 || (yyvsp[-1].i) >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + (yyval.lregn).x1 = (yyvsp[-7].i); + (yyval.lregn).y1 = (yyvsp[-5].i); + (yyval.lregn).x2 = (yyvsp[-3].i); + (yyval.lregn).y2 = (yyvsp[-1].i); + (yyval.lregn).area = 1; + } +#line 5431 "y.tab.c" /* yacc.c:1646 */ + break; + + case 406: +#line 2499 "lev_comp.y" /* yacc.c:1646 */ + { /* 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[-7].i) < 0 || (yyvsp[-7].i) > (int)max_x_map) + lc_error("Region (%li,%li,%li,%li) out of map range (x1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-5].i) < 0 || (yyvsp[-5].i) > (int)max_y_map) + lc_error("Region (%li,%li,%li,%li) out of map range (y1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-3].i) < 0 || (yyvsp[-3].i) > (int)max_x_map) + lc_error("Region (%li,%li,%li,%li) out of map range (x2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-1].i) < 0 || (yyvsp[-1].i) > (int)max_y_map) + lc_error("Region (%li,%li,%li,%li) out of map range (y2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + (yyval.lregn).area = 0; + (yyval.lregn).x1 = (yyvsp[-7].i); + (yyval.lregn).y1 = (yyvsp[-5].i); + (yyval.lregn).x2 = (yyvsp[-3].i); + (yyval.lregn).y2 = (yyvsp[-1].i); } -break; +#line 5453 "y.tab.c" /* yacc.c:1646 */ + break; + + +#line 5457 "y.tab.c" /* yacc.c:1646 */ + default: break; } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + 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: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + + /* 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 +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) + { + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } +# undef YYSYNTAX_ERROR #endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) { - 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 + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; } - 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) + + /* 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 whose 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 (;;) { - goto yyoverflow; + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + 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); } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + + /* 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) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } + /* Do not reclaim the symbols of the rule whose 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 + return yyresult; } +#line 2519 "lev_comp.y" /* yacc.c:1906 */ + + +/*lev_comp.y*/ diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index a1dfdbcd8..46aa8e818 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -151,7 +151,7 @@ TARGET_CPU=x86 # -Zd - generate only public symbols and line numbers for debugging # -GS - enable security checks # -ccommon=-c $(CDBFLAG) -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c +ccommon=-c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c lflags=/INCREMENTAL:NO /NOLOGO !IF "$(TARGET_CPU)" == "x86" diff --git a/win/win32/levstuff.mak b/win/win32/levstuff.mak index cf749c6ce..2597e5eb7 100644 --- a/win/win32/levstuff.mak +++ b/win/win32/levstuff.mak @@ -17,10 +17,14 @@ @echo LEXYYC set to $(LEXYYC) !ENDIF +# 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 +33,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 +66,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) $@