Merge branch 'release-3.30'
[kiteware-cmake.git] / Source / LexerParser / cmFortranLexer.cxx
blobdf65472e8540a0a01fd76e16537b28c5caa8cc92
1 #include "cmStandardLexer.h"
3 #define FLEXINT_H 1
4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
8 #define FLEX_SCANNER
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
13 #define FLEX_BETA
14 #endif
16 #ifdef yy_create_buffer
17 #define cmFortran_yy_create_buffer_ALREADY_DEFINED
18 #else
19 #define yy_create_buffer cmFortran_yy_create_buffer
20 #endif
22 #ifdef yy_delete_buffer
23 #define cmFortran_yy_delete_buffer_ALREADY_DEFINED
24 #else
25 #define yy_delete_buffer cmFortran_yy_delete_buffer
26 #endif
28 #ifdef yy_scan_buffer
29 #define cmFortran_yy_scan_buffer_ALREADY_DEFINED
30 #else
31 #define yy_scan_buffer cmFortran_yy_scan_buffer
32 #endif
34 #ifdef yy_scan_string
35 #define cmFortran_yy_scan_string_ALREADY_DEFINED
36 #else
37 #define yy_scan_string cmFortran_yy_scan_string
38 #endif
40 #ifdef yy_scan_bytes
41 #define cmFortran_yy_scan_bytes_ALREADY_DEFINED
42 #else
43 #define yy_scan_bytes cmFortran_yy_scan_bytes
44 #endif
46 #ifdef yy_init_buffer
47 #define cmFortran_yy_init_buffer_ALREADY_DEFINED
48 #else
49 #define yy_init_buffer cmFortran_yy_init_buffer
50 #endif
52 #ifdef yy_flush_buffer
53 #define cmFortran_yy_flush_buffer_ALREADY_DEFINED
54 #else
55 #define yy_flush_buffer cmFortran_yy_flush_buffer
56 #endif
58 #ifdef yy_load_buffer_state
59 #define cmFortran_yy_load_buffer_state_ALREADY_DEFINED
60 #else
61 #define yy_load_buffer_state cmFortran_yy_load_buffer_state
62 #endif
64 #ifdef yy_switch_to_buffer
65 #define cmFortran_yy_switch_to_buffer_ALREADY_DEFINED
66 #else
67 #define yy_switch_to_buffer cmFortran_yy_switch_to_buffer
68 #endif
70 #ifdef yypush_buffer_state
71 #define cmFortran_yypush_buffer_state_ALREADY_DEFINED
72 #else
73 #define yypush_buffer_state cmFortran_yypush_buffer_state
74 #endif
76 #ifdef yypop_buffer_state
77 #define cmFortran_yypop_buffer_state_ALREADY_DEFINED
78 #else
79 #define yypop_buffer_state cmFortran_yypop_buffer_state
80 #endif
82 #ifdef yyensure_buffer_stack
83 #define cmFortran_yyensure_buffer_stack_ALREADY_DEFINED
84 #else
85 #define yyensure_buffer_stack cmFortran_yyensure_buffer_stack
86 #endif
88 #ifdef yylex
89 #define cmFortran_yylex_ALREADY_DEFINED
90 #else
91 #define yylex cmFortran_yylex
92 #endif
94 #ifdef yyrestart
95 #define cmFortran_yyrestart_ALREADY_DEFINED
96 #else
97 #define yyrestart cmFortran_yyrestart
98 #endif
100 #ifdef yylex_init
101 #define cmFortran_yylex_init_ALREADY_DEFINED
102 #else
103 #define yylex_init cmFortran_yylex_init
104 #endif
106 #ifdef yylex_init_extra
107 #define cmFortran_yylex_init_extra_ALREADY_DEFINED
108 #else
109 #define yylex_init_extra cmFortran_yylex_init_extra
110 #endif
112 #ifdef yylex_destroy
113 #define cmFortran_yylex_destroy_ALREADY_DEFINED
114 #else
115 #define yylex_destroy cmFortran_yylex_destroy
116 #endif
118 #ifdef yyget_debug
119 #define cmFortran_yyget_debug_ALREADY_DEFINED
120 #else
121 #define yyget_debug cmFortran_yyget_debug
122 #endif
124 #ifdef yyset_debug
125 #define cmFortran_yyset_debug_ALREADY_DEFINED
126 #else
127 #define yyset_debug cmFortran_yyset_debug
128 #endif
130 #ifdef yyget_extra
131 #define cmFortran_yyget_extra_ALREADY_DEFINED
132 #else
133 #define yyget_extra cmFortran_yyget_extra
134 #endif
136 #ifdef yyset_extra
137 #define cmFortran_yyset_extra_ALREADY_DEFINED
138 #else
139 #define yyset_extra cmFortran_yyset_extra
140 #endif
142 #ifdef yyget_in
143 #define cmFortran_yyget_in_ALREADY_DEFINED
144 #else
145 #define yyget_in cmFortran_yyget_in
146 #endif
148 #ifdef yyset_in
149 #define cmFortran_yyset_in_ALREADY_DEFINED
150 #else
151 #define yyset_in cmFortran_yyset_in
152 #endif
154 #ifdef yyget_out
155 #define cmFortran_yyget_out_ALREADY_DEFINED
156 #else
157 #define yyget_out cmFortran_yyget_out
158 #endif
160 #ifdef yyset_out
161 #define cmFortran_yyset_out_ALREADY_DEFINED
162 #else
163 #define yyset_out cmFortran_yyset_out
164 #endif
166 #ifdef yyget_leng
167 #define cmFortran_yyget_leng_ALREADY_DEFINED
168 #else
169 #define yyget_leng cmFortran_yyget_leng
170 #endif
172 #ifdef yyget_text
173 #define cmFortran_yyget_text_ALREADY_DEFINED
174 #else
175 #define yyget_text cmFortran_yyget_text
176 #endif
178 #ifdef yyget_lineno
179 #define cmFortran_yyget_lineno_ALREADY_DEFINED
180 #else
181 #define yyget_lineno cmFortran_yyget_lineno
182 #endif
184 #ifdef yyset_lineno
185 #define cmFortran_yyset_lineno_ALREADY_DEFINED
186 #else
187 #define yyset_lineno cmFortran_yyset_lineno
188 #endif
190 #ifdef yyget_column
191 #define cmFortran_yyget_column_ALREADY_DEFINED
192 #else
193 #define yyget_column cmFortran_yyget_column
194 #endif
196 #ifdef yyset_column
197 #define cmFortran_yyset_column_ALREADY_DEFINED
198 #else
199 #define yyset_column cmFortran_yyset_column
200 #endif
202 #ifdef yywrap
203 #define cmFortran_yywrap_ALREADY_DEFINED
204 #else
205 #define yywrap cmFortran_yywrap
206 #endif
208 #ifdef yyalloc
209 #define cmFortran_yyalloc_ALREADY_DEFINED
210 #else
211 #define yyalloc cmFortran_yyalloc
212 #endif
214 #ifdef yyrealloc
215 #define cmFortran_yyrealloc_ALREADY_DEFINED
216 #else
217 #define yyrealloc cmFortran_yyrealloc
218 #endif
220 #ifdef yyfree
221 #define cmFortran_yyfree_ALREADY_DEFINED
222 #else
223 #define yyfree cmFortran_yyfree
224 #endif
226 /* First, we deal with platform-specific or compiler-specific issues. */
228 /* begin standard C headers. */
229 #include <stdio.h>
230 #include <string.h>
231 #include <errno.h>
232 #include <stdlib.h>
234 /* end standard C headers. */
236 /* flex integer type definitions */
238 #ifndef FLEXINT_H
239 #define FLEXINT_H
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
250 #endif
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;
259 #else
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. */
268 #ifndef INT8_MIN
269 #define INT8_MIN (-128)
270 #endif
271 #ifndef INT16_MIN
272 #define INT16_MIN (-32767-1)
273 #endif
274 #ifndef INT32_MIN
275 #define INT32_MIN (-2147483647-1)
276 #endif
277 #ifndef INT8_MAX
278 #define INT8_MAX (127)
279 #endif
280 #ifndef INT16_MAX
281 #define INT16_MAX (32767)
282 #endif
283 #ifndef INT32_MAX
284 #define INT32_MAX (2147483647)
285 #endif
286 #ifndef UINT8_MAX
287 #define UINT8_MAX (255U)
288 #endif
289 #ifndef UINT16_MAX
290 #define UINT16_MAX (65535U)
291 #endif
292 #ifndef UINT32_MAX
293 #define UINT32_MAX (4294967295U)
294 #endif
296 #ifndef SIZE_MAX
297 #define SIZE_MAX (~(size_t)0)
298 #endif
300 #endif /* ! C99 */
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__))
311 #else
312 #define yynoreturn
313 #endif
315 /* Returned upon end-of-file. */
316 #define YY_NULL 0
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;
327 #endif
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
347 * compatibility.
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. */
358 #ifndef YY_BUF_SIZE
359 #ifdef __ia64__
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
365 #else
366 #define YY_BUF_SIZE 16384
367 #endif /* __ia64__ */
368 #endif
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;
377 #endif
379 #ifndef YY_TYPEDEF_YY_SIZE_T
380 #define YY_TYPEDEF_YY_SIZE_T
381 typedef size_t yy_size_t;
382 #endif
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. */
392 #define yyless(n) \
393 do \
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 */ \
403 while ( 0 )
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
410 FILE *yy_input_file;
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
416 * characters.
418 int yy_buf_size;
420 /* Number of characters read into yy_ch_buf, not including EOB
421 * characters.
423 int yy_n_chars;
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
427 * delete it.
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
434 * each newline.
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
440 * not.
442 int yy_at_bol;
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
448 * end of it.
450 int yy_fill_buffer;
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
473 * "scanner state".
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] \
479 : NULL)
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; \
549 *yy_cp = '\0'; \
550 yyg->yy_c_buf_p = yy_cp;
551 #define YY_NUM_RULES 55
552 #define YY_END_OF_BUFFER 56
553 /* This struct is not used in this scanner,
554 but its presence is necessary. */
555 struct yy_trans_info
557 flex_int32_t yy_verify;
558 flex_int32_t yy_nxt;
560 static const flex_int16_t yy_accept[216] =
561 { 0,
562 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
563 56, 50, 52, 51, 54, 1, 50, 34, 2, 48,
564 49, 36, 38, 51, 40, 50, 47, 47, 47, 47,
565 47, 47, 50, 47, 52, 50, 51, 52, 50, 47,
566 9, 8, 9, 9, 4, 3, 50, 0, 10, 0,
567 0, 0, 0, 0, 34, 34, 35, 37, 40, 50,
568 47, 47, 47, 47, 47, 47, 0, 53, 0, 47,
569 0, 0, 0, 12, 0, 0, 0, 0, 0, 0,
570 0, 50, 0, 11, 47, 0, 0, 0, 5, 0,
571 0, 0, 0, 0, 30, 0, 34, 34, 34, 34,
573 0, 0, 41, 47, 47, 47, 47, 46, 12, 12,
574 0, 0, 0, 24, 0, 0, 0, 0, 0, 0,
575 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
576 47, 47, 47, 47, 0, 0, 0, 0, 0, 0,
577 0, 0, 0, 0, 0, 0, 0, 31, 32, 0,
578 0, 0, 0, 0, 47, 47, 47, 47, 0, 25,
579 26, 0, 0, 0, 0, 13, 0, 0, 0, 0,
580 21, 33, 28, 0, 0, 0, 47, 47, 44, 47,
581 0, 27, 22, 0, 0, 13, 20, 0, 0, 19,
582 29, 0, 0, 42, 47, 47, 18, 23, 0, 7,
584 39, 7, 16, 0, 47, 47, 15, 17, 43, 45,
585 0, 0, 0, 14, 0
588 static const YY_CHAR yy_ec[256] =
589 { 0,
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,
617 1, 1, 1, 1, 1
620 static const YY_CHAR yy_meta[50] =
621 { 0,
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] =
630 { 0,
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,
655 426, 433, 440, 447
658 static const flex_int16_t yy_def[225] =
659 { 0,
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,
684 215, 215, 215, 215
687 static const flex_int16_t yy_nxt[542] =
688 { 0,
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] =
752 { 0,
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 */
852 #undef YY_NO_UNPUT
854 #define cmFortranLexer_cxx
855 #include "cmFortranParser.h" /* Interface to parser object. */
857 /* Replace the lexer input function. */
858 #undef YY_INPUT
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 /*--------------------------------------------------------------------------*/
867 #define INITIAL 0
868 #define free_fmt 1
869 #define fixed_fmt 2
870 #define str_sq 3
871 #define str_dq 4
873 #ifndef YY_EXTRA_TYPE
874 #define YY_EXTRA_TYPE void *
875 #endif
877 /* Holds the entire state of the reentrant scanner. */
878 struct yyguts_t
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. */
889 char yy_hold_char;
890 int yy_n_chars;
891 int yyleng_r;
892 char *yy_c_buf_p;
893 int yy_init;
894 int yy_start;
895 int yy_did_buffer_switch_on_eof;
896 int yy_start_stack_ptr;
897 int yy_start_stack_depth;
898 int *yy_start_stack;
899 yy_state_type yy_last_accepting_state;
900 char* yy_last_accepting_cpos;
902 int yylineno_r;
903 int yy_flex_debug_r;
905 char *yytext_r;
906 int yy_more_flag;
907 int yy_more_len;
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
951 * section 1.
954 #ifndef YY_SKIP_YYWRAP
955 #ifdef __cplusplus
956 extern "C" int yywrap ( yyscan_t yyscanner );
957 #else
958 extern int yywrap ( yyscan_t yyscanner );
959 #endif
960 #endif
962 #ifndef YY_NO_UNPUT
964 static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
966 #endif
968 #ifndef yytext_ptr
969 static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
970 #endif
972 #ifdef YY_NEED_STRLEN
973 static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
974 #endif
976 #ifndef YY_NO_INPUT
977 #ifdef __cplusplus
978 static int yyinput ( yyscan_t yyscanner );
979 #else
980 static int input ( yyscan_t yyscanner );
981 #endif
983 #endif
985 /* Amount of stuff to slurp up with each read. */
986 #ifndef YY_READ_BUF_SIZE
987 #ifdef __ia64__
988 /* On IA-64, the buffer size is 16k, not 8k */
989 #define YY_READ_BUF_SIZE 16384
990 #else
991 #define YY_READ_BUF_SIZE 8192
992 #endif /* __ia64__ */
993 #endif
995 /* Copy whatever the last rule matched to the standard output. */
996 #ifndef ECHO
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)
1001 #endif
1003 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1004 * is returned in "result".
1006 #ifndef YY_INPUT
1007 #define YY_INPUT(buf,result,max_size) \
1008 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1010 int c = '*'; \
1011 int n; \
1012 for ( n = 0; n < max_size && \
1013 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1014 buf[n] = (char) c; \
1015 if ( c == '\n' ) \
1016 buf[n++] = (char) c; \
1017 if ( c == EOF && ferror( yyin ) ) \
1018 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1019 result = n; \
1021 else \
1023 errno=0; \
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" ); \
1029 break; \
1031 errno=0; \
1032 clearerr(yyin); \
1037 #endif
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.
1043 #ifndef yyterminate
1044 #define yyterminate() return YY_NULL
1045 #endif
1047 /* Number of entries by which start-condition stack grows. */
1048 #ifndef YY_START_STACK_INCR
1049 #define YY_START_STACK_INCR 25
1050 #endif
1052 /* Report a fatal error. */
1053 #ifndef YY_FATAL_ERROR
1054 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1055 #endif
1057 /* end tables serialization structures and prototypes */
1059 /* Default declaration of generated scanner - a define so the user can
1060 * easily add parameters.
1062 #ifndef YY_DECL
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
1071 * have been set up.
1073 #ifndef YY_USER_ACTION
1074 #define YY_USER_ACTION
1075 #endif
1077 /* Code executed at the end of each rule. */
1078 #ifndef YY_BREAK
1079 #define YY_BREAK /*LINTED*/break;
1080 #endif
1082 #define YY_RULE_SETUP \
1083 if ( yyleng > 0 ) \
1084 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1085 (yytext[yyleng - 1] == '\n'); \
1086 YY_USER_ACTION
1088 /** The main scanner function which does all the work.
1090 YY_DECL
1092 yy_state_type yy_current_state;
1093 char *yy_cp, *yy_bp;
1094 int yy_act;
1095 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1097 if ( !yyg->yy_init )
1099 yyg->yy_init = 1;
1101 #ifdef YY_USER_INIT
1102 YY_USER_INIT;
1103 #endif
1105 if ( ! yyg->yy_start )
1106 yyg->yy_start = 1; /* first start state */
1108 if ( ! yyin )
1109 yyin = stdin;
1111 if ( ! yyout )
1112 yyout = stdout;
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
1133 * the current run.
1135 yy_bp = yy_cp;
1137 yy_current_state = yyg->yy_start;
1138 yy_current_state += YY_AT_BOL();
1139 yy_match:
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];
1155 ++yy_cp;
1157 while ( yy_base[yy_current_state] != 492 );
1159 yy_find_action:
1160 yy_act = yy_accept[yy_current_state];
1161 if ( yy_act == 0 )
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. */
1172 switch ( yy_act )
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;
1181 case 1:
1182 YY_RULE_SETUP
1184 cmFortranParser_StringStart(yyextra);
1185 cmFortranParser_SetOldStartcond(yyextra, YY_START);
1186 BEGIN(str_dq);
1188 YY_BREAK
1189 case 2:
1190 YY_RULE_SETUP
1192 cmFortranParser_StringStart(yyextra);
1193 cmFortranParser_SetOldStartcond(yyextra, YY_START);
1194 BEGIN(str_sq);
1196 YY_BREAK
1197 case 3:
1198 case 4:
1199 YY_RULE_SETUP
1201 BEGIN(cmFortranParser_GetOldStartcond(yyextra) );
1202 yylvalp->string = strdup(cmFortranParser_StringEnd(yyextra));
1203 return STRING;
1205 YY_BREAK
1206 case 5:
1207 /* rule 5 can match eol */
1208 case 6:
1209 /* rule 6 can match eol */
1210 YY_RULE_SETUP
1211 /* Ignore (continued strings, free fmt) */
1212 YY_BREAK
1213 case 7:
1214 /* rule 7 can match eol */
1215 YY_RULE_SETUP
1217 if (cmFortranParser_GetOldStartcond(yyextra) == fixed_fmt)
1218 ; /* Ignore (cont. strings, fixed fmt) */
1219 else
1221 unput(yytext[strlen(yytext)-1]);
1224 YY_BREAK
1225 case 8:
1226 /* rule 8 can match eol */
1227 YY_RULE_SETUP
1229 unput ('\n');
1230 BEGIN(INITIAL);
1231 return UNTERMINATED_STRING;
1233 YY_BREAK
1234 case 9:
1235 YY_RULE_SETUP
1237 cmFortranParser_StringAppend(yyextra, yytext[0]);
1239 YY_BREAK
1240 case 10:
1241 /* rule 10 can match eol */
1242 YY_RULE_SETUP
1243 { return EOSTMT; } /* Treat comments like */
1244 YY_BREAK
1245 case 11:
1246 /* rule 11 can match eol */
1247 YY_RULE_SETUP
1248 { return EOSTMT; } /* empty lines */
1249 YY_BREAK
1250 case 12:
1251 YY_RULE_SETUP
1252 { return CPP_LINE_DIRECTIVE; }
1253 YY_BREAK
1254 case 13:
1255 YY_RULE_SETUP
1256 { return CPP_LINE_DIRECTIVE; }
1257 YY_BREAK
1258 case 14:
1259 /* rule 14 can match eol */
1260 YY_RULE_SETUP
1262 yytext[yyleng-1] = 0;
1263 yylvalp->string = strdup(strchr(yytext, '<')+1);
1264 return CPP_INCLUDE_ANGLE;
1266 YY_BREAK
1267 case 15:
1268 YY_RULE_SETUP
1269 { return CPP_INCLUDE; }
1270 YY_BREAK
1271 case 16:
1272 YY_RULE_SETUP
1273 { return F90PPR_INCLUDE; }
1274 YY_BREAK
1275 case 17:
1276 YY_RULE_SETUP
1277 { return COCO_INCLUDE; }
1278 YY_BREAK
1279 case 18:
1280 YY_RULE_SETUP
1281 { return CPP_DEFINE; }
1282 YY_BREAK
1283 case 19:
1284 YY_RULE_SETUP
1285 { return F90PPR_DEFINE; }
1286 YY_BREAK
1287 case 20:
1288 YY_RULE_SETUP
1289 { return CPP_UNDEF; }
1290 YY_BREAK
1291 case 21:
1292 YY_RULE_SETUP
1293 { return F90PPR_UNDEF; }
1294 YY_BREAK
1295 case 22:
1296 YY_RULE_SETUP
1297 { return CPP_IFDEF; }
1298 YY_BREAK
1299 case 23:
1300 YY_RULE_SETUP
1301 { return CPP_IFNDEF; }
1302 YY_BREAK
1303 case 24:
1304 YY_RULE_SETUP
1305 { return CPP_IF; }
1306 YY_BREAK
1307 case 25:
1308 YY_RULE_SETUP
1309 { return CPP_ELIF; }
1310 YY_BREAK
1311 case 26:
1312 YY_RULE_SETUP
1313 { return CPP_ELSE; }
1314 YY_BREAK
1315 case 27:
1316 YY_RULE_SETUP
1317 { return CPP_ENDIF; }
1318 YY_BREAK
1319 case 28:
1320 YY_RULE_SETUP
1321 { return F90PPR_IFDEF; }
1322 YY_BREAK
1323 case 29:
1324 YY_RULE_SETUP
1325 { return F90PPR_IFNDEF; }
1326 YY_BREAK
1327 case 30:
1328 YY_RULE_SETUP
1329 { return F90PPR_IF; }
1330 YY_BREAK
1331 case 31:
1332 YY_RULE_SETUP
1333 { return F90PPR_ELIF; }
1334 YY_BREAK
1335 case 32:
1336 YY_RULE_SETUP
1337 { return F90PPR_ELSE; }
1338 YY_BREAK
1339 case 33:
1340 YY_RULE_SETUP
1341 { return F90PPR_ENDIF; }
1342 YY_BREAK
1343 /* Line continuations, possible involving comments. */
1344 case 34:
1345 /* rule 34 can match eol */
1346 YY_RULE_SETUP
1348 YY_BREAK
1349 case 35:
1350 /* rule 35 can match eol */
1351 YY_RULE_SETUP
1353 YY_BREAK
1354 case 36:
1355 YY_RULE_SETUP
1356 { return COMMA; }
1357 YY_BREAK
1358 case 37:
1359 YY_RULE_SETUP
1360 { return DCOLON; }
1361 YY_BREAK
1362 case 38:
1363 YY_RULE_SETUP
1364 { return COLON; }
1365 YY_BREAK
1366 case 39:
1367 /* rule 39 can match eol */
1368 YY_RULE_SETUP
1369 { return GARBAGE; }
1370 YY_BREAK
1371 case 40:
1372 YY_RULE_SETUP
1373 { return ASSIGNMENT_OP; }
1374 YY_BREAK
1375 case 41:
1376 YY_RULE_SETUP
1377 { return END; }
1378 YY_BREAK
1379 case 42:
1380 YY_RULE_SETUP
1381 { return INCLUDE; }
1382 YY_BREAK
1383 case 43:
1384 YY_RULE_SETUP
1385 { return INTERFACE; }
1386 YY_BREAK
1387 case 44:
1388 YY_RULE_SETUP
1389 { return MODULE; }
1390 YY_BREAK
1391 case 45:
1392 YY_RULE_SETUP
1393 { return SUBMODULE; }
1394 YY_BREAK
1395 case 46:
1396 YY_RULE_SETUP
1397 { return USE; }
1398 YY_BREAK
1399 case 47:
1400 YY_RULE_SETUP
1402 yylvalp->string = strdup(yytext);
1403 return WORD;
1405 YY_BREAK
1406 case 48:
1407 YY_RULE_SETUP
1408 { return LPAREN; }
1409 YY_BREAK
1410 case 49:
1411 YY_RULE_SETUP
1412 { return RPAREN; }
1413 YY_BREAK
1414 case 50:
1415 YY_RULE_SETUP
1416 { return GARBAGE; }
1417 YY_BREAK
1418 case 51:
1419 /* rule 51 can match eol */
1420 YY_RULE_SETUP
1421 { return EOSTMT; }
1422 YY_BREAK
1423 case 52:
1424 YY_RULE_SETUP
1425 /* Ignore */
1426 YY_BREAK
1427 case 53:
1428 /* rule 53 can match eol */
1429 YY_RULE_SETUP
1430 /* Ignore line-endings preceded by \ */
1431 YY_BREAK
1432 case 54:
1433 YY_RULE_SETUP
1434 { return *yytext; }
1435 YY_BREAK
1436 case YY_STATE_EOF(INITIAL):
1437 case YY_STATE_EOF(free_fmt):
1438 case YY_STATE_EOF(fixed_fmt):
1439 case YY_STATE_EOF(str_sq):
1440 case YY_STATE_EOF(str_dq):
1442 if(!cmFortranParser_FilePop(yyextra) )
1444 return YY_NULL;
1447 YY_BREAK
1448 case 55:
1449 YY_RULE_SETUP
1450 ECHO;
1451 YY_BREAK
1453 case YY_END_OF_BUFFER:
1455 /* Amount of text matched not including the EOB char. */
1456 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1458 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1459 *yy_cp = yyg->yy_hold_char;
1460 YY_RESTORE_YY_MORE_OFFSET
1462 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1464 /* We're scanning a new file or input source. It's
1465 * possible that this happened because the user
1466 * just pointed yyin at a new source and called
1467 * yylex(). If so, then we have to assure
1468 * consistency between YY_CURRENT_BUFFER and our
1469 * globals. Here is the right place to do so, because
1470 * this is the first action (other than possibly a
1471 * back-up) that will match for the new input source.
1473 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1474 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1475 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1478 /* Note that here we test for yy_c_buf_p "<=" to the position
1479 * of the first EOB in the buffer, since yy_c_buf_p will
1480 * already have been incremented past the NUL character
1481 * (since all states make transitions on EOB to the
1482 * end-of-buffer state). Contrast this with the test
1483 * in input().
1485 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1486 { /* This was really a NUL. */
1487 yy_state_type yy_next_state;
1489 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1491 yy_current_state = yy_get_previous_state( yyscanner );
1493 /* Okay, we're now positioned to make the NUL
1494 * transition. We couldn't have
1495 * yy_get_previous_state() go ahead and do it
1496 * for us because it doesn't know how to deal
1497 * with the possibility of jamming (and we don't
1498 * want to build jamming into it because then it
1499 * will run more slowly).
1502 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1504 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1506 if ( yy_next_state )
1508 /* Consume the NUL. */
1509 yy_cp = ++yyg->yy_c_buf_p;
1510 yy_current_state = yy_next_state;
1511 goto yy_match;
1514 else
1516 yy_cp = yyg->yy_c_buf_p;
1517 goto yy_find_action;
1521 else switch ( yy_get_next_buffer( yyscanner ) )
1523 case EOB_ACT_END_OF_FILE:
1525 yyg->yy_did_buffer_switch_on_eof = 0;
1527 if ( yywrap( yyscanner ) )
1529 /* Note: because we've taken care in
1530 * yy_get_next_buffer() to have set up
1531 * yytext, we can now set up
1532 * yy_c_buf_p so that if some total
1533 * hoser (like flex itself) wants to
1534 * call the scanner after we return the
1535 * YY_NULL, it'll still work - another
1536 * YY_NULL will get returned.
1538 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1540 yy_act = YY_STATE_EOF(YY_START);
1541 goto do_action;
1544 else
1546 if ( ! yyg->yy_did_buffer_switch_on_eof )
1547 YY_NEW_FILE;
1549 break;
1552 case EOB_ACT_CONTINUE_SCAN:
1553 yyg->yy_c_buf_p =
1554 yyg->yytext_ptr + yy_amount_of_matched_text;
1556 yy_current_state = yy_get_previous_state( yyscanner );
1558 yy_cp = yyg->yy_c_buf_p;
1559 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1560 goto yy_match;
1562 case EOB_ACT_LAST_MATCH:
1563 yyg->yy_c_buf_p =
1564 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1566 yy_current_state = yy_get_previous_state( yyscanner );
1568 yy_cp = yyg->yy_c_buf_p;
1569 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1570 goto yy_find_action;
1572 break;
1575 default:
1576 YY_FATAL_ERROR(
1577 "fatal flex scanner internal error--no action found" );
1578 } /* end of action switch */
1579 } /* end of scanning one token */
1580 } /* end of user's declarations */
1581 } /* end of yylex */
1583 /* yy_get_next_buffer - try to read in a new buffer
1585 * Returns a code representing an action:
1586 * EOB_ACT_LAST_MATCH -
1587 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1588 * EOB_ACT_END_OF_FILE - end of file
1590 static int yy_get_next_buffer (yyscan_t yyscanner)
1592 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1593 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1594 char *source = yyg->yytext_ptr;
1595 int number_to_move, i;
1596 int ret_val;
1598 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1599 YY_FATAL_ERROR(
1600 "fatal flex scanner internal error--end of buffer missed" );
1602 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1603 { /* Don't try to fill the buffer, so this is an EOF. */
1604 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1606 /* We matched a single character, the EOB, so
1607 * treat this as a final EOF.
1609 return EOB_ACT_END_OF_FILE;
1612 else
1614 /* We matched some text prior to the EOB, first
1615 * process it.
1617 return EOB_ACT_LAST_MATCH;
1621 /* Try to read more data. */
1623 /* First move last chars to start of buffer. */
1624 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
1626 for ( i = 0; i < number_to_move; ++i )
1627 *(dest++) = *(source++);
1629 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1630 /* don't do the read, it's not guaranteed to return an EOF,
1631 * just force an EOF
1633 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1635 else
1637 int num_to_read =
1638 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1640 while ( num_to_read <= 0 )
1641 { /* Not enough room in the buffer - grow it. */
1643 /* just a shorter name for the current buffer */
1644 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1646 int yy_c_buf_p_offset =
1647 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1649 if ( b->yy_is_our_buffer )
1651 int new_size = b->yy_buf_size * 2;
1653 if ( new_size <= 0 )
1654 b->yy_buf_size += b->yy_buf_size / 8;
1655 else
1656 b->yy_buf_size *= 2;
1658 b->yy_ch_buf = (char *)
1659 /* Include room in for 2 EOB chars. */
1660 yyrealloc( (void *) b->yy_ch_buf,
1661 (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1663 else
1664 /* Can't grow it, we don't own it. */
1665 b->yy_ch_buf = NULL;
1667 if ( ! b->yy_ch_buf )
1668 YY_FATAL_ERROR(
1669 "fatal error - scanner input buffer overflow" );
1671 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1673 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1674 number_to_move - 1;
1678 if ( num_to_read > YY_READ_BUF_SIZE )
1679 num_to_read = YY_READ_BUF_SIZE;
1681 /* Read in more data. */
1682 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1683 yyg->yy_n_chars, num_to_read );
1685 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1688 if ( yyg->yy_n_chars == 0 )
1690 if ( number_to_move == YY_MORE_ADJ )
1692 ret_val = EOB_ACT_END_OF_FILE;
1693 yyrestart( yyin , yyscanner);
1696 else
1698 ret_val = EOB_ACT_LAST_MATCH;
1699 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1700 YY_BUFFER_EOF_PENDING;
1704 else
1705 ret_val = EOB_ACT_CONTINUE_SCAN;
1707 if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1708 /* Extend the array by 50%, plus the number we really need. */
1709 int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1710 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1711 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
1712 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1713 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1714 /* "- 2" to take care of EOB's */
1715 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1718 yyg->yy_n_chars += number_to_move;
1719 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1720 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1722 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1724 return ret_val;
1727 /* yy_get_previous_state - get the state just before the EOB char was reached */
1729 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1731 yy_state_type yy_current_state;
1732 char *yy_cp;
1733 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1735 yy_current_state = yyg->yy_start;
1736 yy_current_state += YY_AT_BOL();
1738 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1740 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1741 if ( yy_accept[yy_current_state] )
1743 yyg->yy_last_accepting_state = yy_current_state;
1744 yyg->yy_last_accepting_cpos = yy_cp;
1746 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1748 yy_current_state = (int) yy_def[yy_current_state];
1749 if ( yy_current_state >= 216 )
1750 yy_c = yy_meta[yy_c];
1752 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1755 return yy_current_state;
1758 /* yy_try_NUL_trans - try to make a transition on the NUL character
1760 * synopsis
1761 * next_state = yy_try_NUL_trans( current_state );
1763 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1765 int yy_is_jam;
1766 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1767 char *yy_cp = yyg->yy_c_buf_p;
1769 YY_CHAR yy_c = 1;
1770 if ( yy_accept[yy_current_state] )
1772 yyg->yy_last_accepting_state = yy_current_state;
1773 yyg->yy_last_accepting_cpos = yy_cp;
1775 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1777 yy_current_state = (int) yy_def[yy_current_state];
1778 if ( yy_current_state >= 216 )
1779 yy_c = yy_meta[yy_c];
1781 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1782 yy_is_jam = (yy_current_state == 215);
1784 (void)yyg;
1785 return yy_is_jam ? 0 : yy_current_state;
1788 #ifndef YY_NO_UNPUT
1790 static void yyunput (int c, char * yy_bp , yyscan_t yyscanner)
1792 char *yy_cp;
1793 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1795 yy_cp = yyg->yy_c_buf_p;
1797 /* undo effects of setting up yytext */
1798 *yy_cp = yyg->yy_hold_char;
1800 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1801 { /* need to shift things up to make room */
1802 /* +2 for EOB chars. */
1803 int number_to_move = yyg->yy_n_chars + 2;
1804 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1805 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1806 char *source =
1807 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1809 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1810 *--dest = *--source;
1812 yy_cp += (int) (dest - source);
1813 yy_bp += (int) (dest - source);
1814 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1815 yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1817 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1818 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1821 *--yy_cp = (char) c;
1823 yyg->yytext_ptr = yy_bp;
1824 yyg->yy_hold_char = *yy_cp;
1825 yyg->yy_c_buf_p = yy_cp;
1828 #endif
1830 #ifndef YY_NO_INPUT
1831 #ifdef __cplusplus
1832 static int yyinput (yyscan_t yyscanner)
1833 #else
1834 static int input (yyscan_t yyscanner)
1835 #endif
1838 int c;
1839 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1841 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1843 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1845 /* yy_c_buf_p now points to the character we want to return.
1846 * If this occurs *before* the EOB characters, then it's a
1847 * valid NUL; if not, then we've hit the end of the buffer.
1849 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1850 /* This was really a NUL. */
1851 *yyg->yy_c_buf_p = '\0';
1853 else
1854 { /* need more input */
1855 int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
1856 ++yyg->yy_c_buf_p;
1858 switch ( yy_get_next_buffer( yyscanner ) )
1860 case EOB_ACT_LAST_MATCH:
1861 /* This happens because yy_g_n_b()
1862 * sees that we've accumulated a
1863 * token and flags that we need to
1864 * try matching the token before
1865 * proceeding. But for input(),
1866 * there's no matching to consider.
1867 * So convert the EOB_ACT_LAST_MATCH
1868 * to EOB_ACT_END_OF_FILE.
1871 /* Reset buffer status. */
1872 yyrestart( yyin , yyscanner);
1874 /*FALLTHROUGH*/
1876 case EOB_ACT_END_OF_FILE:
1878 if ( yywrap( yyscanner ) )
1879 return 0;
1881 if ( ! yyg->yy_did_buffer_switch_on_eof )
1882 YY_NEW_FILE;
1883 #ifdef __cplusplus
1884 return yyinput(yyscanner);
1885 #else
1886 return input(yyscanner);
1887 #endif
1890 case EOB_ACT_CONTINUE_SCAN:
1891 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1892 break;
1897 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1898 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1899 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1901 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1903 return c;
1905 #endif /* ifndef YY_NO_INPUT */
1907 /** Immediately switch to a different input stream.
1908 * @param input_file A readable stream.
1909 * @param yyscanner The scanner object.
1910 * @note This function does not reset the start condition to @c INITIAL .
1912 void yyrestart (FILE * input_file , yyscan_t yyscanner)
1914 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1916 if ( ! YY_CURRENT_BUFFER ){
1917 yyensure_buffer_stack (yyscanner);
1918 YY_CURRENT_BUFFER_LVALUE =
1919 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1922 yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
1923 yy_load_buffer_state( yyscanner );
1926 /** Switch to a different input buffer.
1927 * @param new_buffer The new input buffer.
1928 * @param yyscanner The scanner object.
1930 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1932 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1934 /* TODO. We should be able to replace this entire function body
1935 * with
1936 * yypop_buffer_state();
1937 * yypush_buffer_state(new_buffer);
1939 yyensure_buffer_stack (yyscanner);
1940 if ( YY_CURRENT_BUFFER == new_buffer )
1941 return;
1943 if ( YY_CURRENT_BUFFER )
1945 /* Flush out information for old buffer. */
1946 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1947 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1948 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1951 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1952 yy_load_buffer_state( yyscanner );
1954 /* We don't actually know whether we did this switch during
1955 * EOF (yywrap()) processing, but the only time this flag
1956 * is looked at is after yywrap() is called, so it's safe
1957 * to go ahead and always set it.
1959 yyg->yy_did_buffer_switch_on_eof = 1;
1962 static void yy_load_buffer_state (yyscan_t yyscanner)
1964 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1965 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1966 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1967 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1968 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1971 /** Allocate and initialize an input buffer state.
1972 * @param file A readable stream.
1973 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1974 * @param yyscanner The scanner object.
1975 * @return the allocated buffer state.
1977 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1979 YY_BUFFER_STATE b;
1981 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
1982 if ( ! b )
1983 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1985 b->yy_buf_size = size;
1987 /* yy_ch_buf has to be 2 characters longer than the size given because
1988 * we need to put in 2 end-of-buffer characters.
1990 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1991 if ( ! b->yy_ch_buf )
1992 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1994 b->yy_is_our_buffer = 1;
1996 yy_init_buffer( b, file , yyscanner);
1998 return b;
2001 /** Destroy the buffer.
2002 * @param b a buffer created with yy_create_buffer()
2003 * @param yyscanner The scanner object.
2005 void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2007 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2009 if ( ! b )
2010 return;
2012 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2013 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2015 if ( b->yy_is_our_buffer )
2016 yyfree( (void *) b->yy_ch_buf , yyscanner );
2018 yyfree( (void *) b , yyscanner );
2021 /* Initializes or reinitializes a buffer.
2022 * This function is sometimes called more than once on the same buffer,
2023 * such as during a yyrestart() or at EOF.
2025 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2028 int oerrno = errno;
2029 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2031 yy_flush_buffer( b , yyscanner);
2033 b->yy_input_file = file;
2034 b->yy_fill_buffer = 1;
2036 /* If b is the current buffer, then yy_init_buffer was _probably_
2037 * called from yyrestart() or through yy_get_next_buffer.
2038 * In that case, we don't want to reset the lineno or column.
2040 if (b != YY_CURRENT_BUFFER){
2041 b->yy_bs_lineno = 1;
2042 b->yy_bs_column = 0;
2045 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2047 errno = oerrno;
2050 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2051 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2052 * @param yyscanner The scanner object.
2054 void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2056 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2057 if ( ! b )
2058 return;
2060 b->yy_n_chars = 0;
2062 /* We always need two end-of-buffer characters. The first causes
2063 * a transition to the end-of-buffer state. The second causes
2064 * a jam in that state.
2066 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2067 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2069 b->yy_buf_pos = &b->yy_ch_buf[0];
2071 b->yy_at_bol = 1;
2072 b->yy_buffer_status = YY_BUFFER_NEW;
2074 if ( b == YY_CURRENT_BUFFER )
2075 yy_load_buffer_state( yyscanner );
2078 /** Pushes the new state onto the stack. The new state becomes
2079 * the current state. This function will allocate the stack
2080 * if necessary.
2081 * @param new_buffer The new state.
2082 * @param yyscanner The scanner object.
2084 void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2086 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2087 if (new_buffer == NULL)
2088 return;
2090 yyensure_buffer_stack(yyscanner);
2092 /* This block is copied from yy_switch_to_buffer. */
2093 if ( YY_CURRENT_BUFFER )
2095 /* Flush out information for old buffer. */
2096 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2097 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2098 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2101 /* Only push if top exists. Otherwise, replace top. */
2102 if (YY_CURRENT_BUFFER)
2103 yyg->yy_buffer_stack_top++;
2104 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2106 /* copied from yy_switch_to_buffer. */
2107 yy_load_buffer_state( yyscanner );
2108 yyg->yy_did_buffer_switch_on_eof = 1;
2111 /** Removes and deletes the top of the stack, if present.
2112 * The next element becomes the new top.
2113 * @param yyscanner The scanner object.
2115 void yypop_buffer_state (yyscan_t yyscanner)
2117 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2118 if (!YY_CURRENT_BUFFER)
2119 return;
2121 yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
2122 YY_CURRENT_BUFFER_LVALUE = NULL;
2123 if (yyg->yy_buffer_stack_top > 0)
2124 --yyg->yy_buffer_stack_top;
2126 if (YY_CURRENT_BUFFER) {
2127 yy_load_buffer_state( yyscanner );
2128 yyg->yy_did_buffer_switch_on_eof = 1;
2132 /* Allocates the stack if it does not exist.
2133 * Guarantees space for at least one push.
2135 static void yyensure_buffer_stack (yyscan_t yyscanner)
2137 yy_size_t num_to_alloc;
2138 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2140 if (!yyg->yy_buffer_stack) {
2142 /* First allocation is just for 2 elements, since we don't know if this
2143 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2144 * immediate realloc on the next call.
2146 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2147 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
2148 (num_to_alloc * sizeof(struct yy_buffer_state*)
2149 , yyscanner);
2150 if ( ! yyg->yy_buffer_stack )
2151 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2153 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2155 yyg->yy_buffer_stack_max = num_to_alloc;
2156 yyg->yy_buffer_stack_top = 0;
2157 return;
2160 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2162 /* Increase the buffer to prepare for a possible push. */
2163 yy_size_t grow_size = 8 /* arbitrary grow size */;
2165 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2166 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
2167 (yyg->yy_buffer_stack,
2168 num_to_alloc * sizeof(struct yy_buffer_state*)
2169 , yyscanner);
2170 if ( ! yyg->yy_buffer_stack )
2171 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2173 /* zero only the new slots.*/
2174 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2175 yyg->yy_buffer_stack_max = num_to_alloc;
2179 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2180 * @param base the character buffer
2181 * @param size the size in bytes of the character buffer
2182 * @param yyscanner The scanner object.
2183 * @return the newly allocated buffer state object.
2185 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
2187 YY_BUFFER_STATE b;
2189 if ( size < 2 ||
2190 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2191 base[size-1] != YY_END_OF_BUFFER_CHAR )
2192 /* They forgot to leave room for the EOB's. */
2193 return NULL;
2195 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2196 if ( ! b )
2197 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2199 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2200 b->yy_buf_pos = b->yy_ch_buf = base;
2201 b->yy_is_our_buffer = 0;
2202 b->yy_input_file = NULL;
2203 b->yy_n_chars = b->yy_buf_size;
2204 b->yy_is_interactive = 0;
2205 b->yy_at_bol = 1;
2206 b->yy_fill_buffer = 0;
2207 b->yy_buffer_status = YY_BUFFER_NEW;
2209 yy_switch_to_buffer( b , yyscanner );
2211 return b;
2214 /** Setup the input buffer state to scan a string. The next call to yylex() will
2215 * scan from a @e copy of @a str.
2216 * @param yystr a NUL-terminated string to scan
2217 * @param yyscanner The scanner object.
2218 * @return the newly allocated buffer state object.
2219 * @note If you want to scan bytes that may contain NUL values, then use
2220 * yy_scan_bytes() instead.
2222 YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
2225 return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
2228 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2229 * scan from a @e copy of @a bytes.
2230 * @param yybytes the byte buffer to scan
2231 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2232 * @param yyscanner The scanner object.
2233 * @return the newly allocated buffer state object.
2235 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
2237 YY_BUFFER_STATE b;
2238 char *buf;
2239 yy_size_t n;
2240 int i;
2242 /* Get memory for full buffer, including space for trailing EOB's. */
2243 n = (yy_size_t) (_yybytes_len + 2);
2244 buf = (char *) yyalloc( n , yyscanner );
2245 if ( ! buf )
2246 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2248 for ( i = 0; i < _yybytes_len; ++i )
2249 buf[i] = yybytes[i];
2251 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2253 b = yy_scan_buffer( buf, n , yyscanner);
2254 if ( ! b )
2255 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2257 /* It's okay to grow etc. this buffer, and we should throw it
2258 * away when we're done.
2260 b->yy_is_our_buffer = 1;
2262 return b;
2265 #ifndef YY_EXIT_FAILURE
2266 #define YY_EXIT_FAILURE 2
2267 #endif
2269 static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
2271 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2272 (void)yyg;
2273 fprintf( stderr, "%s\n", msg );
2274 exit( YY_EXIT_FAILURE );
2277 /* Redefine yyless() so it works in section 3 code. */
2279 #undef yyless
2280 #define yyless(n) \
2281 do \
2283 /* Undo effects of setting up yytext. */ \
2284 int yyless_macro_arg = (n); \
2285 YY_LESS_LINENO(yyless_macro_arg);\
2286 yytext[yyleng] = yyg->yy_hold_char; \
2287 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2288 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2289 *yyg->yy_c_buf_p = '\0'; \
2290 yyleng = yyless_macro_arg; \
2292 while ( 0 )
2294 /* Accessor methods (get/set functions) to struct members. */
2296 /** Get the user-defined data for this scanner.
2297 * @param yyscanner The scanner object.
2299 YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
2301 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2302 return yyextra;
2305 /** Get the current line number.
2306 * @param yyscanner The scanner object.
2308 int yyget_lineno (yyscan_t yyscanner)
2310 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2312 if (! YY_CURRENT_BUFFER)
2313 return 0;
2315 return yylineno;
2318 /** Get the current column number.
2319 * @param yyscanner The scanner object.
2321 int yyget_column (yyscan_t yyscanner)
2323 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2325 if (! YY_CURRENT_BUFFER)
2326 return 0;
2328 return yycolumn;
2331 /** Get the input stream.
2332 * @param yyscanner The scanner object.
2334 FILE *yyget_in (yyscan_t yyscanner)
2336 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2337 return yyin;
2340 /** Get the output stream.
2341 * @param yyscanner The scanner object.
2343 FILE *yyget_out (yyscan_t yyscanner)
2345 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2346 return yyout;
2349 /** Get the length of the current token.
2350 * @param yyscanner The scanner object.
2352 int yyget_leng (yyscan_t yyscanner)
2354 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2355 return yyleng;
2358 /** Get the current token.
2359 * @param yyscanner The scanner object.
2362 char *yyget_text (yyscan_t yyscanner)
2364 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2365 return yytext;
2368 /** Set the user-defined data. This data is never touched by the scanner.
2369 * @param user_defined The data to be associated with this scanner.
2370 * @param yyscanner The scanner object.
2372 void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2374 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2375 yyextra = user_defined ;
2378 /** Set the current line number.
2379 * @param _line_number line number
2380 * @param yyscanner The scanner object.
2382 void yyset_lineno (int _line_number , yyscan_t yyscanner)
2384 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2386 /* lineno is only valid if an input buffer exists. */
2387 if (! YY_CURRENT_BUFFER )
2388 YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
2390 yylineno = _line_number;
2393 /** Set the current column.
2394 * @param _column_no column number
2395 * @param yyscanner The scanner object.
2397 void yyset_column (int _column_no , yyscan_t yyscanner)
2399 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2401 /* column is only valid if an input buffer exists. */
2402 if (! YY_CURRENT_BUFFER )
2403 YY_FATAL_ERROR( "yyset_column called with no buffer" );
2405 yycolumn = _column_no;
2408 /** Set the input stream. This does not discard the current
2409 * input buffer.
2410 * @param _in_str A readable stream.
2411 * @param yyscanner The scanner object.
2412 * @see yy_switch_to_buffer
2414 void yyset_in (FILE * _in_str , yyscan_t yyscanner)
2416 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2417 yyin = _in_str ;
2420 void yyset_out (FILE * _out_str , yyscan_t yyscanner)
2422 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2423 yyout = _out_str ;
2426 int yyget_debug (yyscan_t yyscanner)
2428 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2429 return yy_flex_debug;
2432 void yyset_debug (int _bdebug , yyscan_t yyscanner)
2434 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2435 yy_flex_debug = _bdebug ;
2438 /* Accessor methods for yylval and yylloc */
2440 /* User-visible API */
2442 /* yylex_init is special because it creates the scanner itself, so it is
2443 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2444 * That's why we explicitly handle the declaration, instead of using our macros.
2446 int yylex_init(yyscan_t* ptr_yy_globals)
2448 if (ptr_yy_globals == NULL){
2449 errno = EINVAL;
2450 return 1;
2453 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2455 if (*ptr_yy_globals == NULL){
2456 errno = ENOMEM;
2457 return 1;
2460 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2461 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2463 return yy_init_globals ( *ptr_yy_globals );
2466 /* yylex_init_extra has the same functionality as yylex_init, but follows the
2467 * convention of taking the scanner as the last argument. Note however, that
2468 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2469 * is the reason, too, why this function also must handle its own declaration).
2470 * The user defined value in the first argument will be available to yyalloc in
2471 * the yyextra field.
2473 int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
2475 struct yyguts_t dummy_yyguts;
2477 yyset_extra (yy_user_defined, &dummy_yyguts);
2479 if (ptr_yy_globals == NULL){
2480 errno = EINVAL;
2481 return 1;
2484 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2486 if (*ptr_yy_globals == NULL){
2487 errno = ENOMEM;
2488 return 1;
2491 /* By setting to 0xAA, we expose bugs in
2492 yy_init_globals. Leave at 0x00 for releases. */
2493 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2495 yyset_extra (yy_user_defined, *ptr_yy_globals);
2497 return yy_init_globals ( *ptr_yy_globals );
2500 static int yy_init_globals (yyscan_t yyscanner)
2502 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2503 /* Initialization is the same as for the non-reentrant scanner.
2504 * This function is called from yylex_destroy(), so don't allocate here.
2507 yyg->yy_buffer_stack = NULL;
2508 yyg->yy_buffer_stack_top = 0;
2509 yyg->yy_buffer_stack_max = 0;
2510 yyg->yy_c_buf_p = NULL;
2511 yyg->yy_init = 0;
2512 yyg->yy_start = 0;
2514 yyg->yy_start_stack_ptr = 0;
2515 yyg->yy_start_stack_depth = 0;
2516 yyg->yy_start_stack = NULL;
2518 /* Defined in main.c */
2519 #ifdef YY_STDINIT
2520 yyin = stdin;
2521 yyout = stdout;
2522 #else
2523 yyin = NULL;
2524 yyout = NULL;
2525 #endif
2527 /* For future reference: Set errno on error, since we are called by
2528 * yylex_init()
2530 return 0;
2533 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2534 int yylex_destroy (yyscan_t yyscanner)
2536 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2538 /* Pop the buffer stack, destroying each element. */
2539 while(YY_CURRENT_BUFFER){
2540 yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
2541 YY_CURRENT_BUFFER_LVALUE = NULL;
2542 yypop_buffer_state(yyscanner);
2545 /* Destroy the stack itself. */
2546 yyfree(yyg->yy_buffer_stack , yyscanner);
2547 yyg->yy_buffer_stack = NULL;
2549 /* Destroy the start condition stack. */
2550 yyfree( yyg->yy_start_stack , yyscanner );
2551 yyg->yy_start_stack = NULL;
2553 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2554 * yylex() is called, initialization will occur. */
2555 yy_init_globals( yyscanner);
2557 /* Destroy the main struct (reentrant only). */
2558 yyfree ( yyscanner , yyscanner );
2559 yyscanner = NULL;
2560 return 0;
2564 * Internal utility routines.
2567 #ifndef yytext_ptr
2568 static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
2570 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2571 (void)yyg;
2573 int i;
2574 for ( i = 0; i < n; ++i )
2575 s1[i] = s2[i];
2577 #endif
2579 #ifdef YY_NEED_STRLEN
2580 static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
2582 int n;
2583 for ( n = 0; s[n]; ++n )
2586 return n;
2588 #endif
2590 void *yyalloc (yy_size_t size , yyscan_t yyscanner)
2592 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2593 (void)yyg;
2594 return malloc(size);
2597 void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2599 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2600 (void)yyg;
2602 /* The cast to (char *) in the following accommodates both
2603 * implementations that use char* generic pointers, and those
2604 * that use void* generic pointers. It works with the latter
2605 * because both ANSI C and C++ allow castless assignment from
2606 * any pointer type to void*, and deal with argument conversions
2607 * as though doing an assignment.
2609 return realloc(ptr, size);
2612 void yyfree (void * ptr , yyscan_t yyscanner)
2614 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2615 (void)yyg;
2616 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2619 #define YYTABLES_NAME "yytables"
2621 /*--------------------------------------------------------------------------*/
2622 YY_BUFFER_STATE cmFortranLexer_GetCurrentBuffer(yyscan_t yyscanner)
2624 /* Hack into the internal flex-generated scanner to get the buffer. */
2625 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2626 return YY_CURRENT_BUFFER;
2629 #endif /* __clang_analyzer__ */