Coverage Report

Created: 2025-08-04 07:15

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