1 #include "cmStandardIncludes.h"
3 #line 2 "cmCommandArgumentLexer.cxx"
5 #line 4 "cmCommandArgumentLexer.cxx"
7 #define YY_INT_ALIGNED short int
9 /* A lexical scanner generated by flex */
12 #define YY_FLEX_MAJOR_VERSION 2
13 #define YY_FLEX_MINOR_VERSION 5
14 #define YY_FLEX_SUBMINOR_VERSION 33
15 #if YY_FLEX_SUBMINOR_VERSION > 0
19 /* First, we deal with platform-specific or compiler-specific issues. */
21 /* begin standard C headers. */
27 /* end standard C headers. */
29 /* flex integer type definitions */
34 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
36 #if __STDC_VERSION__ >= 199901L
38 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
39 * if you want the limit (max/min) macros for int types.
41 #ifndef __STDC_LIMIT_MACROS
42 #define __STDC_LIMIT_MACROS 1
46 typedef int8_t flex_int8_t
;
47 typedef uint8_t flex_uint8_t
;
48 typedef int16_t flex_int16_t
;
49 typedef uint16_t flex_uint16_t
;
50 typedef int32_t flex_int32_t
;
51 typedef uint32_t flex_uint32_t
;
53 typedef signed char flex_int8_t
;
54 typedef short int flex_int16_t
;
55 typedef int flex_int32_t
;
56 typedef unsigned char flex_uint8_t
;
57 typedef unsigned short int flex_uint16_t
;
58 typedef unsigned int flex_uint32_t
;
61 /* Limits of integral types. */
63 #define INT8_MIN (-128)
66 #define INT16_MIN (-32767-1)
69 #define INT32_MIN (-2147483647-1)
72 #define INT8_MAX (127)
75 #define INT16_MAX (32767)
78 #define INT32_MAX (2147483647)
81 #define UINT8_MAX (255U)
84 #define UINT16_MAX (65535U)
87 #define UINT32_MAX (4294967295U)
90 #endif /* ! FLEXINT_H */
94 /* The "const" storage-class-modifier is valid. */
97 #else /* ! __cplusplus */
103 #endif /* __STDC__ */
104 #endif /* ! __cplusplus */
107 #define yyconst const
112 /* Returned upon end-of-file. */
115 /* Promotes a possibly negative, possibly signed char to an unsigned
116 * integer for use as an array index. If the signed char is negative,
117 * we want to instead treat it as an 8-bit unsigned char, hence the
120 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
122 /* An opaque pointer. */
123 #ifndef YY_TYPEDEF_YY_SCANNER_T
124 #define YY_TYPEDEF_YY_SCANNER_T
125 typedef void* yyscan_t
;
128 /* For convenience, these vars (plus the bison vars far below)
129 are macros in the reentrant scanner. */
130 #define yyin yyg->yyin_r
131 #define yyout yyg->yyout_r
132 #define yyextra yyg->yyextra_r
133 #define yyleng yyg->yyleng_r
134 #define yytext yyg->yytext_r
135 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
136 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
137 #define yy_flex_debug yyg->yy_flex_debug_r
139 int cmCommandArgument_yylex_init (yyscan_t
* scanner
);
141 /* Enter a start condition. This macro really ought to take a parameter,
142 * but we do it the disgusting crufty way forced on us by the ()-less
143 * definition of BEGIN.
145 #define BEGIN yyg->yy_start = 1 + 2 *
147 /* Translate the current start state into a value that can be later handed
148 * to BEGIN to return to the state. The YYSTATE alias is for lex
151 #define YY_START ((yyg->yy_start - 1) / 2)
152 #define YYSTATE YY_START
154 /* Action number for EOF rule of a given start state. */
155 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
157 /* Special action meaning "start processing a new file". */
158 #define YY_NEW_FILE cmCommandArgument_yyrestart(yyin ,yyscanner )
160 #define YY_END_OF_BUFFER_CHAR 0
162 /* Size of default input buffer. */
164 #define YY_BUF_SIZE 16384
167 /* The state buf must be large enough to hold one state per character in the main buffer.
169 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
171 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
172 #define YY_TYPEDEF_YY_BUFFER_STATE
173 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
176 #define EOB_ACT_CONTINUE_SCAN 0
177 #define EOB_ACT_END_OF_FILE 1
178 #define EOB_ACT_LAST_MATCH 2
180 #define YY_LESS_LINENO(n)
182 /* Return all but the first "n" matched characters back to the input stream. */
186 /* Undo effects of setting up yytext. */ \
187 int yyless_macro_arg = (n); \
188 YY_LESS_LINENO(yyless_macro_arg);\
189 *yy_cp = yyg->yy_hold_char; \
190 YY_RESTORE_YY_MORE_OFFSET \
191 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
192 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
196 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
198 /* The following is because we cannot portably get our hands on size_t
199 * (without autoconf's help, which isn't available because we want
200 * flex-generated scanners to compile on their own).
203 #ifndef YY_TYPEDEF_YY_SIZE_T
204 #define YY_TYPEDEF_YY_SIZE_T
205 typedef unsigned int yy_size_t
;
208 #ifndef YY_STRUCT_YY_BUFFER_STATE
209 #define YY_STRUCT_YY_BUFFER_STATE
210 struct yy_buffer_state
214 char *yy_ch_buf
; /* input buffer */
215 char *yy_buf_pos
; /* current position in input buffer */
217 /* Size of input buffer in bytes, not including room for EOB
220 yy_size_t yy_buf_size
;
222 /* Number of characters read into yy_ch_buf, not including EOB
227 /* Whether we "own" the buffer - i.e., we know we created it,
228 * and can realloc() it to grow it, and should free() it to
231 int yy_is_our_buffer
;
233 /* Whether this is an "interactive" input source; if so, and
234 * if we're using stdio for input, then we want to use getc()
235 * instead of fread(), to make sure we stop fetching input after
238 int yy_is_interactive
;
240 /* Whether we're considered to be at the beginning of a line.
241 * If so, '^' rules will be active on the next match, otherwise
246 int yy_bs_lineno
; /**< The line count. */
247 int yy_bs_column
; /**< The column count. */
249 /* Whether to try to fill the input buffer when we reach the
254 int yy_buffer_status
;
256 #define YY_BUFFER_NEW 0
257 #define YY_BUFFER_NORMAL 1
258 /* When an EOF's been seen but there's still some text to process
259 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
260 * shouldn't try reading from the input source any more. We might
261 * still have a bunch of tokens to match, though, because of
262 * possible backing-up.
264 * When we actually see the EOF, we change the status to "new"
265 * (via cmCommandArgument_yyrestart()), so that the user can continue scanning by
266 * just pointing yyin at a new input file.
268 #define YY_BUFFER_EOF_PENDING 2
271 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
273 /* We provide macros for accessing buffer states in case in the
274 * future we want to put the buffer states in a more general
277 * Returns the top of the stack, or NULL.
279 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
280 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
283 /* Same as previous macro, but useful when we know that the buffer stack is not
284 * NULL or when we need an lvalue. For internal use only.
286 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
288 void cmCommandArgument_yyrestart (FILE *input_file
,yyscan_t yyscanner
);
289 void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
290 YY_BUFFER_STATE
cmCommandArgument_yy_create_buffer (FILE *file
,int size
,yyscan_t yyscanner
);
291 void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
292 void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
293 void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
294 void cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner
);
296 static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner
);
297 static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner
);
298 static void cmCommandArgument_yy_init_buffer (YY_BUFFER_STATE b
,FILE *file
,yyscan_t yyscanner
);
300 #define YY_FLUSH_BUFFER cmCommandArgument_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
302 YY_BUFFER_STATE
cmCommandArgument_yy_scan_buffer (char *base
,yy_size_t size
,yyscan_t yyscanner
);
303 YY_BUFFER_STATE
cmCommandArgument_yy_scan_string (yyconst
char *yy_str
,yyscan_t yyscanner
);
304 YY_BUFFER_STATE
cmCommandArgument_yy_scan_bytes (yyconst
char *bytes
,int len
,yyscan_t yyscanner
);
306 void *cmCommandArgument_yyalloc (yy_size_t
,yyscan_t yyscanner
);
307 void *cmCommandArgument_yyrealloc (void *,yy_size_t
,yyscan_t yyscanner
);
308 void cmCommandArgument_yyfree (void * ,yyscan_t yyscanner
);
310 #define yy_new_buffer cmCommandArgument_yy_create_buffer
312 #define yy_set_interactive(is_interactive) \
314 if ( ! YY_CURRENT_BUFFER ){ \
315 cmCommandArgument_yyensure_buffer_stack (yyscanner); \
316 YY_CURRENT_BUFFER_LVALUE = \
317 cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
319 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
322 #define yy_set_bol(at_bol) \
324 if ( ! YY_CURRENT_BUFFER ){\
325 cmCommandArgument_yyensure_buffer_stack (yyscanner); \
326 YY_CURRENT_BUFFER_LVALUE = \
327 cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
329 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
332 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
334 /* Begin user sect3 */
336 #define cmCommandArgument_yywrap(n) 1
337 #define YY_SKIP_YYWRAP
339 typedef unsigned char YY_CHAR
;
341 typedef int yy_state_type
;
343 #define yytext_ptr yytext_r
345 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
);
346 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
,yyscan_t yyscanner
);
347 static int yy_get_next_buffer (yyscan_t yyscanner
);
348 static void yy_fatal_error (yyconst
char msg
[] ,yyscan_t yyscanner
);
350 /* Done after the current pattern has been matched and before the
351 * corresponding action - sets up yytext.
353 #define YY_DO_BEFORE_ACTION \
354 yyg->yytext_ptr = yy_bp; \
355 yyleng = (size_t) (yy_cp - yy_bp); \
356 yyg->yy_hold_char = *yy_cp; \
358 yyg->yy_c_buf_p = yy_cp;
360 #define YY_NUM_RULES 13
361 #define YY_END_OF_BUFFER 14
362 /* This struct is not used in this scanner,
363 but its presence is necessary. */
366 flex_int32_t yy_verify
;
369 static yyconst flex_int16_t yy_accept
[26] =
371 0, 0, 0, 0, 0, 0, 14, 8, 9, 6,
372 5, 13, 10, 4, 11, 12, 8, 0, 3, 6,
376 static yyconst flex_int32_t yy_ec
[256] =
378 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
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, 3, 1, 1, 1, 1,
382 1, 1, 4, 1, 4, 4, 4, 4, 4, 4,
383 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
384 1, 1, 1, 5, 4, 4, 4, 4, 4, 4,
385 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
386 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
387 1, 6, 1, 1, 4, 1, 4, 4, 4, 4,
389 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
390 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
391 4, 4, 7, 1, 8, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 static yyconst flex_int32_t yy_meta
[9] =
410 1, 2, 3, 1, 3, 3, 3, 3
413 static yyconst flex_int16_t yy_base
[28] =
415 0, 0, 18, 17, 16, 15, 20, 0, 5, 14,
416 7, 25, 25, 25, 0, 25, 0, 3, 25, 0,
417 9, 25, 25, 25, 25, 14, 16
420 static yyconst flex_int16_t yy_def
[28] =
422 25, 1, 1, 1, 1, 1, 25, 26, 25, 26,
423 25, 25, 25, 25, 27, 25, 26, 9, 25, 10,
424 25, 25, 25, 25, 0, 25, 25
427 static yyconst flex_int16_t yy_nxt
[34] =
429 8, 8, 9, 10, 11, 12, 13, 14, 18, 23,
430 21, 19, 21, 24, 17, 17, 22, 20, 22, 25,
431 16, 16, 15, 15, 7, 25, 25, 25, 25, 25,
435 static yyconst flex_int16_t yy_chk
[34] =
437 1, 1, 1, 1, 1, 1, 1, 1, 9, 18,
438 11, 9, 21, 21, 26, 26, 27, 10, 27, 7,
439 6, 5, 4, 3, 25, 25, 25, 25, 25, 25,
443 /* The intent behind this definition is that it'll catch
444 * any uses of REJECT which flex missed.
446 #define REJECT reject_used_but_not_detected
447 #define yymore() yymore_used_but_not_detected
448 #define YY_MORE_ADJ 0
449 #define YY_RESTORE_YY_MORE_OFFSET
450 #line 1 "cmCommandArgumentLexer.in.l"
451 #line 2 "cmCommandArgumentLexer.in.l"
452 /*=========================================================================
454 Program: CMake - Cross-Platform Makefile Generator
455 Module: $RCSfile: cmCommandArgumentLexer.cxx,v $
457 Date: $Date: 2007-09-24 15:16:13 $
458 Version: $Revision: 1.15 $
460 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
461 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
463 This software is distributed WITHOUT ANY WARRANTY; without even
464 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
465 PURPOSE. See the above copyright notices for more information.
467 =========================================================================*/
470 This file must be translated to C and modified to build everywhere.
474 flex --prefix=cmCommandArgument_yy --header-file=cmCommandArgumentLexer.h -ocmCommandArgumentLexer.cxx cmCommandArgumentLexer.in.l
476 Modify cmCommandArgumentLexer.cxx:
478 - remove "yyscanner" argument from these methods:
479 yy_fatal_error, cmCommandArgument_yyalloc, cmCommandArgument_yyrealloc, cmCommandArgument_yyfree
480 - remove all YY_BREAK lines occurring right after return statements
481 - change while ( 1 ) to for(;;)
483 Modify cmCommandArgumentLexer.h:
485 - remove the yy_init_globals function
486 - remove the block that includes unistd.h
487 - remove #line directives (avoids bogus warning on old Sun)
491 #include "cmStandardLexer.h"
493 #include "cmCommandArgumentParserHelper.h"
495 /* Replace the lexer input function. */
497 #define YY_INPUT(buf, result, max_size) \
498 { result = yyextra->LexInput(buf, max_size); }
500 /* Include the set of tokens from the parser. */
501 #include "cmCommandArgumentParserTokens.h"
503 /*--------------------------------------------------------------------------*/
506 #line 505 "cmCommandArgumentLexer.cxx"
512 #ifndef YY_NO_UNISTD_H
513 /* Special case for "unistd.h", since it is non-ANSI. We include it way
514 * down here because we want the user's section 1 to have been scanned first.
515 * The user has a chance to override it with an option.
520 #ifndef YY_EXTRA_TYPE
521 #define YY_EXTRA_TYPE void *
524 /* Holds the entire state of the reentrant scanner. */
528 /* User-defined. Not touched by flex. */
529 YY_EXTRA_TYPE yyextra_r
;
531 /* The rest are the same as the globals declared in the non-reentrant scanner. */
532 FILE *yyin_r
, *yyout_r
;
533 size_t yy_buffer_stack_top
; /**< index of top of stack. */
534 size_t yy_buffer_stack_max
; /**< capacity of stack. */
535 YY_BUFFER_STATE
* yy_buffer_stack
; /**< Stack as an array. */
542 int yy_did_buffer_switch_on_eof
;
543 int yy_start_stack_ptr
;
544 int yy_start_stack_depth
;
546 yy_state_type yy_last_accepting_state
;
547 char* yy_last_accepting_cpos
;
556 }; /* end struct yyguts_t */
558 static int yy_init_globals (yyscan_t yyscanner
);
560 /* Accessor methods to globals.
561 These are made visible to non-reentrant scanners for convenience. */
563 int cmCommandArgument_yylex_destroy (yyscan_t yyscanner
);
565 int cmCommandArgument_yyget_debug (yyscan_t yyscanner
);
567 void cmCommandArgument_yyset_debug (int debug_flag
,yyscan_t yyscanner
);
569 YY_EXTRA_TYPE
cmCommandArgument_yyget_extra (yyscan_t yyscanner
);
571 void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined
,yyscan_t yyscanner
);
573 FILE *cmCommandArgument_yyget_in (yyscan_t yyscanner
);
575 void cmCommandArgument_yyset_in (FILE * in_str
,yyscan_t yyscanner
);
577 FILE *cmCommandArgument_yyget_out (yyscan_t yyscanner
);
579 void cmCommandArgument_yyset_out (FILE * out_str
,yyscan_t yyscanner
);
581 int cmCommandArgument_yyget_leng (yyscan_t yyscanner
);
583 char *cmCommandArgument_yyget_text (yyscan_t yyscanner
);
585 int cmCommandArgument_yyget_lineno (yyscan_t yyscanner
);
587 void cmCommandArgument_yyset_lineno (int line_number
,yyscan_t yyscanner
);
589 /* Macros after this point can all be overridden by user definitions in
593 #ifndef YY_SKIP_YYWRAP
595 extern "C" int cmCommandArgument_yywrap (yyscan_t yyscanner
);
597 extern int cmCommandArgument_yywrap (yyscan_t yyscanner
);
602 static void yy_flex_strncpy (char *,yyconst
char *,int ,yyscan_t yyscanner
);
605 #ifdef YY_NEED_STRLEN
606 static int yy_flex_strlen (yyconst
char * ,yyscan_t yyscanner
);
612 static int yyinput (yyscan_t yyscanner
);
614 static int input (yyscan_t yyscanner
);
619 /* Amount of stuff to slurp up with each read. */
620 #ifndef YY_READ_BUF_SIZE
621 #define YY_READ_BUF_SIZE 8192
624 /* Copy whatever the last rule matched to the standard output. */
626 /* This used to be an fputs(), but since the string might contain NUL's,
627 * we now use fwrite().
629 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
632 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
633 * is returned in "result".
636 #define YY_INPUT(buf,result,max_size) \
637 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
641 for ( n = 0; n < max_size && \
642 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
645 buf[n++] = (char) c; \
646 if ( c == EOF && ferror( yyin ) ) \
647 YY_FATAL_ERROR( "input in flex scanner failed" ); \
653 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
655 if( errno != EINTR) \
657 YY_FATAL_ERROR( "input in flex scanner failed" ); \
668 /* No semi-colon after return; correct usage is to write "yyterminate();" -
669 * we don't want an extra ';' after the "return" because that will cause
670 * some compilers to complain about unreachable statements.
673 #define yyterminate() return YY_NULL
676 /* Number of entries by which start-condition stack grows. */
677 #ifndef YY_START_STACK_INCR
678 #define YY_START_STACK_INCR 25
681 /* Report a fatal error. */
682 #ifndef YY_FATAL_ERROR
683 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
686 /* end tables serialization structures and prototypes */
688 /* Default declaration of generated scanner - a define so the user can
689 * easily add parameters.
692 #define YY_DECL_IS_OURS 1
694 extern int cmCommandArgument_yylex (yyscan_t yyscanner
);
696 #define YY_DECL int cmCommandArgument_yylex (yyscan_t yyscanner)
697 #endif /* !YY_DECL */
699 /* Code executed at the beginning of each rule, after yytext and yyleng
702 #ifndef YY_USER_ACTION
703 #define YY_USER_ACTION
706 /* Code executed at the end of each rule. */
708 #define YY_BREAK break;
711 #define YY_RULE_SETUP \
714 /** The main scanner function which does all the work.
718 register yy_state_type yy_current_state
;
719 register char *yy_cp
, *yy_bp
;
721 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
723 #line 62 "cmCommandArgumentLexer.in.l"
726 #line 727 "cmCommandArgumentLexer.cxx"
736 if ( ! yyg
->yy_start
)
737 yyg
->yy_start
= 1; /* first start state */
745 if ( ! YY_CURRENT_BUFFER
) {
746 cmCommandArgument_yyensure_buffer_stack (yyscanner
);
747 YY_CURRENT_BUFFER_LVALUE
=
748 cmCommandArgument_yy_create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
751 cmCommandArgument_yy_load_buffer_state(yyscanner
);
754 for(;;) /* loops until end-of-file is reached */
756 yy_cp
= yyg
->yy_c_buf_p
;
758 /* Support of yytext. */
759 *yy_cp
= yyg
->yy_hold_char
;
761 /* yy_bp points to the position in yy_ch_buf of the start of
766 yy_current_state
= yyg
->yy_start
;
770 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
771 if ( yy_accept
[yy_current_state
] )
773 yyg
->yy_last_accepting_state
= yy_current_state
;
774 yyg
->yy_last_accepting_cpos
= yy_cp
;
776 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
778 yy_current_state
= (int) yy_def
[yy_current_state
];
779 if ( yy_current_state
>= 26 )
780 yy_c
= yy_meta
[(unsigned int) yy_c
];
782 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
785 while ( yy_base
[yy_current_state
] != 25 );
788 yy_act
= yy_accept
[yy_current_state
];
790 { /* have to back up */
791 yy_cp
= yyg
->yy_last_accepting_cpos
;
792 yy_current_state
= yyg
->yy_last_accepting_state
;
793 yy_act
= yy_accept
[yy_current_state
];
798 do_action
: /* This label is used only to access EOF actions. */
801 { /* beginning of action switch */
802 case 0: /* must back up */
803 /* undo the effects of YY_DO_BEFORE_ACTION */
804 *yy_cp
= yyg
->yy_hold_char
;
805 yy_cp
= yyg
->yy_last_accepting_cpos
;
806 yy_current_state
= yyg
->yy_last_accepting_state
;
811 #line 64 "cmCommandArgumentLexer.in.l"
813 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
814 yyextra
->AllocateParserType(yylvalp
, yytext
+1, strlen(yytext
)-2);
819 #line 70 "cmCommandArgumentLexer.in.l"
821 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
822 yyextra
->AllocateParserType(yylvalp
, yytext
+1, strlen(yytext
)-2);
827 #line 76 "cmCommandArgumentLexer.in.l"
829 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
830 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
831 yylvalp
->str
= yyextra
->DCURLYVariable
;
836 #line 83 "cmCommandArgumentLexer.in.l"
838 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
839 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
840 yylvalp
->str
= yyextra
->RCURLYVariable
;
845 #line 90 "cmCommandArgumentLexer.in.l"
847 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
848 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
849 yylvalp
->str
= yyextra
->ATVariable
;
854 #line 97 "cmCommandArgumentLexer.in.l"
856 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
857 yyextra
->AllocateParserType(yylvalp
, yytext
, strlen(yytext
));
862 #line 103 "cmCommandArgumentLexer.in.l"
864 if ( !yyextra
->HandleEscapeSymbol(yylvalp
, *(yytext
+1)) )
871 /* rule 8 can match eol */
873 #line 111 "cmCommandArgumentLexer.in.l"
875 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
876 yyextra
->AllocateParserType(yylvalp
, yytext
, strlen(yytext
));
881 #line 117 "cmCommandArgumentLexer.in.l"
883 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
884 yylvalp
->str
= yyextra
->DOLLARVariable
;
889 #line 123 "cmCommandArgumentLexer.in.l"
891 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
892 yylvalp
->str
= yyextra
->LCURLYVariable
;
897 #line 129 "cmCommandArgumentLexer.in.l"
899 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
900 yylvalp
->str
= yyextra
->BSLASHVariable
;
905 #line 135 "cmCommandArgumentLexer.in.l"
907 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
908 yylvalp
->str
= yyextra
->BSLASHVariable
;
913 #line 141 "cmCommandArgumentLexer.in.l"
916 #line 929 "cmCommandArgumentLexer.cxx"
917 case YY_STATE_EOF(INITIAL
):
918 case YY_STATE_EOF(ESCAPES
):
919 case YY_STATE_EOF(NOESCAPES
):
922 case YY_END_OF_BUFFER
:
924 /* Amount of text matched not including the EOB char. */
925 int yy_amount_of_matched_text
= (int) (yy_cp
- yyg
->yytext_ptr
) - 1;
927 /* Undo the effects of YY_DO_BEFORE_ACTION. */
928 *yy_cp
= yyg
->yy_hold_char
;
929 YY_RESTORE_YY_MORE_OFFSET
931 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
933 /* We're scanning a new file or input source. It's
934 * possible that this happened because the user
935 * just pointed yyin at a new source and called
936 * cmCommandArgument_yylex(). If so, then we have to assure
937 * consistency between YY_CURRENT_BUFFER and our
938 * globals. Here is the right place to do so, because
939 * this is the first action (other than possibly a
940 * back-up) that will match for the new input source.
942 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
943 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= yyin
;
944 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
947 /* Note that here we test for yy_c_buf_p "<=" to the position
948 * of the first EOB in the buffer, since yy_c_buf_p will
949 * already have been incremented past the NUL character
950 * (since all states make transitions on EOB to the
951 * end-of-buffer state). Contrast this with the test
954 if ( yyg
->yy_c_buf_p
<= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
955 { /* This was really a NUL. */
956 yy_state_type yy_next_state
;
958 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
960 yy_current_state
= yy_get_previous_state( yyscanner
);
962 /* Okay, we're now positioned to make the NUL
963 * transition. We couldn't have
964 * yy_get_previous_state() go ahead and do it
965 * for us because it doesn't know how to deal
966 * with the possibility of jamming (and we don't
967 * want to build jamming into it because then it
968 * will run more slowly).
971 yy_next_state
= yy_try_NUL_trans( yy_current_state
, yyscanner
);
973 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
977 /* Consume the NUL. */
978 yy_cp
= ++yyg
->yy_c_buf_p
;
979 yy_current_state
= yy_next_state
;
985 yy_cp
= yyg
->yy_c_buf_p
;
990 else switch ( yy_get_next_buffer( yyscanner
) )
992 case EOB_ACT_END_OF_FILE
:
994 yyg
->yy_did_buffer_switch_on_eof
= 0;
996 if ( cmCommandArgument_yywrap(yyscanner
) )
998 /* Note: because we've taken care in
999 * yy_get_next_buffer() to have set up
1000 * yytext, we can now set up
1001 * yy_c_buf_p so that if some total
1002 * hoser (like flex itself) wants to
1003 * call the scanner after we return the
1004 * YY_NULL, it'll still work - another
1005 * YY_NULL will get returned.
1007 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1009 yy_act
= YY_STATE_EOF(YY_START
);
1015 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1021 case EOB_ACT_CONTINUE_SCAN
:
1023 yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
1025 yy_current_state
= yy_get_previous_state( yyscanner
);
1027 yy_cp
= yyg
->yy_c_buf_p
;
1028 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1031 case EOB_ACT_LAST_MATCH
:
1033 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
];
1035 yy_current_state
= yy_get_previous_state( yyscanner
);
1037 yy_cp
= yyg
->yy_c_buf_p
;
1038 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1039 goto yy_find_action
;
1046 "fatal flex scanner internal error--no action found" );
1047 } /* end of action switch */
1048 } /* end of scanning one token */
1049 return 0; /* this should not happend but it should silence a warning */
1050 } /* end of cmCommandArgument_yylex */
1052 /* yy_get_next_buffer - try to read in a new buffer
1054 * Returns a code representing an action:
1055 * EOB_ACT_LAST_MATCH -
1056 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1057 * EOB_ACT_END_OF_FILE - end of file
1059 static int yy_get_next_buffer (yyscan_t yyscanner
)
1061 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1062 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
1063 register char *source
= yyg
->yytext_ptr
;
1064 register int number_to_move
, i
;
1067 if ( yyg
->yy_c_buf_p
> &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] )
1069 "fatal flex scanner internal error--end of buffer missed" );
1071 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
1072 { /* Don't try to fill the buffer, so this is an EOF. */
1073 if ( yyg
->yy_c_buf_p
- yyg
->yytext_ptr
- YY_MORE_ADJ
== 1 )
1075 /* We matched a single character, the EOB, so
1076 * treat this as a final EOF.
1078 return EOB_ACT_END_OF_FILE
;
1083 /* We matched some text prior to the EOB, first
1086 return EOB_ACT_LAST_MATCH
;
1090 /* Try to read more data. */
1092 /* First move last chars to start of buffer. */
1093 number_to_move
= (int) (yyg
->yy_c_buf_p
- yyg
->yytext_ptr
) - 1;
1095 for ( i
= 0; i
< number_to_move
; ++i
)
1096 *(dest
++) = *(source
++);
1098 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1099 /* don't do the read, it's not guaranteed to return an EOF,
1102 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
= 0;
1107 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
1109 while ( num_to_read
<= 0 )
1110 { /* Not enough room in the buffer - grow it. */
1112 /* just a shorter name for the current buffer */
1113 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
1115 int yy_c_buf_p_offset
=
1116 (int) (yyg
->yy_c_buf_p
- b
->yy_ch_buf
);
1118 if ( b
->yy_is_our_buffer
)
1120 int new_size
= b
->yy_buf_size
* 2;
1122 if ( new_size
<= 0 )
1123 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1125 b
->yy_buf_size
*= 2;
1127 b
->yy_ch_buf
= (char *)
1128 /* Include room in for 2 EOB chars. */
1129 cmCommandArgument_yyrealloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 ,yyscanner
);
1132 /* Can't grow it, we don't own it. */
1135 if ( ! b
->yy_ch_buf
)
1137 "fatal error - scanner input buffer overflow" );
1139 yyg
->yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1141 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
1146 if ( num_to_read
> YY_READ_BUF_SIZE
)
1147 num_to_read
= YY_READ_BUF_SIZE
;
1149 /* Read in more data. */
1150 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
1151 yyg
->yy_n_chars
, (size_t) num_to_read
);
1153 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1156 if ( yyg
->yy_n_chars
== 0 )
1158 if ( number_to_move
== YY_MORE_ADJ
)
1160 ret_val
= EOB_ACT_END_OF_FILE
;
1161 cmCommandArgument_yyrestart(yyin
,yyscanner
);
1166 ret_val
= EOB_ACT_LAST_MATCH
;
1167 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
1168 YY_BUFFER_EOF_PENDING
;
1173 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1175 yyg
->yy_n_chars
+= number_to_move
;
1176 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1177 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1179 yyg
->yytext_ptr
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
1184 /* yy_get_previous_state - get the state just before the EOB char was reached */
1186 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
)
1188 register yy_state_type yy_current_state
;
1189 register char *yy_cp
;
1190 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1192 yy_current_state
= yyg
->yy_start
;
1194 for ( yy_cp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yyg
->yy_c_buf_p
; ++yy_cp
)
1196 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1197 if ( yy_accept
[yy_current_state
] )
1199 yyg
->yy_last_accepting_state
= yy_current_state
;
1200 yyg
->yy_last_accepting_cpos
= yy_cp
;
1202 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1204 yy_current_state
= (int) yy_def
[yy_current_state
];
1205 if ( yy_current_state
>= 26 )
1206 yy_c
= yy_meta
[(unsigned int) yy_c
];
1208 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1211 return yy_current_state
;
1214 /* yy_try_NUL_trans - try to make a transition on the NUL character
1217 * next_state = yy_try_NUL_trans( current_state );
1219 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
, yyscan_t yyscanner
)
1221 register int yy_is_jam
;
1222 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
; /* This var may be unused depending upon options. */
1223 register char *yy_cp
= yyg
->yy_c_buf_p
;
1225 register YY_CHAR yy_c
= 1;
1226 if ( yy_accept
[yy_current_state
] )
1228 yyg
->yy_last_accepting_state
= yy_current_state
;
1229 yyg
->yy_last_accepting_cpos
= yy_cp
;
1231 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1233 yy_current_state
= (int) yy_def
[yy_current_state
];
1234 if ( yy_current_state
>= 26 )
1235 yy_c
= yy_meta
[(unsigned int) yy_c
];
1237 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1238 yy_is_jam
= (yy_current_state
== 25);
1240 return yy_is_jam
? 0 : yy_current_state
;
1245 static int yyinput (yyscan_t yyscanner
)
1247 static int input (yyscan_t yyscanner
)
1252 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1254 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1256 if ( *yyg
->yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1258 /* yy_c_buf_p now points to the character we want to return.
1259 * If this occurs *before* the EOB characters, then it's a
1260 * valid NUL; if not, then we've hit the end of the buffer.
1262 if ( yyg
->yy_c_buf_p
< &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
1263 /* This was really a NUL. */
1264 *yyg
->yy_c_buf_p
= '\0';
1267 { /* need more input */
1268 int offset
= yyg
->yy_c_buf_p
- yyg
->yytext_ptr
;
1271 switch ( yy_get_next_buffer( yyscanner
) )
1273 case EOB_ACT_LAST_MATCH
:
1274 /* This happens because yy_g_n_b()
1275 * sees that we've accumulated a
1276 * token and flags that we need to
1277 * try matching the token before
1278 * proceeding. But for input(),
1279 * there's no matching to consider.
1280 * So convert the EOB_ACT_LAST_MATCH
1281 * to EOB_ACT_END_OF_FILE.
1284 /* Reset buffer status. */
1285 cmCommandArgument_yyrestart(yyin
,yyscanner
);
1289 case EOB_ACT_END_OF_FILE
:
1291 if ( cmCommandArgument_yywrap(yyscanner
) )
1294 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1297 return yyinput(yyscanner
);
1299 return input(yyscanner
);
1303 case EOB_ACT_CONTINUE_SCAN
:
1304 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ offset
;
1310 c
= *(unsigned char *) yyg
->yy_c_buf_p
; /* cast for 8-bit char's */
1311 *yyg
->yy_c_buf_p
= '\0'; /* preserve yytext */
1312 yyg
->yy_hold_char
= *++yyg
->yy_c_buf_p
;
1316 #endif /* ifndef YY_NO_INPUT */
1318 /** Immediately switch to a different input stream.
1319 * @param input_file A readable stream.
1320 * @param yyscanner The scanner object.
1321 * @note This function does not reset the start condition to @c INITIAL .
1323 void cmCommandArgument_yyrestart (FILE * input_file
, yyscan_t yyscanner
)
1325 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1327 if ( ! YY_CURRENT_BUFFER
){
1328 cmCommandArgument_yyensure_buffer_stack (yyscanner
);
1329 YY_CURRENT_BUFFER_LVALUE
=
1330 cmCommandArgument_yy_create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
1333 cmCommandArgument_yy_init_buffer(YY_CURRENT_BUFFER
,input_file
,yyscanner
);
1334 cmCommandArgument_yy_load_buffer_state(yyscanner
);
1337 /** Switch to a different input buffer.
1338 * @param new_buffer The new input buffer.
1339 * @param yyscanner The scanner object.
1341 void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1343 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1345 /* TODO. We should be able to replace this entire function body
1347 * cmCommandArgument_yypop_buffer_state();
1348 * cmCommandArgument_yypush_buffer_state(new_buffer);
1350 cmCommandArgument_yyensure_buffer_stack (yyscanner
);
1351 if ( YY_CURRENT_BUFFER
== new_buffer
)
1354 if ( YY_CURRENT_BUFFER
)
1356 /* Flush out information for old buffer. */
1357 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1358 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1359 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1362 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1363 cmCommandArgument_yy_load_buffer_state(yyscanner
);
1365 /* We don't actually know whether we did this switch during
1366 * EOF (cmCommandArgument_yywrap()) processing, but the only time this flag
1367 * is looked at is after cmCommandArgument_yywrap() is called, so it's safe
1368 * to go ahead and always set it.
1370 yyg
->yy_did_buffer_switch_on_eof
= 1;
1373 static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner
)
1375 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1376 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1377 yyg
->yytext_ptr
= yyg
->yy_c_buf_p
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
1378 yyin
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
1379 yyg
->yy_hold_char
= *yyg
->yy_c_buf_p
;
1382 /** Allocate and initialize an input buffer state.
1383 * @param file A readable stream.
1384 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1385 * @param yyscanner The scanner object.
1386 * @return the allocated buffer state.
1388 YY_BUFFER_STATE
cmCommandArgument_yy_create_buffer (FILE * file
, int size
, yyscan_t yyscanner
)
1392 b
= (YY_BUFFER_STATE
) cmCommandArgument_yyalloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1394 YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_create_buffer()" );
1396 b
->yy_buf_size
= size
;
1398 /* yy_ch_buf has to be 2 characters longer than the size given because
1399 * we need to put in 2 end-of-buffer characters.
1401 b
->yy_ch_buf
= (char *) cmCommandArgument_yyalloc(b
->yy_buf_size
+ 2 ,yyscanner
);
1402 if ( ! b
->yy_ch_buf
)
1403 YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_create_buffer()" );
1405 b
->yy_is_our_buffer
= 1;
1407 cmCommandArgument_yy_init_buffer(b
,file
,yyscanner
);
1412 /** Destroy the buffer.
1413 * @param b a buffer created with cmCommandArgument_yy_create_buffer()
1414 * @param yyscanner The scanner object.
1416 void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1418 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1423 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
1424 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
1426 if ( b
->yy_is_our_buffer
)
1427 cmCommandArgument_yyfree((void *) b
->yy_ch_buf
,yyscanner
);
1429 cmCommandArgument_yyfree((void *) b
,yyscanner
);
1433 extern int isatty (int );
1434 #endif /* __cplusplus */
1436 /* Initializes or reinitializes a buffer.
1437 * This function is sometimes called more than once on the same buffer,
1438 * such as during a cmCommandArgument_yyrestart() or at EOF.
1440 static void cmCommandArgument_yy_init_buffer (YY_BUFFER_STATE b
, FILE * file
, yyscan_t yyscanner
)
1444 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1446 cmCommandArgument_yy_flush_buffer(b
,yyscanner
);
1448 b
->yy_input_file
= file
;
1449 b
->yy_fill_buffer
= 1;
1451 /* If b is the current buffer, then cmCommandArgument_yy_init_buffer was _probably_
1452 * called from cmCommandArgument_yyrestart() or through yy_get_next_buffer.
1453 * In that case, we don't want to reset the lineno or column.
1455 if (b
!= YY_CURRENT_BUFFER
){
1456 b
->yy_bs_lineno
= 1;
1457 b
->yy_bs_column
= 0;
1460 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
1465 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1466 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1467 * @param yyscanner The scanner object.
1469 void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1471 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1477 /* We always need two end-of-buffer characters. The first causes
1478 * a transition to the end-of-buffer state. The second causes
1479 * a jam in that state.
1481 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1482 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1484 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1487 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1489 if ( b
== YY_CURRENT_BUFFER
)
1490 cmCommandArgument_yy_load_buffer_state(yyscanner
);
1493 /** Pushes the new state onto the stack. The new state becomes
1494 * the current state. This function will allocate the stack
1496 * @param new_buffer The new state.
1497 * @param yyscanner The scanner object.
1499 void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1501 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1502 if (new_buffer
== NULL
)
1505 cmCommandArgument_yyensure_buffer_stack(yyscanner
);
1507 /* This block is copied from cmCommandArgument_yy_switch_to_buffer. */
1508 if ( YY_CURRENT_BUFFER
)
1510 /* Flush out information for old buffer. */
1511 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1512 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1513 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1516 /* Only push if top exists. Otherwise, replace top. */
1517 if (YY_CURRENT_BUFFER
)
1518 yyg
->yy_buffer_stack_top
++;
1519 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1521 /* copied from cmCommandArgument_yy_switch_to_buffer. */
1522 cmCommandArgument_yy_load_buffer_state(yyscanner
);
1523 yyg
->yy_did_buffer_switch_on_eof
= 1;
1526 /** Removes and deletes the top of the stack, if present.
1527 * The next element becomes the new top.
1528 * @param yyscanner The scanner object.
1530 void cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner
)
1532 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1533 if (!YY_CURRENT_BUFFER
)
1536 cmCommandArgument_yy_delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
1537 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1538 if (yyg
->yy_buffer_stack_top
> 0)
1539 --yyg
->yy_buffer_stack_top
;
1541 if (YY_CURRENT_BUFFER
) {
1542 cmCommandArgument_yy_load_buffer_state(yyscanner
);
1543 yyg
->yy_did_buffer_switch_on_eof
= 1;
1547 /* Allocates the stack if it does not exist.
1548 * Guarantees space for at least one push.
1550 static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner
)
1553 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1555 if (!yyg
->yy_buffer_stack
) {
1557 /* First allocation is just for 2 elements, since we don't know if this
1558 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1559 * immediate realloc on the next call.
1562 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)cmCommandArgument_yyalloc
1563 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
1566 memset(yyg
->yy_buffer_stack
, 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
1568 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1569 yyg
->yy_buffer_stack_top
= 0;
1573 if (yyg
->yy_buffer_stack_top
>= (yyg
->yy_buffer_stack_max
) - 1){
1575 /* Increase the buffer to prepare for a possible push. */
1576 int grow_size
= 8 /* arbitrary grow size */;
1578 num_to_alloc
= yyg
->yy_buffer_stack_max
+ grow_size
;
1579 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)cmCommandArgument_yyrealloc
1580 (yyg
->yy_buffer_stack
,
1581 num_to_alloc
* sizeof(struct yy_buffer_state
*)
1584 /* zero only the new slots.*/
1585 memset(yyg
->yy_buffer_stack
+ yyg
->yy_buffer_stack_max
, 0, grow_size
* sizeof(struct yy_buffer_state
*));
1586 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1590 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1591 * @param base the character buffer
1592 * @param size the size in bytes of the character buffer
1593 * @param yyscanner The scanner object.
1594 * @return the newly allocated buffer state object.
1596 YY_BUFFER_STATE
cmCommandArgument_yy_scan_buffer (char * base
, yy_size_t size
, yyscan_t yyscanner
)
1601 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1602 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1603 /* They forgot to leave room for the EOB's. */
1606 b
= (YY_BUFFER_STATE
) cmCommandArgument_yyalloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1608 YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_scan_buffer()" );
1610 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1611 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1612 b
->yy_is_our_buffer
= 0;
1613 b
->yy_input_file
= 0;
1614 b
->yy_n_chars
= b
->yy_buf_size
;
1615 b
->yy_is_interactive
= 0;
1617 b
->yy_fill_buffer
= 0;
1618 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1620 cmCommandArgument_yy_switch_to_buffer(b
,yyscanner
);
1625 /** Setup the input buffer state to scan a string. The next call to cmCommandArgument_yylex() will
1626 * scan from a @e copy of @a str.
1627 * @param yystr a NUL-terminated string to scan
1628 * @param yyscanner The scanner object.
1629 * @return the newly allocated buffer state object.
1630 * @note If you want to scan bytes that may contain NUL values, then use
1631 * cmCommandArgument_yy_scan_bytes() instead.
1633 YY_BUFFER_STATE
cmCommandArgument_yy_scan_string (yyconst
char * yystr
, yyscan_t yyscanner
)
1636 return cmCommandArgument_yy_scan_bytes(yystr
,strlen(yystr
) ,yyscanner
);
1639 /** Setup the input buffer state to scan the given bytes. The next call to cmCommandArgument_yylex() will
1640 * scan from a @e copy of @a bytes.
1641 * @param bytes the byte buffer to scan
1642 * @param len the number of bytes in the buffer pointed to by @a bytes.
1643 * @param yyscanner The scanner object.
1644 * @return the newly allocated buffer state object.
1646 YY_BUFFER_STATE
cmCommandArgument_yy_scan_bytes (yyconst
char * yybytes
, int _yybytes_len
, yyscan_t yyscanner
)
1653 /* Get memory for full buffer, including space for trailing EOB's. */
1654 n
= _yybytes_len
+ 2;
1655 buf
= (char *) cmCommandArgument_yyalloc(n
,yyscanner
);
1657 YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_scan_bytes()" );
1659 for ( i
= 0; i
< _yybytes_len
; ++i
)
1660 buf
[i
] = yybytes
[i
];
1662 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
1664 b
= cmCommandArgument_yy_scan_buffer(buf
,n
,yyscanner
);
1666 YY_FATAL_ERROR( "bad buffer in cmCommandArgument_yy_scan_bytes()" );
1668 /* It's okay to grow etc. this buffer, and we should throw it
1669 * away when we're done.
1671 b
->yy_is_our_buffer
= 1;
1676 #ifndef YY_EXIT_FAILURE
1677 #define YY_EXIT_FAILURE 2
1680 static void yy_fatal_error (yyconst
char* msg
, yyscan_t
)
1682 (void) fprintf( stderr
, "%s\n", msg
);
1683 exit( YY_EXIT_FAILURE
);
1686 /* Redefine yyless() so it works in section 3 code. */
1692 /* Undo effects of setting up yytext. */ \
1693 int yyless_macro_arg = (n); \
1694 YY_LESS_LINENO(yyless_macro_arg);\
1695 yytext[yyleng] = yyg->yy_hold_char; \
1696 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1697 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1698 *yyg->yy_c_buf_p = '\0'; \
1699 yyleng = yyless_macro_arg; \
1703 /* Accessor methods (get/set functions) to struct members. */
1705 /** Get the user-defined data for this scanner.
1706 * @param yyscanner The scanner object.
1708 YY_EXTRA_TYPE
cmCommandArgument_yyget_extra (yyscan_t yyscanner
)
1710 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1714 /** Get the current line number.
1715 * @param yyscanner The scanner object.
1717 int cmCommandArgument_yyget_lineno (yyscan_t yyscanner
)
1719 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1721 if (! YY_CURRENT_BUFFER
)
1727 /** Get the current column number.
1728 * @param yyscanner The scanner object.
1730 int cmCommandArgument_yyget_column (yyscan_t yyscanner
)
1732 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1734 if (! YY_CURRENT_BUFFER
)
1740 /** Get the input stream.
1741 * @param yyscanner The scanner object.
1743 FILE *cmCommandArgument_yyget_in (yyscan_t yyscanner
)
1745 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1749 /** Get the output stream.
1750 * @param yyscanner The scanner object.
1752 FILE *cmCommandArgument_yyget_out (yyscan_t yyscanner
)
1754 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1758 /** Get the length of the current token.
1759 * @param yyscanner The scanner object.
1761 int cmCommandArgument_yyget_leng (yyscan_t yyscanner
)
1763 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1767 /** Get the current token.
1768 * @param yyscanner The scanner object.
1771 char *cmCommandArgument_yyget_text (yyscan_t yyscanner
)
1773 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1777 /** Set the user-defined data. This data is never touched by the scanner.
1778 * @param user_defined The data to be associated with this scanner.
1779 * @param yyscanner The scanner object.
1781 void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined
, yyscan_t yyscanner
)
1783 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1784 yyextra
= user_defined
;
1787 /** Set the current line number.
1788 * @param line_number
1789 * @param yyscanner The scanner object.
1791 void cmCommandArgument_yyset_lineno (int line_number
, yyscan_t yyscanner
)
1793 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1795 /* lineno is only valid if an input buffer exists. */
1796 if (! YY_CURRENT_BUFFER
)
1797 yy_fatal_error( "cmCommandArgument_yyset_lineno called with no buffer" , yyscanner
);
1799 yylineno
= line_number
;
1802 /** Set the current column.
1803 * @param line_number
1804 * @param yyscanner The scanner object.
1806 void cmCommandArgument_yyset_column (int column_no
, yyscan_t yyscanner
)
1808 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1810 /* column is only valid if an input buffer exists. */
1811 if (! YY_CURRENT_BUFFER
)
1812 yy_fatal_error( "cmCommandArgument_yyset_column called with no buffer" , yyscanner
);
1814 yycolumn
= column_no
;
1817 /** Set the input stream. This does not discard the current
1819 * @param in_str A readable stream.
1820 * @param yyscanner The scanner object.
1821 * @see cmCommandArgument_yy_switch_to_buffer
1823 void cmCommandArgument_yyset_in (FILE * in_str
, yyscan_t yyscanner
)
1825 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1829 void cmCommandArgument_yyset_out (FILE * out_str
, yyscan_t yyscanner
)
1831 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1835 int cmCommandArgument_yyget_debug (yyscan_t yyscanner
)
1837 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1838 return yy_flex_debug
;
1841 void cmCommandArgument_yyset_debug (int bdebug
, yyscan_t yyscanner
)
1843 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1844 yy_flex_debug
= bdebug
;
1847 /* Accessor methods for yylval and yylloc */
1849 /* User-visible API */
1851 /* cmCommandArgument_yylex_init is special because it creates the scanner itself, so it is
1852 * the ONLY reentrant function that doesn't take the scanner as the last argument.
1853 * That's why we explicitly handle the declaration, instead of using our macros.
1856 int cmCommandArgument_yylex_init(yyscan_t
* ptr_yy_globals
)
1859 if (ptr_yy_globals
== NULL
){
1864 *ptr_yy_globals
= (yyscan_t
) cmCommandArgument_yyalloc ( sizeof( struct yyguts_t
), NULL
);
1866 if (*ptr_yy_globals
== NULL
){
1871 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
1872 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
1874 return yy_init_globals ( *ptr_yy_globals
);
1877 static int yy_init_globals (yyscan_t yyscanner
)
1879 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1880 /* Initialization is the same as for the non-reentrant scanner.
1881 * This function is called from cmCommandArgument_yylex_destroy(), so don't allocate here.
1884 yyg
->yy_buffer_stack
= 0;
1885 yyg
->yy_buffer_stack_top
= 0;
1886 yyg
->yy_buffer_stack_max
= 0;
1887 yyg
->yy_c_buf_p
= (char *) 0;
1891 yyg
->yy_start_stack_ptr
= 0;
1892 yyg
->yy_start_stack_depth
= 0;
1893 yyg
->yy_start_stack
= NULL
;
1895 /* Defined in main.c */
1904 /* For future reference: Set errno on error, since we are called by
1905 * cmCommandArgument_yylex_init()
1910 /* cmCommandArgument_yylex_destroy is for both reentrant and non-reentrant scanners. */
1911 int cmCommandArgument_yylex_destroy (yyscan_t yyscanner
)
1913 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1915 /* Pop the buffer stack, destroying each element. */
1916 while(YY_CURRENT_BUFFER
){
1917 cmCommandArgument_yy_delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
1918 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1919 cmCommandArgument_yypop_buffer_state(yyscanner
);
1922 /* Destroy the stack itself. */
1923 cmCommandArgument_yyfree(yyg
->yy_buffer_stack
,yyscanner
);
1924 yyg
->yy_buffer_stack
= NULL
;
1926 /* Destroy the start condition stack. */
1927 cmCommandArgument_yyfree(yyg
->yy_start_stack
,yyscanner
);
1928 yyg
->yy_start_stack
= NULL
;
1930 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1931 * cmCommandArgument_yylex() is called, initialization will occur. */
1932 yy_init_globals( yyscanner
);
1934 /* Destroy the main struct (reentrant only). */
1935 cmCommandArgument_yyfree ( yyscanner
, yyscanner
);
1941 * Internal utility routines.
1945 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
, yyscan_t yyscanner
)
1948 for ( i
= 0; i
< n
; ++i
)
1953 #ifdef YY_NEED_STRLEN
1954 static int yy_flex_strlen (yyconst
char * s
, yyscan_t yyscanner
)
1957 for ( n
= 0; s
[n
]; ++n
)
1964 void *cmCommandArgument_yyalloc (yy_size_t size
, yyscan_t
)
1966 return (void *) malloc( size
);
1969 void *cmCommandArgument_yyrealloc (void * ptr
, yy_size_t size
, yyscan_t
)
1971 /* The cast to (char *) in the following accommodates both
1972 * implementations that use char* generic pointers, and those
1973 * that use void* generic pointers. It works with the latter
1974 * because both ANSI C and C++ allow castless assignment from
1975 * any pointer type to void*, and deal with argument conversions
1976 * as though doing an assignment.
1978 return (void *) realloc( (char *) ptr
, size
);
1981 void cmCommandArgument_yyfree (void * ptr
, yyscan_t
)
1983 free( (char *) ptr
); /* see cmCommandArgument_yyrealloc() for (char *) cast */
1986 #define YYTABLES_NAME "yytables"
1988 #line 141 "cmCommandArgumentLexer.in.l"
1992 /*--------------------------------------------------------------------------*/
1993 void cmCommandArgument_SetupEscapes(yyscan_t yyscanner
, bool noEscapes
)
1995 /* Hack into the internal flex-generated scanner to set the state. */
1996 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;