Coverage Report

Created: 2023-11-19 07:06

/src/dovecot/src/lib/event-filter-lexer.c
Line
Count
Source (jump to first uncovered line)
1
#line 2 "event-filter-lexer.c"
2
3
#line 4 "event-filter-lexer.c"
4
5
#define  YY_INT_ALIGNED short int
6
7
/* A lexical scanner generated by flex */
8
9
#define FLEX_SCANNER
10
#define YY_FLEX_MAJOR_VERSION 2
11
#define YY_FLEX_MINOR_VERSION 6
12
#define YY_FLEX_SUBMINOR_VERSION 4
13
#if YY_FLEX_SUBMINOR_VERSION > 0
14
#define FLEX_BETA
15
#endif
16
17
#ifdef yy_create_buffer
18
#define event_filter_parser__create_buffer_ALREADY_DEFINED
19
#else
20
0
#define yy_create_buffer event_filter_parser__create_buffer
21
#endif
22
23
#ifdef yy_delete_buffer
24
#define event_filter_parser__delete_buffer_ALREADY_DEFINED
25
#else
26
0
#define yy_delete_buffer event_filter_parser__delete_buffer
27
#endif
28
29
#ifdef yy_scan_buffer
30
#define event_filter_parser__scan_buffer_ALREADY_DEFINED
31
#else
32
0
#define yy_scan_buffer event_filter_parser__scan_buffer
33
#endif
34
35
#ifdef yy_scan_string
36
#define event_filter_parser__scan_string_ALREADY_DEFINED
37
#else
38
#define yy_scan_string event_filter_parser__scan_string
39
#endif
40
41
#ifdef yy_scan_bytes
42
#define event_filter_parser__scan_bytes_ALREADY_DEFINED
43
#else
44
0
#define yy_scan_bytes event_filter_parser__scan_bytes
45
#endif
46
47
#ifdef yy_init_buffer
48
#define event_filter_parser__init_buffer_ALREADY_DEFINED
49
#else
50
0
#define yy_init_buffer event_filter_parser__init_buffer
51
#endif
52
53
#ifdef yy_flush_buffer
54
#define event_filter_parser__flush_buffer_ALREADY_DEFINED
55
#else
56
0
#define yy_flush_buffer event_filter_parser__flush_buffer
57
#endif
58
59
#ifdef yy_load_buffer_state
60
#define event_filter_parser__load_buffer_state_ALREADY_DEFINED
61
#else
62
0
#define yy_load_buffer_state event_filter_parser__load_buffer_state
63
#endif
64
65
#ifdef yy_switch_to_buffer
66
#define event_filter_parser__switch_to_buffer_ALREADY_DEFINED
67
#else
68
0
#define yy_switch_to_buffer event_filter_parser__switch_to_buffer
69
#endif
70
71
#ifdef yypush_buffer_state
72
#define event_filter_parser_push_buffer_state_ALREADY_DEFINED
73
#else
74
#define yypush_buffer_state event_filter_parser_push_buffer_state
75
#endif
76
77
#ifdef yypop_buffer_state
78
#define event_filter_parser_pop_buffer_state_ALREADY_DEFINED
79
#else
80
0
#define yypop_buffer_state event_filter_parser_pop_buffer_state
81
#endif
82
83
#ifdef yyensure_buffer_stack
84
#define event_filter_parser_ensure_buffer_stack_ALREADY_DEFINED
85
#else
86
0
#define yyensure_buffer_stack event_filter_parser_ensure_buffer_stack
87
#endif
88
89
#ifdef yylex
90
#define event_filter_parser_lex_ALREADY_DEFINED
91
#else
92
#define yylex event_filter_parser_lex
93
#endif
94
95
#ifdef yyrestart
96
#define event_filter_parser_restart_ALREADY_DEFINED
97
#else
98
0
#define yyrestart event_filter_parser_restart
99
#endif
100
101
#ifdef yylex_init
102
#define event_filter_parser_lex_init_ALREADY_DEFINED
103
#else
104
#define yylex_init event_filter_parser_lex_init
105
#endif
106
107
#ifdef yylex_init_extra
108
#define event_filter_parser_lex_init_extra_ALREADY_DEFINED
109
#else
110
#define yylex_init_extra event_filter_parser_lex_init_extra
111
#endif
112
113
#ifdef yylex_destroy
114
#define event_filter_parser_lex_destroy_ALREADY_DEFINED
115
#else
116
#define yylex_destroy event_filter_parser_lex_destroy
117
#endif
118
119
#ifdef yyget_debug
120
#define event_filter_parser_get_debug_ALREADY_DEFINED
121
#else
122
#define yyget_debug event_filter_parser_get_debug
123
#endif
124
125
#ifdef yyset_debug
126
#define event_filter_parser_set_debug_ALREADY_DEFINED
127
#else
128
#define yyset_debug event_filter_parser_set_debug
129
#endif
130
131
#ifdef yyget_extra
132
#define event_filter_parser_get_extra_ALREADY_DEFINED
133
#else
134
#define yyget_extra event_filter_parser_get_extra
135
#endif
136
137
#ifdef yyset_extra
138
#define event_filter_parser_set_extra_ALREADY_DEFINED
139
#else
140
0
#define yyset_extra event_filter_parser_set_extra
141
#endif
142
143
#ifdef yyget_in
144
#define event_filter_parser_get_in_ALREADY_DEFINED
145
#else
146
#define yyget_in event_filter_parser_get_in
147
#endif
148
149
#ifdef yyset_in
150
#define event_filter_parser_set_in_ALREADY_DEFINED
151
#else
152
#define yyset_in event_filter_parser_set_in
153
#endif
154
155
#ifdef yyget_out
156
#define event_filter_parser_get_out_ALREADY_DEFINED
157
#else
158
#define yyget_out event_filter_parser_get_out
159
#endif
160
161
#ifdef yyset_out
162
#define event_filter_parser_set_out_ALREADY_DEFINED
163
#else
164
#define yyset_out event_filter_parser_set_out
165
#endif
166
167
#ifdef yyget_leng
168
#define event_filter_parser_get_leng_ALREADY_DEFINED
169
#else
170
#define yyget_leng event_filter_parser_get_leng
171
#endif
172
173
#ifdef yyget_text
174
#define event_filter_parser_get_text_ALREADY_DEFINED
175
#else
176
#define yyget_text event_filter_parser_get_text
177
#endif
178
179
#ifdef yyget_lineno
180
#define event_filter_parser_get_lineno_ALREADY_DEFINED
181
#else
182
#define yyget_lineno event_filter_parser_get_lineno
183
#endif
184
185
#ifdef yyset_lineno
186
#define event_filter_parser_set_lineno_ALREADY_DEFINED
187
#else
188
#define yyset_lineno event_filter_parser_set_lineno
189
#endif
190
191
#ifdef yyget_column
192
#define event_filter_parser_get_column_ALREADY_DEFINED
193
#else
194
#define yyget_column event_filter_parser_get_column
195
#endif
196
197
#ifdef yyset_column
198
#define event_filter_parser_set_column_ALREADY_DEFINED
199
#else
200
#define yyset_column event_filter_parser_set_column
201
#endif
202
203
#ifdef yywrap
204
#define event_filter_parser_wrap_ALREADY_DEFINED
205
#else
206
0
#define yywrap event_filter_parser_wrap
207
#endif
208
209
#ifdef yyget_lval
210
#define event_filter_parser_get_lval_ALREADY_DEFINED
211
#else
212
#define yyget_lval event_filter_parser_get_lval
213
#endif
214
215
#ifdef yyset_lval
216
#define event_filter_parser_set_lval_ALREADY_DEFINED
217
#else
218
#define yyset_lval event_filter_parser_set_lval
219
#endif
220
221
#ifdef yyalloc
222
#define event_filter_parser_alloc_ALREADY_DEFINED
223
#else
224
0
#define yyalloc event_filter_parser_alloc
225
#endif
226
227
#ifdef yyrealloc
228
#define event_filter_parser_realloc_ALREADY_DEFINED
229
#else
230
0
#define yyrealloc event_filter_parser_realloc
231
#endif
232
233
#ifdef yyfree
234
#define event_filter_parser_free_ALREADY_DEFINED
235
#else
236
0
#define yyfree event_filter_parser_free
237
#endif
238
239
/* First, we deal with  platform-specific or compiler-specific issues. */
240
241
/* begin standard C headers. */
242
#include <stdio.h>
243
#include <string.h>
244
#include <errno.h>
245
#include <stdlib.h>
246
247
/* end standard C headers. */
248
249
/* flex integer type definitions */
250
251
#ifndef FLEXINT_H
252
#define FLEXINT_H
253
254
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
255
256
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
257
258
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
259
 * if you want the limit (max/min) macros for int types. 
260
 */
