Coverage Report

Created: 2026-02-09 06:05

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
1.25k
#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
1.25k
#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
3.15k
#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
3.15k
#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
5.04k
#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
1.25k
#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
1.25k
#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
1.89k
#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
1.89k
#define yywrap cmListFileLexer_yywrap
206
#endif
207
208
#ifdef yyalloc
209
#define cmListFileLexer_yyalloc_ALREADY_DEFINED
210
#else
211
5.03k
#define yyalloc cmListFileLexer_yyalloc
212
#endif
213
214
#ifdef yyrealloc
215
#define cmListFileLexer_yyrealloc_ALREADY_DEFINED
216
#else
217
122
#define yyrealloc cmListFileLexer_yyrealloc
218
#endif
219
220
#ifdef yyfree
221
#define cmListFileLexer_yyfree_ALREADY_DEFINED
222
#else
223
6.29k
#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
221M
#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
15.1k
#define yyin yyg->yyin_r
332
5.03k
#define yyout yyg->yyout_r
333
4.98k
#define yyextra yyg->yyextra_r
334
1.79M
#define yyleng yyg->yyleng_r
335
735k
#define yytext yyg->yytext_r
336
240k
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
337
240k
#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
177k
#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
5.27k
#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
16.5k
#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
1.25k
#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
3.66k
#define EOB_ACT_CONTINUE_SCAN 0
385
3.79k
#define EOB_ACT_END_OF_FILE 1
386
2.81k
#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
225k
#define YY_BUFFER_NEW 0
474
1.89k
#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
6.54k
#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
17.6k
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
497
17.6k
                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
498
17.6k
                          : 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
1.00M
#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
1.89k
#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
1.54M
#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
635k
  yyg->yytext_ptr = yy_bp; \
566
635k
  yyleng = (int) (yy_cp - yy_bp); \
567
635k
  yyg->yy_hold_char = *yy_cp; \
568
635k
  *yy_cp = '\0'; \
569
635k
  yyg->yy_c_buf_p = yy_cp;
570
#define YY_NUM_RULES 24
571
1.49M
#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
446k
#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
3.73k
  do { result = cmListFileLexerInput(cmListFileLexer_yyget_extra(yyscanner), buf, max_size); } while (0)
