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

« back to all changes in this revision

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