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

« back to all changes in this revision

Viewing changes to src/message_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 message_parse
 
63
#define yylex   message_lex
 
64
#define yyerror message_error
 
65
#define yylval  message_lval
 
66
#define yychar  message_char
 
67
#define yydebug message_debug
 
68
#define yynerrs message_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
     NULL_T = 260,
 
80
     VIEW_T_RES = 261,
 
81
     VIEW_T_RPL = 262,
 
82
     VIEW_T_PROX = 263,
 
83
     VIEW_T_RPLX = 264,
 
84
     VIEW_T_BEACON = 265,
 
85
     IMD_NAME_T = 266,
 
86
     IMD_NAME2_T = 267,
 
87
     SEQUENCE_NAME_T = 268,
 
88
     AUDIO_NAME_T = 269
 
89
   };
 
90
#endif
 
91
/* Tokens.  */
 
92
#define TEXT_T 258
 
93
#define QTEXT_T 259
 
94
#define NULL_T 260
 
95
#define VIEW_T_RES 261
 
96
#define VIEW_T_RPL 262
 
97
#define VIEW_T_PROX 263
 
98
#define VIEW_T_RPLX 264
 
99
#define VIEW_T_BEACON 265
 
100
#define IMD_NAME_T 266
 
101
#define IMD_NAME2_T 267
 
102
#define SEQUENCE_NAME_T 268
 
103
#define AUDIO_NAME_T 269
 
104
 
 
105
 
 
106
 
 
107
 
 
108
/* Copy the first part of user declarations.  */
 
109
#line 20 "message_parser.y"
 
110
 
 
111
/** @file
 
112
 *
 
113
 *  Parser for message data
 
114
 */
 
115
 
 
116
#include "lib/framework/frame.h"
 
117
#include "lib/framework/strres.h"
 
118
#include "lib/framework/frameresource.h"
 
119
#include "message.h"
 
120
#include "messagedef.h"
 
121
#include "messagely.h"
 
122
#include "text.h"
 
123
 
 
124
extern void yyerror(const char* msg);
 
125
void yyerror(const char* msg)
 
126
{
 
127
        debug(LOG_ERROR, "SMSG file parse error:\n%s at line %d\nText: '%s'", msg, message_get_lineno(), message_get_text());
 
128
}
 
129
 
 
130
typedef struct TEXT_MESSAGE
 
131
{
 
132
        char * str;
 
133
        struct TEXT_MESSAGE* psNext;
 
134
} TEXT_MESSAGE;
 
135
 
 
136
static void freeTextMessageList(TEXT_MESSAGE* list)
 
137
{
 
138
        while (list)
 
139
        {
 
140
                TEXT_MESSAGE* const toDelete = list;
 
141
                list = list->psNext;
 
142
                free(toDelete->str);
 
143
                free(toDelete);
 
144
        }
 
145
}
 
146
 
 
147
typedef struct VIEWDATAMESSAGE
 
148
{
 
149
        VIEWDATA view;
 
150
        struct VIEWDATAMESSAGE* psNext;
 
151
} VIEWDATAMESSAGE;
 
152
 
 
153
static void freeViewDataMessageList(VIEWDATAMESSAGE* list)
 
154
{
 
155
        while (list)
 
156
        {
 
157
                VIEWDATAMESSAGE* const toDelete = list;
 
158
                list = list->psNext;
 
159
                free(toDelete->view.pName);
 
160
                free(toDelete->view.ppTextMsg);
 
161
                switch (toDelete->view.type)
 
162
                {
 
163
                        case VIEW_RES:
 
164
                        {
 
165
                                VIEW_RESEARCH* const psViewRes = toDelete->view.pData;
 
166
                                if (psViewRes->pAudio)
 
167
                                        free(psViewRes->pAudio);
 
168
                                free(psViewRes);
 
169
                                break;
 
170
                        }
 
171
                        default:
 
172
                                ASSERT(!"Unhandled view data type", "Unhandled view data type %u", toDelete->view.type);
 
173
                }
 
174
                free(toDelete);
 
175
        }
 
176
}
 
177
 
 
178
#define YYPARSE_PARAM ppsViewData
 
179
 
 
180
 
 
181
 
 
182
/* Enabling traces.  */
 
183
#ifndef YYDEBUG
 
184
# define YYDEBUG 0
 
185
#endif
 
186
 
 
187
/* Enabling verbose error messages.  */
 
188
#ifdef YYERROR_VERBOSE
 
189
# undef YYERROR_VERBOSE
 
190
# define YYERROR_VERBOSE 1
 
191
#else
 
192
# define YYERROR_VERBOSE 0
 
193
#endif
 
194
 
 
195
/* Enabling the token table.  */
 
196
#ifndef YYTOKEN_TABLE
 
197
# define YYTOKEN_TABLE 0
 
198
#endif
 
199
 
 
200
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 
201
typedef union YYSTYPE
 
202
#line 94 "message_parser.y"
 
203
{
 
204
        char*                   sval;
 
205
        struct VIEWDATAMESSAGE* viewdatamsg;
 
206
        struct TEXT_MESSAGE*    txtmsg;
 
207
        VIEW_TYPE               viewtype;
 
208
        VIEW_RESEARCH*          researchdata;
 
209
        struct
 
210
        {
 
211
                const char**    stringArray;
 
212
                unsigned int    count;
 
213
        }                       msg_list;
 
214
}
 
215
/* Line 187 of yacc.c.  */
 
216
#line 217 "message_parser.tab.c"
 
217
        YYSTYPE;
 
218
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 
219
# define YYSTYPE_IS_DECLARED 1
 
220
# define YYSTYPE_IS_TRIVIAL 1
 
221
#endif
 
222
 
 
223
 
 
224
 
 
225
/* Copy the second part of user declarations.  */
 
226
 
 
227
 
 
228
/* Line 216 of yacc.c.  */
 
229
#line 230 "message_parser.tab.c"
 
230
 
 
231
#ifdef short
 
232
# undef short
 
233
#endif
 
234
 
 
235
#ifdef YYTYPE_UINT8
 
236
typedef YYTYPE_UINT8 yytype_uint8;
 
237
#else
 
238
typedef unsigned char yytype_uint8;
 
239
#endif
 
240
 
 
241
#ifdef YYTYPE_INT8
 
242
typedef YYTYPE_INT8 yytype_int8;
 
243
#elif (defined __STDC__ || defined __C99__FUNC__ \
 
244
     || defined __cplusplus || defined _MSC_VER)
 
245
typedef signed char yytype_int8;
 
246
#else
 
247
typedef short int yytype_int8;
 
248
#endif
 
249
 
 
250
#ifdef YYTYPE_UINT16
 
251
typedef YYTYPE_UINT16 yytype_uint16;
 
252
#else
 
253
typedef unsigned short int yytype_uint16;
 
254
#endif
 
255
 
 
256
#ifdef YYTYPE_INT16
 
257
typedef YYTYPE_INT16 yytype_int16;
 
258
#else
 
259
typedef short int yytype_int16;
 
260
#endif
 
261
 
 
262
#ifndef YYSIZE_T
 
263
# ifdef __SIZE_TYPE__
 
264
#  define YYSIZE_T __SIZE_TYPE__
 
265
# elif defined size_t
 
266
#  define YYSIZE_T size_t
 
267
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
 
268
     || defined __cplusplus || defined _MSC_VER)
 
269
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 
270
#  define YYSIZE_T size_t
 
271
# else
 
272
#  define YYSIZE_T unsigned int
 
273
# endif
 
274
#endif
 
275
 
 
276
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 
277
 
 
278
#ifndef YY_
 
279
# if YYENABLE_NLS
 
280
#  if ENABLE_NLS
 
281
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 
282
#   define YY_(msgid) dgettext ("bison-runtime", msgid)
 
283
#  endif
 
284
# endif
 
285
# ifndef YY_
 
286
#  define YY_(msgid) msgid
 
287
# endif
 
288
#endif
 
289
 
 
290
/* Suppress unused-variable warnings by "using" E.  */
 
291
#if ! defined lint || defined __GNUC__
 
292
# define YYUSE(e) ((void) (e))
 
293
#else
 
294
# define YYUSE(e) /* empty */
 
295
#endif
 
296
 
 
297
/* Identity function, used to suppress warnings about constant conditions.  */
 
298
#ifndef lint
 
299
# define YYID(n) (n)
 
300
#else
 
301
#if (defined __STDC__ || defined __C99__FUNC__ \
 
302
     || defined __cplusplus || defined _MSC_VER)
 
303
static int
 
304
YYID (int i)
 
305
#else
 
306
static int
 
307
YYID (i)
 
308
    int i;
 
309
#endif
 
310
{
 
311
  return i;
 
312
}
 
313
#endif
 
314
 
 
315
#if ! defined yyoverflow || YYERROR_VERBOSE
 
316
 
 
317
/* The parser invokes alloca or malloc; define the necessary symbols.  */
 
318
 
 
319
# ifdef YYSTACK_USE_ALLOCA
 
320
#  if YYSTACK_USE_ALLOCA
 
321
#   ifdef __GNUC__
 
322
#    define YYSTACK_ALLOC __builtin_alloca
 
323
#   elif defined __BUILTIN_VA_ARG_INCR
 
324
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
 
325
#   elif defined _AIX
 
326
#    define YYSTACK_ALLOC __alloca
 
327
#   elif defined _MSC_VER
 
328
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
 
329
#    define alloca _alloca
 
330
#   else
 
331
#    define YYSTACK_ALLOC alloca
 
332
#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 
333
     || defined __cplusplus || defined _MSC_VER)
 
334
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 
335
#     ifndef _STDLIB_H
 
336
#      define _STDLIB_H 1
 
337
#     endif
 
338
#    endif
 
339
#   endif
 
340
#  endif
 
341
# endif
 
342
 
 
343
# ifdef YYSTACK_ALLOC
 
344
   /* Pacify GCC's `empty if-body' warning.  */
 
345
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
 
