~ubuntu-branches/ubuntu/lucid/warzone2100/lucid

« back to all changes in this revision

Viewing changes to lib/framework/resource_parser.tab.c

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger, Paul Wise, Christoph Egger
  • Date: 2009-06-29 17:12:52 UTC
  • mfrom: (1.1.11 upstream) (2.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090629171252-5ddnlfg3zfchrega
Tags: 2.2.1+dfsg1-1
[ Paul Wise ]
* New upstream release (Closes: #534962)
* Adjust the flex build-depends to take account of the conflict
  with all the versions of flex 2.5.34 (LP: #372872)
* Make the -music Recommends more strict, 2.1 music doesn't work
  with 2.2.
* Upstream moved the downloads to sourceforge, update the watch file
* Bump Standards-Version, no changes needed
* Drop use of dh_desktop since it no longer does anything
* Recommend the new warzone2100-video package, version 2.2 or similar
* Mention the warzone2100 crash reports in the -dbg package description

[ Christoph Egger ]
* Replace CC-2.0 graphic from cybersphinx, create a new tarball
* Add myself to uploaders

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* A Bison parser, made by GNU Bison 2.3.  */
 
2
 
 
3
/* Skeleton implementation for Bison's Yacc-like parsers in C
 
4
 
 
5
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 
6
   Free Software Foundation, Inc.
 
7
 
 
8
   This program is free software; you can redistribute it and/or modify
 
9
   it under the terms of the GNU General Public License as published by
 
10
   the Free Software Foundation; either version 2, or (at your option)
 
11
   any later version.
 
12
 
 
13
   This program is distributed in the hope that it will be useful,
 
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
   GNU General Public License for more details.
 
17
 
 
18
   You should have received a copy of the GNU General Public License
 
19
   along with this program; if not, write to the Free Software
 
20
   Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
21
   Boston, MA 02110-1301, USA.  */
 
22
 
 
23
/* As a special exception, you may create a larger work that contains
 
24
   part or all of the Bison parser skeleton and distribute that work
 
25
   under terms of your choice, so long as that work isn't itself a
 
26
   parser generator using the skeleton or a modified version thereof
 
27
   as a parser skeleton.  Alternatively, if you modify or redistribute
 
28
   the parser skeleton itself, you may (at your option) remove this
 
29
   special exception, which will cause the skeleton and the resulting
 
30
   Bison output files to be licensed under the GNU General Public
 
31
   License without this special exception.
 
32
 
 
33
   This special exception was added by the Free Software Foundation in
 
34
   version 2.2 of Bison.  */
 
35
 
 
36
/* C LALR(1) parser skeleton written by Richard Stallman, by
 
37
   simplifying the original so-called "semantic" parser.  */
 
38
 
 
39
/* All symbols defined below should begin with yy or YY, to avoid
 
40
   infringing on user name space.  This should be done even for local
 
41
   variables, as they might otherwise be expanded by user macros.
 
42
   There are some unavoidable exceptions within include files to
 
43
   define necessary library symbols; they are noted "INFRINGES ON
 
44
   USER NAME SPACE" below.  */
 
45
 
 
46
/* Identify Bison output.  */
 
47
#define YYBISON 1
 
48
 
 
49
/* Bison version.  */
 
50
#define YYBISON_VERSION "2.3"
 
51
 
 
52
/* Skeleton name.  */
 
53
#define YYSKELETON_NAME "yacc.c"
 
54
 
 
55
/* Pure parsers.  */
 
56
#define YYPURE 0
 
57
 
 
58
/* Using locations.  */
 
59
#define YYLSP_NEEDED 0
 
60
 
 
61
/* Substitute the variable and function names.  */
 
62
#define yyparse res_parse
 
63
#define yylex   res_lex
 
64
#define yyerror res_error
 
65
#define yylval  res_lval
 
66
#define yychar  res_char
 
67
#define yydebug res_debug
 
68
#define yynerrs res_nerrs
 
69
 
 
70
 
 
71
/* Tokens.  */
 
72
#ifndef YYTOKENTYPE
 
73
# define YYTOKENTYPE
 
74
   /* Put the tokens into the symbol table, so that GDB and other debuggers
 
75
      know about them.  */
 
76
   enum yytokentype {
 
77
     TEXT_T = 258,
 
78
     QTEXT_T = 259,
 
79
     DIRECTORY = 260,
 
80
     FILETOKEN = 261
 
81
   };
 
82
#endif
 
83
/* Tokens.  */
 
84
#define TEXT_T 258
 
85
#define QTEXT_T 259
 
86
#define DIRECTORY 260
 
87
#define FILETOKEN 261
 
88
 
 
89
 
 
90
 
 
91
 
 
92
/* Copy the first part of user declarations.  */
 
93
#line 20 "resource_parser.y"
 
94
 
 
95
/** @file
 
96
 *
 
97
 *  Parser for RES (*.wrf) files
 
98
 */
 
99
 
 
100
extern int res_lex(void);
 
101
extern int res_get_lineno(void);
 
102
extern char* res_get_text(void);
 
103
 
 
104
/* Allow frame header files to be singly included */
 
105
#define FRAME_LIB_INCLUDE
 
106
 
 
107
#include "lib/framework/frame.h"
 
108
#include <string.h>
 
109
#include <stdlib.h>
 
110
 
 
111
#include "lib/framework/string_ext.h"
 
112
#include "lib/framework/frameresource.h"
 
113
#include "lib/framework/resly.h"
 
114
 
 
115
extern void yyerror(const char* msg);
 
116
void yyerror(const char* msg)
 
117
{
 
118
        debug(LOG_ERROR, "RES file parse error:\n%s at line %d\nText: '%s'\n", msg, res_get_lineno(), res_get_text());
 
119
}
 
120
 
 
121
 
 
122
 
 
123
/* Enabling traces.  */
 
124
#ifndef YYDEBUG
 
125
# define YYDEBUG 0
 
126
#endif
 
127
 
 
128
/* Enabling verbose error messages.  */
 
129
#ifdef YYERROR_VERBOSE
 
130
# undef YYERROR_VERBOSE
 
131
# define YYERROR_VERBOSE 1
 
132
#else
 
133
# define YYERROR_VERBOSE 0
 
134
#endif
 
135
 
 
136
/* Enabling the token table.  */
 
137
#ifndef YYTOKEN_TABLE
 
138
# define YYTOKEN_TABLE 0
 
139
#endif
 
140
 
 
141
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 
142
typedef union YYSTYPE
 
143
#line 51 "resource_parser.y"
 
144
{
 
145
        char  *sval;
 
146
}
 
147
/* Line 187 of yacc.c.  */
 
148
#line 149 "resource_parser.tab.c"
 
149
        YYSTYPE;
 
150
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 
151
# define YYSTYPE_IS_DECLARED 1
 
152
# define YYSTYPE_IS_TRIVIAL 1
 
153
#endif
 
154
 
 
155
 
 
156
 
 
157
/* Copy the second part of user declarations.  */
 
158
 
 
159
 
 
160
/* Line 216 of yacc.c.  */
 
161
#line 162 "resource_parser.tab.c"
 
162
 
 
163
#ifdef short
 
164
# undef short
 
165
#endif
 
166
 
 
167
#ifdef YYTYPE_UINT8
 
168
typedef YYTYPE_UINT8 yytype_uint8;
 
169
#else
 
170
typedef unsigned char yytype_uint8;
 
171
#endif
 
172
 
 
173
#ifdef YYTYPE_INT8
 
174
typedef YYTYPE_INT8 yytype_int8;
 
175
#elif (defined __STDC__ || defined __C99__FUNC__ \
 
176
     || defined __cplusplus || defined _MSC_VER)
 
177
typedef signed char yytype_int8;
 
178
#else
 
179
typedef short int yytype_int8;
 
180
#endif
 
181
 
 
182
#ifdef YYTYPE_UINT16
 
183
typedef YYTYPE_UINT16 yytype_uint16;
 
184
#else
 
185
typedef unsigned short int yytype_uint16;
 
186
#endif
 
187
 
 
188
#ifdef YYTYPE_INT16
 
189
typedef YYTYPE_INT16 yytype_int16;
 
190
#else
 
191
typedef short int yytype_int16;
 
192
#endif
 
193
 
 
194
#ifndef YYSIZE_T
 
195
# ifdef __SIZE_TYPE__
 
196
#  define YYSIZE_T __SIZE_TYPE__
 
197
# elif defined size_t
 
198
#  define YYSIZE_T size_t
 
199
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
 
200
     || defined __cplusplus || defined _MSC_VER)
 
201
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 
202
#  define YYSIZE_T size_t
 
203
# else
 
204
#  define YYSIZE_T unsigned int
 
205
# endif
 
206
#endif
 
207
 
 
208
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 
209
 
 
210
#ifndef YY_
 
211
# if YYENABLE_NLS
 
212
#  if ENABLE_NLS
 
213
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 
214
#   define YY_(msgid) dgettext ("bison-runtime", msgid)
 
215
#  endif
 
216
# endif
 
217
# ifndef YY_
 
218
#  define YY_(msgid) msgid
 
219
# endif
 
220
#endif
 
221
 
 
222
/* Suppress unused-variable warnings by "using" E.  */
 
223
#if ! defined lint || defined __GNUC__
 
224
# define YYUSE(e) ((void) (e))
 
225
#else
 
226
# define YYUSE(e) /* empty */
 
227
#endif
 
228
 
 
229
/* Identity function, used to suppress warnings about constant conditions.  */
 
230
#ifndef lint
 
231
# define YYID(n) (n)
 
232
#else
 
233
#if (defined __STDC__ || defined __C99__FUNC__ \
 
234
     || defined __cplusplus || defined _MSC_VER)
 
