1 /* std.c -- Implementation File (module.c template V1.0)
2 Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc.
3 Contributed by James Craig Burley.
5 This file is part of GNU Fortran.
7 GNU Fortran is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU Fortran is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU Fortran; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
26 Implements the various statements and such like.
30 Split out actual code generation to ffeste.
53 /* Externals defined here. */
56 /* Simple definitions and enumerations. */
58 #define FFESTD_COPY_EASY_ 1 /* 1 for only one _subr_copy_xyz_ fn. */
60 #define FFESTD_IS_END_OPTIMIZED_ 1 /* 0=always gen STOP/RETURN before
65 FFESTD_stateletSIMPLE_
, /* Expecting simple/start. */
66 FFESTD_stateletATTRIB_
, /* Expecting attrib/item/itemstart. */
67 FFESTD_stateletITEM_
, /* Expecting item/itemstart/finish. */
68 FFESTD_stateletITEMVALS_
, /* Expecting itemvalue/itemendvals. */
75 FFESTD_stmtidENDDOLOOP_
,
76 FFESTD_stmtidENDLOGIF_
,
77 FFESTD_stmtidEXECLABEL_
,
78 FFESTD_stmtidFORMATLABEL_
,
79 FFESTD_stmtidR737A_
, /* let */
80 FFESTD_stmtidR803_
, /* IF-block */
81 FFESTD_stmtidR804_
, /* ELSE IF */
82 FFESTD_stmtidR805_
, /* ELSE */
83 FFESTD_stmtidR806_
, /* END IF */
84 FFESTD_stmtidR807_
, /* IF-logical */
85 FFESTD_stmtidR809_
, /* SELECT CASE */
86 FFESTD_stmtidR810_
, /* CASE */
87 FFESTD_stmtidR811_
, /* END SELECT */
88 FFESTD_stmtidR819A_
, /* DO-iterative */
89 FFESTD_stmtidR819B_
, /* DO WHILE */
90 FFESTD_stmtidR825_
, /* END DO */
91 FFESTD_stmtidR834_
, /* CYCLE */
92 FFESTD_stmtidR835_
, /* EXIT */
93 FFESTD_stmtidR836_
, /* GOTO */
94 FFESTD_stmtidR837_
, /* GOTO-computed */
95 FFESTD_stmtidR838_
, /* ASSIGN */
96 FFESTD_stmtidR839_
, /* GOTO-assigned */
97 FFESTD_stmtidR840_
, /* IF-arithmetic */
98 FFESTD_stmtidR841_
, /* CONTINUE */
99 FFESTD_stmtidR842_
, /* STOP */
100 FFESTD_stmtidR843_
, /* PAUSE */
101 FFESTD_stmtidR904_
, /* OPEN */
102 FFESTD_stmtidR907_
, /* CLOSE */
103 FFESTD_stmtidR909_
, /* READ */
104 FFESTD_stmtidR910_
, /* WRITE */
105 FFESTD_stmtidR911_
, /* PRINT */
106 FFESTD_stmtidR919_
, /* BACKSPACE */
107 FFESTD_stmtidR920_
, /* ENDFILE */
108 FFESTD_stmtidR921_
, /* REWIND */
109 FFESTD_stmtidR923A_
, /* INQUIRE */
110 FFESTD_stmtidR923B_
, /* INQUIRE-iolength */
111 FFESTD_stmtidR1001_
, /* FORMAT */
112 FFESTD_stmtidR1103_
, /* END_PROGRAM */
113 FFESTD_stmtidR1112_
, /* END_BLOCK_DATA */
114 FFESTD_stmtidR1212_
, /* CALL */
115 FFESTD_stmtidR1221_
, /* END_FUNCTION */
116 FFESTD_stmtidR1225_
, /* END_SUBROUTINE */
117 FFESTD_stmtidR1226_
, /* ENTRY */
118 FFESTD_stmtidR1227_
, /* RETURN */
120 FFESTD_stmtidV018_
, /* REWRITE */
121 FFESTD_stmtidV019_
, /* ACCEPT */
123 FFESTD_stmtidV020_
, /* TYPE */
125 FFESTD_stmtidV021_
, /* DELETE */
126 FFESTD_stmtidV022_
, /* UNLOCK */
127 FFESTD_stmtidV023_
, /* ENCODE */
128 FFESTD_stmtidV024_
, /* DECODE */
129 FFESTD_stmtidV025start_
, /* DEFINEFILE (start) */
130 FFESTD_stmtidV025item_
, /* (DEFINEFILE item) */
131 FFESTD_stmtidV025finish_
, /* (DEFINEFILE finish) */
132 FFESTD_stmtidV026_
, /* FIND */
139 /* Internal typedefs. */
141 typedef struct _ffestd_expr_item_
*ffestdExprItem_
;
143 typedef struct _ffestd_stmt_
*ffestdStmt_
;
146 /* Private include files. */
149 /* Internal structure definitions. */
151 struct _ffestd_expr_item_
153 ffestdExprItem_ next
;
162 ffestdStmt_ previous
;
164 #if FFECOM_targetCURRENT == FFECOM_targetGCC
233 unsigned long casenum
;
248 ffelexToken start_token
;
250 ffelexToken end_token
;
252 ffelexToken incr_token
;
323 ffestpOpenStmt
*params
;
329 ffestpCloseStmt
*params
;
335 ffestpReadStmt
*params
;
341 ffestdExprItem_ list
;
347 ffestpWriteStmt
*params
;
351 ffestdExprItem_ list
;
357 ffestpPrintStmt
*params
;
359 ffestdExprItem_ list
;
365 ffestpBeruStmt
*params
;
371 ffestpBeruStmt
*params
;
377 ffestpBeruStmt
*params
;
383 ffestpInquireStmt
*params
;
390 ffestpInquireStmt
*params
;
391 ffestdExprItem_ list
;
422 ffestpRewriteStmt
*params
;
424 ffestdExprItem_ list
;
430 ffestpAcceptStmt
*params
;
432 ffestdExprItem_ list
;
439 ffestpTypeStmt
*params
;
441 ffestdExprItem_ list
;
448 ffestpDeleteStmt
*params
;
454 ffestpBeruStmt
*params
;
460 ffestpVxtcodeStmt
*params
;
461 ffestdExprItem_ list
;
467 ffestpVxtcodeStmt
*params
;
468 ffestdExprItem_ list
;
486 ffestpFindStmt
*params
;
496 /* Static objects accessed by functions in this module. */
498 static ffestdStatelet_ ffestd_statelet_
= FFESTD_stateletSIMPLE_
;
499 static int ffestd_block_level_
= 0; /* Block level for reachableness. */
500 static bool ffestd_is_reachable_
; /* Is the current stmt reachable? */
501 static ffelab ffestd_label_formatdef_
= NULL
;
503 static ffestdExprItem_
*ffestd_expr_list_
;
517 #if FFECOM_targetCURRENT == FFECOM_targetGCC
518 static int ffestd_2pass_entrypoints_
= 0; /* # ENTRY statements
522 /* Static functions (internal). */
525 static void ffestd_stmt_append_ (ffestdStmt_ stmt
);
526 static ffestdStmt_
ffestd_stmt_new_ (ffestdStmtId_ id
);
527 static void ffestd_stmt_pass_ (void);
529 #if FFESTD_COPY_EASY_ && FFECOM_TWOPASS
530 static ffestpInquireStmt
*ffestd_subr_copy_easy_ (ffestpInquireIx max
);
532 #if FFECOM_targetCURRENT == FFECOM_targetGCC
533 static void ffestd_subr_vxt_ (void);
536 static void ffestd_subr_f90_ (void);
538 static void ffestd_subr_labels_ (bool unexpected
);
539 static void ffestd_R1001dump_ (ffests s
, ffesttFormatList list
);
540 static void ffestd_R1001dump_1005_1_ (ffests s
, ffesttFormatList f
,
542 static void ffestd_R1001dump_1005_2_ (ffests s
, ffesttFormatList f
,
544 static void ffestd_R1001dump_1005_3_ (ffests s
, ffesttFormatList f
,
546 static void ffestd_R1001dump_1005_4_ (ffests s
, ffesttFormatList f
,
548 static void ffestd_R1001dump_1005_5_ (ffests s
, ffesttFormatList f
,
550 static void ffestd_R1001dump_1010_1_ (ffests s
, ffesttFormatList f
,
552 static void ffestd_R1001dump_1010_2_ (ffests s
, ffesttFormatList f
,
554 static void ffestd_R1001dump_1010_3_ (ffests s
, ffesttFormatList f
,
556 static void ffestd_R1001dump_1010_4_ (ffests s
, ffesttFormatList f
,
558 static void ffestd_R1001dump_1010_5_ (ffests s
, ffesttFormatList f
,
560 static void ffestd_R1001error_ (ffesttFormatList f
);
561 static void ffestd_R1001rtexpr_ (ffests s
, ffesttFormatList f
, ffebld expr
);
563 /* Internal macros. */
565 #if FFECOM_targetCURRENT == FFECOM_targetGCC
566 #define ffestd_subr_line_now_() \
567 ffeste_set_line (ffelex_token_where_filename (ffesta_tokens[0]), \
568 ffelex_token_where_filelinenum (ffesta_tokens[0]))
569 #define ffestd_subr_line_restore_(s) \
570 ffeste_set_line ((s)->filename, (s)->filelinenum)
571 #define ffestd_subr_line_save_(s) \
572 ((s)->filename = ffelex_token_where_filename (ffesta_tokens[0]), \
573 (s)->filelinenum = ffelex_token_where_filelinenum (ffesta_tokens[0]))
575 #define ffestd_subr_line_now_()
577 #define ffestd_subr_line_restore_(s)
578 #define ffestd_subr_line_save_(s)
579 #endif /* FFECOM_TWOPASS */
580 #endif /* FFECOM_targetCURRENT != FFECOM_targetGCC */
581 #define ffestd_check_simple_() \
582 assert(ffestd_statelet_ == FFESTD_stateletSIMPLE_)
583 #define ffestd_check_start_() \
584 assert(ffestd_statelet_ == FFESTD_stateletSIMPLE_); \
585 ffestd_statelet_ = FFESTD_stateletATTRIB_
586 #define ffestd_check_attrib_() \
587 assert(ffestd_statelet_ == FFESTD_stateletATTRIB_)
588 #define ffestd_check_item_() \
589 assert(ffestd_statelet_ == FFESTD_stateletATTRIB_ \
590 || ffestd_statelet_ == FFESTD_stateletITEM_); \
591 ffestd_statelet_ = FFESTD_stateletITEM_
592 #define ffestd_check_item_startvals_() \
593 assert(ffestd_statelet_ == FFESTD_stateletATTRIB_ \
594 || ffestd_statelet_ == FFESTD_stateletITEM_); \
595 ffestd_statelet_ = FFESTD_stateletITEMVALS_
596 #define ffestd_check_item_value_() \
597 assert(ffestd_statelet_ == FFESTD_stateletITEMVALS_)
598 #define ffestd_check_item_endvals_() \
599 assert(ffestd_statelet_ == FFESTD_stateletITEMVALS_); \
600 ffestd_statelet_ = FFESTD_stateletITEM_
601 #define ffestd_check_finish_() \
602 assert(ffestd_statelet_ == FFESTD_stateletATTRIB_ \
603 || ffestd_statelet_ == FFESTD_stateletITEM_); \
604 ffestd_statelet_ = FFESTD_stateletSIMPLE_
606 #if FFESTD_COPY_EASY_ && FFECOM_TWOPASS
607 #define ffestd_subr_copy_accept_() (ffestpAcceptStmt *) \
608 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_acceptix)
609 #define ffestd_subr_copy_beru_() (ffestpBeruStmt *) \
610 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_beruix)
611 #define ffestd_subr_copy_close_() (ffestpCloseStmt *) \
612 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_closeix)
613 #define ffestd_subr_copy_delete_() (ffestpDeleteStmt *) \
614 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_deleteix)
615 #define ffestd_subr_copy_find_() (ffestpFindStmt *) \
616 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_findix)
617 #define ffestd_subr_copy_inquire_() (ffestpInquireStmt *) \
618 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_inquireix)
619 #define ffestd_subr_copy_open_() (ffestpOpenStmt *) \
620 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_openix)
621 #define ffestd_subr_copy_print_() (ffestpPrintStmt *) \
622 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_printix)
623 #define ffestd_subr_copy_read_() (ffestpReadStmt *) \
624 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_readix)
625 #define ffestd_subr_copy_rewrite_() (ffestpRewriteStmt *) \
626 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_rewriteix)
627 #define ffestd_subr_copy_type_() (ffestpTypeStmt *) \
628 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_typeix)
629 #define ffestd_subr_copy_vxtcode_() (ffestpVxtcodeStmt *) \
630 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_vxtcodeix)
631 #define ffestd_subr_copy_write_() (ffestpWriteStmt *) \
632 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_writeix)
635 /* ffestd_stmt_append_ -- Append statement to end of stmt list
637 ffestd_stmt_append_(ffestd_stmt_new_(FFESTD_stmtidR737A_)); */
641 ffestd_stmt_append_ (ffestdStmt_ stmt
)
643 stmt
->next
= (ffestdStmt_
) &ffestd_stmt_list_
.first
;
644 stmt
->previous
= ffestd_stmt_list_
.last
;
645 stmt
->next
->previous
= stmt
;
646 stmt
->previous
->next
= stmt
;
650 /* ffestd_stmt_new_ -- Make new statement with given id
653 stmt = ffestd_stmt_new_(FFESTD_stmtidR737A_); */
657 ffestd_stmt_new_ (ffestdStmtId_ id
)
661 stmt
= malloc_new_kp (ffe_pool_any_unit (), "ffestdStmt_", sizeof (*stmt
));
667 /* ffestd_stmt_pass_ -- Pass all statements on list to ffeste
669 ffestd_stmt_pass_(); */
676 ffestdExprItem_ expr
; /* For traversing lists. */
677 bool okay
= (TREE_CODE (current_function_decl
) != ERROR_MARK
);
679 #if FFECOM_targetCURRENT == FFECOM_targetGCC
680 if ((ffestd_2pass_entrypoints_
!= 0) && okay
)
682 tree which
= ffecom_which_entrypoint_decl ();
686 int ents
= ffestd_2pass_entrypoints_
;
689 expand_start_case (0, which
, TREE_TYPE (which
), "entrypoint dispatch");
691 stmt
= ffestd_stmt_list_
.first
;
694 while (stmt
->id
!= FFESTD_stmtidR1226_
)
697 if (stmt
->u
.R1226
.entry
!= NULL
)
699 value
= build_int_2 (stmt
->u
.R1226
.entrynum
, 0);
700 /* Yes, we really want to build a null LABEL_DECL here and not
701 put it on any list. That's what pushcase wants, so that's
703 label
= build_decl (LABEL_DECL
, NULL_TREE
, NULL_TREE
);
705 pushok
= pushcase (value
, convert
, label
, &duplicate
);
706 assert (pushok
== 0);
708 label
= ffecom_temp_label ();
709 TREE_USED (label
) = 1;
712 ffesymbol_hook (stmt
->u
.R1226
.entry
).length_tree
= label
;
718 expand_end_case (which
);
722 for (stmt
= ffestd_stmt_list_
.first
;
723 stmt
!= (ffestdStmt_
) &ffestd_stmt_list_
.first
;
728 case FFESTD_stmtidENDDOLOOP_
:
729 ffestd_subr_line_restore_ (stmt
);
731 ffeste_do (stmt
->u
.enddoloop
.block
);
732 ffestw_kill (stmt
->u
.enddoloop
.block
);
735 case FFESTD_stmtidENDLOGIF_
:
736 ffestd_subr_line_restore_ (stmt
);
741 case FFESTD_stmtidEXECLABEL_
:
743 ffeste_labeldef_branch (stmt
->u
.execlabel
.label
);
746 case FFESTD_stmtidFORMATLABEL_
:
748 ffeste_labeldef_format (stmt
->u
.formatlabel
.label
);
751 case FFESTD_stmtidR737A_
:
752 ffestd_subr_line_restore_ (stmt
);
754 ffeste_R737A (stmt
->u
.R737A
.dest
, stmt
->u
.R737A
.source
);
755 malloc_pool_kill (stmt
->u
.R737A
.pool
);
758 case FFESTD_stmtidR803_
:
759 ffestd_subr_line_restore_ (stmt
);
761 ffeste_R803 (stmt
->u
.R803
.block
, stmt
->u
.R803
.expr
);
762 malloc_pool_kill (stmt
->u
.R803
.pool
);
765 case FFESTD_stmtidR804_
:
766 ffestd_subr_line_restore_ (stmt
);
768 ffeste_R804 (stmt
->u
.R803
.block
, stmt
->u
.R804
.expr
);
769 malloc_pool_kill (stmt
->u
.R804
.pool
);
772 case FFESTD_stmtidR805_
:
773 ffestd_subr_line_restore_ (stmt
);
775 ffeste_R805 (stmt
->u
.R803
.block
);
778 case FFESTD_stmtidR806_
:
779 ffestd_subr_line_restore_ (stmt
);
781 ffeste_R806 (stmt
->u
.R806
.block
);
782 ffestw_kill (stmt
->u
.R806
.block
);
785 case FFESTD_stmtidR807_
:
786 ffestd_subr_line_restore_ (stmt
);
788 ffeste_R807 (stmt
->u
.R807
.expr
);
789 malloc_pool_kill (stmt
->u
.R807
.pool
);
792 case FFESTD_stmtidR809_
:
793 ffestd_subr_line_restore_ (stmt
);
795 ffeste_R809 (stmt
->u
.R809
.block
, stmt
->u
.R809
.expr
);
796 malloc_pool_kill (stmt
->u
.R809
.pool
);
799 case FFESTD_stmtidR810_
:
800 ffestd_subr_line_restore_ (stmt
);
802 ffeste_R810 (stmt
->u
.R810
.block
, stmt
->u
.R810
.casenum
);
803 malloc_pool_kill (stmt
->u
.R810
.pool
);
806 case FFESTD_stmtidR811_
:
807 ffestd_subr_line_restore_ (stmt
);
809 ffeste_R811 (stmt
->u
.R811
.block
);
810 malloc_pool_kill (ffestw_select (stmt
->u
.R811
.block
)->pool
);
811 ffestw_kill (stmt
->u
.R811
.block
);
814 case FFESTD_stmtidR819A_
:
815 ffestd_subr_line_restore_ (stmt
);
817 ffeste_R819A (stmt
->u
.R819A
.block
, stmt
->u
.R819A
.label
,
819 stmt
->u
.R819A
.start
, stmt
->u
.R819A
.start_token
,
820 stmt
->u
.R819A
.end
, stmt
->u
.R819A
.end_token
,
821 stmt
->u
.R819A
.incr
, stmt
->u
.R819A
.incr_token
);
822 ffelex_token_kill (stmt
->u
.R819A
.start_token
);
823 ffelex_token_kill (stmt
->u
.R819A
.end_token
);
824 if (stmt
->u
.R819A
.incr_token
!= NULL
)
825 ffelex_token_kill (stmt
->u
.R819A
.incr_token
);
826 malloc_pool_kill (stmt
->u
.R819A
.pool
);
829 case FFESTD_stmtidR819B_
:
830 ffestd_subr_line_restore_ (stmt
);
832 ffeste_R819B (stmt
->u
.R819B
.block
, stmt
->u
.R819B
.label
,
834 malloc_pool_kill (stmt
->u
.R819B
.pool
);
837 case FFESTD_stmtidR825_
:
838 ffestd_subr_line_restore_ (stmt
);
843 case FFESTD_stmtidR834_
:
844 ffestd_subr_line_restore_ (stmt
);
846 ffeste_R834 (stmt
->u
.R834
.block
);
849 case FFESTD_stmtidR835_
:
850 ffestd_subr_line_restore_ (stmt
);
852 ffeste_R835 (stmt
->u
.R835
.block
);
855 case FFESTD_stmtidR836_
:
856 ffestd_subr_line_restore_ (stmt
);
858 ffeste_R836 (stmt
->u
.R836
.label
);
861 case FFESTD_stmtidR837_
:
862 ffestd_subr_line_restore_ (stmt
);
864 ffeste_R837 (stmt
->u
.R837
.labels
, stmt
->u
.R837
.count
,
866 malloc_pool_kill (stmt
->u
.R837
.pool
);
869 case FFESTD_stmtidR838_
:
870 ffestd_subr_line_restore_ (stmt
);
872 ffeste_R838 (stmt
->u
.R838
.label
, stmt
->u
.R838
.target
);
873 malloc_pool_kill (stmt
->u
.R838
.pool
);
876 case FFESTD_stmtidR839_
:
877 ffestd_subr_line_restore_ (stmt
);
879 ffeste_R839 (stmt
->u
.R839
.target
);
880 malloc_pool_kill (stmt
->u
.R839
.pool
);
883 case FFESTD_stmtidR840_
:
884 ffestd_subr_line_restore_ (stmt
);
886 ffeste_R840 (stmt
->u
.R840
.expr
, stmt
->u
.R840
.neg
, stmt
->u
.R840
.zero
,
888 malloc_pool_kill (stmt
->u
.R840
.pool
);
891 case FFESTD_stmtidR841_
:
892 ffestd_subr_line_restore_ (stmt
);
897 case FFESTD_stmtidR842_
:
898 ffestd_subr_line_restore_ (stmt
);
900 ffeste_R842 (stmt
->u
.R842
.expr
);
901 if (stmt
->u
.R842
.pool
!= NULL
)
902 malloc_pool_kill (stmt
->u
.R842
.pool
);
905 case FFESTD_stmtidR843_
:
906 ffestd_subr_line_restore_ (stmt
);
908 ffeste_R843 (stmt
->u
.R843
.expr
);
909 malloc_pool_kill (stmt
->u
.R843
.pool
);
912 case FFESTD_stmtidR904_
:
913 ffestd_subr_line_restore_ (stmt
);
915 ffeste_R904 (stmt
->u
.R904
.params
);
916 malloc_pool_kill (stmt
->u
.R904
.pool
);
919 case FFESTD_stmtidR907_
:
920 ffestd_subr_line_restore_ (stmt
);
922 ffeste_R907 (stmt
->u
.R907
.params
);
923 malloc_pool_kill (stmt
->u
.R907
.pool
);
926 case FFESTD_stmtidR909_
:
927 ffestd_subr_line_restore_ (stmt
);
929 ffeste_R909_start (stmt
->u
.R909
.params
, stmt
->u
.R909
.only_format
,
930 stmt
->u
.R909
.unit
, stmt
->u
.R909
.format
,
931 stmt
->u
.R909
.rec
, stmt
->u
.R909
.key
);
932 for (expr
= stmt
->u
.R909
.list
; expr
!= NULL
; expr
= expr
->next
)
935 ffeste_R909_item (expr
->expr
, expr
->token
);
936 ffelex_token_kill (expr
->token
);
939 ffeste_R909_finish ();
940 malloc_pool_kill (stmt
->u
.R909
.pool
);
943 case FFESTD_stmtidR910_
:
944 ffestd_subr_line_restore_ (stmt
);
946 ffeste_R910_start (stmt
->u
.R910
.params
, stmt
->u
.R910
.unit
,
947 stmt
->u
.R910
.format
, stmt
->u
.R910
.rec
);
948 for (expr
= stmt
->u
.R910
.list
; expr
!= NULL
; expr
= expr
->next
)
951 ffeste_R910_item (expr
->expr
, expr
->token
);
952 ffelex_token_kill (expr
->token
);
955 ffeste_R910_finish ();
956 malloc_pool_kill (stmt
->u
.R910
.pool
);
959 case FFESTD_stmtidR911_
:
960 ffestd_subr_line_restore_ (stmt
);
962 ffeste_R911_start (stmt
->u
.R911
.params
, stmt
->u
.R911
.format
);
963 for (expr
= stmt
->u
.R911
.list
; expr
!= NULL
; expr
= expr
->next
)
966 ffeste_R911_item (expr
->expr
, expr
->token
);
967 ffelex_token_kill (expr
->token
);
970 ffeste_R911_finish ();
971 malloc_pool_kill (stmt
->u
.R911
.pool
);
974 case FFESTD_stmtidR919_
:
975 ffestd_subr_line_restore_ (stmt
);
977 ffeste_R919 (stmt
->u
.R919
.params
);
978 malloc_pool_kill (stmt
->u
.R919
.pool
);
981 case FFESTD_stmtidR920_
:
982 ffestd_subr_line_restore_ (stmt
);
984 ffeste_R920 (stmt
->u
.R920
.params
);
985 malloc_pool_kill (stmt
->u
.R920
.pool
);
988 case FFESTD_stmtidR921_
:
989 ffestd_subr_line_restore_ (stmt
);
991 ffeste_R921 (stmt
->u
.R921
.params
);
992 malloc_pool_kill (stmt
->u
.R921
.pool
);
995 case FFESTD_stmtidR923A_
:
996 ffestd_subr_line_restore_ (stmt
);
998 ffeste_R923A (stmt
->u
.R923A
.params
, stmt
->u
.R923A
.by_file
);
999 malloc_pool_kill (stmt
->u
.R923A
.pool
);
1002 case FFESTD_stmtidR923B_
:
1003 ffestd_subr_line_restore_ (stmt
);
1005 ffeste_R923B_start (stmt
->u
.R923B
.params
);
1006 for (expr
= stmt
->u
.R923B
.list
; expr
!= NULL
; expr
= expr
->next
)
1009 ffeste_R923B_item (expr
->expr
);
1012 ffeste_R923B_finish ();
1013 malloc_pool_kill (stmt
->u
.R923B
.pool
);
1016 case FFESTD_stmtidR1001_
:
1018 ffeste_R1001 (&stmt
->u
.R1001
.str
);
1019 ffests_kill (&stmt
->u
.R1001
.str
);
1022 case FFESTD_stmtidR1103_
:
1027 case FFESTD_stmtidR1112_
:
1032 case FFESTD_stmtidR1212_
:
1033 ffestd_subr_line_restore_ (stmt
);
1035 ffeste_R1212 (stmt
->u
.R1212
.expr
);
1036 malloc_pool_kill (stmt
->u
.R1212
.pool
);
1039 case FFESTD_stmtidR1221_
:
1044 case FFESTD_stmtidR1225_
:
1049 case FFESTD_stmtidR1226_
:
1050 ffestd_subr_line_restore_ (stmt
);
1051 if (stmt
->u
.R1226
.entry
!= NULL
)
1054 ffeste_R1226 (stmt
->u
.R1226
.entry
);
1058 case FFESTD_stmtidR1227_
:
1059 ffestd_subr_line_restore_ (stmt
);
1061 ffeste_R1227 (stmt
->u
.R1227
.block
, stmt
->u
.R1227
.expr
);
1062 malloc_pool_kill (stmt
->u
.R1227
.pool
);
1066 case FFESTD_stmtidV018_
:
1067 ffestd_subr_line_restore_ (stmt
);
1069 ffeste_V018_start (stmt
->u
.V018
.params
, stmt
->u
.V018
.format
);
1070 for (expr
= stmt
->u
.V018
.list
; expr
!= NULL
; expr
= expr
->next
)
1073 ffeste_V018_item (expr
->expr
);
1076 ffeste_V018_finish ();
1077 malloc_pool_kill (stmt
->u
.V018
.pool
);
1080 case FFESTD_stmtidV019_
:
1081 ffestd_subr_line_restore_ (stmt
);
1083 ffeste_V019_start (stmt
->u
.V019
.params
, stmt
->u
.V019
.format
);
1084 for (expr
= stmt
->u
.V019
.list
; expr
!= NULL
; expr
= expr
->next
)
1087 ffeste_V019_item (expr
->expr
);
1090 ffeste_V019_finish ();
1091 malloc_pool_kill (stmt
->u
.V019
.pool
);
1095 case FFESTD_stmtidV020_
:
1096 ffestd_subr_line_restore_ (stmt
);
1098 ffeste_V020_start (stmt
->u
.V020
.params
, stmt
->u
.V020
.format
);
1099 for (expr
= stmt
->u
.V020
.list
; expr
!= NULL
; expr
= expr
->next
)
1102 ffeste_V020_item (expr
->expr
);
1105 ffeste_V020_finish ();
1106 malloc_pool_kill (stmt
->u
.V020
.pool
);
1110 case FFESTD_stmtidV021_
:
1111 ffestd_subr_line_restore_ (stmt
);
1113 ffeste_V021 (stmt
->u
.V021
.params
);
1114 malloc_pool_kill (stmt
->u
.V021
.pool
);
1117 case FFESTD_stmtidV023_
:
1118 ffestd_subr_line_restore_ (stmt
);
1120 ffeste_V023_start (stmt
->u
.V023
.params
);
1121 for (expr
= stmt
->u
.V023
.list
; expr
!= NULL
; expr
= expr
->next
)
1124 ffeste_V023_item (expr
->expr
);
1127 ffeste_V023_finish ();
1128 malloc_pool_kill (stmt
->u
.V023
.pool
);
1131 case FFESTD_stmtidV024_
:
1132 ffestd_subr_line_restore_ (stmt
);
1134 ffeste_V024_start (stmt
->u
.V024
.params
);
1135 for (expr
= stmt
->u
.V024
.list
; expr
!= NULL
; expr
= expr
->next
)
1138 ffeste_V024_item (expr
->expr
);
1141 ffeste_V024_finish ();
1142 malloc_pool_kill (stmt
->u
.V024
.pool
);
1145 case FFESTD_stmtidV025start_
:
1146 ffestd_subr_line_restore_ (stmt
);
1148 ffeste_V025_start ();
1151 case FFESTD_stmtidV025item_
:
1153 ffeste_V025_item (stmt
->u
.V025item
.u
, stmt
->u
.V025item
.m
,
1154 stmt
->u
.V025item
.n
, stmt
->u
.V025item
.asv
);
1157 case FFESTD_stmtidV025finish_
:
1159 ffeste_V025_finish ();
1160 malloc_pool_kill (stmt
->u
.V025finish
.pool
);
1163 case FFESTD_stmtidV026_
:
1164 ffestd_subr_line_restore_ (stmt
);
1166 ffeste_V026 (stmt
->u
.V026
.params
);
1167 malloc_pool_kill (stmt
->u
.V026
.pool
);
1172 assert ("bad stmt->id" == NULL
);
1179 /* ffestd_subr_copy_easy_ -- Copy I/O statement data structure
1181 ffestd_subr_copy_easy_();
1183 Copies all data except tokens in the I/O data structure into a new
1184 structure that lasts as long as the output pool for the current
1185 statement. Assumes that they are
1186 overlaid with each other (union) in stp.h and the typing
1187 and structure references assume (though not necessarily dangerous if
1188 FALSE) that INQUIRE has the most file elements. */
1190 #if FFESTD_COPY_EASY_ && FFECOM_TWOPASS
1191 static ffestpInquireStmt
*
1192 ffestd_subr_copy_easy_ (ffestpInquireIx max
)
1194 ffestpInquireStmt
*stmt
;
1197 stmt
= (ffestpInquireStmt
*) malloc_new_kp (ffesta_output_pool
,
1198 "FFESTD easy", sizeof (ffestpFile
) * max
);
1200 for (ix
= 0; ix
< max
; ++ix
)
1202 if ((stmt
->inquire_spec
[ix
].kw_or_val_present
1203 = ffestp_file
.inquire
.inquire_spec
[ix
].kw_or_val_present
)
1204 && (stmt
->inquire_spec
[ix
].value_present
1205 = ffestp_file
.inquire
.inquire_spec
[ix
].value_present
))
1207 if ((stmt
->inquire_spec
[ix
].value_is_label
1208 = ffestp_file
.inquire
.inquire_spec
[ix
].value_is_label
))
1209 stmt
->inquire_spec
[ix
].u
.label
1210 = ffestp_file
.inquire
.inquire_spec
[ix
].u
.label
;
1212 stmt
->inquire_spec
[ix
].u
.expr
1213 = ffestp_file
.inquire
.inquire_spec
[ix
].u
.expr
;
1221 /* ffestd_subr_labels_ -- Handle any undefined labels
1223 ffestd_subr_labels_(FALSE);
1225 For every undefined label, generate an error message and either define
1226 label as a FORMAT() statement (for FORMAT labels) or as a STOP statement
1227 (for all other labels). */
1230 ffestd_subr_labels_ (bool unexpected
)
1237 undef
= ffelab_number () - ffestv_num_label_defines_
;
1239 for (h
= ffelab_handle_first (); h
!= NULL
; h
= ffelab_handle_next (h
))
1241 l
= ffelab_handle_target (h
);
1242 if (ffewhere_line_is_unknown (ffelab_definition_line (l
)))
1243 { /* Undefined label. */
1244 assert (!unexpected
);
1247 ffebad_start (FFEBAD_UNDEF_LABEL
);
1248 if (ffelab_type (l
) == FFELAB_typeLOOPEND
)
1249 ffebad_here (0, ffelab_doref_line (l
), ffelab_doref_column (l
));
1250 else if (ffelab_type (l
) != FFELAB_typeANY
)
1251 ffebad_here (0, ffelab_firstref_line (l
), ffelab_firstref_column (l
));
1252 else if (!ffewhere_line_is_unknown (ffelab_firstref_line (l
)))
1253 ffebad_here (0, ffelab_firstref_line (l
), ffelab_firstref_column (l
));
1254 else if (!ffewhere_line_is_unknown (ffelab_doref_line (l
)))
1255 ffebad_here (0, ffelab_doref_line (l
), ffelab_doref_column (l
));
1257 ffebad_here (0, ffelab_definition_line (l
), ffelab_definition_column (l
));
1260 switch (ffelab_type (l
))
1262 case FFELAB_typeFORMAT
:
1263 ffelab_set_definition_line (l
,
1264 ffewhere_line_use (ffelab_firstref_line (l
)));
1265 ffelab_set_definition_column (l
,
1266 ffewhere_column_use (ffelab_firstref_column (l
)));
1267 ffestv_num_label_defines_
++;
1268 f
= ffestt_formatlist_create (NULL
, NULL
);
1269 ffestd_labeldef_format (l
);
1271 ffestt_formatlist_kill (f
);
1274 case FFELAB_typeASSIGNABLE
:
1275 ffelab_set_definition_line (l
,
1276 ffewhere_line_use (ffelab_firstref_line (l
)));
1277 ffelab_set_definition_column (l
,
1278 ffewhere_column_use (ffelab_firstref_column (l
)));
1279 ffestv_num_label_defines_
++;
1280 ffelab_set_type (l
, FFELAB_typeNOTLOOP
);
1281 ffelab_set_blocknum (l
, ffestw_blocknum (ffestw_stack_top ()));
1282 ffestd_labeldef_notloop (l
);
1286 case FFELAB_typeNOTLOOP
:
1287 ffelab_set_definition_line (l
,
1288 ffewhere_line_use (ffelab_firstref_line (l
)));
1289 ffelab_set_definition_column (l
,
1290 ffewhere_column_use (ffelab_firstref_column (l
)));
1291 ffestv_num_label_defines_
++;
1292 ffelab_set_blocknum (l
, ffestw_blocknum (ffestw_stack_top ()));
1293 ffestd_labeldef_notloop (l
);
1298 assert ("bad label type" == NULL
);
1300 case FFELAB_typeUNKNOWN
:
1301 case FFELAB_typeANY
:
1306 ffelab_handle_done (h
);
1307 assert (undef
== 0);
1310 /* ffestd_subr_f90_ -- Report error about lack of full F90 support
1312 ffestd_subr_f90_(); */
1318 ffebad_start (FFEBAD_F90
);
1319 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
1320 ffelex_token_where_column (ffesta_tokens
[0]));
1325 /* ffestd_subr_vxt_ -- Report error about lack of full VXT support
1327 ffestd_subr_vxt_(); */
1329 #if FFECOM_targetCURRENT == FFECOM_targetGCC
1333 ffebad_start (FFEBAD_VXT_UNSUPPORTED
);
1334 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
1335 ffelex_token_where_column (ffesta_tokens
[0]));
1340 /* ffestd_begin_uses -- Start a bunch of USE statements
1342 ffestd_begin_uses();
1344 Invoked before handling the first USE statement in a block of one or
1345 more USE statements. _end_uses_(bool ok) is invoked before handling
1346 the first statement after the block (there are no BEGIN USE and END USE
1347 statements, but the semantics of USE statements effectively requires
1348 handling them as a single block rather than one statement at a time). */
1351 ffestd_begin_uses ()
1353 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1354 fputs ("; begin_uses\n", dmpout
);
1355 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1361 /* ffestd_do -- End of statement following DO-term-stmt etc
1365 Also invoked by _labeldef_branch_finish_ (or, in cases
1366 of errors, other _labeldef_ functions) when the label definition is
1367 for a DO-target (LOOPEND) label, once per matching/outstanding DO
1368 block on the stack. These cases invoke this function with ok==TRUE, so
1369 only forced stack popping (via ffestd_eof_()) invokes it with ok==FALSE. */
1372 ffestd_do (bool ok UNUSED
)
1375 ffestd_subr_line_now_ ();
1376 ffeste_do (ffestw_stack_top ());
1381 stmt
= ffestd_stmt_new_ (FFESTD_stmtidENDDOLOOP_
);
1382 ffestd_stmt_append_ (stmt
);
1383 ffestd_subr_line_save_ (stmt
);
1384 stmt
->u
.enddoloop
.block
= ffestw_stack_top ();
1388 --ffestd_block_level_
;
1389 assert (ffestd_block_level_
>= 0);
1392 /* ffestd_end_uses -- End a bunch of USE statements
1394 ffestd_end_uses(TRUE);
1396 ok==TRUE means simply not popping due to ffestd_eof_()
1397 being called, because there is no formal END USES statement in Fortran. */
1401 ffestd_end_uses (bool ok
)
1403 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1404 fputs ("; end_uses\n", dmpout
);
1405 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1411 /* ffestd_end_R740 -- End a WHERE(-THEN)
1413 ffestd_end_R740(TRUE); */
1416 ffestd_end_R740 (bool ok
)
1422 /* ffestd_end_R807 -- End of statement following logical IF
1424 ffestd_end_R807(TRUE);
1426 Applies ONLY to logical IF, not to IF-THEN. For example, does not
1427 ffelex_token_kill the construct name for an IF-THEN block (the name
1428 field is invalid for logical IF). ok==TRUE iff statement following
1429 logical IF (substatement) is valid; else, statement is invalid or
1430 stack forcibly popped due to ffestd_eof_(). */
1433 ffestd_end_R807 (bool ok UNUSED
)
1436 ffestd_subr_line_now_ ();
1442 stmt
= ffestd_stmt_new_ (FFESTD_stmtidENDLOGIF_
);
1443 ffestd_stmt_append_ (stmt
);
1444 ffestd_subr_line_save_ (stmt
);
1448 --ffestd_block_level_
;
1449 assert (ffestd_block_level_
>= 0);
1452 /* ffestd_exec_begin -- Executable statements can start coming in now
1454 ffestd_exec_begin(); */
1457 ffestd_exec_begin ()
1459 ffecom_exec_transition ();
1461 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1462 fputs ("{ begin_exec\n", dmpout
);
1465 #if FFECOM_targetCURRENT == FFECOM_targetGCC
1466 if (ffestd_2pass_entrypoints_
!= 0)
1467 { /* Process pending ENTRY statements now that
1470 int ents
= ffestd_2pass_entrypoints_
;
1472 stmt
= ffestd_stmt_list_
.first
;
1475 while (stmt
->id
!= FFESTD_stmtidR1226_
)
1478 if (!ffecom_2pass_advise_entrypoint (stmt
->u
.R1226
.entry
))
1480 stmt
->u
.R1226
.entry
= NULL
;
1481 --ffestd_2pass_entrypoints_
;
1485 while (--ents
!= 0);
1490 /* ffestd_exec_end -- Executable statements can no longer come in now
1492 ffestd_exec_end(); */
1497 #if FFECOM_targetCURRENT == FFECOM_targetGCC
1498 int old_lineno
= lineno
;
1499 const char *old_input_filename
= input_filename
;
1502 ffecom_end_transition ();
1505 ffestd_stmt_pass_ ();
1508 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1509 fputs ("} end_exec\n", dmpout
);
1510 fputs ("> end_unit\n", dmpout
);
1513 #if FFECOM_targetCURRENT == FFECOM_targetGCC
1514 ffecom_finish_progunit ();
1516 if (ffestd_2pass_entrypoints_
!= 0)
1518 int ents
= ffestd_2pass_entrypoints_
;
1519 ffestdStmt_ stmt
= ffestd_stmt_list_
.first
;
1523 while (stmt
->id
!= FFESTD_stmtidR1226_
)
1526 if (stmt
->u
.R1226
.entry
!= NULL
)
1528 ffestd_subr_line_restore_ (stmt
);
1529 ffecom_2pass_do_entrypoint (stmt
->u
.R1226
.entry
);
1533 while (--ents
!= 0);
1536 ffestd_stmt_list_
.first
= NULL
;
1537 ffestd_stmt_list_
.last
= NULL
;
1538 ffestd_2pass_entrypoints_
= 0;
1540 lineno
= old_lineno
;
1541 input_filename
= old_input_filename
;
1545 /* ffestd_init_3 -- Initialize for any program unit
1553 ffestd_stmt_list_
.first
= (ffestdStmt_
) &ffestd_stmt_list_
.first
;
1554 ffestd_stmt_list_
.last
= (ffestdStmt_
) &ffestd_stmt_list_
.first
;
1558 /* Generate "code" for "any" label def. */
1561 ffestd_labeldef_any (ffelab label UNUSED
)
1563 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1564 fprintf (dmpout
, "; any_label_def %lu\n", ffelab_value (label
));
1565 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1571 /* ffestd_labeldef_branch -- Generate "code" for branch label def
1573 ffestd_labeldef_branch(label); */
1576 ffestd_labeldef_branch (ffelab label
)
1579 ffeste_labeldef_branch (label
);
1584 stmt
= ffestd_stmt_new_ (FFESTD_stmtidEXECLABEL_
);
1585 ffestd_stmt_append_ (stmt
);
1586 stmt
->u
.execlabel
.label
= label
;
1590 ffestd_is_reachable_
= TRUE
;
1593 /* ffestd_labeldef_format -- Generate "code" for FORMAT label def
1595 ffestd_labeldef_format(label); */
1598 ffestd_labeldef_format (ffelab label
)
1600 ffestd_label_formatdef_
= label
;
1603 ffeste_labeldef_format (label
);
1608 stmt
= ffestd_stmt_new_ (FFESTD_stmtidFORMATLABEL_
);
1610 /* Don't bother with this. See FORMAT statement. */
1611 /* Prepend FORMAT label instead of appending it, so all the
1612 FORMAT label/statement pairs end up at the top of the list.
1613 This helps ensure all decls for a block (in the GBE) are
1614 known before any executable statements are generated. */
1615 stmt
->previous
= (ffestdStmt_
) &ffestd_stmt_list_
.first
;
1616 stmt
->next
= ffestd_stmt_list_
.first
;
1617 stmt
->next
->previous
= stmt
;
1618 stmt
->previous
->next
= stmt
;
1620 ffestd_stmt_append_ (stmt
);
1622 stmt
->u
.formatlabel
.label
= label
;
1627 /* ffestd_labeldef_useless -- Generate "code" for useless label def
1629 ffestd_labeldef_useless(label); */
1632 ffestd_labeldef_useless (ffelab label UNUSED
)
1634 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1635 fprintf (dmpout
, "; useless_label_def %lu\n", ffelab_value (label
));
1636 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1642 /* ffestd_R423A -- PRIVATE statement (in R422 derived-type statement)
1650 ffestd_check_simple_ ();
1652 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1653 fputs ("* PRIVATE_derived_type\n", dmpout
);
1654 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1660 /* ffestd_R423B -- SEQUENCE statement (in R422 derived-type-stmt)
1667 ffestd_check_simple_ ();
1669 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1670 fputs ("* SEQUENCE_derived_type\n", dmpout
);
1671 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1677 /* ffestd_R424 -- derived-TYPE-def statement
1679 ffestd_R424(access_token,access_kw,name_token);
1681 Handle a derived-type definition. */
1684 ffestd_R424 (ffelexToken access
, ffestrOther access_kw
, ffelexToken name
)
1686 ffestd_check_simple_ ();
1688 ffestd_subr_f90_ ();
1695 fprintf (dmpout
, "* TYPE %s\n", ffelex_token_text (name
));
1700 case FFESTR_otherPUBLIC
:
1704 case FFESTR_otherPRIVATE
:
1711 fprintf (dmpout
, "* TYPE,%s: %s\n", a
, ffelex_token_text (name
));
1716 /* ffestd_R425 -- End a TYPE
1718 ffestd_R425(TRUE); */
1721 ffestd_R425 (bool ok
)
1723 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1724 fprintf (dmpout
, "* END_TYPE %s\n", ffelex_token_text (ffestw_name (ffestw_stack_top ())));
1725 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1731 /* ffestd_R519_start -- INTENT statement list begin
1733 ffestd_R519_start();
1735 Verify that INTENT is valid here, and begin accepting items in the list. */
1738 ffestd_R519_start (ffestrOther intent_kw
)
1740 ffestd_check_start_ ();
1742 ffestd_subr_f90_ ();
1750 case FFESTR_otherIN
:
1754 case FFESTR_otherOUT
:
1758 case FFESTR_otherINOUT
:
1765 fprintf (dmpout
, "* INTENT (%s) ", a
);
1769 /* ffestd_R519_item -- INTENT statement for name
1771 ffestd_R519_item(name_token);
1773 Make sure name_token identifies a valid object to be INTENTed. */
1776 ffestd_R519_item (ffelexToken name
)
1778 ffestd_check_item_ ();
1783 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
1787 /* ffestd_R519_finish -- INTENT statement list complete
1789 ffestd_R519_finish();
1791 Just wrap up any local activities. */
1794 ffestd_R519_finish ()
1796 ffestd_check_finish_ ();
1801 fputc ('\n', dmpout
);
1805 /* ffestd_R520_start -- OPTIONAL statement list begin
1807 ffestd_R520_start();
1809 Verify that OPTIONAL is valid here, and begin accepting items in the list. */
1812 ffestd_R520_start ()
1814 ffestd_check_start_ ();
1816 ffestd_subr_f90_ ();
1820 fputs ("* OPTIONAL ", dmpout
);
1824 /* ffestd_R520_item -- OPTIONAL statement for name
1826 ffestd_R520_item(name_token);
1828 Make sure name_token identifies a valid object to be OPTIONALed. */
1831 ffestd_R520_item (ffelexToken name
)
1833 ffestd_check_item_ ();
1838 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
1842 /* ffestd_R520_finish -- OPTIONAL statement list complete
1844 ffestd_R520_finish();
1846 Just wrap up any local activities. */
1849 ffestd_R520_finish ()
1851 ffestd_check_finish_ ();
1856 fputc ('\n', dmpout
);
1860 /* ffestd_R521A -- PUBLIC statement
1864 Verify that PUBLIC is valid here. */
1869 ffestd_check_simple_ ();
1871 ffestd_subr_f90_ ();
1875 fputs ("* PUBLIC\n", dmpout
);
1879 /* ffestd_R521Astart -- PUBLIC statement list begin
1881 ffestd_R521Astart();
1883 Verify that PUBLIC is valid here, and begin accepting items in the list. */
1886 ffestd_R521Astart ()
1888 ffestd_check_start_ ();
1890 ffestd_subr_f90_ ();
1894 fputs ("* PUBLIC ", dmpout
);
1898 /* ffestd_R521Aitem -- PUBLIC statement for name
1900 ffestd_R521Aitem(name_token);
1902 Make sure name_token identifies a valid object to be PUBLICed. */
1905 ffestd_R521Aitem (ffelexToken name
)
1907 ffestd_check_item_ ();
1912 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
1916 /* ffestd_R521Afinish -- PUBLIC statement list complete
1918 ffestd_R521Afinish();
1920 Just wrap up any local activities. */
1923 ffestd_R521Afinish ()
1925 ffestd_check_finish_ ();
1930 fputc ('\n', dmpout
);
1934 /* ffestd_R521B -- PRIVATE statement
1938 Verify that PRIVATE is valid here (outside a derived-type statement). */
1943 ffestd_check_simple_ ();
1945 ffestd_subr_f90_ ();
1949 fputs ("* PRIVATE_outside_of_R422_derived_type_def\n", dmpout
);
1953 /* ffestd_R521Bstart -- PRIVATE statement list begin
1955 ffestd_R521Bstart();
1957 Verify that PRIVATE is valid here, and begin accepting items in the list. */
1960 ffestd_R521Bstart ()
1962 ffestd_check_start_ ();
1964 ffestd_subr_f90_ ();
1968 fputs ("* PRIVATE ", dmpout
);
1972 /* ffestd_R521Bitem -- PRIVATE statement for name
1974 ffestd_R521Bitem(name_token);
1976 Make sure name_token identifies a valid object to be PRIVATEed. */
1979 ffestd_R521Bitem (ffelexToken name
)
1981 ffestd_check_item_ ();
1986 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
1990 /* ffestd_R521Bfinish -- PRIVATE statement list complete
1992 ffestd_R521Bfinish();
1994 Just wrap up any local activities. */
1997 ffestd_R521Bfinish ()
1999 ffestd_check_finish_ ();
2004 fputc ('\n', dmpout
);
2009 /* ffestd_R522 -- SAVE statement with no list
2013 Verify that SAVE is valid here, and flag everything as SAVEd. */
2018 ffestd_check_simple_ ();
2020 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2021 fputs ("* SAVE_all\n", dmpout
);
2022 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2028 /* ffestd_R522start -- SAVE statement list begin
2032 Verify that SAVE is valid here, and begin accepting items in the list. */
2037 ffestd_check_start_ ();
2039 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2040 fputs ("* SAVE ", dmpout
);
2041 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2047 /* ffestd_R522item_object -- SAVE statement for object-name
2049 ffestd_R522item_object(name_token);
2051 Make sure name_token identifies a valid object to be SAVEd. */
2054 ffestd_R522item_object (ffelexToken name UNUSED
)
2056 ffestd_check_item_ ();
2058 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2059 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
2060 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2066 /* ffestd_R522item_cblock -- SAVE statement for common-block-name
2068 ffestd_R522item_cblock(name_token);
2070 Make sure name_token identifies a valid common block to be SAVEd. */
2073 ffestd_R522item_cblock (ffelexToken name UNUSED
)
2075 ffestd_check_item_ ();
2077 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2078 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
2079 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2085 /* ffestd_R522finish -- SAVE statement list complete
2087 ffestd_R522finish();
2089 Just wrap up any local activities. */
2092 ffestd_R522finish ()
2094 ffestd_check_finish_ ();
2096 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2097 fputc ('\n', dmpout
);
2098 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2104 /* ffestd_R524_start -- DIMENSION statement list begin
2106 ffestd_R524_start(bool virtual);
2108 Verify that DIMENSION is valid here, and begin accepting items in the list. */
2111 ffestd_R524_start (bool virtual UNUSED
)
2113 ffestd_check_start_ ();
2115 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2117 fputs ("* VIRTUAL ", dmpout
); /* V028. */
2119 fputs ("* DIMENSION ", dmpout
);
2120 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2126 /* ffestd_R524_item -- DIMENSION statement for object-name
2128 ffestd_R524_item(name_token,dim_list);
2130 Make sure name_token identifies a valid object to be DIMENSIONd. */
2133 ffestd_R524_item (ffelexToken name UNUSED
, ffesttDimList dims UNUSED
)
2135 ffestd_check_item_ ();
2137 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2138 fputs (ffelex_token_text (name
), dmpout
);
2139 fputc ('(', dmpout
);
2140 ffestt_dimlist_dump (dims
);
2141 fputs ("),", dmpout
);
2142 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2148 /* ffestd_R524_finish -- DIMENSION statement list complete
2150 ffestd_R524_finish();
2152 Just wrap up any local activities. */
2155 ffestd_R524_finish ()
2157 ffestd_check_finish_ ();
2159 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2160 fputc ('\n', dmpout
);
2161 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2167 /* ffestd_R525_start -- ALLOCATABLE statement list begin
2169 ffestd_R525_start();
2171 Verify that ALLOCATABLE is valid here, and begin accepting items in the
2176 ffestd_R525_start ()
2178 ffestd_check_start_ ();
2180 ffestd_subr_f90_ ();
2184 fputs ("* ALLOCATABLE ", dmpout
);
2188 /* ffestd_R525_item -- ALLOCATABLE statement for object-name
2190 ffestd_R525_item(name_token,dim_list);
2192 Make sure name_token identifies a valid object to be ALLOCATABLEd. */
2195 ffestd_R525_item (ffelexToken name
, ffesttDimList dims
)
2197 ffestd_check_item_ ();
2202 fputs (ffelex_token_text (name
), dmpout
);
2205 fputc ('(', dmpout
);
2206 ffestt_dimlist_dump (dims
);
2207 fputc (')', dmpout
);
2209 fputc (',', dmpout
);
2213 /* ffestd_R525_finish -- ALLOCATABLE statement list complete
2215 ffestd_R525_finish();
2217 Just wrap up any local activities. */
2220 ffestd_R525_finish ()
2222 ffestd_check_finish_ ();
2227 fputc ('\n', dmpout
);
2231 /* ffestd_R526_start -- POINTER statement list begin
2233 ffestd_R526_start();
2235 Verify that POINTER is valid here, and begin accepting items in the
2239 ffestd_R526_start ()
2241 ffestd_check_start_ ();
2243 ffestd_subr_f90_ ();
2247 fputs ("* POINTER ", dmpout
);
2251 /* ffestd_R526_item -- POINTER statement for object-name
2253 ffestd_R526_item(name_token,dim_list);
2255 Make sure name_token identifies a valid object to be POINTERd. */
2258 ffestd_R526_item (ffelexToken name
, ffesttDimList dims
)
2260 ffestd_check_item_ ();
2265 fputs (ffelex_token_text (name
), dmpout
);
2268 fputc ('(', dmpout
);
2269 ffestt_dimlist_dump (dims
);
2270 fputc (')', dmpout
);
2272 fputc (',', dmpout
);
2276 /* ffestd_R526_finish -- POINTER statement list complete
2278 ffestd_R526_finish();
2280 Just wrap up any local activities. */
2283 ffestd_R526_finish ()
2285 ffestd_check_finish_ ();
2290 fputc ('\n', dmpout
);
2294 /* ffestd_R527_start -- TARGET statement list begin
2296 ffestd_R527_start();
2298 Verify that TARGET is valid here, and begin accepting items in the
2302 ffestd_R527_start ()
2304 ffestd_check_start_ ();
2306 ffestd_subr_f90_ ();
2310 fputs ("* TARGET ", dmpout
);
2314 /* ffestd_R527_item -- TARGET statement for object-name
2316 ffestd_R527_item(name_token,dim_list);
2318 Make sure name_token identifies a valid object to be TARGETd. */
2321 ffestd_R527_item (ffelexToken name
, ffesttDimList dims
)
2323 ffestd_check_item_ ();
2328 fputs (ffelex_token_text (name
), dmpout
);
2331 fputc ('(', dmpout
);
2332 ffestt_dimlist_dump (dims
);
2333 fputc (')', dmpout
);
2335 fputc (',', dmpout
);
2339 /* ffestd_R527_finish -- TARGET statement list complete
2341 ffestd_R527_finish();
2343 Just wrap up any local activities. */
2346 ffestd_R527_finish ()
2348 ffestd_check_finish_ ();
2353 fputc ('\n', dmpout
);
2358 /* ffestd_R537_start -- PARAMETER statement list begin
2360 ffestd_R537_start();
2362 Verify that PARAMETER is valid here, and begin accepting items in the list. */
2365 ffestd_R537_start ()
2367 ffestd_check_start_ ();
2369 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2370 fputs ("* PARAMETER (", dmpout
);
2371 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2377 /* ffestd_R537_item -- PARAMETER statement assignment
2379 ffestd_R537_item(dest,dest_token,source,source_token);
2381 Make sure the source is a valid source for the destination; make the
2385 ffestd_R537_item (ffebld dest UNUSED
, ffebld source UNUSED
)
2387 ffestd_check_item_ ();
2389 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2391 fputc ('=', dmpout
);
2392 ffebld_dump (source
);
2393 fputc (',', dmpout
);
2394 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2400 /* ffestd_R537_finish -- PARAMETER statement list complete
2402 ffestd_R537_finish();
2404 Just wrap up any local activities. */
2407 ffestd_R537_finish ()
2409 ffestd_check_finish_ ();
2411 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2412 fputs (")\n", dmpout
);
2413 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2419 /* ffestd_R539 -- IMPLICIT NONE statement
2423 Verify that the IMPLICIT NONE statement is ok here and implement. */
2428 ffestd_check_simple_ ();
2430 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2431 fputs ("* IMPLICIT_NONE\n", dmpout
);
2432 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2438 /* ffestd_R539start -- IMPLICIT statement
2442 Verify that the IMPLICIT statement is ok here and implement. */
2447 ffestd_check_start_ ();
2449 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2450 fputs ("* IMPLICIT ", dmpout
);
2451 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2457 /* ffestd_R539item -- IMPLICIT statement specification (R540)
2459 ffestd_R539item(...);
2461 Verify that the type and letter list are all ok and implement. */
2464 ffestd_R539item (ffestpType type UNUSED
, ffebld kind UNUSED
,
2465 ffelexToken kindt UNUSED
, ffebld len UNUSED
,
2466 ffelexToken lent UNUSED
, ffesttImpList letters UNUSED
)
2468 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2472 ffestd_check_item_ ();
2474 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2477 case FFESTP_typeINTEGER
:
2481 case FFESTP_typeBYTE
:
2485 case FFESTP_typeWORD
:
2489 case FFESTP_typeREAL
:
2493 case FFESTP_typeCOMPLEX
:
2497 case FFESTP_typeLOGICAL
:
2501 case FFESTP_typeCHARACTER
:
2505 case FFESTP_typeDBLPRCSN
:
2506 a
= "DOUBLE PRECISION";
2509 case FFESTP_typeDBLCMPLX
:
2510 a
= "DOUBLE COMPLEX";
2514 case FFESTP_typeTYPE
:
2524 fprintf (dmpout
, "%s(", a
);
2527 fputs ("kind=", dmpout
);
2529 fputs (ffelex_token_text (kindt
), dmpout
);
2533 fputc (',', dmpout
);
2537 fputs ("len=", dmpout
);
2539 fputs (ffelex_token_text (lent
), dmpout
);
2543 fputs (")(", dmpout
);
2544 ffestt_implist_dump (letters
);
2545 fputs ("),", dmpout
);
2546 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2552 /* ffestd_R539finish -- IMPLICIT statement
2554 ffestd_R539finish();
2556 Finish up any local activities. */
2559 ffestd_R539finish ()
2561 ffestd_check_finish_ ();
2563 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2564 fputc ('\n', dmpout
);
2565 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2571 /* ffestd_R542_start -- NAMELIST statement list begin
2573 ffestd_R542_start();
2575 Verify that NAMELIST is valid here, and begin accepting items in the list. */
2578 ffestd_R542_start ()
2580 ffestd_check_start_ ();
2582 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2583 fputs ("* NAMELIST ", dmpout
);
2584 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2590 /* ffestd_R542_item_nlist -- NAMELIST statement for group-name
2592 ffestd_R542_item_nlist(groupname_token);
2594 Make sure name_token identifies a valid object to be NAMELISTd. */
2597 ffestd_R542_item_nlist (ffelexToken name UNUSED
)
2599 ffestd_check_item_ ();
2601 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2602 fprintf (dmpout
, "/%s/", ffelex_token_text (name
));
2603 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2609 /* ffestd_R542_item_nitem -- NAMELIST statement for variable-name
2611 ffestd_R542_item_nitem(name_token);
2613 Make sure name_token identifies a valid object to be NAMELISTd. */
2616 ffestd_R542_item_nitem (ffelexToken name UNUSED
)
2618 ffestd_check_item_ ();
2620 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2621 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
2622 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2628 /* ffestd_R542_finish -- NAMELIST statement list complete
2630 ffestd_R542_finish();
2632 Just wrap up any local activities. */
2635 ffestd_R542_finish ()
2637 ffestd_check_finish_ ();
2639 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2640 fputc ('\n', dmpout
);
2641 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2647 /* ffestd_R544_start -- EQUIVALENCE statement list begin
2649 ffestd_R544_start();
2651 Verify that EQUIVALENCE is valid here, and begin accepting items in the
2656 ffestd_R544_start ()
2658 ffestd_check_start_ ();
2660 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2661 fputs ("* EQUIVALENCE (", dmpout
);
2662 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2669 /* ffestd_R544_item -- EQUIVALENCE statement assignment
2671 ffestd_R544_item(exprlist);
2673 Make sure the equivalence is valid, then implement it. */
2677 ffestd_R544_item (ffesttExprList exprlist
)
2679 ffestd_check_item_ ();
2681 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2682 ffestt_exprlist_dump (exprlist
);
2683 fputs ("),", dmpout
);
2684 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2691 /* ffestd_R544_finish -- EQUIVALENCE statement list complete
2693 ffestd_R544_finish();
2695 Just wrap up any local activities. */
2699 ffestd_R544_finish ()
2701 ffestd_check_finish_ ();
2703 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2704 fputs (")\n", dmpout
);
2705 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2712 /* ffestd_R547_start -- COMMON statement list begin
2714 ffestd_R547_start();
2716 Verify that COMMON is valid here, and begin accepting items in the list. */
2719 ffestd_R547_start ()
2721 ffestd_check_start_ ();
2723 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2724 fputs ("* COMMON ", dmpout
);
2725 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2731 /* ffestd_R547_item_object -- COMMON statement for object-name
2733 ffestd_R547_item_object(name_token,dim_list);
2735 Make sure name_token identifies a valid object to be COMMONd. */
2738 ffestd_R547_item_object (ffelexToken name UNUSED
,
2739 ffesttDimList dims UNUSED
)
2741 ffestd_check_item_ ();
2743 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2744 fputs (ffelex_token_text (name
), dmpout
);
2747 fputc ('(', dmpout
);
2748 ffestt_dimlist_dump (dims
);
2749 fputc (')', dmpout
);
2751 fputc (',', dmpout
);
2752 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2758 /* ffestd_R547_item_cblock -- COMMON statement for common-block-name
2760 ffestd_R547_item_cblock(name_token);
2762 Make sure name_token identifies a valid common block to be COMMONd. */
2765 ffestd_R547_item_cblock (ffelexToken name UNUSED
)
2767 ffestd_check_item_ ();
2769 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2771 fputs ("//,", dmpout
);
2773 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
2774 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2780 /* ffestd_R547_finish -- COMMON statement list complete
2782 ffestd_R547_finish();
2784 Just wrap up any local activities. */
2787 ffestd_R547_finish ()
2789 ffestd_check_finish_ ();
2791 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2792 fputc ('\n', dmpout
);
2793 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2799 /* ffestd_R620 -- ALLOCATE statement
2801 ffestd_R620(exprlist,stat,stat_token);
2803 Make sure the expression list is valid, then implement it. */
2807 ffestd_R620 (ffesttExprList exprlist
, ffebld stat
)
2809 ffestd_check_simple_ ();
2811 ffestd_subr_f90_ ();
2815 fputs ("+ ALLOCATE (", dmpout
);
2816 ffestt_exprlist_dump (exprlist
);
2819 fputs (",stat=", dmpout
);
2822 fputs (")\n", dmpout
);
2826 /* ffestd_R624 -- NULLIFY statement
2828 ffestd_R624(pointer_name_list);
2830 Make sure pointer_name_list identifies valid pointers for a NULLIFY. */
2833 ffestd_R624 (ffesttExprList pointers
)
2835 ffestd_check_simple_ ();
2837 ffestd_subr_f90_ ();
2841 fputs ("+ NULLIFY (", dmpout
);
2842 assert (pointers
!= NULL
);
2843 ffestt_exprlist_dump (pointers
);
2844 fputs (")\n", dmpout
);
2848 /* ffestd_R625 -- DEALLOCATE statement
2850 ffestd_R625(exprlist,stat,stat_token);
2852 Make sure the equivalence is valid, then implement it. */
2855 ffestd_R625 (ffesttExprList exprlist
, ffebld stat
)
2857 ffestd_check_simple_ ();
2859 ffestd_subr_f90_ ();
2863 fputs ("+ DEALLOCATE (", dmpout
);
2864 ffestt_exprlist_dump (exprlist
);
2867 fputs (",stat=", dmpout
);
2870 fputs (")\n", dmpout
);
2875 /* ffestd_R737A -- Assignment statement outside of WHERE
2877 ffestd_R737A(dest_expr,source_expr); */
2880 ffestd_R737A (ffebld dest
, ffebld source
)
2882 ffestd_check_simple_ ();
2885 ffestd_subr_line_now_ ();
2886 ffeste_R737A (dest
, source
);
2891 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR737A_
);
2892 ffestd_stmt_append_ (stmt
);
2893 ffestd_subr_line_save_ (stmt
);
2894 stmt
->u
.R737A
.pool
= ffesta_output_pool
;
2895 stmt
->u
.R737A
.dest
= dest
;
2896 stmt
->u
.R737A
.source
= source
;
2897 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
2902 /* ffestd_R737B -- Assignment statement inside of WHERE
2904 ffestd_R737B(dest_expr,source_expr); */
2908 ffestd_R737B (ffebld dest
, ffebld source
)
2910 ffestd_check_simple_ ();
2915 fputs ("+ let_inside_where ", dmpout
);
2917 fputs ("=", dmpout
);
2918 ffebld_dump (source
);
2919 fputc ('\n', dmpout
);
2923 /* ffestd_R738 -- Pointer assignment statement
2925 ffestd_R738(dest_expr,source_expr,source_token);
2927 Make sure the assignment is valid. */
2930 ffestd_R738 (ffebld dest
, ffebld source
)
2932 ffestd_check_simple_ ();
2934 ffestd_subr_f90_ ();
2938 fputs ("+ let_pointer ", dmpout
);
2940 fputs ("=>", dmpout
);
2941 ffebld_dump (source
);
2942 fputc ('\n', dmpout
);
2946 /* ffestd_R740 -- WHERE statement
2948 ffestd_R740(expr,expr_token);
2950 Make sure statement is valid here; implement. */
2953 ffestd_R740 (ffebld expr
)
2955 ffestd_check_simple_ ();
2957 ffestd_subr_f90_ ();
2961 fputs ("+ WHERE (", dmpout
);
2963 fputs (")\n", dmpout
);
2965 ++ffestd_block_level_
;
2966 assert (ffestd_block_level_
> 0);
2970 /* ffestd_R742 -- WHERE-construct statement
2972 ffestd_R742(expr,expr_token);
2974 Make sure statement is valid here; implement. */
2977 ffestd_R742 (ffebld expr
)
2979 ffestd_check_simple_ ();
2981 ffestd_subr_f90_ ();
2985 fputs ("+ WHERE_construct (", dmpout
);
2987 fputs (")\n", dmpout
);
2989 ++ffestd_block_level_
;
2990 assert (ffestd_block_level_
> 0);
2994 /* ffestd_R744 -- ELSE WHERE statement
2998 Make sure ffestd_kind_ identifies a WHERE block.
2999 Implement the ELSE of the current WHERE block. */
3004 ffestd_check_simple_ ();
3009 fputs ("+ ELSE_WHERE\n", dmpout
);
3013 /* ffestd_R745 -- Implicit END WHERE statement. */
3016 ffestd_R745 (bool ok
)
3021 fputs ("+ END_WHERE\n", dmpout
); /* Also see ffestd_R745. */
3023 --ffestd_block_level_
;
3024 assert (ffestd_block_level_
>= 0);
3030 /* Block IF (IF-THEN) statement. */
3033 ffestd_R803 (ffelexToken construct_name UNUSED
, ffebld expr
)
3035 ffestd_check_simple_ ();
3038 ffestd_subr_line_now_ ();
3039 ffeste_R803 (expr
); /* Don't bother with name. */
3044 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR803_
);
3045 ffestd_stmt_append_ (stmt
);
3046 ffestd_subr_line_save_ (stmt
);
3047 stmt
->u
.R803
.pool
= ffesta_output_pool
;
3048 stmt
->u
.R803
.block
= ffestw_use (ffestw_stack_top ());
3049 stmt
->u
.R803
.expr
= expr
;
3050 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3054 ++ffestd_block_level_
;
3055 assert (ffestd_block_level_
> 0);
3058 /* ELSE IF statement. */
3061 ffestd_R804 (ffebld expr
, ffelexToken name UNUSED
)
3063 ffestd_check_simple_ ();
3066 ffestd_subr_line_now_ ();
3067 ffeste_R804 (expr
); /* Don't bother with name. */
3072 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR804_
);
3073 ffestd_stmt_append_ (stmt
);
3074 ffestd_subr_line_save_ (stmt
);
3075 stmt
->u
.R804
.pool
= ffesta_output_pool
;
3076 stmt
->u
.R804
.block
= ffestw_use (ffestw_stack_top ());
3077 stmt
->u
.R804
.expr
= expr
;
3078 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3083 /* ELSE statement. */
3086 ffestd_R805 (ffelexToken name UNUSED
)
3088 ffestd_check_simple_ ();
3091 ffestd_subr_line_now_ ();
3092 ffeste_R805 (); /* Don't bother with name. */
3097 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR805_
);
3098 ffestd_stmt_append_ (stmt
);
3099 ffestd_subr_line_save_ (stmt
);
3100 stmt
->u
.R805
.block
= ffestw_use (ffestw_stack_top ());
3105 /* END IF statement. */
3108 ffestd_R806 (bool ok UNUSED
)
3111 ffestd_subr_line_now_ ();
3117 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR806_
);
3118 ffestd_stmt_append_ (stmt
);
3119 ffestd_subr_line_save_ (stmt
);
3120 stmt
->u
.R806
.block
= ffestw_use (ffestw_stack_top ());
3124 --ffestd_block_level_
;
3125 assert (ffestd_block_level_
>= 0);
3128 /* ffestd_R807 -- Logical IF statement
3130 ffestd_R807(expr,expr_token);
3132 Make sure statement is valid here; implement. */
3135 ffestd_R807 (ffebld expr
)
3137 ffestd_check_simple_ ();
3140 ffestd_subr_line_now_ ();
3146 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR807_
);
3147 ffestd_stmt_append_ (stmt
);
3148 ffestd_subr_line_save_ (stmt
);
3149 stmt
->u
.R807
.pool
= ffesta_output_pool
;
3150 stmt
->u
.R807
.expr
= expr
;
3151 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3155 ++ffestd_block_level_
;
3156 assert (ffestd_block_level_
> 0);
3159 /* ffestd_R809 -- SELECT CASE statement
3161 ffestd_R809(construct_name,expr,expr_token);
3163 Make sure statement is valid here; implement. */
3166 ffestd_R809 (ffelexToken construct_name UNUSED
, ffebld expr
)
3168 ffestd_check_simple_ ();
3171 ffestd_subr_line_now_ ();
3172 ffeste_R809 (ffestw_stack_top (), expr
);
3177 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR809_
);
3178 ffestd_stmt_append_ (stmt
);
3179 ffestd_subr_line_save_ (stmt
);
3180 stmt
->u
.R809
.pool
= ffesta_output_pool
;
3181 stmt
->u
.R809
.block
= ffestw_use (ffestw_stack_top ());
3182 stmt
->u
.R809
.expr
= expr
;
3183 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3184 malloc_pool_use (ffestw_select (ffestw_stack_top ())->pool
);
3188 ++ffestd_block_level_
;
3189 assert (ffestd_block_level_
> 0);
3192 /* ffestd_R810 -- CASE statement
3194 ffestd_R810(case_value_range_list,name);
3196 If casenum is 0, it's CASE DEFAULT. Else it's the case ranges at
3197 the start of the first_stmt list in the select object at the top of
3198 the stack that match casenum. */
3201 ffestd_R810 (unsigned long casenum
)
3203 ffestd_check_simple_ ();
3206 ffestd_subr_line_now_ ();
3207 ffeste_R810 (ffestw_stack_top (), casenum
);
3212 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR810_
);
3213 ffestd_stmt_append_ (stmt
);
3214 ffestd_subr_line_save_ (stmt
);
3215 stmt
->u
.R810
.pool
= ffesta_output_pool
;
3216 stmt
->u
.R810
.block
= ffestw_stack_top ();
3217 stmt
->u
.R810
.casenum
= casenum
;
3218 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3223 /* ffestd_R811 -- End a SELECT
3225 ffestd_R811(TRUE); */
3228 ffestd_R811 (bool ok UNUSED
)
3231 ffestd_subr_line_now_ ();
3232 ffeste_R811 (ffestw_stack_top ());
3237 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR811_
);
3238 ffestd_stmt_append_ (stmt
);
3239 ffestd_subr_line_save_ (stmt
);
3240 stmt
->u
.R811
.block
= ffestw_stack_top ();
3244 --ffestd_block_level_
;
3245 assert (ffestd_block_level_
>= 0);
3248 /* ffestd_R819A -- Iterative DO statement
3250 ffestd_R819A(construct_name,label_token,expr,expr_token);
3252 Make sure statement is valid here; implement. */
3255 ffestd_R819A (ffelexToken construct_name UNUSED
, ffelab label
,
3256 ffebld var
, ffebld start
, ffelexToken start_token
,
3257 ffebld end
, ffelexToken end_token
,
3258 ffebld incr
, ffelexToken incr_token
)
3260 ffestd_check_simple_ ();
3263 ffestd_subr_line_now_ ();
3264 ffeste_R819A (ffestw_stack_top (), label
, var
, start
, end
, incr
,
3270 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR819A_
);
3271 ffestd_stmt_append_ (stmt
);
3272 ffestd_subr_line_save_ (stmt
);
3273 stmt
->u
.R819A
.pool
= ffesta_output_pool
;
3274 stmt
->u
.R819A
.block
= ffestw_use (ffestw_stack_top ());
3275 stmt
->u
.R819A
.label
= label
;
3276 stmt
->u
.R819A
.var
= var
;
3277 stmt
->u
.R819A
.start
= start
;
3278 stmt
->u
.R819A
.start_token
= ffelex_token_use (start_token
);
3279 stmt
->u
.R819A
.end
= end
;
3280 stmt
->u
.R819A
.end_token
= ffelex_token_use (end_token
);
3281 stmt
->u
.R819A
.incr
= incr
;
3282 stmt
->u
.R819A
.incr_token
= (incr_token
== NULL
) ? NULL
3283 : ffelex_token_use (incr_token
);
3284 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3288 ++ffestd_block_level_
;
3289 assert (ffestd_block_level_
> 0);
3292 /* ffestd_R819B -- DO WHILE statement
3294 ffestd_R819B(construct_name,label_token,expr,expr_token);
3296 Make sure statement is valid here; implement. */
3299 ffestd_R819B (ffelexToken construct_name UNUSED
, ffelab label
,
3302 ffestd_check_simple_ ();
3305 ffestd_subr_line_now_ ();
3306 ffeste_R819B (ffestw_stack_top (), label
, expr
);
3311 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR819B_
);
3312 ffestd_stmt_append_ (stmt
);
3313 ffestd_subr_line_save_ (stmt
);
3314 stmt
->u
.R819B
.pool
= ffesta_output_pool
;
3315 stmt
->u
.R819B
.block
= ffestw_use (ffestw_stack_top ());
3316 stmt
->u
.R819B
.label
= label
;
3317 stmt
->u
.R819B
.expr
= expr
;
3318 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3322 ++ffestd_block_level_
;
3323 assert (ffestd_block_level_
> 0);
3326 /* ffestd_R825 -- END DO statement
3328 ffestd_R825(name_token);
3330 Make sure ffestd_kind_ identifies a DO block. If not
3331 NULL, make sure name_token gives the correct name. Do whatever
3332 is specific to seeing END DO with a DO-target label definition on it,
3333 where the END DO is really treated as a CONTINUE (i.e. generate th
3334 same code you would for CONTINUE). ffestd_do handles the actual
3335 generation of end-loop code. */
3338 ffestd_R825 (ffelexToken name UNUSED
)
3340 ffestd_check_simple_ ();
3343 ffestd_subr_line_now_ ();
3349 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR825_
);
3350 ffestd_stmt_append_ (stmt
);
3351 ffestd_subr_line_save_ (stmt
);
3356 /* ffestd_R834 -- CYCLE statement
3358 ffestd_R834(name_token);
3360 Handle a CYCLE within a loop. */
3363 ffestd_R834 (ffestw block
)
3365 ffestd_check_simple_ ();
3368 ffestd_subr_line_now_ ();
3369 ffeste_R834 (block
);
3374 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR834_
);
3375 ffestd_stmt_append_ (stmt
);
3376 ffestd_subr_line_save_ (stmt
);
3377 stmt
->u
.R834
.block
= block
;
3382 /* ffestd_R835 -- EXIT statement
3384 ffestd_R835(name_token);
3386 Handle a EXIT within a loop. */
3389 ffestd_R835 (ffestw block
)
3391 ffestd_check_simple_ ();
3394 ffestd_subr_line_now_ ();
3395 ffeste_R835 (block
);
3400 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR835_
);
3401 ffestd_stmt_append_ (stmt
);
3402 ffestd_subr_line_save_ (stmt
);
3403 stmt
->u
.R835
.block
= block
;
3408 /* ffestd_R836 -- GOTO statement
3412 Make sure label_token identifies a valid label for a GOTO. Update
3413 that label's info to indicate it is the target of a GOTO. */
3416 ffestd_R836 (ffelab label
)
3418 ffestd_check_simple_ ();
3421 ffestd_subr_line_now_ ();
3422 ffeste_R836 (label
);
3427 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR836_
);
3428 ffestd_stmt_append_ (stmt
);
3429 ffestd_subr_line_save_ (stmt
);
3430 stmt
->u
.R836
.label
= label
;
3434 if (ffestd_block_level_
== 0)
3435 ffestd_is_reachable_
= FALSE
;
3438 /* ffestd_R837 -- Computed GOTO statement
3440 ffestd_R837(labels,expr);
3442 Make sure label_list identifies valid labels for a GOTO. Update
3443 each label's info to indicate it is the target of a GOTO. */
3446 ffestd_R837 (ffelab
*labels
, int count
, ffebld expr
)
3448 ffestd_check_simple_ ();
3451 ffestd_subr_line_now_ ();
3452 ffeste_R837 (labels
, count
, expr
);
3457 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR837_
);
3458 ffestd_stmt_append_ (stmt
);
3459 ffestd_subr_line_save_ (stmt
);
3460 stmt
->u
.R837
.pool
= ffesta_output_pool
;
3461 stmt
->u
.R837
.labels
= labels
;
3462 stmt
->u
.R837
.count
= count
;
3463 stmt
->u
.R837
.expr
= expr
;
3464 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3469 /* ffestd_R838 -- ASSIGN statement
3471 ffestd_R838(label_token,target_variable,target_token);
3473 Make sure label_token identifies a valid label for an assignment. Update
3474 that label's info to indicate it is the source of an assignment. Update
3475 target_variable's info to indicate it is the target the assignment of that
3479 ffestd_R838 (ffelab label
, ffebld target
)
3481 ffestd_check_simple_ ();
3484 ffestd_subr_line_now_ ();
3485 ffeste_R838 (label
, target
);
3490 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR838_
);
3491 ffestd_stmt_append_ (stmt
);
3492 ffestd_subr_line_save_ (stmt
);
3493 stmt
->u
.R838
.pool
= ffesta_output_pool
;
3494 stmt
->u
.R838
.label
= label
;
3495 stmt
->u
.R838
.target
= target
;
3496 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3501 /* ffestd_R839 -- Assigned GOTO statement
3503 ffestd_R839(target,labels);
3505 Make sure label_list identifies valid labels for a GOTO. Update
3506 each label's info to indicate it is the target of a GOTO. */
3509 ffestd_R839 (ffebld target
, ffelab
*labels UNUSED
, int count UNUSED
)
3511 ffestd_check_simple_ ();
3514 ffestd_subr_line_now_ ();
3515 ffeste_R839 (target
);
3520 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR839_
);
3521 ffestd_stmt_append_ (stmt
);
3522 ffestd_subr_line_save_ (stmt
);
3523 stmt
->u
.R839
.pool
= ffesta_output_pool
;
3524 stmt
->u
.R839
.target
= target
;
3525 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3529 if (ffestd_block_level_
== 0)
3530 ffestd_is_reachable_
= FALSE
;
3533 /* ffestd_R840 -- Arithmetic IF statement
3535 ffestd_R840(expr,expr_token,neg,zero,pos);
3537 Make sure the labels are valid; implement. */
3540 ffestd_R840 (ffebld expr
, ffelab neg
, ffelab zero
, ffelab pos
)
3542 ffestd_check_simple_ ();
3545 ffestd_subr_line_now_ ();
3546 ffeste_R840 (expr
, neg
, zero
, pos
);
3551 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR840_
);
3552 ffestd_stmt_append_ (stmt
);
3553 ffestd_subr_line_save_ (stmt
);
3554 stmt
->u
.R840
.pool
= ffesta_output_pool
;
3555 stmt
->u
.R840
.expr
= expr
;
3556 stmt
->u
.R840
.neg
= neg
;
3557 stmt
->u
.R840
.zero
= zero
;
3558 stmt
->u
.R840
.pos
= pos
;
3559 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3563 if (ffestd_block_level_
== 0)
3564 ffestd_is_reachable_
= FALSE
;
3567 /* ffestd_R841 -- CONTINUE statement
3572 ffestd_R841 (bool in_where UNUSED
)
3574 ffestd_check_simple_ ();
3577 ffestd_subr_line_now_ ();
3583 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR841_
);
3584 ffestd_stmt_append_ (stmt
);
3585 ffestd_subr_line_save_ (stmt
);
3590 /* ffestd_R842 -- STOP statement
3592 ffestd_R842(expr); */
3595 ffestd_R842 (ffebld expr
)
3597 ffestd_check_simple_ ();
3600 ffestd_subr_line_now_ ();
3606 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR842_
);
3607 ffestd_stmt_append_ (stmt
);
3608 ffestd_subr_line_save_ (stmt
);
3609 if (ffesta_outpooldisp () == FFESTA_pooldispPRESERVE
)
3611 /* This is a "spurious" (automatically-generated) STOP
3612 that follows a previous STOP or other statement.
3613 Make sure we don't have an expression in the pool,
3614 and then mark that the pool has already been killed. */
3615 assert (expr
== NULL
);
3616 stmt
->u
.R842
.pool
= NULL
;
3617 stmt
->u
.R842
.expr
= NULL
;
3621 stmt
->u
.R842
.pool
= ffesta_output_pool
;
3622 stmt
->u
.R842
.expr
= expr
;
3623 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3628 if (ffestd_block_level_
== 0)
3629 ffestd_is_reachable_
= FALSE
;
3632 /* ffestd_R843 -- PAUSE statement
3634 ffestd_R843(expr,expr_token);
3636 Make sure statement is valid here; implement. expr and expr_token are
3637 both NULL if there was no expression. */
3640 ffestd_R843 (ffebld expr
)
3642 ffestd_check_simple_ ();
3645 ffestd_subr_line_now_ ();
3651 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR843_
);
3652 ffestd_stmt_append_ (stmt
);
3653 ffestd_subr_line_save_ (stmt
);
3654 stmt
->u
.R843
.pool
= ffesta_output_pool
;
3655 stmt
->u
.R843
.expr
= expr
;
3656 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3661 /* ffestd_R904 -- OPEN statement
3665 Make sure an OPEN is valid in the current context, and implement it. */
3670 ffestd_check_simple_ ();
3672 #if FFECOM_targetCURRENT == FFECOM_targetGCC
3673 #define specified(something) \
3674 (ffestp_file.open.open_spec[something].kw_or_val_present)
3676 /* Warn if there are any thing we don't handle via f2c libraries. */
3678 if (specified (FFESTP_openixACTION
)
3679 || specified (FFESTP_openixASSOCIATEVARIABLE
)
3680 || specified (FFESTP_openixBLOCKSIZE
)
3681 || specified (FFESTP_openixBUFFERCOUNT
)
3682 || specified (FFESTP_openixCARRIAGECONTROL
)
3683 || specified (FFESTP_openixDEFAULTFILE
)
3684 || specified (FFESTP_openixDELIM
)
3685 || specified (FFESTP_openixDISPOSE
)
3686 || specified (FFESTP_openixEXTENDSIZE
)
3687 || specified (FFESTP_openixINITIALSIZE
)
3688 || specified (FFESTP_openixKEY
)
3689 || specified (FFESTP_openixMAXREC
)
3690 || specified (FFESTP_openixNOSPANBLOCKS
)
3691 || specified (FFESTP_openixORGANIZATION
)
3692 || specified (FFESTP_openixPAD
)
3693 || specified (FFESTP_openixPOSITION
)
3694 || specified (FFESTP_openixREADONLY
)
3695 || specified (FFESTP_openixRECORDTYPE
)
3696 || specified (FFESTP_openixSHARED
)
3697 || specified (FFESTP_openixUSEROPEN
))
3699 ffebad_start (FFEBAD_OPEN_UNSUPPORTED
);
3700 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
3701 ffelex_token_where_column (ffesta_tokens
[0]));
3709 ffestd_subr_line_now_ ();
3710 ffeste_R904 (&ffestp_file
.open
);
3715 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR904_
);
3716 ffestd_stmt_append_ (stmt
);
3717 ffestd_subr_line_save_ (stmt
);
3718 stmt
->u
.R904
.pool
= ffesta_output_pool
;
3719 stmt
->u
.R904
.params
= ffestd_subr_copy_open_ ();
3720 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3725 /* ffestd_R907 -- CLOSE statement
3729 Make sure a CLOSE is valid in the current context, and implement it. */
3734 ffestd_check_simple_ ();
3737 ffestd_subr_line_now_ ();
3738 ffeste_R907 (&ffestp_file
.close
);
3743 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR907_
);
3744 ffestd_stmt_append_ (stmt
);
3745 ffestd_subr_line_save_ (stmt
);
3746 stmt
->u
.R907
.pool
= ffesta_output_pool
;
3747 stmt
->u
.R907
.params
= ffestd_subr_copy_close_ ();
3748 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3753 /* ffestd_R909_start -- READ(...) statement list begin
3755 ffestd_R909_start(FALSE);
3757 Verify that READ is valid here, and begin accepting items in the
3761 ffestd_R909_start (bool only_format
, ffestvUnit unit
,
3762 ffestvFormat format
, bool rec
, bool key
)
3764 ffestd_check_start_ ();
3766 #if FFECOM_targetCURRENT == FFECOM_targetGCC
3767 #define specified(something) \
3768 (ffestp_file.read.read_spec[something].kw_or_val_present)
3770 /* Warn if there are any thing we don't handle via f2c libraries. */
3771 if (specified (FFESTP_readixADVANCE
)
3772 || specified (FFESTP_readixEOR
)
3773 || specified (FFESTP_readixKEYEQ
)
3774 || specified (FFESTP_readixKEYGE
)
3775 || specified (FFESTP_readixKEYGT
)
3776 || specified (FFESTP_readixKEYID
)
3777 || specified (FFESTP_readixNULLS
)
3778 || specified (FFESTP_readixSIZE
))
3780 ffebad_start (FFEBAD_READ_UNSUPPORTED
);
3781 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
3782 ffelex_token_where_column (ffesta_tokens
[0]));
3790 ffestd_subr_line_now_ ();
3791 ffeste_R909_start (&ffestp_file
.read
, only_format
, unit
, format
, rec
, key
);
3796 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR909_
);
3797 ffestd_stmt_append_ (stmt
);
3798 ffestd_subr_line_save_ (stmt
);
3799 stmt
->u
.R909
.pool
= ffesta_output_pool
;
3800 stmt
->u
.R909
.params
= ffestd_subr_copy_read_ ();
3801 stmt
->u
.R909
.only_format
= only_format
;
3802 stmt
->u
.R909
.unit
= unit
;
3803 stmt
->u
.R909
.format
= format
;
3804 stmt
->u
.R909
.rec
= rec
;
3805 stmt
->u
.R909
.key
= key
;
3806 stmt
->u
.R909
.list
= NULL
;
3807 ffestd_expr_list_
= &stmt
->u
.R909
.list
;
3808 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3813 /* ffestd_R909_item -- READ statement i/o item
3815 ffestd_R909_item(expr,expr_token);
3817 Implement output-list expression. */
3820 ffestd_R909_item (ffebld expr
, ffelexToken expr_token
)
3822 ffestd_check_item_ ();
3825 ffeste_R909_item (expr
);
3828 ffestdExprItem_ item
3829 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
3834 item
->token
= ffelex_token_use (expr_token
);
3835 *ffestd_expr_list_
= item
;
3836 ffestd_expr_list_
= &item
->next
;
3841 /* ffestd_R909_finish -- READ statement list complete
3843 ffestd_R909_finish();
3845 Just wrap up any local activities. */
3848 ffestd_R909_finish ()
3850 ffestd_check_finish_ ();
3853 ffeste_R909_finish ();
3855 /* Nothing to do, it's implicit. */
3859 /* ffestd_R910_start -- WRITE(...) statement list begin
3861 ffestd_R910_start();
3863 Verify that WRITE is valid here, and begin accepting items in the
3867 ffestd_R910_start (ffestvUnit unit
, ffestvFormat format
, bool rec
)
3869 ffestd_check_start_ ();
3871 #if FFECOM_targetCURRENT == FFECOM_targetGCC
3872 #define specified(something) \
3873 (ffestp_file.write.write_spec[something].kw_or_val_present)
3875 /* Warn if there are any thing we don't handle via f2c libraries. */
3876 if (specified (FFESTP_writeixADVANCE
)
3877 || specified (FFESTP_writeixEOR
))
3879 ffebad_start (FFEBAD_WRITE_UNSUPPORTED
);
3880 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
3881 ffelex_token_where_column (ffesta_tokens
[0]));
3889 ffestd_subr_line_now_ ();
3890 ffeste_R910_start (&ffestp_file
.write
, unit
, format
, rec
);
3895 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR910_
);
3896 ffestd_stmt_append_ (stmt
);
3897 ffestd_subr_line_save_ (stmt
);
3898 stmt
->u
.R910
.pool
= ffesta_output_pool
;
3899 stmt
->u
.R910
.params
= ffestd_subr_copy_write_ ();
3900 stmt
->u
.R910
.unit
= unit
;
3901 stmt
->u
.R910
.format
= format
;
3902 stmt
->u
.R910
.rec
= rec
;
3903 stmt
->u
.R910
.list
= NULL
;
3904 ffestd_expr_list_
= &stmt
->u
.R910
.list
;
3905 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3910 /* ffestd_R910_item -- WRITE statement i/o item
3912 ffestd_R910_item(expr,expr_token);
3914 Implement output-list expression. */
3917 ffestd_R910_item (ffebld expr
, ffelexToken expr_token
)
3919 ffestd_check_item_ ();
3922 ffeste_R910_item (expr
);
3925 ffestdExprItem_ item
3926 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
3931 item
->token
= ffelex_token_use (expr_token
);
3932 *ffestd_expr_list_
= item
;
3933 ffestd_expr_list_
= &item
->next
;
3938 /* ffestd_R910_finish -- WRITE statement list complete
3940 ffestd_R910_finish();
3942 Just wrap up any local activities. */
3945 ffestd_R910_finish ()
3947 ffestd_check_finish_ ();
3950 ffeste_R910_finish ();
3952 /* Nothing to do, it's implicit. */
3956 /* ffestd_R911_start -- PRINT statement list begin
3958 ffestd_R911_start();
3960 Verify that PRINT is valid here, and begin accepting items in the
3964 ffestd_R911_start (ffestvFormat format
)
3966 ffestd_check_start_ ();
3969 ffestd_subr_line_now_ ();
3970 ffeste_R911_start (&ffestp_file
.print
, format
);
3975 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR911_
);
3976 ffestd_stmt_append_ (stmt
);
3977 ffestd_subr_line_save_ (stmt
);
3978 stmt
->u
.R911
.pool
= ffesta_output_pool
;
3979 stmt
->u
.R911
.params
= ffestd_subr_copy_print_ ();
3980 stmt
->u
.R911
.format
= format
;
3981 stmt
->u
.R911
.list
= NULL
;
3982 ffestd_expr_list_
= &stmt
->u
.R911
.list
;
3983 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3988 /* ffestd_R911_item -- PRINT statement i/o item
3990 ffestd_R911_item(expr,expr_token);
3992 Implement output-list expression. */
3995 ffestd_R911_item (ffebld expr
, ffelexToken expr_token
)
3997 ffestd_check_item_ ();
4000 ffeste_R911_item (expr
);
4003 ffestdExprItem_ item
4004 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
4009 item
->token
= ffelex_token_use (expr_token
);
4010 *ffestd_expr_list_
= item
;
4011 ffestd_expr_list_
= &item
->next
;
4016 /* ffestd_R911_finish -- PRINT statement list complete
4018 ffestd_R911_finish();
4020 Just wrap up any local activities. */
4023 ffestd_R911_finish ()
4025 ffestd_check_finish_ ();
4028 ffeste_R911_finish ();
4030 /* Nothing to do, it's implicit. */
4034 /* ffestd_R919 -- BACKSPACE statement
4038 Make sure a BACKSPACE is valid in the current context, and implement it. */
4043 ffestd_check_simple_ ();
4046 ffestd_subr_line_now_ ();
4047 ffeste_R919 (&ffestp_file
.beru
);
4052 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR919_
);
4053 ffestd_stmt_append_ (stmt
);
4054 ffestd_subr_line_save_ (stmt
);
4055 stmt
->u
.R919
.pool
= ffesta_output_pool
;
4056 stmt
->u
.R919
.params
= ffestd_subr_copy_beru_ ();
4057 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
4062 /* ffestd_R920 -- ENDFILE statement
4066 Make sure a ENDFILE is valid in the current context, and implement it. */
4071 ffestd_check_simple_ ();
4074 ffestd_subr_line_now_ ();
4075 ffeste_R920 (&ffestp_file
.beru
);
4080 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR920_
);
4081 ffestd_stmt_append_ (stmt
);
4082 ffestd_subr_line_save_ (stmt
);
4083 stmt
->u
.R920
.pool
= ffesta_output_pool
;
4084 stmt
->u
.R920
.params
= ffestd_subr_copy_beru_ ();
4085 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
4090 /* ffestd_R921 -- REWIND statement
4094 Make sure a REWIND is valid in the current context, and implement it. */
4099 ffestd_check_simple_ ();
4102 ffestd_subr_line_now_ ();
4103 ffeste_R921 (&ffestp_file
.beru
);
4108 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR921_
);
4109 ffestd_stmt_append_ (stmt
);
4110 ffestd_subr_line_save_ (stmt
);
4111 stmt
->u
.R921
.pool
= ffesta_output_pool
;
4112 stmt
->u
.R921
.params
= ffestd_subr_copy_beru_ ();
4113 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
4118 /* ffestd_R923A -- INQUIRE statement (non-IOLENGTH version)
4120 ffestd_R923A(bool by_file);
4122 Make sure an INQUIRE is valid in the current context, and implement it. */
4125 ffestd_R923A (bool by_file
)
4127 ffestd_check_simple_ ();
4129 #if FFECOM_targetCURRENT == FFECOM_targetGCC
4130 #define specified(something) \
4131 (ffestp_file.inquire.inquire_spec[something].kw_or_val_present)
4133 /* Warn if there are any thing we don't handle via f2c libraries. */
4134 if (specified (FFESTP_inquireixACTION
)
4135 || specified (FFESTP_inquireixCARRIAGECONTROL
)
4136 || specified (FFESTP_inquireixDEFAULTFILE
)
4137 || specified (FFESTP_inquireixDELIM
)
4138 || specified (FFESTP_inquireixKEYED
)
4139 || specified (FFESTP_inquireixORGANIZATION
)
4140 || specified (FFESTP_inquireixPAD
)
4141 || specified (FFESTP_inquireixPOSITION
)
4142 || specified (FFESTP_inquireixREAD
)
4143 || specified (FFESTP_inquireixREADWRITE
)
4144 || specified (FFESTP_inquireixRECORDTYPE
)
4145 || specified (FFESTP_inquireixWRITE
))
4147 ffebad_start (FFEBAD_INQUIRE_UNSUPPORTED
);
4148 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
4149 ffelex_token_where_column (ffesta_tokens
[0]));
4157 ffestd_subr_line_now_ ();
4158 ffeste_R923A (&ffestp_file
.inquire
, by_file
);
4163 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR923A_
);
4164 ffestd_stmt_append_ (stmt
);
4165 ffestd_subr_line_save_ (stmt
);
4166 stmt
->u
.R923A
.pool
= ffesta_output_pool
;
4167 stmt
->u
.R923A
.params
= ffestd_subr_copy_inquire_ ();
4168 stmt
->u
.R923A
.by_file
= by_file
;
4169 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
4174 /* ffestd_R923B_start -- INQUIRE(IOLENGTH=expr) statement list begin
4176 ffestd_R923B_start();
4178 Verify that INQUIRE is valid here, and begin accepting items in the
4182 ffestd_R923B_start ()
4184 ffestd_check_start_ ();
4187 ffestd_subr_line_now_ ();
4188 ffeste_R923B_start (&ffestp_file
.inquire
);
4193 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR923B_
);
4194 ffestd_stmt_append_ (stmt
);
4195 ffestd_subr_line_save_ (stmt
);
4196 stmt
->u
.R923B
.pool
= ffesta_output_pool
;
4197 stmt
->u
.R923B
.params
= ffestd_subr_copy_inquire_ ();
4198 stmt
->u
.R923B
.list
= NULL
;
4199 ffestd_expr_list_
= &stmt
->u
.R923B
.list
;
4200 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
4205 /* ffestd_R923B_item -- INQUIRE statement i/o item
4207 ffestd_R923B_item(expr,expr_token);
4209 Implement output-list expression. */
4212 ffestd_R923B_item (ffebld expr
)
4214 ffestd_check_item_ ();
4217 ffeste_R923B_item (expr
);
4220 ffestdExprItem_ item
4221 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
4226 *ffestd_expr_list_
= item
;
4227 ffestd_expr_list_
= &item
->next
;
4232 /* ffestd_R923B_finish -- INQUIRE statement list complete
4234 ffestd_R923B_finish();
4236 Just wrap up any local activities. */
4239 ffestd_R923B_finish ()
4241 ffestd_check_finish_ ();
4244 ffeste_R923B_finish ();
4246 /* Nothing to do, it's implicit. */
4250 /* ffestd_R1001 -- FORMAT statement
4252 ffestd_R1001(format_list); */
4255 ffestd_R1001 (ffesttFormatList f
)
4260 ffestd_check_simple_ ();
4262 if (ffestd_label_formatdef_
== NULL
)
4263 return; /* Nothing to hook it up to (no label def). */
4265 ffests_new (s
, malloc_pool_image (), 80);
4266 ffests_putc (s
, '(');
4267 ffestd_R1001dump_ (s
, f
); /* Build the string in s. */
4268 ffests_putc (s
, ')');
4272 ffests_kill (s
); /* Kill the string in s. */
4277 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1001_
);
4279 /* Don't bother with this. After all, things like cilists also are
4280 declared midway through code-generation. Perhaps the only problems
4281 the gcc back end has with midway declarations are with stack vars,
4282 maybe only with vars that can be put in registers. Unless/until the
4283 need is established, handle FORMAT just like cilists and others; at
4284 that point, they'd likely *all* have to be fixed, which would be
4285 very painful anyway. */
4286 /* Insert FORMAT statement just after the first item on the
4287 statement list, which must be a FORMAT label, which see. */
4288 assert (ffestd_stmt_list_
.first
->id
== FFESTD_stmtidFORMATLABEL_
);
4289 stmt
->previous
= ffestd_stmt_list_
.first
;
4290 stmt
->next
= ffestd_stmt_list_
.first
->next
;
4291 stmt
->next
->previous
= stmt
;
4292 stmt
->previous
->next
= stmt
;
4294 ffestd_stmt_append_ (stmt
);
4296 stmt
->u
.R1001
.str
= str
;
4300 ffestd_label_formatdef_
= NULL
;
4303 /* ffestd_R1001dump_ -- Dump list of formats
4305 ffesttFormatList list;
4306 ffestd_R1001dump_(list,0);
4308 The formats in the list are dumped. */
4311 ffestd_R1001dump_ (ffests s
, ffesttFormatList list
)
4313 ffesttFormatList next
;
4315 for (next
= list
->next
; next
!= list
; next
= next
->next
)
4317 if (next
!= list
->next
)
4318 ffests_putc (s
, ',');
4321 case FFESTP_formattypeI
:
4322 ffestd_R1001dump_1005_3_ (s
, next
, "I");
4325 case FFESTP_formattypeB
:
4326 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4327 ffestd_R1001dump_1005_3_ (s
, next
, "B");
4328 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4329 ffestd_R1001error_ (next
);
4335 case FFESTP_formattypeO
:
4336 ffestd_R1001dump_1005_3_ (s
, next
, "O");
4339 case FFESTP_formattypeZ
:
4340 ffestd_R1001dump_1005_3_ (s
, next
, "Z");
4343 case FFESTP_formattypeF
:
4344 ffestd_R1001dump_1005_4_ (s
, next
, "F");
4347 case FFESTP_formattypeE
:
4348 ffestd_R1001dump_1005_5_ (s
, next
, "E");
4351 case FFESTP_formattypeEN
:
4352 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4353 ffestd_R1001dump_1005_5_ (s
, next
, "EN");
4354 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4355 ffestd_R1001error_ (next
);
4361 case FFESTP_formattypeG
:
4362 ffestd_R1001dump_1005_5_ (s
, next
, "G");
4365 case FFESTP_formattypeL
:
4366 ffestd_R1001dump_1005_2_ (s
, next
, "L");
4369 case FFESTP_formattypeA
:
4370 ffestd_R1001dump_1005_1_ (s
, next
, "A");
4373 case FFESTP_formattypeD
:
4374 ffestd_R1001dump_1005_4_ (s
, next
, "D");
4377 case FFESTP_formattypeQ
:
4378 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4379 ffestd_R1001dump_1010_1_ (s
, next
, "Q");
4380 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4381 ffestd_R1001error_ (next
);
4387 case FFESTP_formattypeDOLLAR
:
4388 ffestd_R1001dump_1010_1_ (s
, next
, "$");
4391 case FFESTP_formattypeP
:
4392 ffestd_R1001dump_1010_4_ (s
, next
, "P");
4395 case FFESTP_formattypeT
:
4396 ffestd_R1001dump_1010_5_ (s
, next
, "T");
4399 case FFESTP_formattypeTL
:
4400 ffestd_R1001dump_1010_5_ (s
, next
, "TL");
4403 case FFESTP_formattypeTR
:
4404 ffestd_R1001dump_1010_5_ (s
, next
, "TR");
4407 case FFESTP_formattypeX
:
4408 ffestd_R1001dump_1010_3_ (s
, next
, "X");
4411 case FFESTP_formattypeS
:
4412 ffestd_R1001dump_1010_1_ (s
, next
, "S");
4415 case FFESTP_formattypeSP
:
4416 ffestd_R1001dump_1010_1_ (s
, next
, "SP");
4419 case FFESTP_formattypeSS
:
4420 ffestd_R1001dump_1010_1_ (s
, next
, "SS");
4423 case FFESTP_formattypeBN
:
4424 ffestd_R1001dump_1010_1_ (s
, next
, "BN");
4427 case FFESTP_formattypeBZ
:
4428 ffestd_R1001dump_1010_1_ (s
, next
, "BZ");
4431 case FFESTP_formattypeSLASH
:
4432 ffestd_R1001dump_1010_2_ (s
, next
, "/");
4435 case FFESTP_formattypeCOLON
:
4436 ffestd_R1001dump_1010_1_ (s
, next
, ":");
4439 case FFESTP_formattypeR1016
:
4440 switch (ffelex_token_type (next
->t
))
4442 case FFELEX_typeCHARACTER
:
4444 char *p
= ffelex_token_text (next
->t
);
4445 ffeTokenLength i
= ffelex_token_length (next
->t
);
4447 ffests_putc (s
, '\002');
4451 ffests_putc (s
, '\002');
4452 ffests_putc (s
, *p
);
4455 ffests_putc (s
, '\002');
4459 case FFELEX_typeHOLLERITH
:
4461 char *p
= ffelex_token_text (next
->t
);
4462 ffeTokenLength i
= ffelex_token_length (next
->t
);
4464 ffests_printf (s
, "%" ffeTokenLength_f
"uH", i
);
4467 ffests_putc (s
, *p
);
4478 case FFESTP_formattypeFORMAT
:
4479 if (next
->u
.R1003D
.R1004
.present
)
4481 if (next
->u
.R1003D
.R1004
.rtexpr
)
4482 ffestd_R1001rtexpr_ (s
, next
, next
->u
.R1003D
.R1004
.u
.expr
);
4484 ffests_printf (s
, "%lu", next
->u
.R1003D
.R1004
.u
.unsigned_val
);
4487 ffests_putc (s
, '(');
4488 ffestd_R1001dump_ (s
, next
->u
.R1003D
.format
);
4489 ffests_putc (s
, ')');
4498 /* ffestd_R1001dump_1005_1_ -- Dump a particular format
4501 ffestd_R1001dump_1005_1_(f,"I");
4503 The format is dumped with form [r]X[w]. */
4506 ffestd_R1001dump_1005_1_ (ffests s
, ffesttFormatList f
, const char *string
)
4508 assert (!f
->u
.R1005
.R1007_or_R1008
.present
);
4509 assert (!f
->u
.R1005
.R1009
.present
);
4511 if (f
->u
.R1005
.R1004
.present
)
4513 if (f
->u
.R1005
.R1004
.rtexpr
)
4514 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4516 ffests_printf (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4519 ffests_puts (s
, string
);
4521 if (f
->u
.R1005
.R1006
.present
)
4523 if (f
->u
.R1005
.R1006
.rtexpr
)
4524 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4526 ffests_printf (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4530 /* ffestd_R1001dump_1005_2_ -- Dump a particular format
4533 ffestd_R1001dump_1005_2_(f,"I");
4535 The format is dumped with form [r]Xw. */
4538 ffestd_R1001dump_1005_2_ (ffests s
, ffesttFormatList f
, const char *string
)
4540 assert (!f
->u
.R1005
.R1007_or_R1008
.present
);
4541 assert (!f
->u
.R1005
.R1009
.present
);
4542 assert (f
->u
.R1005
.R1006
.present
);
4544 if (f
->u
.R1005
.R1004
.present
)
4546 if (f
->u
.R1005
.R1004
.rtexpr
)
4547 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4549 ffests_printf (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4552 ffests_puts (s
, string
);
4554 if (f
->u
.R1005
.R1006
.rtexpr
)
4555 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4557 ffests_printf (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4560 /* ffestd_R1001dump_1005_3_ -- Dump a particular format
4563 ffestd_R1001dump_1005_3_(f,"I");
4565 The format is dumped with form [r]Xw[.m]. */
4568 ffestd_R1001dump_1005_3_ (ffests s
, ffesttFormatList f
, const char *string
)
4570 assert (!f
->u
.R1005
.R1009
.present
);
4571 assert (f
->u
.R1005
.R1006
.present
);
4573 if (f
->u
.R1005
.R1004
.present
)
4575 if (f
->u
.R1005
.R1004
.rtexpr
)
4576 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4578 ffests_printf (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4581 ffests_puts (s
, string
);
4583 if (f
->u
.R1005
.R1006
.rtexpr
)
4584 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4586 ffests_printf (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4588 if (f
->u
.R1005
.R1007_or_R1008
.present
)
4590 ffests_putc (s
, '.');
4591 if (f
->u
.R1005
.R1007_or_R1008
.rtexpr
)
4592 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1007_or_R1008
.u
.expr
);
4594 ffests_printf (s
, "%lu", f
->u
.R1005
.R1007_or_R1008
.u
.unsigned_val
);
4598 /* ffestd_R1001dump_1005_4_ -- Dump a particular format
4601 ffestd_R1001dump_1005_4_(f,"I");
4603 The format is dumped with form [r]Xw.d. */
4606 ffestd_R1001dump_1005_4_ (ffests s
, ffesttFormatList f
, const char *string
)
4608 assert (!f
->u
.R1005
.R1009
.present
);
4609 assert (f
->u
.R1005
.R1007_or_R1008
.present
);
4610 assert (f
->u
.R1005
.R1006
.present
);
4612 if (f
->u
.R1005
.R1004
.present
)
4614 if (f
->u
.R1005
.R1004
.rtexpr
)
4615 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4617 ffests_printf (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4620 ffests_puts (s
, string
);
4622 if (f
->u
.R1005
.R1006
.rtexpr
)
4623 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4625 ffests_printf (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4627 ffests_putc (s
, '.');
4628 if (f
->u
.R1005
.R1007_or_R1008
.rtexpr
)
4629 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1007_or_R1008
.u
.expr
);
4631 ffests_printf (s
, "%lu", f
->u
.R1005
.R1007_or_R1008
.u
.unsigned_val
);
4634 /* ffestd_R1001dump_1005_5_ -- Dump a particular format
4637 ffestd_R1001dump_1005_5_(f,"I");
4639 The format is dumped with form [r]Xw.d[Ee]. */
4642 ffestd_R1001dump_1005_5_ (ffests s
, ffesttFormatList f
, const char *string
)
4644 assert (f
->u
.R1005
.R1007_or_R1008
.present
);
4645 assert (f
->u
.R1005
.R1006
.present
);
4647 if (f
->u
.R1005
.R1004
.present
)
4649 if (f
->u
.R1005
.R1004
.rtexpr
)
4650 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4652 ffests_printf (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4655 ffests_puts (s
, string
);
4657 if (f
->u
.R1005
.R1006
.rtexpr
)
4658 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4660 ffests_printf (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4662 ffests_putc (s
, '.');
4663 if (f
->u
.R1005
.R1007_or_R1008
.rtexpr
)
4664 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1007_or_R1008
.u
.expr
);
4666 ffests_printf (s
, "%lu", f
->u
.R1005
.R1007_or_R1008
.u
.unsigned_val
);
4668 if (f
->u
.R1005
.R1009
.present
)
4670 ffests_putc (s
, 'E');
4671 if (f
->u
.R1005
.R1009
.rtexpr
)
4672 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1009
.u
.expr
);
4674 ffests_printf (s
, "%lu", f
->u
.R1005
.R1009
.u
.unsigned_val
);
4678 /* ffestd_R1001dump_1010_1_ -- Dump a particular format
4681 ffestd_R1001dump_1010_1_(f,"I");
4683 The format is dumped with form X. */
4686 ffestd_R1001dump_1010_1_ (ffests s
, ffesttFormatList f
, const char *string
)
4688 assert (!f
->u
.R1010
.val
.present
);
4690 ffests_puts (s
, string
);
4693 /* ffestd_R1001dump_1010_2_ -- Dump a particular format
4696 ffestd_R1001dump_1010_2_(f,"I");
4698 The format is dumped with form [r]X. */
4701 ffestd_R1001dump_1010_2_ (ffests s
, ffesttFormatList f
, const char *string
)
4703 if (f
->u
.R1010
.val
.present
)
4705 if (f
->u
.R1010
.val
.rtexpr
)
4706 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4708 ffests_printf (s
, "%lu", f
->u
.R1010
.val
.u
.unsigned_val
);
4711 ffests_puts (s
, string
);
4714 /* ffestd_R1001dump_1010_3_ -- Dump a particular format
4717 ffestd_R1001dump_1010_3_(f,"I");
4719 The format is dumped with form nX. */
4722 ffestd_R1001dump_1010_3_ (ffests s
, ffesttFormatList f
, const char *string
)
4724 assert (f
->u
.R1010
.val
.present
);
4726 if (f
->u
.R1010
.val
.rtexpr
)
4727 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4729 ffests_printf (s
, "%lu", f
->u
.R1010
.val
.u
.unsigned_val
);
4731 ffests_puts (s
, string
);
4734 /* ffestd_R1001dump_1010_4_ -- Dump a particular format
4737 ffestd_R1001dump_1010_4_(f,"I");
4739 The format is dumped with form kX. Note that k is signed. */
4742 ffestd_R1001dump_1010_4_ (ffests s
, ffesttFormatList f
, const char *string
)
4744 assert (f
->u
.R1010
.val
.present
);
4746 if (f
->u
.R1010
.val
.rtexpr
)
4747 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4749 ffests_printf (s
, "%ld", f
->u
.R1010
.val
.u
.signed_val
);
4751 ffests_puts (s
, string
);
4754 /* ffestd_R1001dump_1010_5_ -- Dump a particular format
4757 ffestd_R1001dump_1010_5_(f,"I");
4759 The format is dumped with form Xn. */
4762 ffestd_R1001dump_1010_5_ (ffests s
, ffesttFormatList f
, const char *string
)
4764 assert (f
->u
.R1010
.val
.present
);
4766 ffests_puts (s
, string
);
4768 if (f
->u
.R1010
.val
.rtexpr
)
4769 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4771 ffests_printf (s
, "%lu", f
->u
.R1010
.val
.u
.unsigned_val
);
4774 /* ffestd_R1001error_ -- Complain about FORMAT specification not supported
4777 ffestd_R1001error_(f);
4779 An error message is produced. */
4782 ffestd_R1001error_ (ffesttFormatList f
)
4784 ffebad_start (FFEBAD_FORMAT_UNSUPPORTED
);
4785 ffebad_here (0, ffelex_token_where_line (f
->t
), ffelex_token_where_column (f
->t
));
4790 ffestd_R1001rtexpr_ (ffests s
, ffesttFormatList f
, ffebld expr
)
4793 || (ffebld_op (expr
) != FFEBLD_opCONTER
)
4794 || (ffeinfo_basictype (ffebld_info (expr
)) != FFEINFO_basictypeINTEGER
)
4795 || (ffeinfo_kindtype (ffebld_info (expr
)) == FFEINFO_kindtypeINTEGER4
))
4797 ffebad_start (FFEBAD_FORMAT_VARIABLE
);
4798 ffebad_here (0, ffelex_token_where_line (f
->t
), ffelex_token_where_column (f
->t
));
4805 switch (ffeinfo_kindtype (ffebld_info (expr
)))
4807 #if FFETARGET_okINTEGER1
4808 case FFEINFO_kindtypeINTEGER1
:
4809 val
= ffebld_constant_integer1 (ffebld_conter (expr
));
4813 #if FFETARGET_okINTEGER2
4814 case FFEINFO_kindtypeINTEGER2
:
4815 val
= ffebld_constant_integer2 (ffebld_conter (expr
));
4819 #if FFETARGET_okINTEGER3
4820 case FFEINFO_kindtypeINTEGER3
:
4821 val
= ffebld_constant_integer3 (ffebld_conter (expr
));
4826 assert ("bad INTEGER constant kind type" == NULL
);
4828 case FFEINFO_kindtypeANY
:
4831 ffests_printf (s
, "%ld", (long) val
);
4835 /* ffestd_R1102 -- PROGRAM statement
4837 ffestd_R1102(name_token);
4839 Make sure ffestd_kind_ identifies an empty block. Make sure name_token
4840 gives a valid name. Implement the beginning of a main program. */
4843 ffestd_R1102 (ffesymbol s
, ffelexToken name UNUSED
)
4845 ffestd_check_simple_ ();
4847 assert (ffestd_block_level_
== 0);
4848 ffestd_is_reachable_
= TRUE
;
4850 ffecom_notify_primary_entry (s
);
4851 ffe_set_is_mainprog (TRUE
); /* Is a main program. */
4852 ffe_set_is_saveall (TRUE
); /* Main program always has implicit SAVE. */
4854 ffestw_set_sym (ffestw_stack_top (), s
);
4856 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4858 fputs ("< PROGRAM_unnamed\n", dmpout
);
4860 fprintf (dmpout
, "< PROGRAM %s\n", ffelex_token_text (name
));
4861 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4867 /* ffestd_R1103 -- End a PROGRAM
4872 ffestd_R1103 (bool ok UNUSED
)
4874 assert (ffestd_block_level_
== 0);
4876 if (FFESTD_IS_END_OPTIMIZED_
&& ffestd_is_reachable_
)
4877 ffestd_R842 (NULL
); /* Generate STOP. */
4879 if (ffestw_state (ffestw_stack_top ()) != FFESTV_statePROGRAM5
)
4880 ffestd_subr_labels_ (FALSE
);/* Handle any undefined labels. */
4888 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1103_
);
4889 ffestd_stmt_append_ (stmt
);
4894 /* ffestd_R1105 -- MODULE statement
4896 ffestd_R1105(name_token);
4898 Make sure ffestd_kind_ identifies an empty block. Make sure name_token
4899 gives a valid name. Implement the beginning of a module. */
4903 ffestd_R1105 (ffelexToken name
)
4905 assert (ffestd_block_level_
== 0);
4907 ffestd_check_simple_ ();
4909 ffestd_subr_f90_ ();
4913 fprintf (dmpout
, "* MODULE %s\n", ffelex_token_text (name
));
4917 /* ffestd_R1106 -- End a MODULE
4919 ffestd_R1106(TRUE); */
4922 ffestd_R1106 (bool ok
)
4924 assert (ffestd_block_level_
== 0);
4926 /* Generate any wrap-up code here (unlikely in MODULE!). */
4928 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateMODULE5
)
4929 ffestd_subr_labels_ (TRUE
); /* Handle any undefined labels (unlikely). */
4934 fprintf (dmpout
, "< END_MODULE %s\n",
4935 ffelex_token_text (ffestw_name (ffestw_stack_top ())));
4939 /* ffestd_R1107_start -- USE statement list begin
4941 ffestd_R1107_start();
4943 Verify that USE is valid here, and begin accepting items in the list. */
4946 ffestd_R1107_start (ffelexToken name
, bool only
)
4948 ffestd_check_start_ ();
4950 ffestd_subr_f90_ ();
4954 fprintf (dmpout
, "* USE %s,", ffelex_token_text (name
)); /* NB
4955 _shriek_begin_uses_. */
4957 fputs ("only: ", dmpout
);
4961 /* ffestd_R1107_item -- USE statement for name
4963 ffestd_R1107_item(local_token,use_token);
4965 Make sure name_token identifies a valid object to be USEed. local_token
4966 may be NULL if _start_ was called with only==TRUE. */
4969 ffestd_R1107_item (ffelexToken local
, ffelexToken use
)
4971 ffestd_check_item_ ();
4972 assert (use
!= NULL
);
4978 fprintf (dmpout
, "%s=>", ffelex_token_text (local
));
4979 fprintf (dmpout
, "%s,", ffelex_token_text (use
));
4983 /* ffestd_R1107_finish -- USE statement list complete
4985 ffestd_R1107_finish();
4987 Just wrap up any local activities. */
4990 ffestd_R1107_finish ()
4992 ffestd_check_finish_ ();
4997 fputc ('\n', dmpout
);
5002 /* ffestd_R1111 -- BLOCK DATA statement
5004 ffestd_R1111(name_token);
5006 Make sure ffestd_kind_ identifies no current program unit. If not
5007 NULL, make sure name_token gives a valid name. Implement the beginning
5008 of a block data program unit. */
5011 ffestd_R1111 (ffesymbol s
, ffelexToken name UNUSED
)
5013 assert (ffestd_block_level_
== 0);
5014 ffestd_is_reachable_
= TRUE
;
5016 ffestd_check_simple_ ();
5018 ffecom_notify_primary_entry (s
);
5019 ffestw_set_sym (ffestw_stack_top (), s
);
5021 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5023 fputs ("< BLOCK_DATA_unnamed\n", dmpout
);
5025 fprintf (dmpout
, "< BLOCK_DATA %s\n", ffelex_token_text (name
));
5026 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5032 /* ffestd_R1112 -- End a BLOCK DATA
5034 ffestd_R1112(TRUE); */
5037 ffestd_R1112 (bool ok UNUSED
)
5039 assert (ffestd_block_level_
== 0);
5041 /* Generate any return-like code here (not likely for BLOCK DATA!). */
5043 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateBLOCKDATA5
)
5044 ffestd_subr_labels_ (TRUE
); /* Handle any undefined labels. */
5052 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1112_
);
5053 ffestd_stmt_append_ (stmt
);
5058 /* ffestd_R1202 -- INTERFACE statement
5060 ffestd_R1202(operator,defined_name);
5062 Make sure ffestd_kind_ identifies an INTERFACE block.
5063 Implement the end of the current interface.
5066 Allow no operator or name to mean INTERFACE by itself; missed this
5067 valid form when originally doing syntactic analysis code. */
5071 ffestd_R1202 (ffestpDefinedOperator
operator, ffelexToken name
)
5073 ffestd_check_simple_ ();
5075 ffestd_subr_f90_ ();
5081 case FFESTP_definedoperatorNone
:
5083 fputs ("* INTERFACE_unnamed\n", dmpout
);
5085 fprintf (dmpout
, "* INTERFACE %s\n", ffelex_token_text (name
));
5088 case FFESTP_definedoperatorOPERATOR
:
5089 fprintf (dmpout
, "* INTERFACE_OPERATOR (.%s.)\n", ffelex_token_text (name
));
5092 case FFESTP_definedoperatorASSIGNMENT
:
5093 fputs ("* INTERFACE_ASSIGNMENT (=)\n", dmpout
);
5096 case FFESTP_definedoperatorPOWER
:
5097 fputs ("* INTERFACE_OPERATOR (**)\n", dmpout
);
5100 case FFESTP_definedoperatorMULT
:
5101 fputs ("* INTERFACE_OPERATOR (*)\n", dmpout
);
5104 case FFESTP_definedoperatorADD
:
5105 fputs ("* INTERFACE_OPERATOR (+)\n", dmpout
);
5108 case FFESTP_definedoperatorCONCAT
:
5109 fputs ("* INTERFACE_OPERATOR (//)\n", dmpout
);
5112 case FFESTP_definedoperatorDIVIDE
:
5113 fputs ("* INTERFACE_OPERATOR (/)\n", dmpout
);
5116 case FFESTP_definedoperatorSUBTRACT
:
5117 fputs ("* INTERFACE_OPERATOR (-)\n", dmpout
);
5120 case FFESTP_definedoperatorNOT
:
5121 fputs ("* INTERFACE_OPERATOR (.not.)\n", dmpout
);
5124 case FFESTP_definedoperatorAND
:
5125 fputs ("* INTERFACE_OPERATOR (.and.)\n", dmpout
);
5128 case FFESTP_definedoperatorOR
:
5129 fputs ("* INTERFACE_OPERATOR (.or.)\n", dmpout
);
5132 case FFESTP_definedoperatorEQV
:
5133 fputs ("* INTERFACE_OPERATOR (.eqv.)\n", dmpout
);
5136 case FFESTP_definedoperatorNEQV
:
5137 fputs ("* INTERFACE_OPERATOR (.neqv.)\n", dmpout
);
5140 case FFESTP_definedoperatorEQ
:
5141 fputs ("* INTERFACE_OPERATOR (==)\n", dmpout
);
5144 case FFESTP_definedoperatorNE
:
5145 fputs ("* INTERFACE_OPERATOR (/=)\n", dmpout
);
5148 case FFESTP_definedoperatorLT
:
5149 fputs ("* INTERFACE_OPERATOR (<)\n", dmpout
);
5152 case FFESTP_definedoperatorLE
:
5153 fputs ("* INTERFACE_OPERATOR (<=)\n", dmpout
);
5156 case FFESTP_definedoperatorGT
:
5157 fputs ("* INTERFACE_OPERATOR (>)\n", dmpout
);
5160 case FFESTP_definedoperatorGE
:
5161 fputs ("* INTERFACE_OPERATOR (>=)\n", dmpout
);
5171 /* ffestd_R1203 -- End an INTERFACE
5173 ffestd_R1203(TRUE); */
5176 ffestd_R1203 (bool ok
)
5181 fputs ("* END_INTERFACE\n", dmpout
);
5185 /* ffestd_R1205_start -- MODULE PROCEDURE statement list begin
5187 ffestd_R1205_start();
5189 Verify that MODULE PROCEDURE is valid here, and begin accepting items in
5193 ffestd_R1205_start ()
5195 ffestd_check_start_ ();
5200 fputs ("* MODULE_PROCEDURE ", dmpout
);
5204 /* ffestd_R1205_item -- MODULE PROCEDURE statement for name
5206 ffestd_R1205_item(name_token);
5208 Make sure name_token identifies a valid object to be MODULE PROCEDUREed. */
5211 ffestd_R1205_item (ffelexToken name
)
5213 ffestd_check_item_ ();
5214 assert (name
!= NULL
);
5219 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
5223 /* ffestd_R1205_finish -- MODULE PROCEDURE statement list complete
5225 ffestd_R1205_finish();
5227 Just wrap up any local activities. */
5230 ffestd_R1205_finish ()
5232 ffestd_check_finish_ ();
5237 fputc ('\n', dmpout
);
5242 /* ffestd_R1207_start -- EXTERNAL statement list begin
5244 ffestd_R1207_start();
5246 Verify that EXTERNAL is valid here, and begin accepting items in the list. */
5249 ffestd_R1207_start ()
5251 ffestd_check_start_ ();
5253 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5254 fputs ("* EXTERNAL (", dmpout
);
5255 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5261 /* ffestd_R1207_item -- EXTERNAL statement for name
5263 ffestd_R1207_item(name_token);
5265 Make sure name_token identifies a valid object to be EXTERNALd. */
5268 ffestd_R1207_item (ffelexToken name
)
5270 ffestd_check_item_ ();
5271 assert (name
!= NULL
);
5273 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5274 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
5275 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5281 /* ffestd_R1207_finish -- EXTERNAL statement list complete
5283 ffestd_R1207_finish();
5285 Just wrap up any local activities. */
5288 ffestd_R1207_finish ()
5290 ffestd_check_finish_ ();
5292 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5293 fputs (")\n", dmpout
);
5294 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5300 /* ffestd_R1208_start -- INTRINSIC statement list begin
5302 ffestd_R1208_start();
5304 Verify that INTRINSIC is valid here, and begin accepting items in the list. */
5307 ffestd_R1208_start ()
5309 ffestd_check_start_ ();
5311 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5312 fputs ("* INTRINSIC (", dmpout
);
5313 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5319 /* ffestd_R1208_item -- INTRINSIC statement for name
5321 ffestd_R1208_item(name_token);
5323 Make sure name_token identifies a valid object to be INTRINSICd. */
5326 ffestd_R1208_item (ffelexToken name
)
5328 ffestd_check_item_ ();
5329 assert (name
!= NULL
);
5331 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5332 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
5333 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5339 /* ffestd_R1208_finish -- INTRINSIC statement list complete
5341 ffestd_R1208_finish();
5343 Just wrap up any local activities. */
5346 ffestd_R1208_finish ()
5348 ffestd_check_finish_ ();
5350 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5351 fputs (")\n", dmpout
);
5352 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5358 /* ffestd_R1212 -- CALL statement
5360 ffestd_R1212(expr,expr_token);
5362 Make sure statement is valid here; implement. */
5365 ffestd_R1212 (ffebld expr
)
5367 ffestd_check_simple_ ();
5370 ffestd_subr_line_now_ ();
5371 ffeste_R1212 (expr
);
5376 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1212_
);
5377 ffestd_stmt_append_ (stmt
);
5378 ffestd_subr_line_save_ (stmt
);
5379 stmt
->u
.R1212
.pool
= ffesta_output_pool
;
5380 stmt
->u
.R1212
.expr
= expr
;
5381 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5386 /* ffestd_R1213 -- Defined assignment statement
5388 ffestd_R1213(dest_expr,source_expr,source_token);
5390 Make sure the assignment is valid. */
5394 ffestd_R1213 (ffebld dest
, ffebld source
)
5396 ffestd_check_simple_ ();
5398 ffestd_subr_f90_ ();
5402 fputs ("+ let_defined ", dmpout
);
5404 fputs ("=", dmpout
);
5405 ffebld_dump (source
);
5406 fputc ('\n', dmpout
);
5411 /* ffestd_R1219 -- FUNCTION statement
5413 ffestd_R1219(funcname,arglist,ending_token,kind,kindt,len,lent,
5416 Make sure statement is valid here, register arguments for the
5417 function name, and so on.
5420 Added the kind, len, and recursive arguments. */
5423 ffestd_R1219 (ffesymbol s
, ffelexToken funcname UNUSED
,
5424 ffesttTokenList args UNUSED
, ffestpType type UNUSED
,
5425 ffebld kind UNUSED
, ffelexToken kindt UNUSED
,
5426 ffebld len UNUSED
, ffelexToken lent UNUSED
,
5427 bool recursive UNUSED
, ffelexToken result UNUSED
,
5428 bool separate_result UNUSED
)
5430 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5434 assert (ffestd_block_level_
== 0);
5435 ffestd_is_reachable_
= TRUE
;
5437 ffestd_check_simple_ ();
5439 ffecom_notify_primary_entry (s
);
5440 ffestw_set_sym (ffestw_stack_top (), s
);
5442 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5445 case FFESTP_typeINTEGER
:
5449 case FFESTP_typeBYTE
:
5453 case FFESTP_typeWORD
:
5457 case FFESTP_typeREAL
:
5461 case FFESTP_typeCOMPLEX
:
5465 case FFESTP_typeLOGICAL
:
5469 case FFESTP_typeCHARACTER
:
5473 case FFESTP_typeDBLPRCSN
:
5474 a
= "DOUBLE PRECISION";
5477 case FFESTP_typeDBLCMPLX
:
5478 a
= "DOUBLE COMPLEX";
5482 case FFESTP_typeTYPE
:
5487 case FFESTP_typeNone
:
5496 fprintf (dmpout
, "< FUNCTION %s ", ffelex_token_text (funcname
));
5498 fputs ("RECURSIVE ", dmpout
);
5499 fprintf (dmpout
, "%s(", a
);
5502 fputs ("kind=", dmpout
);
5504 fputs (ffelex_token_text (kindt
), dmpout
);
5508 fputc (',', dmpout
);
5512 fputs ("len=", dmpout
);
5514 fputs (ffelex_token_text (lent
), dmpout
);
5518 fprintf (dmpout
, ")");
5521 fputs (" (", dmpout
);
5522 ffestt_tokenlist_dump (args
);
5523 fputc (')', dmpout
);
5526 fprintf (dmpout
, " result(%s)", ffelex_token_text (result
));
5527 fputc ('\n', dmpout
);
5528 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5534 /* ffestd_R1221 -- End a FUNCTION
5536 ffestd_R1221(TRUE); */
5539 ffestd_R1221 (bool ok UNUSED
)
5541 assert (ffestd_block_level_
== 0);
5543 if (FFESTD_IS_END_OPTIMIZED_
&& ffestd_is_reachable_
)
5544 ffestd_R1227 (NULL
); /* Generate RETURN. */
5546 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateFUNCTION5
)
5547 ffestd_subr_labels_ (FALSE
);/* Handle any undefined labels. */
5555 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1221_
);
5556 ffestd_stmt_append_ (stmt
);
5561 /* ffestd_R1223 -- SUBROUTINE statement
5563 ffestd_R1223(subrname,arglist,ending_token,recursive_token);
5565 Make sure statement is valid here, register arguments for the
5566 subroutine name, and so on.
5569 Added the recursive argument. */
5572 ffestd_R1223 (ffesymbol s
, ffelexToken subrname UNUSED
,
5573 ffesttTokenList args UNUSED
, ffelexToken final UNUSED
,
5574 bool recursive UNUSED
)
5576 assert (ffestd_block_level_
== 0);
5577 ffestd_is_reachable_
= TRUE
;
5579 ffestd_check_simple_ ();
5581 ffecom_notify_primary_entry (s
);
5582 ffestw_set_sym (ffestw_stack_top (), s
);
5584 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5585 fprintf (dmpout
, "< SUBROUTINE %s ", ffelex_token_text (subrname
));
5587 fputs ("recursive ", dmpout
);
5590 fputc ('(', dmpout
);
5591 ffestt_tokenlist_dump (args
);
5592 fputc (')', dmpout
);
5594 fputc ('\n', dmpout
);
5595 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5601 /* ffestd_R1225 -- End a SUBROUTINE
5603 ffestd_R1225(TRUE); */
5606 ffestd_R1225 (bool ok UNUSED
)
5608 assert (ffestd_block_level_
== 0);
5610 if (FFESTD_IS_END_OPTIMIZED_
&& ffestd_is_reachable_
)
5611 ffestd_R1227 (NULL
); /* Generate RETURN. */
5613 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateSUBROUTINE5
)
5614 ffestd_subr_labels_ (FALSE
);/* Handle any undefined labels. */
5622 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1225_
);
5623 ffestd_stmt_append_ (stmt
);
5628 /* ffestd_R1226 -- ENTRY statement
5630 ffestd_R1226(entryname,arglist,ending_token);
5632 Make sure we're in a SUBROUTINE or FUNCTION, register arguments for the
5633 entry point name, and so on. */
5636 ffestd_R1226 (ffesymbol entry
)
5638 ffestd_check_simple_ ();
5640 #if (FFECOM_targetCURRENT == FFECOM_targetFFE) || FFECOM_ONEPASS
5641 ffestd_subr_line_now_ ();
5642 ffeste_R1226 (entry
);
5644 if (!ffesta_seen_first_exec
|| ffecom_2pass_advise_entrypoint (entry
))
5648 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1226_
);
5649 ffestd_stmt_append_ (stmt
);
5650 ffestd_subr_line_save_ (stmt
);
5651 stmt
->u
.R1226
.entry
= entry
;
5652 stmt
->u
.R1226
.entrynum
= ++ffestd_2pass_entrypoints_
;
5656 ffestd_is_reachable_
= TRUE
;
5659 /* ffestd_R1227 -- RETURN statement
5663 Make sure statement is valid here; implement. expr and expr_token are
5664 both NULL if there was no expression. */
5667 ffestd_R1227 (ffebld expr
)
5669 ffestd_check_simple_ ();
5672 ffestd_subr_line_now_ ();
5673 ffeste_R1227 (ffestw_stack_top (), expr
);
5678 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1227_
);
5679 ffestd_stmt_append_ (stmt
);
5680 ffestd_subr_line_save_ (stmt
);
5681 stmt
->u
.R1227
.pool
= ffesta_output_pool
;
5682 stmt
->u
.R1227
.block
= ffestw_stack_top ();
5683 stmt
->u
.R1227
.expr
= expr
;
5684 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5688 if (ffestd_block_level_
== 0)
5689 ffestd_is_reachable_
= FALSE
;
5692 /* ffestd_R1228 -- CONTAINS statement
5700 assert (ffestd_block_level_
== 0);
5702 ffestd_check_simple_ ();
5704 /* Generate RETURN/STOP code here */
5706 ffestd_subr_labels_ (ffestw_state (ffestw_stack_top ())
5707 == FFESTV_stateMODULE5
); /* Handle any undefined
5710 ffestd_subr_f90_ ();
5714 fputs ("- CONTAINS\n", dmpout
);
5719 /* ffestd_R1229_start -- STMTFUNCTION statement begin
5721 ffestd_R1229_start(func_name,func_arg_list,close_paren);
5723 This function does not really need to do anything, since _finish_
5724 gets all the info needed, and ffestc_R1229_start has already
5725 done all the stuff that makes a two-phase operation (start and
5726 finish) for handling statement functions necessary.
5729 Do nothing, now that _finish_ does everything. */
5732 ffestd_R1229_start (ffelexToken name UNUSED
, ffesttTokenList args UNUSED
)
5734 ffestd_check_start_ ();
5736 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5737 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5743 /* ffestd_R1229_finish -- STMTFUNCTION statement list complete
5745 ffestd_R1229_finish(s);
5747 The statement function's symbol is passed. Its list of dummy args is
5748 accessed via ffesymbol_dummyargs and its expansion expression (expr)
5749 is accessed via ffesymbol_sfexpr.
5751 If sfexpr is NULL, an error occurred parsing the expansion expression, so
5752 just cancel the effects of ffestd_R1229_start and pretend nothing
5753 happened. Otherwise, install the expression as the expansion for the
5754 statement function, then clean up.
5757 Takes sfunc sym instead of just the expansion expression as an
5758 argument, so this function can do all the work, and _start_ is just
5759 a nicety than can do nothing in a back end. */
5762 ffestd_R1229_finish (ffesymbol s
)
5764 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5765 ffebld args
= ffesymbol_dummyargs (s
);
5767 ffebld expr
= ffesymbol_sfexpr (s
);
5769 ffestd_check_finish_ ();
5772 return; /* Nothing to do, definition didn't work. */
5774 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5775 fprintf (dmpout
, "* stmtfunction %s(", ffesymbol_text (s
));
5776 for (; args
!= NULL
; args
= ffebld_trail (args
))
5777 fprintf (dmpout
, "%s,", ffesymbol_text (ffebld_symter (ffebld_head (args
))));
5778 fputs (")=", dmpout
);
5780 fputc ('\n', dmpout
);
5781 #if 0 /* Normally no need to preserve the
5783 ffesymbol_set_sfexpr (s
, NULL
); /* Except expr.c sees NULL
5784 as recursive reference!
5785 So until we can use something
5786 convenient, like a "permanent"
5787 expression, don't worry about
5788 wasting some memory in the
5791 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5793 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5794 /* With gcc, cannot do anything here, because the backend hasn't even
5795 (necessarily) been notified that we're compiling a program unit! */
5797 #if 0 /* Must preserve the expression for gcc. */
5798 ffesymbol_set_sfexpr (s
, NULL
);
5800 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5807 /* ffestd_S3P4 -- INCLUDE line
5809 ffestd_S3P4(filename,filename_token);
5811 Make sure INCLUDE not preceded by any semicolons or a label def; implement. */
5814 ffestd_S3P4 (ffebld filename
)
5817 ffetargetCharacterDefault buildname
;
5820 ffestd_check_simple_ ();
5822 assert (filename
!= NULL
);
5823 if (ffebld_op (filename
) != FFEBLD_opANY
)
5825 assert (ffebld_op (filename
) == FFEBLD_opCONTER
);
5826 assert (ffeinfo_basictype (ffebld_info (filename
))
5827 == FFEINFO_basictypeCHARACTER
);
5828 assert (ffeinfo_kindtype (ffebld_info (filename
))
5829 == FFEINFO_kindtypeCHARACTERDEFAULT
);
5830 buildname
= ffebld_constant_characterdefault (ffebld_conter (filename
));
5831 wf
= ffewhere_file_new (ffetarget_text_characterdefault (buildname
),
5832 ffetarget_length_characterdefault (buildname
));
5833 fi
= ffecom_open_include (ffewhere_file_name (wf
),
5834 ffelex_token_where_line (ffesta_tokens
[0]),
5835 ffelex_token_where_column (ffesta_tokens
[0]));
5837 ffewhere_file_kill (wf
);
5839 ffelex_set_include (wf
, (ffelex_token_type (ffesta_tokens
[0])
5840 == FFELEX_typeNAME
), fi
);
5844 /* ffestd_V003_start -- STRUCTURE statement list begin
5846 ffestd_V003_start(structure_name);
5848 Verify that STRUCTURE is valid here, and begin accepting items in the list. */
5852 ffestd_V003_start (ffelexToken structure_name
)
5854 ffestd_check_start_ ();
5856 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5857 if (structure_name
== NULL
)
5858 fputs ("* STRUCTURE_unnamed ", dmpout
);
5860 fprintf (dmpout
, "* STRUCTURE %s ", ffelex_token_text (structure_name
));
5861 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5862 ffestd_subr_vxt_ ();
5868 /* ffestd_V003_item -- STRUCTURE statement for object-name
5870 ffestd_V003_item(name_token,dim_list);
5872 Make sure name_token identifies a valid object to be STRUCTUREd. */
5875 ffestd_V003_item (ffelexToken name
, ffesttDimList dims
)
5877 ffestd_check_item_ ();
5879 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5880 fputs (ffelex_token_text (name
), dmpout
);
5883 fputc ('(', dmpout
);
5884 ffestt_dimlist_dump (dims
);
5885 fputc (')', dmpout
);
5887 fputc (',', dmpout
);
5888 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5894 /* ffestd_V003_finish -- STRUCTURE statement list complete
5896 ffestd_V003_finish();
5898 Just wrap up any local activities. */
5901 ffestd_V003_finish ()
5903 ffestd_check_finish_ ();
5905 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5906 fputc ('\n', dmpout
);
5907 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5913 /* ffestd_V004 -- End a STRUCTURE
5915 ffestd_V004(TRUE); */
5918 ffestd_V004 (bool ok
)
5920 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5921 fputs ("* END_STRUCTURE\n", dmpout
);
5922 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5928 /* ffestd_V009 -- UNION statement
5935 ffestd_check_simple_ ();
5937 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5938 fputs ("* UNION\n", dmpout
);
5939 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5945 /* ffestd_V010 -- End a UNION
5947 ffestd_V010(TRUE); */
5950 ffestd_V010 (bool ok
)
5952 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5953 fputs ("* END_UNION\n", dmpout
);
5954 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5960 /* ffestd_V012 -- MAP statement
5967 ffestd_check_simple_ ();
5969 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5970 fputs ("* MAP\n", dmpout
);
5971 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5977 /* ffestd_V013 -- End a MAP
5979 ffestd_V013(TRUE); */
5982 ffestd_V013 (bool ok
)
5984 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5985 fputs ("* END_MAP\n", dmpout
);
5986 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5993 /* ffestd_V014_start -- VOLATILE statement list begin
5995 ffestd_V014_start();
5997 Verify that VOLATILE is valid here, and begin accepting items in the list. */
6000 ffestd_V014_start ()
6002 ffestd_check_start_ ();
6004 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6005 fputs ("* VOLATILE (", dmpout
);
6006 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6007 ffestd_subr_vxt_ ();
6013 /* ffestd_V014_item_object -- VOLATILE statement for object-name
6015 ffestd_V014_item_object(name_token);
6017 Make sure name_token identifies a valid object to be VOLATILEd. */
6020 ffestd_V014_item_object (ffelexToken name UNUSED
)
6022 ffestd_check_item_ ();
6024 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6025 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
6026 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6032 /* ffestd_V014_item_cblock -- VOLATILE statement for common-block-name
6034 ffestd_V014_item_cblock(name_token);
6036 Make sure name_token identifies a valid common block to be VOLATILEd. */
6039 ffestd_V014_item_cblock (ffelexToken name UNUSED
)
6041 ffestd_check_item_ ();
6043 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6044 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
6045 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6051 /* ffestd_V014_finish -- VOLATILE statement list complete
6053 ffestd_V014_finish();
6055 Just wrap up any local activities. */
6058 ffestd_V014_finish ()
6060 ffestd_check_finish_ ();
6062 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6063 fputs (")\n", dmpout
);
6064 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6070 /* ffestd_V016_start -- RECORD statement list begin
6072 ffestd_V016_start();
6074 Verify that RECORD is valid here, and begin accepting items in the list. */
6078 ffestd_V016_start ()
6080 ffestd_check_start_ ();
6082 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6083 fputs ("* RECORD ", dmpout
);
6084 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6085 ffestd_subr_vxt_ ();
6091 /* ffestd_V016_item_structure -- RECORD statement for common-block-name
6093 ffestd_V016_item_structure(name_token);
6095 Make sure name_token identifies a valid structure to be RECORDed. */
6098 ffestd_V016_item_structure (ffelexToken name
)
6100 ffestd_check_item_ ();
6102 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6103 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
6104 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6110 /* ffestd_V016_item_object -- RECORD statement for object-name
6112 ffestd_V016_item_object(name_token,dim_list);
6114 Make sure name_token identifies a valid object to be RECORDd. */
6117 ffestd_V016_item_object (ffelexToken name
, ffesttDimList dims
)
6119 ffestd_check_item_ ();
6121 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6122 fputs (ffelex_token_text (name
), dmpout
);
6125 fputc ('(', dmpout
);
6126 ffestt_dimlist_dump (dims
);
6127 fputc (')', dmpout
);
6129 fputc (',', dmpout
);
6130 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6136 /* ffestd_V016_finish -- RECORD statement list complete
6138 ffestd_V016_finish();
6140 Just wrap up any local activities. */
6143 ffestd_V016_finish ()
6145 ffestd_check_finish_ ();
6147 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6148 fputc ('\n', dmpout
);
6149 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6155 /* ffestd_V018_start -- REWRITE(...) statement list begin
6157 ffestd_V018_start();
6159 Verify that REWRITE is valid here, and begin accepting items in the
6163 ffestd_V018_start (ffestvFormat format
)
6165 ffestd_check_start_ ();
6167 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6170 ffestd_subr_line_now_ ();
6171 ffeste_V018_start (&ffestp_file
.rewrite
, format
);
6176 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV018_
);
6177 ffestd_stmt_append_ (stmt
);
6178 ffestd_subr_line_save_ (stmt
);
6179 stmt
->u
.V018
.pool
= ffesta_output_pool
;
6180 stmt
->u
.V018
.params
= ffestd_subr_copy_rewrite_ ();
6181 stmt
->u
.V018
.format
= format
;
6182 stmt
->u
.V018
.list
= NULL
;
6183 ffestd_expr_list_
= &stmt
->u
.V018
.list
;
6184 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6189 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6190 ffestd_subr_vxt_ ();
6194 /* ffestd_V018_item -- REWRITE statement i/o item
6196 ffestd_V018_item(expr,expr_token);
6198 Implement output-list expression. */
6201 ffestd_V018_item (ffebld expr
)
6203 ffestd_check_item_ ();
6205 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6208 ffeste_V018_item (expr
);
6211 ffestdExprItem_ item
6212 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6217 *ffestd_expr_list_
= item
;
6218 ffestd_expr_list_
= &item
->next
;
6223 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6227 /* ffestd_V018_finish -- REWRITE statement list complete
6229 ffestd_V018_finish();
6231 Just wrap up any local activities. */
6234 ffestd_V018_finish ()
6236 ffestd_check_finish_ ();
6238 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6241 ffeste_V018_finish ();
6243 /* Nothing to do, it's implicit. */
6247 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6251 /* ffestd_V019_start -- ACCEPT statement list begin
6253 ffestd_V019_start();
6255 Verify that ACCEPT is valid here, and begin accepting items in the
6259 ffestd_V019_start (ffestvFormat format
)
6261 ffestd_check_start_ ();
6263 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6266 ffestd_subr_line_now_ ();
6267 ffeste_V019_start (&ffestp_file
.accept
, format
);
6272 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV019_
);
6273 ffestd_stmt_append_ (stmt
);
6274 ffestd_subr_line_save_ (stmt
);
6275 stmt
->u
.V019
.pool
= ffesta_output_pool
;
6276 stmt
->u
.V019
.params
= ffestd_subr_copy_accept_ ();
6277 stmt
->u
.V019
.format
= format
;
6278 stmt
->u
.V019
.list
= NULL
;
6279 ffestd_expr_list_
= &stmt
->u
.V019
.list
;
6280 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6285 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6286 ffestd_subr_vxt_ ();
6290 /* ffestd_V019_item -- ACCEPT statement i/o item
6292 ffestd_V019_item(expr,expr_token);
6294 Implement output-list expression. */
6297 ffestd_V019_item (ffebld expr
)
6299 ffestd_check_item_ ();
6301 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6304 ffeste_V019_item (expr
);
6307 ffestdExprItem_ item
6308 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6313 *ffestd_expr_list_
= item
;
6314 ffestd_expr_list_
= &item
->next
;
6319 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6323 /* ffestd_V019_finish -- ACCEPT statement list complete
6325 ffestd_V019_finish();
6327 Just wrap up any local activities. */
6330 ffestd_V019_finish ()
6332 ffestd_check_finish_ ();
6334 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6337 ffeste_V019_finish ();
6339 /* Nothing to do, it's implicit. */
6343 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6348 /* ffestd_V020_start -- TYPE statement list begin
6350 ffestd_V020_start();
6352 Verify that TYPE is valid here, and begin accepting items in the
6356 ffestd_V020_start (ffestvFormat format UNUSED
)
6358 ffestd_check_start_ ();
6360 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6363 ffestd_subr_line_now_ ();
6364 ffeste_V020_start (&ffestp_file
.type
, format
);
6369 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV020_
);
6370 ffestd_stmt_append_ (stmt
);
6371 ffestd_subr_line_save_ (stmt
);
6372 stmt
->u
.V020
.pool
= ffesta_output_pool
;
6373 stmt
->u
.V020
.params
= ffestd_subr_copy_type_ ();
6374 stmt
->u
.V020
.format
= format
;
6375 stmt
->u
.V020
.list
= NULL
;
6376 ffestd_expr_list_
= &stmt
->u
.V020
.list
;
6377 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6382 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6383 ffestd_subr_vxt_ ();
6387 /* ffestd_V020_item -- TYPE statement i/o item
6389 ffestd_V020_item(expr,expr_token);
6391 Implement output-list expression. */
6394 ffestd_V020_item (ffebld expr UNUSED
)
6396 ffestd_check_item_ ();
6398 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6401 ffeste_V020_item (expr
);
6404 ffestdExprItem_ item
6405 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6410 *ffestd_expr_list_
= item
;
6411 ffestd_expr_list_
= &item
->next
;
6416 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6420 /* ffestd_V020_finish -- TYPE statement list complete
6422 ffestd_V020_finish();
6424 Just wrap up any local activities. */
6427 ffestd_V020_finish ()
6429 ffestd_check_finish_ ();
6431 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6434 ffeste_V020_finish ();
6436 /* Nothing to do, it's implicit. */
6440 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6444 /* ffestd_V021 -- DELETE statement
6448 Make sure a DELETE is valid in the current context, and implement it. */
6454 ffestd_check_simple_ ();
6456 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6459 ffestd_subr_line_now_ ();
6460 ffeste_V021 (&ffestp_file
.delete);
6465 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV021_
);
6466 ffestd_stmt_append_ (stmt
);
6467 ffestd_subr_line_save_ (stmt
);
6468 stmt
->u
.V021
.pool
= ffesta_output_pool
;
6469 stmt
->u
.V021
.params
= ffestd_subr_copy_delete_ ();
6470 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6475 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6476 ffestd_subr_vxt_ ();
6480 /* ffestd_V022 -- UNLOCK statement
6484 Make sure a UNLOCK is valid in the current context, and implement it. */
6489 ffestd_check_simple_ ();
6491 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6494 ffestd_subr_line_now_ ();
6495 ffeste_V022 (&ffestp_file
.beru
);
6500 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV022_
);
6501 ffestd_stmt_append_ (stmt
);
6502 ffestd_subr_line_save_ (stmt
);
6503 stmt
->u
.V022
.pool
= ffesta_output_pool
;
6504 stmt
->u
.V022
.params
= ffestd_subr_copy_beru_ ();
6505 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6510 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6511 ffestd_subr_vxt_ ();
6515 /* ffestd_V023_start -- ENCODE(...) statement list begin
6517 ffestd_V023_start();
6519 Verify that ENCODE is valid here, and begin accepting items in the
6523 ffestd_V023_start ()
6525 ffestd_check_start_ ();
6527 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6530 ffestd_subr_line_now_ ();
6531 ffeste_V023_start (&ffestp_file
.vxtcode
);
6536 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV023_
);
6537 ffestd_stmt_append_ (stmt
);
6538 ffestd_subr_line_save_ (stmt
);
6539 stmt
->u
.V023
.pool
= ffesta_output_pool
;
6540 stmt
->u
.V023
.params
= ffestd_subr_copy_vxtcode_ ();
6541 stmt
->u
.V023
.list
= NULL
;
6542 ffestd_expr_list_
= &stmt
->u
.V023
.list
;
6543 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6548 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6549 ffestd_subr_vxt_ ();
6553 /* ffestd_V023_item -- ENCODE statement i/o item
6555 ffestd_V023_item(expr,expr_token);
6557 Implement output-list expression. */
6560 ffestd_V023_item (ffebld expr
)
6562 ffestd_check_item_ ();
6564 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6567 ffeste_V023_item (expr
);
6570 ffestdExprItem_ item
6571 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6576 *ffestd_expr_list_
= item
;
6577 ffestd_expr_list_
= &item
->next
;
6582 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6586 /* ffestd_V023_finish -- ENCODE statement list complete
6588 ffestd_V023_finish();
6590 Just wrap up any local activities. */
6593 ffestd_V023_finish ()
6595 ffestd_check_finish_ ();
6597 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6600 ffeste_V023_finish ();
6602 /* Nothing to do, it's implicit. */
6606 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6610 /* ffestd_V024_start -- DECODE(...) statement list begin
6612 ffestd_V024_start();
6614 Verify that DECODE is valid here, and begin accepting items in the
6618 ffestd_V024_start ()
6620 ffestd_check_start_ ();
6622 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6625 ffestd_subr_line_now_ ();
6626 ffeste_V024_start (&ffestp_file
.vxtcode
);
6631 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV024_
);
6632 ffestd_stmt_append_ (stmt
);
6633 ffestd_subr_line_save_ (stmt
);
6634 stmt
->u
.V024
.pool
= ffesta_output_pool
;
6635 stmt
->u
.V024
.params
= ffestd_subr_copy_vxtcode_ ();
6636 stmt
->u
.V024
.list
= NULL
;
6637 ffestd_expr_list_
= &stmt
->u
.V024
.list
;
6638 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6643 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6644 ffestd_subr_vxt_ ();
6648 /* ffestd_V024_item -- DECODE statement i/o item
6650 ffestd_V024_item(expr,expr_token);
6652 Implement output-list expression. */
6655 ffestd_V024_item (ffebld expr
)
6657 ffestd_check_item_ ();
6659 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6662 ffeste_V024_item (expr
);
6665 ffestdExprItem_ item
6666 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6671 *ffestd_expr_list_
= item
;
6672 ffestd_expr_list_
= &item
->next
;
6677 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6681 /* ffestd_V024_finish -- DECODE statement list complete
6683 ffestd_V024_finish();
6685 Just wrap up any local activities. */
6688 ffestd_V024_finish ()
6690 ffestd_check_finish_ ();
6692 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6695 ffeste_V024_finish ();
6697 /* Nothing to do, it's implicit. */
6701 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6705 /* ffestd_V025_start -- DEFINEFILE statement list begin
6707 ffestd_V025_start();
6709 Verify that DEFINEFILE is valid here, and begin accepting items in the
6713 ffestd_V025_start ()
6715 ffestd_check_start_ ();
6717 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6720 ffestd_subr_line_now_ ();
6721 ffeste_V025_start ();
6726 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV025start_
);
6727 ffestd_stmt_append_ (stmt
);
6728 ffestd_subr_line_save_ (stmt
);
6729 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6734 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6735 ffestd_subr_vxt_ ();
6739 /* ffestd_V025_item -- DEFINE FILE statement item
6741 ffestd_V025_item(u,ut,m,mt,n,nt,asv,asvt);
6743 Implement item. Treat each item kind of like a separate statement,
6744 since there's really no need to treat them as an aggregate. */
6747 ffestd_V025_item (ffebld u
, ffebld m
, ffebld n
, ffebld asv
)
6749 ffestd_check_item_ ();
6751 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6754 ffeste_V025_item (u
, m
, n
, asv
);
6759 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV025item_
);
6760 ffestd_stmt_append_ (stmt
);
6761 stmt
->u
.V025item
.u
= u
;
6762 stmt
->u
.V025item
.m
= m
;
6763 stmt
->u
.V025item
.n
= n
;
6764 stmt
->u
.V025item
.asv
= asv
;
6769 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6773 /* ffestd_V025_finish -- DEFINE FILE statement list complete
6775 ffestd_V025_finish();
6777 Just wrap up any local activities. */
6780 ffestd_V025_finish ()
6782 ffestd_check_finish_ ();
6784 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6787 ffeste_V025_finish ();
6792 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV025finish_
);
6793 stmt
->u
.V025finish
.pool
= ffesta_output_pool
;
6794 ffestd_stmt_append_ (stmt
);
6799 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6803 /* ffestd_V026 -- FIND statement
6807 Make sure a FIND is valid in the current context, and implement it. */
6812 ffestd_check_simple_ ();
6814 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6817 ffestd_subr_line_now_ ();
6818 ffeste_V026 (&ffestp_file
.find
);
6823 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV026_
);
6824 ffestd_stmt_append_ (stmt
);
6825 ffestd_subr_line_save_ (stmt
);
6826 stmt
->u
.V026
.pool
= ffesta_output_pool
;
6827 stmt
->u
.V026
.params
= ffestd_subr_copy_find_ ();
6828 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6833 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6834 ffestd_subr_vxt_ ();
6839 /* ffestd_V027_start -- VXT PARAMETER statement list begin
6841 ffestd_V027_start();
6843 Verify that PARAMETER is valid here, and begin accepting items in the list. */
6846 ffestd_V027_start ()
6848 ffestd_check_start_ ();
6850 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6851 fputs ("* PARAMETER_vxt ", dmpout
);
6853 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6854 ffestd_subr_vxt_ ();
6859 /* ffestd_V027_item -- VXT PARAMETER statement assignment
6861 ffestd_V027_item(dest,dest_token,source,source_token);
6863 Make sure the source is a valid source for the destination; make the
6867 ffestd_V027_item (ffelexToken dest_token UNUSED
, ffebld source UNUSED
)
6869 ffestd_check_item_ ();
6871 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6872 fputs (ffelex_token_text (dest_token
), dmpout
);
6873 fputc ('=', dmpout
);
6874 ffebld_dump (source
);
6875 fputc (',', dmpout
);
6876 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6882 /* ffestd_V027_finish -- VXT PARAMETER statement list complete
6884 ffestd_V027_finish();
6886 Just wrap up any local activities. */
6889 ffestd_V027_finish ()
6891 ffestd_check_finish_ ();
6893 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6894 fputc ('\n', dmpout
);
6895 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6901 /* Any executable statement. */
6906 ffestd_check_simple_ ();
6909 ffestd_subr_line_now_ ();
6915 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR841_
);
6916 ffestd_stmt_append_ (stmt
);
6917 ffestd_subr_line_save_ (stmt
);