Coverage Report

Created: 2025-08-04 07:15

/work/build/epan/dtd_parse.c
Line
Count
Source (jump to first uncovered line)
1
#line 2 "/work/build/epan/dtd_parse.c"
2
/* Include this before everything else, for various large-file definitions */
3
#include "config.h"
4
#include <wireshark.h>
5
6
#line 7 "/work/build/epan/dtd_parse.c"
7
8
#define  YY_INT_ALIGNED short int
9
10
/* A lexical scanner generated by flex */
11
12
/* %not-for-header */
13
/* %if-c-only */
14
/* %if-not-reentrant */
15
/* %endif */
16
/* %endif */
17
/* %ok-for-header */
18
19
#define FLEX_SCANNER
20
#define YY_FLEX_MAJOR_VERSION 2
21
#define YY_FLEX_MINOR_VERSION 6
22
#define YY_FLEX_SUBMINOR_VERSION 4
23
#if YY_FLEX_SUBMINOR_VERSION > 0
24
#define FLEX_BETA
25
#endif
26
27
/* %if-c++-only */
28
/* %endif */
29
30
/* %if-c-only */
31
#ifdef yy_create_buffer
32
#define Dtd_Parse__create_buffer_ALREADY_DEFINED
33
#else
34
0
#define yy_create_buffer Dtd_Parse__create_buffer
35
#endif
36
37
#ifdef yy_delete_buffer
38
#define Dtd_Parse__delete_buffer_ALREADY_DEFINED
39
#else
40
0
#define yy_delete_buffer Dtd_Parse__delete_buffer
41
#endif
42
43
#ifdef yy_scan_buffer
44
#define Dtd_Parse__scan_buffer_ALREADY_DEFINED
45
#else
46
0
#define yy_scan_buffer Dtd_Parse__scan_buffer
47
#endif
48
49
#ifdef yy_scan_string
50
#define Dtd_Parse__scan_string_ALREADY_DEFINED
51
#else
52
#define yy_scan_string Dtd_Parse__scan_string
53
#endif
54
55
#ifdef yy_scan_bytes
56
#define Dtd_Parse__scan_bytes_ALREADY_DEFINED
57
#else
58
0
#define yy_scan_bytes Dtd_Parse__scan_bytes
59
#endif
60
61
#ifdef yy_init_buffer
62
#define Dtd_Parse__init_buffer_ALREADY_DEFINED
63
#else
64
0
#define yy_init_buffer Dtd_Parse__init_buffer
65
#endif
66
67
#ifdef yy_flush_buffer
68
#define Dtd_Parse__flush_buffer_ALREADY_DEFINED
69
#else
70
0
#define yy_flush_buffer Dtd_Parse__flush_buffer
71
#endif
72
73
#ifdef yy_load_buffer_state
74
#define Dtd_Parse__load_buffer_state_ALREADY_DEFINED
75
#else
76
0
#define yy_load_buffer_state Dtd_Parse__load_buffer_state
77
#endif
78
79
#ifdef yy_switch_to_buffer
80
#define Dtd_Parse__switch_to_buffer_ALREADY_DEFINED
81
#else
82
0
#define yy_switch_to_buffer Dtd_Parse__switch_to_buffer
83
#endif
84
85
#ifdef yypush_buffer_state
86
#define Dtd_Parse_push_buffer_state_ALREADY_DEFINED
87
#else
88
#define yypush_buffer_state Dtd_Parse_push_buffer_state
89
#endif
90
91
#ifdef yypop_buffer_state
92
#define Dtd_Parse_pop_buffer_state_ALREADY_DEFINED
93
#else
94
0
#define yypop_buffer_state Dtd_Parse_pop_buffer_state
95
#endif
96
97
#ifdef yyensure_buffer_stack
98
#define Dtd_Parse_ensure_buffer_stack_ALREADY_DEFINED
99
#else
100
0
#define yyensure_buffer_stack Dtd_Parse_ensure_buffer_stack
101
#endif
102
103
#ifdef yylex
104
#define Dtd_Parse_lex_ALREADY_DEFINED
105
#else
106
#define yylex Dtd_Parse_lex
107
#endif
108
109
#ifdef yyrestart
110
#define Dtd_Parse_restart_ALREADY_DEFINED
111
#else
112
0
#define yyrestart Dtd_Parse_restart
113
#endif
114
115
#ifdef yylex_init
116
#define Dtd_Parse_lex_init_ALREADY_DEFINED
117
#else
118
#define yylex_init Dtd_Parse_lex_init
119
#endif
120
121
#ifdef yylex_init_extra
122
#define Dtd_Parse_lex_init_extra_ALREADY_DEFINED
123
#else
124
#define yylex_init_extra Dtd_Parse_lex_init_extra
125
#endif
126
127
#ifdef yylex_destroy
128
#define Dtd_Parse_lex_destroy_ALREADY_DEFINED
129
#else
130
#define yylex_destroy Dtd_Parse_lex_destroy
131
#endif
132
133
#ifdef yyget_debug
134
#define Dtd_Parse_get_debug_ALREADY_DEFINED
135
#else
136
#define yyget_debug Dtd_Parse_get_debug
137
#endif
138
139
#ifdef yyset_debug
140
#define Dtd_Parse_set_debug_ALREADY_DEFINED
141
#else
142
#define yyset_debug Dtd_Parse_set_debug
143
#endif
144
145
#ifdef yyget_extra
146
#define Dtd_Parse_get_extra_ALREADY_DEFINED
147
#else
148
#define yyget_extra Dtd_Parse_get_extra
149
#endif
150
151
#ifdef yyset_extra
152
#define Dtd_Parse_set_extra_ALREADY_DEFINED
153
#else
154
0
#define yyset_extra Dtd_Parse_set_extra
155
#endif
156
157
#ifdef yyget_in
158
#define Dtd_Parse_get_in_ALREADY_DEFINED
159
#else
160
#define yyget_in Dtd_Parse_get_in
161
#endif
162
163
#ifdef yyset_in
164
#define Dtd_Parse_set_in_ALREADY_DEFINED
165
#else
166
#define yyset_in Dtd_Parse_set_in
167
#endif
168
169
#ifdef yyget_out
170
#define Dtd_Parse_get_out_ALREADY_DEFINED
171
#else
172
#define yyget_out Dtd_Parse_get_out
173
#endif
174
175
#ifdef yyset_out
176
#define Dtd_Parse_set_out_ALREADY_DEFINED
177
#else
178
#define yyset_out Dtd_Parse_set_out
179
#endif
180
181
#ifdef yyget_leng
182
#define Dtd_Parse_get_leng_ALREADY_DEFINED
183
#else
184
#define yyget_leng Dtd_Parse_get_leng
185
#endif
186
187
#ifdef yyget_text
188
#define Dtd_Parse_get_text_ALREADY_DEFINED
189
#else
190
#define yyget_text Dtd_Parse_get_text
191
#endif
192
193
#ifdef yyget_lineno
194
#define Dtd_Parse_get_lineno_ALREADY_DEFINED
195
#else
196
#define yyget_lineno Dtd_Parse_get_lineno
197
#endif
198
199
#ifdef yyset_lineno
200
#define Dtd_Parse_set_lineno_ALREADY_DEFINED
201
#else
202
#define yyset_lineno Dtd_Parse_set_lineno
203
#endif
204
205
#ifdef yyget_column
206
#define Dtd_Parse_get_column_ALREADY_DEFINED
207
#else
208
#define yyget_column Dtd_Parse_get_column
209
#endif
210
211
#ifdef yyset_column
212
#define Dtd_Parse_set_column_ALREADY_DEFINED
213
#else
214
#define yyset_column Dtd_Parse_set_column
215
#endif
216
217
#ifdef yywrap
218
#define Dtd_Parse_wrap_ALREADY_DEFINED
219
#else
220
0
#define yywrap Dtd_Parse_wrap
221
#endif
222
223
/* %endif */
224
225
#ifdef yyalloc
226
#define Dtd_Parse_alloc_ALREADY_DEFINED
227
#else
228
0
#define yyalloc Dtd_Parse_alloc
229
#endif
230
231
#ifdef yyrealloc
232
#define Dtd_Parse_realloc_ALREADY_DEFINED
233
#else
234
0
#define yyrealloc Dtd_Parse_realloc
235
#endif
236
237
#ifdef yyfree
238
#define Dtd_Parse_free_ALREADY_DEFINED
239
#else
240
0
#define yyfree Dtd_Parse_free
241
#endif
242
243
/* %if-c-only */
244
245
/* %endif */
246
247
/* First, we deal with  platform-specific or compiler-specific issues. */
248
249
/* begin standard C headers. */
250
/* %if-c-only */
251
#include <stdio.h>
252
#include <string.h>
253
#include <errno.h>
254
#include <stdlib.h>
255
/* %endif */
256
257
/* %if-tables-serialization */
258
/* %endif */
259
/* end standard C headers. */
260
261
/* %if-c-or-c++ */
262
/* flex integer type definitions */
263
264
#ifndef FLEXINT_H
265
#define FLEXINT_H
266
267
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
268
269
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
270
271
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
272
 * if you want the limit (max/min) macros for int types. 
273
 */
274
#ifndef __STDC_LIMIT_MACROS
275
#define __STDC_LIMIT_MACROS 1
276
#endif
277
278
#include <inttypes.h>
279
typedef int8_t flex_int8_t;
280
typedef uint8_t flex_uint8_t;
281
typedef int16_t flex_int16_t;
282
typedef uint16_t flex_uint16_t;
283
typedef int32_t flex_int32_t;
284
typedef uint32_t flex_uint32_t;
285
#else
286
typedef signed char flex_int8_t;
287
typedef short int flex_int16_t;
288
typedef int flex_int32_t;
289
typedef unsigned char flex_uint8_t; 
290
typedef unsigned short int flex_uint16_t;
291
typedef unsigned int flex_uint32_t;
292
293
/* Limits of integral types. */
294
#ifndef INT8_MIN
295
#define INT8_MIN               (-128)
296
#endif
297
#ifndef INT16_MIN
298
#define INT16_MIN              (-32767-1)
299
#endif
300
#ifndef INT32_MIN
301
#define INT32_MIN              (-2147483647-1)
302
#endif
303
#ifndef INT8_MAX
304
#define INT8_MAX               (127)
305
#endif
306
#ifndef INT16_MAX
307
#define INT16_MAX              (32767)
308
#endif
309
#ifndef INT32_MAX
310
#define INT32_MAX              (2147483647)
311
#endif
312
#ifndef UINT8_MAX
313
#define UINT8_MAX              (255U)
314
#endif
315
#ifndef UINT16_MAX
316
#define UINT16_MAX             (65535U)
317
#endif
318
#ifndef UINT32_MAX
319
#define UINT32_MAX             (4294967295U)
320
#endif
321
322
#ifndef SIZE_MAX
323
#define SIZE_MAX               (~(size_t)0)
324
#endif
325
326
#endif /* ! C99 */
327
328
#endif /* ! FLEXINT_H */
329
330
/* %endif */
331
332
/* begin standard C++ headers. */
333
/* %if-c++-only */
334
/* %endif */
335
336
/* TODO: this is always defined, so inline it */
337
#define yyconst const
338
339
#if defined(__GNUC__) && __GNUC__ >= 3
340
#define yynoreturn __attribute__((__noreturn__))
341
#else
342
#define yynoreturn
343
#endif
344
345
/* %not-for-header */
346
/* Returned upon end-of-file. */
347
0
#define YY_NULL 0
348
/* %ok-for-header */
349
350
/* %not-for-header */
351
/* Promotes a possibly negative, possibly signed char to an
352
 *   integer in range [0..255] for use as an array index.
353
 */
354
0
#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
355
/* %ok-for-header */
356
357
/* %if-reentrant */
358
359
/* An opaque pointer. */
360
#ifndef YY_TYPEDEF_YY_SCANNER_T
361
#define YY_TYPEDEF_YY_SCANNER_T
362
typedef void* yyscan_t;
363
#endif
364
365
/* For convenience, these vars (plus the bison vars far below)
366
   are macros in the reentrant scanner. */
367
0
#define yyin yyg->yyin_r
368
0
#define yyout yyg->yyout_r
369
0
#define yyextra yyg->yyextra_r
370
0
#define yyleng yyg->yyleng_r
371
0
#define yytext yyg->yytext_r
372
0
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
373
0
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
374
0
#define yy_flex_debug yyg->yy_flex_debug_r
375
376
/* %endif */
377
378
/* %if-not-reentrant */
379
/* %endif */
380
381
/* Enter a start condition.  This macro really ought to take a parameter,
382
 * but we do it the disgusting crufty way forced on us by the ()-less
383
 * definition of BEGIN.
384
 */
385
0
#define BEGIN yyg->yy_start = 1 + 2 *
386
/* Translate the current start state into a value that can be later handed
387
 * to BEGIN to return to the state.  The YYSTATE alias is for lex
388
 * compatibility.
389
 */
390
#define YY_START ((yyg->yy_start - 1) / 2)
391
#define YYSTATE YY_START
392
/* Action number for EOF rule of a given start state. */
393
0
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
394
/* Special action meaning "start processing a new file". */
395
0
#define YY_NEW_FILE yyrestart( yyin , yyscanner )
396
0
#define YY_END_OF_BUFFER_CHAR 0
397
398
/* Size of default input buffer. */
399
#ifndef YY_BUF_SIZE
400
#ifdef __ia64__
401
/* On IA-64, the buffer size is 16k, not 8k.
402
 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
403
 * Ditto for the __ia64__ case accordingly.
404
 */
405
#define YY_BUF_SIZE 32768
406
#else
407
0
#define YY_BUF_SIZE 16384
408
#endif /* __ia64__ */
409
#endif
410
411
/* The state buf must be large enough to hold one state per character in the main buffer.
412
 */
413
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
414
415
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
416
#define YY_TYPEDEF_YY_BUFFER_STATE
417
typedef struct yy_buffer_state *YY_BUFFER_STATE;
418
#endif
419
420
#ifndef YY_TYPEDEF_YY_SIZE_T
421
#define YY_TYPEDEF_YY_SIZE_T
422
typedef size_t yy_size_t;
423
#endif
424
425
/* %if-not-reentrant */
426
/* %endif */
427
428
/* %if-c-only */
429
/* %if-not-reentrant */
430
/* %endif */
431
/* %endif */
432
433
0
#define EOB_ACT_CONTINUE_SCAN 0
434
0
#define EOB_ACT_END_OF_FILE 1
435
0
#define EOB_ACT_LAST_MATCH 2
436
    
