Coverage Report

Created: 2025-02-15 06:25

/work/build/epan/diam_dict.c
Line
Count
Source (jump to first uncovered line)
1
#line 2 "/work/build/epan/diam_dict.c"
2
/* Include this before everything else, for various large-file definitions */
3
#include "config.h"
4
#include <wireshark.h>
5
6
#line 7 "/work/build/epan/diam_dict.c"
7
8
#define  YY_INT_ALIGNED short int
9
10
/* A lexical scanner generated by flex */
11
12
/* %not-for-header */
13
/* %if-c-only */
14
/* %if-not-reentrant */
15
/* %endif */
16
/* %endif */
17
/* %ok-for-header */
18
19
#define FLEX_SCANNER
20
#define YY_FLEX_MAJOR_VERSION 2
21
#define YY_FLEX_MINOR_VERSION 6
22
#define YY_FLEX_SUBMINOR_VERSION 4
23
#if YY_FLEX_SUBMINOR_VERSION > 0
24
#define FLEX_BETA
25
#endif
26
27
/* %if-c++-only */
28
/* %endif */
29
30
/* %if-c-only */
31
#ifdef yy_create_buffer
32
#define DiamDict__create_buffer_ALREADY_DEFINED
33
#else
34
0
#define yy_create_buffer DiamDict__create_buffer
35
#endif
36
37
#ifdef yy_delete_buffer
38
#define DiamDict__delete_buffer_ALREADY_DEFINED
39
#else
40
0
#define yy_delete_buffer DiamDict__delete_buffer
41
#endif
42
43
#ifdef yy_scan_buffer
44
#define DiamDict__scan_buffer_ALREADY_DEFINED
45
#else
46
0
#define yy_scan_buffer DiamDict__scan_buffer
47
#endif
48
49
#ifdef yy_scan_string
50
#define DiamDict__scan_string_ALREADY_DEFINED
51
#else
52
#define yy_scan_string DiamDict__scan_string
53
#endif
54
55
#ifdef yy_scan_bytes
56
#define DiamDict__scan_bytes_ALREADY_DEFINED
57
#else
58
0
#define yy_scan_bytes DiamDict__scan_bytes
59
#endif
60
61
#ifdef yy_init_buffer
62
#define DiamDict__init_buffer_ALREADY_DEFINED
63
#else
64
0
#define yy_init_buffer DiamDict__init_buffer
65
#endif
66
67
#ifdef yy_flush_buffer
68
#define DiamDict__flush_buffer_ALREADY_DEFINED
69
#else
70
0
#define yy_flush_buffer DiamDict__flush_buffer
71
#endif
72
73
#ifdef yy_load_buffer_state
74
#define DiamDict__load_buffer_state_ALREADY_DEFINED
75
#else
76
0
#define yy_load_buffer_state DiamDict__load_buffer_state
77
#endif
78
79
#ifdef yy_switch_to_buffer
80
#define DiamDict__switch_to_buffer_ALREADY_DEFINED
81
#else
82
0
#define yy_switch_to_buffer DiamDict__switch_to_buffer
83
#endif
84
85
#ifdef yypush_buffer_state
86
#define DiamDict_push_buffer_state_ALREADY_DEFINED
87
#else
88
#define yypush_buffer_state DiamDict_push_buffer_state
89
#endif
90
91
#ifdef yypop_buffer_state
92
#define DiamDict_pop_buffer_state_ALREADY_DEFINED
93
#else
94
0
#define yypop_buffer_state DiamDict_pop_buffer_state
95
#endif
96
97
#ifdef yyensure_buffer_stack
98
#define DiamDict_ensure_buffer_stack_ALREADY_DEFINED
99
#else
100
0
#define yyensure_buffer_stack DiamDict_ensure_buffer_stack
101
#endif
102
103
#ifdef yylex
104
#define DiamDict_lex_ALREADY_DEFINED
105
#else
106
#define yylex DiamDict_lex
107
#endif
108
109
#ifdef yyrestart
110
#define DiamDict_restart_ALREADY_DEFINED
111
#else
112
0
#define yyrestart DiamDict_restart
113
#endif
114
115
#ifdef yylex_init
116
#define DiamDict_lex_init_ALREADY_DEFINED
117
#else
118
#define yylex_init DiamDict_lex_init
119
#endif
120
121
#ifdef yylex_init_extra
122
#define DiamDict_lex_init_extra_ALREADY_DEFINED
123
#else
124
#define yylex_init_extra DiamDict_lex_init_extra
125
#endif
126
127
#ifdef yylex_destroy
128
#define DiamDict_lex_destroy_ALREADY_DEFINED
129
#else
130
#define yylex_destroy DiamDict_lex_destroy
131
#endif
132
133
#ifdef yyget_debug
134
#define DiamDict_get_debug_ALREADY_DEFINED
135
#else
136
#define yyget_debug DiamDict_get_debug
137
#endif
138
139
#ifdef yyset_debug
140
#define DiamDict_set_debug_ALREADY_DEFINED
141
#else
142
#define yyset_debug DiamDict_set_debug
143
#endif
144
145
#ifdef yyget_extra
146
#define DiamDict_get_extra_ALREADY_DEFINED
147
#else
148
0
#define yyget_extra DiamDict_get_extra
149
#endif
150
151
#ifdef yyset_extra
152
#define DiamDict_set_extra_ALREADY_DEFINED
153
#else
154
0
#define yyset_extra DiamDict_set_extra
155
#endif
156
157
#ifdef yyget_in
158
#define DiamDict_get_in_ALREADY_DEFINED
159
#else
160
0
#define yyget_in DiamDict_get_in
161
#endif
162
163
#ifdef yyset_in
164
#define DiamDict_set_in_ALREADY_DEFINED
165
#else
166
#define yyset_in DiamDict_set_in
167
#endif
168
169
#ifdef yyget_out
170
#define DiamDict_get_out_ALREADY_DEFINED
171
#else
172
#define yyget_out DiamDict_get_out
173
#endif
174
175
#ifdef yyset_out
176
#define DiamDict_set_out_ALREADY_DEFINED
177
#else
178
#define yyset_out DiamDict_set_out
179
#endif
180
181
#ifdef yyget_leng
182
#define DiamDict_get_leng_ALREADY_DEFINED
183
#else
184
#define yyget_leng DiamDict_get_leng
185
#endif
186
187
#ifdef yyget_text
188
#define DiamDict_get_text_ALREADY_DEFINED
189
#else
190
#define yyget_text DiamDict_get_text
191
#endif
192
193
#ifdef yyget_lineno
194
#define DiamDict_get_lineno_ALREADY_DEFINED
195
#else
196
#define yyget_lineno DiamDict_get_lineno
197
#endif
198
199
#ifdef yyset_lineno
200
#define DiamDict_set_lineno_ALREADY_DEFINED
201
#else
202
#define yyset_lineno DiamDict_set_lineno
203
#endif
204
205
#ifdef yyget_column
206
#define DiamDict_get_column_ALREADY_DEFINED
207
#else
208
#define yyget_column DiamDict_get_column
209
#endif
210
211
#ifdef yyset_column
212
#define DiamDict_set_column_ALREADY_DEFINED
213
#else
214
#define yyset_column DiamDict_set_column
215
#endif
216
217
#ifdef yywrap
218
#define DiamDict_wrap_ALREADY_DEFINED
219
#else
220
0
#define yywrap DiamDict_wrap
221
#endif
222
223
/* %endif */
224
225
#ifdef yyalloc
226
#define DiamDict_alloc_ALREADY_DEFINED
227
#else
228
0
#define yyalloc DiamDict_alloc
229
#endif
230
231
#ifdef yyrealloc
232
#define DiamDict_realloc_ALREADY_DEFINED
233
#else
234
0
#define yyrealloc DiamDict_realloc
235
#endif
236
237
#ifdef yyfree
238
#define DiamDict_free_ALREADY_DEFINED
239
#else
240
0
#define yyfree DiamDict_free
241
#endif
242
243
/* %if-c-only */
244
245
/* %endif */
246
247
/* First, we deal with  platform-specific or compiler-specific issues. */
248
249
/* begin standard C headers. */
250
/* %if-c-only */
251
#include <stdio.h>
252
#include <string.h>
253
#include <errno.h>
254
#include <stdlib.h>
255
/* %endif */
256
257
/* %if-tables-serialization */
258
/* %endif */
259
/* end standard C headers. */
260
261
/* %if-c-or-c++ */
262
/* flex integer type definitions */
263
264
#ifndef FLEXINT_H
265
#define FLEXINT_H
266
267
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
268
269
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
270
271
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
272
 * if you want the limit (max/min) macros for int types. 
273
 */
274
#ifndef __STDC_LIMIT_MACROS
275
#define __STDC_LIMIT_MACROS 1
276
#endif
277
278
#include <inttypes.h>
279
typedef int8_t flex_int8_t;
280
typedef uint8_t flex_uint8_t;
281
typedef int16_t flex_int16_t;
282
typedef uint16_t flex_uint16_t;
283
typedef int32_t flex_int32_t;
284
typedef uint32_t flex_uint32_t;
285
#else
286
typedef signed char flex_int8_t;
287
typedef short int flex_int16_t;
288
typedef int flex_int32_t;
289
typedef unsigned char flex_uint8_t; 
290
typedef unsigned short int flex_uint16_t;
291
typedef unsigned int flex_uint32_t;
292
293
/* Limits of integral types. */
294
#ifndef INT8_MIN
295
#define INT8_MIN               (-128)
296
#endif
297
#ifndef INT16_MIN
298
#define INT16_MIN              (-32767-1)
299
#endif
300
#ifndef INT32_MIN
301
#define INT32_MIN              (-2147483647-1)
302
#endif
303
#ifndef INT8_MAX
304
#define INT8_MAX               (127)
305
#endif
306
#ifndef INT16_MAX
307
#define INT16_MAX              (32767)
308
#endif
309
#ifndef INT32_MAX
310
#define INT32_MAX              (2147483647)
311
#endif
312
#ifndef UINT8_MAX
313
#define UINT8_MAX              (255U)
314
#endif
315
#ifndef UINT16_MAX
316
#define UINT16_MAX             (65535U)
317
#endif
318
#ifndef UINT32_MAX
319
#define UINT32_MAX             (4294967295U)
320
#endif
321
322
#ifndef SIZE_MAX
323
#define SIZE_MAX               (~(size_t)0)
324
#endif
325
326
#endif /* ! C99 */
327
328
#endif /* ! FLEXINT_H */
329
330
/* %endif */
331
332
/* begin standard C++ headers. */
333
/* %if-c++-only */
334
/* %endif */
335
336
/* TODO: this is always defined, so inline it */
337
#define yyconst const
338
339
#if defined(__GNUC__) && __GNUC__ >= 3
340
#define yynoreturn __attribute__((__noreturn__))
341
#else
342
#define yynoreturn
343
#endif
344
345
/* %not-for-header */
346
/* Returned upon end-of-file. */
347
0
#define YY_NULL 0
348
/* %ok-for-header */
349
350
/* %not-for-header */
351
/* Promotes a possibly negative, possibly signed char to an
352
 *   integer in range [0..255] for use as an array index.
353
 */
354
0
#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
355
/* %ok-for-header */
356
357
/* %if-reentrant */
358
359
/* An opaque pointer. */
360
#ifndef YY_TYPEDEF_YY_SCANNER_T
361
#define YY_TYPEDEF_YY_SCANNER_T
362
typedef void* yyscan_t;
363
#endif
364
365
/* For convenience, these vars (plus the bison vars far below)
366
   are macros in the reentrant scanner. */
367
0
#define yyin yyg->yyin_r
368
0
#define yyout yyg->yyout_r
369
0
#define yyextra yyg->yyextra_r
370
0
#define yyleng yyg->yyleng_r
371
0
#define yytext yyg->yytext_r
372
0
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
373
0
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
374
0
#define yy_flex_debug yyg->yy_flex_debug_r
375
376
/* %endif */
377
378
/* %if-not-reentrant */
379
/* %endif */
380
381
/* Enter a start condition.  This macro really ought to take a parameter,
382
 * but we do it the disgusting crufty way forced on us by the ()-less
383
 * definition of BEGIN.
384
 */
385
0
#define BEGIN yyg->yy_start = 1 + 2 *
386
/* Translate the current start state into a value that can be later handed
387
 * to BEGIN to return to the state.  The YYSTATE alias is for lex
388
 * compatibility.
389
 */
390
0
#define YY_START ((yyg->yy_start - 1) / 2)
391
#define YYSTATE YY_START
392
/* Action number for EOF rule of a given start state. */
393
0
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
394
/* Special action meaning "start processing a new file". */
395
0
#define YY_NEW_FILE yyrestart( yyin , yyscanner )
396
0
#define YY_END_OF_BUFFER_CHAR 0
397
398
/* Size of default input buffer. */
399
#ifndef YY_BUF_SIZE
400
#ifdef __ia64__
401
/* On IA-64, the buffer size is 16k, not 8k.
402
 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
403
 * Ditto for the __ia64__ case accordingly.
404
 */
405
#define YY_BUF_SIZE 32768
406
#else
407
0
#define YY_BUF_SIZE 16384
408
#endif /* __ia64__ */
409
#endif
410
411
/* The state buf must be large enough to hold one state per character in the main buffer.
412
 */
413
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
414
415
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
416
#define YY_TYPEDEF_YY_BUFFER_STATE
417
typedef struct yy_buffer_state *YY_BUFFER_STATE;
418
#endif
419
420
#ifndef YY_TYPEDEF_YY_SIZE_T
421
#define YY_TYPEDEF_YY_SIZE_T
422
typedef size_t yy_size_t;
423
#endif
424
425
/* %if-not-reentrant */
426
/* %endif */
427
428
/* %if-c-only */
429
/* %if-not-reentrant */
430
/* %endif */
431
/* %endif */
432
433
0
#define EOB_ACT_CONTINUE_SCAN 0
434
0
#define EOB_ACT_END_OF_FILE 1
435
0
#define EOB_ACT_LAST_MATCH 2
436
    
437
    #define YY_LESS_LINENO(n)
438
    #define YY_LINENO_REWIND_TO(ptr)
439
    
440
/* Return all but the first "n" matched characters back to the input stream. */
441
#define yyless(n) \
442
  do \
443
    { \
444
    /* Undo effects of setting up yytext. */ \
445
        int yyless_macro_arg = (n); \
446
        YY_LESS_LINENO(yyless_macro_arg);\
447
    *yy_cp = yyg->yy_hold_char; \
448
    YY_RESTORE_YY_MORE_OFFSET \
449
    yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
450
    YY_DO_BEFORE_ACTION; /* set up yytext again */ \
451
    } \
452
  while ( 0 )
453
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
454
455
#ifndef YY_STRUCT_YY_BUFFER_STATE
456
#define YY_STRUCT_YY_BUFFER_STATE
457
struct yy_buffer_state
458
  {
459
/* %if-c-only */
460
  FILE *yy_input_file;
461
/* %endif */
462
463
/* %if-c++-only */
464
/* %endif */
465
466
  char *yy_ch_buf;    /* input buffer */
467
  char *yy_buf_pos;   /* current position in input buffer */
468
469
  /* Size of input buffer in bytes, not including room for EOB
470
   * characters.
471
   */
472
  int yy_buf_size;
473
474
  /* Number of characters read into yy_ch_buf, not including EOB
475
   * characters.
476
   */
477
  int yy_n_chars;
478
479
  /* Whether we "own" the buffer - i.e., we know we created it,
480
   * and can realloc() it to grow it, and should free() it to
481
   * delete it.
482
   */
483
  int yy_is_our_buffer;
484
485
  /* Whether this is an "interactive" input source; if so, and
486
   * if we're using stdio for input, then we want to use getc()
487
   * instead of fread(), to make sure we stop fetching input after
488
   * each newline.
489
   */
490
  int yy_is_interactive;
491
492
  /* Whether we're considered to be at the beginning of a line.
493
   * If so, '^' rules will be active on the next match, otherwise
494
   * not.
495
   */
496
  int yy_at_bol;
497
498
    int yy_bs_lineno; /**< The line count. */
499
    int yy_bs_column; /**< The column count. */
500
501
  /* Whether to try to fill the input buffer when we reach the
502
   * end of it.
503
   */
504
  int yy_fill_buffer;
505
506
  int yy_buffer_status;
507
508
0
#define YY_BUFFER_NEW 0
509
0
#define YY_BUFFER_NORMAL 1
510
  /* When an EOF's been seen but there's still some text to process
511
   * then we mark the buffer as YY_EOF_PENDING, to indicate that we
512
   * shouldn't try reading from the input source any more.  We might
513
   * still have a bunch of tokens to match, though, because of
514
   * possible backing-up.
515
   *
516
   * When we actually see the EOF, we change the status to "new"
517
   * (via yyrestart()), so that the user can continue scanning by
518
   * just pointing yyin at a new input file.
519
   */
520
0
#define YY_BUFFER_EOF_PENDING 2
521
522
  };
523
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
524
525
/* %if-c-only Standard (non-C++) definition */
526
/* %not-for-header */
527
/* %if-not-reentrant */
528
/* %endif */
529
/* %ok-for-header */
530
531
/* %endif */
532
533
/* We provide macros for accessing buffer states in case in the
534
 * future we want to put the buffer states in a more general
535
 * "scanner state".
536
 *
537
 * Returns the top of the stack, or NULL.
538
 */
539
0
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
540
0
                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
541
0
                          : NULL)
542
/* Same as previous macro, but useful when we know that the buffer stack is not
543
 * NULL or when we need an lvalue. For internal use only.
544
 */
545
0
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
546
547
/* %if-c-only Standard (non-C++) definition */
548
549
/* %if-not-reentrant */
550
/* %not-for-header */
551
/* %ok-for-header */
552
553
/* %endif */
554
555
void yyrestart ( FILE *input_file , yyscan_t yyscanner );
556
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
557
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
558
void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
559
void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
560
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
561
void yypop_buffer_state ( yyscan_t yyscanner );
562
563
static void yyensure_buffer_stack ( yyscan_t yyscanner );
564
static void yy_load_buffer_state ( yyscan_t yyscanner );
565
static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
566
#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
567
568
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
569
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
570
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
571
572
/* %endif */
573
574
void *yyalloc ( yy_size_t , yyscan_t yyscanner );
575
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
576
void yyfree ( void * , yyscan_t yyscanner );
577
578
#define yy_new_buffer yy_create_buffer
579
#define yy_set_interactive(is_interactive) \
580
  { \
581
  if ( ! YY_CURRENT_BUFFER ){ \
582
        yyensure_buffer_stack (yyscanner); \
583
    YY_CURRENT_BUFFER_LVALUE =    \
584
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
585
  } \
586
  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
587
  }
588
#define yy_set_bol(at_bol) \
589
  { \
590
  if ( ! YY_CURRENT_BUFFER ){\
591
        yyensure_buffer_stack (yyscanner); \
592
    YY_CURRENT_BUFFER_LVALUE =    \
593
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
594
  } \
595
  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
596
  }
597
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
598
599
/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
600
/* Begin user sect3 */
601
602
0
#define DiamDict_wrap(yyscanner) (/*CONSTCOND*/1)
603
#define YY_SKIP_YYWRAP
604
605
#define FLEX_DEBUG
606
typedef flex_uint8_t YY_CHAR;
607
608
typedef int yy_state_type;
609
610
0
#define yytext_ptr yytext_r
611
612
/* %% [1.5] DFA */
613
614
/* %if-c-only Standard (non-C++) definition */
615
616
static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
617
static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  , yyscan_t yyscanner);
618
static int yy_get_next_buffer ( yyscan_t yyscanner );
619
static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
620
621
/* %endif */
622
623
/* Done after the current pattern has been matched and before the
624
 * corresponding action - sets up yytext.
625
 */
626
#define YY_DO_BEFORE_ACTION \
627
0
  yyg->yytext_ptr = yy_bp; \
628
0
/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
629
0
  yyleng = (int) (yy_cp - yy_bp); \
630
0
  yyg->yy_hold_char = *yy_cp; \
631
0
  *yy_cp = '\0'; \
632
0
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
633
0
  yyg->yy_c_buf_p = yy_cp;
634
/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
635
#define YY_NUM_RULES 85
636
0
#define YY_END_OF_BUFFER 86
637
/* This struct is not used in this scanner,
638
   but its presence is necessary. */
