Coverage Report

Created: 2026-12-01 07:31

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libfvde/libfplist/libfplist_xml_parser.c
Line
Count
Source
1
/* original parser id follows */
2
/* yysccsid[] = "@(#)yaccpar  1.9 (Berkeley) 02/21/93" */
3
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
4
5
#define YYBYACC 1
6
#define YYMAJOR 2
7
#define YYMINOR 0
8
#define YYPATCH 20221106
9
10
4.49M
#define YYEMPTY        (-1)
11
#define yyclearin      (yychar = YYEMPTY)
12
#define yyerrok        (yyerrflag = 0)
13
#define YYRECOVERING() (yyerrflag != 0)
14
56
#define YYENOMEM       (-2)
15
5.72k
#define YYEOF          0
16
#undef YYBTYACC
17
#define YYBTYACC 0
18
#define YYDEBUGSTR YYPREFIX "debug"
19
20
#ifndef yyparse
21
#define yyparse    libfplist_xml_scanner_parse
22
#endif /* yyparse */
23
24
#ifndef yylex
25
4.49M
#define yylex      libfplist_xml_scanner_lex
26
#endif /* yylex */
27
28
#ifndef yyerror
29
3.18k
#define yyerror    libfplist_xml_scanner_error
30
#endif /* yyerror */
31
32
#ifndef yychar
33
36.3M
#define yychar     libfplist_xml_scanner_char
34
#endif /* yychar */
35
36
#ifndef yyval
37
17.2M
#define yyval      libfplist_xml_scanner_val
38
#endif /* yyval */
39
40
#ifndef yylval
41
4.48M
#define yylval     libfplist_xml_scanner_lval
42
#endif /* yylval */
43
44
#ifndef yydebug
45
#define yydebug    libfplist_xml_scanner_debug
46
#endif /* yydebug */
47
48
#ifndef yynerrs
49
13.0k
#define yynerrs    libfplist_xml_scanner_nerrs
50
#endif /* yynerrs */
51
52
#ifndef yyerrflag
53
4.50M
#define yyerrflag  libfplist_xml_scanner_errflag
54
#endif /* yyerrflag */
55
56
#ifndef yylhs
57
7.67M
#define yylhs      libfplist_xml_scanner_lhs
58
#endif /* yylhs */
59
60
#ifndef yylen
61
7.67M
#define yylen      libfplist_xml_scanner_len
62
#endif /* yylen */
63
64
#ifndef yydefred
65
12.1M
#define yydefred   libfplist_xml_scanner_defred
66
#endif /* yydefred */
67
68
#ifndef yystos
69
#define yystos     libfplist_xml_scanner_stos
70
#endif /* yystos */
71
72
#ifndef yydgoto
73
4.88M
#define yydgoto    libfplist_xml_scanner_dgoto
74
#endif /* yydgoto */
75
76
#ifndef yysindex
77
7.56M
#define yysindex   libfplist_xml_scanner_sindex
78
#endif /* yysindex */
79
80
#ifndef yyrindex
81
1.88M
#define yyrindex   libfplist_xml_scanner_rindex
82
#endif /* yyrindex */
83
84
#ifndef yygindex
85
7.66M
#define yygindex   libfplist_xml_scanner_gindex
86
#endif /* yygindex */
87
88
#ifndef yytable
89
13.6M
#define yytable    libfplist_xml_scanner_table
90
#endif /* yytable */
91
92
#ifndef yycheck
93
11.1M
#define yycheck    libfplist_xml_scanner_check
94
#endif /* yycheck */
95
96
#ifndef yyname
97
#define yyname     libfplist_xml_scanner_name
98
#endif /* yyname */
99
100
#ifndef yyrule
101
#define yyrule     libfplist_xml_scanner_rule
102
#endif /* yyrule */
103
104
#if YYBTYACC
105
106
#ifndef yycindex
107
#define yycindex   libfplist_xml_scanner_cindex
108
#endif /* yycindex */
109
110
#ifndef yyctable
111
#define yyctable   libfplist_xml_scanner_ctable
112
#endif /* yyctable */
113
114
#endif /* YYBTYACC */
115
116
#define YYPREFIX "libfplist_xml_scanner_"
117
118
#define YYPURE 0
119
120
/*
121
 * XML parser functions
122
 *
123
 * Copyright (C) 2016-2026, Joachim Metz <joachim.metz@gmail.com>
124
 *
125
 * Refer to AUTHORS for acknowledgements.
126
 *
127
 * This program is free software: you can redistribute it and/or modify
128
 * it under the terms of the GNU Lesser General Public License as published by
129
 * the Free Software Foundation, either version 3 of the License, or
130
 * (at your option) any later version.
131
 *
132
 * This program is distributed in the hope that it will be useful,
133
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
134
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
135
 * GNU General Public License for more details.
136
 *
137
 * You should have received a copy of the GNU Lesser General Public License
138
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
139
 */
140
141
#include <common.h>
142
#include <memory.h>
143
#include <narrow_string.h>
144
#include <types.h>
145
146
#if defined( HAVE_STDLIB_H ) || defined( WINAPI )
147
#include <stdlib.h>
148
#endif
149
150
#include "libfplist_libcerror.h"
151
#include "libfplist_libcnotify.h"
152
#include "libfplist_property_list.h"
153
#include "libfplist_types.h"
154
#include "libfplist_xml_tag.h"
155
156
#define YYMALLOC  libfplist_xml_scanner_alloc
157
#define YYREALLOC libfplist_xml_scanner_realloc
158
#define YYFREE    libfplist_xml_scanner_free
159
160
4.49M
#define YYLEX_PARAM NULL
161
#define YYPARSE_PARAM parser_state
162
163
#if defined( HAVE_DEBUG_OUTPUT )
164
#define libfplist_xml_parser_rule_print( string ) \
165
  if( libcnotify_verbose != 0 ) libcnotify_printf( "libfplist_xml_parser: rule: %s\n", string )
166
#else
167
#define libfplist_xml_parser_rule_print( string )
168
#endif
169
170
#ifdef YYSTYPE
171
#undef  YYSTYPE_IS_DECLARED
172
#define YYSTYPE_IS_DECLARED 1
173
#endif
174
#ifndef YYSTYPE_IS_DECLARED
175
#define YYSTYPE_IS_DECLARED 1
176
typedef union YYSTYPE
177
{
178
        /* The numeric value
179
         */
180
        uint32_t numeric_value;
181
182
        /* The string value
183
         */
184
  struct xml_plist_string_value
185
  {
186
    /* The string data
187
     */
188
          const char *data;
189
190
    /* The string length
191
     */
192
    size_t length;
193
194
  } string_value;
195
} YYSTYPE;
196
#endif /* !YYSTYPE_IS_DECLARED */
197
198
typedef struct libfplist_xml_parser_state libfplist_xml_parser_state_t;
199
200
struct libfplist_xml_parser_state
201
{
202
  /* The property list
203
   */
204
  libfplist_property_list_t *property_list;
205
206
  /* The error
207
   */
208
  libcerror_error_t **error;
209
210
  /* The root XML tag
211
   */
212
  libfplist_xml_tag_t *root_tag;
213
214
  /* The current XML tag
215
   */
216
  libfplist_xml_tag_t *current_tag;
217
218
  /* The parent XML tag
219
   */
220
  libfplist_xml_tag_t *parent_tag;
221
};
222
223
typedef size_t yy_size_t;
224
typedef struct yy_buffer_state* YY_BUFFER_STATE;
225
226
extern \
227
int libfplist_xml_scanner_suppress_error;
228
229
extern \
230
int libfplist_xml_scanner_lex_destroy(
231
     void );
232
233
extern \
234
void *libfplist_xml_scanner_alloc(
235
       yy_size_t size );
236
237
extern \
238
void *libfplist_xml_scanner_realloc(
239
       void *buffer,
240
       yy_size_t size );
