STYLE: Fix typo in GetFilenameLastExtension docs
[cmake.git] / Source / cmExprLexer.cxx
blob7e6c9a482917e118bae26bb52cc9d6542a1f4538
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 */
10 #define FLEX_SCANNER
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
15 #define FLEX_BETA
16 #endif
18 /* First, we deal with platform-specific or compiler-specific issues. */
20 /* begin standard C headers. */
21 #include <stdio.h>
22 #include <string.h>
23 #include <errno.h>
24 #include <stdlib.h>
26 /* end standard C headers. */
28 /* flex integer type definitions */
30 #ifndef FLEXINT_H
31 #define FLEXINT_H
33 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
35 #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
36 #include <inttypes.h>
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;
43 #else
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;
50 #endif /* ! C99 */
52 /* Limits of integral types. */
53 #ifndef INT8_MIN
54 #define INT8_MIN (-128)
55 #endif
56 #ifndef INT16_MIN
57 #define INT16_MIN (-32767-1)
58 #endif
59 #ifndef INT32_MIN
60 #define INT32_MIN (-2147483647-1)
61 #endif
62 #ifndef INT8_MAX
63 #define INT8_MAX (127)
64 #endif
65 #ifndef INT16_MAX
66 #define INT16_MAX (32767)
67 #endif
68 #ifndef INT32_MAX
69 #define INT32_MAX (2147483647)
70 #endif
71 #ifndef UINT8_MAX
72 #define UINT8_MAX (255U)
73 #endif
74 #ifndef UINT16_MAX
75 #define UINT16_MAX (65535U)
76 #endif
77 #ifndef UINT32_MAX
78 #define UINT32_MAX (4294967295U)
79 #endif
81 #endif /* ! FLEXINT_H */
83 #ifdef __cplusplus
85 /* The "const" storage-class-modifier is valid. */
86 #define YY_USE_CONST
88 #else /* ! __cplusplus */
90 #if __STDC__
92 #define YY_USE_CONST
94 #endif /* __STDC__ */
95 #endif /* ! __cplusplus */
97 #ifdef YY_USE_CONST
98 #define yyconst const
99 #else
100 #define yyconst
101 #endif
103 /* Returned upon end-of-file. */
104 #define YY_NULL 0
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
109 * double cast.
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;
117 #endif
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
140 * compatibility.
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. */
154 #ifndef YY_BUF_SIZE
155 #define YY_BUF_SIZE 16384
156 #endif
158 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
159 #define YY_TYPEDEF_YY_BUFFER_STATE
160 typedef struct yy_buffer_state *YY_BUFFER_STATE;
161 #endif
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
170 stream. */
171 #define yyless(n) \
172 do \
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 */ \
182 while ( 0 )
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;
192 #endif
194 #ifndef YY_STRUCT_YY_BUFFER_STATE
195 #define YY_STRUCT_YY_BUFFER_STATE
196 struct yy_buffer_state
198 FILE *yy_input_file;
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
204 * characters.
206 yy_size_t yy_buf_size;
208 /* Number of characters read into yy_ch_buf, not including EOB
209 * characters.
211 int yy_n_chars;
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
215 * delete it.
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
222 * each newline.
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
228 * not.
230 int yy_at_bol;
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
236 * end of it.
238 int yy_fill_buffer;
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
261 * "scanner state".
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] \
267 : NULL)
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 ,
333 yyscan_t yyscanner);
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; \
344 *yy_cp = '\0'; \
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. */
351 struct yy_trans_info
353 flex_int32_t yy_verify;
354 flex_int32_t yy_nxt;
356 static yyconst flex_int16_t yy_accept[23] =
357 { 0,
358 0, 0, 16, 15, 6, 8, 13, 14, 4, 2,
359 3, 5, 1, 15, 15, 9, 7, 10, 1, 11,
360 12, 0
363 static yyconst flex_int32_t yy_ec[256] =
364 { 0,
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,
392 1, 1, 1, 1, 1
395 static yyconst flex_int32_t yy_meta[16] =
396 { 0,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1
401 static yyconst flex_int16_t yy_base[23] =
402 { 0,
403 0, 0, 20, 21, 21, 21, 21, 21, 21, 21,
404 21, 21, 9, 7, 5, 21, 21, 21, 6, 21,
405 21, 21
408 static yyconst flex_int16_t yy_def[23] =
409 { 0,
410 22, 1, 22, 22, 22, 22, 22, 22, 22, 22,
411 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
412 22, 0
415 static yyconst flex_int16_t yy_nxt[37] =
416 { 0,
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] =
424 { 0,
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 /*=========================================================================
442 Program: CMake - Cross-Platform Makefile Generator
443 Module: $RCSfile: cmExprLexer.cxx,v $
444 Language: C++
445 Date: $Date: 2007-09-24 15:16:13 $
446 Version: $Revision: 1.7 $
448 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
449 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
451 This software is distributed WITHOUT ANY WARRANTY; without even
452 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
453 PURPOSE. See the above copyright notices for more information.
455 =========================================================================*/
458 This file must be translated to C and modified to build everywhere.
460 Run flex like this:
462 flex --prefix=cmExpr_yy --header-file=cmExprLexer.h -ocmExprLexer.cxx cmExprLexer.in.l
464 Modify cmExprLexer.cxx:
465 - remove TABs
466 - remove "yyscanner" argument from these methods:
467 yy_fatal_error, cmExpr_yyalloc, cmExpr_yyrealloc, cmExpr_yyfree
468 - remove all YY_BREAK lines occurring right after return statements
469 - change while ( 1 ) to for(;;)
471 Modify cmExprLexer.h:
472 - remove TABs
473 - remove the yy_init_globals function
474 - remove the block that includes unistd.h
475 - remove #line directives (avoids bogus warning on old Sun)
479 #include "cmStandardLexer.h"
481 #include "cmExprParserHelper.h"
483 /* Replace the lexer input function. */
484 #undef YY_INPUT
485 #define YY_INPUT(buf, result, max_size) \
486 { result = yyextra->LexInput(buf, max_size); }
488 /* Include the set of tokens from the parser. */
489 #include "cmExprParserTokens.h"
491 /*--------------------------------------------------------------------------*/
492 #line 518 "/home/andy/vtk/CMake-bin/Source/cmExprLexer.cxx"
494 #define INITIAL 0
496 #ifndef YY_NO_UNISTD_H
497 /* Special case for "unistd.h", since it is non-ANSI. We include it way
498 * down here because we want the user's section 1 to have been scanned first.
499 * The user has a chance to override it with an option.
501 #include <unistd.h>
502 #endif
504 #ifndef YY_EXTRA_TYPE
505 #define YY_EXTRA_TYPE void *
506 #endif
508 /* Holds the entire state of the reentrant scanner. */
509 struct yyguts_t
512 /* User-defined. Not touched by flex. */
513 YY_EXTRA_TYPE yyextra_r;
515 /* The rest are the same as the globals declared in the non-reentrant
516 scanner. */
517 FILE *yyin_r, *yyout_r;
518 size_t yy_buffer_stack_top; /**< index of top of stack. */
519 size_t yy_buffer_stack_max; /**< capacity of stack. */
520 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
521 char yy_hold_char;
522 int yy_n_chars;
523 int yyleng_r;
524 char *yy_c_buf_p;
525 int yy_init;
526 int yy_start;
527 int yy_did_buffer_switch_on_eof;
528 int yy_start_stack_ptr;
529 int yy_start_stack_depth;
530 int *yy_start_stack;
531 yy_state_type yy_last_accepting_state;
532 char* yy_last_accepting_cpos;
534 int yylineno_r;
535 int yy_flex_debug_r;
537 char *yytext_r;
538 int yy_more_flag;
539 int yy_more_len;
541 }; /* end struct yyguts_t */
543 /* Accessor methods to globals.
544 These are made visible to non-reentrant scanners for convenience. */
546 int cmExpr_yylex_destroy (yyscan_t yyscanner );
548 int cmExpr_yyget_debug (yyscan_t yyscanner );
550 void cmExpr_yyset_debug (int debug_flag ,yyscan_t yyscanner );
552 YY_EXTRA_TYPE cmExpr_yyget_extra (yyscan_t yyscanner );
554 void cmExpr_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
556 FILE *cmExpr_yyget_in (yyscan_t yyscanner );
558 void cmExpr_yyset_in (FILE * in_str ,yyscan_t yyscanner );
560 FILE *cmExpr_yyget_out (yyscan_t yyscanner );
562 void cmExpr_yyset_out (FILE * out_str ,yyscan_t yyscanner );
564 int cmExpr_yyget_leng (yyscan_t yyscanner );
566 char *cmExpr_yyget_text (yyscan_t yyscanner );
568 int cmExpr_yyget_lineno (yyscan_t yyscanner );
570 void cmExpr_yyset_lineno (int line_number ,yyscan_t yyscanner );
572 /* Macros after this point can all be overridden by user definitions in
573 * section 1.
576 #ifndef YY_SKIP_YYWRAP
577 #ifdef __cplusplus
578 extern "C" int cmExpr_yywrap (yyscan_t yyscanner );
579 #else
580 extern int cmExpr_yywrap (yyscan_t yyscanner );
581 #endif
582 #endif
584 #ifndef yytext_ptr
585 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
586 #endif
588 #ifdef YY_NEED_STRLEN
589 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
590 #endif
592 #ifndef YY_NO_INPUT
594 #ifdef __cplusplus
595 static int yyinput (yyscan_t yyscanner );
596 #else
597 static int input (yyscan_t yyscanner );
598 #endif
600 #endif
602 /* Amount of stuff to slurp up with each read. */
603 #ifndef YY_READ_BUF_SIZE
604 #define YY_READ_BUF_SIZE 8192
605 #endif
607 /* Copy whatever the last rule matched to the standard output. */
608 #ifndef ECHO
609 /* This used to be an fputs(), but since the string might contain NUL's,
610 * we now use fwrite().
612 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
613 #endif
615 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
616 * is returned in "result".
618 #ifndef YY_INPUT
619 #define YY_INPUT(buf,result,max_size) \
620 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
622 int c = '*'; \
623 size_t n; \
624 for ( n = 0; n < max_size && \
625 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
626 buf[n] = (char) c; \
627 if ( c == '\n' ) \
628 buf[n++] = (char) c; \
629 if ( c == EOF && ferror( yyin ) ) \
630 YY_FATAL_ERROR( "input in flex scanner failed" ); \
631 result = n; \
633 else \
635 errno=0; \
636 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
638 if( errno != EINTR) \
640 YY_FATAL_ERROR( "input in flex scanner failed" ); \
641 break; \
643 errno=0; \
644 clearerr(yyin); \
649 #endif
651 /* No semi-colon after return; correct usage is to write "yyterminate();" -
652 * we don't want an extra ';' after the "return" because that will cause
653 * some compilers to complain about unreachable statements.
655 #ifndef yyterminate
656 #define yyterminate() return YY_NULL
657 #endif
659 /* Number of entries by which start-condition stack grows. */
660 #ifndef YY_START_STACK_INCR
661 #define YY_START_STACK_INCR 25
662 #endif
664 /* Report a fatal error. */
665 #ifndef YY_FATAL_ERROR
666 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
667 #endif
669 /* end tables serialization structures and prototypes */
671 /* Default declaration of generated scanner - a define so the user can
672 * easily add parameters.
674 #ifndef YY_DECL
675 #define YY_DECL_IS_OURS 1
677 extern int cmExpr_yylex (yyscan_t yyscanner);
679 #define YY_DECL int cmExpr_yylex (yyscan_t yyscanner)
680 #endif /* !YY_DECL */
682 /* Code executed at the beginning of each rule, after yytext and yyleng
683 * have been set up.
685 #ifndef YY_USER_ACTION
686 #define YY_USER_ACTION
687 #endif
689 /* Code executed at the end of each rule. */
690 #ifndef YY_BREAK
691 #define YY_BREAK break;
692 #endif
694 #define YY_RULE_SETUP \
695 YY_USER_ACTION
697 /** The main scanner function which does all the work.
699 YY_DECL
701 register yy_state_type yy_current_state;
702 register char *yy_cp, *yy_bp;
703 register int yy_act;
704 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
706 #line 86 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
709 #line 736 "/home/andy/vtk/CMake-bin/Source/cmExprLexer.cxx"
711 if ( yyg->yy_init )
713 yyg->yy_init = 0;
715 #ifdef YY_USER_INIT
716 YY_USER_INIT;
717 #endif
719 if ( ! yyg->yy_start )
720 yyg->yy_start = 1; /* first start state */
722 if ( ! yyin )
723 yyin = stdin;
725 if ( ! yyout )
726 yyout = stdout;
728 if ( ! YY_CURRENT_BUFFER ) {
729 cmExpr_yyensure_buffer_stack (yyscanner);
730 YY_CURRENT_BUFFER_LVALUE =
731 cmExpr_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
734 cmExpr_yy_load_buffer_state(yyscanner );
737 for(;;) /* loops until end-of-file is reached */
739 yy_cp = yyg->yy_c_buf_p;
741 /* Support of yytext. */
742 *yy_cp = yyg->yy_hold_char;
744 /* yy_bp points to the position in yy_ch_buf of the start of
745 * the current run.
747 yy_bp = yy_cp;
749 yy_current_state = yyg->yy_start;
750 yy_match:
753 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
754 if ( yy_accept[yy_current_state] )
756 yyg->yy_last_accepting_state = yy_current_state;
757 yyg->yy_last_accepting_cpos = yy_cp;
759 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
761 yy_current_state = (int) yy_def[yy_current_state];
762 if ( yy_current_state >= 23 )
763 yy_c = yy_meta[(unsigned int) yy_c];
765 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
766 ++yy_cp;
768 while ( yy_base[yy_current_state] != 21 );
770 yy_find_action:
771 yy_act = yy_accept[yy_current_state];
772 if ( yy_act == 0 )
773 { /* have to back up */
774 yy_cp = yyg->yy_last_accepting_cpos;
775 yy_current_state = yyg->yy_last_accepting_state;
776 yy_act = yy_accept[yy_current_state];
779 YY_DO_BEFORE_ACTION;
781 do_action: /* This label is used only to access EOF actions. */
783 switch ( yy_act )
784 { /* beginning of action switch */
785 case 0: /* must back up */
786 /* undo the effects of YY_DO_BEFORE_ACTION */
787 *yy_cp = yyg->yy_hold_char;
788 yy_cp = yyg->yy_last_accepting_cpos;
789 yy_current_state = yyg->yy_last_accepting_state;
790 goto yy_find_action;
792 case 1:
793 YY_RULE_SETUP
794 #line 88 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
795 { yylvalp->Number = atoi(yytext); return exp_NUMBER; }
796 case 2:
797 YY_RULE_SETUP
798 #line 90 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
799 { return exp_PLUS; }
800 case 3:
801 YY_RULE_SETUP
802 #line 91 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
803 { return exp_MINUS; }
804 case 4:
805 YY_RULE_SETUP
806 #line 92 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
807 { return exp_TIMES; }
808 case 5:
809 YY_RULE_SETUP
810 #line 93 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
811 { return exp_DIVIDE; }
812 case 6:
813 YY_RULE_SETUP
814 #line 94 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
815 { return exp_MOD; }
816 case 7:
817 YY_RULE_SETUP
818 #line 95 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
819 { return exp_OR; }
820 case 8:
821 YY_RULE_SETUP
822 #line 96 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
823 { return exp_AND; }
824 case 9:
825 YY_RULE_SETUP
826 #line 97 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
827 { return exp_XOR; }
828 case 10:
829 YY_RULE_SETUP
830 #line 98 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
831 { return exp_NOT; }
832 case 11:
833 YY_RULE_SETUP
834 #line 99 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
835 { return exp_SHIFTLEFT; }
836 case 12:
837 YY_RULE_SETUP
838 #line 100 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
839 { return exp_SHIFTRIGHT; }
840 case 13:
841 YY_RULE_SETUP
842 #line 101 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
843 { return exp_OPENPARENT; }
844 case 14:
845 YY_RULE_SETUP
846 #line 102 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
847 { return exp_CLOSEPARENT; }
848 case 15:
849 YY_RULE_SETUP
850 #line 104 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
851 ECHO;
852 YY_BREAK
853 #line 894 "/home/andy/vtk/CMake-bin/Source/cmExprLexer.cxx"
854 case YY_STATE_EOF(INITIAL):
855 yyterminate();
857 case YY_END_OF_BUFFER:
859 /* Amount of text matched not including the EOB char. */
860 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
862 /* Undo the effects of YY_DO_BEFORE_ACTION. */
863 *yy_cp = yyg->yy_hold_char;
864 YY_RESTORE_YY_MORE_OFFSET
866 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
868 /* We're scanning a new file or input source. It's
869 * possible that this happened because the user
870 * just pointed yyin at a new source and called
871 * cmExpr_yylex(). If so, then we have to assure
872 * consistency between YY_CURRENT_BUFFER and our
873 * globals. Here is the right place to do so, because
874 * this is the first action (other than possibly a
875 * back-up) that will match for the new input source.
877 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
878 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
879 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
882 /* Note that here we test for yy_c_buf_p "<=" to the position
883 * of the first EOB in the buffer, since yy_c_buf_p will
884 * already have been incremented past the NUL character
885 * (since all states make transitions on EOB to the
886 * end-of-buffer state). Contrast this with the test
887 * in input().
889 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
890 { /* This was really a NUL. */
891 yy_state_type yy_next_state;
893 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
895 yy_current_state = yy_get_previous_state( yyscanner );
897 /* Okay, we're now positioned to make the NUL
898 * transition. We couldn't have
899 * yy_get_previous_state() go ahead and do it
900 * for us because it doesn't know how to deal
901 * with the possibility of jamming (and we don't
902 * want to build jamming into it because then it
903 * will run more slowly).
906 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
908 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
910 if ( yy_next_state )
912 /* Consume the NUL. */
913 yy_cp = ++yyg->yy_c_buf_p;
914 yy_current_state = yy_next_state;
915 goto yy_match;
918 else
920 yy_cp = yyg->yy_c_buf_p;
921 goto yy_find_action;
925 else switch ( yy_get_next_buffer( yyscanner ) )
927 case EOB_ACT_END_OF_FILE:
929 yyg->yy_did_buffer_switch_on_eof = 0;
931 if ( cmExpr_yywrap(yyscanner ) )
933 /* Note: because we've taken care in
934 * yy_get_next_buffer() to have set up
935 * yytext, we can now set up
936 * yy_c_buf_p so that if some total
937 * hoser (like flex itself) wants to
938 * call the scanner after we return the
939 * YY_NULL, it'll still work - another
940 * YY_NULL will get returned.
942 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
944 yy_act = YY_STATE_EOF(YY_START);
945 goto do_action;
948 else
950 if ( ! yyg->yy_did_buffer_switch_on_eof )
951 YY_NEW_FILE;
953 break;
956 case EOB_ACT_CONTINUE_SCAN:
957 yyg->yy_c_buf_p =
958 yyg->yytext_ptr + yy_amount_of_matched_text;
960 yy_current_state = yy_get_previous_state( yyscanner );
962 yy_cp = yyg->yy_c_buf_p;
963 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
964 goto yy_match;
966 case EOB_ACT_LAST_MATCH:
967 yyg->yy_c_buf_p =
968 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
970 yy_current_state = yy_get_previous_state( yyscanner );
972 yy_cp = yyg->yy_c_buf_p;
973 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
974 goto yy_find_action;
976 break;
979 default:
980 YY_FATAL_ERROR(
981 "fatal flex scanner internal error--no action found" );
982 } /* end of action switch */
983 } /* end of scanning one token */
984 return 0; /* this should not happen but it silences a warning*/
985 } /* end of cmExpr_yylex */
987 /* yy_get_next_buffer - try to read in a new buffer
989 * Returns a code representing an action:
990 * EOB_ACT_LAST_MATCH -
991 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
992 * EOB_ACT_END_OF_FILE - end of file
994 static int yy_get_next_buffer (yyscan_t yyscanner)
996 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
997 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
998 register char *source = yyg->yytext_ptr;
999 register int number_to_move, i;
1000 int ret_val;
1002 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1003 YY_FATAL_ERROR(
1004 "fatal flex scanner internal error--end of buffer missed" );
1006 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1007 { /* Don't try to fill the buffer, so this is an EOF. */
1008 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1010 /* We matched a single character, the EOB, so
1011 * treat this as a final EOF.
1013 return EOB_ACT_END_OF_FILE;
1016 else
1018 /* We matched some text prior to the EOB, first
1019 * process it.
1021 return EOB_ACT_LAST_MATCH;
1025 /* Try to read more data. */
1027 /* First move last chars to start of buffer. */
1028 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1030 for ( i = 0; i < number_to_move; ++i )
1031 *(dest++) = *(source++);
1033 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1034 /* don't do the read, it's not guaranteed to return an EOF,
1035 * just force an EOF
1037 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1039 else
1041 size_t nuto_read =
1042 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1044 while ( nuto_read <= 0 )
1045 { /* Not enough room in the buffer - grow it. */
1047 /* just a shorter name for the current buffer */
1048 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1050 int yy_c_buf_p_offset =
1051 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1053 if ( b->yy_is_our_buffer )
1055 int new_size = b->yy_buf_size * 2;
1057 if ( new_size <= 0 )
1058 b->yy_buf_size += b->yy_buf_size / 8;
1059 else
1060 b->yy_buf_size *= 2;
1062 b->yy_ch_buf = (char *)
1063 /* Include room in for 2 EOB chars. */
1064 cmExpr_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1066 else
1067 /* Can't grow it, we don't own it. */
1068 b->yy_ch_buf = 0;
1070 if ( ! b->yy_ch_buf )
1071 YY_FATAL_ERROR(
1072 "fatal error - scanner input buffer overflow" );
1074 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1076 nuto_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1077 number_to_move - 1;
1081 if ( nuto_read > YY_READ_BUF_SIZE )
1082 nuto_read = YY_READ_BUF_SIZE;
1084 /* Read in more data. */
1085 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1086 yyg->yy_n_chars, nuto_read );
1088 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1091 if ( yyg->yy_n_chars == 0 )
1093 if ( number_to_move == YY_MORE_ADJ )
1095 ret_val = EOB_ACT_END_OF_FILE;
1096 cmExpr_yyrestart(yyin ,yyscanner);
1099 else
1101 ret_val = EOB_ACT_LAST_MATCH;
1102 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1103 YY_BUFFER_EOF_PENDING;
1107 else
1108 ret_val = EOB_ACT_CONTINUE_SCAN;
1110 yyg->yy_n_chars += number_to_move;
1111 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1112 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1114 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1116 return ret_val;
1119 /* yy_get_previous_state - get the state just before the EOB char was
1120 reached */
1122 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1124 register yy_state_type yy_current_state;
1125 register char *yy_cp;
1126 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1128 yy_current_state = yyg->yy_start;
1130 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1132 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1133 if ( yy_accept[yy_current_state] )
1135 yyg->yy_last_accepting_state = yy_current_state;
1136 yyg->yy_last_accepting_cpos = yy_cp;
1138 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1140 yy_current_state = (int) yy_def[yy_current_state];
1141 if ( yy_current_state >= 23 )
1142 yy_c = yy_meta[(unsigned int) yy_c];
1144 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1147 return yy_current_state;
1150 /* yy_try_NUL_trans - try to make a transition on the NUL character
1152 * synopsis
1153 * next_state = yy_try_NUL_trans( current_state );
1155 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1157 register int yy_is_jam;
1158 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1159 register char *yy_cp = yyg->yy_c_buf_p;
1161 register YY_CHAR yy_c = 1;
1162 if ( yy_accept[yy_current_state] )
1164 yyg->yy_last_accepting_state = yy_current_state;
1165 yyg->yy_last_accepting_cpos = yy_cp;
1167 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1169 yy_current_state = (int) yy_def[yy_current_state];
1170 if ( yy_current_state >= 23 )
1171 yy_c = yy_meta[(unsigned int) yy_c];
1173 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1174 yy_is_jam = (yy_current_state == 22);
1176 return yy_is_jam ? 0 : yy_current_state;
1179 #ifndef YY_NO_INPUT
1180 #ifdef __cplusplus
1181 static int yyinput (yyscan_t yyscanner)
1182 #else
1183 static int input (yyscan_t yyscanner)
1184 #endif
1187 int c;
1188 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1190 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1192 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1194 /* yy_c_buf_p now points to the character we want to return.
1195 * If this occurs *before* the EOB characters, then it's a
1196 * valid NUL; if not, then we've hit the end of the buffer.
1198 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1199 /* This was really a NUL. */
1200 *yyg->yy_c_buf_p = '\0';
1202 else
1203 { /* need more input */
1204 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1205 ++yyg->yy_c_buf_p;
1207 switch ( yy_get_next_buffer( yyscanner ) )
1209 case EOB_ACT_LAST_MATCH:
1210 /* This happens because yy_g_n_b()
1211 * sees that we've accumulated a
1212 * token and flags that we need to
1213 * try matching the token before
1214 * proceeding. But for input(),
1215 * there's no matching to consider.
1216 * So convert the EOB_ACT_LAST_MATCH
1217 * to EOB_ACT_END_OF_FILE.
1220 /* Reset buffer status. */
1221 cmExpr_yyrestart(yyin ,yyscanner);
1223 /*FALLTHROUGH*/
1225 case EOB_ACT_END_OF_FILE:
1227 if ( cmExpr_yywrap(yyscanner ) )
1228 return EOF;
1230 if ( ! yyg->yy_did_buffer_switch_on_eof )
1231 YY_NEW_FILE;
1232 #ifdef __cplusplus
1233 return yyinput(yyscanner);
1234 #else
1235 return input(yyscanner);
1236 #endif
1239 case EOB_ACT_CONTINUE_SCAN:
1240 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1241 break;
1246 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1247 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1248 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1250 return c;
1252 #endif /* ifndef YY_NO_INPUT */
1254 /** Immediately switch to a different input stream.
1255 * @param input_file A readable stream.
1256 * @param yyscanner The scanner object.
1257 * @note This function does not reset the start condition to @c INITIAL .
1259 void cmExpr_yyrestart (FILE * input_file , yyscan_t yyscanner)
1261 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1263 if ( ! YY_CURRENT_BUFFER ){
1264 cmExpr_yyensure_buffer_stack (yyscanner);
1265 YY_CURRENT_BUFFER_LVALUE =
1266 cmExpr_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1269 cmExpr_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1270 cmExpr_yy_load_buffer_state(yyscanner );
1273 /** Switch to a different input buffer.
1274 * @param new_buffer The new input buffer.
1275 * @param yyscanner The scanner object.
1277 void cmExpr_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1279 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1281 /* TODO. We should be able to replace this entire function body
1282 * with
1283 * cmExpr_yypop_buffer_state();
1284 * cmExpr_yypush_buffer_state(new_buffer);
1286 cmExpr_yyensure_buffer_stack (yyscanner);
1287 if ( YY_CURRENT_BUFFER == new_buffer )
1288 return;
1290 if ( YY_CURRENT_BUFFER )
1292 /* Flush out information for old buffer. */
1293 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1294 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1295 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1298 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1299 cmExpr_yy_load_buffer_state(yyscanner );
1301 /* We don't actually know whether we did this switch during
1302 * EOF (cmExpr_yywrap()) processing, but the only time this flag
1303 * is looked at is after cmExpr_yywrap() is called, so it's safe
1304 * to go ahead and always set it.
1306 yyg->yy_did_buffer_switch_on_eof = 1;
1309 static void cmExpr_yy_load_buffer_state (yyscan_t yyscanner)
1311 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1312 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1313 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1314 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1315 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1318 /** Allocate and initialize an input buffer state.
1319 * @param file A readable stream.
1320 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1321 * @param yyscanner The scanner object.
1322 * @return the allocated buffer state.
1324 YY_BUFFER_STATE cmExpr_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1326 YY_BUFFER_STATE b;
1328 b = (YY_BUFFER_STATE) cmExpr_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1329 if ( ! b )
1330 YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yy_create_buffer()" );
1332 b->yy_buf_size = size;
1334 /* yy_ch_buf has to be 2 characters longer than the size given because
1335 * we need to put in 2 end-of-buffer characters.
1337 b->yy_ch_buf = (char *) cmExpr_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1338 if ( ! b->yy_ch_buf )
1339 YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yy_create_buffer()" );
1341 b->yy_is_our_buffer = 1;
1343 cmExpr_yy_init_buffer(b,file ,yyscanner);
1345 return b;
1348 /** Destroy the buffer.
1349 * @param b a buffer created with cmExpr_yy_create_buffer()
1350 * @param yyscanner The scanner object.
1352 void cmExpr_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1354 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1356 if ( ! b )
1357 return;
1359 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1360 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1362 if ( b->yy_is_our_buffer )
1363 cmExpr_yyfree((void *) b->yy_ch_buf ,yyscanner );
1365 cmExpr_yyfree((void *) b ,yyscanner );
1368 #ifndef __cplusplus
1369 extern int isatty (int );
1370 #endif /* __cplusplus */
1372 /* Initializes or reinitializes a buffer.
1373 * This function is sometimes called more than once on the same buffer,
1374 * such as during a cmExpr_yyrestart() or at EOF.
1376 static void cmExpr_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1379 int oerrno = errno;
1380 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1382 cmExpr_yy_flush_buffer(b ,yyscanner);
1384 b->yy_input_file = file;
1385 b->yy_fill_buffer = 1;
1387 /* If b is the current buffer, then cmExpr_yy_init_buffer was _probably_
1388 * called from cmExpr_yyrestart() or through yy_get_next_buffer.
1389 * In that case, we don't want to reset the lineno or column.
1391 if (b != YY_CURRENT_BUFFER){
1392 b->yy_bs_lineno = 1;
1393 b->yy_bs_column = 0;
1396 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1398 errno = oerrno;
1401 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1402 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1403 * @param yyscanner The scanner object.
1405 void cmExpr_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1407 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1408 if ( ! b )
1409 return;
1411 b->yy_n_chars = 0;
1413 /* We always need two end-of-buffer characters. The first causes
1414 * a transition to the end-of-buffer state. The second causes
1415 * a jam in that state.
1417 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1418 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1420 b->yy_buf_pos = &b->yy_ch_buf[0];
1422 b->yy_at_bol = 1;
1423 b->yy_buffer_status = YY_BUFFER_NEW;
1425 if ( b == YY_CURRENT_BUFFER )
1426 cmExpr_yy_load_buffer_state(yyscanner );
1429 /** Pushes the new state onto the stack. The new state becomes
1430 * the current state. This function will allocate the stack
1431 * if necessary.
1432 * @param new_buffer The new state.
1433 * @param yyscanner The scanner object.
1435 void cmExpr_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1437 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1438 if (new_buffer == NULL)
1439 return;
1441 cmExpr_yyensure_buffer_stack(yyscanner);
1443 /* This block is copied from cmExpr_yy_switch_to_buffer. */
1444 if ( YY_CURRENT_BUFFER )
1446 /* Flush out information for old buffer. */
1447 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1448 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1449 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1452 /* Only push if top exists. Otherwise, replace top. */
1453 if (YY_CURRENT_BUFFER)
1454 yyg->yy_buffer_stack_top++;
1455 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1457 /* copied from cmExpr_yy_switch_to_buffer. */
1458 cmExpr_yy_load_buffer_state(yyscanner );
1459 yyg->yy_did_buffer_switch_on_eof = 1;
1462 /** Removes and deletes the top of the stack, if present.
1463 * The next element becomes the new top.
1464 * @param yyscanner The scanner object.
1466 void cmExpr_yypop_buffer_state (yyscan_t yyscanner)
1468 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1469 if (!YY_CURRENT_BUFFER)
1470 return;
1472 cmExpr_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1473 YY_CURRENT_BUFFER_LVALUE = NULL;
1474 if (yyg->yy_buffer_stack_top > 0)
1475 --yyg->yy_buffer_stack_top;
1477 if (YY_CURRENT_BUFFER) {
1478 cmExpr_yy_load_buffer_state(yyscanner );
1479 yyg->yy_did_buffer_switch_on_eof = 1;
1483 /* Allocates the stack if it does not exist.
1484 * Guarantees space for at least one push.
1486 static void cmExpr_yyensure_buffer_stack (yyscan_t yyscanner)
1488 int nuto_alloc;
1489 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1491 if (!yyg->yy_buffer_stack) {
1493 /* First allocation is just for 2 elements, since we don't know if this
1494 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1495 * immediate realloc on the next call.
1497 nuto_alloc = 1;
1498 yyg->yy_buffer_stack = (struct yy_buffer_state**)cmExpr_yyalloc
1499 (nuto_alloc * sizeof(struct yy_buffer_state*)
1500 , yyscanner);
1502 memset(yyg->yy_buffer_stack, 0, nuto_alloc * sizeof(struct yy_buffer_state*));
1504 yyg->yy_buffer_stack_max = nuto_alloc;
1505 yyg->yy_buffer_stack_top = 0;
1506 return;
1509 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1511 /* Increase the buffer to prepare for a possible push. */
1512 int grow_size = 8 /* arbitrary grow size */;
1514 nuto_alloc = yyg->yy_buffer_stack_max + grow_size;
1515 yyg->yy_buffer_stack = (struct yy_buffer_state**)cmExpr_yyrealloc
1516 (yyg->yy_buffer_stack,
1517 nuto_alloc * sizeof(struct yy_buffer_state*)
1518 , yyscanner);
1520 /* zero only the new slots.*/
1521 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1522 yyg->yy_buffer_stack_max = nuto_alloc;
1526 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1527 * @param base the character buffer
1528 * @param size the size in bytes of the character buffer
1529 * @param yyscanner The scanner object.
1530 * @return the newly allocated buffer state object.
1532 YY_BUFFER_STATE cmExpr_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1534 YY_BUFFER_STATE b;
1536 if ( size < 2 ||
1537 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1538 base[size-1] != YY_END_OF_BUFFER_CHAR )
1539 /* They forgot to leave room for the EOB's. */
1540 return 0;
1542 b = (YY_BUFFER_STATE) cmExpr_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1543 if ( ! b )
1544 YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yy_scan_buffer()" );
1546 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1547 b->yy_buf_pos = b->yy_ch_buf = base;
1548 b->yy_is_our_buffer = 0;
1549 b->yy_input_file = 0;
1550 b->yy_n_chars = b->yy_buf_size;
1551 b->yy_is_interactive = 0;
1552 b->yy_at_bol = 1;
1553 b->yy_fill_buffer = 0;
1554 b->yy_buffer_status = YY_BUFFER_NEW;
1556 cmExpr_yy_switch_to_buffer(b ,yyscanner );
1558 return b;
1561 /** Setup the input buffer state to scan a string. The next call to cmExpr_yylex() will
1562 * scan from a @e copy of @a str.
1563 * @param str a NUL-terminated string to scan
1564 * @param yy_str a NUL-terminated string to scan
1565 * @param yyscanner The scanner object.
1566 * @return the newly allocated buffer state object.
1567 * @note If you want to scan bytes that may contain NUL values, then use
1568 * cmExpr_yy_scan_bytes() instead.
1570 YY_BUFFER_STATE cmExpr_yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner)
1573 return cmExpr_yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner);
1576 /** Setup the input buffer state to scan the given bytes. The next call to cmExpr_yylex() will
1577 * scan from a @e copy of @a bytes.
1578 * @param bytes the byte buffer to scan
1579 * @param len the number of bytes in the buffer pointed to by @a bytes.
1580 * @param yyscanner The scanner object.
1581 * @return the newly allocated buffer state object.
1583 YY_BUFFER_STATE cmExpr_yy_scan_bytes (yyconst char * bytes, int len , yyscan_t yyscanner)
1585 YY_BUFFER_STATE b;
1586 char *buf;
1587 yy_size_t n;
1588 int i;
1590 /* Get memory for full buffer, including space for trailing EOB's. */
1591 n = len + 2;
1592 buf = (char *) cmExpr_yyalloc(n ,yyscanner );
1593 if ( ! buf )
1594 YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yy_scan_bytes()" );
1596 for ( i = 0; i < len; ++i )
1597 buf[i] = bytes[i];
1599 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1601 b = cmExpr_yy_scan_buffer(buf,n ,yyscanner);
1602 if ( ! b )
1603 YY_FATAL_ERROR( "bad buffer in cmExpr_yy_scan_bytes()" );
1605 /* It's okay to grow etc. this buffer, and we should throw it
1606 * away when we're done.
1608 b->yy_is_our_buffer = 1;
1610 return b;
1613 #ifndef YY_EXIT_FAILURE
1614 #define YY_EXIT_FAILURE 2
1615 #endif
1617 static void yy_fatal_error (yyconst char* msg , yyscan_t)
1619 (void) fprintf( stderr, "%s\n", msg );
1620 exit( YY_EXIT_FAILURE );
1623 /* Redefine yyless() so it works in section 3 code. */
1625 #undef yyless
1626 #define yyless(n) \
1627 do \
1629 /* Undo effects of setting up yytext. */ \
1630 int yyless_macro_arg = (n); \
1631 YY_LESS_LINENO(yyless_macro_arg);\
1632 yytext[yyleng] = yyg->yy_hold_char; \
1633 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1634 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1635 *yyg->yy_c_buf_p = '\0'; \
1636 yyleng = yyless_macro_arg; \
1638 while ( 0 )
1640 /* Accessor methods (get/set functions) to struct members. */
1642 /** Get the user-defined data for this scanner.
1643 * @param yyscanner The scanner object.
1645 YY_EXTRA_TYPE cmExpr_yyget_extra (yyscan_t yyscanner)
1647 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1648 return yyextra;
1651 /** Get the current line number.
1652 * @param yyscanner The scanner object.
1654 int cmExpr_yyget_lineno (yyscan_t yyscanner)
1656 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1658 if (! YY_CURRENT_BUFFER)
1659 return 0;
1661 return yylineno;
1664 /** Get the current column number.
1665 * @param yyscanner The scanner object.
1667 int cmExpr_yyget_column (yyscan_t yyscanner)
1669 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1671 if (! YY_CURRENT_BUFFER)
1672 return 0;
1674 return yycolumn;
1677 /** Get the input stream.
1678 * @param yyscanner The scanner object.
1680 FILE *cmExpr_yyget_in (yyscan_t yyscanner)
1682 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1683 return yyin;
1686 /** Get the output stream.
1687 * @param yyscanner The scanner object.
1689 FILE *cmExpr_yyget_out (yyscan_t yyscanner)
1691 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1692 return yyout;
1695 /** Get the length of the current token.
1696 * @param yyscanner The scanner object.
1698 int cmExpr_yyget_leng (yyscan_t yyscanner)
1700 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1701 return yyleng;
1704 /** Get the current token.
1705 * @param yyscanner The scanner object.
1708 char *cmExpr_yyget_text (yyscan_t yyscanner)
1710 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1711 return yytext;
1714 /** Set the user-defined data. This data is never touched by the scanner.
1715 * @param user_defined The data to be associated with this scanner.
1716 * @param yyscanner The scanner object.
1718 void cmExpr_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
1720 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1721 yyextra = user_defined ;
1724 /** Set the current line number.
1725 * @param line_number
1726 * @param yyscanner The scanner object.
1728 void cmExpr_yyset_lineno (int line_number , yyscan_t yyscanner)
1730 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1732 /* lineno is only valid if an input buffer exists. */
1733 if (! YY_CURRENT_BUFFER )
1734 yy_fatal_error( "cmExpr_yyset_lineno called with no buffer" , yyscanner);
1736 yylineno = line_number;
1739 /** Set the current column.
1740 * @param line_number
1741 * @param yyscanner The scanner object.
1743 void cmExpr_yyset_column (int column_no , yyscan_t yyscanner)
1745 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1747 /* column is only valid if an input buffer exists. */
1748 if (! YY_CURRENT_BUFFER )
1749 yy_fatal_error( "cmExpr_yyset_column called with no buffer" , yyscanner);
1751 yycolumn = column_no;
1754 /** Set the input stream. This does not discard the current
1755 * input buffer.
1756 * @param in_str A readable stream.
1757 * @param yyscanner The scanner object.
1758 * @see cmExpr_yy_switch_to_buffer
1760 void cmExpr_yyset_in (FILE * in_str , yyscan_t yyscanner)
1762 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1763 yyin = in_str ;
1766 void cmExpr_yyset_out (FILE * out_str , yyscan_t yyscanner)
1768 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1769 yyout = out_str ;
1772 int cmExpr_yyget_debug (yyscan_t yyscanner)
1774 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1775 return yy_flex_debug;
1778 void cmExpr_yyset_debug (int bdebug , yyscan_t yyscanner)
1780 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1781 yy_flex_debug = bdebug ;
1784 /* Accessor methods for yylval and yylloc */
1786 static int yy_init_globals (yyscan_t yyscanner)
1788 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1789 /* Initialization is the same as for the non-reentrant scanner.
1790 This function is called once per scanner lifetime. */
1792 yyg->yy_buffer_stack = 0;
1793 yyg->yy_buffer_stack_top = 0;
1794 yyg->yy_buffer_stack_max = 0;
1795 yyg->yy_c_buf_p = (char *) 0;
1796 yyg->yy_init = 1;
1797 yyg->yy_start = 0;
1798 yyg->yy_start_stack_ptr = 0;
1799 yyg->yy_start_stack_depth = 0;
1800 yyg->yy_start_stack = (int *) 0;
1802 /* Defined in main.c */
1803 #ifdef YY_STDINIT
1804 yyin = stdin;
1805 yyout = stdout;
1806 #else
1807 yyin = (FILE *) 0;
1808 yyout = (FILE *) 0;
1809 #endif
1811 /* For future reference: Set errno on error, since we are called by
1812 * cmExpr_yylex_init()
1814 return 0;
1817 /* User-visible API */
1819 /* cmExpr_yylex_init is special because it creates the scanner itself, so it is
1820 * the ONLY reentrant function that doesn't take the scanner as the last argument.
1821 * That's why we explicitly handle the declaration, instead of using our macros.
1824 int cmExpr_yylex_init(yyscan_t* ptr_yy_globals)
1827 if (ptr_yy_globals == NULL){
1828 errno = EINVAL;
1829 return 1;
1832 *ptr_yy_globals = (yyscan_t) cmExpr_yyalloc ( sizeof( struct yyguts_t ), NULL );
1834 if (*ptr_yy_globals == NULL){
1835 errno = ENOMEM;
1836 return 1;
1839 memset(*ptr_yy_globals,0,sizeof(struct yyguts_t));
1841 return yy_init_globals ( *ptr_yy_globals );
1844 /* cmExpr_yylex_destroy is for both reentrant and non-reentrant scanners. */
1845 int cmExpr_yylex_destroy (yyscan_t yyscanner)
1847 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1849 /* Pop the buffer stack, destroying each element. */
1850 while(YY_CURRENT_BUFFER){
1851 cmExpr_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
1852 YY_CURRENT_BUFFER_LVALUE = NULL;
1853 cmExpr_yypop_buffer_state(yyscanner);
1856 /* Destroy the stack itself. */
1857 cmExpr_yyfree(yyg->yy_buffer_stack ,yyscanner);
1858 yyg->yy_buffer_stack = NULL;
1860 /* Destroy the start condition stack. */
1861 cmExpr_yyfree(yyg->yy_start_stack ,yyscanner );
1862 yyg->yy_start_stack = NULL;
1864 /* Destroy the main struct (reentrant only). */
1865 cmExpr_yyfree ( yyscanner , yyscanner );
1866 return 0;
1870 * Internal utility routines.
1873 #ifndef yytext_ptr
1874 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
1876 register int i;
1877 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1878 for ( i = 0; i < n; ++i )
1879 s1[i] = s2[i];
1881 #endif
1883 #ifdef YY_NEED_STRLEN
1884 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
1886 register int n;
1887 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1888 for ( n = 0; s[n]; ++n )
1891 return n;
1893 #endif
1895 void *cmExpr_yyalloc (yy_size_t size , yyscan_t)
1897 return (void *) malloc( size );
1900 void *cmExpr_yyrealloc (void * ptr, yy_size_t size , yyscan_t)
1902 /* The cast to (char *) in the following accommodates both
1903 * implementations that use char* generic pointers, and those
1904 * that use void* generic pointers. It works with the latter
1905 * because both ANSI C and C++ allow castless assignment from
1906 * any pointer type to void*, and deal with argument conversions
1907 * as though doing an assignment.
1909 return (void *) realloc( (char *) ptr, size );
1912 void cmExpr_yyfree (void * ptr , yyscan_t)
1914 free( (char *) ptr ); /* see cmExpr_yyrealloc() for (char *) cast */
1917 #define YYTABLES_NAME "yytables"
1919 #undef YY_NEW_FILE
1920 #undef YY_FLUSH_BUFFER
1921 #undef yy_set_bol
1922 #undef yy_new_buffer
1923 #undef yy_set_interactive
1924 #undef yytext_ptr
1925 #undef YY_DO_BEFORE_ACTION
1927 #ifdef YY_DECL_IS_OURS
1928 #undef YY_DECL_IS_OURS
1929 #undef YY_DECL
1930 #endif
1931 #line 104 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"