235
static int
 
236
YYID (int i)
 
237
#else
 
238
static int
 
239
YYID (i)
 
240
    int i;
 
241
#endif
 
242
{
 
243
  return i;
 
244
}
 
245
#endif
 
246
 
 
247
#if ! defined yyoverflow || YYERROR_VERBOSE
 
248
 
 
249
/* The parser invokes alloca or malloc; define the necessary symbols.  */
 
250
 
 
251
# ifdef YYSTACK_USE_ALLOCA
 
252
#  if YYSTACK_USE_ALLOCA
 
253
#   ifdef __GNUC__
 
254
#    define YYSTACK_ALLOC __builtin_alloca
 
255
#   elif defined __BUILTIN_VA_ARG_INCR
 
256
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
 
257
#   elif defined _AIX
 
258
#    define YYSTACK_ALLOC __alloca
 
259
#   elif defined _MSC_VER
 
260
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
 
261
#    define alloca _alloca
 
262
#   else
 
263
#    define YYSTACK_ALLOC alloca
 
264
#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 
265
     || defined __cplusplus || defined _MSC_VER)
 
266
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 
267
#     ifndef _STDLIB_H
 
268
#      define _STDLIB_H 1
 
269
#     endif
 
270
#    endif
 
271
#   endif
 
272
#  endif
 
273
# endif
 
274
 
 
275
# ifdef YYSTACK_ALLOC
 
276
   /* Pacify GCC's `empty if-body' warning.  */
 
277
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
 
278
#  ifndef YYSTACK_ALLOC_MAXIMUM
 
279
    /* The OS might guarantee only one guard page at the bottom of the stack,
 
280
       and a page size can be as small as 4096 bytes.  So we cannot safely
 
281
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
 
282
       to allow for a few compiler-allocated temporary stack slots.  */
 
283
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
 
284
#  endif
 
285
# else
 
286
#  define YYSTACK_ALLOC YYMALLOC
 
287
#  define YYSTACK_FREE YYFREE
 
288
#  ifndef YYSTACK_ALLOC_MAXIMUM
 
289
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 
290
#  endif
 
291
#  if (defined __cplusplus && ! defined _STDLIB_H \
 
292
       && ! ((defined YYMALLOC || defined malloc) \
 
293
             && (defined YYFREE || defined free)))
 
294
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 
295
#   ifndef _STDLIB_H
 
296
#    define _STDLIB_H 1
 
297
#   endif
 
298
#  endif
 
299
#  ifndef YYMALLOC
 
300
#   define YYMALLOC malloc
 
301
#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 
302
     || defined __cplusplus || defined _MSC_VER)
 
303
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 
304
#   endif
 
305
#  endif
 
306
#  ifndef YYFREE
 
307
#   define YYFREE free
 
308
#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 
309
     || defined __cplusplus || defined _MSC_VER)
 
310
void free (void *); /* INFRINGES ON USER NAME SPACE */
 
311
#   endif
 
312
#  endif
 
313
# endif
 
314
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
 
315
 
 
316
 
 
317
#if (! defined yyoverflow \
 
318
     && (! defined __cplusplus \
 
319
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
320
 
 
321
/* A type that is properly aligned for any stack member.  */
 
322
union yyalloc
 
323
{
 
324
  yytype_int16 yyss;
 
325
  YYSTYPE yyvs;
 
326
  };
 
327
 
 
328
/* The size of the maximum gap between one aligned stack and the next.  */
 
329
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
 
330
 
 
331
/* The size of an array large to enough to hold all stacks, each with
 
332
   N elements.  */
 
333
# define YYSTACK_BYTES(N) \
 
334
     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
 
335
      + YYSTACK_GAP_MAXIMUM)
 
336
 
 
337
/* Copy COUNT objects from FROM to TO.  The source and destination do
 
338
   not overlap.  */
 
339
# ifndef YYCOPY
 
340
#  if defined __GNUC__ && 1 < __GNUC__
 
341
#   define YYCOPY(To, From, Count) \
 
342
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 
343
#  else
 
344
#   define YYCOPY(To, From, Count)              \
 
345
      do                                        \
 
346
        {                                       \
 
347
          YYSIZE_T yyi;                         \
 
348
          for (yyi = 0; yyi < (Count); yyi++)   \
 
349
            (To)[yyi] = (From)[yyi];            \
 
350
        }                                       \
 
351
      while (YYID (0))
 
352
#  endif
 
353
# endif
 
354
 
 
355
/* Relocate STACK from its old location to the new one.  The
 
356
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
 
357
   elements in the stack, and YYPTR gives the new location of the
 
358
   stack.  Advance YYPTR to a properly aligned location for the next
 
359
   stack.  */
 
360
# define YYSTACK_RELOCATE(Stack)                                        \
 
361
    do                                                                  \
 
362
      {                                                                 \
 
363
        YYSIZE_T yynewbytes;                                            \
 
364
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
 
365
        Stack = &yyptr->Stack;                                          \
 
366
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 
367
        yyptr += yynewbytes / sizeof (*yyptr);                          \
 
368
      }                                                                 \
 
369
    while (YYID (0))
 
370
 
 
371
#endif
 
372
 
 
373
/* YYFINAL -- State number of the termination state.  */
 
374
#define YYFINAL  9
 
375
/* YYLAST -- Last index in YYTABLE.  */
 
376
#define YYLAST   8
 
377
 
 
378
/* YYNTOKENS -- Number of terminals.  */
 
379
#define YYNTOKENS  7
 
380
/* YYNNTS -- Number of nonterminals.  */
 
381
#define YYNNTS  5
 