241
242
extern \
243
void *libfplist_xml_scanner_free(
244
       void *buffer );
245
246
extern \
247
int libfplist_xml_scanner_lex(
248
     void *user_data );
249
250
extern \
251
void libfplist_xml_scanner_error(
252
      void *parser_state,
253
      const char *error_string );
254
255
extern \
256
YY_BUFFER_STATE libfplist_xml_scanner__scan_buffer(
257
                 char *buffer,
258
                 yy_size_t buffer_size );
259
260
extern \
261
void libfplist_xml_scanner__delete_buffer(
262
      YY_BUFFER_STATE buffer_state );
263
264
extern \
265
size_t libfplist_xml_scanner_buffer_offset;
266
267
static char *libfplist_xml_parser_function = "libfplist_xml_parser";
268
269
int libfplist_xml_parser_parse_buffer(
270
     libfplist_property_list_t *property_list,
271
     uint8_t *buffer,
272
     size_t buffer_size,
273
     libcerror_error_t **error );
274
275
276
/* compatibility with bison */
277
#ifdef YYPARSE_PARAM
278
/* compatibility with FreeBSD */
279
# ifdef YYPARSE_PARAM_TYPE
280
#  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
281
# else
282
#  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
283
# endif
284
#else
285
# define YYPARSE_DECL() yyparse(void *parser_state)
286
#endif
287
288
/* Parameters sent to lex. */
289
#ifdef YYLEX_PARAM
290
# define YYLEX_DECL() yylex(void *YYLEX_PARAM)
291
4.49M
# define YYLEX yylex(YYLEX_PARAM)
292
#else
293
# define YYLEX_DECL() yylex((void *) NULL)
294
# define YYLEX yylex(NULL)
295
#endif
296
297
/* Parameters sent to yyerror. */
298
#ifndef YYERROR_DECL
299
#define YYERROR_DECL() yyerror(void *parser_state, const char *s)
300
#endif
301
#ifndef YYERROR_CALL
302
3.18k
#define YYERROR_CALL(msg) yyerror(parser_state, msg)
303
#endif
304
305
extern int YYPARSE_DECL();
306
307
#define XML_ATTRIBUTE_ASSIGN 257
308
#define XML_COMMENT 258
309
#define XML_DOCTYPE 259
310
#define XML_PROLOGUE 260
311
#define XML_TAG_END 261
312
#define XML_TAG_END_SINGLE 262
313
#define XML_UNDEFINED 263
314
#define XML_ATTRIBUTE_NAME 264
315
#define XML_ATTRIBUTE_VALUE 265
316
#define XML_TAG_CLOSE 266
317
#define XML_TAG_CONTENT 267
318
#define XML_TAG_OPEN_START 268
319
1.26M
#define YYERRCODE 256
320
typedef int YYINT;
321
static const YYINT libfplist_xml_scanner_lhs[] = {       -1,
322
    0,    1,    1,    2,    2,    4,    4,    6,    6,    6,
323
    9,    3,    8,    5,    7,   10,   10,   11,
324
};
325
static const YYINT libfplist_xml_scanner_len[] = {        2,
326
    5,    0,    1,    0,    1,    0,    2,    3,    3,    1,
327
    1,    3,    3,    1,    1,    0,    2,    3,
328
};
329
static const YYINT libfplist_xml_scanner_defred[] = {     0,
330
    3,    0,    0,    5,    0,   11,    0,    0,    0,    0,
331
    0,   10,    0,    0,    0,    0,   15,    0,    0,   14,
332
    1,    7,    0,    0,   12,   17,    8,    9,   13,   18,
333
};
334
#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING)
335
static const YYINT libfplist_xml_scanner_stos[] = {       0,
336
  260,  270,  271,  259,  272,  268,  273,  279,  273,  274,
337
  276,  278,  279,  264,  280,  281,  267,  274,  277,  266,
338
  275,  274,  280,  257,  261,  280,  275,  275,  262,  265,
339
};
340
#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */
341
static const YYINT libfplist_xml_scanner_dgoto[] = {      2,
342
    3,    5,    9,   10,   21,   11,   19,   12,   13,   15,
343
   16,
344
};
345
static const YYINT libfplist_xml_scanner_sindex[] = {  -258,
346
    0,    0, -243,    0, -260,    0, -260, -247, -261, -248,
347
 -260,    0, -247, -238, -241, -247,    0, -248, -248,    0,
348
    0,    0, -251, -244,    0,    0,    0,    0,    0,    0,
349
};
350
static const YYINT libfplist_xml_scanner_rindex[] = {  -259,
351
    0,    0, -246,    0,    0,    0, -242, -236, -242,    0,
352
 -242,    0, -249,    0,    0, -249,    0,    0,    0,    0,
353
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
354
};
355
#if YYBTYACC
356
static const YYINT libfplist_xml_scanner_cindex[] = {     0,
357
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
358
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
359
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
360
};
361
#endif
362
static const YYINT libfplist_xml_scanner_gindex[] = {     0,
363
    0,    0,   18,   -6,   -4,    0,    0,    0,   21,  -12,
364
    0,
365
};
366
31.3M
#define YYTABLESIZE 26
367
static const YYINT libfplist_xml_scanner_table[] = {      2,
368
   23,    1,   18,   26,   22,   17,    6,    6,    2,   25,
369
   29,   16,   16,   27,   28,    4,   14,   20,   24,   25,
370
   30,    4,    7,    6,   16,    8,
371
};
372
static const YYINT libfplist_xml_scanner_check[] = {    259,
373
   13,  260,    9,   16,   11,  267,  268,  268,  268,  261,
374
  262,  261,  262,   18,   19,  259,  264,  266,  257,  261,
375
  265,  268,    5,  266,  261,    5,
376
};
377
#if YYBTYACC
378
static const YYINT libfplist_xml_scanner_ctable[] = {    -1,
379
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
380
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
381
   -1,   -1,   -1,   -1,   -1,
382
};
383
#endif
384
11.4k
#define YYFINAL 2
385
#ifndef YYDEBUG
386
#define YYDEBUG 0
387
#endif
388
#define YYMAXTOKEN 268
389
#define YYUNDFTOKEN 282
390
#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
391
#if YYDEBUG
392
static const char *const libfplist_xml_scanner_name[] = {
393
394
"$end",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
395
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
396
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
397
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
398
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
399
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
400
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"error","XML_ATTRIBUTE_ASSIGN",
401
"XML_COMMENT","XML_DOCTYPE","XML_PROLOGUE","XML_TAG_END","XML_TAG_END_SINGLE",
402
"XML_UNDEFINED","XML_ATTRIBUTE_NAME","XML_ATTRIBUTE_VALUE","XML_TAG_CLOSE",
403
"XML_TAG_CONTENT","XML_TAG_OPEN_START","$accept","xml_plist_main",
404
"xml_prologue","xml_doctype","xml_tag_open","xml_tags","xml_tag_close",
405
"xml_tag","xml_tag_content","xml_tag_single","xml_tag_open_start",
406
"xml_attributes","xml_attribute","illegal-symbol",
407
};
408
static const char *const libfplist_xml_scanner_rule[] = {
409
"$accept : xml_plist_main",
410
"xml_plist_main : xml_prologue xml_doctype xml_tag_open xml_tags xml_tag_close",
411
"xml_prologue :",
412
"xml_prologue : XML_PROLOGUE",
413
"xml_doctype :",
414
"xml_doctype : XML_DOCTYPE",
415
"xml_tags :",
416
"xml_tags : xml_tag xml_tags",
417
"xml_tag : xml_tag_open xml_tags xml_tag_close",
418
"xml_tag : xml_tag_open xml_tag_content xml_tag_close",
419
"xml_tag : xml_tag_single",
420
"xml_tag_open_start : XML_TAG_OPEN_START",
421
"xml_tag_open : xml_tag_open_start xml_attributes XML_TAG_END",
422
"xml_tag_single : xml_tag_open_start xml_attributes XML_TAG_END_SINGLE",
423
"xml_tag_close : XML_TAG_CLOSE",
424
"xml_tag_content : XML_TAG_CONTENT",
425
"xml_attributes :",
426
"xml_attributes : xml_attribute xml_attributes",
427
"xml_attribute : XML_ATTRIBUTE_NAME XML_ATTRIBUTE_ASSIGN XML_ATTRIBUTE_VALUE",
428
429
};
430
#endif
431
432
#if YYDEBUG
433
int      yydebug;
434
#endif
435
436
int      yyerrflag;
437
int      yychar;
438
YYSTYPE  yyval;
439
YYSTYPE  yylval;
440
int      yynerrs;
441
442
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
443
YYLTYPE  yyloc; /* position returned by actions */
444
YYLTYPE  yylloc; /* position from the lexer */
445
#endif
446
447
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
448
#ifndef YYLLOC_DEFAULT
449
#define YYLLOC_DEFAULT(loc, rhs, n) \
450
do \
451
{ \
452
    if (n == 0) \
453
    { \
454
        (loc).first_line   = YYRHSLOC(rhs, 0).last_line; \
455
        (loc).first_column = YYRHSLOC(rhs, 0).last_column; \
456
        (loc).last_line    = YYRHSLOC(rhs, 0).last_line; \
457
        (loc).last_column  = YYRHSLOC(rhs, 0).last_column; \
458
    } \
459
    else \
460
    { \
461
        (loc).first_line   = YYRHSLOC(rhs, 1).first_line; \
462
        (loc).first_column = YYRHSLOC(rhs, 1).first_column; \
463
        (loc).last_line    = YYRHSLOC(rhs, n).last_line; \
464
        (loc).last_column  = YYRHSLOC(rhs, n).last_column; \
465
    } \
466
} while (0)
467
#endif /* YYLLOC_DEFAULT */
468
#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
469
#if YYBTYACC
470
471
#ifndef YYLVQUEUEGROWTH
472
#define YYLVQUEUEGROWTH 32
473
#endif
474
#endif /* YYBTYACC */
475
476
/* define the initial stack-sizes */
477
#ifdef YYSTACKSIZE
478
#undef YYMAXDEPTH
479
#define YYMAXDEPTH  YYSTACKSIZE
480
#else
481
#ifdef YYMAXDEPTH
482
#define YYSTACKSIZE YYMAXDEPTH
483
#else
484
#define YYSTACKSIZE 10000
485
85
#define YYMAXDEPTH  10000
486
#endif
487
#endif
488
489
#ifndef YYINITSTACKSIZE
490
6
#define YYINITSTACKSIZE 200
491
#endif
492
493
typedef struct {
494
    unsigned stacksize;
495
    YYINT    *s_base;
496
    YYINT    *s_mark;
497
    YYINT    *s_last;
498
    YYSTYPE  *l_base;
499
    YYSTYPE  *l_mark;
500
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
501
    YYLTYPE  *p_base;
502
    YYLTYPE  *p_mark;
503
#endif
504
} YYSTACKDATA;
505
#if YYBTYACC
506
507
struct YYParseState_s
508
{
509
    struct YYParseState_s *save;    /* Previously saved parser state */
510
    YYSTACKDATA            yystack; /* saved parser stack */
511
    int                    state;   /* saved parser state */
512
    int                    errflag; /* saved error recovery status */
513
    int                    lexeme;  /* saved index of the conflict lexeme in the lexical queue */
514
    YYINT                  ctry;    /* saved index in yyctable[] for this conflict */
515
};
516
typedef struct YYParseState_s YYParseState;
517
#endif /* YYBTYACC */
518
/* variables for the parser stack */
519
static YYSTACKDATA yystack;
520
#if YYBTYACC
521
522
/* Current parser state */
523
static YYParseState *yyps = 0;
524
525
/* yypath != NULL: do the full parse, starting at *yypath parser state. */
526
static YYParseState *yypath = 0;
527
528
/* Base of the lexical value queue */
529
static YYSTYPE *yylvals = 0;
530
531
/* Current position at lexical value queue */
532
static YYSTYPE *yylvp = 0;
533
534
/* End position of lexical value queue */
535
static YYSTYPE *yylve = 0;
536
537
/* The last allocated position at the lexical value queue */
538
static YYSTYPE *yylvlim = 0;
539
540
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
541
/* Base of the lexical position queue */
542
static YYLTYPE *yylpsns = 0;
543
544
/* Current position at lexical position queue */
545
static YYLTYPE *yylpp = 0;
546
547
/* End position of lexical position queue */
548
static YYLTYPE *yylpe = 0;
549
550
/* The last allocated position at the lexical position queue */
551
static YYLTYPE *yylplim = 0;
552
#endif
553
554
/* Current position at lexical token queue */
555
static YYINT  *yylexp = 0;
556
557
static YYINT  *yylexemes = 0;
558
#endif /* YYBTYACC */
559
560
int libfplist_xml_parser_parse_buffer(
561
     libfplist_property_list_t *property_list,
562
     uint8_t *buffer,
563
     size_t buffer_size,
564
     libcerror_error_t **error )