346
#  ifndef YYSTACK_ALLOC_MAXIMUM
 
347
    /* The OS might guarantee only one guard page at the bottom of the stack,
 
348
       and a page size can be as small as 4096 bytes.  So we cannot safely
 
349
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
 
350
       to allow for a few compiler-allocated temporary stack slots.  */
 
351
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
 
352
#  endif
 
353
# else
 
354
#  define YYSTACK_ALLOC YYMALLOC
 
355
#  define YYSTACK_FREE YYFREE
 
356
#  ifndef YYSTACK_ALLOC_MAXIMUM
 
357
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 
358
#  endif
 
359
#  if (defined __cplusplus && ! defined _STDLIB_H \
 
360
       && ! ((defined YYMALLOC || defined malloc) \
 
361
             && (defined YYFREE || defined free)))
 
362
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 
363
#   ifndef _STDLIB_H
 
364
#    define _STDLIB_H 1
 
365
#   endif
 
366
#  endif
 
367
#  ifndef YYMALLOC
 
368
#   define YYMALLOC malloc
 
369
#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 
370
     || defined __cplusplus || defined _MSC_VER)
 
371
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 
372
#   endif
 
373
#  endif
 
374
#  ifndef YYFREE
 
375
#   define YYFREE free
 
376
#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 
377
     || defined __cplusplus || defined _MSC_VER)
 
378
void free (void *); /* INFRINGES ON USER NAME SPACE */
 
379
#   endif
 
380
#  endif
 
381
# endif
 
382
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
 
383
 
 
384
 
 
385
#if (! defined yyoverflow \
 
386
     && (! defined __cplusplus \
 
387
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
388
 
 
389
/* A type that is properly aligned for any stack member.  */
 
390
union yyalloc
 
391
{
 
392
  yytype_int16 yyss;
 
393
  YYSTYPE yyvs;
 
394
  };
 
395
 
 
396
/* The size of the maximum gap between one aligned stack and the next.  */
 
397
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
 
398
 
 
399
/* The size of an array large to enough to hold all stacks, each with
 
400
   N elements.  */
 
401
# define YYSTACK_BYTES(N) \
 
402
     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
 
403
      + YYSTACK_GAP_MAXIMUM)
 
404
 
 
405
/* Copy COUNT objects from FROM to TO.  The source and destination do
 
406
   not overlap.  */
 
407
# ifndef YYCOPY
 
408
#  if defined __GNUC__ && 1 < __GNUC__
 
409
#   define YYCOPY(To, From, Count) \
 
410
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 
411
#  else
 
412
#   define YYCOPY(To, From, Count)              \
 
413
      do                                        \
 
414
        {                                       \
 
415
          YYSIZE_T yyi;                         \
 
416
          for (yyi = 0; yyi < (Count); yyi++)   \
 
417
            (To)[yyi] = (From)[yyi];            \
 
418
        }                                       \
 
419
      while (YYID (0))
 
420
#  endif
 
421
# endif
 
422
 
 
423
/* Relocate STACK from its old location to the new one.  The
 
424
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
 
425
   elements in the stack, and YYPTR gives the new location of the
 
426
   stack.  Advance YYPTR to a properly aligned location for the next
 
427
   stack.  */
 
428
# define YYSTACK_RELOCATE(Stack)                                        \
 
429
    do                                                                  \
 
430
      {                                                                 \
 
431
        YYSIZE_T yynewbytes;                                            \
 
432
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
 
433
        Stack = &yyptr->Stack;                                          \
 
434
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 
435
        yyptr += yynewbytes / sizeof (*yyptr);                          \
 
436
      }                                                                 \
 
437
    while (YYID (0))
 
438
 
 
439
#endif
 
440
 
 
441
/* YYFINAL -- State number of the termination state.  */
 
442
#define YYFINAL  6
 
443
/* YYLAST -- Last index in YYTABLE.  */
 
444
#define YYLAST   45
 
445
 
 
446
/* YYNTOKENS -- Number of terminals.  */
 
447
#define YYNTOKENS  23
 
448
/* YYNNTS -- Number of nonterminals.  */
 
449
#define YYNNTS  13
 
450
/* YYNRULES -- Number of rules.  */
 
451
#define YYNRULES  23
 
452
/* YYNRULES -- Number of states.  */
 
453
#define YYNSTATES  51
 
454
 
 
455
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 
456
#define YYUNDEFTOK  2
 
457
#define YYMAXUTOK   269
 
458
 
 
459
#define YYTRANSLATE(YYX)                                                \
 
460
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
461
 
 
462
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
 
463
static const yytype_uint8 yytranslate[] =
 
464
{
 
465
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
466
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
467
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
468
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
469
      21,    22,     2,     2,    16,     2,     2,     2,     2,     2,
 
470
       2,     2,     2,     2,     2,     2,     2,     2,     2,    18,
 
471
       2,    19,     2,     2,     2,     2,     2,     2,     2,     2,
 
472
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
473
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
474
       2,     2,     2,     2,     2,    20,     2,     2,     2,     2,
 
475
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
476
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
477
       2,     2,     2,    15,     2,    17,     2,     2,     2,     2,
 
478
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
479
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
480
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
481
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
482
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
483
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
484
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
485
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
486
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
487
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
488
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
489
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
490
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
 
491
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14
 
492
};
 
493
 
 
494
#if YYDEBUG
 
495
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
 
496
   YYRHS.  */
 
497
static const yytype_uint8 yyprhs[] =
 
498
{
 
499
       0,     0,     3,     5,     7,    10,    18,    27,    31,    33,
 
500
      37,    39,    43,    45,    49,    51,    53,    55,    59,    61,
 
501
      64,    68,    70,    72
 
502
};
 
503
 
 
504
/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 
505
static const yytype_int8 yyrhs[] =
 
506
{
 
507
      24,     0,    -1,    25,    -1,    26,    -1,    26,    25,    -1,
 
508
       3,    15,    33,    16,    27,    17,    18,    -1,    28,    16,
 
509
      29,    16,    30,    16,    31,    16,    -1,    11,    19,     4,
 
510
      -1,     4,    -1,    12,    19,    32,    -1,    32,    -1,    13,
 
511
      19,     4,    -1,     4,    -1,    14,    19,    32,    -1,    32,
 
512
      -1,     4,    -1,     5,    -1,    15,    34,    17,    -1,    35,
 
513
      -1,    35,    16,    -1,    35,    16,    34,    -1,     3,    -1,
 
514
       4,    -1,    20,    21,     4,    22,    -1
 
515
};
 
516
 
 
517
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 
518
static const yytype_uint16 yyrline[] =
 
519
{
 
520
       0,   153,   153,   195,   196,   203,   227,   274,   275,   278,
 
521
     279,   282,   283,   286,   287,   290,   291,   294,   347,   349,
 
522
     350,   357,   379,   393
 
523
};
 
524
#endif
 
525
 
 
526
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 
527
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
 
528
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 
529
static const char *const yytname[] =
 
530
{
 
531
  "$end", "error", "$undefined", "TEXT_T", "QTEXT_T", "NULL_T",
 
532
  "VIEW_T_RES", "VIEW_T_RPL", "VIEW_T_PROX", "VIEW_T_RPLX",
 
533
  "VIEW_T_BEACON", "IMD_NAME_T", "IMD_NAME2_T", "SEQUENCE_NAME_T",
 
534
  "AUDIO_NAME_T", "'{'", "','", "'}'", "';'", "'='", "'_'", "'('", "')'",
 
535
  "$accept", "file", "all_messages", "message", "research_message",
 
536
  "imd_name", "imd_name2", "sequence_name", "audio_name",
 
537
  "optional_string", "message_list", "text_messages", "text_message", 0
 
538
};
 
539
#endif
 
540
 
 
541
# ifdef YYPRINT
 
542
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
 
543
   token YYLEX-NUM.  */
 
544
static const yytype_uint16 yytoknum[] =
 
545
{
 
546
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
 
547
     265,   266,   267,   268,   269,   123,    44,   125,    59,    61,
 
548
      95,    40,    41
 
549
};
 
550
# endif
 
551
 
 
552
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 
553
static const yytype_uint8 yyr1[] =
 
554
{
 
555
       0,    23,    24,    25,    25,    26,    27,    28,    28,    29,
 
556
      29,    30,    30,    31,    31,    32,    32,    33,    34,    34,
 
557
      34,    35,    35,    35
 
558
};
 
559
 
 
560
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 
561
static const yytype_uint8 yyr2[] =
 
562
{
 
563
       0,     2,     1,     1,     2,     7,     8,     3,     1,     3,
 
564
       1,     3,     1,     3,     1,     1,     1,     3,     1,     2,
 
565
       3,     1,     1,     4
 
566
};
 
567
 
 
568
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
 
569
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
 
570
   means the default is an error.  */
 
571
static const yytype_uint8 yydefact[] =
 
572
{
 
573
       0,     0,     0,     2,     3,     0,     1,     4,     0,     0,
 
574
      21,    22,     0,     0,    18,     0,     0,    17,    19,     8,
 
575
       0,     0,     0,     0,    20,     0,     0,     0,    23,     7,
 
576
       5,    15,    16,     0,     0,    10,     0,     0,     9,    12,
 
577
       0,     0,     0,     0,    11,     0,     0,    14,     0,     6,
 
578
      13
 
579
};
 
580
 
 
581
/* YYDEFGOTO[NTERM-NUM].  */
 
582
static const yytype_int8 yydefgoto[] =
 
583
{
 
584
      -1,     2,     3,     4,    21,    22,    34,    41,    46,    35,
 
585
       9,    13,    14
 
586
};
 
587
 
 
588
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
 
589
   STATE-NUM.  */
 
590
#define YYPACT_NINF -35
 
591
static const yytype_int8 yypact[] =
 