382
/* YYNRULES -- Number of rules.  */
 
383
#define YYNRULES  7
 
384
/* YYNRULES -- Number of states.  */
 
385
#define YYNSTATES  12
 
386
 
 
387
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 
388
#define YYUNDEFTOK  2
 
389
#define YYMAXUTOK   261
 
390
 
 
391
#define YYTRANSLATE(YYX)                                                \
 
392
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
393
 
 
394
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
 
395
static const yytype_uint8 yytranslate[] =
 
396
{
 
397
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
398
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
399
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
400
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
401
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
402
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
403
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
404
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
405
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
406
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
407
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
408
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
409
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
410
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
411
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
412
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
413
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
414
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
415
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
416
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
417
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
418
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
419
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
420
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
421
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
422
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
 
423
       5,     6
 
424
};
 
425
 
 
426
#if YYDEBUG
 
427
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
 
428
   YYRHS.  */
 
429
static const yytype_uint8 yyprhs[] =
 
430
{
 
431
       0,     0,     3,     5,     8,    10,    12,    15
 
432
};
 
433
 
 
434
/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 
435
static const yytype_int8 yyrhs[] =
 
436
{
 
437
       8,     0,    -1,     9,    -1,     8,     9,    -1,    10,    -1,
 
438
      11,    -1,     5,     4,    -1,     6,     3,     4,    -1
 
439
};
 
440
 
 
441
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 
442
static const yytype_uint8 yyrline[] =
 
443
{
 
444
       0,    75,    75,    76,    79,    80,    83,   112
 
445
};
 
446
#endif
 
447
 
 
448
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 
449
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
 
450
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 
451
static const char *const yytname[] =
 
452
{
 
453
  "$end", "error", "$undefined", "TEXT_T", "QTEXT_T", "DIRECTORY",
 
454
  "FILETOKEN", "$accept", "res_file", "res_line", "dir_line", "file_line", 0
 
455
};
 
456
#endif
 
457
 
 
458
# ifdef YYPRINT
 
459
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
 
460
   token YYLEX-NUM.  */
 
461
static const yytype_uint16 yytoknum[] =
 
462
{
 
463
       0,   256,   257,   258,   259,   260,   261
 
464
};
 
465
# endif
 
466
 
 
467
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 
468
static const yytype_uint8 yyr1[] =
 
469
{
 
470
       0,     7,     8,     8,     9,     9,    10,    11
 
471
};
 
472
 
 
473
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 
474
static const yytype_uint8 yyr2[] =
 
475
{
 
476
       0,     2,     1,     2,     1,     1,     2,     3
 
477
};
 
478
 
 
479
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
 
480
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
 
481
   means the default is an error.  */
 
482
static const yytype_uint8 yydefact[] =
 
483
{
 
484
       0,     0,     0,     0,     2,     4,     5,     6,     0,     1,
 
485
       3,     7
 
486
};
 
487
 
 
488
/* YYDEFGOTO[NTERM-NUM].  */
 
489
static const yytype_int8 yydefgoto[] =
 
490
{
 
491
      -1,     3,     4,     5,     6
 
492
};
 
493
 
 
494
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
 
495
   STATE-NUM.  */
 
496
#define YYPACT_NINF -5
 
497
static const yytype_int8 yypact[] =
 
498
{
 
499
      -4,    -1,     1,     0,    -5,    -5,    -5,    -5,     3,    -5,
 
500
      -5,    -5
 
501
};
 
502
 
 
503
/* YYPGOTO[NTERM-NUM].  */
 
504
static const yytype_int8 yypgoto[] =
 
505
{
 
506
      -5,    -5,     5,    -5,    -5
 
507
};
 
508
 
 
509
/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
 
510
   positive, shift that token.  If negative, reduce the rule which
 
511
   number is the opposite.  If zero, do what YYDEFACT says.
 
512
   If YYTABLE_NINF, syntax error.  */
 
513
#define YYTABLE_NINF -1
 
514
static const yytype_uint8 yytable[] =
 
515
{
 
516
       9,     1,     2,     7,     8,     1,     2,    11,    10
 
517
};
 
518
 
 
519
static const yytype_uint8 yycheck[] =
 
520
{
 
521
       0,     5,     6,     4,     3,     5,     6,     4,     3
 
522
};
 
523
 
 
524
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
 
525
   symbol of state STATE-NUM.  */
 
526
static const yytype_uint8 yystos[] =
 
527
{
 
528
       0,     5,     6,     8,     9,    10,    11,     4,     3,     0,
 
529
       9,     4
 
530
};
 
531
 
 
532
#define yyerrok         (yyerrstatus = 0)
 
533
#define yyclearin       (yychar = YYEMPTY)
 
534
#define YYEMPTY         (-2)
 
535
#define YYEOF           0
 
536
 
 
537
#define YYACCEPT        goto yyacceptlab
 
538
#define YYABORT         goto yyabortlab
 
539
#define YYERROR         goto yyerrorlab
 
540
 
 
541
 
 
542
/* Like YYERROR except do call yyerror.  This remains here temporarily
 
543
   to ease the transition to the new meaning of YYERROR, for GCC.
 
544
   Once GCC version 2 has supplanted version 1, this can go.  */
 
545
 
 
546
#define YYFAIL          goto yyerrlab
 
547
 
 
548
#define YYRECOVERING()  (!!yyerrstatus)
 
549
 
 
550
#define YYBACKUP(Token, Value)                                  \
 
551
do                                                              \
 
552
  if (yychar == YYEMPTY && yylen == 1)                          \
 
553
    {                                                           \
 
554
      yychar = (Token);                                         \
 
555
      yylval = (Value);                                         \
 
556
      yytoken = YYTRANSLATE (yychar);                           \
 
557
      YYPOPSTACK (1);                                           \
 
558
      goto yybackup;                                            \
 
559
    }                                                           \
 
560
  else                                                          \
 
561
    {                                                           \
 
562
      yyerror (YY_("syntax error: cannot back up")); \
 
563
      YYERROR;                                                  \
 
564
    }                                                           \
 
565
while (YYID (0))
 
566
 
 
567
 
 
568
#define YYTERROR        1
 
569
#define YYERRCODE       256
 
570
 
 
571
 
 
572
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
 
573
   If N is 0, then set CURRENT to the empty location which ends
 
574
   the previous symbol: RHS[0] (always defined).  */
 
575
 
 
576
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
 
577
#ifndef YYLLOC_DEFAULT
 
578
# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
 
579
    do                                                                  \
 
580
      if (YYID (N))                                                    \
 
581
        {                                                               \
 
582
          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
 
583
          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
 
584
          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
 
585
          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
 
586
        }                                                               \
 
587
      else                                                              \
 
588
        {                                                               \
 
589
          (Current).first_line   = (Current).last_line   =              \
 
590
            YYRHSLOC (Rhs, 0).last_line;                                \
 
591
          (Current).first_column = (Current).last_column =              \
 
592
            YYRHSLOC (Rhs, 0).last_column;                              \
 
593
        }                                                               \
 
594
    while (YYID (0))
 
595
#endif
 
596
 
 
597
 
 
598
/* YY_LOCATION_PRINT -- Print the location on the stream.
 
599
   This macro was not mandated originally: define only if we know
 
600
   we won't break user code: when these are the locations we know.  */
 
601
 
 
602
#ifndef YY_LOCATION_PRINT
 
603
# if YYLTYPE_IS_TRIVIAL
 
604
#  define YY_LOCATION_PRINT(File, Loc)                  \
 
605
     fprintf (File, "%d.%d-%d.%d",                      \
 
606
              (Loc).first_line, (Loc).first_column,     \
 
607
              (Loc).last_line,  (Loc).last_column)
 