565
9.91k
{
566
9.91k
  libfplist_xml_parser_state_t parser_state;
567
  
568
9.91k
  YY_BUFFER_STATE buffer_state = NULL;
569
9.91k
  static char *function        = "libfplist_xml_parser_parse_buffer";
570
9.91k
  int result                   = -1;
571
572
9.91k
  if( buffer == NULL )
573
0
  {
574
0
    libcerror_error_set(
575
0
     error,
576
0
     LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
577
0
     LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
578
0
     "%s: invalid buffer.",
579
0
     function );
580
581
0
    return( -1 );
582
0
  }
583
9.91k
  buffer_state = libfplist_xml_scanner__scan_buffer(
584
9.91k
                  (char *) buffer,
585
9.91k
                  buffer_size );
586
587
9.91k
  libfplist_xml_scanner_buffer_offset = 0;
588
589
9.91k
  if( buffer_state != NULL )
590
9.91k
  {
591
9.91k
    parser_state.property_list = property_list;
592
9.91k
    parser_state.error         = error;
593
9.91k
    parser_state.root_tag      = NULL;
594
9.91k
    parser_state.current_tag   = NULL;
595
9.91k
    parser_state.parent_tag    = NULL;
596
597
9.91k
    if( libfplist_xml_scanner_parse(
598
9.91k
         &parser_state ) == 0 )
599
5.65k
    {
600
5.65k
      if( libfplist_property_list_set_root_tag(
601
5.65k
           property_list,
602
5.65k
           parser_state.root_tag,
603
5.65k
           error ) != 1 )
604
0
      {
605
0
        libcerror_error_set(
606
0
         error,
607
0
         LIBCERROR_ERROR_DOMAIN_RUNTIME,
608
0
         LIBCERROR_RUNTIME_ERROR_GET_FAILED,
609
0
         "%s: unable to set root tag.",
610
0
         function );
611
612
0
        result = -1;
613
0
      }
614
5.65k
      else
615
5.65k
      {
616
5.65k
        parser_state.root_tag = NULL;
617
618
5.65k
        result = 1;
619
5.65k
      }
620
5.65k
    }
621
9.91k
    libfplist_xml_scanner__delete_buffer(
622
9.91k
     buffer_state );
623
9.91k
  }
624
9.91k
  libfplist_xml_scanner_lex_destroy();
625
626
9.91k
  if( parser_state.root_tag != NULL )
627
3.46k
  {
628
3.46k
    libfplist_xml_tag_free(
629
3.46k
     &( parser_state.root_tag ),
630
3.46k
     NULL );
631
3.46k
  }
632
9.91k
  return( result );
633
9.91k
}
634
635
636
/* For use in generated program */
637
#define yydepth (int)(yystack.s_mark - yystack.s_base)
638
#if YYBTYACC
639
#define yytrial (yyps->save)
640
#endif /* YYBTYACC */
641
642
#if YYDEBUG
643
#include <stdio.h>  /* needed for printf */
644
#endif
645
646
#include <stdlib.h> /* needed for malloc, etc */
647
#include <string.h> /* needed for memset */
648
649
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
650
static int yygrowstack(YYSTACKDATA *data)
651
49
{
652
49
    int i;
653
49
    unsigned newsize;
654
49
    YYINT *newss;
655
49
    YYSTYPE *newvs;
656
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
657
    YYLTYPE *newps;
658
#endif
659
660
49
    if ((newsize = data->stacksize) == 0)
661
6
        newsize = YYINITSTACKSIZE;
662
43
    else if (newsize >= YYMAXDEPTH)
663
7
        return YYENOMEM;
664
36
    else if ((newsize *= 2) > YYMAXDEPTH)
665
6
        newsize = YYMAXDEPTH;
666
667
42
    i = (int) (data->s_mark - data->s_base);
668
42
    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
669
42
    if (newss == 0)
670
0
        return YYENOMEM;
671
672
42
    data->s_base = newss;
673
42
    data->s_mark = newss + i;
674
675
42
    newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
676
42
    if (newvs == 0)
677
0
        return YYENOMEM;
678
679
42
    data->l_base = newvs;
680
42
    data->l_mark = newvs + i;
681
682
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
683
    newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
684
    if (newps == 0)
685
        return YYENOMEM;
686
687
    data->p_base = newps;
688
    data->p_mark = newps + i;
689
#endif
690
691
42
    data->stacksize = newsize;
692
42
    data->s_last = data->s_base + newsize - 1;
693
694
#if YYDEBUG
695
    if (yydebug)
696
        fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
697
#endif
698
42
    return 0;
699
42
}
700
701
#if YYPURE || defined(YY_NO_LEAKS)
702
static void yyfreestack(YYSTACKDATA *data)
703
{
704
    free(data->s_base);
705
    free(data->l_base);
706
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
707
    free(data->p_base);
708
#endif
709
    memset(data, 0, sizeof(*data));
710
}
711
#else
712
#define yyfreestack(data) /* nothing */
713
#endif /* YYPURE || defined(YY_NO_LEAKS) */
714
#if YYBTYACC
715
716
static YYParseState *
717
yyNewState(unsigned size)
718
{
719
    YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
720
    if (p == NULL) return NULL;
721
722
    p->yystack.stacksize = size;
723
    if (size == 0)
724
    {
725
        p->yystack.s_base = NULL;
726
        p->yystack.l_base = NULL;
727
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
728
        p->yystack.p_base = NULL;
729
#endif
730
        return p;
731
    }
732
    p->yystack.s_base    = (YYINT *) malloc(size * sizeof(YYINT));
733
    if (p->yystack.s_base == NULL) return NULL;
734
    p->yystack.l_base    = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
735
    if (p->yystack.l_base == NULL) return NULL;
736
    memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
737
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
738
    p->yystack.p_base    = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
739
    if (p->yystack.p_base == NULL) return NULL;
740
    memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
741
#endif
742
743
    return p;
744
}
745
746
static void
747
yyFreeState(YYParseState *p)
748
{
749
    yyfreestack(&p->yystack);
750
    free(p);
751
}
752
#endif /* YYBTYACC */
753
754
1.07k
#define YYABORT  goto yyabort
755
#define YYREJECT goto yyabort
756
#define YYACCEPT goto yyaccept
757
#define YYERROR  goto yyerrlab
758
#if YYBTYACC
759
#define YYVALID        do { if (yyps->save)            goto yyvalid; } while(0)
760
#define YYVALID_NESTED do { if (yyps->save && \
761
                                yyps->save->save == 0) goto yyvalid; } while(0)