592
{
 
593
      13,     4,    20,   -35,    13,     7,   -35,   -35,    -3,     5,
 
594
     -35,   -35,     8,     9,    11,     1,    19,   -35,    -3,   -35,
 
595
      12,    15,    14,    16,   -35,    21,    10,     6,   -35,   -35,
 
596
     -35,   -35,   -35,    17,    18,   -35,     3,     2,   -35,   -35,
 
597
      22,    23,    29,    -1,   -35,    24,    26,   -35,     3,   -35,
 
598
     -35
 
599
};
 
600
 
 
601
/* YYPGOTO[NTERM-NUM].  */
 
602
static const yytype_int8 yypgoto[] =
 
603
{
 
604
     -35,   -35,    31,   -35,   -35,   -35,   -35,   -35,   -35,   -34,
 
605
     -35,    27,   -35
 
606
};
 
607
 
 
608
/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
 
609
   positive, shift that token.  If negative, reduce the rule which
 
610
   number is the opposite.  If zero, do what YYDEFACT says.
 
611
   If YYTABLE_NINF, syntax error.  */
 
612
#define YYTABLE_NINF -1
 
613
static const yytype_uint8 yytable[] =
 
614
{
 
615
      10,    11,    38,    31,    32,    19,    39,    31,    32,    47,
 
616
      31,    32,    20,    45,    50,    40,     1,    12,    33,     5,
 
617
       6,    15,     8,    23,     0,    29,    17,    18,    30,    16,
 
618
      27,    25,    26,    44,    37,     7,    36,     0,    28,    43,
 
619
       0,    42,    49,    48,     0,    24
 
620
};
 
621
 
 
622
static const yytype_int8 yycheck[] =
 
623
{
 
624
       3,     4,    36,     4,     5,     4,     4,     4,     5,    43,
 
625
       4,     5,    11,    14,    48,    13,     3,    20,    12,    15,
 
626
       0,    16,    15,     4,    -1,     4,    17,    16,    18,    21,
 
627
      16,    19,    17,     4,    16,     4,    19,    -1,    22,    16,
 
628
      -1,    19,    16,    19,    -1,    18
 
629
};
 
630
 
 
631
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
 
632
   symbol of state STATE-NUM.  */
 
633
static const yytype_uint8 yystos[] =
 
634
{
 
635
       0,     3,    24,    25,    26,    15,     0,    25,    15,    33,
 
636
       3,     4,    20,    34,    35,    16,    21,    17,    16,     4,
 
637
      11,    27,    28,     4,    34,    19,    17,    16,    22,     4,
 
638
      18,     4,     5,    12,    29,    32,    19,    16,    32,     4,
 
639
      13,    30,    19,    16,     4,    14,    31,    32,    19,    16,
 
640
      32
 
641
};
 
642
 
 
643
#define yyerrok         (yyerrstatus = 0)
 
644
#define yyclearin       (yychar = YYEMPTY)
 
645
#define YYEMPTY         (-2)
 
646
#define YYEOF           0
 
647
 
 
648
#define YYACCEPT        goto yyacceptlab
 
649
#define YYABORT         goto yyabortlab
 
650
#define YYERROR         goto yyerrorlab
 
651
 
 
652
 
 
653
/* Like YYERROR except do call yyerror.  This remains here temporarily
 
654
   to ease the transition to the new meaning of YYERROR, for GCC.
 
655
   Once GCC version 2 has supplanted version 1, this can go.  */
 
656
 
 
657
#define YYFAIL          goto yyerrlab
 
658
 
 
659
#define YYRECOVERING()  (!!yyerrstatus)
 
660
 
 
661
#define YYBACKUP(Token, Value)                                  \
 
662
do                                                              \
 
663
  if (yychar == YYEMPTY && yylen == 1)                          \
 
664
    {                                                           \
 
665
      yychar = (Token);                                         \
 
666
      yylval = (Value);                                         \
 
667
      yytoken = YYTRANSLATE (yychar);                           \
 
668
      YYPOPSTACK (1);                                           \
 
669
      goto yybackup;                                            \
 
670
    }                                                           \
 
671
  else                                                          \
 
672
    {                                                           \
 
673
      yyerror (YY_("syntax error: cannot back up")); \
 
674
      YYERROR;                                                  \
 
675
    }                                                           \
 
676
while (YYID (0))
 
677
 
 
678
 
 
679
#define YYTERROR        1
 
680
#define YYERRCODE       256
 
681
 
 
682
 
 
683
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
 
684
   If N is 0, then set CURRENT to the empty location which ends
 
685
   the previous symbol: RHS[0] (always defined).  */
 
686
 
 
687
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
 
688
#ifndef YYLLOC_DEFAULT
 
689
# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
 
690
    do                                                                  \
 
691
      if (YYID (N))                                                    \
 
692
        {                                                               \
 
693
          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
 
694
          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
 
695
          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
 
696
          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
 
697
        }                                                               \
 
698
      else                                                              \
 
699
        {                                                               \
 
700
          (Current).first_line   = (Current).last_line   =              \
 
701
            YYRHSLOC (Rhs, 0).last_line;                                \
 
702
          (Current).first_column = (Current).last_column =              \
 
703
            YYRHSLOC (Rhs, 0).last_column;                              \
 
704
        }                                                               \
 
705
    while (YYID (0))
 
706
#endif
 
707
 
 
708
 
 
709
/* YY_LOCATION_PRINT -- Print the location on the stream.
 
710
   This macro was not mandated originally: define only if we know
 
711
   we won't break user code: when these are the locations we know.  */
 
712
 
 
713
#ifndef YY_LOCATION_PRINT
 
714
# if YYLTYPE_IS_TRIVIAL
 
715
#  define YY_LOCATION_PRINT(File, Loc)                  \
 
716
     fprintf (File, "%d.%d-%d.%d",                      \
 
717
              (Loc).first_line, (Loc).first_column,     \
 
718
              (Loc).last_line,  (Loc).last_column)
 
719
# else
 
720
#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 
721
# endif
 
722
#endif
 
723
 
 
724
 
 
725
/* YYLEX -- calling `yylex' with the right arguments.  */
 
726
 
 
727
#ifdef YYLEX_PARAM
 
728
# define YYLEX yylex (YYLEX_PARAM)
 
729
#else
 
730
# define YYLEX yylex ()
 
731
#endif
 
732
 
 
733
/* Enable debugging if requested.  */
 
734
#if YYDEBUG
 
735
 
 
736
# ifndef YYFPRINTF
 
737
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
 
738
#  define YYFPRINTF fprintf
 
739
# endif
 
740
 
 
741
# define YYDPRINTF(Args)                        \
 
742
do {                                            \
 
743
  if (yydebug)                                  \
 
744
    YYFPRINTF Args;                             \
 
745
} while (YYID (0))
 
746
 
 
747
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
 
748
do {                                                                      \
 
749
  if (yydebug)                                                            \
 
750
    {                                                                     \
 
751
      YYFPRINTF (stderr, "%s ", Title);                                   \
 
752
      yy_symbol_print (stderr,                                            \
 
753
                  Type, Value); \
 
754
      YYFPRINTF (stderr, "\n");                                           \
 
755
    }                                                                     \
 
756
} while (YYID (0))
 
757
 
 
758
 
 
759
/*--------------------------------.
 
760
| Print this symbol on YYOUTPUT.  |
 
761
`--------------------------------*/
 
762
 
 
763
/*ARGSUSED*/
 
764
#if (defined __STDC__ || defined __C99__FUNC__ \
 
765
     || defined __cplusplus || defined _MSC_VER)
 
766
static void
 
767
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 
768
#else
 
769
static void
 
770
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
 
771
    FILE *yyoutput;
 
772
    int yytype;
 
773
    YYSTYPE const * const yyvaluep;
 
774
#endif
 
775
{
 
776
  if (!yyvaluep)
 
777
    return;
 
778
# ifdef YYPRINT
 
779
  if (yytype < YYNTOKENS)
 
780
    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
 
781
# else
 
782
  YYUSE (yyoutput);
 
783
# endif
 
784
  switch (yytype)
 
785
    {
 
786
      default:
 
787
        break;
 
788
    }
 
789
}
 
790
 
 
791
 
 
792
/*--------------------------------.
 
793
| Print this symbol on YYOUTPUT.  |
 
794
`--------------------------------*/
 
795
 
 
796
#if (defined __STDC__ || defined __C99__FUNC__ \
 
797
     || defined __cplusplus || defined _MSC_VER)
 
798
static void
 
799
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 
800
#else
 
801
static void
 
802
yy_symbol_print (yyoutput, yytype, yyvaluep)
 
803
    FILE *yyoutput;
 
804
    int yytype;
 
805
    YYSTYPE const * const yyvaluep;
 
806
#endif
 
807
{
 
808
  if (yytype < YYNTOKENS)
 
809
    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
 
810
  else
 
811
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
 
812
 
 
813
  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
 
814
  YYFPRINTF (yyoutput, ")");
 
815
}
 
816
 
 
817
/*------------------------------------------------------------------.
 
818
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
 
819
| TOP (included).                                                   |
 
820
`------------------------------------------------------------------*/
 
821
 
 
822
#if (defined __STDC__ || defined __C99__FUNC__ \
 
823
     || defined __cplusplus || defined _MSC_VER)
 
824
static void
 
825
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
 
826
#else
 
827
static void
 
828
yy_stack_print (bottom, top)
 
829
    yytype_int16 *bottom;
 
830
    yytype_int16 *top;
 
831
#endif
 
832
{
 
833
  YYFPRINTF (stderr, "Stack now");
 
834
  for (; bottom <= top; ++bottom)
 
835
    YYFPRINTF (stderr, " %d", *bottom);
 
836
  YYFPRINTF (stderr, "\n");
 
837
}
 
838
 
 
839
# define YY_STACK_PRINT(Bottom, Top)                            \
 
840
do {                                                            \
 
841
  if (yydebug)                                                  \
 
842
    yy_stack_print ((Bottom), (Top));                           \
 
843
} while (YYID (0))
 
844
 
 
845
 
 
846
/*------------------------------------------------.
 
847
| Report that the YYRULE is going to be reduced.  |
 
848
`------------------------------------------------*/
 