608
# else
 
609
#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 
610
# endif
 
611
#endif
 
612
 
 
613
 
 
614
/* YYLEX -- calling `yylex' with the right arguments.  */
 
615
 
 
616
#ifdef YYLEX_PARAM
 
617
# define YYLEX yylex (YYLEX_PARAM)
 
618
#else
 
619
# define YYLEX yylex ()
 
620
#endif
 
621
 
 
622
/* Enable debugging if requested.  */
 
623
#if YYDEBUG
 
624
 
 
625
# ifndef YYFPRINTF
 
626
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
 
627
#  define YYFPRINTF fprintf
 
628
# endif
 
629
 
 
630
# define YYDPRINTF(Args)                        \
 
631
do {                                            \
 
632
  if (yydebug)                                  \
 
633
    YYFPRINTF Args;                             \
 
634
} while (YYID (0))
 
635
 
 
636
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
 
637
do {                                                                      \
 
638
  if (yydebug)                                                            \
 
639
    {                                                                     \
 
640
      YYFPRINTF (stderr, "%s ", Title);                                   \
 
641
      yy_symbol_print (stderr,                                            \
 
642
                  Type, Value); \
 
643
      YYFPRINTF (stderr, "\n");                                           \
 
644
    }                                                                     \
 
645
} while (YYID (0))
 
646
 
 
647
 
 
648
/*--------------------------------.
 
649
| Print this symbol on YYOUTPUT.  |
 
650
`--------------------------------*/
 
651
 
 
652
/*ARGSUSED*/
 
653
#if (defined __STDC__ || defined __C99__FUNC__ \
 
654
     || defined __cplusplus || defined _MSC_VER)
 
655
static void
 
656
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 
657
#else
 
658
static void
 
659
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
 
660
    FILE *yyoutput;
 
661
    int yytype;
 
662
    YYSTYPE const * const yyvaluep;
 
663
#endif
 
664
{
 
665
  if (!yyvaluep)
 
666
    return;
 
667
# ifdef YYPRINT
 
668
  if (yytype < YYNTOKENS)
 
669
    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
 
670
# else
 
671
  YYUSE (yyoutput);
 
672
# endif
 
673
  switch (yytype)
 
674
    {
 
675
      default:
 
676
        break;
 
677
    }
 
678
}
 
679
 
 
680
 
 
681
/*--------------------------------.
 
682
| Print this symbol on YYOUTPUT.  |
 
683
`--------------------------------*/
 
684
 
 
685
#if (defined __STDC__ || defined __C99__FUNC__ \
 
686
     || defined __cplusplus || defined _MSC_VER)
 
687
static void
 
688
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 
689
#else
 
690
static void
 
691
yy_symbol_print (yyoutput, yytype, yyvaluep)
 
692
    FILE *yyoutput;
 
693
    int yytype;
 
694
    YYSTYPE const * const yyvaluep;
 
695
#endif
 
696
{
 
697
  if (yytype < YYNTOKENS)
 
698
    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
 
699
  else
 
700
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
 
701
 
 
702
  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
 
703
  YYFPRINTF (yyoutput, ")");
 
704
}
 
705
 
 
706
/*------------------------------------------------------------------.
 
707
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
 
708
| TOP (included).                                                   |
 
709
`------------------------------------------------------------------*/
 
710
 
 
711
#if (defined __STDC__ || defined __C99__FUNC__ \
 
712
     || defined __cplusplus || defined _MSC_VER)
 
713
static void
 
714
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
 
715
#else
 
716
static void
 
717
yy_stack_print (bottom, top)
 
718
    yytype_int16 *bottom;
 
719
    yytype_int16 *top;
 
720
#endif
 
721
{
 
722
  YYFPRINTF (stderr, "Stack now");
 
723
  for (; bottom <= top; ++bottom)
 
724
    YYFPRINTF (stderr, " %d", *bottom);
 
725
  YYFPRINTF (stderr, "\n");
 
726
}
 
727
 
 
728
# define YY_STACK_PRINT(Bottom, Top)                            \
 
729
do {                                                            \
 
730
  if (yydebug)                                                  \
 
731
    yy_stack_print ((Bottom), (Top));                           \
 
732
} while (YYID (0))
 
733
 
 
734
 
 
735
/*------------------------------------------------.
 
736
| Report that the YYRULE is going to be reduced.  |
 
737
`------------------------------------------------*/
 
738
 
 
739
#if (defined __STDC__ || defined __C99__FUNC__ \
 
740
     || defined __cplusplus || defined _MSC_VER)
 
741
static void
 
742
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
 
743
#else
 
744
static void
 
745
yy_reduce_print (yyvsp, yyrule)
 
746
    YYSTYPE *yyvsp;
 
747
    int yyrule;
 
748
#endif
 
749
{
 
750
  int yynrhs = yyr2[yyrule];
 
751
  int yyi;
 
752
  unsigned long int yylno = yyrline[yyrule];
 
753
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
 
754
             yyrule - 1, yylno);
 
755
  /* The symbols being reduced.  */
 
756
  for (yyi = 0; yyi < yynrhs; yyi++)
 
757
    {
 
758
      fprintf (stderr, "   $%d = ", yyi + 1);
 
759
      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
 
760
                       &(yyvsp[(yyi + 1) - (yynrhs)])
 
761
                                       );
 
762
      fprintf (stderr, "\n");
 
763
    }
 
764
}
 
765
 
 
766
# define YY_REDUCE_PRINT(Rule)          \
 
767
do {                                    \
 
768
  if (yydebug)                          \
 
769
    yy_reduce_print (yyvsp, Rule); \
 
770
} while (YYID (0))
 
771
 
 
772
/* Nonzero means print parse trace.  It is left uninitialized so that
 
773
   multiple parsers can coexist.  */
 
774
int yydebug;
 
775
#else /* !YYDEBUG */
 
776
# define YYDPRINTF(Args)
 
777
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 
778
# define YY_STACK_PRINT(Bottom, Top)
 
779
# define YY_REDUCE_PRINT(Rule)
 
780
#endif /* !YYDEBUG */
 
781
 
 
782
 
 
783
/* YYINITDEPTH -- initial size of the parser's stacks.  */
 
784
#ifndef YYINITDEPTH
 
785
# define YYINITDEPTH 200
 
786
#endif
 
787
 
 
788
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
 
789
   if the built-in stack extension method is used).
 
790
 
 
791
   Do not make this value too large; the results are undefined if
 
792
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
 
793
   evaluated with infinite-precision integer arithmetic.  */
 
794
 
 
795
#ifndef YYMAXDEPTH
 
796
# define YYMAXDEPTH 10000
 
797
#endif
 
798
 
 
799
 
 
800
 
 
801
#if YYERROR_VERBOSE
 
802
 
 
803
# ifndef yystrlen
 
804
#  if defined __GLIBC__ && defined _STRING_H
 
805
#   define yystrlen strlen
 
806
#  else
 
807
/* Return the length of YYSTR.  */
 
808
#if (defined __STDC__ || defined __C99__FUNC__ \
 
809
     || defined __cplusplus || defined _MSC_VER)
 
810
static YYSIZE_T
 
811
yystrlen (const char *yystr)
 
812
#else
 
813
static YYSIZE_T
 
814
yystrlen (yystr)
 
815
    const char *yystr;
 
816
#endif
 
817
{
 
818
  YYSIZE_T yylen;
 
819
  for (yylen = 0; yystr[yylen]; yylen++)
 
820
    continue;
 
821
  return yylen;
 
822
}
 
823
#  endif
 
824
# endif
 
825
 
 
826
# ifndef yystpcpy
 
827
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
 
