1 #include "cmStandardIncludes.h"
2 #line 2 "/home/andy/vtk/CMake-bin/Source/cmExprLexer.cxx"
4 #line 4 "/home/andy/vtk/CMake-bin/Source/cmExprLexer.cxx"
6 #define YY_INT_ALIGNED short int
8 /* A lexical scanner generated by flex */
11 #define YY_FLEX_MAJOR_VERSION 2
12 #define YY_FLEX_MINOR_VERSION 5
13 #define YY_FLEX_SUBMINOR_VERSION 31
14 #if YY_FLEX_SUBMINOR_VERSION > 0
18 /* First, we deal with platform-specific or compiler-specific issues. */
20 /* begin standard C headers. */
26 /* end standard C headers. */
28 /* flex integer type definitions */
33 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
35 #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
37 typedef int8_t flex_int8_t;
38 typedef uint8_t flex_uint8_t;
39 typedef int16_t flex_int16_t;
40 typedef uint16_t flex_uint16_t;
41 typedef int32_t flex_int32_t;
42 typedef uint32_t flex_uint32_t;
44 typedef signed char flex_int8_t;
45 typedef short int flex_int16_t;
46 typedef int flex_int32_t;
47 typedef unsigned char flex_uint8_t;
48 typedef unsigned short int flex_uint16_t;
49 typedef unsigned int flex_uint32_t;
52 /* Limits of integral types. */
54 #define INT8_MIN (-128)
57 #define INT16_MIN (-32767-1)
60 #define INT32_MIN (-2147483647-1)
63 #define INT8_MAX (127)
66 #define INT16_MAX (32767)
69 #define INT32_MAX (2147483647)
72 #define UINT8_MAX (255U)
75 #define UINT16_MAX (65535U)
78 #define UINT32_MAX (4294967295U)
81 #endif /* ! FLEXINT_H */
85 /* The "const" storage-class-modifier is valid. */
88 #else /* ! __cplusplus */
95 #endif /* ! __cplusplus */
103 /* Returned upon end-of-file. */
106 /* Promotes a possibly negative, possibly signed char to an unsigned
107 * integer for use as an array index. If the signed char is negative,
108 * we want to instead treat it as an 8-bit unsigned char, hence the
111 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
113 /* An opaque pointer. */
114 #ifndef YY_TYPEDEF_YY_SCANNER_T
115 #define YY_TYPEDEF_YY_SCANNER_T
116 typedef void* yyscan_t;
119 /* For convenience, these vars (plus the bison vars far below)
120 are macros in the reentrant scanner. */
121 #define yyin yyg->yyin_r
122 #define yyout yyg->yyout_r
123 #define yyextra yyg->yyextra_r
124 #define yyleng yyg->yyleng_r
125 #define yytext yyg->yytext_r
126 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
127 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
128 #define yy_flex_debug yyg->yy_flex_debug_r
130 int cmExpr_yylex_init (yyscan_t* scanner);
132 /* Enter a start condition. This macro really ought to take a parameter,
133 * but we do it the disgusting crufty way forced on us by the ()-less
134 * definition of BEGIN.
136 #define BEGIN yyg->yy_start = 1 + 2 *
138 /* Translate the current start state into a value that can be later handed
139 * to BEGIN to return to the state. The YYSTATE alias is for lex
142 #define YY_START ((yyg->yy_start - 1) / 2)
143 #define YYSTATE YY_START
145 /* Action number for EOF rule of a given start state. */
146 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
148 /* Special action meaning "start processing a new file". */
149 #define YY_NEW_FILE cmExpr_yyrestart(yyin ,yyscanner )
151 #define YY_END_OF_BUFFER_CHAR 0
153 /* Size of default input buffer. */
155 #define YY_BUF_SIZE 16384
158 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
159 #define YY_TYPEDEF_YY_BUFFER_STATE
160 typedef struct yy_buffer_state *YY_BUFFER_STATE;
163 #define EOB_ACT_CONTINUE_SCAN 0
164 #define EOB_ACT_END_OF_FILE 1
165 #define EOB_ACT_LAST_MATCH 2
167 #define YY_LESS_LINENO(n)
169 /* Return all but the first "n" matched characters back to the input
174 /* Undo effects of setting up yytext. */ \
175 int yyless_macro_arg = (n); \
176 YY_LESS_LINENO(yyless_macro_arg);\
177 *yy_cp = yyg->yy_hold_char; \
178 YY_RESTORE_YY_MORE_OFFSET \
179 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
180 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
184 /* The following is because we cannot portably get our hands on size_t
185 * (without autoconf's help, which isn't available because we want
186 * flex-generated scanners to compile on their own).
189 #ifndef YY_TYPEDEF_YY_SIZE_T
190 #define YY_TYPEDEF_YY_SIZE_T
191 typedef unsigned int yy_size_t;
194 #ifndef YY_STRUCT_YY_BUFFER_STATE
195 #define YY_STRUCT_YY_BUFFER_STATE
196 struct yy_buffer_state
200 char *yy_ch_buf; /* input buffer */
201 char *yy_buf_pos; /* current position in input buffer */
203 /* Size of input buffer in bytes, not including room for EOB
206 yy_size_t yy_buf_size;
208 /* Number of characters read into yy_ch_buf, not including EOB
213 /* Whether we "own" the buffer - i.e., we know we created it,
214 * and can realloc() it to grow it, and should free() it to
217 int yy_is_our_buffer;
219 /* Whether this is an "interactive" input source; if so, and
220 * if we're using stdio for input, then we want to use getc()
221 * instead of fread(), to make sure we stop fetching input after
224 int yy_is_interactive;
226 /* Whether we're considered to be at the beginning of a line.
227 * If so, '^' rules will be active on the next match, otherwise
232 int yy_bs_lineno; /**< The line count. */
233 int yy_bs_column; /**< The column count. */
235 /* Whether to try to fill the input buffer when we reach the
240 int yy_buffer_status;
242 #define YY_BUFFER_NEW 0
243 #define YY_BUFFER_NORMAL 1
244 /* When an EOF's been seen but there's still some text to process
245 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
246 * shouldn't try reading from the input source any more. We might
247 * still have a bunch of tokens to match, though, because of
248 * possible backing-up.
250 * When we actually see the EOF, we change the status to "new"
251 * (via cmExpr_yyrestart()), so that the user can continue scanning by
252 * just pointing yyin at a new input file.
254 #define YY_BUFFER_EOF_PENDING 2
257 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
259 /* We provide macros for accessing buffer states in case in the
260 * future we want to put the buffer states in a more general
263 * Returns the top of the stack, or NULL.
265 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
266 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
269 /* Same as previous macro, but useful when we know that the buffer stack is
270 * not NULL or when we need an lvalue. For internal use only.
272 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
274 void cmExpr_yyrestart (FILE *input_file ,yyscan_t yyscanner );
275 void cmExpr_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
276 YY_BUFFER_STATE cmExpr_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
277 void cmExpr_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
278 void cmExpr_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
279 void cmExpr_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
280 void cmExpr_yypop_buffer_state (yyscan_t yyscanner );
282 static void cmExpr_yyensure_buffer_stack (yyscan_t yyscanner );
283 static void cmExpr_yy_load_buffer_state (yyscan_t yyscanner );
284 static void cmExpr_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
286 #define YY_FLUSH_BUFFER cmExpr_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
288 YY_BUFFER_STATE cmExpr_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
289 YY_BUFFER_STATE cmExpr_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
290 YY_BUFFER_STATE cmExpr_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
292 void *cmExpr_yyalloc (yy_size_t ,yyscan_t yyscanner );
293 void *cmExpr_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
294 void cmExpr_yyfree (void * ,yyscan_t yyscanner );
296 #define yy_new_buffer cmExpr_yy_create_buffer
298 #define yy_set_interactive(is_interactive) \
300 if ( ! YY_CURRENT_BUFFER ){ \
301 cmExpr_yyensure_buffer_stack (yyscanner); \
302 YY_CURRENT_BUFFER_LVALUE = \
303 cmExpr_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
305 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
308 #define yy_set_bol(at_bol) \
310 if ( ! YY_CURRENT_BUFFER ){\
311 cmExpr_yyensure_buffer_stack (yyscanner); \
312 YY_CURRENT_BUFFER_LVALUE = \
313 cmExpr_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
315 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
318 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
320 /* Begin user sect3 */
322 #define cmExpr_yywrap(n) 1
323 #define YY_SKIP_YYWRAP
325 typedef unsigned char YY_CHAR;
327 typedef int yy_state_type;
329 #define yytext_ptr yytext_r
331 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
332 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,
334 static int yy_get_next_buffer (yyscan_t yyscanner );
335 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
337 /* Done after the current pattern has been matched and before the
338 * corresponding action - sets up yytext.
340 #define YY_DO_BEFORE_ACTION \
341 yyg->yytext_ptr = yy_bp; \
342 yyleng = (size_t) (yy_cp - yy_bp); \
343 yyg->yy_hold_char = *yy_cp; \
345 yyg->yy_c_buf_p = yy_cp;
347 #define YY_NUM_RULES 15
348 #define YY_END_OF_BUFFER 16
349 /* This struct is not used in this scanner,
350 but its presence is necessary. */
353 flex_int32_t yy_verify;
356 static yyconst flex_int16_t yy_accept[23] =
358 0, 0, 16, 15, 6, 8, 13, 14, 4, 2,
359 3, 5, 1, 15, 15, 9, 7, 10, 1, 11,
363 static yyconst flex_int32_t yy_ec[256] =
365 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
366 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
367 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
368 1, 1, 1, 1, 1, 1, 2, 3, 1, 4,
369 5, 6, 7, 1, 8, 1, 9, 10, 10, 10,
370 10, 10, 10, 10, 10, 10, 10, 1, 1, 11,
371 1, 12, 1, 1, 1, 1, 1, 1, 1, 1,
372 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
373 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
374 1, 1, 1, 13, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
378 1, 1, 1, 14, 1, 15, 1, 1, 1, 1,
379 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
381 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
382 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
383 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 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,
395 static yyconst flex_int32_t yy_meta[16] =
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 static yyconst flex_int16_t yy_base[23] =
403 0, 0, 20, 21, 21, 21, 21, 21, 21, 21,
404 21, 21, 9, 7, 5, 21, 21, 21, 6, 21,
408 static yyconst flex_int16_t yy_def[23] =
410 22, 1, 22, 22, 22, 22, 22, 22, 22, 22,
411 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
415 static yyconst flex_int16_t yy_nxt[37] =
417 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
418 14, 15, 16, 17, 18, 19, 21, 20, 19, 22,
419 3, 22, 22, 22, 22, 22, 22, 22, 22, 22,
420 22, 22, 22, 22, 22, 22
423 static yyconst flex_int16_t yy_chk[37] =
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 19, 15, 14, 13, 3,
427 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
428 22, 22, 22, 22, 22, 22
431 /* The intent behind this definition is that it'll catch
432 * any uses of REJECT which flex missed.
434 #define REJECT reject_used_but_not_detected
435 #define yymore() yymore_used_but_not_detected
436 #define YY_MORE_ADJ 0
437 #define YY_RESTORE_YY_MORE_OFFSET
438 #line 1 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
439 #line 2 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
440 /*============================================================================
441 CMake - Cross Platform Makefile Generator
442 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
444 Distributed under the OSI-approved BSD License (the "License");
445 see accompanying file Copyright.txt for details.
447 This software is distributed WITHOUT ANY WARRANTY; without even the
448 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
449 See the License for more information.
450 ============================================================================*/
453 This file must be translated to C and modified to build everywhere.
457 flex --prefix=cmExpr_yy --header-file=cmExprLexer.h -ocmExprLexer.cxx cmExprLexer.in.l
459 Modify cmExprLexer.cxx:
461 - remove "yyscanner" argument from these methods:
462 yy_fatal_error, cmExpr_yyalloc, cmExpr_yyrealloc, cmExpr_yyfree
463 - remove all YY_BREAK lines occurring right after return statements
464 - change while ( 1 ) to for(;;)
466 Modify cmExprLexer.h:
468 - remove the yy_init_globals function
469 - remove the block that includes unistd.h
470 - remove #line directives (avoids bogus warning on old Sun)
474 #include "cmStandardLexer.h"
476 #include "cmExprParserHelper.h"
478 /* Replace the lexer input function. */
480 #define YY_INPUT(buf, result, max_size) \
481 { result = yyextra->LexInput(buf, max_size); }
483 /* Include the set of tokens from the parser. */
484 #include "cmExprParserTokens.h"
486 /*--------------------------------------------------------------------------*/
487 #line 518 "/home/andy/vtk/CMake-bin/Source/cmExprLexer.cxx"
491 #ifndef YY_NO_UNISTD_H
492 /* Special case for "unistd.h", since it is non-ANSI. We include it way
493 * down here because we want the user's section 1 to have been scanned first.
494 * The user has a chance to override it with an option.
499 #ifndef YY_EXTRA_TYPE
500 #define YY_EXTRA_TYPE void *
503 /* Holds the entire state of the reentrant scanner. */
507 /* User-defined. Not touched by flex. */
508 YY_EXTRA_TYPE yyextra_r;
510 /* The rest are the same as the globals declared in the non-reentrant
512 FILE *yyin_r, *yyout_r;
513 size_t yy_buffer_stack_top; /**< index of top of stack. */
514 size_t yy_buffer_stack_max; /**< capacity of stack. */
515 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
522 int yy_did_buffer_switch_on_eof;
523 int yy_start_stack_ptr;
524 int yy_start_stack_depth;
526 yy_state_type yy_last_accepting_state;
527 char* yy_last_accepting_cpos;
536 }; /* end struct yyguts_t */
538 /* Accessor methods to globals.
539 These are made visible to non-reentrant scanners for convenience. */
541 int cmExpr_yylex_destroy (yyscan_t yyscanner );
543 int cmExpr_yyget_debug (yyscan_t yyscanner );
545 void cmExpr_yyset_debug (int debug_flag ,yyscan_t yyscanner );
547 YY_EXTRA_TYPE cmExpr_yyget_extra (yyscan_t yyscanner );
549 void cmExpr_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
551 FILE *cmExpr_yyget_in (yyscan_t yyscanner );
553 void cmExpr_yyset_in (FILE * in_str ,yyscan_t yyscanner );
555 FILE *cmExpr_yyget_out (yyscan_t yyscanner );
557 void cmExpr_yyset_out (FILE * out_str ,yyscan_t yyscanner );
559 int cmExpr_yyget_leng (yyscan_t yyscanner );
561 char *cmExpr_yyget_text (yyscan_t yyscanner );
563 int cmExpr_yyget_lineno (yyscan_t yyscanner );
565 void cmExpr_yyset_lineno (int line_number ,yyscan_t yyscanner );
567 /* Macros after this point can all be overridden by user definitions in
571 #ifndef YY_SKIP_YYWRAP
573 extern "C" int cmExpr_yywrap (yyscan_t yyscanner );
575 extern int cmExpr_yywrap (yyscan_t yyscanner );
580 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
583 #ifdef YY_NEED_STRLEN
584 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
590 static int yyinput (yyscan_t yyscanner );
592 static int input (yyscan_t yyscanner );
597 /* Amount of stuff to slurp up with each read. */
598 #ifndef YY_READ_BUF_SIZE
599 #define YY_READ_BUF_SIZE 8192
602 /* Copy whatever the last rule matched to the standard output. */
604 /* This used to be an fputs(), but since the string might contain NUL's,
605 * we now use fwrite().
607 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
610 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
611 * is returned in "result".
614 #define YY_INPUT(buf,result,max_size) \
615 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
619 for ( n = 0; n < max_size && \
620 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
623 buf[n++] = (char) c; \
624 if ( c == EOF && ferror( yyin ) ) \
625 YY_FATAL_ERROR( "input in flex scanner failed" ); \
631 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
633 if( errno != EINTR) \
635 YY_FATAL_ERROR( "input in flex scanner failed" ); \
646 /* No semi-colon after return; correct usage is to write "yyterminate();" -
647 * we don't want an extra ';' after the "return" because that will cause
648 * some compilers to complain about unreachable statements.
651 #define yyterminate() return YY_NULL
654 /* Number of entries by which start-condition stack grows. */
655 #ifndef YY_START_STACK_INCR
656 #define YY_START_STACK_INCR 25
659 /* Report a fatal error. */
660 #ifndef YY_FATAL_ERROR
661 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
664 /* end tables serialization structures and prototypes */
666 /* Default declaration of generated scanner - a define so the user can
667 * easily add parameters.
670 #define YY_DECL_IS_OURS 1
672 extern int cmExpr_yylex (yyscan_t yyscanner);
674 #define YY_DECL int cmExpr_yylex (yyscan_t yyscanner)
675 #endif /* !YY_DECL */
677 /* Code executed at the beginning of each rule, after yytext and yyleng
680 #ifndef YY_USER_ACTION
681 #define YY_USER_ACTION
684 /* Code executed at the end of each rule. */
686 #define YY_BREAK break;
689 #define YY_RULE_SETUP \
692 /** The main scanner function which does all the work.
696 yy_state_type yy_current_state;
699 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
701 #line 86 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
704 #line 736 "/home/andy/vtk/CMake-bin/Source/cmExprLexer.cxx"
714 if ( ! yyg->yy_start )
715 yyg->yy_start = 1; /* first start state */
723 if ( ! YY_CURRENT_BUFFER ) {
724 cmExpr_yyensure_buffer_stack (yyscanner);
725 YY_CURRENT_BUFFER_LVALUE =
726 cmExpr_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
729 cmExpr_yy_load_buffer_state(yyscanner );
732 for(;;) /* loops until end-of-file is reached */
734 yy_cp = yyg->yy_c_buf_p;
736 /* Support of yytext. */
737 *yy_cp = yyg->yy_hold_char;
739 /* yy_bp points to the position in yy_ch_buf of the start of
744 yy_current_state = yyg->yy_start;
748 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
749 if ( yy_accept[yy_current_state] )
751 yyg->yy_last_accepting_state = yy_current_state;
752 yyg->yy_last_accepting_cpos = yy_cp;
754 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
756 yy_current_state = (int) yy_def[yy_current_state];
757 if ( yy_current_state >= 23 )
758 yy_c = yy_meta[(unsigned int) yy_c];
760 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
763 while ( yy_base[yy_current_state] != 21 );
766 yy_act = yy_accept[yy_current_state];
768 { /* have to back up */
769 yy_cp = yyg->yy_last_accepting_cpos;
770 yy_current_state = yyg->yy_last_accepting_state;
771 yy_act = yy_accept[yy_current_state];
776 do_action: /* This label is used only to access EOF actions. */
779 { /* beginning of action switch */
780 case 0: /* must back up */
781 /* undo the effects of YY_DO_BEFORE_ACTION */
782 *yy_cp = yyg->yy_hold_char;
783 yy_cp = yyg->yy_last_accepting_cpos;
784 yy_current_state = yyg->yy_last_accepting_state;
789 #line 88 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
790 { yylvalp->Number = atoi(yytext); return exp_NUMBER; }
793 #line 90 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
797 #line 91 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
798 { return exp_MINUS; }
801 #line 92 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
802 { return exp_TIMES; }
805 #line 93 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
806 { return exp_DIVIDE; }
809 #line 94 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
813 #line 95 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
817 #line 96 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
821 #line 97 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
825 #line 98 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
829 #line 99 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
830 { return exp_SHIFTLEFT; }
833 #line 100 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
834 { return exp_SHIFTRIGHT; }
837 #line 101 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
838 { return exp_OPENPARENT; }
841 #line 102 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
842 { return exp_CLOSEPARENT; }
845 #line 104 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
848 #line 894 "/home/andy/vtk/CMake-bin/Source/cmExprLexer.cxx"
849 case YY_STATE_EOF(INITIAL):
852 case YY_END_OF_BUFFER:
854 /* Amount of text matched not including the EOB char. */
855 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
857 /* Undo the effects of YY_DO_BEFORE_ACTION. */
858 *yy_cp = yyg->yy_hold_char;
859 YY_RESTORE_YY_MORE_OFFSET
861 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
863 /* We're scanning a new file or input source. It's
864 * possible that this happened because the user
865 * just pointed yyin at a new source and called
866 * cmExpr_yylex(). If so, then we have to assure
867 * consistency between YY_CURRENT_BUFFER and our
868 * globals. Here is the right place to do so, because
869 * this is the first action (other than possibly a
870 * back-up) that will match for the new input source.
872 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
873 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
874 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
877 /* Note that here we test for yy_c_buf_p "<=" to the position
878 * of the first EOB in the buffer, since yy_c_buf_p will
879 * already have been incremented past the NUL character
880 * (since all states make transitions on EOB to the
881 * end-of-buffer state). Contrast this with the test
884 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
885 { /* This was really a NUL. */
886 yy_state_type yy_next_state;
888 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
890 yy_current_state = yy_get_previous_state( yyscanner );
892 /* Okay, we're now positioned to make the NUL
893 * transition. We couldn't have
894 * yy_get_previous_state() go ahead and do it
895 * for us because it doesn't know how to deal
896 * with the possibility of jamming (and we don't
897 * want to build jamming into it because then it
898 * will run more slowly).
901 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
903 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
907 /* Consume the NUL. */
908 yy_cp = ++yyg->yy_c_buf_p;
909 yy_current_state = yy_next_state;
915 yy_cp = yyg->yy_c_buf_p;
920 else switch ( yy_get_next_buffer( yyscanner ) )
922 case EOB_ACT_END_OF_FILE:
924 yyg->yy_did_buffer_switch_on_eof = 0;
926 if ( cmExpr_yywrap(yyscanner ) )
928 /* Note: because we've taken care in
929 * yy_get_next_buffer() to have set up
930 * yytext, we can now set up
931 * yy_c_buf_p so that if some total
932 * hoser (like flex itself) wants to
933 * call the scanner after we return the
934 * YY_NULL, it'll still work - another
935 * YY_NULL will get returned.
937 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
939 yy_act = YY_STATE_EOF(YY_START);
945 if ( ! yyg->yy_did_buffer_switch_on_eof )
951 case EOB_ACT_CONTINUE_SCAN:
953 yyg->yytext_ptr + yy_amount_of_matched_text;
955 yy_current_state = yy_get_previous_state( yyscanner );
957 yy_cp = yyg->yy_c_buf_p;
958 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
961 case EOB_ACT_LAST_MATCH:
963 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
965 yy_current_state = yy_get_previous_state( yyscanner );
967 yy_cp = yyg->yy_c_buf_p;
968 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
976 "fatal flex scanner internal error--no action found" );
977 } /* end of action switch */
978 } /* end of scanning one token */
979 return 0; /* this should not happen but it silences a warning*/
980 } /* end of cmExpr_yylex */
982 /* yy_get_next_buffer - try to read in a new buffer
984 * Returns a code representing an action:
985 * EOB_ACT_LAST_MATCH -
986 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
987 * EOB_ACT_END_OF_FILE - end of file
989 static int yy_get_next_buffer (yyscan_t yyscanner)
991 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
992 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
993 char *source = yyg->yytext_ptr;
994 int number_to_move, i;
997 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
999 "fatal flex scanner internal error--end of buffer missed" );
1001 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1002 { /* Don't try to fill the buffer, so this is an EOF. */
1003 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1005 /* We matched a single character, the EOB, so
1006 * treat this as a final EOF.
1008 return EOB_ACT_END_OF_FILE;
1013 /* We matched some text prior to the EOB, first
1016 return EOB_ACT_LAST_MATCH;
1020 /* Try to read more data. */
1022 /* First move last chars to start of buffer. */
1023 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1025 for ( i = 0; i < number_to_move; ++i )
1026 *(dest++) = *(source++);
1028 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1029 /* don't do the read, it's not guaranteed to return an EOF,
1032 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1037 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1039 while ( nuto_read <= 0 )
1040 { /* Not enough room in the buffer - grow it. */
1042 /* just a shorter name for the current buffer */
1043 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1045 int yy_c_buf_p_offset =
1046 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1048 if ( b->yy_is_our_buffer )
1050 int new_size = b->yy_buf_size * 2;
1052 if ( new_size <= 0 )
1053 b->yy_buf_size += b->yy_buf_size / 8;
1055 b->yy_buf_size *= 2;
1057 b->yy_ch_buf = (char *)
1058 /* Include room in for 2 EOB chars. */
1059 cmExpr_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1062 /* Can't grow it, we don't own it. */
1065 if ( ! b->yy_ch_buf )
1067 "fatal error - scanner input buffer overflow" );
1069 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1071 nuto_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1076 if ( nuto_read > YY_READ_BUF_SIZE )
1077 nuto_read = YY_READ_BUF_SIZE;
1079 /* Read in more data. */
1080 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1081 yyg->yy_n_chars, nuto_read );
1083 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1086 if ( yyg->yy_n_chars == 0 )
1088 if ( number_to_move == YY_MORE_ADJ )
1090 ret_val = EOB_ACT_END_OF_FILE;
1091 cmExpr_yyrestart(yyin ,yyscanner);
1096 ret_val = EOB_ACT_LAST_MATCH;
1097 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1098 YY_BUFFER_EOF_PENDING;
1103 ret_val = EOB_ACT_CONTINUE_SCAN;
1105 yyg->yy_n_chars += number_to_move;
1106 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1107 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1109 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1114 /* yy_get_previous_state - get the state just before the EOB char was
1117 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1119 yy_state_type yy_current_state;
1121 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1123 yy_current_state = yyg->yy_start;
1125 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1127 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1128 if ( yy_accept[yy_current_state] )
1130 yyg->yy_last_accepting_state = yy_current_state;
1131 yyg->yy_last_accepting_cpos = yy_cp;
1133 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1135 yy_current_state = (int) yy_def[yy_current_state];
1136 if ( yy_current_state >= 23 )
1137 yy_c = yy_meta[(unsigned int) yy_c];
1139 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1142 return yy_current_state;
1145 /* yy_try_NUL_trans - try to make a transition on the NUL character
1148 * next_state = yy_try_NUL_trans( current_state );
1150 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1153 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1154 char *yy_cp = yyg->yy_c_buf_p;
1157 if ( yy_accept[yy_current_state] )
1159 yyg->yy_last_accepting_state = yy_current_state;
1160 yyg->yy_last_accepting_cpos = yy_cp;
1162 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1164 yy_current_state = (int) yy_def[yy_current_state];
1165 if ( yy_current_state >= 23 )
1166 yy_c = yy_meta[(unsigned int) yy_c];
1168 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1169 yy_is_jam = (yy_current_state == 22);
1171 return yy_is_jam ? 0 : yy_current_state;
1176 static int yyinput (yyscan_t yyscanner)
1178 static int input (yyscan_t yyscanner)
1183 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1185 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1187 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1189 /* yy_c_buf_p now points to the character we want to return.
1190 * If this occurs *before* the EOB characters, then it's a
1191 * valid NUL; if not, then we've hit the end of the buffer.
1193 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1194 /* This was really a NUL. */
1195 *yyg->yy_c_buf_p = '\0';
1198 { /* need more input */
1199 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1202 switch ( yy_get_next_buffer( yyscanner ) )
1204 case EOB_ACT_LAST_MATCH:
1205 /* This happens because yy_g_n_b()
1206 * sees that we've accumulated a
1207 * token and flags that we need to
1208 * try matching the token before
1209 * proceeding. But for input(),
1210 * there's no matching to consider.
1211 * So convert the EOB_ACT_LAST_MATCH
1212 * to EOB_ACT_END_OF_FILE.
1215 /* Reset buffer status. */
1216 cmExpr_yyrestart(yyin ,yyscanner);
1220 case EOB_ACT_END_OF_FILE:
1222 if ( cmExpr_yywrap(yyscanner ) )
1225 if ( ! yyg->yy_did_buffer_switch_on_eof )
1228 return yyinput(yyscanner);
1230 return input(yyscanner);
1234 case EOB_ACT_CONTINUE_SCAN:
1235 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1241 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1242 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1243 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1247 #endif /* ifndef YY_NO_INPUT */
1249 /** Immediately switch to a different input stream.
1250 * @param input_file A readable stream.
1251 * @param yyscanner The scanner object.
1252 * @note This function does not reset the start condition to @c INITIAL .
1254 void cmExpr_yyrestart (FILE * input_file , yyscan_t yyscanner)
1256 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1258 if ( ! YY_CURRENT_BUFFER ){
1259 cmExpr_yyensure_buffer_stack (yyscanner);
1260 YY_CURRENT_BUFFER_LVALUE =
1261 cmExpr_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1264 cmExpr_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1265 cmExpr_yy_load_buffer_state(yyscanner );
1268 /** Switch to a different input buffer.
1269 * @param new_buffer The new input buffer.
1270 * @param yyscanner The scanner object.
1272 void cmExpr_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1274 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1276 /* TODO. We should be able to replace this entire function body
1278 * cmExpr_yypop_buffer_state();
1279 * cmExpr_yypush_buffer_state(new_buffer);
1281 cmExpr_yyensure_buffer_stack (yyscanner);
1282 if ( YY_CURRENT_BUFFER == new_buffer )
1285 if ( YY_CURRENT_BUFFER )
1287 /* Flush out information for old buffer. */
1288 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1289 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1290 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1293 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1294 cmExpr_yy_load_buffer_state(yyscanner );
1296 /* We don't actually know whether we did this switch during
1297 * EOF (cmExpr_yywrap()) processing, but the only time this flag
1298 * is looked at is after cmExpr_yywrap() is called, so it's safe
1299 * to go ahead and always set it.
1301 yyg->yy_did_buffer_switch_on_eof = 1;
1304 static void cmExpr_yy_load_buffer_state (yyscan_t yyscanner)
1306 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1307 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1308 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1309 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1310 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1313 /** Allocate and initialize an input buffer state.
1314 * @param file A readable stream.
1315 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1316 * @param yyscanner The scanner object.
1317 * @return the allocated buffer state.
1319 YY_BUFFER_STATE cmExpr_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1323 b = (YY_BUFFER_STATE) cmExpr_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1325 YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yy_create_buffer()" );
1327 b->yy_buf_size = size;
1329 /* yy_ch_buf has to be 2 characters longer than the size given because
1330 * we need to put in 2 end-of-buffer characters.
1332 b->yy_ch_buf = (char *) cmExpr_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1333 if ( ! b->yy_ch_buf )
1334 YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yy_create_buffer()" );
1336 b->yy_is_our_buffer = 1;
1338 cmExpr_yy_init_buffer(b,file ,yyscanner);
1343 /** Destroy the buffer.
1344 * @param b a buffer created with cmExpr_yy_create_buffer()
1345 * @param yyscanner The scanner object.
1347 void cmExpr_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1349 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1354 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1355 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1357 if ( b->yy_is_our_buffer )
1358 cmExpr_yyfree((void *) b->yy_ch_buf ,yyscanner );
1360 cmExpr_yyfree((void *) b ,yyscanner );
1364 extern int isatty (int );
1365 #endif /* __cplusplus */
1367 /* Initializes or reinitializes a buffer.
1368 * This function is sometimes called more than once on the same buffer,
1369 * such as during a cmExpr_yyrestart() or at EOF.
1371 static void cmExpr_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1375 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1377 cmExpr_yy_flush_buffer(b ,yyscanner);
1379 b->yy_input_file = file;
1380 b->yy_fill_buffer = 1;
1382 /* If b is the current buffer, then cmExpr_yy_init_buffer was _probably_
1383 * called from cmExpr_yyrestart() or through yy_get_next_buffer.
1384 * In that case, we don't want to reset the lineno or column.
1386 if (b != YY_CURRENT_BUFFER){
1387 b->yy_bs_lineno = 1;
1388 b->yy_bs_column = 0;
1391 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1396 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1397 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1398 * @param yyscanner The scanner object.
1400 void cmExpr_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1402 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1408 /* We always need two end-of-buffer characters. The first causes
1409 * a transition to the end-of-buffer state. The second causes
1410 * a jam in that state.
1412 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1413 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1415 b->yy_buf_pos = &b->yy_ch_buf[0];
1418 b->yy_buffer_status = YY_BUFFER_NEW;
1420 if ( b == YY_CURRENT_BUFFER )
1421 cmExpr_yy_load_buffer_state(yyscanner );
1424 /** Pushes the new state onto the stack. The new state becomes
1425 * the current state. This function will allocate the stack
1427 * @param new_buffer The new state.
1428 * @param yyscanner The scanner object.
1430 void cmExpr_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1432 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1433 if (new_buffer == NULL)
1436 cmExpr_yyensure_buffer_stack(yyscanner);
1438 /* This block is copied from cmExpr_yy_switch_to_buffer. */
1439 if ( YY_CURRENT_BUFFER )
1441 /* Flush out information for old buffer. */
1442 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1443 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1444 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1447 /* Only push if top exists. Otherwise, replace top. */
1448 if (YY_CURRENT_BUFFER)
1449 yyg->yy_buffer_stack_top++;
1450 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1452 /* copied from cmExpr_yy_switch_to_buffer. */
1453 cmExpr_yy_load_buffer_state(yyscanner );
1454 yyg->yy_did_buffer_switch_on_eof = 1;
1457 /** Removes and deletes the top of the stack, if present.
1458 * The next element becomes the new top.
1459 * @param yyscanner The scanner object.
1461 void cmExpr_yypop_buffer_state (yyscan_t yyscanner)
1463 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1464 if (!YY_CURRENT_BUFFER)
1467 cmExpr_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1468 YY_CURRENT_BUFFER_LVALUE = NULL;
1469 if (yyg->yy_buffer_stack_top > 0)
1470 --yyg->yy_buffer_stack_top;
1472 if (YY_CURRENT_BUFFER) {
1473 cmExpr_yy_load_buffer_state(yyscanner );
1474 yyg->yy_did_buffer_switch_on_eof = 1;
1478 /* Allocates the stack if it does not exist.
1479 * Guarantees space for at least one push.
1481 static void cmExpr_yyensure_buffer_stack (yyscan_t yyscanner)
1484 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1486 if (!yyg->yy_buffer_stack) {
1488 /* First allocation is just for 2 elements, since we don't know if this
1489 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1490 * immediate realloc on the next call.
1493 yyg->yy_buffer_stack = (struct yy_buffer_state**)cmExpr_yyalloc
1494 (nuto_alloc * sizeof(struct yy_buffer_state*)
1497 memset(yyg->yy_buffer_stack, 0, nuto_alloc * sizeof(struct yy_buffer_state*));
1499 yyg->yy_buffer_stack_max = nuto_alloc;
1500 yyg->yy_buffer_stack_top = 0;
1504 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1506 /* Increase the buffer to prepare for a possible push. */
1507 int grow_size = 8 /* arbitrary grow size */;
1509 nuto_alloc = yyg->yy_buffer_stack_max + grow_size;
1510 yyg->yy_buffer_stack = (struct yy_buffer_state**)cmExpr_yyrealloc
1511 (yyg->yy_buffer_stack,
1512 nuto_alloc * sizeof(struct yy_buffer_state*)
1515 /* zero only the new slots.*/
1516 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1517 yyg->yy_buffer_stack_max = nuto_alloc;
1521 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1522 * @param base the character buffer
1523 * @param size the size in bytes of the character buffer
1524 * @param yyscanner The scanner object.
1525 * @return the newly allocated buffer state object.
1527 YY_BUFFER_STATE cmExpr_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1532 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1533 base[size-1] != YY_END_OF_BUFFER_CHAR )
1534 /* They forgot to leave room for the EOB's. */
1537 b = (YY_BUFFER_STATE) cmExpr_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1539 YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yy_scan_buffer()" );
1541 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1542 b->yy_buf_pos = b->yy_ch_buf = base;
1543 b->yy_is_our_buffer = 0;
1544 b->yy_input_file = 0;
1545 b->yy_n_chars = b->yy_buf_size;
1546 b->yy_is_interactive = 0;
1548 b->yy_fill_buffer = 0;
1549 b->yy_buffer_status = YY_BUFFER_NEW;
1551 cmExpr_yy_switch_to_buffer(b ,yyscanner );
1556 /** Setup the input buffer state to scan a string. The next call to cmExpr_yylex() will
1557 * scan from a @e copy of @a yy_str.
1558 * @param yy_str a NUL-terminated string to scan
1559 * @param yyscanner The scanner object.
1560 * @return the newly allocated buffer state object.
1561 * @note If you want to scan bytes that may contain NUL values, then use
1562 * cmExpr_yy_scan_bytes() instead.
1564 YY_BUFFER_STATE cmExpr_yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner)
1567 return cmExpr_yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner);
1570 /** Setup the input buffer state to scan the given bytes. The next call to cmExpr_yylex() will
1571 * scan from a @e copy of @a bytes.
1572 * @param bytes the byte buffer to scan
1573 * @param len the number of bytes in the buffer pointed to by @a bytes.
1574 * @param yyscanner The scanner object.
1575 * @return the newly allocated buffer state object.
1577 YY_BUFFER_STATE cmExpr_yy_scan_bytes (yyconst char * bytes, int len , yyscan_t yyscanner)
1584 /* Get memory for full buffer, including space for trailing EOB's. */
1586 buf = (char *) cmExpr_yyalloc(n ,yyscanner );
1588 YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yy_scan_bytes()" );
1590 for ( i = 0; i < len; ++i )
1593 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1595 b = cmExpr_yy_scan_buffer(buf,n ,yyscanner);
1597 YY_FATAL_ERROR( "bad buffer in cmExpr_yy_scan_bytes()" );
1599 /* It's okay to grow etc. this buffer, and we should throw it
1600 * away when we're done.
1602 b->yy_is_our_buffer = 1;
1607 #ifndef YY_EXIT_FAILURE
1608 #define YY_EXIT_FAILURE 2
1611 static void yy_fatal_error (yyconst char* msg , yyscan_t)
1613 (void) fprintf( stderr, "%s\n", msg );
1614 exit( YY_EXIT_FAILURE );
1617 /* Redefine yyless() so it works in section 3 code. */
1623 /* Undo effects of setting up yytext. */ \
1624 int yyless_macro_arg = (n); \
1625 YY_LESS_LINENO(yyless_macro_arg);\
1626 yytext[yyleng] = yyg->yy_hold_char; \
1627 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1628 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1629 *yyg->yy_c_buf_p = '\0'; \
1630 yyleng = yyless_macro_arg; \
1634 /* Accessor methods (get/set functions) to struct members. */
1636 /** Get the user-defined data for this scanner.
1637 * @param yyscanner The scanner object.
1639 YY_EXTRA_TYPE cmExpr_yyget_extra (yyscan_t yyscanner)
1641 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1645 /** Get the current line number.
1646 * @param yyscanner The scanner object.
1648 int cmExpr_yyget_lineno (yyscan_t yyscanner)
1650 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1652 if (! YY_CURRENT_BUFFER)
1658 /** Get the current column number.
1659 * @param yyscanner The scanner object.
1661 int cmExpr_yyget_column (yyscan_t yyscanner)
1663 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1665 if (! YY_CURRENT_BUFFER)
1671 /** Get the input stream.
1672 * @param yyscanner The scanner object.
1674 FILE *cmExpr_yyget_in (yyscan_t yyscanner)
1676 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1680 /** Get the output stream.
1681 * @param yyscanner The scanner object.
1683 FILE *cmExpr_yyget_out (yyscan_t yyscanner)
1685 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1689 /** Get the length of the current token.
1690 * @param yyscanner The scanner object.
1692 int cmExpr_yyget_leng (yyscan_t yyscanner)
1694 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1698 /** Get the current token.
1699 * @param yyscanner The scanner object.
1702 char *cmExpr_yyget_text (yyscan_t yyscanner)
1704 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1708 /** Set the user-defined data. This data is never touched by the scanner.
1709 * @param user_defined The data to be associated with this scanner.
1710 * @param yyscanner The scanner object.
1712 void cmExpr_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
1714 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1715 yyextra = user_defined ;
1718 /** Set the current line number.
1719 * @param line_number
1720 * @param yyscanner The scanner object.
1722 void cmExpr_yyset_lineno (int line_number , yyscan_t yyscanner)
1724 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1726 /* lineno is only valid if an input buffer exists. */
1727 if (! YY_CURRENT_BUFFER )
1728 yy_fatal_error( "cmExpr_yyset_lineno called with no buffer" , yyscanner);
1730 yylineno = line_number;
1733 /** Set the current column.
1735 * @param yyscanner The scanner object.
1737 void cmExpr_yyset_column (int column_no , yyscan_t yyscanner)
1739 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1741 /* column is only valid if an input buffer exists. */
1742 if (! YY_CURRENT_BUFFER )
1743 yy_fatal_error( "cmExpr_yyset_column called with no buffer" , yyscanner);
1745 yycolumn = column_no;
1748 /** Set the input stream. This does not discard the current
1750 * @param in_str A readable stream.
1751 * @param yyscanner The scanner object.
1752 * @see cmExpr_yy_switch_to_buffer
1754 void cmExpr_yyset_in (FILE * in_str , yyscan_t yyscanner)
1756 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1760 void cmExpr_yyset_out (FILE * out_str , yyscan_t yyscanner)
1762 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1766 int cmExpr_yyget_debug (yyscan_t yyscanner)
1768 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1769 return yy_flex_debug;
1772 void cmExpr_yyset_debug (int bdebug , yyscan_t yyscanner)
1774 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1775 yy_flex_debug = bdebug ;
1778 /* Accessor methods for yylval and yylloc */
1780 static int yy_init_globals (yyscan_t yyscanner)
1782 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1783 /* Initialization is the same as for the non-reentrant scanner.
1784 This function is called once per scanner lifetime. */
1786 yyg->yy_buffer_stack = 0;
1787 yyg->yy_buffer_stack_top = 0;
1788 yyg->yy_buffer_stack_max = 0;
1789 yyg->yy_c_buf_p = (char *) 0;
1792 yyg->yy_start_stack_ptr = 0;
1793 yyg->yy_start_stack_depth = 0;
1794 yyg->yy_start_stack = (int *) 0;
1796 /* Defined in main.c */
1805 /* For future reference: Set errno on error, since we are called by
1806 * cmExpr_yylex_init()
1811 /* User-visible API */
1813 /* cmExpr_yylex_init is special because it creates the scanner itself, so it is
1814 * the ONLY reentrant function that doesn't take the scanner as the last argument.
1815 * That's why we explicitly handle the declaration, instead of using our macros.
1818 int cmExpr_yylex_init(yyscan_t* ptr_yy_globals)
1821 if (ptr_yy_globals == NULL){
1826 *ptr_yy_globals = (yyscan_t) cmExpr_yyalloc ( sizeof( struct yyguts_t ), NULL );
1828 if (*ptr_yy_globals == NULL){
1833 memset(*ptr_yy_globals,0,sizeof(struct yyguts_t));
1835 return yy_init_globals ( *ptr_yy_globals );
1838 /* cmExpr_yylex_destroy is for both reentrant and non-reentrant scanners. */
1839 int cmExpr_yylex_destroy (yyscan_t yyscanner)
1841 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1843 /* Pop the buffer stack, destroying each element. */
1844 while(YY_CURRENT_BUFFER){
1845 cmExpr_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
1846 YY_CURRENT_BUFFER_LVALUE = NULL;
1847 cmExpr_yypop_buffer_state(yyscanner);
1850 /* Destroy the stack itself. */
1851 cmExpr_yyfree(yyg->yy_buffer_stack ,yyscanner);
1852 yyg->yy_buffer_stack = NULL;
1854 /* Destroy the start condition stack. */
1855 cmExpr_yyfree(yyg->yy_start_stack ,yyscanner );
1856 yyg->yy_start_stack = NULL;
1858 /* Destroy the main struct (reentrant only). */
1859 cmExpr_yyfree ( yyscanner , yyscanner );
1864 * Internal utility routines.
1868 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
1871 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1872 for ( i = 0; i < n; ++i )
1877 #ifdef YY_NEED_STRLEN
1878 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
1881 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1882 for ( n = 0; s[n]; ++n )
1889 void *cmExpr_yyalloc (yy_size_t size , yyscan_t)
1891 return (void *) malloc( size );
1894 void *cmExpr_yyrealloc (void * ptr, yy_size_t size , yyscan_t)
1896 /* The cast to (char *) in the following accommodates both
1897 * implementations that use char* generic pointers, and those
1898 * that use void* generic pointers. It works with the latter
1899 * because both ANSI C and C++ allow castless assignment from
1900 * any pointer type to void*, and deal with argument conversions
1901 * as though doing an assignment.
1903 return (void *) realloc( (char *) ptr, size );
1906 void cmExpr_yyfree (void * ptr , yyscan_t)
1908 free( (char *) ptr ); /* see cmExpr_yyrealloc() for (char *) cast */
1911 #define YYTABLES_NAME "yytables"
1914 #undef YY_FLUSH_BUFFER
1916 #undef yy_new_buffer
1917 #undef yy_set_interactive
1919 #undef YY_DO_BEFORE_ACTION
1921 #ifdef YY_DECL_IS_OURS
1922 #undef YY_DECL_IS_OURS
1925 #line 104 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"