1 #include "cmStandardLexer.h"
4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 6
11 #define YY_FLEX_SUBMINOR_VERSION 4
12 #if YY_FLEX_SUBMINOR_VERSION > 0
16 #ifdef yy_create_buffer
17 #define cmFortran_yy_create_buffer_ALREADY_DEFINED
19 #define yy_create_buffer cmFortran_yy_create_buffer
22 #ifdef yy_delete_buffer
23 #define cmFortran_yy_delete_buffer_ALREADY_DEFINED
25 #define yy_delete_buffer cmFortran_yy_delete_buffer
29 #define cmFortran_yy_scan_buffer_ALREADY_DEFINED
31 #define yy_scan_buffer cmFortran_yy_scan_buffer
35 #define cmFortran_yy_scan_string_ALREADY_DEFINED
37 #define yy_scan_string cmFortran_yy_scan_string
41 #define cmFortran_yy_scan_bytes_ALREADY_DEFINED
43 #define yy_scan_bytes cmFortran_yy_scan_bytes
47 #define cmFortran_yy_init_buffer_ALREADY_DEFINED
49 #define yy_init_buffer cmFortran_yy_init_buffer
52 #ifdef yy_flush_buffer
53 #define cmFortran_yy_flush_buffer_ALREADY_DEFINED
55 #define yy_flush_buffer cmFortran_yy_flush_buffer
58 #ifdef yy_load_buffer_state
59 #define cmFortran_yy_load_buffer_state_ALREADY_DEFINED
61 #define yy_load_buffer_state cmFortran_yy_load_buffer_state
64 #ifdef yy_switch_to_buffer
65 #define cmFortran_yy_switch_to_buffer_ALREADY_DEFINED
67 #define yy_switch_to_buffer cmFortran_yy_switch_to_buffer
70 #ifdef yypush_buffer_state
71 #define cmFortran_yypush_buffer_state_ALREADY_DEFINED
73 #define yypush_buffer_state cmFortran_yypush_buffer_state
76 #ifdef yypop_buffer_state
77 #define cmFortran_yypop_buffer_state_ALREADY_DEFINED
79 #define yypop_buffer_state cmFortran_yypop_buffer_state
82 #ifdef yyensure_buffer_stack
83 #define cmFortran_yyensure_buffer_stack_ALREADY_DEFINED
85 #define yyensure_buffer_stack cmFortran_yyensure_buffer_stack
89 #define cmFortran_yylex_ALREADY_DEFINED
91 #define yylex cmFortran_yylex
95 #define cmFortran_yyrestart_ALREADY_DEFINED
97 #define yyrestart cmFortran_yyrestart
101 #define cmFortran_yylex_init_ALREADY_DEFINED
103 #define yylex_init cmFortran_yylex_init
106 #ifdef yylex_init_extra
107 #define cmFortran_yylex_init_extra_ALREADY_DEFINED
109 #define yylex_init_extra cmFortran_yylex_init_extra
113 #define cmFortran_yylex_destroy_ALREADY_DEFINED
115 #define yylex_destroy cmFortran_yylex_destroy
119 #define cmFortran_yyget_debug_ALREADY_DEFINED
121 #define yyget_debug cmFortran_yyget_debug
125 #define cmFortran_yyset_debug_ALREADY_DEFINED
127 #define yyset_debug cmFortran_yyset_debug
131 #define cmFortran_yyget_extra_ALREADY_DEFINED
133 #define yyget_extra cmFortran_yyget_extra
137 #define cmFortran_yyset_extra_ALREADY_DEFINED
139 #define yyset_extra cmFortran_yyset_extra
143 #define cmFortran_yyget_in_ALREADY_DEFINED
145 #define yyget_in cmFortran_yyget_in
149 #define cmFortran_yyset_in_ALREADY_DEFINED
151 #define yyset_in cmFortran_yyset_in
155 #define cmFortran_yyget_out_ALREADY_DEFINED
157 #define yyget_out cmFortran_yyget_out
161 #define cmFortran_yyset_out_ALREADY_DEFINED
163 #define yyset_out cmFortran_yyset_out
167 #define cmFortran_yyget_leng_ALREADY_DEFINED
169 #define yyget_leng cmFortran_yyget_leng
173 #define cmFortran_yyget_text_ALREADY_DEFINED
175 #define yyget_text cmFortran_yyget_text
179 #define cmFortran_yyget_lineno_ALREADY_DEFINED
181 #define yyget_lineno cmFortran_yyget_lineno
185 #define cmFortran_yyset_lineno_ALREADY_DEFINED
187 #define yyset_lineno cmFortran_yyset_lineno
191 #define cmFortran_yyget_column_ALREADY_DEFINED
193 #define yyget_column cmFortran_yyget_column
197 #define cmFortran_yyset_column_ALREADY_DEFINED
199 #define yyset_column cmFortran_yyset_column
203 #define cmFortran_yywrap_ALREADY_DEFINED
205 #define yywrap cmFortran_yywrap
209 #define cmFortran_yyalloc_ALREADY_DEFINED
211 #define yyalloc cmFortran_yyalloc
215 #define cmFortran_yyrealloc_ALREADY_DEFINED
217 #define yyrealloc cmFortran_yyrealloc
221 #define cmFortran_yyfree_ALREADY_DEFINED
223 #define yyfree cmFortran_yyfree
226 /* First, we deal with platform-specific or compiler-specific issues. */
228 /* begin standard C headers. */
234 /* end standard C headers. */
236 /* flex integer type definitions */
241 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
243 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
245 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
246 * if you want the limit (max/min) macros for int types.
248 #ifndef __STDC_LIMIT_MACROS
249 #define __STDC_LIMIT_MACROS 1
252 #include <inttypes.h>
253 typedef int8_t flex_int8_t;
254 typedef uint8_t flex_uint8_t;
255 typedef int16_t flex_int16_t;
256 typedef uint16_t flex_uint16_t;
257 typedef int32_t flex_int32_t;
258 typedef uint32_t flex_uint32_t;
260 typedef signed char flex_int8_t;
261 typedef short int flex_int16_t;
262 typedef int flex_int32_t;
263 typedef unsigned char flex_uint8_t;
264 typedef unsigned short int flex_uint16_t;
265 typedef unsigned int flex_uint32_t;
267 /* Limits of integral types. */
269 #define INT8_MIN (-128)
272 #define INT16_MIN (-32767-1)
275 #define INT32_MIN (-2147483647-1)
278 #define INT8_MAX (127)
281 #define INT16_MAX (32767)
284 #define INT32_MAX (2147483647)
287 #define UINT8_MAX (255U)
290 #define UINT16_MAX (65535U)
293 #define UINT32_MAX (4294967295U)
297 #define SIZE_MAX (~(size_t)0)
302 #endif /* ! FLEXINT_H */
304 /* begin standard C++ headers. */
306 /* TODO: this is always defined, so inline it */
307 #define yyconst const
309 #if defined(__GNUC__) && __GNUC__ >= 3
310 #define yynoreturn __attribute__((__noreturn__))
315 /* Returned upon end-of-file. */
318 /* Promotes a possibly negative, possibly signed char to an
319 * integer in range [0..255] for use as an array index.
321 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
323 /* An opaque pointer. */
324 #ifndef YY_TYPEDEF_YY_SCANNER_T
325 #define YY_TYPEDEF_YY_SCANNER_T
326 typedef void* yyscan_t;
329 /* For convenience, these vars (plus the bison vars far below)
330 are macros in the reentrant scanner. */
331 #define yyin yyg->yyin_r
332 #define yyout yyg->yyout_r
333 #define yyextra yyg->yyextra_r
334 #define yyleng yyg->yyleng_r
335 #define yytext yyg->yytext_r
336 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
337 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
338 #define yy_flex_debug yyg->yy_flex_debug_r
340 /* Enter a start condition. This macro really ought to take a parameter,
341 * but we do it the disgusting crufty way forced on us by the ()-less
342 * definition of BEGIN.
344 #define BEGIN yyg->yy_start = 1 + 2 *
345 /* Translate the current start state into a value that can be later handed
346 * to BEGIN to return to the state. The YYSTATE alias is for lex
349 #define YY_START ((yyg->yy_start - 1) / 2)
350 #define YYSTATE YY_START
351 /* Action number for EOF rule of a given start state. */
352 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
353 /* Special action meaning "start processing a new file". */
354 #define YY_NEW_FILE yyrestart( yyin , yyscanner )
355 #define YY_END_OF_BUFFER_CHAR 0
357 /* Size of default input buffer. */
360 /* On IA-64, the buffer size is 16k, not 8k.
361 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
362 * Ditto for the __ia64__ case accordingly.
364 #define YY_BUF_SIZE 32768
366 #define YY_BUF_SIZE 16384
367 #endif /* __ia64__ */
370 /* The state buf must be large enough to hold one state per character in the main buffer.
372 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
374 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
375 #define YY_TYPEDEF_YY_BUFFER_STATE
376 typedef struct yy_buffer_state *YY_BUFFER_STATE;
379 #ifndef YY_TYPEDEF_YY_SIZE_T
380 #define YY_TYPEDEF_YY_SIZE_T
381 typedef size_t yy_size_t;
384 #define EOB_ACT_CONTINUE_SCAN 0
385 #define EOB_ACT_END_OF_FILE 1
386 #define EOB_ACT_LAST_MATCH 2
388 #define YY_LESS_LINENO(n)
389 #define YY_LINENO_REWIND_TO(ptr)
391 /* Return all but the first "n" matched characters back to the input stream. */
395 /* Undo effects of setting up yytext. */ \
396 int yyless_macro_arg = (n); \
397 YY_LESS_LINENO(yyless_macro_arg);\
398 *yy_cp = yyg->yy_hold_char; \
399 YY_RESTORE_YY_MORE_OFFSET \
400 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
401 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
404 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
406 #ifndef YY_STRUCT_YY_BUFFER_STATE
407 #define YY_STRUCT_YY_BUFFER_STATE
408 struct yy_buffer_state
412 char *yy_ch_buf; /* input buffer */
413 char *yy_buf_pos; /* current position in input buffer */
415 /* Size of input buffer in bytes, not including room for EOB
420 /* Number of characters read into yy_ch_buf, not including EOB
425 /* Whether we "own" the buffer - i.e., we know we created it,
426 * and can realloc() it to grow it, and should free() it to
429 int yy_is_our_buffer;
431 /* Whether this is an "interactive" input source; if so, and
432 * if we're using stdio for input, then we want to use getc()
433 * instead of fread(), to make sure we stop fetching input after
436 int yy_is_interactive;
438 /* Whether we're considered to be at the beginning of a line.
439 * If so, '^' rules will be active on the next match, otherwise
444 int yy_bs_lineno; /**< The line count. */
445 int yy_bs_column; /**< The column count. */
447 /* Whether to try to fill the input buffer when we reach the
452 int yy_buffer_status;
454 #define YY_BUFFER_NEW 0
455 #define YY_BUFFER_NORMAL 1
456 /* When an EOF's been seen but there's still some text to process
457 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
458 * shouldn't try reading from the input source any more. We might
459 * still have a bunch of tokens to match, though, because of
460 * possible backing-up.
462 * When we actually see the EOF, we change the status to "new"
463 * (via yyrestart()), so that the user can continue scanning by
464 * just pointing yyin at a new input file.
466 #define YY_BUFFER_EOF_PENDING 2
469 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
471 /* We provide macros for accessing buffer states in case in the
472 * future we want to put the buffer states in a more general
475 * Returns the top of the stack, or NULL.
477 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
478 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
480 /* Same as previous macro, but useful when we know that the buffer stack is not
481 * NULL or when we need an lvalue. For internal use only.
483 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
485 void yyrestart ( FILE *input_file , yyscan_t yyscanner );
486 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
487 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
488 void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
489 void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
490 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
491 void yypop_buffer_state ( yyscan_t yyscanner );
493 static void yyensure_buffer_stack ( yyscan_t yyscanner );
494 static void yy_load_buffer_state ( yyscan_t yyscanner );
495 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
496 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
498 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
499 YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
500 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
502 void *yyalloc ( yy_size_t , yyscan_t yyscanner );
503 void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
504 void yyfree ( void * , yyscan_t yyscanner );
506 #define yy_new_buffer yy_create_buffer
507 #define yy_set_interactive(is_interactive) \
509 if ( ! YY_CURRENT_BUFFER ){ \
510 yyensure_buffer_stack (yyscanner); \
511 YY_CURRENT_BUFFER_LVALUE = \
512 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
514 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
516 #define yy_set_bol(at_bol) \
518 if ( ! YY_CURRENT_BUFFER ){\
519 yyensure_buffer_stack (yyscanner); \
520 YY_CURRENT_BUFFER_LVALUE = \
521 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
523 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
525 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
527 /* Begin user sect3 */
529 #define cmFortran_yywrap(yyscanner) (/*CONSTCOND*/1)
530 #define YY_SKIP_YYWRAP
531 typedef flex_uint8_t YY_CHAR;
533 typedef int yy_state_type;
535 #define yytext_ptr yytext_r
537 static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
538 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
539 static int yy_get_next_buffer ( yyscan_t yyscanner );
540 static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
542 /* Done after the current pattern has been matched and before the
543 * corresponding action - sets up yytext.
545 #define YY_DO_BEFORE_ACTION \
546 yyg->yytext_ptr = yy_bp; \
547 yyleng = (int) (yy_cp - yy_bp); \
548 yyg->yy_hold_char = *yy_cp; \
550 yyg->yy_c_buf_p = yy_cp;
551 #define YY_NUM_RULES 54
552 #define YY_END_OF_BUFFER 55
553 /* This struct is not used in this scanner,
554 but its presence is necessary. */
557 flex_int32_t yy_verify;
560 static const flex_int16_t yy_accept[216] =
562 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
563 55, 49, 51, 50, 53, 1, 49, 33, 2, 47,
564 48, 35, 37, 50, 39, 49, 46, 46, 46, 46,
565 46, 46, 49, 46, 51, 49, 50, 51, 49, 46,
566 9, 8, 9, 9, 4, 3, 49, 0, 10, 0,
567 0, 0, 0, 0, 33, 33, 34, 36, 39, 49,
568 46, 46, 46, 46, 46, 46, 0, 52, 0, 46,
569 0, 0, 0, 12, 0, 0, 0, 0, 0, 0,
570 0, 49, 0, 11, 46, 0, 0, 0, 5, 0,
571 0, 0, 0, 0, 29, 0, 33, 33, 33, 33,
573 0, 0, 40, 46, 46, 46, 46, 45, 12, 12,
574 0, 0, 0, 23, 0, 0, 0, 0, 0, 0,
575 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
576 46, 46, 46, 46, 0, 0, 0, 0, 0, 0,
577 0, 0, 0, 0, 0, 0, 0, 30, 31, 0,
578 0, 0, 0, 0, 46, 46, 46, 46, 0, 24,
579 25, 0, 0, 0, 0, 0, 0, 0, 0, 0,
580 20, 32, 27, 0, 0, 0, 46, 46, 43, 46,
581 0, 26, 21, 0, 0, 0, 19, 0, 0, 18,
582 28, 0, 0, 41, 46, 46, 17, 22, 0, 7,
584 38, 7, 15, 0, 46, 46, 14, 16, 42, 44,
588 static const YY_CHAR yy_ec[256] =
590 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
591 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
592 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
593 1, 5, 6, 7, 8, 9, 1, 10, 11, 12,
594 13, 14, 1, 15, 1, 1, 1, 16, 16, 16,
595 16, 16, 16, 16, 16, 16, 16, 17, 18, 19,
596 20, 21, 22, 1, 23, 24, 25, 26, 27, 28,
597 29, 29, 30, 29, 29, 31, 32, 33, 34, 29,
598 29, 35, 36, 37, 38, 29, 29, 29, 29, 29,
599 1, 39, 1, 1, 40, 1, 23, 24, 41, 42,
601 43, 44, 29, 29, 45, 29, 29, 46, 32, 47,
602 34, 29, 29, 35, 48, 37, 49, 29, 29, 29,
603 29, 29, 1, 1, 1, 1, 1, 1, 1, 1,
604 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
605 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
606 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
607 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
608 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
609 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
610 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
612 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
613 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
614 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
615 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
616 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
620 static const YY_CHAR yy_meta[50] =
622 1, 2, 2, 2, 3, 4, 4, 1, 1, 4,
623 4, 4, 4, 1, 4, 5, 4, 4, 1, 4,
624 6, 1, 7, 7, 7, 7, 7, 7, 7, 7,
625 7, 7, 7, 7, 7, 7, 7, 7, 1, 5,
626 7, 7, 7, 7, 7, 7, 7, 7, 7
629 static const flex_int16_t yy_base[225] =
631 0, 48, 0, 49, 55, 58, 64, 66, 75, 83,
632 491, 0, 492, 492, 487, 492, 86, 92, 492, 492,
633 492, 492, 472, 492, 467, 465, 0, 56, 59, 452,
634 66, 16, 105, 131, 109, 170, 480, 481, 219, 259,
635 492, 478, 479, 116, 492, 492, 0, 478, 492, 111,
636 453, 446, 34, 78, 155, 174, 492, 492, 492, 121,
637 0, 29, 105, 101, 454, 101, 131, 492, 474, 0,
638 180, 307, 0, 146, 433, 117, 94, 430, 427, 468,
639 467, 356, 468, 492, 0, 465, 464, 187, 191, 465,
640 439, 440, 149, 423, 126, 423, 200, 240, 311, 322,
642 206, 416, 0, 152, 180, 176, 430, 0, 216, 224,
643 417, 186, 418, 127, 418, 411, 415, 451, 450, 247,
644 492, 423, 416, 398, 393, 373, 364, 364, 359, 353,
645 198, 358, 178, 358, 346, 346, 346, 343, 344, 344,
646 338, 340, 339, 376, 374, 343, 346, 492, 492, 329,
647 325, 324, 313, 315, 211, 211, 291, 293, 313, 492,
648 492, 314, 304, 304, 261, 328, 212, 249, 243, 203,
649 492, 492, 492, 173, 158, 150, 293, 172, 0, 273,
650 144, 492, 492, 137, 125, 335, 492, 339, 0, 492,
651 492, 112, 63, 0, 304, 300, 492, 492, 58, 492,
653 492, 492, 492, 30, 311, 312, 361, 492, 0, 0,
654 366, 0, 44, 492, 492, 396, 403, 409, 412, 419,
658 static const flex_int16_t yy_def[225] =
660 215, 1, 1, 1, 1, 1, 216, 216, 216, 216,
661 215, 217, 215, 215, 218, 215, 217, 215, 215, 215,
662 215, 215, 215, 215, 215, 217, 219, 219, 219, 219,
663 219, 219, 217, 219, 215, 217, 215, 215, 220, 215,
664 215, 215, 215, 215, 215, 215, 217, 218, 215, 215,
665 215, 215, 215, 215, 215, 221, 215, 215, 215, 217,
666 219, 219, 219, 219, 219, 219, 215, 215, 215, 34,
667 215, 215, 72, 217, 215, 215, 215, 215, 215, 215,
668 215, 220, 220, 215, 40, 215, 215, 215, 215, 215,
669 215, 215, 215, 215, 215, 215, 221, 221, 221, 221,
671 215, 215, 219, 219, 219, 219, 219, 219, 215, 215,
672 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
673 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
674 219, 219, 219, 219, 215, 215, 215, 215, 215, 215,
675 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
676 215, 215, 215, 215, 219, 219, 219, 219, 215, 215,
677 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
678 215, 215, 215, 215, 215, 215, 219, 219, 219, 219,
679 215, 215, 215, 215, 215, 215, 215, 222, 223, 215,
680 215, 215, 215, 219, 219, 219, 215, 215, 215, 215,
682 215, 215, 215, 215, 219, 219, 215, 215, 219, 219,
683 215, 224, 224, 215, 0, 215, 215, 215, 215, 215,
687 static const flex_int16_t yy_nxt[542] =
689 12, 13, 14, 13, 13, 15, 16, 12, 17, 18,
690 19, 20, 21, 12, 22, 12, 23, 24, 12, 25,
691 12, 26, 27, 27, 27, 27, 28, 27, 27, 29,
692 27, 30, 27, 27, 27, 31, 27, 32, 33, 34,
693 27, 27, 28, 27, 29, 27, 27, 31, 32, 35,
694 35, 66, 35, 35, 103, 36, 36, 37, 38, 35,
695 37, 38, 35, 66, 214, 36, 42, 43, 42, 43,
696 103, 39, 208, 44, 45, 44, 45, 42, 43, 93,
697 94, 46, 40, 40, 44, 42, 43, 50, 62, 46,
698 50, 63, 44, 55, 55, 55, 55, 56, 40, 40,
700 207, 57, 62, 65, 204, 63, 67, 68, 69, 67,
701 71, 51, 50, 71, 65, 50, 72, 88, 89, 90,
702 88, 95, 101, 52, 96, 101, 106, 108, 53, 104,
703 54, 47, 67, 68, 69, 67, 51, 114, 47, 47,
704 115, 105, 106, 108, 47, 104, 70, 110, 52, 47,
705 110, 47, 47, 53, 203, 54, 55, 55, 55, 55,
706 56, 74, 112, 113, 57, 102, 199, 127, 139, 47,
707 70, 73, 128, 140, 73, 98, 55, 98, 98, 99,
708 198, 71, 131, 100, 71, 74, 197, 72, 88, 89,
709 90, 88, 120, 124, 195, 120, 125, 131, 193, 192,
711 121, 98, 55, 98, 98, 99, 132, 101, 157, 100,
712 101, 75, 76, 133, 77, 78, 191, 110, 79, 82,
713 110, 84, 132, 157, 133, 110, 82, 82, 110, 190,
714 136, 109, 82, 137, 82, 155, 177, 82, 178, 82,
715 82, 98, 55, 98, 98, 99, 155, 189, 120, 100,
716 102, 120, 177, 188, 178, 187, 121, 82, 82, 83,
717 83, 84, 83, 83, 83, 83, 83, 83, 83, 83,
718 83, 83, 83, 83, 85, 83, 83, 83, 83, 83,
719 83, 85, 85, 85, 85, 85, 85, 85, 85, 85,
720 85, 85, 85, 85, 85, 85, 85, 83, 85, 85,
722 85, 85, 85, 85, 85, 85, 85, 85, 73, 185,
723 196, 73, 98, 55, 98, 98, 99, 179, 180, 194,
724 100, 196, 109, 98, 55, 98, 98, 99, 205, 186,
725 206, 100, 186, 179, 180, 194, 186, 209, 210, 186,
726 201, 201, 201, 109, 205, 206, 184, 183, 75, 76,
727 109, 77, 78, 209, 210, 79, 82, 182, 84, 181,
728 176, 175, 211, 82, 82, 211, 174, 211, 173, 82,
729 211, 82, 172, 171, 82, 170, 82, 82, 169, 212,
730 168, 167, 166, 165, 212, 164, 163, 162, 161, 160,
731 159, 158, 156, 154, 82, 82, 41, 41, 41, 41,
733 41, 41, 41, 47, 153, 152, 151, 47, 47, 48,
734 48, 48, 48, 48, 48, 48, 61, 150, 61, 83,
735 83, 83, 83, 83, 83, 83, 97, 97, 97, 97,
736 97, 97, 97, 200, 200, 149, 200, 200, 200, 200,
737 202, 148, 147, 202, 202, 202, 202, 213, 213, 213,
738 213, 213, 146, 213, 145, 144, 143, 142, 141, 138,
739 135, 134, 130, 129, 126, 123, 122, 89, 86, 119,
740 84, 80, 118, 117, 116, 111, 68, 107, 92, 91,
741 49, 87, 86, 81, 80, 64, 60, 59, 58, 49,
742 215, 11, 215, 215, 215, 215, 215, 215, 215, 215,
744 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
745 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
746 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
747 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
751 static const flex_int16_t yy_chk[542] =
753 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
754 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
755 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
756 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
757 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
758 4, 32, 2, 4, 62, 2, 4, 5, 5, 6,
759 6, 6, 6, 32, 213, 6, 7, 7, 8, 8,
760 62, 6, 204, 7, 7, 8, 8, 9, 9, 53,
761 53, 9, 6, 6, 9, 10, 10, 17, 28, 10,
762 17, 29, 10, 18, 18, 18, 18, 18, 6, 6,
764 199, 18, 28, 31, 193, 29, 33, 33, 33, 33,
765 35, 17, 50, 35, 31, 50, 35, 44, 44, 44,
766 44, 54, 60, 17, 54, 60, 64, 66, 17, 63,
767 17, 34, 67, 67, 67, 67, 50, 77, 34, 34,
768 77, 63, 64, 66, 34, 63, 34, 74, 50, 34,
769 74, 34, 34, 50, 192, 50, 55, 55, 55, 55,
770 55, 74, 76, 76, 55, 60, 185, 95, 114, 34,
771 34, 36, 95, 114, 36, 56, 56, 56, 56, 56,
772 184, 71, 104, 56, 71, 36, 181, 71, 88, 88,
773 88, 88, 89, 93, 178, 89, 93, 104, 176, 175,
775 89, 97, 97, 97, 97, 97, 105, 101, 133, 97,
776 101, 36, 36, 106, 36, 36, 174, 109, 36, 39,
777 109, 39, 105, 133, 106, 110, 39, 39, 110, 170,
778 112, 109, 39, 112, 39, 131, 155, 39, 156, 39,
779 39, 98, 98, 98, 98, 98, 131, 169, 120, 98,
780 101, 120, 155, 168, 156, 167, 120, 39, 39, 40,
781 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
782 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
783 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
784 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
786 40, 40, 40, 40, 40, 40, 40, 40, 72, 165,
787 180, 72, 99, 99, 99, 99, 99, 157, 158, 177,
788 99, 180, 72, 100, 100, 100, 100, 100, 195, 166,
789 196, 100, 166, 157, 158, 177, 186, 205, 206, 186,
790 188, 188, 188, 166, 195, 196, 164, 163, 72, 72,
791 186, 72, 72, 205, 206, 72, 82, 162, 82, 159,
792 154, 153, 207, 82, 82, 207, 152, 211, 151, 82,
793 211, 82, 150, 147, 82, 146, 82, 82, 145, 207,
794 144, 143, 142, 141, 211, 140, 139, 138, 137, 136,
795 135, 134, 132, 130, 82, 82, 216, 216, 216, 216,
797 216, 216, 216, 217, 129, 128, 127, 217, 217, 218,
798 218, 218, 218, 218, 218, 218, 219, 126, 219, 220,
799 220, 220, 220, 220, 220, 220, 221, 221, 221, 221,
800 221, 221, 221, 222, 222, 125, 222, 222, 222, 222,
801 223, 124, 123, 223, 223, 223, 223, 224, 224, 224,
802 224, 224, 122, 224, 119, 118, 117, 116, 115, 113,
803 111, 107, 102, 96, 94, 92, 91, 90, 87, 86,
804 83, 81, 80, 79, 78, 75, 69, 65, 52, 51,
805 48, 43, 42, 38, 37, 30, 26, 25, 23, 15,
806 11, 215, 215, 215, 215, 215, 215, 215, 215, 215,
808 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
809 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
810 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
811 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
815 /* The intent behind this definition is that it'll catch
816 * any uses of REJECT which flex missed.
818 #define REJECT reject_used_but_not_detected
819 #define yymore() yymore_used_but_not_detected
820 #define YY_MORE_ADJ 0
821 #define YY_RESTORE_YY_MORE_OFFSET
822 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
823 file Copyright.txt or https://cmake.org/licensing for details. */
824 /*-------------------------------------------------------------------------
825 Portions of this source have been derived from makedepf90 version 2.8.8,
827 Copyright (C) 2000--2006 Erik Edelmann <erik.edelmann@iki.fi>
829 The code was originally distributed under the GPL but permission
830 from the copyright holder has been obtained to distribute this
831 derived work under the CMake license.
832 -------------------------------------------------------------------------*/
836 This file must be translated to C++ and modified to build everywhere.
838 Run flex >= 2.6 like this:
840 flex -i --nounistd -DFLEXINT_H --noline --header-file=cmFortranLexer.h -ocmFortranLexer.cxx cmFortranLexer.in.l
842 Modify cmFortranLexer.cxx:
843 - remove trailing whitespace: sed -i 's/\s*$//' cmFortranLexer.h cmFortranLexer.cxx
844 - remove blank lines at end of file: sed -i '${/^$/d;}' cmFortranLexer.h cmFortranLexer.cxx
845 - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmFortranLexer.cxx
848 /* IWYU pragma: no_forward_declare yyguts_t */
850 #ifndef __clang_analyzer__ /* Suppress clang-analyzer warnings */
854 #define cmFortranLexer_cxx
855 #include "cmFortranParser.h" /* Interface to parser object. */
857 /* Replace the lexer input function. */
859 #define YY_INPUT(buf, result, max_size) \
860 do { result = cmFortranParser_Input(yyextra, buf, max_size); } while (0)
862 /* Include the set of tokens from the parser. */
863 #include "cmFortranParserTokens.h"
865 /*--------------------------------------------------------------------------*/
873 #ifndef YY_EXTRA_TYPE
874 #define YY_EXTRA_TYPE void *
877 /* Holds the entire state of the reentrant scanner. */
881 /* User-defined. Not touched by flex. */
882 YY_EXTRA_TYPE yyextra_r;
884 /* The rest are the same as the globals declared in the non-reentrant scanner. */
885 FILE *yyin_r, *yyout_r;
886 size_t yy_buffer_stack_top; /**< index of top of stack. */
887 size_t yy_buffer_stack_max; /**< capacity of stack. */
888 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
895 int yy_did_buffer_switch_on_eof;
896 int yy_start_stack_ptr;
897 int yy_start_stack_depth;
899 yy_state_type yy_last_accepting_state;
900 char* yy_last_accepting_cpos;
909 }; /* end struct yyguts_t */
911 static int yy_init_globals ( yyscan_t yyscanner );
913 int yylex_init (yyscan_t* scanner);
915 int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
917 /* Accessor methods to globals.
918 These are made visible to non-reentrant scanners for convenience. */
920 int yylex_destroy ( yyscan_t yyscanner );
922 int yyget_debug ( yyscan_t yyscanner );
924 void yyset_debug ( int debug_flag , yyscan_t yyscanner );
926 YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
928 void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
930 FILE *yyget_in ( yyscan_t yyscanner );
932 void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
934 FILE *yyget_out ( yyscan_t yyscanner );
936 void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
938 int yyget_leng ( yyscan_t yyscanner );
940 char *yyget_text ( yyscan_t yyscanner );
942 int yyget_lineno ( yyscan_t yyscanner );
944 void yyset_lineno ( int _line_number , yyscan_t yyscanner );
946 int yyget_column ( yyscan_t yyscanner );
948 void yyset_column ( int _column_no , yyscan_t yyscanner );
950 /* Macros after this point can all be overridden by user definitions in
954 #ifndef YY_SKIP_YYWRAP
956 extern "C" int yywrap ( yyscan_t yyscanner );
958 extern int yywrap ( yyscan_t yyscanner );
964 static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
969 static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
972 #ifdef YY_NEED_STRLEN
973 static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
978 static int yyinput ( yyscan_t yyscanner );
980 static int input ( yyscan_t yyscanner );
985 /* Amount of stuff to slurp up with each read. */
986 #ifndef YY_READ_BUF_SIZE
988 /* On IA-64, the buffer size is 16k, not 8k */
989 #define YY_READ_BUF_SIZE 16384
991 #define YY_READ_BUF_SIZE 8192
992 #endif /* __ia64__ */
995 /* Copy whatever the last rule matched to the standard output. */
997 /* This used to be an fputs(), but since the string might contain NUL's,
998 * we now use fwrite().
1000 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1003 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1004 * is returned in "result".
1007 #define YY_INPUT(buf,result,max_size) \
1008 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1012 for ( n = 0; n < max_size && \
1013 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1014 buf[n] = (char) c; \
1016 buf[n++] = (char) c; \
1017 if ( c == EOF && ferror( yyin ) ) \
1018 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1024 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1026 if( errno != EINTR) \
1028 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1039 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1040 * we don't want an extra ';' after the "return" because that will cause
1041 * some compilers to complain about unreachable statements.
1044 #define yyterminate() return YY_NULL
1047 /* Number of entries by which start-condition stack grows. */
1048 #ifndef YY_START_STACK_INCR
1049 #define YY_START_STACK_INCR 25
1052 /* Report a fatal error. */
1053 #ifndef YY_FATAL_ERROR
1054 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1057 /* end tables serialization structures and prototypes */
1059 /* Default declaration of generated scanner - a define so the user can
1060 * easily add parameters.
1063 #define YY_DECL_IS_OURS 1
1065 extern int yylex (yyscan_t yyscanner);
1067 #define YY_DECL int yylex (yyscan_t yyscanner)
1068 #endif /* !YY_DECL */
1070 /* Code executed at the beginning of each rule, after yytext and yyleng
1073 #ifndef YY_USER_ACTION
1074 #define YY_USER_ACTION
1077 /* Code executed at the end of each rule. */
1079 #define YY_BREAK /*LINTED*/break;
1082 #define YY_RULE_SETUP \
1084 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1085 (yytext[yyleng - 1] == '\n'); \
1088 /** The main scanner function which does all the work.
1092 yy_state_type yy_current_state;
1093 char *yy_cp, *yy_bp;
1095 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1097 if ( !yyg->yy_init )
1105 if ( ! yyg->yy_start )
1106 yyg->yy_start = 1; /* first start state */
1114 if ( ! YY_CURRENT_BUFFER ) {
1115 yyensure_buffer_stack (yyscanner);
1116 YY_CURRENT_BUFFER_LVALUE =
1117 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1120 yy_load_buffer_state( yyscanner );
1125 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1127 yy_cp = yyg->yy_c_buf_p;
1129 /* Support of yytext. */
1130 *yy_cp = yyg->yy_hold_char;
1132 /* yy_bp points to the position in yy_ch_buf of the start of
1137 yy_current_state = yyg->yy_start;
1138 yy_current_state += YY_AT_BOL();
1142 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1143 if ( yy_accept[yy_current_state] )
1145 yyg->yy_last_accepting_state = yy_current_state;
1146 yyg->yy_last_accepting_cpos = yy_cp;
1148 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1150 yy_current_state = (int) yy_def[yy_current_state];
1151 if ( yy_current_state >= 216 )
1152 yy_c = yy_meta[yy_c];
1154 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1157 while ( yy_base[yy_current_state] != 492 );
1160 yy_act = yy_accept[yy_current_state];
1162 { /* have to back up */
1163 yy_cp = yyg->yy_last_accepting_cpos;
1164 yy_current_state = yyg->yy_last_accepting_state;
1165 yy_act = yy_accept[yy_current_state];
1168 YY_DO_BEFORE_ACTION;
1170 do_action: /* This label is used only to access EOF actions. */
1173 { /* beginning of action switch */
1174 case 0: /* must back up */
1175 /* undo the effects of YY_DO_BEFORE_ACTION */
1176 *yy_cp = yyg->yy_hold_char;
1177 yy_cp = yyg->yy_last_accepting_cpos;
1178 yy_current_state = yyg->yy_last_accepting_state;
1179 goto yy_find_action;
1184 cmFortranParser_StringStart(yyextra);
1185 cmFortranParser_SetOldStartcond(yyextra, YY_START);
1192 cmFortranParser_StringStart(yyextra);
1193 cmFortranParser_SetOldStartcond(yyextra, YY_START);
1201 BEGIN(cmFortranParser_GetOldStartcond(yyextra) );
1202 yylvalp->string = strdup(cmFortranParser_StringEnd(yyextra));
1207 /* rule 5 can match eol */
1209 /* rule 6 can match eol */
1211 /* Ignore (continued strings, free fmt) */
1214 /* rule 7 can match eol */
1217 if (cmFortranParser_GetOldStartcond(yyextra) == fixed_fmt)
1218 ; /* Ignore (cont. strings, fixed fmt) */
1221 unput(yytext[strlen(yytext)-1]);
1226 /* rule 8 can match eol */
1231 return UNTERMINATED_STRING;
1237 cmFortranParser_StringAppend(yyextra, yytext[0]);
1241 /* rule 10 can match eol */
1243 { return EOSTMT; } /* Treat comments like */
1246 /* rule 11 can match eol */
1248 { return EOSTMT; } /* empty lines */
1252 { return CPP_LINE_DIRECTIVE; }
1255 /* rule 13 can match eol */
1258 yytext[yyleng-1] = 0;
1259 yylvalp->string = strdup(strchr(yytext, '<')+1);
1260 return CPP_INCLUDE_ANGLE;
1265 { return CPP_INCLUDE; }
1269 { return F90PPR_INCLUDE; }
1273 { return COCO_INCLUDE; }
1277 { return CPP_DEFINE; }
1281 { return F90PPR_DEFINE; }
1285 { return CPP_UNDEF; }
1289 { return F90PPR_UNDEF; }
1293 { return CPP_IFDEF; }
1297 { return CPP_IFNDEF; }
1305 { return CPP_ELIF; }
1309 { return CPP_ELSE; }
1313 { return CPP_ENDIF; }
1317 { return F90PPR_IFDEF; }
1321 { return F90PPR_IFNDEF; }
1325 { return F90PPR_IF; }
1329 { return F90PPR_ELIF; }
1333 { return F90PPR_ELSE; }
1337 { return F90PPR_ENDIF; }
1339 /* Line continuations, possible involving comments. */
1341 /* rule 33 can match eol */
1346 /* rule 34 can match eol */
1363 /* rule 38 can match eol */
1369 { return ASSIGNMENT_OP; }
1381 { return INTERFACE; }
1389 { return SUBMODULE; }
1398 yylvalp->string = strdup(yytext);
1415 /* rule 50 can match eol */
1424 /* rule 52 can match eol */
1426 /* Ignore line-endings preceded by \ */
1432 case YY_STATE_EOF(INITIAL):
1433 case YY_STATE_EOF(free_fmt):
1434 case YY_STATE_EOF(fixed_fmt):
1435 case YY_STATE_EOF(str_sq):
1436 case YY_STATE_EOF(str_dq):
1438 if(!cmFortranParser_FilePop(yyextra) )
1449 case YY_END_OF_BUFFER:
1451 /* Amount of text matched not including the EOB char. */
1452 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1454 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1455 *yy_cp = yyg->yy_hold_char;
1456 YY_RESTORE_YY_MORE_OFFSET
1458 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1460 /* We're scanning a new file or input source. It's
1461 * possible that this happened because the user
1462 * just pointed yyin at a new source and called
1463 * yylex(). If so, then we have to assure
1464 * consistency between YY_CURRENT_BUFFER and our
1465 * globals. Here is the right place to do so, because
1466 * this is the first action (other than possibly a
1467 * back-up) that will match for the new input source.
1469 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1470 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1471 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1474 /* Note that here we test for yy_c_buf_p "<=" to the position
1475 * of the first EOB in the buffer, since yy_c_buf_p will
1476 * already have been incremented past the NUL character
1477 * (since all states make transitions on EOB to the
1478 * end-of-buffer state). Contrast this with the test
1481 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1482 { /* This was really a NUL. */
1483 yy_state_type yy_next_state;
1485 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1487 yy_current_state = yy_get_previous_state( yyscanner );
1489 /* Okay, we're now positioned to make the NUL
1490 * transition. We couldn't have
1491 * yy_get_previous_state() go ahead and do it
1492 * for us because it doesn't know how to deal
1493 * with the possibility of jamming (and we don't
1494 * want to build jamming into it because then it
1495 * will run more slowly).
1498 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1500 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1502 if ( yy_next_state )
1504 /* Consume the NUL. */
1505 yy_cp = ++yyg->yy_c_buf_p;
1506 yy_current_state = yy_next_state;
1512 yy_cp = yyg->yy_c_buf_p;
1513 goto yy_find_action;
1517 else switch ( yy_get_next_buffer( yyscanner ) )
1519 case EOB_ACT_END_OF_FILE:
1521 yyg->yy_did_buffer_switch_on_eof = 0;
1523 if ( yywrap( yyscanner ) )
1525 /* Note: because we've taken care in
1526 * yy_get_next_buffer() to have set up
1527 * yytext, we can now set up
1528 * yy_c_buf_p so that if some total
1529 * hoser (like flex itself) wants to
1530 * call the scanner after we return the
1531 * YY_NULL, it'll still work - another
1532 * YY_NULL will get returned.
1534 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1536 yy_act = YY_STATE_EOF(YY_START);
1542 if ( ! yyg->yy_did_buffer_switch_on_eof )
1548 case EOB_ACT_CONTINUE_SCAN:
1550 yyg->yytext_ptr + yy_amount_of_matched_text;
1552 yy_current_state = yy_get_previous_state( yyscanner );
1554 yy_cp = yyg->yy_c_buf_p;
1555 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1558 case EOB_ACT_LAST_MATCH:
1560 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1562 yy_current_state = yy_get_previous_state( yyscanner );
1564 yy_cp = yyg->yy_c_buf_p;
1565 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1566 goto yy_find_action;
1573 "fatal flex scanner internal error--no action found" );
1574 } /* end of action switch */
1575 } /* end of scanning one token */
1576 } /* end of user's declarations */
1577 } /* end of yylex */
1579 /* yy_get_next_buffer - try to read in a new buffer
1581 * Returns a code representing an action:
1582 * EOB_ACT_LAST_MATCH -
1583 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1584 * EOB_ACT_END_OF_FILE - end of file
1586 static int yy_get_next_buffer (yyscan_t yyscanner)
1588 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1589 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1590 char *source = yyg->yytext_ptr;
1591 int number_to_move, i;
1594 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1596 "fatal flex scanner internal error--end of buffer missed" );
1598 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1599 { /* Don't try to fill the buffer, so this is an EOF. */
1600 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1602 /* We matched a single character, the EOB, so
1603 * treat this as a final EOF.
1605 return EOB_ACT_END_OF_FILE;
1610 /* We matched some text prior to the EOB, first
1613 return EOB_ACT_LAST_MATCH;
1617 /* Try to read more data. */
1619 /* First move last chars to start of buffer. */
1620 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
1622 for ( i = 0; i < number_to_move; ++i )
1623 *(dest++) = *(source++);
1625 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1626 /* don't do the read, it's not guaranteed to return an EOF,
1629 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1634 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1636 while ( num_to_read <= 0 )
1637 { /* Not enough room in the buffer - grow it. */
1639 /* just a shorter name for the current buffer */
1640 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1642 int yy_c_buf_p_offset =
1643 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1645 if ( b->yy_is_our_buffer )
1647 int new_size = b->yy_buf_size * 2;
1649 if ( new_size <= 0 )
1650 b->yy_buf_size += b->yy_buf_size / 8;
1652 b->yy_buf_size *= 2;
1654 b->yy_ch_buf = (char *)
1655 /* Include room in for 2 EOB chars. */
1656 yyrealloc( (void *) b->yy_ch_buf,
1657 (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1660 /* Can't grow it, we don't own it. */
1661 b->yy_ch_buf = NULL;
1663 if ( ! b->yy_ch_buf )
1665 "fatal error - scanner input buffer overflow" );
1667 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1669 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1674 if ( num_to_read > YY_READ_BUF_SIZE )
1675 num_to_read = YY_READ_BUF_SIZE;
1677 /* Read in more data. */
1678 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1679 yyg->yy_n_chars, num_to_read );
1681 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1684 if ( yyg->yy_n_chars == 0 )
1686 if ( number_to_move == YY_MORE_ADJ )
1688 ret_val = EOB_ACT_END_OF_FILE;
1689 yyrestart( yyin , yyscanner);
1694 ret_val = EOB_ACT_LAST_MATCH;
1695 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1696 YY_BUFFER_EOF_PENDING;
1701 ret_val = EOB_ACT_CONTINUE_SCAN;
1703 if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1704 /* Extend the array by 50%, plus the number we really need. */
1705 int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1706 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1707 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
1708 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1709 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1710 /* "- 2" to take care of EOB's */
1711 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1714 yyg->yy_n_chars += number_to_move;
1715 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1716 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1718 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1723 /* yy_get_previous_state - get the state just before the EOB char was reached */
1725 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1727 yy_state_type yy_current_state;
1729 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1731 yy_current_state = yyg->yy_start;
1732 yy_current_state += YY_AT_BOL();
1734 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1736 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1737 if ( yy_accept[yy_current_state] )
1739 yyg->yy_last_accepting_state = yy_current_state;
1740 yyg->yy_last_accepting_cpos = yy_cp;
1742 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1744 yy_current_state = (int) yy_def[yy_current_state];
1745 if ( yy_current_state >= 216 )
1746 yy_c = yy_meta[yy_c];
1748 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1751 return yy_current_state;
1754 /* yy_try_NUL_trans - try to make a transition on the NUL character
1757 * next_state = yy_try_NUL_trans( current_state );
1759 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1762 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1763 char *yy_cp = yyg->yy_c_buf_p;
1766 if ( yy_accept[yy_current_state] )
1768 yyg->yy_last_accepting_state = yy_current_state;
1769 yyg->yy_last_accepting_cpos = yy_cp;
1771 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1773 yy_current_state = (int) yy_def[yy_current_state];
1774 if ( yy_current_state >= 216 )
1775 yy_c = yy_meta[yy_c];
1777 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1778 yy_is_jam = (yy_current_state == 215);
1781 return yy_is_jam ? 0 : yy_current_state;
1786 static void yyunput (int c, char * yy_bp , yyscan_t yyscanner)
1789 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1791 yy_cp = yyg->yy_c_buf_p;
1793 /* undo effects of setting up yytext */
1794 *yy_cp = yyg->yy_hold_char;
1796 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1797 { /* need to shift things up to make room */
1798 /* +2 for EOB chars. */
1799 int number_to_move = yyg->yy_n_chars + 2;
1800 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1801 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1803 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1805 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1806 *--dest = *--source;
1808 yy_cp += (int) (dest - source);
1809 yy_bp += (int) (dest - source);
1810 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1811 yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1813 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1814 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1817 *--yy_cp = (char) c;
1819 yyg->yytext_ptr = yy_bp;
1820 yyg->yy_hold_char = *yy_cp;
1821 yyg->yy_c_buf_p = yy_cp;
1828 static int yyinput (yyscan_t yyscanner)
1830 static int input (yyscan_t yyscanner)
1835 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1837 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1839 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1841 /* yy_c_buf_p now points to the character we want to return.
1842 * If this occurs *before* the EOB characters, then it's a
1843 * valid NUL; if not, then we've hit the end of the buffer.
1845 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1846 /* This was really a NUL. */
1847 *yyg->yy_c_buf_p = '\0';
1850 { /* need more input */
1851 int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
1854 switch ( yy_get_next_buffer( yyscanner ) )
1856 case EOB_ACT_LAST_MATCH:
1857 /* This happens because yy_g_n_b()
1858 * sees that we've accumulated a
1859 * token and flags that we need to
1860 * try matching the token before
1861 * proceeding. But for input(),
1862 * there's no matching to consider.
1863 * So convert the EOB_ACT_LAST_MATCH
1864 * to EOB_ACT_END_OF_FILE.
1867 /* Reset buffer status. */
1868 yyrestart( yyin , yyscanner);
1872 case EOB_ACT_END_OF_FILE:
1874 if ( yywrap( yyscanner ) )
1877 if ( ! yyg->yy_did_buffer_switch_on_eof )
1880 return yyinput(yyscanner);
1882 return input(yyscanner);
1886 case EOB_ACT_CONTINUE_SCAN:
1887 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1893 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1894 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1895 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1897 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1901 #endif /* ifndef YY_NO_INPUT */
1903 /** Immediately switch to a different input stream.
1904 * @param input_file A readable stream.
1905 * @param yyscanner The scanner object.
1906 * @note This function does not reset the start condition to @c INITIAL .
1908 void yyrestart (FILE * input_file , yyscan_t yyscanner)
1910 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1912 if ( ! YY_CURRENT_BUFFER ){
1913 yyensure_buffer_stack (yyscanner);
1914 YY_CURRENT_BUFFER_LVALUE =
1915 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1918 yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
1919 yy_load_buffer_state( yyscanner );
1922 /** Switch to a different input buffer.
1923 * @param new_buffer The new input buffer.
1924 * @param yyscanner The scanner object.
1926 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1928 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1930 /* TODO. We should be able to replace this entire function body
1932 * yypop_buffer_state();
1933 * yypush_buffer_state(new_buffer);
1935 yyensure_buffer_stack (yyscanner);
1936 if ( YY_CURRENT_BUFFER == new_buffer )
1939 if ( YY_CURRENT_BUFFER )
1941 /* Flush out information for old buffer. */
1942 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1943 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1944 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1947 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1948 yy_load_buffer_state( yyscanner );
1950 /* We don't actually know whether we did this switch during
1951 * EOF (yywrap()) processing, but the only time this flag
1952 * is looked at is after yywrap() is called, so it's safe
1953 * to go ahead and always set it.
1955 yyg->yy_did_buffer_switch_on_eof = 1;
1958 static void yy_load_buffer_state (yyscan_t yyscanner)
1960 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1961 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1962 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1963 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1964 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1967 /** Allocate and initialize an input buffer state.
1968 * @param file A readable stream.
1969 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1970 * @param yyscanner The scanner object.
1971 * @return the allocated buffer state.
1973 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1977 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
1979 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1981 b->yy_buf_size = size;
1983 /* yy_ch_buf has to be 2 characters longer than the size given because
1984 * we need to put in 2 end-of-buffer characters.
1986 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1987 if ( ! b->yy_ch_buf )
1988 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1990 b->yy_is_our_buffer = 1;
1992 yy_init_buffer( b, file , yyscanner);
1997 /** Destroy the buffer.
1998 * @param b a buffer created with yy_create_buffer()
1999 * @param yyscanner The scanner object.
2001 void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2003 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2008 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2009 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2011 if ( b->yy_is_our_buffer )
2012 yyfree( (void *) b->yy_ch_buf , yyscanner );
2014 yyfree( (void *) b , yyscanner );
2017 /* Initializes or reinitializes a buffer.
2018 * This function is sometimes called more than once on the same buffer,
2019 * such as during a yyrestart() or at EOF.
2021 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2025 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2027 yy_flush_buffer( b , yyscanner);
2029 b->yy_input_file = file;
2030 b->yy_fill_buffer = 1;
2032 /* If b is the current buffer, then yy_init_buffer was _probably_
2033 * called from yyrestart() or through yy_get_next_buffer.
2034 * In that case, we don't want to reset the lineno or column.
2036 if (b != YY_CURRENT_BUFFER){
2037 b->yy_bs_lineno = 1;
2038 b->yy_bs_column = 0;
2041 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2046 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2047 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2048 * @param yyscanner The scanner object.
2050 void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2052 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2058 /* We always need two end-of-buffer characters. The first causes
2059 * a transition to the end-of-buffer state. The second causes
2060 * a jam in that state.
2062 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2063 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2065 b->yy_buf_pos = &b->yy_ch_buf[0];
2068 b->yy_buffer_status = YY_BUFFER_NEW;
2070 if ( b == YY_CURRENT_BUFFER )
2071 yy_load_buffer_state( yyscanner );
2074 /** Pushes the new state onto the stack. The new state becomes
2075 * the current state. This function will allocate the stack
2077 * @param new_buffer The new state.
2078 * @param yyscanner The scanner object.
2080 void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2082 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2083 if (new_buffer == NULL)
2086 yyensure_buffer_stack(yyscanner);
2088 /* This block is copied from yy_switch_to_buffer. */
2089 if ( YY_CURRENT_BUFFER )
2091 /* Flush out information for old buffer. */
2092 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2093 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2094 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2097 /* Only push if top exists. Otherwise, replace top. */
2098 if (YY_CURRENT_BUFFER)
2099 yyg->yy_buffer_stack_top++;
2100 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2102 /* copied from yy_switch_to_buffer. */
2103 yy_load_buffer_state( yyscanner );
2104 yyg->yy_did_buffer_switch_on_eof = 1;
2107 /** Removes and deletes the top of the stack, if present.
2108 * The next element becomes the new top.
2109 * @param yyscanner The scanner object.
2111 void yypop_buffer_state (yyscan_t yyscanner)
2113 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2114 if (!YY_CURRENT_BUFFER)
2117 yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
2118 YY_CURRENT_BUFFER_LVALUE = NULL;
2119 if (yyg->yy_buffer_stack_top > 0)
2120 --yyg->yy_buffer_stack_top;
2122 if (YY_CURRENT_BUFFER) {
2123 yy_load_buffer_state( yyscanner );
2124 yyg->yy_did_buffer_switch_on_eof = 1;
2128 /* Allocates the stack if it does not exist.
2129 * Guarantees space for at least one push.
2131 static void yyensure_buffer_stack (yyscan_t yyscanner)
2133 yy_size_t num_to_alloc;
2134 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2136 if (!yyg->yy_buffer_stack) {
2138 /* First allocation is just for 2 elements, since we don't know if this
2139 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2140 * immediate realloc on the next call.
2142 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2143 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
2144 (num_to_alloc * sizeof(struct yy_buffer_state*)
2146 if ( ! yyg->yy_buffer_stack )
2147 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2149 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2151 yyg->yy_buffer_stack_max = num_to_alloc;
2152 yyg->yy_buffer_stack_top = 0;
2156 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2158 /* Increase the buffer to prepare for a possible push. */
2159 yy_size_t grow_size = 8 /* arbitrary grow size */;
2161 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2162 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
2163 (yyg->yy_buffer_stack,
2164 num_to_alloc * sizeof(struct yy_buffer_state*)
2166 if ( ! yyg->yy_buffer_stack )
2167 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2169 /* zero only the new slots.*/
2170 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2171 yyg->yy_buffer_stack_max = num_to_alloc;
2175 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2176 * @param base the character buffer
2177 * @param size the size in bytes of the character buffer
2178 * @param yyscanner The scanner object.
2179 * @return the newly allocated buffer state object.
2181 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
2186 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2187 base[size-1] != YY_END_OF_BUFFER_CHAR )
2188 /* They forgot to leave room for the EOB's. */
2191 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2193 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2195 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2196 b->yy_buf_pos = b->yy_ch_buf = base;
2197 b->yy_is_our_buffer = 0;
2198 b->yy_input_file = NULL;
2199 b->yy_n_chars = b->yy_buf_size;
2200 b->yy_is_interactive = 0;
2202 b->yy_fill_buffer = 0;
2203 b->yy_buffer_status = YY_BUFFER_NEW;
2205 yy_switch_to_buffer( b , yyscanner );
2210 /** Setup the input buffer state to scan a string. The next call to yylex() will
2211 * scan from a @e copy of @a str.
2212 * @param yystr a NUL-terminated string to scan
2213 * @param yyscanner The scanner object.
2214 * @return the newly allocated buffer state object.
2215 * @note If you want to scan bytes that may contain NUL values, then use
2216 * yy_scan_bytes() instead.
2218 YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
2221 return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
2224 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2225 * scan from a @e copy of @a bytes.
2226 * @param yybytes the byte buffer to scan
2227 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2228 * @param yyscanner The scanner object.
2229 * @return the newly allocated buffer state object.
2231 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
2238 /* Get memory for full buffer, including space for trailing EOB's. */
2239 n = (yy_size_t) (_yybytes_len + 2);
2240 buf = (char *) yyalloc( n , yyscanner );
2242 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2244 for ( i = 0; i < _yybytes_len; ++i )
2245 buf[i] = yybytes[i];
2247 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2249 b = yy_scan_buffer( buf, n , yyscanner);
2251 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2253 /* It's okay to grow etc. this buffer, and we should throw it
2254 * away when we're done.
2256 b->yy_is_our_buffer = 1;
2261 #ifndef YY_EXIT_FAILURE
2262 #define YY_EXIT_FAILURE 2
2265 static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
2267 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2269 fprintf( stderr, "%s\n", msg );
2270 exit( YY_EXIT_FAILURE );
2273 /* Redefine yyless() so it works in section 3 code. */
2279 /* Undo effects of setting up yytext. */ \
2280 int yyless_macro_arg = (n); \
2281 YY_LESS_LINENO(yyless_macro_arg);\
2282 yytext[yyleng] = yyg->yy_hold_char; \
2283 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2284 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2285 *yyg->yy_c_buf_p = '\0'; \
2286 yyleng = yyless_macro_arg; \
2290 /* Accessor methods (get/set functions) to struct members. */
2292 /** Get the user-defined data for this scanner.
2293 * @param yyscanner The scanner object.
2295 YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
2297 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2301 /** Get the current line number.
2302 * @param yyscanner The scanner object.
2304 int yyget_lineno (yyscan_t yyscanner)
2306 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2308 if (! YY_CURRENT_BUFFER)
2314 /** Get the current column number.
2315 * @param yyscanner The scanner object.
2317 int yyget_column (yyscan_t yyscanner)
2319 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2321 if (! YY_CURRENT_BUFFER)
2327 /** Get the input stream.
2328 * @param yyscanner The scanner object.
2330 FILE *yyget_in (yyscan_t yyscanner)
2332 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2336 /** Get the output stream.
2337 * @param yyscanner The scanner object.
2339 FILE *yyget_out (yyscan_t yyscanner)
2341 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2345 /** Get the length of the current token.
2346 * @param yyscanner The scanner object.
2348 int yyget_leng (yyscan_t yyscanner)
2350 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2354 /** Get the current token.
2355 * @param yyscanner The scanner object.
2358 char *yyget_text (yyscan_t yyscanner)
2360 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2364 /** Set the user-defined data. This data is never touched by the scanner.
2365 * @param user_defined The data to be associated with this scanner.
2366 * @param yyscanner The scanner object.
2368 void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2370 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2371 yyextra = user_defined ;
2374 /** Set the current line number.
2375 * @param _line_number line number
2376 * @param yyscanner The scanner object.
2378 void yyset_lineno (int _line_number , yyscan_t yyscanner)
2380 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2382 /* lineno is only valid if an input buffer exists. */
2383 if (! YY_CURRENT_BUFFER )
2384 YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
2386 yylineno = _line_number;
2389 /** Set the current column.
2390 * @param _column_no column number
2391 * @param yyscanner The scanner object.
2393 void yyset_column (int _column_no , yyscan_t yyscanner)
2395 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2397 /* column is only valid if an input buffer exists. */
2398 if (! YY_CURRENT_BUFFER )
2399 YY_FATAL_ERROR( "yyset_column called with no buffer" );
2401 yycolumn = _column_no;
2404 /** Set the input stream. This does not discard the current
2406 * @param _in_str A readable stream.
2407 * @param yyscanner The scanner object.
2408 * @see yy_switch_to_buffer
2410 void yyset_in (FILE * _in_str , yyscan_t yyscanner)
2412 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2416 void yyset_out (FILE * _out_str , yyscan_t yyscanner)
2418 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2422 int yyget_debug (yyscan_t yyscanner)
2424 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2425 return yy_flex_debug;
2428 void yyset_debug (int _bdebug , yyscan_t yyscanner)
2430 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2431 yy_flex_debug = _bdebug ;
2434 /* Accessor methods for yylval and yylloc */
2436 /* User-visible API */
2438 /* yylex_init is special because it creates the scanner itself, so it is
2439 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2440 * That's why we explicitly handle the declaration, instead of using our macros.
2442 int yylex_init(yyscan_t* ptr_yy_globals)
2444 if (ptr_yy_globals == NULL){
2449 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2451 if (*ptr_yy_globals == NULL){
2456 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2457 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2459 return yy_init_globals ( *ptr_yy_globals );
2462 /* yylex_init_extra has the same functionality as yylex_init, but follows the
2463 * convention of taking the scanner as the last argument. Note however, that
2464 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2465 * is the reason, too, why this function also must handle its own declaration).
2466 * The user defined value in the first argument will be available to yyalloc in
2467 * the yyextra field.
2469 int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
2471 struct yyguts_t dummy_yyguts;
2473 yyset_extra (yy_user_defined, &dummy_yyguts);
2475 if (ptr_yy_globals == NULL){
2480 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2482 if (*ptr_yy_globals == NULL){
2487 /* By setting to 0xAA, we expose bugs in
2488 yy_init_globals. Leave at 0x00 for releases. */
2489 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2491 yyset_extra (yy_user_defined, *ptr_yy_globals);
2493 return yy_init_globals ( *ptr_yy_globals );
2496 static int yy_init_globals (yyscan_t yyscanner)
2498 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2499 /* Initialization is the same as for the non-reentrant scanner.
2500 * This function is called from yylex_destroy(), so don't allocate here.
2503 yyg->yy_buffer_stack = NULL;
2504 yyg->yy_buffer_stack_top = 0;
2505 yyg->yy_buffer_stack_max = 0;
2506 yyg->yy_c_buf_p = NULL;
2510 yyg->yy_start_stack_ptr = 0;
2511 yyg->yy_start_stack_depth = 0;
2512 yyg->yy_start_stack = NULL;
2514 /* Defined in main.c */
2523 /* For future reference: Set errno on error, since we are called by
2529 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2530 int yylex_destroy (yyscan_t yyscanner)
2532 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2534 /* Pop the buffer stack, destroying each element. */
2535 while(YY_CURRENT_BUFFER){
2536 yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
2537 YY_CURRENT_BUFFER_LVALUE = NULL;
2538 yypop_buffer_state(yyscanner);
2541 /* Destroy the stack itself. */
2542 yyfree(yyg->yy_buffer_stack , yyscanner);
2543 yyg->yy_buffer_stack = NULL;
2545 /* Destroy the start condition stack. */
2546 yyfree( yyg->yy_start_stack , yyscanner );
2547 yyg->yy_start_stack = NULL;
2549 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2550 * yylex() is called, initialization will occur. */
2551 yy_init_globals( yyscanner);
2553 /* Destroy the main struct (reentrant only). */
2554 yyfree ( yyscanner , yyscanner );
2560 * Internal utility routines.
2564 static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
2566 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2570 for ( i = 0; i < n; ++i )
2575 #ifdef YY_NEED_STRLEN
2576 static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
2579 for ( n = 0; s[n]; ++n )
2586 void *yyalloc (yy_size_t size , yyscan_t yyscanner)
2588 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2590 return malloc(size);
2593 void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2595 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2598 /* The cast to (char *) in the following accommodates both
2599 * implementations that use char* generic pointers, and those
2600 * that use void* generic pointers. It works with the latter
2601 * because both ANSI C and C++ allow castless assignment from
2602 * any pointer type to void*, and deal with argument conversions
2603 * as though doing an assignment.
2605 return realloc(ptr, size);
2608 void yyfree (void * ptr , yyscan_t yyscanner)
2610 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2612 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2615 #define YYTABLES_NAME "yytables"
2617 /*--------------------------------------------------------------------------*/
2618 YY_BUFFER_STATE cmFortranLexer_GetCurrentBuffer(yyscan_t yyscanner)
2620 /* Hack into the internal flex-generated scanner to get the buffer. */
2621 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2622 return YY_CURRENT_BUFFER;
2625 #endif /* __clang_analyzer__ */