828
#   define yystpcpy stpcpy
 
829
#  else
 
830
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
 
831
   YYDEST.  */
 
832
#if (defined __STDC__ || defined __C99__FUNC__ \
 
833
     || defined __cplusplus || defined _MSC_VER)
 
834
static char *
 
835
yystpcpy (char *yydest, const char *yysrc)
 
836
#else
 
837
static char *
 
838
yystpcpy (yydest, yysrc)
 
839
    char *yydest;
 
840
    const char *yysrc;
 
841
#endif
 
842
{
 
843
  char *yyd = yydest;
 
844
  const char *yys = yysrc;
 
845
 
 
846
  while ((*yyd++ = *yys++) != '\0')
 
847
    continue;
 
848
 
 
849
  return yyd - 1;
 
850
}
 
851
#  endif
 
852
# endif
 
853
 
 
854
# ifndef yytnamerr
 
855
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
 
856
   quotes and backslashes, so that it's suitable for yyerror.  The
 
857
   heuristic is that double-quoting is unnecessary unless the string
 
858
   contains an apostrophe, a comma, or backslash (other than
 
859
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
 
860
   null, do not copy; instead, return the length of what the result
 
861
   would have been.  */
 
862
static YYSIZE_T
 
863
yytnamerr (char *yyres, const char *yystr)
 
864
{
 
865
  if (*yystr == '"')
 
866
    {
 
867
      YYSIZE_T yyn = 0;
 
868
      char const *yyp = yystr;
 
869
 
 
870
      for (;;)
 
871
        switch (*++yyp)
 
872
          {
 
873
          case '\'':
 
874
          case ',':
 
875
            goto do_not_strip_quotes;
 
876
 
 
877
          case '\\':
 
878
            if (*++yyp != '\\')
 
879
              goto do_not_strip_quotes;
 
880
            /* Fall through.  */
 
881
          default:
 
882
            if (yyres)
 
883
              yyres[yyn] = *yyp;
 
884
            yyn++;
 
885
            break;
 
886
 
 
887
          case '"':
 
888
            if (yyres)
 
889
              yyres[yyn] = '\0';
 
890
            return yyn;
 
891
          }
 
892
    do_not_strip_quotes: ;
 
893
    }
 
894
 
 
895
  if (! yyres)
 
896
    return yystrlen (yystr);
 
897
 
 
898
  return yystpcpy (yyres, yystr) - yyres;
 
899
}
 
900
# endif
 
901
 
 
902
/* Copy into YYRESULT an error message about the unexpected token
 
903
   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
 
904
   including the terminating null byte.  If YYRESULT is null, do not
 
905
   copy anything; just return the number of bytes that would be
 
906
   copied.  As a special case, return 0 if an ordinary "syntax error"
 
907
   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
 
908
   size calculation.  */
 
909
static YYSIZE_T
 
910
yysyntax_error (char *yyresult, int yystate, int yychar)
 
911
{
 
912
  int yyn = yypact[yystate];
 
913
 
 
914
  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
 
915
    return 0;
 
916
  else
 
917
    {
 
918
      int yytype = YYTRANSLATE (yychar);
 
919
      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
 
920
      YYSIZE_T yysize = yysize0;
 
921
      YYSIZE_T yysize1;
 
922
      int yysize_overflow = 0;
 
923
      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
 
924
      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
 
925
      int yyx;
 
926
 
 
927
# if 0
 
928
      /* This is so xgettext sees the translatable formats that are
 
929
         constructed on the fly.  */
 
930
      YY_("syntax error, unexpected %s");
 
931
      YY_("syntax error, unexpected %s, expecting %s");
 
932
      YY_("syntax error, unexpected %s, expecting %s or %s");
 
933
      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
 
934
      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
 
935
# endif
 
936
      char *yyfmt;
 
937
      char const *yyf;
 
938
      static char const yyunexpected[] = "syntax error, unexpected %s";
 
939
      static char const yyexpecting[] = ", expecting %s";
 
940
      static char const yyor[] = " or %s";
 
941
      char yyformat[sizeof yyunexpected
 
942
                    + sizeof yyexpecting - 1
 
943
                    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
 
944
                       * (sizeof yyor - 1))];
 
945
      char const *yyprefix = yyexpecting;
 
946
 
 
947
      /* Start YYX at -YYN if negative to avoid negative indexes in
 
948
         YYCHECK.  */
 
949
      int yyxbegin = yyn < 0 ? -yyn : 0;
 
950
 
 
951
      /* Stay within bounds of both yycheck and yytname.  */
 
952
      int yychecklim = YYLAST - yyn + 1;
 
953
      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
 
954
      int yycount = 1;
 
955
 
 
956
      yyarg[0] = yytname[yytype];
 
957
      yyfmt = yystpcpy (yyformat, yyunexpected);
 
958
 
 
959
      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
 
960
        if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
 
961
          {
 
962
            if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
 
963
              {
 
964
                yycount = 1;
 
965
                yysize = yysize0;
 
966
                yyformat[sizeof yyunexpected - 1] = '\0';
 
967
                break;
 
968
              }
 
969
            yyarg[yycount++] = yytname[yyx];
 
970
            yysize1 = yysize + yytnamerr (0, yytname[yyx]);
 
971
            yysize_overflow |= (yysize1 < yysize);
 
972
            yysize = yysize1;
 
973
            yyfmt = yystpcpy (yyfmt, yyprefix);
 
974
            yyprefix = yyor;
 
975
          }
 
976
 
 
977
      yyf = YY_(yyformat);
 
978
      yysize1 = yysize + yystrlen (yyf);
 
979
      yysize_overflow |= (yysize1 < yysize);
 
980
      yysize = yysize1;
 
981
 
 
982
      if (yysize_overflow)
 
983
        return YYSIZE_MAXIMUM;
 
984
 
 
985
      if (yyresult)
 
986
        {
 
987
          /* Avoid sprintf, as that infringes on the user's name space.
 
988
             Don't have undefined behavior even if the translation
 
989
             produced a string with the wrong number of "%s"s.  */
 
990
          char *yyp = yyresult;
 
991
          int yyi = 0;
 
992
          while ((*yyp = *yyf) != '\0')
 
993
            {
 
994
              if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
 
995
                {
 
996
                  yyp += yytnamerr (yyp, yyarg[yyi++]);
 
997
                  yyf += 2;
 
998
                }
 
999
              else
 
1000
                {
 
1001
                  yyp++;
 
1002
                  yyf++;
 
1003
                }
 
1004
            }
 
1005
        }
 
1006
      return yysize;
 
1007
    }
 
1008
}
 
1009
#endif /* YYERROR_VERBOSE */
 
1010
 
 
1011
 
 
1012
/*-----------------------------------------------.
 
1013
| Release the memory associated to this symbol.  |
 
1014
`-----------------------------------------------*/
 
1015
 
 
1016
/*ARGSUSED*/
 
1017
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1018
     || defined __cplusplus || defined _MSC_VER)
 
1019
static void
 
1020
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
 
1021
#else
 
1022
static void
 
1023
yydestruct (yymsg, yytype, yyvaluep)
 
1024
    const char *yymsg;
 
1025
    int yytype;
 
1026
    YYSTYPE *yyvaluep;
 
1027
#endif
 
