1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCommandArgumentLexer.cxx,v $
6 Date: $Date: 2008-12-18 14:58:06 $
7 Version: $Revision: 1.18 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "cmStandardIncludes.h"
19 #line 2 "cmCommandArgumentLexer.cxx"
21 #line 4 "cmCommandArgumentLexer.cxx"
23 #define YY_INT_ALIGNED short int
25 /* A lexical scanner generated by flex */
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
30 #define YY_FLEX_SUBMINOR_VERSION 35
31 #if YY_FLEX_SUBMINOR_VERSION > 0
35 /* First, we deal with platform-specific or compiler-specific issues. */
37 /* begin standard C headers. */
43 /* end standard C headers. */
45 /* flex integer type definitions */
50 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55 * if you want the limit (max/min) macros for int types.
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
62 typedef int8_t flex_int8_t
;
63 typedef uint8_t flex_uint8_t
;
64 typedef int16_t flex_int16_t
;
65 typedef uint16_t flex_uint16_t
;
66 typedef int32_t flex_int32_t
;
67 typedef uint32_t flex_uint32_t
;
69 typedef signed char flex_int8_t
;
70 typedef short int flex_int16_t
;
71 typedef int flex_int32_t
;
72 typedef unsigned char flex_uint8_t
;
73 typedef unsigned short int flex_uint16_t
;
74 typedef unsigned int flex_uint32_t
;
76 /* Limits of integral types. */
78 #define INT8_MIN (-128)
81 #define INT16_MIN (-32767-1)
84 #define INT32_MIN (-2147483647-1)
87 #define INT8_MAX (127)
90 #define INT16_MAX (32767)
93 #define INT32_MAX (2147483647)
96 #define UINT8_MAX (255U)
99 #define UINT16_MAX (65535U)
102 #define UINT32_MAX (4294967295U)
107 #endif /* ! FLEXINT_H */
111 /* The "const" storage-class-modifier is valid. */
114 #else /* ! __cplusplus */
116 /* C99 requires __STDC__ to be defined as 1. */
117 #if defined (__STDC__)
121 #endif /* defined (__STDC__) */
122 #endif /* ! __cplusplus */
125 #define yyconst const
130 /* Returned upon end-of-file. */
133 /* Promotes a possibly negative, possibly signed char to an unsigned
134 * integer for use as an array index. If the signed char is negative,
135 * we want to instead treat it as an 8-bit unsigned char, hence the
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
140 /* An opaque pointer. */
141 #ifndef YY_TYPEDEF_YY_SCANNER_T
142 #define YY_TYPEDEF_YY_SCANNER_T
143 typedef void* yyscan_t
;
146 /* For convenience, these vars (plus the bison vars far below)
147 are macros in the reentrant scanner. */
148 #define yyin yyg->yyin_r
149 #define yyout yyg->yyout_r
150 #define yyextra yyg->yyextra_r
151 #define yyleng yyg->yyleng_r
152 #define yytext yyg->yytext_r
153 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
154 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
155 #define yy_flex_debug yyg->yy_flex_debug_r
157 /* Enter a start condition. This macro really ought to take a parameter,
158 * but we do it the disgusting crufty way forced on us by the ()-less
159 * definition of BEGIN.
161 #define BEGIN yyg->yy_start = 1 + 2 *
163 /* Translate the current start state into a value that can be later handed
164 * to BEGIN to return to the state. The YYSTATE alias is for lex
167 #define YY_START ((yyg->yy_start - 1) / 2)
168 #define YYSTATE YY_START
170 /* Action number for EOF rule of a given start state. */
171 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
173 /* Special action meaning "start processing a new file". */
174 #define YY_NEW_FILE cmCommandArgument_yyrestart(yyin ,yyscanner )
176 #define YY_END_OF_BUFFER_CHAR 0
178 /* Size of default input buffer. */
180 #define YY_BUF_SIZE 16384
183 /* The state buf must be large enough to hold one state per character in the main buffer.
185 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
187 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
188 #define YY_TYPEDEF_YY_BUFFER_STATE
189 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
192 #define EOB_ACT_CONTINUE_SCAN 0
193 #define EOB_ACT_END_OF_FILE 1
194 #define EOB_ACT_LAST_MATCH 2
196 #define YY_LESS_LINENO(n)
198 /* Return all but the first "n" matched characters back to the input stream. */
202 /* Undo effects of setting up yytext. */ \
203 int yyless_macro_arg = (n); \
204 YY_LESS_LINENO(yyless_macro_arg);\
205 *yy_cp = yyg->yy_hold_char; \
206 YY_RESTORE_YY_MORE_OFFSET \
207 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
208 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
212 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
214 #ifndef YY_TYPEDEF_YY_SIZE_T
215 #define YY_TYPEDEF_YY_SIZE_T
216 typedef size_t yy_size_t
;
219 #ifndef YY_STRUCT_YY_BUFFER_STATE
220 #define YY_STRUCT_YY_BUFFER_STATE
221 struct yy_buffer_state
225 char *yy_ch_buf
; /* input buffer */
226 char *yy_buf_pos
; /* current position in input buffer */
228 /* Size of input buffer in bytes, not including room for EOB
231 yy_size_t yy_buf_size
;
233 /* Number of characters read into yy_ch_buf, not including EOB
238 /* Whether we "own" the buffer - i.e., we know we created it,
239 * and can realloc() it to grow it, and should free() it to
242 int yy_is_our_buffer
;
244 /* Whether this is an "interactive" input source; if so, and
245 * if we're using stdio for input, then we want to use getc()
246 * instead of fread(), to make sure we stop fetching input after
249 int yy_is_interactive
;
251 /* Whether we're considered to be at the beginning of a line.
252 * If so, '^' rules will be active on the next match, otherwise
257 int yy_bs_lineno
; /**< The line count. */
258 int yy_bs_column
; /**< The column count. */
260 /* Whether to try to fill the input buffer when we reach the
265 int yy_buffer_status
;
267 #define YY_BUFFER_NEW 0
268 #define YY_BUFFER_NORMAL 1
269 /* When an EOF's been seen but there's still some text to process
270 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
271 * shouldn't try reading from the input source any more. We might
272 * still have a bunch of tokens to match, though, because of
273 * possible backing-up.
275 * When we actually see the EOF, we change the status to "new"
276 * (via cmCommandArgument_yyrestart()), so that the user can continue scanning by
277 * just pointing yyin at a new input file.
279 #define YY_BUFFER_EOF_PENDING 2
282 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
284 /* We provide macros for accessing buffer states in case in the
285 * future we want to put the buffer states in a more general
288 * Returns the top of the stack, or NULL.
290 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
291 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
294 /* Same as previous macro, but useful when we know that the buffer stack is not
295 * NULL or when we need an lvalue. For internal use only.
297 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
299 void cmCommandArgument_yyrestart (FILE *input_file
,yyscan_t yyscanner
);
300 void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
301 YY_BUFFER_STATE
cmCommandArgument_yy_create_buffer (FILE *file
,int size
,yyscan_t yyscanner
);
302 void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
303 void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
304 void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
305 void cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner
);
307 static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner
);
308 static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner
);
309 static void cmCommandArgument_yy_init_buffer (YY_BUFFER_STATE b
,FILE *file
,yyscan_t yyscanner
);
311 #define YY_FLUSH_BUFFER cmCommandArgument_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
313 YY_BUFFER_STATE
cmCommandArgument_yy_scan_buffer (char *base
,yy_size_t size
,yyscan_t yyscanner
);
314 YY_BUFFER_STATE
cmCommandArgument_yy_scan_string (yyconst
char *yy_str
,yyscan_t yyscanner
);
315 YY_BUFFER_STATE
cmCommandArgument_yy_scan_bytes (yyconst
char *bytes
,int len
,yyscan_t yyscanner
);
317 void *cmCommandArgument_yyalloc (yy_size_t
,yyscan_t yyscanner
);
318 void *cmCommandArgument_yyrealloc (void *,yy_size_t
,yyscan_t yyscanner
);
319 void cmCommandArgument_yyfree (void * ,yyscan_t yyscanner
);
321 #define yy_new_buffer cmCommandArgument_yy_create_buffer
323 #define yy_set_interactive(is_interactive) \
325 if ( ! YY_CURRENT_BUFFER ){ \
326 cmCommandArgument_yyensure_buffer_stack (yyscanner); \
327 YY_CURRENT_BUFFER_LVALUE = \
328 cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
330 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
333 #define yy_set_bol(at_bol) \
335 if ( ! YY_CURRENT_BUFFER ){\
336 cmCommandArgument_yyensure_buffer_stack (yyscanner); \
337 YY_CURRENT_BUFFER_LVALUE = \
338 cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
340 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
343 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
345 /* Begin user sect3 */
347 #define cmCommandArgument_yywrap(n) 1
348 #define YY_SKIP_YYWRAP
350 typedef unsigned char YY_CHAR
;
352 typedef int yy_state_type
;
354 #define yytext_ptr yytext_r
356 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
);
357 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
,yyscan_t yyscanner
);
358 static int yy_get_next_buffer (yyscan_t yyscanner
);
359 static void yy_fatal_error (yyconst
char msg
[] ,yyscan_t yyscanner
);
361 /* Done after the current pattern has been matched and before the
362 * corresponding action - sets up yytext.
364 #define YY_DO_BEFORE_ACTION \
365 yyg->yytext_ptr = yy_bp; \
366 yyleng = (size_t) (yy_cp - yy_bp); \
367 yyg->yy_hold_char = *yy_cp; \
369 yyg->yy_c_buf_p = yy_cp;
371 #define YY_NUM_RULES 14
372 #define YY_END_OF_BUFFER 15
373 /* This struct is not used in this scanner,
374 but its presence is necessary. */
377 flex_int32_t yy_verify
;
380 static yyconst flex_int16_t yy_accept
[30] =
382 0, 0, 0, 0, 0, 0, 15, 9, 10, 7,
383 6, 14, 11, 5, 12, 13, 9, 0, 0, 4,
384 7, 0, 8, 2, 0, 3, 0, 1, 0
387 static yyconst flex_int32_t yy_ec
[256] =
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
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, 3, 1, 1, 1, 1,
393 1, 1, 4, 1, 4, 4, 4, 4, 4, 4,
394 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
395 1, 1, 1, 5, 4, 4, 4, 4, 6, 4,
396 4, 4, 4, 4, 4, 4, 4, 7, 4, 4,
397 4, 4, 4, 4, 4, 8, 4, 4, 4, 4,
398 1, 9, 1, 1, 4, 1, 4, 4, 4, 4,
400 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
401 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
402 4, 4, 10, 1, 11, 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,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 static yyconst flex_int32_t yy_meta
[12] =
421 1, 2, 3, 4, 3, 4, 4, 4, 3, 5,
425 static yyconst flex_int16_t yy_base
[35] =
427 0, 0, 31, 30, 29, 28, 36, 0, 6, 16,
428 0, 41, 41, 41, 0, 41, 0, 22, 22, 41,
429 18, 18, 41, 41, 7, 41, 4, 41, 41, 20,
433 static yyconst flex_int16_t yy_def
[35] =
435 29, 1, 1, 1, 1, 1, 29, 30, 31, 32,
436 33, 29, 29, 29, 34, 29, 30, 31, 18, 29,
437 32, 33, 29, 29, 18, 29, 18, 29, 0, 29,
441 static yyconst flex_int16_t yy_nxt
[53] =
443 8, 8, 9, 10, 11, 10, 10, 10, 12, 13,
444 14, 19, 22, 28, 27, 20, 17, 17, 17, 17,
445 17, 17, 26, 17, 18, 18, 21, 21, 25, 21,
446 23, 24, 23, 23, 23, 29, 16, 16, 15, 15,
447 7, 29, 29, 29, 29, 29, 29, 29, 29, 29,
451 static yyconst flex_int16_t yy_chk
[53] =
453 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
454 1, 9, 33, 27, 25, 9, 10, 10, 21, 21,
455 30, 30, 22, 30, 31, 31, 32, 32, 19, 32,
456 34, 18, 34, 34, 34, 7, 6, 5, 4, 3,
457 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
461 /* The intent behind this definition is that it'll catch
462 * any uses of REJECT which flex missed.
464 #define REJECT reject_used_but_not_detected
465 #define yymore() yymore_used_but_not_detected
466 #define YY_MORE_ADJ 0
467 #define YY_RESTORE_YY_MORE_OFFSET
468 #line 1 "cmCommandArgumentLexer.in.l"
469 #line 2 "cmCommandArgumentLexer.in.l"
470 /*=========================================================================
472 Program: CMake - Cross-Platform Makefile Generator
473 Module: $RCSfile: cmCommandArgumentLexer.cxx,v $
475 Date: $Date: 2008-12-18 14:58:06 $
476 Version: $Revision: 1.18 $
478 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
479 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
481 This software is distributed WITHOUT ANY WARRANTY; without even
482 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
483 PURPOSE. See the above copyright notices for more information.
485 =========================================================================*/
488 This file must be translated to C and modified to build everywhere.
492 flex --prefix=cmCommandArgument_yy --header-file=cmCommandArgumentLexer.h -ocmCommandArgumentLexer.cxx cmCommandArgumentLexer.in.l
494 Modify cmCommandArgumentLexer.cxx:
495 - add #include "cmStandardIncludes.h" to top of file
496 - put header block at top of file
498 - remove "yyscanner" argument from these methods:
499 yy_fatal_error, cmCommandArgument_yyalloc, cmCommandArgument_yyrealloc, cmCommandArgument_yyfree
500 - remove all YY_BREAK lines occurring right after return statements
501 - change while ( 1 ) to for(;;)
502 - add "return 0;" to end of cmCommandArgument_yylex
504 Modify cmCommandArgumentLexer.h:
506 - remove the yy_init_globals function
507 - remove the block that includes unistd.h
508 - remove #line directives (avoids bogus warning on old Sun)
512 #include "cmStandardLexer.h"
514 #include "cmCommandArgumentParserHelper.h"
516 /* Replace the lexer input function. */
518 #define YY_INPUT(buf, result, max_size) \
519 { result = yyextra->LexInput(buf, max_size); }
521 /* Include the set of tokens from the parser. */
522 #include "cmCommandArgumentParserTokens.h"
524 /*--------------------------------------------------------------------------*/
527 #line 508 "cmCommandArgumentLexer.cxx"
533 #ifndef YY_NO_UNISTD_H
534 /* Special case for "unistd.h", since it is non-ANSI. We include it way
535 * down here because we want the user's section 1 to have been scanned first.
536 * The user has a chance to override it with an option.
541 #ifndef YY_EXTRA_TYPE
542 #define YY_EXTRA_TYPE void *
545 /* Holds the entire state of the reentrant scanner. */
549 /* User-defined. Not touched by flex. */
550 YY_EXTRA_TYPE yyextra_r
;
552 /* The rest are the same as the globals declared in the non-reentrant scanner. */
553 FILE *yyin_r
, *yyout_r
;
554 size_t yy_buffer_stack_top
; /**< index of top of stack. */
555 size_t yy_buffer_stack_max
; /**< capacity of stack. */
556 YY_BUFFER_STATE
* yy_buffer_stack
; /**< Stack as an array. */
563 int yy_did_buffer_switch_on_eof
;
564 int yy_start_stack_ptr
;
565 int yy_start_stack_depth
;
567 yy_state_type yy_last_accepting_state
;
568 char* yy_last_accepting_cpos
;
577 }; /* end struct yyguts_t */
579 static int yy_init_globals (yyscan_t yyscanner
);
581 int cmCommandArgument_yylex_init (yyscan_t
* scanner
);
583 int cmCommandArgument_yylex_init_extra (YY_EXTRA_TYPE user_defined
,yyscan_t
* scanner
);
585 /* Accessor methods to globals.
586 These are made visible to non-reentrant scanners for convenience. */
588 int cmCommandArgument_yylex_destroy (yyscan_t yyscanner
);
590 int cmCommandArgument_yyget_debug (yyscan_t yyscanner
);
592 void cmCommandArgument_yyset_debug (int debug_flag
,yyscan_t yyscanner
);
594 YY_EXTRA_TYPE
cmCommandArgument_yyget_extra (yyscan_t yyscanner
);
596 void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined
,yyscan_t yyscanner
);
598 FILE *cmCommandArgument_yyget_in (yyscan_t yyscanner
);
600 void cmCommandArgument_yyset_in (FILE * in_str
,yyscan_t yyscanner
);
602 FILE *cmCommandArgument_yyget_out (yyscan_t yyscanner
);
604 void cmCommandArgument_yyset_out (FILE * out_str
,yyscan_t yyscanner
);
606 int cmCommandArgument_yyget_leng (yyscan_t yyscanner
);
608 char *cmCommandArgument_yyget_text (yyscan_t yyscanner
);
610 int cmCommandArgument_yyget_lineno (yyscan_t yyscanner
);
612 void cmCommandArgument_yyset_lineno (int line_number
,yyscan_t yyscanner
);
614 /* Macros after this point can all be overridden by user definitions in
618 #ifndef YY_SKIP_YYWRAP
620 extern "C" int cmCommandArgument_yywrap (yyscan_t yyscanner
);
622 extern int cmCommandArgument_yywrap (yyscan_t yyscanner
);
627 static void yy_flex_strncpy (char *,yyconst
char *,int ,yyscan_t yyscanner
);
630 #ifdef YY_NEED_STRLEN
631 static int yy_flex_strlen (yyconst
char * ,yyscan_t yyscanner
);
637 static int yyinput (yyscan_t yyscanner
);
639 static int input (yyscan_t yyscanner
);
644 /* Amount of stuff to slurp up with each read. */
645 #ifndef YY_READ_BUF_SIZE
646 #define YY_READ_BUF_SIZE 8192
649 /* Copy whatever the last rule matched to the standard output. */
651 /* This used to be an fputs(), but since the string might contain NUL's,
652 * we now use fwrite().
654 #define ECHO fwrite( yytext, yyleng, 1, yyout )
657 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
658 * is returned in "result".
661 #define YY_INPUT(buf,result,max_size) \
662 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
666 for ( n = 0; n < max_size && \
667 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
670 buf[n++] = (char) c; \
671 if ( c == EOF && ferror( yyin ) ) \
672 YY_FATAL_ERROR( "input in flex scanner failed" ); \
678 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
680 if( errno != EINTR) \
682 YY_FATAL_ERROR( "input in flex scanner failed" ); \
693 /* No semi-colon after return; correct usage is to write "yyterminate();" -
694 * we don't want an extra ';' after the "return" because that will cause
695 * some compilers to complain about unreachable statements.
698 #define yyterminate() return YY_NULL
701 /* Number of entries by which start-condition stack grows. */
702 #ifndef YY_START_STACK_INCR
703 #define YY_START_STACK_INCR 25
706 /* Report a fatal error. */
707 #ifndef YY_FATAL_ERROR
708 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
711 /* end tables serialization structures and prototypes */
713 /* Default declaration of generated scanner - a define so the user can
714 * easily add parameters.
717 #define YY_DECL_IS_OURS 1
719 extern int cmCommandArgument_yylex (yyscan_t yyscanner
);
721 #define YY_DECL int cmCommandArgument_yylex (yyscan_t yyscanner)
722 #endif /* !YY_DECL */
724 /* Code executed at the beginning of each rule, after yytext and yyleng
727 #ifndef YY_USER_ACTION
728 #define YY_USER_ACTION
731 /* Code executed at the end of each rule. */
733 #define YY_BREAK break;
736 #define YY_RULE_SETUP \
739 /** The main scanner function which does all the work.
743 register yy_state_type yy_current_state
;
744 register char *yy_cp
, *yy_bp
;
746 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
748 #line 64 "cmCommandArgumentLexer.in.l"
751 #line 732 "cmCommandArgumentLexer.cxx"
761 if ( ! yyg
->yy_start
)
762 yyg
->yy_start
= 1; /* first start state */
770 if ( ! YY_CURRENT_BUFFER
) {
771 cmCommandArgument_yyensure_buffer_stack (yyscanner
);
772 YY_CURRENT_BUFFER_LVALUE
=
773 cmCommandArgument_yy_create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
776 cmCommandArgument_yy_load_buffer_state(yyscanner
);
779 for(;;) /* loops until end-of-file is reached */
781 yy_cp
= yyg
->yy_c_buf_p
;
783 /* Support of yytext. */
784 *yy_cp
= yyg
->yy_hold_char
;
786 /* yy_bp points to the position in yy_ch_buf of the start of
791 yy_current_state
= yyg
->yy_start
;
795 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
796 if ( yy_accept
[yy_current_state
] )
798 yyg
->yy_last_accepting_state
= yy_current_state
;
799 yyg
->yy_last_accepting_cpos
= yy_cp
;
801 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
803 yy_current_state
= (int) yy_def
[yy_current_state
];
804 if ( yy_current_state
>= 30 )
805 yy_c
= yy_meta
[(unsigned int) yy_c
];
807 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
810 while ( yy_base
[yy_current_state
] != 41 );
813 yy_act
= yy_accept
[yy_current_state
];
815 { /* have to back up */
816 yy_cp
= yyg
->yy_last_accepting_cpos
;
817 yy_current_state
= yyg
->yy_last_accepting_state
;
818 yy_act
= yy_accept
[yy_current_state
];
823 do_action
: /* This label is used only to access EOF actions. */
826 { /* beginning of action switch */
827 case 0: /* must back up */
828 /* undo the effects of YY_DO_BEFORE_ACTION */
829 *yy_cp
= yyg
->yy_hold_char
;
830 yy_cp
= yyg
->yy_last_accepting_cpos
;
831 yy_current_state
= yyg
->yy_last_accepting_state
;
836 #line 66 "cmCommandArgumentLexer.in.l"
838 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
839 yyextra
->AllocateParserType(yylvalp
, yytext
+1, strlen(yytext
)-2);
844 #line 72 "cmCommandArgumentLexer.in.l"
846 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
847 yyextra
->AllocateParserType(yylvalp
, yytext
+1, strlen(yytext
)-2);
852 #line 78 "cmCommandArgumentLexer.in.l"
854 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
855 yyextra
->AllocateParserType(yylvalp
, yytext
+1, strlen(yytext
)-2);
860 #line 84 "cmCommandArgumentLexer.in.l"
862 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
863 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
864 yylvalp
->str
= yyextra
->DCURLYVariable
;
869 #line 91 "cmCommandArgumentLexer.in.l"
871 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
872 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
873 yylvalp
->str
= yyextra
->RCURLYVariable
;
878 #line 98 "cmCommandArgumentLexer.in.l"
880 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
881 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
882 yylvalp
->str
= yyextra
->ATVariable
;
887 #line 105 "cmCommandArgumentLexer.in.l"
889 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
890 yyextra
->AllocateParserType(yylvalp
, yytext
, strlen(yytext
));
895 #line 111 "cmCommandArgumentLexer.in.l"
897 if ( !yyextra
->HandleEscapeSymbol(yylvalp
, *(yytext
+1)) )
904 /* rule 9 can match eol */
906 #line 119 "cmCommandArgumentLexer.in.l"
908 //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
909 yyextra
->AllocateParserType(yylvalp
, yytext
, strlen(yytext
));
914 #line 125 "cmCommandArgumentLexer.in.l"
916 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
917 yylvalp
->str
= yyextra
->DOLLARVariable
;
922 #line 131 "cmCommandArgumentLexer.in.l"
924 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
925 yylvalp
->str
= yyextra
->LCURLYVariable
;
930 #line 137 "cmCommandArgumentLexer.in.l"
932 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
933 yylvalp
->str
= yyextra
->BSLASHVariable
;
938 #line 143 "cmCommandArgumentLexer.in.l"
940 //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
941 yylvalp
->str
= yyextra
->BSLASHVariable
;
946 #line 149 "cmCommandArgumentLexer.in.l"
949 #line 943 "cmCommandArgumentLexer.cxx"
950 case YY_STATE_EOF(INITIAL
):
951 case YY_STATE_EOF(ESCAPES
):
952 case YY_STATE_EOF(NOESCAPES
):
955 case YY_END_OF_BUFFER
:
957 /* Amount of text matched not including the EOB char. */
958 int yy_amount_of_matched_text
= (int) (yy_cp
- yyg
->yytext_ptr
) - 1;
960 /* Undo the effects of YY_DO_BEFORE_ACTION. */
961 *yy_cp
= yyg
->yy_hold_char
;
962 YY_RESTORE_YY_MORE_OFFSET
964 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
966 /* We're scanning a new file or input source. It's
967 * possible that this happened because the user
968 * just pointed yyin at a new source and called
969 * cmCommandArgument_yylex(). If so, then we have to assure
970 * consistency between YY_CURRENT_BUFFER and our
971 * globals. Here is the right place to do so, because
972 * this is the first action (other than possibly a
973 * back-up) that will match for the new input source.
975 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
976 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= yyin
;
977 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
980 /* Note that here we test for yy_c_buf_p "<=" to the position
981 * of the first EOB in the buffer, since yy_c_buf_p will
982 * already have been incremented past the NUL character
983 * (since all states make transitions on EOB to the
984 * end-of-buffer state). Contrast this with the test
987 if ( yyg
->yy_c_buf_p
<= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
988 { /* This was really a NUL. */
989 yy_state_type yy_next_state
;
991 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
993 yy_current_state
= yy_get_previous_state( yyscanner
);
995 /* Okay, we're now positioned to make the NUL
996 * transition. We couldn't have
997 * yy_get_previous_state() go ahead and do it
998 * for us because it doesn't know how to deal
999 * with the possibility of jamming (and we don't
1000 * want to build jamming into it because then it
1001 * will run more slowly).
1004 yy_next_state
= yy_try_NUL_trans( yy_current_state
, yyscanner
);
1006 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1008 if ( yy_next_state
)
1010 /* Consume the NUL. */
1011 yy_cp
= ++yyg
->yy_c_buf_p
;
1012 yy_current_state
= yy_next_state
;
1018 yy_cp
= yyg
->yy_c_buf_p
;
1019 goto yy_find_action
;
1023 else switch ( yy_get_next_buffer( yyscanner
) )
1025 case EOB_ACT_END_OF_FILE
:
1027 yyg
->yy_did_buffer_switch_on_eof
= 0;
1029 if ( cmCommandArgument_yywrap(yyscanner
) )
1031 /* Note: because we've taken care in
1032 * yy_get_next_buffer() to have set up
1033 * yytext, we can now set up
1034 * yy_c_buf_p so that if some total
1035 * hoser (like flex itself) wants to
1036 * call the scanner after we return the
1037 * YY_NULL, it'll still work - another
1038 * YY_NULL will get returned.
1040 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1042 yy_act
= YY_STATE_EOF(YY_START
);
1048 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1054 case EOB_ACT_CONTINUE_SCAN
:
1056 yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
1058 yy_current_state
= yy_get_previous_state( yyscanner
);
1060 yy_cp
= yyg
->yy_c_buf_p
;
1061 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1064 case EOB_ACT_LAST_MATCH
:
1066 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
];
1068 yy_current_state
= yy_get_previous_state( yyscanner
);
1070 yy_cp
= yyg
->yy_c_buf_p
;
1071 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1072 goto yy_find_action
;
1079 "fatal flex scanner internal error--no action found" );
1080 } /* end of action switch */
1081 } /* end of scanning one token */
1082 return 0; /* this should not happend but it should silence a warning */
1083 } /* end of cmCommandArgument_yylex */
1085 /* yy_get_next_buffer - try to read in a new buffer
1087 * Returns a code representing an action:
1088 * EOB_ACT_LAST_MATCH -
1089 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1090 * EOB_ACT_END_OF_FILE - end of file
1092 static int yy_get_next_buffer (yyscan_t yyscanner
)
1094 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1095 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
1096 register char *source
= yyg
->yytext_ptr
;
1097 register int number_to_move
, i
;
1100 if ( yyg
->yy_c_buf_p
> &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] )
1102 "fatal flex scanner internal error--end of buffer missed" );
1104 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
1105 { /* Don't try to fill the buffer, so this is an EOF. */
1106 if ( yyg
->yy_c_buf_p
- yyg
->yytext_ptr
- YY_MORE_ADJ
== 1 )
1108 /* We matched a single character, the EOB, so
1109 * treat this as a final EOF.
1111 return EOB_ACT_END_OF_FILE
;
1116 /* We matched some text prior to the EOB, first
1119 return EOB_ACT_LAST_MATCH
;
1123 /* Try to read more data. */
1125 /* First move last chars to start of buffer. */
1126 number_to_move
= (int) (yyg
->yy_c_buf_p
- yyg
->yytext_ptr
) - 1;
1128 for ( i
= 0; i
< number_to_move
; ++i
)
1129 *(dest
++) = *(source
++);
1131 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1132 /* don't do the read, it's not guaranteed to return an EOF,
1135 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
= 0;
1140 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
1142 while ( num_to_read
<= 0 )
1143 { /* Not enough room in the buffer - grow it. */
1145 /* just a shorter name for the current buffer */
1146 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
1148 int yy_c_buf_p_offset
=
1149 (int) (yyg
->yy_c_buf_p
- b
->yy_ch_buf
);
1151 if ( b
->yy_is_our_buffer
)
1153 int new_size
= b
->yy_buf_size
* 2;
1155 if ( new_size
<= 0 )
1156 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1158 b
->yy_buf_size
*= 2;
1160 b
->yy_ch_buf
= (char *)
1161 /* Include room in for 2 EOB chars. */
1162 cmCommandArgument_yyrealloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 ,yyscanner
);
1165 /* Can't grow it, we don't own it. */
1168 if ( ! b
->yy_ch_buf
)
1170 "fatal error - scanner input buffer overflow" );
1172 yyg
->yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1174 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
1179 if ( num_to_read
> YY_READ_BUF_SIZE
)
1180 num_to_read
= YY_READ_BUF_SIZE
;
1182 /* Read in more data. */
1183 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
1184 yyg
->yy_n_chars
, (size_t) num_to_read
);
1186 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1189 if ( yyg
->yy_n_chars
== 0 )
1191 if ( number_to_move
== YY_MORE_ADJ
)
1193 ret_val
= EOB_ACT_END_OF_FILE
;
1194 cmCommandArgument_yyrestart(yyin
,yyscanner
);
1199 ret_val
= EOB_ACT_LAST_MATCH
;
1200 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
1201 YY_BUFFER_EOF_PENDING
;
1206 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1208 if ((yy_size_t
) (yyg
->yy_n_chars
+ number_to_move
) > YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
) {
1209 /* Extend the array by 50%, plus the number we really need. */
1210 yy_size_t new_size
= yyg
->yy_n_chars
+ number_to_move
+ (yyg
->yy_n_chars
>> 1);
1211 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
= (char *) cmCommandArgument_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
,new_size
,yyscanner
);
1212 if ( ! YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
1213 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1216 yyg
->yy_n_chars
+= number_to_move
;
1217 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1218 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1220 yyg
->yytext_ptr
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
1225 /* yy_get_previous_state - get the state just before the EOB char was reached */
1227 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
)
1229 register yy_state_type yy_current_state
;
1230 register char *yy_cp
;
1231 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1233 yy_current_state
= yyg
->yy_start
;
1235 for ( yy_cp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yyg
->yy_c_buf_p
; ++yy_cp
)
1237 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1238 if ( yy_accept
[yy_current_state
] )
1240 yyg
->yy_last_accepting_state
= yy_current_state
;
1241 yyg
->yy_last_accepting_cpos
= yy_cp
;
1243 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1245 yy_current_state
= (int) yy_def
[yy_current_state
];
1246 if ( yy_current_state
>= 30 )
1247 yy_c
= yy_meta
[(unsigned int) yy_c
];
1249 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1252 return yy_current_state
;
1255 /* yy_try_NUL_trans - try to make a transition on the NUL character
1258 * next_state = yy_try_NUL_trans( current_state );
1260 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
, yyscan_t yyscanner
)
1262 register int yy_is_jam
;
1263 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
; /* This var may be unused depending upon options. */
1264 register char *yy_cp
= yyg
->yy_c_buf_p
;
1266 register YY_CHAR yy_c
= 1;
1267 if ( yy_accept
[yy_current_state
] )
1269 yyg
->yy_last_accepting_state
= yy_current_state
;
1270 yyg
->yy_last_accepting_cpos
= yy_cp
;
1272 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1274 yy_current_state
= (int) yy_def
[yy_current_state
];
1275 if ( yy_current_state
>= 30 )
1276 yy_c
= yy_meta
[(unsigned int) yy_c
];
1278 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1279 yy_is_jam
= (yy_current_state
== 29);
1281 return yy_is_jam
? 0 : yy_current_state
;
1286 static int yyinput (yyscan_t yyscanner
)
1288 static int input (yyscan_t yyscanner
)
1293 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1295 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1297 if ( *yyg
->yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1299 /* yy_c_buf_p now points to the character we want to return.
1300 * If this occurs *before* the EOB characters, then it's a
1301 * valid NUL; if not, then we've hit the end of the buffer.
1303 if ( yyg
->yy_c_buf_p
< &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
1304 /* This was really a NUL. */
1305 *yyg
->yy_c_buf_p
= '\0';
1308 { /* need more input */
1309 int offset
= yyg
->yy_c_buf_p
- yyg
->yytext_ptr
;
1312 switch ( yy_get_next_buffer( yyscanner
) )
1314 case EOB_ACT_LAST_MATCH
:
1315 /* This happens because yy_g_n_b()
1316 * sees that we've accumulated a
1317 * token and flags that we need to
1318 * try matching the token before
1319 * proceeding. But for input(),
1320 * there's no matching to consider.
1321 * So convert the EOB_ACT_LAST_MATCH
1322 * to EOB_ACT_END_OF_FILE.
1325 /* Reset buffer status. */
1326 cmCommandArgument_yyrestart(yyin
,yyscanner
);
1330 case EOB_ACT_END_OF_FILE
:
1332 if ( cmCommandArgument_yywrap(yyscanner
) )
1335 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1338 return yyinput(yyscanner
);
1340 return input(yyscanner
);
1344 case EOB_ACT_CONTINUE_SCAN
:
1345 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ offset
;
1351 c
= *(unsigned char *) yyg
->yy_c_buf_p
; /* cast for 8-bit char's */
1352 *yyg
->yy_c_buf_p
= '\0'; /* preserve yytext */
1353 yyg
->yy_hold_char
= *++yyg
->yy_c_buf_p
;
1357 #endif /* ifndef YY_NO_INPUT */
1359 /** Immediately switch to a different input stream.
1360 * @param input_file A readable stream.
1361 * @param yyscanner The scanner object.
1362 * @note This function does not reset the start condition to @c INITIAL .
1364 void cmCommandArgument_yyrestart (FILE * input_file
, yyscan_t yyscanner
)
1366 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1368 if ( ! YY_CURRENT_BUFFER
){
1369 cmCommandArgument_yyensure_buffer_stack (yyscanner
);
1370 YY_CURRENT_BUFFER_LVALUE
=
1371 cmCommandArgument_yy_create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
1374 cmCommandArgument_yy_init_buffer(YY_CURRENT_BUFFER
,input_file
,yyscanner
);
1375 cmCommandArgument_yy_load_buffer_state(yyscanner
);
1378 /** Switch to a different input buffer.
1379 * @param new_buffer The new input buffer.
1380 * @param yyscanner The scanner object.
1382 void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1384 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1386 /* TODO. We should be able to replace this entire function body
1388 * cmCommandArgument_yypop_buffer_state();
1389 * cmCommandArgument_yypush_buffer_state(new_buffer);
1391 cmCommandArgument_yyensure_buffer_stack (yyscanner
);
1392 if ( YY_CURRENT_BUFFER
== new_buffer
)
1395 if ( YY_CURRENT_BUFFER
)
1397 /* Flush out information for old buffer. */
1398 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1399 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1400 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1403 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1404 cmCommandArgument_yy_load_buffer_state(yyscanner
);
1406 /* We don't actually know whether we did this switch during
1407 * EOF (cmCommandArgument_yywrap()) processing, but the only time this flag
1408 * is looked at is after cmCommandArgument_yywrap() is called, so it's safe
1409 * to go ahead and always set it.
1411 yyg
->yy_did_buffer_switch_on_eof
= 1;
1414 static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner
)
1416 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1417 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1418 yyg
->yytext_ptr
= yyg
->yy_c_buf_p
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
1419 yyin
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
1420 yyg
->yy_hold_char
= *yyg
->yy_c_buf_p
;
1423 /** Allocate and initialize an input buffer state.
1424 * @param file A readable stream.
1425 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1426 * @param yyscanner The scanner object.
1427 * @return the allocated buffer state.
1429 YY_BUFFER_STATE
cmCommandArgument_yy_create_buffer (FILE * file
, int size
, yyscan_t yyscanner
)
1433 b
= (YY_BUFFER_STATE
) cmCommandArgument_yyalloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1435 YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_create_buffer()" );
1437 b
->yy_buf_size
= size
;
1439 /* yy_ch_buf has to be 2 characters longer than the size given because
1440 * we need to put in 2 end-of-buffer characters.
1442 b
->yy_ch_buf
= (char *) cmCommandArgument_yyalloc(b
->yy_buf_size
+ 2 ,yyscanner
);
1443 if ( ! b
->yy_ch_buf
)
1444 YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_create_buffer()" );
1446 b
->yy_is_our_buffer
= 1;
1448 cmCommandArgument_yy_init_buffer(b
,file
,yyscanner
);
1453 /** Destroy the buffer.
1454 * @param b a buffer created with cmCommandArgument_yy_create_buffer()
1455 * @param yyscanner The scanner object.
1457 void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1459 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1464 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
1465 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
1467 if ( b
->yy_is_our_buffer
)
1468 cmCommandArgument_yyfree((void *) b
->yy_ch_buf
,yyscanner
);
1470 cmCommandArgument_yyfree((void *) b
,yyscanner
);
1474 extern int isatty (int );
1475 #endif /* __cplusplus */
1477 /* Initializes or reinitializes a buffer.
1478 * This function is sometimes called more than once on the same buffer,
1479 * such as during a cmCommandArgument_yyrestart() or at EOF.
1481 static void cmCommandArgument_yy_init_buffer (YY_BUFFER_STATE b
, FILE * file
, yyscan_t yyscanner
)
1485 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1487 cmCommandArgument_yy_flush_buffer(b
,yyscanner
);
1489 b
->yy_input_file
= file
;
1490 b
->yy_fill_buffer
= 1;
1492 /* If b is the current buffer, then cmCommandArgument_yy_init_buffer was _probably_
1493 * called from cmCommandArgument_yyrestart() or through yy_get_next_buffer.
1494 * In that case, we don't want to reset the lineno or column.
1496 if (b
!= YY_CURRENT_BUFFER
){
1497 b
->yy_bs_lineno
= 1;
1498 b
->yy_bs_column
= 0;
1501 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
1506 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1507 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1508 * @param yyscanner The scanner object.
1510 void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1512 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1518 /* We always need two end-of-buffer characters. The first causes
1519 * a transition to the end-of-buffer state. The second causes
1520 * a jam in that state.
1522 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1523 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1525 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1528 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1530 if ( b
== YY_CURRENT_BUFFER
)
1531 cmCommandArgument_yy_load_buffer_state(yyscanner
);
1534 /** Pushes the new state onto the stack. The new state becomes
1535 * the current state. This function will allocate the stack
1537 * @param new_buffer The new state.
1538 * @param yyscanner The scanner object.
1540 void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1542 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1543 if (new_buffer
== NULL
)
1546 cmCommandArgument_yyensure_buffer_stack(yyscanner
);
1548 /* This block is copied from cmCommandArgument_yy_switch_to_buffer. */
1549 if ( YY_CURRENT_BUFFER
)
1551 /* Flush out information for old buffer. */
1552 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1553 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1554 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1557 /* Only push if top exists. Otherwise, replace top. */
1558 if (YY_CURRENT_BUFFER
)
1559 yyg
->yy_buffer_stack_top
++;
1560 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1562 /* copied from cmCommandArgument_yy_switch_to_buffer. */
1563 cmCommandArgument_yy_load_buffer_state(yyscanner
);
1564 yyg
->yy_did_buffer_switch_on_eof
= 1;
1567 /** Removes and deletes the top of the stack, if present.
1568 * The next element becomes the new top.
1569 * @param yyscanner The scanner object.
1571 void cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner
)
1573 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1574 if (!YY_CURRENT_BUFFER
)
1577 cmCommandArgument_yy_delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
1578 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1579 if (yyg
->yy_buffer_stack_top
> 0)
1580 --yyg
->yy_buffer_stack_top
;
1582 if (YY_CURRENT_BUFFER
) {
1583 cmCommandArgument_yy_load_buffer_state(yyscanner
);
1584 yyg
->yy_did_buffer_switch_on_eof
= 1;
1588 /* Allocates the stack if it does not exist.
1589 * Guarantees space for at least one push.
1591 static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner
)
1594 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1596 if (!yyg
->yy_buffer_stack
) {
1598 /* First allocation is just for 2 elements, since we don't know if this
1599 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1600 * immediate realloc on the next call.
1603 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)cmCommandArgument_yyalloc
1604 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
1606 if ( ! yyg
->yy_buffer_stack
)
1607 YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yyensure_buffer_stack()" );
1609 memset(yyg
->yy_buffer_stack
, 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
1611 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1612 yyg
->yy_buffer_stack_top
= 0;
1616 if (yyg
->yy_buffer_stack_top
>= (yyg
->yy_buffer_stack_max
) - 1){
1618 /* Increase the buffer to prepare for a possible push. */
1619 int grow_size
= 8 /* arbitrary grow size */;
1621 num_to_alloc
= yyg
->yy_buffer_stack_max
+ grow_size
;
1622 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)cmCommandArgument_yyrealloc
1623 (yyg
->yy_buffer_stack
,
1624 num_to_alloc
* sizeof(struct yy_buffer_state
*)
1626 if ( ! yyg
->yy_buffer_stack
)
1627 YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yyensure_buffer_stack()" );
1629 /* zero only the new slots.*/
1630 memset(yyg
->yy_buffer_stack
+ yyg
->yy_buffer_stack_max
, 0, grow_size
* sizeof(struct yy_buffer_state
*));
1631 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1635 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1636 * @param base the character buffer
1637 * @param size the size in bytes of the character buffer
1638 * @param yyscanner The scanner object.
1639 * @return the newly allocated buffer state object.
1641 YY_BUFFER_STATE
cmCommandArgument_yy_scan_buffer (char * base
, yy_size_t size
, yyscan_t yyscanner
)
1646 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1647 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1648 /* They forgot to leave room for the EOB's. */
1651 b
= (YY_BUFFER_STATE
) cmCommandArgument_yyalloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1653 YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_scan_buffer()" );
1655 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1656 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1657 b
->yy_is_our_buffer
= 0;
1658 b
->yy_input_file
= 0;
1659 b
->yy_n_chars
= b
->yy_buf_size
;
1660 b
->yy_is_interactive
= 0;
1662 b
->yy_fill_buffer
= 0;
1663 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1665 cmCommandArgument_yy_switch_to_buffer(b
,yyscanner
);
1670 /** Setup the input buffer state to scan a string. The next call to cmCommandArgument_yylex() will
1671 * scan from a @e copy of @a str.
1672 * @param yystr a NUL-terminated string to scan
1673 * @param yyscanner The scanner object.
1674 * @return the newly allocated buffer state object.
1675 * @note If you want to scan bytes that may contain NUL values, then use
1676 * cmCommandArgument_yy_scan_bytes() instead.
1678 YY_BUFFER_STATE
cmCommandArgument_yy_scan_string (yyconst
char * yystr
, yyscan_t yyscanner
)
1681 return cmCommandArgument_yy_scan_bytes(yystr
,strlen(yystr
) ,yyscanner
);
1684 /** Setup the input buffer state to scan the given bytes. The next call to cmCommandArgument_yylex() will
1685 * scan from a @e copy of @a bytes.
1686 * @param bytes the byte buffer to scan
1687 * @param len the number of bytes in the buffer pointed to by @a bytes.
1688 * @param yyscanner The scanner object.
1689 * @return the newly allocated buffer state object.
1691 YY_BUFFER_STATE
cmCommandArgument_yy_scan_bytes (yyconst
char * yybytes
, int _yybytes_len
, yyscan_t yyscanner
)
1698 /* Get memory for full buffer, including space for trailing EOB's. */
1699 n
= _yybytes_len
+ 2;
1700 buf
= (char *) cmCommandArgument_yyalloc(n
,yyscanner
);
1702 YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_scan_bytes()" );
1704 for ( i
= 0; i
< _yybytes_len
; ++i
)
1705 buf
[i
] = yybytes
[i
];
1707 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
1709 b
= cmCommandArgument_yy_scan_buffer(buf
,n
,yyscanner
);
1711 YY_FATAL_ERROR( "bad buffer in cmCommandArgument_yy_scan_bytes()" );
1713 /* It's okay to grow etc. this buffer, and we should throw it
1714 * away when we're done.
1716 b
->yy_is_our_buffer
= 1;
1721 #ifndef YY_EXIT_FAILURE
1722 #define YY_EXIT_FAILURE 2
1725 static void yy_fatal_error (yyconst
char* msg
, yyscan_t
)
1727 (void) fprintf( stderr
, "%s\n", msg
);
1728 exit( YY_EXIT_FAILURE
);
1731 /* Redefine yyless() so it works in section 3 code. */
1737 /* Undo effects of setting up yytext. */ \
1738 int yyless_macro_arg = (n); \
1739 YY_LESS_LINENO(yyless_macro_arg);\
1740 yytext[yyleng] = yyg->yy_hold_char; \
1741 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1742 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1743 *yyg->yy_c_buf_p = '\0'; \
1744 yyleng = yyless_macro_arg; \
1748 /* Accessor methods (get/set functions) to struct members. */
1750 /** Get the user-defined data for this scanner.
1751 * @param yyscanner The scanner object.
1753 YY_EXTRA_TYPE
cmCommandArgument_yyget_extra (yyscan_t yyscanner
)
1755 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1759 /** Get the current line number.
1760 * @param yyscanner The scanner object.
1762 int cmCommandArgument_yyget_lineno (yyscan_t yyscanner
)
1764 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1766 if (! YY_CURRENT_BUFFER
)
1772 /** Get the current column number.
1773 * @param yyscanner The scanner object.
1775 int cmCommandArgument_yyget_column (yyscan_t yyscanner
)
1777 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1779 if (! YY_CURRENT_BUFFER
)
1785 /** Get the input stream.
1786 * @param yyscanner The scanner object.
1788 FILE *cmCommandArgument_yyget_in (yyscan_t yyscanner
)
1790 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1794 /** Get the output stream.
1795 * @param yyscanner The scanner object.
1797 FILE *cmCommandArgument_yyget_out (yyscan_t yyscanner
)
1799 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1803 /** Get the length of the current token.
1804 * @param yyscanner The scanner object.
1806 int cmCommandArgument_yyget_leng (yyscan_t yyscanner
)
1808 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1812 /** Get the current token.
1813 * @param yyscanner The scanner object.
1816 char *cmCommandArgument_yyget_text (yyscan_t yyscanner
)
1818 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1822 /** Set the user-defined data. This data is never touched by the scanner.
1823 * @param user_defined The data to be associated with this scanner.
1824 * @param yyscanner The scanner object.
1826 void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined
, yyscan_t yyscanner
)
1828 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1829 yyextra
= user_defined
;
1832 /** Set the current line number.
1833 * @param line_number
1834 * @param yyscanner The scanner object.
1836 void cmCommandArgument_yyset_lineno (int line_number
, yyscan_t yyscanner
)
1838 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1840 /* lineno is only valid if an input buffer exists. */
1841 if (! YY_CURRENT_BUFFER
)
1842 yy_fatal_error( "cmCommandArgument_yyset_lineno called with no buffer" , yyscanner
);
1844 yylineno
= line_number
;
1847 /** Set the current column.
1848 * @param line_number
1849 * @param yyscanner The scanner object.
1851 void cmCommandArgument_yyset_column (int column_no
, yyscan_t yyscanner
)
1853 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1855 /* column is only valid if an input buffer exists. */
1856 if (! YY_CURRENT_BUFFER
)
1857 yy_fatal_error( "cmCommandArgument_yyset_column called with no buffer" , yyscanner
);
1859 yycolumn
= column_no
;
1862 /** Set the input stream. This does not discard the current
1864 * @param in_str A readable stream.
1865 * @param yyscanner The scanner object.
1866 * @see cmCommandArgument_yy_switch_to_buffer
1868 void cmCommandArgument_yyset_in (FILE * in_str
, yyscan_t yyscanner
)
1870 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1874 void cmCommandArgument_yyset_out (FILE * out_str
, yyscan_t yyscanner
)
1876 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1880 int cmCommandArgument_yyget_debug (yyscan_t yyscanner
)
1882 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1883 return yy_flex_debug
;
1886 void cmCommandArgument_yyset_debug (int bdebug
, yyscan_t yyscanner
)
1888 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1889 yy_flex_debug
= bdebug
;
1892 /* Accessor methods for yylval and yylloc */
1894 /* User-visible API */
1896 /* cmCommandArgument_yylex_init is special because it creates the scanner itself, so it is
1897 * the ONLY reentrant function that doesn't take the scanner as the last argument.
1898 * That's why we explicitly handle the declaration, instead of using our macros.
1901 int cmCommandArgument_yylex_init(yyscan_t
* ptr_yy_globals
)
1904 if (ptr_yy_globals
== NULL
){
1909 *ptr_yy_globals
= (yyscan_t
) cmCommandArgument_yyalloc ( sizeof( struct yyguts_t
), NULL
);
1911 if (*ptr_yy_globals
== NULL
){
1916 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
1917 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
1919 return yy_init_globals ( *ptr_yy_globals
);
1922 /* cmCommandArgument_yylex_init_extra has the same functionality as cmCommandArgument_yylex_init, but follows the
1923 * convention of taking the scanner as the last argument. Note however, that
1924 * this is a *pointer* to a scanner, as it will be allocated by this call (and
1925 * is the reason, too, why this function also must handle its own declaration).
1926 * The user defined value in the first argument will be available to cmCommandArgument_yyalloc in
1927 * the yyextra field.
1930 int cmCommandArgument_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined
,yyscan_t
* ptr_yy_globals
)
1933 struct yyguts_t dummy_yyguts
;
1935 cmCommandArgument_yyset_extra (yy_user_defined
, &dummy_yyguts
);
1937 if (ptr_yy_globals
== NULL
){
1942 *ptr_yy_globals
= (yyscan_t
) cmCommandArgument_yyalloc ( sizeof( struct yyguts_t
), &dummy_yyguts
);
1944 if (*ptr_yy_globals
== NULL
){
1949 /* By setting to 0xAA, we expose bugs in
1950 yy_init_globals. Leave at 0x00 for releases. */
1951 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
1953 cmCommandArgument_yyset_extra (yy_user_defined
, *ptr_yy_globals
);
1955 return yy_init_globals ( *ptr_yy_globals
);
1958 static int yy_init_globals (yyscan_t yyscanner
)
1960 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1961 /* Initialization is the same as for the non-reentrant scanner.
1962 * This function is called from cmCommandArgument_yylex_destroy(), so don't allocate here.
1965 yyg
->yy_buffer_stack
= 0;
1966 yyg
->yy_buffer_stack_top
= 0;
1967 yyg
->yy_buffer_stack_max
= 0;
1968 yyg
->yy_c_buf_p
= (char *) 0;
1972 yyg
->yy_start_stack_ptr
= 0;
1973 yyg
->yy_start_stack_depth
= 0;
1974 yyg
->yy_start_stack
= NULL
;
1976 /* Defined in main.c */
1985 /* For future reference: Set errno on error, since we are called by
1986 * cmCommandArgument_yylex_init()
1991 /* cmCommandArgument_yylex_destroy is for both reentrant and non-reentrant scanners. */
1992 int cmCommandArgument_yylex_destroy (yyscan_t yyscanner
)
1994 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1996 /* Pop the buffer stack, destroying each element. */
1997 while(YY_CURRENT_BUFFER
){
1998 cmCommandArgument_yy_delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
1999 YY_CURRENT_BUFFER_LVALUE
= NULL
;
2000 cmCommandArgument_yypop_buffer_state(yyscanner
);
2003 /* Destroy the stack itself. */
2004 cmCommandArgument_yyfree(yyg
->yy_buffer_stack
,yyscanner
);
2005 yyg
->yy_buffer_stack
= NULL
;
2007 /* Destroy the start condition stack. */
2008 cmCommandArgument_yyfree(yyg
->yy_start_stack
,yyscanner
);
2009 yyg
->yy_start_stack
= NULL
;
2011 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2012 * cmCommandArgument_yylex() is called, initialization will occur. */
2013 yy_init_globals( yyscanner
);
2015 /* Destroy the main struct (reentrant only). */
2016 cmCommandArgument_yyfree ( yyscanner
, yyscanner
);
2022 * Internal utility routines.
2026 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
, yyscan_t yyscanner
)
2029 for ( i
= 0; i
< n
; ++i
)
2034 #ifdef YY_NEED_STRLEN
2035 static int yy_flex_strlen (yyconst
char * s
, yyscan_t yyscanner
)
2038 for ( n
= 0; s
[n
]; ++n
)
2045 void *cmCommandArgument_yyalloc (yy_size_t size
, yyscan_t
)
2047 return (void *) malloc( size
);
2050 void *cmCommandArgument_yyrealloc (void * ptr
, yy_size_t size
, yyscan_t
)
2052 /* The cast to (char *) in the following accommodates both
2053 * implementations that use char* generic pointers, and those
2054 * that use void* generic pointers. It works with the latter
2055 * because both ANSI C and C++ allow castless assignment from
2056 * any pointer type to void*, and deal with argument conversions
2057 * as though doing an assignment.
2059 return (void *) realloc( (char *) ptr
, size
);
2062 void cmCommandArgument_yyfree (void * ptr
, yyscan_t
)
2064 free( (char *) ptr
); /* see cmCommandArgument_yyrealloc() for (char *) cast */
2067 #define YYTABLES_NAME "yytables"
2069 #line 149 "cmCommandArgumentLexer.in.l"
2073 /*--------------------------------------------------------------------------*/
2074 void cmCommandArgument_SetupEscapes(yyscan_t yyscanner
, bool noEscapes
)
2076 /* Hack into the internal flex-generated scanner to set the state. */
2077 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;