849
 
 
850
#if (defined __STDC__ || defined __C99__FUNC__ \
 
851
     || defined __cplusplus || defined _MSC_VER)
 
852
static void
 
853
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
 
854
#else
 
855
static void
 
856
yy_reduce_print (yyvsp, yyrule)
 
857
    YYSTYPE *yyvsp;
 
858
    int yyrule;
 
859
#endif
 
860
{
 
861
  int yynrhs = yyr2[yyrule];
 
862
  int yyi;
 
863
  unsigned long int yylno = yyrline[yyrule];
 
864
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
 
865
             yyrule - 1, yylno);
 
866
  /* The symbols being reduced.  */
 
867
  for (yyi = 0; yyi < yynrhs; yyi++)
 
868
    {
 
869
      fprintf (stderr, "   $%d = ", yyi + 1);
 
870
      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
 
871
                       &(yyvsp[(yyi + 1) - (yynrhs)])
 
872
                                       );
 
873
      fprintf (stderr, "\n");
 
874
    }
 
875
}
 
876
 
 
877
# define YY_REDUCE_PRINT(Rule)          \
 
878
do {                                    \
 
879
  if (yydebug)                          \
 
880
    yy_reduce_print (yyvsp, Rule); \
 
881
} while (YYID (0))
 
882
 
 
883
/* Nonzero means print parse trace.  It is left uninitialized so that
 
884
   multiple parsers can coexist.  */
 
885
int yydebug;
 
886
#else /* !YYDEBUG */
 
887
# define YYDPRINTF(Args)
 
888
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 
889
# define YY_STACK_PRINT(Bottom, Top)
 
890
# define YY_REDUCE_PRINT(Rule)
 
891
#endif /* !YYDEBUG */
 
892
 
 
893
 
 
894
/* YYINITDEPTH -- initial size of the parser's stacks.  */
 
895
#ifndef YYINITDEPTH
 
896
# define YYINITDEPTH 200
 
897
#endif
 
898
 
 
899
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
 
900
   if the built-in stack extension method is used).
 
901
 
 
902
   Do not make this value too large; the results are undefined if
 
903
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
 
904
   evaluated with infinite-precision integer arithmetic.  */
 
905
 
 
906
#ifndef YYMAXDEPTH
 
907
# define YYMAXDEPTH 10000
 
908
#endif
 
909
 
 
910
 
 
911
 
 
912
#if YYERROR_VERBOSE
 
913
 
 
914
# ifndef yystrlen
 
915
#  if defined __GLIBC__ && defined _STRING_H
 
916
#   define yystrlen strlen
 
917
#  else
 
918
/* Return the length of YYSTR.  */
 
919
#if (defined __STDC__ || defined __C99__FUNC__ \
 
920
     || defined __cplusplus || defined _MSC_VER)
 
921
static YYSIZE_T
 
922
yystrlen (const char *yystr)
 
923
#else
 
924
static YYSIZE_T
 
925
yystrlen (yystr)
 
926
    const char *yystr;
 
927
#endif
 
928
{
 
929
  YYSIZE_T yylen;
 
930
  for (yylen = 0; yystr[yylen]; yylen++)
 
931
    continue;
 
932
  return yylen;
 
933
}
 
934
#  endif
 
935
# endif
 
936
 
 
937
# ifndef yystpcpy
 
938
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
 
939
#   define yystpcpy stpcpy
 
940
#  else
 
941
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
 
942
   YYDEST.  */
 
943
#if (defined __STDC__ || defined __C99__FUNC__ \
 
944
     || defined __cplusplus || defined _MSC_VER)
 
945
static char *
 
946
yystpcpy (char *yydest, const char *yysrc)
 
947
#else
 
948
static char *
 
949
yystpcpy (yydest, yysrc)
 
950
    char *yydest;
 
951
    const char *yysrc;
 
952
#endif
 
953
{
 
954
  char *yyd = yydest;
 
955
  const char *yys = yysrc;
 
956
 
 
957
  while ((*yyd++ = *yys++) != '\0')
 
958
    continue;
 
959
 
 
960
  return yyd - 1;
 
961
}
 
962
#  endif
 
963
# endif
 
964
 
 
965
# ifndef yytnamerr
 
966
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
 
967
   quotes and backslashes, so that it's suitable for yyerror.  The
 
968
   heuristic is that double-quoting is unnecessary unless the string
 
969
   contains an apostrophe, a comma, or backslash (other than
 
970
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
 
971
   null, do not copy; instead, return the length of what the result
 
972
   would have been.  */
 
973
static YYSIZE_T
 
974
yytnamerr (char *yyres, const char *yystr)
 
975
{
 
976
  if (*yystr == '"')
 
977
    {
 
978
      YYSIZE_T yyn = 0;
 
979
      char const *yyp = yystr;
 
980
 
 
981
      for (;;)
 
982
        switch (*++yyp)
 
983
          {
 
984
          case '\'':
 
985
          case ',':
 
986
            goto do_not_strip_quotes;
 
987
 
 
988
          case '\\':
 
989
            if (*++yyp != '\\')
 
990
              goto do_not_strip_quotes;
 
991
            /* Fall through.  */
 
992
          default:
 
993
            if (yyres)
 
994
              yyres[yyn] = *yyp;
 
995
            yyn++;
 
996
            break;
 
997
 
 
998
          case '"':
 
999
            if (yyres)
 
1000
              yyres[yyn] = '\0';
 
1001
            return yyn;
 
1002
          }
 
1003
    do_not_strip_quotes: ;
 
1004
    }
 
1005
 
 
1006
  if (! yyres)
 
1007
    return yystrlen (yystr);
 
1008
 
 
1009
  return yystpcpy (yyres, yystr) - yyres;
 
1010
}
 
1011
# endif
 
1012
 
 
1013
/* Copy into YYRESULT an error message about the unexpected token
 
1014
   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
 
1015
   including the terminating null byte.  If YYRESULT is null, do not
 
1016
   copy anything; just return the number of bytes that would be
 
1017
   copied.  As a special case, return 0 if an ordinary "syntax error"
 
1018
   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
 
1019
   size calculation.  */
 
1020
static YYSIZE_T
 
1021
yysyntax_error (char *yyresult, int yystate, int yychar)
 
1022
{
 
1023
  int yyn = yypact[yystate];
 
1024
 
 
1025
  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
 
1026
    return 0;
 
1027
  else
 
1028
    {
 
1029
      int yytype = YYTRANSLATE (yychar);
 
1030
      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
 
1031
      YYSIZE_T yysize = yysize0;
 
1032
      YYSIZE_T yysize1;
 
1033
      int yysize_overflow = 0;
 
1034
      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
 
1035
      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
 
1036
      int yyx;
 
1037
 
 
1038
# if 0
 
1039
      /* This is so xgettext sees the translatable formats that are
 
1040
         constructed on the fly.  */
 
1041
      YY_("syntax error, unexpected %s");
 
1042
      YY_("syntax error, unexpected %s, expecting %s");
 
1043
      YY_("syntax error, unexpected %s, expecting %s or %s");
 
1044
      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
 
1045
      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
 
1046
# endif
 
1047
      char *yyfmt;
 
1048
      char const *yyf;
 
1049
      static char const yyunexpected[] = "syntax error, unexpected %s";
 
1050
      static char const yyexpecting[] = ", expecting %s";
 
1051
      static char const yyor[] = " or %s";
 
1052
      char yyformat[sizeof yyunexpected
 
1053
                    + sizeof yyexpecting - 1
 
1054
                    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
 
1055
                       * (sizeof yyor - 1))];
 
1056
      char const *yyprefix = yyexpecting;
 
1057
 
 
1058
      /* Start YYX at -YYN if negative to avoid negative indexes in
 
1059
         YYCHECK.  */
 
1060
      int yyxbegin = yyn < 0 ? -yyn : 0;
 
1061
 
 
1062
      /* Stay within bounds of both yycheck and yytname.  */
 
1063
      int yychecklim = YYLAST - yyn + 1;
 
1064
      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
 
1065
      int yycount = 1;
 
1066
 
 
1067
      yyarg[0] = yytname[yytype];
 
1068
      yyfmt = yystpcpy (yyformat, yyunexpected);
 
1069
 
 
1070
      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
 
1071
        if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
 
1072
          {
 
1073
            if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
 
1074
              {
 
1075
                yycount = 1;
 
1076
                yysize = yysize0;
 
1077
                yyformat[sizeof yyunexpected - 1] = '\0';
 
1078
                break;
 
1079
              }
 
1080
            yyarg[yycount++] = yytname[yyx];
 
1081
            yysize1 = yysize + yytnamerr (0, yytname[yyx]);
 
1082
            yysize_overflow |= (yysize1 < yysize);
 
1083
            yysize = yysize1;
 
1084
            yyfmt = yystpcpy (yyfmt, yyprefix);
 
1085
            yyprefix = yyor;
 
1086
          }
 
1087
 
 
1088
      yyf = YY_(yyformat);
 
1089
      yysize1 = yysize + yystrlen (yyf);
 
1090
      yysize_overflow |= (yysize1 < yysize);
 
1091
      yysize = yysize1;
 
1092
 
 
1093
      if (yysize_overflow)
 
1094
        return YYSIZE_MAXIMUM;
 
1095
 
 
1096
      if (yyresult)
 
1097
        {
 
1098
          /* Avoid sprintf, as that infringes on the user's name space.
 
1099
             Don't have undefined behavior even if the translation
 
1100
             produced a string with the wrong number of "%s"s.  */
 
1101
          char *yyp = yyresult;
 
1102
          int yyi = 0;
 
1103
          while ((*yyp = *yyf) != '\0')
 
1104
            {
 
1105
              if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
 
1106
                {
 
1107
                  yyp += yytnamerr (yyp, yyarg[yyi++]);
 
1108
                  yyf += 2;
 
1109
                }
 
1110
              else
 
1111
                {
 
1112
                  yyp++;
 
1113
                  yyf++;
 
1114
                }
 
1115
            }
 
1116
        }
 
1117
      return yysize;
 
1118
    }
 
1119
}
 