1028
{
 
1029
  YYUSE (yyvaluep);
 
1030
 
 
1031
  if (!yymsg)
 
1032
    yymsg = "Deleting";
 
1033
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
 
1034
 
 
1035
  switch (yytype)
 
1036
    {
 
1037
      case 3: /* "TEXT_T" */
 
1038
#line 59 "resource_parser.y"
 
1039
        {
 
1040
#ifndef WZ_OS_WIN
 
1041
        // Force type checking by the compiler
 
1042
        char * const s = (yyvaluep->sval);
 
1043
 
 
1044
        if (s)
 
1045
                free(s);
 
1046
#endif
 
1047
};
 
1048
#line 1049 "resource_parser.tab.c"
 
1049
        break;
 
1050
      case 4: /* "QTEXT_T" */
 
1051
#line 59 "resource_parser.y"
 
1052
        {
 
1053
#ifndef WZ_OS_WIN
 
1054
        // Force type checking by the compiler
 
1055
        char * const s = (yyvaluep->sval);
 
1056
 
 
1057
        if (s)
 
1058
                free(s);
 
1059
#endif
 
1060
};
 
1061
#line 1062 "resource_parser.tab.c"
 
1062
        break;
 
1063
 
 
1064
      default:
 
1065
        break;
 
1066
    }
 
1067
}
 
1068
 
 
1069
 
 
1070
/* Prevent warnings from -Wmissing-prototypes.  */
 
1071
 
 
1072
#ifdef YYPARSE_PARAM
 
1073
#if defined __STDC__ || defined __cplusplus
 
1074
int yyparse (void *YYPARSE_PARAM);
 
1075
#else
 
1076
int yyparse ();
 
1077
#endif
 
1078
#else /* ! YYPARSE_PARAM */
 
1079
#if defined __STDC__ || defined __cplusplus
 
1080
int yyparse (void);
 
1081
#else
 
1082
int yyparse ();
 
1083
#endif
 
1084
#endif /* ! YYPARSE_PARAM */
 
1085
 
 
1086
 
 
1087
 
 
1088
/* The look-ahead symbol.  */
 
1089
int yychar;
 
1090
 
 
1091
/* The semantic value of the look-ahead symbol.  */
 
1092
YYSTYPE yylval;
 
1093
 
 
1094
/* Number of syntax errors so far.  */
 
1095
int yynerrs;
 
1096
 
 
1097
 
 
1098
 
 
1099
/*----------.
 
1100
| yyparse.  |
 
1101
`----------*/
 
1102
 
 
1103
#ifdef YYPARSE_PARAM
 
1104
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1105
     || defined __cplusplus || defined _MSC_VER)
 
1106
int
 
1107
yyparse (void *YYPARSE_PARAM)
 
1108
#else
 
1109
int
 
1110
yyparse (YYPARSE_PARAM)
 
1111
    void *YYPARSE_PARAM;
 
1112
#endif
 
1113
#else /* ! YYPARSE_PARAM */
 
1114
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1115
     || defined __cplusplus || defined _MSC_VER)
 
1116
int
 
1117
yyparse (void)
 
1118
#else
 
1119
int
 
1120
yyparse ()
 
1121
 
 
1122
#endif
 
1123
#endif
 
1124
{
 
1125
  
 
1126
  int yystate;
 
1127
  int yyn;
 
1128
  int yyresult;
 
1129
  /* Number of tokens to shift before error messages enabled.  */
 
1130
  int yyerrstatus;
 
1131
  /* Look-ahead token as an internal (translated) token number.  */
 
1132
  int yytoken = 0;
 
1133
#if YYERROR_VERBOSE
 
1134
  /* Buffer for error messages, and its allocated size.  */
 
1135
  char yymsgbuf[128];
 
1136
  char *yymsg = yymsgbuf;
 
1137
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
 
1138
#endif
 
1139
 
 
1140
  /* Three stacks and their tools:
 
1141
     `yyss': related to states,
 
1142
     `yyvs': related to semantic values,
 
1143
     `yyls': related to locations.
 
1144
 
 
1145
     Refer to the stacks thru separate pointers, to allow yyoverflow
 
1146
     to reallocate them elsewhere.  */
 
1147
 
 
1148
  /* The state stack.  */
 
1149
  yytype_int16 yyssa[YYINITDEPTH];
 
1150
  yytype_int16 *yyss = yyssa;
 
1151
  yytype_int16 *yyssp;
 
1152
 
 
1153
  /* The semantic value stack.  */
 
1154
  YYSTYPE yyvsa[YYINITDEPTH];
 
1155
  YYSTYPE *yyvs = yyvsa;
 
1156
  YYSTYPE *yyvsp;
 
1157
 
 
1158
 
 
1159
 
 
1160
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
1161
 
 
1162
  YYSIZE_T yystacksize = YYINITDEPTH;
 
1163
 
 
1164
  /* The variables used to return semantic value and location from the
 
1165
     action routines.  */
 
1166
  YYSTYPE yyval;
 
1167
 
 
1168
 
 
1169
  /* The number of symbols on the RHS of the reduced rule.
 
1170
     Keep to zero when no symbol should be popped.  */
 
1171
  int yylen = 0;
 
1172
 
 
1173
  YYDPRINTF ((stderr, "Starting parse\n"));
 
1174
 
 
1175
  yystate = 0;
 
1176
  yyerrstatus = 0;
 
1177
  yynerrs = 0;
 
1178
  yychar = YYEMPTY;             /* Cause a token to be read.  */
 
1179
 
 
1180
  /* Initialize stack pointers.
 
1181
     Waste one element of value and location stack
 
1182
     so that they stay on the same level as the state stack.
 
1183
     The wasted elements are never initialized.  */
 
1184
 
 
1185
  yyssp = yyss;
 
1186
  yyvsp = yyvs;
 
1187
 
 
1188
  goto yysetstate;
 
1189
 
 
1190
/*------------------------------------------------------------.
 
1191
| yynewstate -- Push a new state, which is found in yystate.  |
 
1192
`------------------------------------------------------------*/
 
1193
 yynewstate:
 
1194
  /* In all cases, when you get here, the value and location stacks
 
1195
     have just been pushed.  So pushing a state here evens the stacks.  */
 
1196
  yyssp++;
 
1197
 
 
1198
 yysetstate:
 
1199
  *yyssp = yystate;
 
1200
 
 
1201
  if (yyss + yystacksize - 1 <= yyssp)
 
1202
    {
 
1203
      /* Get the current used size of the three stacks, in elements.  */
 
1204
      YYSIZE_T yysize = yyssp - yyss + 1;
 
1205
 
 
1206
#ifdef yyoverflow
 
1207
      {
 
1208
        /* Give user a chance to reallocate the stack.  Use copies of
 
1209
           these so that the &'s don't force the real ones into
 
1210
           memory.  */
 
1211
        YYSTYPE *yyvs1 = yyvs;
 
1212
        yytype_int16 *yyss1 = yyss;
 
1213
 
 
1214
 
 
1215
        /* Each stack pointer address is followed by the size of the
 
1216
           data in use in that stack, in bytes.  This used to be a
 
1217
           conditional around just the two extra args, but that might
 
1218
           be undefined if yyoverflow is a macro.  */
 
1219
        yyoverflow (YY_("memory exhausted"),
 
1220
                    &yyss1, yysize * sizeof (*yyssp),
 
1221
                    &yyvs1, yysize * sizeof (*yyvsp),
 
1222
 
 
1223
                    &yystacksize);
 
1224
 
 
1225
        yyss = yyss1;
 
1226
        yyvs = yyvs1;
 
1227
      }
 
1228
#else /* no yyoverflow */
 
1229
# ifndef YYSTACK_RELOCATE
 
1230
      goto yyexhaustedlab;
 
1231
# else
 
1232
      /* Extend the stack our own way.  */
 
1233
      if (YYMAXDEPTH <= yystacksize)
 
1234
        goto yyexhaustedlab;
 
1235
      yystacksize *= 2;
 
1236
      if (YYMAXDEPTH < yystacksize)
 
1237
        yystacksize = YYMAXDEPTH;
 
1238
 
 
1239
      {
 
1240
        yytype_int16 *yyss1 = yyss;
 
1241
        union yyalloc *yyptr =
 
1242
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
 
1243
        if (! yyptr)
 
1244
          goto yyexhaustedlab;
 
1245
        YYSTACK_RELOCATE (yyss);
 
1246
        YYSTACK_RELOCATE (yyvs);
 
1247
 
 
1248
#  undef YYSTACK_RELOCATE
 
1249
        if (yyss1 != yyssa)
 
1250
          YYSTACK_FREE (yyss1);
 
1251
      }
 
1252
# endif
 
1253
#endif /* no yyoverflow */
 
1254
 
 
1255
      yyssp = yyss + yysize - 1;
 
1256
      yyvsp = yyvs + yysize - 1;
 
1257
 
 
1258
 
 
1259
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
 
1260
                  (unsigned long int) yystacksize));
 
