1 /* std.c -- Implementation File (module.c template V1.0)
2 Copyright (C) 1995, 1996 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");
692 stmt
= ffestd_stmt_list_
.first
;
695 while (stmt
->id
!= FFESTD_stmtidR1226_
)
698 if (stmt
->u
.R1226
.entry
!= NULL
)
700 value
= build_int_2 (stmt
->u
.R1226
.entrynum
, 0);
701 /* Yes, we really want to build a null LABEL_DECL here and not
702 put it on any list. That's what pushcase wants, so that's
704 label
= build_decl (LABEL_DECL
, NULL_TREE
, NULL_TREE
);
706 pushok
= pushcase (value
, convert
, label
, &duplicate
);
707 assert (pushok
== 0);
709 label
= ffecom_temp_label ();
710 TREE_USED (label
) = 1;
714 ffesymbol_hook (stmt
->u
.R1226
.entry
).length_tree
= label
;
721 expand_end_case (which
);
726 for (stmt
= ffestd_stmt_list_
.first
;
727 stmt
!= (ffestdStmt_
) &ffestd_stmt_list_
.first
;
732 case FFESTD_stmtidENDDOLOOP_
:
733 ffestd_subr_line_restore_ (stmt
);
735 ffeste_do (stmt
->u
.enddoloop
.block
);
736 ffestw_kill (stmt
->u
.enddoloop
.block
);
739 case FFESTD_stmtidENDLOGIF_
:
740 ffestd_subr_line_restore_ (stmt
);
745 case FFESTD_stmtidEXECLABEL_
:
747 ffeste_labeldef_branch (stmt
->u
.execlabel
.label
);
750 case FFESTD_stmtidFORMATLABEL_
:
752 ffeste_labeldef_format (stmt
->u
.formatlabel
.label
);
755 case FFESTD_stmtidR737A_
:
756 ffestd_subr_line_restore_ (stmt
);
758 ffeste_R737A (stmt
->u
.R737A
.dest
, stmt
->u
.R737A
.source
);
759 malloc_pool_kill (stmt
->u
.R737A
.pool
);
762 case FFESTD_stmtidR803_
:
763 ffestd_subr_line_restore_ (stmt
);
765 ffeste_R803 (stmt
->u
.R803
.block
, stmt
->u
.R803
.expr
);
766 malloc_pool_kill (stmt
->u
.R803
.pool
);
769 case FFESTD_stmtidR804_
:
770 ffestd_subr_line_restore_ (stmt
);
772 ffeste_R804 (stmt
->u
.R803
.block
, stmt
->u
.R804
.expr
);
773 malloc_pool_kill (stmt
->u
.R804
.pool
);
776 case FFESTD_stmtidR805_
:
777 ffestd_subr_line_restore_ (stmt
);
779 ffeste_R805 (stmt
->u
.R803
.block
);
782 case FFESTD_stmtidR806_
:
783 ffestd_subr_line_restore_ (stmt
);
785 ffeste_R806 (stmt
->u
.R806
.block
);
786 ffestw_kill (stmt
->u
.R806
.block
);
789 case FFESTD_stmtidR807_
:
790 ffestd_subr_line_restore_ (stmt
);
792 ffeste_R807 (stmt
->u
.R807
.expr
);
793 malloc_pool_kill (stmt
->u
.R807
.pool
);
796 case FFESTD_stmtidR809_
:
797 ffestd_subr_line_restore_ (stmt
);
799 ffeste_R809 (stmt
->u
.R809
.block
, stmt
->u
.R809
.expr
);
800 malloc_pool_kill (stmt
->u
.R809
.pool
);
803 case FFESTD_stmtidR810_
:
804 ffestd_subr_line_restore_ (stmt
);
806 ffeste_R810 (stmt
->u
.R810
.block
, stmt
->u
.R810
.casenum
);
807 malloc_pool_kill (stmt
->u
.R810
.pool
);
810 case FFESTD_stmtidR811_
:
811 ffestd_subr_line_restore_ (stmt
);
813 ffeste_R811 (stmt
->u
.R811
.block
);
814 malloc_pool_kill (ffestw_select (stmt
->u
.R811
.block
)->pool
);
815 ffestw_kill (stmt
->u
.R811
.block
);
818 case FFESTD_stmtidR819A_
:
819 ffestd_subr_line_restore_ (stmt
);
821 ffeste_R819A (stmt
->u
.R819A
.block
, stmt
->u
.R819A
.label
,
823 stmt
->u
.R819A
.start
, stmt
->u
.R819A
.start_token
,
824 stmt
->u
.R819A
.end
, stmt
->u
.R819A
.end_token
,
825 stmt
->u
.R819A
.incr
, stmt
->u
.R819A
.incr_token
);
826 ffelex_token_kill (stmt
->u
.R819A
.start_token
);
827 ffelex_token_kill (stmt
->u
.R819A
.end_token
);
828 if (stmt
->u
.R819A
.incr_token
!= NULL
)
829 ffelex_token_kill (stmt
->u
.R819A
.incr_token
);
830 malloc_pool_kill (stmt
->u
.R819A
.pool
);
833 case FFESTD_stmtidR819B_
:
834 ffestd_subr_line_restore_ (stmt
);
836 ffeste_R819B (stmt
->u
.R819B
.block
, stmt
->u
.R819B
.label
,
838 malloc_pool_kill (stmt
->u
.R819B
.pool
);
841 case FFESTD_stmtidR825_
:
842 ffestd_subr_line_restore_ (stmt
);
847 case FFESTD_stmtidR834_
:
848 ffestd_subr_line_restore_ (stmt
);
850 ffeste_R834 (stmt
->u
.R834
.block
);
853 case FFESTD_stmtidR835_
:
854 ffestd_subr_line_restore_ (stmt
);
856 ffeste_R835 (stmt
->u
.R835
.block
);
859 case FFESTD_stmtidR836_
:
860 ffestd_subr_line_restore_ (stmt
);
862 ffeste_R836 (stmt
->u
.R836
.label
);
865 case FFESTD_stmtidR837_
:
866 ffestd_subr_line_restore_ (stmt
);
868 ffeste_R837 (stmt
->u
.R837
.labels
, stmt
->u
.R837
.count
,
870 malloc_pool_kill (stmt
->u
.R837
.pool
);
873 case FFESTD_stmtidR838_
:
874 ffestd_subr_line_restore_ (stmt
);
876 ffeste_R838 (stmt
->u
.R838
.label
, stmt
->u
.R838
.target
);
877 malloc_pool_kill (stmt
->u
.R838
.pool
);
880 case FFESTD_stmtidR839_
:
881 ffestd_subr_line_restore_ (stmt
);
883 ffeste_R839 (stmt
->u
.R839
.target
);
884 malloc_pool_kill (stmt
->u
.R839
.pool
);
887 case FFESTD_stmtidR840_
:
888 ffestd_subr_line_restore_ (stmt
);
890 ffeste_R840 (stmt
->u
.R840
.expr
, stmt
->u
.R840
.neg
, stmt
->u
.R840
.zero
,
892 malloc_pool_kill (stmt
->u
.R840
.pool
);
895 case FFESTD_stmtidR841_
:
896 ffestd_subr_line_restore_ (stmt
);
901 case FFESTD_stmtidR842_
:
902 ffestd_subr_line_restore_ (stmt
);
904 ffeste_R842 (stmt
->u
.R842
.expr
);
905 if (stmt
->u
.R842
.pool
!= NULL
)
906 malloc_pool_kill (stmt
->u
.R842
.pool
);
909 case FFESTD_stmtidR843_
:
910 ffestd_subr_line_restore_ (stmt
);
912 ffeste_R843 (stmt
->u
.R843
.expr
);
913 malloc_pool_kill (stmt
->u
.R843
.pool
);
916 case FFESTD_stmtidR904_
:
917 ffestd_subr_line_restore_ (stmt
);
919 ffeste_R904 (stmt
->u
.R904
.params
);
920 malloc_pool_kill (stmt
->u
.R904
.pool
);
923 case FFESTD_stmtidR907_
:
924 ffestd_subr_line_restore_ (stmt
);
926 ffeste_R907 (stmt
->u
.R907
.params
);
927 malloc_pool_kill (stmt
->u
.R907
.pool
);
930 case FFESTD_stmtidR909_
:
931 ffestd_subr_line_restore_ (stmt
);
933 ffeste_R909_start (stmt
->u
.R909
.params
, stmt
->u
.R909
.only_format
,
934 stmt
->u
.R909
.unit
, stmt
->u
.R909
.format
,
935 stmt
->u
.R909
.rec
, stmt
->u
.R909
.key
);
936 for (expr
= stmt
->u
.R909
.list
; expr
!= NULL
; expr
= expr
->next
)
939 ffeste_R909_item (expr
->expr
, expr
->token
);
940 ffelex_token_kill (expr
->token
);
943 ffeste_R909_finish ();
944 malloc_pool_kill (stmt
->u
.R909
.pool
);
947 case FFESTD_stmtidR910_
:
948 ffestd_subr_line_restore_ (stmt
);
950 ffeste_R910_start (stmt
->u
.R910
.params
, stmt
->u
.R910
.unit
,
951 stmt
->u
.R910
.format
, stmt
->u
.R910
.rec
);
952 for (expr
= stmt
->u
.R910
.list
; expr
!= NULL
; expr
= expr
->next
)
955 ffeste_R910_item (expr
->expr
, expr
->token
);
956 ffelex_token_kill (expr
->token
);
959 ffeste_R910_finish ();
960 malloc_pool_kill (stmt
->u
.R910
.pool
);
963 case FFESTD_stmtidR911_
:
964 ffestd_subr_line_restore_ (stmt
);
966 ffeste_R911_start (stmt
->u
.R911
.params
, stmt
->u
.R911
.format
);
967 for (expr
= stmt
->u
.R911
.list
; expr
!= NULL
; expr
= expr
->next
)
970 ffeste_R911_item (expr
->expr
, expr
->token
);
971 ffelex_token_kill (expr
->token
);
974 ffeste_R911_finish ();
975 malloc_pool_kill (stmt
->u
.R911
.pool
);
978 case FFESTD_stmtidR919_
:
979 ffestd_subr_line_restore_ (stmt
);
981 ffeste_R919 (stmt
->u
.R919
.params
);
982 malloc_pool_kill (stmt
->u
.R919
.pool
);
985 case FFESTD_stmtidR920_
:
986 ffestd_subr_line_restore_ (stmt
);
988 ffeste_R920 (stmt
->u
.R920
.params
);
989 malloc_pool_kill (stmt
->u
.R920
.pool
);
992 case FFESTD_stmtidR921_
:
993 ffestd_subr_line_restore_ (stmt
);
995 ffeste_R921 (stmt
->u
.R921
.params
);
996 malloc_pool_kill (stmt
->u
.R921
.pool
);
999 case FFESTD_stmtidR923A_
:
1000 ffestd_subr_line_restore_ (stmt
);
1002 ffeste_R923A (stmt
->u
.R923A
.params
, stmt
->u
.R923A
.by_file
);
1003 malloc_pool_kill (stmt
->u
.R923A
.pool
);
1006 case FFESTD_stmtidR923B_
:
1007 ffestd_subr_line_restore_ (stmt
);
1009 ffeste_R923B_start (stmt
->u
.R923B
.params
);
1010 for (expr
= stmt
->u
.R923B
.list
; expr
!= NULL
; expr
= expr
->next
)
1013 ffeste_R923B_item (expr
->expr
);
1016 ffeste_R923B_finish ();
1017 malloc_pool_kill (stmt
->u
.R923B
.pool
);
1020 case FFESTD_stmtidR1001_
:
1022 ffeste_R1001 (&stmt
->u
.R1001
.str
);
1023 ffests_kill (&stmt
->u
.R1001
.str
);
1026 case FFESTD_stmtidR1103_
:
1031 case FFESTD_stmtidR1112_
:
1036 case FFESTD_stmtidR1212_
:
1037 ffestd_subr_line_restore_ (stmt
);
1039 ffeste_R1212 (stmt
->u
.R1212
.expr
);
1040 malloc_pool_kill (stmt
->u
.R1212
.pool
);
1043 case FFESTD_stmtidR1221_
:
1048 case FFESTD_stmtidR1225_
:
1053 case FFESTD_stmtidR1226_
:
1054 ffestd_subr_line_restore_ (stmt
);
1055 if (stmt
->u
.R1226
.entry
!= NULL
)
1058 ffeste_R1226 (stmt
->u
.R1226
.entry
);
1062 case FFESTD_stmtidR1227_
:
1063 ffestd_subr_line_restore_ (stmt
);
1065 ffeste_R1227 (stmt
->u
.R1227
.block
, stmt
->u
.R1227
.expr
);
1066 malloc_pool_kill (stmt
->u
.R1227
.pool
);
1070 case FFESTD_stmtidV018_
:
1071 ffestd_subr_line_restore_ (stmt
);
1073 ffeste_V018_start (stmt
->u
.V018
.params
, stmt
->u
.V018
.format
);
1074 for (expr
= stmt
->u
.V018
.list
; expr
!= NULL
; expr
= expr
->next
)
1077 ffeste_V018_item (expr
->expr
);
1080 ffeste_V018_finish ();
1081 malloc_pool_kill (stmt
->u
.V018
.pool
);
1084 case FFESTD_stmtidV019_
:
1085 ffestd_subr_line_restore_ (stmt
);
1087 ffeste_V019_start (stmt
->u
.V019
.params
, stmt
->u
.V019
.format
);
1088 for (expr
= stmt
->u
.V019
.list
; expr
!= NULL
; expr
= expr
->next
)
1091 ffeste_V019_item (expr
->expr
);
1094 ffeste_V019_finish ();
1095 malloc_pool_kill (stmt
->u
.V019
.pool
);
1099 case FFESTD_stmtidV020_
:
1100 ffestd_subr_line_restore_ (stmt
);
1102 ffeste_V020_start (stmt
->u
.V020
.params
, stmt
->u
.V020
.format
);
1103 for (expr
= stmt
->u
.V020
.list
; expr
!= NULL
; expr
= expr
->next
)
1106 ffeste_V020_item (expr
->expr
);
1109 ffeste_V020_finish ();
1110 malloc_pool_kill (stmt
->u
.V020
.pool
);
1114 case FFESTD_stmtidV021_
:
1115 ffestd_subr_line_restore_ (stmt
);
1117 ffeste_V021 (stmt
->u
.V021
.params
);
1118 malloc_pool_kill (stmt
->u
.V021
.pool
);
1121 case FFESTD_stmtidV023_
:
1122 ffestd_subr_line_restore_ (stmt
);
1124 ffeste_V023_start (stmt
->u
.V023
.params
);
1125 for (expr
= stmt
->u
.V023
.list
; expr
!= NULL
; expr
= expr
->next
)
1128 ffeste_V023_item (expr
->expr
);
1131 ffeste_V023_finish ();
1132 malloc_pool_kill (stmt
->u
.V023
.pool
);
1135 case FFESTD_stmtidV024_
:
1136 ffestd_subr_line_restore_ (stmt
);
1138 ffeste_V024_start (stmt
->u
.V024
.params
);
1139 for (expr
= stmt
->u
.V024
.list
; expr
!= NULL
; expr
= expr
->next
)
1142 ffeste_V024_item (expr
->expr
);
1145 ffeste_V024_finish ();
1146 malloc_pool_kill (stmt
->u
.V024
.pool
);
1149 case FFESTD_stmtidV025start_
:
1150 ffestd_subr_line_restore_ (stmt
);
1152 ffeste_V025_start ();
1155 case FFESTD_stmtidV025item_
:
1157 ffeste_V025_item (stmt
->u
.V025item
.u
, stmt
->u
.V025item
.m
,
1158 stmt
->u
.V025item
.n
, stmt
->u
.V025item
.asv
);
1161 case FFESTD_stmtidV025finish_
:
1163 ffeste_V025_finish ();
1164 malloc_pool_kill (stmt
->u
.V025finish
.pool
);
1167 case FFESTD_stmtidV026_
:
1168 ffestd_subr_line_restore_ (stmt
);
1170 ffeste_V026 (stmt
->u
.V026
.params
);
1171 malloc_pool_kill (stmt
->u
.V026
.pool
);
1176 assert ("bad stmt->id" == NULL
);
1183 /* ffestd_subr_copy_easy_ -- Copy I/O statement data structure
1185 ffestd_subr_copy_easy_();
1187 Copies all data except tokens in the I/O data structure into a new
1188 structure that lasts as long as the output pool for the current
1189 statement. Assumes that they are
1190 overlaid with each other (union) in stp.h and the typing
1191 and structure references assume (though not necessarily dangerous if
1192 FALSE) that INQUIRE has the most file elements. */
1194 #if FFESTD_COPY_EASY_ && FFECOM_TWOPASS
1195 static ffestpInquireStmt
*
1196 ffestd_subr_copy_easy_ (ffestpInquireIx max
)
1198 ffestpInquireStmt
*stmt
;
1201 stmt
= (ffestpInquireStmt
*) malloc_new_kp (ffesta_output_pool
,
1202 "FFESTD easy", sizeof (ffestpFile
) * max
);
1204 for (ix
= 0; ix
< max
; ++ix
)
1206 if ((stmt
->inquire_spec
[ix
].kw_or_val_present
1207 = ffestp_file
.inquire
.inquire_spec
[ix
].kw_or_val_present
)
1208 && (stmt
->inquire_spec
[ix
].value_present
1209 = ffestp_file
.inquire
.inquire_spec
[ix
].value_present
))
1211 if ((stmt
->inquire_spec
[ix
].value_is_label
1212 = ffestp_file
.inquire
.inquire_spec
[ix
].value_is_label
))
1213 stmt
->inquire_spec
[ix
].u
.label
1214 = ffestp_file
.inquire
.inquire_spec
[ix
].u
.label
;
1216 stmt
->inquire_spec
[ix
].u
.expr
1217 = ffestp_file
.inquire
.inquire_spec
[ix
].u
.expr
;
1225 /* ffestd_subr_labels_ -- Handle any undefined labels
1227 ffestd_subr_labels_(FALSE);
1229 For every undefined label, generate an error message and either define
1230 label as a FORMAT() statement (for FORMAT labels) or as a STOP statement
1231 (for all other labels). */
1234 ffestd_subr_labels_ (bool unexpected
)
1241 undef
= ffelab_number () - ffestv_num_label_defines_
;
1243 for (h
= ffelab_handle_first (); h
!= NULL
; h
= ffelab_handle_next (h
))
1245 l
= ffelab_handle_target (h
);
1246 if (ffewhere_line_is_unknown (ffelab_definition_line (l
)))
1247 { /* Undefined label. */
1248 assert (!unexpected
);
1251 ffebad_start (FFEBAD_UNDEF_LABEL
);
1252 if (ffelab_type (l
) == FFELAB_typeLOOPEND
)
1253 ffebad_here (0, ffelab_doref_line (l
), ffelab_doref_column (l
));
1254 else if (ffelab_type (l
) != FFELAB_typeANY
)
1255 ffebad_here (0, ffelab_firstref_line (l
), ffelab_firstref_column (l
));
1256 else if (!ffewhere_line_is_unknown (ffelab_firstref_line (l
)))
1257 ffebad_here (0, ffelab_firstref_line (l
), ffelab_firstref_column (l
));
1258 else if (!ffewhere_line_is_unknown (ffelab_doref_line (l
)))
1259 ffebad_here (0, ffelab_doref_line (l
), ffelab_doref_column (l
));
1261 ffebad_here (0, ffelab_definition_line (l
), ffelab_definition_column (l
));
1264 switch (ffelab_type (l
))
1266 case FFELAB_typeFORMAT
:
1267 ffelab_set_definition_line (l
,
1268 ffewhere_line_use (ffelab_firstref_line (l
)));
1269 ffelab_set_definition_column (l
,
1270 ffewhere_column_use (ffelab_firstref_column (l
)));
1271 ffestv_num_label_defines_
++;
1272 f
= ffestt_formatlist_create (NULL
, NULL
);
1273 ffestd_labeldef_format (l
);
1275 ffestt_formatlist_kill (f
);
1278 case FFELAB_typeASSIGNABLE
:
1279 ffelab_set_definition_line (l
,
1280 ffewhere_line_use (ffelab_firstref_line (l
)));
1281 ffelab_set_definition_column (l
,
1282 ffewhere_column_use (ffelab_firstref_column (l
)));
1283 ffestv_num_label_defines_
++;
1284 ffelab_set_type (l
, FFELAB_typeNOTLOOP
);
1285 ffelab_set_blocknum (l
, ffestw_blocknum (ffestw_stack_top ()));
1286 ffestd_labeldef_notloop (l
);
1290 case FFELAB_typeNOTLOOP
:
1291 ffelab_set_definition_line (l
,
1292 ffewhere_line_use (ffelab_firstref_line (l
)));
1293 ffelab_set_definition_column (l
,
1294 ffewhere_column_use (ffelab_firstref_column (l
)));
1295 ffestv_num_label_defines_
++;
1296 ffelab_set_blocknum (l
, ffestw_blocknum (ffestw_stack_top ()));
1297 ffestd_labeldef_notloop (l
);
1302 assert ("bad label type" == NULL
);
1304 case FFELAB_typeUNKNOWN
:
1305 case FFELAB_typeANY
:
1310 ffelab_handle_done (h
);
1311 assert (undef
== 0);
1314 /* ffestd_subr_f90_ -- Report error about lack of full F90 support
1316 ffestd_subr_f90_(); */
1322 ffebad_start (FFEBAD_F90
);
1323 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
1324 ffelex_token_where_column (ffesta_tokens
[0]));
1329 /* ffestd_subr_vxt_ -- Report error about lack of full VXT support
1331 ffestd_subr_vxt_(); */
1333 #if FFECOM_targetCURRENT == FFECOM_targetGCC
1337 ffebad_start (FFEBAD_VXT_UNSUPPORTED
);
1338 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
1339 ffelex_token_where_column (ffesta_tokens
[0]));
1344 /* ffestd_begin_uses -- Start a bunch of USE statements
1346 ffestd_begin_uses();
1348 Invoked before handling the first USE statement in a block of one or
1349 more USE statements. _end_uses_(bool ok) is invoked before handling
1350 the first statement after the block (there are no BEGIN USE and END USE
1351 statements, but the semantics of USE statements effectively requires
1352 handling them as a single block rather than one statement at a time). */
1355 ffestd_begin_uses ()
1357 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1358 fputs ("; begin_uses\n", dmpout
);
1359 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1365 /* ffestd_do -- End of statement following DO-term-stmt etc
1369 Also invoked by _labeldef_branch_finish_ (or, in cases
1370 of errors, other _labeldef_ functions) when the label definition is
1371 for a DO-target (LOOPEND) label, once per matching/outstanding DO
1372 block on the stack. These cases invoke this function with ok==TRUE, so
1373 only forced stack popping (via ffestd_eof_()) invokes it with ok==FALSE. */
1376 ffestd_do (bool ok UNUSED
)
1379 ffestd_subr_line_now_ ();
1380 ffeste_do (ffestw_stack_top ());
1385 stmt
= ffestd_stmt_new_ (FFESTD_stmtidENDDOLOOP_
);
1386 ffestd_stmt_append_ (stmt
);
1387 ffestd_subr_line_save_ (stmt
);
1388 stmt
->u
.enddoloop
.block
= ffestw_stack_top ();
1392 --ffestd_block_level_
;
1393 assert (ffestd_block_level_
>= 0);
1396 /* ffestd_end_uses -- End a bunch of USE statements
1398 ffestd_end_uses(TRUE);
1400 ok==TRUE means simply not popping due to ffestd_eof_()
1401 being called, because there is no formal END USES statement in Fortran. */
1405 ffestd_end_uses (bool ok
)
1407 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1408 fputs ("; end_uses\n", dmpout
);
1409 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1415 /* ffestd_end_R740 -- End a WHERE(-THEN)
1417 ffestd_end_R740(TRUE); */
1420 ffestd_end_R740 (bool ok
)
1426 /* ffestd_end_R807 -- End of statement following logical IF
1428 ffestd_end_R807(TRUE);
1430 Applies ONLY to logical IF, not to IF-THEN. For example, does not
1431 ffelex_token_kill the construct name for an IF-THEN block (the name
1432 field is invalid for logical IF). ok==TRUE iff statement following
1433 logical IF (substatement) is valid; else, statement is invalid or
1434 stack forcibly popped due to ffestd_eof_(). */
1437 ffestd_end_R807 (bool ok UNUSED
)
1440 ffestd_subr_line_now_ ();
1446 stmt
= ffestd_stmt_new_ (FFESTD_stmtidENDLOGIF_
);
1447 ffestd_stmt_append_ (stmt
);
1448 ffestd_subr_line_save_ (stmt
);
1452 --ffestd_block_level_
;
1453 assert (ffestd_block_level_
>= 0);
1456 /* ffestd_exec_begin -- Executable statements can start coming in now
1458 ffestd_exec_begin(); */
1461 ffestd_exec_begin ()
1463 ffecom_exec_transition ();
1465 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1466 fputs ("{ begin_exec\n", dmpout
);
1469 #if FFECOM_targetCURRENT == FFECOM_targetGCC
1470 if (ffestd_2pass_entrypoints_
!= 0)
1471 { /* Process pending ENTRY statements now that
1474 int ents
= ffestd_2pass_entrypoints_
;
1476 stmt
= ffestd_stmt_list_
.first
;
1479 while (stmt
->id
!= FFESTD_stmtidR1226_
)
1482 if (!ffecom_2pass_advise_entrypoint (stmt
->u
.R1226
.entry
))
1484 stmt
->u
.R1226
.entry
= NULL
;
1485 --ffestd_2pass_entrypoints_
;
1489 while (--ents
!= 0);
1494 /* ffestd_exec_end -- Executable statements can no longer come in now
1496 ffestd_exec_end(); */
1501 #if FFECOM_targetCURRENT == FFECOM_targetGCC
1502 int old_lineno
= lineno
;
1503 char *old_input_filename
= input_filename
;
1506 ffecom_end_transition ();
1509 ffestd_stmt_pass_ ();
1512 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1513 fputs ("} end_exec\n", dmpout
);
1514 fputs ("> end_unit\n", dmpout
);
1517 #if FFECOM_targetCURRENT == FFECOM_targetGCC
1518 ffecom_finish_progunit ();
1520 if (ffestd_2pass_entrypoints_
!= 0)
1522 int ents
= ffestd_2pass_entrypoints_
;
1523 ffestdStmt_ stmt
= ffestd_stmt_list_
.first
;
1527 while (stmt
->id
!= FFESTD_stmtidR1226_
)
1530 if (stmt
->u
.R1226
.entry
!= NULL
)
1532 ffestd_subr_line_restore_ (stmt
);
1533 ffecom_2pass_do_entrypoint (stmt
->u
.R1226
.entry
);
1537 while (--ents
!= 0);
1540 ffestd_stmt_list_
.first
= NULL
;
1541 ffestd_stmt_list_
.last
= NULL
;
1542 ffestd_2pass_entrypoints_
= 0;
1544 lineno
= old_lineno
;
1545 input_filename
= old_input_filename
;
1549 /* ffestd_init_3 -- Initialize for any program unit
1557 ffestd_stmt_list_
.first
= (ffestdStmt_
) &ffestd_stmt_list_
.first
;
1558 ffestd_stmt_list_
.last
= (ffestdStmt_
) &ffestd_stmt_list_
.first
;
1562 /* Generate "code" for "any" label def. */
1565 ffestd_labeldef_any (ffelab label UNUSED
)
1567 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1568 fprintf (dmpout
, "; any_label_def %lu\n", ffelab_value (label
));
1569 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1575 /* ffestd_labeldef_branch -- Generate "code" for branch label def
1577 ffestd_labeldef_branch(label); */
1580 ffestd_labeldef_branch (ffelab label
)
1583 ffeste_labeldef_branch (label
);
1588 stmt
= ffestd_stmt_new_ (FFESTD_stmtidEXECLABEL_
);
1589 ffestd_stmt_append_ (stmt
);
1590 stmt
->u
.execlabel
.label
= label
;
1594 ffestd_is_reachable_
= TRUE
;
1597 /* ffestd_labeldef_format -- Generate "code" for FORMAT label def
1599 ffestd_labeldef_format(label); */
1602 ffestd_labeldef_format (ffelab label
)
1604 ffestd_label_formatdef_
= label
;
1607 ffeste_labeldef_format (label
);
1612 stmt
= ffestd_stmt_new_ (FFESTD_stmtidFORMATLABEL_
);
1614 /* Don't bother with this. See FORMAT statement. */
1615 /* Prepend FORMAT label instead of appending it, so all the
1616 FORMAT label/statement pairs end up at the top of the list.
1617 This helps ensure all decls for a block (in the GBE) are
1618 known before any executable statements are generated. */
1619 stmt
->previous
= (ffestdStmt_
) &ffestd_stmt_list_
.first
;
1620 stmt
->next
= ffestd_stmt_list_
.first
;
1621 stmt
->next
->previous
= stmt
;
1622 stmt
->previous
->next
= stmt
;
1624 ffestd_stmt_append_ (stmt
);
1626 stmt
->u
.formatlabel
.label
= label
;
1631 /* ffestd_labeldef_useless -- Generate "code" for useless label def
1633 ffestd_labeldef_useless(label); */
1636 ffestd_labeldef_useless (ffelab label UNUSED
)
1638 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1639 fprintf (dmpout
, "; useless_label_def %lu\n", ffelab_value (label
));
1640 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1646 /* ffestd_R423A -- PRIVATE statement (in R422 derived-type statement)
1654 ffestd_check_simple_ ();
1656 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1657 fputs ("* PRIVATE_derived_type\n", dmpout
);
1658 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1664 /* ffestd_R423B -- SEQUENCE statement (in R422 derived-type-stmt)
1671 ffestd_check_simple_ ();
1673 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1674 fputs ("* SEQUENCE_derived_type\n", dmpout
);
1675 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1681 /* ffestd_R424 -- derived-TYPE-def statement
1683 ffestd_R424(access_token,access_kw,name_token);
1685 Handle a derived-type definition. */
1688 ffestd_R424 (ffelexToken access
, ffestrOther access_kw
, ffelexToken name
)
1690 ffestd_check_simple_ ();
1692 ffestd_subr_f90_ ();
1699 fprintf (dmpout
, "* TYPE %s\n", ffelex_token_text (name
));
1704 case FFESTR_otherPUBLIC
:
1708 case FFESTR_otherPRIVATE
:
1715 fprintf (dmpout
, "* TYPE,%s: %s\n", a
, ffelex_token_text (name
));
1720 /* ffestd_R425 -- End a TYPE
1722 ffestd_R425(TRUE); */
1725 ffestd_R425 (bool ok
)
1727 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1728 fprintf (dmpout
, "* END_TYPE %s\n", ffelex_token_text (ffestw_name (ffestw_stack_top ())));
1729 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1735 /* ffestd_R519_start -- INTENT statement list begin
1737 ffestd_R519_start();
1739 Verify that INTENT is valid here, and begin accepting items in the list. */
1742 ffestd_R519_start (ffestrOther intent_kw
)
1744 ffestd_check_start_ ();
1746 ffestd_subr_f90_ ();
1754 case FFESTR_otherIN
:
1758 case FFESTR_otherOUT
:
1762 case FFESTR_otherINOUT
:
1769 fprintf (dmpout
, "* INTENT (%s) ", a
);
1773 /* ffestd_R519_item -- INTENT statement for name
1775 ffestd_R519_item(name_token);
1777 Make sure name_token identifies a valid object to be INTENTed. */
1780 ffestd_R519_item (ffelexToken name
)
1782 ffestd_check_item_ ();
1787 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
1791 /* ffestd_R519_finish -- INTENT statement list complete
1793 ffestd_R519_finish();
1795 Just wrap up any local activities. */
1798 ffestd_R519_finish ()
1800 ffestd_check_finish_ ();
1805 fputc ('\n', dmpout
);
1809 /* ffestd_R520_start -- OPTIONAL statement list begin
1811 ffestd_R520_start();
1813 Verify that OPTIONAL is valid here, and begin accepting items in the list. */
1816 ffestd_R520_start ()
1818 ffestd_check_start_ ();
1820 ffestd_subr_f90_ ();
1824 fputs ("* OPTIONAL ", dmpout
);
1828 /* ffestd_R520_item -- OPTIONAL statement for name
1830 ffestd_R520_item(name_token);
1832 Make sure name_token identifies a valid object to be OPTIONALed. */
1835 ffestd_R520_item (ffelexToken name
)
1837 ffestd_check_item_ ();
1842 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
1846 /* ffestd_R520_finish -- OPTIONAL statement list complete
1848 ffestd_R520_finish();
1850 Just wrap up any local activities. */
1853 ffestd_R520_finish ()
1855 ffestd_check_finish_ ();
1860 fputc ('\n', dmpout
);
1864 /* ffestd_R521A -- PUBLIC statement
1868 Verify that PUBLIC is valid here. */
1873 ffestd_check_simple_ ();
1875 ffestd_subr_f90_ ();
1879 fputs ("* PUBLIC\n", dmpout
);
1883 /* ffestd_R521Astart -- PUBLIC statement list begin
1885 ffestd_R521Astart();
1887 Verify that PUBLIC is valid here, and begin accepting items in the list. */
1890 ffestd_R521Astart ()
1892 ffestd_check_start_ ();
1894 ffestd_subr_f90_ ();
1898 fputs ("* PUBLIC ", dmpout
);
1902 /* ffestd_R521Aitem -- PUBLIC statement for name
1904 ffestd_R521Aitem(name_token);
1906 Make sure name_token identifies a valid object to be PUBLICed. */
1909 ffestd_R521Aitem (ffelexToken name
)
1911 ffestd_check_item_ ();
1916 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
1920 /* ffestd_R521Afinish -- PUBLIC statement list complete
1922 ffestd_R521Afinish();
1924 Just wrap up any local activities. */
1927 ffestd_R521Afinish ()
1929 ffestd_check_finish_ ();
1934 fputc ('\n', dmpout
);
1938 /* ffestd_R521B -- PRIVATE statement
1942 Verify that PRIVATE is valid here (outside a derived-type statement). */
1947 ffestd_check_simple_ ();
1949 ffestd_subr_f90_ ();
1953 fputs ("* PRIVATE_outside_of_R422_derived_type_def\n", dmpout
);
1957 /* ffestd_R521Bstart -- PRIVATE statement list begin
1959 ffestd_R521Bstart();
1961 Verify that PRIVATE is valid here, and begin accepting items in the list. */
1964 ffestd_R521Bstart ()
1966 ffestd_check_start_ ();
1968 ffestd_subr_f90_ ();
1972 fputs ("* PRIVATE ", dmpout
);
1976 /* ffestd_R521Bitem -- PRIVATE statement for name
1978 ffestd_R521Bitem(name_token);
1980 Make sure name_token identifies a valid object to be PRIVATEed. */
1983 ffestd_R521Bitem (ffelexToken name
)
1985 ffestd_check_item_ ();
1990 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
1994 /* ffestd_R521Bfinish -- PRIVATE statement list complete
1996 ffestd_R521Bfinish();
1998 Just wrap up any local activities. */
2001 ffestd_R521Bfinish ()
2003 ffestd_check_finish_ ();
2008 fputc ('\n', dmpout
);
2013 /* ffestd_R522 -- SAVE statement with no list
2017 Verify that SAVE is valid here, and flag everything as SAVEd. */
2022 ffestd_check_simple_ ();
2024 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2025 fputs ("* SAVE_all\n", dmpout
);
2026 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2032 /* ffestd_R522start -- SAVE statement list begin
2036 Verify that SAVE is valid here, and begin accepting items in the list. */
2041 ffestd_check_start_ ();
2043 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2044 fputs ("* SAVE ", dmpout
);
2045 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2051 /* ffestd_R522item_object -- SAVE statement for object-name
2053 ffestd_R522item_object(name_token);
2055 Make sure name_token identifies a valid object to be SAVEd. */
2058 ffestd_R522item_object (ffelexToken name UNUSED
)
2060 ffestd_check_item_ ();
2062 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2063 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
2064 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2070 /* ffestd_R522item_cblock -- SAVE statement for common-block-name
2072 ffestd_R522item_cblock(name_token);
2074 Make sure name_token identifies a valid common block to be SAVEd. */
2077 ffestd_R522item_cblock (ffelexToken name UNUSED
)
2079 ffestd_check_item_ ();
2081 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2082 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
2083 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2089 /* ffestd_R522finish -- SAVE statement list complete
2091 ffestd_R522finish();
2093 Just wrap up any local activities. */
2096 ffestd_R522finish ()
2098 ffestd_check_finish_ ();
2100 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2101 fputc ('\n', dmpout
);
2102 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2108 /* ffestd_R524_start -- DIMENSION statement list begin
2110 ffestd_R524_start(bool virtual);
2112 Verify that DIMENSION is valid here, and begin accepting items in the list. */
2115 ffestd_R524_start (bool virtual UNUSED
)
2117 ffestd_check_start_ ();
2119 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2121 fputs ("* VIRTUAL ", dmpout
); /* V028. */
2123 fputs ("* DIMENSION ", dmpout
);
2124 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2130 /* ffestd_R524_item -- DIMENSION statement for object-name
2132 ffestd_R524_item(name_token,dim_list);
2134 Make sure name_token identifies a valid object to be DIMENSIONd. */
2137 ffestd_R524_item (ffelexToken name UNUSED
, ffesttDimList dims UNUSED
)
2139 ffestd_check_item_ ();
2141 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2142 fputs (ffelex_token_text (name
), dmpout
);
2143 fputc ('(', dmpout
);
2144 ffestt_dimlist_dump (dims
);
2145 fputs ("),", dmpout
);
2146 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2152 /* ffestd_R524_finish -- DIMENSION statement list complete
2154 ffestd_R524_finish();
2156 Just wrap up any local activities. */
2159 ffestd_R524_finish ()
2161 ffestd_check_finish_ ();
2163 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2164 fputc ('\n', dmpout
);
2165 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2171 /* ffestd_R525_start -- ALLOCATABLE statement list begin
2173 ffestd_R525_start();
2175 Verify that ALLOCATABLE is valid here, and begin accepting items in the
2180 ffestd_R525_start ()
2182 ffestd_check_start_ ();
2184 ffestd_subr_f90_ ();
2188 fputs ("* ALLOCATABLE ", dmpout
);
2192 /* ffestd_R525_item -- ALLOCATABLE statement for object-name
2194 ffestd_R525_item(name_token,dim_list);
2196 Make sure name_token identifies a valid object to be ALLOCATABLEd. */
2199 ffestd_R525_item (ffelexToken name
, ffesttDimList dims
)
2201 ffestd_check_item_ ();
2206 fputs (ffelex_token_text (name
), dmpout
);
2209 fputc ('(', dmpout
);
2210 ffestt_dimlist_dump (dims
);
2211 fputc (')', dmpout
);
2213 fputc (',', dmpout
);
2217 /* ffestd_R525_finish -- ALLOCATABLE statement list complete
2219 ffestd_R525_finish();
2221 Just wrap up any local activities. */
2224 ffestd_R525_finish ()
2226 ffestd_check_finish_ ();
2231 fputc ('\n', dmpout
);
2235 /* ffestd_R526_start -- POINTER statement list begin
2237 ffestd_R526_start();
2239 Verify that POINTER is valid here, and begin accepting items in the
2243 ffestd_R526_start ()
2245 ffestd_check_start_ ();
2247 ffestd_subr_f90_ ();
2251 fputs ("* POINTER ", dmpout
);
2255 /* ffestd_R526_item -- POINTER statement for object-name
2257 ffestd_R526_item(name_token,dim_list);
2259 Make sure name_token identifies a valid object to be POINTERd. */
2262 ffestd_R526_item (ffelexToken name
, ffesttDimList dims
)
2264 ffestd_check_item_ ();
2269 fputs (ffelex_token_text (name
), dmpout
);
2272 fputc ('(', dmpout
);
2273 ffestt_dimlist_dump (dims
);
2274 fputc (')', dmpout
);
2276 fputc (',', dmpout
);
2280 /* ffestd_R526_finish -- POINTER statement list complete
2282 ffestd_R526_finish();
2284 Just wrap up any local activities. */
2287 ffestd_R526_finish ()
2289 ffestd_check_finish_ ();
2294 fputc ('\n', dmpout
);
2298 /* ffestd_R527_start -- TARGET statement list begin
2300 ffestd_R527_start();
2302 Verify that TARGET is valid here, and begin accepting items in the
2306 ffestd_R527_start ()
2308 ffestd_check_start_ ();
2310 ffestd_subr_f90_ ();
2314 fputs ("* TARGET ", dmpout
);
2318 /* ffestd_R527_item -- TARGET statement for object-name
2320 ffestd_R527_item(name_token,dim_list);
2322 Make sure name_token identifies a valid object to be TARGETd. */
2325 ffestd_R527_item (ffelexToken name
, ffesttDimList dims
)
2327 ffestd_check_item_ ();
2332 fputs (ffelex_token_text (name
), dmpout
);
2335 fputc ('(', dmpout
);
2336 ffestt_dimlist_dump (dims
);
2337 fputc (')', dmpout
);
2339 fputc (',', dmpout
);
2343 /* ffestd_R527_finish -- TARGET statement list complete
2345 ffestd_R527_finish();
2347 Just wrap up any local activities. */
2350 ffestd_R527_finish ()
2352 ffestd_check_finish_ ();
2357 fputc ('\n', dmpout
);
2362 /* ffestd_R537_start -- PARAMETER statement list begin
2364 ffestd_R537_start();
2366 Verify that PARAMETER is valid here, and begin accepting items in the list. */
2369 ffestd_R537_start ()
2371 ffestd_check_start_ ();
2373 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2374 fputs ("* PARAMETER (", dmpout
);
2375 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2381 /* ffestd_R537_item -- PARAMETER statement assignment
2383 ffestd_R537_item(dest,dest_token,source,source_token);
2385 Make sure the source is a valid source for the destination; make the
2389 ffestd_R537_item (ffebld dest UNUSED
, ffebld source UNUSED
)
2391 ffestd_check_item_ ();
2393 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2395 fputc ('=', dmpout
);
2396 ffebld_dump (source
);
2397 fputc (',', dmpout
);
2398 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2404 /* ffestd_R537_finish -- PARAMETER statement list complete
2406 ffestd_R537_finish();
2408 Just wrap up any local activities. */
2411 ffestd_R537_finish ()
2413 ffestd_check_finish_ ();
2415 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2416 fputs (")\n", dmpout
);
2417 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2423 /* ffestd_R539 -- IMPLICIT NONE statement
2427 Verify that the IMPLICIT NONE statement is ok here and implement. */
2432 ffestd_check_simple_ ();
2434 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2435 fputs ("* IMPLICIT_NONE\n", dmpout
);
2436 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2442 /* ffestd_R539start -- IMPLICIT statement
2446 Verify that the IMPLICIT statement is ok here and implement. */
2451 ffestd_check_start_ ();
2453 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2454 fputs ("* IMPLICIT ", dmpout
);
2455 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2461 /* ffestd_R539item -- IMPLICIT statement specification (R540)
2463 ffestd_R539item(...);
2465 Verify that the type and letter list are all ok and implement. */
2468 ffestd_R539item (ffestpType type UNUSED
, ffebld kind UNUSED
,
2469 ffelexToken kindt UNUSED
, ffebld len UNUSED
,
2470 ffelexToken lent UNUSED
, ffesttImpList letters UNUSED
)
2472 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2476 ffestd_check_item_ ();
2478 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2481 case FFESTP_typeINTEGER
:
2485 case FFESTP_typeBYTE
:
2489 case FFESTP_typeWORD
:
2493 case FFESTP_typeREAL
:
2497 case FFESTP_typeCOMPLEX
:
2501 case FFESTP_typeLOGICAL
:
2505 case FFESTP_typeCHARACTER
:
2509 case FFESTP_typeDBLPRCSN
:
2510 a
= "DOUBLE PRECISION";
2513 case FFESTP_typeDBLCMPLX
:
2514 a
= "DOUBLE COMPLEX";
2518 case FFESTP_typeTYPE
:
2528 fprintf (dmpout
, "%s(", a
);
2531 fputs ("kind=", dmpout
);
2533 fputs (ffelex_token_text (kindt
), dmpout
);
2537 fputc (',', dmpout
);
2541 fputs ("len=", dmpout
);
2543 fputs (ffelex_token_text (lent
), dmpout
);
2547 fputs (")(", dmpout
);
2548 ffestt_implist_dump (letters
);
2549 fputs ("),", dmpout
);
2550 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2556 /* ffestd_R539finish -- IMPLICIT statement
2558 ffestd_R539finish();
2560 Finish up any local activities. */
2563 ffestd_R539finish ()
2565 ffestd_check_finish_ ();
2567 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2568 fputc ('\n', dmpout
);
2569 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2575 /* ffestd_R542_start -- NAMELIST statement list begin
2577 ffestd_R542_start();
2579 Verify that NAMELIST is valid here, and begin accepting items in the list. */
2582 ffestd_R542_start ()
2584 ffestd_check_start_ ();
2586 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2587 fputs ("* NAMELIST ", dmpout
);
2588 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2594 /* ffestd_R542_item_nlist -- NAMELIST statement for group-name
2596 ffestd_R542_item_nlist(groupname_token);
2598 Make sure name_token identifies a valid object to be NAMELISTd. */
2601 ffestd_R542_item_nlist (ffelexToken name UNUSED
)
2603 ffestd_check_item_ ();
2605 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2606 fprintf (dmpout
, "/%s/", ffelex_token_text (name
));
2607 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2613 /* ffestd_R542_item_nitem -- NAMELIST statement for variable-name
2615 ffestd_R542_item_nitem(name_token);
2617 Make sure name_token identifies a valid object to be NAMELISTd. */
2620 ffestd_R542_item_nitem (ffelexToken name UNUSED
)
2622 ffestd_check_item_ ();
2624 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2625 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
2626 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2632 /* ffestd_R542_finish -- NAMELIST statement list complete
2634 ffestd_R542_finish();
2636 Just wrap up any local activities. */
2639 ffestd_R542_finish ()
2641 ffestd_check_finish_ ();
2643 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2644 fputc ('\n', dmpout
);
2645 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2651 /* ffestd_R544_start -- EQUIVALENCE statement list begin
2653 ffestd_R544_start();
2655 Verify that EQUIVALENCE is valid here, and begin accepting items in the
2660 ffestd_R544_start ()
2662 ffestd_check_start_ ();
2664 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2665 fputs ("* EQUIVALENCE (", dmpout
);
2666 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2673 /* ffestd_R544_item -- EQUIVALENCE statement assignment
2675 ffestd_R544_item(exprlist);
2677 Make sure the equivalence is valid, then implement it. */
2681 ffestd_R544_item (ffesttExprList exprlist
)
2683 ffestd_check_item_ ();
2685 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2686 ffestt_exprlist_dump (exprlist
);
2687 fputs ("),", dmpout
);
2688 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2695 /* ffestd_R544_finish -- EQUIVALENCE statement list complete
2697 ffestd_R544_finish();
2699 Just wrap up any local activities. */
2703 ffestd_R544_finish ()
2705 ffestd_check_finish_ ();
2707 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2708 fputs (")\n", dmpout
);
2709 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2716 /* ffestd_R547_start -- COMMON statement list begin
2718 ffestd_R547_start();
2720 Verify that COMMON is valid here, and begin accepting items in the list. */
2723 ffestd_R547_start ()
2725 ffestd_check_start_ ();
2727 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2728 fputs ("* COMMON ", dmpout
);
2729 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2735 /* ffestd_R547_item_object -- COMMON statement for object-name
2737 ffestd_R547_item_object(name_token,dim_list);
2739 Make sure name_token identifies a valid object to be COMMONd. */
2742 ffestd_R547_item_object (ffelexToken name UNUSED
,
2743 ffesttDimList dims UNUSED
)
2745 ffestd_check_item_ ();
2747 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2748 fputs (ffelex_token_text (name
), dmpout
);
2751 fputc ('(', dmpout
);
2752 ffestt_dimlist_dump (dims
);
2753 fputc (')', dmpout
);
2755 fputc (',', dmpout
);
2756 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2762 /* ffestd_R547_item_cblock -- COMMON statement for common-block-name
2764 ffestd_R547_item_cblock(name_token);
2766 Make sure name_token identifies a valid common block to be COMMONd. */
2769 ffestd_R547_item_cblock (ffelexToken name UNUSED
)
2771 ffestd_check_item_ ();
2773 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2775 fputs ("//,", dmpout
);
2777 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
2778 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2784 /* ffestd_R547_finish -- COMMON statement list complete
2786 ffestd_R547_finish();
2788 Just wrap up any local activities. */
2791 ffestd_R547_finish ()
2793 ffestd_check_finish_ ();
2795 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2796 fputc ('\n', dmpout
);
2797 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2803 /* ffestd_R620 -- ALLOCATE statement
2805 ffestd_R620(exprlist,stat,stat_token);
2807 Make sure the expression list is valid, then implement it. */
2811 ffestd_R620 (ffesttExprList exprlist
, ffebld stat
)
2813 ffestd_check_simple_ ();
2815 ffestd_subr_f90_ ();
2819 fputs ("+ ALLOCATE (", dmpout
);
2820 ffestt_exprlist_dump (exprlist
);
2823 fputs (",stat=", dmpout
);
2826 fputs (")\n", dmpout
);
2830 /* ffestd_R624 -- NULLIFY statement
2832 ffestd_R624(pointer_name_list);
2834 Make sure pointer_name_list identifies valid pointers for a NULLIFY. */
2837 ffestd_R624 (ffesttExprList pointers
)
2839 ffestd_check_simple_ ();
2841 ffestd_subr_f90_ ();
2845 fputs ("+ NULLIFY (", dmpout
);
2846 assert (pointers
!= NULL
);
2847 ffestt_exprlist_dump (pointers
);
2848 fputs (")\n", dmpout
);
2852 /* ffestd_R625 -- DEALLOCATE statement
2854 ffestd_R625(exprlist,stat,stat_token);
2856 Make sure the equivalence is valid, then implement it. */
2859 ffestd_R625 (ffesttExprList exprlist
, ffebld stat
)
2861 ffestd_check_simple_ ();
2863 ffestd_subr_f90_ ();
2867 fputs ("+ DEALLOCATE (", dmpout
);
2868 ffestt_exprlist_dump (exprlist
);
2871 fputs (",stat=", dmpout
);
2874 fputs (")\n", dmpout
);
2879 /* ffestd_R737A -- Assignment statement outside of WHERE
2881 ffestd_R737A(dest_expr,source_expr); */
2884 ffestd_R737A (ffebld dest
, ffebld source
)
2886 ffestd_check_simple_ ();
2889 ffestd_subr_line_now_ ();
2890 ffeste_R737A (dest
, source
);
2895 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR737A_
);
2896 ffestd_stmt_append_ (stmt
);
2897 ffestd_subr_line_save_ (stmt
);
2898 stmt
->u
.R737A
.pool
= ffesta_output_pool
;
2899 stmt
->u
.R737A
.dest
= dest
;
2900 stmt
->u
.R737A
.source
= source
;
2901 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
2906 /* ffestd_R737B -- Assignment statement inside of WHERE
2908 ffestd_R737B(dest_expr,source_expr); */
2912 ffestd_R737B (ffebld dest
, ffebld source
)
2914 ffestd_check_simple_ ();
2919 fputs ("+ let_inside_where ", dmpout
);
2921 fputs ("=", dmpout
);
2922 ffebld_dump (source
);
2923 fputc ('\n', dmpout
);
2927 /* ffestd_R738 -- Pointer assignment statement
2929 ffestd_R738(dest_expr,source_expr,source_token);
2931 Make sure the assignment is valid. */
2934 ffestd_R738 (ffebld dest
, ffebld source
)
2936 ffestd_check_simple_ ();
2938 ffestd_subr_f90_ ();
2942 fputs ("+ let_pointer ", dmpout
);
2944 fputs ("=>", dmpout
);
2945 ffebld_dump (source
);
2946 fputc ('\n', dmpout
);
2950 /* ffestd_R740 -- WHERE statement
2952 ffestd_R740(expr,expr_token);
2954 Make sure statement is valid here; implement. */
2957 ffestd_R740 (ffebld expr
)
2959 ffestd_check_simple_ ();
2961 ffestd_subr_f90_ ();
2965 fputs ("+ WHERE (", dmpout
);
2967 fputs (")\n", dmpout
);
2969 ++ffestd_block_level_
;
2970 assert (ffestd_block_level_
> 0);
2974 /* ffestd_R742 -- WHERE-construct statement
2976 ffestd_R742(expr,expr_token);
2978 Make sure statement is valid here; implement. */
2981 ffestd_R742 (ffebld expr
)
2983 ffestd_check_simple_ ();
2985 ffestd_subr_f90_ ();
2989 fputs ("+ WHERE_construct (", dmpout
);
2991 fputs (")\n", dmpout
);
2993 ++ffestd_block_level_
;
2994 assert (ffestd_block_level_
> 0);
2998 /* ffestd_R744 -- ELSE WHERE statement
3002 Make sure ffestd_kind_ identifies a WHERE block.
3003 Implement the ELSE of the current WHERE block. */
3008 ffestd_check_simple_ ();
3013 fputs ("+ ELSE_WHERE\n", dmpout
);
3017 /* ffestd_R745 -- Implicit END WHERE statement. */
3020 ffestd_R745 (bool ok
)
3025 fputs ("+ END_WHERE\n", dmpout
); /* Also see ffestd_R745. */
3027 --ffestd_block_level_
;
3028 assert (ffestd_block_level_
>= 0);
3034 /* Block IF (IF-THEN) statement. */
3037 ffestd_R803 (ffelexToken construct_name UNUSED
, ffebld expr
)
3039 ffestd_check_simple_ ();
3042 ffestd_subr_line_now_ ();
3043 ffeste_R803 (expr
); /* Don't bother with name. */
3048 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR803_
);
3049 ffestd_stmt_append_ (stmt
);
3050 ffestd_subr_line_save_ (stmt
);
3051 stmt
->u
.R803
.pool
= ffesta_output_pool
;
3052 stmt
->u
.R803
.block
= ffestw_use (ffestw_stack_top ());
3053 stmt
->u
.R803
.expr
= expr
;
3054 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3058 ++ffestd_block_level_
;
3059 assert (ffestd_block_level_
> 0);
3062 /* ELSE IF statement. */
3065 ffestd_R804 (ffebld expr
, ffelexToken name UNUSED
)
3067 ffestd_check_simple_ ();
3070 ffestd_subr_line_now_ ();
3071 ffeste_R804 (expr
); /* Don't bother with name. */
3076 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR804_
);
3077 ffestd_stmt_append_ (stmt
);
3078 ffestd_subr_line_save_ (stmt
);
3079 stmt
->u
.R804
.pool
= ffesta_output_pool
;
3080 stmt
->u
.R804
.block
= ffestw_use (ffestw_stack_top ());
3081 stmt
->u
.R804
.expr
= expr
;
3082 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3087 /* ELSE statement. */
3090 ffestd_R805 (ffelexToken name UNUSED
)
3092 ffestd_check_simple_ ();
3095 ffestd_subr_line_now_ ();
3096 ffeste_R805 (); /* Don't bother with name. */
3101 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR805_
);
3102 ffestd_stmt_append_ (stmt
);
3103 ffestd_subr_line_save_ (stmt
);
3104 stmt
->u
.R805
.block
= ffestw_use (ffestw_stack_top ());
3109 /* END IF statement. */
3112 ffestd_R806 (bool ok UNUSED
)
3115 ffestd_subr_line_now_ ();
3121 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR806_
);
3122 ffestd_stmt_append_ (stmt
);
3123 ffestd_subr_line_save_ (stmt
);
3124 stmt
->u
.R806
.block
= ffestw_use (ffestw_stack_top ());
3128 --ffestd_block_level_
;
3129 assert (ffestd_block_level_
>= 0);
3132 /* ffestd_R807 -- Logical IF statement
3134 ffestd_R807(expr,expr_token);
3136 Make sure statement is valid here; implement. */
3139 ffestd_R807 (ffebld expr
)
3141 ffestd_check_simple_ ();
3144 ffestd_subr_line_now_ ();
3150 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR807_
);
3151 ffestd_stmt_append_ (stmt
);
3152 ffestd_subr_line_save_ (stmt
);
3153 stmt
->u
.R807
.pool
= ffesta_output_pool
;
3154 stmt
->u
.R807
.expr
= expr
;
3155 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3159 ++ffestd_block_level_
;
3160 assert (ffestd_block_level_
> 0);
3163 /* ffestd_R809 -- SELECT CASE statement
3165 ffestd_R809(construct_name,expr,expr_token);
3167 Make sure statement is valid here; implement. */
3170 ffestd_R809 (ffelexToken construct_name UNUSED
, ffebld expr
)
3172 ffestd_check_simple_ ();
3175 ffestd_subr_line_now_ ();
3176 ffeste_R809 (ffestw_stack_top (), expr
);
3181 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR809_
);
3182 ffestd_stmt_append_ (stmt
);
3183 ffestd_subr_line_save_ (stmt
);
3184 stmt
->u
.R809
.pool
= ffesta_output_pool
;
3185 stmt
->u
.R809
.block
= ffestw_use (ffestw_stack_top ());
3186 stmt
->u
.R809
.expr
= expr
;
3187 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3188 malloc_pool_use (ffestw_select (ffestw_stack_top ())->pool
);
3192 ++ffestd_block_level_
;
3193 assert (ffestd_block_level_
> 0);
3196 /* ffestd_R810 -- CASE statement
3198 ffestd_R810(case_value_range_list,name);
3200 If casenum is 0, it's CASE DEFAULT. Else it's the case ranges at
3201 the start of the first_stmt list in the select object at the top of
3202 the stack that match casenum. */
3205 ffestd_R810 (unsigned long casenum
)
3207 ffestd_check_simple_ ();
3210 ffestd_subr_line_now_ ();
3211 ffeste_R810 (ffestw_stack_top (), casenum
);
3216 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR810_
);
3217 ffestd_stmt_append_ (stmt
);
3218 ffestd_subr_line_save_ (stmt
);
3219 stmt
->u
.R810
.pool
= ffesta_output_pool
;
3220 stmt
->u
.R810
.block
= ffestw_stack_top ();
3221 stmt
->u
.R810
.casenum
= casenum
;
3222 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3227 /* ffestd_R811 -- End a SELECT
3229 ffestd_R811(TRUE); */
3232 ffestd_R811 (bool ok UNUSED
)
3235 ffestd_subr_line_now_ ();
3236 ffeste_R811 (ffestw_stack_top ());
3241 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR811_
);
3242 ffestd_stmt_append_ (stmt
);
3243 ffestd_subr_line_save_ (stmt
);
3244 stmt
->u
.R811
.block
= ffestw_stack_top ();
3248 --ffestd_block_level_
;
3249 assert (ffestd_block_level_
>= 0);
3252 /* ffestd_R819A -- Iterative DO statement
3254 ffestd_R819A(construct_name,label_token,expr,expr_token);
3256 Make sure statement is valid here; implement. */
3259 ffestd_R819A (ffelexToken construct_name UNUSED
, ffelab label
,
3260 ffebld var
, ffebld start
, ffelexToken start_token
,
3261 ffebld end
, ffelexToken end_token
,
3262 ffebld incr
, ffelexToken incr_token
)
3264 ffestd_check_simple_ ();
3267 ffestd_subr_line_now_ ();
3268 ffeste_R819A (ffestw_stack_top (), label
, var
, start
, end
, incr
,
3274 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR819A_
);
3275 ffestd_stmt_append_ (stmt
);
3276 ffestd_subr_line_save_ (stmt
);
3277 stmt
->u
.R819A
.pool
= ffesta_output_pool
;
3278 stmt
->u
.R819A
.block
= ffestw_use (ffestw_stack_top ());
3279 stmt
->u
.R819A
.label
= label
;
3280 stmt
->u
.R819A
.var
= var
;
3281 stmt
->u
.R819A
.start
= start
;
3282 stmt
->u
.R819A
.start_token
= ffelex_token_use (start_token
);
3283 stmt
->u
.R819A
.end
= end
;
3284 stmt
->u
.R819A
.end_token
= ffelex_token_use (end_token
);
3285 stmt
->u
.R819A
.incr
= incr
;
3286 stmt
->u
.R819A
.incr_token
= (incr_token
== NULL
) ? NULL
3287 : ffelex_token_use (incr_token
);
3288 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3292 ++ffestd_block_level_
;
3293 assert (ffestd_block_level_
> 0);
3296 /* ffestd_R819B -- DO WHILE statement
3298 ffestd_R819B(construct_name,label_token,expr,expr_token);
3300 Make sure statement is valid here; implement. */
3303 ffestd_R819B (ffelexToken construct_name UNUSED
, ffelab label
,
3306 ffestd_check_simple_ ();
3309 ffestd_subr_line_now_ ();
3310 ffeste_R819B (ffestw_stack_top (), label
, expr
);
3315 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR819B_
);
3316 ffestd_stmt_append_ (stmt
);
3317 ffestd_subr_line_save_ (stmt
);
3318 stmt
->u
.R819B
.pool
= ffesta_output_pool
;
3319 stmt
->u
.R819B
.block
= ffestw_use (ffestw_stack_top ());
3320 stmt
->u
.R819B
.label
= label
;
3321 stmt
->u
.R819B
.expr
= expr
;
3322 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3326 ++ffestd_block_level_
;
3327 assert (ffestd_block_level_
> 0);
3330 /* ffestd_R825 -- END DO statement
3332 ffestd_R825(name_token);
3334 Make sure ffestd_kind_ identifies a DO block. If not
3335 NULL, make sure name_token gives the correct name. Do whatever
3336 is specific to seeing END DO with a DO-target label definition on it,
3337 where the END DO is really treated as a CONTINUE (i.e. generate th
3338 same code you would for CONTINUE). ffestd_do handles the actual
3339 generation of end-loop code. */
3342 ffestd_R825 (ffelexToken name UNUSED
)
3344 ffestd_check_simple_ ();
3347 ffestd_subr_line_now_ ();
3353 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR825_
);
3354 ffestd_stmt_append_ (stmt
);
3355 ffestd_subr_line_save_ (stmt
);
3360 /* ffestd_R834 -- CYCLE statement
3362 ffestd_R834(name_token);
3364 Handle a CYCLE within a loop. */
3367 ffestd_R834 (ffestw block
)
3369 ffestd_check_simple_ ();
3372 ffestd_subr_line_now_ ();
3373 ffeste_R834 (block
);
3378 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR834_
);
3379 ffestd_stmt_append_ (stmt
);
3380 ffestd_subr_line_save_ (stmt
);
3381 stmt
->u
.R834
.block
= block
;
3386 /* ffestd_R835 -- EXIT statement
3388 ffestd_R835(name_token);
3390 Handle a EXIT within a loop. */
3393 ffestd_R835 (ffestw block
)
3395 ffestd_check_simple_ ();
3398 ffestd_subr_line_now_ ();
3399 ffeste_R835 (block
);
3404 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR835_
);
3405 ffestd_stmt_append_ (stmt
);
3406 ffestd_subr_line_save_ (stmt
);
3407 stmt
->u
.R835
.block
= block
;
3412 /* ffestd_R836 -- GOTO statement
3416 Make sure label_token identifies a valid label for a GOTO. Update
3417 that label's info to indicate it is the target of a GOTO. */
3420 ffestd_R836 (ffelab label
)
3422 ffestd_check_simple_ ();
3425 ffestd_subr_line_now_ ();
3426 ffeste_R836 (label
);
3431 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR836_
);
3432 ffestd_stmt_append_ (stmt
);
3433 ffestd_subr_line_save_ (stmt
);
3434 stmt
->u
.R836
.label
= label
;
3438 if (ffestd_block_level_
== 0)
3439 ffestd_is_reachable_
= FALSE
;
3442 /* ffestd_R837 -- Computed GOTO statement
3444 ffestd_R837(labels,expr);
3446 Make sure label_list identifies valid labels for a GOTO. Update
3447 each label's info to indicate it is the target of a GOTO. */
3450 ffestd_R837 (ffelab
*labels
, int count
, ffebld expr
)
3452 ffestd_check_simple_ ();
3455 ffestd_subr_line_now_ ();
3456 ffeste_R837 (labels
, count
, expr
);
3461 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR837_
);
3462 ffestd_stmt_append_ (stmt
);
3463 ffestd_subr_line_save_ (stmt
);
3464 stmt
->u
.R837
.pool
= ffesta_output_pool
;
3465 stmt
->u
.R837
.labels
= labels
;
3466 stmt
->u
.R837
.count
= count
;
3467 stmt
->u
.R837
.expr
= expr
;
3468 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3473 /* ffestd_R838 -- ASSIGN statement
3475 ffestd_R838(label_token,target_variable,target_token);
3477 Make sure label_token identifies a valid label for an assignment. Update
3478 that label's info to indicate it is the source of an assignment. Update
3479 target_variable's info to indicate it is the target the assignment of that
3483 ffestd_R838 (ffelab label
, ffebld target
)
3485 ffestd_check_simple_ ();
3488 ffestd_subr_line_now_ ();
3489 ffeste_R838 (label
, target
);
3494 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR838_
);
3495 ffestd_stmt_append_ (stmt
);
3496 ffestd_subr_line_save_ (stmt
);
3497 stmt
->u
.R838
.pool
= ffesta_output_pool
;
3498 stmt
->u
.R838
.label
= label
;
3499 stmt
->u
.R838
.target
= target
;
3500 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3505 /* ffestd_R839 -- Assigned GOTO statement
3507 ffestd_R839(target,labels);
3509 Make sure label_list identifies valid labels for a GOTO. Update
3510 each label's info to indicate it is the target of a GOTO. */
3513 ffestd_R839 (ffebld target
, ffelab
*labels UNUSED
, int count UNUSED
)
3515 ffestd_check_simple_ ();
3518 ffestd_subr_line_now_ ();
3519 ffeste_R839 (target
);
3524 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR839_
);
3525 ffestd_stmt_append_ (stmt
);
3526 ffestd_subr_line_save_ (stmt
);
3527 stmt
->u
.R839
.pool
= ffesta_output_pool
;
3528 stmt
->u
.R839
.target
= target
;
3529 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3533 if (ffestd_block_level_
== 0)
3534 ffestd_is_reachable_
= FALSE
;
3537 /* ffestd_R840 -- Arithmetic IF statement
3539 ffestd_R840(expr,expr_token,neg,zero,pos);
3541 Make sure the labels are valid; implement. */
3544 ffestd_R840 (ffebld expr
, ffelab neg
, ffelab zero
, ffelab pos
)
3546 ffestd_check_simple_ ();
3549 ffestd_subr_line_now_ ();
3550 ffeste_R840 (expr
, neg
, zero
, pos
);
3555 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR840_
);
3556 ffestd_stmt_append_ (stmt
);
3557 ffestd_subr_line_save_ (stmt
);
3558 stmt
->u
.R840
.pool
= ffesta_output_pool
;
3559 stmt
->u
.R840
.expr
= expr
;
3560 stmt
->u
.R840
.neg
= neg
;
3561 stmt
->u
.R840
.zero
= zero
;
3562 stmt
->u
.R840
.pos
= pos
;
3563 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3567 if (ffestd_block_level_
== 0)
3568 ffestd_is_reachable_
= FALSE
;
3571 /* ffestd_R841 -- CONTINUE statement
3576 ffestd_R841 (bool in_where UNUSED
)
3578 ffestd_check_simple_ ();
3581 ffestd_subr_line_now_ ();
3587 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR841_
);
3588 ffestd_stmt_append_ (stmt
);
3589 ffestd_subr_line_save_ (stmt
);
3594 /* ffestd_R842 -- STOP statement
3596 ffestd_R842(expr); */
3599 ffestd_R842 (ffebld expr
)
3601 ffestd_check_simple_ ();
3604 ffestd_subr_line_now_ ();
3610 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR842_
);
3611 ffestd_stmt_append_ (stmt
);
3612 ffestd_subr_line_save_ (stmt
);
3613 if (ffesta_outpooldisp () == FFESTA_pooldispPRESERVE
)
3615 /* This is a "spurious" (automatically-generated) STOP
3616 that follows a previous STOP or other statement.
3617 Make sure we don't have an expression in the pool,
3618 and then mark that the pool has already been killed. */
3619 assert (expr
== NULL
);
3620 stmt
->u
.R842
.pool
= NULL
;
3621 stmt
->u
.R842
.expr
= NULL
;
3625 stmt
->u
.R842
.pool
= ffesta_output_pool
;
3626 stmt
->u
.R842
.expr
= expr
;
3627 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3632 if (ffestd_block_level_
== 0)
3633 ffestd_is_reachable_
= FALSE
;
3636 /* ffestd_R843 -- PAUSE statement
3638 ffestd_R843(expr,expr_token);
3640 Make sure statement is valid here; implement. expr and expr_token are
3641 both NULL if there was no expression. */
3644 ffestd_R843 (ffebld expr
)
3646 ffestd_check_simple_ ();
3649 ffestd_subr_line_now_ ();
3655 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR843_
);
3656 ffestd_stmt_append_ (stmt
);
3657 ffestd_subr_line_save_ (stmt
);
3658 stmt
->u
.R843
.pool
= ffesta_output_pool
;
3659 stmt
->u
.R843
.expr
= expr
;
3660 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3665 /* ffestd_R904 -- OPEN statement
3669 Make sure an OPEN is valid in the current context, and implement it. */
3674 ffestd_check_simple_ ();
3676 #if FFECOM_targetCURRENT == FFECOM_targetGCC
3677 #define specified(something) \
3678 (ffestp_file.open.open_spec[something].kw_or_val_present)
3680 /* Warn if there are any thing we don't handle via f2c libraries. */
3682 if (specified (FFESTP_openixACTION
)
3683 || specified (FFESTP_openixASSOCIATEVARIABLE
)
3684 || specified (FFESTP_openixBLOCKSIZE
)
3685 || specified (FFESTP_openixBUFFERCOUNT
)
3686 || specified (FFESTP_openixCARRIAGECONTROL
)
3687 || specified (FFESTP_openixDEFAULTFILE
)
3688 || specified (FFESTP_openixDELIM
)
3689 || specified (FFESTP_openixDISPOSE
)
3690 || specified (FFESTP_openixEXTENDSIZE
)
3691 || specified (FFESTP_openixINITIALSIZE
)
3692 || specified (FFESTP_openixKEY
)
3693 || specified (FFESTP_openixMAXREC
)
3694 || specified (FFESTP_openixNOSPANBLOCKS
)
3695 || specified (FFESTP_openixORGANIZATION
)
3696 || specified (FFESTP_openixPAD
)
3697 || specified (FFESTP_openixPOSITION
)
3698 || specified (FFESTP_openixREADONLY
)
3699 || specified (FFESTP_openixRECORDTYPE
)
3700 || specified (FFESTP_openixSHARED
)
3701 || specified (FFESTP_openixUSEROPEN
))
3703 ffebad_start (FFEBAD_OPEN_UNSUPPORTED
);
3704 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
3705 ffelex_token_where_column (ffesta_tokens
[0]));
3713 ffestd_subr_line_now_ ();
3714 ffeste_R904 (&ffestp_file
.open
);
3719 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR904_
);
3720 ffestd_stmt_append_ (stmt
);
3721 ffestd_subr_line_save_ (stmt
);
3722 stmt
->u
.R904
.pool
= ffesta_output_pool
;
3723 stmt
->u
.R904
.params
= ffestd_subr_copy_open_ ();
3724 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3729 /* ffestd_R907 -- CLOSE statement
3733 Make sure a CLOSE is valid in the current context, and implement it. */
3738 ffestd_check_simple_ ();
3741 ffestd_subr_line_now_ ();
3742 ffeste_R907 (&ffestp_file
.close
);
3747 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR907_
);
3748 ffestd_stmt_append_ (stmt
);
3749 ffestd_subr_line_save_ (stmt
);
3750 stmt
->u
.R907
.pool
= ffesta_output_pool
;
3751 stmt
->u
.R907
.params
= ffestd_subr_copy_close_ ();
3752 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3757 /* ffestd_R909_start -- READ(...) statement list begin
3759 ffestd_R909_start(FALSE);
3761 Verify that READ is valid here, and begin accepting items in the
3765 ffestd_R909_start (bool only_format
, ffestvUnit unit
,
3766 ffestvFormat format
, bool rec
, bool key
)
3768 ffestd_check_start_ ();
3770 #if FFECOM_targetCURRENT == FFECOM_targetGCC
3771 #define specified(something) \
3772 (ffestp_file.read.read_spec[something].kw_or_val_present)
3774 /* Warn if there are any thing we don't handle via f2c libraries. */
3775 if (specified (FFESTP_readixADVANCE
)
3776 || specified (FFESTP_readixEOR
)
3777 || specified (FFESTP_readixKEYEQ
)
3778 || specified (FFESTP_readixKEYGE
)
3779 || specified (FFESTP_readixKEYGT
)
3780 || specified (FFESTP_readixKEYID
)
3781 || specified (FFESTP_readixNULLS
)
3782 || specified (FFESTP_readixSIZE
))
3784 ffebad_start (FFEBAD_READ_UNSUPPORTED
);
3785 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
3786 ffelex_token_where_column (ffesta_tokens
[0]));
3794 ffestd_subr_line_now_ ();
3795 ffeste_R909_start (&ffestp_file
.read
, only_format
, unit
, format
, rec
, key
);
3800 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR909_
);
3801 ffestd_stmt_append_ (stmt
);
3802 ffestd_subr_line_save_ (stmt
);
3803 stmt
->u
.R909
.pool
= ffesta_output_pool
;
3804 stmt
->u
.R909
.params
= ffestd_subr_copy_read_ ();
3805 stmt
->u
.R909
.only_format
= only_format
;
3806 stmt
->u
.R909
.unit
= unit
;
3807 stmt
->u
.R909
.format
= format
;
3808 stmt
->u
.R909
.rec
= rec
;
3809 stmt
->u
.R909
.key
= key
;
3810 stmt
->u
.R909
.list
= NULL
;
3811 ffestd_expr_list_
= &stmt
->u
.R909
.list
;
3812 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3817 /* ffestd_R909_item -- READ statement i/o item
3819 ffestd_R909_item(expr,expr_token);
3821 Implement output-list expression. */
3824 ffestd_R909_item (ffebld expr
, ffelexToken expr_token
)
3826 ffestd_check_item_ ();
3829 ffeste_R909_item (expr
);
3832 ffestdExprItem_ item
3833 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
3838 item
->token
= ffelex_token_use (expr_token
);
3839 *ffestd_expr_list_
= item
;
3840 ffestd_expr_list_
= &item
->next
;
3845 /* ffestd_R909_finish -- READ statement list complete
3847 ffestd_R909_finish();
3849 Just wrap up any local activities. */
3852 ffestd_R909_finish ()
3854 ffestd_check_finish_ ();
3857 ffeste_R909_finish ();
3859 /* Nothing to do, it's implicit. */
3863 /* ffestd_R910_start -- WRITE(...) statement list begin
3865 ffestd_R910_start();
3867 Verify that WRITE is valid here, and begin accepting items in the
3871 ffestd_R910_start (ffestvUnit unit
, ffestvFormat format
, bool rec
)
3873 ffestd_check_start_ ();
3875 #if FFECOM_targetCURRENT == FFECOM_targetGCC
3876 #define specified(something) \
3877 (ffestp_file.write.write_spec[something].kw_or_val_present)
3879 /* Warn if there are any thing we don't handle via f2c libraries. */
3880 if (specified (FFESTP_writeixADVANCE
)
3881 || specified (FFESTP_writeixEOR
))
3883 ffebad_start (FFEBAD_WRITE_UNSUPPORTED
);
3884 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
3885 ffelex_token_where_column (ffesta_tokens
[0]));
3893 ffestd_subr_line_now_ ();
3894 ffeste_R910_start (&ffestp_file
.write
, unit
, format
, rec
);
3899 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR910_
);
3900 ffestd_stmt_append_ (stmt
);
3901 ffestd_subr_line_save_ (stmt
);
3902 stmt
->u
.R910
.pool
= ffesta_output_pool
;
3903 stmt
->u
.R910
.params
= ffestd_subr_copy_write_ ();
3904 stmt
->u
.R910
.unit
= unit
;
3905 stmt
->u
.R910
.format
= format
;
3906 stmt
->u
.R910
.rec
= rec
;
3907 stmt
->u
.R910
.list
= NULL
;
3908 ffestd_expr_list_
= &stmt
->u
.R910
.list
;
3909 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3914 /* ffestd_R910_item -- WRITE statement i/o item
3916 ffestd_R910_item(expr,expr_token);
3918 Implement output-list expression. */
3921 ffestd_R910_item (ffebld expr
, ffelexToken expr_token
)
3923 ffestd_check_item_ ();
3926 ffeste_R910_item (expr
);
3929 ffestdExprItem_ item
3930 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
3935 item
->token
= ffelex_token_use (expr_token
);
3936 *ffestd_expr_list_
= item
;
3937 ffestd_expr_list_
= &item
->next
;
3942 /* ffestd_R910_finish -- WRITE statement list complete
3944 ffestd_R910_finish();
3946 Just wrap up any local activities. */
3949 ffestd_R910_finish ()
3951 ffestd_check_finish_ ();
3954 ffeste_R910_finish ();
3956 /* Nothing to do, it's implicit. */
3960 /* ffestd_R911_start -- PRINT statement list begin
3962 ffestd_R911_start();
3964 Verify that PRINT is valid here, and begin accepting items in the
3968 ffestd_R911_start (ffestvFormat format
)
3970 ffestd_check_start_ ();
3973 ffestd_subr_line_now_ ();
3974 ffeste_R911_start (&ffestp_file
.print
, format
);
3979 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR911_
);
3980 ffestd_stmt_append_ (stmt
);
3981 ffestd_subr_line_save_ (stmt
);
3982 stmt
->u
.R911
.pool
= ffesta_output_pool
;
3983 stmt
->u
.R911
.params
= ffestd_subr_copy_print_ ();
3984 stmt
->u
.R911
.format
= format
;
3985 stmt
->u
.R911
.list
= NULL
;
3986 ffestd_expr_list_
= &stmt
->u
.R911
.list
;
3987 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3992 /* ffestd_R911_item -- PRINT statement i/o item
3994 ffestd_R911_item(expr,expr_token);
3996 Implement output-list expression. */
3999 ffestd_R911_item (ffebld expr
, ffelexToken expr_token
)
4001 ffestd_check_item_ ();
4004 ffeste_R911_item (expr
);
4007 ffestdExprItem_ item
4008 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
4013 item
->token
= ffelex_token_use (expr_token
);
4014 *ffestd_expr_list_
= item
;
4015 ffestd_expr_list_
= &item
->next
;
4020 /* ffestd_R911_finish -- PRINT statement list complete
4022 ffestd_R911_finish();
4024 Just wrap up any local activities. */
4027 ffestd_R911_finish ()
4029 ffestd_check_finish_ ();
4032 ffeste_R911_finish ();
4034 /* Nothing to do, it's implicit. */
4038 /* ffestd_R919 -- BACKSPACE statement
4042 Make sure a BACKSPACE is valid in the current context, and implement it. */
4047 ffestd_check_simple_ ();
4050 ffestd_subr_line_now_ ();
4051 ffeste_R919 (&ffestp_file
.beru
);
4056 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR919_
);
4057 ffestd_stmt_append_ (stmt
);
4058 ffestd_subr_line_save_ (stmt
);
4059 stmt
->u
.R919
.pool
= ffesta_output_pool
;
4060 stmt
->u
.R919
.params
= ffestd_subr_copy_beru_ ();
4061 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
4066 /* ffestd_R920 -- ENDFILE statement
4070 Make sure a ENDFILE is valid in the current context, and implement it. */
4075 ffestd_check_simple_ ();
4078 ffestd_subr_line_now_ ();
4079 ffeste_R920 (&ffestp_file
.beru
);
4084 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR920_
);
4085 ffestd_stmt_append_ (stmt
);
4086 ffestd_subr_line_save_ (stmt
);
4087 stmt
->u
.R920
.pool
= ffesta_output_pool
;
4088 stmt
->u
.R920
.params
= ffestd_subr_copy_beru_ ();
4089 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
4094 /* ffestd_R921 -- REWIND statement
4098 Make sure a REWIND is valid in the current context, and implement it. */
4103 ffestd_check_simple_ ();
4106 ffestd_subr_line_now_ ();
4107 ffeste_R921 (&ffestp_file
.beru
);
4112 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR921_
);
4113 ffestd_stmt_append_ (stmt
);
4114 ffestd_subr_line_save_ (stmt
);
4115 stmt
->u
.R921
.pool
= ffesta_output_pool
;
4116 stmt
->u
.R921
.params
= ffestd_subr_copy_beru_ ();
4117 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
4122 /* ffestd_R923A -- INQUIRE statement (non-IOLENGTH version)
4124 ffestd_R923A(bool by_file);
4126 Make sure an INQUIRE is valid in the current context, and implement it. */
4129 ffestd_R923A (bool by_file
)
4131 ffestd_check_simple_ ();
4133 #if FFECOM_targetCURRENT == FFECOM_targetGCC
4134 #define specified(something) \
4135 (ffestp_file.inquire.inquire_spec[something].kw_or_val_present)
4137 /* Warn if there are any thing we don't handle via f2c libraries. */
4138 if (specified (FFESTP_inquireixACTION
)
4139 || specified (FFESTP_inquireixCARRIAGECONTROL
)
4140 || specified (FFESTP_inquireixDEFAULTFILE
)
4141 || specified (FFESTP_inquireixDELIM
)
4142 || specified (FFESTP_inquireixKEYED
)
4143 || specified (FFESTP_inquireixORGANIZATION
)
4144 || specified (FFESTP_inquireixPAD
)
4145 || specified (FFESTP_inquireixPOSITION
)
4146 || specified (FFESTP_inquireixREAD
)
4147 || specified (FFESTP_inquireixREADWRITE
)
4148 || specified (FFESTP_inquireixRECORDTYPE
)
4149 || specified (FFESTP_inquireixWRITE
))
4151 ffebad_start (FFEBAD_INQUIRE_UNSUPPORTED
);
4152 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
4153 ffelex_token_where_column (ffesta_tokens
[0]));
4161 ffestd_subr_line_now_ ();
4162 ffeste_R923A (&ffestp_file
.inquire
, by_file
);
4167 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR923A_
);
4168 ffestd_stmt_append_ (stmt
);
4169 ffestd_subr_line_save_ (stmt
);
4170 stmt
->u
.R923A
.pool
= ffesta_output_pool
;
4171 stmt
->u
.R923A
.params
= ffestd_subr_copy_inquire_ ();
4172 stmt
->u
.R923A
.by_file
= by_file
;
4173 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
4178 /* ffestd_R923B_start -- INQUIRE(IOLENGTH=expr) statement list begin
4180 ffestd_R923B_start();
4182 Verify that INQUIRE is valid here, and begin accepting items in the
4186 ffestd_R923B_start ()
4188 ffestd_check_start_ ();
4191 ffestd_subr_line_now_ ();
4192 ffeste_R923B_start (&ffestp_file
.inquire
);
4197 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR923B_
);
4198 ffestd_stmt_append_ (stmt
);
4199 ffestd_subr_line_save_ (stmt
);
4200 stmt
->u
.R923B
.pool
= ffesta_output_pool
;
4201 stmt
->u
.R923B
.params
= ffestd_subr_copy_inquire_ ();
4202 stmt
->u
.R923B
.list
= NULL
;
4203 ffestd_expr_list_
= &stmt
->u
.R923B
.list
;
4204 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
4209 /* ffestd_R923B_item -- INQUIRE statement i/o item
4211 ffestd_R923B_item(expr,expr_token);
4213 Implement output-list expression. */
4216 ffestd_R923B_item (ffebld expr
)
4218 ffestd_check_item_ ();
4221 ffeste_R923B_item (expr
);
4224 ffestdExprItem_ item
4225 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
4230 *ffestd_expr_list_
= item
;
4231 ffestd_expr_list_
= &item
->next
;
4236 /* ffestd_R923B_finish -- INQUIRE statement list complete
4238 ffestd_R923B_finish();
4240 Just wrap up any local activities. */
4243 ffestd_R923B_finish ()
4245 ffestd_check_finish_ ();
4248 ffeste_R923B_finish ();
4250 /* Nothing to do, it's implicit. */
4254 /* ffestd_R1001 -- FORMAT statement
4256 ffestd_R1001(format_list); */
4259 ffestd_R1001 (ffesttFormatList f
)
4264 ffestd_check_simple_ ();
4266 if (ffestd_label_formatdef_
== NULL
)
4267 return; /* Nothing to hook it up to (no label def). */
4269 ffests_new (s
, malloc_pool_image (), 80);
4270 ffests_putc (s
, '(');
4271 ffestd_R1001dump_ (s
, f
); /* Build the string in s. */
4272 ffests_putc (s
, ')');
4276 ffests_kill (s
); /* Kill the string in s. */
4281 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1001_
);
4283 /* Don't bother with this. After all, things like cilists also are
4284 declared midway through code-generation. Perhaps the only problems
4285 the gcc back end has with midway declarations are with stack vars,
4286 maybe only with vars that can be put in registers. Unless/until the
4287 need is established, handle FORMAT just like cilists and others; at
4288 that point, they'd likely *all* have to be fixed, which would be
4289 very painful anyway. */
4290 /* Insert FORMAT statement just after the first item on the
4291 statement list, which must be a FORMAT label, which see. */
4292 assert (ffestd_stmt_list_
.first
->id
== FFESTD_stmtidFORMATLABEL_
);
4293 stmt
->previous
= ffestd_stmt_list_
.first
;
4294 stmt
->next
= ffestd_stmt_list_
.first
->next
;
4295 stmt
->next
->previous
= stmt
;
4296 stmt
->previous
->next
= stmt
;
4298 ffestd_stmt_append_ (stmt
);
4300 stmt
->u
.R1001
.str
= str
;
4304 ffestd_label_formatdef_
= NULL
;
4307 /* ffestd_R1001dump_ -- Dump list of formats
4309 ffesttFormatList list;
4310 ffestd_R1001dump_(list,0);
4312 The formats in the list are dumped. */
4315 ffestd_R1001dump_ (ffests s
, ffesttFormatList list
)
4317 ffesttFormatList next
;
4319 for (next
= list
->next
; next
!= list
; next
= next
->next
)
4321 if (next
!= list
->next
)
4322 ffests_putc (s
, ',');
4325 case FFESTP_formattypeI
:
4326 ffestd_R1001dump_1005_3_ (s
, next
, "I");
4329 case FFESTP_formattypeB
:
4330 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4331 ffestd_R1001dump_1005_3_ (s
, next
, "B");
4332 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4333 ffestd_R1001error_ (next
);
4339 case FFESTP_formattypeO
:
4340 ffestd_R1001dump_1005_3_ (s
, next
, "O");
4343 case FFESTP_formattypeZ
:
4344 ffestd_R1001dump_1005_3_ (s
, next
, "Z");
4347 case FFESTP_formattypeF
:
4348 ffestd_R1001dump_1005_4_ (s
, next
, "F");
4351 case FFESTP_formattypeE
:
4352 ffestd_R1001dump_1005_5_ (s
, next
, "E");
4355 case FFESTP_formattypeEN
:
4356 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4357 ffestd_R1001dump_1005_5_ (s
, next
, "EN");
4358 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4359 ffestd_R1001error_ (next
);
4365 case FFESTP_formattypeG
:
4366 ffestd_R1001dump_1005_5_ (s
, next
, "G");
4369 case FFESTP_formattypeL
:
4370 ffestd_R1001dump_1005_2_ (s
, next
, "L");
4373 case FFESTP_formattypeA
:
4374 ffestd_R1001dump_1005_1_ (s
, next
, "A");
4377 case FFESTP_formattypeD
:
4378 ffestd_R1001dump_1005_4_ (s
, next
, "D");
4381 case FFESTP_formattypeQ
:
4382 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4383 ffestd_R1001dump_1010_1_ (s
, next
, "Q");
4384 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4385 ffestd_R1001error_ (next
);
4391 case FFESTP_formattypeDOLLAR
:
4392 ffestd_R1001dump_1010_1_ (s
, next
, "$");
4395 case FFESTP_formattypeP
:
4396 ffestd_R1001dump_1010_4_ (s
, next
, "P");
4399 case FFESTP_formattypeT
:
4400 ffestd_R1001dump_1010_5_ (s
, next
, "T");
4403 case FFESTP_formattypeTL
:
4404 ffestd_R1001dump_1010_5_ (s
, next
, "TL");
4407 case FFESTP_formattypeTR
:
4408 ffestd_R1001dump_1010_5_ (s
, next
, "TR");
4411 case FFESTP_formattypeX
:
4412 ffestd_R1001dump_1010_3_ (s
, next
, "X");
4415 case FFESTP_formattypeS
:
4416 ffestd_R1001dump_1010_1_ (s
, next
, "S");
4419 case FFESTP_formattypeSP
:
4420 ffestd_R1001dump_1010_1_ (s
, next
, "SP");
4423 case FFESTP_formattypeSS
:
4424 ffestd_R1001dump_1010_1_ (s
, next
, "SS");
4427 case FFESTP_formattypeBN
:
4428 ffestd_R1001dump_1010_1_ (s
, next
, "BN");
4431 case FFESTP_formattypeBZ
:
4432 ffestd_R1001dump_1010_1_ (s
, next
, "BZ");
4435 case FFESTP_formattypeSLASH
:
4436 ffestd_R1001dump_1010_2_ (s
, next
, "/");
4439 case FFESTP_formattypeCOLON
:
4440 ffestd_R1001dump_1010_1_ (s
, next
, ":");
4443 case FFESTP_formattypeR1016
:
4444 switch (ffelex_token_type (next
->t
))
4446 case FFELEX_typeCHARACTER
:
4448 char *p
= ffelex_token_text (next
->t
);
4449 ffeTokenLength i
= ffelex_token_length (next
->t
);
4451 ffests_putc (s
, '\002');
4455 ffests_putc (s
, '\002');
4456 ffests_putc (s
, *p
);
4459 ffests_putc (s
, '\002');
4463 case FFELEX_typeHOLLERITH
:
4465 char *p
= ffelex_token_text (next
->t
);
4466 ffeTokenLength i
= ffelex_token_length (next
->t
);
4468 ffests_printf_1U (s
,
4469 "%" ffeTokenLength_f
"uH",
4473 ffests_putc (s
, *p
);
4484 case FFESTP_formattypeFORMAT
:
4485 if (next
->u
.R1003D
.R1004
.present
)
4487 if (next
->u
.R1003D
.R1004
.rtexpr
)
4488 ffestd_R1001rtexpr_ (s
, next
, next
->u
.R1003D
.R1004
.u
.expr
);
4490 ffests_printf_1U (s
, "%lu",
4491 next
->u
.R1003D
.R1004
.u
.unsigned_val
);
4494 ffests_putc (s
, '(');
4495 ffestd_R1001dump_ (s
, next
->u
.R1003D
.format
);
4496 ffests_putc (s
, ')');
4505 /* ffestd_R1001dump_1005_1_ -- Dump a particular format
4508 ffestd_R1001dump_1005_1_(f,"I");
4510 The format is dumped with form [r]X[w]. */
4513 ffestd_R1001dump_1005_1_ (ffests s
, ffesttFormatList f
, const char *string
)
4515 assert (!f
->u
.R1005
.R1007_or_R1008
.present
);
4516 assert (!f
->u
.R1005
.R1009
.present
);
4518 if (f
->u
.R1005
.R1004
.present
)
4520 if (f
->u
.R1005
.R1004
.rtexpr
)
4521 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4523 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4526 ffests_puts (s
, string
);
4528 if (f
->u
.R1005
.R1006
.present
)
4530 if (f
->u
.R1005
.R1006
.rtexpr
)
4531 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4533 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4537 /* ffestd_R1001dump_1005_2_ -- Dump a particular format
4540 ffestd_R1001dump_1005_2_(f,"I");
4542 The format is dumped with form [r]Xw. */
4545 ffestd_R1001dump_1005_2_ (ffests s
, ffesttFormatList f
, const char *string
)
4547 assert (!f
->u
.R1005
.R1007_or_R1008
.present
);
4548 assert (!f
->u
.R1005
.R1009
.present
);
4549 assert (f
->u
.R1005
.R1006
.present
);
4551 if (f
->u
.R1005
.R1004
.present
)
4553 if (f
->u
.R1005
.R1004
.rtexpr
)
4554 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4556 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4559 ffests_puts (s
, string
);
4561 if (f
->u
.R1005
.R1006
.rtexpr
)
4562 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4564 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4567 /* ffestd_R1001dump_1005_3_ -- Dump a particular format
4570 ffestd_R1001dump_1005_3_(f,"I");
4572 The format is dumped with form [r]Xw[.m]. */
4575 ffestd_R1001dump_1005_3_ (ffests s
, ffesttFormatList f
, const char *string
)
4577 assert (!f
->u
.R1005
.R1009
.present
);
4578 assert (f
->u
.R1005
.R1006
.present
);
4580 if (f
->u
.R1005
.R1004
.present
)
4582 if (f
->u
.R1005
.R1004
.rtexpr
)
4583 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4585 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4588 ffests_puts (s
, string
);
4590 if (f
->u
.R1005
.R1006
.rtexpr
)
4591 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4593 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4595 if (f
->u
.R1005
.R1007_or_R1008
.present
)
4597 ffests_putc (s
, '.');
4598 if (f
->u
.R1005
.R1007_or_R1008
.rtexpr
)
4599 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1007_or_R1008
.u
.expr
);
4601 ffests_printf_1U (s
, "%lu",
4602 f
->u
.R1005
.R1007_or_R1008
.u
.unsigned_val
);
4606 /* ffestd_R1001dump_1005_4_ -- Dump a particular format
4609 ffestd_R1001dump_1005_4_(f,"I");
4611 The format is dumped with form [r]Xw.d. */
4614 ffestd_R1001dump_1005_4_ (ffests s
, ffesttFormatList f
, const char *string
)
4616 assert (!f
->u
.R1005
.R1009
.present
);
4617 assert (f
->u
.R1005
.R1007_or_R1008
.present
);
4618 assert (f
->u
.R1005
.R1006
.present
);
4620 if (f
->u
.R1005
.R1004
.present
)
4622 if (f
->u
.R1005
.R1004
.rtexpr
)
4623 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4625 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4628 ffests_puts (s
, string
);
4630 if (f
->u
.R1005
.R1006
.rtexpr
)
4631 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4633 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4635 ffests_putc (s
, '.');
4636 if (f
->u
.R1005
.R1007_or_R1008
.rtexpr
)
4637 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1007_or_R1008
.u
.expr
);
4639 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1007_or_R1008
.u
.unsigned_val
);
4642 /* ffestd_R1001dump_1005_5_ -- Dump a particular format
4645 ffestd_R1001dump_1005_5_(f,"I");
4647 The format is dumped with form [r]Xw.d[Ee]. */
4650 ffestd_R1001dump_1005_5_ (ffests s
, ffesttFormatList f
, const char *string
)
4652 assert (f
->u
.R1005
.R1007_or_R1008
.present
);
4653 assert (f
->u
.R1005
.R1006
.present
);
4655 if (f
->u
.R1005
.R1004
.present
)
4657 if (f
->u
.R1005
.R1004
.rtexpr
)
4658 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4660 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4663 ffests_puts (s
, string
);
4665 if (f
->u
.R1005
.R1006
.rtexpr
)
4666 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4668 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4670 ffests_putc (s
, '.');
4671 if (f
->u
.R1005
.R1007_or_R1008
.rtexpr
)
4672 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1007_or_R1008
.u
.expr
);
4674 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1007_or_R1008
.u
.unsigned_val
);
4676 if (f
->u
.R1005
.R1009
.present
)
4678 ffests_putc (s
, 'E');
4679 if (f
->u
.R1005
.R1009
.rtexpr
)
4680 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1009
.u
.expr
);
4682 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1009
.u
.unsigned_val
);
4686 /* ffestd_R1001dump_1010_1_ -- Dump a particular format
4689 ffestd_R1001dump_1010_1_(f,"I");
4691 The format is dumped with form X. */
4694 ffestd_R1001dump_1010_1_ (ffests s
, ffesttFormatList f
, const char *string
)
4696 assert (!f
->u
.R1010
.val
.present
);
4698 ffests_puts (s
, string
);
4701 /* ffestd_R1001dump_1010_2_ -- Dump a particular format
4704 ffestd_R1001dump_1010_2_(f,"I");
4706 The format is dumped with form [r]X. */
4709 ffestd_R1001dump_1010_2_ (ffests s
, ffesttFormatList f
, const char *string
)
4711 if (f
->u
.R1010
.val
.present
)
4713 if (f
->u
.R1010
.val
.rtexpr
)
4714 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4716 ffests_printf_1U (s
, "%lu", f
->u
.R1010
.val
.u
.unsigned_val
);
4719 ffests_puts (s
, string
);
4722 /* ffestd_R1001dump_1010_3_ -- Dump a particular format
4725 ffestd_R1001dump_1010_3_(f,"I");
4727 The format is dumped with form nX. */
4730 ffestd_R1001dump_1010_3_ (ffests s
, ffesttFormatList f
, const char *string
)
4732 assert (f
->u
.R1010
.val
.present
);
4734 if (f
->u
.R1010
.val
.rtexpr
)
4735 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4737 ffests_printf_1U (s
, "%lu", f
->u
.R1010
.val
.u
.unsigned_val
);
4739 ffests_puts (s
, string
);
4742 /* ffestd_R1001dump_1010_4_ -- Dump a particular format
4745 ffestd_R1001dump_1010_4_(f,"I");
4747 The format is dumped with form kX. Note that k is signed. */
4750 ffestd_R1001dump_1010_4_ (ffests s
, ffesttFormatList f
, const char *string
)
4752 assert (f
->u
.R1010
.val
.present
);
4754 if (f
->u
.R1010
.val
.rtexpr
)
4755 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4757 ffests_printf_1D (s
, "%ld", f
->u
.R1010
.val
.u
.signed_val
);
4759 ffests_puts (s
, string
);
4762 /* ffestd_R1001dump_1010_5_ -- Dump a particular format
4765 ffestd_R1001dump_1010_5_(f,"I");
4767 The format is dumped with form Xn. */
4770 ffestd_R1001dump_1010_5_ (ffests s
, ffesttFormatList f
, const char *string
)
4772 assert (f
->u
.R1010
.val
.present
);
4774 ffests_puts (s
, string
);
4776 if (f
->u
.R1010
.val
.rtexpr
)
4777 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4779 ffests_printf_1U (s
, "%lu", f
->u
.R1010
.val
.u
.unsigned_val
);
4782 /* ffestd_R1001error_ -- Complain about FORMAT specification not supported
4785 ffestd_R1001error_(f);
4787 An error message is produced. */
4790 ffestd_R1001error_ (ffesttFormatList f
)
4792 ffebad_start (FFEBAD_FORMAT_UNSUPPORTED
);
4793 ffebad_here (0, ffelex_token_where_line (f
->t
), ffelex_token_where_column (f
->t
));
4798 ffestd_R1001rtexpr_ (ffests s
, ffesttFormatList f
, ffebld expr
)
4801 || (ffebld_op (expr
) != FFEBLD_opCONTER
)
4802 || (ffeinfo_basictype (ffebld_info (expr
)) != FFEINFO_basictypeINTEGER
)
4803 || (ffeinfo_kindtype (ffebld_info (expr
)) == FFEINFO_kindtypeINTEGER4
))
4805 ffebad_start (FFEBAD_FORMAT_VARIABLE
);
4806 ffebad_here (0, ffelex_token_where_line (f
->t
), ffelex_token_where_column (f
->t
));
4813 switch (ffeinfo_kindtype (ffebld_info (expr
)))
4815 #if FFETARGET_okINTEGER1
4816 case FFEINFO_kindtypeINTEGER1
:
4817 val
= ffebld_constant_integer1 (ffebld_conter (expr
));
4821 #if FFETARGET_okINTEGER2
4822 case FFEINFO_kindtypeINTEGER2
:
4823 val
= ffebld_constant_integer2 (ffebld_conter (expr
));
4827 #if FFETARGET_okINTEGER3
4828 case FFEINFO_kindtypeINTEGER3
:
4829 val
= ffebld_constant_integer3 (ffebld_conter (expr
));
4834 assert ("bad INTEGER constant kind type" == NULL
);
4836 case FFEINFO_kindtypeANY
:
4839 ffests_printf_1D (s
, "%ld", val
);
4843 /* ffestd_R1102 -- PROGRAM statement
4845 ffestd_R1102(name_token);
4847 Make sure ffestd_kind_ identifies an empty block. Make sure name_token
4848 gives a valid name. Implement the beginning of a main program. */
4851 ffestd_R1102 (ffesymbol s
, ffelexToken name UNUSED
)
4853 ffestd_check_simple_ ();
4855 assert (ffestd_block_level_
== 0);
4856 ffestd_is_reachable_
= TRUE
;
4858 ffecom_notify_primary_entry (s
);
4859 ffe_set_is_mainprog (TRUE
); /* Is a main program. */
4860 ffe_set_is_saveall (TRUE
); /* Main program always has implicit SAVE. */
4862 ffestw_set_sym (ffestw_stack_top (), s
);
4864 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4866 fputs ("< PROGRAM_unnamed\n", dmpout
);
4868 fprintf (dmpout
, "< PROGRAM %s\n", ffelex_token_text (name
));
4869 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4875 /* ffestd_R1103 -- End a PROGRAM
4880 ffestd_R1103 (bool ok UNUSED
)
4882 assert (ffestd_block_level_
== 0);
4884 if (FFESTD_IS_END_OPTIMIZED_
&& ffestd_is_reachable_
)
4885 ffestd_R842 (NULL
); /* Generate STOP. */
4887 if (ffestw_state (ffestw_stack_top ()) != FFESTV_statePROGRAM5
)
4888 ffestd_subr_labels_ (FALSE
);/* Handle any undefined labels. */
4896 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1103_
);
4897 ffestd_stmt_append_ (stmt
);
4902 /* ffestd_R1105 -- MODULE statement
4904 ffestd_R1105(name_token);
4906 Make sure ffestd_kind_ identifies an empty block. Make sure name_token
4907 gives a valid name. Implement the beginning of a module. */
4911 ffestd_R1105 (ffelexToken name
)
4913 assert (ffestd_block_level_
== 0);
4915 ffestd_check_simple_ ();
4917 ffestd_subr_f90_ ();
4921 fprintf (dmpout
, "* MODULE %s\n", ffelex_token_text (name
));
4925 /* ffestd_R1106 -- End a MODULE
4927 ffestd_R1106(TRUE); */
4930 ffestd_R1106 (bool ok
)
4932 assert (ffestd_block_level_
== 0);
4934 /* Generate any wrap-up code here (unlikely in MODULE!). */
4936 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateMODULE5
)
4937 ffestd_subr_labels_ (TRUE
); /* Handle any undefined labels (unlikely). */
4942 fprintf (dmpout
, "< END_MODULE %s\n",
4943 ffelex_token_text (ffestw_name (ffestw_stack_top ())));
4947 /* ffestd_R1107_start -- USE statement list begin
4949 ffestd_R1107_start();
4951 Verify that USE is valid here, and begin accepting items in the list. */
4954 ffestd_R1107_start (ffelexToken name
, bool only
)
4956 ffestd_check_start_ ();
4958 ffestd_subr_f90_ ();
4962 fprintf (dmpout
, "* USE %s,", ffelex_token_text (name
)); /* NB
4963 _shriek_begin_uses_. */
4965 fputs ("only: ", dmpout
);
4969 /* ffestd_R1107_item -- USE statement for name
4971 ffestd_R1107_item(local_token,use_token);
4973 Make sure name_token identifies a valid object to be USEed. local_token
4974 may be NULL if _start_ was called with only==TRUE. */
4977 ffestd_R1107_item (ffelexToken local
, ffelexToken use
)
4979 ffestd_check_item_ ();
4980 assert (use
!= NULL
);
4986 fprintf (dmpout
, "%s=>", ffelex_token_text (local
));
4987 fprintf (dmpout
, "%s,", ffelex_token_text (use
));
4991 /* ffestd_R1107_finish -- USE statement list complete
4993 ffestd_R1107_finish();
4995 Just wrap up any local activities. */
4998 ffestd_R1107_finish ()
5000 ffestd_check_finish_ ();
5005 fputc ('\n', dmpout
);
5010 /* ffestd_R1111 -- BLOCK DATA statement
5012 ffestd_R1111(name_token);
5014 Make sure ffestd_kind_ identifies no current program unit. If not
5015 NULL, make sure name_token gives a valid name. Implement the beginning
5016 of a block data program unit. */
5019 ffestd_R1111 (ffesymbol s
, ffelexToken name UNUSED
)
5021 assert (ffestd_block_level_
== 0);
5022 ffestd_is_reachable_
= TRUE
;
5024 ffestd_check_simple_ ();
5026 ffecom_notify_primary_entry (s
);
5027 ffestw_set_sym (ffestw_stack_top (), s
);
5029 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5031 fputs ("< BLOCK_DATA_unnamed\n", dmpout
);
5033 fprintf (dmpout
, "< BLOCK_DATA %s\n", ffelex_token_text (name
));
5034 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5040 /* ffestd_R1112 -- End a BLOCK DATA
5042 ffestd_R1112(TRUE); */
5045 ffestd_R1112 (bool ok UNUSED
)
5047 assert (ffestd_block_level_
== 0);
5049 /* Generate any return-like code here (not likely for BLOCK DATA!). */
5051 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateBLOCKDATA5
)
5052 ffestd_subr_labels_ (TRUE
); /* Handle any undefined labels. */
5060 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1112_
);
5061 ffestd_stmt_append_ (stmt
);
5066 /* ffestd_R1202 -- INTERFACE statement
5068 ffestd_R1202(operator,defined_name);
5070 Make sure ffestd_kind_ identifies an INTERFACE block.
5071 Implement the end of the current interface.
5074 Allow no operator or name to mean INTERFACE by itself; missed this
5075 valid form when originally doing syntactic analysis code. */
5079 ffestd_R1202 (ffestpDefinedOperator
operator, ffelexToken name
)
5081 ffestd_check_simple_ ();
5083 ffestd_subr_f90_ ();
5089 case FFESTP_definedoperatorNone
:
5091 fputs ("* INTERFACE_unnamed\n", dmpout
);
5093 fprintf (dmpout
, "* INTERFACE %s\n", ffelex_token_text (name
));
5096 case FFESTP_definedoperatorOPERATOR
:
5097 fprintf (dmpout
, "* INTERFACE_OPERATOR (.%s.)\n", ffelex_token_text (name
));
5100 case FFESTP_definedoperatorASSIGNMENT
:
5101 fputs ("* INTERFACE_ASSIGNMENT (=)\n", dmpout
);
5104 case FFESTP_definedoperatorPOWER
:
5105 fputs ("* INTERFACE_OPERATOR (**)\n", dmpout
);
5108 case FFESTP_definedoperatorMULT
:
5109 fputs ("* INTERFACE_OPERATOR (*)\n", dmpout
);
5112 case FFESTP_definedoperatorADD
:
5113 fputs ("* INTERFACE_OPERATOR (+)\n", dmpout
);
5116 case FFESTP_definedoperatorCONCAT
:
5117 fputs ("* INTERFACE_OPERATOR (//)\n", dmpout
);
5120 case FFESTP_definedoperatorDIVIDE
:
5121 fputs ("* INTERFACE_OPERATOR (/)\n", dmpout
);
5124 case FFESTP_definedoperatorSUBTRACT
:
5125 fputs ("* INTERFACE_OPERATOR (-)\n", dmpout
);
5128 case FFESTP_definedoperatorNOT
:
5129 fputs ("* INTERFACE_OPERATOR (.not.)\n", dmpout
);
5132 case FFESTP_definedoperatorAND
:
5133 fputs ("* INTERFACE_OPERATOR (.and.)\n", dmpout
);
5136 case FFESTP_definedoperatorOR
:
5137 fputs ("* INTERFACE_OPERATOR (.or.)\n", dmpout
);
5140 case FFESTP_definedoperatorEQV
:
5141 fputs ("* INTERFACE_OPERATOR (.eqv.)\n", dmpout
);
5144 case FFESTP_definedoperatorNEQV
:
5145 fputs ("* INTERFACE_OPERATOR (.neqv.)\n", dmpout
);
5148 case FFESTP_definedoperatorEQ
:
5149 fputs ("* INTERFACE_OPERATOR (==)\n", dmpout
);
5152 case FFESTP_definedoperatorNE
:
5153 fputs ("* INTERFACE_OPERATOR (/=)\n", dmpout
);
5156 case FFESTP_definedoperatorLT
:
5157 fputs ("* INTERFACE_OPERATOR (<)\n", dmpout
);
5160 case FFESTP_definedoperatorLE
:
5161 fputs ("* INTERFACE_OPERATOR (<=)\n", dmpout
);
5164 case FFESTP_definedoperatorGT
:
5165 fputs ("* INTERFACE_OPERATOR (>)\n", dmpout
);
5168 case FFESTP_definedoperatorGE
:
5169 fputs ("* INTERFACE_OPERATOR (>=)\n", dmpout
);
5179 /* ffestd_R1203 -- End an INTERFACE
5181 ffestd_R1203(TRUE); */
5184 ffestd_R1203 (bool ok
)
5189 fputs ("* END_INTERFACE\n", dmpout
);
5193 /* ffestd_R1205_start -- MODULE PROCEDURE statement list begin
5195 ffestd_R1205_start();
5197 Verify that MODULE PROCEDURE is valid here, and begin accepting items in
5201 ffestd_R1205_start ()
5203 ffestd_check_start_ ();
5208 fputs ("* MODULE_PROCEDURE ", dmpout
);
5212 /* ffestd_R1205_item -- MODULE PROCEDURE statement for name
5214 ffestd_R1205_item(name_token);
5216 Make sure name_token identifies a valid object to be MODULE PROCEDUREed. */
5219 ffestd_R1205_item (ffelexToken name
)
5221 ffestd_check_item_ ();
5222 assert (name
!= NULL
);
5227 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
5231 /* ffestd_R1205_finish -- MODULE PROCEDURE statement list complete
5233 ffestd_R1205_finish();
5235 Just wrap up any local activities. */
5238 ffestd_R1205_finish ()
5240 ffestd_check_finish_ ();
5245 fputc ('\n', dmpout
);
5250 /* ffestd_R1207_start -- EXTERNAL statement list begin
5252 ffestd_R1207_start();
5254 Verify that EXTERNAL is valid here, and begin accepting items in the list. */
5257 ffestd_R1207_start ()
5259 ffestd_check_start_ ();
5261 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5262 fputs ("* EXTERNAL (", dmpout
);
5263 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5269 /* ffestd_R1207_item -- EXTERNAL statement for name
5271 ffestd_R1207_item(name_token);
5273 Make sure name_token identifies a valid object to be EXTERNALd. */
5276 ffestd_R1207_item (ffelexToken name
)
5278 ffestd_check_item_ ();
5279 assert (name
!= NULL
);
5281 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5282 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
5283 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5289 /* ffestd_R1207_finish -- EXTERNAL statement list complete
5291 ffestd_R1207_finish();
5293 Just wrap up any local activities. */
5296 ffestd_R1207_finish ()
5298 ffestd_check_finish_ ();
5300 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5301 fputs (")\n", dmpout
);
5302 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5308 /* ffestd_R1208_start -- INTRINSIC statement list begin
5310 ffestd_R1208_start();
5312 Verify that INTRINSIC is valid here, and begin accepting items in the list. */
5315 ffestd_R1208_start ()
5317 ffestd_check_start_ ();
5319 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5320 fputs ("* INTRINSIC (", dmpout
);
5321 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5327 /* ffestd_R1208_item -- INTRINSIC statement for name
5329 ffestd_R1208_item(name_token);
5331 Make sure name_token identifies a valid object to be INTRINSICd. */
5334 ffestd_R1208_item (ffelexToken name
)
5336 ffestd_check_item_ ();
5337 assert (name
!= NULL
);
5339 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5340 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
5341 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5347 /* ffestd_R1208_finish -- INTRINSIC statement list complete
5349 ffestd_R1208_finish();
5351 Just wrap up any local activities. */
5354 ffestd_R1208_finish ()
5356 ffestd_check_finish_ ();
5358 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5359 fputs (")\n", dmpout
);
5360 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5366 /* ffestd_R1212 -- CALL statement
5368 ffestd_R1212(expr,expr_token);
5370 Make sure statement is valid here; implement. */
5373 ffestd_R1212 (ffebld expr
)
5375 ffestd_check_simple_ ();
5378 ffestd_subr_line_now_ ();
5379 ffeste_R1212 (expr
);
5384 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1212_
);
5385 ffestd_stmt_append_ (stmt
);
5386 ffestd_subr_line_save_ (stmt
);
5387 stmt
->u
.R1212
.pool
= ffesta_output_pool
;
5388 stmt
->u
.R1212
.expr
= expr
;
5389 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5394 /* ffestd_R1213 -- Defined assignment statement
5396 ffestd_R1213(dest_expr,source_expr,source_token);
5398 Make sure the assignment is valid. */
5402 ffestd_R1213 (ffebld dest
, ffebld source
)
5404 ffestd_check_simple_ ();
5406 ffestd_subr_f90_ ();
5410 fputs ("+ let_defined ", dmpout
);
5412 fputs ("=", dmpout
);
5413 ffebld_dump (source
);
5414 fputc ('\n', dmpout
);
5419 /* ffestd_R1219 -- FUNCTION statement
5421 ffestd_R1219(funcname,arglist,ending_token,kind,kindt,len,lent,
5424 Make sure statement is valid here, register arguments for the
5425 function name, and so on.
5428 Added the kind, len, and recursive arguments. */
5431 ffestd_R1219 (ffesymbol s
, ffelexToken funcname UNUSED
,
5432 ffesttTokenList args UNUSED
, ffestpType type UNUSED
,
5433 ffebld kind UNUSED
, ffelexToken kindt UNUSED
,
5434 ffebld len UNUSED
, ffelexToken lent UNUSED
,
5435 bool recursive UNUSED
, ffelexToken result UNUSED
,
5436 bool separate_result UNUSED
)
5438 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5442 assert (ffestd_block_level_
== 0);
5443 ffestd_is_reachable_
= TRUE
;
5445 ffestd_check_simple_ ();
5447 ffecom_notify_primary_entry (s
);
5448 ffestw_set_sym (ffestw_stack_top (), s
);
5450 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5453 case FFESTP_typeINTEGER
:
5457 case FFESTP_typeBYTE
:
5461 case FFESTP_typeWORD
:
5465 case FFESTP_typeREAL
:
5469 case FFESTP_typeCOMPLEX
:
5473 case FFESTP_typeLOGICAL
:
5477 case FFESTP_typeCHARACTER
:
5481 case FFESTP_typeDBLPRCSN
:
5482 a
= "DOUBLE PRECISION";
5485 case FFESTP_typeDBLCMPLX
:
5486 a
= "DOUBLE COMPLEX";
5490 case FFESTP_typeTYPE
:
5495 case FFESTP_typeNone
:
5504 fprintf (dmpout
, "< FUNCTION %s ", ffelex_token_text (funcname
));
5506 fputs ("RECURSIVE ", dmpout
);
5507 fprintf (dmpout
, "%s(", a
);
5510 fputs ("kind=", dmpout
);
5512 fputs (ffelex_token_text (kindt
), dmpout
);
5516 fputc (',', dmpout
);
5520 fputs ("len=", dmpout
);
5522 fputs (ffelex_token_text (lent
), dmpout
);
5526 fprintf (dmpout
, ")");
5529 fputs (" (", dmpout
);
5530 ffestt_tokenlist_dump (args
);
5531 fputc (')', dmpout
);
5534 fprintf (dmpout
, " result(%s)", ffelex_token_text (result
));
5535 fputc ('\n', dmpout
);
5536 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5542 /* ffestd_R1221 -- End a FUNCTION
5544 ffestd_R1221(TRUE); */
5547 ffestd_R1221 (bool ok UNUSED
)
5549 assert (ffestd_block_level_
== 0);
5551 if (FFESTD_IS_END_OPTIMIZED_
&& ffestd_is_reachable_
)
5552 ffestd_R1227 (NULL
); /* Generate RETURN. */
5554 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateFUNCTION5
)
5555 ffestd_subr_labels_ (FALSE
);/* Handle any undefined labels. */
5563 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1221_
);
5564 ffestd_stmt_append_ (stmt
);
5569 /* ffestd_R1223 -- SUBROUTINE statement
5571 ffestd_R1223(subrname,arglist,ending_token,recursive_token);
5573 Make sure statement is valid here, register arguments for the
5574 subroutine name, and so on.
5577 Added the recursive argument. */
5580 ffestd_R1223 (ffesymbol s
, ffelexToken subrname UNUSED
,
5581 ffesttTokenList args UNUSED
, ffelexToken final UNUSED
,
5582 bool recursive UNUSED
)
5584 assert (ffestd_block_level_
== 0);
5585 ffestd_is_reachable_
= TRUE
;
5587 ffestd_check_simple_ ();
5589 ffecom_notify_primary_entry (s
);
5590 ffestw_set_sym (ffestw_stack_top (), s
);
5592 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5593 fprintf (dmpout
, "< SUBROUTINE %s ", ffelex_token_text (subrname
));
5595 fputs ("recursive ", dmpout
);
5598 fputc ('(', dmpout
);
5599 ffestt_tokenlist_dump (args
);
5600 fputc (')', dmpout
);
5602 fputc ('\n', dmpout
);
5603 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5609 /* ffestd_R1225 -- End a SUBROUTINE
5611 ffestd_R1225(TRUE); */
5614 ffestd_R1225 (bool ok UNUSED
)
5616 assert (ffestd_block_level_
== 0);
5618 if (FFESTD_IS_END_OPTIMIZED_
&& ffestd_is_reachable_
)
5619 ffestd_R1227 (NULL
); /* Generate RETURN. */
5621 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateSUBROUTINE5
)
5622 ffestd_subr_labels_ (FALSE
);/* Handle any undefined labels. */
5630 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1225_
);
5631 ffestd_stmt_append_ (stmt
);
5636 /* ffestd_R1226 -- ENTRY statement
5638 ffestd_R1226(entryname,arglist,ending_token);
5640 Make sure we're in a SUBROUTINE or FUNCTION, register arguments for the
5641 entry point name, and so on. */
5644 ffestd_R1226 (ffesymbol entry
)
5646 ffestd_check_simple_ ();
5648 #if (FFECOM_targetCURRENT == FFECOM_targetFFE) || FFECOM_ONEPASS
5649 ffestd_subr_line_now_ ();
5650 ffeste_R1226 (entry
);
5652 if (!ffesta_seen_first_exec
|| ffecom_2pass_advise_entrypoint (entry
))
5656 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1226_
);
5657 ffestd_stmt_append_ (stmt
);
5658 ffestd_subr_line_save_ (stmt
);
5659 stmt
->u
.R1226
.entry
= entry
;
5660 stmt
->u
.R1226
.entrynum
= ++ffestd_2pass_entrypoints_
;
5664 ffestd_is_reachable_
= TRUE
;
5667 /* ffestd_R1227 -- RETURN statement
5671 Make sure statement is valid here; implement. expr and expr_token are
5672 both NULL if there was no expression. */
5675 ffestd_R1227 (ffebld expr
)
5677 ffestd_check_simple_ ();
5680 ffestd_subr_line_now_ ();
5681 ffeste_R1227 (ffestw_stack_top (), expr
);
5686 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1227_
);
5687 ffestd_stmt_append_ (stmt
);
5688 ffestd_subr_line_save_ (stmt
);
5689 stmt
->u
.R1227
.pool
= ffesta_output_pool
;
5690 stmt
->u
.R1227
.block
= ffestw_stack_top ();
5691 stmt
->u
.R1227
.expr
= expr
;
5692 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5696 if (ffestd_block_level_
== 0)
5697 ffestd_is_reachable_
= FALSE
;
5700 /* ffestd_R1228 -- CONTAINS statement
5708 assert (ffestd_block_level_
== 0);
5710 ffestd_check_simple_ ();
5712 /* Generate RETURN/STOP code here */
5714 ffestd_subr_labels_ (ffestw_state (ffestw_stack_top ())
5715 == FFESTV_stateMODULE5
); /* Handle any undefined
5718 ffestd_subr_f90_ ();
5722 fputs ("- CONTAINS\n", dmpout
);
5727 /* ffestd_R1229_start -- STMTFUNCTION statement begin
5729 ffestd_R1229_start(func_name,func_arg_list,close_paren);
5731 This function does not really need to do anything, since _finish_
5732 gets all the info needed, and ffestc_R1229_start has already
5733 done all the stuff that makes a two-phase operation (start and
5734 finish) for handling statement functions necessary.
5737 Do nothing, now that _finish_ does everything. */
5740 ffestd_R1229_start (ffelexToken name UNUSED
, ffesttTokenList args UNUSED
)
5742 ffestd_check_start_ ();
5744 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5745 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5751 /* ffestd_R1229_finish -- STMTFUNCTION statement list complete
5753 ffestd_R1229_finish(s);
5755 The statement function's symbol is passed. Its list of dummy args is
5756 accessed via ffesymbol_dummyargs and its expansion expression (expr)
5757 is accessed via ffesymbol_sfexpr.
5759 If sfexpr is NULL, an error occurred parsing the expansion expression, so
5760 just cancel the effects of ffestd_R1229_start and pretend nothing
5761 happened. Otherwise, install the expression as the expansion for the
5762 statement function, then clean up.
5765 Takes sfunc sym instead of just the expansion expression as an
5766 argument, so this function can do all the work, and _start_ is just
5767 a nicety than can do nothing in a back end. */
5770 ffestd_R1229_finish (ffesymbol s
)
5772 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5773 ffebld args
= ffesymbol_dummyargs (s
);
5775 ffebld expr
= ffesymbol_sfexpr (s
);
5777 ffestd_check_finish_ ();
5780 return; /* Nothing to do, definition didn't work. */
5782 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5783 fprintf (dmpout
, "* stmtfunction %s(", ffesymbol_text (s
));
5784 for (; args
!= NULL
; args
= ffebld_trail (args
))
5785 fprintf (dmpout
, "%s,", ffesymbol_text (ffebld_symter (ffebld_head (args
))));
5786 fputs (")=", dmpout
);
5788 fputc ('\n', dmpout
);
5789 #if 0 /* Normally no need to preserve the
5791 ffesymbol_set_sfexpr (s
, NULL
); /* Except expr.c sees NULL
5792 as recursive reference!
5793 So until we can use something
5794 convenient, like a "permanent"
5795 expression, don't worry about
5796 wasting some memory in the
5799 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5801 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5802 /* With gcc, cannot do anything here, because the backend hasn't even
5803 (necessarily) been notified that we're compiling a program unit! */
5805 #if 0 /* Must preserve the expression for gcc. */
5806 ffesymbol_set_sfexpr (s
, NULL
);
5808 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5815 /* ffestd_S3P4 -- INCLUDE line
5817 ffestd_S3P4(filename,filename_token);
5819 Make sure INCLUDE not preceded by any semicolons or a label def; implement. */
5822 ffestd_S3P4 (ffebld filename
)
5825 ffetargetCharacterDefault buildname
;
5828 ffestd_check_simple_ ();
5830 assert (filename
!= NULL
);
5831 if (ffebld_op (filename
) != FFEBLD_opANY
)
5833 assert (ffebld_op (filename
) == FFEBLD_opCONTER
);
5834 assert (ffeinfo_basictype (ffebld_info (filename
))
5835 == FFEINFO_basictypeCHARACTER
);
5836 assert (ffeinfo_kindtype (ffebld_info (filename
))
5837 == FFEINFO_kindtypeCHARACTERDEFAULT
);
5838 buildname
= ffebld_constant_characterdefault (ffebld_conter (filename
));
5839 wf
= ffewhere_file_new (ffetarget_text_characterdefault (buildname
),
5840 ffetarget_length_characterdefault (buildname
));
5841 fi
= ffecom_open_include (ffewhere_file_name (wf
),
5842 ffelex_token_where_line (ffesta_tokens
[0]),
5843 ffelex_token_where_column (ffesta_tokens
[0]));
5845 ffewhere_file_kill (wf
);
5847 ffelex_set_include (wf
, (ffelex_token_type (ffesta_tokens
[0])
5848 == FFELEX_typeNAME
), fi
);
5852 /* ffestd_V003_start -- STRUCTURE statement list begin
5854 ffestd_V003_start(structure_name);
5856 Verify that STRUCTURE is valid here, and begin accepting items in the list. */
5860 ffestd_V003_start (ffelexToken structure_name
)
5862 ffestd_check_start_ ();
5864 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5865 if (structure_name
== NULL
)
5866 fputs ("* STRUCTURE_unnamed ", dmpout
);
5868 fprintf (dmpout
, "* STRUCTURE %s ", ffelex_token_text (structure_name
));
5869 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5870 ffestd_subr_vxt_ ();
5876 /* ffestd_V003_item -- STRUCTURE statement for object-name
5878 ffestd_V003_item(name_token,dim_list);
5880 Make sure name_token identifies a valid object to be STRUCTUREd. */
5883 ffestd_V003_item (ffelexToken name
, ffesttDimList dims
)
5885 ffestd_check_item_ ();
5887 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5888 fputs (ffelex_token_text (name
), dmpout
);
5891 fputc ('(', dmpout
);
5892 ffestt_dimlist_dump (dims
);
5893 fputc (')', dmpout
);
5895 fputc (',', dmpout
);
5896 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5902 /* ffestd_V003_finish -- STRUCTURE statement list complete
5904 ffestd_V003_finish();
5906 Just wrap up any local activities. */
5909 ffestd_V003_finish ()
5911 ffestd_check_finish_ ();
5913 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5914 fputc ('\n', dmpout
);
5915 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5921 /* ffestd_V004 -- End a STRUCTURE
5923 ffestd_V004(TRUE); */
5926 ffestd_V004 (bool ok
)
5928 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5929 fputs ("* END_STRUCTURE\n", dmpout
);
5930 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5936 /* ffestd_V009 -- UNION statement
5943 ffestd_check_simple_ ();
5945 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5946 fputs ("* UNION\n", dmpout
);
5947 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5953 /* ffestd_V010 -- End a UNION
5955 ffestd_V010(TRUE); */
5958 ffestd_V010 (bool ok
)
5960 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5961 fputs ("* END_UNION\n", dmpout
);
5962 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5968 /* ffestd_V012 -- MAP statement
5975 ffestd_check_simple_ ();
5977 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5978 fputs ("* MAP\n", dmpout
);
5979 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5985 /* ffestd_V013 -- End a MAP
5987 ffestd_V013(TRUE); */
5990 ffestd_V013 (bool ok
)
5992 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5993 fputs ("* END_MAP\n", dmpout
);
5994 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6001 /* ffestd_V014_start -- VOLATILE statement list begin
6003 ffestd_V014_start();
6005 Verify that VOLATILE is valid here, and begin accepting items in the list. */
6008 ffestd_V014_start ()
6010 ffestd_check_start_ ();
6012 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6013 fputs ("* VOLATILE (", dmpout
);
6014 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6015 ffestd_subr_vxt_ ();
6021 /* ffestd_V014_item_object -- VOLATILE statement for object-name
6023 ffestd_V014_item_object(name_token);
6025 Make sure name_token identifies a valid object to be VOLATILEd. */
6028 ffestd_V014_item_object (ffelexToken name UNUSED
)
6030 ffestd_check_item_ ();
6032 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6033 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
6034 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6040 /* ffestd_V014_item_cblock -- VOLATILE statement for common-block-name
6042 ffestd_V014_item_cblock(name_token);
6044 Make sure name_token identifies a valid common block to be VOLATILEd. */
6047 ffestd_V014_item_cblock (ffelexToken name UNUSED
)
6049 ffestd_check_item_ ();
6051 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6052 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
6053 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6059 /* ffestd_V014_finish -- VOLATILE statement list complete
6061 ffestd_V014_finish();
6063 Just wrap up any local activities. */
6066 ffestd_V014_finish ()
6068 ffestd_check_finish_ ();
6070 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6071 fputs (")\n", dmpout
);
6072 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6078 /* ffestd_V016_start -- RECORD statement list begin
6080 ffestd_V016_start();
6082 Verify that RECORD is valid here, and begin accepting items in the list. */
6086 ffestd_V016_start ()
6088 ffestd_check_start_ ();
6090 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6091 fputs ("* RECORD ", dmpout
);
6092 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6093 ffestd_subr_vxt_ ();
6099 /* ffestd_V016_item_structure -- RECORD statement for common-block-name
6101 ffestd_V016_item_structure(name_token);
6103 Make sure name_token identifies a valid structure to be RECORDed. */
6106 ffestd_V016_item_structure (ffelexToken name
)
6108 ffestd_check_item_ ();
6110 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6111 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
6112 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6118 /* ffestd_V016_item_object -- RECORD statement for object-name
6120 ffestd_V016_item_object(name_token,dim_list);
6122 Make sure name_token identifies a valid object to be RECORDd. */
6125 ffestd_V016_item_object (ffelexToken name
, ffesttDimList dims
)
6127 ffestd_check_item_ ();
6129 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6130 fputs (ffelex_token_text (name
), dmpout
);
6133 fputc ('(', dmpout
);
6134 ffestt_dimlist_dump (dims
);
6135 fputc (')', dmpout
);
6137 fputc (',', dmpout
);
6138 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6144 /* ffestd_V016_finish -- RECORD statement list complete
6146 ffestd_V016_finish();
6148 Just wrap up any local activities. */
6151 ffestd_V016_finish ()
6153 ffestd_check_finish_ ();
6155 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6156 fputc ('\n', dmpout
);
6157 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6163 /* ffestd_V018_start -- REWRITE(...) statement list begin
6165 ffestd_V018_start();
6167 Verify that REWRITE is valid here, and begin accepting items in the
6171 ffestd_V018_start (ffestvFormat format
)
6173 ffestd_check_start_ ();
6175 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6178 ffestd_subr_line_now_ ();
6179 ffeste_V018_start (&ffestp_file
.rewrite
, format
);
6184 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV018_
);
6185 ffestd_stmt_append_ (stmt
);
6186 ffestd_subr_line_save_ (stmt
);
6187 stmt
->u
.V018
.pool
= ffesta_output_pool
;
6188 stmt
->u
.V018
.params
= ffestd_subr_copy_rewrite_ ();
6189 stmt
->u
.V018
.format
= format
;
6190 stmt
->u
.V018
.list
= NULL
;
6191 ffestd_expr_list_
= &stmt
->u
.V018
.list
;
6192 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6197 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6198 ffestd_subr_vxt_ ();
6202 /* ffestd_V018_item -- REWRITE statement i/o item
6204 ffestd_V018_item(expr,expr_token);
6206 Implement output-list expression. */
6209 ffestd_V018_item (ffebld expr
)
6211 ffestd_check_item_ ();
6213 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6216 ffeste_V018_item (expr
);
6219 ffestdExprItem_ item
6220 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6225 *ffestd_expr_list_
= item
;
6226 ffestd_expr_list_
= &item
->next
;
6231 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6235 /* ffestd_V018_finish -- REWRITE statement list complete
6237 ffestd_V018_finish();
6239 Just wrap up any local activities. */
6242 ffestd_V018_finish ()
6244 ffestd_check_finish_ ();
6246 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6249 ffeste_V018_finish ();
6251 /* Nothing to do, it's implicit. */
6255 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6259 /* ffestd_V019_start -- ACCEPT statement list begin
6261 ffestd_V019_start();
6263 Verify that ACCEPT is valid here, and begin accepting items in the
6267 ffestd_V019_start (ffestvFormat format
)
6269 ffestd_check_start_ ();
6271 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6274 ffestd_subr_line_now_ ();
6275 ffeste_V019_start (&ffestp_file
.accept
, format
);
6280 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV019_
);
6281 ffestd_stmt_append_ (stmt
);
6282 ffestd_subr_line_save_ (stmt
);
6283 stmt
->u
.V019
.pool
= ffesta_output_pool
;
6284 stmt
->u
.V019
.params
= ffestd_subr_copy_accept_ ();
6285 stmt
->u
.V019
.format
= format
;
6286 stmt
->u
.V019
.list
= NULL
;
6287 ffestd_expr_list_
= &stmt
->u
.V019
.list
;
6288 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6293 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6294 ffestd_subr_vxt_ ();
6298 /* ffestd_V019_item -- ACCEPT statement i/o item
6300 ffestd_V019_item(expr,expr_token);
6302 Implement output-list expression. */
6305 ffestd_V019_item (ffebld expr
)
6307 ffestd_check_item_ ();
6309 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6312 ffeste_V019_item (expr
);
6315 ffestdExprItem_ item
6316 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6321 *ffestd_expr_list_
= item
;
6322 ffestd_expr_list_
= &item
->next
;
6327 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6331 /* ffestd_V019_finish -- ACCEPT statement list complete
6333 ffestd_V019_finish();
6335 Just wrap up any local activities. */
6338 ffestd_V019_finish ()
6340 ffestd_check_finish_ ();
6342 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6345 ffeste_V019_finish ();
6347 /* Nothing to do, it's implicit. */
6351 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6356 /* ffestd_V020_start -- TYPE statement list begin
6358 ffestd_V020_start();
6360 Verify that TYPE is valid here, and begin accepting items in the
6364 ffestd_V020_start (ffestvFormat format UNUSED
)
6366 ffestd_check_start_ ();
6368 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6371 ffestd_subr_line_now_ ();
6372 ffeste_V020_start (&ffestp_file
.type
, format
);
6377 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV020_
);
6378 ffestd_stmt_append_ (stmt
);
6379 ffestd_subr_line_save_ (stmt
);
6380 stmt
->u
.V020
.pool
= ffesta_output_pool
;
6381 stmt
->u
.V020
.params
= ffestd_subr_copy_type_ ();
6382 stmt
->u
.V020
.format
= format
;
6383 stmt
->u
.V020
.list
= NULL
;
6384 ffestd_expr_list_
= &stmt
->u
.V020
.list
;
6385 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6390 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6391 ffestd_subr_vxt_ ();
6395 /* ffestd_V020_item -- TYPE statement i/o item
6397 ffestd_V020_item(expr,expr_token);
6399 Implement output-list expression. */
6402 ffestd_V020_item (ffebld expr UNUSED
)
6404 ffestd_check_item_ ();
6406 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6409 ffeste_V020_item (expr
);
6412 ffestdExprItem_ item
6413 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6418 *ffestd_expr_list_
= item
;
6419 ffestd_expr_list_
= &item
->next
;
6424 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6428 /* ffestd_V020_finish -- TYPE statement list complete
6430 ffestd_V020_finish();
6432 Just wrap up any local activities. */
6435 ffestd_V020_finish ()
6437 ffestd_check_finish_ ();
6439 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6442 ffeste_V020_finish ();
6444 /* Nothing to do, it's implicit. */
6448 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6452 /* ffestd_V021 -- DELETE statement
6456 Make sure a DELETE is valid in the current context, and implement it. */
6462 ffestd_check_simple_ ();
6464 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6467 ffestd_subr_line_now_ ();
6468 ffeste_V021 (&ffestp_file
.delete);
6473 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV021_
);
6474 ffestd_stmt_append_ (stmt
);
6475 ffestd_subr_line_save_ (stmt
);
6476 stmt
->u
.V021
.pool
= ffesta_output_pool
;
6477 stmt
->u
.V021
.params
= ffestd_subr_copy_delete_ ();
6478 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6483 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6484 ffestd_subr_vxt_ ();
6488 /* ffestd_V022 -- UNLOCK statement
6492 Make sure a UNLOCK is valid in the current context, and implement it. */
6497 ffestd_check_simple_ ();
6499 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6502 ffestd_subr_line_now_ ();
6503 ffeste_V022 (&ffestp_file
.beru
);
6508 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV022_
);
6509 ffestd_stmt_append_ (stmt
);
6510 ffestd_subr_line_save_ (stmt
);
6511 stmt
->u
.V022
.pool
= ffesta_output_pool
;
6512 stmt
->u
.V022
.params
= ffestd_subr_copy_beru_ ();
6513 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6518 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6519 ffestd_subr_vxt_ ();
6523 /* ffestd_V023_start -- ENCODE(...) statement list begin
6525 ffestd_V023_start();
6527 Verify that ENCODE is valid here, and begin accepting items in the
6531 ffestd_V023_start ()
6533 ffestd_check_start_ ();
6535 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6538 ffestd_subr_line_now_ ();
6539 ffeste_V023_start (&ffestp_file
.vxtcode
);
6544 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV023_
);
6545 ffestd_stmt_append_ (stmt
);
6546 ffestd_subr_line_save_ (stmt
);
6547 stmt
->u
.V023
.pool
= ffesta_output_pool
;
6548 stmt
->u
.V023
.params
= ffestd_subr_copy_vxtcode_ ();
6549 stmt
->u
.V023
.list
= NULL
;
6550 ffestd_expr_list_
= &stmt
->u
.V023
.list
;
6551 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6556 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6557 ffestd_subr_vxt_ ();
6561 /* ffestd_V023_item -- ENCODE statement i/o item
6563 ffestd_V023_item(expr,expr_token);
6565 Implement output-list expression. */
6568 ffestd_V023_item (ffebld expr
)
6570 ffestd_check_item_ ();
6572 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6575 ffeste_V023_item (expr
);
6578 ffestdExprItem_ item
6579 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6584 *ffestd_expr_list_
= item
;
6585 ffestd_expr_list_
= &item
->next
;
6590 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6594 /* ffestd_V023_finish -- ENCODE statement list complete
6596 ffestd_V023_finish();
6598 Just wrap up any local activities. */
6601 ffestd_V023_finish ()
6603 ffestd_check_finish_ ();
6605 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6608 ffeste_V023_finish ();
6610 /* Nothing to do, it's implicit. */
6614 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6618 /* ffestd_V024_start -- DECODE(...) statement list begin
6620 ffestd_V024_start();
6622 Verify that DECODE is valid here, and begin accepting items in the
6626 ffestd_V024_start ()
6628 ffestd_check_start_ ();
6630 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6633 ffestd_subr_line_now_ ();
6634 ffeste_V024_start (&ffestp_file
.vxtcode
);
6639 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV024_
);
6640 ffestd_stmt_append_ (stmt
);
6641 ffestd_subr_line_save_ (stmt
);
6642 stmt
->u
.V024
.pool
= ffesta_output_pool
;
6643 stmt
->u
.V024
.params
= ffestd_subr_copy_vxtcode_ ();
6644 stmt
->u
.V024
.list
= NULL
;
6645 ffestd_expr_list_
= &stmt
->u
.V024
.list
;
6646 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6651 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6652 ffestd_subr_vxt_ ();
6656 /* ffestd_V024_item -- DECODE statement i/o item
6658 ffestd_V024_item(expr,expr_token);
6660 Implement output-list expression. */
6663 ffestd_V024_item (ffebld expr
)
6665 ffestd_check_item_ ();
6667 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6670 ffeste_V024_item (expr
);
6673 ffestdExprItem_ item
6674 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6679 *ffestd_expr_list_
= item
;
6680 ffestd_expr_list_
= &item
->next
;
6685 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6689 /* ffestd_V024_finish -- DECODE statement list complete
6691 ffestd_V024_finish();
6693 Just wrap up any local activities. */
6696 ffestd_V024_finish ()
6698 ffestd_check_finish_ ();
6700 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6703 ffeste_V024_finish ();
6705 /* Nothing to do, it's implicit. */
6709 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6713 /* ffestd_V025_start -- DEFINEFILE statement list begin
6715 ffestd_V025_start();
6717 Verify that DEFINEFILE is valid here, and begin accepting items in the
6721 ffestd_V025_start ()
6723 ffestd_check_start_ ();
6725 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6728 ffestd_subr_line_now_ ();
6729 ffeste_V025_start ();
6734 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV025start_
);
6735 ffestd_stmt_append_ (stmt
);
6736 ffestd_subr_line_save_ (stmt
);
6737 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6742 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6743 ffestd_subr_vxt_ ();
6747 /* ffestd_V025_item -- DEFINE FILE statement item
6749 ffestd_V025_item(u,ut,m,mt,n,nt,asv,asvt);
6751 Implement item. Treat each item kind of like a separate statement,
6752 since there's really no need to treat them as an aggregate. */
6755 ffestd_V025_item (ffebld u
, ffebld m
, ffebld n
, ffebld asv
)
6757 ffestd_check_item_ ();
6759 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6762 ffeste_V025_item (u
, m
, n
, asv
);
6767 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV025item_
);
6768 ffestd_stmt_append_ (stmt
);
6769 stmt
->u
.V025item
.u
= u
;
6770 stmt
->u
.V025item
.m
= m
;
6771 stmt
->u
.V025item
.n
= n
;
6772 stmt
->u
.V025item
.asv
= asv
;
6777 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6781 /* ffestd_V025_finish -- DEFINE FILE statement list complete
6783 ffestd_V025_finish();
6785 Just wrap up any local activities. */
6788 ffestd_V025_finish ()
6790 ffestd_check_finish_ ();
6792 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6795 ffeste_V025_finish ();
6800 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV025finish_
);
6801 stmt
->u
.V025finish
.pool
= ffesta_output_pool
;
6802 ffestd_stmt_append_ (stmt
);
6807 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6811 /* ffestd_V026 -- FIND statement
6815 Make sure a FIND is valid in the current context, and implement it. */
6820 ffestd_check_simple_ ();
6822 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6825 ffestd_subr_line_now_ ();
6826 ffeste_V026 (&ffestp_file
.find
);
6831 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV026_
);
6832 ffestd_stmt_append_ (stmt
);
6833 ffestd_subr_line_save_ (stmt
);
6834 stmt
->u
.V026
.pool
= ffesta_output_pool
;
6835 stmt
->u
.V026
.params
= ffestd_subr_copy_find_ ();
6836 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6841 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6842 ffestd_subr_vxt_ ();
6847 /* ffestd_V027_start -- VXT PARAMETER statement list begin
6849 ffestd_V027_start();
6851 Verify that PARAMETER is valid here, and begin accepting items in the list. */
6854 ffestd_V027_start ()
6856 ffestd_check_start_ ();
6858 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6859 fputs ("* PARAMETER_vxt ", dmpout
);
6861 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6862 ffestd_subr_vxt_ ();
6867 /* ffestd_V027_item -- VXT PARAMETER statement assignment
6869 ffestd_V027_item(dest,dest_token,source,source_token);
6871 Make sure the source is a valid source for the destination; make the
6875 ffestd_V027_item (ffelexToken dest_token UNUSED
, ffebld source UNUSED
)
6877 ffestd_check_item_ ();
6879 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6880 fputs (ffelex_token_text (dest_token
), dmpout
);
6881 fputc ('=', dmpout
);
6882 ffebld_dump (source
);
6883 fputc (',', dmpout
);
6884 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6890 /* ffestd_V027_finish -- VXT PARAMETER statement list complete
6892 ffestd_V027_finish();
6894 Just wrap up any local activities. */
6897 ffestd_V027_finish ()
6899 ffestd_check_finish_ ();
6901 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6902 fputc ('\n', dmpout
);
6903 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6909 /* Any executable statement. */
6914 ffestd_check_simple_ ();
6917 ffestd_subr_line_now_ ();
6923 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR841_
);
6924 ffestd_stmt_append_ (stmt
);
6925 ffestd_subr_line_save_ (stmt
);