762
#endif /* YYBTYACC */
763
764
int
765
YYPARSE_DECL()
766
9.91k
{
767
9.91k
    int yym, yyn, yystate, yyresult;
768
#if YYBTYACC
769
    int yynewerrflag;
770
    YYParseState *yyerrctx = NULL;
771
#endif /* YYBTYACC */
772
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
773
    YYLTYPE  yyerror_loc_range[3]; /* position of error start/end (0 unused) */
774
#endif
775
#if YYDEBUG
776
    const char *yys;
777
778
    if ((yys = getenv("YYDEBUG")) != 0)
779
    {
780
        yyn = *yys;
781
        if (yyn >= '0' && yyn <= '9')
782
            yydebug = yyn - '0';
783
    }
784
    if (yydebug)
785
        fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
786
#endif
787
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
788
    memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range));
789
#endif
790
791
#if YYBTYACC
792
    yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
793
    yyps->save = 0;
794
#endif /* YYBTYACC */
795
9.91k
    yym = 0;
796
    /* yyn is set below */
797
9.91k
    yynerrs = 0;
798
9.91k
    yyerrflag = 0;
799
9.91k
    yychar = YYEMPTY;
800
9.91k
    yystate = 0;
801
802
#if YYPURE
803
    memset(&yystack, 0, sizeof(yystack));
804
#endif
805
806
9.91k
    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
807
9.91k
    yystack.s_mark = yystack.s_base;
808
9.91k
    yystack.l_mark = yystack.l_base;
809
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
810
    yystack.p_mark = yystack.p_base;
811
#endif
812
9.91k
    yystate = 0;
813
9.91k
    *yystack.s_mark = 0;
814
815
12.1M
yyloop:
816
12.1M
    if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
817
6.37M
    if (yychar < 0)