1261
 
 
1262
      if (yyss + yystacksize - 1 <= yyssp)
 
1263
        YYABORT;
 
1264
    }
 
1265
 
 
1266
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 
1267
 
 
1268
  goto yybackup;
 
1269
 
 
1270
/*-----------.
 
1271
| yybackup.  |
 
1272
`-----------*/
 
1273
yybackup:
 
1274
 
 
1275
  /* Do appropriate processing given the current state.  Read a
 
1276
     look-ahead token if we need one and don't already have one.  */
 
1277
 
 
1278
  /* First try to decide what to do without reference to look-ahead token.  */
 
1279
  yyn = yypact[yystate];
 
1280
  if (yyn == YYPACT_NINF)
 
1281
    goto yydefault;
 
1282
 
 
1283
  /* Not known => get a look-ahead token if don't already have one.  */
 
1284
 
 
1285
  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
 
1286
  if (yychar == YYEMPTY)
 
1287
    {
 
1288
      YYDPRINTF ((stderr, "Reading a token: "));
 
1289
      yychar = YYLEX;
 
1290
    }
 
1291
 
 
1292
  if (yychar <= YYEOF)
 
1293
    {
 
1294
      yychar = yytoken = YYEOF;
 
1295
      YYDPRINTF ((stderr, "Now at end of input.\n"));
 
1296
    }
 
1297
  else
 
1298
    {
 
1299
      yytoken = YYTRANSLATE (yychar);
 
1300
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
 
1301
    }
 
1302
 
 
1303
  /* If the proper action on seeing token YYTOKEN is to reduce or to
 
1304
     detect an error, take that action.  */
 
1305
  yyn += yytoken;
 
1306
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
 
1307
    goto yydefault;
 
1308
  yyn = yytable[yyn];
 
1309
  if (yyn <= 0)
 
1310
    {
 
1311
      if (yyn == 0 || yyn == YYTABLE_NINF)
 
1312
        goto yyerrlab;
 
1313
      yyn = -yyn;
 
1314
      goto yyreduce;
 
1315
    }
 
1316
 
 
1317
  if (yyn == YYFINAL)
 
1318
    YYACCEPT;
 
1319
 
 
1320
  /* Count tokens shifted since error; after three, turn off error
 
1321
     status.  */
 
1322
  if (yyerrstatus)
 
1323
    yyerrstatus--;
 
1324
 
 
1325
  /* Shift the look-ahead token.  */
 
1326
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 
1327
 
 
1328
  /* Discard the shifted token unless it is eof.  */
 
1329
  if (yychar != YYEOF)
 
1330
    yychar = YYEMPTY;
 
1331
 
 
1332
  yystate = yyn;
 
1333
  *++yyvsp = yylval;
 
1334
 
 
1335
  goto yynewstate;
 
1336
 
 
1337
 
 
1338
/*-----------------------------------------------------------.
 
1339
| yydefault -- do the default action for the current state.  |
 
1340
`-----------------------------------------------------------*/
 
1341
yydefault:
 
1342
  yyn = yydefact[yystate];
 
1343
  if (yyn == 0)
 
1344
    goto yyerrlab;
 
1345
  goto yyreduce;
 
1346
 
 
1347
 
 
1348
/*-----------------------------.
 
1349
| yyreduce -- Do a reduction.  |
 
1350
`-----------------------------*/
 
1351
yyreduce:
 
1352
  /* yyn is the number of a rule to reduce with.  */
 
1353
  yylen = yyr2[yyn];
 
1354
 
 
1355
  /* If YYLEN is nonzero, implement the default value of the action:
 
1356
     `$$ = $1'.
 
1357
 
 
1358
     Otherwise, the following line sets YYVAL to garbage.
 
1359
     This behavior is undocumented and Bison
 
1360
     users should not rely upon it.  Assigning to YYVAL
 
1361
     unconditionally makes the parser a bit smaller, and it avoids a
 
1362
     GCC warning that YYVAL may be used uninitialized.  */
 
1363
  yyval = yyvsp[1-yylen];
 
1364
 
 
1365
 
 
1366
  YY_REDUCE_PRINT (yyn);
 
1367
  switch (yyn)
 
1368
    {
 
1369
        case 6:
 
1370
#line 84 "resource_parser.y"
 
1371
    {
 
1372
                                        UDWORD len;
 
1373
 
 
1374
                                        // set a new input directory
 
1375
                                        debug(LOG_NEVER, "directory: %s", (yyvsp[(2) - (2)].sval));
 
1376
                                        if (strncmp((yyvsp[(2) - (2)].sval), "/:", strlen("/:")) == 0)
 
1377
                                        {
 
1378
                                                // the new dir is rooted
 
1379
                                                sstrcpy(aCurrResDir, (yyvsp[(2) - (2)].sval));
 
1380
                                        }
 
1381
                                        else
 
1382
                                        {
 
1383
                                                sstrcpy(aCurrResDir, aResDir);
 
1384
                                                sstrcat(aCurrResDir, (yyvsp[(2) - (2)].sval));
 
1385
                                        }
 
1386
                                        if (strlen((yyvsp[(2) - (2)].sval)) > 0)
 
1387
                                        {
 
1388
                                                // Add a trailing '/'
 
1389
                                                len = strlen(aCurrResDir);
 
1390
                                                aCurrResDir[len] = '/';
 
1391
                                                aCurrResDir[len+1] = 0;
 
1392
                                                debug(LOG_NEVER, "Current resource directory: %s", aCurrResDir);
 
1393
                                        }
 
1394
                                        free((yyvsp[(2) - (2)].sval));
 
1395
                                }
 
1396
    break;
 
1397
 
 
1398
  case 7:
 
1399
#line 113 "resource_parser.y"
 
1400
    {
 
1401
                                        bool succes;
 
1402
                                        /* load a data file */
 
1403
                                        debug(LOG_NEVER, "file: %s %s", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval));
 
1404
                                        succes = resLoadFile((yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval));
 
1405
                                        free((yyvsp[(2) - (3)].sval));
 
1406
                                        free((yyvsp[(3) - (3)].sval));
 
1407
 
 
1408
                                        if (!succes)
 
1409
                                        {
 
1410
                                                YYABORT;
 
1411
                                        }
 
1412
                                }
 
1413
    break;
 
1414
 
 
1415
 
 
1416
/* Line 1267 of yacc.c.  */
 
1417
#line 1418 "resource_parser.tab.c"
 
1418
      default: break;
 
1419
    }
 
1420
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
1421
 
 
1422
  YYPOPSTACK (yylen);
 
1423
  yylen = 0;
 
1424
  YY_STACK_PRINT (yyss, yyssp);
 
1425
 
 
1426
  *++yyvsp = yyval;
 