1120
#endif /* YYERROR_VERBOSE */
 
1121
 
 
1122
 
 
1123
/*-----------------------------------------------.
 
1124
| Release the memory associated to this symbol.  |
 
1125
`-----------------------------------------------*/
 
1126
 
 
1127
/*ARGSUSED*/
 
1128
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1129
     || defined __cplusplus || defined _MSC_VER)
 
1130
static void
 
1131
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
 
1132
#else
 
1133
static void
 
1134
yydestruct (yymsg, yytype, yyvaluep)
 
1135
    const char *yymsg;
 
1136
    int yytype;
 
1137
    YYSTYPE *yyvaluep;
 
1138
#endif
 
1139
{
 
1140
  YYUSE (yyvaluep);
 
1141
 
 
1142
  if (!yymsg)
 
1143
    yymsg = "Deleting";
 
1144
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
 
1145
 
 
1146
  switch (yytype)
 
1147
    {
 
1148
      case 3: /* "TEXT_T" */
 
1149
#line 120 "message_parser.y"
 
1150
        {
 
1151
#ifndef WZ_OS_WIN
 
1152
        // Force type checking by the compiler
 
1153
        char * const s = (yyvaluep->sval);
 
1154
 
 
1155
        if (s)
 
1156
                free(s);
 
1157
#endif
 
1158
};
 
1159
#line 1160 "message_parser.tab.c"
 
1160
        break;
 
1161
      case 4: /* "QTEXT_T" */
 
1162
#line 120 "message_parser.y"
 
1163
        {
 
1164
#ifndef WZ_OS_WIN
 
1165
        // Force type checking by the compiler
 
1166
        char * const s = (yyvaluep->sval);
 
1167
 
 
1168
        if (s)
 
1169
                free(s);
 
1170
#endif
 
1171
};
 
1172
#line 1173 "message_parser.tab.c"
 
1173
        break;
 
1174
      case 25: /* "all_messages" */
 
1175
#line 147 "message_parser.y"
 
1176
        {
 
1177
        freeViewDataMessageList((yyvaluep->viewdatamsg));
 
1178
};
 
1179
#line 1180 "message_parser.tab.c"
 
1180
        break;
 
1181
      case 26: /* "message" */
 
1182
#line 147 "message_parser.y"
 
1183
        {
 
1184
        freeViewDataMessageList((yyvaluep->viewdatamsg));
 
1185
};
 
1186
#line 1187 "message_parser.tab.c"
 
1187
        break;
 
1188
      case 27: /* "research_message" */
 
1189
#line 134 "message_parser.y"
 
1190
        {
 
1191
        // Force type checking by the compiler
 
1192
        VIEW_RESEARCH* const r = (yyvaluep->researchdata);
 
1193
 
 
1194
        if (r)
 
1195
        {
 
1196
                if (r->pAudio)
 
1197
                        free(r->pAudio);
 
1198
 
 
1199
                free(r);
 
1200
        }
 
1201
};
 
1202
#line 1203 "message_parser.tab.c"
 
1203
        break;
 
1204
      case 28: /* "imd_name" */
 
1205
#line 120 "message_parser.y"
 
1206
        {
 
1207
#ifndef WZ_OS_WIN
 
1208
        // Force type checking by the compiler
 
1209
        char * const s = (yyvaluep->sval);
 
1210
 
 
1211
        if (s)
 
1212
                free(s);
 
1213
#endif
 
1214
};
 
1215
#line 1216 "message_parser.tab.c"
 
1216
        break;
 
1217
      case 29: /* "imd_name2" */
 
1218
#line 120 "message_parser.y"
 
1219
        {
 
1220
#ifndef WZ_OS_WIN
 
1221
        // Force type checking by the compiler
 
1222
        char * const s = (yyvaluep->sval);
 
1223
 
 
1224
        if (s)
 
1225
                free(s);
 
1226
#endif
 
1227
};
 
1228
#line 1229 "message_parser.tab.c"
 
1229
        break;
 
1230
      case 30: /* "sequence_name" */
 
1231
#line 120 "message_parser.y"
 
1232
        {
 
1233
#ifndef WZ_OS_WIN
 
1234
        // Force type checking by the compiler
 
1235
        char * const s = (yyvaluep->sval);
 
1236
 
 
1237
        if (s)
 
1238
                free(s);
 
1239
#endif
 
1240
};
 
1241
#line 1242 "message_parser.tab.c"
 
1242
        break;
 
1243
      case 31: /* "audio_name" */
 
1244
#line 120 "message_parser.y"
 
1245
        {
 
1246
#ifndef WZ_OS_WIN
 
1247
        // Force type checking by the compiler
 
1248
        char * const s = (yyvaluep->sval);
 
1249
 
 
1250
        if (s)
 
1251
                free(s);
 
1252
#endif
 
1253
};
 
1254
#line 1255 "message_parser.tab.c"
 
1255
        break;
 
1256
      case 32: /* "optional_string" */
 
1257
#line 120 "message_parser.y"
 
1258
        {
 
1259
#ifndef WZ_OS_WIN
 
1260
        // Force type checking by the compiler
 
1261
        char * const s = (yyvaluep->sval);
 
1262
 
 
1263
        if (s)
 
1264
                free(s);
 
1265
#endif
 
1266
};
 
1267
#line 1268 "message_parser.tab.c"
 
1268
        break;
 
1269
      case 34: /* "text_messages" */
 
1270
#line 130 "message_parser.y"
 
1271
        {
 
1272
        freeTextMessageList((yyvaluep->txtmsg));
 
1273
};
 
1274
#line 1275 "message_parser.tab.c"
 
1275
        break;
 
1276
      case 35: /* "text_message" */
 
1277
#line 130 "message_parser.y"
 
1278
        {
 
1279
        freeTextMessageList((yyvaluep->txtmsg));
 
1280
};
 
1281
#line 1282 "message_parser.tab.c"
 
1282
        break;
 
1283
 
 
1284
      default:
 
1285
        break;
 
1286
    }
 
1287
}
 
1288
 
 
1289
 
 
1290
/* Prevent warnings from -Wmissing-prototypes.  */
 
1291
 
 
1292
#ifdef YYPARSE_PARAM
 
1293
#if defined __STDC__ || defined __cplusplus
 
1294
int yyparse (void *YYPARSE_PARAM);
 
1295
#else
 
1296
int yyparse ();
 
1297
#endif
 
1298
#else /* ! YYPARSE_PARAM */
 
1299
#if defined __STDC__ || defined __cplusplus
 
1300
int yyparse (void);
 
1301
#else
 
1302
int yyparse ();
 
1303
#endif
 
1304
#endif /* ! YYPARSE_PARAM */
 
1305
 
 
1306
 
 
1307
 
 
1308
/* The look-ahead symbol.  */
 
1309
int yychar;
 
1310
 
 
1311
/* The semantic value of the look-ahead symbol.  */
 
1312
YYSTYPE yylval;
 
1313
 
 
1314
/* Number of syntax errors so far.  */
 
1315
int yynerrs;
 
1316
 
 
1317
 
 
1318
 
 
1319
/*----------.
 
1320
| yyparse.  |
 
1321
`----------*/
 
1322
 
 
1323
#ifdef YYPARSE_PARAM
 
1324
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1325
     || defined __cplusplus || defined _MSC_VER)
 
1326
int
 
1327
yyparse (void *YYPARSE_PARAM)
 
1328
#else
 
1329
int
 
1330
yyparse (YYPARSE_PARAM)
 
1331
    void *YYPARSE_PARAM;
 
1332
#endif
 
1333
#else /* ! YYPARSE_PARAM */
 
1334
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1335
     || defined __cplusplus || defined _MSC_VER)
 
1336
int
 
1337
yyparse (void)
 
1338
#else
 
1339
int
 
1340
yyparse ()
 
1341
 
 
1342
#endif
 
1343
#endif
 