818
4.48M
    {
819
#if YYBTYACC
820
        do {
821
        if (yylvp < yylve)
822
        {
823
            /* we're currently re-reading tokens */
824
            yylval = *yylvp++;
825
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
826
            yylloc = *yylpp++;
827
#endif
828
            yychar = *yylexp++;
829
            break;
830
        }
831
        if (yyps->save)
832
        {
833
            /* in trial mode; save scanner results for future parse attempts */
834
            if (yylvp == yylvlim)
835
            {   /* Enlarge lexical value queue */
836
                size_t p = (size_t) (yylvp - yylvals);
837
                size_t s = (size_t) (yylvlim - yylvals);
838
839
                s += YYLVQUEUEGROWTH;
840
                if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;
841
                if ((yylvals   = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
842
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
843
                if ((yylpsns   = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
844
#endif
845
                yylvp   = yylve = yylvals + p;
846
                yylvlim = yylvals + s;
847
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
848
                yylpp   = yylpe = yylpsns + p;
849
                yylplim = yylpsns + s;
850
#endif
851
                yylexp  = yylexemes + p;
852
            }
853
            *yylexp = (YYINT) YYLEX;
854
            *yylvp++ = yylval;
855
            yylve++;
856
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
857
            *yylpp++ = yylloc;
858
            yylpe++;
859
#endif
860
            yychar = *yylexp++;
861
            break;
862
        }
863
        /* normal operation, no conflict encountered */
864
#endif /* YYBTYACC */
865
4.48M
        yychar = YYLEX;
866
#if YYBTYACC
867
        } while (0);
868
#endif /* YYBTYACC */
869
4.48M
        if (yychar < 0) yychar = YYEOF;
870
#if YYDEBUG
871
        if (yydebug)
872
        {
873
            if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
874
            fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
875
                            YYDEBUGSTR, yydepth, yystate, yychar, yys);
876
#ifdef YYSTYPE_TOSTRING
877
#if YYBTYACC
878
            if (!yytrial)
879
#endif /* YYBTYACC */
880
                fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
881
#endif
882
            fputc('\n', stderr);
883
        }
884
#endif
885
4.48M
    }
886
#if YYBTYACC
887
888
    /* Do we have a conflict? */
889
    if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
890
        yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
891
    {
892
        YYINT ctry;
893
894
        if (yypath)
895
        {
896
            YYParseState *save;
897
#if YYDEBUG
898
            if (yydebug)
899
                fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
900
                                YYDEBUGSTR, yydepth, yystate);
901
#endif
902
            /* Switch to the next conflict context */
903
            save = yypath;
904
            yypath = save->save;
905
            save->save = NULL;
906
            ctry = save->ctry;
907
            if (save->state != yystate) YYABORT;
908
            yyFreeState(save);
909
910
        }
911
        else
912
        {
913
914
            /* Unresolved conflict - start/continue trial parse */
915
            YYParseState *save;
916
#if YYDEBUG
917
            if (yydebug)
918
            {
919
                fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
920
                if (yyps->save)
921
                    fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
922
                else
923
                    fputs("Starting trial parse.\n", stderr);
924
            }
925
#endif
926
            save                  = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
927
            if (save == NULL) goto yyenomem;
928
            save->save            = yyps->save;
929
            save->state           = yystate;
930
            save->errflag         = yyerrflag;
931
            save->yystack.s_mark  = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
932
            memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
933
            save->yystack.l_mark  = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
934
            memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
935
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
936
            save->yystack.p_mark  = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
937
            memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
938
#endif
939
            ctry                  = yytable[yyn];
940
            if (yyctable[ctry] == -1)
941
            {
942
#if YYDEBUG
943
                if (yydebug && yychar >= YYEOF)
944
                    fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
945
#endif
946
                ctry++;
947
            }
948
            save->ctry = ctry;
949
            if (yyps->save == NULL)
950
            {
951
                /* If this is a first conflict in the stack, start saving lexemes */
952
                if (!yylexemes)
953
                {
954
                    yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));
955
                    if (yylexemes == NULL) goto yyenomem;
956
                    yylvals   = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
957
                    if (yylvals == NULL) goto yyenomem;
958
                    yylvlim   = yylvals + YYLVQUEUEGROWTH;
959
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
960
                    yylpsns   = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
961
                    if (yylpsns == NULL) goto yyenomem;
962
                    yylplim   = yylpsns + YYLVQUEUEGROWTH;
963
#endif
964
                }
965
                if (yylvp == yylve)
966
                {
967
                    yylvp  = yylve = yylvals;
968
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
969
                    yylpp  = yylpe = yylpsns;
970
#endif
971
                    yylexp = yylexemes;
972
                    if (yychar >= YYEOF)
973
                    {
974
                        *yylve++ = yylval;
975
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
976
                        *yylpe++ = yylloc;
977
#endif
978
                        *yylexp  = (YYINT) yychar;
979
                        yychar   = YYEMPTY;
980
                    }
981
                }
982
            }
983
            if (yychar >= YYEOF)
984
            {
985
                yylvp--;
986
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
987
                yylpp--;
988
#endif
989
                yylexp--;
990
                yychar = YYEMPTY;
991
            }
992
            save->lexeme = (int) (yylvp - yylvals);
993
            yyps->save   = save;
994
        }
995
        if (yytable[yyn] == ctry)
996
        {
997
#if YYDEBUG
998
            if (yydebug)
999
                fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1000
                                YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
1001
#endif
1002
            if (yychar < 0)
1003
            {
1004
                yylvp++;
1005
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1006
                yylpp++;
1007
#endif
1008
                yylexp++;
1009
            }
1010
            if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
1011
                goto yyoverflow;
1012
            yystate = yyctable[ctry];
1013
            *++yystack.s_mark = (YYINT) yystate;
1014
            *++yystack.l_mark = yylval;
1015
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1016
            *++yystack.p_mark = yylloc;
1017
#endif
1018
            yychar  = YYEMPTY;
1019
            if (yyerrflag > 0) --yyerrflag;
1020
            goto yyloop;
1021
        }
1022
        else
1023
        {
1024
            yyn = yyctable[ctry];
1025
            goto yyreduce;
1026
        }
1027
    } /* End of code dealing with conflicts */
1028
#endif /* YYBTYACC */
1029
6.37M
    if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1030
6.37M
            yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1031
4.48M
    {
1032
#if YYDEBUG
1033
        if (yydebug)
1034
            fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1035
                            YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
1036
#endif
1037
4.48M
        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1038
4.48M
        yystate = yytable[yyn];
1039
4.48M
        *++yystack.s_mark = yytable[yyn];
1040
4.48M
        *++yystack.l_mark = yylval;
1041
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1042
        *++yystack.p_mark = yylloc;
1043
#endif
1044
4.48M
        yychar = YYEMPTY;
1045
4.48M
        if (yyerrflag > 0)  --yyerrflag;
1046
4.48M
        goto yyloop;
1047
4.48M
    }
1048
1.88M
    if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1049
1.88M
            yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1050
1.88M
    {
1051
1.88M
        yyn = yytable[yyn];
1052
1.88M
        goto yyreduce;
1053
1.88M
    }
1054
3.17k
    if (yyerrflag != 0) goto yyinrecovery;
1055
#if YYBTYACC
1056
1057
    yynewerrflag = 1;
1058
    goto yyerrhandler;
1059
    goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1060
1061
yyerrlab:
1062
    /* explicit YYERROR from an action -- pop the rhs of the rule reduced
1063
     * before looking for error recovery */
1064
    yystack.s_mark -= yym;
1065
    yystate = *yystack.s_mark;
1066
    yystack.l_mark -= yym;
1067
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1068
    yystack.p_mark -= yym;
1069
#endif
1070
1071
    yynewerrflag = 0;
1072
yyerrhandler:
1073
    while (yyps->save)
1074
    {
1075
        int ctry;
1076
        YYParseState *save = yyps->save;
1077
#if YYDEBUG
1078
        if (yydebug)
1079
            fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
1080
                            YYDEBUGSTR, yydepth, yystate, yyps->save->state,
1081
                    (int)(yylvp - yylvals - yyps->save->lexeme));
1082
#endif
1083
        /* Memorize most forward-looking error state in case it's really an error. */
1084
        if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
1085
        {
1086
            /* Free old saved error context state */
1087
            if (yyerrctx) yyFreeState(yyerrctx);
1088
            /* Create and fill out new saved error context state */
1089
            yyerrctx                 = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1090
            if (yyerrctx == NULL) goto yyenomem;
1091
            yyerrctx->save           = yyps->save;
1092
            yyerrctx->state          = yystate;
1093
            yyerrctx->errflag        = yyerrflag;
1094
            yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
1095
            memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1096
            yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
1097
            memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1098
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1099
            yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
1100
            memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1101
#endif
1102
            yyerrctx->lexeme         = (int) (yylvp - yylvals);
1103
        }
1104
        yylvp          = yylvals   + save->lexeme;
1105
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1106
        yylpp          = yylpsns   + save->lexeme;
1107
#endif
1108
        yylexp         = yylexemes + save->lexeme;
1109
        yychar         = YYEMPTY;
1110
        yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1111
        memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1112
        yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
1113
        memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1114
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1115
        yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
1116
        memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1117
#endif
1118
        ctry           = ++save->ctry;
1119
        yystate        = save->state;
1120
        /* We tried shift, try reduce now */
1121
        if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
1122
        yyps->save     = save->save;
1123
        save->save     = NULL;
1124
        yyFreeState(save);
1125
1126
        /* Nothing left on the stack -- error */
1127
        if (!yyps->save)
1128
        {
1129
#if YYDEBUG
1130
            if (yydebug)
1131
                fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
1132
                                YYPREFIX, yydepth);
1133
#endif
1134
            /* Restore state as it was in the most forward-advanced error */
1135
            yylvp          = yylvals   + yyerrctx->lexeme;