1427
 
 
1428
 
 
1429
  /* Now `shift' the result of the reduction.  Determine what state
 
1430
     that goes to, based on the state we popped back to and the rule
 
1431
     number reduced by.  */
 
1432
 
 
1433
  yyn = yyr1[yyn];
 
1434
 
 
1435
  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
 
1436
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
 
1437
    yystate = yytable[yystate];
 
1438
  else
 
1439
    yystate = yydefgoto[yyn - YYNTOKENS];
 
1440
 
 
1441
  goto yynewstate;
 
1442
 
 
1443
 
 
1444
/*------------------------------------.
 
1445
| yyerrlab -- here on detecting error |
 
1446
`------------------------------------*/
 
1447
yyerrlab:
 
1448
  /* If not already recovering from an error, report this error.  */
 
1449
  if (!yyerrstatus)
 
1450
    {
 
1451
      ++yynerrs;
 
1452
#if ! YYERROR_VERBOSE
 
1453
      yyerror (YY_("syntax error"));
 
1454
#else
 
1455
      {
 
1456
        YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
 
1457
        if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
 
1458
          {
 
1459
            YYSIZE_T yyalloc = 2 * yysize;
 
1460
            if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
 
1461
              yyalloc = YYSTACK_ALLOC_MAXIMUM;
 
1462
            if (yymsg != yymsgbuf)
 
1463
              YYSTACK_FREE (yymsg);
 
1464
            yymsg = (char *) YYSTACK_ALLOC (yyalloc);
 
1465
            if (yymsg)
 
1466
              yymsg_alloc = yyalloc;
 
1467
            else
 
1468
              {
 
1469
                yymsg = yymsgbuf;
 
1470
                yymsg_alloc = sizeof yymsgbuf;
 
1471
              }
 
1472
          }
 
1473
 
 
1474
        if (0 < yysize && yysize <= yymsg_alloc)
 
1475
          {
 
1476
            (void) yysyntax_error (yymsg, yystate, yychar);
 
1477
            yyerror (yymsg);
 
1478
          }
 
1479
        else
 
1480
          {
 
1481
            yyerror (YY_("syntax error"));
 
1482
            if (yysize != 0)
 
1483
              goto yyexhaustedlab;
 
1484
          }
 
1485
      }
 
1486
#endif
 
1487
    }
 
1488
 
 
1489
 
 
1490
 
 
1491
  if (yyerrstatus == 3)
 
1492
    {
 
1493
      /* If just tried and failed to reuse look-ahead token after an
 
1494
         error, discard it.  */
 
1495
 
 
1496
      if (yychar <= YYEOF)
 
1497
        {
 
1498
          /* Return failure if at end of input.  */
 
1499
          if (yychar == YYEOF)
 
1500
            YYABORT;
 
1501
        }
 
1502
      else
 
1503
        {
 
1504
          yydestruct ("Error: discarding",
 
1505
                      yytoken, &yylval);
 
1506
          yychar = YYEMPTY;
 
1507
        }
 
1508
    }
 
1509
 
 
1510
  /* Else will try to reuse look-ahead token after shifting the error
 
1511
     token.  */
 
1512
  goto yyerrlab1;
 
1513
 
 
1514
 
 
1515
/*---------------------------------------------------.
 
1516
| yyerrorlab -- error raised explicitly by YYERROR.  |
 
1517
`---------------------------------------------------*/
 
1518
yyerrorlab:
 
1519
 
 
1520
  /* Pacify compilers like GCC when the user code never invokes
 
1521
     YYERROR and the label yyerrorlab therefore never appears in user
 
1522
     code.  */
 
1523
  if (/*CONSTCOND*/ 0)
 
1524
     goto yyerrorlab;
 
1525
 
 
1526
  /* Do not reclaim the symbols of the rule which action triggered
 
1527
     this YYERROR.  */
 
1528
  YYPOPSTACK (yylen);
 
1529
  yylen = 0;
 
1530
  YY_STACK_PRINT (yyss, yyssp);
 
1531
  yystate = *yyssp;
 
1532
  goto yyerrlab1;
 
1533
 
 
1534
 
 
1535
/*-------------------------------------------------------------.
 
1536
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
 
1537
`-------------------------------------------------------------*/
 
1538
yyerrlab1:
 
1539
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
 
1540
 
 
1541
  for (;;)
 
1542
    {
 
1543
      yyn = yypact[yystate];
 
1544
      if (yyn != YYPACT_NINF)
 
1545
        {
 
1546
          yyn += YYTERROR;
 
1547
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
 
1548
            {
 
1549
              yyn = yytable[yyn];
 
1550
              if (0 < yyn)
 
1551
                break;
 
1552
            }
 
1553
        }
 
1554
 
 
1555
      /* Pop the current state because it cannot handle the error token.  */
 
1556
      if (yyssp == yyss)
 
1557
        YYABORT;
 
1558
 
 
1559
 
 
1560
      yydestruct ("Error: popping",
 
1561
                  yystos[yystate], yyvsp);
 
1562
      YYPOPSTACK (1);
 
1563
      yystate = *yyssp;
 
1564
      YY_STACK_PRINT (yyss, yyssp);
 
1565
    }
 
1566
 
 
1567
  if (yyn == YYFINAL)
 
1568
    YYACCEPT;
 
1569
 
 
1570
  *++yyvsp = yylval;
 
1571
 
 
1572
 
 
1573
  /* Shift the error token.  */
 
1574
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
 
1575
 
 
1576
  yystate = yyn;
 
1577
  goto yynewstate;
 
1578
 
 
1579
 
 
1580
/*-------------------------------------.
 
1581
| yyacceptlab -- YYACCEPT comes here.  |
 
1582
`-------------------------------------*/
 
1583
yyacceptlab:
 
1584
  yyresult = 0;
 
1585
  goto yyreturn;
 
1586
 
 
1587
/*-----------------------------------.
 
1588
| yyabortlab -- YYABORT comes here.  |
 
1589
`-----------------------------------*/
 
1590
yyabortlab:
 
1591
  yyresult = 1;
 
1592
  goto yyreturn;
 
1593
 
 
1594
#ifndef yyoverflow
 
1595
/*-------------------------------------------------.
 
1596
| yyexhaustedlab -- memory exhaustion comes here.  |
 
1597
`-------------------------------------------------*/
 
1598
yyexhaustedlab:
 
1599
  yyerror (YY_("memory exhausted"));
 
1600
  yyresult = 2;
 
1601
  /* Fall through.  */
 
1602
#endif
 
1603
 
 
1604
yyreturn:
 
1605
  if (yychar != YYEOF && yychar != YYEMPTY)
 
1606
     yydestruct ("Cleanup: discarding lookahead",
 
1607
                 yytoken, &yylval);
 
1608
  /* Do not reclaim the symbols of the rule which action triggered
 
1609
     this YYABORT or YYACCEPT.  */
 
1610
  YYPOPSTACK (yylen);
 
1611
  YY_STACK_PRINT (yyss, yyssp);
 
1612
  while (yyssp != yyss)
 
1613
    {
 
1614
      yydestruct ("Cleanup: popping",
 
1615
                  yystos[*yyssp], yyvsp);
 
1616
      YYPOPSTACK (1);
 
1617
    }
 
1618
#ifndef yyoverflow
 
1619
  if (yyss != yyssa)
 
1620
    YYSTACK_FREE (yyss);
 
1621
#endif
 
1622
#if YYERROR_VERBOSE
 
1623
  if (yymsg != yymsgbuf)
 
1624
    YYSTACK_FREE (yymsg);
 
1625
#endif
 
1626
  /* Make sure YYID is used.  */
 
1627
  return YYID (yyresult);
 
1628
}
 
1629
 
 
1630
 
 
1631