Coverage Report

Created: 2026-03-15 06:39

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