1136
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1137
            yylpp          = yylpsns   + yyerrctx->lexeme;
1138
#endif
1139
            yylexp         = yylexemes + yyerrctx->lexeme;
1140
            yychar         = yylexp[-1];
1141
            yylval         = yylvp[-1];
1142
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1143
            yylloc         = yylpp[-1];
1144
#endif
1145
            yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1146
            memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1147
            yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
1148
            memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1149
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1150
            yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
1151
            memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1152
#endif
1153
            yystate        = yyerrctx->state;
1154
            yyFreeState(yyerrctx);
1155
            yyerrctx       = NULL;
1156
        }
1157
        yynewerrflag = 1;
1158
    }
1159
    if (yynewerrflag == 0) goto yyinrecovery;
1160
#endif /* YYBTYACC */
1161
1162
3.17k
    YYERROR_CALL("syntax error");
1163
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1164
    yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */
1165
#endif
1166
1167
3.17k
#if !YYBTYACC
1168
3.17k
    goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1169
3.17k
yyerrlab:
1170
3.17k
#endif
1171
3.17k
    ++yynerrs;
1172
1173
3.17k
yyinrecovery:
1174
3.17k
    if (yyerrflag < 3)
1175
3.17k
    {
1176
3.17k
        yyerrflag = 3;
1177
3.17k
        for (;;)
1178
1.19M
        {
1179
1.19M
            if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
1180
69.8k
                    yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
1181
0
            {
1182
#if YYDEBUG
1183
                if (yydebug)
1184
                    fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
1185
                                    YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
1186
#endif
1187
0
                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1188
0
                yystate = yytable[yyn];
1189
0
                *++yystack.s_mark = yytable[yyn];
1190
0
                *++yystack.l_mark = yylval;
1191
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1192
                /* lookahead position is error end position */
1193
                yyerror_loc_range[2] = yylloc;
1194
                YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
1195
                *++yystack.p_mark = yyloc;
1196
#endif
1197
0
                goto yyloop;
1198
0
            }
1199
1.19M
            else
1200
1.19M
            {
1201
#if YYDEBUG
1202
                if (yydebug)
1203
                    fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
1204
                                    YYDEBUGSTR, yydepth, *yystack.s_mark);
1205
#endif
1206
1.19M
                if (yystack.s_mark <= yystack.s_base) goto yyabort;
1207
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1208
                /* the current TOS position is the error start position */
1209
                yyerror_loc_range[1] = *yystack.p_mark;
1210
#endif
1211
#if defined(YYDESTRUCT_CALL)
1212
#if YYBTYACC
1213
                if (!yytrial)
1214
#endif /* YYBTYACC */
1215
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1216
                    YYDESTRUCT_CALL("error: discarding state",
1217
                                    yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
1218
#else
1219
                    YYDESTRUCT_CALL("error: discarding state",
1220
                                    yystos[*yystack.s_mark], yystack.l_mark);
1221
#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1222
#endif /* defined(YYDESTRUCT_CALL) */
1223
1.19M
                --yystack.s_mark;
1224
1.19M
                --yystack.l_mark;
1225
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1226
                --yystack.p_mark;
1227
#endif
1228
1.19M
            }
1229
1.19M
        }
1230
3.17k
    }
1231
0
    else
1232
0
    {
1233
0
        if (yychar == YYEOF) goto yyabort;
1234
#if YYDEBUG
1235
        if (yydebug)
1236
        {
1237
            if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1238
            fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
1239
                            YYDEBUGSTR, yydepth, yystate, yychar, yys);
1240
        }
1241
#endif
1242
#if defined(YYDESTRUCT_CALL)
1243
#if YYBTYACC
1244
        if (!yytrial)
1245
#endif /* YYBTYACC */
1246
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1247
            YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
1248
#else
1249
            YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
1250
#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1251
#endif /* defined(YYDESTRUCT_CALL) */
1252
0
        yychar = YYEMPTY;
1253
0
        goto yyloop;
1254
0
    }
1255
1256
7.67M
yyreduce:
1257
7.67M
    yym = yylen[yyn];
1258
#if YYDEBUG
1259
    if (yydebug)
1260
    {
1261
        fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
1262
                        YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
1263
#ifdef YYSTYPE_TOSTRING
1264
#if YYBTYACC
1265
        if (!yytrial)
1266
#endif /* YYBTYACC */
1267
            if (yym > 0)
1268
            {
1269
                int i;
1270
                fputc('<', stderr);
1271
                for (i = yym; i > 0; i--)
1272
                {
1273
                    if (i != yym) fputs(", ", stderr);
1274
                    fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
1275
                                           yystack.l_mark[1-i]), stderr);
1276
                }
1277
                fputc('>', stderr);
1278
            }
1279
#endif
1280
        fputc('\n', stderr);
1281
    }
1282
#endif
1283
7.67M
    if (yym > 0)
1284
5.79M
        yyval = yystack.l_mark[1-yym];
1285
1.88M
    else
1286
1.88M
        memset(&yyval, 0, sizeof yyval);
1287
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1288
1289
    /* Perform position reduction */
1290
    memset(&yyloc, 0, sizeof(yyloc));
1291
#if YYBTYACC
1292
    if (!yytrial)
1293
#endif /* YYBTYACC */
1294
    {
1295
        YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym);
1296
        /* just in case YYERROR is invoked within the action, save
1297
           the start of the rhs as the error start position */
1298
        yyerror_loc_range[1] = yystack.p_mark[1-yym];
1299
    }
1300
#endif
1301
1302
7.67M
    switch (yyn)
