1 #line 2 "cmListFileLexer.c"
3 #line 4 "cmListFileLexer.c"
5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 31
13 #if YY_FLEX_SUBMINOR_VERSION > 0
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
25 /* end standard C headers. */
27 /* flex integer type definitions */
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
36 typedef int8_t flex_int8_t;
37 typedef uint8_t flex_uint8_t;
38 typedef int16_t flex_int16_t;
39 typedef uint16_t flex_uint16_t;
40 typedef int32_t flex_int32_t;
41 typedef uint32_t flex_uint32_t;
43 typedef signed char flex_int8_t;
44 typedef short int flex_int16_t;
45 typedef int flex_int32_t;
46 typedef unsigned char flex_uint8_t;
47 typedef unsigned short int flex_uint16_t;
48 typedef unsigned int flex_uint32_t;
51 /* Limits of integral types. */
53 #define INT8_MIN (-128)
56 #define INT16_MIN (-32767-1)
59 #define INT32_MIN (-2147483647-1)
62 #define INT8_MAX (127)
65 #define INT16_MAX (32767)
68 #define INT32_MAX (2147483647)
71 #define UINT8_MAX (255U)
74 #define UINT16_MAX (65535U)
77 #define UINT32_MAX (4294967295U)
80 #endif /* ! FLEXINT_H */
84 /* The "const" storage-class-modifier is valid. */
87 #else /* ! __cplusplus */
94 #endif /* ! __cplusplus */
102 /* Returned upon end-of-file. */
105 /* Promotes a possibly negative, possibly signed char to an unsigned
106 * integer for use as an array index. If the signed char is negative,
107 * we want to instead treat it as an 8-bit unsigned char, hence the
110 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
112 /* An opaque pointer. */
113 #ifndef YY_TYPEDEF_YY_SCANNER_T
114 #define YY_TYPEDEF_YY_SCANNER_T
115 typedef void* yyscan_t;
118 /* For convenience, these vars (plus the bison vars far below)
119 are macros in the reentrant scanner. */
120 #define yyin yyg->yyin_r
121 #define yyout yyg->yyout_r
122 #define yyextra yyg->yyextra_r
123 #define yyleng yyg->yyleng_r
124 #define yytext yyg->yytext_r
125 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
126 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
127 #define yy_flex_debug yyg->yy_flex_debug_r
129 int cmListFileLexer_yylex_init (yyscan_t* scanner);
131 /* Enter a start condition. This macro really ought to take a parameter,
132 * but we do it the disgusting crufty way forced on us by the ()-less
133 * definition of BEGIN.
135 #define BEGIN yyg->yy_start = 1 + 2 *
137 /* Translate the current start state into a value that can be later handed
138 * to BEGIN to return to the state. The YYSTATE alias is for lex
141 #define YY_START ((yyg->yy_start - 1) / 2)
142 #define YYSTATE YY_START
144 /* Action number for EOF rule of a given start state. */
145 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
147 /* Special action meaning "start processing a new file". */
148 #define YY_NEW_FILE cmListFileLexer_yyrestart(yyin ,yyscanner )
150 #define YY_END_OF_BUFFER_CHAR 0
152 /* Size of default input buffer. */
154 #define YY_BUF_SIZE 16384
157 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
158 #define YY_TYPEDEF_YY_BUFFER_STATE
159 typedef struct yy_buffer_state *YY_BUFFER_STATE;
162 #define EOB_ACT_CONTINUE_SCAN 0
163 #define EOB_ACT_END_OF_FILE 1
164 #define EOB_ACT_LAST_MATCH 2
166 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
167 * access to the local variable yy_act. Since yyless() is a macro, it would break
168 * existing scanners that call yyless() from OUTSIDE cmListFileLexer_yylex.
169 * One obvious solution it to make yy_act a global. I tried that, and saw
170 * a 5% performance hit in a non-yylineno scanner, because yy_act is
171 * normally declared as a register variable-- so it is not worth it.
173 #define YY_LESS_LINENO(n) \
176 for ( yyl = n; yyl < yyleng; ++yyl )\
177 if ( yytext[yyl] == '\n' )\
181 /* Return all but the first "n" matched characters back to the input stream. */
185 /* Undo effects of setting up yytext. */ \
186 int yyless_macro_arg = (n); \
187 YY_LESS_LINENO(yyless_macro_arg);\
188 *yy_cp = yyg->yy_hold_char; \
189 YY_RESTORE_YY_MORE_OFFSET \
190 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
191 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
195 /* The following is because we cannot portably get our hands on size_t
196 * (without autoconf's help, which isn't available because we want
197 * flex-generated scanners to compile on their own).
200 #ifndef YY_TYPEDEF_YY_SIZE_T
201 #define YY_TYPEDEF_YY_SIZE_T
202 typedef unsigned int yy_size_t;
205 #ifndef YY_STRUCT_YY_BUFFER_STATE
206 #define YY_STRUCT_YY_BUFFER_STATE
207 struct yy_buffer_state
211 char *yy_ch_buf; /* input buffer */
212 char *yy_buf_pos; /* current position in input buffer */
214 /* Size of input buffer in bytes, not including room for EOB
217 yy_size_t yy_buf_size;
219 /* Number of characters read into yy_ch_buf, not including EOB
224 /* Whether we "own" the buffer - i.e., we know we created it,
225 * and can realloc() it to grow it, and should free() it to
228 int yy_is_our_buffer;
230 /* Whether this is an "interactive" input source; if so, and
231 * if we're using stdio for input, then we want to use getc()
232 * instead of fread(), to make sure we stop fetching input after
235 int yy_is_interactive;
237 /* Whether we're considered to be at the beginning of a line.
238 * If so, '^' rules will be active on the next match, otherwise
243 int yy_bs_lineno; /**< The line count. */
244 int yy_bs_column; /**< The column count. */
246 /* Whether to try to fill the input buffer when we reach the
251 int yy_buffer_status;
253 #define YY_BUFFER_NEW 0
254 #define YY_BUFFER_NORMAL 1
255 /* When an EOF's been seen but there's still some text to process
256 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
257 * shouldn't try reading from the input source any more. We might
258 * still have a bunch of tokens to match, though, because of
259 * possible backing-up.
261 * When we actually see the EOF, we change the status to "new"
262 * (via cmListFileLexer_yyrestart()), so that the user can continue scanning by
263 * just pointing yyin at a new input file.
265 #define YY_BUFFER_EOF_PENDING 2
268 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
270 /* We provide macros for accessing buffer states in case in the
271 * future we want to put the buffer states in a more general
274 * Returns the top of the stack, or NULL.
276 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
277 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
280 /* Same as previous macro, but useful when we know that the buffer stack is not
281 * NULL or when we need an lvalue. For internal use only.
283 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
285 void cmListFileLexer_yyrestart (FILE *input_file ,yyscan_t yyscanner );
286 void cmListFileLexer_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
287 YY_BUFFER_STATE cmListFileLexer_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
288 void cmListFileLexer_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
289 void cmListFileLexer_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
290 void cmListFileLexer_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
291 void cmListFileLexer_yypop_buffer_state (yyscan_t yyscanner );
293 static void cmListFileLexer_yyensure_buffer_stack (yyscan_t yyscanner );
294 static void cmListFileLexer_yy_load_buffer_state (yyscan_t yyscanner );
295 static void cmListFileLexer_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
297 #define YY_FLUSH_BUFFER cmListFileLexer_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
299 YY_BUFFER_STATE cmListFileLexer_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
300 YY_BUFFER_STATE cmListFileLexer_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
301 YY_BUFFER_STATE cmListFileLexer_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
303 void *cmListFileLexer_yyalloc (yy_size_t ,yyscan_t yyscanner );
304 void *cmListFileLexer_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
305 void cmListFileLexer_yyfree (void * ,yyscan_t yyscanner );
307 #define yy_new_buffer cmListFileLexer_yy_create_buffer
309 #define yy_set_interactive(is_interactive) \
311 if ( ! YY_CURRENT_BUFFER ){ \
312 cmListFileLexer_yyensure_buffer_stack (yyscanner); \
313 YY_CURRENT_BUFFER_LVALUE = \
314 cmListFileLexer_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
316 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
319 #define yy_set_bol(at_bol) \
321 if ( ! YY_CURRENT_BUFFER ){\
322 cmListFileLexer_yyensure_buffer_stack (yyscanner); \
323 YY_CURRENT_BUFFER_LVALUE = \
324 cmListFileLexer_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
326 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
329 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
331 /* Begin user sect3 */
333 #define cmListFileLexer_yywrap(n) 1
334 #define YY_SKIP_YYWRAP
336 typedef unsigned char YY_CHAR;
338 typedef int yy_state_type;
340 #define yytext_ptr yytext_r
342 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
343 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
344 static int yy_get_next_buffer (yyscan_t yyscanner );
345 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
347 /* Done after the current pattern has been matched and before the
348 * corresponding action - sets up yytext.
350 #define YY_DO_BEFORE_ACTION \
351 yyg->yytext_ptr = yy_bp; \
352 yyleng = (size_t) (yy_cp - yy_bp); \
353 yyg->yy_hold_char = *yy_cp; \
355 yyg->yy_c_buf_p = yy_cp;
357 #define YY_NUM_RULES 14
358 #define YY_END_OF_BUFFER 15
359 /* This struct is not used in this scanner,
360 but its presence is necessary. */
363 flex_int32_t yy_verify;
366 static yyconst flex_int16_t yy_accept[39] =
368 0, 0, 0, 0, 15, 6, 12, 1, 7, 2,
369 6, 3, 4, 6, 13, 8, 9, 10, 11, 6,
370 0, 6, 0, 2, 0, 5, 6, 8, 0, 0,
371 0, 0, 0, 0, 0, 0, 0, 0
374 static yyconst flex_int32_t yy_ec[256] =
376 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
377 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
378 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379 1, 2, 1, 5, 6, 7, 1, 1, 1, 8,
380 9, 1, 1, 1, 1, 1, 1, 10, 10, 10,
381 10, 10, 10, 10, 10, 10, 10, 1, 1, 1,
382 1, 1, 1, 1, 11, 11, 11, 11, 11, 11,
383 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
384 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
385 1, 12, 1, 1, 11, 1, 11, 11, 11, 11,
387 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
388 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
389 11, 11, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 static yyconst flex_int32_t yy_meta[13] =
408 1, 1, 2, 1, 3, 1, 1, 1, 4, 4,
412 static yyconst flex_int16_t yy_base[48] =
414 0, 0, 10, 20, 34, 32, 89, 89, 89, 0,
415 23, 89, 89, 35, 0, 18, 89, 89, 44, 0,
416 49, 21, 0, 0, 19, 0, 0, 15, 59, 0,
417 18, 0, 15, 12, 11, 10, 9, 89, 64, 68,
418 72, 76, 80, 13, 84, 12, 10
421 static yyconst flex_int16_t yy_def[48] =
423 38, 1, 39, 39, 38, 38, 38, 38, 38, 40,
424 6, 38, 38, 6, 41, 42, 38, 38, 42, 6,
425 38, 6, 43, 40, 44, 14, 6, 42, 42, 21,
426 21, 45, 46, 44, 47, 46, 47, 0, 38, 38,
427 38, 38, 38, 38, 38, 38, 38
430 static yyconst flex_int16_t yy_nxt[102] =
432 6, 7, 8, 7, 9, 10, 11, 12, 13, 6,
433 14, 15, 17, 37, 18, 36, 34, 30, 20, 30,
434 27, 19, 17, 20, 18, 35, 29, 27, 33, 29,
435 25, 19, 20, 38, 38, 38, 21, 38, 22, 38,
436 38, 20, 20, 23, 26, 26, 28, 38, 28, 30,
437 30, 38, 38, 20, 38, 31, 38, 38, 30, 30,
438 32, 28, 38, 28, 16, 16, 16, 16, 24, 38,
439 24, 24, 27, 38, 27, 27, 28, 38, 38, 28,
440 20, 38, 20, 20, 30, 38, 30, 30, 5, 38,
441 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
446 static yyconst flex_int16_t yy_chk[102] =
448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449 1, 1, 3, 47, 3, 46, 44, 37, 36, 35,
450 34, 3, 4, 33, 4, 31, 28, 25, 22, 16,
451 11, 4, 6, 5, 0, 0, 6, 0, 6, 0,
452 0, 6, 6, 6, 14, 14, 19, 0, 19, 21,
453 21, 0, 0, 21, 0, 21, 0, 0, 21, 21,
454 21, 29, 0, 29, 39, 39, 39, 39, 40, 0,
455 40, 40, 41, 0, 41, 41, 42, 0, 0, 42,
456 43, 0, 43, 43, 45, 0, 45, 45, 38, 38,
457 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
462 /* Table of booleans, true if rule could match eol. */
463 static yyconst flex_int32_t yy_rule_can_match_eol[15] =
465 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, };
467 /* The intent behind this definition is that it'll catch
468 * any uses of REJECT which flex missed.
470 #define REJECT reject_used_but_not_detected
471 #define yymore() yymore_used_but_not_detected
472 #define YY_MORE_ADJ 0
473 #define YY_RESTORE_YY_MORE_OFFSET
474 #line 1 "cmListFileLexer.in.l"
475 #line 2 "cmListFileLexer.in.l"
476 /*============================================================================
477 CMake - Cross Platform Makefile Generator
478 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
480 Distributed under the OSI-approved BSD License (the "License");
481 see accompanying file Copyright.txt for details.
483 This software is distributed WITHOUT ANY WARRANTY; without even the
484 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
485 See the License for more information.
486 ============================================================================*/
489 This file must be translated to C and modified to build everywhere.
493 flex --prefix=cmListFileLexer_yy -ocmListFileLexer.c cmListFileLexer.in.l
495 Modify cmListFileLexer.c:
497 - remove the yyunput function
498 - add a statement "(void)yyscanner;" to the top of these methods:
499 yy_fatal_error, cmListFileLexer_yyalloc, cmListFileLexer_yyrealloc, cmListFileLexer_yyfree
500 - remove all YY_BREAK lines occurring right after return statements
501 - remove the isatty forward declaration
505 #include "cmStandardLexer.h"
507 /* Setup the proper cmListFileLexer_yylex declaration. */
508 #define YY_EXTRA_TYPE cmListFileLexer*
509 #define YY_DECL int cmListFileLexer_yylex (yyscan_t yyscanner, cmListFileLexer* lexer)
511 #include "cmListFileLexer.h"
513 /*--------------------------------------------------------------------------*/
514 struct cmListFileLexer_s
516 cmListFileLexer_Token token;
522 char* string_position;
527 static void cmListFileLexerSetToken(cmListFileLexer* lexer, const char* text,
529 static void cmListFileLexerAppend(cmListFileLexer* lexer, const char* text,
531 static int cmListFileLexerInput(cmListFileLexer* lexer, char* buffer,
533 static void cmListFileLexerInit(cmListFileLexer* lexer);
534 static void cmListFileLexerDestroy(cmListFileLexer* lexer);
536 /* Replace the lexer input function. */
538 #define YY_INPUT(buf, result, max_size) \
539 { result = cmListFileLexerInput(cmListFileLexer_yyget_extra(yyscanner), buf, max_size); }
541 /*--------------------------------------------------------------------------*/
543 #line 568 "cmListFileLexer.c"
548 #ifndef YY_NO_UNISTD_H
549 /* Special case for "unistd.h", since it is non-ANSI. We include it way
550 * down here because we want the user's section 1 to have been scanned first.
551 * The user has a chance to override it with an option.
556 #ifndef YY_EXTRA_TYPE
557 #define YY_EXTRA_TYPE void *
560 /* Holds the entire state of the reentrant scanner. */
564 /* User-defined. Not touched by flex. */
565 YY_EXTRA_TYPE yyextra_r;
567 /* The rest are the same as the globals declared in the non-reentrant scanner. */
568 FILE *yyin_r, *yyout_r;
569 size_t yy_buffer_stack_top; /**< index of top of stack. */
570 size_t yy_buffer_stack_max; /**< capacity of stack. */
571 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
578 int yy_did_buffer_switch_on_eof;
579 int yy_start_stack_ptr;
580 int yy_start_stack_depth;
582 yy_state_type yy_last_accepting_state;
583 char* yy_last_accepting_cpos;
592 }; /* end struct yyguts_t */
594 /* Accessor methods to globals.
595 These are made visible to non-reentrant scanners for convenience. */
597 int cmListFileLexer_yylex_destroy (yyscan_t yyscanner );
599 int cmListFileLexer_yyget_debug (yyscan_t yyscanner );
601 void cmListFileLexer_yyset_debug (int debug_flag ,yyscan_t yyscanner );
603 YY_EXTRA_TYPE cmListFileLexer_yyget_extra (yyscan_t yyscanner );
605 void cmListFileLexer_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
607 FILE *cmListFileLexer_yyget_in (yyscan_t yyscanner );
609 void cmListFileLexer_yyset_in (FILE * in_str ,yyscan_t yyscanner );
611 FILE *cmListFileLexer_yyget_out (yyscan_t yyscanner );
613 void cmListFileLexer_yyset_out (FILE * out_str ,yyscan_t yyscanner );
615 int cmListFileLexer_yyget_leng (yyscan_t yyscanner );
617 char *cmListFileLexer_yyget_text (yyscan_t yyscanner );
619 int cmListFileLexer_yyget_lineno (yyscan_t yyscanner );
621 void cmListFileLexer_yyset_lineno (int line_number ,yyscan_t yyscanner );
623 /* Macros after this point can all be overridden by user definitions in
627 #ifndef YY_SKIP_YYWRAP
629 extern "C" int cmListFileLexer_yywrap (yyscan_t yyscanner );
631 extern int cmListFileLexer_yywrap (yyscan_t yyscanner );
636 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
639 #ifdef YY_NEED_STRLEN
640 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
646 static int yyinput (yyscan_t yyscanner );
648 static int input (yyscan_t yyscanner );
653 /* Amount of stuff to slurp up with each read. */
654 #ifndef YY_READ_BUF_SIZE
655 #define YY_READ_BUF_SIZE 8192
658 /* Copy whatever the last rule matched to the standard output. */
660 /* This used to be an fputs(), but since the string might contain NUL's,
661 * we now use fwrite().
663 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
666 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
667 * is returned in "result".
670 #define YY_INPUT(buf,result,max_size) \
671 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
675 for ( n = 0; n < max_size && \
676 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
679 buf[n++] = (char) c; \
680 if ( c == EOF && ferror( yyin ) ) \
681 YY_FATAL_ERROR( "input in flex scanner failed" ); \
687 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
689 if( errno != EINTR) \
691 YY_FATAL_ERROR( "input in flex scanner failed" ); \
702 /* No semi-colon after return; correct usage is to write "yyterminate();" -
703 * we don't want an extra ';' after the "return" because that will cause
704 * some compilers to complain about unreachable statements.
707 #define yyterminate() return YY_NULL
710 /* Number of entries by which start-condition stack grows. */
711 #ifndef YY_START_STACK_INCR
712 #define YY_START_STACK_INCR 25
715 /* Report a fatal error. */
716 #ifndef YY_FATAL_ERROR
717 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
720 /* end tables serialization structures and prototypes */
722 /* Default declaration of generated scanner - a define so the user can
723 * easily add parameters.
726 #define YY_DECL_IS_OURS 1
728 extern int cmListFileLexer_yylex (yyscan_t yyscanner);
730 #define YY_DECL int cmListFileLexer_yylex (yyscan_t yyscanner)
731 #endif /* !YY_DECL */
733 /* Code executed at the beginning of each rule, after yytext and yyleng
736 #ifndef YY_USER_ACTION
737 #define YY_USER_ACTION
740 /* Code executed at the end of each rule. */
742 #define YY_BREAK break;
745 #define YY_RULE_SETUP \
748 /** The main scanner function which does all the work.
752 register yy_state_type yy_current_state;
753 register char *yy_cp, *yy_bp;
755 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
757 #line 100 "cmListFileLexer.in.l"
760 #line 787 "cmListFileLexer.c"
770 if ( ! yyg->yy_start )
771 yyg->yy_start = 1; /* first start state */
779 if ( ! YY_CURRENT_BUFFER ) {
780 cmListFileLexer_yyensure_buffer_stack (yyscanner);
781 YY_CURRENT_BUFFER_LVALUE =
782 cmListFileLexer_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
785 cmListFileLexer_yy_load_buffer_state(yyscanner );
788 while ( 1 ) /* loops until end-of-file is reached */
790 yy_cp = yyg->yy_c_buf_p;
792 /* Support of yytext. */
793 *yy_cp = yyg->yy_hold_char;
795 /* yy_bp points to the position in yy_ch_buf of the start of
800 yy_current_state = yyg->yy_start;
804 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
805 if ( yy_accept[yy_current_state] )
807 yyg->yy_last_accepting_state = yy_current_state;
808 yyg->yy_last_accepting_cpos = yy_cp;
810 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
812 yy_current_state = (int) yy_def[yy_current_state];
813 if ( yy_current_state >= 39 )
814 yy_c = yy_meta[(unsigned int) yy_c];
816 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
819 while ( yy_base[yy_current_state] != 89 );
822 yy_act = yy_accept[yy_current_state];
824 { /* have to back up */
825 yy_cp = yyg->yy_last_accepting_cpos;
826 yy_current_state = yyg->yy_last_accepting_state;
827 yy_act = yy_accept[yy_current_state];
832 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
835 for ( yyl = 0; yyl < yyleng; ++yyl )
836 if ( yytext[yyl] == '\n' )
844 do_action: /* This label is used only to access EOF actions. */
847 { /* beginning of action switch */
848 case 0: /* must back up */
849 /* undo the effects of YY_DO_BEFORE_ACTION */
850 *yy_cp = yyg->yy_hold_char;
851 yy_cp = yyg->yy_last_accepting_cpos;
852 yy_current_state = yyg->yy_last_accepting_state;
856 /* rule 1 can match eol */
858 #line 102 "cmListFileLexer.in.l"
860 lexer->token.type = cmListFileLexer_Token_Newline;
861 cmListFileLexerSetToken(lexer, yytext, yyleng);
868 #line 110 "cmListFileLexer.in.l"
870 lexer->column += yyleng;
875 #line 114 "cmListFileLexer.in.l"
877 lexer->token.type = cmListFileLexer_Token_ParenLeft;
878 cmListFileLexerSetToken(lexer, yytext, yyleng);
879 lexer->column += yyleng;
884 #line 121 "cmListFileLexer.in.l"
886 lexer->token.type = cmListFileLexer_Token_ParenRight;
887 cmListFileLexerSetToken(lexer, yytext, yyleng);
888 lexer->column += yyleng;
893 #line 128 "cmListFileLexer.in.l"
895 lexer->token.type = cmListFileLexer_Token_Identifier;
896 cmListFileLexerSetToken(lexer, yytext, yyleng);
897 lexer->column += yyleng;
902 #line 135 "cmListFileLexer.in.l"
904 lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
905 cmListFileLexerSetToken(lexer, yytext, yyleng);
906 lexer->column += yyleng;
911 #line 142 "cmListFileLexer.in.l"
913 lexer->token.type = cmListFileLexer_Token_ArgumentQuoted;
914 cmListFileLexerSetToken(lexer, "", 0);
915 lexer->column += yyleng;
920 /* rule 8 can match eol */
922 #line 149 "cmListFileLexer.in.l"
924 cmListFileLexerAppend(lexer, yytext, yyleng);
925 lexer->column += yyleng;
929 /* rule 9 can match eol */
931 #line 154 "cmListFileLexer.in.l"
933 cmListFileLexerAppend(lexer, yytext, yyleng);
940 #line 160 "cmListFileLexer.in.l"
942 lexer->column += yyleng;
948 #line 166 "cmListFileLexer.in.l"
950 cmListFileLexerAppend(lexer, yytext, yyleng);
951 lexer->column += yyleng;
954 case YY_STATE_EOF(STRING):
955 #line 171 "cmListFileLexer.in.l"
957 lexer->token.type = cmListFileLexer_Token_BadString;
963 #line 177 "cmListFileLexer.in.l"
965 lexer->column += yyleng;
970 #line 181 "cmListFileLexer.in.l"
972 lexer->token.type = cmListFileLexer_Token_BadCharacter;
973 cmListFileLexerSetToken(lexer, yytext, yyleng);
974 lexer->column += yyleng;
977 case YY_STATE_EOF(INITIAL):
978 #line 188 "cmListFileLexer.in.l"
980 lexer->token.type = cmListFileLexer_Token_None;
981 cmListFileLexerSetToken(lexer, 0, 0);
986 #line 194 "cmListFileLexer.in.l"
989 #line 1025 "cmListFileLexer.c"
991 case YY_END_OF_BUFFER:
993 /* Amount of text matched not including the EOB char. */
994 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
996 /* Undo the effects of YY_DO_BEFORE_ACTION. */
997 *yy_cp = yyg->yy_hold_char;
998 YY_RESTORE_YY_MORE_OFFSET
1000 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1002 /* We're scanning a new file or input source. It's
1003 * possible that this happened because the user
1004 * just pointed yyin at a new source and called
1005 * cmListFileLexer_yylex(). If so, then we have to assure
1006 * consistency between YY_CURRENT_BUFFER and our
1007 * globals. Here is the right place to do so, because
1008 * this is the first action (other than possibly a
1009 * back-up) that will match for the new input source.
1011 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1012 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1013 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1016 /* Note that here we test for yy_c_buf_p "<=" to the position
1017 * of the first EOB in the buffer, since yy_c_buf_p will
1018 * already have been incremented past the NUL character
1019 * (since all states make transitions on EOB to the
1020 * end-of-buffer state). Contrast this with the test
1023 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1024 { /* This was really a NUL. */
1025 yy_state_type yy_next_state;
1027 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1029 yy_current_state = yy_get_previous_state( yyscanner );
1031 /* Okay, we're now positioned to make the NUL
1032 * transition. We couldn't have
1033 * yy_get_previous_state() go ahead and do it
1034 * for us because it doesn't know how to deal
1035 * with the possibility of jamming (and we don't
1036 * want to build jamming into it because then it
1037 * will run more slowly).
1040 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1042 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1044 if ( yy_next_state )
1046 /* Consume the NUL. */
1047 yy_cp = ++yyg->yy_c_buf_p;
1048 yy_current_state = yy_next_state;
1054 yy_cp = yyg->yy_c_buf_p;
1055 goto yy_find_action;
1059 else switch ( yy_get_next_buffer( yyscanner ) )
1061 case EOB_ACT_END_OF_FILE:
1063 yyg->yy_did_buffer_switch_on_eof = 0;
1065 if ( cmListFileLexer_yywrap(yyscanner ) )
1067 /* Note: because we've taken care in
1068 * yy_get_next_buffer() to have set up
1069 * yytext, we can now set up
1070 * yy_c_buf_p so that if some total
1071 * hoser (like flex itself) wants to
1072 * call the scanner after we return the
1073 * YY_NULL, it'll still work - another
1074 * YY_NULL will get returned.
1076 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1078 yy_act = YY_STATE_EOF(YY_START);
1084 if ( ! yyg->yy_did_buffer_switch_on_eof )
1090 case EOB_ACT_CONTINUE_SCAN:
1092 yyg->yytext_ptr + yy_amount_of_matched_text;
1094 yy_current_state = yy_get_previous_state( yyscanner );
1096 yy_cp = yyg->yy_c_buf_p;
1097 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1100 case EOB_ACT_LAST_MATCH:
1102 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1104 yy_current_state = yy_get_previous_state( yyscanner );
1106 yy_cp = yyg->yy_c_buf_p;
1107 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1108 goto yy_find_action;
1115 "fatal flex scanner internal error--no action found" );
1116 } /* end of action switch */
1117 } /* end of scanning one token */
1118 } /* end of cmListFileLexer_yylex */
1120 /* yy_get_next_buffer - try to read in a new buffer
1122 * Returns a code representing an action:
1123 * EOB_ACT_LAST_MATCH -
1124 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1125 * EOB_ACT_END_OF_FILE - end of file
1127 static int yy_get_next_buffer (yyscan_t yyscanner)
1129 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1130 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1131 register char *source = yyg->yytext_ptr;
1132 register int number_to_move, i;
1135 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1137 "fatal flex scanner internal error--end of buffer missed" );
1139 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1140 { /* Don't try to fill the buffer, so this is an EOF. */
1141 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1143 /* We matched a single character, the EOB, so
1144 * treat this as a final EOF.
1146 return EOB_ACT_END_OF_FILE;
1151 /* We matched some text prior to the EOB, first
1154 return EOB_ACT_LAST_MATCH;
1158 /* Try to read more data. */
1160 /* First move last chars to start of buffer. */
1161 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1163 for ( i = 0; i < number_to_move; ++i )
1164 *(dest++) = *(source++);
1166 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1167 /* don't do the read, it's not guaranteed to return an EOF,
1170 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1174 size_t num_to_read =
1175 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1177 while ( num_to_read <= 0 )
1178 { /* Not enough room in the buffer - grow it. */
1180 /* just a shorter name for the current buffer */
1181 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1183 int yy_c_buf_p_offset =
1184 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1186 if ( b->yy_is_our_buffer )
1188 int new_size = b->yy_buf_size * 2;
1190 if ( new_size <= 0 )
1191 b->yy_buf_size += b->yy_buf_size / 8;
1193 b->yy_buf_size *= 2;
1195 b->yy_ch_buf = (char *)
1196 /* Include room in for 2 EOB chars. */
1197 cmListFileLexer_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1200 /* Can't grow it, we don't own it. */
1203 if ( ! b->yy_ch_buf )
1205 "fatal error - scanner input buffer overflow" );
1207 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1209 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1214 if ( num_to_read > YY_READ_BUF_SIZE )
1215 num_to_read = YY_READ_BUF_SIZE;
1217 /* Read in more data. */
1218 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1219 yyg->yy_n_chars, num_to_read );
1221 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1224 if ( yyg->yy_n_chars == 0 )
1226 if ( number_to_move == YY_MORE_ADJ )
1228 ret_val = EOB_ACT_END_OF_FILE;
1229 cmListFileLexer_yyrestart(yyin ,yyscanner);
1234 ret_val = EOB_ACT_LAST_MATCH;
1235 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1236 YY_BUFFER_EOF_PENDING;
1241 ret_val = EOB_ACT_CONTINUE_SCAN;
1243 yyg->yy_n_chars += number_to_move;
1244 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1245 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1247 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1252 /* yy_get_previous_state - get the state just before the EOB char was reached */
1254 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1256 register yy_state_type yy_current_state;
1257 register char *yy_cp;
1258 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1260 yy_current_state = yyg->yy_start;
1262 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1264 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1265 if ( yy_accept[yy_current_state] )
1267 yyg->yy_last_accepting_state = yy_current_state;
1268 yyg->yy_last_accepting_cpos = yy_cp;
1270 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1272 yy_current_state = (int) yy_def[yy_current_state];
1273 if ( yy_current_state >= 39 )
1274 yy_c = yy_meta[(unsigned int) yy_c];
1276 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1279 return yy_current_state;
1282 /* yy_try_NUL_trans - try to make a transition on the NUL character
1285 * next_state = yy_try_NUL_trans( current_state );
1287 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1289 register int yy_is_jam;
1290 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1291 register char *yy_cp = yyg->yy_c_buf_p;
1293 register YY_CHAR yy_c = 1;
1294 if ( yy_accept[yy_current_state] )
1296 yyg->yy_last_accepting_state = yy_current_state;
1297 yyg->yy_last_accepting_cpos = yy_cp;
1299 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1301 yy_current_state = (int) yy_def[yy_current_state];
1302 if ( yy_current_state >= 39 )
1303 yy_c = yy_meta[(unsigned int) yy_c];
1305 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1306 yy_is_jam = (yy_current_state == 38);
1308 return yy_is_jam ? 0 : yy_current_state;
1313 static int yyinput (yyscan_t yyscanner)
1315 static int input (yyscan_t yyscanner)
1320 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1322 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1324 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1326 /* yy_c_buf_p now points to the character we want to return.
1327 * If this occurs *before* the EOB characters, then it's a
1328 * valid NUL; if not, then we've hit the end of the buffer.
1330 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1331 /* This was really a NUL. */
1332 *yyg->yy_c_buf_p = '\0';
1335 { /* need more input */
1336 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1339 switch ( yy_get_next_buffer( yyscanner ) )
1341 case EOB_ACT_LAST_MATCH:
1342 /* This happens because yy_g_n_b()
1343 * sees that we've accumulated a
1344 * token and flags that we need to
1345 * try matching the token before
1346 * proceeding. But for input(),
1347 * there's no matching to consider.
1348 * So convert the EOB_ACT_LAST_MATCH
1349 * to EOB_ACT_END_OF_FILE.
1352 /* Reset buffer status. */
1353 cmListFileLexer_yyrestart(yyin ,yyscanner);
1357 case EOB_ACT_END_OF_FILE:
1359 if ( cmListFileLexer_yywrap(yyscanner ) )
1362 if ( ! yyg->yy_did_buffer_switch_on_eof )
1365 return yyinput(yyscanner);
1367 return input(yyscanner);
1371 case EOB_ACT_CONTINUE_SCAN:
1372 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1378 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1379 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1380 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1391 #endif /* ifndef YY_NO_INPUT */
1393 /** Immediately switch to a different input stream.
1394 * @param input_file A readable stream.
1395 * @param yyscanner The scanner object.
1396 * @note This function does not reset the start condition to @c INITIAL .
1398 void cmListFileLexer_yyrestart (FILE * input_file , yyscan_t yyscanner)
1400 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1402 if ( ! YY_CURRENT_BUFFER ){
1403 cmListFileLexer_yyensure_buffer_stack (yyscanner);
1404 YY_CURRENT_BUFFER_LVALUE =
1405 cmListFileLexer_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1408 cmListFileLexer_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1409 cmListFileLexer_yy_load_buffer_state(yyscanner );
1412 /** Switch to a different input buffer.
1413 * @param new_buffer The new input buffer.
1414 * @param yyscanner The scanner object.
1416 void cmListFileLexer_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1418 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1420 /* TODO. We should be able to replace this entire function body
1422 * cmListFileLexer_yypop_buffer_state();
1423 * cmListFileLexer_yypush_buffer_state(new_buffer);
1425 cmListFileLexer_yyensure_buffer_stack (yyscanner);
1426 if ( YY_CURRENT_BUFFER == new_buffer )
1429 if ( YY_CURRENT_BUFFER )
1431 /* Flush out information for old buffer. */
1432 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1433 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1434 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1437 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1438 cmListFileLexer_yy_load_buffer_state(yyscanner );
1440 /* We don't actually know whether we did this switch during
1441 * EOF (cmListFileLexer_yywrap()) processing, but the only time this flag
1442 * is looked at is after cmListFileLexer_yywrap() is called, so it's safe
1443 * to go ahead and always set it.
1445 yyg->yy_did_buffer_switch_on_eof = 1;
1448 static void cmListFileLexer_yy_load_buffer_state (yyscan_t yyscanner)
1450 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1451 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1452 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1453 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1454 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1457 /** Allocate and initialize an input buffer state.
1458 * @param file A readable stream.
1459 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1460 * @param yyscanner The scanner object.
1461 * @return the allocated buffer state.
1463 YY_BUFFER_STATE cmListFileLexer_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1467 b = (YY_BUFFER_STATE) cmListFileLexer_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1469 YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_create_buffer()" );
1471 b->yy_buf_size = size;
1473 /* yy_ch_buf has to be 2 characters longer than the size given because
1474 * we need to put in 2 end-of-buffer characters.
1476 b->yy_ch_buf = (char *) cmListFileLexer_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1477 if ( ! b->yy_ch_buf )
1478 YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_create_buffer()" );
1480 b->yy_is_our_buffer = 1;
1482 cmListFileLexer_yy_init_buffer(b,file ,yyscanner);
1487 /** Destroy the buffer.
1488 * @param b a buffer created with cmListFileLexer_yy_create_buffer()
1489 * @param yyscanner The scanner object.
1491 void cmListFileLexer_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1493 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1498 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1499 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1501 if ( b->yy_is_our_buffer )
1502 cmListFileLexer_yyfree((void *) b->yy_ch_buf ,yyscanner );
1504 cmListFileLexer_yyfree((void *) b ,yyscanner );
1507 /* Initializes or reinitializes a buffer.
1508 * This function is sometimes called more than once on the same buffer,
1509 * such as during a cmListFileLexer_yyrestart() or at EOF.
1511 static void cmListFileLexer_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1515 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1517 cmListFileLexer_yy_flush_buffer(b ,yyscanner);
1519 b->yy_input_file = file;
1520 b->yy_fill_buffer = 1;
1522 /* If b is the current buffer, then cmListFileLexer_yy_init_buffer was _probably_
1523 * called from cmListFileLexer_yyrestart() or through yy_get_next_buffer.
1524 * In that case, we don't want to reset the lineno or column.
1526 if (b != YY_CURRENT_BUFFER){
1527 b->yy_bs_lineno = 1;
1528 b->yy_bs_column = 0;
1531 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1536 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1537 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1538 * @param yyscanner The scanner object.
1540 void cmListFileLexer_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1542 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1548 /* We always need two end-of-buffer characters. The first causes
1549 * a transition to the end-of-buffer state. The second causes
1550 * a jam in that state.
1552 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1553 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1555 b->yy_buf_pos = &b->yy_ch_buf[0];
1558 b->yy_buffer_status = YY_BUFFER_NEW;
1560 if ( b == YY_CURRENT_BUFFER )
1561 cmListFileLexer_yy_load_buffer_state(yyscanner );
1564 /** Pushes the new state onto the stack. The new state becomes
1565 * the current state. This function will allocate the stack
1567 * @param new_buffer The new state.
1568 * @param yyscanner The scanner object.
1570 void cmListFileLexer_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1572 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1573 if (new_buffer == NULL)
1576 cmListFileLexer_yyensure_buffer_stack(yyscanner);
1578 /* This block is copied from cmListFileLexer_yy_switch_to_buffer. */
1579 if ( YY_CURRENT_BUFFER )
1581 /* Flush out information for old buffer. */
1582 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1583 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1584 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1587 /* Only push if top exists. Otherwise, replace top. */
1588 if (YY_CURRENT_BUFFER)
1589 yyg->yy_buffer_stack_top++;
1590 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1592 /* copied from cmListFileLexer_yy_switch_to_buffer. */
1593 cmListFileLexer_yy_load_buffer_state(yyscanner );
1594 yyg->yy_did_buffer_switch_on_eof = 1;
1597 /** Removes and deletes the top of the stack, if present.
1598 * The next element becomes the new top.
1599 * @param yyscanner The scanner object.
1601 void cmListFileLexer_yypop_buffer_state (yyscan_t yyscanner)
1603 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1604 if (!YY_CURRENT_BUFFER)
1607 cmListFileLexer_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1608 YY_CURRENT_BUFFER_LVALUE = NULL;
1609 if (yyg->yy_buffer_stack_top > 0)
1610 --yyg->yy_buffer_stack_top;
1612 if (YY_CURRENT_BUFFER) {
1613 cmListFileLexer_yy_load_buffer_state(yyscanner );
1614 yyg->yy_did_buffer_switch_on_eof = 1;
1618 /* Allocates the stack if it does not exist.
1619 * Guarantees space for at least one push.
1621 static void cmListFileLexer_yyensure_buffer_stack (yyscan_t yyscanner)
1624 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1626 if (!yyg->yy_buffer_stack) {
1628 /* First allocation is just for 2 elements, since we don't know if this
1629 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1630 * immediate realloc on the next call.
1633 yyg->yy_buffer_stack = (struct yy_buffer_state**)cmListFileLexer_yyalloc
1634 (num_to_alloc * sizeof(struct yy_buffer_state*)
1637 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1639 yyg->yy_buffer_stack_max = num_to_alloc;
1640 yyg->yy_buffer_stack_top = 0;
1644 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1646 /* Increase the buffer to prepare for a possible push. */
1647 int grow_size = 8 /* arbitrary grow size */;
1649 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1650 yyg->yy_buffer_stack = (struct yy_buffer_state**)cmListFileLexer_yyrealloc
1651 (yyg->yy_buffer_stack,
1652 num_to_alloc * sizeof(struct yy_buffer_state*)
1655 /* zero only the new slots.*/
1656 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1657 yyg->yy_buffer_stack_max = num_to_alloc;
1661 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1662 * @param base the character buffer
1663 * @param size the size in bytes of the character buffer
1664 * @param yyscanner The scanner object.
1665 * @return the newly allocated buffer state object.
1667 YY_BUFFER_STATE cmListFileLexer_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1672 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1673 base[size-1] != YY_END_OF_BUFFER_CHAR )
1674 /* They forgot to leave room for the EOB's. */
1677 b = (YY_BUFFER_STATE) cmListFileLexer_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1679 YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_scan_buffer()" );
1681 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1682 b->yy_buf_pos = b->yy_ch_buf = base;
1683 b->yy_is_our_buffer = 0;
1684 b->yy_input_file = 0;
1685 b->yy_n_chars = b->yy_buf_size;
1686 b->yy_is_interactive = 0;
1688 b->yy_fill_buffer = 0;
1689 b->yy_buffer_status = YY_BUFFER_NEW;
1691 cmListFileLexer_yy_switch_to_buffer(b ,yyscanner );
1696 /** Setup the input buffer state to scan a string. The next call to cmListFileLexer_yylex() will
1697 * scan from a @e copy of @a str.
1698 * @param str a NUL-terminated string to scan
1699 * @param yyscanner The scanner object.
1700 * @return the newly allocated buffer state object.
1701 * @note If you want to scan bytes that may contain NUL values, then use
1702 * cmListFileLexer_yy_scan_bytes() instead.
1704 YY_BUFFER_STATE cmListFileLexer_yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner)
1707 return cmListFileLexer_yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner);
1710 /** Setup the input buffer state to scan the given bytes. The next call to cmListFileLexer_yylex() will
1711 * scan from a @e copy of @a bytes.
1712 * @param bytes the byte buffer to scan
1713 * @param len the number of bytes in the buffer pointed to by @a bytes.
1714 * @param yyscanner The scanner object.
1715 * @return the newly allocated buffer state object.
1717 YY_BUFFER_STATE cmListFileLexer_yy_scan_bytes (yyconst char * bytes, int len , yyscan_t yyscanner)
1724 /* Get memory for full buffer, including space for trailing EOB's. */
1726 buf = (char *) cmListFileLexer_yyalloc(n ,yyscanner );
1728 YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_scan_bytes()" );
1730 for ( i = 0; i < len; ++i )
1733 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1735 b = cmListFileLexer_yy_scan_buffer(buf,n ,yyscanner);
1737 YY_FATAL_ERROR( "bad buffer in cmListFileLexer_yy_scan_bytes()" );
1739 /* It's okay to grow etc. this buffer, and we should throw it
1740 * away when we're done.
1742 b->yy_is_our_buffer = 1;
1747 #ifndef YY_EXIT_FAILURE
1748 #define YY_EXIT_FAILURE 2
1751 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
1754 (void) fprintf( stderr, "%s\n", msg );
1755 exit( YY_EXIT_FAILURE );
1758 /* Redefine yyless() so it works in section 3 code. */
1764 /* Undo effects of setting up yytext. */ \
1765 int yyless_macro_arg = (n); \
1766 YY_LESS_LINENO(yyless_macro_arg);\
1767 yytext[yyleng] = yyg->yy_hold_char; \
1768 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1769 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1770 *yyg->yy_c_buf_p = '\0'; \
1771 yyleng = yyless_macro_arg; \
1775 /* Accessor methods (get/set functions) to struct members. */
1777 /** Get the user-defined data for this scanner.
1778 * @param yyscanner The scanner object.
1780 YY_EXTRA_TYPE cmListFileLexer_yyget_extra (yyscan_t yyscanner)
1782 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1786 /** Get the current line number.
1787 * @param yyscanner The scanner object.
1789 int cmListFileLexer_yyget_lineno (yyscan_t yyscanner)
1791 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1793 if (! YY_CURRENT_BUFFER)
1799 /** Get the current column number.
1800 * @param yyscanner The scanner object.
1802 int cmListFileLexer_yyget_column (yyscan_t yyscanner)
1804 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1806 if (! YY_CURRENT_BUFFER)
1812 /** Get the input stream.
1813 * @param yyscanner The scanner object.
1815 FILE *cmListFileLexer_yyget_in (yyscan_t yyscanner)
1817 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1821 /** Get the output stream.
1822 * @param yyscanner The scanner object.
1824 FILE *cmListFileLexer_yyget_out (yyscan_t yyscanner)
1826 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1830 /** Get the length of the current token.
1831 * @param yyscanner The scanner object.
1833 int cmListFileLexer_yyget_leng (yyscan_t yyscanner)
1835 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1839 /** Get the current token.
1840 * @param yyscanner The scanner object.
1843 char *cmListFileLexer_yyget_text (yyscan_t yyscanner)
1845 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1849 /** Set the user-defined data. This data is never touched by the scanner.
1850 * @param user_defined The data to be associated with this scanner.
1851 * @param yyscanner The scanner object.
1853 void cmListFileLexer_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
1855 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1856 yyextra = user_defined ;
1859 /** Set the current line number.
1860 * @param line_number
1861 * @param yyscanner The scanner object.
1863 void cmListFileLexer_yyset_lineno (int line_number , yyscan_t yyscanner)
1865 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1867 /* lineno is only valid if an input buffer exists. */
1868 if (! YY_CURRENT_BUFFER )
1869 yy_fatal_error( "cmListFileLexer_yyset_lineno called with no buffer" , yyscanner);
1871 yylineno = line_number;
1874 /** Set the current column.
1875 * @param line_number
1876 * @param yyscanner The scanner object.
1878 void cmListFileLexer_yyset_column (int column_no , yyscan_t yyscanner)
1880 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1882 /* column is only valid if an input buffer exists. */
1883 if (! YY_CURRENT_BUFFER )
1884 yy_fatal_error( "cmListFileLexer_yyset_column called with no buffer" , yyscanner);
1886 yycolumn = column_no;
1889 /** Set the input stream. This does not discard the current
1891 * @param in_str A readable stream.
1892 * @param yyscanner The scanner object.
1893 * @see cmListFileLexer_yy_switch_to_buffer
1895 void cmListFileLexer_yyset_in (FILE * in_str , yyscan_t yyscanner)
1897 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1901 void cmListFileLexer_yyset_out (FILE * out_str , yyscan_t yyscanner)
1903 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1907 int cmListFileLexer_yyget_debug (yyscan_t yyscanner)
1909 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1910 return yy_flex_debug;
1913 void cmListFileLexer_yyset_debug (int bdebug , yyscan_t yyscanner)
1915 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1916 yy_flex_debug = bdebug ;
1919 /* Accessor methods for yylval and yylloc */
1921 static int yy_init_globals (yyscan_t yyscanner)
1923 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1924 /* Initialization is the same as for the non-reentrant scanner.
1925 This function is called once per scanner lifetime. */
1927 yyg->yy_buffer_stack = 0;
1928 yyg->yy_buffer_stack_top = 0;
1929 yyg->yy_buffer_stack_max = 0;
1930 yyg->yy_c_buf_p = (char *) 0;
1933 yyg->yy_start_stack_ptr = 0;
1934 yyg->yy_start_stack_depth = 0;
1935 yyg->yy_start_stack = (int *) 0;
1937 /* Defined in main.c */
1946 /* For future reference: Set errno on error, since we are called by
1947 * cmListFileLexer_yylex_init()
1952 /* User-visible API */
1954 /* cmListFileLexer_yylex_init is special because it creates the scanner itself, so it is
1955 * the ONLY reentrant function that doesn't take the scanner as the last argument.
1956 * That's why we explicitly handle the declaration, instead of using our macros.
1959 int cmListFileLexer_yylex_init(yyscan_t* ptr_yy_globals)
1962 if (ptr_yy_globals == NULL){
1967 *ptr_yy_globals = (yyscan_t) cmListFileLexer_yyalloc ( sizeof( struct yyguts_t ), NULL );
1969 if (*ptr_yy_globals == NULL){
1974 memset(*ptr_yy_globals,0,sizeof(struct yyguts_t));
1976 return yy_init_globals ( *ptr_yy_globals );
1979 /* cmListFileLexer_yylex_destroy is for both reentrant and non-reentrant scanners. */
1980 int cmListFileLexer_yylex_destroy (yyscan_t yyscanner)
1982 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1984 /* Pop the buffer stack, destroying each element. */
1985 while(YY_CURRENT_BUFFER){
1986 cmListFileLexer_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
1987 YY_CURRENT_BUFFER_LVALUE = NULL;
1988 cmListFileLexer_yypop_buffer_state(yyscanner);
1991 /* Destroy the stack itself. */
1992 cmListFileLexer_yyfree(yyg->yy_buffer_stack ,yyscanner);
1993 yyg->yy_buffer_stack = NULL;
1995 /* Destroy the start condition stack. */
1996 cmListFileLexer_yyfree(yyg->yy_start_stack ,yyscanner );
1997 yyg->yy_start_stack = NULL;
1999 /* Destroy the main struct (reentrant only). */
2000 cmListFileLexer_yyfree ( yyscanner , yyscanner );
2005 * Internal utility routines.
2009 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2012 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2013 for ( i = 0; i < n; ++i )
2018 #ifdef YY_NEED_STRLEN
2019 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2022 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2023 for ( n = 0; s[n]; ++n )
2030 void *cmListFileLexer_yyalloc (yy_size_t size , yyscan_t yyscanner)
2033 return (void *) malloc( size );
2036 void *cmListFileLexer_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2038 /* The cast to (char *) in the following accommodates both
2039 * implementations that use char* generic pointers, and those
2040 * that use void* generic pointers. It works with the latter
2041 * because both ANSI C and C++ allow castless assignment from
2042 * any pointer type to void*, and deal with argument conversions
2043 * as though doing an assignment.
2046 return (void *) realloc( (char *) ptr, size );
2049 void cmListFileLexer_yyfree (void * ptr , yyscan_t yyscanner)
2052 free( (char *) ptr ); /* see cmListFileLexer_yyrealloc() for (char *) cast */
2055 #define YYTABLES_NAME "yytables"
2058 #undef YY_FLUSH_BUFFER
2060 #undef yy_new_buffer
2061 #undef yy_set_interactive
2063 #undef YY_DO_BEFORE_ACTION
2065 #ifdef YY_DECL_IS_OURS
2066 #undef YY_DECL_IS_OURS
2069 #line 194 "cmListFileLexer.in.l"
2073 /*--------------------------------------------------------------------------*/
2074 static void cmListFileLexerSetToken(cmListFileLexer* lexer, const char* text,
2077 /* Set the token line and column number. */
2078 lexer->token.line = lexer->line;
2079 lexer->token.column = lexer->column;
2081 /* Use the same buffer if possible. */
2082 if(lexer->token.text)
2084 if(text && length < lexer->size)
2086 strcpy(lexer->token.text, text);
2087 lexer->token.length = length;
2090 free(lexer->token.text);
2091 lexer->token.text = 0;
2095 /* Need to extend the buffer. */
2098 lexer->token.text = strdup(text);
2099 lexer->token.length = length;
2100 lexer->size = length+1;
2104 lexer->token.length = 0;
2108 /*--------------------------------------------------------------------------*/
2109 static void cmListFileLexerAppend(cmListFileLexer* lexer, const char* text,
2115 /* If the appended text will fit in the buffer, do not reallocate. */
2116 newSize = lexer->token.length + length + 1;
2117 if(lexer->token.text && newSize <= lexer->size)
2119 strcpy(lexer->token.text+lexer->token.length, text);
2120 lexer->token.length += length;
2124 /* We need to extend the buffer. */
2125 temp = (char*)malloc(newSize);
2126 if(lexer->token.text)
2128 memcpy(temp, lexer->token.text, lexer->token.length);
2129 free(lexer->token.text);
2131 memcpy(temp+lexer->token.length, text, length);
2132 temp[lexer->token.length+length] = 0;
2133 lexer->token.text = temp;
2134 lexer->token.length += length;
2135 lexer->size = newSize;
2138 /*--------------------------------------------------------------------------*/
2139 static int cmListFileLexerInput(cmListFileLexer* lexer, char* buffer,
2146 return (int)fread(buffer, 1, bufferSize, lexer->file);
2148 else if(lexer->string_left)
2150 int length = lexer->string_left;
2151 if((int)bufferSize < length) { length = (int)bufferSize; }
2152 memcpy(buffer, lexer->string_position, length);
2153 lexer->string_position += length;
2154 lexer->string_left -= length;
2161 /*--------------------------------------------------------------------------*/
2162 static void cmListFileLexerInit(cmListFileLexer* lexer)
2164 if(lexer->file || lexer->string_buffer)
2166 cmListFileLexer_yylex_init(&lexer->scanner);
2167 cmListFileLexer_yyset_extra(lexer, lexer->scanner);
2171 /*--------------------------------------------------------------------------*/
2172 static void cmListFileLexerDestroy(cmListFileLexer* lexer)
2174 if(lexer->file || lexer->string_buffer)
2176 cmListFileLexer_yylex_destroy(lexer->scanner);
2179 fclose(lexer->file);
2182 if(lexer->string_buffer)
2184 free(lexer->string_buffer);
2185 lexer->string_buffer = 0;
2186 lexer->string_left = 0;
2187 lexer->string_position = 0;
2192 /*--------------------------------------------------------------------------*/
2193 cmListFileLexer* cmListFileLexer_New()
2195 cmListFileLexer* lexer = (cmListFileLexer*)malloc(sizeof(cmListFileLexer));
2200 memset(lexer, 0, sizeof(*lexer));
2206 /*--------------------------------------------------------------------------*/
2207 void cmListFileLexer_Delete(cmListFileLexer* lexer)
2209 cmListFileLexer_SetFileName(lexer, 0);
2213 /*--------------------------------------------------------------------------*/
2214 int cmListFileLexer_SetFileName(cmListFileLexer* lexer, const char* name)
2217 cmListFileLexerDestroy(lexer);
2220 lexer->file = fopen(name, "r");
2226 cmListFileLexerInit(lexer);
2230 /*--------------------------------------------------------------------------*/
2231 int cmListFileLexer_SetString(cmListFileLexer* lexer, const char* text)
2234 cmListFileLexerDestroy(lexer);
2237 int length = (int)strlen(text);
2238 lexer->string_buffer = (char*)malloc(length+1);
2239 if(lexer->string_buffer)
2241 strcpy(lexer->string_buffer, text);
2242 lexer->string_position = lexer->string_buffer;
2243 lexer->string_left = length;
2250 cmListFileLexerInit(lexer);
2254 /*--------------------------------------------------------------------------*/
2255 cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer* lexer)
2261 if(cmListFileLexer_yylex(lexer->scanner, lexer))
2263 return &lexer->token;
2267 cmListFileLexer_SetFileName(lexer, 0);
2272 /*--------------------------------------------------------------------------*/
2273 long cmListFileLexer_GetCurrentLine(cmListFileLexer* lexer)
2285 /*--------------------------------------------------------------------------*/
2286 long cmListFileLexer_GetCurrentColumn(cmListFileLexer* lexer)
2290 return lexer->column;
2298 /*--------------------------------------------------------------------------*/
2299 const char* cmListFileLexer_GetTypeAsString(cmListFileLexer* lexer,
2300 cmListFileLexer_Type type)
2305 case cmListFileLexer_Token_None: return "nothing";
2306 case cmListFileLexer_Token_Newline: return "newline";
2307 case cmListFileLexer_Token_Identifier: return "identifier";
2308 case cmListFileLexer_Token_ParenLeft: return "left paren";
2309 case cmListFileLexer_Token_ParenRight: return "right paren";
2310 case cmListFileLexer_Token_ArgumentUnquoted: return "unquoted argument";
2311 case cmListFileLexer_Token_ArgumentQuoted: return "quoted argument";
2312 case cmListFileLexer_Token_BadCharacter: return "bad character";
2313 case cmListFileLexer_Token_BadString: return "unterminated string";
2315 return "unknown token";