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