639
struct yy_trans_info
640
  {
641
  flex_int32_t yy_verify;
642
  flex_int32_t yy_nxt;
643
  };
644
static const flex_int16_t yy_accept[482] =
645
    {   0,
646
        0,    0,   24,   24,    0,    0,    7,    7,    0,    0,
647
        0,    0,    0,    0,    0,    0,    0,    0,   30,   30,
648
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
649
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
650
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
651
        0,    0,    0,    0,    0,    0,   86,   85,   27,   24,
652
       24,   27,   27,   27,   20,   26,   21,   27,    4,    4,
653
       85,    4,    7,    8,   16,   85,   85,   18,   85,   29,
654
       30,   30,   31,   84,   84,   85,   85,   85,   85,   85,
655
       85,   39,   85,   85,   32,   32,   85,   75,   85,   85,
656
657
       85,   85,   85,   64,   85,   85,   85,   85,   85,   52,
658
       85,   85,   85,   85,   46,   85,   85,   85,   85,   57,
659
       85,   13,   13,   85,   13,   13,   13,   10,   12,   24,
660
        0,   20,   26,   21,    0,    0,   25,    0,   22,   20,
661
        0,   23,    6,   26,   21,    0,    2,    0,    0,    0,
662
        7,    8,   16,    0,    0,    0,   18,    0,   19,   29,
663
       30,    0,    0,    0,    0,    0,   79,    0,    0,    0,
664
        0,    0,    0,    0,    0,    0,   83,   40,    0,    0,
665
        0,   33,   76,    0,    0,    0,    0,   65,    0,    0,
666
        0,    0,   53,    0,    0,    0,   47,    0,    0,    0,
667
668
       58,    0,    0,    0,    0,    0,   14,    0,    0,   10,
669
       12,   28,   22,    0,    0,    0,   23,    6,    2,    5,
670
        0,   19,    0,    0,    0,    0,    0,    0,    0,    0,
671
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
672
       83,    0,    0,    0,    0,    0,    0,    0,    0,    0,
673
        0,    0,    0,    0,    0,    0,    0,   14,    0,    0,
674
        3,    0,    0,    5,    0,    0,    0,    0,    0,    0,
675
        0,    0,    0,    0,   59,    0,    0,    0,    0,    0,
676
        0,    0,    0,   38,    0,    0,    0,    0,    0,    0,
677
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
678
679
        0,    0,    0,    3,    0,    0,    0,    0,    0,    0,
680
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
681
       72,   70,    0,   68,   83,    0,   83,   83,   83,   83,
682
        0,   83,    0,   83,   83,    0,   83,   83,    0,    0,
683
        0,    9,    0,    0,    0,    0,    0,    0,    0,    0,
684
       35,    0,    0,    0,    0,    0,    0,    0,   77,    0,
685
        0,   37,    0,   71,   74,   73,   63,    0,   60,    0,
686
       51,   49,    0,   45,   43,    0,    0,    0,    0,    0,
687
        0,    0,    0,   17,    0,    0,    0,   48,    0,   81,
688
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
689
690
        0,    0,    0,    0,   11,    0,   15,    0,    0,    0,
691
        0,    0,    0,   42,    0,    0,    0,    0,    0,    0,
692
        0,    0,    0,    0,    0,   15,    0,    0,    0,    0,
693
        0,   80,   54,    0,   66,    0,    0,    0,    0,    0,
694
        0,    0,    0,    1,    0,    0,    0,    0,   41,   67,
695
       83,    0,   83,   83,   83,   83,    0,    1,    0,    0,
696
        0,    0,   69,    0,   62,   50,   44,   55,    0,   34,
697
        0,   36,    0,   83,   83,   82,    0,   61,   56,   78,
698
        0
699
    } ;
700
701
static const YY_CHAR yy_ec[256] =
702
    {   0,
703
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
704
        1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
705
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
706
        1,    2,    4,    5,    1,    1,    1,    6,    1,    1,
707
        1,    7,    1,    1,    8,    1,    9,   10,   10,   10,
708
       10,   10,   10,   10,   10,   10,   10,    1,   11,   12,
709
       13,   14,   15,    1,   16,   17,   18,   19,   20,   21,
710
       22,   23,   24,   23,   25,   26,   27,   28,   29,   30,
711
       23,   31,   32,   33,   34,   35,   23,   23,   36,   23,
712
       37,    1,   38,    1,    1,    1,   39,   40,   41,   42,
713
714
       43,   44,   45,   23,   46,   23,   47,   48,   49,   50,
715
       51,   52,   23,   53,   54,   55,   56,   57,   23,   23,
716
       58,   23,    1,    1,    1,    1,    1,    1,    1,    1,
717
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
718
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
719
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
720
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
721
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
722
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
723
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
724
725
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
726
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
727
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
728
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
729
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
730
        1,    1,    1,    1,    1
731
    } ;
732
733
static const YY_CHAR yy_meta[59] =
734
    {   0,
735
        1,    1,    1,    1,    2,    1,    3,    4,    1,    4,
736
        1,    1,    5,    1,    1,    4,    4,    4,    4,    4,
737
        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
738
        4,    4,    4,    4,    4,    4,    1,    1,    4,    4,
739
        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
740
        4,    4,    4,    4,    4,    4,    4,    4
741
    } ;
742
743
static const flex_int16_t yy_base[507] =
744
    {   0,
745
        0,    0,    0,   37,    8,   15,   75,  113,  151,  189,
746
        5,   29, 1179, 1178, 1177, 1176, 1175, 1174,   11,   12,
747
     1173, 1172,   12,   22, 1164, 1163,   17,   18, 1162, 1161,
748
      227,  277,   30,   42,  284,  285,   46,  121,  319,  327,
749
      369,    0,  418,  467,  516,  565,  339,  362,  210,  272,
750
     1160, 1154, 1149, 1137,    0,    0, 1137, 1185, 1185,   55,
751
       95, 1058,    0, 1048,  166,   50,   60,   92, 1185,   63,
752
       97, 1053,   70,    0,    0,  129,   65,    0,  134,    0,
753
     1050, 1049, 1185, 1185,   92,  383, 1043,  341,  164, 1040,
754
     1037, 1185,  163,  198, 1185, 1045, 1035, 1185,  186,  204,
755
756
      195,  237, 1034, 1185,  234,  167,  256,  283, 1032, 1185,
757
      287,  336,  341, 1031, 1185,  291,  385,  396, 1030, 1185,
758
      308, 1185,  426,  432, 1005,  101,  232,    0,    0,  485,
759
      992,  440,  100,  136,  256,  969, 1185,  953,  138,  140,
760
      450,  144,  175,  213,  258,  308,  322,  463,  929,  881,
761
      400,    0,    0,  418,  355,  398,    0,  460,  403,    0,
762
      820,  432,  337,  452,  342,  405, 1185,  497,  449,  461,
763
      460,  494,  472,  489,  471,  815, 1185, 1185,  750,  513,
764
      750, 1185, 1185,  518,  514,  530,  532, 1185,  533,  537,
765
      540,  548, 1185,  552,  555,  564, 1185,  567,  572,  574,
766
767
     1185,  565,  608,  732,  411,  464,  553,  554,  570,    0,
768
        0, 1185,  617,  705,  574,  577,  626,  628,  632,  634,
769
      583,  637,  608,  608,  611,  610,  616,  615,  630,  619,
770
      630,  622,  626,  626,  622,  627,  625,  625,  632,  632,
771
      698,  672,  673,  674,  675,  676,  677,  658,  678,  687,
772
      688,  689,  691,  692,  694,  709,  710,  722,  736,  692,
773
      738,  693,  703,  740,  707,  711,  727,  721,  732,  735,
774
      726,  725,  732,  732, 1185,  734,  742,  734,  736,  740,
775
      740,  737,  752, 1185,  664,   28,  659,  655,  638,  634,
776
      760,  600,  761,  595,  588,  767,  584,  575,  771,  166,
777
778
      795,  799,  756,  803,  755,  770,  776,  783,  776,  787,
779
      550,  785,  789,  797,  792,  801,  805,  804,  546,  792,
780
     1185, 1185,  797, 1185,  542,  811,  516,  514,  506,  496,
781
      821,  486,  819,  472,  459,  822,  440,  409,  825,  829,
782
      849, 1185,  860,  811,  822,  863,  829,  836,  846,  393,
783
     1185,  839,  847,  356,  858,  847,  855,  864, 1185,  856,
784
      868, 1185,  878, 1185, 1185, 1185, 1185,  872, 1185,  210,
785
     1185, 1185,  241, 1185, 1185,  425,  883,  887,  907,  910,
786
      871,  870,  916, 1185,  886,  887,  888, 1185,  907, 1185,
787
      901,  899,  912,  911,  913,  915,  922,  926,  929,  934,
788
789
      937,  933,  931,  938, 1185,  925,  887,  947,  937,  933,
790
      951,  950,  350, 1185,  944,  951,  348,  965,  976,  960,
791
      978,  982,  983,  985,  309,  974,  968,  988,  983,  976,
792
      318, 1185, 1185,  292, 1185,  289, 1001,  255,  253,  249,
793
      243,  997,  215, 1009,  977,  984,  987,  993, 1185, 1185,
794
      216, 1005,  201,  180,  167,  154, 1010, 1038,  115,  996,
795
     1006, 1007, 1185,   97, 1185, 1185, 1185, 1185,   78, 1185,
796
       71, 1185, 1014,   51,   49, 1185,   34, 1185, 1185, 1185,
797
     1185, 1065, 1070, 1075, 1080, 1085, 1090, 1095, 1100, 1105,
798
     1110, 1115, 1120, 1125, 1130,   40,   24,    0, 1135, 1140,
799
800
     1142, 1147, 1152, 1157, 1162, 1167
801
    } ;
802
803
static const flex_int16_t yy_def[507] =
804
    {   0,
805
      482,  482,  483,  483,  484,  484,  485,  485,  486,  486,
806
      482,  482,  487,  487,  482,  482,  488,  488,  482,  482,
807
      482,  482,  489,  489,  482,  482,  482,  482,  482,  482,
808
      490,  490,  491,  491,   32,   32,   32,   32,   32,   32,
809
       32,   41,   41,   41,   41,   41,   32,   32,  492,  492,
810
      493,  493,  494,  494,  482,  482,  481,  481,  481,  481,
811
      481,  495,  496,  481,  481,  481,  481,  481,  481,  481,
812
      481,  481,  481,  497,  498,  481,  481,  499,  481,  500,
813
      481,  481,  481,  481,  481,  481,  481,  481,  481,  501,
814
      481,  481,  501,  501,  481,  502,  481,  481,  501,  501,
815
816
      501,  501,  481,  481,  501,  501,  501,  501,  481,  481,
817
      501,  501,  501,  481,  481,  501,  501,  501,  481,  481,
818
      501,  481,  481,  481,  481,  481,  481,  503,  504,  481,
819
      481,  481,  481,  481,  481,  495,  481,  496,  481,  481,
820
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
821
      481,  497,  498,  481,  481,  481,  499,  481,  481,  500,
822
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
823
      481,  481,  481,  481,  481,  501,  481,  481,  501,  501,
824
      502,  481,  481,  501,  501,  501,  501,  481,  501,  501,
825
      501,  501,  481,  501,  501,  501,  481,  501,  501,  501,
826
827
      481,  501,  481,  481,  481,  481,  481,  481,  481,  503,
828
      504,  481,  481,  481,  481,  481,  481,  481,  481,  481,
829
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
830
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
831
      481,  501,  501,  501,  501,  501,  501,  501,  501,  501,
832
      501,  501,  501,  501,  501,  501,  501,  481,  481,  481,
833
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
834
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
835
      481,  481,  481,  481,  501,  501,  501,  501,  501,  501,
836
      501,  501,  501,  501,  501,  501,  501,  501,  501,  501,
837
838
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
839
      505,  481,  481,  481,  481,  481,  481,  481,  481,  481,
840
      481,  481,  481,  481,  481,  501,  481,  481,  481,  481,
841
      501,  481,  501,  481,  481,  501,  481,  481,  501,  501,
842
      481,  481,  481,  481,  481,  481,  481,  481,  481,  505,
843
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
844
      481,  481,  501,  481,  481,  481,  481,  501,  481,  501,
845
      481,  481,  501,  481,  481,  501,  501,  501,  481,  481,
846
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
847
      481,  481,  481,  481,  481,  481,  501,  501,  501,  501,
848
849
      501,  501,  501,  481,  481,  481,  481,  481,  481,  481,
850
      481,  481,  481,  481,  481,  481,  481,  501,  501,  501,
851
      501,  501,  501,  501,  506,  481,  481,  481,  481,  481,
852
      481,  481,  481,  481,  481,  501,  501,  501,  501,  501,
853
      501,  501,  506,  481,  481,  481,  481,  481,  481,  481,
854
      481,  501,  481,  481,  481,  481,  501,  481,  481,  481,
855
      481,  481,  481,  501,  481,  481,  481,  481,  501,  481,
856
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
857
        0,  481,  481,  481,  481,  481,  481,  481,  481,  481,
858
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
859
860
      481,  481,  481,  481,  481,  481
861
    } ;
862
863
static const flex_int16_t yy_nxt[1244] =
864
    {   0,
865
      481,   60,   61,  153,   62,   63,   76,   76,   64,   70,
866
       71,   65,   66,   67,   58,   72,   70,   71,   81,   81,
867
       82,   82,   72,   85,   58,   87,   87,  152,   88,   88,
868
       76,   76,   58,   85,   96,  326,   77,   68,   60,   61,
869
      177,   62,   63,  138,   58,   64,   96,  480,   65,   66,
870
       67,  144,  144,  479,   97,  478,  130,  130,   77,   98,
871
       77,  145,  145,  131,  148,  148,  132,  133,  134,   90,
872
      149,  151,  151,  100,   68,   58,   73,   73,   58,   58,
873
       58,   58,   77,   58,  476,   58,   58,   58,   58,   58,
874
      475,   90,  135,  146,  146,  100,  130,  130,  148,  148,
875
876
      156,  144,  144,  131,  149,  147,  132,  133,  134,  474,
877
      162,   58,   58,   58,   73,   73,   58,   58,   58,   58,
878
      208,   58,  156,   58,   58,   58,   58,   58,  470,   97,
879
      154,  154,  135,  162,   98,  158,  158,  145,  145,  213,
880
      213,  140,  140,  208,   90,  217,  217,  159,  100,   58,
881
       58,   58,   58,   58,   58,   58,   58,   58,  468,   58,
882
      155,   58,   58,   58,   58,   58,   90,  140,  140,  141,
883
      100,  467,  172,  340,  142,  177,  218,  218,  177,  177,
884
      143,  179,  155,  173,  466,  174,  190,   58,   58,   58,
885
       58,   58,   58,   58,   58,   58,  175,   58,  177,   58,
886
887
       58,   58,   58,   58,  179,  465,  173,  177,  174,  190,
888
      177,  123,  124,  180,  144,  144,  177,  399,  175,  185,
889
      463,  184,  177,  186,  125,   58,   58,   58,   58,   58,
890
       58,   58,   58,   58,  126,   91,  180,   58,   58,   58,
891
       92,   58,  185,  184,  127,  186,  177,  209,  400,  177,
892
       93,  444,  187,  177,   94,  456,  126,  146,  146,  145,
893
      145,  455,  189,   58,   58,  454,  127,  453,  177,  147,
894
      209,  191,   93,  123,  124,  187,   94,   58,   58,   58,
895
       58,   58,   58,   58,  189,   91,  125,   58,   58,   58,
896
       92,   58,   97,   97,  191,  177,  126,   98,   98,  177,
897
898
       93,  451,  192,  177,   94,  450,  127,   90,   90,  146,
899
      146,   90,   90,   58,   58,  194,   99,   99,  126,  198,
900
      177,  147,   93,  219,  219,  192,   94,   97,  127,   90,
901
       90,  449,   98,   90,   90,   97,  101,  194,   99,   99,
902
       98,  198,   90,  202,  101,  444,  102,  119,  177,  168,
903
       90,  195,  120,  177,  102,  224,  169,  226,  170,  101,
904
      196,  435,   90,  432,   90,  202,   90,  101,  102,  390,
905
      119,  121,   90,  171,  195,  120,  102,  103,  224,  169,
906
      226,  170,  104,  196,   90,   90,  105,  106,   90,   90,
907
      156,  163,   90,  121,  121,  171,  107,  177,  164,  165,
908
909
      199,  151,  151,  108,  222,  222,  351,   90,  177,  105,
910
      106,   90,  156,  375,   90,  200,  121,  166,  107,  154,
911
      154,  164,  165,  199,  227,  108,  109,  203,  203,  221,
912
      208,  110,  401,  203,  203,  111,   90,  177,  200,  166,
913
      204,  140,  140,  141,  374,  112,  204,  227,  142,  155,
914
      205,  221,  113,  208,  143,  223,  205,  214,  111,   90,
915
      206,  158,  158,  372,  148,  148,  206,  112,  215,  216,
916
      149,  155,  205,  159,  113,  109,  371,  223,  205,  209,
917
      110,  225,  206,  232,  111,   90,  130,  130,  206,  233,
918
      369,  215,  216,  131,  112,  234,  132,  133,  134,  237,
919
920
      367,  113,  209,  225,  238,  232,  240,  111,   90,  235,
921
      366,  233,  228,  229,  230,  236,  112,  234,  365,  239,
922
      364,  237,  135,  113,  114,  177,  177,  238,  240,  115,
923
      177,  231,  235,  116,   90,  228,  229,  230,  236,  242,
924
      244,  239,  177,  117,  177,  177,  362,  243,  245,  177,
925
      118,  247,  177,  231,  258,  258,  116,   90,  246,  359,
926
      177,  242,  244,  351,  177,  117,  249,  177,  248,  243,
927
      251,  245,  118,  114,  247,  250,  177,  177,  115,  177,
928
      246,  252,  116,   90,  177,  254,  177,  338,  249,  259,
929
      248,  253,  117,  251,  257,  260,  337,  250,  255,  118,
930
931
      335,  256,  262,  252,  263,  116,   90,  334,  254,  203,
932
      203,  259,  332,  253,  117,  265,  257,  260,  213,  213,
933
      255,  118,  204,  256,  262,  266,  263,  217,  217,  218,
934
      218,  267,  205,  219,  219,  264,  264,  265,  222,  222,
935
      268,  269,  206,  270,  271,  272,  330,  273,  266,  274,
936
      329,  275,  276,  267,  205,  277,  278,  279,  280,  281,
937
      282,  283,  268,  269,  206,  270,  271,  328,  272,  273,
938
      177,  327,  274,  275,  276,  291,  325,  277,  278,  279,
939
      280,  281,  282,  283,  177,  177,  177,  177,  177,  177,
940
      177,  285,  286,  287,  288,  289,  290,  292,  291,  177,
941
942
      177,  177,  284,  177,  177,  293,  177,  294,  295,  296,
943
      305,  297,  261,  298,  285,  286,  287,  288,  289,  290,
944
      292,  177,  177,  258,  258,  303,  307,  299,  293,  300,
945
      294,  295,  296,  305,  297,  306,  298,  301,  301,  304,
946
      304,  264,  264,  308,  309,  207,  310,  303,  302,  307,
947
      299,  311,  300,  312,  182,  313,  314,  306,  315,  316,
948
      317,  318,  241,  319,  320,  308,  321,  309,  310,  322,
949
      323,  324,  177,  177,  311,  343,  312,  313,  314,  177,
950
      315,  316,  317,  177,  318,  319,  320,  344,  321,  333,
951
      331,  322,  323,  345,  324,  336,  301,  301,  343,  339,
952
953
      341,  341,  346,  342,  304,  304,  347,  302,  348,  344,
954
      349,  333,  331,  352,  353,  345,  354,  336,  355,  356,
955
      357,  339,  358,  177,  346,  360,  361,  177,  347,  161,
956
      348,  177,  349,  177,  177,  352,  353,  177,  363,  354,
957
      355,  177,  356,  357,  368,  358,  381,  360,  361,  370,
958
      341,  341,  373,  342,  382,  376,  377,  385,  378,  386,
959
      363,  379,  379,  387,  383,  383,  368,  384,  381,  388,
960
      389,  370,  380,  391,  373,  392,  382,  376,  377,  385,
961
      378,  386,  393,  394,  177,  395,  387,  396,  426,  426,
962
      177,  388,  389,  397,  220,  177,  391,  392,  402,  177,
963
964
      406,  398,  403,  410,  393,  407,  394,  395,  379,  379,
965
      396,  404,  404,  408,  405,  409,  397,  383,  383,  380,
966
      384,  402,  406,  398,  411,  403,  410,  407,  412,  413,
967
      414,  415,  416,  417,  177,  408,  150,  409,  177,  404,
968
      404,  177,  405,  177,  425,  177,  177,  411,  418,  177,
969
      412,  413,  420,  414,  415,  416,  417,  421,  419,  423,
970
      422,  424,  427,  212,  428,  429,  430,  425,  431,  434,
971
      418,  433,  177,  137,  420,  426,  426,  177,  438,  421,
972
      419,  423,  422,  424,  436,  427,  428,  429,  177,  430,
973
      177,  431,  434,  433,  177,  177,  439,  177,  445,  437,
974
975
      440,  438,  441,  446,  442,  139,  447,  436,  448,  177,
976
      458,  458,  459,  177,  460,  461,  462,  177,  207,  439,
977
      445,  437,  177,  440,  457,  441,  446,  442,  447,  452,
978
      448,  471,  464,  472,  459,  473,  460,  461,  462,  458,
979
      458,  477,  469,  201,  197,  193,  457,  188,  183,  182,
980
      178,  452,  177,  471,  464,  472,  167,  473,  161,  161,
981
      150,  139,  137,  477,  469,   58,   58,   58,   58,   58,
982
       59,   59,   59,   59,   59,   69,   69,   69,   69,   69,
983
       74,   74,   74,   74,   74,   75,   75,   75,   75,   75,
984
       78,   78,   78,   78,   78,   80,   80,   80,   80,   80,
985
986
       84,   84,   84,   84,   84,   90,   90,   90,   90,   90,
987
       95,   95,   95,   95,   95,  122,  122,  122,  122,  122,
988
      128,  128,  128,  128,  128,  129,  129,  129,  129,  129,
989
      136,  136,  136,  136,  136,  157,  481,  157,  157,  157,
990
      160,   58,  160,  160,  160,  176,  176,  181,  181,  181,
991
      181,  181,  210,   58,  210,  210,  210,  211,   58,  211,
992
      211,  211,  350,  350,   58,  350,  350,  443,  443,  443,
993
      443,  443,   89,   89,   86,   86,   83,   83,   58,   58,
994
       79,   79,   58,   58,   57,  481,  481,  481,  481,  481,
995
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
996
997
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
998
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
999
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
1000
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
1001
      481,  481,  481
1002
    } ;