261
#ifndef __STDC_LIMIT_MACROS
262
#define __STDC_LIMIT_MACROS 1
263
#endif
264
265
#include <inttypes.h>
266
typedef int8_t flex_int8_t;
267
typedef uint8_t flex_uint8_t;
268
typedef int16_t flex_int16_t;
269
typedef uint16_t flex_uint16_t;
270
typedef int32_t flex_int32_t;
271
typedef uint32_t flex_uint32_t;
272
#else
273
typedef signed char flex_int8_t;
274
typedef short int flex_int16_t;
275
typedef int flex_int32_t;
276
typedef unsigned char flex_uint8_t; 
277
typedef unsigned short int flex_uint16_t;
278
typedef unsigned int flex_uint32_t;
279
280
/* Limits of integral types. */
281
#ifndef INT8_MIN
282
#define INT8_MIN               (-128)
283
#endif
284
#ifndef INT16_MIN
285
#define INT16_MIN              (-32767-1)
286
#endif
287
#ifndef INT32_MIN
288
#define INT32_MIN              (-2147483647-1)
289
#endif
290
#ifndef INT8_MAX
291
#define INT8_MAX               (127)
292
#endif
293
#ifndef INT16_MAX
294
#define INT16_MAX              (32767)
295
#endif
296
#ifndef INT32_MAX
297
#define INT32_MAX              (2147483647)
298
#endif
299
#ifndef UINT8_MAX
300
#define UINT8_MAX              (255U)
301
#endif
302
#ifndef UINT16_MAX
303
#define UINT16_MAX             (65535U)
304
#endif
305
#ifndef UINT32_MAX
306
#define UINT32_MAX             (4294967295U)
307
#endif
308
309
#ifndef SIZE_MAX
310
#define SIZE_MAX               (~(size_t)0)
311
#endif
312
313
#endif /* ! C99 */
314
315
#endif /* ! FLEXINT_H */
316
317
/* begin standard C++ headers. */
318
319
/* TODO: this is always defined, so inline it */
320
#define yyconst const
321
322
#if defined(__GNUC__) && __GNUC__ >= 3
323
#define yynoreturn __attribute__((__noreturn__))
324
#else
325
#define yynoreturn
326
#endif
327
328
/* Returned upon end-of-file. */
329
0
#define YY_NULL 0
330
331
/* Promotes a possibly negative, possibly signed char to an
332
 *   integer in range [0..255] for use as an array index.
333
 */
334
0
#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
335
336
/* An opaque pointer. */
337
#ifndef YY_TYPEDEF_YY_SCANNER_T
338
#define YY_TYPEDEF_YY_SCANNER_T
339
typedef void* yyscan_t;
340
#endif
341
342
/* For convenience, these vars (plus the bison vars far below)
343
   are macros in the reentrant scanner. */
344
0
#define yyin yyg->yyin_r
345
0
#define yyout yyg->yyout_r
346
0
#define yyextra yyg->yyextra_r
347
0
#define yyleng yyg->yyleng_r
348
0
#define yytext yyg->yytext_r
349
0
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
350
0
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
351
0
#define yy_flex_debug yyg->yy_flex_debug_r
352
353
/* Enter a start condition.  This macro really ought to take a parameter,
354
 * but we do it the disgusting crufty way forced on us by the ()-less
355
 * definition of BEGIN.
356
 */
357
0
#define BEGIN yyg->yy_start = 1 + 2 *
358
/* Translate the current start state into a value that can be later handed
359
 * to BEGIN to return to the state.  The YYSTATE alias is for lex
360
 * compatibility.
361
 */
362
#define YY_START ((yyg->yy_start - 1) / 2)
363
#define YYSTATE YY_START
364
/* Action number for EOF rule of a given start state. */
365
0
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
366
/* Special action meaning "start processing a new file". */
367
0
#define YY_NEW_FILE yyrestart( yyin , yyscanner )
368
0
#define YY_END_OF_BUFFER_CHAR 0
369
370
/* Size of default input buffer. */
371
#ifndef YY_BUF_SIZE
372
#ifdef __ia64__
373
/* On IA-64, the buffer size is 16k, not 8k.
374
 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
375
 * Ditto for the __ia64__ case accordingly.
376
 */
377
#define YY_BUF_SIZE 32768
378
#else
379
0
#define YY_BUF_SIZE 16384
380
#endif /* __ia64__ */
381
#endif
382
383
/* The state buf must be large enough to hold one state per character in the main buffer.
384
 */
385
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
386
387
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
388
#define YY_TYPEDEF_YY_BUFFER_STATE
389
typedef struct yy_buffer_state *YY_BUFFER_STATE;
390
#endif
391
392
#ifndef YY_TYPEDEF_YY_SIZE_T
393
#define YY_TYPEDEF_YY_SIZE_T
394
typedef size_t yy_size_t;
395
#endif
396
397
0
#define EOB_ACT_CONTINUE_SCAN 0
398
0
#define EOB_ACT_END_OF_FILE 1
399
0
#define EOB_ACT_LAST_MATCH 2
400
    
401
    #define YY_LESS_LINENO(n)
402
    #define YY_LINENO_REWIND_TO(ptr)
403
    
404
/* Return all but the first "n" matched characters back to the input stream. */
405
#define yyless(n) \
406
  do \
407
    { \
408
    /* Undo effects of setting up yytext. */ \
409
        int yyless_macro_arg = (n); \
410
        YY_LESS_LINENO(yyless_macro_arg);\
411
    *yy_cp = yyg->yy_hold_char; \
412
    YY_RESTORE_YY_MORE_OFFSET \
413
    yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
414
    YY_DO_BEFORE_ACTION; /* set up yytext again */ \
415
    } \
416
  while ( 0 )
417
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
418
419
#ifndef YY_STRUCT_YY_BUFFER_STATE
420
#define YY_STRUCT_YY_BUFFER_STATE
421
struct yy_buffer_state
422
  {
423
  FILE *yy_input_file;
424
425
  char *yy_ch_buf;    /* input buffer */
426
  char *yy_buf_pos;   /* current position in input buffer */
427
428
  /* Size of input buffer in bytes, not including room for EOB
429
   * characters.
430
   */
431
  int yy_buf_size;
432
433
  /* Number of characters read into yy_ch_buf, not including EOB
434
   * characters.
435
   */
436
  int yy_n_chars;
437
438
  /* Whether we "own" the buffer - i.e., we know we created it,
439
   * and can realloc() it to grow it, and should free() it to
440
   * delete it.
441
   */
442
  int yy_is_our_buffer;
443
444
  /* Whether this is an "interactive" input source; if so, and
445
   * if we're using stdio for input, then we want to use getc()
446
   * instead of fread(), to make sure we stop fetching input after
447
   * each newline.
448
   */
449
  int yy_is_interactive;
450
451
  /* Whether we're considered to be at the beginning of a line.
452
   * If so, '^' rules will be active on the next match, otherwise
453
   * not.
454
   */
455
  int yy_at_bol;
456
457
    int yy_bs_lineno; /**< The line count. */
458
    int yy_bs_column; /**< The column count. */
459
460
  /* Whether to try to fill the input buffer when we reach the
461
   * end of it.
462
   */
463
  int yy_fill_buffer;
464
465
  int yy_buffer_status;
466
467
0
#define YY_BUFFER_NEW 0
468
0
#define YY_BUFFER_NORMAL 1
469
  /* When an EOF's been seen but there's still some text to process
470
   * then we mark the buffer as YY_EOF_PENDING, to indicate that we
471
   * shouldn't try reading from the input source any more.  We might
472
   * still have a bunch of tokens to match, though, because of
473
   * possible backing-up.
474
   *
475
   * When we actually see the EOF, we change the status to "new"
476
   * (via yyrestart()), so that the user can continue scanning by
477
   * just pointing yyin at a new input file.
478
   */
479
0
#define YY_BUFFER_EOF_PENDING 2
480
481
  };
482
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
483
484
/* We provide macros for accessing buffer states in case in the
485
 * future we want to put the buffer states in a more general
486
 * "scanner state".
487
 *
488
 * Returns the top of the stack, or NULL.
489
 */
490
0
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
491
0
                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
492
0
                          : NULL)
493
/* Same as previous macro, but useful when we know that the buffer stack is not
494
 * NULL or when we need an lvalue. For internal use only.
495
 */
496
0
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
497
498
void yyrestart ( FILE *input_file , yyscan_t yyscanner );
499
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
500
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
501
void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
502
void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
503
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
504
void yypop_buffer_state ( yyscan_t yyscanner );
505
506
static void yyensure_buffer_stack ( yyscan_t yyscanner );
507
static void yy_load_buffer_state ( yyscan_t yyscanner );
508
static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
509
#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
510
511
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
512
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
513
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
514
515
void *yyalloc ( yy_size_t , yyscan_t yyscanner );
516
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
517
void yyfree ( void * , yyscan_t yyscanner );
518
519
#define yy_new_buffer yy_create_buffer
520
#define yy_set_interactive(is_interactive) \
521
  { \
522
  if ( ! YY_CURRENT_BUFFER ){ \
523
        yyensure_buffer_stack (yyscanner); \
524
    YY_CURRENT_BUFFER_LVALUE =    \
525
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
526
  } \
527
  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
528
  }
529
#define yy_set_bol(at_bol) \
530
  { \
531
  if ( ! YY_CURRENT_BUFFER ){\
532
        yyensure_buffer_stack (yyscanner); \
533
    YY_CURRENT_BUFFER_LVALUE =    \
534
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
535
  } \
536
  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
537
  }
538
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
539
540
/* Begin user sect3 */
541
542
0
#define event_filter_parser_wrap(yyscanner) (/*CONSTCOND*/1)
543
#define YY_SKIP_YYWRAP
544
typedef flex_uint8_t YY_CHAR;
545
546
typedef int yy_state_type;
547
548
0
#define yytext_ptr yytext_r
549
550
static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
551
static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  , yyscan_t yyscanner);
552
static int yy_get_next_buffer ( yyscan_t yyscanner );
553
static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
554
555
/* Done after the current pattern has been matched and before the
556
 * corresponding action - sets up yytext.
557
 */
558
#define YY_DO_BEFORE_ACTION \
559
0
  yyg->yytext_ptr = yy_bp; \
560
0
  yyleng = (int) (yy_cp - yy_bp); \
561
0
  yyg->yy_hold_char = *yy_cp; \
562
0
  *yy_cp = '\0'; \
563
0
  yyg->yy_c_buf_p = yy_cp;
564
#define YY_NUM_RULES 14
565
0
#define YY_END_OF_BUFFER 15
566
/* This struct is not used in this scanner,
567
   but its presence is necessary. */