437
    #define YY_LESS_LINENO(n)
438
    #define YY_LINENO_REWIND_TO(ptr)
439
    
440
/* Return all but the first "n" matched characters back to the input stream. */
441
#define yyless(n) \
442
  do \
443
    { \
444
    /* Undo effects of setting up yytext. */ \
445
        int yyless_macro_arg = (n); \
446
        YY_LESS_LINENO(yyless_macro_arg);\
447
    *yy_cp = yyg->yy_hold_char; \
448
    YY_RESTORE_YY_MORE_OFFSET \
449
    yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
450
    YY_DO_BEFORE_ACTION; /* set up yytext again */ \
451
    } \
452
  while ( 0 )
453
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
454
455
#ifndef YY_STRUCT_YY_BUFFER_STATE
456
#define YY_STRUCT_YY_BUFFER_STATE
457
struct yy_buffer_state
458
  {
459
/* %if-c-only */
460
  FILE *yy_input_file;
461
/* %endif */
462
463
/* %if-c++-only */
464
/* %endif */
465
466
  char *yy_ch_buf;    /* input buffer */
467
  char *yy_buf_pos;   /* current position in input buffer */
468
469
  /* Size of input buffer in bytes, not including room for EOB
470
   * characters.
471
   */
472
  int yy_buf_size;
473
474
  /* Number of characters read into yy_ch_buf, not including EOB
475
   * characters.
476
   */
477
  int yy_n_chars;
478
479
  /* Whether we "own" the buffer - i.e., we know we created it,
480
   * and can realloc() it to grow it, and should free() it to
481
   * delete it.
482
   */
483
  int yy_is_our_buffer;
484
485
  /* Whether this is an "interactive" input source; if so, and
486
   * if we're using stdio for input, then we want to use getc()
487
   * instead of fread(), to make sure we stop fetching input after
488
   * each newline.
489
   */
490
  int yy_is_interactive;
491
492
  /* Whether we're considered to be at the beginning of a line.
493
   * If so, '^' rules will be active on the next match, otherwise
494
   * not.
495
   */
496
  int yy_at_bol;
497
498
    int yy_bs_lineno; /**< The line count. */
499
    int yy_bs_column; /**< The column count. */
500
501
  /* Whether to try to fill the input buffer when we reach the
502
   * end of it.
503
   */
504
  int yy_fill_buffer;
505
506
  int yy_buffer_status;
507
508
0
#define YY_BUFFER_NEW 0
509
0
#define YY_BUFFER_NORMAL 1
510
  /* When an EOF's been seen but there's still some text to process
511
   * then we mark the buffer as YY_EOF_PENDING, to indicate that we
512
   * shouldn't try reading from the input source any more.  We might
513
   * still have a bunch of tokens to match, though, because of
514
   * possible backing-up.
515
   *
516
   * When we actually see the EOF, we change the status to "new"
517
   * (via yyrestart()), so that the user can continue scanning by
518
   * just pointing yyin at a new input file.
519
   */
520
0
#define YY_BUFFER_EOF_PENDING 2
521
522
  };
523
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
524
525
/* %if-c-only Standard (non-C++) definition */
526
/* %not-for-header */
527
/* %if-not-reentrant */
528
/* %endif */
529
/* %ok-for-header */
530
531
/* %endif */
532
533
/* We provide macros for accessing buffer states in case in the
534
 * future we want to put the buffer states in a more general
535
 * "scanner state".
536
 *
537
 * Returns the top of the stack, or NULL.
538
 */
539
0
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
540
0
                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
541
0
                          : NULL)
542
/* Same as previous macro, but useful when we know that the buffer stack is not
543
 * NULL or when we need an lvalue. For internal use only.
544
 */
545
0
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
546
547
/* %if-c-only Standard (non-C++) definition */
548
549
/* %if-not-reentrant */
550
/* %not-for-header */
551
/* %ok-for-header */
552
553
/* %endif */
554
555
void yyrestart ( FILE *input_file , yyscan_t yyscanner );
556
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
557
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
558
void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
559
void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
560
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
561
void yypop_buffer_state ( yyscan_t yyscanner );
562
563
static void yyensure_buffer_stack ( yyscan_t yyscanner );
564
static void yy_load_buffer_state ( yyscan_t yyscanner );
565
static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
566
#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
567
568
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
569
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
570
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
571
572
/* %endif */
573
574
void *yyalloc ( yy_size_t , yyscan_t yyscanner );
575
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
576
void yyfree ( void * , yyscan_t yyscanner );
577
578
#define yy_new_buffer yy_create_buffer
579
#define yy_set_interactive(is_interactive) \
580
  { \
581
  if ( ! YY_CURRENT_BUFFER ){ \
582
        yyensure_buffer_stack (yyscanner); \
583
    YY_CURRENT_BUFFER_LVALUE =    \
584
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
585
  } \
586
  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
587
  }
588
#define yy_set_bol(at_bol) \
589
  { \
590
  if ( ! YY_CURRENT_BUFFER ){\
591
        yyensure_buffer_stack (yyscanner); \
592
    YY_CURRENT_BUFFER_LVALUE =    \
593
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
594
  } \
595
  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
596
  }
597
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
598
599
/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
600
/* Begin user sect3 */
601
602
0
#define Dtd_Parse_wrap(yyscanner) (/*CONSTCOND*/1)
603
#define YY_SKIP_YYWRAP
604
605
#define FLEX_DEBUG
606
typedef flex_uint8_t YY_CHAR;
607
608
typedef int yy_state_type;
609
610
0
#define yytext_ptr yytext_r
611
612
/* %% [1.5] DFA */
613
614
/* %if-c-only Standard (non-C++) definition */
615
616
static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
617
static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  , yyscan_t yyscanner);
618
static int yy_get_next_buffer ( yyscan_t yyscanner );
619
static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
620
621
/* %endif */
622
623
/* Done after the current pattern has been matched and before the
624
 * corresponding action - sets up yytext.
625
 */
626
#define YY_DO_BEFORE_ACTION \
627
0
  yyg->yytext_ptr = yy_bp; \
628
0
/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
629
0
  yyleng = (int) (yy_cp - yy_bp); \
630
0
  yyg->yy_hold_char = *yy_cp; \
631
0
  *yy_cp = '\0'; \
632
0
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
633
0
  yyg->yy_c_buf_p = yy_cp;
634
/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
635
#define YY_NUM_RULES 56
636
0
#define YY_END_OF_BUFFER 57
637
/* This struct is not used in this scanner,
638
   but its presence is necessary. */
639
struct yy_trans_info
640
  {
641
  flex_int32_t yy_verify;
642
  flex_int32_t yy_nxt;
643
  };
644
static const flex_int16_t yy_accept[219] =
645
    {   0,
646
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
647
        0,    0,    0,    0,    0,    0,    0,    0,    3,    3,
648
        0,    0,   57,   56,    1,   56,   56,   56,   48,   49,
649
       44,   46,   47,   55,   56,   23,   45,   55,   55,   55,
650
       55,   55,   55,   50,   51,   52,   56,   56,   56,   14,
651
        1,   56,   16,   56,   18,    1,   18,   19,    1,   20,
652
        3,    1,    4,    7,    1,    8,    1,    0,   53,    0,
653
        0,    0,    0,    0,    0,    0,   54,   55,   22,    9,
654
       55,   55,   55,   55,   55,   55,   55,   31,   55,   55,
655
        0,   13,    0,   14,    1,   15,   16,   21,   17,    0,
656
657
       19,    1,    0,    0,    0,    0,    0,    0,    0,    0,
658
        0,    0,   28,   55,   55,   55,   55,   55,   55,   55,
659
       55,   55,   12,    0,    5,    0,    0,    0,    0,    0,
660
        0,    2,    0,   55,   55,   55,   55,   55,   55,   55,
661
       55,   55,    0,    0,    0,    0,    0,    0,    0,    0,
662
       55,   39,   55,   55,   30,   55,   32,   55,   55,    0,
663
       29,    0,   41,    0,    0,    0,    0,   55,   55,   55,
664
       55,   36,   33,   55,   55,    0,    0,    0,   27,    0,
665
        0,   24,   26,   25,   55,   34,   55,    0,   40,   43,
666
        0,    0,   37,   35,   38,    0,   42,    0,    0,    6,
667
668
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
669
        0,    0,    0,    0,    0,   10,   11,    0
670
    } ;
671
672
static const YY_CHAR yy_ec[256] =
673
    {   0,
674
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
675
        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
676
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
677
        1,    2,    5,    6,    7,    1,    1,    1,    8,    9,
678
       10,   11,   12,   13,   14,    1,    1,   15,   15,   15,
679
       15,   15,   15,   15,   15,   15,   15,   16,    1,   17,
680
       18,   19,   20,    1,   21,   15,   22,   23,   24,   25,
681
       15,   15,   26,   15,   27,   28,   29,   30,   31,   32,
682
       33,   34,   35,   36,   37,   15,   15,   38,   39,   15,
683
       40,    1,   41,    1,   42,    1,   43,   44,   45,   15,
684
685
       46,   15,   15,   47,   48,   15,   49,   50,   15,   51,
686
       52,   53,   15,   54,   55,   56,   15,   15,   57,   15,
687
       15,   15,    1,   58,    1,    1,    1,    1,    1,    1,
688
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
689
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
690
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
691
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
692
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
693
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
694
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
695
696
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
697
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
698
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
699
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
700
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
701
        1,    1,    1,    1,    1
702
    } ;
703
704
static const YY_CHAR yy_meta[59] =
705
    {   0,
706
        1,    2,    3,    1,    1,    4,    1,    1,    1,    1,
707
        1,    1,    1,    5,    5,    1,    1,    1,    1,    1,
708
        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
709
        5,    5,    5,    5,    5,    5,    5,    5,    5,    1,
710
        1,    5,    5,    5,    5,    5,    5,    5,    5,    5,
711
        5,    5,    5,    5,    5,    5,    5,    1
712
    } ;
713
714
static const flex_int16_t yy_base[233] =
715
    {   0,
716
        0,    3,    7,    0,   64,   68,   71,   74,   87,   90,
717
      125,  183,   93,   96,   99,  113,  144,  149,  154,  157,
718
      160,  202,  431,  432,  120,  424,  185,  421,  432,  432,
719
      432,  432,  432,    0,  149,  432,  432,   50,  405,  396,
720
      144,  403,   75,  432,  432,  432,    0,  406,  376,    0,
721
      173,  404,    0,  403,  432,  178,  206,    0,  211,  432,
722
      432,  224,  407,  432,  227,  432,  230,  414,  432,  396,
723
      394,  391,  387,  393,  390,  405,  432,    0,  221,  432,
724
      373,  375,  389,  387,  384,  375,  370,  371,  368,  367,
725
      383,  432,  347,    0,  236,  432,    0,  432,  432,  230,
726
727
        0,  240,  381,  378,  373,  359,  364,  372,  361,  379,
728
      245,  361,    0,  363,  354,  353,  359,  351,  360,  361,
729
      353,  362,  432,  336,  432,  345,  359,  355,  350,  356,
730
      339,  432,  339,  348,  352,  333,  347,  331,  333,  343,
731
      340,  330,  310,  343,  326,  339,  335,  324,  333,  337,
732
      322,    0,  323,  318,    0,   43,  309,  269,  266,  244,
733
      432,  262,  432,  263,  265,  251,  248,  247,  258,  242,
734
      253,    0,    0,  246,  238,  225,  231,  243,  432,  239,
735
      236,    0,    0,    0,  225,  224,  228,  200,  432,  432,
736
      230,  221,    0,    0,    0,  199,  432,  217,  231,  432,
737
738
       59,  168,  164,  171,  157,  155,  122,  114,   97,   92,
739
       75,   66,   61,   57,   37,  432,  432,  432,  296,  301,
740
      306,  311,  316,  321,  326,  331,  336,   78,  341,  346,
741
       74,  351
742
    } ;
743
744
static const flex_int16_t yy_def[233] =
745
    {   0,
746
      219,  219,  218,    3,  219,  219,  220,  220,  219,  219,
747
      221,  221,  222,  222,  223,  223,  219,  219,  224,  224,
748
      225,  225,  218,  218,  218,  226,  218,  227,  218,  218,
749
      218,  218,  218,  228,  218,  218,  218,  228,  228,  228,
750
      228,  228,  228,  218,  218,  218,  229,  218,  218,  230,
751
      230,  218,  231,  218,  218,  218,  218,  232,  232,  218,
752
      218,  218,  218,  218,  218,  218,  218,  226,  218,  218,
753
      218,  218,  218,  218,  218,  227,  218,  228,  218,  218,
754
      228,  228,  228,  228,  228,  228,  228,  228,  228,  228,
755
      218,  218,  218,  230,  230,  218,  231,  218,  218,  218,
756
757
      232,  232,  218,  218,  218,  218,  218,  218,  218,  218,
758
      218,  218,  228,  228,  228,  228,  228,  228,  228,  228,
759
      228,  228,  218,  218,  218,  218,  218,  218,  218,  218,
760
      218,  218,  218,  228,  228,  228,  228,  228,  228,  228,
761
      228,  228,  218,  218,  218,  218,  218,  218,  218,  218,
762
      228,  228,  228,  228,  228,  228,  228,  228,  228,  218,
763
      218,  218,  218,  218,  218,  218,  218,  228,  228,  228,
764
      228,  228,  228,  228,  228,  218,  218,  218,  218,  218,
765
      218,  228,  228,  228,  228,  228,  228,  218,  218,  218,
766
      218,  218,  228,  228,  228,  218,  218,  218,  218,  218,
767
768
      218,  218,  218,  218,  218,  218,  218,  218,  218,  218,
769
      218,  218,  218,  218,  218,  218,  218,    0,  218,  218,
770
      218,  218,  218,  218,  218,  218,  218,  218,  218,  218,
771
      218,  218
772
    } ;