798
799
/*--------------------------------------------------------------------------*/
800
801
118k
#define INITIAL 0
802
3.10k
#define STRING 1
803
47.5k
#define BRACKET 2
804
7.58k
#define BRACKETEND 3
805
1.17k
#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
7.23k
#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
195k
#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
218k
{
1023
218k
  yy_state_type yy_current_state;
1024
218k
  char *yy_cp, *yy_bp;
1025
218k
  int yy_act;
1026
218k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1027
1028
218k
  if ( !yyg->yy_init )
1029
1.25k
    {
1030
1.25k
    yyg->yy_init = 1;
1031
1032
#ifdef YY_USER_INIT
1033
    YY_USER_INIT;
1034
#endif
1035
1036
1.25k
    if ( ! yyg->yy_start )
1037
1.25k
      yyg->yy_start = 1; /* first start state */
1038
1039
1.25k
    if ( ! yyin )
1040
1.25k
      yyin = stdin;
1041
1042
1.25k
    if ( ! yyout )
1043
1.25k
      yyout = stdout;
1044
1045
1.25k
    if ( ! YY_CURRENT_BUFFER ) {
1046
1.25k
      yyensure_buffer_stack (yyscanner);
1047
1.25k
      YY_CURRENT_BUFFER_LVALUE =
1048
1.25k
        yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1049
1.25k
    }
1050
1051
1.25k
    yy_load_buffer_state( yyscanner );
1052
1.25k
    }
1053
1054
218k
  {
1055
1056
414k
  while ( /*CONSTCOND*/1 )    /* loops until end-of-file is reached */
1057
414k
    {
1058
414k
    yy_cp = yyg->yy_c_buf_p;
1059
1060
    /* Support of yytext. */
1061
414k
    *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
414k
    yy_bp = yy_cp;
1067
1068
414k
    yy_current_state = yyg->yy_start;
1069
627k
yy_match:
1070
627k
    do
1071
6.21M
      {
1072
6.21M
      YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1073
6.21M
      if ( yy_accept[yy_current_state] )
1074
4.58M
        {
1075
4.58M
        yyg->yy_last_accepting_state = yy_current_state;
1076
4.58M
        yyg->yy_last_accepting_cpos = yy_cp;
1077
4.58M
        }
1078
11.2M
      while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1079
5.04M
        {
1080
5.04M
        yy_current_state = (int) yy_def[yy_current_state];
1081
5.04M
        if ( yy_current_state >= 77 )
1082
2.74M
          yy_c = yy_meta[yy_c];
1083
5.04M
        }
1084
6.21M
      yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1085
6.21M
      ++yy_cp;
1086
6.21M
      }
1087
6.21M
    while ( yy_base[yy_current_state] != 237 );
1088
1089
635k
yy_find_action:
1090
635k
    yy_act = yy_accept[yy_current_state];
1091
635k
    if ( yy_act == 0 )
1092
338k
      { /* have to back up */
1093
338k
      yy_cp = yyg->yy_last_accepting_cpos;
1094
338k
      yy_current_state = yyg->yy_last_accepting_state;
1095
338k
      yy_act = yy_accept[yy_current_state];
1096
338k
      }
1097
1098
635k
    YY_DO_BEFORE_ACTION;
1099
1100
635k
    if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
1101
241k
      {
1102
241k
      int yyl;
1103
505k
      for ( yyl = 0; yyl < yyleng; ++yyl )
1104
263k
        if ( yytext[yyl] == '\n' )
1105
1106
240k
    do{ yylineno++;
1107
240k
        yycolumn=0;
1108
240k
    }while(0)
1109
241k
;
1110
241k
      }
1111
1112
637k
do_action:  /* This label is used only to access EOF actions. */
1113
1114
637k
    switch ( yy_act )
1115
637k
  { /* 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
113k
case 1:
1124
/* rule 1 can match eol */
1125
113k
YY_RULE_SETUP
1126
113k
{
1127
113k
  lexer->token.type = cmListFileLexer_Token_Newline;
1128
113k
  cmListFileLexerSetToken(lexer, yytext, yyleng);
1129
113k
  ++lexer->line;
1130
113k
  lexer->column = 1;
1131
113k
  BEGIN(INITIAL);
1132
113k
  return 1;
1133
0
}
1134
0
  YY_BREAK
1135
1.64k
case 2:
1136
/* rule 2 can match eol */
1137
1.64k
YY_RULE_SETUP
1138
1.64k
{
1139
1.64k
  const char* bracket = yytext;
1140
1.64k
  size_t length = yyleng;
1141
1.64k
  lexer->comment = yytext[0] == '#';
1142
1.64k
  if (lexer->comment) {
1143
562
    lexer->token.type = cmListFileLexer_Token_CommentBracket;
1144
562
    bracket += 1;
1145
562
    --length;
1146
1.07k
  } else {
1147
1.07k
    lexer->token.type = cmListFileLexer_Token_ArgumentBracket;
1148
1.07k
  }
1149
1.64k
  cmListFileLexerSetToken(lexer, "", 0);
1150
1.64k
  lexer->bracket = (char*)memchr(bracket + 1, '[', length - 1) - bracket;
1151
1.64k
  if (yytext[yyleng-1] == '\n') {
1152
287
    ++lexer->line;
1153
287
    lexer->column = 1;
1154
1.35k
  } else {
1155
1.35k
    lexer->column += yyleng;
1156
1.35k
  }
1157
1.64k
  BEGIN(BRACKET);
1158
1.64k
}
1159
1.64k
  YY_BREAK
1160
1.17k
case 3:
1161
1.17k
YY_RULE_SETUP
1162
1.17k
{
1163
1.17k
  lexer->column += yyleng;
1164
1.17k
  BEGIN(COMMENT);
1165
1.17k
}
1166
1.17k
  YY_BREAK
1167
778
case 4:
1168
778
YY_RULE_SETUP
1169
778
{
1170
778
  if (memchr(yytext, '\0', yyleng) != NULL) {
1171
438
    lexer->token.type = cmListFileLexer_Token_BadCharacter;
1172
438
  }
1173
778
  lexer->column += yyleng;
1174
778
}
1175
778
  YY_BREAK
1176
36.7k
case 5:
1177
36.7k
YY_RULE_SETUP
1178
36.7k
{
1179
36.7k
  lexer->token.type = cmListFileLexer_Token_ParenLeft;
1180
36.7k
  cmListFileLexerSetToken(lexer, yytext, yyleng);
1181
36.7k
  lexer->column += yyleng;
1182
36.7k
  return 1;
1183
0
}
1184
0
  YY_BREAK
1185
2.63k
case 6:
1186
2.63k
YY_RULE_SETUP
1187
2.63k
{
1188
2.63k
  lexer->token.type = cmListFileLexer_Token_ParenRight;
1189
2.63k
  cmListFileLexerSetToken(lexer, yytext, yyleng);
1190
2.63k
  lexer->column += yyleng;
1191
2.63k
  return 1;
1192
0
}
1193
0
  YY_BREAK
1194
11.9k
case 7:
1195
11.9k
YY_RULE_SETUP
1196
11.9k
{
1197
11.9k
  lexer->token.type = cmListFileLexer_Token_Identifier;
1198
11.9k
  cmListFileLexerSetToken(lexer, yytext, yyleng);
1199
11.9k
  lexer->column += yyleng;
1200
11.9k
  return 1;
1201
0
}
1202
0
  YY_BREAK
1203
16.9k
case 8:
1204
16.9k
YY_RULE_SETUP
1205
16.9k
{
1206
  /* Handle ]]====]=======]*/
1207
16.9k
  cmListFileLexerAppend(lexer, yytext, yyleng);
1208
16.9k
  lexer->column += yyleng;
1209
16.9k
  if (yyleng == lexer->bracket) {
1210
7.58k
    BEGIN(BRACKETEND);
1211
7.58k
  }
1212
16.9k
}
1213
16.9k
  YY_BREAK
1214
1.35k
case 9:
1215
1.35k
YY_RULE_SETUP
1216
1.35k
{
1217
1.35k
  lexer->column += yyleng;
1218
  /* Erase the partial bracket from the token.  */
1219
1.35k
  lexer->token.length -= lexer->bracket;
1220
1.35k
  BEGIN(INITIAL);
1221
1.35k
  return 1;
1222
0
}
1223
0
  YY_BREAK
1224
13.0k
case 10:
1225
13.0k
YY_RULE_SETUP
1226
13.0k
{
1227
13.0k
  if (memchr(yytext, '\0', yyleng) != NULL) {
1228
4.73k
    lexer->token.type = cmListFileLexer_Token_BadCharacter;
1229
4.73k
  }
1230
13.0k
  cmListFileLexerAppend(lexer, yytext, yyleng);
1231
13.0k
  lexer->column += yyleng;
1232
13.0k
}
1233
13.0k
  YY_BREAK
1234
39.8k
case 11:
1235
/* rule 11 can match eol */
1236
39.8k
YY_RULE_SETUP
1237
39.8k
{
1238
39.8k
  cmListFileLexerAppend(lexer, yytext, yyleng);
1239
39.8k
  ++lexer->line;
1240
39.8k
  lexer->column = 1;
1241
39.8k
  BEGIN(BRACKET);
1242
39.8k
}
1243
39.8k
  YY_BREAK
1244
6.05k
case 12:
1245
6.05k
YY_RULE_SETUP
1246
6.05k
{
1247
6.05k
  if (memchr(yytext, '\0', yyleng) != NULL) {
1248
3.40k
    lexer->token.type = cmListFileLexer_Token_BadCharacter;
1249
3.40k
  }
1250
6.05k
  cmListFileLexerAppend(lexer, yytext, yyleng);
1251
6.05k
  lexer->column += yyleng;
1252
6.05k
  BEGIN(BRACKET);
1253
6.05k
}
1254
6.05k
  YY_BREAK
1255
268
case YY_STATE_EOF(BRACKET):
1256
284
case YY_STATE_EOF(BRACKETEND):
1257
284
{
1258
284
  lexer->token.type = cmListFileLexer_Token_BadBracket;
1259
284
  BEGIN(INITIAL);
1260
284
  return 1;
1261
268
}
1262
0
  YY_BREAK
1263
21.3k
case 13:
1264
21.3k
YY_RULE_SETUP
1265
21.3k
{
1266
21.3k
  if (memchr(yytext, '\0', yyleng) != NULL) {
1267
    /* An unquoted argument that contains a null character. */
1268
4.43k
    lexer->token.type = cmListFileLexer_Token_BadCharacter;
1269
16.8k
  } else {
1270
16.8k
    lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
1271
16.8k
  }
1272
21.3k
  cmListFileLexerSetToken(lexer, yytext, yyleng);
1273
21.3k
  lexer->column += yyleng;
1274
21.3k
  return 1;
1275
268
}
1276
0
  YY_BREAK
1277
1.90k
case 14:
1278
1.90k
YY_RULE_SETUP
1279
1.90k
{
1280
1.90k
  lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
1281
1.90k
  cmListFileLexerSetToken(lexer, yytext, yyleng);
1282
1.90k
  lexer->column += yyleng;
1283
1.90k
  return 1;
1284
268
}
1285
0
  YY_BREAK
1286
798
case 15:
1287
798
YY_RULE_SETUP
1288
798
{
1289
798
  lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
1290
798
  cmListFileLexerSetToken(lexer, yytext, yyleng);
1291
798
  lexer->column += yyleng;
1292
798
  return 1;
1293
268
}
1294
0
  YY_BREAK
1295
3.10k
case 16:
1296
3.10k
YY_RULE_SETUP
1297
3.10k
{
1298
3.10k
  lexer->token.type = cmListFileLexer_Token_ArgumentQuoted;
1299
3.10k
  cmListFileLexerSetToken(lexer, "", 0);
1300
3.10k
  lexer->column += yyleng;
1301
3.10k
  BEGIN(STRING);
1302
3.10k
}
1303
3.10k
  YY_BREAK
1304
26.5k
case 17:
1305
26.5k
YY_RULE_SETUP
1306
26.5k
{
1307
26.5k
  if (memchr(yytext, '\0', yyleng) != NULL) {
1308
20.5k
    lexer->token.type = cmListFileLexer_Token_BadCharacter;
1309
20.5k
  }
1310
26.5k
  cmListFileLexerAppend(lexer, yytext, yyleng);
1311
26.5k
  lexer->column += yyleng;
1312
26.5k
}
1313
26.5k
  YY_BREAK
1314
2.69k
case 18:
1315
/* rule 18 can match eol */
1316
2.69k
YY_RULE_SETUP
1317
2.69k
{
1318
  /* Continuation: text is not part of string */
1319
2.69k
  ++lexer->line;
1320
2.69k
  lexer->column = 1;
1321
2.69k
}
1322
2.69k
  YY_BREAK
1323
84.0k
case 19:
1324
/* rule 19 can match eol */
1325
84.0k
YY_RULE_SETUP
1326
84.0k
{
1327
84.0k
  cmListFileLexerAppend(lexer, yytext, yyleng);
1328
84.0k
  ++lexer->line;
1329
84.0k
  lexer->column = 1;
1330
84.0k
}
1331
84.0k
  YY_BREAK
1332
2.75k
case 20:
1333
2.75k
YY_RULE_SETUP
1334
2.75k
{
1335
2.75k
  lexer->column += yyleng;
1336
2.75k
  BEGIN(INITIAL);
1337
2.75k
  return 1;
1338
268
}
1339
0
  YY_BREAK
1340
43
case 21:
1341
43
YY_RULE_SETUP
1342
43
{
1343
43
  if (memchr(yytext, '\0', yyleng) != NULL) {
1344
0
    lexer->token.type = cmListFileLexer_Token_BadCharacter;
1345
0
  }
1346
43
  cmListFileLexerAppend(lexer, yytext, yyleng);
1347
43
  lexer->column += yyleng;
1348
43
}
1349
43
  YY_BREAK
1350
353
case YY_STATE_EOF(STRING):
1351
353
{
1352
353
  lexer->token.type = cmListFileLexer_Token_BadString;
1353
353
  BEGIN(INITIAL);
1354
353
  return 1;
1355
268
}
1356
0
  YY_BREAK
1357
15.3k
case 22:
1358
15.3k
YY_RULE_SETUP
1359
15.3k
{
1360
15.3k
  lexer->token.type = cmListFileLexer_Token_Space;
1361
15.3k
  cmListFileLexerSetToken(lexer, yytext, yyleng);
1362
15.3k
  lexer->column += yyleng;
1363
15.3k
  return 1;
1364
268
}
1365
0
  YY_BREAK
1366
8.41k
case 23:
1367
8.41k
YY_RULE_SETUP
1368
8.41k
{
1369
8.41k
  lexer->token.type = cmListFileLexer_Token_BadCharacter;
1370
8.41k
  cmListFileLexerSetToken(lexer, yytext, yyleng);
1371
8.41k
  lexer->column += yyleng;
1372
8.41k
  return 1;
1373
268
}
1374
0
  YY_BREAK
1375
1.21k
case YY_STATE_EOF(INITIAL):
1376
1.25k
case YY_STATE_EOF(COMMENT):
1377
1.25k
{
1378
1.25k
  lexer->token.type = cmListFileLexer_Token_None;
1379
1.25k
  cmListFileLexerSetToken(lexer, 0, 0);
1380
1.25k
  return 0;
1381
1.21k
}
1382
0
  YY_BREAK
1383
0
case 24:
1384
0
YY_RULE_SETUP
1385
0
ECHO;
1386
0
  YY_BREAK
1387
1388
222k
  case YY_END_OF_BUFFER:
1389
222k
    {
1390
    /* Amount of text matched not including the EOB char. */
1391
222k
    int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1392
1393
    /* Undo the effects of YY_DO_BEFORE_ACTION. */
1394
222k
    *yy_cp = yyg->yy_hold_char;
1395
222k
    YY_RESTORE_YY_MORE_OFFSET
1396
1397
222k
    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1398
1.89k
      {
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
1.89k
      yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1409
1.89k
      YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1410
1.89k
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1411
1.89k
      }
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
222k
    if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1421
217k
      { /* This was really a NUL. */
1422
217k
      yy_state_type yy_next_state;
1423
1424
217k
      yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1425
1426
217k
      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
217k
      yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1438
1439
217k
      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1440
1441
217k
      if ( yy_next_state )
1442
211k
        {
1443
        /* Consume the NUL. */
1444
211k
        yy_cp = ++yyg->yy_c_buf_p;
1445
211k
        yy_current_state = yy_next_state;
1446
211k
        goto yy_match;
1447
211k
        }
1448
1449
6.28k
      else
1450
6.28k
        {
1451
6.28k
        yy_cp = yyg->yy_c_buf_p;
1452
6.28k
        goto yy_find_action;
1453
6.28k
        }
1454
217k
      }
1455
1456
5.13k
    else switch ( yy_get_next_buffer( yyscanner ) )
1457
5.13k
      {
1458
1.89k
      case EOB_ACT_END_OF_FILE:
1459
1.89k
        {
1460
1.89k
        yyg->yy_did_buffer_switch_on_eof = 0;
1461
1462
1.89k
        if ( yywrap( yyscanner ) )
1463
1.89k
          {
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
1.89k
          yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1474
1475
1.89k
          yy_act = YY_STATE_EOF(YY_START);
1476
1.89k
          goto do_action;
1477
1.89k
          }
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
1.89k
        }
1486
1487
1.83k
      case EOB_ACT_CONTINUE_SCAN:
1488
1.83k
        yyg->yy_c_buf_p =
1489
1.83k
          yyg->yytext_ptr + yy_amount_of_matched_text;
1490
1491
1.83k
        yy_current_state = yy_get_previous_state( yyscanner );
1492
1493
1.83k
        yy_cp = yyg->yy_c_buf_p;
1494
1.83k
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1495
1.83k
        goto yy_match;
1496
1497
1.40k
      case EOB_ACT_LAST_MATCH:
1498
1.40k
        yyg->yy_c_buf_p =
1499
1.40k
        &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1500
1501
1.40k
        yy_current_state = yy_get_previous_state( yyscanner );
1502
1503
1.40k
        yy_cp = yyg->yy_c_buf_p;
1504
1.40k
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1505
1.40k
        goto yy_find_action;
1506
5.13k
      }
1507
0
    break;
1508
222k
    }
1509
1510
0
  default:
1511
0
    YY_FATAL_ERROR(
1512
637k
      "fatal flex scanner internal error--no action found" );
1513
637k
  } /* end of action switch */
1514
637k
    } /* end of scanning one token */
1515
218k
  } /* end of user's declarations */
1516
218k
} /* 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
5.13k
{
1527
5.13k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1528
5.13k
  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1529
5.13k
  char *source = yyg->yytext_ptr;
1530
5.13k
  int number_to_move, i;
1531
5.13k
  int ret_val;
1532
1533
5.13k
  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1534
0
    YY_FATAL_ERROR(
1535
5.13k
    "fatal flex scanner internal error--end of buffer missed" );
1536
1537
5.13k
  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
5.13k
  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
1560
1561
11.0M
  for ( i = 0; i < number_to_move; ++i )
1562
11.0M
    *(dest++) = *(source++);
1563
1564
5.13k
  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.40k
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1569
1570
3.73k
  else
1571
3.73k
    {
1572
3.73k
      int num_to_read =
1573
3.73k
      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1574
1575
3.85k
    while ( num_to_read <= 0 )
1576
122
      { /* Not enough room in the buffer - grow it. */