1003
1004
static const flex_int16_t yy_chk[1244] =
1005
    {   0,
1006
        0,    3,    3,  498,    3,    3,   11,   11,    3,    5,
1007
        5,    3,    3,    3,   23,    5,    6,    6,   19,   20,
1008
       19,   20,    6,   23,   24,   27,   28,  497,   27,   28,
1009
       12,   12,   33,   24,   33,  286,   11,    3,    4,    4,
1010
      286,    4,    4,  496,   34,    4,   34,  477,    4,    4,
1011
        4,   66,   66,  475,   37,  474,   60,   60,   11,   37,
1012
       12,   67,   67,   60,   70,   70,   60,   60,   60,   37,
1013
       70,   73,   73,   37,    4,    7,    7,    7,    7,    7,
1014
        7,    7,   12,    7,  471,    7,    7,    7,    7,    7,
1015
      469,   37,   60,   68,   68,   37,   61,   61,   71,   71,
1016
1017
       77,  133,  133,   61,   71,   68,   61,   61,   61,  464,
1018
       85,    7,    7,    8,    8,    8,    8,    8,    8,    8,
1019
      126,    8,   77,    8,    8,    8,    8,    8,  459,   38,
1020
       76,   76,   61,   85,   38,   79,   79,  134,  134,  139,
1021
      139,  140,  140,  126,   38,  142,  142,   79,   38,    8,
1022
        8,    9,    9,    9,    9,    9,    9,    9,  456,    9,
1023
       76,    9,    9,    9,    9,    9,   38,   65,   65,   65,
1024
       38,  455,   89,  300,   65,   93,  143,  143,  300,  106,
1025
       65,   93,   76,   89,  454,   89,  106,    9,    9,   10,
1026
       10,   10,   10,   10,   10,   10,   89,   10,   99,   10,
1027
1028
       10,   10,   10,   10,   93,  453,   89,  101,   89,  106,
1029
       94,   49,   49,   94,  144,  144,  100,  370,   89,  100,
1030
      451,   99,  370,  101,   49,   10,   10,   31,   31,   31,
1031
       31,   31,   31,   31,   49,   31,   94,   31,   31,   31,
1032
       31,   31,  100,   99,   49,  101,  105,  127,  373,  102,
1033
       31,  443,  102,  373,   31,  441,   49,  135,  135,  145,
1034
      145,  440,  105,   31,   31,  439,   49,  438,  107,  135,
1035
      127,  107,   31,   50,   50,  102,   31,   32,   32,   32,
1036
       32,   32,   32,   32,  105,   32,   50,   32,   32,   32,
1037
       32,   32,   35,   36,  107,  108,   50,   35,   36,  111,
1038
1039
       32,  436,  108,  116,   32,  434,   50,   35,   36,  146,
1040
      146,   35,   36,   32,   32,  111,   35,   36,   50,  116,
1041
      121,  146,   32,  147,  147,  108,   32,   39,   50,   35,
1042
       36,  431,   39,   35,   36,   40,   39,  111,   35,   36,
1043
       40,  116,   39,  121,   40,  425,   39,   47,  112,   88,
1044
       40,  112,   47,  113,   40,  163,   88,  165,   88,   39,
1045
      113,  417,   47,  413,   39,  121,   47,   40,   39,  354,
1046
       48,   47,   40,   88,  112,   48,   40,   41,  163,   88,
1047
      165,   88,   41,  113,   47,   48,   41,   41,   47,   48,
1048
      155,   86,   41,   47,   48,   88,   41,  117,   86,   86,
1049
1050
      117,  151,  151,   41,  159,  159,  350,   48,  118,   41,
1051
       41,   48,  155,  338,   41,  118,   48,   86,   41,  154,
1052
      154,   86,   86,  117,  166,   41,   43,  123,  123,  156,
1053
      205,   43,  376,  124,  124,   43,   43,  376,  118,   86,
1054
      123,  132,  132,  132,  337,   43,  124,  166,  132,  154,
1055
      123,  156,   43,  205,  132,  162,  124,  141,   43,   43,
1056
      123,  158,  158,  335,  148,  148,  124,   43,  141,  141,
1057
      148,  154,  123,  158,   43,   44,  334,  162,  124,  206,
1058
       44,  164,  123,  169,   44,   44,  130,  130,  124,  170,
1059
      332,  141,  141,  130,   44,  171,  130,  130,  130,  173,
1060
1061
      330,   44,  206,  164,  174,  169,  175,   44,   44,  172,
1062
      329,  170,  168,  168,  168,  172,   44,  171,  328,  174,
1063
      327,  173,  130,   44,   45,  180,  185,  174,  175,   45,
1064
      184,  168,  172,   45,   45,  168,  168,  168,  172,  180,
1065
      185,  174,  186,   45,  187,  189,  325,  184,  186,  190,
1066
       45,  189,  191,  168,  207,  207,   45,   45,  187,  319,
1067
      192,  180,  185,  311,  194,   45,  191,  195,  190,  184,
1068
      194,  186,   45,   46,  189,  192,  196,  202,   46,  198,
1069
      187,  195,   46,   46,  199,  198,  200,  298,  191,  208,
1070
      190,  196,   46,  194,  202,  209,  297,  192,  199,   46,
1071
1072
      295,  200,  215,  195,  216,   46,   46,  294,  198,  203,
1073
      203,  208,  292,  196,   46,  221,  202,  209,  213,  213,
1074
      199,   46,  203,  200,  215,  223,  216,  217,  217,  218,
1075
      218,  224,  203,  219,  219,  220,  220,  221,  222,  222,
1076
      225,  226,  203,  227,  228,  229,  290,  230,  223,  231,
1077
      289,  232,  233,  224,  203,  234,  235,  236,  237,  238,
1078
      239,  240,  225,  226,  203,  227,  228,  288,  229,  230,
1079
      248,  287,  231,  232,  233,  248,  285,  234,  235,  236,
1080
      237,  238,  239,  240,  242,  243,  244,  245,  246,  247,
1081
      249,  242,  243,  244,  245,  246,  247,  249,  248,  250,
1082
1083
      251,  252,  241,  253,  254,  250,  255,  251,  252,  253,
1084
      262,  254,  214,  255,  242,  243,  244,  245,  246,  247,
1085
      249,  256,  257,  258,  258,  260,  265,  256,  250,  257,
1086
      251,  252,  253,  262,  254,  263,  255,  259,  259,  261,
1087
      261,  264,  264,  266,  267,  204,  268,  260,  259,  265,
1088
      256,  269,  257,  270,  181,  271,  272,  263,  273,  274,
1089
      276,  277,  179,  278,  279,  266,  280,  267,  268,  281,
1090
      282,  283,  291,  293,  269,  303,  270,  271,  272,  296,
1091
      273,  274,  276,  299,  277,  278,  279,  305,  280,  293,
1092
      291,  281,  282,  306,  283,  296,  301,  301,  303,  299,
1093
1094
      302,  302,  307,  302,  304,  304,  308,  301,  309,  305,
1095
      310,  293,  291,  312,  313,  306,  314,  296,  315,  316,
1096
      317,  299,  318,  326,  307,  320,  323,  176,  308,  161,
1097
      309,  333,  310,  331,  336,  312,  313,  339,  326,  314,
1098
      315,  340,  316,  317,  331,  318,  344,  320,  323,  333,
1099
      341,  341,  336,  341,  345,  339,  340,  347,  340,  348,
1100
      326,  343,  343,  349,  346,  346,  331,  346,  344,  352,
1101
      353,  333,  343,  355,  336,  356,  345,  339,  340,  347,
1102
      340,  348,  357,  358,  368,  360,  349,  361,  407,  407,
1103
      363,  352,  353,  363,  150,  377,  355,  356,  377,  378,
1104
1105
      381,  368,  378,  387,  357,  382,  358,  360,  379,  379,
1106
      361,  380,  380,  385,  380,  386,  363,  383,  383,  379,
1107
      383,  377,  381,  368,  389,  378,  387,  382,  391,  392,
1108
      393,  394,  395,  396,  397,  385,  149,  386,  398,  404,
1109
      404,  399,  404,  403,  406,  402,  400,  389,  397,  401,
1110
      391,  392,  399,  393,  394,  395,  396,  400,  398,  402,
1111
      401,  403,  408,  138,  409,  410,  411,  406,  412,  416,
1112
      397,  415,  420,  136,  399,  426,  426,  418,  420,  400,
1113
      398,  402,  401,  403,  418,  408,  409,  410,  419,  411,
1114
      421,  412,  416,  415,  422,  423,  421,  424,  427,  419,
1115
1116
      422,  420,  423,  428,  424,  131,  429,  418,  430,  442,
1117
      444,  444,  445,  437,  446,  447,  448,  452,  125,  421,
1118
      427,  419,  457,  422,  442,  423,  428,  424,  429,  437,
1119
      430,  460,  452,  461,  445,  462,  446,  447,  448,  458,
1120
      458,  473,  457,  119,  114,  109,  442,  103,   97,   96,
1121
       91,  437,   90,  460,  452,  461,   87,  462,   82,   81,
1122
       72,   64,   62,  473,  457,  482,  482,  482,  482,  482,
1123
      483,  483,  483,  483,  483,  484,  484,  484,  484,  484,
1124
      485,  485,  485,  485,  485,  486,  486,  486,  486,  486,
1125
      487,  487,  487,  487,  487,  488,  488,  488,  488,  488,
1126
1127
      489,  489,  489,  489,  489,  490,  490,  490,  490,  490,
1128
      491,  491,  491,  491,  491,  492,  492,  492,  492,  492,
1129
      493,  493,  493,  493,  493,  494,  494,  494,  494,  494,
1130
      495,  495,  495,  495,  495,  499,   57,  499,  499,  499,
1131
      500,   54,  500,  500,  500,  501,  501,  502,  502,  502,
1132
      502,  502,  503,   53,  503,  503,  503,  504,   52,  504,
1133
      504,  504,  505,  505,   51,  505,  505,  506,  506,  506,
1134
      506,  506,   30,   29,   26,   25,   22,   21,   18,   17,
1135
       16,   15,   14,   13,  481,  481,  481,  481,  481,  481,
1136
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
1137
1138
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
1139
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
1140
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
1141
      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
1142
      481,  481,  481
1143
    } ;
1144
1145
static const flex_int16_t yy_rule_linenum[85] =
1146
    {   0,
1147
      273,  274,  276,  277,  278,  280,  281,  282,  297,  298,
1148
      300,  301,  303,  304,  307,  308,  315,  316,  320,  322,
1149
      324,  326,  328,  330,  332,  334,  336,  338,  397,  404,
1150
      411,  413,  418,  423,  429,  434,  450,  451,  453,  454,
1151
      456,  458,  475,  476,  477,  478,  479,  481,  497,  498,
1152
      499,  500,  501,  503,  519,  520,  521,  522,  525,  546,
1153
      547,  548,  549,  550,  551,  554,  555,  557,  558,  560,
1154
      577,  580,  597,  598,  600,  601,  603,  605,  608,  611,
1155
      614,  618,  622,  624
1156
    } ;
1157
1158
/* The intent behind this definition is that it'll catch
1159
 * any uses of REJECT which flex missed.
1160
 */
1161
#define REJECT reject_used_but_not_detected
1162
#define yymore() yymore_used_but_not_detected
1163
0
#define YY_MORE_ADJ 0
1164
#define YY_RESTORE_YY_MORE_OFFSET
1165
#line 1 "/src/wireshark/epan/diam_dict.l"
1166
1167
/*
1168
 * We want a reentrant scanner.
1169
 */
1170
/*
1171
 * We don't use input, so don't generate code for it.
1172
 */
1173
#define YY_NO_INPUT 1
1174
/*
1175
 * We don't use unput, so don't generate code for it.
1176
 */
1177
/*
1178
 * We don't read interactively from the terminal.
1179
 */
1180
/*
1181
 * The language we're scanning is case-insensitive.
1182
 */
1183
/*
1184
 * We use start condition stacks.
1185
 */
1186
/*
1187
 * We want to stop processing when we get to the end of the input.
1188
 */
1189
/*
1190
 * The type for the state we keep for a scanner.
1191
 */
1192
/*
1193
 * Prefix scanner routines with "DiamDict_" rather than "yy", so this scanner
1194
 * can coexist with other scanners.
1195
 */
1196
/*
1197
 * We have to override the memory allocators so that we don't get
1198
 * "unused argument" warnings from the yyscanner argument (which
1199
 * we don't use, as we have a global memory allocator).
1200
 *
1201
 * We provide, as macros, our own versions of the routines generated by Flex,
1202
 * which just call malloc()/realloc()/free() (as the Flex versions do),
1203
 * discarding the extra argument.
1204
 */
1205
#line 67 "/src/wireshark/epan/diam_dict.l"
1206
  /*
1207
   ** diam_dict.h
1208
   ** Diameter Dictionary Import Routines
1209
   **
1210
   ** (c) 2007, Luis E. Garcia Ontanon <luis@ontanon.org>
1211
   **
1212
   ** This library is free software; you can redistribute it and/or
1213
   ** modify it under the terms of the GNU Library General Public
1214
   ** License as published by the Free Software Foundation; either
1215
   ** version 2 of the License, or (at your option) any later version.
1216
   **
1217
   ** This library is distributed in the hope that it will be useful,
1218
   ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1219
   ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1220
   ** Library General Public License for more details.
1221
   **
1222
   ** You should have received a copy of the GNU Library General Public
1223
   ** License along with this library; if not, write to the Free Software
1224
   ** Foundation, Inc., 51 Franklin Street, Fifth Floor,
1225
   ** Boston, MA  02110-1301, USA.
1226
   **
1227
   ** See draft-frascone-xml-dictionary for the syntax of the
1228
   ** dictionary.
1229
   */
1230
1231
#include <glib.h>
1232
#include <stdio.h>
1233
#include <string.h>
1234
#include <errno.h>
1235
#include <stdlib.h>
1236
#include <stdarg.h>
1237
#include "diam_dict.h"
1238
#include <epan/to_str.h>
1239
#include <wsutil/file_util.h>
1240
1241
/*
1242
 * Disable diagnostics in the code generated by Flex.
1243
 */
1244
DIAG_OFF_FLEX()
1245
1246
typedef struct entity_t {
1247
  char* name;
1248
  char* file;
1249
  struct entity_t* next;
1250
} entity_t;
1251
1252
0
#define ATTR_UINT(cont) do { D(("attr_uint " #cont "\t" )); yyextra->attr_uint = &(cont); yy_push_state(GET_UINT_ATTR, yyscanner); } while(0)
1253
0
#define ATTR_STR(cont) do { D(("attr_str " #cont "\t" )); yyextra->attr_str = &(cont); yy_push_state(GET_ATTR, yyscanner); } while(0)
1254
0
#define IGNORE() do { D(("ignore: %s\t",yytext)); yy_push_state(IGNORE_ATTR, yyscanner); } while(0)
1255
1256
0
#define D(args) ddict_debug args
1257
1258
0
#define MAX_INCLUDE_DEPTH 10
1259
0
#define YY_INPUT(buf,result,max_size) { result = yyextra->current_yyinput(buf,max_size,yyscanner); }
1260
0
#define YY_USER_INIT { \
1261
0
  DiamDict_scanner_state_t *scanner_state = DiamDict_get_extra(yyscanner); \
1262
0
  BEGIN(scanner_state->start_state); \
1263
0
}
1264
#define ECHO
1265
0
#define APPEND(txt,len) append_to_buffer(txt,len,yyextra)
1266
1267
typedef struct {
1268
  const char* sys_dir;
1269
1270
  char* write_ptr;
1271
  char* read_ptr;
1272
1273
  char* strbuf;
1274
  unsigned size_strbuf;
1275
  unsigned len_strbuf;
1276
1277
  ddict_t* dict;
1278
1279
  ddict_application_t* appl;
1280
  ddict_avp_t* avp;
1281
  ddict_enum_t* enumitem;
1282
  ddict_gavp_t* gavp;
1283
  ddict_typedefn_t* typedefn;
1284
  ddict_cmd_t* cmd;
1285
  ddict_vendor_t* vnd;
1286
  ddict_xmlpi_t* xmlpi;
1287
1288
  ddict_application_t* last_appl;
1289
  ddict_avp_t* last_avp;
1290
  ddict_enum_t* last_enumitem;
1291
  ddict_gavp_t* last_gavp;
1292
  ddict_typedefn_t* last_typedefn;
1293
  ddict_cmd_t* last_cmd;
1294
  ddict_vendor_t* last_vnd;
1295
  ddict_xmlpi_t* last_xmlpi;
1296
1297
  entity_t *ents;
1298
1299
  char** attr_str;
1300
  unsigned* attr_uint;
1301
1302
  size_t (*current_yyinput)(char*,size_t,yyscan_t);
1303
  int (*current_close)(FILE *fh);
1304
1305
  YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
1306
  int include_stack_ptr;
1307
1308
  int start_state;
1309
} DiamDict_scanner_state_t;
1310
1311
static void ddict_debug(const char* fmt, ...) G_GNUC_PRINTF(1, 2);
1312
static void append_to_buffer(const char* txt, unsigned len, DiamDict_scanner_state_t *statep);
1313
static FILE* ddict_open(const char*, const char*);
1314
1315
/*
1316
 * Sleazy hack to suppress compiler warnings in yy_fatal_error().
1317
 */
1318
0
#define YY_EXIT_FAILURE ((void)yyscanner, 2)
1319
1320
/*
1321
 * Macros for the allocators, to discard the extra argument.
1322
 */