773
774
static const flex_int16_t yy_nxt[491] =
775
    {   0,
776
      218,   25,   25,   25,   25,   25,   25,   24,   25,   25,
777
       25,   24,   26,   27,   28,   29,   30,   31,   32,   33,
778
       24,   34,   24,   35,   24,   36,   37,   38,   39,   40,
779
       41,   34,   42,   34,   34,   34,   43,   34,   34,   34,
780
       34,   34,   34,   34,   34,   34,   44,   45,   24,   34,
781
       34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
782
       34,   34,   34,   34,   46,   25,   25,   25,  171,   25,
783
       25,   25,   25,   51,   51,   25,   51,   51,   97,   81,
784
       47,  172,   78,   48,   47,   82,  217,   48,   25,   25,
785
       25,   25,   25,   25,   56,   25,   56,   56,   25,   56,
786
787
       59,   59,   59,   89,   24,   90,   52,  216,  202,   52,
788
       57,  203,  215,   57,   59,   59,   59,  214,   24,  213,
789
       49,   67,   67,   67,   49,   24,   25,   25,   25,   24,
790
       24,   24,   24,   24,   24,   24,   24,   24,   24,  212,
791
       24,   24,   24,   24,   54,   25,   25,   25,  211,   60,
792
       25,   25,   25,   79,   60,   62,   62,   62,   62,   62,
793
       62,   65,   65,   65,   24,   24,   24,   63,   80,  210,
794
       63,   85,   86,   87,   67,   95,   95,  209,   66,   67,
795
       67,   67,   24,   24,   25,   25,   25,   24,   24,   24,
796
       24,   24,   24,   24,   24,   24,   24,  208,   24,   24,
797
798
       24,   24,   54,   65,   65,   65,   70,   71,  207,   72,
799
       73,   99,  102,  102,  102,  206,   74,  205,   75,  204,
800
       66,  100,   24,   24,   24,   67,   67,   67,   67,   67,
801
       67,   67,   67,   67,  110,   99,  111,   67,   95,   95,
802
       24,  102,  102,  102,  201,  100,  200,  199,  100,  100,
803
      112,  198,  197,  196,  100,  100,  100,  195,  194,  193,
804
      111,  192,  191,  111,  111,  190,  189,  188,  187,  111,
805
      111,  111,  100,  100,  112,  186,  185,  184,  100,  100,
806
      100,  183,  182,  181,  180,  179,  178,  111,  111,  177,
807
      176,  175,  174,  111,  111,  111,   24,   24,   24,   24,
808
809
       24,   50,   50,   50,   50,   50,   53,   53,   53,   53,
810
       53,   55,   55,   55,   55,   55,   58,   58,   58,   58,
811
       58,   61,   61,   61,   61,   61,   64,   64,   64,   64,
812
       64,   68,   68,   68,   68,   68,   76,   76,   76,   76,
813
       76,   91,   91,  173,   91,   91,   94,  170,   94,   94,
814
       94,  101,  101,  101,  169,  101,  168,  167,  166,  165,
815
      164,  163,  162,  161,  160,  159,  158,  157,  156,  155,
816
      154,  153,  152,  151,  150,  149,  148,  147,  146,  145,
817
      144,  143,  142,  141,  140,  139,  138,  137,  136,  135,
818
      134,  133,  132,  131,  130,  129,  128,  127,  126,  125,
819
820
      124,  123,  122,  121,  120,  119,  118,  117,  116,  115,
821
      114,  113,   77,  109,  108,  107,  106,  105,  104,   69,
822
      103,   98,   96,   93,   92,   88,   84,   83,   77,   69,
823
      218,   23,  218,  218,  218,  218,  218,  218,  218,  218,
824
      218,  218,  218,  218,  218,  218,  218,  218,  218,  218,
825
      218,  218,  218,  218,  218,  218,  218,  218,  218,  218,
826
      218,  218,  218,  218,  218,  218,  218,  218,  218,  218,
827
      218,  218,  218,  218,  218,  218,  218,  218,  218,  218,
828
      218,  218,  218,  218,  218,  218,  218,  218,  218,  218
829
    } ;
830
831
static const flex_int16_t yy_chk[491] =
832
    {   0,
833
        0,    1,    1,    1,    2,    2,    2,    3,    3,    3,
834
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
835
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
836
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
837
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
838
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
839
        3,    3,    3,    3,    3,    5,    5,    5,  156,    6,
840
        6,    6,    7,    7,    7,    8,    8,    8,  231,   38,
841
        5,  156,  228,    5,    6,   38,  215,    6,    9,    9,
842
        9,   10,   10,   10,   13,   13,   13,   14,   14,   14,
843
844
       15,   15,   15,   43,   15,   43,    9,  214,  201,   10,
845
       13,  201,  213,   14,   16,   16,   16,  212,   16,  211,
846
        5,   25,   25,   25,    6,   11,   11,   11,   11,   11,
847
       11,   11,   11,   11,   11,   11,   11,   11,   11,  210,
848
       11,   11,   11,   11,   11,   17,   17,   17,  209,   17,
849
       18,   18,   18,   35,   18,   19,   19,   19,   20,   20,
850
       20,   21,   21,   21,   11,   11,   11,   19,   35,  208,
851
       20,   41,   41,   41,   51,   51,   51,  207,   21,   56,
852
       56,   56,   11,   12,   12,   12,   12,   12,   12,   12,
853
       12,   12,   12,   12,   12,   12,   12,  206,   12,   12,
854
855
       12,   12,   12,   22,   22,   22,   27,   27,  205,   27,
856
       27,   57,   59,   59,   59,  204,   27,  203,   27,  202,
857
       22,   57,   12,   12,   12,   62,   62,   62,   65,   65,
858
       65,   67,   67,   67,   79,  100,   79,   95,   95,   95,
859
       12,  102,  102,  102,  199,  100,  198,  196,   57,   57,
860
       79,  192,  191,  188,   57,   57,   57,  187,  186,  185,
861
      111,  181,  180,   79,   79,  178,  177,  176,  175,   79,
862
       79,   79,  100,  100,  111,  174,  171,  170,  100,  100,
863
      100,  169,  168,  167,  166,  165,  164,  111,  111,  162,
864
      160,  159,  158,  111,  111,  111,  219,  219,  219,  219,
865
866
      219,  220,  220,  220,  220,  220,  221,  221,  221,  221,
867
      221,  222,  222,  222,  222,  222,  223,  223,  223,  223,
868
      223,  224,  224,  224,  224,  224,  225,  225,  225,  225,
869
      225,  226,  226,  226,  226,  226,  227,  227,  227,  227,
870
      227,  229,  229,  157,  229,  229,  230,  154,  230,  230,
871
      230,  232,  232,  232,  153,  232,  151,  150,  149,  148,
872
      147,  146,  145,  144,  143,  142,  141,  140,  139,  138,
873
      137,  136,  135,  134,  133,  131,  130,  129,  128,  127,
874
      126,  124,  122,  121,  120,  119,  118,  117,  116,  115,
875
      114,  112,  110,  109,  108,  107,  106,  105,  104,  103,
876
877
       93,   91,   90,   89,   88,   87,   86,   85,   84,   83,
878
       82,   81,   76,   75,   74,   73,   72,   71,   70,   68,
879
       63,   54,   52,   49,   48,   42,   40,   39,   28,   26,
880
       23,  218,  218,  218,  218,  218,  218,  218,  218,  218,
881
      218,  218,  218,  218,  218,  218,  218,  218,  218,  218,
882
      218,  218,  218,  218,  218,  218,  218,  218,  218,  218,
883
      218,  218,  218,  218,  218,  218,  218,  218,  218,  218,
884
      218,  218,  218,  218,  218,  218,  218,  218,  218,  218,
885
      218,  218,  218,  218,  218,  218,  218,  218,  218,  218
886
    } ;
887
888
static const flex_int16_t yy_rule_linenum[56] =
889
    {   0,
890
      209,  212,  213,  214,  215,  217,  218,  219,  221,  225,
891
      229,  233,  234,  236,  242,  244,  249,  251,  258,  293,
892
      295,  297,  298,  300,  301,  302,  304,  305,  306,  307,
893
      309,  310,  311,  312,  313,  314,  315,  316,  317,  318,
894
      319,  320,  321,  323,  324,  325,  326,  327,  328,  329,
895
      330,  331,  333,  334,  335
896
    } ;
897
898
/* The intent behind this definition is that it'll catch
899
 * any uses of REJECT which flex missed.
900
 */
901
#define REJECT reject_used_but_not_detected
902
#define yymore() yymore_used_but_not_detected
903
0
#define YY_MORE_ADJ 0
904
#define YY_RESTORE_YY_MORE_OFFSET
905
#line 1 "/src/wireshark/epan/dtd_parse.l"
906
907
/*
908
 * We want a reentrant scanner.
909
 */
910
/*
911
 * We don't use input, so don't generate code for it.
912
 */
913
#define YY_NO_INPUT 1
914
/*
915
 * We don't use unput, so don't generate code for it.
916
 */
917
/*
918
 * We don't read interactively from the terminal.
919
 */
920
/*
921
 * We want to stop processing when we get to the end of the input.
922
 */
923
/*
924
 * The type for the state we keep for a scanner.
925
 */
926
/*
927
 * Prefix scanner routines with "Dtd_Parse_" rather than "yy", so this scanner
928
 * can coexist with other scanners.
929
 */
930
/*
931
 * We have to override the memory allocators so that we don't get
932
 * "unused argument" warnings from the yyscanner argument (which
933
 * we don't use, as we have a global memory allocator).
934
 *
935
 * We provide, as macros, our own versions of the routines generated by Flex,
936
 * which just call malloc()/realloc()/free() (as the Flex versions do),
937
 * discarding the extra argument.
938
 */
939
#line 57 "/src/wireshark/epan/dtd_parse.l"
940
941
  /* dtd_parse.l
942
  * an XML dissector for Wireshark
943
  * lexical analyzer for DTDs
944
  *
945
  * Copyright 2004, Luis E. Garcia Ontanon <luis@ontanon.org>
946
  *
947
  * Wireshark - Network traffic analyzer
948
  * By Gerald Combs <gerald@wireshark.org>
949
  * Copyright 1998 Gerald Combs
950
  *
951
  * SPDX-License-Identifier: GPL-2.0-or-later
952
  */
953
954
#include <glib.h>
955
#include <string.h>
956
957
#include "dtd.h"
958
#include "dtd_grammar.h"
959
#include "dtd_parse.h"
960
961
/*
962
 * Disable diagnostics in the code generated by Flex.
963
 */
964
DIAG_OFF_FLEX()
965
966
  struct _proto_xmlpi_attr {
967
    const char* name;
968
    void (*act)(char*);
969
  };
970
971
  typedef struct {
972
    GString* input_string;
973
    size_t offsetx;
974
    size_t len;
975
    void* pParser;
976
    char* location;
977
    char* attr_name;
978
  } Dtd_Parse_scanner_state_t;
979
980
  static size_t my_yyinput(Dtd_Parse_scanner_state_t *state,char* buff,size_t size);
981
982
  static dtd_token_data_t* new_token(char*,char*);
983
984
  static dtd_build_data_t* build_data;
985
986
0
  static void set_proto_name (char* val) { g_free(build_data->proto_name); build_data->proto_name = g_strdup(val); }
987
0
  static void set_media_type (char* val) { g_free(build_data->media_type); build_data->media_type = g_strdup(val); }
988
0
  static void set_proto_root (char* val) { g_free(build_data->proto_root); build_data->proto_root = g_strdup(val); }
989
0
  static void set_description (char* val) { g_free(build_data->description); build_data->description = g_strdup(val); }
990
0
  static void set_recursive (char* val) { build_data->recursion = ( g_ascii_strcasecmp(val,"yes") == 0 ) ? true : false; }
991
992
#ifdef DEBUG_DTD_PARSER
993
#define DEBUG_DTD_TOKEN fprintf(stderr,"->%s (%i)%s\n",location,token_type,yytext)
994
#else
995
#define DEBUG_DTD_TOKEN
996
#endif
997
998
#define DTD_PARSE(token_type) \
999
0
  {   DEBUG_DTD_TOKEN; \
1000
0
    DtdParse(yyextra->pParser, (token_type), new_token(yytext, yyextra->location), build_data); \
1001
0
    if(build_data->error->len > 0) yyterminate(); \
1002
0
  }
1003
1004
1005
0
#define YY_INPUT(buff,result,max_size) ( (result) = my_yyinput(yyextra,(buff),(max_size)) )
1006
0
#define YY_USER_INIT BEGIN DTD;
1007
1008
/*
1009
 * Flex (v 2.5.35) uses this symbol to "exclude" unistd.h
1010
 */
1011
#ifdef _WIN32
1012
#define YY_NO_UNISTD_H
1013
#endif
1014
1015
/*
1016
 * Sleazy hack to suppress compiler warnings in yy_fatal_error().
1017
 */
1018
0
#define YY_EXIT_FAILURE ((void)yyscanner, 2)
1019
1020
/*
1021
 * Macros for the allocators, to discard the extra argument.
1022
 */
1023
0
#define Dtd_Parse_alloc(size, yyscanner)  (void *)malloc(size)
1024
0
#define Dtd_Parse_realloc(ptr, size, yyscanner) (void *)realloc((char *)(ptr), (size))
1025
0
#define Dtd_Parse_free(ptr, yyscanner)    free((char *)ptr)
1026
1027
#line 1028 "/work/build/epan/dtd_parse.c"
1028
1029
#line 1030 "/work/build/epan/dtd_parse.c"
1030
1031
#define INITIAL 0
1032
0
#define DTD 1
1033
0
#define XMLPI 2
1034
0
#define LOCATION 3
1035
0
#define DONE 4
1036
0
#define PROTOCOL 5
1037
0
#define GET_ATTR_QUOTE 6
1038
0
#define GET_ATTR_VAL 7
1039
0
#define GET_ATTR_CLOSE_QUOTE 8
1040
0
#define IN_COMMENT 9
1041
0
#define IN_NOTATION 10
1042
1043
#ifndef YY_NO_UNISTD_H
1044
/* Special case for "unistd.h", since it is non-ANSI. We include it way
1045
 * down here because we want the user's section 1 to have been scanned first.
1046
 * The user has a chance to override it with an option.
1047
 */
