1
/* A Bison parser, made by GNU Bison 2.3. */
3
/* Skeleton implementation for Bison's Yacc-like parsers in C
5
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6
Free Software Foundation, Inc.
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)
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.
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. */
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.
33
This special exception was added by the Free Software Foundation in
34
version 2.2 of Bison. */
36
/* C LALR(1) parser skeleton written by Richard Stallman, by
37
simplifying the original so-called "semantic" parser. */
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. */
46
/* Identify Bison output. */
50
#define YYBISON_VERSION "2.3"
53
#define YYSKELETON_NAME "yacc.c"
58
/* Using locations. */
59
#define YYLSP_NEEDED 0
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
74
/* Put the tokens into the symbol table, so that GDB and other debuggers
87
SEQUENCE_NAME_T = 268,
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
108
/* Copy the first part of user declarations. */
109
#line 20 "message_parser.y"
113
* Parser for message data
116
#include "lib/framework/frame.h"
117
#include "lib/framework/strres.h"
118
#include "lib/framework/frameresource.h"
120
#include "messagedef.h"
121
#include "messagely.h"
124
extern void yyerror(const char* msg);
125
void yyerror(const char* msg)
127
debug(LOG_ERROR, "SMSG file parse error:\n%s at line %d\nText: '%s'", msg, message_get_lineno(), message_get_text());
130
typedef struct TEXT_MESSAGE
133
struct TEXT_MESSAGE* psNext;
136
static void freeTextMessageList(TEXT_MESSAGE* list)
140
TEXT_MESSAGE* const toDelete = list;
147
typedef struct VIEWDATAMESSAGE
150
struct VIEWDATAMESSAGE* psNext;
153
static void freeViewDataMessageList(VIEWDATAMESSAGE* list)
157
VIEWDATAMESSAGE* const toDelete = list;
159
free(toDelete->view.pName);
160
free(toDelete->view.ppTextMsg);
161
switch (toDelete->view.type)
165
VIEW_RESEARCH* const psViewRes = toDelete->view.pData;
166
if (psViewRes->pAudio)
167
free(psViewRes->pAudio);
172
ASSERT(!"Unhandled view data type", "Unhandled view data type %u", toDelete->view.type);
178
#define YYPARSE_PARAM ppsViewData
182
/* Enabling traces. */
187
/* Enabling verbose error messages. */
188
#ifdef YYERROR_VERBOSE
189
# undef YYERROR_VERBOSE
190
# define YYERROR_VERBOSE 1
192
# define YYERROR_VERBOSE 0
195
/* Enabling the token table. */
196
#ifndef YYTOKEN_TABLE
197
# define YYTOKEN_TABLE 0
200
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
201
typedef union YYSTYPE
202
#line 94 "message_parser.y"
205
struct VIEWDATAMESSAGE* viewdatamsg;
206
struct TEXT_MESSAGE* txtmsg;
208
VIEW_RESEARCH* researchdata;
211
const char** stringArray;
215
/* Line 187 of yacc.c. */
216
#line 217 "message_parser.tab.c"
218
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
219
# define YYSTYPE_IS_DECLARED 1
220
# define YYSTYPE_IS_TRIVIAL 1
225
/* Copy the second part of user declarations. */
228
/* Line 216 of yacc.c. */
229
#line 230 "message_parser.tab.c"
236
typedef YYTYPE_UINT8 yytype_uint8;
238
typedef unsigned char yytype_uint8;
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;
247
typedef short int yytype_int8;
251
typedef YYTYPE_UINT16 yytype_uint16;
253
typedef unsigned short int yytype_uint16;
257
typedef YYTYPE_INT16 yytype_int16;
259
typedef short int yytype_int16;
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
272
# define YYSIZE_T unsigned int
276
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
281
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
282
# define YY_(msgid) dgettext ("bison-runtime", msgid)
286
# define YY_(msgid) msgid
290
/* Suppress unused-variable warnings by "using" E. */
291
#if ! defined lint || defined __GNUC__
292
# define YYUSE(e) ((void) (e))
294
# define YYUSE(e) /* empty */
297
/* Identity function, used to suppress warnings about constant conditions. */
301
#if (defined __STDC__ || defined __C99__FUNC__ \
302
|| defined __cplusplus || defined _MSC_VER)
315
#if ! defined yyoverflow || YYERROR_VERBOSE
317
/* The parser invokes alloca or malloc; define the necessary symbols. */
319
# ifdef YYSTACK_USE_ALLOCA
320
# if YYSTACK_USE_ALLOCA
322
# define YYSTACK_ALLOC __builtin_alloca
323
# elif defined __BUILTIN_VA_ARG_INCR
324
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
326
# define YYSTACK_ALLOC __alloca
327
# elif defined _MSC_VER
328
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
329
# define alloca _alloca
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 */
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 */
354
# define YYSTACK_ALLOC YYMALLOC
355
# define YYSTACK_FREE YYFREE
356
# ifndef YYSTACK_ALLOC_MAXIMUM
357
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
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 */
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 */
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 */
382
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
385
#if (! defined yyoverflow \
386
&& (! defined __cplusplus \
387
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
389
/* A type that is properly aligned for any stack member. */
396
/* The size of the maximum gap between one aligned stack and the next. */
397
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
399
/* The size of an array large to enough to hold all stacks, each with
401
# define YYSTACK_BYTES(N) \
402
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
403
+ YYSTACK_GAP_MAXIMUM)
405
/* Copy COUNT objects from FROM to TO. The source and destination do
408
# if defined __GNUC__ && 1 < __GNUC__
409
# define YYCOPY(To, From, Count) \
410
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
412
# define YYCOPY(To, From, Count) \
416
for (yyi = 0; yyi < (Count); yyi++) \
417
(To)[yyi] = (From)[yyi]; \
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
428
# define YYSTACK_RELOCATE(Stack) \
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); \
441
/* YYFINAL -- State number of the termination state. */
443
/* YYLAST -- Last index in YYTABLE. */
446
/* YYNTOKENS -- Number of terminals. */
448
/* YYNNTS -- Number of nonterminals. */
450
/* YYNRULES -- Number of rules. */
452
/* YYNRULES -- Number of states. */
455
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
457
#define YYMAXUTOK 269
459
#define YYTRANSLATE(YYX) \
460
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
462
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
463
static const yytype_uint8 yytranslate[] =
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
495
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
497
static const yytype_uint8 yyprhs[] =
499
0, 0, 3, 5, 7, 10, 18, 27, 31, 33,
500
37, 39, 43, 45, 49, 51, 53, 55, 59, 61,
504
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
505
static const yytype_int8 yyrhs[] =
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
517
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
518
static const yytype_uint16 yyrline[] =
520
0, 153, 153, 195, 196, 203, 227, 274, 275, 278,
521
279, 282, 283, 286, 287, 290, 291, 294, 347, 349,
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[] =
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
542
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
544
static const yytype_uint16 yytoknum[] =
546
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
547
265, 266, 267, 268, 269, 123, 44, 125, 59, 61,
552
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
553
static const yytype_uint8 yyr1[] =
555
0, 23, 24, 25, 25, 26, 27, 28, 28, 29,
556
29, 30, 30, 31, 31, 32, 32, 33, 34, 34,
560
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
561
static const yytype_uint8 yyr2[] =
563
0, 2, 1, 1, 2, 7, 8, 3, 1, 3,
564
1, 3, 1, 3, 1, 1, 1, 3, 1, 2,
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[] =
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,
581
/* YYDEFGOTO[NTERM-NUM]. */
582
static const yytype_int8 yydefgoto[] =
584
-1, 2, 3, 4, 21, 22, 34, 41, 46, 35,
588
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
590
#define YYPACT_NINF -35
591
static const yytype_int8 yypact[] =
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,
601
/* YYPGOTO[NTERM-NUM]. */
602
static const yytype_int8 yypgoto[] =
604
-35, -35, 31, -35, -35, -35, -35, -35, -35, -34,
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[] =
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,
622
static const yytype_int8 yycheck[] =
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
631
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
632
symbol of state STATE-NUM. */
633
static const yytype_uint8 yystos[] =
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,
643
#define yyerrok (yyerrstatus = 0)
644
#define yyclearin (yychar = YYEMPTY)
648
#define YYACCEPT goto yyacceptlab
649
#define YYABORT goto yyabortlab
650
#define YYERROR goto yyerrorlab
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. */
657
#define YYFAIL goto yyerrlab
659
#define YYRECOVERING() (!!yyerrstatus)
661
#define YYBACKUP(Token, Value) \
663
if (yychar == YYEMPTY && yylen == 1) \
667
yytoken = YYTRANSLATE (yychar); \
673
yyerror (YY_("syntax error: cannot back up")); \
680
#define YYERRCODE 256
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). */
687
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
688
#ifndef YYLLOC_DEFAULT
689
# define YYLLOC_DEFAULT(Current, Rhs, N) \
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; \
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; \
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. */
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)
720
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
725
/* YYLEX -- calling `yylex' with the right arguments. */
728
# define YYLEX yylex (YYLEX_PARAM)
730
# define YYLEX yylex ()
733
/* Enable debugging if requested. */
737
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
738
# define YYFPRINTF fprintf
741
# define YYDPRINTF(Args) \
747
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
751
YYFPRINTF (stderr, "%s ", Title); \
752
yy_symbol_print (stderr, \
754
YYFPRINTF (stderr, "\n"); \
759
/*--------------------------------.
760
| Print this symbol on YYOUTPUT. |
761
`--------------------------------*/
764
#if (defined __STDC__ || defined __C99__FUNC__ \
765
|| defined __cplusplus || defined _MSC_VER)
767
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
770
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
773
YYSTYPE const * const yyvaluep;
779
if (yytype < YYNTOKENS)
780
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
792
/*--------------------------------.
793
| Print this symbol on YYOUTPUT. |
794
`--------------------------------*/
796
#if (defined __STDC__ || defined __C99__FUNC__ \
797
|| defined __cplusplus || defined _MSC_VER)
799
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
802
yy_symbol_print (yyoutput, yytype, yyvaluep)
805
YYSTYPE const * const yyvaluep;
808
if (yytype < YYNTOKENS)
809
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
811
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
813
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
814
YYFPRINTF (yyoutput, ")");
817
/*------------------------------------------------------------------.
818
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
820
`------------------------------------------------------------------*/
822
#if (defined __STDC__ || defined __C99__FUNC__ \
823
|| defined __cplusplus || defined _MSC_VER)
825
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
828
yy_stack_print (bottom, top)
829
yytype_int16 *bottom;
833
YYFPRINTF (stderr, "Stack now");
834
for (; bottom <= top; ++bottom)
835
YYFPRINTF (stderr, " %d", *bottom);
836
YYFPRINTF (stderr, "\n");
839
# define YY_STACK_PRINT(Bottom, Top) \
842
yy_stack_print ((Bottom), (Top)); \
846
/*------------------------------------------------.
847
| Report that the YYRULE is going to be reduced. |
848
`------------------------------------------------*/
850
#if (defined __STDC__ || defined __C99__FUNC__ \
851
|| defined __cplusplus || defined _MSC_VER)
853
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
856
yy_reduce_print (yyvsp, yyrule)
861
int yynrhs = yyr2[yyrule];
863
unsigned long int yylno = yyrline[yyrule];
864
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
866
/* The symbols being reduced. */
867
for (yyi = 0; yyi < yynrhs; yyi++)
869
fprintf (stderr, " $%d = ", yyi + 1);
870
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
871
&(yyvsp[(yyi + 1) - (yynrhs)])
873
fprintf (stderr, "\n");
877
# define YY_REDUCE_PRINT(Rule) \
880
yy_reduce_print (yyvsp, Rule); \
883
/* Nonzero means print parse trace. It is left uninitialized so that
884
multiple parsers can coexist. */
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 */
894
/* YYINITDEPTH -- initial size of the parser's stacks. */
896
# define YYINITDEPTH 200
899
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
900
if the built-in stack extension method is used).
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. */
907
# define YYMAXDEPTH 10000
915
# if defined __GLIBC__ && defined _STRING_H
916
# define yystrlen strlen
918
/* Return the length of YYSTR. */
919
#if (defined __STDC__ || defined __C99__FUNC__ \
920
|| defined __cplusplus || defined _MSC_VER)
922
yystrlen (const char *yystr)
930
for (yylen = 0; yystr[yylen]; yylen++)
938
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
939
# define yystpcpy stpcpy
941
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
943
#if (defined __STDC__ || defined __C99__FUNC__ \
944
|| defined __cplusplus || defined _MSC_VER)
946
yystpcpy (char *yydest, const char *yysrc)
949
yystpcpy (yydest, yysrc)
955
const char *yys = yysrc;
957
while ((*yyd++ = *yys++) != '\0')
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
974
yytnamerr (char *yyres, const char *yystr)
979
char const *yyp = yystr;
986
goto do_not_strip_quotes;
990
goto do_not_strip_quotes;
1003
do_not_strip_quotes: ;
1007
return yystrlen (yystr);
1009
return yystpcpy (yyres, yystr) - yyres;
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. */
1021
yysyntax_error (char *yyresult, int yystate, int yychar)
1023
int yyn = yypact[yystate];
1025
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1029
int yytype = YYTRANSLATE (yychar);
1030
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1031
YYSIZE_T yysize = yysize0;
1033
int yysize_overflow = 0;
1034
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1035
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
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");
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;
1058
/* Start YYX at -YYN if negative to avoid negative indexes in
1060
int yyxbegin = yyn < 0 ? -yyn : 0;
1062
/* Stay within bounds of both yycheck and yytname. */
1063
int yychecklim = YYLAST - yyn + 1;
1064
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1067
yyarg[0] = yytname[yytype];
1068
yyfmt = yystpcpy (yyformat, yyunexpected);
1070
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1071
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1073
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1077
yyformat[sizeof yyunexpected - 1] = '\0';
1080
yyarg[yycount++] = yytname[yyx];
1081
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1082
yysize_overflow |= (yysize1 < yysize);
1084
yyfmt = yystpcpy (yyfmt, yyprefix);
1088
yyf = YY_(yyformat);
1089
yysize1 = yysize + yystrlen (yyf);
1090
yysize_overflow |= (yysize1 < yysize);
1093
if (yysize_overflow)
1094
return YYSIZE_MAXIMUM;
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;
1103
while ((*yyp = *yyf) != '\0')
1105
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1107
yyp += yytnamerr (yyp, yyarg[yyi++]);
1120
#endif /* YYERROR_VERBOSE */
1123
/*-----------------------------------------------.
1124
| Release the memory associated to this symbol. |
1125
`-----------------------------------------------*/
1128
#if (defined __STDC__ || defined __C99__FUNC__ \
1129
|| defined __cplusplus || defined _MSC_VER)
1131
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1134
yydestruct (yymsg, yytype, yyvaluep)
1144
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1148
case 3: /* "TEXT_T" */
1149
#line 120 "message_parser.y"
1152
// Force type checking by the compiler
1153
char * const s = (yyvaluep->sval);
1159
#line 1160 "message_parser.tab.c"
1161
case 4: /* "QTEXT_T" */
1162
#line 120 "message_parser.y"
1165
// Force type checking by the compiler
1166
char * const s = (yyvaluep->sval);
1172
#line 1173 "message_parser.tab.c"
1174
case 25: /* "all_messages" */
1175
#line 147 "message_parser.y"
1177
freeViewDataMessageList((yyvaluep->viewdatamsg));
1179
#line 1180 "message_parser.tab.c"
1181
case 26: /* "message" */
1182
#line 147 "message_parser.y"
1184
freeViewDataMessageList((yyvaluep->viewdatamsg));
1186
#line 1187 "message_parser.tab.c"
1188
case 27: /* "research_message" */
1189
#line 134 "message_parser.y"
1191
// Force type checking by the compiler
1192
VIEW_RESEARCH* const r = (yyvaluep->researchdata);
1202
#line 1203 "message_parser.tab.c"
1204
case 28: /* "imd_name" */
1205
#line 120 "message_parser.y"
1208
// Force type checking by the compiler
1209
char * const s = (yyvaluep->sval);
1215
#line 1216 "message_parser.tab.c"
1217
case 29: /* "imd_name2" */
1218
#line 120 "message_parser.y"
1221
// Force type checking by the compiler
1222
char * const s = (yyvaluep->sval);
1228
#line 1229 "message_parser.tab.c"
1230
case 30: /* "sequence_name" */
1231
#line 120 "message_parser.y"
1234
// Force type checking by the compiler
1235
char * const s = (yyvaluep->sval);
1241
#line 1242 "message_parser.tab.c"
1243
case 31: /* "audio_name" */
1244
#line 120 "message_parser.y"
1247
// Force type checking by the compiler
1248
char * const s = (yyvaluep->sval);
1254
#line 1255 "message_parser.tab.c"
1256
case 32: /* "optional_string" */
1257
#line 120 "message_parser.y"
1260
// Force type checking by the compiler
1261
char * const s = (yyvaluep->sval);
1267
#line 1268 "message_parser.tab.c"
1269
case 34: /* "text_messages" */
1270
#line 130 "message_parser.y"
1272
freeTextMessageList((yyvaluep->txtmsg));
1274
#line 1275 "message_parser.tab.c"
1276
case 35: /* "text_message" */
1277
#line 130 "message_parser.y"
1279
freeTextMessageList((yyvaluep->txtmsg));
1281
#line 1282 "message_parser.tab.c"
1290
/* Prevent warnings from -Wmissing-prototypes. */
1292
#ifdef YYPARSE_PARAM
1293
#if defined __STDC__ || defined __cplusplus
1294
int yyparse (void *YYPARSE_PARAM);
1298
#else /* ! YYPARSE_PARAM */
1299
#if defined __STDC__ || defined __cplusplus
1304
#endif /* ! YYPARSE_PARAM */
1308
/* The look-ahead symbol. */
1311
/* The semantic value of the look-ahead symbol. */
1314
/* Number of syntax errors so far. */
1323
#ifdef YYPARSE_PARAM
1324
#if (defined __STDC__ || defined __C99__FUNC__ \
1325
|| defined __cplusplus || defined _MSC_VER)
1327
yyparse (void *YYPARSE_PARAM)
1330
yyparse (YYPARSE_PARAM)
1331
void *YYPARSE_PARAM;
1333
#else /* ! YYPARSE_PARAM */
1334
#if (defined __STDC__ || defined __C99__FUNC__ \
1335
|| defined __cplusplus || defined _MSC_VER)
1349
/* Number of tokens to shift before error messages enabled. */
1351
/* Look-ahead token as an internal (translated) token number. */
1354
/* Buffer for error messages, and its allocated size. */
1356
char *yymsg = yymsgbuf;
1357
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1360
/* Three stacks and their tools:
1361
`yyss': related to states,
1362
`yyvs': related to semantic values,
1363
`yyls': related to locations.
1365
Refer to the stacks thru separate pointers, to allow yyoverflow
1366
to reallocate them elsewhere. */
1368
/* The state stack. */
1369
yytype_int16 yyssa[YYINITDEPTH];
1370
yytype_int16 *yyss = yyssa;
1371
yytype_int16 *yyssp;
1373
/* The semantic value stack. */
1374
YYSTYPE yyvsa[YYINITDEPTH];
1375
YYSTYPE *yyvs = yyvsa;
1380
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1382
YYSIZE_T yystacksize = YYINITDEPTH;
1384
/* The variables used to return semantic value and location from the
1389
/* The number of symbols on the RHS of the reduced rule.
1390
Keep to zero when no symbol should be popped. */
1393
YYDPRINTF ((stderr, "Starting parse\n"));
1398
yychar = YYEMPTY; /* Cause a token to be read. */
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. */
1410
/*------------------------------------------------------------.
1411
| yynewstate -- Push a new state, which is found in yystate. |
1412
`------------------------------------------------------------*/
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. */
1421
if (yyss + yystacksize - 1 <= yyssp)
1423
/* Get the current used size of the three stacks, in elements. */
1424
YYSIZE_T yysize = yyssp - yyss + 1;
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
1431
YYSTYPE *yyvs1 = yyvs;
1432
yytype_int16 *yyss1 = yyss;
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),
1448
#else /* no yyoverflow */
1449
# ifndef YYSTACK_RELOCATE
1450
goto yyexhaustedlab;
1452
/* Extend the stack our own way. */
1453
if (YYMAXDEPTH <= yystacksize)
1454
goto yyexhaustedlab;
1456
if (YYMAXDEPTH < yystacksize)
1457
yystacksize = YYMAXDEPTH;
1460
yytype_int16 *yyss1 = yyss;
1461
union yyalloc *yyptr =
1462
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1464
goto yyexhaustedlab;
1465
YYSTACK_RELOCATE (yyss);
1466
YYSTACK_RELOCATE (yyvs);
1468
# undef YYSTACK_RELOCATE
1470
YYSTACK_FREE (yyss1);
1473
#endif /* no yyoverflow */
1475
yyssp = yyss + yysize - 1;
1476
yyvsp = yyvs + yysize - 1;
1479
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1480
(unsigned long int) yystacksize));
1482
if (yyss + yystacksize - 1 <= yyssp)
1486
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1495
/* Do appropriate processing given the current state. Read a
1496
look-ahead token if we need one and don't already have one. */
1498
/* First try to decide what to do without reference to look-ahead token. */
1499
yyn = yypact[yystate];
1500
if (yyn == YYPACT_NINF)
1503
/* Not known => get a look-ahead token if don't already have one. */
1505
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1506
if (yychar == YYEMPTY)
1508
YYDPRINTF ((stderr, "Reading a token: "));
1512
if (yychar <= YYEOF)
1514
yychar = yytoken = YYEOF;
1515
YYDPRINTF ((stderr, "Now at end of input.\n"));
1519
yytoken = YYTRANSLATE (yychar);
1520
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1523
/* If the proper action on seeing token YYTOKEN is to reduce or to
1524
detect an error, take that action. */
1526
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1531
if (yyn == 0 || yyn == YYTABLE_NINF)
1540
/* Count tokens shifted since error; after three, turn off error
1545
/* Shift the look-ahead token. */
1546
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1548
/* Discard the shifted token unless it is eof. */
1549
if (yychar != YYEOF)
1558
/*-----------------------------------------------------------.
1559
| yydefault -- do the default action for the current state. |
1560
`-----------------------------------------------------------*/
1562
yyn = yydefact[yystate];
1568
/*-----------------------------.
1569
| yyreduce -- Do a reduction. |
1570
`-----------------------------*/
1572
/* yyn is the number of a rule to reduce with. */
1575
/* If YYLEN is nonzero, implement the default value of the action:
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];
1586
YY_REDUCE_PRINT (yyn);
1590
#line 154 "message_parser.y"
1592
unsigned int numData = 0, i;
1593
VIEWDATAMESSAGE* curMsg;
1594
VIEWDATA* psViewData;
1596
for (curMsg = (yyvsp[(1) - (1)].viewdatamsg); curMsg != NULL; curMsg = curMsg->psNext)
1601
ASSERT(numData <= UBYTE_MAX, "loadViewData: Didn't expect %d (or more) viewData messages (got %u)!", UBYTE_MAX, numData);
1602
if (numData > UBYTE_MAX)
1604
freeViewDataMessageList((yyvsp[(1) - (1)].viewdatamsg));
1608
psViewData = malloc(numData * sizeof(*psViewData));
1609
if (psViewData == NULL)
1611
debug(LOG_ERROR, "Out of memory");
1613
freeViewDataMessageList((yyvsp[(1) - (1)].viewdatamsg));
1617
curMsg = (yyvsp[(1) - (1)].viewdatamsg);
1618
for (i = 0; i < numData; ++i)
1620
VIEWDATAMESSAGE* const toMove = curMsg;
1621
assert(toMove != NULL);
1622
curMsg = curMsg->psNext;
1623
memcpy(&psViewData[i], &toMove->view, sizeof(psViewData[i]));
1627
addToViewDataList(psViewData, numData);
1628
*(VIEWDATA**)ppsViewData = psViewData;
1633
#line 197 "message_parser.y"
1635
(yyvsp[(1) - (2)].viewdatamsg)->psNext = (yyvsp[(2) - (2)].viewdatamsg);
1636
(yyval.viewdatamsg) = (yyvsp[(1) - (2)].viewdatamsg);
1641
#line 204 "message_parser.y"
1643
(yyval.viewdatamsg) = malloc(sizeof(*(yyval.viewdatamsg)));
1644
if ((yyval.viewdatamsg) == NULL)
1646
debug(LOG_ERROR, "Out of memory");
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));
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;
1666
#line 228 "message_parser.y"
1668
(yyval.researchdata) = malloc(sizeof(*(yyval.researchdata)));
1669
if ((yyval.researchdata) == NULL)
1671
debug(LOG_ERROR, "Out of memory");
1673
free((yyvsp[(1) - (8)].sval));
1674
free((yyvsp[(3) - (8)].sval));
1675
free((yyvsp[(5) - (8)].sval));
1676
free((yyvsp[(7) - (8)].sval));
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));
1685
(yyval.researchdata)->pIMD = (iIMDShape *) resGetData("IMD", (yyvsp[(1) - (8)].sval));
1686
if ((yyval.researchdata)->pIMD == NULL)
1688
ASSERT(LOG_ERROR, "Cannot find PIE \"%s\"", (yyvsp[(1) - (8)].sval));
1689
free((yyvsp[(1) - (8)].sval));
1690
free((yyvsp[(3) - (8)].sval));
1693
free((yyvsp[(1) - (8)].sval));
1695
if ((yyvsp[(3) - (8)].sval))
1697
(yyval.researchdata)->pIMD2 = (iIMDShape *) resGetData("IMD", (yyvsp[(3) - (8)].sval));
1698
if ((yyval.researchdata)->pIMD2 == NULL)
1700
ASSERT(false, "Cannot find 2nd PIE \"%s\"", (yyvsp[(3) - (8)].sval));
1701
free((yyvsp[(3) - (8)].sval));
1704
free((yyvsp[(3) - (8)].sval));
1708
(yyval.researchdata)->pIMD2 = NULL;
1714
#line 274 "message_parser.y"
1715
{ (yyval.sval) = (yyvsp[(3) - (3)].sval); }
1719
#line 278 "message_parser.y"
1720
{ (yyval.sval) = (yyvsp[(3) - (3)].sval); }
1724
#line 282 "message_parser.y"
1725
{ (yyval.sval) = (yyvsp[(3) - (3)].sval); }
1729
#line 286 "message_parser.y"
1730
{ (yyval.sval) = (yyvsp[(3) - (3)].sval); }
1734
#line 295 "message_parser.y"
1738
TEXT_MESSAGE* psCur;
1741
(yyval.msg_list).count = 0;
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)
1746
++(yyval.msg_list).count;
1747
bytes += sizeof(char*) + strlen(psCur->str) + 1;
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)
1756
if ((yyval.msg_list).count)
1758
(yyval.msg_list).stringArray = malloc(bytes);
1759
if ((yyval.msg_list).stringArray == NULL)
1761
debug(LOG_ERROR, "Out of memory");
1763
freeTextMessageList((yyvsp[(2) - (3)].txtmsg));
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)
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];
1779
(yyval.msg_list).stringArray = NULL;
1782
// Clean up our tokens
1783
freeTextMessageList((yyvsp[(2) - (3)].txtmsg));
1788
#line 351 "message_parser.y"
1790
(yyvsp[(1) - (3)].txtmsg)->psNext = (yyvsp[(3) - (3)].txtmsg);
1791
(yyval.txtmsg) = (yyvsp[(1) - (3)].txtmsg);
1796
#line 358 "message_parser.y"
1798
const char * const msg = strresGetString(psStringRes, (yyvsp[(1) - (1)].sval));
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));
1806
(yyval.txtmsg) = malloc(sizeof(*(yyval.txtmsg)));
1807
if ((yyval.txtmsg) == NULL)
1809
debug(LOG_ERROR, "Out of memory");
1811
free((yyvsp[(1) - (1)].sval));
1815
(yyval.txtmsg)->str = (yyvsp[(1) - (1)].sval);
1816
(yyval.txtmsg)->psNext = NULL;
1821
#line 380 "message_parser.y"
1823
(yyval.txtmsg) = malloc(sizeof(*(yyval.txtmsg)));
1824
if ((yyval.txtmsg) == NULL)
1826
debug(LOG_ERROR, "Out of memory");
1828
free((yyvsp[(1) - (1)].sval));
1832
(yyval.txtmsg)->str = (yyvsp[(1) - (1)].sval);
1833
(yyval.txtmsg)->psNext = NULL;
1838
#line 394 "message_parser.y"
1840
(yyval.txtmsg) = malloc(sizeof(*(yyval.txtmsg)));
1841
if ((yyval.txtmsg) == NULL)
1843
debug(LOG_ERROR, "Out of memory");
1845
free((yyvsp[(3) - (4)].sval));
1849
(yyval.txtmsg)->str = (yyvsp[(3) - (4)].sval);
1850
(yyval.txtmsg)->psNext = NULL;
1855
/* Line 1267 of yacc.c. */
1856
#line 1857 "message_parser.tab.c"
1859
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1863
YY_STACK_PRINT (yyss, yyssp);
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. */
1874
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1875
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1876
yystate = yytable[yystate];
1878
yystate = yydefgoto[yyn - YYNTOKENS];
1883
/*------------------------------------.
1884
| yyerrlab -- here on detecting error |
1885
`------------------------------------*/
1887
/* If not already recovering from an error, report this error. */
1891
#if ! YYERROR_VERBOSE
1892
yyerror (YY_("syntax error"));
1895
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1896
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
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);
1905
yymsg_alloc = yyalloc;
1909
yymsg_alloc = sizeof yymsgbuf;
1913
if (0 < yysize && yysize <= yymsg_alloc)
1915
(void) yysyntax_error (yymsg, yystate, yychar);
1920
yyerror (YY_("syntax error"));
1922
goto yyexhaustedlab;
1930
if (yyerrstatus == 3)
1932
/* If just tried and failed to reuse look-ahead token after an
1933
error, discard it. */
1935
if (yychar <= YYEOF)
1937
/* Return failure if at end of input. */
1938
if (yychar == YYEOF)
1943
yydestruct ("Error: discarding",
1949
/* Else will try to reuse look-ahead token after shifting the error
1954
/*---------------------------------------------------.
1955
| yyerrorlab -- error raised explicitly by YYERROR. |
1956
`---------------------------------------------------*/
1959
/* Pacify compilers like GCC when the user code never invokes
1960
YYERROR and the label yyerrorlab therefore never appears in user
1962
if (/*CONSTCOND*/ 0)
1965
/* Do not reclaim the symbols of the rule which action triggered
1969
YY_STACK_PRINT (yyss, yyssp);
1974
/*-------------------------------------------------------------.
1975
| yyerrlab1 -- common code for both syntax error and YYERROR. |
1976
`-------------------------------------------------------------*/
1978
yyerrstatus = 3; /* Each real token shifted decrements this. */
1982
yyn = yypact[yystate];
1983
if (yyn != YYPACT_NINF)
1986
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1994
/* Pop the current state because it cannot handle the error token. */
1999
yydestruct ("Error: popping",
2000
yystos[yystate], yyvsp);
2003
YY_STACK_PRINT (yyss, yyssp);
2012
/* Shift the error token. */
2013
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2019
/*-------------------------------------.
2020
| yyacceptlab -- YYACCEPT comes here. |
2021
`-------------------------------------*/
2026
/*-----------------------------------.
2027
| yyabortlab -- YYABORT comes here. |
2028
`-----------------------------------*/
2034
/*-------------------------------------------------.
2035
| yyexhaustedlab -- memory exhaustion comes here. |
2036
`-------------------------------------------------*/
2038
yyerror (YY_("memory exhausted"));
2044
if (yychar != YYEOF && yychar != YYEMPTY)
2045
yydestruct ("Cleanup: discarding lookahead",
2047
/* Do not reclaim the symbols of the rule which action triggered
2048
this YYABORT or YYACCEPT. */
2050
YY_STACK_PRINT (yyss, yyssp);
2051
while (yyssp != yyss)
2053
yydestruct ("Cleanup: popping",
2054
yystos[*yyssp], yyvsp);
2059
YYSTACK_FREE (yyss);
2062
if (yymsg != yymsgbuf)
2063
YYSTACK_FREE (yymsg);
2065
/* Make sure YYID is used. */
2066
return YYID (yyresult);