Line data Source code
1 : #line 2 "preproc-fortran.cc"
2 :
3 : #line 4 "preproc-fortran.cc"
4 :
5 : #define YY_INT_ALIGNED short int
6 :
7 : /* A lexical scanner generated by flex */
8 :
9 : #define yy_create_buffer Rose_Fortran_free_format__create_buffer
10 : #define yy_delete_buffer Rose_Fortran_free_format__delete_buffer
11 : #define yy_scan_buffer Rose_Fortran_free_format__scan_buffer
12 : #define yy_scan_string Rose_Fortran_free_format__scan_string
13 : #define yy_scan_bytes Rose_Fortran_free_format__scan_bytes
14 : #define yy_init_buffer Rose_Fortran_free_format__init_buffer
15 : #define yy_flush_buffer Rose_Fortran_free_format__flush_buffer
16 : #define yy_load_buffer_state Rose_Fortran_free_format__load_buffer_state
17 : #define yy_switch_to_buffer Rose_Fortran_free_format__switch_to_buffer
18 : #define yypush_buffer_state Rose_Fortran_free_format_push_buffer_state
19 : #define yypop_buffer_state Rose_Fortran_free_format_pop_buffer_state
20 : #define yyensure_buffer_stack Rose_Fortran_free_format_ensure_buffer_stack
21 : #define yy_flex_debug Rose_Fortran_free_format__flex_debug
22 : #define yyin Rose_Fortran_free_format_in
23 : #define yyleng Rose_Fortran_free_format_leng
24 : #define yylex Rose_Fortran_free_format_lex
25 : #define yylineno Rose_Fortran_free_format_lineno
26 : #define yyout Rose_Fortran_free_format_out
27 : #define yyrestart Rose_Fortran_free_format_restart
28 : #define yytext Rose_Fortran_free_format_text
29 : #define yywrap Rose_Fortran_free_format_wrap
30 : #define yyalloc Rose_Fortran_free_format_alloc
31 : #define yyrealloc Rose_Fortran_free_format_realloc
32 : #define yyfree Rose_Fortran_free_format_free
33 :
34 : #define FLEX_SCANNER
35 : #define YY_FLEX_MAJOR_VERSION 2
36 : #define YY_FLEX_MINOR_VERSION 6
37 : #define YY_FLEX_SUBMINOR_VERSION 4
38 : #if YY_FLEX_SUBMINOR_VERSION > 0
39 : #define FLEX_BETA
40 : #endif
41 :
42 : #ifdef yy_create_buffer
43 : #define Rose_Fortran_free_format__create_buffer_ALREADY_DEFINED
44 : #else
45 : #define yy_create_buffer Rose_Fortran_free_format__create_buffer
46 : #endif
47 :
48 : #ifdef yy_delete_buffer
49 : #define Rose_Fortran_free_format__delete_buffer_ALREADY_DEFINED
50 : #else
51 : #define yy_delete_buffer Rose_Fortran_free_format__delete_buffer
52 : #endif
53 :
54 : #ifdef yy_scan_buffer
55 : #define Rose_Fortran_free_format__scan_buffer_ALREADY_DEFINED
56 : #else
57 : #define yy_scan_buffer Rose_Fortran_free_format__scan_buffer
58 : #endif
59 :
60 : #ifdef yy_scan_string
61 : #define Rose_Fortran_free_format__scan_string_ALREADY_DEFINED
62 : #else
63 : #define yy_scan_string Rose_Fortran_free_format__scan_string
64 : #endif
65 :
66 : #ifdef yy_scan_bytes
67 : #define Rose_Fortran_free_format__scan_bytes_ALREADY_DEFINED
68 : #else
69 : #define yy_scan_bytes Rose_Fortran_free_format__scan_bytes
70 : #endif
71 :
72 : #ifdef yy_init_buffer
73 : #define Rose_Fortran_free_format__init_buffer_ALREADY_DEFINED
74 : #else
75 : #define yy_init_buffer Rose_Fortran_free_format__init_buffer
76 : #endif
77 :
78 : #ifdef yy_flush_buffer
79 : #define Rose_Fortran_free_format__flush_buffer_ALREADY_DEFINED
80 : #else
81 : #define yy_flush_buffer Rose_Fortran_free_format__flush_buffer
82 : #endif
83 :
84 : #ifdef yy_load_buffer_state
85 : #define Rose_Fortran_free_format__load_buffer_state_ALREADY_DEFINED
86 : #else
87 : #define yy_load_buffer_state Rose_Fortran_free_format__load_buffer_state
88 : #endif
89 :
90 : #ifdef yy_switch_to_buffer
91 : #define Rose_Fortran_free_format__switch_to_buffer_ALREADY_DEFINED
92 : #else
93 : #define yy_switch_to_buffer Rose_Fortran_free_format__switch_to_buffer
94 : #endif
95 :
96 : #ifdef yypush_buffer_state
97 : #define Rose_Fortran_free_format_push_buffer_state_ALREADY_DEFINED
98 : #else
99 : #define yypush_buffer_state Rose_Fortran_free_format_push_buffer_state
100 : #endif
101 :
102 : #ifdef yypop_buffer_state
103 : #define Rose_Fortran_free_format_pop_buffer_state_ALREADY_DEFINED
104 : #else
105 : #define yypop_buffer_state Rose_Fortran_free_format_pop_buffer_state
106 : #endif
107 :
108 : #ifdef yyensure_buffer_stack
109 : #define Rose_Fortran_free_format_ensure_buffer_stack_ALREADY_DEFINED
110 : #else
111 : #define yyensure_buffer_stack Rose_Fortran_free_format_ensure_buffer_stack
112 : #endif
113 :
114 : #ifdef yylex
115 : #define Rose_Fortran_free_format_lex_ALREADY_DEFINED
116 : #else
117 : #define yylex Rose_Fortran_free_format_lex
118 : #endif
119 :
120 : #ifdef yyrestart
121 : #define Rose_Fortran_free_format_restart_ALREADY_DEFINED
122 : #else
123 : #define yyrestart Rose_Fortran_free_format_restart
124 : #endif
125 :
126 : #ifdef yylex_init
127 : #define Rose_Fortran_free_format_lex_init_ALREADY_DEFINED
128 : #else
129 : #define yylex_init Rose_Fortran_free_format_lex_init
130 : #endif
131 :
132 : #ifdef yylex_init_extra
133 : #define Rose_Fortran_free_format_lex_init_extra_ALREADY_DEFINED
134 : #else
135 : #define yylex_init_extra Rose_Fortran_free_format_lex_init_extra
136 : #endif
137 :
138 : #ifdef yylex_destroy
139 : #define Rose_Fortran_free_format_lex_destroy_ALREADY_DEFINED
140 : #else
141 : #define yylex_destroy Rose_Fortran_free_format_lex_destroy
142 : #endif
143 :
144 : #ifdef yyget_debug
145 : #define Rose_Fortran_free_format_get_debug_ALREADY_DEFINED
146 : #else
147 : #define yyget_debug Rose_Fortran_free_format_get_debug
148 : #endif
149 :
150 : #ifdef yyset_debug
151 : #define Rose_Fortran_free_format_set_debug_ALREADY_DEFINED
152 : #else
153 : #define yyset_debug Rose_Fortran_free_format_set_debug
154 : #endif
155 :
156 : #ifdef yyget_extra
157 : #define Rose_Fortran_free_format_get_extra_ALREADY_DEFINED
158 : #else
159 : #define yyget_extra Rose_Fortran_free_format_get_extra
160 : #endif
161 :
162 : #ifdef yyset_extra
163 : #define Rose_Fortran_free_format_set_extra_ALREADY_DEFINED
164 : #else
165 : #define yyset_extra Rose_Fortran_free_format_set_extra
166 : #endif
167 :
168 : #ifdef yyget_in
169 : #define Rose_Fortran_free_format_get_in_ALREADY_DEFINED
170 : #else
171 : #define yyget_in Rose_Fortran_free_format_get_in
172 : #endif
173 :
174 : #ifdef yyset_in
175 : #define Rose_Fortran_free_format_set_in_ALREADY_DEFINED
176 : #else
177 : #define yyset_in Rose_Fortran_free_format_set_in
178 : #endif
179 :
180 : #ifdef yyget_out
181 : #define Rose_Fortran_free_format_get_out_ALREADY_DEFINED
182 : #else
183 : #define yyget_out Rose_Fortran_free_format_get_out
184 : #endif
185 :
186 : #ifdef yyset_out
187 : #define Rose_Fortran_free_format_set_out_ALREADY_DEFINED
188 : #else
189 : #define yyset_out Rose_Fortran_free_format_set_out
190 : #endif
191 :
192 : #ifdef yyget_leng
193 : #define Rose_Fortran_free_format_get_leng_ALREADY_DEFINED
194 : #else
195 : #define yyget_leng Rose_Fortran_free_format_get_leng
196 : #endif
197 :
198 : #ifdef yyget_text
199 : #define Rose_Fortran_free_format_get_text_ALREADY_DEFINED
200 : #else
201 : #define yyget_text Rose_Fortran_free_format_get_text
202 : #endif
203 :
204 : #ifdef yyget_lineno
205 : #define Rose_Fortran_free_format_get_lineno_ALREADY_DEFINED
206 : #else
207 : #define yyget_lineno Rose_Fortran_free_format_get_lineno
208 : #endif
209 :
210 : #ifdef yyset_lineno
211 : #define Rose_Fortran_free_format_set_lineno_ALREADY_DEFINED
212 : #else
213 : #define yyset_lineno Rose_Fortran_free_format_set_lineno
214 : #endif
215 :
216 : #ifdef yywrap
217 : #define Rose_Fortran_free_format_wrap_ALREADY_DEFINED
218 : #else
219 : #define yywrap Rose_Fortran_free_format_wrap
220 : #endif
221 :
222 : #ifdef yyalloc
223 : #define Rose_Fortran_free_format_alloc_ALREADY_DEFINED
224 : #else
225 : #define yyalloc Rose_Fortran_free_format_alloc
226 : #endif
227 :
228 : #ifdef yyrealloc
229 : #define Rose_Fortran_free_format_realloc_ALREADY_DEFINED
230 : #else
231 : #define yyrealloc Rose_Fortran_free_format_realloc
232 : #endif
233 :
234 : #ifdef yyfree
235 : #define Rose_Fortran_free_format_free_ALREADY_DEFINED
236 : #else
237 : #define yyfree Rose_Fortran_free_format_free
238 : #endif
239 :
240 : #ifdef yytext
241 : #define Rose_Fortran_free_format_text_ALREADY_DEFINED
242 : #else
243 : #define yytext Rose_Fortran_free_format_text
244 : #endif
245 :
246 : #ifdef yyleng
247 : #define Rose_Fortran_free_format_leng_ALREADY_DEFINED
248 : #else
249 : #define yyleng Rose_Fortran_free_format_leng
250 : #endif
251 :
252 : #ifdef yyin
253 : #define Rose_Fortran_free_format_in_ALREADY_DEFINED
254 : #else
255 : #define yyin Rose_Fortran_free_format_in
256 : #endif
257 :
258 : #ifdef yyout
259 : #define Rose_Fortran_free_format_out_ALREADY_DEFINED
260 : #else
261 : #define yyout Rose_Fortran_free_format_out
262 : #endif
263 :
264 : #ifdef yy_flex_debug
265 : #define Rose_Fortran_free_format__flex_debug_ALREADY_DEFINED
266 : #else
267 : #define yy_flex_debug Rose_Fortran_free_format__flex_debug
268 : #endif
269 :
270 : #ifdef yylineno
271 : #define Rose_Fortran_free_format_lineno_ALREADY_DEFINED
272 : #else
273 : #define yylineno Rose_Fortran_free_format_lineno
274 : #endif
275 :
276 : /* First, we deal with platform-specific or compiler-specific issues. */
277 :
278 : /* begin standard C headers. */
279 : #include <stdio.h>
280 : #include <string.h>
281 : #include <errno.h>
282 : #include <stdlib.h>
283 :
284 : /* end standard C headers. */
285 :
286 : /* flex integer type definitions */
287 :
288 : #ifndef FLEXINT_H
289 : #define FLEXINT_H
290 :
291 : /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
292 :
293 : #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
294 :
295 : /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
296 : * if you want the limit (max/min) macros for int types.
297 : */
298 : #ifndef __STDC_LIMIT_MACROS
299 : #define __STDC_LIMIT_MACROS 1
300 : #endif
301 :
302 : #include <inttypes.h>
303 : typedef int8_t flex_int8_t;
304 : typedef uint8_t flex_uint8_t;
305 : typedef int16_t flex_int16_t;
306 : typedef uint16_t flex_uint16_t;
307 : typedef int32_t flex_int32_t;
308 : typedef uint32_t flex_uint32_t;
309 : #else
310 : typedef signed char flex_int8_t;
311 : typedef short int flex_int16_t;
312 : typedef int flex_int32_t;
313 : typedef unsigned char flex_uint8_t;
314 : typedef unsigned short int flex_uint16_t;
315 : typedef unsigned int flex_uint32_t;
316 :
317 : /* Limits of integral types. */
318 : #ifndef INT8_MIN
319 : #define INT8_MIN (-128)
320 : #endif
321 : #ifndef INT16_MIN
322 : #define INT16_MIN (-32767-1)
323 : #endif
324 : #ifndef INT32_MIN
325 : #define INT32_MIN (-2147483647-1)
326 : #endif
327 : #ifndef INT8_MAX
328 : #define INT8_MAX (127)
329 : #endif
330 : #ifndef INT16_MAX
331 : #define INT16_MAX (32767)
332 : #endif
333 : #ifndef INT32_MAX
334 : #define INT32_MAX (2147483647)
335 : #endif
336 : #ifndef UINT8_MAX
337 : #define UINT8_MAX (255U)
338 : #endif
339 : #ifndef UINT16_MAX
340 : #define UINT16_MAX (65535U)
341 : #endif
342 : #ifndef UINT32_MAX
343 : #define UINT32_MAX (4294967295U)
344 : #endif
345 :
346 : #ifndef SIZE_MAX
347 : #define SIZE_MAX (~(size_t)0)
348 : #endif
349 :
350 : #endif /* ! C99 */
351 :
352 : #endif /* ! FLEXINT_H */
353 :
354 : /* begin standard C++ headers. */
355 :
356 : /* TODO: this is always defined, so inline it */
357 : #define yyconst const
358 :
359 : #if defined(__GNUC__) && __GNUC__ >= 3
360 : #define yynoreturn __attribute__((__noreturn__))
361 : #else
362 : #define yynoreturn
363 : #endif
364 :
365 : /* Returned upon end-of-file. */
366 : #define YY_NULL 0
367 :
368 : /* Promotes a possibly negative, possibly signed char to an
369 : * integer in range [0..255] for use as an array index.
370 : */
371 : #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
372 :
373 : /* Enter a start condition. This macro really ought to take a parameter,
374 : * but we do it the disgusting crufty way forced on us by the ()-less
375 : * definition of BEGIN.
376 : */
377 : #define BEGIN (yy_start) = 1 + 2 *
378 : /* Translate the current start state into a value that can be later handed
379 : * to BEGIN to return to the state. The YYSTATE alias is for lex
380 : * compatibility.
381 : */
382 : #define YY_START (((yy_start) - 1) / 2)
383 : #define YYSTATE YY_START
384 : /* Action number for EOF rule of a given start state. */
385 : #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
386 : /* Special action meaning "start processing a new file". */
387 : #define YY_NEW_FILE yyrestart( yyin )
388 : #define YY_END_OF_BUFFER_CHAR 0
389 :
390 : /* Size of default input buffer. */
391 : #ifndef YY_BUF_SIZE
392 : #ifdef __ia64__
393 : /* On IA-64, the buffer size is 16k, not 8k.
394 : * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
395 : * Ditto for the __ia64__ case accordingly.
396 : */
397 : #define YY_BUF_SIZE 32768
398 : #else
399 : #define YY_BUF_SIZE 16384
400 : #endif /* __ia64__ */
401 : #endif
402 :
403 : /* The state buf must be large enough to hold one state per character in the main buffer.
404 : */
405 : #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
406 :
407 : #ifndef YY_TYPEDEF_YY_BUFFER_STATE
408 : #define YY_TYPEDEF_YY_BUFFER_STATE
409 : typedef struct yy_buffer_state *YY_BUFFER_STATE;
410 : #endif
411 :
412 : #ifndef YY_TYPEDEF_YY_SIZE_T
413 : #define YY_TYPEDEF_YY_SIZE_T
414 : typedef size_t yy_size_t;
415 : #endif
416 :
417 : extern int yyleng;
418 :
419 : extern FILE *yyin, *yyout;
420 :
421 : #define EOB_ACT_CONTINUE_SCAN 0
422 : #define EOB_ACT_END_OF_FILE 1
423 : #define EOB_ACT_LAST_MATCH 2
424 :
425 : #define YY_LESS_LINENO(n)
426 : #define YY_LINENO_REWIND_TO(ptr)
427 :
428 : /* Return all but the first "n" matched characters back to the input stream. */
429 : #define yyless(n) \
430 : do \
431 : { \
432 : /* Undo effects of setting up yytext. */ \
433 : int yyless_macro_arg = (n); \
434 : YY_LESS_LINENO(yyless_macro_arg);\
435 : *yy_cp = (yy_hold_char); \
436 : YY_RESTORE_YY_MORE_OFFSET \
437 : (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
438 : YY_DO_BEFORE_ACTION; /* set up yytext again */ \
439 : } \
440 : while ( 0 )
441 : #define unput(c) yyunput( c, (yytext_ptr) )
442 :
443 : #ifndef YY_STRUCT_YY_BUFFER_STATE
444 : #define YY_STRUCT_YY_BUFFER_STATE
445 : struct yy_buffer_state
446 : {
447 : FILE *yy_input_file;
448 :
449 : char *yy_ch_buf; /* input buffer */
450 : char *yy_buf_pos; /* current position in input buffer */
451 :
452 : /* Size of input buffer in bytes, not including room for EOB
453 : * characters.
454 : */
455 : int yy_buf_size;
456 :
457 : /* Number of characters read into yy_ch_buf, not including EOB
458 : * characters.
459 : */
460 : int yy_n_chars;
461 :
462 : /* Whether we "own" the buffer - i.e., we know we created it,
463 : * and can realloc() it to grow it, and should free() it to
464 : * delete it.
465 : */
466 : int yy_is_our_buffer;
467 :
468 : /* Whether this is an "interactive" input source; if so, and
469 : * if we're using stdio for input, then we want to use getc()
470 : * instead of fread(), to make sure we stop fetching input after
471 : * each newline.
472 : */
473 : int yy_is_interactive;
474 :
475 : /* Whether we're considered to be at the beginning of a line.
476 : * If so, '^' rules will be active on the next match, otherwise
477 : * not.
478 : */
479 : int yy_at_bol;
480 :
481 : int yy_bs_lineno; /**< The line count. */
482 : int yy_bs_column; /**< The column count. */
483 :
484 : /* Whether to try to fill the input buffer when we reach the
485 : * end of it.
486 : */
487 : int yy_fill_buffer;
488 :
489 : int yy_buffer_status;
490 :
491 : #define YY_BUFFER_NEW 0
492 : #define YY_BUFFER_NORMAL 1
493 : /* When an EOF's been seen but there's still some text to process
494 : * then we mark the buffer as YY_EOF_PENDING, to indicate that we
495 : * shouldn't try reading from the input source any more. We might
496 : * still have a bunch of tokens to match, though, because of
497 : * possible backing-up.
498 : *
499 : * When we actually see the EOF, we change the status to "new"
500 : * (via yyrestart()), so that the user can continue scanning by
501 : * just pointing yyin at a new input file.
502 : */
503 : #define YY_BUFFER_EOF_PENDING 2
504 :
505 : };
506 : #endif /* !YY_STRUCT_YY_BUFFER_STATE */
507 :
508 : /* Stack of input buffers. */
509 : static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
510 : static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
511 : static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
512 :
513 : /* We provide macros for accessing buffer states in case in the
514 : * future we want to put the buffer states in a more general
515 : * "scanner state".
516 : *
517 : * Returns the top of the stack, or NULL.
518 : */
519 : #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
520 : ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
521 : : NULL)
522 : /* Same as previous macro, but useful when we know that the buffer stack is not
523 : * NULL or when we need an lvalue. For internal use only.
524 : */
525 : #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
526 :
527 : /* yy_hold_char holds the character lost when yytext is formed. */
528 : static char yy_hold_char;
529 : static int yy_n_chars; /* number of characters read into yy_ch_buf */
530 : int yyleng;
531 :
532 : /* Points to current character in buffer. */
533 : static char *yy_c_buf_p = NULL;
534 : static int yy_init = 0; /* whether we need to initialize */
535 : static int yy_start = 0; /* start state number */
536 :
537 : /* Flag which is used to allow yywrap()'s to do buffer switches
538 : * instead of setting up a fresh yyin. A bit of a hack ...
539 : */
540 : static int yy_did_buffer_switch_on_eof;
541 :
542 : void yyrestart ( FILE *input_file );
543 : void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
544 : YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
545 : void yy_delete_buffer ( YY_BUFFER_STATE b );
546 : void yy_flush_buffer ( YY_BUFFER_STATE b );
547 : void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
548 : void yypop_buffer_state ( void );
549 :
550 : static void yyensure_buffer_stack ( void );
551 : static void yy_load_buffer_state ( void );
552 : static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
553 : #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
554 :
555 : YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
556 : YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
557 : YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
558 :
559 : void *yyalloc ( yy_size_t );
560 : void *yyrealloc ( void *, yy_size_t );
561 : void yyfree ( void * );
562 :
563 : #define yy_new_buffer yy_create_buffer
564 : #define yy_set_interactive(is_interactive) \
565 : { \
566 : if ( ! YY_CURRENT_BUFFER ){ \
567 : yyensure_buffer_stack (); \
568 : YY_CURRENT_BUFFER_LVALUE = \
569 : yy_create_buffer( yyin, YY_BUF_SIZE ); \
570 : } \
571 : YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
572 : }
573 : #define yy_set_bol(at_bol) \
574 : { \
575 : if ( ! YY_CURRENT_BUFFER ){\
576 : yyensure_buffer_stack (); \
577 : YY_CURRENT_BUFFER_LVALUE = \
578 : yy_create_buffer( yyin, YY_BUF_SIZE ); \
579 : } \
580 : YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
581 : }
582 : #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
583 :
584 : /* Begin user sect3 */
585 :
586 : #define Rose_Fortran_free_format_wrap() (/*CONSTCOND*/1)
587 : #define YY_SKIP_YYWRAP
588 : typedef flex_uint8_t YY_CHAR;
589 :
590 : FILE *yyin = NULL, *yyout = NULL;
591 :
592 : typedef int yy_state_type;
593 :
594 : extern int yylineno;
595 : int yylineno = 1;
596 :
597 : extern char *yytext;
598 : #ifdef yytext_ptr
599 : #undef yytext_ptr
600 : #endif
601 : #define yytext_ptr yytext
602 :
603 : static yy_state_type yy_get_previous_state ( void );
604 : static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
605 : static int yy_get_next_buffer ( void );
606 : static void yynoreturn yy_fatal_error ( const char* msg );
607 :
608 : /* Done after the current pattern has been matched and before the
609 : * corresponding action - sets up yytext.
610 : */
611 : #define YY_DO_BEFORE_ACTION \
612 : (yytext_ptr) = yy_bp; \
613 : yyleng = (int) (yy_cp - yy_bp); \
614 : (yy_hold_char) = *yy_cp; \
615 : *yy_cp = '\0'; \
616 : (yy_c_buf_p) = yy_cp;
617 : #define YY_NUM_RULES 40
618 : #define YY_END_OF_BUFFER 41
619 : /* This struct is not used in this scanner,
620 : but its presence is necessary. */
621 : struct yy_trans_info
622 : {
623 : flex_int32_t yy_verify;
624 : flex_int32_t yy_nxt;
625 : };
626 : static const flex_int16_t yy_accept[107] =
627 : { 0,
628 : 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
629 : 41, 40, 34, 4, 2, 3, 10, 6, 32, 7,
630 : 34, 11, 34, 31, 20, 34, 21, 5, 34, 5,
631 : 39, 38, 35, 37, 8, 0, 0, 0, 0, 0,
632 : 0, 0, 0, 9, 17, 33, 19, 16, 18, 5,
633 : 0, 0, 5, 36, 0, 0, 0, 0, 0, 0,
634 : 0, 0, 0, 0, 0, 0, 5, 0, 23, 0,
635 : 0, 25, 28, 26, 27, 24, 0, 0, 13, 0,
636 : 0, 5, 12, 14, 0, 0, 22, 0, 0, 5,
637 : 0, 15, 29, 0, 5, 30, 0, 0, 0, 0,
638 :
639 : 0, 0, 0, 1, 0, 0
640 : } ;
641 :
642 : static const YY_CHAR yy_ec[256] =
643 : { 0,
644 : 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
645 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
646 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
647 : 1, 2, 4, 5, 1, 1, 1, 1, 6, 1,
648 : 1, 7, 8, 9, 10, 11, 12, 13, 13, 13,
649 : 13, 13, 13, 13, 13, 13, 13, 14, 15, 16,
650 : 17, 18, 1, 1, 19, 19, 20, 19, 19, 19,
651 : 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
652 : 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
653 : 1, 1, 1, 1, 19, 1, 21, 19, 19, 22,
654 :
655 : 23, 24, 25, 19, 19, 19, 19, 26, 19, 27,
656 : 28, 19, 29, 30, 31, 32, 33, 34, 19, 35,
657 : 19, 19, 36, 1, 1, 1, 1, 1, 1, 1,
658 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
659 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
660 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
661 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
662 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
663 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
664 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
665 :
666 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
667 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
668 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
669 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
670 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
671 : 1, 1, 1, 1, 1
672 : } ;
673 :
674 : static const YY_CHAR yy_meta[37] =
675 : { 0,
676 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
677 : 1, 1, 2, 1, 1, 1, 1, 1, 2, 2,
678 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
679 : 2, 2, 2, 2, 2, 1
680 : } ;
681 :
682 : static const flex_int16_t yy_base[111] =
683 : { 0,
684 : 0, 0, 0, 35, 128, 127, 123, 122, 0, 0,
685 : 127, 132, 132, 132, 132, 132, 119, 132, 132, 132,
686 : 38, 26, 111, 132, 107, 106, 105, 0, 37, 86,
687 : 132, 132, 132, 114, 132, 92, 89, 96, 17, 18,
688 : 19, 86, 78, 132, 132, 132, 132, 132, 132, 0,
689 : 44, 72, 73, 132, 82, 34, 77, 91, 90, 89,
690 : 88, 40, 66, 86, 63, 63, 71, 82, 132, 81,
691 : 60, 132, 132, 132, 132, 132, 56, 78, 132, 65,
692 : 64, 56, 132, 132, 62, 73, 132, 72, 52, 54,
693 : 69, 132, 132, 52, 50, 132, 51, 52, 58, 66,
694 :
695 : 70, 69, 73, 132, 43, 132, 109, 111, 113, 42
696 : } ;
697 :
698 : static const flex_int16_t yy_def[111] =
699 : { 0,
700 : 107, 107, 106, 3, 108, 108, 109, 109, 107, 107,
701 : 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
702 : 106, 106, 106, 106, 106, 106, 106, 110, 106, 110,
703 : 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
704 : 106, 106, 106, 106, 106, 106, 106, 106, 106, 110,
705 : 106, 106, 110, 106, 106, 106, 106, 106, 106, 106,
706 : 106, 106, 106, 106, 106, 106, 110, 106, 106, 106,
707 : 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
708 : 106, 110, 106, 106, 106, 106, 106, 106, 106, 110,
709 : 106, 106, 106, 106, 110, 106, 106, 106, 106, 106,
710 :
711 : 106, 106, 106, 106, 106, 0, 106, 106, 106, 106
712 : } ;
713 :
714 : static const flex_int16_t yy_nxt[169] =
715 : { 0,
716 : 13, 13, 14, 15, 13, 16, 17, 18, 19, 20,
717 : 21, 22, 13, 23, 24, 25, 26, 27, 28, 28,
718 : 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
719 : 28, 28, 28, 28, 28, 13, 29, 44, 51, 58,
720 : 60, 62, 45, 50, 69, 51, 63, 101, 59, 61,
721 : 76, 98, 98, 98, 99, 99, 99, 30, 36, 52,
722 : 37, 38, 39, 40, 41, 42, 52, 70, 77, 43,
723 : 101, 103, 103, 102, 103, 103, 105, 100, 97, 96,
724 : 95, 94, 93, 92, 91, 90, 89, 88, 87, 86,
725 : 85, 84, 83, 82, 81, 80, 79, 78, 75, 74,
726 :
727 : 73, 72, 71, 68, 67, 104, 66, 65, 104, 12,
728 : 12, 31, 31, 33, 33, 64, 57, 56, 55, 54,
729 : 53, 49, 48, 47, 46, 35, 106, 34, 34, 32,
730 : 32, 11, 106, 106, 106, 106, 106, 106, 106, 106,
731 : 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
732 : 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
733 : 106, 106, 106, 106, 106, 106, 106, 106
734 : } ;
735 :
736 : static const flex_int16_t yy_chk[169] =
737 : { 0,
738 : 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
739 : 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
740 : 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
741 : 3, 3, 3, 3, 3, 3, 4, 22, 29, 39,
742 : 40, 41, 22, 110, 56, 51, 41, 105, 39, 40,
743 : 62, 95, 97, 98, 95, 97, 98, 4, 21, 29,
744 : 21, 21, 21, 21, 21, 21, 51, 56, 62, 21,
745 : 100, 101, 101, 100, 103, 103, 102, 99, 94, 91,
746 : 90, 89, 88, 86, 85, 82, 81, 80, 78, 77,
747 : 71, 70, 68, 67, 66, 65, 64, 63, 61, 60,
748 :
749 : 59, 58, 57, 55, 53, 101, 52, 43, 103, 107,
750 : 107, 108, 108, 109, 109, 42, 38, 37, 36, 34,
751 : 30, 27, 26, 25, 23, 17, 11, 8, 7, 6,
752 : 5, 106, 106, 106, 106, 106, 106, 106, 106, 106,
753 : 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
754 : 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
755 : 106, 106, 106, 106, 106, 106, 106, 106
756 : } ;
757 :
758 : static yy_state_type yy_last_accepting_state;
759 : static char *yy_last_accepting_cpos;
760 :
761 : extern int yy_flex_debug;
762 : int yy_flex_debug = 0;
763 :
764 : /* The intent behind this definition is that it'll catch
765 : * any uses of REJECT which flex missed.
766 : */
767 : #define REJECT reject_used_but_not_detected
768 : #define yymore() yymore_used_but_not_detected
769 : #define YY_MORE_ADJ 0
770 : #define YY_RESTORE_YY_MORE_OFFSET
771 : char *yytext;
772 : #line 1 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
773 : #line 5 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
774 : /*
775 : Version 0.2.1 of FORTRAN scanner.
776 : 03-09-2007: Written by Ramakrishna Upadrasta and Dan Quinlan.
777 :
778 : In an input free formatted FORTRAN file, this scanner recognizes the following
779 : the ROSE sequence point in a FORTRAN file
780 : comments (beginning with ! and extendig till the end of the line)
781 : string literals (enclosed by single quotes '')
782 : Keywords (the list is provided in this code)
783 : */
784 :
785 :
786 : /*
787 : -------------------------------------------------------------------------------------
788 : New in the current release:
789 : Better data structures for the keywords
790 : scripts to generate the header files automatically
791 : preliminary macro processing
792 : -------------------------------------------------------------------------------------
793 : */
794 :
795 : /*
796 : -------------------------------------------------------------------------------------
797 : Acknowledgements:
798 : -------------------------------------------------------------------------------------
799 : The authors (Dan and Rama) looked at the source codes of GFORTRAN as well as G95.
800 : We gratefully acknowledge the authors of GFORTRAN and G95.
801 : */
802 :
803 : /*
804 : -------------------------------------------------------------------------------------
805 : Limitations:
806 : -------------------------------------------------------------------------------------
807 : The authors (Rama and Dan) recognize many of the limitations.
808 : They will be tabulated later.
809 : */
810 :
811 : /*
812 : There are three scanners in the ROSE frontend. One for C/C++, two for fixed and free
813 : format FORTRAN languages. So that the flex generated C code and definitions (yylex,
814 : yytext, etc.) of these does not interfere with any other, we are adding
815 : the prefix 'Rose_Fortran_C_Cxx_' for the C/C++ scanner,
816 : the prefix 'Rose_Fortran_Fixed_Format_' for the Fixed Format FORTRAN scanner and
817 : the prefix 'Rose_Fortran_Free_Format_' for the Free Format FORTRAN scanner
818 : by using the -P<prefix options>
819 : Note: We could have done this in an arguably more elegant way by changing the individual uses of these
820 : functions/variables.
821 : */
822 : #define yytext Rose_Fortran_free_format_text
823 : #define yylex Rose_Fortran_free_format_lex
824 :
825 :
826 :
827 : /* DQ (12/10/2016): This is a technique to suppress warnings in generated code that we want to be an error elsewhere in ROSE.
828 : See https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html for more detail.
829 : */
830 : #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
831 : #pragma GCC diagnostic ignored "-Wsign-compare"
832 : #endif
833 :
834 : #include "sage3basic.h"
835 :
836 : #include <iostream>
837 : #include <stdio.h>
838 : #include <ctype.h>
839 : #include <string>
840 : #include <list>
841 :
842 :
843 :
844 : using namespace std;
845 :
846 : // namespace Rose_Fortran_free_format_namespace {
847 :
848 : #include "general_token_defs.h"
849 : #include "./rose_fortran_token_maps.h"
850 :
851 : #if 0
852 : // These are now defined in general_defs.h
853 : struct file_pos_info
854 : {
855 : int line_num;
856 : int column_num;
857 : };
858 :
859 : struct stream_element
860 : {
861 : struct token_element * p_tok_elem;
862 : struct file_pos_info beginning_fpi;
863 : struct file_pos_info ending_fpi;
864 : };
865 : #endif
866 :
867 : // DQ (1/21/2008): Modified this to be a pointer so it could be built and returned to ROSE.
868 : LexTokenStreamTypePointer ROSE_Fortran_free_format_token_stream_pointer = NULL;
869 :
870 : typedef LexTokenStreamType::iterator SE_ITR;
871 :
872 : static struct file_pos_info curr_beginning;
873 :
874 : //Operators
875 : //This includes the "new" as well as the "old" operators
876 : token_element ROSE_Fortran_Operator_map[] =
877 : {
878 : {"+", SgToken::FORTRAN_INTRINSIC_PLUS}, /* GFORTRAN/G95 equivalent is INTRINSIC_PLUS */
879 : {"-", SgToken::FORTRAN_INTRINSIC_MINUS}, /* GFORTRAN/G95 equivalent is INTRINSIC_MINUS */
880 : {"**", SgToken::FORTRAN_INTRINSIC_POWER}, /* GFORTRAN/G95 equivalent is INTRINSIC_POWER */
881 : {"//", SgToken::FORTRAN_INTRINSIC_CONCAT}, /* GFORTRAN/G95 equivalent is INTRINSIC_CONCAT */
882 : {"*", SgToken::FORTRAN_INTRINSIC_TIMES}, /* GFORTRAN/G95 equivalent is INTRINSIC_TIMES */
883 : {"/", SgToken::FORTRAN_INTRINSIC_DIVIDE}, /* GFORTRAN/G95 equivalent is INTRINSIC_DIVIDE */
884 : {".and.", SgToken::FORTRAN_INTRINSIC_AND}, /* GFORTRAN/G95 equivalent is INTRINSIC_AND */
885 : {".or.", SgToken::FORTRAN_INTRINSIC_OR}, /* GFORTRAN/G95 equivalent is INTRINSIC_OR */
886 : {".eqv.", SgToken::FORTRAN_INTRINSIC_EQV}, /* GFORTRAN/G95 equivalent is INTRINSIC_EQV */
887 : {".neqv.", SgToken::FORTRAN_INTRINSIC_NEQV}, /* GFORTRAN/G95 equivalent is INTRINSIC_NEQV */
888 : //{".true.", SgToken::FORTRAN_TRUE}, /* GFORTRAN/G95 equivalent is INTRINSIC_NEQV */
889 : //{".false.", SgToken::FORTRAN_FALSE}, /* GFORTRAN/G95 equivalent is INTRINSIC_NEQV */
890 : {"==", SgToken::FORTRAN_INTRINSIC_EQ}, /* GFORTRAN/G95 equivalent is INTRINSIC_EQ */
891 : {"/=", SgToken::FORTRAN_INTRINSIC_NE}, /* GFORTRAN/G95 equivalent is INTRINSIC_NE */
892 : {">=", SgToken::FORTRAN_INTRINSIC_GE}, /* GFORTRAN/G95 equivalent is INTRINSIC_GE */
893 : {"<=", SgToken::FORTRAN_INTRINSIC_LE}, /* GFORTRAN/G95 equivalent is INTRINSIC_LE */
894 : {"<", SgToken::FORTRAN_INTRINSIC_LT}, /* GFORTRAN/G95 equivalent is INTRINSIC_LT */
895 : {">", SgToken::FORTRAN_INTRINSIC_GT}, /* GFORTRAN/G95 equivalent is INTRINSIC_GT */
896 : {".not.", SgToken::FORTRAN_INTRINSIC_NOT}, /* GFORTRAN/G95 equivalent is INTRINSIC_NOT */
897 : {".eq.", SgToken::FORTRAN_INTRINSIC_OLDEQ}, /* GFORTRAN/G95 equivalent is INTRINSIC_OLDEQ */
898 : {".ne.", SgToken::FORTRAN_INTRINSIC_OLDNE}, /* GFORTRAN/G95 equivalent is INTRINSIC_OLDNE */
899 : {".ge.", SgToken::FORTRAN_INTRINSIC_OLDGE}, /* GFORTRAN/G95 equivalent is INTRINSIC_OLDGE */
900 : {".le.", SgToken::FORTRAN_INTRINSIC_OLDLE}, /* GFORTRAN/G95 equivalent is INTRINSIC_OLDLE */
901 : {".lt.", SgToken::FORTRAN_INTRINSIC_OLDLT}, /* GFORTRAN/G95 equivalent is INTRINSIC_OLDLT */
902 : {".gt.", SgToken::FORTRAN_INTRINSIC_OLDGT} /* GFORTRAN/G95 equivalent is INTRINSIC_OLDGT */
903 : };
904 :
905 :
906 : //We know that this is a magic number.
907 : //We also know how to fix it.
908 : #define NUM_KEYWORDS 67
909 :
910 : //returns -1 if the string is not a keyword
911 : //otherwise returns the token ID
912 : static int identify_if_keyword(string str)
913 : {
914 : //In FORTRAN, the identifiers are case insensitive.
915 : //So, variable 'ArEa' is the same as 'aReA'
916 :
917 : string lowered_str;
918 : for(unsigned int i = 0; i < strlen(str.c_str()); i++)
919 : {
920 : lowered_str += (unsigned char)tolower(char((str.c_str())[i]));
921 : }
922 :
923 : //printf("got called with %s. Converted to %s\n", str.c_str(), lowered_str.c_str());
924 : for(int i = 0; i < NUM_KEYWORDS; i++)
925 : {
926 : if(lowered_str == ROSE_Fortran_keyword_map[i].token_lexeme)
927 : {
928 : return (ROSE_Fortran_keyword_map[i].token_id);
929 : }
930 : }
931 : return -1;
932 : }
933 :
934 : //We know that this is a magic number.
935 : //It will be fixed.
936 : #define NUM_OPERATORS 23
937 :
938 : #if 0
939 : static int identify_operator_matching(string str)
940 : {
941 : //printf("got called with %s. \n", str.c_str());
942 :
943 : for(int i = 0; i < NUM_OPERATORS; i++)
944 : {
945 : if(str == ROSE_Fortran_Operator_map[i].token_lexeme)
946 : {
947 : return (ROSE_Fortran_Operator_map[i].token_id);
948 : }
949 : }
950 : return -1;
951 : }
952 : #endif
953 :
954 : static void process_operator(string op)
955 : {
956 :
957 : }
958 :
959 :
960 : //This could be handled in a fashion better than a MACRO, but for now this will work
961 : /*
962 : #define process_operator(op) { \
963 : token_element *p_tok_elem = new token_element; \
964 : p_tok_elem->token_lexeme = yytext; \
965 : int rr = identify_if_keyword(yytext); \
966 : stream_element *p_se = new stream_element; \
967 : p_se->p_tok_elem = p_tok_elem; \
968 : p_se->beginning_fpi.line_num = line_no; \
969 : p_se->beginning_fpi.column_num = column_no; \
970 : column_no+=strlen(yytext); \
971 : p_se->ending_fpi.line_num = line_no; \
972 : p_se->ending_fpi.column_num = column_no-1; \
973 : ROSE_Fortran_free_format_token_stream.push_back(p_se); \
974 : } \
975 :
976 : */
977 :
978 : static void process_operator(string op);
979 :
980 : #define YY_NO_UNPUT
981 :
982 : // static int i = 0;
983 : static std::string currentBuffer;
984 :
985 : // DQ (4/19/2006):
986 : // Store the name of the current file so that we can generate Sg_File_Info objects
987 : // for each comment. Later we might want starting and ending fileInfo for each
988 : // comments and CPP directive.
989 : static std::string globalFileName;
990 :
991 : #define FORTRAN_LEXICAL_SUPPORT 0
992 :
993 : //struct matching_construct
994 : static int braces_no=0;
995 : // static int brace_counting_on=0;
996 :
997 : // static int topbracestack();
998 : static void pushbracestack(int);
999 : // static int popbracestack();
1000 : // static bool isemptystack();
1001 :
1002 : static int num_of_newlines(char*);
1003 : static int adjust_new_line_counter();
1004 :
1005 : using namespace std;
1006 : //#undef yywrap
1007 :
1008 :
1009 : #line 1010 "preproc-fortran.cc"
1010 :
1011 : #line 1012 "preproc-fortran.cc"
1012 :
1013 : #define INITIAL 0
1014 : #define NORMAL 1
1015 : #define FORT_COMMENT 2
1016 : #define STRING_LIT 3
1017 : #define MACRO 4
1018 :
1019 : #ifndef YY_NO_UNISTD_H
1020 : /* Special case for "unistd.h", since it is non-ANSI. We include it way
1021 : * down here because we want the user's section 1 to have been scanned first.
1022 : * The user has a chance to override it with an option.
1023 : */
1024 : #include <unistd.h>
1025 : #endif
1026 :
1027 : #ifndef YY_EXTRA_TYPE
1028 : #define YY_EXTRA_TYPE void *
1029 : #endif
1030 :
1031 : static int yy_init_globals ( void );
1032 :
1033 : /* Accessor methods to globals.
1034 : These are made visible to non-reentrant scanners for convenience. */
1035 :
1036 : int yylex_destroy ( void );
1037 :
1038 : int yyget_debug ( void );
1039 :
1040 : void yyset_debug ( int debug_flag );
1041 :
1042 : YY_EXTRA_TYPE yyget_extra ( void );
1043 :
1044 : void yyset_extra ( YY_EXTRA_TYPE user_defined );
1045 :
1046 : FILE *yyget_in ( void );
1047 :
1048 : void yyset_in ( FILE * _in_str );
1049 :
1050 : FILE *yyget_out ( void );
1051 :
1052 : void yyset_out ( FILE * _out_str );
1053 :
1054 : int yyget_leng ( void );
1055 :
1056 : char *yyget_text ( void );
1057 :
1058 : int yyget_lineno ( void );
1059 :
1060 : void yyset_lineno ( int _line_number );
1061 :
1062 : /* Macros after this point can all be overridden by user definitions in
1063 : * section 1.
1064 : */
1065 :
1066 : #ifndef YY_SKIP_YYWRAP
1067 : #ifdef __cplusplus
1068 : extern "C" int yywrap ( void );
1069 : #else
1070 : extern int yywrap ( void );
1071 : #endif
1072 : #endif
1073 :
1074 : #ifndef YY_NO_UNPUT
1075 :
1076 : static void yyunput ( int c, char *buf_ptr );
1077 :
1078 : #endif
1079 :
1080 : #ifndef yytext_ptr
1081 : static void yy_flex_strncpy ( char *, const char *, int );
1082 : #endif
1083 :
1084 : #ifdef YY_NEED_STRLEN
1085 : static int yy_flex_strlen ( const char * );
1086 : #endif
1087 :
1088 : #ifndef YY_NO_INPUT
1089 : #ifdef __cplusplus
1090 : static int yyinput ( void );
1091 : #else
1092 : static int input ( void );
1093 : #endif
1094 :
1095 : #endif
1096 :
1097 : /* Amount of stuff to slurp up with each read. */
1098 : #ifndef YY_READ_BUF_SIZE
1099 : #ifdef __ia64__
1100 : /* On IA-64, the buffer size is 16k, not 8k */
1101 : #define YY_READ_BUF_SIZE 16384
1102 : #else
1103 : #define YY_READ_BUF_SIZE 8192
1104 : #endif /* __ia64__ */
1105 : #endif
1106 :
1107 : /* Copy whatever the last rule matched to the standard output. */
1108 : #ifndef ECHO
1109 : /* This used to be an fputs(), but since the string might contain NUL's,
1110 : * we now use fwrite().
1111 : */
1112 : #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1113 : #endif
1114 :
1115 : /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1116 : * is returned in "result".
1117 : */
1118 : #ifndef YY_INPUT
1119 : #define YY_INPUT(buf,result,max_size) \
1120 : if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1121 : { \
1122 : int c = '*'; \
1123 : int n; \
1124 : for ( n = 0; n < max_size && \
1125 : (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1126 : buf[n] = (char) c; \
1127 : if ( c == '\n' ) \
1128 : buf[n++] = (char) c; \
1129 : if ( c == EOF && ferror( yyin ) ) \
1130 : YY_FATAL_ERROR( "input in flex scanner failed" ); \
1131 : result = n; \
1132 : } \
1133 : else \
1134 : { \
1135 : errno=0; \
1136 : while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1137 : { \
1138 : if( errno != EINTR) \
1139 : { \
1140 : YY_FATAL_ERROR( "input in flex scanner failed" ); \
1141 : break; \
1142 : } \
1143 : errno=0; \
1144 : clearerr(yyin); \
1145 : } \
1146 : }\
1147 : \
1148 :
1149 : #endif
1150 :
1151 : /* No semi-colon after return; correct usage is to write "yyterminate();" -
1152 : * we don't want an extra ';' after the "return" because that will cause
1153 : * some compilers to complain about unreachable statements.
1154 : */
1155 : #ifndef yyterminate
1156 : #define yyterminate() return YY_NULL
1157 : #endif
1158 :
1159 : /* Number of entries by which start-condition stack grows. */
1160 : #ifndef YY_START_STACK_INCR
1161 : #define YY_START_STACK_INCR 25
1162 : #endif
1163 :
1164 : /* Report a fatal error. */
1165 : #ifndef YY_FATAL_ERROR
1166 : #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1167 : #endif
1168 :
1169 : /* end tables serialization structures and prototypes */
1170 :
1171 : /* Default declaration of generated scanner - a define so the user can
1172 : * easily add parameters.
1173 : */
1174 : #ifndef YY_DECL
1175 : #define YY_DECL_IS_OURS 1
1176 :
1177 : extern int yylex (void);
1178 :
1179 : #define YY_DECL int yylex (void)
1180 : #endif /* !YY_DECL */
1181 :
1182 : /* Code executed at the beginning of each rule, after yytext and yyleng
1183 : * have been set up.
1184 : */
1185 : #ifndef YY_USER_ACTION
1186 : #define YY_USER_ACTION
1187 : #endif
1188 :
1189 : /* Code executed at the end of each rule. */
1190 : #ifndef YY_BREAK
1191 : #define YY_BREAK /*LINTED*/break;
1192 : #endif
1193 :
1194 : #define YY_RULE_SETUP \
1195 : if ( yyleng > 0 ) \
1196 : YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1197 : (yytext[yyleng - 1] == '\n'); \
1198 : YY_USER_ACTION
1199 :
1200 : /** The main scanner function which does all the work.
1201 : */
1202 6 : YY_DECL
1203 : {
1204 6 : yy_state_type yy_current_state;
1205 6 : char *yy_cp, *yy_bp;
1206 6 : int yy_act;
1207 :
1208 6 : if ( !(yy_init) )
1209 : {
1210 6 : (yy_init) = 1;
1211 :
1212 : #ifdef YY_USER_INIT
1213 : YY_USER_INIT;
1214 : #endif
1215 :
1216 6 : if ( ! (yy_start) )
1217 6 : (yy_start) = 1; /* first start state */
1218 :
1219 6 : if ( ! yyin )
1220 0 : yyin = stdin;
1221 :
1222 6 : if ( ! yyout )
1223 6 : yyout = stdout;
1224 :
1225 6 : if ( ! YY_CURRENT_BUFFER ) {
1226 6 : yyensure_buffer_stack ();
1227 6 : YY_CURRENT_BUFFER_LVALUE =
1228 6 : yy_create_buffer( yyin, YY_BUF_SIZE );
1229 : }
1230 :
1231 6 : yy_load_buffer_state( );
1232 : }
1233 :
1234 6 : {
1235 : #line 252 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1236 :
1237 :
1238 :
1239 : #line 256 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1240 : #undef Rose_Fortran_Free_Format_wrap
1241 : int line_no = 1;
1242 :
1243 : /* DQ (12/10/2016): Eliminating a warning that we want to be an error: -Werror=unused-but-set-variable. */
1244 : /* int start_line_no = line_no; */
1245 :
1246 : int column_no = 1;
1247 :
1248 : /* DQ (12/10/2016): Eliminating a warning that we want to be an error: -Werror=unused-but-set-variable. */
1249 : /* int start_column_no = column_no; */
1250 :
1251 : BEGIN NORMAL;
1252 :
1253 :
1254 : #line 1255 "preproc-fortran.cc"
1255 :
1256 1076 : while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1257 : {
1258 1076 : yy_cp = (yy_c_buf_p);
1259 :
1260 : /* Support of yytext. */
1261 1076 : *yy_cp = (yy_hold_char);
1262 :
1263 : /* yy_bp points to the position in yy_ch_buf of the start of
1264 : * the current run.
1265 : */
1266 1076 : yy_bp = yy_cp;
1267 :
1268 1076 : yy_current_state = (yy_start);
1269 1076 : yy_current_state += YY_AT_BOL();
1270 1607 : yy_match:
1271 1607 : do
1272 : {
1273 1607 : YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1274 1607 : if ( yy_accept[yy_current_state] )
1275 : {
1276 434 : (yy_last_accepting_state) = yy_current_state;
1277 434 : (yy_last_accepting_cpos) = yy_cp;
1278 : }
1279 2803 : while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1280 : {
1281 1196 : yy_current_state = (int) yy_def[yy_current_state];
1282 1196 : if ( yy_current_state >= 107 )
1283 978 : yy_c = yy_meta[yy_c];
1284 : }
1285 1607 : yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1286 1607 : ++yy_cp;
1287 : }
1288 1607 : while ( yy_base[yy_current_state] != 132 );
1289 :
1290 1082 : yy_find_action:
1291 1082 : yy_act = yy_accept[yy_current_state];
1292 1082 : if ( yy_act == 0 )
1293 : { /* have to back up */
1294 168 : yy_cp = (yy_last_accepting_cpos);
1295 168 : yy_current_state = (yy_last_accepting_state);
1296 168 : yy_act = yy_accept[yy_current_state];
1297 : }
1298 :
1299 1082 : YY_DO_BEFORE_ACTION;
1300 :
1301 1088 : do_action: /* This label is used only to access EOF actions. */
1302 :
1303 1088 : switch ( yy_act )
1304 : { /* beginning of action switch */
1305 0 : case 0: /* must back up */
1306 : /* undo the effects of YY_DO_BEFORE_ACTION */
1307 0 : *yy_cp = (yy_hold_char);
1308 0 : yy_cp = (yy_last_accepting_cpos);
1309 0 : yy_current_state = (yy_last_accepting_state);
1310 0 : goto yy_find_action;
1311 :
1312 0 : case 1:
1313 : /* rule 1 can match eol */
1314 0 : YY_RULE_SETUP
1315 : #line 270 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1316 : {
1317 : /*preprocessorList.addElement(PreprocessingInfo::ClinkageSpecificationStart,
1318 : yytext,globalFileName,line_no,column_no,0);
1319 : */
1320 : braces_no++;
1321 : line_no+=num_of_newlines(yytext);
1322 : column_no+=strlen(yytext);
1323 : pushbracestack(braces_no);
1324 : }
1325 : YY_BREAK
1326 : case 2:
1327 : YY_RULE_SETUP
1328 : #line 279 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1329 : {
1330 : /* DQ (12/10/2016): Eliminating a warning that we want to be an error: -Werror=unused-but-set-variable. */
1331 : /* start_line_no=line_no; */
1332 : /* start_column_no=column_no; */
1333 : curr_beginning.line_num = line_no;
1334 : curr_beginning.column_num = column_no;
1335 : column_no+=1;
1336 : currentBuffer = yytext;
1337 : BEGIN FORT_COMMENT;
1338 : }
1339 : YY_BREAK
1340 : case 3:
1341 : YY_RULE_SETUP
1342 : #line 289 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1343 : {
1344 : /* DQ (12/10/2016): Eliminating a warning that we want to be an error: -Werror=unused-but-set-variable. */
1345 : /* This begins a STRING LITERAL */
1346 : /* start_line_no=line_no; */
1347 : /* start_column_no=column_no; */
1348 : curr_beginning.line_num = line_no;
1349 : curr_beginning.column_num = column_no;
1350 : column_no+=1;
1351 : currentBuffer = yytext;
1352 : BEGIN STRING_LIT;
1353 : }
1354 : YY_BREAK
1355 : case 4:
1356 : /* rule 4 can match eol */
1357 : YY_RULE_SETUP
1358 : #line 300 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1359 : { line_no++; column_no=1; }
1360 : YY_BREAK
1361 : case 5:
1362 : YY_RULE_SETUP
1363 : #line 301 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1364 : {
1365 :
1366 : token_element *p_tok_elem = new token_element;
1367 : p_tok_elem->token_lexeme = yytext;
1368 :
1369 : int is_keyword = identify_if_keyword(yytext);
1370 : //found a keyword?
1371 : if(is_keyword != -1)
1372 : {
1373 : //printf("%s is a keyword\n", yytext);
1374 : p_tok_elem->token_id = is_keyword;
1375 : }
1376 : else
1377 : {
1378 : //printf("%s is not a keyword\n", yytext);
1379 : p_tok_elem->token_id = SgToken::FORTRAN_IDENTIFIER;
1380 : }
1381 :
1382 : stream_element *p_se = new stream_element;
1383 : p_se->p_tok_elem = p_tok_elem;
1384 :
1385 : p_se->beginning_fpi.line_num = line_no;
1386 : p_se->beginning_fpi.column_num = column_no;
1387 : column_no+=strlen(yytext);
1388 : p_se->ending_fpi.line_num = line_no;
1389 : p_se->ending_fpi.column_num = column_no-1;
1390 : //push the element onto the token stream
1391 : ROSE_Fortran_free_format_token_stream_pointer->push_back(p_se);
1392 : }
1393 : YY_BREAK
1394 : case 6:
1395 : YY_RULE_SETUP
1396 : #line 330 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1397 : {process_operator(yytext);column_no+=strlen(yytext);}
1398 : YY_BREAK
1399 : case 7:
1400 : YY_RULE_SETUP
1401 : #line 331 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1402 : {process_operator(yytext);column_no+=strlen(yytext);}
1403 : YY_BREAK
1404 : case 8:
1405 : YY_RULE_SETUP
1406 : #line 332 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1407 : {process_operator(yytext);column_no+=strlen(yytext);}
1408 : YY_BREAK
1409 : case 9:
1410 : YY_RULE_SETUP
1411 : #line 333 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1412 : {process_operator(yytext);column_no+=strlen(yytext);}
1413 : YY_BREAK
1414 : case 10:
1415 : YY_RULE_SETUP
1416 : #line 334 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1417 : {process_operator(yytext);column_no+=strlen(yytext);}
1418 : YY_BREAK
1419 : case 11:
1420 : YY_RULE_SETUP
1421 : #line 335 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1422 : {process_operator(yytext);column_no+=strlen(yytext);}
1423 : YY_BREAK
1424 : case 12:
1425 : YY_RULE_SETUP
1426 : #line 336 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1427 : {process_operator(yytext);column_no+=strlen(yytext);}
1428 : YY_BREAK
1429 : case 13:
1430 : YY_RULE_SETUP
1431 : #line 337 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1432 : {process_operator(yytext);column_no+=strlen(yytext);}
1433 : YY_BREAK
1434 : case 14:
1435 : YY_RULE_SETUP
1436 : #line 338 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1437 : {process_operator(yytext);column_no+=strlen(yytext);}
1438 : YY_BREAK
1439 : case 15:
1440 : YY_RULE_SETUP
1441 : #line 339 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1442 : {process_operator(yytext);column_no+=strlen(yytext);}
1443 : YY_BREAK
1444 : case 16:
1445 : YY_RULE_SETUP
1446 : #line 340 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1447 : {process_operator(yytext);column_no+=strlen(yytext);}
1448 : YY_BREAK
1449 : case 17:
1450 : YY_RULE_SETUP
1451 : #line 341 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1452 : {process_operator(yytext);column_no+=strlen(yytext);}
1453 : YY_BREAK
1454 : case 18:
1455 : YY_RULE_SETUP
1456 : #line 342 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1457 : {process_operator(yytext);column_no+=strlen(yytext);}
1458 : YY_BREAK
1459 : case 19:
1460 : YY_RULE_SETUP
1461 : #line 343 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1462 : {process_operator(yytext);column_no+=strlen(yytext);}
1463 : YY_BREAK
1464 : case 20:
1465 : YY_RULE_SETUP
1466 : #line 344 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1467 : {process_operator(yytext);column_no+=strlen(yytext);}
1468 : YY_BREAK
1469 : case 21:
1470 : YY_RULE_SETUP
1471 : #line 345 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1472 : {process_operator(yytext);column_no+=strlen(yytext);}
1473 : YY_BREAK
1474 : case 22:
1475 : YY_RULE_SETUP
1476 : #line 346 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1477 : {process_operator(yytext);column_no+=strlen(yytext);}
1478 : YY_BREAK
1479 : case 23:
1480 : YY_RULE_SETUP
1481 : #line 347 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1482 : {process_operator(yytext);column_no+=strlen(yytext);}
1483 : YY_BREAK
1484 : case 24:
1485 : YY_RULE_SETUP
1486 : #line 348 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1487 : {process_operator(yytext);column_no+=strlen(yytext);}
1488 : YY_BREAK
1489 : case 25:
1490 : YY_RULE_SETUP
1491 : #line 349 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1492 : {process_operator(yytext);column_no+=strlen(yytext);}
1493 : YY_BREAK
1494 : case 26:
1495 : YY_RULE_SETUP
1496 : #line 350 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1497 : {process_operator(yytext);column_no+=strlen(yytext);}
1498 : YY_BREAK
1499 : case 27:
1500 : YY_RULE_SETUP
1501 : #line 351 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1502 : {process_operator(yytext);column_no+=strlen(yytext);}
1503 : YY_BREAK
1504 : case 28:
1505 : YY_RULE_SETUP
1506 : #line 352 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1507 : {process_operator(yytext);column_no+=strlen(yytext);}
1508 : YY_BREAK
1509 : case 29:
1510 : YY_RULE_SETUP
1511 : #line 353 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1512 : {process_operator(yytext);column_no+=strlen(yytext);}
1513 : YY_BREAK
1514 : case 30:
1515 : YY_RULE_SETUP
1516 : #line 354 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1517 : {process_operator(yytext);column_no+=strlen(yytext);}
1518 : YY_BREAK
1519 : case 31:
1520 : YY_RULE_SETUP
1521 : #line 355 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1522 : {/*Do stuff to store semi colons*/ /*process_operator(yytext);*/column_no+=strlen(yytext);}
1523 : YY_BREAK
1524 : case 32:
1525 : YY_RULE_SETUP
1526 : #line 356 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1527 : {/*Do stuff to store commas*/ /*process_operator(yytext);*/column_no+=strlen(yytext);}
1528 : YY_BREAK
1529 : case 33:
1530 : YY_RULE_SETUP
1531 : #line 357 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1532 : {/*Do stuff to store colons*/ /*process_operator(yytext);*/column_no+=strlen(yytext);}
1533 : YY_BREAK
1534 : /*
1535 : <NORMAL>^[:blank:]*\n {
1536 : //According to the STD, a line which has whitespaces is a comment line
1537 : //We will store it
1538 : printf("came across a blank line\n");
1539 : currentBuffer += yytext;
1540 :
1541 : token_element *p_tok_elem = new token_element;
1542 : p_tok_elem->token_lexeme = currentBuffer;
1543 : p_tok_elem->token_id = SgToken::FORTRAN_COMMENTS;
1544 :
1545 : stream_element *p_se = new stream_element;
1546 : p_se->p_tok_elem = p_tok_elem;
1547 :
1548 : p_se->beginning_fpi.line_num = line_no;
1549 : p_se->beginning_fpi.column_num = column_no;
1550 :
1551 : p_se->ending_fpi.line_num = line_no;
1552 : p_se->ending_fpi.column_num = column_no;
1553 : ROSE_Fortran_free_format_token_stream_pointer->push_back(p_se);
1554 :
1555 : line_no++; column_no=1;
1556 : }
1557 : */
1558 : case 34:
1559 : YY_RULE_SETUP
1560 : #line 382 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1561 : {column_no++;}
1562 : YY_BREAK
1563 : case 35:
1564 : /* rule 35 can match eol */
1565 : YY_RULE_SETUP
1566 : #line 383 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1567 : {
1568 : column_no++;
1569 : currentBuffer += yytext;
1570 : }
1571 : YY_BREAK
1572 : case 36:
1573 : YY_RULE_SETUP
1574 : #line 387 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1575 : {
1576 : column_no+=2;
1577 : currentBuffer += yytext;
1578 : }
1579 : YY_BREAK
1580 : case 37:
1581 : YY_RULE_SETUP
1582 : #line 391 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1583 : {
1584 : //This ends the STRING LITERALS
1585 : currentBuffer += yytext;
1586 : //printf("\nthe literal string is %s\n", currentBuffer.c_str());
1587 : //printf("ending in (%d, %d) \n", line_no, column_no);
1588 :
1589 : adjust_new_line_counter();
1590 :
1591 : token_element *p_tok_elem = new token_element;
1592 : p_tok_elem->token_lexeme = currentBuffer;
1593 : p_tok_elem->token_id = SgToken::FORTRAN_STRING_LITERALS;
1594 :
1595 : stream_element *p_se = new stream_element;
1596 : p_se->p_tok_elem = p_tok_elem;
1597 :
1598 : p_se->beginning_fpi = curr_beginning;
1599 : p_se->ending_fpi.line_num = line_no;
1600 : p_se->ending_fpi.column_num = column_no;
1601 :
1602 : ROSE_Fortran_free_format_token_stream_pointer->push_back(p_se);
1603 :
1604 : column_no++;
1605 : BEGIN NORMAL;
1606 : }
1607 : YY_BREAK
1608 : case 38:
1609 : /* rule 38 can match eol */
1610 : YY_RULE_SETUP
1611 : #line 415 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1612 : {
1613 : //This is also a comment
1614 : currentBuffer += yytext;
1615 : //printf("the comment string is %s", currentBuffer.c_str());
1616 :
1617 : token_element *p_tok_elem = new token_element;
1618 : p_tok_elem->token_lexeme = currentBuffer;
1619 : p_tok_elem->token_id = SgToken::FORTRAN_COMMENTS;
1620 :
1621 : stream_element *p_se = new stream_element;
1622 : p_se->p_tok_elem = p_tok_elem;
1623 : p_se->beginning_fpi = curr_beginning;
1624 : p_se->ending_fpi.line_num = line_no;
1625 : p_se->ending_fpi.column_num = column_no;
1626 : ROSE_Fortran_free_format_token_stream_pointer->push_back(p_se);
1627 :
1628 : line_no++; column_no=1;
1629 : BEGIN NORMAL;
1630 : }
1631 : YY_BREAK
1632 : case 39:
1633 : YY_RULE_SETUP
1634 : #line 434 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1635 : {
1636 : column_no++;
1637 : currentBuffer += yytext;
1638 : }
1639 : YY_BREAK
1640 : case 40:
1641 : YY_RULE_SETUP
1642 : #line 438 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
1643 : ECHO;
1644 : YY_BREAK
1645 : #line 1646 "preproc-fortran.cc"
1646 6 : case YY_STATE_EOF(INITIAL):
1647 6 : case YY_STATE_EOF(NORMAL):
1648 6 : case YY_STATE_EOF(FORT_COMMENT):
1649 6 : case YY_STATE_EOF(STRING_LIT):
1650 6 : case YY_STATE_EOF(MACRO):
1651 6 : yyterminate();
1652 :
1653 12 : case YY_END_OF_BUFFER:
1654 12 : {
1655 : /* Amount of text matched not including the EOB char. */
1656 12 : int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1657 :
1658 : /* Undo the effects of YY_DO_BEFORE_ACTION. */
1659 12 : *yy_cp = (yy_hold_char);
1660 : YY_RESTORE_YY_MORE_OFFSET
1661 :
1662 12 : if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1663 : {
1664 : /* We're scanning a new file or input source. It's
1665 : * possible that this happened because the user
1666 : * just pointed yyin at a new source and called
1667 : * yylex(). If so, then we have to assure
1668 : * consistency between YY_CURRENT_BUFFER and our
1669 : * globals. Here is the right place to do so, because
1670 : * this is the first action (other than possibly a
1671 : * back-up) that will match for the new input source.
1672 : */
1673 6 : (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1674 6 : YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1675 6 : YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1676 : }
1677 :
1678 : /* Note that here we test for yy_c_buf_p "<=" to the position
1679 : * of the first EOB in the buffer, since yy_c_buf_p will
1680 : * already have been incremented past the NUL character
1681 : * (since all states make transitions on EOB to the
1682 : * end-of-buffer state). Contrast this with the test
1683 : * in input().
1684 : */
1685 12 : if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1686 : { /* This was really a NUL. */
1687 0 : yy_state_type yy_next_state;
1688 :
1689 0 : (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1690 :
1691 0 : yy_current_state = yy_get_previous_state( );
1692 :
1693 : /* Okay, we're now positioned to make the NUL
1694 : * transition. We couldn't have
1695 : * yy_get_previous_state() go ahead and do it
1696 : * for us because it doesn't know how to deal
1697 : * with the possibility of jamming (and we don't
1698 : * want to build jamming into it because then it
1699 : * will run more slowly).
1700 : */
1701 :
1702 0 : yy_next_state = yy_try_NUL_trans( yy_current_state );
1703 :
1704 0 : yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1705 :
1706 0 : if ( yy_next_state )
1707 : {
1708 : /* Consume the NUL. */
1709 0 : yy_cp = ++(yy_c_buf_p);
1710 0 : yy_current_state = yy_next_state;
1711 0 : goto yy_match;
1712 : }
1713 :
1714 : else
1715 : {
1716 0 : yy_cp = (yy_c_buf_p);
1717 0 : goto yy_find_action;
1718 : }
1719 : }
1720 :
1721 12 : else switch ( yy_get_next_buffer( ) )
1722 : {
1723 6 : case EOB_ACT_END_OF_FILE:
1724 6 : {
1725 6 : (yy_did_buffer_switch_on_eof) = 0;
1726 :
1727 6 : if ( yywrap( ) )
1728 : {
1729 : /* Note: because we've taken care in
1730 : * yy_get_next_buffer() to have set up
1731 : * yytext, we can now set up
1732 : * yy_c_buf_p so that if some total
1733 : * hoser (like flex itself) wants to
1734 : * call the scanner after we return the
1735 : * YY_NULL, it'll still work - another
1736 : * YY_NULL will get returned.
1737 : */
1738 6 : (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1739 :
1740 6 : yy_act = YY_STATE_EOF(YY_START);
1741 6 : goto do_action;
1742 : }
1743 :
1744 : else
1745 : {
1746 : if ( ! (yy_did_buffer_switch_on_eof) )
1747 : YY_NEW_FILE;
1748 : }
1749 : break;
1750 : }
1751 :
1752 6 : case EOB_ACT_CONTINUE_SCAN:
1753 6 : (yy_c_buf_p) =
1754 6 : (yytext_ptr) + yy_amount_of_matched_text;
1755 :
1756 6 : yy_current_state = yy_get_previous_state( );
1757 :
1758 6 : yy_cp = (yy_c_buf_p);
1759 6 : yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1760 6 : goto yy_match;
1761 :
1762 0 : case EOB_ACT_LAST_MATCH:
1763 0 : (yy_c_buf_p) =
1764 0 : &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1765 :
1766 0 : yy_current_state = yy_get_previous_state( );
1767 :
1768 0 : yy_cp = (yy_c_buf_p);
1769 0 : yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1770 0 : goto yy_find_action;
1771 : }
1772 : break;
1773 : }
1774 :
1775 0 : default:
1776 0 : YY_FATAL_ERROR(
1777 : "fatal flex scanner internal error--no action found" );
1778 : } /* end of action switch */
1779 : } /* end of scanning one token */
1780 : } /* end of user's declarations */
1781 : } /* end of yylex */
1782 :
1783 : /* yy_get_next_buffer - try to read in a new buffer
1784 : *
1785 : * Returns a code representing an action:
1786 : * EOB_ACT_LAST_MATCH -
1787 : * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1788 : * EOB_ACT_END_OF_FILE - end of file
1789 : */
1790 12 : static int yy_get_next_buffer (void)
1791 : {
1792 12 : char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1793 12 : char *source = (yytext_ptr);
1794 12 : int number_to_move, i;
1795 12 : int ret_val;
1796 :
1797 12 : if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1798 0 : YY_FATAL_ERROR(
1799 : "fatal flex scanner internal error--end of buffer missed" );
1800 :
1801 12 : if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1802 : { /* Don't try to fill the buffer, so this is an EOF. */
1803 0 : if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1804 : {
1805 : /* We matched a single character, the EOB, so
1806 : * treat this as a final EOF.
1807 : */
1808 : return EOB_ACT_END_OF_FILE;
1809 : }
1810 :
1811 : else
1812 : {
1813 : /* We matched some text prior to the EOB, first
1814 : * process it.
1815 : */
1816 0 : return EOB_ACT_LAST_MATCH;
1817 : }
1818 : }
1819 :
1820 : /* Try to read more data. */
1821 :
1822 : /* First move last chars to start of buffer. */
1823 12 : number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1824 :
1825 12 : for ( i = 0; i < number_to_move; ++i )
1826 0 : *(dest++) = *(source++);
1827 :
1828 12 : if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1829 : /* don't do the read, it's not guaranteed to return an EOF,
1830 : * just force an EOF
1831 : */
1832 0 : YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1833 :
1834 : else
1835 : {
1836 12 : int num_to_read =
1837 12 : YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1838 :
1839 12 : while ( num_to_read <= 0 )
1840 : { /* Not enough room in the buffer - grow it. */
1841 :
1842 : /* just a shorter name for the current buffer */
1843 0 : YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1844 :
1845 0 : int yy_c_buf_p_offset =
1846 0 : (int) ((yy_c_buf_p) - b->yy_ch_buf);
1847 :
1848 0 : if ( b->yy_is_our_buffer )
1849 : {
1850 0 : int new_size = b->yy_buf_size * 2;
1851 :
1852 0 : if ( new_size <= 0 )
1853 0 : b->yy_buf_size += b->yy_buf_size / 8;
1854 : else
1855 0 : b->yy_buf_size *= 2;
1856 :
1857 0 : b->yy_ch_buf = (char *)
1858 : /* Include room in for 2 EOB chars. */
1859 0 : yyrealloc( (void *) b->yy_ch_buf,
1860 0 : (yy_size_t) (b->yy_buf_size + 2) );
1861 : }
1862 : else
1863 : /* Can't grow it, we don't own it. */
1864 0 : b->yy_ch_buf = NULL;
1865 :
1866 0 : if ( ! b->yy_ch_buf )
1867 0 : YY_FATAL_ERROR(
1868 : "fatal error - scanner input buffer overflow" );
1869 :
1870 0 : (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1871 :
1872 0 : num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1873 : number_to_move - 1;
1874 :
1875 : }
1876 :
1877 12 : if ( num_to_read > YY_READ_BUF_SIZE )
1878 : num_to_read = YY_READ_BUF_SIZE;
1879 :
1880 : /* Read in more data. */
1881 24 : YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1882 12 : (yy_n_chars), num_to_read );
1883 :
1884 12 : YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1885 : }
1886 :
1887 12 : if ( (yy_n_chars) == 0 )
1888 : {
1889 6 : if ( number_to_move == YY_MORE_ADJ )
1890 : {
1891 6 : ret_val = EOB_ACT_END_OF_FILE;
1892 6 : yyrestart( yyin );
1893 : }
1894 :
1895 : else
1896 : {
1897 0 : ret_val = EOB_ACT_LAST_MATCH;
1898 0 : YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1899 : YY_BUFFER_EOF_PENDING;
1900 : }
1901 : }
1902 :
1903 : else
1904 : ret_val = EOB_ACT_CONTINUE_SCAN;
1905 :
1906 12 : if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1907 : /* Extend the array by 50%, plus the number we really need. */
1908 0 : int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1909 0 : YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1910 0 : (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1911 0 : if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1912 0 : YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1913 : /* "- 2" to take care of EOB's */
1914 0 : YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1915 : }
1916 :
1917 12 : (yy_n_chars) += number_to_move;
1918 12 : YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1919 12 : YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1920 :
1921 12 : (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1922 :
1923 12 : return ret_val;
1924 : }
1925 :
1926 : /* yy_get_previous_state - get the state just before the EOB char was reached */
1927 :
1928 6 : static yy_state_type yy_get_previous_state (void)
1929 : {
1930 6 : yy_state_type yy_current_state;
1931 6 : char *yy_cp;
1932 :
1933 6 : yy_current_state = (yy_start);
1934 6 : yy_current_state += YY_AT_BOL();
1935 :
1936 6 : for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1937 : {
1938 0 : YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1939 0 : if ( yy_accept[yy_current_state] )
1940 : {
1941 0 : (yy_last_accepting_state) = yy_current_state;
1942 0 : (yy_last_accepting_cpos) = yy_cp;
1943 : }
1944 0 : while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1945 : {
1946 0 : yy_current_state = (int) yy_def[yy_current_state];
1947 0 : if ( yy_current_state >= 107 )
1948 0 : yy_c = yy_meta[yy_c];
1949 : }
1950 0 : yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1951 : }
1952 :
1953 6 : return yy_current_state;
1954 : }
1955 :
1956 : /* yy_try_NUL_trans - try to make a transition on the NUL character
1957 : *
1958 : * synopsis
1959 : * next_state = yy_try_NUL_trans( current_state );
1960 : */
1961 0 : static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1962 : {
1963 0 : int yy_is_jam;
1964 0 : char *yy_cp = (yy_c_buf_p);
1965 :
1966 0 : YY_CHAR yy_c = 1;
1967 0 : if ( yy_accept[yy_current_state] )
1968 : {
1969 0 : (yy_last_accepting_state) = yy_current_state;
1970 0 : (yy_last_accepting_cpos) = yy_cp;
1971 : }
1972 0 : while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1973 : {
1974 0 : yy_current_state = (int) yy_def[yy_current_state];
1975 0 : if ( yy_current_state >= 107 )
1976 : yy_c = yy_meta[yy_c];
1977 : }
1978 0 : yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1979 0 : yy_is_jam = (yy_current_state == 106);
1980 :
1981 0 : return yy_is_jam ? 0 : yy_current_state;
1982 : }
1983 :
1984 : #ifndef YY_NO_UNPUT
1985 :
1986 : static void yyunput (int c, char * yy_bp )
1987 : {
1988 : char *yy_cp;
1989 :
1990 : yy_cp = (yy_c_buf_p);
1991 :
1992 : /* undo effects of setting up yytext */
1993 : *yy_cp = (yy_hold_char);
1994 :
1995 : if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1996 : { /* need to shift things up to make room */
1997 : /* +2 for EOB chars. */
1998 : int number_to_move = (yy_n_chars) + 2;
1999 : char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2000 : YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2001 : char *source =
2002 : &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2003 :
2004 : while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2005 : *--dest = *--source;
2006 :
2007 : yy_cp += (int) (dest - source);
2008 : yy_bp += (int) (dest - source);
2009 : YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2010 : (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2011 :
2012 : if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2013 : YY_FATAL_ERROR( "flex scanner push-back overflow" );
2014 : }
2015 :
2016 : *--yy_cp = (char) c;
2017 :
2018 : (yytext_ptr) = yy_bp;
2019 : (yy_hold_char) = *yy_cp;
2020 : (yy_c_buf_p) = yy_cp;
2021 : }
2022 :
2023 : #endif
2024 :
2025 : #ifndef YY_NO_INPUT
2026 : #ifdef __cplusplus
2027 : static int yyinput (void)
2028 : #else
2029 : static int input (void)
2030 : #endif
2031 :
2032 : {
2033 : int c;
2034 :
2035 : *(yy_c_buf_p) = (yy_hold_char);
2036 :
2037 : if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2038 : {
2039 : /* yy_c_buf_p now points to the character we want to return.
2040 : * If this occurs *before* the EOB characters, then it's a
2041 : * valid NUL; if not, then we've hit the end of the buffer.
2042 : */
2043 : if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2044 : /* This was really a NUL. */
2045 : *(yy_c_buf_p) = '\0';
2046 :
2047 : else
2048 : { /* need more input */
2049 : int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
2050 : ++(yy_c_buf_p);
2051 :
2052 : switch ( yy_get_next_buffer( ) )
2053 : {
2054 : case EOB_ACT_LAST_MATCH:
2055 : /* This happens because yy_g_n_b()
2056 : * sees that we've accumulated a
2057 : * token and flags that we need to
2058 : * try matching the token before
2059 : * proceeding. But for input(),
2060 : * there's no matching to consider.
2061 : * So convert the EOB_ACT_LAST_MATCH
2062 : * to EOB_ACT_END_OF_FILE.
2063 : */
2064 :
2065 : /* Reset buffer status. */
2066 : yyrestart( yyin );
2067 :
2068 : /*FALLTHROUGH*/
2069 :
2070 : case EOB_ACT_END_OF_FILE:
2071 : {
2072 : if ( yywrap( ) )
2073 : return 0;
2074 :
2075 : if ( ! (yy_did_buffer_switch_on_eof) )
2076 : YY_NEW_FILE;
2077 : #ifdef __cplusplus
2078 : return yyinput();
2079 : #else
2080 : return input();
2081 : #endif
2082 : }
2083 :
2084 : case EOB_ACT_CONTINUE_SCAN:
2085 : (yy_c_buf_p) = (yytext_ptr) + offset;
2086 : break;
2087 : }
2088 : }
2089 : }
2090 :
2091 : c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2092 : *(yy_c_buf_p) = '\0'; /* preserve yytext */
2093 : (yy_hold_char) = *++(yy_c_buf_p);
2094 :
2095 : YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2096 :
2097 : return c;
2098 : }
2099 : #endif /* ifndef YY_NO_INPUT */
2100 :
2101 : /** Immediately switch to a different input stream.
2102 : * @param input_file A readable stream.
2103 : *
2104 : * @note This function does not reset the start condition to @c INITIAL .
2105 : */
2106 6 : void yyrestart (FILE * input_file )
2107 : {
2108 :
2109 6 : if ( ! YY_CURRENT_BUFFER ){
2110 0 : yyensure_buffer_stack ();
2111 0 : YY_CURRENT_BUFFER_LVALUE =
2112 0 : yy_create_buffer( yyin, YY_BUF_SIZE );
2113 : }
2114 :
2115 6 : yy_init_buffer( YY_CURRENT_BUFFER, input_file );
2116 6 : yy_load_buffer_state( );
2117 6 : }
2118 :
2119 : /** Switch to a different input buffer.
2120 : * @param new_buffer The new input buffer.
2121 : *
2122 : */
2123 0 : void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2124 : {
2125 :
2126 : /* TODO. We should be able to replace this entire function body
2127 : * with
2128 : * yypop_buffer_state();
2129 : * yypush_buffer_state(new_buffer);
2130 : */
2131 0 : yyensure_buffer_stack ();
2132 0 : if ( YY_CURRENT_BUFFER == new_buffer )
2133 : return;
2134 :
2135 0 : if ( YY_CURRENT_BUFFER )
2136 : {
2137 : /* Flush out information for old buffer. */
2138 0 : *(yy_c_buf_p) = (yy_hold_char);
2139 0 : YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2140 0 : YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2141 : }
2142 :
2143 0 : YY_CURRENT_BUFFER_LVALUE = new_buffer;
2144 0 : yy_load_buffer_state( );
2145 :
2146 : /* We don't actually know whether we did this switch during
2147 : * EOF (yywrap()) processing, but the only time this flag
2148 : * is looked at is after yywrap() is called, so it's safe
2149 : * to go ahead and always set it.
2150 : */
2151 0 : (yy_did_buffer_switch_on_eof) = 1;
2152 : }
2153 :
2154 18 : static void yy_load_buffer_state (void)
2155 : {
2156 18 : (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2157 18 : (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2158 18 : yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2159 0 : (yy_hold_char) = *(yy_c_buf_p);
2160 6 : }
2161 :
2162 : /** Allocate and initialize an input buffer state.
2163 : * @param file A readable stream.
2164 : * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2165 : *
2166 : * @return the allocated buffer state.
2167 : */
2168 6 : YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
2169 : {
2170 6 : YY_BUFFER_STATE b;
2171 :
2172 6 : b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2173 6 : if ( ! b )
2174 0 : YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2175 :
2176 6 : b->yy_buf_size = size;
2177 :
2178 : /* yy_ch_buf has to be 2 characters longer than the size given because
2179 : * we need to put in 2 end-of-buffer characters.
2180 : */
2181 6 : b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
2182 6 : if ( ! b->yy_ch_buf )
2183 0 : YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2184 :
2185 6 : b->yy_is_our_buffer = 1;
2186 :
2187 6 : yy_init_buffer( b, file );
2188 :
2189 6 : return b;
2190 : }
2191 :
2192 : /** Destroy the buffer.
2193 : * @param b a buffer created with yy_create_buffer()
2194 : *
2195 : */
2196 0 : void yy_delete_buffer (YY_BUFFER_STATE b )
2197 : {
2198 :
2199 0 : if ( ! b )
2200 : return;
2201 :
2202 0 : if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2203 0 : YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2204 :
2205 0 : if ( b->yy_is_our_buffer )
2206 0 : yyfree( (void *) b->yy_ch_buf );
2207 :
2208 0 : yyfree( (void *) b );
2209 : }
2210 :
2211 : /* Initializes or reinitializes a buffer.
2212 : * This function is sometimes called more than once on the same buffer,
2213 : * such as during a yyrestart() or at EOF.
2214 : */
2215 12 : static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
2216 :
2217 : {
2218 12 : int oerrno = errno;
2219 :
2220 12 : yy_flush_buffer( b );
2221 :
2222 12 : b->yy_input_file = file;
2223 12 : b->yy_fill_buffer = 1;
2224 :
2225 : /* If b is the current buffer, then yy_init_buffer was _probably_
2226 : * called from yyrestart() or through yy_get_next_buffer.
2227 : * In that case, we don't want to reset the lineno or column.
2228 : */
2229 12 : if (b != YY_CURRENT_BUFFER){
2230 6 : b->yy_bs_lineno = 1;
2231 6 : b->yy_bs_column = 0;
2232 : }
2233 :
2234 12 : b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2235 :
2236 12 : errno = oerrno;
2237 12 : }
2238 :
2239 : /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2240 : * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2241 : *
2242 : */
2243 12 : void yy_flush_buffer (YY_BUFFER_STATE b )
2244 : {
2245 12 : if ( ! b )
2246 : return;
2247 :
2248 12 : b->yy_n_chars = 0;
2249 :
2250 : /* We always need two end-of-buffer characters. The first causes
2251 : * a transition to the end-of-buffer state. The second causes
2252 : * a jam in that state.
2253 : */
2254 12 : b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2255 12 : b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2256 :
2257 12 : b->yy_buf_pos = &b->yy_ch_buf[0];
2258 :
2259 12 : b->yy_at_bol = 1;
2260 12 : b->yy_buffer_status = YY_BUFFER_NEW;
2261 :
2262 12 : if ( b == YY_CURRENT_BUFFER )
2263 6 : yy_load_buffer_state( );
2264 : }
2265 :
2266 : /** Pushes the new state onto the stack. The new state becomes
2267 : * the current state. This function will allocate the stack
2268 : * if necessary.
2269 : * @param new_buffer The new state.
2270 : *
2271 : */
2272 0 : void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2273 : {
2274 0 : if (new_buffer == NULL)
2275 : return;
2276 :
2277 0 : yyensure_buffer_stack();
2278 :
2279 : /* This block is copied from yy_switch_to_buffer. */
2280 0 : if ( YY_CURRENT_BUFFER )
2281 : {
2282 : /* Flush out information for old buffer. */
2283 0 : *(yy_c_buf_p) = (yy_hold_char);
2284 0 : YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2285 0 : YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2286 : }
2287 :
2288 : /* Only push if top exists. Otherwise, replace top. */
2289 0 : if (YY_CURRENT_BUFFER)
2290 0 : (yy_buffer_stack_top)++;
2291 0 : YY_CURRENT_BUFFER_LVALUE = new_buffer;
2292 :
2293 : /* copied from yy_switch_to_buffer. */
2294 0 : yy_load_buffer_state( );
2295 0 : (yy_did_buffer_switch_on_eof) = 1;
2296 : }
2297 :
2298 : /** Removes and deletes the top of the stack, if present.
2299 : * The next element becomes the new top.
2300 : *
2301 : */
2302 0 : void yypop_buffer_state (void)
2303 : {
2304 0 : if (!YY_CURRENT_BUFFER)
2305 : return;
2306 :
2307 0 : yy_delete_buffer(YY_CURRENT_BUFFER );
2308 0 : YY_CURRENT_BUFFER_LVALUE = NULL;
2309 0 : if ((yy_buffer_stack_top) > 0)
2310 0 : --(yy_buffer_stack_top);
2311 :
2312 0 : if (YY_CURRENT_BUFFER) {
2313 0 : yy_load_buffer_state( );
2314 0 : (yy_did_buffer_switch_on_eof) = 1;
2315 : }
2316 : }
2317 :
2318 : /* Allocates the stack if it does not exist.
2319 : * Guarantees space for at least one push.
2320 : */
2321 6 : static void yyensure_buffer_stack (void)
2322 : {
2323 6 : yy_size_t num_to_alloc;
2324 :
2325 6 : if (!(yy_buffer_stack)) {
2326 :
2327 : /* First allocation is just for 2 elements, since we don't know if this
2328 : * scanner will even need a stack. We use 2 instead of 1 to avoid an
2329 : * immediate realloc on the next call.
2330 : */
2331 6 : num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2332 12 : (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2333 6 : (num_to_alloc * sizeof(struct yy_buffer_state*)
2334 : );
2335 6 : if ( ! (yy_buffer_stack) )
2336 0 : YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2337 :
2338 6 : memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2339 :
2340 6 : (yy_buffer_stack_max) = num_to_alloc;
2341 6 : (yy_buffer_stack_top) = 0;
2342 6 : return;
2343 : }
2344 :
2345 0 : if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2346 :
2347 : /* Increase the buffer to prepare for a possible push. */
2348 0 : yy_size_t grow_size = 8 /* arbitrary grow size */;
2349 :
2350 0 : num_to_alloc = (yy_buffer_stack_max) + grow_size;
2351 0 : (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2352 0 : ((yy_buffer_stack),
2353 : num_to_alloc * sizeof(struct yy_buffer_state*)
2354 : );
2355 0 : if ( ! (yy_buffer_stack) )
2356 0 : YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2357 :
2358 : /* zero only the new slots.*/
2359 0 : memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2360 0 : (yy_buffer_stack_max) = num_to_alloc;
2361 : }
2362 : }
2363 :
2364 : /** Setup the input buffer state to scan directly from a user-specified character buffer.
2365 : * @param base the character buffer
2366 : * @param size the size in bytes of the character buffer
2367 : *
2368 : * @return the newly allocated buffer state object.
2369 : */
2370 0 : YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2371 : {
2372 0 : YY_BUFFER_STATE b;
2373 :
2374 0 : if ( size < 2 ||
2375 0 : base[size-2] != YY_END_OF_BUFFER_CHAR ||
2376 0 : base[size-1] != YY_END_OF_BUFFER_CHAR )
2377 : /* They forgot to leave room for the EOB's. */
2378 : return NULL;
2379 :
2380 0 : b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2381 0 : if ( ! b )
2382 0 : YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2383 :
2384 0 : b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2385 0 : b->yy_buf_pos = b->yy_ch_buf = base;
2386 0 : b->yy_is_our_buffer = 0;
2387 0 : b->yy_input_file = NULL;
2388 0 : b->yy_n_chars = b->yy_buf_size;
2389 0 : b->yy_is_interactive = 0;
2390 0 : b->yy_at_bol = 1;
2391 0 : b->yy_fill_buffer = 0;
2392 0 : b->yy_buffer_status = YY_BUFFER_NEW;
2393 :
2394 0 : yy_switch_to_buffer( b );
2395 :
2396 0 : return b;
2397 : }
2398 :
2399 : /** Setup the input buffer state to scan a string. The next call to yylex() will
2400 : * scan from a @e copy of @a str.
2401 : * @param yystr a NUL-terminated string to scan
2402 : *
2403 : * @return the newly allocated buffer state object.
2404 : * @note If you want to scan bytes that may contain NUL values, then use
2405 : * yy_scan_bytes() instead.
2406 : */
2407 0 : YY_BUFFER_STATE yy_scan_string (const char * yystr )
2408 : {
2409 :
2410 0 : return yy_scan_bytes( yystr, (int) strlen(yystr) );
2411 : }
2412 :
2413 : /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2414 : * scan from a @e copy of @a bytes.
2415 : * @param yybytes the byte buffer to scan
2416 : * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2417 : *
2418 : * @return the newly allocated buffer state object.
2419 : */
2420 0 : YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
2421 : {
2422 0 : YY_BUFFER_STATE b;
2423 0 : char *buf;
2424 0 : yy_size_t n;
2425 0 : int i;
2426 :
2427 : /* Get memory for full buffer, including space for trailing EOB's. */
2428 0 : n = (yy_size_t) (_yybytes_len + 2);
2429 0 : buf = (char *) yyalloc( n );
2430 0 : if ( ! buf )
2431 0 : YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2432 :
2433 0 : for ( i = 0; i < _yybytes_len; ++i )
2434 0 : buf[i] = yybytes[i];
2435 :
2436 0 : buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2437 :
2438 0 : b = yy_scan_buffer( buf, n );
2439 0 : if ( ! b )
2440 0 : YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2441 :
2442 : /* It's okay to grow etc. this buffer, and we should throw it
2443 : * away when we're done.
2444 : */
2445 0 : b->yy_is_our_buffer = 1;
2446 :
2447 0 : return b;
2448 : }
2449 :
2450 : #ifndef YY_EXIT_FAILURE
2451 : #define YY_EXIT_FAILURE 2
2452 : #endif
2453 :
2454 0 : static void yynoreturn yy_fatal_error (const char* msg )
2455 : {
2456 0 : fprintf( stderr, "%s\n", msg );
2457 0 : exit( YY_EXIT_FAILURE );
2458 : }
2459 :
2460 : /* Redefine yyless() so it works in section 3 code. */
2461 :
2462 : #undef yyless
2463 : #define yyless(n) \
2464 : do \
2465 : { \
2466 : /* Undo effects of setting up yytext. */ \
2467 : int yyless_macro_arg = (n); \
2468 : YY_LESS_LINENO(yyless_macro_arg);\
2469 : yytext[yyleng] = (yy_hold_char); \
2470 : (yy_c_buf_p) = yytext + yyless_macro_arg; \
2471 : (yy_hold_char) = *(yy_c_buf_p); \
2472 : *(yy_c_buf_p) = '\0'; \
2473 : yyleng = yyless_macro_arg; \
2474 : } \
2475 : while ( 0 )
2476 :
2477 : /* Accessor methods (get/set functions) to struct members. */
2478 :
2479 : /** Get the current line number.
2480 : *
2481 : */
2482 0 : int yyget_lineno (void)
2483 : {
2484 :
2485 0 : return yylineno;
2486 : }
2487 :
2488 : /** Get the input stream.
2489 : *
2490 : */
2491 0 : FILE *yyget_in (void)
2492 : {
2493 0 : return yyin;
2494 : }
2495 :
2496 : /** Get the output stream.
2497 : *
2498 : */
2499 0 : FILE *yyget_out (void)
2500 : {
2501 0 : return yyout;
2502 : }
2503 :
2504 : /** Get the length of the current token.
2505 : *
2506 : */
2507 0 : int yyget_leng (void)
2508 : {
2509 0 : return yyleng;
2510 : }
2511 :
2512 : /** Get the current token.
2513 : *
2514 : */
2515 :
2516 0 : char *yyget_text (void)
2517 : {
2518 0 : return yytext;
2519 : }
2520 :
2521 : /** Set the current line number.
2522 : * @param _line_number line number
2523 : *
2524 : */
2525 0 : void yyset_lineno (int _line_number )
2526 : {
2527 :
2528 0 : yylineno = _line_number;
2529 0 : }
2530 :
2531 : /** Set the input stream. This does not discard the current
2532 : * input buffer.
2533 : * @param _in_str A readable stream.
2534 : *
2535 : * @see yy_switch_to_buffer
2536 : */
2537 0 : void yyset_in (FILE * _in_str )
2538 : {
2539 0 : yyin = _in_str ;
2540 0 : }
2541 :
2542 0 : void yyset_out (FILE * _out_str )
2543 : {
2544 0 : yyout = _out_str ;
2545 0 : }
2546 :
2547 0 : int yyget_debug (void)
2548 : {
2549 0 : return yy_flex_debug;
2550 : }
2551 :
2552 0 : void yyset_debug (int _bdebug )
2553 : {
2554 0 : yy_flex_debug = _bdebug ;
2555 0 : }
2556 :
2557 0 : static int yy_init_globals (void)
2558 : {
2559 : /* Initialization is the same as for the non-reentrant scanner.
2560 : * This function is called from yylex_destroy(), so don't allocate here.
2561 : */
2562 :
2563 0 : (yy_buffer_stack) = NULL;
2564 0 : (yy_buffer_stack_top) = 0;
2565 0 : (yy_buffer_stack_max) = 0;
2566 0 : (yy_c_buf_p) = NULL;
2567 0 : (yy_init) = 0;
2568 0 : (yy_start) = 0;
2569 :
2570 : /* Defined in main.c */
2571 : #ifdef YY_STDINIT
2572 : yyin = stdin;
2573 : yyout = stdout;
2574 : #else
2575 0 : yyin = NULL;
2576 0 : yyout = NULL;
2577 : #endif
2578 :
2579 : /* For future reference: Set errno on error, since we are called by
2580 : * yylex_init()
2581 : */
2582 0 : return 0;
2583 : }
2584 :
2585 : /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2586 0 : int yylex_destroy (void)
2587 : {
2588 :
2589 : /* Pop the buffer stack, destroying each element. */
2590 0 : while(YY_CURRENT_BUFFER){
2591 0 : yy_delete_buffer( YY_CURRENT_BUFFER );
2592 0 : YY_CURRENT_BUFFER_LVALUE = NULL;
2593 0 : yypop_buffer_state();
2594 : }
2595 :
2596 : /* Destroy the stack itself. */
2597 0 : yyfree((yy_buffer_stack) );
2598 0 : (yy_buffer_stack) = NULL;
2599 :
2600 : /* Reset the globals. This is important in a non-reentrant scanner so the next time
2601 : * yylex() is called, initialization will occur. */
2602 0 : yy_init_globals( );
2603 :
2604 0 : return 0;
2605 : }
2606 :
2607 : /*
2608 : * Internal utility routines.
2609 : */
2610 :
2611 : #ifndef yytext_ptr
2612 : static void yy_flex_strncpy (char* s1, const char * s2, int n )
2613 : {
2614 :
2615 : int i;
2616 : for ( i = 0; i < n; ++i )
2617 : s1[i] = s2[i];
2618 : }
2619 : #endif
2620 :
2621 : #ifdef YY_NEED_STRLEN
2622 : static int yy_flex_strlen (const char * s )
2623 : {
2624 : int n;
2625 : for ( n = 0; s[n]; ++n )
2626 : ;
2627 :
2628 : return n;
2629 : }
2630 : #endif
2631 :
2632 18 : void *yyalloc (yy_size_t size )
2633 : {
2634 18 : return malloc(size);
2635 : }
2636 :
2637 0 : void *yyrealloc (void * ptr, yy_size_t size )
2638 : {
2639 :
2640 : /* The cast to (char *) in the following accommodates both
2641 : * implementations that use char* generic pointers, and those
2642 : * that use void* generic pointers. It works with the latter
2643 : * because both ANSI C and C++ allow castless assignment from
2644 : * any pointer type to void*, and deal with argument conversions
2645 : * as though doing an assignment.
2646 : */
2647 0 : return realloc(ptr, size);
2648 : }
2649 :
2650 0 : void yyfree (void * ptr )
2651 : {
2652 0 : free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2653 0 : }
2654 :
2655 : #define YYTABLES_NAME "yytables"
2656 :
2657 : #line 438 "../../../../rexompiler/src/frontend/OpenFortranParser_SAGE_Connection/preproc-fortran.ll"
2658 :
2659 :
2660 : static const int maxstacksize=500;
2661 : static int bracestack[maxstacksize];
2662 :
2663 : static int top=0;
2664 : static void pushbracestack(int brace_no) { bracestack[top++]=brace_no; }
2665 : // static int topbracestack() { if(top) return bracestack[top-1]; else return -1; }
2666 : // static int popbracestack() { return bracestack[--top]; }
2667 : // static bool isemptystack() { return top==0; }
2668 :
2669 :
2670 : static int adjust_new_line_counter()
2671 : {
2672 : return 1;
2673 : }
2674 :
2675 : static int num_of_newlines(char* s)
2676 : {
2677 : int num = 0;
2678 : while(*s != '\0')
2679 : {
2680 : if(*s == '\n')
2681 : num++;
2682 : s++;
2683 : }
2684 : return num;
2685 : }
2686 :
2687 : // This function is called by AttachPreprocessingInfoTreeTrav::evaluateInheritedAttribute()
2688 : // function when the input node is a SgFile IR node.
2689 : // int getFortranFreeFormatPreprocessorDirectives( std::string fileName )
2690 : LexTokenStreamTypePointer
2691 : getFortranFreeFormatPreprocessorDirectives( std::string fileName )
2692 : {
2693 : FILE *fp = NULL;
2694 :
2695 : ROSE_Fortran_free_format_token_stream_pointer = new LexTokenStreamType;
2696 : assert(ROSE_Fortran_free_format_token_stream_pointer != NULL);
2697 :
2698 : globalFileName = fileName;
2699 :
2700 : #if 0
2701 : printf ("In getFortranFreeFormatPreprocessorDirectives(): Lexical pass to retrieve the token stream (Opening Free Format Fortran file: %s) \n",fileName.c_str());
2702 : #endif
2703 :
2704 : if(fileName.empty() == false)
2705 : {
2706 : fp = fopen(fileName.c_str(), "r");
2707 : if (fp)
2708 : {
2709 : // printf ("opened file %s\n",fileName.c_str());
2710 : // exit(0);
2711 : yyin = fp;
2712 : yylex();
2713 : fclose(fp);
2714 : }
2715 : else
2716 : {
2717 : printf ("Error: can't find the requested file (%s) \n",fileName.c_str());
2718 : }
2719 : }
2720 :
2721 : assert(ROSE_Fortran_free_format_token_stream_pointer != NULL);
2722 : return ROSE_Fortran_free_format_token_stream_pointer;
2723 : }
2724 :
2725 : void
2726 : clean_up_stream()
2727 : {
2728 : //
2729 : //This "rudimentary" post processing of the token stream helps in correct identification of keywords.
2730 :
2731 : //int e g e r
2732 : //is a sequence of identifiers
2733 : //recognize the token_ids and map them.
2734 : //If the tokens are
2735 :
2736 :
2737 : #if 0
2738 : for(SE_ITR ii = ROSE_Fortran_free_format_token_stream_pointer->begin(); ii != ROSE_Fortran_free_format_token_stream_pointer->end(); ii++)
2739 : {
2740 : if((*ii)->p_tok_elem->token_id == SgToken::FORTRAN_COMMENTS)
2741 : {
2742 : cout<<"## COMMENT -->";
2743 : cout<<(*ii)->p_tok_elem->token_lexeme;
2744 : cout<<"<-- From "<<"("<<(*ii)->beginning_fpi.line_num<<","<<(*ii)->beginning_fpi.column_num<<") to "
2745 : <<"("<<(*ii)->ending_fpi.line_num<<","<<(*ii)->ending_fpi.column_num<<")";
2746 : }
2747 : else if((*ii)->p_tok_elem->token_id == SgToken::FORTRAN_STRING_LITERALS)
2748 : {
2749 : cout<<"## STRING_LIT -->";
2750 : cout<<(*ii)->p_tok_elem->token_lexeme;
2751 : cout<<"<-- From "<<"("<<(*ii)->beginning_fpi.line_num<<","<<(*ii)->beginning_fpi.column_num<<") to "
2752 : <<"("<<(*ii)->ending_fpi.line_num<<","<<(*ii)->ending_fpi.column_num<<")";
2753 : }
2754 : else if(((*ii)->p_tok_elem->token_id > 2) && ((*ii)->p_tok_elem->token_id < 67))
2755 : {
2756 : cout<<"## KEYWORD -->";
2757 : cout<<(*ii)->p_tok_elem->token_lexeme;
2758 : cout<<"<-- From "<<"("<<(*ii)->beginning_fpi.line_num<<","<<(*ii)->beginning_fpi.column_num<<") to "
2759 : <<"("<<(*ii)->ending_fpi.line_num<<","<<(*ii)->ending_fpi.column_num<<")";
2760 : }
2761 : else if((*ii)->p_tok_elem->token_id == SgToken::FORTRAN_IDENTIFIER)
2762 : {
2763 : cout<<"## IDENTIFIER -->";
2764 : cout<<(*ii)->p_tok_elem->token_lexeme;
2765 : cout<<"<-- From "<<"("<<(*ii)->beginning_fpi.line_num<<","<<(*ii)->beginning_fpi.column_num<<") to "
2766 : <<"("<<(*ii)->ending_fpi.line_num<<","<<(*ii)->ending_fpi.column_num<<")";
2767 : }
2768 : else
2769 : {
2770 : cout<<"## ????Unrecognized element in the token stream##";
2771 : }
2772 : cout<<"\n";
2773 :
2774 : }
2775 : #endif
2776 : }
2777 :
2778 : #if 0
2779 : int main(int argc, char *argv[])
2780 : {
2781 : if(argc == 1)
2782 : { //The "default" for now
2783 : getFortranFreeFormatPreprocessorDirectives("triangle.f90");
2784 : }
2785 : else
2786 : {
2787 : getFortranFreeFormatPreprocessorDirectives(argv[1]);
2788 : }
2789 :
2790 : clean_up_stream();
2791 :
2792 : printf("*****************here is the stream *************\n");
2793 : for(SE_ITR ii = ROSE_Fortran_free_format_token_stream.begin(); ii != ROSE_Fortran_free_format_token_stream.end(); ii++)
2794 : {
2795 : if((*ii)->p_tok_elem->token_id == SgToken::FORTRAN_COMMENTS)
2796 : {
2797 : cout<<"## COMMENT -->";
2798 : cout<<(*ii)->p_tok_elem->token_lexeme;
2799 : cout<<"<-- From "<<"("<<(*ii)->beginning_fpi.line_num<<","<<(*ii)->beginning_fpi.column_num<<") to "
2800 : <<"("<<(*ii)->ending_fpi.line_num<<","<<(*ii)->ending_fpi.column_num<<")";
2801 : }
2802 : else if((*ii)->p_tok_elem->token_id == SgToken::FORTRAN_STRING_LITERALS)
2803 : {
2804 : cout<<"## STRING_LIT -->";
2805 : cout<<(*ii)->p_tok_elem->token_lexeme;
2806 : cout<<"<-- From "<<"("<<(*ii)->beginning_fpi.line_num<<","<<(*ii)->beginning_fpi.column_num<<") to "
2807 : <<"("<<(*ii)->ending_fpi.line_num<<","<<(*ii)->ending_fpi.column_num<<")";
2808 : }
2809 : else if(((*ii)->p_tok_elem->token_id > 2) && ((*ii)->p_tok_elem->token_id < 67))
2810 : {
2811 : cout<<"## KEYWORD -->";
2812 : cout<<(*ii)->p_tok_elem->token_lexeme;
2813 : cout<<"<-- From "<<"("<<(*ii)->beginning_fpi.line_num<<","<<(*ii)->beginning_fpi.column_num<<") to "
2814 : <<"("<<(*ii)->ending_fpi.line_num<<","<<(*ii)->ending_fpi.column_num<<")";
2815 : }
2816 : else if((*ii)->p_tok_elem->token_id == SgToken::FORTRAN_IDENTIFIER)
2817 : {
2818 : cout<<"## IDENTIFIER -->";
2819 : cout<<(*ii)->p_tok_elem->token_lexeme;
2820 : cout<<"<-- From "<<"("<<(*ii)->beginning_fpi.line_num<<","<<(*ii)->beginning_fpi.column_num<<") to "
2821 : <<"("<<(*ii)->ending_fpi.line_num<<","<<(*ii)->ending_fpi.column_num<<")";
2822 : }
2823 : else
2824 : {
2825 : cout<<"## ????Unrecognized element in the token stream##";
2826 : }
2827 : cout<<"\n";
2828 :
2829 : }
2830 : printf("*****************the stream is over*************\n");
2831 :
2832 : return 1;
2833 : }
2834 :
2835 : #endif
2836 : // }//This ends the namespace Rose_Fortran_free_format_namespace
2837 :
2838 :
|