568
struct yy_trans_info
569
  {
570
  flex_int32_t yy_verify;
571
  flex_int32_t yy_nxt;
572
  };
573
static const flex_int16_t yy_accept[29] =
574
    {   0,
575
        0,    0,    0,    0,   15,   13,   12,   12,    1,   11,
576
       10,   11,   11,   11,    3,    2,   14,   11,   11,   11,
577
        8,    3,    6,    5,    4,    7,    9,    0
578
    } ;
579
580
static const YY_CHAR yy_ec[256] =
581
    {   0,
582
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
583
        1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
584
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
585
        1,    2,    1,    4,    1,    1,    5,    1,    1,    6,
586
        6,    5,    1,    1,    5,    5,    5,    5,    5,    5,
587
        5,    5,    5,    5,    5,    5,    5,    5,    1,    6,
588
        6,    6,    5,    1,    7,    5,    5,    8,    5,    5,
589
        5,    5,    5,    5,    5,    5,    5,    9,   10,    5,
590
        5,   11,    5,   12,    5,    5,    5,    5,    5,    5,
591
        1,   13,    1,    1,    5,    1,    7,    5,    5,    8,
592
593
        5,    5,    5,    5,    5,    5,    5,    5,    5,    9,
594
       10,    5,    5,   11,    5,   12,    5,    5,    5,    5,
595
        5,    5,    1,    1,    1,    1,    1,    1,    1,    1,
596
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
597
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
598
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
599
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
600
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
601
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
602
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
603
604
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
605
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
606
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
607
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
608
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
609
        1,    1,    1,    1,    1
610
    } ;
611
612
static const YY_CHAR yy_meta[14] =
613
    {   0,
614
        1,    1,    2,    3,    4,    1,    4,    4,    4,    4,
615
        4,    4,    3
616
    } ;
617
618
static const flex_int16_t yy_base[33] =
619
    {   0,
620
        0,    0,   10,   20,   21,   56,   56,   56,   56,    0,
621
       56,   11,    9,    7,    0,   56,   30,    0,    9,    4,
622
        0,    0,   56,   56,   56,    0,    0,   56,   43,   11,
623
       47,   51
624
    } ;
625
626
static const flex_int16_t yy_def[33] =
627
    {   0,
628
       28,    1,   29,   29,   28,   28,   28,   28,   28,   30,
629
       28,   30,   30,   30,   31,   28,   32,   30,   30,   30,
630
       30,   31,   28,   28,   28,   30,   30,    0,   28,   28,
631
       28,   28
632
    } ;
633
634
static const flex_int16_t yy_nxt[70] =
635
    {   0,
636
        6,    7,    8,    9,   10,   11,   12,   10,   13,   14,
637
       10,   10,    6,   16,   18,   27,   26,   21,   20,   19,
638
       28,   28,   17,   16,   28,   28,   28,   28,   28,   28,
639
       28,   28,   17,   24,   28,   28,   28,   28,   28,   28,
640
       28,   28,   25,   15,   15,   15,   15,   22,   22,   28,
641
       22,   23,   28,   23,   23,    5,   28,   28,   28,   28,
642
       28,   28,   28,   28,   28,   28,   28,   28,   28
643
    } ;
644
645
static const flex_int16_t yy_chk[70] =
646
    {   0,
647
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
648
        1,    1,    1,    3,   30,   20,   19,   14,   13,   12,
649
        5,    0,    3,    4,    0,    0,    0,    0,    0,    0,
650
        0,    0,    4,   17,    0,    0,    0,    0,    0,    0,
651
        0,    0,   17,   29,   29,   29,   29,   31,   31,    0,
652
       31,   32,    0,   32,   32,   28,   28,   28,   28,   28,
653
       28,   28,   28,   28,   28,   28,   28,   28,   28
654
    } ;
655
656
/* The intent behind this definition is that it'll catch
657
 * any uses of REJECT which flex missed.
658
 */
659
#define REJECT reject_used_but_not_detected
660
#define yymore() yymore_used_but_not_detected
661
0
#define YY_MORE_ADJ 0
662
#define YY_RESTORE_YY_MORE_OFFSET
663
#line 1 "event-filter-lexer.l"
664
/* Copyright (c) 2020 Dovecot authors, see the included COPYING file */
665
#define YY_NO_INPUT 1
666
#line 13 "event-filter-lexer.l"
667
#include "lib.h"
668
#include "str.h"
669
#include "event-filter-private.h"
670
#include "event-filter-parser.h"
671
672
0
#define YY_FATAL_ERROR(msg) { i_fatal("event filter parsing: %s", (msg)); }
673
674
/* mimic renaming done by bison's api.prefix %define */
675
#define YYSTYPE         EVENT_FILTER_PARSER_STYPE
676
677
#define YY_INPUT(buf, result, max_size) \
678
0
        result = event_filter_parser_input_proc(buf, max_size, yyscanner)
679
static size_t event_filter_parser_input_proc(char *buf, size_t size, yyscan_t scanner);
680
681
#pragma GCC diagnostic push
682
683
/* ignore strict bool warnings in generated code */
684
#ifdef HAVE_STRICT_BOOL
685
#  pragma GCC diagnostic ignored "-Wstrict-bool"
686
#endif
687
/* ignore sign comparison errors (buggy flex) */
688
#pragma GCC diagnostic ignored "-Wsign-compare"
689
/* ignore unused functions */
690
#pragma GCC diagnostic ignored "-Wunused-function"
691
/* ignore unused parameters */
692
#pragma GCC diagnostic ignored "-Wunused-parameter"
693
694
#line 695 "event-filter-lexer.c"
695
696
#line 697 "event-filter-lexer.c"
697
698
0
#define INITIAL 0
699
0
#define string 1
700
701
#ifndef YY_NO_UNISTD_H
702
/* Special case for "unistd.h", since it is non-ANSI. We include it way
703
 * down here because we want the user's section 1 to have been scanned first.
704
 * The user has a chance to override it with an option.
705
 */
706
#include <unistd.h>
707
#endif
708
709
#ifndef YY_EXTRA_TYPE
710
#define YY_EXTRA_TYPE void *
711
#endif
712
713
/* Holds the entire state of the reentrant scanner. */
714
struct yyguts_t
715
    {
716
717
    /* User-defined. Not touched by flex. */
718
    YY_EXTRA_TYPE yyextra_r;
719
720
    /* The rest are the same as the globals declared in the non-reentrant scanner. */
721
    FILE *yyin_r, *yyout_r;
722
    size_t yy_buffer_stack_top; /**< index of top of stack. */
723
    size_t yy_buffer_stack_max; /**< capacity of stack. */
724
    YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
725
    char yy_hold_char;
726
    int yy_n_chars;
727
    int yyleng_r;
728
    char *yy_c_buf_p;
729
    int yy_init;
730
    int yy_start;
731
    int yy_did_buffer_switch_on_eof;
732
    int yy_start_stack_ptr;
733
    int yy_start_stack_depth;
734
    int *yy_start_stack;
735
    yy_state_type yy_last_accepting_state;
736
    char* yy_last_accepting_cpos;
737
738
    int yylineno_r;
739
    int yy_flex_debug_r;
740
741
    char *yytext_r;
742
    int yy_more_flag;
743
    int yy_more_len;
744
745
    YYSTYPE * yylval_r;
746
747
    }; /* end struct yyguts_t */
748
749
static int yy_init_globals ( yyscan_t yyscanner );
750
751
    /* This must go here because YYSTYPE and YYLTYPE are included
752
     * from bison output in section 1.*/
753
0
    #    define yylval yyg->yylval_r
754
    
755
int yylex_init (yyscan_t* scanner);
756
757
int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
758
759
/* Accessor methods to globals.
760
   These are made visible to non-reentrant scanners for convenience. */
761
762
int yylex_destroy ( yyscan_t yyscanner );
763
764
int yyget_debug ( yyscan_t yyscanner );
765
766
void yyset_debug ( int debug_flag , yyscan_t yyscanner );
767
768
YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
769
770
void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
771
772
FILE *yyget_in ( yyscan_t yyscanner );
773
774
void yyset_in  ( FILE * _in_str , yyscan_t yyscanner );
775
776
FILE *yyget_out ( yyscan_t yyscanner );
777
778
void yyset_out  ( FILE * _out_str , yyscan_t yyscanner );
779
780
      int yyget_leng ( yyscan_t yyscanner );
781
782
char *yyget_text ( yyscan_t yyscanner );
783
784
int yyget_lineno ( yyscan_t yyscanner );
785
786
void yyset_lineno ( int _line_number , yyscan_t yyscanner );
787
788
int yyget_column  ( yyscan_t yyscanner );
789
790
void yyset_column ( int _column_no , yyscan_t yyscanner );
791
792
YYSTYPE * yyget_lval ( yyscan_t yyscanner );
793
794
void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
795
796
/* Macros after this point can all be overridden by user definitions in
797
 * section 1.
798
 */
799
800
#ifndef YY_SKIP_YYWRAP
801
#ifdef __cplusplus
802
extern "C" int yywrap ( yyscan_t yyscanner );
803
#else
804
extern int yywrap ( yyscan_t yyscanner );
805
#endif
806
#endif
807
808
#ifndef YY_NO_UNPUT
809
    
810
#endif
811
812
#ifndef yytext_ptr
813
static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
814
#endif
815
816
#ifdef YY_NEED_STRLEN
817
static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
818
#endif
819
820
#ifndef YY_NO_INPUT
821
#ifdef __cplusplus
822
static int yyinput ( yyscan_t yyscanner );
823
#else
824
static int input ( yyscan_t yyscanner );
825
#endif
826
827
#endif
828
829
/* Amount of stuff to slurp up with each read. */
830
#ifndef YY_READ_BUF_SIZE
831
#ifdef __ia64__
832
/* On IA-64, the buffer size is 16k, not 8k */
833
#define YY_READ_BUF_SIZE 16384
834
#else
835
0
#define YY_READ_BUF_SIZE 8192
836
#endif /* __ia64__ */
837
#endif
838
839
/* Copy whatever the last rule matched to the standard output. */
840
#ifndef ECHO
841
/* This used to be an fputs(), but since the string might contain NUL's,
842
 * we now use fwrite().
843
 */