1303
7.67M
    {
1304
1.83M
case 11:
1305
1.83M
  {
1306
1.83M
    libfplist_xml_parser_rule_print(
1307
1.83M
     "xml_tag_open_start" );
1308
1309
1.83M
    if( yystack.l_mark[0].string_value.data == NULL )
1310
0
    {
1311
0
      libcerror_error_set(
1312
0
       ( (libfplist_xml_parser_state_t *) parser_state )->error,
1313
0
       LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
1314
0
       LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
1315
0
       "%s: invalid tag name.",
1316
0
       libfplist_xml_parser_function );
1317
1318
0
      YYABORT;
1319
0
    }
1320
1.83M
    ( (libfplist_xml_parser_state_t *) parser_state )->current_tag = NULL;
1321
1322
1.83M
    if( libfplist_xml_tag_initialize(
1323
1.83M
         &( ( (libfplist_xml_parser_state_t *) parser_state )->current_tag ),
1324
1.83M
         (uint8_t *) yystack.l_mark[0].string_value.data,
1325
1.83M
         yystack.l_mark[0].string_value.length,
1326
1.83M
         ( (libfplist_xml_parser_state_t *) parser_state )->error ) != 1 )
1327
0
    {
1328
0
      libcerror_error_set(
1329
0
       ( (libfplist_xml_parser_state_t *) parser_state )->error,
1330
0
       LIBCERROR_ERROR_DOMAIN_RUNTIME,
1331
0
       LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED,
1332
0
       "%s: unable to create XML tag.",
1333
0
       libfplist_xml_parser_function );
1334
1335
0
      YYABORT;
1336
0
    }
1337
1.83M
    if( ( (libfplist_xml_parser_state_t *) parser_state )->root_tag == NULL )
1338
9.12k
    {
1339
9.12k
      ( (libfplist_xml_parser_state_t *) parser_state )->root_tag = ( (libfplist_xml_parser_state_t *) parser_state )->current_tag;
1340
9.12k
    }
1341
1.82M
    else
1342
1.82M
    {
1343
1.82M
      if( libfplist_xml_tag_append_element(
1344
1.82M
           ( (libfplist_xml_parser_state_t *) parser_state )->parent_tag,
1345
1.82M
           ( (libfplist_xml_parser_state_t *) parser_state )->current_tag,
1346
1.82M
           ( (libfplist_xml_parser_state_t *) parser_state )->error ) != 1 )
1347
0
      {
1348
0
        libcerror_error_set(
1349
0
         ( (libfplist_xml_parser_state_t *) parser_state )->error,
1350
0
         LIBCERROR_ERROR_DOMAIN_RUNTIME,
1351
0
         LIBCERROR_RUNTIME_ERROR_APPEND_FAILED,
1352
0
         "%s: unable to append attribute.",
1353
0
         libfplist_xml_parser_function );
1354
1355
0
        YYABORT;
1356
0
      }
1357
1.82M
    }
1358
1.83M
    ( (libfplist_xml_parser_state_t *) parser_state )->parent_tag = ( (libfplist_xml_parser_state_t *) parser_state )->current_tag;
1359
1.83M
  }
1360
0
break;
1361
559k
case 13:
1362
559k
  {
1363
559k
    libfplist_xml_parser_rule_print(
1364
559k
     "xml_tag_single" );
1365
1366
559k
    if( ( (libfplist_xml_parser_state_t *) parser_state )->current_tag == NULL )
1367
0
    {
1368
0
      libcerror_error_set(
1369
0
       ( (libfplist_xml_parser_state_t *) parser_state )->error,
1370
0
       LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
1371
0
       LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
1372
0
       "%s: invalid current tag.",
1373
0
       libfplist_xml_parser_function );
1374
1375
0
      YYABORT;
1376
0
    }
1377
559k
    ( (libfplist_xml_parser_state_t *) parser_state )->parent_tag  = ( (libfplist_xml_parser_state_t *) parser_state )->current_tag->parent_tag;
1378
559k
    ( (libfplist_xml_parser_state_t *) parser_state )->current_tag = ( (libfplist_xml_parser_state_t *) parser_state )->parent_tag;
1379
559k
  }
1380
0
break;
1381
292k
case 14:
1382
292k
  {
1383
292k
    libfplist_xml_parser_rule_print(
1384
292k
     "xml_tag_close" );
1385
1386
292k
    if( yystack.l_mark[0].string_value.data == NULL )
1387
0
    {
1388
0
      libcerror_error_set(
1389
0
       ( (libfplist_xml_parser_state_t *) parser_state )->error,
1390
0
       LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
1391
0
       LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
1392
0
       "%s: invalid tag name.",
1393
0
       libfplist_xml_parser_function );
1394
1395
0
      YYABORT;
1396
0
    }
1397
292k
    if( ( (libfplist_xml_parser_state_t *) parser_state )->current_tag == NULL )
1398
0
    {
1399
0
      libcerror_error_set(
1400
0
       ( (libfplist_xml_parser_state_t *) parser_state )->error,
1401
0
       LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
1402
0
       LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
1403
0
       "%s: invalid current tag.",
1404
0
       libfplist_xml_parser_function );
1405
1406
0
      YYABORT;
1407
0
    }
1408
292k
    if( ( ( (libfplist_xml_parser_state_t *) parser_state )->current_tag->name_size != ( yystack.l_mark[0].string_value.length + 1 ) )
1409
291k
     || ( narrow_string_compare(
1410
291k
           ( (libfplist_xml_parser_state_t *) parser_state )->current_tag->name,
1411
291k
           yystack.l_mark[0].string_value.data,
1412
291k
           yystack.l_mark[0].string_value.length ) != 0 ) )
1413
1.00k
    {
1414
1.00k
      libcerror_error_set(
1415
1.00k
       ( (libfplist_xml_parser_state_t *) parser_state )->error,
1416
1.00k
       LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
1417
1.00k
       LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
1418
1.00k
       "%s: mismatch in tag name (%s != %s).",
1419
1.00k
       libfplist_xml_parser_function,
1420
1.00k
       ( (libfplist_xml_parser_state_t *) parser_state )->current_tag->name,
1421
1.00k
       yystack.l_mark[0].string_value.data );
1422
1423
1.00k
      YYABORT;
1424
1.00k
    }
1425
291k
    ( (libfplist_xml_parser_state_t *) parser_state )->parent_tag  = ( (libfplist_xml_parser_state_t *) parser_state )->current_tag->parent_tag;
1426
291k
    ( (libfplist_xml_parser_state_t *) parser_state )->current_tag = ( (libfplist_xml_parser_state_t *) parser_state )->parent_tag;
1427
291k
  }
1428
0
break;
1429
257k
case 15:
1430
257k
  {
1431
257k
    libfplist_xml_parser_rule_print(
1432
257k
     "xml_tag_content" );
1433
1434
257k
    if( yystack.l_mark[0].string_value.data == NULL )
1435
0
    {
1436
0
      libcerror_error_set(
1437
0
       ( (libfplist_xml_parser_state_t *) parser_state )->error,
1438
0
       LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
1439
0
       LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
1440
0
       "%s: invalid attribute value.",
1441
0
       libfplist_xml_parser_function );
1442
1443
0
      YYABORT;
1444
0
    }
1445
257k
    if( libfplist_xml_tag_set_value(
1446
257k
         ( (libfplist_xml_parser_state_t *) parser_state )->current_tag,
1447
257k
         (uint8_t *) yystack.l_mark[0].string_value.data,
1448
257k
         yystack.l_mark[0].string_value.length,
1449
257k
         ( (libfplist_xml_parser_state_t *) parser_state )->error ) != 1 )
1450
0
    {
1451
0
      libcerror_error_set(
1452
0
       ( (libfplist_xml_parser_state_t *) parser_state )->error,
1453
0
       LIBCERROR_ERROR_DOMAIN_RUNTIME,
1454
0
       LIBCERROR_RUNTIME_ERROR_SET_FAILED,
1455
0
       "%s: unable to set value.",
1456
0
       libfplist_xml_parser_function );
1457
1458
0
      YYABORT;
1459
0
    }
1460
257k
  }
1461
257k
break;
1462
257k
case 18:
1463
85.1k
  {
1464
85.1k
    libfplist_xml_parser_rule_print(
1465
85.1k
     "xml_attribute" );
1466
1467
85.1k
    if( yystack.l_mark[-2].string_value.data == NULL )
1468
0
    {
1469
0
      libcerror_error_set(
1470
0
       ( (libfplist_xml_parser_state_t *) parser_state )->error,
1471
0
       LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
1472
0
       LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
1473
0
       "%s: invalid attribute name.",
1474
0
       libfplist_xml_parser_function );
1475
1476
0
      YYABORT;
1477
0
    }
1478
85.1k
    if( yystack.l_mark[0].string_value.data == NULL )
1479
0
    {
1480
0
      libcerror_error_set(
1481
0
       ( (libfplist_xml_parser_state_t *) parser_state )->error,
1482
0
       LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
1483
0
       LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
1484
0
       "%s: invalid attribute value.",
1485
0
       libfplist_xml_parser_function );
1486
1487
0
      YYABORT;
1488
0
    }
1489
85.1k
    if( libfplist_xml_tag_append_attribute(
1490
85.1k
         ( (libfplist_xml_parser_state_t *) parser_state )->current_tag,
1491
85.1k
         (uint8_t *) yystack.l_mark[-2].string_value.data,
1492
85.1k
         yystack.l_mark[-2].string_value.length,
1493
85.1k
         (uint8_t *) yystack.l_mark[0].string_value.data,
1494
85.1k
         yystack.l_mark[0].string_value.length,
1495
85.1k
         ( (libfplist_xml_parser_state_t *) parser_state )->error ) != 1 )
1496
68
    {
1497
68
      libcerror_error_set(
1498
68
       ( (libfplist_xml_parser_state_t *) parser_state )->error,
1499
68
       LIBCERROR_ERROR_DOMAIN_RUNTIME,
1500
68
       LIBCERROR_RUNTIME_ERROR_APPEND_FAILED,
1501
68
       "%s: unable to append attribute.",
1502
68
       libfplist_xml_parser_function );
1503
1504
68
      YYABORT;
1505
68
    }
1506
85.1k
  }
1507
85.0k
break;
1508
4.64M
    default:
1509
4.64M
        break;
1510
7.67M
    }