1577
1578
      /* just a shorter name for the current buffer */
1579
122
      YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1580
1581
122
      int yy_c_buf_p_offset =
1582
122
        (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1583
1584
122
      if ( b->yy_is_our_buffer )
1585
122
        {
1586
122
        int new_size = b->yy_buf_size * 2;
1587
1588
122
        if ( new_size <= 0 )
1589
0
          b->yy_buf_size += b->yy_buf_size / 8;
1590
122
        else
1591
122
          b->yy_buf_size *= 2;
1592
1593
122
        b->yy_ch_buf = (char *)
1594
          /* Include room in for 2 EOB chars. */
1595
122
          yyrealloc( (void *) b->yy_ch_buf,
1596
122
               (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1597
122
        }
1598
0
      else
1599
        /* Can't grow it, we don't own it. */
1600
0
        b->yy_ch_buf = NULL;
1601
1602
122
      if ( ! b->yy_ch_buf )
1603
0
        YY_FATAL_ERROR(
1604
122
        "fatal error - scanner input buffer overflow" );
1605
1606
122
      yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1607
1608
122
      num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1609
122
            number_to_move - 1;
1610
1611
122
      }
1612
1613
3.73k
    if ( num_to_read > YY_READ_BUF_SIZE )
1614
3.50k
      num_to_read = YY_READ_BUF_SIZE;
1615
1616
    /* Read in more data. */
1617
3.73k
    YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1618
3.73k
      yyg->yy_n_chars, num_to_read );
1619
1620
3.73k
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1621
3.73k
    }