844
0
#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
845
#endif
846
847
/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
848
 * is returned in "result".
849
 */
850
#ifndef YY_INPUT
851
#define YY_INPUT(buf,result,max_size) \
852
  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
853
    { \
854
    int c = '*'; \
855
    int n; \
856
    for ( n = 0; n < max_size && \
857
           (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
858
      buf[n] = (char) c; \
859
    if ( c == '\n' ) \
860
      buf[n++] = (char) c; \
861
    if ( c == EOF && ferror( yyin ) ) \
862
      YY_FATAL_ERROR( "input in flex scanner failed" ); \
863
    result = n; \
864
    } \
865
  else \
866
    { \
867
    errno=0; \
868
    while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
869
      { \
870
      if( errno != EINTR) \
871
        { \
872
        YY_FATAL_ERROR( "input in flex scanner failed" ); \
873
        break; \
874
        } \
875
      errno=0; \
876
      clearerr(yyin); \
877
      } \
878
    }\
879
\
880
881
#endif
882
883
/* No semi-colon after return; correct usage is to write "yyterminate();" -
884
 * we don't want an extra ';' after the "return" because that will cause
885
 * some compilers to complain about unreachable statements.
886
 */
887
#ifndef yyterminate
888
0
#define yyterminate() return YY_NULL
889
#endif
890
891
/* Number of entries by which start-condition stack grows. */
892
#ifndef YY_START_STACK_INCR
893
#define YY_START_STACK_INCR 25
894
#endif
895
896
/* Report a fatal error. */
897
#ifndef YY_FATAL_ERROR
898
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
899
#endif
900
901
/* end tables serialization structures and prototypes */
902
903
/* Default declaration of generated scanner - a define so the user can
904
 * easily add parameters.
905
 */
906
#ifndef YY_DECL
907
#define YY_DECL_IS_OURS 1
908
909
extern int yylex \
910
               (YYSTYPE * yylval_param , yyscan_t yyscanner);
911
912
#define YY_DECL int yylex \
913
               (YYSTYPE * yylval_param , yyscan_t yyscanner)
914
#endif /* !YY_DECL */
915
916
/* Code executed at the beginning of each rule, after yytext and yyleng
917
 * have been set up.
918
 */
919
#ifndef YY_USER_ACTION
920
#define YY_USER_ACTION
921
#endif
922
923
/* Code executed at the end of each rule. */
924
#ifndef YY_BREAK
925
0
#define YY_BREAK /*LINTED*/break;
926
#endif
927
928
#define YY_RULE_SETUP \
929
  YY_USER_ACTION
930
931
/** The main scanner function which does all the work.
932
 */
933
YY_DECL
934
0
{
935
0
  yy_state_type yy_current_state;
936
0
  char *yy_cp, *yy_bp;
937
0
  int yy_act;
938
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
939
940
0
    yylval = yylval_param;
941
942
0
  if ( !yyg->yy_init )
943
0
    {
944
0
    yyg->yy_init = 1;
945
946
#ifdef YY_USER_INIT
947
    YY_USER_INIT;
948
#endif
949
950
0
    if ( ! yyg->yy_start )
951
0
      yyg->yy_start = 1; /* first start state */
952
953
0
    if ( ! yyin )
954
0
      yyin = stdin;
955
956
0
    if ( ! yyout )
957
0
      yyout = stdout;
958
959
0
    if ( ! YY_CURRENT_BUFFER ) {
960
0
      yyensure_buffer_stack (yyscanner);
961
0
      YY_CURRENT_BUFFER_LVALUE =
962
0
        yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
963
0
    }
964
965
0
    yy_load_buffer_state( yyscanner );
966
0
    }
967
968
0
  {
969
0
#line 44 "event-filter-lexer.l"
970
971
0
#line 46 "event-filter-lexer.l"
972
0
  string_t *str_buf = NULL;
973
974
0
#line 975 "event-filter-lexer.c"
975
976
0
  while ( /*CONSTCOND*/1 )    /* loops until end-of-file is reached */
977
0
    {
978
0
    yy_cp = yyg->yy_c_buf_p;
979
980
    /* Support of yytext. */
981
0
    *yy_cp = yyg->yy_hold_char;
982
983
    /* yy_bp points to the position in yy_ch_buf of the start of
984
     * the current run.
985
     */
986
0
    yy_bp = yy_cp;
987
988
0
    yy_current_state = yyg->yy_start;
989
0
yy_match:
990
0
    do
991
0
      {
992
0
      YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
993
0
      if ( yy_accept[yy_current_state] )
994
0
        {
995
0
        yyg->yy_last_accepting_state = yy_current_state;
996
0
        yyg->yy_last_accepting_cpos = yy_cp;
997
0
        }
998
0
      while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
999
0
        {
1000
0
        yy_current_state = (int) yy_def[yy_current_state];
1001
0
        if ( yy_current_state >= 29 )
1002
0
          yy_c = yy_meta[yy_c];
1003
0
        }
1004
0
      yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1005
0
      ++yy_cp;
1006
0
      }
1007
0
    while ( yy_current_state != 28 );
1008
0
    yy_cp = yyg->yy_last_accepting_cpos;
1009
0
    yy_current_state = yyg->yy_last_accepting_state;
1010
1011
0
yy_find_action:
1012
0
    yy_act = yy_accept[yy_current_state];
1013
1014
0
    YY_DO_BEFORE_ACTION;
1015
1016
0
do_action:  /* This label is used only to access EOF actions. */
1017
1018
0
    switch ( yy_act )
1019
0
  { /* beginning of action switch */
1020
0
      case 0: /* must back up */
1021
      /* undo the effects of YY_DO_BEFORE_ACTION */
1022
0
      *yy_cp = yyg->yy_hold_char;
1023
0
      yy_cp = yyg->yy_last_accepting_cpos;
1024
0
      yy_current_state = yyg->yy_last_accepting_state;
1025
0
      goto yy_find_action;
1026
1027
0
case 1:
1028
0
YY_RULE_SETUP
1029
0
#line 48 "event-filter-lexer.l"
1030
0
{
1031
0
          BEGIN(string);
1032
1033
0
          str_buf = t_str_new(128);
1034
0
        }
1035
0
  YY_BREAK
1036
0
case 2:
1037
0
YY_RULE_SETUP
1038
0
#line 53 "event-filter-lexer.l"
1039
0
{
1040
0
          yylval->str = str_c(str_buf);
1041
0
          BEGIN(INITIAL);
1042
0
          return STRING;
1043
0
        }
1044
0
  YY_BREAK
1045
/* Note: these have to match the event_filter_append_escaped() behavior */
1046
0
case 3:
1047
/* rule 3 can match eol */
1048
0
YY_RULE_SETUP
1049
0
#line 59 "event-filter-lexer.l"
1050
0
{ str_append(str_buf, yytext); }
1051
0
  YY_BREAK
1052
0
case 4:
1053
0
YY_RULE_SETUP
1054
0
#line 60 "event-filter-lexer.l"
1055
0
{ str_append(str_buf, yytext); }
1056
0
  YY_BREAK
1057
0
case 5:
1058
0
YY_RULE_SETUP
1059
0
#line 61 "event-filter-lexer.l"
1060
0
{ str_append(str_buf, yytext); }
1061
0
  YY_BREAK
1062
0
case 6:
1063
0
YY_RULE_SETUP
1064
0
#line 62 "event-filter-lexer.l"
1065
0
{ str_append(str_buf, yytext); }
1066
0
  YY_BREAK
1067
0
case 7:
1068
0
YY_RULE_SETUP
1069
0
#line 64 "event-filter-lexer.l"
1070
0
{ return AND; }
1071
0
  YY_BREAK
1072
0
case 8:
1073
0
YY_RULE_SETUP
1074
0
#line 65 "event-filter-lexer.l"
1075
0
{ return OR; }
1076
0
  YY_BREAK
1077
0
case 9:
1078
0
YY_RULE_SETUP
1079
0
#line 66 "event-filter-lexer.l"
1080
0
{ return NOT; }
1081
0
  YY_BREAK
1082
0
case 10:
1083
0
YY_RULE_SETUP
1084
0
#line 67 "event-filter-lexer.l"
1085
0
{ return *yytext; }
1086
0
  YY_BREAK
1087
0
case 11:
1088
0
YY_RULE_SETUP
1089
0
#line 68 "event-filter-lexer.l"
1090
0
{ yylval->str = t_strdup(yytext); return TOKEN; }
1091
0
  YY_BREAK
1092
0
case 12:
1093
/* rule 12 can match eol */
1094
0
YY_RULE_SETUP
1095
0
#line 69 "event-filter-lexer.l"
1096
0
{ /* ignore */ }
1097
0
  YY_BREAK
1098
0
case 13:
1099
0
YY_RULE_SETUP
1100
0
#line 70 "event-filter-lexer.l"
1101
0
{
1102
          /*
1103
           * We simply return the char to the
1104
           * and let the grammar error out
1105
           * with a syntax error.
1106
           *
1107
           * Note: The cast is significant
1108
           * since utf-8 bytes >=128 will
1109
           * otherwise result in sign
1110
           * extension and a negative int
1111
           * getting returned on some
1112
           * platforms (e.g., x86) which in
1113
           * turn confuses the parser.  E.g.,
1114
           * if:
1115
           *    *yytext = '\x80'
1116
           * we get:
1117
           *    *yytext             -> -128
1118
           *    (int) *yytext       -> -128
1119
           * which is wrong.  With the
1120
           * unsigned char cast, we get:
1121
           *    (u.c.) *yytext      -> 128
1122
           *    (int)(u.c.) *yytext -> 128
1123
           * which is correct.
1124
           */
1125
0
          return (unsigned char) *yytext;
1126
0
        }
1127
0
  YY_BREAK
1128
0
case 14:
1129
0
YY_RULE_SETUP
1130
0
#line 96 "event-filter-lexer.l"
1131
0
ECHO;
1132
0
  YY_BREAK
1133
0
#line 1134 "event-filter-lexer.c"
1134
0
case YY_STATE_EOF(INITIAL):
1135
0
case YY_STATE_EOF(string):
1136
0
  yyterminate();
1137
1138
0
  case YY_END_OF_BUFFER:
1139
0
    {
1140
    /* Amount of text matched not including the EOB char. */
1141
0
    int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1142
1143
    /* Undo the effects of YY_DO_BEFORE_ACTION. */
1144
0
    *yy_cp = yyg->yy_hold_char;
1145
0
    YY_RESTORE_YY_MORE_OFFSET
1146
1147
0
    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1148
0
      {
1149
      /* We're scanning a new file or input source.  It's
1150
       * possible that this happened because the user
1151
       * just pointed yyin at a new source and called
1152
       * yylex().  If so, then we have to assure
1153
       * consistency between YY_CURRENT_BUFFER and our
1154
       * globals.  Here is the right place to do so, because
1155
       * this is the first action (other than possibly a
1156
       * back-up) that will match for the new input source.
1157
       */
1158
0
      yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1159
0
      YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1160
0
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1161
0
      }
1162
1163
    /* Note that here we test for yy_c_buf_p "<=" to the position
1164
     * of the first EOB in the buffer, since yy_c_buf_p will
1165
     * already have been incremented past the NUL character
1166
     * (since all states make transitions on EOB to the
1167
     * end-of-buffer state).  Contrast this with the test
1168
     * in input().
1169
     */
1170
0
    if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1171
0
      { /* This was really a NUL. */
1172
0
      yy_state_type yy_next_state;
1173
1174
0
      yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1175
1176
0
      yy_current_state = yy_get_previous_state( yyscanner );
1177
1178
      /* Okay, we're now positioned to make the NUL
1179
       * transition.  We couldn't have
1180
       * yy_get_previous_state() go ahead and do it
1181
       * for us because it doesn't know how to deal
1182
       * with the possibility of jamming (and we don't
1183
       * want to build jamming into it because then it
1184
       * will run more slowly).
1185
       */
1186
1187
0
      yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1188
1189
0
      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1190
1191
0
      if ( yy_next_state )
1192
0
        {
1193
        /* Consume the NUL. */
1194
0
        yy_cp = ++yyg->yy_c_buf_p;
1195
0
        yy_current_state = yy_next_state;
1196
0
        goto yy_match;
1197
0
        }
1198
1199
0
      else
1200
0
        {
1201
0
        yy_cp = yyg->yy_last_accepting_cpos;
1202
0
        yy_current_state = yyg->yy_last_accepting_state;
1203
0
        goto yy_find_action;
1204
0
        }
1205
0
      }
1206
1207
0
    else switch ( yy_get_next_buffer( yyscanner ) )
1208
0
      {
1209
0
      case EOB_ACT_END_OF_FILE:
1210
0
        {
1211
0
        yyg->yy_did_buffer_switch_on_eof = 0;
1212
1213
0
        if ( yywrap( yyscanner ) )
1214
0
          {
1215
          /* Note: because we've taken care in
1216
           * yy_get_next_buffer() to have set up
1217
           * yytext, we can now set up
1218
           * yy_c_buf_p so that if some total
1219
           * hoser (like flex itself) wants to
1220
           * call the scanner after we return the
1221
           * YY_NULL, it'll still work - another
1222
           * YY_NULL will get returned.
1223
           */
1224
0
          yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1225
1226
0
          yy_act = YY_STATE_EOF(YY_START);
1227
0
          goto do_action;
1228
0
          }
1229
1230
0
        else
1231
0
          {
1232
0
          if ( ! yyg->yy_did_buffer_switch_on_eof )
1233
0
            YY_NEW_FILE;
1234
0
          }
1235
0
        break;
1236
0
        }
1237
1238
0
      case EOB_ACT_CONTINUE_SCAN:
1239
0
        yyg->yy_c_buf_p =
1240
0
          yyg->yytext_ptr + yy_amount_of_matched_text;
1241
1242
0
        yy_current_state = yy_get_previous_state( yyscanner );
1243
1244
0
        yy_cp = yyg->yy_c_buf_p;
1245
0
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1246
0
        goto yy_match;
1247
1248
0
      case EOB_ACT_LAST_MATCH:
1249
0
        yyg->yy_c_buf_p =
1250
0
        &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1251
1252
0
        yy_current_state = yy_get_previous_state( yyscanner );
1253
1254
0
        yy_cp = yyg->yy_c_buf_p;
1255
0
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1256
0
        goto yy_find_action;
1257
0
      }
1258
0
    break;
1259
0
    }
1260
1261
0
  default:
1262
0
    YY_FATAL_ERROR(
1263
0
      "fatal flex scanner internal error--no action found" );
1264
0
  } /* end of action switch */
1265
0
    } /* end of scanning one token */
1266
0
  } /* end of user's declarations */
1267
0
} /* end of yylex */
1268
1269
/* yy_get_next_buffer - try to read in a new buffer
1270
 *
1271
 * Returns a code representing an action:
1272
 *  EOB_ACT_LAST_MATCH -
1273
 *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1274
 *  EOB_ACT_END_OF_FILE - end of file
1275
 */
1276
static int yy_get_next_buffer (yyscan_t yyscanner)
1277
0
{
1278
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1279
0
  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1280
0
  char *source = yyg->yytext_ptr;
1281
0
  int number_to_move, i;
1282
0
  int ret_val;
1283
1284
0
  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1285
0
    YY_FATAL_ERROR(
1286
0
    "fatal flex scanner internal error--end of buffer missed" );
1287
1288
0
  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1289
0
    { /* Don't try to fill the buffer, so this is an EOF. */
1290
0
    if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1291
0
      {
1292
      /* We matched a single character, the EOB, so
1293
       * treat this as a final EOF.
1294
       */
1295
0
      return EOB_ACT_END_OF_FILE;
1296
0
      }
1297
1298
0
    else
1299
0
      {
1300
      /* We matched some text prior to the EOB, first
1301
       * process it.
1302
       */
1303
0
      return EOB_ACT_LAST_MATCH;
1304
0
      }
1305
0
    }
1306
1307
  /* Try to read more data. */
1308
1309
  /* First move last chars to start of buffer. */
1310
0
  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
1311
1312
0
  for ( i = 0; i < number_to_move; ++i )
1313
0
    *(dest++) = *(source++);
1314
1315
0
  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1316
    /* don't do the read, it's not guaranteed to return an EOF,
1317
     * just force an EOF
1318
     */
1319
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1320
1321
0
  else
1322
0
    {
1323
0
      int num_to_read =
1324
0
      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1325
1326
0
    while ( num_to_read <= 0 )
1327
0
      { /* Not enough room in the buffer - grow it. */
1328
1329
      /* just a shorter name for the current buffer */
1330
0
      YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1331
1332
0
      int yy_c_buf_p_offset =
1333
0
        (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1334
1335
0
      if ( b->yy_is_our_buffer )
1336
0
        {
1337
0
        int new_size = b->yy_buf_size * 2;
1338
1339
0
        if ( new_size <= 0 )
1340
0
          b->yy_buf_size += b->yy_buf_size / 8;
1341
0
        else
1342
0
          b->yy_buf_size *= 2;
1343
1344
0
        b->yy_ch_buf = (char *)
1345
          /* Include room in for 2 EOB chars. */
1346
0
          yyrealloc( (void *) b->yy_ch_buf,
1347
0
               (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1348
0
        }
1349
0
      else
1350
        /* Can't grow it, we don't own it. */
1351
0
        b->yy_ch_buf = NULL;
1352
1353
0
      if ( ! b->yy_ch_buf )
1354
0
        YY_FATAL_ERROR(
1355
0
        "fatal error - scanner input buffer overflow" );
1356
1357
0
      yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1358
1359
0
      num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1360
0
            number_to_move - 1;
1361
1362
0
      }
1363
1364
0
    if ( num_to_read > YY_READ_BUF_SIZE )
1365
0
      num_to_read = YY_READ_BUF_SIZE;
1366
1367
    /* Read in more data. */
1368
0
    YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1369
0
      yyg->yy_n_chars, num_to_read );
1370
1371
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1372
0
    }
1373
1374
0
  if ( yyg->yy_n_chars == 0 )
1375
0
    {
1376
0
    if ( number_to_move == YY_MORE_ADJ )
1377
0
      {
1378
0
      ret_val = EOB_ACT_END_OF_FILE;
1379
0
      yyrestart( yyin  , yyscanner);
1380
0
      }
1381
1382
0
    else
1383
0
      {
1384
0
      ret_val = EOB_ACT_LAST_MATCH;
1385
0
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1386
0
        YY_BUFFER_EOF_PENDING;
1387
0
      }
1388
0
    }
1389
1390
0
  else
1391
0
    ret_val = EOB_ACT_CONTINUE_SCAN;
1392
1393
0
  if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1394
    /* Extend the array by 50%, plus the number we really need. */
1395
0
    int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1396
0
    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1397
0
      (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
1398
0
    if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1399
0
      YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1400
    /* "- 2" to take care of EOB's */
1401
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1402
0
  }
1403
1404
0
  yyg->yy_n_chars += number_to_move;
1405
0
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1406
0
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1407
1408
0
  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1409
1410
0
  return ret_val;
1411
0
}
1412
1413
/* yy_get_previous_state - get the state just before the EOB char was reached */
1414
1415
    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1416
0
{
1417
0
  yy_state_type yy_current_state;
1418
0
  char *yy_cp;
1419
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1420
1421
0
  yy_current_state = yyg->yy_start;
1422
1423
0
  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1424
0
    {
1425
0
    YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1426
0
    if ( yy_accept[yy_current_state] )
1427
0
      {
1428
0
      yyg->yy_last_accepting_state = yy_current_state;
1429
0
      yyg->yy_last_accepting_cpos = yy_cp;
1430
0
      }
1431
0
    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1432
0
      {
1433
0
      yy_current_state = (int) yy_def[yy_current_state];
1434
0
      if ( yy_current_state >= 29 )
1435
0
        yy_c = yy_meta[yy_c];
1436
0
      }
1437
0
    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1438
0
    }
1439
1440
0
  return yy_current_state;
1441
0
}
1442
1443
/* yy_try_NUL_trans - try to make a transition on the NUL character
1444
 *
1445
 * synopsis
1446
 *  next_state = yy_try_NUL_trans( current_state );
1447
 */
1448
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
1449
0
{
1450
0
  int yy_is_jam;
1451
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1452
0
  char *yy_cp = yyg->yy_c_buf_p;
1453
1454
0
  YY_CHAR yy_c = 1;
1455
0
  if ( yy_accept[yy_current_state] )
1456
0
    {
1457
0
    yyg->yy_last_accepting_state = yy_current_state;
1458
0
    yyg->yy_last_accepting_cpos = yy_cp;
1459
0
    }
1460
0
  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1461
0
    {
1462
0
    yy_current_state = (int) yy_def[yy_current_state];
1463
0
    if ( yy_current_state >= 29 )
1464
0
      yy_c = yy_meta[yy_c];
1465
0
    }
1466
0
  yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1467
0
  yy_is_jam = (yy_current_state == 28);
1468
1469
0
  (void)yyg;
1470
0
  return yy_is_jam ? 0 : yy_current_state;
1471
0
}
1472
1473
#ifndef YY_NO_UNPUT
1474
1475
#endif
1476
1477
#ifndef YY_NO_INPUT
1478
#ifdef __cplusplus
1479
    static int yyinput (yyscan_t yyscanner)
1480
#else
1481
    static int input  (yyscan_t yyscanner)
1482
#endif
1483
1484
{
1485
  int c;
1486
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1487
1488
  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1489
1490
  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1491
    {
1492
    /* yy_c_buf_p now points to the character we want to return.
1493
     * If this occurs *before* the EOB characters, then it's a
1494
     * valid NUL; if not, then we've hit the end of the buffer.
1495
     */
1496
    if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1497
      /* This was really a NUL. */
1498
      *yyg->yy_c_buf_p = '\0';
1499
1500
    else
1501
      { /* need more input */
1502
      int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
1503
      ++yyg->yy_c_buf_p;
1504
1505
      switch ( yy_get_next_buffer( yyscanner ) )
1506
        {
1507
        case EOB_ACT_LAST_MATCH:
1508
          /* This happens because yy_g_n_b()
1509
           * sees that we've accumulated a
1510
           * token and flags that we need to
1511
           * try matching the token before
1512
           * proceeding.  But for input(),
1513
           * there's no matching to consider.
1514
           * So convert the EOB_ACT_LAST_MATCH
1515
           * to EOB_ACT_END_OF_FILE.
1516
           */
1517
1518
          /* Reset buffer status. */
1519
          yyrestart( yyin , yyscanner);
1520
1521
          /*FALLTHROUGH*/
1522
1523
        case EOB_ACT_END_OF_FILE:
1524
          {
1525
          if ( yywrap( yyscanner ) )
1526
            return 0;
1527
1528
          if ( ! yyg->yy_did_buffer_switch_on_eof )
1529
            YY_NEW_FILE;
1530
#ifdef __cplusplus
1531
          return yyinput(yyscanner);
1532
#else
1533
          return input(yyscanner);
1534
#endif
1535
          }
1536
1537
        case EOB_ACT_CONTINUE_SCAN:
1538
          yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1539
          break;
1540
        }
1541
      }
1542
    }
1543
1544
  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1545
  *yyg->yy_c_buf_p = '\0';  /* preserve yytext */
1546
  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1547
1548
  return c;
1549
}
1550
#endif  /* ifndef YY_NO_INPUT */
1551
1552
/** Immediately switch to a different input stream.
1553
 * @param input_file A readable stream.
1554
 * @param yyscanner The scanner object.
1555
 * @note This function does not reset the start condition to @c INITIAL .
1556
 */
1557
    void yyrestart  (FILE * input_file , yyscan_t yyscanner)
1558
0
{
1559
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1560
1561
0
  if ( ! YY_CURRENT_BUFFER ){
1562
0
        yyensure_buffer_stack (yyscanner);
1563
0
    YY_CURRENT_BUFFER_LVALUE =
1564
0
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1565
0
  }
1566
1567
0
  yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
1568
0
  yy_load_buffer_state( yyscanner );
1569
0
}
1570
1571
/** Switch to a different input buffer.
1572
 * @param new_buffer The new input buffer.
1573
 * @param yyscanner The scanner object.
1574
 */
1575
    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
1576
0
{
1577
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1578
1579
  /* TODO. We should be able to replace this entire function body
1580
   * with
1581
   *    yypop_buffer_state();
1582
   *    yypush_buffer_state(new_buffer);
1583
     */
1584
0
  yyensure_buffer_stack (yyscanner);
1585
0
  if ( YY_CURRENT_BUFFER == new_buffer )
1586
0
    return;
1587
1588
0
  if ( YY_CURRENT_BUFFER )
1589
0
    {
1590
    /* Flush out information for old buffer. */
1591
0
    *yyg->yy_c_buf_p = yyg->yy_hold_char;
1592
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1593
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1594
0
    }
1595
1596
0
  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1597
0
  yy_load_buffer_state( yyscanner );
1598
1599
  /* We don't actually know whether we did this switch during
1600
   * EOF (yywrap()) processing, but the only time this flag
1601
   * is looked at is after yywrap() is called, so it's safe
1602
   * to go ahead and always set it.
1603
   */
1604
0
  yyg->yy_did_buffer_switch_on_eof = 1;
1605
0
}
1606
1607
static void yy_load_buffer_state  (yyscan_t yyscanner)
1608
0
{
1609
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1610
0
  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1611
0
  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1612
0
  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1613
0
  yyg->yy_hold_char = *yyg->yy_c_buf_p;
1614
0
}
1615
1616
/** Allocate and initialize an input buffer state.
1617
 * @param file A readable stream.
1618
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1619
 * @param yyscanner The scanner object.
1620
 * @return the allocated buffer state.
1621
 */
1622
    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
1623
0
{
1624
0
  YY_BUFFER_STATE b;
1625
    
1626
0
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
1627
0
  if ( ! b )
1628
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1629
1630
0
  b->yy_buf_size = size;
1631
1632
  /* yy_ch_buf has to be 2 characters longer than the size given because
1633
   * we need to put in 2 end-of-buffer characters.
1634
   */
1635
0
  b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1636
0
  if ( ! b->yy_ch_buf )
1637
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1638
1639
0
  b->yy_is_our_buffer = 1;
1640
1641
0
  yy_init_buffer( b, file , yyscanner);
1642
1643
0
  return b;
1644
0
}
1645
1646
/** Destroy the buffer.
1647
 * @param b a buffer created with yy_create_buffer()
1648
 * @param yyscanner The scanner object.
1649
 */
1650
    void yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
1651
0
{
1652
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1653
1654
0
  if ( ! b )
1655
0
    return;
1656
1657
0
  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1658
0
    YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1659
1660
0
  if ( b->yy_is_our_buffer )
1661
0
    yyfree( (void *) b->yy_ch_buf , yyscanner );
1662
1663
0
  yyfree( (void *) b , yyscanner );
1664
0
}
1665
1666
/* Initializes or reinitializes a buffer.
1667
 * This function is sometimes called more than once on the same buffer,
1668
 * such as during a yyrestart() or at EOF.
1669
 */
1670
    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
1671
1672
0
{
1673
0
  int oerrno = errno;
1674
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1675
1676
0
  yy_flush_buffer( b , yyscanner);
1677
1678
0
  b->yy_input_file = file;
1679
0
  b->yy_fill_buffer = 1;
1680
1681
    /* If b is the current buffer, then yy_init_buffer was _probably_
1682
     * called from yyrestart() or through yy_get_next_buffer.
1683
     * In that case, we don't want to reset the lineno or column.
1684
     */
1685
0
    if (b != YY_CURRENT_BUFFER){
1686
0
        b->yy_bs_lineno = 1;
1687
0
        b->yy_bs_column = 0;
1688
0
    }
1689
1690
0
        b->yy_is_interactive = 0;
1691
    
1692
0
  errno = oerrno;
1693
0
}
1694
1695
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1696
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1697
 * @param yyscanner The scanner object.
1698
 */
1699
    void yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
1700
0
{
1701
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1702
0
  if ( ! b )
1703
0
    return;
1704
1705
0
  b->yy_n_chars = 0;
1706
1707
  /* We always need two end-of-buffer characters.  The first causes
1708
   * a transition to the end-of-buffer state.  The second causes
1709
   * a jam in that state.
1710
   */
1711
0
  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1712
0
  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1713
1714
0
  b->yy_buf_pos = &b->yy_ch_buf[0];
1715
1716
0
  b->yy_at_bol = 1;
1717
0
  b->yy_buffer_status = YY_BUFFER_NEW;
1718
1719
0
  if ( b == YY_CURRENT_BUFFER )
1720
0
    yy_load_buffer_state( yyscanner );
1721
0
}
1722
1723
/** Pushes the new state onto the stack. The new state becomes
1724
 *  the current state. This function will allocate the stack
1725
 *  if necessary.
1726
 *  @param new_buffer The new state.
1727
 *  @param yyscanner The scanner object.
1728
 */
1729
void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1730
0
{
1731
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1732
0
  if (new_buffer == NULL)
1733
0
    return;
1734
1735
0
  yyensure_buffer_stack(yyscanner);
1736
1737
  /* This block is copied from yy_switch_to_buffer. */
1738
0
  if ( YY_CURRENT_BUFFER )
1739
0
    {
1740
    /* Flush out information for old buffer. */
1741
0
    *yyg->yy_c_buf_p = yyg->yy_hold_char;
1742
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1743
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1744
0
    }
1745
1746
  /* Only push if top exists. Otherwise, replace top. */
1747
0
  if (YY_CURRENT_BUFFER)
1748
0
    yyg->yy_buffer_stack_top++;
1749
0
  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1750
1751
  /* copied from yy_switch_to_buffer. */
1752
0
  yy_load_buffer_state( yyscanner );
1753
0
  yyg->yy_did_buffer_switch_on_eof = 1;
1754
0
}
1755
1756
/** Removes and deletes the top of the stack, if present.
1757
 *  The next element becomes the new top.
1758
 *  @param yyscanner The scanner object.
1759
 */
1760
void yypop_buffer_state (yyscan_t yyscanner)
1761
0
{
1762
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1763
0
  if (!YY_CURRENT_BUFFER)
1764
0
    return;
1765
1766
0
  yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
1767
0
  YY_CURRENT_BUFFER_LVALUE = NULL;
1768
0
  if (yyg->yy_buffer_stack_top > 0)
1769
0
    --yyg->yy_buffer_stack_top;
1770
1771
0
  if (YY_CURRENT_BUFFER) {
1772
0
    yy_load_buffer_state( yyscanner );
1773
0
    yyg->yy_did_buffer_switch_on_eof = 1;
1774
0
  }
1775
0
}
1776
1777
/* Allocates the stack if it does not exist.
1778
 *  Guarantees space for at least one push.
1779
 */
1780
static void yyensure_buffer_stack (yyscan_t yyscanner)
1781
0
{
1782
0
  yy_size_t num_to_alloc;
1783
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1784
1785
0
  if (!yyg->yy_buffer_stack) {
1786
1787
    /* First allocation is just for 2 elements, since we don't know if this
1788
     * scanner will even need a stack. We use 2 instead of 1 to avoid an
1789
     * immediate realloc on the next call.
1790
         */
1791
0
      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1792
0
    yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
1793
0
                (num_to_alloc * sizeof(struct yy_buffer_state*)
1794
0
                , yyscanner);
1795
0
    if ( ! yyg->yy_buffer_stack )
1796
0
      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1797
1798
0
    memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1799
1800
0
    yyg->yy_buffer_stack_max = num_to_alloc;
1801
0
    yyg->yy_buffer_stack_top = 0;
1802
0
    return;
1803
0
  }
1804
1805
0
  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1806
1807
    /* Increase the buffer to prepare for a possible push. */
1808
0
    yy_size_t grow_size = 8 /* arbitrary grow size */;
1809
1810
0
    num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1811
0
    yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
1812
0
                (yyg->yy_buffer_stack,
1813
0
                num_to_alloc * sizeof(struct yy_buffer_state*)
1814
0
                , yyscanner);
1815
0
    if ( ! yyg->yy_buffer_stack )
1816
0
      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1817
1818
    /* zero only the new slots.*/
1819
0
    memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1820
0
    yyg->yy_buffer_stack_max = num_to_alloc;
1821
0
  }
1822
0
}
1823
1824
/** Setup the input buffer state to scan directly from a user-specified character buffer.
1825
 * @param base the character buffer
1826
 * @param size the size in bytes of the character buffer
1827
 * @param yyscanner The scanner object.
1828
 * @return the newly allocated buffer state object.
1829
 */
1830
YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
1831
0
{
1832
0
  YY_BUFFER_STATE b;
1833
    
1834
0
  if ( size < 2 ||
1835
0
       base[size-2] != YY_END_OF_BUFFER_CHAR ||
1836
0
       base[size-1] != YY_END_OF_BUFFER_CHAR )
1837
    /* They forgot to leave room for the EOB's. */
1838
0
    return NULL;
1839
1840
0
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
1841
0
  if ( ! b )
1842
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1843
1844
0
  b->yy_buf_size = (int) (size - 2);  /* "- 2" to take care of EOB's */
1845
0
  b->yy_buf_pos = b->yy_ch_buf = base;
1846
0
  b->yy_is_our_buffer = 0;
1847
0
  b->yy_input_file = NULL;
1848
0
  b->yy_n_chars = b->yy_buf_size;
1849
0
  b->yy_is_interactive = 0;
1850
0
  b->yy_at_bol = 1;
1851
0
  b->yy_fill_buffer = 0;
1852
0
  b->yy_buffer_status = YY_BUFFER_NEW;
1853
1854
0
  yy_switch_to_buffer( b , yyscanner );
1855
1856
0
  return b;
1857
0
}
1858
1859
/** Setup the input buffer state to scan a string. The next call to yylex() will
1860
 * scan from a @e copy of @a str.
1861
 * @param yystr a NUL-terminated string to scan
1862
 * @param yyscanner The scanner object.
1863
 * @return the newly allocated buffer state object.
1864
 * @note If you want to scan bytes that may contain NUL values, then use
1865
 *       yy_scan_bytes() instead.
1866
 */
1867
YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
1868
0
{
1869
    
1870
0
  return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
1871
0
}
1872
1873
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1874
 * scan from a @e copy of @a bytes.
1875
 * @param yybytes the byte buffer to scan
1876
 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1877
 * @param yyscanner The scanner object.
1878
 * @return the newly allocated buffer state object.
1879
 */
1880
YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
1881
0
{
1882
0
  YY_BUFFER_STATE b;
1883
0
  char *buf;
1884
0
  yy_size_t n;
1885
0
  int i;
1886
    
1887
  /* Get memory for full buffer, including space for trailing EOB's. */
1888
0
  n = (yy_size_t) (_yybytes_len + 2);
1889
0
  buf = (char *) yyalloc( n , yyscanner );
1890
0
  if ( ! buf )
1891
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1892
1893
0
  for ( i = 0; i < _yybytes_len; ++i )
1894
0
    buf[i] = yybytes[i];
1895
1896
0
  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1897
1898
0
  b = yy_scan_buffer( buf, n , yyscanner);
1899
0
  if ( ! b )
1900
0
    YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1901
1902
  /* It's okay to grow etc. this buffer, and we should throw it
1903
   * away when we're done.
1904
   */
1905
0
  b->yy_is_our_buffer = 1;
1906
1907
0
  return b;
1908
0
}
1909
1910
#ifndef YY_EXIT_FAILURE
1911
#define YY_EXIT_FAILURE 2
1912
#endif
1913
1914
static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
1915
0
{
1916
0
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1917
0
  (void)yyg;
1918
0
  fprintf( stderr, "%s\n", msg );
1919
0
  exit( YY_EXIT_FAILURE );
1920
0
}
1921
1922
/* Redefine yyless() so it works in section 3 code. */
1923
1924
#undef yyless
1925
#define yyless(n) \
1926
  do \
1927
    { \
1928
    /* Undo effects of setting up yytext. */ \
1929
        int yyless_macro_arg = (n); \
1930
        YY_LESS_LINENO(yyless_macro_arg);\
1931
    yytext[yyleng] = yyg->yy_hold_char; \
1932
    yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1933
    yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1934
    *yyg->yy_c_buf_p = '\0'; \
1935
    yyleng = yyless_macro_arg; \
1936
    } \
1937
  while ( 0 )
1938
1939
/* Accessor  methods (get/set functions) to struct members. */
1940
1941
/** Get the user-defined data for this scanner.
1942
 * @param yyscanner The scanner object.
1943
 */
1944
YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
1945
0
{
1946
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1947
0
    return yyextra;
1948
0
}
1949
1950
/** Get the current line number.
1951
 * @param yyscanner The scanner object.
1952
 */
1953
int yyget_lineno  (yyscan_t yyscanner)
1954
0
{
1955
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1956
1957
0
        if (! YY_CURRENT_BUFFER)
1958
0
            return 0;
1959
    
1960
0
    return yylineno;
1961
0
}
1962
1963
/** Get the current column number.
1964
 * @param yyscanner The scanner object.
1965
 */
1966
int yyget_column  (yyscan_t yyscanner)
1967
0
{
1968
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1969
1970
0
        if (! YY_CURRENT_BUFFER)
1971
0
            return 0;
1972
    
1973
0
    return yycolumn;
1974
0
}
1975
1976
/** Get the input stream.
1977
 * @param yyscanner The scanner object.
1978
 */
1979
FILE *yyget_in  (yyscan_t yyscanner)
1980
0
{
1981
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1982
0
    return yyin;
1983
0
}
1984
1985
/** Get the output stream.
1986
 * @param yyscanner The scanner object.
1987
 */
1988
FILE *yyget_out  (yyscan_t yyscanner)
1989
0
{
1990
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1991
0
    return yyout;
1992
0
}
1993
1994
/** Get the length of the current token.
1995
 * @param yyscanner The scanner object.
1996
 */
1997
int yyget_leng  (yyscan_t yyscanner)
1998
0
{
1999
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2000
0
    return yyleng;
2001
0
}
2002
2003
/** Get the current token.
2004
 * @param yyscanner The scanner object.
2005
 */
2006
2007
char *yyget_text  (yyscan_t yyscanner)
2008
0
{
2009
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2010
0
    return yytext;
2011
0
}
2012
2013
/** Set the user-defined data. This data is never touched by the scanner.
2014
 * @param user_defined The data to be associated with this scanner.
2015
 * @param yyscanner The scanner object.
2016
 */
2017
void yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
2018
0
{
2019
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2020
0
    yyextra = user_defined ;
2021
0
}
2022
2023
/** Set the current line number.
2024
 * @param _line_number line number
2025
 * @param yyscanner The scanner object.
2026
 */
2027
void yyset_lineno (int  _line_number , yyscan_t yyscanner)
2028
0
{
2029
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2030
2031
        /* lineno is only valid if an input buffer exists. */
2032
0
        if (! YY_CURRENT_BUFFER )
2033
0
           YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
2034
    
2035
0
    yylineno = _line_number;
2036
0
}
2037
2038
/** Set the current column.
2039
 * @param _column_no column number
2040
 * @param yyscanner The scanner object.
2041
 */
2042
void yyset_column (int  _column_no , yyscan_t yyscanner)
2043
0
{
2044
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2045
2046
        /* column is only valid if an input buffer exists. */
2047
0
        if (! YY_CURRENT_BUFFER )
2048
0
           YY_FATAL_ERROR( "yyset_column called with no buffer" );
2049
    
2050
0
    yycolumn = _column_no;
2051
0
}
2052
2053
/** Set the input stream. This does not discard the current
2054
 * input buffer.
2055
 * @param _in_str A readable stream.
2056
 * @param yyscanner The scanner object.
2057
 * @see yy_switch_to_buffer
2058
 */
2059
void yyset_in (FILE *  _in_str , yyscan_t yyscanner)
2060
0
{
2061
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2062
0
    yyin = _in_str ;
2063
0
}
2064
2065
void yyset_out (FILE *  _out_str , yyscan_t yyscanner)
2066
0
{
2067
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2068
0
    yyout = _out_str ;
2069
0
}
2070
2071
int yyget_debug  (yyscan_t yyscanner)
2072
0
{
2073
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2074
0
    return yy_flex_debug;
2075
0
}
2076
2077
void yyset_debug (int  _bdebug , yyscan_t yyscanner)
2078
0
{
2079
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2080
0
    yy_flex_debug = _bdebug ;
2081
0
}
2082
2083
/* Accessor methods for yylval and yylloc */
2084
2085
YYSTYPE * yyget_lval  (yyscan_t yyscanner)
2086
0
{
2087
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2088
0
    return yylval;
2089
0
}
2090
2091
void yyset_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
2092
0
{
2093
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2094
0
    yylval = yylval_param;
2095
0
}
2096
2097
/* User-visible API */
2098
2099
/* yylex_init is special because it creates the scanner itself, so it is
2100
 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2101
 * That's why we explicitly handle the declaration, instead of using our macros.
2102
 */
2103
int yylex_init(yyscan_t* ptr_yy_globals)
2104
0
{
2105
0
    if (ptr_yy_globals == NULL){
2106
0
        errno = EINVAL;
2107
0
        return 1;
2108
0
    }
2109
2110
0
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2111
2112
0
    if (*ptr_yy_globals == NULL){
2113
0
        errno = ENOMEM;
2114
0
        return 1;
2115
0
    }
2116
2117
    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2118
0
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2119
2120
0
    return yy_init_globals ( *ptr_yy_globals );
2121
0
}
2122
2123
/* yylex_init_extra has the same functionality as yylex_init, but follows the
2124
 * convention of taking the scanner as the last argument. Note however, that
2125
 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2126
 * is the reason, too, why this function also must handle its own declaration).
2127
 * The user defined value in the first argument will be available to yyalloc in
2128
 * the yyextra field.
2129
 */
2130
int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
2131
0
{
2132
0
    struct yyguts_t dummy_yyguts;
2133
2134
0
    yyset_extra (yy_user_defined, &dummy_yyguts);
2135
2136
0
    if (ptr_yy_globals == NULL){
2137
0
        errno = EINVAL;
2138
0
        return 1;
2139
0
    }
2140
2141
0
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2142
2143
0
    if (*ptr_yy_globals == NULL){
2144
0
        errno = ENOMEM;
2145
0
        return 1;
2146
0
    }
2147
2148
    /* By setting to 0xAA, we expose bugs in
2149
    yy_init_globals. Leave at 0x00 for releases. */
2150
0
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2151
2152
0
    yyset_extra (yy_user_defined, *ptr_yy_globals);
2153
2154
0
    return yy_init_globals ( *ptr_yy_globals );
2155
0
}
2156
2157
static int yy_init_globals (yyscan_t yyscanner)
2158
0
{
2159
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2160
    /* Initialization is the same as for the non-reentrant scanner.
2161
     * This function is called from yylex_destroy(), so don't allocate here.
2162
     */
2163
2164
0
    yyg->yy_buffer_stack = NULL;
2165
0
    yyg->yy_buffer_stack_top = 0;
2166
0
    yyg->yy_buffer_stack_max = 0;
2167
0
    yyg->yy_c_buf_p = NULL;
2168
0
    yyg->yy_init = 0;
2169
0
    yyg->yy_start = 0;
2170
2171
0
    yyg->yy_start_stack_ptr = 0;
2172
0
    yyg->yy_start_stack_depth = 0;
2173
0
    yyg->yy_start_stack =  NULL;
2174
2175
/* Defined in main.c */
2176
#ifdef YY_STDINIT
2177
    yyin = stdin;
2178
    yyout = stdout;
2179
#else
2180
0
    yyin = NULL;
2181
0
    yyout = NULL;
2182
0
#endif
2183
2184
    /* For future reference: Set errno on error, since we are called by
2185
     * yylex_init()
2186
     */
2187
0
    return 0;
2188
0
}
2189
2190
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2191
int yylex_destroy  (yyscan_t yyscanner)
2192
0
{
2193
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2194
2195
    /* Pop the buffer stack, destroying each element. */
2196
0
  while(YY_CURRENT_BUFFER){
2197
0
    yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
2198
0
    YY_CURRENT_BUFFER_LVALUE = NULL;
2199
0
    yypop_buffer_state(yyscanner);
2200
0
  }
2201
2202
  /* Destroy the stack itself. */
2203
0
  yyfree(yyg->yy_buffer_stack , yyscanner);
2204
0
  yyg->yy_buffer_stack = NULL;
2205
2206
    /* Destroy the start condition stack. */
2207
0
        yyfree( yyg->yy_start_stack , yyscanner );
2208
0
        yyg->yy_start_stack = NULL;
2209
2210
    /* Reset the globals. This is important in a non-reentrant scanner so the next time
2211
     * yylex() is called, initialization will occur. */
2212
0
    yy_init_globals( yyscanner);
2213
2214
    /* Destroy the main struct (reentrant only). */
2215
0
    yyfree ( yyscanner , yyscanner );
2216
0
    yyscanner = NULL;
2217
0
    return 0;
2218
0
}
2219
2220
/*
2221
 * Internal utility routines.
2222
 */
2223
2224
#ifndef yytext_ptr
2225
static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
2226
{
2227
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2228
  (void)yyg;
2229
2230
  int i;
2231
  for ( i = 0; i < n; ++i )
2232
    s1[i] = s2[i];
2233
}
2234
#endif
2235
2236
#ifdef YY_NEED_STRLEN
2237
static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
2238
{
2239
  int n;
2240
  for ( n = 0; s[n]; ++n )
2241
    ;
2242
2243
  return n;
2244
}
2245
#endif
2246
2247
#define YYTABLES_NAME "yytables"
2248
2249
#line 96 "event-filter-lexer.l"
2250
2251
2252
#pragma GCC diagnostic pop
2253
2254
void *yyalloc(size_t bytes, void* yyscanner ATTR_UNUSED)
2255
0
{
2256
0
  void *ptr = calloc(1, bytes);
2257
0
  if (ptr == NULL)
2258
0
    i_fatal_status(FATAL_OUTOFMEM, "calloc(1, %zu): Out of memory",
2259
0
             bytes);
2260
0
  return ptr;
2261
0
}
2262
2263
void *yyrealloc (void *ptr, size_t bytes, void *yyscanner ATTR_UNUSED)
2264
0
{
2265
0
  void *nptr = realloc(ptr, bytes);
2266
0
  if (nptr == NULL)
2267
0
    i_fatal_status(FATAL_OUTOFMEM, "realloc(ptr, %zu): Out of memory",
2268
0
             bytes);
2269
0
  return nptr;
2270
0
}
2271
2272
void yyfree(void *ptr, void *yyscanner ATTR_UNUSED)
2273
0
{
2274
0
  if (ptr == NULL)
2275
0
    return;
2276
0
  free(ptr);
2277
0
}
2278
2279
static size_t event_filter_parser_input_proc(char *buf, size_t size, yyscan_t scanner)
2280
0
{
2281
0
  struct event_filter_parser_state *state;
2282
0
  size_t num_bytes;
2283
2284
0
  state = event_filter_parser_get_extra(scanner);
2285
2286
0
  if (state->len == state->pos)
2287
0
    return 0;
2288
2289
0
  i_assert(state->len > state->pos);
2290
2291
0
  num_bytes = I_MIN(state->len - state->pos, size);
2292
0
  memcpy(buf, state->input + state->pos, num_bytes);
2293
0
  state->pos += num_bytes;
2294
2295
0
  return num_bytes;
2296
0
}
2297