1323
0
#define DiamDict_alloc(size, yyscanner)   (void *)malloc(size)
1324
0
#define DiamDict_realloc(ptr, size, yyscanner)  (void *)realloc((char *)(ptr), (size))
1325
0
#define DiamDict_free(ptr, yyscanner)   free((char *)ptr)
1326
1327
#line 1328 "/work/build/epan/diam_dict.c"
1328
1329
#line 1330 "/work/build/epan/diam_dict.c"
1330
1331
#define INITIAL 0
1332
0
#define LOADING 1
1333
0
#define LOADING_COMMENT 2
1334
0
#define LOADING_XMLPI 3
1335
0
#define ENTITY 4
1336
0
#define GET_SYSTEM 5
1337
0
#define GET_FILE 6
1338
0
#define END_ENTITY 7
1339
0
#define GET_ATTR 8
1340
0
#define GET_UINT_ATTR 9
1341
0
#define END_ATTR 10
1342
0
#define OUTSIDE 11
1343
0
#define IN_DICT 12
1344
0
#define IN_APPL 13
1345
0
#define IN_AVP 14
1346
0
#define APPL_ATTRS 15
1347
0
#define IGNORE_ATTR 16
1348
0
#define TYPE_ATTRS 17
1349
0
#define GAVP_ATTRS 18
1350
0
#define ENUM_ATTRS 19
1351
0
#define AVP_ATTRS 20
1352
0
#define VENDOR_ATTRS 21
1353
0
#define COMMAND_ATTRS 22
1354
0
#define TYPEDEFN_ATTRS 23
1355
0
#define XMLPI_ATTRS 24
1356
0
#define XMLPI_GETKEY 25
1357
0
#define XMLPI_GETVAL 26
1358
#define XMLPI_ENDATTR 27
1359
1360
#ifndef YY_NO_UNISTD_H
1361
/* Special case for "unistd.h", since it is non-ANSI. We include it way
1362
 * down here because we want the user's section 1 to have been scanned first.
1363
 * The user has a chance to override it with an option.
1364
 */
1365
/* %if-c-only */
1366
#include <unistd.h>
1367
/* %endif */
1368
/* %if-c++-only */
1369
/* %endif */
1370
#endif
1371
1372
#define YY_EXTRA_TYPE DiamDict_scanner_state_t *
1373
1374
/* %if-c-only Reentrant structure and macros (non-C++). */
1375
/* %if-reentrant */
1376
1377
/* Holds the entire state of the reentrant scanner. */
1378
struct yyguts_t
1379
    {
1380
1381
    /* User-defined. Not touched by flex. */
1382
    YY_EXTRA_TYPE yyextra_r;
1383
1384
    /* The rest are the same as the globals declared in the non-reentrant scanner. */
1385
    FILE *yyin_r, *yyout_r;
1386
    size_t yy_buffer_stack_top; /**< index of top of stack. */
1387
    size_t yy_buffer_stack_max; /**< capacity of stack. */
1388
    YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1389
    char yy_hold_char;
1390
    int yy_n_chars;
1391
    int yyleng_r;
1392
    char *yy_c_buf_p;
1393
    int yy_init;
1394
    int yy_start;
1395
    int yy_did_buffer_switch_on_eof;
1396
    int yy_start_stack_ptr;
1397
    int yy_start_stack_depth;
1398
    int *yy_start_stack;
1399
    yy_state_type yy_last_accepting_state;
1400
    char* yy_last_accepting_cpos;
1401
1402
    int yylineno_r;
1403
    int yy_flex_debug_r;
1404
1405
    char *yytext_r;
1406
    int yy_more_flag;
1407
    int yy_more_len;
1408
1409
    }; /* end struct yyguts_t */
1410
1411
/* %if-c-only */
1412
1413
static int yy_init_globals ( yyscan_t yyscanner );
1414
1415
/* %endif */
1416
1417
/* %if-reentrant */
1418
1419
int yylex_init (yyscan_t* scanner);
1420
1421
int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
1422
1423
/* %endif */
1424
1425
/* %endif End reentrant structures and macros. */
1426
1427
/* Accessor methods to globals.
1428
   These are made visible to non-reentrant scanners for convenience. */
1429
1430
int yylex_destroy ( yyscan_t yyscanner );
1431
1432
int yyget_debug ( yyscan_t yyscanner );
1433
1434
void yyset_debug ( int debug_flag , yyscan_t yyscanner );
1435
1436
YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
1437
1438
void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
1439
1440
FILE *yyget_in ( yyscan_t yyscanner );
1441
1442
void yyset_in  ( FILE * _in_str , yyscan_t yyscanner );
1443
1444
FILE *yyget_out ( yyscan_t yyscanner );
1445
1446
void yyset_out  ( FILE * _out_str , yyscan_t yyscanner );
1447
1448
      int yyget_leng ( yyscan_t yyscanner );
1449
1450
char *yyget_text ( yyscan_t yyscanner );
1451
1452
int yyget_lineno ( yyscan_t yyscanner );
1453
1454
void yyset_lineno ( int _line_number , yyscan_t yyscanner );
1455
1456
int yyget_column  ( yyscan_t yyscanner );
1457
1458
void yyset_column ( int _column_no , yyscan_t yyscanner );
1459
1460
/* %if-bison-bridge */
1461
/* %endif */
1462
1463
/* Macros after this point can all be overridden by user definitions in
1464
 * section 1.
1465
 */
1466
1467
#ifndef YY_SKIP_YYWRAP
1468
#ifdef __cplusplus
1469
extern "C" int yywrap ( yyscan_t yyscanner );
1470
#else
1471
extern int yywrap ( yyscan_t yyscanner );
1472
#endif
1473
#endif
1474
1475
/* %not-for-header */
1476
#ifndef YY_NO_UNPUT
1477
    
1478
#endif
1479
/* %ok-for-header */
1480
1481
/* %endif */
1482
1483
#ifndef yytext_ptr
1484
static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
1485
#endif
1486
1487
#ifdef YY_NEED_STRLEN
1488
static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
1489
#endif
1490
1491
#ifndef YY_NO_INPUT
1492
/* %if-c-only Standard (non-C++) definition */
1493
/* %not-for-header */
1494
#ifdef __cplusplus
1495
static int yyinput ( yyscan_t yyscanner );
1496
#else
1497
static int input ( yyscan_t yyscanner );
1498
#endif
1499
/* %ok-for-header */
1500
1501
/* %endif */
1502
#endif
1503
1504
/* %if-c-only */
1505
1506
    static void yy_push_state ( int _new_state , yyscan_t yyscanner);
1507
    
1508
    static void yy_pop_state ( yyscan_t yyscanner );
1509
    
1510
    static int yy_top_state ( yyscan_t yyscanner );
1511
    
1512
/* %endif */
1513
1514
/* Amount of stuff to slurp up with each read. */
1515
#ifndef YY_READ_BUF_SIZE
1516
#ifdef __ia64__
1517
/* On IA-64, the buffer size is 16k, not 8k */
1518
#define YY_READ_BUF_SIZE 16384
1519
#else
1520
0
#define YY_READ_BUF_SIZE 8192
1521
#endif /* __ia64__ */
1522
#endif
1523
1524
/* Copy whatever the last rule matched to the standard output. */
1525
#ifndef ECHO
1526
/* %if-c-only Standard (non-C++) definition */
1527
/* This used to be an fputs(), but since the string might contain NUL's,
1528
 * we now use fwrite().
1529
 */
1530
#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1531
/* %endif */
1532
/* %if-c++-only C++ definition */
1533
/* %endif */
1534
#endif
1535
1536
/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1537
 * is returned in "result".
1538
 */