1622
1623
5.13k
  if ( yyg->yy_n_chars == 0 )
1624
3.30k
    {
1625
3.30k
    if ( number_to_move == YY_MORE_ADJ )
1626
1.89k
      {
1627
1.89k
      ret_val = EOB_ACT_END_OF_FILE;
1628
1.89k
      yyrestart( yyin  , yyscanner);
1629
1.89k
      }
1630
1631
1.40k
    else
1632
1.40k
      {
1633
1.40k
      ret_val = EOB_ACT_LAST_MATCH;
1634
1.40k
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1635
1.40k
        YY_BUFFER_EOF_PENDING;
1636
1.40k
      }
1637
3.30k
    }
1638
1639
1.83k
  else
1640
1.83k
    ret_val = EOB_ACT_CONTINUE_SCAN;
1641
1642
5.13k
  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
5.13k
  yyg->yy_n_chars += number_to_move;
1654
5.13k
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1655
5.13k
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1656
1657
5.13k
  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1658
1659
5.13k
  return ret_val;
1660
5.13k
}
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
220k
{
1666
220k
  yy_state_type yy_current_state;
1667
220k
  char *yy_cp;
1668
220k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1669
1670
220k
  yy_current_state = yyg->yy_start;
1671
1672
356M
  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1673
356M
    {
1674
356M
    YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1675
356M
    if ( yy_accept[yy_current_state] )
1676
280M
      {
1677
280M
      yyg->yy_last_accepting_state = yy_current_state;
1678
280M
      yyg->yy_last_accepting_cpos = yy_cp;
1679
280M
      }
1680
617M
    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1681
261M
      {
1682
261M
      yy_current_state = (int) yy_def[yy_current_state];
1683
261M
      if ( yy_current_state >= 77 )
1684
206M
        yy_c = yy_meta[yy_c];
1685
261M
      }
1686
356M
    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1687
356M
    }
1688
1689
220k
  return yy_current_state;
1690
220k
}
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
217k
{
1699
217k
  int yy_is_jam;
1700
217k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1701
217k
  char *yy_cp = yyg->yy_c_buf_p;
1702
1703
217k
  YY_CHAR yy_c = 1;
1704
217k
  if ( yy_accept[yy_current_state] )
1705
161k
    {
1706
161k
    yyg->yy_last_accepting_state = yy_current_state;
1707
161k
    yyg->yy_last_accepting_cpos = yy_cp;
1708
161k
    }
1709
414k
  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1710
197k
    {
1711
197k
    yy_current_state = (int) yy_def[yy_current_state];
1712
197k
    if ( yy_current_state >= 77 )
1713
138k
      yy_c = yy_meta[yy_c];
1714
197k
    }
1715
217k
  yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1716
217k
  yy_is_jam = (yy_current_state == 76);
1717
1718
217k
  (void)yyg;
1719
217k
  return yy_is_jam ? 0 : yy_current_state;
1720
217k
}
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
1.89k
{
1857
1.89k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1858
1859
1.89k
  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
1.89k
  yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
1866
1.89k
  yy_load_buffer_state( yyscanner );
1867
1.89k
}
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
5.04k
{
1907
5.04k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1908
5.04k
  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1909
5.04k
  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1910
5.04k
  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1911
5.04k
  yyg->yy_hold_char = *yyg->yy_c_buf_p;
1912
5.04k
}
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
1.25k
{
1922
1.25k
  YY_BUFFER_STATE b;
1923
1924
1.25k
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
1925
1.25k
  if ( ! b )
1926
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1927
1928
1.25k
  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
1.25k
  b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1934
1.25k
  if ( ! b->yy_ch_buf )
1935
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1936
1937
1.25k
  b->yy_is_our_buffer = 1;
1938
1939
1.25k
  yy_init_buffer( b, file , yyscanner);
1940
1941
1.25k
  return b;
1942
1.25k
}
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
1.25k
{
1950
1.25k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1951
1952
1.25k
  if ( ! b )
1953
0
    return;
1954
1955
1.25k
  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1956
1.25k
    YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1957
1958
1.25k
  if ( b->yy_is_our_buffer )
1959
1.25k
    yyfree( (void *) b->yy_ch_buf , yyscanner );
1960
1961
1.25k
  yyfree( (void *) b , yyscanner );
1962
1.25k
}
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
3.15k
{
1971
3.15k
  int oerrno = errno;
1972
3.15k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1973
1974
3.15k
  yy_flush_buffer( b , yyscanner);
1975
1976
3.15k
  b->yy_input_file = file;
1977
3.15k
  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
3.15k
    if (b != YY_CURRENT_BUFFER){
1984
1.25k
        b->yy_bs_lineno = 1;
1985
1.25k
        b->yy_bs_column = 0;
1986
1.25k
    }
1987
1988
3.15k
        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1989
1990
3.15k
  errno = oerrno;
1991
3.15k
}
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
3.15k
{
1999
3.15k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2000
3.15k
  if ( ! b )
2001
0
    return;
2002
2003
3.15k
  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
3.15k
  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2010
3.15k
  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2011
2012
3.15k
  b->yy_buf_pos = &b->yy_ch_buf[0];
2013
2014
3.15k
  b->yy_at_bol = 1;
2015
3.15k
  b->yy_buffer_status = YY_BUFFER_NEW;
2016
2017
3.15k
  if ( b == YY_CURRENT_BUFFER )
2018
1.89k
    yy_load_buffer_state( yyscanner );
2019
3.15k
}
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
1.25k
{
2060
1.25k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2061
1.25k
  if (!YY_CURRENT_BUFFER)
2062
1.25k
    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
1.25k
{
2080
1.25k
  yy_size_t num_to_alloc;
2081
1.25k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2082
2083
1.25k
  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
1.25k
      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2090
1.25k
    yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
2091
1.25k
                (num_to_alloc * sizeof(struct yy_buffer_state*)
2092
1.25k
                , yyscanner);
2093
1.25k
    if ( ! yyg->yy_buffer_stack )
2094
0
      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2095
2096
1.25k
    memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2097
2098
1.25k
    yyg->yy_buffer_stack_max = num_to_alloc;
2099
1.25k
    yyg->yy_buffer_stack_top = 0;
2100
1.25k
    return;
2101
1.25k
  }
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
3.73k
{
2244
3.73k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2245
3.73k
    return yyextra;
2246
3.73k
}
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
1.25k
{
2317
1.25k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2318
1.25k
    yyextra = user_defined ;
2319
1.25k
}
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
1.25k
{
2391
1.25k
    if (ptr_yy_globals == NULL){
2392
0
        errno = EINVAL;
2393
0
        return 1;
2394
0
    }
2395
2396
1.25k
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2397
2398
1.25k
    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
1.25k
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2405
2406
1.25k
    return yy_init_globals ( *ptr_yy_globals );
2407
1.25k
}
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
2.51k
{
2445
2.51k
    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
2.51k
    yyg->yy_buffer_stack = NULL;
2451
2.51k
    yyg->yy_buffer_stack_top = 0;
2452
2.51k
    yyg->yy_buffer_stack_max = 0;
2453
2.51k
    yyg->yy_c_buf_p = NULL;
2454
2.51k
    yyg->yy_init = 0;
2455
2.51k
    yyg->yy_start = 0;
2456
2457
2.51k
    yyg->yy_start_stack_ptr = 0;
2458
2.51k
    yyg->yy_start_stack_depth = 0;
2459
2.51k
    yyg->yy_start_stack =  NULL;
2460
2461
/* Defined in main.c */
2462
#ifdef YY_STDINIT
2463
    yyin = stdin;
2464
    yyout = stdout;
2465
#else
2466
2.51k
    yyin = NULL;
2467
2.51k
    yyout = NULL;
2468
2.51k
#endif
2469
2470
    /* For future reference: Set errno on error, since we are called by
2471
     * yylex_init()
2472
     */
2473
2.51k
    return 0;
2474
2.51k
}
2475
2476
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2477
int yylex_destroy  (yyscan_t yyscanner)
2478
1.25k
{
2479
1.25k
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2480
2481
    /* Pop the buffer stack, destroying each element. */
2482
2.51k
  while(YY_CURRENT_BUFFER){
2483
1.25k
    yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
2484
1.25k
    YY_CURRENT_BUFFER_LVALUE = NULL;
2485
1.25k
    yypop_buffer_state(yyscanner);
2486
1.25k
  }
2487
2488
  /* Destroy the stack itself. */
2489
1.25k
  yyfree(yyg->yy_buffer_stack , yyscanner);
2490
1.25k
  yyg->yy_buffer_stack = NULL;
2491
2492
    /* Destroy the start condition stack. */
2493
1.25k
        yyfree( yyg->yy_start_stack , yyscanner );
2494
1.25k
        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
1.25k
    yy_init_globals( yyscanner);
2499
2500
    /* Destroy the main struct (reentrant only). */
2501
1.25k
    yyfree ( yyscanner , yyscanner );
2502
1.25k
    yyscanner = NULL;
2503
1.25k
    return 0;
2504
1.25k
}
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
5.03k
{
2535
5.03k
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2536
5.03k
  (void)yyg;
2537
5.03k
  return malloc(size);
2538
5.03k
}
2539
2540
void *yyrealloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
2541
122
{
2542
122
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2543
122
  (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
122
  return realloc(ptr, size);
2553
122
}
2554
2555
void yyfree (void * ptr , yyscan_t yyscanner)
2556
6.29k
{
2557
6.29k
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2558
6.29k
  (void)yyg;
2559
6.29k
  free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2560
6.29k
}
2561
2562
#define YYTABLES_NAME "yytables"
2563
2564
/*--------------------------------------------------------------------------*/
2565
static void cmListFileLexerSetToken(cmListFileLexer* lexer, const char* text,
2566
                                    size_t length)
2567
222k
{
2568
  /* Set the token line and column number.  */
2569
222k
  lexer->token.line = lexer->line;
2570
222k
  lexer->token.column = lexer->column;
2571
2572
  /* Use the same buffer if possible.  */
2573
222k
  if (lexer->token.text) {
2574
216k
    if (text && length < lexer->size) {
2575
184k
      memcpy(lexer->token.text, text, length);
2576
184k
      lexer->token.length = length;
2577
184k
      return;
2578
184k
    }
2579
31.7k
    free(lexer->token.text);
2580
31.7k
    lexer->token.text = 0;
2581
31.7k
    lexer->size = 0;
2582
31.7k
  }
2583
2584
  /* Need to extend the buffer.  */
2585
37.3k
  if (length > 0) {
2586
31.5k
    lexer->token.text = (char*)malloc(length);
2587
31.5k
    memcpy(lexer->token.text, text, length);
2588
31.5k
    lexer->token.length = length;
2589
31.5k
    lexer->size = length;
2590
31.5k
  } else {
2591
5.77k
    lexer->token.length = 0;
2592
5.77k
  }
2593
37.3k
}
2594
2595
/*--------------------------------------------------------------------------*/
2596
static void cmListFileLexerAppend(cmListFileLexer* lexer, const char* text,
2597
                                  size_t length)
2598
186k
{
2599
186k
  char* temp;
2600
186k
  size_t newSize;
2601
2602
  /* If the appended text will fit in the buffer, do not reallocate.  */
2603
186k
  newSize = lexer->token.length + length;
2604
186k
  if (lexer->token.text && newSize <= lexer->size) {
2605
30.8k
    memcpy(lexer->token.text + lexer->token.length, text, length);
2606
30.8k
    lexer->token.length += length;
2607
30.8k
    return;
2608
30.8k
  }
2609
2610
  /* We need to extend the buffer.  */
2611
155k
  temp = malloc(newSize);
2612
155k
  if (lexer->token.text) {
2613
155k
    memcpy(temp, lexer->token.text, lexer->token.length);
2614
155k
    free(lexer->token.text);
2615
155k
  }
2616
155k
  memcpy(temp + lexer->token.length, text, length);
2617
155k
  lexer->token.text = temp;
2618
155k
  lexer->token.length += length;
2619
155k
  lexer->size = newSize;
2620
155k
}
2621
2622
/*--------------------------------------------------------------------------*/
2623
static int cmListFileLexerInput(cmListFileLexer* lexer, char* buffer,
2624
                                size_t bufferSize)
2625
3.73k
{
2626
3.73k
  if (lexer) {
2627
3.73k
    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
3.72k
    } else if (lexer->string_left) {
2673
1.83k
      size_t length = lexer->string_left;
2674
1.83k
      if (bufferSize < length) {
2675
575
        length = bufferSize;
2676
575
      }
2677
1.83k
      memcpy(buffer, lexer->string_position, length);
2678
1.83k
      lexer->string_position += length;
2679
1.83k
      lexer->string_left -= length;
2680
1.83k
      return length;
2681
1.83k
    }
2682
3.73k
  }
2683
1.89k
  return 0;
2684
3.73k
}
2685
2686
/*--------------------------------------------------------------------------*/
2687
static void cmListFileLexerInit(cmListFileLexer* lexer)
2688
3.77k
{
2689
3.77k
  if (lexer->file || lexer->string_buffer) {
2690
1.25k
    cmListFileLexer_yylex_init(&lexer->scanner);
2691
1.25k
    cmListFileLexer_yyset_extra(lexer, lexer->scanner);
2692
1.25k
  }
2693
3.77k
}
2694
2695
/*--------------------------------------------------------------------------*/
2696
static void cmListFileLexerDestroy(cmListFileLexer* lexer)
2697
3.77k
{
2698
3.77k
  cmListFileLexerSetToken(lexer, 0, 0);
2699
3.77k
  if (lexer->file || lexer->string_buffer) {
2700
1.25k
    cmListFileLexer_yylex_destroy(lexer->scanner);
2701
1.25k
    if (lexer->file) {
2702
1
      fclose(lexer->file);
2703
1
      lexer->file = 0;
2704
1
    }
2705
1.25k
    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
1.25k
    if (lexer->string_buffer) {
2711
1.25k
      free(lexer->string_buffer);
2712
1.25k
      lexer->string_buffer = 0;
2713
1.25k
      lexer->string_left = 0;
2714
1.25k
      lexer->string_position = 0;
2715
1.25k
    }
2716
1.25k
  }
2717
3.77k
}
2718
2719
/*--------------------------------------------------------------------------*/
2720
cmListFileLexer* cmListFileLexer_New(void)
2721
1.25k
{
2722
1.25k
  cmListFileLexer* lexer = (cmListFileLexer*)malloc(sizeof(cmListFileLexer));
2723
1.25k
  if (!lexer) {
2724
0
    return 0;
2725
0
  }
2726
1.25k
  memset(lexer, 0, sizeof(*lexer));
2727
1.25k
  lexer->line = 1;
2728
1.25k
  lexer->column = 1;
2729
1.25k
  return lexer;
2730
1.25k
}
2731
2732
/*--------------------------------------------------------------------------*/
2733
void cmListFileLexer_Delete(cmListFileLexer* lexer)
2734
1.25k
{
2735
1.25k
  cmListFileLexer_SetFileName(lexer, 0, 0);
2736
1.25k
  free(lexer);
2737
1.25k
}
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
2.51k
{
2807
2.51k
  int result = 1;
2808
2.51k
  cmListFileLexerDestroy(lexer);
2809
2.51k
  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
2.51k
  cmListFileLexerInit(lexer);
2832
2.51k
  return result;
2833
2.51k
}
2834
2835
/*--------------------------------------------------------------------------*/
2836
int cmListFileLexer_SetString(cmListFileLexer* lexer, char const* text,
2837
                              size_t length)
2838
1.25k
{
2839
1.25k
  int result = 1;
2840
1.25k
  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
1.25k
  size_t read_size = lexer->read_size - lexer->read_position;
2845
1.25k
  size_t string_size = read_size + length;
2846
1.25k
  if (string_size > 0) {
2847
1.25k
    lexer->string_buffer = (char*)malloc(string_size);
2848
1.25k
    if (lexer->string_buffer) {
2849
1.25k
      memcpy(lexer->string_buffer, lexer->read_buffer + lexer->read_position,
2850
1.25k
             read_size);
2851
1.25k
      memcpy(lexer->string_buffer + read_size, text, length);
2852
1.25k
      lexer->read_position += read_size;
2853
1.25k
      lexer->string_position = lexer->string_buffer;
2854
1.25k
      lexer->string_left = length;
2855
1.25k
    } else {
2856
0
      result = 0;
2857
0
    }
2858
1.25k
  }
2859
1.25k
  cmListFileLexerInit(lexer);
2860
1.25k
  return result;
2861
1.25k
}
2862
2863
/*--------------------------------------------------------------------------*/
2864
cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer* lexer)
2865
218k
{
2866
218k
  if (!lexer->file && !lexer->string_buffer) {
2867
0
    return 0;
2868
0
  }
2869
218k
  if (cmListFileLexer_yylex(lexer->scanner, lexer)) {
2870
217k
    return &lexer->token;
2871
217k
  } else {
2872
1.25k
    cmListFileLexer_SetFileName(lexer, 0, 0);
2873
1.25k
    return 0;
2874
1.25k
  }
2875
218k
}
2876
2877
/*--------------------------------------------------------------------------*/
2878
long cmListFileLexer_GetCurrentLine(cmListFileLexer* lexer)
2879
1.25k
{
2880
1.25k
  return lexer->line;
2881
1.25k
}
2882
2883
/*--------------------------------------------------------------------------*/
2884
long cmListFileLexer_GetCurrentColumn(cmListFileLexer* lexer)
2885
1.25k
{
2886
1.25k
  return lexer->column;
2887
1.25k
}
2888
2889
/*--------------------------------------------------------------------------*/
2890
const char* cmListFileLexer_GetTypeAsString(cmListFileLexer* lexer,
2891
                                            cmListFileLexer_Type type)
