Coverage Report

Created: 2026-10-28 06:38

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