1048
/* %if-c-only */
1049
#include <unistd.h>
1050
/* %endif */
1051
/* %if-c++-only */
1052
/* %endif */
1053
#endif
1054
1055
#define YY_EXTRA_TYPE Dtd_Parse_scanner_state_t *
1056
1057
/* %if-c-only Reentrant structure and macros (non-C++). */
1058
/* %if-reentrant */
1059
1060
/* Holds the entire state of the reentrant scanner. */
1061
struct yyguts_t
1062
    {
1063
1064
    /* User-defined. Not touched by flex. */
1065
    YY_EXTRA_TYPE yyextra_r;
1066
1067
    /* The rest are the same as the globals declared in the non-reentrant scanner. */
1068
    FILE *yyin_r, *yyout_r;
1069
    size_t yy_buffer_stack_top; /**< index of top of stack. */
1070
    size_t yy_buffer_stack_max; /**< capacity of stack. */
1071
    YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1072
    char yy_hold_char;
1073
    int yy_n_chars;
1074
    int yyleng_r;
1075
    char *yy_c_buf_p;
1076
    int yy_init;
1077
    int yy_start;
1078
    int yy_did_buffer_switch_on_eof;
1079
    int yy_start_stack_ptr;
1080
    int yy_start_stack_depth;
1081
    int *yy_start_stack;
1082
    yy_state_type yy_last_accepting_state;
1083
    char* yy_last_accepting_cpos;
1084
1085
    int yylineno_r;
1086
    int yy_flex_debug_r;
1087
1088
    char *yytext_r;
1089
    int yy_more_flag;
1090
    int yy_more_len;
1091
1092
    }; /* end struct yyguts_t */
1093
1094
/* %if-c-only */
1095
1096
static int yy_init_globals ( yyscan_t yyscanner );
1097
1098
/* %endif */
1099
1100
/* %if-reentrant */
1101
1102
int yylex_init (yyscan_t* scanner);
1103
1104
int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
1105
1106
/* %endif */
1107
1108
/* %endif End reentrant structures and macros. */
1109
1110
/* Accessor methods to globals.
1111
   These are made visible to non-reentrant scanners for convenience. */
1112
1113
int yylex_destroy ( yyscan_t yyscanner );
1114
1115
int yyget_debug ( yyscan_t yyscanner );
1116
1117
void yyset_debug ( int debug_flag , yyscan_t yyscanner );
1118
1119
YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
1120
1121
void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
1122
1123
FILE *yyget_in ( yyscan_t yyscanner );
1124
1125
void yyset_in  ( FILE * _in_str , yyscan_t yyscanner );
1126
1127
FILE *yyget_out ( yyscan_t yyscanner );
1128
1129
void yyset_out  ( FILE * _out_str , yyscan_t yyscanner );
1130
1131
      int yyget_leng ( yyscan_t yyscanner );
1132
1133
char *yyget_text ( yyscan_t yyscanner );
1134
1135
int yyget_lineno ( yyscan_t yyscanner );
1136
1137
void yyset_lineno ( int _line_number , yyscan_t yyscanner );
1138
1139
int yyget_column  ( yyscan_t yyscanner );
1140
1141
void yyset_column ( int _column_no , yyscan_t yyscanner );
1142
1143
/* %if-bison-bridge */
1144
/* %endif */
1145
1146
/* Macros after this point can all be overridden by user definitions in
1147
 * section 1.
1148
 */
1149
1150
#ifndef YY_SKIP_YYWRAP
1151
#ifdef __cplusplus
1152
extern "C" int yywrap ( yyscan_t yyscanner );
1153
#else
1154
extern int yywrap ( yyscan_t yyscanner );
1155
#endif
1156
#endif
1157
1158
/* %not-for-header */
1159
#ifndef YY_NO_UNPUT
1160
    
1161
#endif
1162
/* %ok-for-header */
1163
1164
/* %endif */
1165
1166
#ifndef yytext_ptr
1167
static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
1168
#endif
1169
1170
#ifdef YY_NEED_STRLEN
1171
static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
1172
#endif
1173
1174
#ifndef YY_NO_INPUT
1175
/* %if-c-only Standard (non-C++) definition */
1176
/* %not-for-header */
1177
#ifdef __cplusplus
1178
static int yyinput ( yyscan_t yyscanner );
1179
#else
1180
static int input ( yyscan_t yyscanner );
1181
#endif
1182
/* %ok-for-header */
1183
1184
/* %endif */
1185
#endif
1186
1187
/* %if-c-only */
1188
1189
/* %endif */
1190
1191
/* Amount of stuff to slurp up with each read. */
1192
#ifndef YY_READ_BUF_SIZE
1193
#ifdef __ia64__
1194
/* On IA-64, the buffer size is 16k, not 8k */
1195
#define YY_READ_BUF_SIZE 16384
1196
#else
1197
0
#define YY_READ_BUF_SIZE 8192
1198
#endif /* __ia64__ */
1199
#endif
1200
1201
/* Copy whatever the last rule matched to the standard output. */
1202
#ifndef ECHO
1203
/* %if-c-only Standard (non-C++) definition */
1204
/* This used to be an fputs(), but since the string might contain NUL's,
1205
 * we now use fwrite().
1206
 */
1207
0
#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1208
/* %endif */
1209
/* %if-c++-only C++ definition */
1210
/* %endif */
1211
#endif
1212
1213
/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1214
 * is returned in "result".
1215
 */
