#define YYBISON 1
#define YYBISON_VERSION "2.3"
#define YYSKELETON_NAME "yacc.c"
#define YYPURE 0
#define YYLSP_NEEDED 0
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype {
DEFAULT_DEPTH = 258,
SHUFFLE = 259,
SUBST = 260,
TAGS = 261,
KFEAT = 262,
KITEM = 263,
KMONS = 264,
KMASK = 265,
KPROP = 266,
NAME = 267,
DEPTH = 268,
ORIENT = 269,
PLACE = 270,
CHANCE = 271,
WEIGHT = 272,
MONS = 273,
ITEM = 274,
MARKER = 275,
COLOUR = 276,
PRELUDE = 277,
MAIN = 278,
VALIDATE = 279,
VETO = 280,
NSUBST = 281,
WELCOME = 282,
LFLAGS = 283,
BFLAGS = 284,
LFLOORCOL = 285,
LROCKCOL = 286,
LFLOORTILE = 287,
LROCKTILE = 288,
FTILE = 289,
RTILE = 290,
COMMA = 291,
COLON = 292,
PERC = 293,
INTEGER = 294,
CHARACTER = 295,
STRING = 296,
MAP_LINE = 297,
MONSTER_NAME = 298,
ITEM_INFO = 299,
LUA_LINE = 300
};
#endif
#define DEFAULT_DEPTH 258
#define SHUFFLE 259
#define SUBST 260
#define TAGS 261
#define KFEAT 262
#define KITEM 263
#define KMONS 264
#define KMASK 265
#define KPROP 266
#define NAME 267
#define DEPTH 268
#define ORIENT 269
#define PLACE 270
#define CHANCE 271
#define WEIGHT 272
#define MONS 273
#define ITEM 274
#define MARKER 275
#define COLOUR 276
#define PRELUDE 277
#define MAIN 278
#define VALIDATE 279
#define VETO 280
#define NSUBST 281
#define WELCOME 282
#define LFLAGS 283
#define BFLAGS 284
#define LFLOORCOL 285
#define LROCKCOL 286
#define LFLOORTILE 287
#define LROCKTILE 288
#define FTILE 289
#define RTILE 290
#define COMMA 291
#define COLON 292
#define PERC 293
#define INTEGER 294
#define CHARACTER 295
#define STRING 296
#define MAP_LINE 297
#define MONSTER_NAME 298
#define ITEM_INFO 299
#define LUA_LINE 300
#line 1 "levcomp.ypp"
#include <map>
#include <algorithm>
#include "AppHdr.h"
#include "l_defs.h"
#include "libutil.h"
#include "mapdef.h"
#include "maps.h"
#include "stuff.h"
#define YYERROR_VERBOSE 1
int yylex();
extern int yylineno;
void yyerror(const char *e)
{
if (strstr(e, lc_desfile.c_str()) == e)
fprintf(stderr, "%s\n", e);
else
fprintf(stderr, "%s:%d: %s\n", lc_desfile.c_str(), yylineno, e);
end(1);
}
level_range set_range(const char *s, int start, int end)
{
try
{
lc_range.set(s, start, end);
}
catch (const std::string &err)
{
yyerror(err.c_str());
}
return (lc_range);
}
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
#endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
#line 45 "levcomp.ypp"
{
int i;
const char *text;
raw_range range;
}
#line 235 "levcomp.tab.c"
YYSTYPE;
# define yystype YYSTYPE
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
#line 248 "levcomp.tab.c"
#ifdef short
# undef short
#endif
#ifdef YYTYPE_UINT8
typedef YYTYPE_UINT8 yytype_uint8;
#else
typedef unsigned char yytype_uint8;
#endif
#ifdef YYTYPE_INT8
typedef YYTYPE_INT8 yytype_int8;
#elif (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
typedef signed char yytype_int8;
#else
typedef short int yytype_int8;
#endif
#ifdef YYTYPE_UINT16
typedef YYTYPE_UINT16 yytype_uint16;
#else
typedef unsigned short int yytype_uint16;
#endif
#ifdef YYTYPE_INT16
typedef YYTYPE_INT16 yytype_int16;
#else
typedef short int yytype_int16;
#endif
#ifndef YYSIZE_T
# ifdef __SIZE_TYPE__
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include <stddef.h>
# define YYSIZE_T size_t
# else
# define YYSIZE_T unsigned int
# endif
#endif
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
# if YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h>
# define YY_(msgid) dgettext ("bison-runtime", msgid)
# endif
# endif
# ifndef YY_
# define YY_(msgid) msgid
# endif
#endif
#if ! defined lint || defined __GNUC__
# define YYUSE(e) ((void) (e))
#else
# define YYUSE(e)
#endif
#ifndef lint
# define YYID(n) (n)
#else
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static int
YYID (int i)
#else
static int
YYID (i)
int i;
#endif
{
return i;
}
#endif
#if ! defined yyoverflow || YYERROR_VERBOSE
# ifdef YYSTACK_USE_ALLOCA
# if YYSTACK_USE_ALLOCA
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
# elif defined __BUILTIN_VA_ARG_INCR
# include <alloca.h>
# elif defined _AIX
# define YYSTACK_ALLOC __alloca
# elif defined _MSC_VER
# include <malloc.h>
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include <stdlib.h>
# ifndef _STDLIB_H
# define _STDLIB_H 1
# endif
# endif
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
# define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM 4032
# endif
# else
# define YYSTACK_ALLOC YYMALLOC
# define YYSTACK_FREE YYFREE
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
# if (defined __cplusplus && ! defined _STDLIB_H \
&& ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
# include <stdlib.h>
# ifndef _STDLIB_H
# define _STDLIB_H 1
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T);
# endif
# endif
# ifndef YYFREE
# define YYFREE free
# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void free (void *);
# endif
# endif
# endif
#endif
#if (! defined yyoverflow \
&& (! defined __cplusplus \
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
union yyalloc
{
yytype_int16 yyss;
YYSTYPE yyvs;
};
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
# define YYSTACK_BYTES(N) \
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
while (YYID (0))
# endif
# endif
# define YYSTACK_RELOCATE(Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (YYID (0))
#endif
#define YYFINAL 3
#define YYLAST 106
#define YYNTOKENS 46
#define YYNNTS 75
#define YYNRULES 142
#define YYNSTATES 167
#define YYUNDEFTOK 2
#define YYMAXUTOK 300
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
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, 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, 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
};
#if YYDEBUG
static const yytype_uint16 yyprhs[] =
{
0, 0, 3, 5, 6, 9, 11, 13, 15, 17,
19, 22, 25, 26, 29, 31, 33, 36, 38, 40,
42, 44, 46, 48, 50, 52, 54, 56, 58, 60,
62, 64, 66, 68, 70, 72, 74, 76, 78, 80,
82, 84, 86, 88, 90, 92, 94, 96, 98, 100,
103, 104, 107, 109, 112, 113, 116, 118, 121, 122,
125, 127, 130, 131, 134, 136, 139, 140, 143, 145,
147, 150, 152, 155, 157, 160, 162, 165, 167, 170,
173, 175, 179, 181, 184, 185, 188, 190, 193, 196,
199, 202, 204, 207, 209, 212, 214, 217, 219, 222,
225, 227, 231, 233, 236, 238, 242, 244, 246, 250,
252, 255, 257, 261, 263, 266, 268, 272, 274, 276,
279, 283, 285, 287, 289, 292, 296, 298, 300, 303,
305, 308, 314, 319, 323, 326, 329, 331, 334, 337,
339, 342, 344
};
static const yytype_int8 yyrhs[] =
{
47, 0, -1, 48, -1, -1, 48, 49, -1, 51,
-1, 53, -1, 40, -1, 52, -1, 58, -1, 3,
41, -1, 56, 54, -1, -1, 54, 55, -1, 57,
-1, 118, -1, 12, 41, -1, 112, -1, 113, -1,
114, -1, 115, -1, 116, -1, 117, -1, 109, -1,
106, -1, 86, -1, 103, -1, 100, -1, 87, -1,
88, -1, 89, -1, 90, -1, 91, -1, 92, -1,
95, -1, 78, -1, 81, -1, 84, -1, 85, -1,
73, -1, 75, -1, 74, -1, 76, -1, 77, -1,
61, -1, 70, -1, 64, -1, 67, -1, 50, -1,
23, 59, -1, -1, 59, 60, -1, 45, -1, 23,
62, -1, -1, 62, 63, -1, 45, -1, 24, 65,
-1, -1, 65, 66, -1, 45, -1, 25, 68, -1,
-1, 68, 69, -1, 45, -1, 22, 71, -1, -1,
71, 72, -1, 45, -1, 7, -1, 7, 41, -1,
9, -1, 9, 41, -1, 8, -1, 8, 41, -1,
10, -1, 10, 41, -1, 11, -1, 11, 41, -1,
4, 79, -1, 80, -1, 79, 36, 80, -1, 44,
-1, 6, 82, -1, -1, 82, 83, -1, 41, -1,
28, 41, -1, 29, 41, -1, 20, 41, -1, 21,
98, -1, 30, -1, 30, 41, -1, 31, -1, 31,
41, -1, 32, -1, 32, 41, -1, 33, -1, 33,
41, -1, 34, 93, -1, 94, -1, 93, 36, 94,
-1, 44, -1, 35, 96, -1, 97, -1, 96, 36,
97, -1, 44, -1, 99, -1, 98, 36, 99, -1,
44, -1, 26, 101, -1, 102, -1, 101, 36, 102,
-1, 44, -1, 5, 104, -1, 105, -1, 105, 36,
104, -1, 44, -1, 19, -1, 19, 107, -1, 107,
36, 108, -1, 108, -1, 44, -1, 18, -1, 18,
110, -1, 111, 36, 110, -1, 111, -1, 43, -1,
15, 41, -1, 13, -1, 13, 41, -1, 16, 39,
37, 39, 38, -1, 16, 39, 37, 39, -1, 16,
39, 38, -1, 16, 39, -1, 17, 39, -1, 14,
-1, 14, 41, -1, 27, 41, -1, 119, -1, 119,
120, -1, 120, -1, 42, -1
};
static const yytype_uint16 yyrline[] =
{
0, 66, 66, 69, 70, 73, 74, 77, 83, 84,
87, 97, 119, 120, 123, 124, 127, 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, 185,
187, 188, 191, 196, 198, 199, 202, 207, 209, 210,
213, 218, 220, 221, 224, 229, 231, 232, 235, 240,
241, 249, 250, 258, 259, 267, 268, 276, 277, 285,
288, 289, 292, 300, 303, 304, 307, 316, 325, 334,
367, 370, 371, 379, 380, 388, 389, 397, 398, 407,
410, 411, 414, 423, 426, 427, 430, 439, 440, 443,
452, 455, 456, 459, 468, 471, 472, 475, 484, 485,
488, 489, 492, 500, 501, 504, 505, 508, 517, 526,
527, 536, 543, 550, 557, 565, 573, 574, 583, 592,
595, 596, 599
};
#endif
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
static const char *const yytname[] =
{
"$end", "error", "$undefined", "DEFAULT_DEPTH", "SHUFFLE", "SUBST",
"TAGS", "KFEAT", "KITEM", "KMONS", "KMASK", "KPROP", "NAME", "DEPTH",
"ORIENT", "PLACE", "CHANCE", "WEIGHT", "MONS", "ITEM", "MARKER",
"COLOUR", "PRELUDE", "MAIN", "VALIDATE", "VETO", "NSUBST", "WELCOME",
"LFLAGS", "BFLAGS", "LFLOORCOL", "LROCKCOL", "LFLOORTILE", "LROCKTILE",
"FTILE", "RTILE", "COMMA", "COLON", "PERC", "INTEGER", "CHARACTER",
"STRING", "MAP_LINE", "MONSTER_NAME", "ITEM_INFO", "LUA_LINE", "$accept",
"file", "definitions", "definition", "error_seq", "def", "defdepth",
"level", "map_specs", "map_spec", "name", "metaline", "global_lua",
"global_lua_lines", "global_lua_line", "main_lua", "main_lua_lines",
"main_lua_line", "validate_lua", "validate_lua_lines",
"validate_lua_line", "veto_lua", "veto_lua_lines", "veto_lua_line",
"prelude_lua", "prelude_lua_lines", "prelude_lua_line", "kfeat", "kmons",
"kitem", "kmask", "kprop", "shuffle", "shuffle_specifiers",
"shuffle_spec", "tags", "tagstrings", "tagstring", "lflags", "bflags",
"marker", "colour", "lfloorcol", "lrockcol", "lfloortile", "lrocktile",
"ftile", "ftile_specifiers", "ftile_specifier", "rtile",
"rtile_specifiers", "rtile_specifier", "colour_specifiers",
"colour_specifier", "nsubst", "nsubst_specifiers", "nsubst_spec",
"subst", "subst_specifiers", "subst_spec", "items", "item_specifiers",
"item_specifier", "mons", "mnames", "mname", "place", "depth", "chance",
"weight", "orientation", "welcome", "map_def", "map_lines", "map_line", 0
};
#endif
# ifdef YYPRINT
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
};
# endif
static const yytype_uint8 yyr1[] =
{
0, 46, 47, 48, 48, 49, 49, 50, 51, 51,
52, 53, 54, 54, 55, 55, 56, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 58,
59, 59, 60, 61, 62, 62, 63, 64, 65, 65,
66, 67, 68, 68, 69, 70, 71, 71, 72, 73,
73, 74, 74, 75, 75, 76, 76, 77, 77, 78,
79, 79, 80, 81, 82, 82, 83, 84, 85, 86,
87, 88, 88, 89, 89, 90, 90, 91, 91, 92,
93, 93, 94, 95, 96, 96, 97, 98, 98, 99,
100, 101, 101, 102, 103, 104, 104, 105, 106, 106,
107, 107, 108, 109, 109, 110, 110, 111, 112, 113,
113, 114, 114, 114, 114, 115, 116, 116, 117, 118,
119, 119, 120
};
static const yytype_uint8 yyr2[] =
{
0, 2, 1, 0, 2, 1, 1, 1, 1, 1,
2, 2, 0, 2, 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, 1, 1, 1, 1, 1, 1, 1, 2,
0, 2, 1, 2, 0, 2, 1, 2, 0, 2,
1, 2, 0, 2, 1, 2, 0, 2, 1, 1,
2, 1, 2, 1, 2, 1, 2, 1, 2, 2,
1, 3, 1, 2, 0, 2, 1, 2, 2, 2,
2, 1, 2, 1, 2, 1, 2, 1, 2, 2,
1, 3, 1, 2, 1, 3, 1, 1, 3, 1,
2, 1, 3, 1, 2, 1, 3, 1, 1, 2,
3, 1, 1, 1, 2, 3, 1, 1, 2, 1,
2, 5, 4, 3, 2, 2, 1, 2, 2, 1,
2, 1, 1
};
static const yytype_uint8 yydefact[] =
{
3, 0, 2, 1, 0, 0, 50, 4, 5, 8,
6, 12, 9, 10, 16, 49, 11, 52, 51, 0,
0, 84, 69, 73, 71, 75, 77, 129, 136, 0,
0, 0, 123, 118, 0, 0, 66, 54, 58, 62,
0, 0, 0, 0, 91, 93, 95, 97, 0, 0,
7, 142, 48, 13, 14, 44, 46, 47, 45, 39,
41, 40, 42, 43, 35, 36, 37, 38, 25, 28,
29, 30, 31, 32, 33, 34, 27, 26, 24, 23,
17, 18, 19, 20, 21, 22, 15, 139, 141, 82,
79, 80, 117, 114, 115, 83, 70, 74, 72, 76,
78, 130, 137, 128, 134, 135, 127, 124, 126, 122,
119, 121, 89, 109, 90, 107, 65, 53, 57, 61,
113, 110, 111, 138, 87, 88, 92, 94, 96, 98,
102, 99, 100, 106, 103, 104, 140, 0, 0, 86,
85, 0, 133, 0, 0, 0, 68, 67, 56, 55,
60, 59, 64, 63, 0, 0, 0, 81, 116, 132,
125, 120, 108, 112, 101, 105, 131
};
static const yytype_int16 yydefgoto[] =
{
-1, 1, 2, 7, 52, 8, 9, 10, 16, 53,
11, 54, 12, 15, 18, 55, 117, 149, 56, 118,
151, 57, 119, 153, 58, 116, 147, 59, 60, 61,
62, 63, 64, 90, 91, 65, 95, 140, 66, 67,
68, 69, 70, 71, 72, 73, 74, 131, 132, 75,
134, 135, 114, 115, 76, 121, 122, 77, 93, 94,
78, 110, 111, 79, 107, 108, 80, 81, 82, 83,
84, 85, 86, 87, 88
};
#define YYPACT_NINF -89
static const yytype_int8 yypact[] =
{
-89, 8, 29, -89, -8, -2, -89, -89, -89, -89,
-89, -89, -89, -89, -89, -5, -4, -89, -89, -7,
-1, -89, 1, 3, 4, 5, 6, 7, 9, 10,
14, 15, 12, 13, 17, 16, -89, -89, -89, -89,
18, 20, 22, 23, 24, 25, 26, 27, 28, 30,
-89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
-89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
-89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
-89, -89, -89, -89, -89, -89, -89, 31, -89, -89,
33, -89, -89, -89, 34, 35, -89, -89, -89, -89,
-89, -89, -89, -89, -3, -89, -89, -89, 39, -89,
41, -89, -89, -89, 42, -89, 11, 36, 37, 38,
-89, 43, -89, -89, -89, -89, -89, -89, -89, -89,
-89, 44, -89, -89, 48, -89, -89, -7, -1, -89,
-89, 32, -89, 12, 13, 16, -89, -89, -89, -89,
-89, -89, -89, -89, 18, 28, 30, -89, -89, 21,
-89, -89, -89, -89, -89, -89, -89
};
static const yytype_int8 yypgoto[] =
{
-89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
-89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
-89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
-89, -89, -89, -89, -88, -89, -89, -89, -89, -89,
-89, -89, -89, -89, -89, -89, -89, -89, -70, -89,
-89, -69, -89, -59, -89, -89, -66, -89, -49, -89,
-89, -89, -54, -89, -52, -89, -89, -89, -89, -89,
-89, -89, -89, -89, 19
};
#define YYTABLE_NINF -1
static const yytype_uint8 yytable[] =
{
19, 20, 21, 22, 23, 24, 25, 26, 3, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 4, 13, 141, 142, 50, 89, 51, 14,
17, 5, 96, 92, 97, 98, 99, 100, 101, 157,
102, 103, 6, 104, 105, 106, 146, 109, 112, 166,
113, 123, 120, 124, 125, 126, 127, 128, 129, 137,
138, 159, 130, 51, 133, 143, 139, 144, 145, 154,
155, 148, 150, 152, 156, 164, 162, 165, 163, 158,
161, 160, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 136
};
static const yytype_int16 yycheck[] =
{
4, 5, 6, 7, 8, 9, 10, 11, 0, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
34, 35, 3, 41, 37, 38, 40, 44, 42, 41,
45, 12, 41, 44, 41, 41, 41, 41, 41, 137,
41, 41, 23, 39, 39, 43, 45, 44, 41, 38,
44, 41, 44, 41, 41, 41, 41, 41, 41, 36,
36, 39, 44, 42, 44, 36, 41, 36, 36, 36,
36, 45, 45, 45, 36, 155, 145, 156, 154, 138,
144, 143, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 87
};
static const yytype_uint8 yystos[] =
{
0, 47, 48, 0, 3, 12, 23, 49, 51, 52,
53, 56, 58, 41, 41, 59, 54, 45, 60, 4,
5, 6, 7, 8, 9, 10, 11, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
40, 42, 50, 55, 57, 61, 64, 67, 70, 73,
74, 75, 76, 77, 78, 81, 84, 85, 86, 87,
88, 89, 90, 91, 92, 95, 100, 103, 106, 109,
112, 113, 114, 115, 116, 117, 118, 119, 120, 44,
79, 80, 44, 104, 105, 82, 41, 41, 41, 41,
41, 41, 41, 41, 39, 39, 43, 110, 111, 44,
107, 108, 41, 44, 98, 99, 71, 62, 65, 68,
44, 101, 102, 41, 41, 41, 41, 41, 41, 41,
44, 93, 94, 44, 96, 97, 120, 36, 36, 41,
83, 37, 38, 36, 36, 36, 45, 72, 45, 63,
45, 66, 45, 69, 36, 36, 36, 80, 104, 39,
110, 108, 99, 102, 94, 97, 38
};
#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 YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(Token, Value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
{ \
yychar = (Token); \
yylval = (Value); \
yytoken = YYTRANSLATE (yychar); \
YYPOPSTACK (1); \
goto yybackup; \
} \
else \
{ \
yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (YYID (0))
#define YYTERROR 1
#define YYERRCODE 256
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (YYID (N)) \
{ \
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
} \
else \
{ \
(Current).first_line = (Current).last_line = \
YYRHSLOC (Rhs, 0).last_line; \
(Current).first_column = (Current).last_column = \
YYRHSLOC (Rhs, 0).last_column; \
} \
while (YYID (0))
#endif
#ifndef YY_LOCATION_PRINT
# if YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
(Loc).last_line, (Loc).last_column)
# else
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
#endif
#ifdef YYLEX_PARAM
# define YYLEX yylex (YYLEX_PARAM)
#else
# define YYLEX yylex ()
#endif
#if YYDEBUG
# ifndef YYFPRINTF
# include <stdio.h>
# define YYFPRINTF fprintf
# endif
# define YYDPRINTF(Args) \
do { \
if (yydebug) \
YYFPRINTF Args; \
} while (YYID (0))
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
do { \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
Type, Value); \
YYFPRINTF (stderr, "\n"); \
} \
} while (YYID (0))
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
#else
static void
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
FILE *yyoutput;
int yytype;
YYSTYPE const * const yyvaluep;
#endif
{
if (!yyvaluep)
return;
# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# else
YYUSE (yyoutput);
# endif
switch (yytype)
{
default:
break;
}
}
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
#else
static void
yy_symbol_print (yyoutput, yytype, yyvaluep)
FILE *yyoutput;
int yytype;
YYSTYPE const * const yyvaluep;
#endif
{
if (yytype < YYNTOKENS)
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
else
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
YYFPRINTF (yyoutput, ")");
}
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
#else
static void
yy_stack_print (bottom, top)
yytype_int16 *bottom;
yytype_int16 *top;
#endif
{
YYFPRINTF (stderr, "Stack now");
for (; bottom <= top; ++bottom)
YYFPRINTF (stderr, " %d", *bottom);
YYFPRINTF (stderr, "\n");
}
# define YY_STACK_PRINT(Bottom, Top) \
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
} while (YYID (0))
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
#else
static void
yy_reduce_print (yyvsp, yyrule)
YYSTYPE *yyvsp;
int yyrule;
#endif
{
int yynrhs = yyr2[yyrule];
int yyi;
unsigned long int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
yyrule - 1, yylno);
for (yyi = 0; yyi < yynrhs; yyi++)
{
fprintf (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
);
fprintf (stderr, "\n");
}
}
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
yy_reduce_print (yyvsp, Rule); \
} while (YYID (0))
int yydebug;
#else
# define YYDPRINTF(Args)
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif
#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif
#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif
#if YYERROR_VERBOSE
# ifndef yystrlen
# if defined __GLIBC__ && defined _STRING_H
# define yystrlen strlen
# else
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static YYSIZE_T
yystrlen (const char *yystr)
#else
static YYSIZE_T
yystrlen (yystr)
const char *yystr;
#endif
{
YYSIZE_T yylen;
for (yylen = 0; yystr[yylen]; yylen++)
continue;
return yylen;
}
# endif
# endif
# ifndef yystpcpy
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
# define yystpcpy stpcpy
# else
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static char *
yystpcpy (char *yydest, const char *yysrc)
#else
static char *
yystpcpy (yydest, yysrc)
char *yydest;
const char *yysrc;
#endif
{
char *yyd = yydest;
const char *yys = yysrc;
while ((*yyd++ = *yys++) != '\0')
continue;
return yyd - 1;
}
# endif
# endif
# ifndef yytnamerr
static YYSIZE_T
yytnamerr (char *yyres, const char *yystr)
{
if (*yystr == '"')
{
YYSIZE_T yyn = 0;
char const *yyp = yystr;
for (;;)
switch (*++yyp)
{
case '\'':
case ',':
goto do_not_strip_quotes;
case '\\':
if (*++yyp != '\\')
goto do_not_strip_quotes;
default:
if (yyres)
yyres[yyn] = *yyp;
yyn++;
break;
case '"':
if (yyres)
yyres[yyn] = '\0';
return yyn;
}
do_not_strip_quotes: ;
}
if (! yyres)
return yystrlen (yystr);
return yystpcpy (yyres, yystr) - yyres;
}
# endif
static YYSIZE_T
yysyntax_error (char *yyresult, int yystate, int yychar)
{
int yyn = yypact[yystate];
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
return 0;
else
{
int yytype = YYTRANSLATE (yychar);
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
YYSIZE_T yysize = yysize0;
YYSIZE_T yysize1;
int yysize_overflow = 0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
int yyx;
# if 0
YY_("syntax error, unexpected %s");
YY_("syntax error, unexpected %s, expecting %s");
YY_("syntax error, unexpected %s, expecting %s or %s");
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
# endif
char *yyfmt;
char const *yyf;
static char const yyunexpected[] = "syntax error, unexpected %s";
static char const yyexpecting[] = ", expecting %s";
static char const yyor[] = " or %s";
char yyformat[sizeof yyunexpected
+ sizeof yyexpecting - 1
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
* (sizeof yyor - 1))];
char const *yyprefix = yyexpecting;
int yyxbegin = yyn < 0 ? -yyn : 0;
int yychecklim = YYLAST - yyn + 1;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
int yycount = 1;
yyarg[0] = yytname[yytype];
yyfmt = yystpcpy (yyformat, yyunexpected);
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{
yycount = 1;
yysize = yysize0;
yyformat[sizeof yyunexpected - 1] = '\0';
break;
}
yyarg[yycount++] = yytname[yyx];
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
yysize_overflow |= (yysize1 < yysize);
yysize = yysize1;
yyfmt = yystpcpy (yyfmt, yyprefix);
yyprefix = yyor;
}
yyf = YY_(yyformat);
yysize1 = yysize + yystrlen (yyf);
yysize_overflow |= (yysize1 < yysize);
yysize = yysize1;
if (yysize_overflow)
return YYSIZE_MAXIMUM;
if (yyresult)
{
char *yyp = yyresult;
int yyi = 0;
while ((*yyp = *yyf) != '\0')
{
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
{
yyp += yytnamerr (yyp, yyarg[yyi++]);
yyf += 2;
}
else
{
yyp++;
yyf++;
}
}
}
return yysize;
}
}
#endif
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
#else
static void
yydestruct (yymsg, yytype, yyvaluep)
const char *yymsg;
int yytype;
YYSTYPE *yyvaluep;
#endif
{
YYUSE (yyvaluep);
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
switch (yytype)
{
default:
break;
}
}
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else
#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
#endif
#endif
int yychar;
YYSTYPE yylval;
int yynerrs;
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
int
yyparse (void *YYPARSE_PARAM)
#else
int
yyparse (YYPARSE_PARAM)
void *YYPARSE_PARAM;
#endif
#else
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
int
yyparse (void)
#else
int
yyparse ()
#endif
#endif
{
int yystate;
int yyn;
int yyresult;
int yyerrstatus;
int yytoken = 0;
#if YYERROR_VERBOSE
char yymsgbuf[128];
char *yymsg = yymsgbuf;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
yytype_int16 yyssa[YYINITDEPTH];
yytype_int16 *yyss = yyssa;
yytype_int16 *yyssp;
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa;
YYSTYPE *yyvsp;
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
YYSIZE_T yystacksize = YYINITDEPTH;
YYSTYPE yyval;
int yylen = 0;
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY;
yyssp = yyss;
yyvsp = yyvs;
goto yysetstate;
yynewstate:
yyssp++;
yysetstate:
*yyssp = yystate;
if (yyss + yystacksize - 1 <= yyssp)
{
YYSIZE_T yysize = yyssp - yyss + 1;
#ifdef yyoverflow
{
YYSTYPE *yyvs1 = yyvs;
yytype_int16 *yyss1 = yyss;
yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
&yystacksize);
yyss = yyss1;
yyvs = yyvs1;
}
#else
# ifndef YYSTACK_RELOCATE
goto yyexhaustedlab;
# else
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);
YYSTACK_RELOCATE (yyvs);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
#endif
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));
goto yybackup;
yybackup:
yyn = yypact[yystate];
if (yyn == YYPACT_NINF)
goto yydefault;
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);
}
yyn += yytoken;
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
goto yydefault;
yyn = yytable[yyn];
if (yyn <= 0)
{
if (yyn == 0 || yyn == YYTABLE_NINF)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
if (yyn == YYFINAL)
YYACCEPT;
if (yyerrstatus)
yyerrstatus--;
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
if (yychar != YYEOF)
yychar = YYEMPTY;
yystate = yyn;
*++yyvsp = yylval;
goto yynewstate;
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
goto yyreduce;
yyreduce:
yylen = yyr2[yyn];
yyval = yyvsp[1-yylen];
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
case 2:
#line 66 "levcomp.ypp"
{ }
break;
case 3:
#line 69 "levcomp.ypp"
{}
break;
case 4:
#line 70 "levcomp.ypp"
{}
break;
case 5:
#line 73 "levcomp.ypp"
{}
break;
case 6:
#line 74 "levcomp.ypp"
{}
break;
case 7:
#line 78 "levcomp.ypp"
{
yyerror("Unexpected character sequence.");
}
break;
case 8:
#line 83 "levcomp.ypp"
{}
break;
case 9:
#line 84 "levcomp.ypp"
{}
break;
case 10:
#line 88 "levcomp.ypp"
{
dgn_reset_default_depth();
std::string err = dgn_set_default_depth((yyvsp[(2) - (2)].text));
if (!err.empty())
yyerror(make_stringf("Bad default-depth: %s (%s)",
(yyvsp[(2) - (2)].text), err.c_str()).c_str());
}
break;
case 11:
#line 98 "levcomp.ypp"
{
lc_map.set_file(lc_desfile);
if (lc_run_global_prelude && !lc_global_prelude.empty())
{
lc_global_prelude.set_file(lc_desfile);
lc_run_global_prelude = false;
if (lc_global_prelude.load_call(dlua, NULL))
yyerror( lc_global_prelude.orig_error().c_str() );
}
std::string err = lc_map.validate_map_def();
if (!err.empty())
yyerror(err.c_str());
if (!lc_map.has_depth() && !lc_default_depths.empty())
lc_map.add_depths(lc_default_depths.begin(),
lc_default_depths.end());
add_parsed_map(lc_map);
}
break;
case 12:
#line 119 "levcomp.ypp"
{ }
break;
case 13:
#line 120 "levcomp.ypp"
{ }
break;
case 14:
#line 123 "levcomp.ypp"
{ }
break;
case 15:
#line 124 "levcomp.ypp"
{ }
break;
case 16:
#line 128 "levcomp.ypp"
{
lc_map.init();
lc_map.name = (yyvsp[(2) - (2)].text);
map_load_info_t::const_iterator i =
lc_loaded_maps.find((yyvsp[(2) - (2)].text));
if (i != lc_loaded_maps.end())
{
yyerror(
make_stringf(
"Map named '%s' already loaded at %s:%d",
(yyvsp[(2) - (2)].text),
i->second.filename.c_str(),
i->second.lineno).c_str() );
}
lc_map.place_loaded_from =
map_file_place(lc_desfile, yylineno);
lc_loaded_maps[(yyvsp[(2) - (2)].text)] = lc_map.place_loaded_from;
}
break;
case 48:
#line 182 "levcomp.ypp"
{}
break;
case 49:
#line 185 "levcomp.ypp"
{ }
break;
case 50:
#line 187 "levcomp.ypp"
{ }
break;
case 51:
#line 188 "levcomp.ypp"
{ }
break;
case 52:
#line 192 "levcomp.ypp"
{
lc_global_prelude.add(yylineno, (yyvsp[(1) - (1)].text));
}
break;
case 53:
#line 196 "levcomp.ypp"
{ }
break;
case 54:
#line 198 "levcomp.ypp"
{ }
break;
case 55:
#line 199 "levcomp.ypp"
{ }
break;
case 56:
#line 203 "levcomp.ypp"
{
lc_map.main.add(yylineno, (yyvsp[(1) - (1)].text));
}
break;
case 57:
#line 207 "levcomp.ypp"
{ }
break;
case 58:
#line 209 "levcomp.ypp"
{ }
break;
case 59:
#line 210 "levcomp.ypp"
{ }
break;
case 60:
#line 214 "levcomp.ypp"
{
lc_map.validate.add(yylineno, (yyvsp[(1) - (1)].text));
}
break;
case 61:
#line 218 "levcomp.ypp"
{ }
break;
case 62:
#line 220 "levcomp.ypp"
{ }
break;
case 63:
#line 221 "levcomp.ypp"
{ }
break;
case 64:
#line 225 "levcomp.ypp"
{
lc_map.veto.add(yylineno, (yyvsp[(1) - (1)].text));
}
break;
case 65:
#line 229 "levcomp.ypp"
{ }
break;
case 66:
#line 231 "levcomp.ypp"
{ }
break;
case 67:
#line 232 "levcomp.ypp"
{ }
break;
case 68:
#line 236 "levcomp.ypp"
{
lc_map.prelude.add(yylineno, (yyvsp[(1) - (1)].text));
}
break;
case 69:
#line 240 "levcomp.ypp"
{ }
break;
case 70:
#line 242 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("kfeat(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 71:
#line 249 "levcomp.ypp"
{ }
break;
case 72:
#line 251 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("kmons(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 73:
#line 258 "levcomp.ypp"
{ }
break;
case 74:
#line 260 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("kitem(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 75:
#line 267 "levcomp.ypp"
{ }
break;
case 76:
#line 269 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("kmask(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 77:
#line 276 "levcomp.ypp"
{ }
break;
case 78:
#line 278 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("kprop(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 79:
#line 285 "levcomp.ypp"
{}
break;
case 82:
#line 293 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("shuffle(\"%s\")",
quote_lua_string((yyvsp[(1) - (1)].text)).c_str()));
}
break;
case 83:
#line 300 "levcomp.ypp"
{}
break;
case 86:
#line 308 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("tags(\"%s\")",
quote_lua_string((yyvsp[(1) - (1)].text)).c_str()));
}
break;
case 87:
#line 317 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("lflags(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 88:
#line 326 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("bflags(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 89:
#line 335 "levcomp.ypp"
{
std::string key, arg;
int sep(0);
const std::string err =
mapdef_split_key_item((yyvsp[(2) - (2)].text), &key, &sep, &arg);
if (!err.empty())
yyerror(err.c_str());
if (arg.find("lua:") == 0)
{
arg = arg.substr(4);
lc_map.main.add(
yylineno,
make_stringf("lua_marker(\"%s\", function () "
" return %s "
"end)",
quote_lua_string(key).c_str(),
arg.c_str()));
}
else
{
lc_map.main.add(
yylineno,
make_stringf("marker(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
}
break;
case 90:
#line 367 "levcomp.ypp"
{ }
break;
case 91:
#line 370 "levcomp.ypp"
{ }
break;
case 92:
#line 372 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("lfloorcol(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 93:
#line 379 "levcomp.ypp"
{ }
break;
case 94:
#line 381 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("lrockcol(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 95:
#line 388 "levcomp.ypp"
{ }
break;
case 96:
#line 390 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("lfloortile(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 97:
#line 397 "levcomp.ypp"
{ }
break;
case 98:
#line 399 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("lrocktile(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 102:
#line 415 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("ftile(\"%s\")",
quote_lua_string((yyvsp[(1) - (1)].text)).c_str()));
}
break;
case 106:
#line 431 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("rtile(\"%s\")",
quote_lua_string((yyvsp[(1) - (1)].text)).c_str()));
}
break;
case 107:
#line 439 "levcomp.ypp"
{ }
break;
case 108:
#line 440 "levcomp.ypp"
{ }
break;
case 109:
#line 444 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("colour(\"%s\")",
quote_lua_string((yyvsp[(1) - (1)].text)).c_str()));
}
break;
case 110:
#line 452 "levcomp.ypp"
{ }
break;
case 111:
#line 455 "levcomp.ypp"
{ }
break;
case 112:
#line 456 "levcomp.ypp"
{ }
break;
case 113:
#line 460 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("nsubst(\"%s\")",
quote_lua_string((yyvsp[(1) - (1)].text)).c_str()));
}
break;
case 114:
#line 468 "levcomp.ypp"
{ }
break;
case 117:
#line 476 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("subst(\"%s\")",
quote_lua_string((yyvsp[(1) - (1)].text)).c_str()));
}
break;
case 118:
#line 484 "levcomp.ypp"
{}
break;
case 119:
#line 485 "levcomp.ypp"
{}
break;
case 122:
#line 493 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("item(\"%s\")",
quote_lua_string((yyvsp[(1) - (1)].text)).c_str()));
}
break;
case 123:
#line 500 "levcomp.ypp"
{}
break;
case 124:
#line 501 "levcomp.ypp"
{}
break;
case 127:
#line 509 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("mons(\"%s\")",
quote_lua_string((yyvsp[(1) - (1)].text)).c_str()));
}
break;
case 128:
#line 518 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("place(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 129:
#line 526 "levcomp.ypp"
{}
break;
case 130:
#line 528 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("depth(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 131:
#line 537 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("chance(%d, %d)", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i) * 100));
}
break;
case 132:
#line 544 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("chance(%d, %d)", (yyvsp[(2) - (4)].i), (yyvsp[(4) - (4)].i)));
}
break;
case 133:
#line 551 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("chance(0, %d)", (yyvsp[(2) - (3)].i) * 100));
}
break;
case 134:
#line 558 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("chance(0, %d)", (yyvsp[(2) - (2)].i)));
}
break;
case 135:
#line 566 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("weight(%d)", (yyvsp[(2) - (2)].i)));
}
break;
case 136:
#line 573 "levcomp.ypp"
{}
break;
case 137:
#line 575 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("orient(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 138:
#line 584 "levcomp.ypp"
{
lc_map.main.add(
yylineno,
make_stringf("welcome(\"%s\")",
quote_lua_string((yyvsp[(2) - (2)].text)).c_str()));
}
break;
case 142:
#line 600 "levcomp.ypp"
{
lc_map.mapchunk.add(
yylineno,
make_stringf("map(\"%s\")",
quote_lua_string((yyvsp[(1) - (1)].text)).c_str()));
}
break;
#line 2313 "levcomp.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
yylen = 0;
YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
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:
if (!yyerrstatus)
{
++yynerrs;
#if ! YYERROR_VERBOSE
yyerror (YY_("syntax error"));
#else
{
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
{
YYSIZE_T yyalloc = 2 * yysize;
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
yyalloc = YYSTACK_ALLOC_MAXIMUM;
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
if (yymsg)
yymsg_alloc = yyalloc;
else
{
yymsg = yymsgbuf;
yymsg_alloc = sizeof yymsgbuf;
}
}
if (0 < yysize && yysize <= yymsg_alloc)
{
(void) yysyntax_error (yymsg, yystate, yychar);
yyerror (yymsg);
}
else
{
yyerror (YY_("syntax error"));
if (yysize != 0)
goto yyexhaustedlab;
}
}
#endif
}
if (yyerrstatus == 3)
{
if (yychar <= YYEOF)
{
if (yychar == YYEOF)
YYABORT;
}
else
{
yydestruct ("Error: discarding",
yytoken, &yylval);
yychar = YYEMPTY;
}
}
goto yyerrlab1;
yyerrorlab:
if ( 0)
goto yyerrorlab;
YYPOPSTACK (yylen);
yylen = 0;
YY_STACK_PRINT (yyss, yyssp);
yystate = *yyssp;
goto yyerrlab1;
yyerrlab1:
yyerrstatus = 3;
for (;;)
{
yyn = yypact[yystate];
if (yyn != YYPACT_NINF)
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
{
yyn = yytable[yyn];
if (0 < yyn)
break;
}
}
if (yyssp == yyss)
YYABORT;
yydestruct ("Error: popping",
yystos[yystate], yyvsp);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval;
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
yystate = yyn;
goto yynewstate;
yyacceptlab:
yyresult = 0;
goto yyreturn;
yyabortlab:
yyresult = 1;
goto yyreturn;
#ifndef yyoverflow
yyexhaustedlab:
yyerror (YY_("memory exhausted"));
yyresult = 2;
#endif
yyreturn:
if (yychar != YYEOF && yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval);
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 YYID (yyresult);
}
#line 608 "levcomp.ypp"