1539
#ifndef YY_INPUT
1540
#define YY_INPUT(buf,result,max_size) \
1541
/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
1542
  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1543
    { \
1544
    int c = '*'; \
1545
    int n; \
1546
    for ( n = 0; n < max_size && \
1547
           (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1548
      buf[n] = (char) c; \
1549
    if ( c == '\n' ) \
1550
      buf[n++] = (char) c; \
1551
    if ( c == EOF && ferror( yyin ) ) \
1552
      YY_FATAL_ERROR( "input in flex scanner failed" ); \
1553
    result = n; \
1554
    } \
1555
  else \
1556
    { \
1557
    errno=0; \
1558
    while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1559
      { \
1560
      if( errno != EINTR) \
1561
        { \
1562
        YY_FATAL_ERROR( "input in flex scanner failed" ); \
1563
        break; \
1564
        } \
1565
      errno=0; \
1566
      clearerr(yyin); \
1567
      } \
1568
    }\
1569
\
1570
/* %if-c++-only C++ definition \ */\
1571
/* %endif */
1572
1573
#endif
1574
1575
/* No semi-colon after return; correct usage is to write "yyterminate();" -
1576
 * we don't want an extra ';' after the "return" because that will cause
1577
 * some compilers to complain about unreachable statements.
1578
 */
1579
#ifndef yyterminate
1580
0
#define yyterminate() return YY_NULL
1581
#endif
1582
1583
/* Number of entries by which start-condition stack grows. */
1584
#ifndef YY_START_STACK_INCR
1585
0
#define YY_START_STACK_INCR 25
1586
#endif
1587
1588
/* Report a fatal error. */
1589
#ifndef YY_FATAL_ERROR
1590
/* %if-c-only */
1591
0
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1592
/* %endif */
1593
/* %if-c++-only */
1594
/* %endif */
1595
#endif
1596
1597
/* %if-tables-serialization structures and prototypes */
1598
/* %not-for-header */
1599
/* %ok-for-header */
1600
1601
/* %not-for-header */
1602
/* %tables-yydmap generated elements */
1603
/* %endif */
1604
/* end tables serialization structures and prototypes */
1605
1606
/* %ok-for-header */
1607
1608
/* Default declaration of generated scanner - a define so the user can
1609
 * easily add parameters.
1610
 */
1611
#ifndef YY_DECL
1612
#define YY_DECL_IS_OURS 1
1613
/* %if-c-only Standard (non-C++) definition */
1614
1615
extern int yylex (yyscan_t yyscanner);
1616
1617
#define YY_DECL int yylex (yyscan_t yyscanner)
1618
/* %endif */
1619
/* %if-c++-only C++ definition */
1620
/* %endif */
1621
#endif /* !YY_DECL */
1622
1623
/* Code executed at the beginning of each rule, after yytext and yyleng
1624
 * have been set up.
1625
 */
1626
#ifndef YY_USER_ACTION
1627
#define YY_USER_ACTION
1628
#endif
1629
1630
/* Code executed at the end of each rule. */
1631
#ifndef YY_BREAK
1632
0
#define YY_BREAK /*LINTED*/break;
1633
#endif
1634
1635
/* %% [6.0] YY_RULE_SETUP definition goes here */
1636
#define YY_RULE_SETUP \
1637
  YY_USER_ACTION
1638
1639
/* %not-for-header */
1640
/** The main scanner function which does all the work.
1641
 */
1642
YY_DECL
1643
0
{
1644
0
  yy_state_type yy_current_state;
1645
0
  char *yy_cp, *yy_bp;
1646
0
  int yy_act;
1647
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1648
1649
0
  if ( !yyg->yy_init )
1650
0
    {
1651
0
    yyg->yy_init = 1;
1652
1653
0
#ifdef YY_USER_INIT
1654
0
    YY_USER_INIT;
1655
0
#endif
1656
1657
0
    if ( ! yyg->yy_start )
1658
0
      yyg->yy_start = 1; /* first start state */
1659
1660
0
    if ( ! yyin )
1661
/* %if-c-only */
1662
0
      yyin = stdin;
1663
/* %endif */
1664
/* %if-c++-only */
1665
/* %endif */
1666
1667
0
    if ( ! yyout )
1668
/* %if-c-only */
1669
0
      yyout = stdout;
1670
/* %endif */
1671
/* %if-c++-only */
1672
/* %endif */
1673
1674
0
    if ( ! YY_CURRENT_BUFFER ) {
1675
0
      yyensure_buffer_stack (yyscanner);
1676
0
      YY_CURRENT_BUFFER_LVALUE =
1677
0
        yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1678
0
    }
1679
1680
0
    yy_load_buffer_state( yyscanner );
1681
0
    }
1682
1683
0
  {
1684
/* %% [7.0] user's declarations go here */
1685
0
#line 272 "/src/wireshark/epan/diam_dict.l"
1686
1687
0
#line 1688 "/work/build/epan/diam_dict.c"
1688
1689
0
  while ( /*CONSTCOND*/1 )    /* loops until end-of-file is reached */
1690
0
    {
1691
/* %% [8.0] yymore()-related code goes here */
1692
0
    yy_cp = yyg->yy_c_buf_p;
1693
1694
    /* Support of yytext. */
1695
0
    *yy_cp = yyg->yy_hold_char;
1696
1697
    /* yy_bp points to the position in yy_ch_buf of the start of
1698
     * the current run.
1699
     */
1700
0
    yy_bp = yy_cp;
1701
1702
/* %% [9.0] code to set up and find next match goes here */
1703
0
    yy_current_state = yyg->yy_start;
1704
0
yy_match:
1705
0
    do
1706
0
      {
1707
0
      YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1708
0
      if ( yy_accept[yy_current_state] )
1709
0
        {
1710
0
        yyg->yy_last_accepting_state = yy_current_state;
1711
0
        yyg->yy_last_accepting_cpos = yy_cp;
1712
0
        }
1713
0
      while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1714
0
        {
1715
0
        yy_current_state = (int) yy_def[yy_current_state];
1716
0
        if ( yy_current_state >= 482 )
1717
0
          yy_c = yy_meta[yy_c];
1718
0
        }
1719
0
      yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1720
0
      ++yy_cp;
1721
0
      }
1722
0
    while ( yy_current_state != 481 );
1723
0
    yy_cp = yyg->yy_last_accepting_cpos;
1724
0
    yy_current_state = yyg->yy_last_accepting_state;
1725
1726
0
yy_find_action:
1727
/* %% [10.0] code to find the action number goes here */
1728
0
    yy_act = yy_accept[yy_current_state];
1729
1730
0
    YY_DO_BEFORE_ACTION;
1731
1732
/* %% [11.0] code for yylineno update goes here */
1733
1734
0
do_action:  /* This label is used only to access EOF actions. */
1735
1736
/* %% [12.0] debug code goes here */
1737
0
    if ( yy_flex_debug )
1738
0
      {
1739
0
      if ( yy_act == 0 )
1740
0
        fprintf( stderr, "--scanner backing up\n" );
1741
0
      else if ( yy_act < 85 )
1742
0
        fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1743
0
                 (long)yy_rule_linenum[yy_act], yytext );
1744
0
      else if ( yy_act == 85 )
1745
0
        fprintf( stderr, "--accepting default rule (\"%s\")\n",
1746
0
                 yytext );
1747
0
      else if ( yy_act == 86 )
1748
0
        fprintf( stderr, "--(end of buffer or a NUL)\n" );
1749
0
      else
1750
0
        fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1751
0
      }
1752
1753
0
    switch ( yy_act )
1754
0
  { /* beginning of action switch */
1755
/* %% [13.0] actions go here */
1756
0
      case 0: /* must back up */
1757
      /* undo the effects of YY_DO_BEFORE_ACTION */
1758
0
      *yy_cp = yyg->yy_hold_char;
1759
0
      yy_cp = yyg->yy_last_accepting_cpos;
1760
0
      yy_current_state = yyg->yy_last_accepting_state;
1761
0
      goto yy_find_action;
1762
1763
0
case 1:
1764
/* rule 1 can match eol */
1765
0
YY_RULE_SETUP
1766
0
#line 273 "/src/wireshark/epan/diam_dict.l"
1767
0
;
1768
0
  YY_BREAK
1769
0
case 2:
1770
/* rule 2 can match eol */
1771
0
YY_RULE_SETUP
1772
0
#line 274 "/src/wireshark/epan/diam_dict.l"
1773
0
;
1774
0
  YY_BREAK
1775
0
case 3:
1776
/* rule 3 can match eol */
1777
0
YY_RULE_SETUP
1778
0
#line 276 "/src/wireshark/epan/diam_dict.l"
1779
0
BEGIN LOADING_COMMENT;
1780
0
  YY_BREAK
1781
0
case 4:
1782
0
YY_RULE_SETUP
1783
0
#line 277 "/src/wireshark/epan/diam_dict.l"
1784
0
;
1785
0
  YY_BREAK
1786
0
case 5:
1787
/* rule 5 can match eol */
1788
0
YY_RULE_SETUP
1789
0
#line 278 "/src/wireshark/epan/diam_dict.l"
1790
0
BEGIN LOADING;
1791
0
  YY_BREAK
1792
0
case 6:
1793
/* rule 6 can match eol */
1794
0
YY_RULE_SETUP
1795
0
#line 280 "/src/wireshark/epan/diam_dict.l"
1796
0
BEGIN LOADING_XMLPI;
1797
0
  YY_BREAK
1798
0
case 7:
1799
/* rule 7 can match eol */
1800
0
YY_RULE_SETUP
1801
0
#line 281 "/src/wireshark/epan/diam_dict.l"
1802
0
;
1803
0
  YY_BREAK
1804
0
case 8:
1805
0
YY_RULE_SETUP
1806
0
#line 282 "/src/wireshark/epan/diam_dict.l"
1807
0
{
1808
0
  yyextra->xmlpi = g_new(ddict_xmlpi_t,1);
1809
0
  yyextra->xmlpi->name = g_strdup(yytext);
1810
0
  yyextra->xmlpi->key = NULL;
1811
0
  yyextra->xmlpi->value = NULL;
1812
0
  yyextra->xmlpi->next = NULL;
1813
1814
0
  if (!yyextra->dict->xmlpis)
1815
0
    yyextra->last_xmlpi = yyextra->dict->xmlpis = yyextra->xmlpi;
1816
0
  else
1817
0
    yyextra->last_xmlpi = yyextra->last_xmlpi->next = yyextra->xmlpi;
1818
1819
0
  BEGIN XMLPI_ATTRS;
1820
0
}
1821
0
  YY_BREAK
1822
0
case 9:
1823
/* rule 9 can match eol */
1824
0
YY_RULE_SETUP
1825
0
#line 297 "/src/wireshark/epan/diam_dict.l"
1826
0
BEGIN XMLPI_GETKEY;
1827
0
  YY_BREAK
1828
0
case 10:
1829
/* rule 10 can match eol */
1830
0
YY_RULE_SETUP
1831
0
#line 298 "/src/wireshark/epan/diam_dict.l"
1832
0
{ yyextra->xmlpi->key = g_strdup(yytext); BEGIN XMLPI_ATTRS; }
1833
0
  YY_BREAK
1834
0
case 11:
1835
/* rule 11 can match eol */
1836
0
YY_RULE_SETUP
1837
0
#line 300 "/src/wireshark/epan/diam_dict.l"
1838
0
BEGIN XMLPI_GETVAL;
1839
0
  YY_BREAK
1840
0
case 12:
1841
/* rule 12 can match eol */
1842
0
YY_RULE_SETUP
1843
0
#line 301 "/src/wireshark/epan/diam_dict.l"
1844
0
{ yyextra->xmlpi->value = g_strdup(yytext); BEGIN XMLPI_ATTRS; }
1845
0
  YY_BREAK
1846
0
case 13:
1847
0
YY_RULE_SETUP
1848
0
#line 303 "/src/wireshark/epan/diam_dict.l"
1849
1850
0
  YY_BREAK
1851
0
case 14:
1852
/* rule 14 can match eol */
1853
0
YY_RULE_SETUP
1854
0
#line 304 "/src/wireshark/epan/diam_dict.l"
1855
0
BEGIN LOADING;
1856
0
  YY_BREAK
1857
0
case 15:
1858
/* rule 15 can match eol */
1859
0
YY_RULE_SETUP
1860
0
#line 307 "/src/wireshark/epan/diam_dict.l"
1861
0
BEGIN ENTITY;
1862
0
  YY_BREAK
1863
0
case 16:
1864
0
YY_RULE_SETUP
1865
0
#line 308 "/src/wireshark/epan/diam_dict.l"
1866
0
{
1867
0
  entity_t* e = g_new(entity_t,1);
1868
0
  e->name = g_strdup(yytext);
1869
0
  e->next = yyextra->ents;
1870
0
  yyextra->ents = e;
1871
0
  BEGIN GET_SYSTEM;
1872
0
  };
1873
0
  YY_BREAK
1874
0
case 17:
1875
/* rule 17 can match eol */
1876
0
YY_RULE_SETUP
1877
0
#line 315 "/src/wireshark/epan/diam_dict.l"
1878
0
BEGIN GET_FILE;
1879
0
  YY_BREAK
1880
0
case 18:
1881
/* rule 18 can match eol */
1882
0
YY_RULE_SETUP
1883
0
#line 316 "/src/wireshark/epan/diam_dict.l"
1884
0
{
1885
0
    yyextra->ents->file = g_strdup(yytext);
1886
0
    BEGIN END_ENTITY;
1887
0
  }
1888
0
  YY_BREAK
1889
0
case 19:
1890
/* rule 19 can match eol */
1891
0
YY_RULE_SETUP
1892
0
#line 320 "/src/wireshark/epan/diam_dict.l"
1893
0
BEGIN LOADING;
1894
0
  YY_BREAK
1895
0
case 20:
1896
/* rule 20 can match eol */
1897
0
YY_RULE_SETUP
1898
0
#line 322 "/src/wireshark/epan/diam_dict.l"
1899
0
APPEND("<",1);
1900
0
  YY_BREAK
1901
0
case 21:
1902
/* rule 21 can match eol */
1903
0
YY_RULE_SETUP
1904
0
#line 324 "/src/wireshark/epan/diam_dict.l"
1905
0
APPEND(">",1);
1906
0
  YY_BREAK
1907
0
case 22:
1908
/* rule 22 can match eol */
1909
0
YY_RULE_SETUP
1910
0
#line 326 "/src/wireshark/epan/diam_dict.l"
1911
0
APPEND("/>",2);
1912
0
  YY_BREAK
1913
0
case 23:
1914
/* rule 23 can match eol */
1915
0
YY_RULE_SETUP
1916
0
#line 328 "/src/wireshark/epan/diam_dict.l"
1917
0
APPEND("</",2);
1918
0
  YY_BREAK
1919
0
case 24:
1920
/* rule 24 can match eol */
1921
0
YY_RULE_SETUP
1922
0
#line 330 "/src/wireshark/epan/diam_dict.l"
1923
0
APPEND(" ",1);
1924
0
  YY_BREAK
1925
0
case 25:
1926
/* rule 25 can match eol */
1927
0
YY_RULE_SETUP
1928
0
#line 332 "/src/wireshark/epan/diam_dict.l"
1929
0
APPEND(yytext, (unsigned) yyleng);
1930
0
  YY_BREAK
1931
0
case 26:
1932
/* rule 26 can match eol */
1933
0
YY_RULE_SETUP
1934
0
#line 334 "/src/wireshark/epan/diam_dict.l"
1935
0
APPEND("=",1);
1936
0
  YY_BREAK
1937
0
case 27:
1938
0
YY_RULE_SETUP
1939
0
#line 336 "/src/wireshark/epan/diam_dict.l"
1940
0
APPEND(yytext, (unsigned) yyleng);
1941
0
  YY_BREAK
1942
0
case 28:
1943
0
YY_RULE_SETUP
1944
0
#line 338 "/src/wireshark/epan/diam_dict.l"
1945
0
{
1946
0
  char* p = ++yytext;
1947
0
  entity_t* e;
1948
1949
0
  while(*p != ';') p++;
1950
1951
0
  *p = '\0';
1952
1953
0
  D(("looking for entity: %s\n",yytext));
1954
1955
0
  if ( yyextra->include_stack_ptr >= MAX_INCLUDE_DEPTH ) {
1956
0
    fprintf(stderr, "included files nested to deeply\n");
1957
0
    yyterminate();
1958
0
  }
1959
1960
0
  for (e = yyextra->ents; e; e = e->next) {
1961
0
    if (strcmp(e->name,yytext) == 0) {
1962
0
      yyin = ddict_open(yyextra->sys_dir,e->file);
1963
0
      D(("entity: %s filename: %s yyin: %p\n",e->name,e->file,(void*)yyin));
1964
0
      if (!yyin) {
1965
0
        if (errno)
1966
0
          fprintf(stderr, "Could not open file: '%s', error: %s\n", e->file, g_strerror(errno) );
1967
0
        else
1968
0
          fprintf(stderr, "Could not open file: '%s', error unknown (errno == 0)\n", e->file );
1969
0
        yyterminate();
1970
0
      } else {
1971
0
        yyextra->include_stack[yyextra->include_stack_ptr++] = YY_CURRENT_BUFFER;
1972
0
        yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner), yyscanner);
1973
0
        BEGIN LOADING;
1974
0
      }
1975
0
      break;
1976
0
    }
1977
0
  }
1978
1979
0
  if (!e) {
1980
0
    fprintf(stderr, "Could not find entity: '%s'\n", yytext );
1981
0
    yyterminate();
1982
0
  }
1983
1984
0
}
1985
0
  YY_BREAK
1986
0
case YY_STATE_EOF(INITIAL):
1987
0
case YY_STATE_EOF(LOADING):
1988
0
case YY_STATE_EOF(LOADING_COMMENT):
1989
0
case YY_STATE_EOF(LOADING_XMLPI):
1990
0
case YY_STATE_EOF(ENTITY):
1991
0
case YY_STATE_EOF(GET_SYSTEM):
1992
0
case YY_STATE_EOF(GET_FILE):
1993
0
case YY_STATE_EOF(END_ENTITY):
1994
0
case YY_STATE_EOF(GET_ATTR):
1995
0
case YY_STATE_EOF(GET_UINT_ATTR):
1996
0
case YY_STATE_EOF(END_ATTR):
1997
0
case YY_STATE_EOF(OUTSIDE):
1998
0
case YY_STATE_EOF(IN_DICT):
1999
0
case YY_STATE_EOF(IN_APPL):
2000
0
case YY_STATE_EOF(IN_AVP):
2001
0
case YY_STATE_EOF(APPL_ATTRS):
2002
0
case YY_STATE_EOF(IGNORE_ATTR):
2003
0
case YY_STATE_EOF(TYPE_ATTRS):
2004
0
case YY_STATE_EOF(GAVP_ATTRS):
2005
0
case YY_STATE_EOF(ENUM_ATTRS):
2006
0
case YY_STATE_EOF(AVP_ATTRS):
2007
0
case YY_STATE_EOF(VENDOR_ATTRS):
2008
0
case YY_STATE_EOF(COMMAND_ATTRS):
2009
0
case YY_STATE_EOF(TYPEDEFN_ATTRS):
2010
0
case YY_STATE_EOF(XMLPI_ATTRS):
2011
0
case YY_STATE_EOF(XMLPI_GETKEY):
2012
0
case YY_STATE_EOF(XMLPI_GETVAL):
2013
0
case YY_STATE_EOF(XMLPI_ENDATTR):
2014
0
#line 379 "/src/wireshark/epan/diam_dict.l"
2015
0
{
2016
0
  if (!yyin) yyterminate();
2017
2018
0
  yyextra->current_close(yyin);
2019
0
  D(("closing: %p %i\n",(void*)yyin,yyextra->include_stack_ptr));
2020
2021
0
  if ( --yyextra->include_stack_ptr < 0 ) {
2022
0
    D(("DONE READING\n"));
2023
0
    yyin = NULL;
2024
0
    yyterminate();
2025
0
  } else {
2026
0
    yy_delete_buffer( YY_CURRENT_BUFFER, yyscanner);
2027
0
    yy_switch_to_buffer(yyextra->include_stack[yyextra->include_stack_ptr], yyscanner);
2028
0
    BEGIN LOADING;
2029
0
  }
2030
0
}
2031
0
  YY_BREAK
2032
0
case 29:
2033
/* rule 29 can match eol */
2034
0
YY_RULE_SETUP
2035
0
#line 397 "/src/wireshark/epan/diam_dict.l"
2036
0
{
2037
0
  *(yyextra->attr_str) = g_strdup(yytext);
2038
0
  D(("%s\n",yytext));
2039
0
  yyextra->attr_str = NULL;
2040
0
  BEGIN END_ATTR;
2041
0
}
2042
0
  YY_BREAK
2043
0
case 30:
2044
0
YY_RULE_SETUP
2045
0
#line 404 "/src/wireshark/epan/diam_dict.l"
2046
0
{
2047
0
  *(yyextra->attr_uint) = (unsigned) strtoul(yytext,NULL,10);
2048
0
  D(("%s\n",yytext););
2049
0
  yyextra->attr_uint = NULL;
2050
0
  BEGIN END_ATTR;
2051
0
}
2052
0
  YY_BREAK
2053
0
case 31:
2054
0
YY_RULE_SETUP
2055
0
#line 411 "/src/wireshark/epan/diam_dict.l"
2056
0
{ yy_pop_state(yyscanner); }
2057
0
  YY_BREAK
2058
0
case 32:
2059
0
YY_RULE_SETUP
2060
0
#line 413 "/src/wireshark/epan/diam_dict.l"
2061
0
{
2062
  /* XXX: should go?*/
2063
0
  D(("{%s}",yytext));
2064
0
}
2065
0
  YY_BREAK
2066
0
case 33:
2067
/* rule 33 can match eol */
2068
0
YY_RULE_SETUP
2069
0
#line 418 "/src/wireshark/epan/diam_dict.l"
2070
0
{
2071
0
  D(("=>%s<=\n",yytext));
2072
0
  yy_pop_state(yyscanner);
2073
0
}
2074
0
  YY_BREAK
2075
0
case 34:
2076
0
YY_RULE_SETUP
2077
0
#line 423 "/src/wireshark/epan/diam_dict.l"
2078
0
{
2079
0
  D(("dictionary_start\n"));
2080
2081
0
  BEGIN IN_DICT;
2082
0
}
2083
0
  YY_BREAK
2084
0
case 35:
2085
/* rule 35 can match eol */
2086
0
YY_RULE_SETUP
2087
0
#line 429 "/src/wireshark/epan/diam_dict.l"
2088
0
{
2089
0
  D(("base_start\n"));
2090
0
  BEGIN IN_APPL;
2091
0
}
2092
0
  YY_BREAK
2093
0
case 36:
2094
0
YY_RULE_SETUP
2095
0
#line 434 "/src/wireshark/epan/diam_dict.l"
2096
0
{
2097
0
  D(("application_start\n"));
2098
2099
0
  yyextra->appl = g_new(ddict_application_t,1);
2100
0
  yyextra->appl->name = NULL;
2101
0
  yyextra->appl->code = 0;
2102
0
  yyextra->appl->next = NULL;
2103
2104
0
  if (!yyextra->dict->applications)
2105
0
    yyextra->last_appl = yyextra->dict->applications = yyextra->appl;
2106
0
  else
2107
0
    yyextra->last_appl = yyextra->last_appl->next = yyextra->appl;
2108
2109
0
  BEGIN APPL_ATTRS;
2110
0
}
2111
0
  YY_BREAK
2112
0
case 37:
2113
0
YY_RULE_SETUP
2114
0
#line 450 "/src/wireshark/epan/diam_dict.l"
2115
0
{ ATTR_STR(yyextra->appl->name); }
2116
0
  YY_BREAK
2117
0
case 38:
2118
0
YY_RULE_SETUP
2119
0
#line 451 "/src/wireshark/epan/diam_dict.l"
2120
0
{ ATTR_UINT(yyextra->appl->code); }
2121
0
  YY_BREAK
2122
0
case 39:
2123
0
YY_RULE_SETUP
2124
0
#line 453 "/src/wireshark/epan/diam_dict.l"
2125
0
BEGIN IN_APPL;
2126
0
  YY_BREAK
2127
0
case 40:
2128
0
YY_RULE_SETUP
2129
0
#line 454 "/src/wireshark/epan/diam_dict.l"
2130
0
BEGIN IN_DICT;
2131
0
  YY_BREAK
2132
0
case 41:
2133
0
YY_RULE_SETUP
2134
0
#line 456 "/src/wireshark/epan/diam_dict.l"
2135
0
;
2136
0
  YY_BREAK
2137
0
case 42:
2138
0
YY_RULE_SETUP
2139
0
#line 458 "/src/wireshark/epan/diam_dict.l"
2140
0
{
2141
0
  D(("command_start\n"));
2142
2143
0
  yyextra->cmd = g_new(ddict_cmd_t,1);
2144
0
  yyextra->cmd->name = NULL;
2145
0
  yyextra->cmd->vendor = NULL;
2146
0
  yyextra->cmd->code = 0;
2147
0
  yyextra->cmd->next = NULL;
2148
2149
0
  if (!yyextra->dict->cmds)
2150
0
    yyextra->last_cmd = yyextra->dict->cmds = yyextra->cmd;
2151
0
  else
2152
0
    yyextra->last_cmd = yyextra->last_cmd->next = yyextra->cmd;
2153
2154
0
  BEGIN COMMAND_ATTRS;
2155
0
}
2156
0
  YY_BREAK
2157
0
case 43:
2158
0
YY_RULE_SETUP
2159
0
#line 475 "/src/wireshark/epan/diam_dict.l"
2160
0
{ ATTR_STR(yyextra->cmd->name); }
2161
0
  YY_BREAK
2162
0
case 44:
2163
0
YY_RULE_SETUP
2164
0
#line 476 "/src/wireshark/epan/diam_dict.l"
2165
0
{ ATTR_STR(yyextra->cmd->vendor); }
2166
0
  YY_BREAK
2167
0
case 45:
2168
0
YY_RULE_SETUP
2169
0
#line 477 "/src/wireshark/epan/diam_dict.l"
2170
0
{ ATTR_UINT(yyextra->cmd->code); }
2171
0
  YY_BREAK
2172
0
case 46:
2173
0
#line 479 "/src/wireshark/epan/diam_dict.l"
2174
0
case 47:
2175
0
YY_RULE_SETUP
2176
0
#line 479 "/src/wireshark/epan/diam_dict.l"
2177
0
{ BEGIN IN_APPL; }
2178
0
  YY_BREAK
2179
0
case 48:
2180
0
YY_RULE_SETUP
2181
0
#line 481 "/src/wireshark/epan/diam_dict.l"
2182
0
{
2183
0
  D(("vendor_start\n"));
2184
2185
0
  yyextra->vnd = g_new(ddict_vendor_t,1);
2186
0
  yyextra->vnd->name = NULL;
2187
0
  yyextra->vnd->code = 0;
2188
0
  yyextra->vnd->next = NULL;
2189
2190
0
  if (!yyextra->dict->vendors)
2191
0
    yyextra->last_vnd = yyextra->dict->vendors = yyextra->vnd;
2192
0
  else
2193
0
    yyextra->last_vnd = yyextra->last_vnd->next = yyextra->vnd;
2194
2195
0
  BEGIN VENDOR_ATTRS;
2196
0
}
2197
0
  YY_BREAK
2198
0
case 49:
2199
0
YY_RULE_SETUP
2200
0
#line 497 "/src/wireshark/epan/diam_dict.l"
2201
0
{ ATTR_STR(yyextra->vnd->desc); }
2202
0
  YY_BREAK
2203
0
case 50:
2204
0
YY_RULE_SETUP
2205
0
#line 498 "/src/wireshark/epan/diam_dict.l"
2206
0
{ ATTR_STR(yyextra->vnd->name); }
2207
0
  YY_BREAK
2208
0
case 51:
2209
0
YY_RULE_SETUP
2210
0
#line 499 "/src/wireshark/epan/diam_dict.l"
2211
0
{ ATTR_UINT(yyextra->vnd->code); }
2212
0
  YY_BREAK
2213
0
case 52:
2214
0
YY_RULE_SETUP
2215
0
#line 500 "/src/wireshark/epan/diam_dict.l"
2216
0
{ BEGIN IN_APPL; }
2217
0
  YY_BREAK
2218
0
case 53:
2219
0
YY_RULE_SETUP
2220
0
#line 501 "/src/wireshark/epan/diam_dict.l"
2221
0
{ BEGIN IN_DICT; }
2222
0
  YY_BREAK
2223
0
case 54:
2224
0
YY_RULE_SETUP
2225
0
#line 503 "/src/wireshark/epan/diam_dict.l"
2226
0
{
2227
0
  D(("typedefn_start\n"));
2228
2229
0
  yyextra->typedefn = g_new(ddict_typedefn_t,1);
2230
0
  yyextra->typedefn->name = NULL;
2231
0
  yyextra->typedefn->parent = NULL;
2232
0
  yyextra->typedefn->next = NULL;
2233
2234
0
  if (!yyextra->dict->typedefns)
2235
0
    yyextra->last_typedefn = yyextra->dict->typedefns = yyextra->typedefn;
2236
0
  else
2237
0
    yyextra->last_typedefn = yyextra->last_typedefn->next = yyextra->typedefn;
2238
2239
0
  BEGIN TYPEDEFN_ATTRS;
2240
0
}
2241
0
  YY_BREAK
2242
0
case 55:
2243
0
YY_RULE_SETUP
2244
0
#line 519 "/src/wireshark/epan/diam_dict.l"
2245
0
{ ATTR_STR(yyextra->typedefn->name); }
2246
0
  YY_BREAK
2247
0
case 56:
2248
0
YY_RULE_SETUP
2249
0
#line 520 "/src/wireshark/epan/diam_dict.l"
2250
0
{ ATTR_STR(yyextra->typedefn->parent); }
2251
0
  YY_BREAK
2252
0
case 57:
2253
0
#line 522 "/src/wireshark/epan/diam_dict.l"
2254
0
case 58:
2255
0
YY_RULE_SETUP
2256
0
#line 522 "/src/wireshark/epan/diam_dict.l"
2257
0
{ BEGIN IN_APPL; }
2258
0
  YY_BREAK
2259
0
case 59:
2260
0
YY_RULE_SETUP
2261
0
#line 525 "/src/wireshark/epan/diam_dict.l"
2262
0
{
2263
0
  D(("avp_start\n"));
2264
2265
0
  yyextra->avp = g_new(ddict_avp_t,1);
2266
0
  yyextra->avp->name = NULL;
2267
0
  yyextra->avp->description = NULL;
2268
0
  yyextra->avp->vendor = NULL;
2269
0
  yyextra->avp->code = 0;
2270
0
  yyextra->avp->type = NULL;
2271
0
  yyextra->avp->enums = NULL;
2272
0
  yyextra->avp->gavps = NULL;
2273
0
  yyextra->avp->next = NULL;
2274
2275
0
  if (! yyextra->dict->avps )
2276
0
    yyextra->last_avp = yyextra->dict->avps = yyextra->avp;
2277
0
  else
2278
0
    yyextra->last_avp = yyextra->last_avp->next = yyextra->avp;
2279
2280
0
  BEGIN AVP_ATTRS;
2281
0
}
2282
0
  YY_BREAK
2283
0
case 60:
2284
0
YY_RULE_SETUP
2285
0
#line 546 "/src/wireshark/epan/diam_dict.l"
2286
0
{ ATTR_STR(yyextra->avp->name); }
2287
0
  YY_BREAK
2288
0
case 61:
2289
0
YY_RULE_SETUP
2290
0
#line 547 "/src/wireshark/epan/diam_dict.l"
2291
0
{ ATTR_STR(yyextra->avp->description); }
2292
0
  YY_BREAK
2293
0
case 62:
2294
0
YY_RULE_SETUP
2295
0
#line 548 "/src/wireshark/epan/diam_dict.l"
2296
0
{ ATTR_STR(yyextra->avp->vendor); }
2297
0
  YY_BREAK
2298
0
case 63:
2299
0
YY_RULE_SETUP
2300
0
#line 549 "/src/wireshark/epan/diam_dict.l"
2301
0
{ ATTR_UINT(yyextra->avp->code); }
2302
0
  YY_BREAK
2303
0
case 64:
2304
0
YY_RULE_SETUP
2305
0
#line 550 "/src/wireshark/epan/diam_dict.l"
2306
0
{ BEGIN IN_AVP;  }
2307
0
  YY_BREAK
2308
0
case 65:
2309
0
YY_RULE_SETUP
2310
0
#line 551 "/src/wireshark/epan/diam_dict.l"
2311
0
{ BEGIN IN_APPL; }
2312
0
  YY_BREAK
2313
0
case 66:
2314
0
YY_RULE_SETUP
2315
0
#line 554 "/src/wireshark/epan/diam_dict.l"
2316
0
{ yyextra->avp->type = g_strdup("Grouped"); };
2317
0
  YY_BREAK
2318
0
case 67:
2319
0
YY_RULE_SETUP
2320
0
#line 555 "/src/wireshark/epan/diam_dict.l"
2321
0
;
2322
0
  YY_BREAK
2323
0
case 68:
2324
0
YY_RULE_SETUP
2325
0
#line 557 "/src/wireshark/epan/diam_dict.l"
2326
0
{ BEGIN TYPE_ATTRS; }
2327
0
  YY_BREAK
2328
0
case 69:
2329
0
YY_RULE_SETUP
2330
0
#line 558 "/src/wireshark/epan/diam_dict.l"
2331
0
{ ATTR_STR(yyextra->avp->type); }
2332
0
  YY_BREAK
2333
0
case 70:
2334
0
YY_RULE_SETUP
2335
0
#line 560 "/src/wireshark/epan/diam_dict.l"
2336
0
{
2337
0
  D(("gavp_start\n"));
2338
2339
0
  yyextra->gavp = g_new(ddict_gavp_t,1);
2340
0
  yyextra->gavp->name = NULL;
2341
0
  yyextra->gavp->code = 0;
2342
0
  yyextra->gavp->next = NULL;
2343
2344
0
  if (!yyextra->avp->gavps)
2345
0
    yyextra->last_gavp = yyextra->avp->gavps = yyextra->gavp;
2346
0
  else
2347
0
    yyextra->last_gavp = yyextra->last_gavp->next = yyextra->gavp;
2348
2349
0
  BEGIN GAVP_ATTRS;
2350
0
}
2351
0
  YY_BREAK
2352
0
case 71:
2353
0
YY_RULE_SETUP
2354
0
#line 577 "/src/wireshark/epan/diam_dict.l"
2355
0
{ ATTR_STR(yyextra->gavp->name); }
2356
0
  YY_BREAK
2357
0
case 72:
2358
0
YY_RULE_SETUP
2359
0
#line 580 "/src/wireshark/epan/diam_dict.l"
2360
0
{
2361
0
  D(("enum_start\n"));
2362
2363
0
  yyextra->enumitem = g_new(ddict_enum_t,1);
2364
0
  yyextra->enumitem->name = NULL;
2365
0
  yyextra->enumitem->code = 0;
2366
0
  yyextra->enumitem->next = NULL;
2367
2368
0
  if (!yyextra->avp->enums)
2369
0
    yyextra->last_enumitem = yyextra->avp->enums = yyextra->enumitem;
2370
0
  else
2371
0
    yyextra->last_enumitem = yyextra->last_enumitem->next = yyextra->enumitem;
2372
2373
0
  BEGIN ENUM_ATTRS;
2374
0
}
2375
0
  YY_BREAK
2376
0
case 73:
2377
0
YY_RULE_SETUP
2378
0
#line 597 "/src/wireshark/epan/diam_dict.l"
2379
0
{ ATTR_STR(yyextra->enumitem->name); }
2380
0
  YY_BREAK
2381
0
case 74:
2382
0
YY_RULE_SETUP
2383
0
#line 598 "/src/wireshark/epan/diam_dict.l"
2384
0
{ ATTR_UINT(yyextra->enumitem->code); }
2385
0
  YY_BREAK
2386
0
case 75:
2387
0
YY_RULE_SETUP
2388
0
#line 600 "/src/wireshark/epan/diam_dict.l"
2389
0
{ BEGIN IN_AVP; }
2390
0
  YY_BREAK
2391
0
case 76:
2392
0
YY_RULE_SETUP
2393
0
#line 601 "/src/wireshark/epan/diam_dict.l"
2394
0
{ BEGIN IN_AVP; }
2395
0
  YY_BREAK
2396
0
case 77:
2397
0
YY_RULE_SETUP
2398
0
#line 603 "/src/wireshark/epan/diam_dict.l"
2399
0
{ D(("avp_end\n")); BEGIN IN_APPL; }
2400
0
  YY_BREAK
2401
0
case 78:
2402
0
YY_RULE_SETUP
2403
0
#line 605 "/src/wireshark/epan/diam_dict.l"
2404
0
{
2405
0
  D(("application_end\n")); BEGIN IN_DICT;
2406
0
}
2407
0
  YY_BREAK
2408
0
case 79:
2409
0
YY_RULE_SETUP
2410
0
#line 608 "/src/wireshark/epan/diam_dict.l"
2411
0
{
2412
0
  D(("application_stop_end\n")); BEGIN IN_DICT;
2413
0
}
2414
0
  YY_BREAK
2415
0
case 80:
2416
0
YY_RULE_SETUP
2417
0
#line 611 "/src/wireshark/epan/diam_dict.l"
2418
0
{
2419
0
  D(("vendor_end\n")); BEGIN IN_DICT;
2420
0
}
2421
0
  YY_BREAK
2422
0
case 81:
2423
0
YY_RULE_SETUP
2424
0
#line 614 "/src/wireshark/epan/diam_dict.l"
2425
0
{
2426
0
  D(("base_end\n")); BEGIN IN_DICT;
2427
0
}
2428
0
  YY_BREAK
2429
0
case 82:
2430
0
YY_RULE_SETUP
2431
0
#line 618 "/src/wireshark/epan/diam_dict.l"
2432
0
{
2433
0
  yyterminate();
2434
0
}
2435
0
  YY_BREAK
2436
0
case 83:
2437
0
YY_RULE_SETUP
2438
0
#line 622 "/src/wireshark/epan/diam_dict.l"
2439
0
IGNORE();
2440
0
  YY_BREAK
2441
0
case 84:
2442
0
YY_RULE_SETUP
2443
0
#line 624 "/src/wireshark/epan/diam_dict.l"
2444
0
;
2445
0
  YY_BREAK
2446
0
case 85:
2447
0
YY_RULE_SETUP
2448
0
#line 626 "/src/wireshark/epan/diam_dict.l"
2449
0
ECHO;
2450
0
  YY_BREAK
2451
0
#line 2452 "/work/build/epan/diam_dict.c"
2452
2453
0
  case YY_END_OF_BUFFER:
2454
0
    {
2455
    /* Amount of text matched not including the EOB char. */
2456
0
    int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2457
2458
    /* Undo the effects of YY_DO_BEFORE_ACTION. */
2459
0
    *yy_cp = yyg->yy_hold_char;
2460
0
    YY_RESTORE_YY_MORE_OFFSET
2461
2462
0
    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2463
0
      {
2464
      /* We're scanning a new file or input source.  It's
2465
       * possible that this happened because the user
2466
       * just pointed yyin at a new source and called
2467
       * yylex().  If so, then we have to assure
2468
       * consistency between YY_CURRENT_BUFFER and our
2469
       * globals.  Here is the right place to do so, because
2470
       * this is the first action (other than possibly a
2471
       * back-up) that will match for the new input source.
2472
       */
2473
0
      yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2474
/* %if-c-only */
2475
0
      YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2476
/* %endif */
2477
/* %if-c++-only */
2478
/* %endif */
2479
0
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2480
0
      }
2481
2482
    /* Note that here we test for yy_c_buf_p "<=" to the position
2483
     * of the first EOB in the buffer, since yy_c_buf_p will
2484
     * already have been incremented past the NUL character
2485
     * (since all states make transitions on EOB to the
2486
     * end-of-buffer state).  Contrast this with the test
2487
     * in input().
2488
     */
2489
0
    if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2490
0
      { /* This was really a NUL. */
2491
0
      yy_state_type yy_next_state;
2492
2493
0
      yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2494
2495
0
      yy_current_state = yy_get_previous_state( yyscanner );
2496
2497
      /* Okay, we're now positioned to make the NUL
2498
       * transition.  We couldn't have
2499
       * yy_get_previous_state() go ahead and do it
2500
       * for us because it doesn't know how to deal
2501
       * with the possibility of jamming (and we don't
2502
       * want to build jamming into it because then it
2503
       * will run more slowly).
2504
       */
2505
2506
0
      yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2507
2508
0
      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2509
2510
0
      if ( yy_next_state )
2511
0
        {
2512
        /* Consume the NUL. */
2513
0
        yy_cp = ++yyg->yy_c_buf_p;
2514
0
        yy_current_state = yy_next_state;
2515
0
        goto yy_match;
2516
0
        }
2517
2518
0
      else
2519
0
        {
2520
/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
2521
0
        yy_cp = yyg->yy_last_accepting_cpos;
2522
0
        yy_current_state = yyg->yy_last_accepting_state;
2523
0
        goto yy_find_action;
2524
0
        }
2525
0
      }
2526
2527
0
    else switch ( yy_get_next_buffer( yyscanner ) )
2528
0
      {
2529
0
      case EOB_ACT_END_OF_FILE:
2530
0
        {
2531
0
        yyg->yy_did_buffer_switch_on_eof = 0;
2532
2533
0
        if ( yywrap( yyscanner ) )
2534
0
          {
2535
          /* Note: because we've taken care in
2536
           * yy_get_next_buffer() to have set up
2537
           * yytext, we can now set up
2538
           * yy_c_buf_p so that if some total
2539
           * hoser (like flex itself) wants to
2540
           * call the scanner after we return the
2541
           * YY_NULL, it'll still work - another
2542
           * YY_NULL will get returned.
2543
           */
2544
0
          yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2545
2546
0
          yy_act = YY_STATE_EOF(YY_START);
2547
0
          goto do_action;
2548
0
          }
2549
2550
0
        else
2551
0
          {
2552
0
          if ( ! yyg->yy_did_buffer_switch_on_eof )
2553
0
            YY_NEW_FILE;
2554
0
          }
2555
0
        break;
2556
0
        }
2557
2558
0
      case EOB_ACT_CONTINUE_SCAN:
2559
0
        yyg->yy_c_buf_p =
2560
0
          yyg->yytext_ptr + yy_amount_of_matched_text;
2561
2562
0
        yy_current_state = yy_get_previous_state( yyscanner );
2563
2564
0
        yy_cp = yyg->yy_c_buf_p;
2565
0
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2566
0
        goto yy_match;
2567
2568
0
      case EOB_ACT_LAST_MATCH:
2569
0
        yyg->yy_c_buf_p =
2570
0
        &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2571
2572
0
        yy_current_state = yy_get_previous_state( yyscanner );
2573
2574
0
        yy_cp = yyg->yy_c_buf_p;
2575
0
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2576
0
        goto yy_find_action;
2577
0
      }
2578
0
    break;
2579
0
    }
2580
2581
0
  default:
2582
0
    YY_FATAL_ERROR(
2583
0
      "fatal flex scanner internal error--no action found" );
2584
0
  } /* end of action switch */
2585
0
    } /* end of scanning one token */
2586
0
  } /* end of user's declarations */
