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