1344
{
 
1345
  
 
1346
  int yystate;
 
1347
  int yyn;
 
1348
  int yyresult;
 
1349
  /* Number of tokens to shift before error messages enabled.  */
 
1350
  int yyerrstatus;
 
1351
  /* Look-ahead token as an internal (translated) token number.  */
 
1352
  int yytoken = 0;
 
1353
#if YYERROR_VERBOSE
 
1354
  /* Buffer for error messages, and its allocated size.  */
 
1355
  char yymsgbuf[128];
 
1356
  char *yymsg = yymsgbuf;
 
1357
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
 
1358
#endif
 
1359
 
 
1360
  /* Three stacks and their tools:
 
1361
     `yyss': related to states,
 
1362
     `yyvs': related to semantic values,
 
1363
     `yyls': related to locations.
 
1364
 
 
1365
     Refer to the stacks thru separate pointers, to allow yyoverflow
 
1366
     to reallocate them elsewhere.  */
 
1367
 
 
1368
  /* The state stack.  */
 
1369
  yytype_int16 yyssa[YYINITDEPTH];
 
1370
  yytype_int16 *yyss = yyssa;
 
1371
  yytype_int16 *yyssp;
 
1372
 
 
1373
  /* The semantic value stack.  */
 
1374
  YYSTYPE yyvsa[YYINITDEPTH];
 
1375
  YYSTYPE *yyvs = yyvsa;
 
1376
  YYSTYPE *yyvsp;
 
1377
 
 
1378
 
 
1379
 
 
1380
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
1381
 
 
1382
  YYSIZE_T yystacksize = YYINITDEPTH;
 
1383
 
 
1384
  /* The variables used to return semantic value and location from the
 
1385
     action routines.  */
 
1386
  YYSTYPE yyval;
 
1387
 
 
1388
 
 
1389
  /* The number of symbols on the RHS of the reduced rule.
 
1390
     Keep to zero when no symbol should be popped.  */
 
1391
  int yylen = 0;
 
1392
 
 
1393
  YYDPRINTF ((stderr, "Starting parse\n"));
 
1394
 
 
1395
  yystate = 0;
 
1396
  yyerrstatus = 0;
 
1397
  yynerrs = 0;
 
1398
  yychar = YYEMPTY;             /* Cause a token to be read.  */
 
1399
 
 
1400
  /* Initialize stack pointers.
 
1401
     Waste one element of value and location stack
 
1402
     so that they stay on the same level as the state stack.
 
1403
     The wasted elements are never initialized.  */
 
1404
 
 
1405
  yyssp = yyss;
 
1406
  yyvsp = yyvs;
 
1407
 
 
1408
  goto yysetstate;
 
1409
 
 
1410
/*------------------------------------------------------------.
 
1411
| yynewstate -- Push a new state, which is found in yystate.  |
 
1412
`------------------------------------------------------------*/
 
1413
 yynewstate:
 
1414
  /* In all cases, when you get here, the value and location stacks
 
1415
     have just been pushed.  So pushing a state here evens the stacks.  */
 
1416
  yyssp++;
 
1417
 
 
1418
 yysetstate:
 
1419
  *yyssp = yystate;
 
1420
 
 
1421
  if (yyss + yystacksize - 1 <= yyssp)
 
1422
    {
 
1423
      /* Get the current used size of the three stacks, in elements.  */
 
1424
      YYSIZE_T yysize = yyssp - yyss + 1;
 
1425
 
 
1426
#ifdef yyoverflow
 
1427
      {
 
1428
        /* Give user a chance to reallocate the stack.  Use copies of
 
1429
           these so that the &'s don't force the real ones into
 
1430
           memory.  */
 
1431
        YYSTYPE *yyvs1 = yyvs;
 
1432
        yytype_int16 *yyss1 = yyss;
 
1433
 
 
1434
 
 
1435
        /* Each stack pointer address is followed by the size of the
 
1436
           data in use in that stack, in bytes.  This used to be a
 
1437
           conditional around just the two extra args, but that might
 
1438
           be undefined if yyoverflow is a macro.  */
 
1439
        yyoverflow (YY_("memory exhausted"),
 
1440
                    &yyss1, yysize * sizeof (*yyssp),
 
1441
                    &yyvs1, yysize * sizeof (*yyvsp),
 
1442
 
 
1443
                    &yystacksize);
 
1444
 
 
1445
        yyss = yyss1;
 
1446
        yyvs = yyvs1;
 
1447
      }
 
1448
#else /* no yyoverflow */
 
1449
# ifndef YYSTACK_RELOCATE
 
1450
      goto yyexhaustedlab;
 
1451
# else
 
1452
      /* Extend the stack our own way.  */
 
1453
      if (YYMAXDEPTH <= yystacksize)
 
1454
        goto yyexhaustedlab;
 
1455
      yystacksize *= 2;
 
1456
      if (YYMAXDEPTH < yystacksize)
 
1457
        yystacksize = YYMAXDEPTH;
 
1458
 
 
1459
      {
 
1460
        yytype_int16 *yyss1 = yyss;
 
1461
        union yyalloc *yyptr =
 
1462
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
 
1463
        if (! yyptr)
 
1464
          goto yyexhaustedlab;
 
1465
        YYSTACK_RELOCATE (yyss);
 
1466
        YYSTACK_RELOCATE (yyvs);
 
1467
 
 
1468
#  undef YYSTACK_RELOCATE
 
1469
        if (yyss1 != yyssa)
 
1470
          YYSTACK_FREE (yyss1);
 
1471
      }
 
1472
# endif
 
1473
#endif /* no yyoverflow */
 
1474
 
 
1475
      yyssp = yyss + yysize - 1;
 
1476
      yyvsp = yyvs + yysize - 1;
 
1477
 
 
1478
 
 
1479
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
 
1480
                  (unsigned long int) yystacksize));
 
1481
 
 
1482
      if (yyss + yystacksize - 1 <= yyssp)
 
1483
        YYABORT;
 
1484
    }
 
1485
 
 
1486
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 
1487
 
 
1488
  goto yybackup;
 
1489
 
 
1490
/*-----------.
 
1491
| yybackup.  |
 
1492
`-----------*/
 
1493
yybackup:
 
1494
 
 
1495
  /* Do appropriate processing given the current state.  Read a
 
1496
     look-ahead token if we need one and don't already have one.  */
 
1497
 
 
1498
  /* First try to decide what to do without reference to look-ahead token.  */
 
1499
  yyn = yypact[yystate];
 
1500
  if (yyn == YYPACT_NINF)
 
1501
    goto yydefault;
 
1502
 
 
1503
  /* Not known => get a look-ahead token if don't already have one.  */
 
1504
 
 
1505
  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
 
1506
  if (yychar == YYEMPTY)
 
1507
    {
 
1508
      YYDPRINTF ((stderr, "Reading a token: "));
 
1509
      yychar = YYLEX;
 
1510
    }
 
1511
 
 
1512
  if (yychar <= YYEOF)
 
1513
    {
 
1514
      yychar = yytoken = YYEOF;
 
1515
      YYDPRINTF ((stderr, "Now at end of input.\n"));
 
1516
    }
 
1517
  else
 
1518
    {
 
1519
      yytoken = YYTRANSLATE (yychar);
 
1520
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
 
1521
    }
 
1522
 
 
1523
  /* If the proper action on seeing token YYTOKEN is to reduce or to
 
1524
     detect an error, take that action.  */
 
1525
  yyn += yytoken;
 
1526
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
 
1527
    goto yydefault;
 
1528
  yyn = yytable[yyn];
 
1529
  if (yyn <= 0)
 
1530
    {
 
1531
      if (yyn == 0 || yyn == YYTABLE_NINF)
 
1532
        goto yyerrlab;
 
1533
      yyn = -yyn;
 
1534
      goto yyreduce;
 
1535
    }
 
1536
 
 
1537
  if (yyn == YYFINAL)
 
1538
    YYACCEPT;
 
1539
 
 
1540
  /* Count tokens shifted since error; after three, turn off error
 
1541
     status.  */
 
1542
  if (yyerrstatus)
 
1543
    yyerrstatus--;
 
1544
 
 
1545
  /* Shift the look-ahead token.  */
 
1546
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 
1547
 
 
1548
  /* Discard the shifted token unless it is eof.  */
 
1549
  if (yychar != YYEOF)
 
1550
    yychar = YYEMPTY;
 
1551
 
 
1552
  yystate = yyn;
 
1553
  *++yyvsp = yylval;
 
1554
 
 
1555
  goto yynewstate;
 
1556
 
 
1557
 
 
1558
/*-----------------------------------------------------------.
 
1559
| yydefault -- do the default action for the current state.  |
 
1560
`-----------------------------------------------------------*/
 
1561
yydefault:
 
1562
  yyn = yydefact[yystate];
 
1563
  if (yyn == 0)
 
1564
    goto yyerrlab;
 
1565
  goto yyreduce;
 
1566
 
 
1567
 
 
1568
/*-----------------------------.
 
1569
| yyreduce -- Do a reduction.  |
 
1570
`-----------------------------*/
 
1571
yyreduce:
 
1572
  /* yyn is the number of a rule to reduce with.  */
 
1573
  yylen = yyr2[yyn];
 
1574
 
 
1575
  /* If YYLEN is nonzero, implement the default value of the action:
 
1576
     `$$ = $1'.
 
1577
 
 
1578
     Otherwise, the following line sets YYVAL to garbage.
 
1579
     This behavior is undocumented and Bison
 
1580
     users should not rely upon it.  Assigning to YYVAL
 
1581
     unconditionally makes the parser a bit smaller, and it avoids a
 
1582
     GCC warning that YYVAL may be used uninitialized.  */
 
1583
  yyval = yyvsp[1-yylen];
 
1584
 
 
1585
 
 
1586
  YY_REDUCE_PRINT (yyn);
 
1587
  switch (yyn)
 