2892
217k
{
2893
217k
  (void)lexer;
2894
217k
  switch (type) {
2895
0
    case cmListFileLexer_Token_None:
2896
0
      return "nothing";
2897
15.3k
    case cmListFileLexer_Token_Space:
2898
15.3k
      return "space";
2899
113k
    case cmListFileLexer_Token_Newline:
2900
113k
      return "newline";
2901
11.9k
    case cmListFileLexer_Token_Identifier:
2902
11.9k
      return "identifier";
2903
36.7k
    case cmListFileLexer_Token_ParenLeft:
2904
36.7k
      return "left paren";
2905
2.63k
    case cmListFileLexer_Token_ParenRight:
2906
2.63k
      return "right paren";
2907
19.5k
    case cmListFileLexer_Token_ArgumentUnquoted:
2908
19.5k
      return "unquoted argument";
2909
2.10k
    case cmListFileLexer_Token_ArgumentQuoted:
2910
2.10k
      return "quoted argument";
2911
724
    case cmListFileLexer_Token_ArgumentBracket:
2912
724
      return "bracket argument";
2913
462
    case cmListFileLexer_Token_CommentBracket:
2914
462
      return "bracket comment";
2915
13.6k
    case cmListFileLexer_Token_BadCharacter:
2916
13.6k
      return "bad character";
2917
284
    case cmListFileLexer_Token_BadBracket:
2918
284
      return "unterminated bracket";
2919
353
    case cmListFileLexer_Token_BadString:
2920
353
      return "unterminated string";
2921
217k
  }
2922
0
  return "unknown token";
2923
217k
}