1511
7.67M
    yystack.s_mark -= yym;
1512
7.67M
    yystate = *yystack.s_mark;
1513
7.67M
    yystack.l_mark -= yym;
1514
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1515
    yystack.p_mark -= yym;
1516
#endif
1517
7.67M
    yym = yylhs[yyn];
1518
7.67M
    if (yystate == 0 && yym == 0)
1519
5.72k
    {
1520
#if YYDEBUG
1521
        if (yydebug)
1522
        {
1523
            fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1524
#ifdef YYSTYPE_TOSTRING
1525
#if YYBTYACC
1526
            if (!yytrial)
1527
#endif /* YYBTYACC */
1528
                fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
1529
#endif
1530
            fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
1531
        }
1532
#endif
1533
5.72k
        yystate = YYFINAL;
1534
5.72k
        *++yystack.s_mark = YYFINAL;
1535
5.72k
        *++yystack.l_mark = yyval;
1536
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1537
        *++yystack.p_mark = yyloc;
1538
#endif
1539
5.72k
        if (yychar < 0)
1540
5.72k
        {
1541
#if YYBTYACC
1542
            do {
1543
            if (yylvp < yylve)
1544
            {
1545
                /* we're currently re-reading tokens */
1546
                yylval = *yylvp++;
1547
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1548
                yylloc = *yylpp++;
1549
#endif
1550
                yychar = *yylexp++;
1551
                break;
1552
            }
1553
            if (yyps->save)
1554
            {
1555
                /* in trial mode; save scanner results for future parse attempts */
1556
                if (yylvp == yylvlim)
1557
                {   /* Enlarge lexical value queue */
1558
                    size_t p = (size_t) (yylvp - yylvals);
1559
                    size_t s = (size_t) (yylvlim - yylvals);
1560
1561
                    s += YYLVQUEUEGROWTH;
1562
                    if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL)
1563
                        goto yyenomem;
1564
                    if ((yylvals   = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
1565
                        goto yyenomem;
1566
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1567
                    if ((yylpsns   = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
1568
                        goto yyenomem;
1569
#endif
1570
                    yylvp   = yylve = yylvals + p;
1571
                    yylvlim = yylvals + s;
1572
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1573
                    yylpp   = yylpe = yylpsns + p;
1574
                    yylplim = yylpsns + s;
1575
#endif
1576
                    yylexp  = yylexemes + p;
1577
                }
1578
                *yylexp = (YYINT) YYLEX;
1579
                *yylvp++ = yylval;
1580
                yylve++;
1581
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1582
                *yylpp++ = yylloc;
1583
                yylpe++;
1584
#endif
1585
                yychar = *yylexp++;
1586
                break;
1587
            }
1588
            /* normal operation, no conflict encountered */
1589
#endif /* YYBTYACC */
1590
5.72k
            yychar = YYLEX;
1591
#if YYBTYACC
1592
            } while (0);
1593
#endif /* YYBTYACC */
1594
5.72k
            if (yychar < 0) yychar = YYEOF;
1595
#if YYDEBUG
1596
            if (yydebug)
1597
            {
1598
                if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1599
                fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
1600
                                YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
1601
            }
1602
#endif
1603
5.72k
        }
1604
5.72k
        if (yychar == YYEOF) goto yyaccept;
1605
71
        goto yyloop;
1606
5.72k
    }
1607
7.66M
    if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1608
5.89M
            yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1609
2.78M
        yystate = yytable[yyn];
1610
4.88M
    else
1611
4.88M
        yystate = yydgoto[yym];
1612
#if YYDEBUG
1613
    if (yydebug)
1614
    {
1615
        fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1616
#ifdef YYSTYPE_TOSTRING
1617
#if YYBTYACC
1618
        if (!yytrial)
1619
#endif /* YYBTYACC */
1620
            fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1621
#endif
1622
        fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1623
    }
1624
#endif
1625
7.66M
    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1626
7.66M
    *++yystack.s_mark = (YYINT) yystate;
1627
7.66M
    *++yystack.l_mark = yyval;
1628
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1629
    *++yystack.p_mark = yyloc;
1630
#endif
1631
7.66M
    goto yyloop;
1632
#if YYBTYACC
1633
1634
    /* Reduction declares that this path is valid. Set yypath and do a full parse */
1635
yyvalid:
1636
    if (yypath) YYABORT;
1637
    while (yyps->save)
1638
    {
1639
        YYParseState *save = yyps->save;
1640
        yyps->save = save->save;
1641
        save->save = yypath;
1642
        yypath = save;
1643
    }
1644
#if YYDEBUG
1645
    if (yydebug)
1646
        fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
1647
                        YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
1648
#endif
1649
    if (yyerrctx)
1650
    {
1651
        yyFreeState(yyerrctx);
1652
        yyerrctx = NULL;
1653
    }
1654
    yylvp          = yylvals + yypath->lexeme;
1655
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1656
    yylpp          = yylpsns + yypath->lexeme;
1657
#endif
1658
    yylexp         = yylexemes + yypath->lexeme;
1659
    yychar         = YYEMPTY;
1660
    yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1661
    memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1662
    yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1663
    memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1664
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1665
    yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1666
    memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1667
#endif
1668
    yystate        = yypath->state;
1669
    goto yyloop;
1670
#endif /* YYBTYACC */
1671
1672
7
yyoverflow:
1673
7
    YYERROR_CALL("yacc stack overflow");
1674
#if YYBTYACC
1675
    goto yyabort_nomem;
1676
yyenomem:
1677
    YYERROR_CALL("memory exhausted");
1678
yyabort_nomem:
1679
#endif /* YYBTYACC */
1680
7
    yyresult = 2;
1681
7
    goto yyreturn;
1682
1683
4.24k
yyabort:
1684
4.24k
    yyresult = 1;
1685
4.24k
    goto yyreturn;
1686
1687
5.65k
yyaccept:
1688
#if YYBTYACC
1689
    if (yyps->save) goto yyvalid;
1690
#endif /* YYBTYACC */
1691
5.65k
    yyresult = 0;
1692
1693
9.91k
yyreturn:
1694
#if defined(YYDESTRUCT_CALL)
1695
    if (yychar != YYEOF && yychar != YYEMPTY)
1696
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1697
        YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
1698
#else
1699
        YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
1700
#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1701
1702
    {
1703
        YYSTYPE *pv;
1704
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1705
        YYLTYPE *pp;
1706
1707
        for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
1708
             YYDESTRUCT_CALL("cleanup: discarding state",
1709
                             yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
1710
#else
1711
        for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
1712
             YYDESTRUCT_CALL("cleanup: discarding state",
1713
                             yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
1714
#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1715
    }
1716
#endif /* defined(YYDESTRUCT_CALL) */
1717
1718
#if YYBTYACC
1719
    if (yyerrctx)
1720
    {
1721
        yyFreeState(yyerrctx);
1722
        yyerrctx = NULL;
1723
    }
1724
    while (yyps)
1725
    {
1726
        YYParseState *save = yyps;
1727
        yyps = save->save;
1728
        save->save = NULL;
1729
        yyFreeState(save);
1730
    }
1731
    while (yypath)
1732
    {
1733
        YYParseState *save = yypath;
1734
        yypath = save->save;
1735
        save->save = NULL;
1736
        yyFreeState(save);
1737
    }
1738
#endif /* YYBTYACC */
1739
9.91k
    yyfreestack(&yystack);
1740
9.91k
    return (yyresult);
1741
5.65k
}