1588
    {
 
1589
        case 2:
 
1590
#line 154 "message_parser.y"
 
1591
    {
 
1592
                                        unsigned int numData = 0, i;
 
1593
                                        VIEWDATAMESSAGE* curMsg;
 
1594
                                        VIEWDATA* psViewData;
 
1595
 
 
1596
                                        for (curMsg = (yyvsp[(1) - (1)].viewdatamsg); curMsg != NULL; curMsg = curMsg->psNext)
 
1597
                                        {
 
1598
                                                ++numData;
 
1599
                                        }
 
1600
 
 
1601
                                        ASSERT(numData <= UBYTE_MAX, "loadViewData: Didn't expect %d (or more) viewData messages (got %u)!", UBYTE_MAX, numData);
 
1602
                                        if (numData > UBYTE_MAX)
 
1603
                                        {
 
1604
                                                freeViewDataMessageList((yyvsp[(1) - (1)].viewdatamsg));
 
1605
                                                YYABORT;
 
1606
                                        }
 
1607
 
 
1608
                                        psViewData = malloc(numData * sizeof(*psViewData));
 
1609
                                        if (psViewData == NULL)
 
1610
                                        {
 
1611
                                                debug(LOG_ERROR, "Out of memory");
 
1612
                                                abort();
 
1613
                                                freeViewDataMessageList((yyvsp[(1) - (1)].viewdatamsg));
 
1614
                                                YYABORT;
 
1615
                                        }
 
1616
 
 
1617
                                        curMsg = (yyvsp[(1) - (1)].viewdatamsg);
 
1618
                                        for (i = 0; i < numData; ++i)
 
1619
                                        {
 
1620
                                                VIEWDATAMESSAGE* const toMove = curMsg;
 
1621
                                                assert(toMove != NULL);
 
1622
                                                curMsg = curMsg->psNext;
 
1623
                                                memcpy(&psViewData[i], &toMove->view, sizeof(psViewData[i]));
 
1624
                                                free(toMove);
 
1625
                                        }
 
1626
 
 
1627
                                        addToViewDataList(psViewData, numData);
 
1628
                                        *(VIEWDATA**)ppsViewData = psViewData;
 
1629
                                }
 
1630
    break;
 
1631
 
 
1632
  case 4:
 
1633
#line 197 "message_parser.y"
 
1634
    {
 
1635
                                        (yyvsp[(1) - (2)].viewdatamsg)->psNext = (yyvsp[(2) - (2)].viewdatamsg);
 
1636
                                        (yyval.viewdatamsg) = (yyvsp[(1) - (2)].viewdatamsg);
 
1637
                                }
 
1638
    break;
 
1639
 
 
1640
  case 5:
 
1641
#line 204 "message_parser.y"
 
1642
    {
 
1643
                                        (yyval.viewdatamsg) = malloc(sizeof(*(yyval.viewdatamsg)));
 
1644
                                        if ((yyval.viewdatamsg) == NULL)
 
1645
                                        {
 
1646
                                                debug(LOG_ERROR, "Out of memory");
 
1647
                                                abort();
 
1648
                                                free((yyvsp[(1) - (7)].sval));
 
1649
                                                free((yyvsp[(3) - (7)].msg_list).stringArray);
 
1650
                                                if ((yyvsp[(5) - (7)].researchdata))
 
1651
                                                        free((yyvsp[(5) - (7)].researchdata)->pAudio);
 
1652
                                                free((yyvsp[(5) - (7)].researchdata));
 
1653
                                                YYABORT;
 
1654
                                        }
 
1655
 
 
1656
                                        (yyval.viewdatamsg)->view.pName = (yyvsp[(1) - (7)].sval);
 
1657
                                        (yyval.viewdatamsg)->view.numText = (yyvsp[(3) - (7)].msg_list).count;
 
1658
                                        (yyval.viewdatamsg)->view.ppTextMsg = (yyvsp[(3) - (7)].msg_list).stringArray;
 
1659
                                        (yyval.viewdatamsg)->view.type = VIEW_RES;
 
1660
                                        (yyval.viewdatamsg)->view.pData = (yyvsp[(5) - (7)].researchdata);
 
1661
                                        (yyval.viewdatamsg)->psNext = NULL;
 
1662
                                }
 
1663
    break;
 
1664
 
 
1665
  case 6:
 
1666
#line 228 "message_parser.y"
 
1667
    {
 
1668
                                        (yyval.researchdata) = malloc(sizeof(*(yyval.researchdata)));
 
1669
                                        if ((yyval.researchdata) == NULL)
 
1670
                                        {
 
1671
                                                debug(LOG_ERROR, "Out of memory");
 
1672
                                                abort();
 
1673
                                                free((yyvsp[(1) - (8)].sval));
 
1674
                                                free((yyvsp[(3) - (8)].sval));
 
1675
                                                free((yyvsp[(5) - (8)].sval));
 
1676
                                                free((yyvsp[(7) - (8)].sval));
 
1677
                                                YYABORT;
 
1678
                                        }
 
1679
 
 
1680
                                        (yyval.researchdata)->pAudio = (yyvsp[(7) - (8)].sval);
 
1681
                                        sstrcpy((yyval.researchdata)->sequenceName, (yyvsp[(5) - (8)].sval));
 
1682
                                        // Get rid of our tokens ASAP (so that the free() lists on errors become shorter)
 
1683
                                        free((yyvsp[(5) - (8)].sval));
 
1684
 
 
1685
                                        (yyval.researchdata)->pIMD = (iIMDShape *) resGetData("IMD", (yyvsp[(1) - (8)].sval));
 
1686
                                        if ((yyval.researchdata)->pIMD == NULL)
 
1687
                                        {
 
1688
                                                ASSERT(LOG_ERROR, "Cannot find PIE \"%s\"", (yyvsp[(1) - (8)].sval));
 
1689
                                                free((yyvsp[(1) - (8)].sval));
 
1690
                                                free((yyvsp[(3) - (8)].sval));
 
1691
                                                YYABORT;
 
1692
                                        }
 
1693
                                        free((yyvsp[(1) - (8)].sval));
 
1694
 
 
1695
                                        if ((yyvsp[(3) - (8)].sval))
 
1696
                                        {
 
1697
                                                (yyval.researchdata)->pIMD2 = (iIMDShape *) resGetData("IMD", (yyvsp[(3) - (8)].sval));
 
1698
                                                if ((yyval.researchdata)->pIMD2 == NULL)
 
1699
                                                {
 
1700
                                                        ASSERT(false, "Cannot find 2nd PIE \"%s\"", (yyvsp[(3) - (8)].sval));
 
1701
                                                        free((yyvsp[(3) - (8)].sval));
 
1702
                                                        YYABORT;
 
1703
                                                }
 
1704
                                                free((yyvsp[(3) - (8)].sval));
 
1705
                                        }
 
1706
                                        else
 
1707
                                        {
 
1708
                                                (yyval.researchdata)->pIMD2 = NULL;
 
1709
                                        }
 
1710
                                }
 
1711
    break;
 
1712
 
 
1713
  case 7:
 
1714
#line 274 "message_parser.y"
 
1715
    { (yyval.sval) = (yyvsp[(3) - (3)].sval); }
 
1716
    break;
 
1717
 
 
1718
  case 9:
 
1719
#line 278 "message_parser.y"
 
1720
    { (yyval.sval) = (yyvsp[(3) - (3)].sval); }
 
1721
    break;
 
1722
 
 
1723
  case 11:
 
1724
#line 282 "message_parser.y"
 
1725
    { (yyval.sval) = (yyvsp[(3) - (3)].sval); }
 
1726
    break;
 
1727
 
 
1728
  case 13:
 
1729
#line 286 "message_parser.y"
 
1730
    { (yyval.sval) = (yyvsp[(3) - (3)].sval); }
 
1731
    break;
 
1732
 
 
1733
  case 17:
 
1734
#line 295 "message_parser.y"
 
1735
    {
 
1736
                                        size_t bytes = 0;
 
1737
                                        unsigned int i;
 
1738
                                        TEXT_MESSAGE* psCur;
 
1739
                                        char* stringStart;
 
1740
 
 
1741
                                        (yyval.msg_list).count = 0;
 
1742
 
 
1743
                                        // Compute the required space for all strings and an array of pointers to hold it
 
1744
                                        for (psCur = (yyvsp[(2) - (3)].txtmsg); psCur != NULL; psCur = psCur->psNext)
 
1745
                                        {
 
1746
                                                ++(yyval.msg_list).count;
 
1747
                                                bytes += sizeof(char*) + strlen(psCur->str) + 1;
 
1748
                                        }
 
1749
 
 
1750
                                        ASSERT((yyval.msg_list).count <= MAX_DATA, "Too many text strings (%u) provided, with %u as maximum", (yyval.msg_list).count, (unsigned int)MAX_DATA);
 
1751
                                        if ((yyval.msg_list).count > MAX_DATA)
 
1752
                                        {
 
1753
                                                YYABORT;
 
1754
                                        }
 
1755
 
 
1756
                                        if ((yyval.msg_list).count)
 
1757
                                        {
 
1758
                                                (yyval.msg_list).stringArray = malloc(bytes);
 
1759
                                                if ((yyval.msg_list).stringArray == NULL)
 
1760
                                                {
 
1761
                                                        debug(LOG_ERROR, "Out of memory");
 
1762
                                                        abort();
 
1763
                                                        freeTextMessageList((yyvsp[(2) - (3)].txtmsg));
 
1764
                                                        YYABORT;
 
1765
                                                }
 
1766
 
 
1767
                                                stringStart = (char*)&(yyval.msg_list).stringArray[(yyval.msg_list).count];
 
1768
                                                for (psCur = (yyvsp[(2) - (3)].txtmsg), i = 0, stringStart;
 
1769
                                                     psCur != NULL && i < (yyval.msg_list).count;
 
1770
                                                     psCur = psCur->psNext, ++i)
 
1771
                                                {
 
1772
                                                        assert(&stringStart[strlen(psCur->str)] - (char*)(yyval.msg_list).stringArray < bytes);
 
1773
                                                        (yyval.msg_list).stringArray[i] = strcpy(stringStart, psCur->str);
 
1774
                                                        stringStart = &stringStart[strlen(psCur->str) + 1];
 
1775
                                                }
 
1776
                                        }
 
1777
                                        else
 
1778
                                        {
 
1779
                                                (yyval.msg_list).stringArray = NULL;
 
1780
                                        }
 
1781
 
 
1782
                                        // Clean up our tokens
 
1783
                                        freeTextMessageList((yyvsp[(2) - (3)].txtmsg));
 
1784
                                }
 
1785
    break;
 
1786
 
 
1787
  case 20:
 
1788
#line 351 "message_parser.y"
 
1789
    {
 
1790
                                        (yyvsp[(1) - (3)].txtmsg)->psNext = (yyvsp[(3) - (3)].txtmsg);
 
1791
                                        (yyval.txtmsg) = (yyvsp[(1) - (3)].txtmsg);
 
1792
                                }
 
1793
    break;
 
1794
 
 
1795
  case 21:
 
1796
#line 358 "message_parser.y"
 
1797
    {
 
1798
                                        const char * const msg = strresGetString(psStringRes, (yyvsp[(1) - (1)].sval));
 
1799
                                        if (!msg)
 
1800
                                        {
 
1801
                                                ASSERT(!"Cannot find string resource", "Cannot find the view data string with id \"%s\"", (yyvsp[(1) - (1)].sval));
 
1802
                                                free((yyvsp[(1) - (1)].sval));
 
1803
                                                YYABORT;
 
1804
                                        }
 
1805
 
 
1806
                                        (yyval.txtmsg) = malloc(sizeof(*(yyval.txtmsg)));
 
1807
                                        if ((yyval.txtmsg) == NULL)
 
1808
                                        {
 
1809
                                                debug(LOG_ERROR, "Out of memory");
 
1810
                                                abort();
 
1811
                                                free((yyvsp[(1) - (1)].sval));
 
1812
                                                YYABORT;
 
1813
                                        }
 
1814
 
 
1815
                                        (yyval.txtmsg)->str = (yyvsp[(1) - (1)].sval);
 
1816
                                        (yyval.txtmsg)->psNext = NULL;
 
1817
                                }
 
1818
    break;
 
1819
 
 
1820
  case 22:
 
1821
#line 380 "message_parser.y"
 
1822
    {
 
1823
                                        (yyval.txtmsg) = malloc(sizeof(*(yyval.txtmsg)));
 
1824
                                        if ((yyval.txtmsg) == NULL)
 
1825
                                        {
 
1826
                                                debug(LOG_ERROR, "Out of memory");
 
1827
                                                abort();
 
1828
                                                free((yyvsp[(1) - (1)].sval));
 
1829
                                                YYABORT;
 
1830
                                        }
 
1831
 
 
1832
                                        (yyval.txtmsg)->str = (yyvsp[(1) - (1)].sval);
 
1833
                                        (yyval.txtmsg)->psNext = NULL;
 
1834
                                }
 
1835
    break;
 
1836
 
 
1837
  case 23:
 
1838
#line 394 "message_parser.y"
 
1839
    {
 
1840
                                        (yyval.txtmsg) = malloc(sizeof(*(yyval.txtmsg)));
 
1841
                                        if ((yyval.txtmsg) == NULL)
 
1842
                                        {
 
1843
                                                debug(LOG_ERROR, "Out of memory");
 
1844
                                                abort();
 
1845
                                                free((yyvsp[(3) - (4)].sval));
 
1846
                                                YYABORT;
 
1847
                                        }
 
1848
 
 
1849
                                        (yyval.txtmsg)->str = (yyvsp[(3) - (4)].sval);
 
1850
                                        (yyval.txtmsg)->psNext = NULL;
 
1851
                                }
 
1852
    break;
 
1853
 
 
1854
 
 
1855
/* Line 1267 of yacc.c.  */
 
1856
#line 1857 "message_parser.tab.c"
 
1857
      default: break;
 
1858
    }
 