2587
0
} /* end of yylex */
2588
/* %ok-for-header */
2589
2590
/* %if-c++-only */
2591
/* %not-for-header */
2592
/* %ok-for-header */
2593
2594
/* %endif */
2595
2596
/* yy_get_next_buffer - try to read in a new buffer
2597
 *
2598
 * Returns a code representing an action:
2599
 *  EOB_ACT_LAST_MATCH -
2600
 *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2601
 *  EOB_ACT_END_OF_FILE - end of file
2602
 */
2603
/* %if-c-only */
2604
static int yy_get_next_buffer (yyscan_t yyscanner)
2605
/* %endif */
2606
/* %if-c++-only */
2607
/* %endif */
2608
0
{
2609
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2610
0
  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2611
0
  char *source = yyg->yytext_ptr;
2612
0
  int number_to_move, i;
2613
0
  int ret_val;
2614
2615
0
  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2616
0
    YY_FATAL_ERROR(
2617
0
    "fatal flex scanner internal error--end of buffer missed" );
2618
2619
0
  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2620
0
    { /* Don't try to fill the buffer, so this is an EOF. */
2621
0
    if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2622
0
      {
2623
      /* We matched a single character, the EOB, so
2624
       * treat this as a final EOF.
2625
       */
2626
0
      return EOB_ACT_END_OF_FILE;
2627
0
      }
2628
2629
0
    else
2630
0
      {
2631
      /* We matched some text prior to the EOB, first
2632
       * process it.
2633
       */
2634
0
      return EOB_ACT_LAST_MATCH;
2635
0
      }
2636
0
    }
2637
2638
  /* Try to read more data. */
2639
2640
  /* First move last chars to start of buffer. */
2641
0
  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
2642
2643
0
  for ( i = 0; i < number_to_move; ++i )
2644
0
    *(dest++) = *(source++);
2645
2646
0
  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2647
    /* don't do the read, it's not guaranteed to return an EOF,
2648
     * just force an EOF
2649
     */
2650
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2651
2652
0
  else
2653
0
    {
2654
0
      int num_to_read =
2655
0
      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2656
2657
0
    while ( num_to_read <= 0 )
2658
0
      { /* Not enough room in the buffer - grow it. */
2659
2660
      /* just a shorter name for the current buffer */
2661
0
      YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
2662
2663
0
      int yy_c_buf_p_offset =
2664
0
        (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2665
2666
0
      if ( b->yy_is_our_buffer )
2667
0
        {
2668
0
        int new_size = b->yy_buf_size * 2;
2669
2670
0
        if ( new_size <= 0 )
2671
0
          b->yy_buf_size += b->yy_buf_size / 8;
2672
0
        else
2673
0
          b->yy_buf_size *= 2;
2674
2675
0
        b->yy_ch_buf = (char *)
2676
          /* Include room in for 2 EOB chars. */
2677
0
          yyrealloc( (void *) b->yy_ch_buf,
2678
0
               (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
2679
0
        }
2680
0
      else
2681
        /* Can't grow it, we don't own it. */
2682
0
        b->yy_ch_buf = NULL;
2683
2684
0
      if ( ! b->yy_ch_buf )
2685
0
        YY_FATAL_ERROR(
2686
0
        "fatal error - scanner input buffer overflow" );
2687
2688
0
      yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2689
2690
0
      num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2691
0
            number_to_move - 1;
2692
2693
0
      }
2694
2695
0
    if ( num_to_read > YY_READ_BUF_SIZE )
2696
0
      num_to_read = YY_READ_BUF_SIZE;
2697
2698
    /* Read in more data. */
2699
0
    YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2700
0
      yyg->yy_n_chars, num_to_read );
2701
2702
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2703
0
    }
2704
2705
0
  if ( yyg->yy_n_chars == 0 )
2706
0
    {
2707
0
    if ( number_to_move == YY_MORE_ADJ )
2708
0
      {
2709
0
      ret_val = EOB_ACT_END_OF_FILE;
2710
0
      yyrestart( yyin  , yyscanner);
2711
0
      }
2712
2713
0
    else
2714
0
      {
2715
0
      ret_val = EOB_ACT_LAST_MATCH;
2716
0
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2717
0
        YY_BUFFER_EOF_PENDING;
2718
0
      }
2719
0
    }
2720
2721
0
  else
2722
0
    ret_val = EOB_ACT_CONTINUE_SCAN;
2723
2724
0
  if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2725
    /* Extend the array by 50%, plus the number we really need. */
2726
0
    int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2727
0
    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
2728
0
      (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
2729
0
    if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2730
0
      YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2731
    /* "- 2" to take care of EOB's */
2732
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
2733
0
  }
2734
2735
0
  yyg->yy_n_chars += number_to_move;
2736
0
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2737
0
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2738
2739
0
  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2740
2741
0
  return ret_val;
2742
0
}
2743
2744
/* yy_get_previous_state - get the state just before the EOB char was reached */
2745
2746
/* %if-c-only */
2747
/* %not-for-header */
2748
    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2749
/* %endif */
2750
/* %if-c++-only */
2751
/* %endif */
2752
0
{
2753
0
  yy_state_type yy_current_state;
2754
0
  char *yy_cp;
2755
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2756
2757
/* %% [15.0] code to get the start state into yy_current_state goes here */
2758
0
  yy_current_state = yyg->yy_start;
2759
2760
0
  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2761
0
    {
2762
/* %% [16.0] code to find the next state goes here */
2763
0
    YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2764
0
    if ( yy_accept[yy_current_state] )
2765
0
      {
2766
0
      yyg->yy_last_accepting_state = yy_current_state;
2767
0
      yyg->yy_last_accepting_cpos = yy_cp;
2768
0
      }
2769
0
    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2770
0
      {
2771
0
      yy_current_state = (int) yy_def[yy_current_state];
2772
0
      if ( yy_current_state >= 482 )
2773
0
        yy_c = yy_meta[yy_c];
2774
0
      }
2775
0
    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2776
0
    }
2777
2778
0
  return yy_current_state;
2779
0
}
2780
2781
/* yy_try_NUL_trans - try to make a transition on the NUL character
2782
 *
2783
 * synopsis
2784
 *  next_state = yy_try_NUL_trans( current_state );
2785
 */
2786
/* %if-c-only */
2787
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
2788
/* %endif */
2789
/* %if-c++-only */
2790
/* %endif */
2791
0
{
2792
0
  int yy_is_jam;
2793
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2794
/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
2795
0
  char *yy_cp = yyg->yy_c_buf_p;
2796
2797
0
  YY_CHAR yy_c = 1;
2798
0
  if ( yy_accept[yy_current_state] )
2799
0
    {
2800
0
    yyg->yy_last_accepting_state = yy_current_state;
2801
0
    yyg->yy_last_accepting_cpos = yy_cp;
2802
0
    }
2803
0
  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2804
0
    {
2805
0
    yy_current_state = (int) yy_def[yy_current_state];
2806
0
    if ( yy_current_state >= 482 )
2807
0
      yy_c = yy_meta[yy_c];
2808
0
    }
2809
0
  yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2810
0
  yy_is_jam = (yy_current_state == 481);
2811
2812
0
  (void)yyg;
2813
0
  return yy_is_jam ? 0 : yy_current_state;
2814
0
}
2815
2816
#ifndef YY_NO_UNPUT
2817
/* %if-c-only */
2818
2819
/* %endif */
2820
#endif
2821
2822
/* %if-c-only */
2823
#ifndef YY_NO_INPUT
2824
#ifdef __cplusplus
2825
    static int yyinput (yyscan_t yyscanner)
2826
#else
2827
    static int input  (yyscan_t yyscanner)
2828
#endif
2829
2830
/* %endif */
2831
/* %if-c++-only */
2832
/* %endif */
2833
{
2834
  int c;
2835
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2836
2837
  *yyg->yy_c_buf_p = yyg->yy_hold_char;
2838
2839
  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2840
    {
2841
    /* yy_c_buf_p now points to the character we want to return.
2842
     * If this occurs *before* the EOB characters, then it's a
2843
     * valid NUL; if not, then we've hit the end of the buffer.
2844
     */
2845
    if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2846
      /* This was really a NUL. */
2847
      *yyg->yy_c_buf_p = '\0';
2848
2849
    else
2850
      { /* need more input */
2851
      int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
2852
      ++yyg->yy_c_buf_p;
2853
2854
      switch ( yy_get_next_buffer( yyscanner ) )
2855
        {
2856
        case EOB_ACT_LAST_MATCH:
2857
          /* This happens because yy_g_n_b()
2858
           * sees that we've accumulated a
2859
           * token and flags that we need to
2860
           * try matching the token before
2861
           * proceeding.  But for input(),
2862
           * there's no matching to consider.
2863
           * So convert the EOB_ACT_LAST_MATCH
2864
           * to EOB_ACT_END_OF_FILE.
2865
           */
2866
2867
          /* Reset buffer status. */
2868
          yyrestart( yyin , yyscanner);
2869
2870
          /*FALLTHROUGH*/
2871
2872
        case EOB_ACT_END_OF_FILE:
2873
          {
2874
          if ( yywrap( yyscanner ) )
2875
            return 0;
2876
2877
          if ( ! yyg->yy_did_buffer_switch_on_eof )
2878
            YY_NEW_FILE;
2879
#ifdef __cplusplus
2880
          return yyinput(yyscanner);
2881
#else
2882
          return input(yyscanner);
2883
#endif
2884
          }
2885
2886
        case EOB_ACT_CONTINUE_SCAN:
2887
          yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2888
          break;
2889
        }
2890
      }
2891
    }
2892
2893
  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2894
  *yyg->yy_c_buf_p = '\0';  /* preserve yytext */
2895
  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2896
2897
/* %% [19.0] update BOL and yylineno */
2898
2899
  return c;
2900
}
2901
/* %if-c-only */
2902
#endif  /* ifndef YY_NO_INPUT */
2903
/* %endif */
2904
2905
/** Immediately switch to a different input stream.
2906
 * @param input_file A readable stream.
2907
 * @param yyscanner The scanner object.
2908
 * @note This function does not reset the start condition to @c INITIAL .
2909
 */
2910
/* %if-c-only */
2911
    void yyrestart  (FILE * input_file , yyscan_t yyscanner)
2912
/* %endif */
2913
/* %if-c++-only */
2914
/* %endif */
2915
0
{
2916
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2917
2918
0
  if ( ! YY_CURRENT_BUFFER ){
2919
0
        yyensure_buffer_stack (yyscanner);
2920
0
    YY_CURRENT_BUFFER_LVALUE =
2921
0
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
2922
0
  }
2923
2924
0
  yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
2925
0
  yy_load_buffer_state( yyscanner );
2926
0
}
2927
2928
/* %if-c++-only */
2929
/* %endif */
2930
2931
/** Switch to a different input buffer.
2932
 * @param new_buffer The new input buffer.
2933
 * @param yyscanner The scanner object.
2934
 */
2935
/* %if-c-only */
2936
    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
2937
/* %endif */
2938
/* %if-c++-only */
2939
/* %endif */
2940
0
{
2941
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2942
2943
  /* TODO. We should be able to replace this entire function body
2944
   * with
2945
   *    yypop_buffer_state();
2946
   *    yypush_buffer_state(new_buffer);
2947
     */
2948
0
  yyensure_buffer_stack (yyscanner);
2949
0
  if ( YY_CURRENT_BUFFER == new_buffer )
2950
0
    return;
2951
2952
0
  if ( YY_CURRENT_BUFFER )
2953
0
    {
2954
    /* Flush out information for old buffer. */
2955
0
    *yyg->yy_c_buf_p = yyg->yy_hold_char;
2956
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2957
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2958
0
    }
2959
2960
0
  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2961
0
  yy_load_buffer_state( yyscanner );
2962
2963
  /* We don't actually know whether we did this switch during
2964
   * EOF (yywrap()) processing, but the only time this flag
2965
   * is looked at is after yywrap() is called, so it's safe
2966
   * to go ahead and always set it.
2967
   */
2968
0
  yyg->yy_did_buffer_switch_on_eof = 1;
2969
0
}
2970
2971
/* %if-c-only */
2972
static void yy_load_buffer_state  (yyscan_t yyscanner)
2973
/* %endif */
2974
/* %if-c++-only */
2975
/* %endif */
2976
0
{
2977
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2978
0
  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2979
0
  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2980
/* %if-c-only */
2981
0
  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2982
/* %endif */
2983
/* %if-c++-only */
2984
/* %endif */
2985
0
  yyg->yy_hold_char = *yyg->yy_c_buf_p;
2986
0
}
2987
2988
/** Allocate and initialize an input buffer state.
2989
 * @param file A readable stream.
2990
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2991
 * @param yyscanner The scanner object.
2992
 * @return the allocated buffer state.
2993
 */
2994
/* %if-c-only */
2995
    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
2996
/* %endif */
2997
/* %if-c++-only */
2998
/* %endif */
2999
0
{
3000
0
  YY_BUFFER_STATE b;
3001
    
3002
0
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
3003
0
  if ( ! b )
3004
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3005
3006
0
  b->yy_buf_size = size;
3007
3008
  /* yy_ch_buf has to be 2 characters longer than the size given because
3009
   * we need to put in 2 end-of-buffer characters.
3010
   */
3011
0
  b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
3012
0
  if ( ! b->yy_ch_buf )
3013
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3014
3015
0
  b->yy_is_our_buffer = 1;
3016
3017
0
  yy_init_buffer( b, file , yyscanner);
3018
3019
0
  return b;
3020
0
}
3021
3022
/* %if-c++-only */
3023
/* %endif */
3024
3025
/** Destroy the buffer.
3026
 * @param b a buffer created with yy_create_buffer()
3027
 * @param yyscanner The scanner object.
3028
 */
3029
/* %if-c-only */
3030
    void yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
3031
/* %endif */
3032
/* %if-c++-only */
3033
/* %endif */
3034
0
{
3035
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3036
3037
0
  if ( ! b )
3038
0
    return;
3039
3040
0
  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
3041
0
    YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
3042
3043
0
  if ( b->yy_is_our_buffer )
3044
0
    yyfree( (void *) b->yy_ch_buf , yyscanner );
3045
3046
0
  yyfree( (void *) b , yyscanner );
3047
0
}
3048
3049
/* Initializes or reinitializes a buffer.
3050
 * This function is sometimes called more than once on the same buffer,
3051
 * such as during a yyrestart() or at EOF.
3052
 */
3053
/* %if-c-only */
3054
    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
3055
/* %endif */
3056
/* %if-c++-only */
3057
/* %endif */
3058
3059
0
{
3060
0
  int oerrno = errno;
3061
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3062
3063
0
  yy_flush_buffer( b , yyscanner);
3064
3065
/* %if-c-only */
3066
0
  b->yy_input_file = file;
3067
/* %endif */
3068
/* %if-c++-only */
3069
/* %endif */
3070
0
  b->yy_fill_buffer = 1;
3071
3072
    /* If b is the current buffer, then yy_init_buffer was _probably_
3073
     * called from yyrestart() or through yy_get_next_buffer.
3074
     * In that case, we don't want to reset the lineno or column.
3075
     */
3076
0
    if (b != YY_CURRENT_BUFFER){
3077
0
        b->yy_bs_lineno = 1;
3078
0
        b->yy_bs_column = 0;
3079
0
    }
3080
3081
/* %if-c-only */
3082
3083
0
        b->yy_is_interactive = 0;
3084
    
3085
/* %endif */
3086
/* %if-c++-only */
3087
/* %endif */
3088
0
  errno = oerrno;
3089
0
}
3090
3091
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
3092
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
3093
 * @param yyscanner The scanner object.
3094
 */
3095
/* %if-c-only */
3096
    void yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
3097
/* %endif */
3098
/* %if-c++-only */
3099
/* %endif */
3100
0
{
3101
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3102
0
  if ( ! b )
3103
0
    return;
3104
3105
0
  b->yy_n_chars = 0;
3106
3107
  /* We always need two end-of-buffer characters.  The first causes
3108
   * a transition to the end-of-buffer state.  The second causes
3109
   * a jam in that state.
3110
   */
3111
0
  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3112
0
  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3113
3114
0
  b->yy_buf_pos = &b->yy_ch_buf[0];
3115
3116
0
  b->yy_at_bol = 1;
3117
0
  b->yy_buffer_status = YY_BUFFER_NEW;
3118
3119
0
  if ( b == YY_CURRENT_BUFFER )
3120
0
    yy_load_buffer_state( yyscanner );
3121
0
}
3122
3123
/* %if-c-or-c++ */
3124
/** Pushes the new state onto the stack. The new state becomes
3125
 *  the current state. This function will allocate the stack
3126
 *  if necessary.
3127
 *  @param new_buffer The new state.
3128
 *  @param yyscanner The scanner object.
3129
 */
3130
/* %if-c-only */
3131
void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
3132
/* %endif */
3133
/* %if-c++-only */
3134
/* %endif */
3135
0
{
3136
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3137
0
  if (new_buffer == NULL)
3138
0
    return;
3139
3140
0
  yyensure_buffer_stack(yyscanner);
3141
3142
  /* This block is copied from yy_switch_to_buffer. */
3143
0
  if ( YY_CURRENT_BUFFER )
3144
0
    {
3145
    /* Flush out information for old buffer. */
3146
0
    *yyg->yy_c_buf_p = yyg->yy_hold_char;
3147
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
3148
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
3149
0
    }
3150
3151
  /* Only push if top exists. Otherwise, replace top. */
3152
0
  if (YY_CURRENT_BUFFER)
3153
0
    yyg->yy_buffer_stack_top++;
3154
0
  YY_CURRENT_BUFFER_LVALUE = new_buffer;
3155
3156
  /* copied from yy_switch_to_buffer. */
3157
0
  yy_load_buffer_state( yyscanner );
3158
0
  yyg->yy_did_buffer_switch_on_eof = 1;
3159
0
}
3160
/* %endif */
3161
3162
/* %if-c-or-c++ */
3163
/** Removes and deletes the top of the stack, if present.
3164
 *  The next element becomes the new top.
3165
 *  @param yyscanner The scanner object.
3166
 */
3167
/* %if-c-only */
3168
void yypop_buffer_state (yyscan_t yyscanner)
3169
/* %endif */
3170
/* %if-c++-only */
3171
/* %endif */
3172
0
{
3173
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3174
0
  if (!YY_CURRENT_BUFFER)
3175
0
    return;
3176
3177
0
  yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
3178
0
  YY_CURRENT_BUFFER_LVALUE = NULL;
3179
0
  if (yyg->yy_buffer_stack_top > 0)
3180
0
    --yyg->yy_buffer_stack_top;
3181
3182
0
  if (YY_CURRENT_BUFFER) {
3183
0
    yy_load_buffer_state( yyscanner );
3184
0
    yyg->yy_did_buffer_switch_on_eof = 1;
3185
0
  }
3186
0
}
3187
/* %endif */
3188
3189
/* %if-c-or-c++ */
3190
/* Allocates the stack if it does not exist.
3191
 *  Guarantees space for at least one push.
3192
 */
3193
/* %if-c-only */
3194
static void yyensure_buffer_stack (yyscan_t yyscanner)
3195
/* %endif */
3196
/* %if-c++-only */
3197
/* %endif */
3198
0
{
3199
0
  yy_size_t num_to_alloc;
3200
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3201
3202
0
  if (!yyg->yy_buffer_stack) {
3203
3204
    /* First allocation is just for 2 elements, since we don't know if this
3205
     * scanner will even need a stack. We use 2 instead of 1 to avoid an
3206
     * immediate realloc on the next call.
3207
         */
3208
0
      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
3209
0
    yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
3210
0
                (num_to_alloc * sizeof(struct yy_buffer_state*)
3211
0
                , yyscanner);
3212
0
    if ( ! yyg->yy_buffer_stack )
3213
0
      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3214
3215
0
    memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3216
3217
0
    yyg->yy_buffer_stack_max = num_to_alloc;
3218
0
    yyg->yy_buffer_stack_top = 0;
3219
0
    return;
3220
0
  }
3221
3222
0
  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
3223
3224
    /* Increase the buffer to prepare for a possible push. */
3225
0
    yy_size_t grow_size = 8 /* arbitrary grow size */;
3226
3227
0
    num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
3228
0
    yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
3229
0
                (yyg->yy_buffer_stack,
3230
0
                num_to_alloc * sizeof(struct yy_buffer_state*)
3231
0
                , yyscanner);
3232
0
    if ( ! yyg->yy_buffer_stack )
3233
0
      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3234
3235
    /* zero only the new slots.*/
3236
0
    memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
3237
0
    yyg->yy_buffer_stack_max = num_to_alloc;
3238
0
  }
3239
0
}
3240
/* %endif */
3241
3242
/* %if-c-only */
3243
/** Setup the input buffer state to scan directly from a user-specified character buffer.
3244
 * @param base the character buffer
3245
 * @param size the size in bytes of the character buffer
3246
 * @param yyscanner The scanner object.
3247
 * @return the newly allocated buffer state object.
3248
 */
3249
YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
3250
0
{
3251
0
  YY_BUFFER_STATE b;
3252
    
3253
0
  if ( size < 2 ||
3254
0
       base[size-2] != YY_END_OF_BUFFER_CHAR ||
3255
0
       base[size-1] != YY_END_OF_BUFFER_CHAR )
3256
    /* They forgot to leave room for the EOB's. */
3257
0
    return NULL;
3258
3259
0
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
3260
0
  if ( ! b )
3261
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3262
3263
0
  b->yy_buf_size = (int) (size - 2);  /* "- 2" to take care of EOB's */
3264
0
  b->yy_buf_pos = b->yy_ch_buf = base;
3265
0
  b->yy_is_our_buffer = 0;
3266
0
  b->yy_input_file = NULL;
3267
0
  b->yy_n_chars = b->yy_buf_size;
3268
0
  b->yy_is_interactive = 0;
3269
0
  b->yy_at_bol = 1;
3270
0
  b->yy_fill_buffer = 0;
3271
0
  b->yy_buffer_status = YY_BUFFER_NEW;
3272
3273
0
  yy_switch_to_buffer( b , yyscanner );
3274
3275
0
  return b;
3276
0
}
3277
/* %endif */
3278
3279
/* %if-c-only */
3280
/** Setup the input buffer state to scan a string. The next call to yylex() will
3281
 * scan from a @e copy of @a str.
3282
 * @param yystr a NUL-terminated string to scan
3283
 * @param yyscanner The scanner object.
3284
 * @return the newly allocated buffer state object.
3285
 * @note If you want to scan bytes that may contain NUL values, then use
3286
 *       yy_scan_bytes() instead.
3287
 */
3288
YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
3289
0
{
3290
    
3291
0
  return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
3292
0
}
3293
/* %endif */
3294
3295
/* %if-c-only */
3296
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
3297
 * scan from a @e copy of @a bytes.
3298
 * @param yybytes the byte buffer to scan
3299
 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
3300
 * @param yyscanner The scanner object.
3301
 * @return the newly allocated buffer state object.
3302
 */
3303
YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
3304
0
{
3305
0
  YY_BUFFER_STATE b;
3306
0
  char *buf;
3307
0
  yy_size_t n;
3308
0
  int i;
3309
    
3310
  /* Get memory for full buffer, including space for trailing EOB's. */
3311
0
  n = (yy_size_t) (_yybytes_len + 2);
3312
0
  buf = (char *) yyalloc( n , yyscanner );
3313
0
  if ( ! buf )
3314
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3315
3316
0
  for ( i = 0; i < _yybytes_len; ++i )
3317
0
    buf[i] = yybytes[i];
3318
3319
0
  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3320
3321
0
  b = yy_scan_buffer( buf, n , yyscanner);
3322
0
  if ( ! b )
3323
0
    YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3324
3325
  /* It's okay to grow etc. this buffer, and we should throw it
3326
   * away when we're done.
3327
   */
3328
0
  b->yy_is_our_buffer = 1;
3329
3330
0
  return b;
3331
0
}
3332
/* %endif */
3333
3334
/* %if-c-only */
3335
    static void yy_push_state (int  _new_state , yyscan_t yyscanner)
3336
/* %endif */
3337
/* %if-c++-only */
3338
/* %endif */
3339
0
{
3340
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3341
0
  if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
3342
0
    {
3343
0
    yy_size_t new_size;
3344
3345
0
    yyg->yy_start_stack_depth += YY_START_STACK_INCR;
3346
0
    new_size = (yy_size_t) yyg->yy_start_stack_depth * sizeof( int );
3347
3348
0
    if ( ! yyg->yy_start_stack )
3349
0
      yyg->yy_start_stack = (int *) yyalloc( new_size , yyscanner );
3350
3351
0
    else
3352
0
      yyg->yy_start_stack = (int *) yyrealloc(
3353
0
          (void *) yyg->yy_start_stack, new_size , yyscanner );
3354
3355
0
    if ( ! yyg->yy_start_stack )
3356
0
      YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
3357
0
    }
3358
3359
0
  yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START;
3360
3361
0
  BEGIN(_new_state);
3362
0
}
3363
3364
/* %if-c-only */
3365
    static void yy_pop_state  (yyscan_t yyscanner)
3366
/* %endif */
3367
/* %if-c++-only */
3368
/* %endif */
3369
0
{
3370
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3371
0
  if ( --yyg->yy_start_stack_ptr < 0 )
3372
0
    YY_FATAL_ERROR( "start-condition stack underflow" );
3373
3374
0
  BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
3375
0
}
3376
3377
/* %if-c-only */
3378
    static int yy_top_state  (yyscan_t yyscanner)
3379
/* %endif */
3380
/* %if-c++-only */
3381
/* %endif */
3382
0
{
3383
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3384
0
  return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
3385
0
}
3386
3387
#ifndef YY_EXIT_FAILURE
3388
#define YY_EXIT_FAILURE 2
3389
#endif
3390
3391
/* %if-c-only */
3392
static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
3393
0
{
3394
0
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3395
0
  (void)yyg;
3396
0
  fprintf( stderr, "%s\n", msg );
3397
0
  exit( YY_EXIT_FAILURE );
3398
0
}
3399
/* %endif */
3400
/* %if-c++-only */
3401
/* %endif */
3402
3403
/* Redefine yyless() so it works in section 3 code. */
3404
3405
#undef yyless
3406
#define yyless(n) \
3407
  do \
3408
    { \
3409
    /* Undo effects of setting up yytext. */ \
3410
        int yyless_macro_arg = (n); \
3411
        YY_LESS_LINENO(yyless_macro_arg);\
3412
    yytext[yyleng] = yyg->yy_hold_char; \
3413
    yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3414
    yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3415
    *yyg->yy_c_buf_p = '\0'; \
3416
    yyleng = yyless_macro_arg; \
3417
    } \
3418
  while ( 0 )
3419
3420
/* Accessor  methods (get/set functions) to struct members. */
3421
3422
/* %if-c-only */
3423
/* %if-reentrant */
3424
3425
/** Get the user-defined data for this scanner.
3426
 * @param yyscanner The scanner object.
3427
 */
3428
YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
3429
0
{
3430
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3431
0
    return yyextra;
3432
0
}
3433
3434
/* %endif */
3435
3436
/** Get the current line number.
3437
 * @param yyscanner The scanner object.
3438
 */
3439
int yyget_lineno  (yyscan_t yyscanner)
3440
0
{
3441
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3442
3443
0
        if (! YY_CURRENT_BUFFER)
3444
0
            return 0;
3445
    
3446
0
    return yylineno;
3447
0
}
3448
3449
/** Get the current column number.
3450
 * @param yyscanner The scanner object.
3451
 */
3452
int yyget_column  (yyscan_t yyscanner)
3453
0
{
3454
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3455
3456
0
        if (! YY_CURRENT_BUFFER)
3457
0
            return 0;
3458
    
3459
0
    return yycolumn;
3460
0
}
3461
3462
/** Get the input stream.
3463
 * @param yyscanner The scanner object.
3464
 */
3465
FILE *yyget_in  (yyscan_t yyscanner)
3466
0
{
3467
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3468
0
    return yyin;
3469
0
}
3470
3471
/** Get the output stream.
3472
 * @param yyscanner The scanner object.
3473
 */
3474
FILE *yyget_out  (yyscan_t yyscanner)
3475
0
{
3476
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3477
0
    return yyout;
3478
0
}
3479
3480
/** Get the length of the current token.
3481
 * @param yyscanner The scanner object.
3482
 */
3483
int yyget_leng  (yyscan_t yyscanner)
3484
0
{
3485
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3486
0
    return yyleng;
3487
0
}
3488
3489
/** Get the current token.
3490
 * @param yyscanner The scanner object.
3491
 */
3492
3493
char *yyget_text  (yyscan_t yyscanner)
3494
0
{
3495
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3496
0
    return yytext;
3497
0
}
3498
3499
/* %if-reentrant */
3500
3501
/** Set the user-defined data. This data is never touched by the scanner.
3502
 * @param user_defined The data to be associated with this scanner.
3503
 * @param yyscanner The scanner object.
3504
 */
3505
void yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
3506
0
{
3507
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3508
0
    yyextra = user_defined ;
3509
0
}
3510
3511
/* %endif */
3512
3513
/** Set the current line number.
3514
 * @param _line_number line number
3515
 * @param yyscanner The scanner object.
3516
 */
3517
void yyset_lineno (int  _line_number , yyscan_t yyscanner)
3518
0
{
3519
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3520
3521
        /* lineno is only valid if an input buffer exists. */
3522
0
        if (! YY_CURRENT_BUFFER )
3523
0
           YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
3524
    
3525
0
    yylineno = _line_number;
3526
0
}
3527
3528
/** Set the current column.
3529
 * @param _column_no column number
3530
 * @param yyscanner The scanner object.
3531
 */
3532
void yyset_column (int  _column_no , yyscan_t yyscanner)
3533
0
{
3534
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3535
3536
        /* column is only valid if an input buffer exists. */
3537
0
        if (! YY_CURRENT_BUFFER )
3538
0
           YY_FATAL_ERROR( "yyset_column called with no buffer" );
3539
    
3540
0
    yycolumn = _column_no;
3541
0
}
3542
3543
/** Set the input stream. This does not discard the current
3544
 * input buffer.
3545
 * @param _in_str A readable stream.
3546
 * @param yyscanner The scanner object.
3547
 * @see yy_switch_to_buffer
3548
 */
3549
void yyset_in (FILE *  _in_str , yyscan_t yyscanner)
3550
0
{
3551
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3552
0
    yyin = _in_str ;
3553
0
}
3554
3555
void yyset_out (FILE *  _out_str , yyscan_t yyscanner)
3556
0
{
3557
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3558
0
    yyout = _out_str ;
3559
0
}
3560
3561
int yyget_debug  (yyscan_t yyscanner)
3562
0
{
3563
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3564
0
    return yy_flex_debug;
3565
0
}
3566
3567
void yyset_debug (int  _bdebug , yyscan_t yyscanner)
3568
0
{
3569
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3570
0
    yy_flex_debug = _bdebug ;
3571
0
}
3572
3573
/* %endif */
3574
3575
/* %if-reentrant */
3576
/* Accessor methods for yylval and yylloc */
3577
3578
/* %if-bison-bridge */
3579
/* %endif */
3580
3581
/* User-visible API */
3582
3583
/* yylex_init is special because it creates the scanner itself, so it is
3584
 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3585
 * That's why we explicitly handle the declaration, instead of using our macros.
3586
 */
3587
int yylex_init(yyscan_t* ptr_yy_globals)
3588
0
{
3589
0
    if (ptr_yy_globals == NULL){
3590
0
        errno = EINVAL;
3591
0
        return 1;
3592
0
    }
3593
3594
0
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
3595
3596
0
    if (*ptr_yy_globals == NULL){
3597
0
        errno = ENOMEM;
3598
0
        return 1;
3599
0
    }
3600
3601
    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3602
0
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3603
3604
0
    return yy_init_globals ( *ptr_yy_globals );
3605
0
}
3606
3607
/* yylex_init_extra has the same functionality as yylex_init, but follows the
3608
 * convention of taking the scanner as the last argument. Note however, that
3609
 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3610
 * is the reason, too, why this function also must handle its own declaration).
3611
 * The user defined value in the first argument will be available to yyalloc in
3612
 * the yyextra field.
3613
 */
3614
int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
3615
0
{
3616
0
    struct yyguts_t dummy_yyguts;
3617
3618
0
    yyset_extra (yy_user_defined, &dummy_yyguts);
3619
3620
0
    if (ptr_yy_globals == NULL){
3621
0
        errno = EINVAL;
3622
0
        return 1;
3623
0
    }
3624
3625
0
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3626
3627
0
    if (*ptr_yy_globals == NULL){
3628
0
        errno = ENOMEM;
3629
0
        return 1;
3630
0
    }
3631
3632
    /* By setting to 0xAA, we expose bugs in
3633
    yy_init_globals. Leave at 0x00 for releases. */
3634
0
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3635
3636
0
    yyset_extra (yy_user_defined, *ptr_yy_globals);
3637
3638
0
    return yy_init_globals ( *ptr_yy_globals );
3639
0
}
3640
3641
/* %endif if-c-only */
3642
3643
/* %if-c-only */
3644
static int yy_init_globals (yyscan_t yyscanner)
3645
0
{
3646
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3647
    /* Initialization is the same as for the non-reentrant scanner.
3648
     * This function is called from yylex_destroy(), so don't allocate here.
3649
     */
3650
3651
0
    yyg->yy_buffer_stack = NULL;
3652
0
    yyg->yy_buffer_stack_top = 0;
3653
0
    yyg->yy_buffer_stack_max = 0;
3654
0
    yyg->yy_c_buf_p = NULL;
3655
0
    yyg->yy_init = 0;
3656
0
    yyg->yy_start = 0;
3657
3658
0
    yyg->yy_start_stack_ptr = 0;
3659
0
    yyg->yy_start_stack_depth = 0;
3660
0
    yyg->yy_start_stack =  NULL;
3661
3662
/* Defined in main.c */
3663
#ifdef YY_STDINIT
3664
    yyin = stdin;
3665
    yyout = stdout;
3666
#else
3667
0
    yyin = NULL;
3668
0
    yyout = NULL;
3669
0
#endif
3670
3671
    /* For future reference: Set errno on error, since we are called by
3672
     * yylex_init()
3673
     */
3674
0
    return 0;
3675
0
}
3676
/* %endif */
3677
3678
/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
3679
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
3680
int yylex_destroy  (yyscan_t yyscanner)
3681
0
{
3682
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3683
3684
    /* Pop the buffer stack, destroying each element. */
3685
0
  while(YY_CURRENT_BUFFER){
3686
0
    yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
3687
0
    YY_CURRENT_BUFFER_LVALUE = NULL;
3688
0
    yypop_buffer_state(yyscanner);
3689
0
  }
3690
3691
  /* Destroy the stack itself. */
3692
0
  yyfree(yyg->yy_buffer_stack , yyscanner);
3693
0
  yyg->yy_buffer_stack = NULL;
3694
3695
    /* Destroy the start condition stack. */
3696
0
        yyfree( yyg->yy_start_stack , yyscanner );
3697
0
        yyg->yy_start_stack = NULL;
3698
3699
    /* Reset the globals. This is important in a non-reentrant scanner so the next time
3700
     * yylex() is called, initialization will occur. */
3701
0
    yy_init_globals( yyscanner);
3702
3703
/* %if-reentrant */
3704
    /* Destroy the main struct (reentrant only). */
3705
0
    yyfree ( yyscanner , yyscanner );
3706
0
    yyscanner = NULL;
3707
/* %endif */
3708
0
    return 0;
3709
0
}
3710
/* %endif */
3711
3712
/*
3713
 * Internal utility routines.
3714
 */
3715
3716
#ifndef yytext_ptr
3717
static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
3718
{
3719
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3720
  (void)yyg;
3721
3722
  int i;
3723
  for ( i = 0; i < n; ++i )
3724
    s1[i] = s2[i];
3725
}
3726
#endif
3727
3728
#ifdef YY_NEED_STRLEN
3729
static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
3730
{
3731
  int n;
3732
  for ( n = 0; s[n]; ++n )
3733
    ;
3734
3735
  return n;
3736
}
3737
#endif
3738
3739
/* %if-tables-serialization definitions */
3740
/* %define-yytables   The name for this specific scanner's tables. */
3741
#define YYTABLES_NAME "yytables"
3742
/* %endif */
3743
3744
/* %ok-for-header */
3745
3746
#line 626 "/src/wireshark/epan/diam_dict.l"
3747
3748
3749
/*
3750
 * Turn diagnostics back on, so we check the code that we've written.
3751
 */
3752
DIAG_ON_FLEX()
3753
3754
static int debugging  = 0;
3755
3756
0
static void ddict_debug(const char* fmt, ...) {
3757
0
  va_list ap;
3758
3759
0
  va_start(ap, fmt);
3760
0
  if (debugging) vfprintf(stderr, fmt, ap);
3761
0
  va_end(ap);
3762
3763
0
  fflush(stderr);
3764
0
}
3765
3766
/*
3767
 * Sleazy hack to avoid unused function warnings for yy_top_state.
3768
 */
3769
extern void ddict_unused(yyscan_t yyscanner);
3770
3771
void
3772
ddict_unused(yyscan_t yyscanner)
3773
0
{
3774
0
  yy_top_state(yyscanner);
3775
0
}
3776
3777
static void
3778
append_to_buffer(const char* txt, unsigned len, DiamDict_scanner_state_t *statep)
3779
0
{
3780
3781
0
  if (statep->strbuf == NULL) {
3782
0
    statep->strbuf = (char*)g_malloc(statep->size_strbuf);
3783
0
    statep->read_ptr = statep->strbuf;
3784
0
    statep->write_ptr = statep->strbuf;
3785
0
  }
3786
3787
0
  if (statep->len_strbuf + len >= statep->size_strbuf) {
3788
0
    statep->strbuf = (char*)g_realloc(statep->strbuf,statep->size_strbuf *= 2);
3789
0
    statep->read_ptr = statep->strbuf;
3790
0
  }
3791
3792
0
  statep->write_ptr = statep->strbuf + statep->len_strbuf;
3793
0
  memcpy(statep->write_ptr, txt, len + 1);
3794
0
  statep->len_strbuf += len;
3795
0
}
3796
3797
static size_t
3798
file_input(char* buf, size_t max, yyscan_t scanner)
3799
0
{
3800
0
  FILE *in = yyget_in(scanner);
3801
0
  size_t read_cnt;
3802
3803
0
  read_cnt = fread(buf,1,max,in);
3804
3805
0
  if ( read_cnt == max ) {
3806
0
    return max;
3807
0
  } else if (read_cnt > 0) {
3808
0
    return read_cnt;
3809
0
  } else {
3810
0
    return YY_NULL;
3811
0
  }
3812
0
}
3813
3814
3815
static size_t
3816
string_input(char* buf, size_t max, yyscan_t scanner)
3817
0
{
3818
0
  DiamDict_scanner_state_t *statep = yyget_extra(scanner);
3819
3820
0
  if (statep->read_ptr >= statep->write_ptr ) {
3821
0
    return YY_NULL;
3822
0
  } else if ( statep->read_ptr + max > statep->write_ptr ) {
3823
0
    max = statep->write_ptr - statep->read_ptr;
3824
0
  }
3825
3826
0
  memcpy(buf,statep->read_ptr,max);
3827
0
  statep->read_ptr += max;
3828
3829
0
  return max;
3830
0
}
3831
3832
/*
3833
 * If we're reading from a string, yyin is set to stdin, and we don't
3834
 * want to close that.
3835
 */
3836
static int
3837
string_close(FILE *fh _U_)
3838
0
{
3839
0
  return 0;
3840
0
}
3841
3842
static FILE *
3843
ddict_open(const char* system_directory, const char* filename)
3844
0
{
3845
0
  FILE* fh;
3846
0
  char* fname;
3847
0
  if (system_directory) {
3848
0
    fname = ws_strdup_printf("%s" G_DIR_SEPARATOR_S "%s",
3849
0
        system_directory,filename);
3850
0
  } else {
3851
0
    fname = g_strdup(filename);
3852
0
  }
3853
3854
0
  fh = ws_fopen(fname,"r");
3855
3856
0
  D(("fname: %s fh: %p\n",fname,(void*)fh));
3857
3858
0
  g_free(fname);
3859
3860
3861
0
  return fh;
3862
0
}
3863
3864
ddict_t *
3865
ddict_scan(const char* system_directory, const char* filename, int dbg)
3866
0
{
3867
0
  DiamDict_scanner_state_t state;
3868
0
  FILE *in;
3869
0
  yyscan_t scanner;
3870
3871
0
  debugging = dbg;
3872
3873
0
  state.sys_dir = system_directory;
3874
3875
0
  state.write_ptr = NULL;
3876
0
  state.read_ptr = NULL;
3877
3878
0
  state.strbuf = NULL;
3879
0
  state.size_strbuf = 8192;
3880
0
  state.len_strbuf = 0;
3881
3882
0
  state.dict = g_new(ddict_t,1);
3883
0
  state.dict->applications = NULL;
3884
0
  state.dict->vendors = NULL;
3885
0
  state.dict->cmds = NULL;
3886
0
  state.dict->typedefns = NULL;
3887
0
  state.dict->avps = NULL;
3888
0
  state.dict->xmlpis = NULL;
3889
3890
0
  state.appl = NULL;
3891
0
  state.avp = NULL;
3892
0
  state.enumitem = NULL;
3893
0
  state.gavp = NULL;
3894
0
  state.typedefn = NULL;
3895
0
  state.cmd = NULL;
3896
0
  state.vnd = NULL;
3897
0
  state.xmlpi = NULL;
3898
3899
0
  state.last_appl = NULL;
3900
0
  state.last_avp = NULL;
3901
0
  state.last_enumitem = NULL;
3902
0
  state.last_gavp = NULL;
3903
0
  state.last_typedefn = NULL;
3904
0
  state.last_cmd = NULL;
3905
0
  state.last_vnd = NULL;
3906
0
  state.last_xmlpi = NULL;
3907
3908
0
  state.ents = NULL;
3909
3910
0
  state.attr_str = NULL;
3911
0
  state.attr_uint = NULL;
3912
3913
  /*
3914
   * Pass 1.
3915
   *
3916
   * Reads the file, does some work, and stores a modified version
3917
   * of the file contents in memory.
3918
   */
3919
0
  state.current_yyinput = file_input;
3920
0
  state.current_close = fclose;
3921
0
  state.include_stack_ptr = 0;
3922
3923
0
  in = ddict_open(system_directory,filename);
3924
3925
0
  if (in == NULL) {
3926
0
    D(("unable to open %s: %s\n", filename, g_strerror(errno)));
3927
0
    g_free(state.dict);
3928
0
    return NULL;
3929
0
  }
3930
3931
0
  if (DiamDict_lex_init(&scanner) != 0) {
3932
    /* Note: cannot be reached since memory allocation failure terminates early */
3933
0
    D(("Can't initialize scanner: %s\n", g_strerror(errno)));
3934
0
    fclose(in);
3935
0
    g_free(state.dict);
3936
0
    return NULL;
3937
0
  }
3938
3939
0
  DiamDict_set_in(in, scanner);
3940
3941
  /* Associate the state with the scanner */
3942
0
  DiamDict_set_extra(&state, scanner);
3943
3944
0
  state.start_state = LOADING;
3945
0
  DiamDict_lex(scanner);
3946
3947
0
  DiamDict_lex_destroy(scanner);
3948
  /*
3949
   * XXX - can the lexical analyzer terminate without closing
3950
   * all open input files?
3951
   */
3952
3953
0
  D(("\n---------------\n%s\n------- %u -------\n",state.strbuf,state.len_strbuf));
3954
3955
  /*
3956
   * Pass 2.
3957
   *
3958
   * Reads the modified version of the file contents and does the
3959
   * rest of the work.
3960
   */
3961
0
  state.current_yyinput = string_input;
3962
0
  state.current_close = string_close;
3963
3964
0
  if (DiamDict_lex_init(&scanner) != 0) {
3965
    /* Note: cannot be reached since memory allocation failure terminates early */
3966
0
    D(("Can't initialize scanner: %s\n", g_strerror(errno)));
3967
0
    g_free(state.dict);
3968
0
    g_free(state.strbuf);
3969
0
    return NULL;
3970
0
  }
3971
3972
  /* Associate the state with the scanner */
3973
0
  DiamDict_set_extra(&state, scanner);
3974
3975
0
  state.start_state = OUTSIDE;
3976
0
  DiamDict_lex(scanner);
3977
3978
0
  DiamDict_lex_destroy(scanner);
3979
0
  {
3980
0
    entity_t *e, *en;
3981
3982
0
    for (e = state.ents; e; e = en) {
3983
0
      en = e->next;
3984
0
      g_free(e->name);
3985
0
      g_free(e->file);
3986
0
      g_free(e);
3987
0
    }
3988
0
  }
3989
0
  g_free(state.strbuf);
3990
3991
0
  return state.dict;
3992
0
}
3993
3994
void
3995
ddict_free(ddict_t* d)
3996
0
{
3997
0
  ddict_application_t *p, *pn;
3998
0
  ddict_vendor_t *v, *vn;
3999
0
  ddict_cmd_t *c, *cn;
4000
0
  ddict_typedefn_t *t, *tn;
4001
0
  ddict_avp_t *a, *an;
4002
0
  ddict_xmlpi_t *x, *xn;
4003
4004
0
#define FREE_NAMEANDOBJ(n) do { g_free(n->name); g_free(n); } while(0)
4005
4006
0
  for (p = d->applications; p; p = pn ) {
4007
0
    pn = p->next;
4008
0
    FREE_NAMEANDOBJ(p);
4009
0
  }
4010
4011
0
  for (v = d->vendors; v; v = vn) {
4012
0
    vn = v->next;
4013
0
    g_free(v->desc);
4014
0
    FREE_NAMEANDOBJ(v);
4015
0
  }
4016
4017
0
  for (c = d->cmds; c; c = cn ) {
4018
0
    cn = c->next;
4019
0
    g_free(c->vendor);
4020
0
    FREE_NAMEANDOBJ(c);
4021
0
  }
4022
4023
0
  for (t = d->typedefns; t; t = tn) {
4024
0
    tn = t->next;
4025
0
    g_free(t->parent);
4026
0
    FREE_NAMEANDOBJ(t);
4027
0
  }
4028
4029
0
  for (a = d->avps; a; a = an) {
4030
0
    ddict_gavp_t* g, *gn;
4031
0
    ddict_enum_t* e, *en;
4032
0
    an = a->next;
4033
4034
0
    for (g = a->gavps; g; g = gn) {
4035
0
      gn = g->next;
4036
0
      FREE_NAMEANDOBJ(g);
4037
0
    }
4038
4039
0
    for (e = a->enums; e; e = en) {
4040
0
      en = e->next;
4041
0
      FREE_NAMEANDOBJ(e);
4042
0
    }
4043
4044
0
    g_free(a->vendor);
4045
0
    g_free(a->type);
4046
0
    g_free(a->description);
4047
0
    FREE_NAMEANDOBJ(a);
4048
0
  }
4049
4050
0
  for (x = d->xmlpis; x; x = xn) {
4051
0
    xn = x->next;
4052
0
    g_free(x->key);
4053
0
    g_free(x->value);
4054
0
    FREE_NAMEANDOBJ(x);
4055
0
  }
4056
4057
0
  g_free(d);
4058
0
}
4059
4060
void
4061
ddict_print(FILE* fh, ddict_t* d)
4062
0
{
4063
0
  ddict_application_t* p;
4064
0
  ddict_vendor_t* v;
4065
0
  ddict_cmd_t* c;
4066
0
  ddict_typedefn_t* t;
4067
0
  ddict_avp_t* a;
4068
4069
4070
0
  for (p = d->applications; p; p = p->next) {
4071
0
    fprintf(fh,"Application: %s[%u]:\n",
4072
0
        p->name ? p->name : "-",
4073
0
        p->code);
4074
0
  }
4075
4076
0
  for (v = d->vendors; v; v = v->next) {
4077
0
    fprintf(fh,"Vendor: %s[%u]:\n",
4078
0
        v->name ? v->name : "-",
4079
0
        v->code);
4080
0
  }
4081
4082
0
  for (c = d->cmds; c; c = c->next) {
4083
0
    fprintf(fh,"Command: %s[%u] \n",
4084
0
        c->name ? c->name : "-",
4085
0
        c->code);
4086
0
  }
4087
4088
0
  for (t = d->typedefns; t; t = t->next) {
4089
0
    fprintf(fh,"Type: %s -> %s \n",
4090
0
        t->name ? t->name : "-",
4091
0
        t->parent ? t->parent : "" );
4092
0
  }
4093
4094
0
  for (a = d->avps; a; a = a->next) {
4095
0
    ddict_gavp_t* g;
4096
0
    ddict_enum_t* e;
4097
0
    fprintf(fh,"AVP: %s[%u:%s] %s %s\n",
4098
0
        a->name ? a->name : "-",
4099
0
        a->code,
4100
0
        a->vendor ? a->vendor : "None",
4101
0
        a->type ? a->type : "-",
4102
0
        a->description ? a->description : "");
4103
4104
0
    for (g = a->gavps; g; g = g->next) {
4105
0
      fprintf(fh,"\tGAVP: %s\n",
4106
0
          g->name ? g->name : "-" );
4107
0
    }
4108
4109
0
    for (e = a->enums; e; e = e->next) {
4110
0
      fprintf(fh,"\tEnum: %s[%u]\n",
4111
0
          e->name ? e->name : "-",
4112
0
          e->code);
4113
0
    }
4114
0
  }
4115
0
}
4116
4117
#ifdef TEST_DIAM_DICT_STANDALONE
4118
int
4119
main(int argc, char** argv)
4120
{
4121
  ddict_t* d;
4122
  char* dname = NULL;
4123
  char* fname;
4124
  int i = 1;
4125
4126
  switch (argc) {
4127
    case 3:
4128
      dname = argv[i++];
4129
    case 2:
4130
      fname = argv[i];
4131
      break;
4132
    default:
4133
      fprintf(stderr,"%s: usage [dictionary_dir] dictionary_filename\n",argv[0]);
4134
      return 1;
4135
  }
4136
4137
  d = ddict_scan(dname,fname,1);
4138
  if (d == NULL) {
4139
    fprintf(stderr, "Can't open dictionary\n");
4140
    return 2;
4141
  }
4142
4143
  ddict_print(stdout, d);
4144
4145
  return 0;
4146
}
4147
#endif
4148