1216
#ifndef YY_INPUT
1217
#define YY_INPUT(buf,result,max_size) \
1218
/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
1219
  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1220
    { \
1221
    int c = '*'; \
1222
    int n; \
1223
    for ( n = 0; n < max_size && \
1224
           (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1225
      buf[n] = (char) c; \
1226
    if ( c == '\n' ) \
1227
      buf[n++] = (char) c; \
1228
    if ( c == EOF && ferror( yyin ) ) \
1229
      YY_FATAL_ERROR( "input in flex scanner failed" ); \
1230
    result = n; \
1231
    } \
1232
  else \
1233
    { \
1234
    errno=0; \
1235
    while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1236
      { \
1237
      if( errno != EINTR) \
1238
        { \
1239
        YY_FATAL_ERROR( "input in flex scanner failed" ); \
1240
        break; \
1241
        } \
1242
      errno=0; \
1243
      clearerr(yyin); \
1244
      } \
1245
    }\
1246
\
1247
/* %if-c++-only C++ definition \ */\
1248
/* %endif */
1249
1250
#endif
1251
1252
/* No semi-colon after return; correct usage is to write "yyterminate();" -
1253
 * we don't want an extra ';' after the "return" because that will cause
1254
 * some compilers to complain about unreachable statements.
1255
 */
1256
#ifndef yyterminate
1257
0
#define yyterminate() return YY_NULL
1258
#endif
1259
1260
/* Number of entries by which start-condition stack grows. */
1261
#ifndef YY_START_STACK_INCR
1262
#define YY_START_STACK_INCR 25
1263
#endif
1264
1265
/* Report a fatal error. */
1266
#ifndef YY_FATAL_ERROR
1267
/* %if-c-only */
1268
0
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1269
/* %endif */
1270
/* %if-c++-only */
1271
/* %endif */
1272
#endif
1273
1274
/* %if-tables-serialization structures and prototypes */
1275
/* %not-for-header */
1276
/* %ok-for-header */
1277
1278
/* %not-for-header */
1279
/* %tables-yydmap generated elements */
1280
/* %endif */
1281
/* end tables serialization structures and prototypes */
1282
1283
/* %ok-for-header */
1284
1285
/* Default declaration of generated scanner - a define so the user can
1286
 * easily add parameters.
1287
 */
1288
#ifndef YY_DECL
1289
#define YY_DECL_IS_OURS 1
1290
/* %if-c-only Standard (non-C++) definition */
1291
1292
extern int yylex (yyscan_t yyscanner);
1293
1294
#define YY_DECL int yylex (yyscan_t yyscanner)
1295
/* %endif */
1296
/* %if-c++-only C++ definition */
1297
/* %endif */
1298
#endif /* !YY_DECL */
1299
1300
/* Code executed at the beginning of each rule, after yytext and yyleng
1301
 * have been set up.
1302
 */
1303
#ifndef YY_USER_ACTION
1304
#define YY_USER_ACTION
1305
#endif
1306
1307
/* Code executed at the end of each rule. */
1308
#ifndef YY_BREAK
1309
0
#define YY_BREAK /*LINTED*/break;
1310
#endif
1311
1312
/* %% [6.0] YY_RULE_SETUP definition goes here */
1313
#define YY_RULE_SETUP \
1314
  YY_USER_ACTION
1315
1316
/* %not-for-header */
1317
/** The main scanner function which does all the work.
1318
 */
1319
YY_DECL
1320
0
{
1321
0
  yy_state_type yy_current_state;
1322
0
  char *yy_cp, *yy_bp;
1323
0
  int yy_act;
1324
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1325
1326
0
  if ( !yyg->yy_init )
1327
0
    {
1328
0
    yyg->yy_init = 1;
1329
1330
0
#ifdef YY_USER_INIT
1331
0
    YY_USER_INIT;
1332
0
#endif
1333
1334
0
    if ( ! yyg->yy_start )
1335
0
      yyg->yy_start = 1; /* first start state */
1336
1337
0
    if ( ! yyin )
1338
/* %if-c-only */
1339
0
      yyin = stdin;
1340
/* %endif */
1341
/* %if-c++-only */
1342
/* %endif */
1343
1344
0
    if ( ! yyout )
1345
/* %if-c-only */
1346
0
      yyout = stdout;
1347
/* %endif */
1348
/* %if-c++-only */
1349
/* %endif */
1350
1351
0
    if ( ! YY_CURRENT_BUFFER ) {
1352
0
      yyensure_buffer_stack (yyscanner);
1353
0
      YY_CURRENT_BUFFER_LVALUE =
1354
0
        yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1355
0
    }
1356
1357
0
    yy_load_buffer_state( yyscanner );
1358
0
    }
1359
1360
0
  {
1361
/* %% [7.0] user's declarations go here */
1362
0
#line 207 "/src/wireshark/epan/dtd_parse.l"
1363
1364
1365
0
#line 1366 "/work/build/epan/dtd_parse.c"
1366
1367
0
  while ( /*CONSTCOND*/1 )    /* loops until end-of-file is reached */
1368
0
    {
1369
/* %% [8.0] yymore()-related code goes here */
1370
0
    yy_cp = yyg->yy_c_buf_p;
1371
1372
    /* Support of yytext. */
1373
0
    *yy_cp = yyg->yy_hold_char;
1374
1375
    /* yy_bp points to the position in yy_ch_buf of the start of
1376
     * the current run.
1377
     */
1378
0
    yy_bp = yy_cp;
1379
1380
/* %% [9.0] code to set up and find next match goes here */
1381
0
    yy_current_state = yyg->yy_start;
1382
0
yy_match:
1383
0
    do
1384
0
      {
1385
0
      YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1386
0
      if ( yy_accept[yy_current_state] )
1387
0
        {
1388
0
        yyg->yy_last_accepting_state = yy_current_state;
1389
0
        yyg->yy_last_accepting_cpos = yy_cp;
1390
0
        }
1391
0
      while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1392
0
        {
1393
0
        yy_current_state = (int) yy_def[yy_current_state];
1394
0
        if ( yy_current_state >= 219 )
1395
0
          yy_c = yy_meta[yy_c];
1396
0
        }
1397
0
      yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1398
0
      ++yy_cp;
1399
0
      }
1400
0
    while ( yy_current_state != 218 );
1401
0
    yy_cp = yyg->yy_last_accepting_cpos;
1402
0
    yy_current_state = yyg->yy_last_accepting_state;
1403
1404
0
yy_find_action:
1405
/* %% [10.0] code to find the action number goes here */
1406
0
    yy_act = yy_accept[yy_current_state];
1407
1408
0
    YY_DO_BEFORE_ACTION;
1409
1410
/* %% [11.0] code for yylineno update goes here */
1411
1412
0
do_action:  /* This label is used only to access EOF actions. */
1413
1414
/* %% [12.0] debug code goes here */
1415
0
    if ( yy_flex_debug )
1416
0
      {
1417
0
      if ( yy_act == 0 )
1418
0
        fprintf( stderr, "--scanner backing up\n" );
1419
0
      else if ( yy_act < 56 )
1420
0
        fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1421
0
                 (long)yy_rule_linenum[yy_act], yytext );
1422
0
      else if ( yy_act == 56 )
1423
0
        fprintf( stderr, "--accepting default rule (\"%s\")\n",
1424
0
                 yytext );
1425
0
      else if ( yy_act == 57 )
1426
0
        fprintf( stderr, "--(end of buffer or a NUL)\n" );
1427
0
      else
1428
0
        fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1429
0
      }
1430
1431
0
    switch ( yy_act )
1432
0
  { /* beginning of action switch */
1433
/* %% [13.0] actions go here */
1434
0
      case 0: /* must back up */
1435
      /* undo the effects of YY_DO_BEFORE_ACTION */
1436
0
      *yy_cp = yyg->yy_hold_char;
1437
0
      yy_cp = yyg->yy_last_accepting_cpos;
1438
0
      yy_current_state = yyg->yy_last_accepting_state;
1439
0
      goto yy_find_action;
1440
1441
0
case 1:
1442
/* rule 1 can match eol */
1443
0
YY_RULE_SETUP
1444
0
#line 209 "/src/wireshark/epan/dtd_parse.l"
1445
0
;
1446
0
  YY_BREAK
1447
0
case 2:
1448
0
YY_RULE_SETUP
1449
0
#line 212 "/src/wireshark/epan/dtd_parse.l"
1450
0
{ BEGIN IN_COMMENT; }
1451
0
  YY_BREAK
1452
0
case 3:
1453
/* rule 3 can match eol */
1454
0
#line 214 "/src/wireshark/epan/dtd_parse.l"
1455
0
case 4:
1456
/* rule 4 can match eol */
1457
0
YY_RULE_SETUP
1458
0
#line 214 "/src/wireshark/epan/dtd_parse.l"
1459
0
;
1460
0
  YY_BREAK
1461
0
case 5:
1462
0
YY_RULE_SETUP
1463
0
#line 215 "/src/wireshark/epan/dtd_parse.l"
1464
0
{ BEGIN DTD; }
1465
0
  YY_BREAK
1466
0
case 6:
1467
0
YY_RULE_SETUP
1468
0
#line 217 "/src/wireshark/epan/dtd_parse.l"
1469
0
{ BEGIN IN_NOTATION; }
1470
0
  YY_BREAK
1471
0
case 7:
1472
/* rule 7 can match eol */
1473
0
YY_RULE_SETUP
1474
0
#line 218 "/src/wireshark/epan/dtd_parse.l"
1475
0
;
1476
0
  YY_BREAK
1477
0
case 8:
1478
0
YY_RULE_SETUP
1479
0
#line 219 "/src/wireshark/epan/dtd_parse.l"
1480
0
{ BEGIN DTD; }
1481
0
  YY_BREAK
1482
0
case 9:
1483
0
YY_RULE_SETUP
1484
0
#line 221 "/src/wireshark/epan/dtd_parse.l"
1485
0
{
1486
0
  BEGIN XMLPI;
1487
0
}
1488
0
  YY_BREAK
1489
0
case 10:
1490
0
YY_RULE_SETUP
1491
0
#line 225 "/src/wireshark/epan/dtd_parse.l"
1492
0
{
1493
0
  BEGIN LOCATION;
1494
0
}
1495
0
  YY_BREAK
1496
0
case 11:
1497
0
YY_RULE_SETUP
1498
0
#line 229 "/src/wireshark/epan/dtd_parse.l"
1499
0
{
1500
0
  BEGIN PROTOCOL;
1501
0
}
1502
0
  YY_BREAK
1503
0
case 12:
1504
0
YY_RULE_SETUP
1505
0
#line 233 "/src/wireshark/epan/dtd_parse.l"
1506
0
;
1507
0
  YY_BREAK
1508
0
case 13:
1509
0
YY_RULE_SETUP
1510
0
#line 234 "/src/wireshark/epan/dtd_parse.l"
1511
0
BEGIN DTD;
1512
0
  YY_BREAK
1513
0
case 14:
1514
/* rule 14 can match eol */
1515
0
YY_RULE_SETUP
1516
0
#line 236 "/src/wireshark/epan/dtd_parse.l"
1517
0
{
1518
0
  g_free(yyextra->location);
1519
0
  yyextra->location = g_strdup(yytext);
1520
0
  BEGIN DONE;
1521
0
}
1522
0
  YY_BREAK
1523
0
case 15:
1524
0
YY_RULE_SETUP
1525
0
#line 242 "/src/wireshark/epan/dtd_parse.l"
1526
0
BEGIN DTD;
1527
0
  YY_BREAK
1528
0
case 16:
1529
0
YY_RULE_SETUP
1530
0
#line 244 "/src/wireshark/epan/dtd_parse.l"
1531
0
{
1532
0
  yyextra->attr_name = g_ascii_strdown(yytext, -1);
1533
0
  BEGIN GET_ATTR_QUOTE;
1534
0
}
1535
0
  YY_BREAK
1536
0
case 17:
1537
0
YY_RULE_SETUP
1538
0
#line 249 "/src/wireshark/epan/dtd_parse.l"
1539
0
{ BEGIN GET_ATTR_VAL; }
1540
0
  YY_BREAK
1541
0
case 18:
1542
0
YY_RULE_SETUP
1543
0
#line 251 "/src/wireshark/epan/dtd_parse.l"
1544
0
{
1545
0
  g_string_append_printf(build_data->error,
1546
0
          "error in wireshark:protocol xmpli at %s : could not find attribute value!",
1547
0
          yyextra->location);
1548
0
  yyterminate();
1549
0
}
1550
0
  YY_BREAK
1551
0
case 19:
1552
/* rule 19 can match eol */
1553
0
YY_RULE_SETUP
1554
0
#line 258 "/src/wireshark/epan/dtd_parse.l"
1555
0
{
1556
  /*"*/
1557
0
  struct _proto_xmlpi_attr* pa;
1558
0
  bool got_it = false;
1559
0
  static struct _proto_xmlpi_attr proto_attrs[] =
1560
0
  {
1561
0
    { "proto_name", set_proto_name },
1562
0
    { "media", set_media_type },
1563
0
    { "root", set_proto_root },
1564
0
    { "description", set_description },
1565
0
    { "hierarchy", set_recursive },
1566
0
    {NULL,NULL}
1567
0
  };
1568
1569
0
  for(pa = proto_attrs; pa->name; pa++) {
1570
0
    if (g_ascii_strcasecmp(yyextra->attr_name,pa->name) == 0) {
1571
0
      pa->act(yytext);
1572
0
      got_it = true;
1573
0
      break;
1574
0
    }
1575
0
  }
1576
1577
0
  if (! got_it) {
1578
0
    g_string_append_printf(build_data->error,
1579
0
            "error in wireshark:protocol xmpli at %s : no such parameter %s!",
1580
0
            yyextra->location, yyextra->attr_name);
1581
0
    g_free(yyextra->attr_name);
1582
0
    yyterminate();
1583
0
  }
1584
1585
0
  g_free(yyextra->attr_name);
1586
1587
0
  BEGIN GET_ATTR_CLOSE_QUOTE;
1588
0
}
1589
0
  YY_BREAK
1590
0
case 20:
1591
0
YY_RULE_SETUP
1592
0
#line 293 "/src/wireshark/epan/dtd_parse.l"
1593
0
{ BEGIN PROTOCOL;}
1594
0
  YY_BREAK
1595
0
case 21:
1596
0
YY_RULE_SETUP
1597
0
#line 295 "/src/wireshark/epan/dtd_parse.l"
1598
0
BEGIN DTD;
1599
0
  YY_BREAK
1600
0
case 22:
1601
0
YY_RULE_SETUP
1602
0
#line 297 "/src/wireshark/epan/dtd_parse.l"
1603
0
{ DTD_PARSE(TOKEN_TAG_START); }
1604
0
  YY_BREAK
1605
0
case 23:
1606
0
YY_RULE_SETUP
1607
0
#line 298 "/src/wireshark/epan/dtd_parse.l"
1608
0
{ DTD_PARSE(TOKEN_TAG_STOP); }
1609
0
  YY_BREAK
1610
0
case 24:
1611
0
YY_RULE_SETUP
1612
0
#line 300 "/src/wireshark/epan/dtd_parse.l"
1613
0
{ DTD_PARSE(TOKEN_ATTLIST_KW); }
1614
0
  YY_BREAK
1615
0
case 25:
1616
0
YY_RULE_SETUP
1617
0
#line 301 "/src/wireshark/epan/dtd_parse.l"
1618
0
{ DTD_PARSE(TOKEN_ELEMENT_KW); }
1619
0
  YY_BREAK
1620
0
case 26:
1621
0
YY_RULE_SETUP
1622
0
#line 302 "/src/wireshark/epan/dtd_parse.l"
1623
0
{ DTD_PARSE(TOKEN_DOCTYPE_KW); }
1624
0
  YY_BREAK
1625
0
case 27:
1626
0
YY_RULE_SETUP
1627
0
#line 304 "/src/wireshark/epan/dtd_parse.l"
1628
0
{ DTD_PARSE(TOKEN_ELEM_DATA); }
1629
0
  YY_BREAK
1630
0
case 28:
1631
0
YY_RULE_SETUP
1632
0
#line 305 "/src/wireshark/epan/dtd_parse.l"
1633
0
{ DTD_PARSE(TOKEN_ELEM_DATA); }
1634
0
  YY_BREAK
1635
0
case 29:
1636
0
YY_RULE_SETUP
1637
0
#line 306 "/src/wireshark/epan/dtd_parse.l"
1638
0
{ DTD_PARSE(TOKEN_ELEM_DATA); }
1639
0
  YY_BREAK
1640
0
case 30:
1641
0
YY_RULE_SETUP
1642
0
#line 307 "/src/wireshark/epan/dtd_parse.l"
1643
0
{ DTD_PARSE(TOKEN_EMPTY_KW); }
1644
0
  YY_BREAK
1645
0
case 31:
1646
0
YY_RULE_SETUP
1647
0
#line 309 "/src/wireshark/epan/dtd_parse.l"
1648
0
{ DTD_PARSE(TOKEN_ATT_TYPE); }
1649
0
  YY_BREAK
1650
0
case 32:
1651
0
YY_RULE_SETUP
1652
0
#line 310 "/src/wireshark/epan/dtd_parse.l"
1653
0
{ DTD_PARSE(TOKEN_ATT_TYPE); }
1654
0
  YY_BREAK
1655
0
case 33:
1656
0
YY_RULE_SETUP
1657
0
#line 311 "/src/wireshark/epan/dtd_parse.l"
1658
0
{ DTD_PARSE(TOKEN_ATT_TYPE); }
1659
0
  YY_BREAK
1660
0
case 34:
1661
0
YY_RULE_SETUP
1662
0
#line 312 "/src/wireshark/epan/dtd_parse.l"
1663
0
{ DTD_PARSE(TOKEN_ATT_TYPE); }
1664
0
  YY_BREAK
1665
0
case 35:
1666
0
YY_RULE_SETUP
1667
0
#line 313 "/src/wireshark/epan/dtd_parse.l"
1668
0
{ DTD_PARSE(TOKEN_ATT_TYPE); }
1669
0
  YY_BREAK
1670
0
case 36:
1671
0
YY_RULE_SETUP
1672
0
#line 314 "/src/wireshark/epan/dtd_parse.l"
1673
0
{ DTD_PARSE(TOKEN_ATT_TYPE); }
1674
0
  YY_BREAK
1675
0
case 37:
1676
0
YY_RULE_SETUP
1677
0
#line 315 "/src/wireshark/epan/dtd_parse.l"
1678
0
{ DTD_PARSE(TOKEN_ATT_TYPE); }
1679
0
  YY_BREAK
1680
0
case 38:
1681
0
YY_RULE_SETUP
1682
0
#line 316 "/src/wireshark/epan/dtd_parse.l"
1683
0
{ DTD_PARSE(TOKEN_ATT_TYPE); }
1684
0
  YY_BREAK
1685
0
case 39:
1686
0
YY_RULE_SETUP
1687
0
#line 317 "/src/wireshark/epan/dtd_parse.l"
1688
0
{ DTD_PARSE(TOKEN_ATT_TYPE); }
1689
0
  YY_BREAK
1690
0
case 40:
1691
0
YY_RULE_SETUP
1692
0
#line 318 "/src/wireshark/epan/dtd_parse.l"
1693
0
{ DTD_PARSE(TOKEN_ATT_DEF_WITH_VALUE); }
1694
0
  YY_BREAK
1695
0
case 41:
1696
0
YY_RULE_SETUP
1697
0
#line 319 "/src/wireshark/epan/dtd_parse.l"
1698
0
{ DTD_PARSE(TOKEN_ATT_DEF_WITH_VALUE); }
1699
0
  YY_BREAK
1700
0
case 42:
1701
0
YY_RULE_SETUP
1702
0
#line 320 "/src/wireshark/epan/dtd_parse.l"
1703
0
{ DTD_PARSE(TOKEN_ATT_DEF); }
1704
0
  YY_BREAK
1705
0
case 43:
1706
0
YY_RULE_SETUP
1707
0
#line 321 "/src/wireshark/epan/dtd_parse.l"
1708
0
{ DTD_PARSE(TOKEN_ATT_DEF); }
1709
0
  YY_BREAK
1710
0
case 44:
1711
0
YY_RULE_SETUP
1712
0
#line 323 "/src/wireshark/epan/dtd_parse.l"
1713
0
{ DTD_PARSE(TOKEN_STAR); }
1714
0
  YY_BREAK
1715
0
case 45:
1716
0
YY_RULE_SETUP
1717
0
#line 324 "/src/wireshark/epan/dtd_parse.l"
1718
0
{ DTD_PARSE(TOKEN_QUESTION); }
1719
0
  YY_BREAK
1720
0
case 46:
1721
0
YY_RULE_SETUP
1722
0
#line 325 "/src/wireshark/epan/dtd_parse.l"
1723
0
{ DTD_PARSE(TOKEN_PLUS); }
1724
0
  YY_BREAK
1725
0
case 47:
1726
0
YY_RULE_SETUP
1727
0
#line 326 "/src/wireshark/epan/dtd_parse.l"
1728
0
{ DTD_PARSE(TOKEN_COMMA); }
1729
0
  YY_BREAK
1730
0
case 48:
1731
0
YY_RULE_SETUP
1732
0
#line 327 "/src/wireshark/epan/dtd_parse.l"
1733
0
{ DTD_PARSE(TOKEN_OPEN_PARENS); }
1734
0
  YY_BREAK
1735
0
case 49:
1736
0
YY_RULE_SETUP
1737
0
#line 328 "/src/wireshark/epan/dtd_parse.l"
1738
0
{ DTD_PARSE(TOKEN_CLOSE_PARENS); }
1739
0
  YY_BREAK
1740
0
case 50:
1741
0
YY_RULE_SETUP
1742
0
#line 329 "/src/wireshark/epan/dtd_parse.l"
1743
0
{ DTD_PARSE(TOKEN_OPEN_BRACKET); }
1744
0
  YY_BREAK
1745
0
case 51:
1746
0
YY_RULE_SETUP
1747
0
#line 330 "/src/wireshark/epan/dtd_parse.l"
1748
0
{ DTD_PARSE(TOKEN_CLOSE_BRACKET); }
1749
0
  YY_BREAK
1750
0
case 52:
1751
0
YY_RULE_SETUP
1752
0
#line 331 "/src/wireshark/epan/dtd_parse.l"
1753
0
{ DTD_PARSE(TOKEN_PIPE); }
1754
0
  YY_BREAK
1755
0
case 53:
1756
/* rule 53 can match eol */
1757
0
#line 334 "/src/wireshark/epan/dtd_parse.l"
1758
0
case 54:
1759
/* rule 54 can match eol */
1760
0
YY_RULE_SETUP
1761
0
#line 334 "/src/wireshark/epan/dtd_parse.l"
1762
0
{ DTD_PARSE(TOKEN_QUOTED); }
1763
0
  YY_BREAK
1764
0
case 55:
1765
0
YY_RULE_SETUP
1766
0
#line 335 "/src/wireshark/epan/dtd_parse.l"
1767
0
{ DTD_PARSE(TOKEN_NAME); }
1768
0
  YY_BREAK
1769
0
case 56:
1770
0
YY_RULE_SETUP
1771
0
#line 337 "/src/wireshark/epan/dtd_parse.l"
1772
0
ECHO;
1773
0
  YY_BREAK
1774
0
#line 1775 "/work/build/epan/dtd_parse.c"
1775
0
case YY_STATE_EOF(INITIAL):
1776
0
case YY_STATE_EOF(DTD):
1777
0
case YY_STATE_EOF(XMLPI):
1778
0
case YY_STATE_EOF(LOCATION):
1779
0
case YY_STATE_EOF(DONE):
1780
0
case YY_STATE_EOF(PROTOCOL):
1781
0
case YY_STATE_EOF(GET_ATTR_QUOTE):
1782
0
case YY_STATE_EOF(GET_ATTR_VAL):
1783
0
case YY_STATE_EOF(GET_ATTR_CLOSE_QUOTE):
1784
0
case YY_STATE_EOF(IN_COMMENT):
1785
0
case YY_STATE_EOF(IN_NOTATION):
1786
0
  yyterminate();
1787
1788
0
  case YY_END_OF_BUFFER:
1789
0
    {
1790
    /* Amount of text matched not including the EOB char. */
1791
0
    int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1792
1793
    /* Undo the effects of YY_DO_BEFORE_ACTION. */
1794
0
    *yy_cp = yyg->yy_hold_char;
1795
0
    YY_RESTORE_YY_MORE_OFFSET
1796
1797
0
    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1798
0
      {
1799
      /* We're scanning a new file or input source.  It's
1800
       * possible that this happened because the user
1801
       * just pointed yyin at a new source and called
1802
       * yylex().  If so, then we have to assure
1803
       * consistency between YY_CURRENT_BUFFER and our
1804
       * globals.  Here is the right place to do so, because
1805
       * this is the first action (other than possibly a
1806
       * back-up) that will match for the new input source.
1807
       */
1808
0
      yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1809
/* %if-c-only */
1810
0
      YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1811
/* %endif */
1812
/* %if-c++-only */
1813
/* %endif */
1814
0
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1815
0
      }
1816
1817
    /* Note that here we test for yy_c_buf_p "<=" to the position
1818
     * of the first EOB in the buffer, since yy_c_buf_p will
1819
     * already have been incremented past the NUL character
1820
     * (since all states make transitions on EOB to the
1821
     * end-of-buffer state).  Contrast this with the test
1822
     * in input().
1823
     */
1824
0
    if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1825
0
      { /* This was really a NUL. */
1826
0
      yy_state_type yy_next_state;
1827
1828
0
      yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1829
1830
0
      yy_current_state = yy_get_previous_state( yyscanner );
1831
1832
      /* Okay, we're now positioned to make the NUL
1833
       * transition.  We couldn't have
1834
       * yy_get_previous_state() go ahead and do it
1835
       * for us because it doesn't know how to deal
1836
       * with the possibility of jamming (and we don't
1837
       * want to build jamming into it because then it
1838
       * will run more slowly).
1839
       */
1840
1841
0
      yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1842
1843
0
      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1844
1845
0
      if ( yy_next_state )
1846
0
        {
1847
        /* Consume the NUL. */
1848
0
        yy_cp = ++yyg->yy_c_buf_p;
1849
0
        yy_current_state = yy_next_state;
1850
0
        goto yy_match;
1851
0
        }
1852
1853
0
      else
1854
0
        {
1855
/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
1856
0
        yy_cp = yyg->yy_last_accepting_cpos;
1857
0
        yy_current_state = yyg->yy_last_accepting_state;
1858
0
        goto yy_find_action;
1859
0
        }
1860
0
      }
1861
1862
0
    else switch ( yy_get_next_buffer( yyscanner ) )
1863
0
      {
1864
0
      case EOB_ACT_END_OF_FILE:
1865
0
        {
1866
0
        yyg->yy_did_buffer_switch_on_eof = 0;
1867
1868
0
        if ( yywrap( yyscanner ) )
1869
0
          {
1870
          /* Note: because we've taken care in
1871
           * yy_get_next_buffer() to have set up
1872
           * yytext, we can now set up
1873
           * yy_c_buf_p so that if some total
1874
           * hoser (like flex itself) wants to
1875
           * call the scanner after we return the
1876
           * YY_NULL, it'll still work - another
1877
           * YY_NULL will get returned.
1878
           */
1879
0
          yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1880
1881
0
          yy_act = YY_STATE_EOF(YY_START);
1882
0
          goto do_action;
1883
0
          }
1884
1885
0
        else
1886
0
          {
1887
0
          if ( ! yyg->yy_did_buffer_switch_on_eof )
1888
0
            YY_NEW_FILE;
1889
0
          }
1890
0
        break;
1891
0
        }
1892
1893
0
      case EOB_ACT_CONTINUE_SCAN:
1894
0
        yyg->yy_c_buf_p =
1895
0
          yyg->yytext_ptr + yy_amount_of_matched_text;
1896
1897
0
        yy_current_state = yy_get_previous_state( yyscanner );
1898
1899
0
        yy_cp = yyg->yy_c_buf_p;
1900
0
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1901
0
        goto yy_match;
1902
1903
0
      case EOB_ACT_LAST_MATCH:
1904
0
        yyg->yy_c_buf_p =
1905
0
        &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1906
1907
0
        yy_current_state = yy_get_previous_state( yyscanner );
1908
1909
0
        yy_cp = yyg->yy_c_buf_p;
1910
0
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1911
0
        goto yy_find_action;
1912
0
      }
1913
0
    break;
1914
0
    }
1915
1916
0
  default:
1917
0
    YY_FATAL_ERROR(
1918
0
      "fatal flex scanner internal error--no action found" );
1919
0
  } /* end of action switch */
1920
0
    } /* end of scanning one token */
1921
0
  } /* end of user's declarations */
1922
0
} /* end of yylex */
1923
/* %ok-for-header */
1924
1925
/* %if-c++-only */
1926
/* %not-for-header */
1927
/* %ok-for-header */
1928
1929
/* %endif */
1930
1931
/* yy_get_next_buffer - try to read in a new buffer
1932
 *
1933
 * Returns a code representing an action:
1934
 *  EOB_ACT_LAST_MATCH -
1935
 *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1936
 *  EOB_ACT_END_OF_FILE - end of file
1937
 */
1938
/* %if-c-only */
1939
static int yy_get_next_buffer (yyscan_t yyscanner)
1940
/* %endif */
1941
/* %if-c++-only */
1942
/* %endif */
1943
0
{
1944
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1945
0
  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1946
0
  char *source = yyg->yytext_ptr;
1947
0
  int number_to_move, i;
1948
0
  int ret_val;
1949
1950
0
  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1951
0
    YY_FATAL_ERROR(
1952
0
    "fatal flex scanner internal error--end of buffer missed" );
1953
1954
0
  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1955
0
    { /* Don't try to fill the buffer, so this is an EOF. */
1956
0
    if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1957
0
      {
1958
      /* We matched a single character, the EOB, so
1959
       * treat this as a final EOF.
1960
       */
1961
0
      return EOB_ACT_END_OF_FILE;
1962
0
      }
1963
1964
0
    else
1965
0
      {
1966
      /* We matched some text prior to the EOB, first
1967
       * process it.
1968
       */
1969
0
      return EOB_ACT_LAST_MATCH;
1970
0
      }
1971
0
    }
1972
1973
  /* Try to read more data. */
1974
1975
  /* First move last chars to start of buffer. */
1976
0
  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
1977
1978
0
  for ( i = 0; i < number_to_move; ++i )
1979
0
    *(dest++) = *(source++);
1980
1981
0
  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1982
    /* don't do the read, it's not guaranteed to return an EOF,
1983
     * just force an EOF
1984
     */
1985
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1986
1987
0
  else
1988
0
    {
1989
0
      int num_to_read =
1990
0
      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1991
1992
0
    while ( num_to_read <= 0 )
1993
0
      { /* Not enough room in the buffer - grow it. */
1994
1995
      /* just a shorter name for the current buffer */
1996
0
      YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1997
1998
0
      int yy_c_buf_p_offset =
1999
0
        (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2000
2001
0
      if ( b->yy_is_our_buffer )
2002
0
        {
2003
0
        int new_size = b->yy_buf_size * 2;
2004
2005
0
        if ( new_size <= 0 )
2006
0
          b->yy_buf_size += b->yy_buf_size / 8;
2007
0
        else
2008
0
          b->yy_buf_size *= 2;
2009
2010
0
        b->yy_ch_buf = (char *)
2011
          /* Include room in for 2 EOB chars. */
2012
0
          yyrealloc( (void *) b->yy_ch_buf,
2013
0
               (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
2014
0
        }
2015
0
      else
2016
        /* Can't grow it, we don't own it. */
2017
0
        b->yy_ch_buf = NULL;
2018
2019
0
      if ( ! b->yy_ch_buf )
2020
0
        YY_FATAL_ERROR(
2021
0
        "fatal error - scanner input buffer overflow" );
2022
2023
0
      yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2024
2025
0
      num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2026
0
            number_to_move - 1;
2027
2028
0
      }
2029
2030
0
    if ( num_to_read > YY_READ_BUF_SIZE )
2031
0
      num_to_read = YY_READ_BUF_SIZE;
2032
2033
    /* Read in more data. */
2034
0
    YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2035
0
      yyg->yy_n_chars, num_to_read );
2036
2037
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2038
0
    }
2039
2040
0
  if ( yyg->yy_n_chars == 0 )
2041
0
    {
2042
0
    if ( number_to_move == YY_MORE_ADJ )
2043
0
      {
2044
0
      ret_val = EOB_ACT_END_OF_FILE;
2045
0
      yyrestart( yyin  , yyscanner);
2046
0
      }
2047
2048
0
    else
2049
0
      {
2050
0
      ret_val = EOB_ACT_LAST_MATCH;
2051
0
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2052
0
        YY_BUFFER_EOF_PENDING;
2053
0
      }
2054
0
    }
2055
2056
0
  else
2057
0
    ret_val = EOB_ACT_CONTINUE_SCAN;
2058
2059
0
  if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2060
    /* Extend the array by 50%, plus the number we really need. */
2061
0
    int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2062
0
    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
2063
0
      (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
2064
0
    if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2065
0
      YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2066
    /* "- 2" to take care of EOB's */
2067
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
2068
0
  }
2069
2070
0
  yyg->yy_n_chars += number_to_move;
2071
0
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2072
0
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2073
2074
0
  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2075
2076
0
  return ret_val;
2077
0
}
2078
2079
/* yy_get_previous_state - get the state just before the EOB char was reached */
2080
2081
/* %if-c-only */
2082
/* %not-for-header */
2083
    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2084
/* %endif */
2085
/* %if-c++-only */
2086
/* %endif */
2087
0
{
2088
0
  yy_state_type yy_current_state;
2089
0
  char *yy_cp;
2090
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2091
2092
/* %% [15.0] code to get the start state into yy_current_state goes here */
2093
0
  yy_current_state = yyg->yy_start;
2094
2095
0
  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2096
0
    {
2097
/* %% [16.0] code to find the next state goes here */
2098
0
    YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2099
0
    if ( yy_accept[yy_current_state] )
2100
0
      {
2101
0
      yyg->yy_last_accepting_state = yy_current_state;
2102
0
      yyg->yy_last_accepting_cpos = yy_cp;
2103
0
      }
2104
0
    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2105
0
      {
2106
0
      yy_current_state = (int) yy_def[yy_current_state];
2107
0
      if ( yy_current_state >= 219 )
2108
0
        yy_c = yy_meta[yy_c];
2109
0
      }
2110
0
    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2111
0
    }
2112
2113
0
  return yy_current_state;
2114
0
}
2115
2116
/* yy_try_NUL_trans - try to make a transition on the NUL character
2117
 *
2118
 * synopsis
2119
 *  next_state = yy_try_NUL_trans( current_state );
2120
 */
2121
/* %if-c-only */
2122
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
2123
/* %endif */
2124
/* %if-c++-only */
2125
/* %endif */
2126
0
{
2127
0
  int yy_is_jam;
2128
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2129
/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
2130
0
  char *yy_cp = yyg->yy_c_buf_p;
2131
2132
0
  YY_CHAR yy_c = 1;
2133
0
  if ( yy_accept[yy_current_state] )
2134
0
    {
2135
0
    yyg->yy_last_accepting_state = yy_current_state;
2136
0
    yyg->yy_last_accepting_cpos = yy_cp;
2137
0
    }
2138
0
  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2139
0
    {
2140
0
    yy_current_state = (int) yy_def[yy_current_state];
2141
0
    if ( yy_current_state >= 219 )
2142
0
      yy_c = yy_meta[yy_c];
2143
0
    }
2144
0
  yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2145
0
  yy_is_jam = (yy_current_state == 218);
2146
2147
0
  (void)yyg;
2148
0
  return yy_is_jam ? 0 : yy_current_state;
2149
0
}
2150
2151
#ifndef YY_NO_UNPUT
2152
/* %if-c-only */
2153
2154
/* %endif */
2155
#endif
2156
2157
/* %if-c-only */
2158
#ifndef YY_NO_INPUT
2159
#ifdef __cplusplus
2160
    static int yyinput (yyscan_t yyscanner)
2161
#else
2162
    static int input  (yyscan_t yyscanner)
2163
#endif
2164
2165
/* %endif */
2166
/* %if-c++-only */
2167
/* %endif */
2168
{
2169
  int c;
2170
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2171
2172
  *yyg->yy_c_buf_p = yyg->yy_hold_char;
2173
2174
  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2175
    {
2176
    /* yy_c_buf_p now points to the character we want to return.
2177
     * If this occurs *before* the EOB characters, then it's a
2178
     * valid NUL; if not, then we've hit the end of the buffer.
2179
     */
2180
    if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2181
      /* This was really a NUL. */
2182
      *yyg->yy_c_buf_p = '\0';
2183
2184
    else
2185
      { /* need more input */
2186
      int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
2187
      ++yyg->yy_c_buf_p;
2188
2189
      switch ( yy_get_next_buffer( yyscanner ) )
2190
        {
2191
        case EOB_ACT_LAST_MATCH:
2192
          /* This happens because yy_g_n_b()
2193
           * sees that we've accumulated a
2194
           * token and flags that we need to
2195
           * try matching the token before
2196
           * proceeding.  But for input(),
2197
           * there's no matching to consider.
2198
           * So convert the EOB_ACT_LAST_MATCH
2199
           * to EOB_ACT_END_OF_FILE.
2200
           */
2201
2202
          /* Reset buffer status. */
2203
          yyrestart( yyin , yyscanner);
2204
2205
          /*FALLTHROUGH*/
2206
2207
        case EOB_ACT_END_OF_FILE:
2208
          {
2209
          if ( yywrap( yyscanner ) )
2210
            return 0;
2211
2212
          if ( ! yyg->yy_did_buffer_switch_on_eof )
2213
            YY_NEW_FILE;
2214
#ifdef __cplusplus
2215
          return yyinput(yyscanner);
2216
#else
2217
          return input(yyscanner);
2218
#endif
2219
          }
2220
2221
        case EOB_ACT_CONTINUE_SCAN:
2222
          yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2223
          break;
2224
        }
2225
      }
2226
    }
2227
2228
  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2229
  *yyg->yy_c_buf_p = '\0';  /* preserve yytext */
2230
  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2231
2232
/* %% [19.0] update BOL and yylineno */
2233
2234
  return c;
2235
}
2236
/* %if-c-only */
2237
#endif  /* ifndef YY_NO_INPUT */
2238
/* %endif */
2239
2240
/** Immediately switch to a different input stream.
2241
 * @param input_file A readable stream.
2242
 * @param yyscanner The scanner object.
2243
 * @note This function does not reset the start condition to @c INITIAL .
2244
 */
2245
/* %if-c-only */
2246
    void yyrestart  (FILE * input_file , yyscan_t yyscanner)
2247
/* %endif */
2248
/* %if-c++-only */
2249
/* %endif */
2250
0
{
2251
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2252
2253
0
  if ( ! YY_CURRENT_BUFFER ){
2254
0
        yyensure_buffer_stack (yyscanner);
2255
0
    YY_CURRENT_BUFFER_LVALUE =
2256
0
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
2257
0
  }
2258
2259
0
  yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
2260
0
  yy_load_buffer_state( yyscanner );
2261
0
}
2262
2263
/* %if-c++-only */
2264
/* %endif */
2265
2266
/** Switch to a different input buffer.
2267
 * @param new_buffer The new input buffer.
2268
 * @param yyscanner The scanner object.
2269
 */
2270
/* %if-c-only */
2271
    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
2272
/* %endif */
2273
/* %if-c++-only */
2274
/* %endif */
2275
0
{
2276
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2277
2278
  /* TODO. We should be able to replace this entire function body
2279
   * with
2280
   *    yypop_buffer_state();
2281
   *    yypush_buffer_state(new_buffer);
2282
     */
2283
0
  yyensure_buffer_stack (yyscanner);
2284
0
  if ( YY_CURRENT_BUFFER == new_buffer )
2285
0
    return;
2286
2287
0
  if ( YY_CURRENT_BUFFER )
2288
0
    {
2289
    /* Flush out information for old buffer. */
2290
0
    *yyg->yy_c_buf_p = yyg->yy_hold_char;
2291
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2292
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2293
0
    }
2294
2295
0
  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2296
0
  yy_load_buffer_state( yyscanner );
2297
2298
  /* We don't actually know whether we did this switch during
2299
   * EOF (yywrap()) processing, but the only time this flag
2300
   * is looked at is after yywrap() is called, so it's safe
2301
   * to go ahead and always set it.
2302
   */
2303
0
  yyg->yy_did_buffer_switch_on_eof = 1;
2304
0
}
2305
2306
/* %if-c-only */
2307
static void yy_load_buffer_state  (yyscan_t yyscanner)
2308
/* %endif */
2309
/* %if-c++-only */
2310
/* %endif */
2311
0
{
2312
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2313
0
  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2314
0
  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2315
/* %if-c-only */
2316
0
  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2317
/* %endif */
2318
/* %if-c++-only */
2319
/* %endif */
2320
0
  yyg->yy_hold_char = *yyg->yy_c_buf_p;
2321
0
}
2322
2323
/** Allocate and initialize an input buffer state.
2324
 * @param file A readable stream.
2325
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2326
 * @param yyscanner The scanner object.
2327
 * @return the allocated buffer state.
2328
 */
2329
/* %if-c-only */
2330
    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
2331
/* %endif */
2332
/* %if-c++-only */
2333
/* %endif */
2334
0
{
2335
0
  YY_BUFFER_STATE b;
2336
    
2337
0
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2338
0
  if ( ! b )
2339
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2340
2341
0
  b->yy_buf_size = size;
2342
2343
  /* yy_ch_buf has to be 2 characters longer than the size given because
2344
   * we need to put in 2 end-of-buffer characters.
2345
   */
2346
0
  b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
2347
0
  if ( ! b->yy_ch_buf )
2348
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2349
2350
0
  b->yy_is_our_buffer = 1;
2351
2352
0
  yy_init_buffer( b, file , yyscanner);
2353
2354
0
  return b;
2355
0
}
2356
2357
/* %if-c++-only */
2358
/* %endif */
2359
2360
/** Destroy the buffer.
2361
 * @param b a buffer created with yy_create_buffer()
2362
 * @param yyscanner The scanner object.
2363
 */
2364
/* %if-c-only */
2365
    void yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
2366
/* %endif */
2367
/* %if-c++-only */
2368
/* %endif */
2369
0
{
2370
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2371
2372
0
  if ( ! b )
2373
0
    return;
2374
2375
0
  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2376
0
    YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2377
2378
0
  if ( b->yy_is_our_buffer )
2379
0
    yyfree( (void *) b->yy_ch_buf , yyscanner );
2380
2381
0
  yyfree( (void *) b , yyscanner );
2382
0
}
2383
2384
/* Initializes or reinitializes a buffer.
2385
 * This function is sometimes called more than once on the same buffer,
2386
 * such as during a yyrestart() or at EOF.
2387
 */
2388
/* %if-c-only */
2389
    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
2390
/* %endif */
2391
/* %if-c++-only */
2392
/* %endif */
2393
2394
0
{
2395
0
  int oerrno = errno;
2396
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2397
2398
0
  yy_flush_buffer( b , yyscanner);
2399
2400
/* %if-c-only */
2401
0
  b->yy_input_file = file;
2402
/* %endif */
2403
/* %if-c++-only */
2404
/* %endif */
2405
0
  b->yy_fill_buffer = 1;
2406
2407
    /* If b is the current buffer, then yy_init_buffer was _probably_
2408
     * called from yyrestart() or through yy_get_next_buffer.
2409
     * In that case, we don't want to reset the lineno or column.
2410
     */
2411
0
    if (b != YY_CURRENT_BUFFER){
2412
0
        b->yy_bs_lineno = 1;
2413
0
        b->yy_bs_column = 0;
2414
0
    }
2415
2416
/* %if-c-only */
2417
2418
0
        b->yy_is_interactive = 0;
2419
    
2420
/* %endif */
2421
/* %if-c++-only */
2422
/* %endif */
2423
0
  errno = oerrno;
2424
0
}
2425
2426
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2427
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2428
 * @param yyscanner The scanner object.
2429
 */
2430
/* %if-c-only */
2431
    void yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
2432
/* %endif */
2433
/* %if-c++-only */
2434
/* %endif */
2435
0
{
2436
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2437
0
  if ( ! b )
2438
0
    return;
2439
2440
0
  b->yy_n_chars = 0;
2441
2442
  /* We always need two end-of-buffer characters.  The first causes
2443
   * a transition to the end-of-buffer state.  The second causes
2444
   * a jam in that state.
2445
   */
2446
0
  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2447
0
  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2448
2449
0
  b->yy_buf_pos = &b->yy_ch_buf[0];
2450
2451
0
  b->yy_at_bol = 1;
2452
0
  b->yy_buffer_status = YY_BUFFER_NEW;
2453
2454
0
  if ( b == YY_CURRENT_BUFFER )
2455
0
    yy_load_buffer_state( yyscanner );
2456
0
}
2457
2458
/* %if-c-or-c++ */
2459
/** Pushes the new state onto the stack. The new state becomes
2460
 *  the current state. This function will allocate the stack
2461
 *  if necessary.
2462
 *  @param new_buffer The new state.
2463
 *  @param yyscanner The scanner object.
2464
 */
2465
/* %if-c-only */
2466
void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2467
/* %endif */
2468
/* %if-c++-only */
2469
/* %endif */
2470
0
{
2471
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2472
0
  if (new_buffer == NULL)
2473
0
    return;
2474
2475
0
  yyensure_buffer_stack(yyscanner);
2476
2477
  /* This block is copied from yy_switch_to_buffer. */
2478
0
  if ( YY_CURRENT_BUFFER )
2479
0
    {
2480
    /* Flush out information for old buffer. */
2481
0
    *yyg->yy_c_buf_p = yyg->yy_hold_char;
2482
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2483
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2484
0
    }
2485
2486
  /* Only push if top exists. Otherwise, replace top. */
2487
0
  if (YY_CURRENT_BUFFER)
2488
0
    yyg->yy_buffer_stack_top++;
2489
0
  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2490
2491
  /* copied from yy_switch_to_buffer. */
2492
0
  yy_load_buffer_state( yyscanner );
2493
0
  yyg->yy_did_buffer_switch_on_eof = 1;
2494
0
}
2495
/* %endif */
2496
2497
/* %if-c-or-c++ */
2498
/** Removes and deletes the top of the stack, if present.
2499
 *  The next element becomes the new top.
2500
 *  @param yyscanner The scanner object.
2501
 */
2502
/* %if-c-only */
2503
void yypop_buffer_state (yyscan_t yyscanner)
2504
/* %endif */
2505
/* %if-c++-only */
2506
/* %endif */
2507
0
{
2508
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2509
0
  if (!YY_CURRENT_BUFFER)
2510
0
    return;
2511
2512
0
  yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
2513
0
  YY_CURRENT_BUFFER_LVALUE = NULL;
2514
0
  if (yyg->yy_buffer_stack_top > 0)
2515
0
    --yyg->yy_buffer_stack_top;
2516
2517
0
  if (YY_CURRENT_BUFFER) {
2518
0
    yy_load_buffer_state( yyscanner );
2519
0
    yyg->yy_did_buffer_switch_on_eof = 1;
2520
0
  }
2521
0
}
2522
/* %endif */
2523
2524
/* %if-c-or-c++ */
2525
/* Allocates the stack if it does not exist.
2526
 *  Guarantees space for at least one push.
2527
 */
2528
/* %if-c-only */
2529
static void yyensure_buffer_stack (yyscan_t yyscanner)
2530
/* %endif */
2531
/* %if-c++-only */
2532
/* %endif */
2533
0
{
2534
0
  yy_size_t num_to_alloc;
2535
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2536
2537
0
  if (!yyg->yy_buffer_stack) {
2538
2539
    /* First allocation is just for 2 elements, since we don't know if this
2540
     * scanner will even need a stack. We use 2 instead of 1 to avoid an
2541
     * immediate realloc on the next call.
2542
         */
2543
0
      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2544
0
    yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
2545
0
                (num_to_alloc * sizeof(struct yy_buffer_state*)
2546
0
                , yyscanner);
2547
0
    if ( ! yyg->yy_buffer_stack )
2548
0
      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2549
2550
0
    memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2551
2552
0
    yyg->yy_buffer_stack_max = num_to_alloc;
2553
0
    yyg->yy_buffer_stack_top = 0;
2554
0
    return;
2555
0
  }
2556
2557
0
  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2558
2559
    /* Increase the buffer to prepare for a possible push. */
2560
0
    yy_size_t grow_size = 8 /* arbitrary grow size */;
2561
2562
0
    num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2563
0
    yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
2564
0
                (yyg->yy_buffer_stack,
2565
0
                num_to_alloc * sizeof(struct yy_buffer_state*)
2566
0
                , yyscanner);
2567
0
    if ( ! yyg->yy_buffer_stack )
2568
0
      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2569
2570
    /* zero only the new slots.*/
2571
0
    memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2572
0
    yyg->yy_buffer_stack_max = num_to_alloc;
2573
0
  }
2574
0
}
2575
/* %endif */
2576
2577
/* %if-c-only */
2578
/** Setup the input buffer state to scan directly from a user-specified character buffer.
2579
 * @param base the character buffer
2580
 * @param size the size in bytes of the character buffer
2581
 * @param yyscanner The scanner object.
2582
 * @return the newly allocated buffer state object.
2583
 */
2584
YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
2585
0
{
2586
0
  YY_BUFFER_STATE b;
2587
    
2588
0
  if ( size < 2 ||
2589
0
       base[size-2] != YY_END_OF_BUFFER_CHAR ||
2590
0
       base[size-1] != YY_END_OF_BUFFER_CHAR )
2591
    /* They forgot to leave room for the EOB's. */
2592
0
    return NULL;
2593
2594
0
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2595
0
  if ( ! b )
2596
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2597
2598
0
  b->yy_buf_size = (int) (size - 2);  /* "- 2" to take care of EOB's */
2599
0
  b->yy_buf_pos = b->yy_ch_buf = base;
2600
0
  b->yy_is_our_buffer = 0;
2601
0
  b->yy_input_file = NULL;
2602
0
  b->yy_n_chars = b->yy_buf_size;
2603
0
  b->yy_is_interactive = 0;
2604
0
  b->yy_at_bol = 1;
2605
0
  b->yy_fill_buffer = 0;
2606
0
  b->yy_buffer_status = YY_BUFFER_NEW;
2607
2608
0
  yy_switch_to_buffer( b , yyscanner );
2609
2610
0
  return b;
2611
0
}
2612
/* %endif */
2613
2614
/* %if-c-only */
2615
/** Setup the input buffer state to scan a string. The next call to yylex() will
2616
 * scan from a @e copy of @a str.
2617
 * @param yystr a NUL-terminated string to scan
2618
 * @param yyscanner The scanner object.
2619
 * @return the newly allocated buffer state object.
2620
 * @note If you want to scan bytes that may contain NUL values, then use
2621
 *       yy_scan_bytes() instead.
2622
 */
2623
YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
2624
0
{
2625
    
2626
0
  return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
2627
0
}
2628
/* %endif */
2629
2630
/* %if-c-only */
2631
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2632
 * scan from a @e copy of @a bytes.
2633
 * @param yybytes the byte buffer to scan
2634
 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2635
 * @param yyscanner The scanner object.
2636
 * @return the newly allocated buffer state object.
2637
 */
2638
YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
2639
0
{
2640
0
  YY_BUFFER_STATE b;
2641
0
  char *buf;
2642
0
  yy_size_t n;
2643
0
  int i;
2644
    
2645
  /* Get memory for full buffer, including space for trailing EOB's. */
2646
0
  n = (yy_size_t) (_yybytes_len + 2);
2647
0
  buf = (char *) yyalloc( n , yyscanner );
2648
0
  if ( ! buf )
2649
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2650
2651
0
  for ( i = 0; i < _yybytes_len; ++i )
2652
0
    buf[i] = yybytes[i];
2653
2654
0
  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2655
2656
0
  b = yy_scan_buffer( buf, n , yyscanner);
2657
0
  if ( ! b )
2658
0
    YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2659
2660
  /* It's okay to grow etc. this buffer, and we should throw it
2661
   * away when we're done.
2662
   */
2663
0
  b->yy_is_our_buffer = 1;
2664
2665
0
  return b;
2666
0
}
2667
/* %endif */
2668
2669
#ifndef YY_EXIT_FAILURE
2670
#define YY_EXIT_FAILURE 2
2671
#endif
2672
2673
/* %if-c-only */
2674
static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
2675
0
{
2676
0
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2677
0
  (void)yyg;
2678
0
  fprintf( stderr, "%s\n", msg );
2679
0
  exit( YY_EXIT_FAILURE );
2680
0
}
2681
/* %endif */
2682
/* %if-c++-only */
2683
/* %endif */
2684
2685
/* Redefine yyless() so it works in section 3 code. */
2686
2687
#undef yyless
2688
#define yyless(n) \
2689
  do \
2690
    { \
2691
    /* Undo effects of setting up yytext. */ \
2692
        int yyless_macro_arg = (n); \
2693
        YY_LESS_LINENO(yyless_macro_arg);\
2694
    yytext[yyleng] = yyg->yy_hold_char; \
2695
    yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2696
    yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2697
    *yyg->yy_c_buf_p = '\0'; \
2698
    yyleng = yyless_macro_arg; \
2699
    } \
2700
  while ( 0 )
2701
2702
/* Accessor  methods (get/set functions) to struct members. */
2703
2704
/* %if-c-only */
2705
/* %if-reentrant */
2706
2707
/** Get the user-defined data for this scanner.
2708
 * @param yyscanner The scanner object.
2709
 */
2710
YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
2711
0
{
2712
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2713
0
    return yyextra;
2714
0
}
2715
2716
/* %endif */
2717
2718
/** Get the current line number.
2719
 * @param yyscanner The scanner object.
2720
 */
2721
int yyget_lineno  (yyscan_t yyscanner)
2722
0
{
2723
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2724
2725
0
        if (! YY_CURRENT_BUFFER)
2726
0
            return 0;
2727
    
2728
0
    return yylineno;
2729
0
}
2730
2731
/** Get the current column number.
2732
 * @param yyscanner The scanner object.
2733
 */
2734
int yyget_column  (yyscan_t yyscanner)
2735
0
{
2736
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2737
2738
0
        if (! YY_CURRENT_BUFFER)
2739
0
            return 0;
2740
    
2741
0
    return yycolumn;
2742
0
}
2743
2744
/** Get the input stream.
2745
 * @param yyscanner The scanner object.
2746
 */
2747
FILE *yyget_in  (yyscan_t yyscanner)
2748
0
{
2749
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2750
0
    return yyin;
2751
0
}
2752
2753
/** Get the output stream.
2754
 * @param yyscanner The scanner object.
2755
 */
2756
FILE *yyget_out  (yyscan_t yyscanner)
2757
0
{
2758
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2759
0
    return yyout;
2760
0
}
2761
2762
/** Get the length of the current token.
2763
 * @param yyscanner The scanner object.
2764
 */
2765
int yyget_leng  (yyscan_t yyscanner)
2766
0
{
2767
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2768
0
    return yyleng;
2769
0
}
2770
2771
/** Get the current token.
2772
 * @param yyscanner The scanner object.
2773
 */
2774
2775
char *yyget_text  (yyscan_t yyscanner)
2776
0
{
2777
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2778
0
    return yytext;
2779
0
}
2780
2781
/* %if-reentrant */
2782
2783
/** Set the user-defined data. This data is never touched by the scanner.
2784
 * @param user_defined The data to be associated with this scanner.
2785
 * @param yyscanner The scanner object.
2786
 */
2787
void yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
2788
0
{
2789
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2790
0
    yyextra = user_defined ;
2791
0
}
2792
2793
/* %endif */
2794
2795
/** Set the current line number.
2796
 * @param _line_number line number
2797
 * @param yyscanner The scanner object.
2798
 */
2799
void yyset_lineno (int  _line_number , yyscan_t yyscanner)
2800
0
{
2801
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2802
2803
        /* lineno is only valid if an input buffer exists. */
2804
0
        if (! YY_CURRENT_BUFFER )
2805
0
           YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
2806
    
2807
0
    yylineno = _line_number;
2808
0
}
2809
2810
/** Set the current column.
2811
 * @param _column_no column number
2812
 * @param yyscanner The scanner object.
2813
 */
2814
void yyset_column (int  _column_no , yyscan_t yyscanner)
2815
0
{
2816
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2817
2818
        /* column is only valid if an input buffer exists. */
2819
0
        if (! YY_CURRENT_BUFFER )
2820
0
           YY_FATAL_ERROR( "yyset_column called with no buffer" );
2821
    
2822
0
    yycolumn = _column_no;
2823
0
}
2824
2825
/** Set the input stream. This does not discard the current
2826
 * input buffer.
2827
 * @param _in_str A readable stream.
2828
 * @param yyscanner The scanner object.
2829
 * @see yy_switch_to_buffer
2830
 */
2831
void yyset_in (FILE *  _in_str , yyscan_t yyscanner)
2832
0
{
2833
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2834
0
    yyin = _in_str ;
2835
0
}
2836
2837
void yyset_out (FILE *  _out_str , yyscan_t yyscanner)
2838
0
{
2839
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2840
0
    yyout = _out_str ;
2841
0
}
2842
2843
int yyget_debug  (yyscan_t yyscanner)
2844
0
{
2845
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2846
0
    return yy_flex_debug;
2847
0
}
2848
2849
void yyset_debug (int  _bdebug , yyscan_t yyscanner)
2850
0
{
2851
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2852
0
    yy_flex_debug = _bdebug ;
2853
0
}
2854
2855
/* %endif */
2856
2857
/* %if-reentrant */
2858
/* Accessor methods for yylval and yylloc */
2859
2860
/* %if-bison-bridge */
2861
/* %endif */
2862
2863
/* User-visible API */
2864
2865
/* yylex_init is special because it creates the scanner itself, so it is
2866
 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2867
 * That's why we explicitly handle the declaration, instead of using our macros.
2868
 */
2869
int yylex_init(yyscan_t* ptr_yy_globals)
2870
0
{
2871
0
    if (ptr_yy_globals == NULL){
2872
0
        errno = EINVAL;
2873
0
        return 1;
2874
0
    }
2875
2876
0
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2877
2878
0
    if (*ptr_yy_globals == NULL){
2879
0
        errno = ENOMEM;
2880
0
        return 1;
2881
0
    }
2882
2883
    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2884
0
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2885
2886
0
    return yy_init_globals ( *ptr_yy_globals );
2887
0
}
2888
2889
/* yylex_init_extra has the same functionality as yylex_init, but follows the
2890
 * convention of taking the scanner as the last argument. Note however, that
2891
 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2892
 * is the reason, too, why this function also must handle its own declaration).
2893
 * The user defined value in the first argument will be available to yyalloc in
2894
 * the yyextra field.
2895
 */
2896
int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
2897
0
{
2898
0
    struct yyguts_t dummy_yyguts;
2899
2900
0
    yyset_extra (yy_user_defined, &dummy_yyguts);
2901
2902
0
    if (ptr_yy_globals == NULL){
2903
0
        errno = EINVAL;
2904
0
        return 1;
2905
0
    }
2906
2907
0
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2908
2909
0
    if (*ptr_yy_globals == NULL){
2910
0
        errno = ENOMEM;
2911
0
        return 1;
2912
0
    }
2913
2914
    /* By setting to 0xAA, we expose bugs in
2915
    yy_init_globals. Leave at 0x00 for releases. */
2916
0
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2917
2918
0
    yyset_extra (yy_user_defined, *ptr_yy_globals);
2919
2920
0
    return yy_init_globals ( *ptr_yy_globals );
2921
0
}
2922
2923
/* %endif if-c-only */
2924
2925
/* %if-c-only */
2926
static int yy_init_globals (yyscan_t yyscanner)
2927
0
{
2928
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2929
    /* Initialization is the same as for the non-reentrant scanner.
2930
     * This function is called from yylex_destroy(), so don't allocate here.
2931
     */
2932
2933
0
    yyg->yy_buffer_stack = NULL;
2934
0
    yyg->yy_buffer_stack_top = 0;
2935
0
    yyg->yy_buffer_stack_max = 0;
2936
0
    yyg->yy_c_buf_p = NULL;
2937
0
    yyg->yy_init = 0;
2938
0
    yyg->yy_start = 0;
2939
2940
0
    yyg->yy_start_stack_ptr = 0;
2941
0
    yyg->yy_start_stack_depth = 0;
2942
0
    yyg->yy_start_stack =  NULL;
2943
2944
/* Defined in main.c */
2945
#ifdef YY_STDINIT
2946
    yyin = stdin;
2947
    yyout = stdout;
2948
#else
2949
0
    yyin = NULL;
2950
0
    yyout = NULL;
2951
0
#endif
2952
2953
    /* For future reference: Set errno on error, since we are called by
2954
     * yylex_init()
2955
     */
2956
0
    return 0;
2957
0
}
2958
/* %endif */
2959
2960
/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
2961
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2962
int yylex_destroy  (yyscan_t yyscanner)
2963
0
{
2964
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2965
2966
    /* Pop the buffer stack, destroying each element. */
2967
0
  while(YY_CURRENT_BUFFER){
2968
0
    yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
2969
0
    YY_CURRENT_BUFFER_LVALUE = NULL;
2970
0
    yypop_buffer_state(yyscanner);
2971
0
  }
2972
2973
  /* Destroy the stack itself. */
2974
0
  yyfree(yyg->yy_buffer_stack , yyscanner);
2975
0
  yyg->yy_buffer_stack = NULL;
2976
2977
    /* Destroy the start condition stack. */
2978
0
        yyfree( yyg->yy_start_stack , yyscanner );
2979
0
        yyg->yy_start_stack = NULL;
2980
2981
    /* Reset the globals. This is important in a non-reentrant scanner so the next time
2982
     * yylex() is called, initialization will occur. */
2983
0
    yy_init_globals( yyscanner);
2984
2985
/* %if-reentrant */
2986
    /* Destroy the main struct (reentrant only). */
2987
0
    yyfree ( yyscanner , yyscanner );
2988
0
    yyscanner = NULL;
2989
/* %endif */
2990
0
    return 0;
2991
0
}
2992
/* %endif */
2993
2994
/*
2995
 * Internal utility routines.
2996
 */
2997
2998
#ifndef yytext_ptr
2999
static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
3000
{
3001
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3002
  (void)yyg;
3003
3004
  int i;
3005
  for ( i = 0; i < n; ++i )
3006
    s1[i] = s2[i];
3007
}
3008
#endif
3009
3010
#ifdef YY_NEED_STRLEN
3011
static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
3012
{
3013
  int n;
3014
  for ( n = 0; s[n]; ++n )
3015
    ;
3016
3017
  return n;
3018
}
3019
#endif
3020
3021
/* %if-tables-serialization definitions */
3022
/* %define-yytables   The name for this specific scanner's tables. */
3023
#define YYTABLES_NAME "yytables"
3024
/* %endif */
3025
3026
/* %ok-for-header */
3027
3028
#line 337 "/src/wireshark/epan/dtd_parse.l"
3029
3030
3031
/*
3032
 * Turn diagnostics back on, so we check the code that we've written.
3033
 */
3034
DIAG_ON_FLEX()
3035
3036
0
static dtd_token_data_t* new_token(char* text, char* location) {
3037
0
  dtd_token_data_t* t = g_new(dtd_token_data_t,1);
3038
3039
0
  t->text = g_strdup(text);
3040
0
  t->location = g_strdup(location);
3041
3042
0
  return t;
3043
0
}
3044
3045
3046
0
static size_t my_yyinput(Dtd_Parse_scanner_state_t *state, char* buff, size_t size) {
3047
3048
0
  if (state->offsetx >= state->len) {
3049
0
    return YY_NULL;
3050
0
  } else if (state->offsetx + size <= state->len) {
3051
0
    memcpy(buff, state->input_string->str + state->offsetx, size);
3052
0
    state->offsetx += size;
3053
0
    return size;
3054
0
  } else {
3055
0
    size = state->len - state->offsetx;
3056
0
    memcpy(buff, state->input_string->str + state->offsetx, size);
3057
0
    state->offsetx = state->len;
3058
0
    return size;
3059
0
  }
3060
0
}
3061
3062
0
extern dtd_build_data_t* dtd_parse(GString* s) {
3063
0
  yyscan_t scanner;
3064
0
  Dtd_Parse_scanner_state_t state;
3065
3066
0
  if (Dtd_Parse_lex_init(&scanner) != 0) {
3067
#ifdef DEBUG_DTD_PARSER
3068
    fprintf(stderr, "Can't initialize scanner: %s\n",
3069
        strerror(errno));
3070
#endif
3071
0
    return NULL;
3072
0
  }
3073
3074
0
  state.input_string = s;
3075
0
  state.offsetx = 0;
3076
0
  state.len = state.input_string->len;
3077
3078
0
  state.pParser = DtdParseAlloc(g_malloc);
3079
3080
#ifdef DEBUG_DTD_PARSER
3081
  DtdParseTrace(stderr, ">>");
3082
#endif
3083
3084
0
  build_data = g_new(dtd_build_data_t,1);
3085
3086
0
  build_data->proto_name = NULL;
3087
0
  build_data->media_type = NULL;
3088
0
  build_data->description = NULL;
3089
0
  build_data->proto_root = NULL;
3090
0
  build_data->recursion = false;
3091
3092
0
  build_data->elements = g_ptr_array_new();
3093
0
  build_data->attributes = g_ptr_array_new();
3094
3095
0
  build_data->error = g_string_new("");
3096
3097
0
  state.location = NULL;
3098
0
  state.attr_name = NULL;
3099
3100
  /* Associate the state with the scanner */
3101
0
  Dtd_Parse_set_extra(&state, scanner);
3102
3103
0
  Dtd_Parse_lex(scanner);
3104
3105
0
  DtdParse(state.pParser, 0, NULL, build_data);
3106
3107
0
  Dtd_Parse_lex_destroy(scanner);
3108
3109
0
  g_free(state.location);
3110
3111
0
  DtdParseFree(state.pParser, g_free);
3112
3113
0
  return build_data;
3114
0
}
3115