1859
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
1860
 
 
1861
  YYPOPSTACK (yylen);
 
1862
  yylen = 0;
 
1863
  YY_STACK_PRINT (yyss, yyssp);
 
1864
 
 
1865
  *++yyvsp = yyval;
 
1866
 
 
1867
 
 
1868
  /* Now `shift' the result of the reduction.  Determine what state
 
1869
     that goes to, based on the state we popped back to and the rule
 
1870
     number reduced by.  */
 
1871
 
 
1872
  yyn = yyr1[yyn];
 
1873
 
 
1874
  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
 
1875
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
 
1876
    yystate = yytable[yystate];
 
1877
  else
 
1878
    yystate = yydefgoto[yyn - YYNTOKENS];
 
1879
 
 
1880
  goto yynewstate;
 
1881
 
 
1882
 
 
1883
/*------------------------------------.
 
1884
| yyerrlab -- here on detecting error |
 
1885
`------------------------------------*/
 
1886
yyerrlab:
 
1887
  /* If not already recovering from an error, report this error.  */
 
1888
  if (!yyerrstatus)
 
1889
    {
 
1890
      ++yynerrs;
 
1891
#if ! YYERROR_VERBOSE
 
1892
      yyerror (YY_("syntax error"));
 
1893
#else
 
1894
      {
 
1895
        YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
 
1896
        if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
 
1897
          {
 
1898
            YYSIZE_T yyalloc = 2 * yysize;
 
1899
            if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
 
1900
              yyalloc = YYSTACK_ALLOC_MAXIMUM;
 
1901
            if (yymsg != yymsgbuf)
 
1902
              YYSTACK_FREE (yymsg);
 
1903
            yymsg = (char *) YYSTACK_ALLOC (yyalloc);
 
1904
            if (yymsg)
 
1905
              yymsg_alloc = yyalloc;
 
1906
            else
 
1907
              {
 
1908
                yymsg = yymsgbuf;
 
1909
                yymsg_alloc = sizeof yymsgbuf;
 
1910
              }
 
1911
          }
 
1912
 
 
1913
        if (0 < yysize && yysize <= yymsg_alloc)
 
1914
          {
 
1915
            (void) yysyntax_error (yymsg, yystate, yychar);
 
1916
            yyerror (yymsg);
 
1917
          }
 
1918
        else
 
1919
          {
 
1920
            yyerror (YY_("syntax error"));
 
1921
            if (yysize != 0)
 
1922
              goto yyexhaustedlab;
 
1923
          }
 
1924
      }
 
1925
#endif
 
1926
    }
 
1927
 
 
1928
 
 
1929
 
 
1930
  if (yyerrstatus == 3)
 
1931
    {
 
1932
      /* If just tried and failed to reuse look-ahead token after an
 
1933
         error, discard it.  */
 
1934
 
 
1935
      if (yychar <= YYEOF)
 
1936
        {
 
1937
          /* Return failure if at end of input.  */
 
1938
          if (yychar == YYEOF)
 
1939
            YYABORT;
 
1940
        }
 
1941
      else
 
1942
        {
 
1943
          yydestruct ("Error: discarding",
 
1944
                      yytoken, &yylval);
 
1945
          yychar = YYEMPTY;
 
1946
        }
 
1947
    }
 
1948
 
 
1949
  /* Else will try to reuse look-ahead token after shifting the error
 
1950
     token.  */
 
1951
  goto yyerrlab1;
 
1952
 
 
1953
 
 
1954
/*---------------------------------------------------.
 
1955
| yyerrorlab -- error raised explicitly by YYERROR.  |
 
1956
`---------------------------------------------------*/
 
1957
yyerrorlab:
 
1958
 
 
1959
  /* Pacify compilers like GCC when the user code never invokes
 
1960
     YYERROR and the label yyerrorlab therefore never appears in user
 
1961
     code.  */
 
1962
  if (/*CONSTCOND*/ 0)
 
1963
     goto yyerrorlab;
 
1964
 
 
1965
  /* Do not reclaim the symbols of the rule which action triggered
 
1966
     this YYERROR.  */
 
1967
  YYPOPSTACK (yylen);
 
1968
  yylen = 0;
 
1969
  YY_STACK_PRINT (yyss, yyssp);
 
1970
  yystate = *yyssp;
 
1971
  goto yyerrlab1;
 
1972
 
 
1973
 
 
1974
/*-------------------------------------------------------------.
 
1975
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
 
1976
`-------------------------------------------------------------*/
 
1977
yyerrlab1:
 
1978
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
 
1979
 
 
1980
  for (;;)
 
1981
    {
 
1982
      yyn = yypact[yystate];
 
1983
      if (yyn != YYPACT_NINF)
 
1984
        {
 
1985
          yyn += YYTERROR;
 
1986
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
 
1987
            {
 
1988
              yyn = yytable[yyn];
 
1989
              if (0 < yyn)
 
1990
                break;
 
1991
            }
 
1992
        }
 
1993
 
 
1994
      /* Pop the current state because it cannot handle the error token.  */
 
1995
      if (yyssp == yyss)
 
1996
        YYABORT;
 
1997
 
 
1998
 
 
1999
      yydestruct ("Error: popping",
 
2000
                  yystos[yystate], yyvsp);
 
2001
      YYPOPSTACK (1);
 
2002
      yystate = *yyssp;
 
2003
      YY_STACK_PRINT (yyss, yyssp);
 
2004
    }
 
2005
 
 
2006
  if (yyn == YYFINAL)
 
2007
    YYACCEPT;
 
2008
 
 
2009
  *++yyvsp = yylval;
 
2010
 
 
2011
 
 
2012
  /* Shift the error token.  */
 
2013
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
 
2014
 
 
2015
  yystate = yyn;
 
2016
  goto yynewstate;
 
2017
 
 
2018
 
 
2019
/*-------------------------------------.
 
2020
| yyacceptlab -- YYACCEPT comes here.  |
 
2021
`-------------------------------------*/
 
2022
yyacceptlab:
 
2023
  yyresult = 0;
 
2024
  goto yyreturn;
 
2025
 
 
2026
/*-----------------------------------.
 
2027
| yyabortlab -- YYABORT comes here.  |
 
2028
`-----------------------------------*/
 
2029
yyabortlab:
 
2030
  yyresult = 1;
 
2031
  goto yyreturn;
 
2032
 
 
2033
#ifndef yyoverflow
 
2034
/*-------------------------------------------------.
 
2035
| yyexhaustedlab -- memory exhaustion comes here.  |
 
2036
`-------------------------------------------------*/
 
2037
yyexhaustedlab:
 
2038
  yyerror (YY_("memory exhausted"));
 
2039
  yyresult = 2;
 
2040
  /* Fall through.  */
 
2041
#endif
 
2042
 
 
2043
yyreturn:
 
2044
  if (yychar != YYEOF && yychar != YYEMPTY)
 
2045
     yydestruct ("Cleanup: discarding lookahead",
 
2046
                 yytoken, &yylval);
 
2047
  /* Do not reclaim the symbols of the rule which action triggered
 
2048
     this YYABORT or YYACCEPT.  */
 
2049
  YYPOPSTACK (yylen);
 
2050
  YY_STACK_PRINT (yyss, yyssp);
 
2051
  while (yyssp != yyss)
 
2052
    {
 
2053
      yydestruct ("Cleanup: popping",
 
2054
                  yystos[*yyssp], yyvsp);
 
2055
      YYPOPSTACK (1);
 
2056
    }
 
2057
#ifndef yyoverflow
 
2058
  if (yyss != yyssa)
 
2059
    YYSTACK_FREE (yyss);
 
2060
#endif
 
2061
#if YYERROR_VERBOSE
 
2062
  if (yymsg != yymsgbuf)
 
2063
    YYSTACK_FREE (yymsg);
 
2064
#endif
 
2065
  /* Make sure YYID is used.  */
 
2066
  return YYID (yyresult);
 
2067
}
 
2068
 
 
2069
 
 
2070