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 (s
, "%" ffeTokenLength_f
"uH", i
);
4471 ffests_putc (s
, *p
);
4482 case FFESTP_formattypeFORMAT
:
4483 if (next
->u
.R1003D
.R1004
.present
)
4485 if (next
->u
.R1003D
.R1004
.rtexpr
)
4486 ffestd_R1001rtexpr_ (s
, next
, next
->u
.R1003D
.R1004
.u
.expr
);
4488 ffests_printf (s
, "%lu", next
->u
.R1003D
.R1004
.u
.unsigned_val
);
4491 ffests_putc (s
, '(');
4492 ffestd_R1001dump_ (s
, next
->u
.R1003D
.format
);
4493 ffests_putc (s
, ')');
4502 /* ffestd_R1001dump_1005_1_ -- Dump a particular format
4505 ffestd_R1001dump_1005_1_(f,"I");
4507 The format is dumped with form [r]X[w]. */
4510 ffestd_R1001dump_1005_1_ (ffests s
, ffesttFormatList f
, const char *string
)
4512 assert (!f
->u
.R1005
.R1007_or_R1008
.present
);
4513 assert (!f
->u
.R1005
.R1009
.present
);
4515 if (f
->u
.R1005
.R1004
.present
)
4517 if (f
->u
.R1005
.R1004
.rtexpr
)
4518 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4520 ffests_printf (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4523 ffests_puts (s
, string
);
4525 if (f
->u
.R1005
.R1006
.present
)
4527 if (f
->u
.R1005
.R1006
.rtexpr
)
4528 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4530 ffests_printf (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4534 /* ffestd_R1001dump_1005_2_ -- Dump a particular format
4537 ffestd_R1001dump_1005_2_(f,"I");
4539 The format is dumped with form [r]Xw. */
4542 ffestd_R1001dump_1005_2_ (ffests s
, ffesttFormatList f
, const char *string
)
4544 assert (!f
->u
.R1005
.R1007_or_R1008
.present
);
4545 assert (!f
->u
.R1005
.R1009
.present
);
4546 assert (f
->u
.R1005
.R1006
.present
);
4548 if (f
->u
.R1005
.R1004
.present
)
4550 if (f
->u
.R1005
.R1004
.rtexpr
)
4551 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4553 ffests_printf (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4556 ffests_puts (s
, string
);
4558 if (f
->u
.R1005
.R1006
.rtexpr
)
4559 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4561 ffests_printf (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4564 /* ffestd_R1001dump_1005_3_ -- Dump a particular format
4567 ffestd_R1001dump_1005_3_(f,"I");
4569 The format is dumped with form [r]Xw[.m]. */
4572 ffestd_R1001dump_1005_3_ (ffests s
, ffesttFormatList f
, const char *string
)
4574 assert (!f
->u
.R1005
.R1009
.present
);
4575 assert (f
->u
.R1005
.R1006
.present
);
4577 if (f
->u
.R1005
.R1004
.present
)
4579 if (f
->u
.R1005
.R1004
.rtexpr
)
4580 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4582 ffests_printf (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4585 ffests_puts (s
, string
);
4587 if (f
->u
.R1005
.R1006
.rtexpr
)
4588 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4590 ffests_printf (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4592 if (f
->u
.R1005
.R1007_or_R1008
.present
)
4594 ffests_putc (s
, '.');
4595 if (f
->u
.R1005
.R1007_or_R1008
.rtexpr
)
4596 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1007_or_R1008
.u
.expr
);
4598 ffests_printf (s
, "%lu", f
->u
.R1005
.R1007_or_R1008
.u
.unsigned_val
);
4602 /* ffestd_R1001dump_1005_4_ -- Dump a particular format
4605 ffestd_R1001dump_1005_4_(f,"I");
4607 The format is dumped with form [r]Xw.d. */
4610 ffestd_R1001dump_1005_4_ (ffests s
, ffesttFormatList f
, const char *string
)
4612 assert (!f
->u
.R1005
.R1009
.present
);
4613 assert (f
->u
.R1005
.R1007_or_R1008
.present
);
4614 assert (f
->u
.R1005
.R1006
.present
);
4616 if (f
->u
.R1005
.R1004
.present
)
4618 if (f
->u
.R1005
.R1004
.rtexpr
)
4619 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4621 ffests_printf (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4624 ffests_puts (s
, string
);
4626 if (f
->u
.R1005
.R1006
.rtexpr
)
4627 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4629 ffests_printf (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4631 ffests_putc (s
, '.');
4632 if (f
->u
.R1005
.R1007_or_R1008
.rtexpr
)
4633 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1007_or_R1008
.u
.expr
);
4635 ffests_printf (s
, "%lu", f
->u
.R1005
.R1007_or_R1008
.u
.unsigned_val
);
4638 /* ffestd_R1001dump_1005_5_ -- Dump a particular format
4641 ffestd_R1001dump_1005_5_(f,"I");
4643 The format is dumped with form [r]Xw.d[Ee]. */
4646 ffestd_R1001dump_1005_5_ (ffests s
, ffesttFormatList f
, const char *string
)
4648 assert (f
->u
.R1005
.R1007_or_R1008
.present
);
4649 assert (f
->u
.R1005
.R1006
.present
);
4651 if (f
->u
.R1005
.R1004
.present
)
4653 if (f
->u
.R1005
.R1004
.rtexpr
)
4654 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4656 ffests_printf (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4659 ffests_puts (s
, string
);
4661 if (f
->u
.R1005
.R1006
.rtexpr
)
4662 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4664 ffests_printf (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4666 ffests_putc (s
, '.');
4667 if (f
->u
.R1005
.R1007_or_R1008
.rtexpr
)
4668 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1007_or_R1008
.u
.expr
);
4670 ffests_printf (s
, "%lu", f
->u
.R1005
.R1007_or_R1008
.u
.unsigned_val
);
4672 if (f
->u
.R1005
.R1009
.present
)
4674 ffests_putc (s
, 'E');
4675 if (f
->u
.R1005
.R1009
.rtexpr
)
4676 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1009
.u
.expr
);
4678 ffests_printf (s
, "%lu", f
->u
.R1005
.R1009
.u
.unsigned_val
);
4682 /* ffestd_R1001dump_1010_1_ -- Dump a particular format
4685 ffestd_R1001dump_1010_1_(f,"I");
4687 The format is dumped with form X. */
4690 ffestd_R1001dump_1010_1_ (ffests s
, ffesttFormatList f
, const char *string
)
4692 assert (!f
->u
.R1010
.val
.present
);
4694 ffests_puts (s
, string
);
4697 /* ffestd_R1001dump_1010_2_ -- Dump a particular format
4700 ffestd_R1001dump_1010_2_(f,"I");
4702 The format is dumped with form [r]X. */
4705 ffestd_R1001dump_1010_2_ (ffests s
, ffesttFormatList f
, const char *string
)
4707 if (f
->u
.R1010
.val
.present
)
4709 if (f
->u
.R1010
.val
.rtexpr
)
4710 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4712 ffests_printf (s
, "%lu", f
->u
.R1010
.val
.u
.unsigned_val
);
4715 ffests_puts (s
, string
);
4718 /* ffestd_R1001dump_1010_3_ -- Dump a particular format
4721 ffestd_R1001dump_1010_3_(f,"I");
4723 The format is dumped with form nX. */
4726 ffestd_R1001dump_1010_3_ (ffests s
, ffesttFormatList f
, const char *string
)
4728 assert (f
->u
.R1010
.val
.present
);
4730 if (f
->u
.R1010
.val
.rtexpr
)
4731 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4733 ffests_printf (s
, "%lu", f
->u
.R1010
.val
.u
.unsigned_val
);
4735 ffests_puts (s
, string
);
4738 /* ffestd_R1001dump_1010_4_ -- Dump a particular format
4741 ffestd_R1001dump_1010_4_(f,"I");
4743 The format is dumped with form kX. Note that k is signed. */
4746 ffestd_R1001dump_1010_4_ (ffests s
, ffesttFormatList f
, const char *string
)
4748 assert (f
->u
.R1010
.val
.present
);
4750 if (f
->u
.R1010
.val
.rtexpr
)
4751 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4753 ffests_printf (s
, "%ld", f
->u
.R1010
.val
.u
.signed_val
);
4755 ffests_puts (s
, string
);
4758 /* ffestd_R1001dump_1010_5_ -- Dump a particular format
4761 ffestd_R1001dump_1010_5_(f,"I");
4763 The format is dumped with form Xn. */
4766 ffestd_R1001dump_1010_5_ (ffests s
, ffesttFormatList f
, const char *string
)
4768 assert (f
->u
.R1010
.val
.present
);
4770 ffests_puts (s
, string
);
4772 if (f
->u
.R1010
.val
.rtexpr
)
4773 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4775 ffests_printf (s
, "%lu", f
->u
.R1010
.val
.u
.unsigned_val
);
4778 /* ffestd_R1001error_ -- Complain about FORMAT specification not supported
4781 ffestd_R1001error_(f);
4783 An error message is produced. */
4786 ffestd_R1001error_ (ffesttFormatList f
)
4788 ffebad_start (FFEBAD_FORMAT_UNSUPPORTED
);
4789 ffebad_here (0, ffelex_token_where_line (f
->t
), ffelex_token_where_column (f
->t
));
4794 ffestd_R1001rtexpr_ (ffests s
, ffesttFormatList f
, ffebld expr
)
4797 || (ffebld_op (expr
) != FFEBLD_opCONTER
)
4798 || (ffeinfo_basictype (ffebld_info (expr
)) != FFEINFO_basictypeINTEGER
)
4799 || (ffeinfo_kindtype (ffebld_info (expr
)) == FFEINFO_kindtypeINTEGER4
))
4801 ffebad_start (FFEBAD_FORMAT_VARIABLE
);
4802 ffebad_here (0, ffelex_token_where_line (f
->t
), ffelex_token_where_column (f
->t
));
4809 switch (ffeinfo_kindtype (ffebld_info (expr
)))
4811 #if FFETARGET_okINTEGER1
4812 case FFEINFO_kindtypeINTEGER1
:
4813 val
= ffebld_constant_integer1 (ffebld_conter (expr
));
4817 #if FFETARGET_okINTEGER2
4818 case FFEINFO_kindtypeINTEGER2
:
4819 val
= ffebld_constant_integer2 (ffebld_conter (expr
));
4823 #if FFETARGET_okINTEGER3
4824 case FFEINFO_kindtypeINTEGER3
:
4825 val
= ffebld_constant_integer3 (ffebld_conter (expr
));
4830 assert ("bad INTEGER constant kind type" == NULL
);
4832 case FFEINFO_kindtypeANY
:
4835 ffests_printf (s
, "%ld", (long) val
);
4839 /* ffestd_R1102 -- PROGRAM statement
4841 ffestd_R1102(name_token);
4843 Make sure ffestd_kind_ identifies an empty block. Make sure name_token
4844 gives a valid name. Implement the beginning of a main program. */
4847 ffestd_R1102 (ffesymbol s
, ffelexToken name UNUSED
)
4849 ffestd_check_simple_ ();
4851 assert (ffestd_block_level_
== 0);
4852 ffestd_is_reachable_
= TRUE
;
4854 ffecom_notify_primary_entry (s
);
4855 ffe_set_is_mainprog (TRUE
); /* Is a main program. */
4856 ffe_set_is_saveall (TRUE
); /* Main program always has implicit SAVE. */
4858 ffestw_set_sym (ffestw_stack_top (), s
);
4860 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4862 fputs ("< PROGRAM_unnamed\n", dmpout
);
4864 fprintf (dmpout
, "< PROGRAM %s\n", ffelex_token_text (name
));
4865 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4871 /* ffestd_R1103 -- End a PROGRAM
4876 ffestd_R1103 (bool ok UNUSED
)
4878 assert (ffestd_block_level_
== 0);
4880 if (FFESTD_IS_END_OPTIMIZED_
&& ffestd_is_reachable_
)
4881 ffestd_R842 (NULL
); /* Generate STOP. */
4883 if (ffestw_state (ffestw_stack_top ()) != FFESTV_statePROGRAM5
)
4884 ffestd_subr_labels_ (FALSE
);/* Handle any undefined labels. */
4892 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1103_
);
4893 ffestd_stmt_append_ (stmt
);
4898 /* ffestd_R1105 -- MODULE statement
4900 ffestd_R1105(name_token);
4902 Make sure ffestd_kind_ identifies an empty block. Make sure name_token
4903 gives a valid name. Implement the beginning of a module. */
4907 ffestd_R1105 (ffelexToken name
)
4909 assert (ffestd_block_level_
== 0);
4911 ffestd_check_simple_ ();
4913 ffestd_subr_f90_ ();
4917 fprintf (dmpout
, "* MODULE %s\n", ffelex_token_text (name
));
4921 /* ffestd_R1106 -- End a MODULE
4923 ffestd_R1106(TRUE); */
4926 ffestd_R1106 (bool ok
)
4928 assert (ffestd_block_level_
== 0);
4930 /* Generate any wrap-up code here (unlikely in MODULE!). */
4932 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateMODULE5
)
4933 ffestd_subr_labels_ (TRUE
); /* Handle any undefined labels (unlikely). */
4938 fprintf (dmpout
, "< END_MODULE %s\n",
4939 ffelex_token_text (ffestw_name (ffestw_stack_top ())));
4943 /* ffestd_R1107_start -- USE statement list begin
4945 ffestd_R1107_start();
4947 Verify that USE is valid here, and begin accepting items in the list. */
4950 ffestd_R1107_start (ffelexToken name
, bool only
)
4952 ffestd_check_start_ ();
4954 ffestd_subr_f90_ ();
4958 fprintf (dmpout
, "* USE %s,", ffelex_token_text (name
)); /* NB
4959 _shriek_begin_uses_. */
4961 fputs ("only: ", dmpout
);
4965 /* ffestd_R1107_item -- USE statement for name
4967 ffestd_R1107_item(local_token,use_token);
4969 Make sure name_token identifies a valid object to be USEed. local_token
4970 may be NULL if _start_ was called with only==TRUE. */
4973 ffestd_R1107_item (ffelexToken local
, ffelexToken use
)
4975 ffestd_check_item_ ();
4976 assert (use
!= NULL
);
4982 fprintf (dmpout
, "%s=>", ffelex_token_text (local
));
4983 fprintf (dmpout
, "%s,", ffelex_token_text (use
));
4987 /* ffestd_R1107_finish -- USE statement list complete
4989 ffestd_R1107_finish();
4991 Just wrap up any local activities. */
4994 ffestd_R1107_finish ()
4996 ffestd_check_finish_ ();
5001 fputc ('\n', dmpout
);
5006 /* ffestd_R1111 -- BLOCK DATA statement
5008 ffestd_R1111(name_token);
5010 Make sure ffestd_kind_ identifies no current program unit. If not
5011 NULL, make sure name_token gives a valid name. Implement the beginning
5012 of a block data program unit. */
5015 ffestd_R1111 (ffesymbol s
, ffelexToken name UNUSED
)
5017 assert (ffestd_block_level_
== 0);
5018 ffestd_is_reachable_
= TRUE
;
5020 ffestd_check_simple_ ();
5022 ffecom_notify_primary_entry (s
);
5023 ffestw_set_sym (ffestw_stack_top (), s
);
5025 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5027 fputs ("< BLOCK_DATA_unnamed\n", dmpout
);
5029 fprintf (dmpout
, "< BLOCK_DATA %s\n", ffelex_token_text (name
));
5030 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5036 /* ffestd_R1112 -- End a BLOCK DATA
5038 ffestd_R1112(TRUE); */
5041 ffestd_R1112 (bool ok UNUSED
)
5043 assert (ffestd_block_level_
== 0);
5045 /* Generate any return-like code here (not likely for BLOCK DATA!). */
5047 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateBLOCKDATA5
)
5048 ffestd_subr_labels_ (TRUE
); /* Handle any undefined labels. */
5056 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1112_
);
5057 ffestd_stmt_append_ (stmt
);
5062 /* ffestd_R1202 -- INTERFACE statement
5064 ffestd_R1202(operator,defined_name);
5066 Make sure ffestd_kind_ identifies an INTERFACE block.
5067 Implement the end of the current interface.
5070 Allow no operator or name to mean INTERFACE by itself; missed this
5071 valid form when originally doing syntactic analysis code. */
5075 ffestd_R1202 (ffestpDefinedOperator
operator, ffelexToken name
)
5077 ffestd_check_simple_ ();
5079 ffestd_subr_f90_ ();
5085 case FFESTP_definedoperatorNone
:
5087 fputs ("* INTERFACE_unnamed\n", dmpout
);
5089 fprintf (dmpout
, "* INTERFACE %s\n", ffelex_token_text (name
));
5092 case FFESTP_definedoperatorOPERATOR
:
5093 fprintf (dmpout
, "* INTERFACE_OPERATOR (.%s.)\n", ffelex_token_text (name
));
5096 case FFESTP_definedoperatorASSIGNMENT
:
5097 fputs ("* INTERFACE_ASSIGNMENT (=)\n", dmpout
);
5100 case FFESTP_definedoperatorPOWER
:
5101 fputs ("* INTERFACE_OPERATOR (**)\n", dmpout
);
5104 case FFESTP_definedoperatorMULT
:
5105 fputs ("* INTERFACE_OPERATOR (*)\n", dmpout
);
5108 case FFESTP_definedoperatorADD
:
5109 fputs ("* INTERFACE_OPERATOR (+)\n", dmpout
);
5112 case FFESTP_definedoperatorCONCAT
:
5113 fputs ("* INTERFACE_OPERATOR (//)\n", dmpout
);
5116 case FFESTP_definedoperatorDIVIDE
:
5117 fputs ("* INTERFACE_OPERATOR (/)\n", dmpout
);
5120 case FFESTP_definedoperatorSUBTRACT
:
5121 fputs ("* INTERFACE_OPERATOR (-)\n", dmpout
);
5124 case FFESTP_definedoperatorNOT
:
5125 fputs ("* INTERFACE_OPERATOR (.not.)\n", dmpout
);
5128 case FFESTP_definedoperatorAND
:
5129 fputs ("* INTERFACE_OPERATOR (.and.)\n", dmpout
);
5132 case FFESTP_definedoperatorOR
:
5133 fputs ("* INTERFACE_OPERATOR (.or.)\n", dmpout
);
5136 case FFESTP_definedoperatorEQV
:
5137 fputs ("* INTERFACE_OPERATOR (.eqv.)\n", dmpout
);
5140 case FFESTP_definedoperatorNEQV
:
5141 fputs ("* INTERFACE_OPERATOR (.neqv.)\n", dmpout
);
5144 case FFESTP_definedoperatorEQ
:
5145 fputs ("* INTERFACE_OPERATOR (==)\n", dmpout
);
5148 case FFESTP_definedoperatorNE
:
5149 fputs ("* INTERFACE_OPERATOR (/=)\n", dmpout
);
5152 case FFESTP_definedoperatorLT
:
5153 fputs ("* INTERFACE_OPERATOR (<)\n", dmpout
);
5156 case FFESTP_definedoperatorLE
:
5157 fputs ("* INTERFACE_OPERATOR (<=)\n", dmpout
);
5160 case FFESTP_definedoperatorGT
:
5161 fputs ("* INTERFACE_OPERATOR (>)\n", dmpout
);
5164 case FFESTP_definedoperatorGE
:
5165 fputs ("* INTERFACE_OPERATOR (>=)\n", dmpout
);
5175 /* ffestd_R1203 -- End an INTERFACE
5177 ffestd_R1203(TRUE); */
5180 ffestd_R1203 (bool ok
)
5185 fputs ("* END_INTERFACE\n", dmpout
);
5189 /* ffestd_R1205_start -- MODULE PROCEDURE statement list begin
5191 ffestd_R1205_start();
5193 Verify that MODULE PROCEDURE is valid here, and begin accepting items in
5197 ffestd_R1205_start ()
5199 ffestd_check_start_ ();
5204 fputs ("* MODULE_PROCEDURE ", dmpout
);
5208 /* ffestd_R1205_item -- MODULE PROCEDURE statement for name
5210 ffestd_R1205_item(name_token);
5212 Make sure name_token identifies a valid object to be MODULE PROCEDUREed. */
5215 ffestd_R1205_item (ffelexToken name
)
5217 ffestd_check_item_ ();
5218 assert (name
!= NULL
);
5223 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
5227 /* ffestd_R1205_finish -- MODULE PROCEDURE statement list complete
5229 ffestd_R1205_finish();
5231 Just wrap up any local activities. */
5234 ffestd_R1205_finish ()
5236 ffestd_check_finish_ ();
5241 fputc ('\n', dmpout
);
5246 /* ffestd_R1207_start -- EXTERNAL statement list begin
5248 ffestd_R1207_start();
5250 Verify that EXTERNAL is valid here, and begin accepting items in the list. */
5253 ffestd_R1207_start ()
5255 ffestd_check_start_ ();
5257 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5258 fputs ("* EXTERNAL (", dmpout
);
5259 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5265 /* ffestd_R1207_item -- EXTERNAL statement for name
5267 ffestd_R1207_item(name_token);
5269 Make sure name_token identifies a valid object to be EXTERNALd. */
5272 ffestd_R1207_item (ffelexToken name
)
5274 ffestd_check_item_ ();
5275 assert (name
!= NULL
);
5277 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5278 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
5279 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5285 /* ffestd_R1207_finish -- EXTERNAL statement list complete
5287 ffestd_R1207_finish();
5289 Just wrap up any local activities. */
5292 ffestd_R1207_finish ()
5294 ffestd_check_finish_ ();
5296 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5297 fputs (")\n", dmpout
);
5298 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5304 /* ffestd_R1208_start -- INTRINSIC statement list begin
5306 ffestd_R1208_start();
5308 Verify that INTRINSIC is valid here, and begin accepting items in the list. */
5311 ffestd_R1208_start ()
5313 ffestd_check_start_ ();
5315 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5316 fputs ("* INTRINSIC (", dmpout
);
5317 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5323 /* ffestd_R1208_item -- INTRINSIC statement for name
5325 ffestd_R1208_item(name_token);
5327 Make sure name_token identifies a valid object to be INTRINSICd. */
5330 ffestd_R1208_item (ffelexToken name
)
5332 ffestd_check_item_ ();
5333 assert (name
!= NULL
);
5335 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5336 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
5337 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5343 /* ffestd_R1208_finish -- INTRINSIC statement list complete
5345 ffestd_R1208_finish();
5347 Just wrap up any local activities. */
5350 ffestd_R1208_finish ()
5352 ffestd_check_finish_ ();
5354 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5355 fputs (")\n", dmpout
);
5356 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5362 /* ffestd_R1212 -- CALL statement
5364 ffestd_R1212(expr,expr_token);
5366 Make sure statement is valid here; implement. */
5369 ffestd_R1212 (ffebld expr
)
5371 ffestd_check_simple_ ();
5374 ffestd_subr_line_now_ ();
5375 ffeste_R1212 (expr
);
5380 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1212_
);
5381 ffestd_stmt_append_ (stmt
);
5382 ffestd_subr_line_save_ (stmt
);
5383 stmt
->u
.R1212
.pool
= ffesta_output_pool
;
5384 stmt
->u
.R1212
.expr
= expr
;
5385 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5390 /* ffestd_R1213 -- Defined assignment statement
5392 ffestd_R1213(dest_expr,source_expr,source_token);
5394 Make sure the assignment is valid. */
5398 ffestd_R1213 (ffebld dest
, ffebld source
)
5400 ffestd_check_simple_ ();
5402 ffestd_subr_f90_ ();
5406 fputs ("+ let_defined ", dmpout
);
5408 fputs ("=", dmpout
);
5409 ffebld_dump (source
);
5410 fputc ('\n', dmpout
);
5415 /* ffestd_R1219 -- FUNCTION statement
5417 ffestd_R1219(funcname,arglist,ending_token,kind,kindt,len,lent,
5420 Make sure statement is valid here, register arguments for the
5421 function name, and so on.
5424 Added the kind, len, and recursive arguments. */
5427 ffestd_R1219 (ffesymbol s
, ffelexToken funcname UNUSED
,
5428 ffesttTokenList args UNUSED
, ffestpType type UNUSED
,
5429 ffebld kind UNUSED
, ffelexToken kindt UNUSED
,
5430 ffebld len UNUSED
, ffelexToken lent UNUSED
,
5431 bool recursive UNUSED
, ffelexToken result UNUSED
,
5432 bool separate_result UNUSED
)
5434 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5438 assert (ffestd_block_level_
== 0);
5439 ffestd_is_reachable_
= TRUE
;
5441 ffestd_check_simple_ ();
5443 ffecom_notify_primary_entry (s
);
5444 ffestw_set_sym (ffestw_stack_top (), s
);
5446 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5449 case FFESTP_typeINTEGER
:
5453 case FFESTP_typeBYTE
:
5457 case FFESTP_typeWORD
:
5461 case FFESTP_typeREAL
:
5465 case FFESTP_typeCOMPLEX
:
5469 case FFESTP_typeLOGICAL
:
5473 case FFESTP_typeCHARACTER
:
5477 case FFESTP_typeDBLPRCSN
:
5478 a
= "DOUBLE PRECISION";
5481 case FFESTP_typeDBLCMPLX
:
5482 a
= "DOUBLE COMPLEX";
5486 case FFESTP_typeTYPE
:
5491 case FFESTP_typeNone
:
5500 fprintf (dmpout
, "< FUNCTION %s ", ffelex_token_text (funcname
));
5502 fputs ("RECURSIVE ", dmpout
);
5503 fprintf (dmpout
, "%s(", a
);
5506 fputs ("kind=", dmpout
);
5508 fputs (ffelex_token_text (kindt
), dmpout
);
5512 fputc (',', dmpout
);
5516 fputs ("len=", dmpout
);
5518 fputs (ffelex_token_text (lent
), dmpout
);
5522 fprintf (dmpout
, ")");
5525 fputs (" (", dmpout
);
5526 ffestt_tokenlist_dump (args
);
5527 fputc (')', dmpout
);
5530 fprintf (dmpout
, " result(%s)", ffelex_token_text (result
));
5531 fputc ('\n', dmpout
);
5532 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5538 /* ffestd_R1221 -- End a FUNCTION
5540 ffestd_R1221(TRUE); */
5543 ffestd_R1221 (bool ok UNUSED
)
5545 assert (ffestd_block_level_
== 0);
5547 if (FFESTD_IS_END_OPTIMIZED_
&& ffestd_is_reachable_
)
5548 ffestd_R1227 (NULL
); /* Generate RETURN. */
5550 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateFUNCTION5
)
5551 ffestd_subr_labels_ (FALSE
);/* Handle any undefined labels. */
5559 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1221_
);
5560 ffestd_stmt_append_ (stmt
);
5565 /* ffestd_R1223 -- SUBROUTINE statement
5567 ffestd_R1223(subrname,arglist,ending_token,recursive_token);
5569 Make sure statement is valid here, register arguments for the
5570 subroutine name, and so on.
5573 Added the recursive argument. */
5576 ffestd_R1223 (ffesymbol s
, ffelexToken subrname UNUSED
,
5577 ffesttTokenList args UNUSED
, ffelexToken final UNUSED
,
5578 bool recursive UNUSED
)
5580 assert (ffestd_block_level_
== 0);
5581 ffestd_is_reachable_
= TRUE
;
5583 ffestd_check_simple_ ();
5585 ffecom_notify_primary_entry (s
);
5586 ffestw_set_sym (ffestw_stack_top (), s
);
5588 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5589 fprintf (dmpout
, "< SUBROUTINE %s ", ffelex_token_text (subrname
));
5591 fputs ("recursive ", dmpout
);
5594 fputc ('(', dmpout
);
5595 ffestt_tokenlist_dump (args
);
5596 fputc (')', dmpout
);
5598 fputc ('\n', dmpout
);
5599 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5605 /* ffestd_R1225 -- End a SUBROUTINE
5607 ffestd_R1225(TRUE); */
5610 ffestd_R1225 (bool ok UNUSED
)
5612 assert (ffestd_block_level_
== 0);
5614 if (FFESTD_IS_END_OPTIMIZED_
&& ffestd_is_reachable_
)
5615 ffestd_R1227 (NULL
); /* Generate RETURN. */
5617 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateSUBROUTINE5
)
5618 ffestd_subr_labels_ (FALSE
);/* Handle any undefined labels. */
5626 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1225_
);
5627 ffestd_stmt_append_ (stmt
);
5632 /* ffestd_R1226 -- ENTRY statement
5634 ffestd_R1226(entryname,arglist,ending_token);
5636 Make sure we're in a SUBROUTINE or FUNCTION, register arguments for the
5637 entry point name, and so on. */
5640 ffestd_R1226 (ffesymbol entry
)
5642 ffestd_check_simple_ ();
5644 #if (FFECOM_targetCURRENT == FFECOM_targetFFE) || FFECOM_ONEPASS
5645 ffestd_subr_line_now_ ();
5646 ffeste_R1226 (entry
);
5648 if (!ffesta_seen_first_exec
|| ffecom_2pass_advise_entrypoint (entry
))
5652 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1226_
);
5653 ffestd_stmt_append_ (stmt
);
5654 ffestd_subr_line_save_ (stmt
);
5655 stmt
->u
.R1226
.entry
= entry
;
5656 stmt
->u
.R1226
.entrynum
= ++ffestd_2pass_entrypoints_
;
5660 ffestd_is_reachable_
= TRUE
;
5663 /* ffestd_R1227 -- RETURN statement
5667 Make sure statement is valid here; implement. expr and expr_token are
5668 both NULL if there was no expression. */
5671 ffestd_R1227 (ffebld expr
)
5673 ffestd_check_simple_ ();
5676 ffestd_subr_line_now_ ();
5677 ffeste_R1227 (ffestw_stack_top (), expr
);
5682 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1227_
);
5683 ffestd_stmt_append_ (stmt
);
5684 ffestd_subr_line_save_ (stmt
);
5685 stmt
->u
.R1227
.pool
= ffesta_output_pool
;
5686 stmt
->u
.R1227
.block
= ffestw_stack_top ();
5687 stmt
->u
.R1227
.expr
= expr
;
5688 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5692 if (ffestd_block_level_
== 0)
5693 ffestd_is_reachable_
= FALSE
;
5696 /* ffestd_R1228 -- CONTAINS statement
5704 assert (ffestd_block_level_
== 0);
5706 ffestd_check_simple_ ();
5708 /* Generate RETURN/STOP code here */
5710 ffestd_subr_labels_ (ffestw_state (ffestw_stack_top ())
5711 == FFESTV_stateMODULE5
); /* Handle any undefined
5714 ffestd_subr_f90_ ();
5718 fputs ("- CONTAINS\n", dmpout
);
5723 /* ffestd_R1229_start -- STMTFUNCTION statement begin
5725 ffestd_R1229_start(func_name,func_arg_list,close_paren);
5727 This function does not really need to do anything, since _finish_
5728 gets all the info needed, and ffestc_R1229_start has already
5729 done all the stuff that makes a two-phase operation (start and
5730 finish) for handling statement functions necessary.
5733 Do nothing, now that _finish_ does everything. */
5736 ffestd_R1229_start (ffelexToken name UNUSED
, ffesttTokenList args UNUSED
)
5738 ffestd_check_start_ ();
5740 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5741 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5747 /* ffestd_R1229_finish -- STMTFUNCTION statement list complete
5749 ffestd_R1229_finish(s);
5751 The statement function's symbol is passed. Its list of dummy args is
5752 accessed via ffesymbol_dummyargs and its expansion expression (expr)
5753 is accessed via ffesymbol_sfexpr.
5755 If sfexpr is NULL, an error occurred parsing the expansion expression, so
5756 just cancel the effects of ffestd_R1229_start and pretend nothing
5757 happened. Otherwise, install the expression as the expansion for the
5758 statement function, then clean up.
5761 Takes sfunc sym instead of just the expansion expression as an
5762 argument, so this function can do all the work, and _start_ is just
5763 a nicety than can do nothing in a back end. */
5766 ffestd_R1229_finish (ffesymbol s
)
5768 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5769 ffebld args
= ffesymbol_dummyargs (s
);
5771 ffebld expr
= ffesymbol_sfexpr (s
);
5773 ffestd_check_finish_ ();
5776 return; /* Nothing to do, definition didn't work. */
5778 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5779 fprintf (dmpout
, "* stmtfunction %s(", ffesymbol_text (s
));
5780 for (; args
!= NULL
; args
= ffebld_trail (args
))
5781 fprintf (dmpout
, "%s,", ffesymbol_text (ffebld_symter (ffebld_head (args
))));
5782 fputs (")=", dmpout
);
5784 fputc ('\n', dmpout
);
5785 #if 0 /* Normally no need to preserve the
5787 ffesymbol_set_sfexpr (s
, NULL
); /* Except expr.c sees NULL
5788 as recursive reference!
5789 So until we can use something
5790 convenient, like a "permanent"
5791 expression, don't worry about
5792 wasting some memory in the
5795 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5797 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5798 /* With gcc, cannot do anything here, because the backend hasn't even
5799 (necessarily) been notified that we're compiling a program unit! */
5801 #if 0 /* Must preserve the expression for gcc. */
5802 ffesymbol_set_sfexpr (s
, NULL
);
5804 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5811 /* ffestd_S3P4 -- INCLUDE line
5813 ffestd_S3P4(filename,filename_token);
5815 Make sure INCLUDE not preceded by any semicolons or a label def; implement. */
5818 ffestd_S3P4 (ffebld filename
)
5821 ffetargetCharacterDefault buildname
;
5824 ffestd_check_simple_ ();
5826 assert (filename
!= NULL
);
5827 if (ffebld_op (filename
) != FFEBLD_opANY
)
5829 assert (ffebld_op (filename
) == FFEBLD_opCONTER
);
5830 assert (ffeinfo_basictype (ffebld_info (filename
))
5831 == FFEINFO_basictypeCHARACTER
);
5832 assert (ffeinfo_kindtype (ffebld_info (filename
))
5833 == FFEINFO_kindtypeCHARACTERDEFAULT
);
5834 buildname
= ffebld_constant_characterdefault (ffebld_conter (filename
));
5835 wf
= ffewhere_file_new (ffetarget_text_characterdefault (buildname
),
5836 ffetarget_length_characterdefault (buildname
));
5837 fi
= ffecom_open_include (ffewhere_file_name (wf
),
5838 ffelex_token_where_line (ffesta_tokens
[0]),
5839 ffelex_token_where_column (ffesta_tokens
[0]));
5841 ffewhere_file_kill (wf
);
5843 ffelex_set_include (wf
, (ffelex_token_type (ffesta_tokens
[0])
5844 == FFELEX_typeNAME
), fi
);
5848 /* ffestd_V003_start -- STRUCTURE statement list begin
5850 ffestd_V003_start(structure_name);
5852 Verify that STRUCTURE is valid here, and begin accepting items in the list. */
5856 ffestd_V003_start (ffelexToken structure_name
)
5858 ffestd_check_start_ ();
5860 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5861 if (structure_name
== NULL
)
5862 fputs ("* STRUCTURE_unnamed ", dmpout
);
5864 fprintf (dmpout
, "* STRUCTURE %s ", ffelex_token_text (structure_name
));
5865 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5866 ffestd_subr_vxt_ ();
5872 /* ffestd_V003_item -- STRUCTURE statement for object-name
5874 ffestd_V003_item(name_token,dim_list);
5876 Make sure name_token identifies a valid object to be STRUCTUREd. */
5879 ffestd_V003_item (ffelexToken name
, ffesttDimList dims
)
5881 ffestd_check_item_ ();
5883 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5884 fputs (ffelex_token_text (name
), dmpout
);
5887 fputc ('(', dmpout
);
5888 ffestt_dimlist_dump (dims
);
5889 fputc (')', dmpout
);
5891 fputc (',', dmpout
);
5892 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5898 /* ffestd_V003_finish -- STRUCTURE statement list complete
5900 ffestd_V003_finish();
5902 Just wrap up any local activities. */
5905 ffestd_V003_finish ()
5907 ffestd_check_finish_ ();
5909 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5910 fputc ('\n', dmpout
);
5911 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5917 /* ffestd_V004 -- End a STRUCTURE
5919 ffestd_V004(TRUE); */
5922 ffestd_V004 (bool ok
)
5924 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5925 fputs ("* END_STRUCTURE\n", dmpout
);
5926 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5932 /* ffestd_V009 -- UNION statement
5939 ffestd_check_simple_ ();
5941 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5942 fputs ("* UNION\n", dmpout
);
5943 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5949 /* ffestd_V010 -- End a UNION
5951 ffestd_V010(TRUE); */
5954 ffestd_V010 (bool ok
)
5956 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5957 fputs ("* END_UNION\n", dmpout
);
5958 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5964 /* ffestd_V012 -- MAP statement
5971 ffestd_check_simple_ ();
5973 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5974 fputs ("* MAP\n", dmpout
);
5975 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5981 /* ffestd_V013 -- End a MAP
5983 ffestd_V013(TRUE); */
5986 ffestd_V013 (bool ok
)
5988 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5989 fputs ("* END_MAP\n", dmpout
);
5990 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5997 /* ffestd_V014_start -- VOLATILE statement list begin
5999 ffestd_V014_start();
6001 Verify that VOLATILE is valid here, and begin accepting items in the list. */
6004 ffestd_V014_start ()
6006 ffestd_check_start_ ();
6008 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6009 fputs ("* VOLATILE (", dmpout
);
6010 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6011 ffestd_subr_vxt_ ();
6017 /* ffestd_V014_item_object -- VOLATILE statement for object-name
6019 ffestd_V014_item_object(name_token);
6021 Make sure name_token identifies a valid object to be VOLATILEd. */
6024 ffestd_V014_item_object (ffelexToken name UNUSED
)
6026 ffestd_check_item_ ();
6028 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6029 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
6030 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6036 /* ffestd_V014_item_cblock -- VOLATILE statement for common-block-name
6038 ffestd_V014_item_cblock(name_token);
6040 Make sure name_token identifies a valid common block to be VOLATILEd. */
6043 ffestd_V014_item_cblock (ffelexToken name UNUSED
)
6045 ffestd_check_item_ ();
6047 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6048 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
6049 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6055 /* ffestd_V014_finish -- VOLATILE statement list complete
6057 ffestd_V014_finish();
6059 Just wrap up any local activities. */
6062 ffestd_V014_finish ()
6064 ffestd_check_finish_ ();
6066 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6067 fputs (")\n", dmpout
);
6068 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6074 /* ffestd_V016_start -- RECORD statement list begin
6076 ffestd_V016_start();
6078 Verify that RECORD is valid here, and begin accepting items in the list. */
6082 ffestd_V016_start ()
6084 ffestd_check_start_ ();
6086 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6087 fputs ("* RECORD ", dmpout
);
6088 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6089 ffestd_subr_vxt_ ();
6095 /* ffestd_V016_item_structure -- RECORD statement for common-block-name
6097 ffestd_V016_item_structure(name_token);
6099 Make sure name_token identifies a valid structure to be RECORDed. */
6102 ffestd_V016_item_structure (ffelexToken name
)
6104 ffestd_check_item_ ();
6106 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6107 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
6108 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6114 /* ffestd_V016_item_object -- RECORD statement for object-name
6116 ffestd_V016_item_object(name_token,dim_list);
6118 Make sure name_token identifies a valid object to be RECORDd. */
6121 ffestd_V016_item_object (ffelexToken name
, ffesttDimList dims
)
6123 ffestd_check_item_ ();
6125 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6126 fputs (ffelex_token_text (name
), dmpout
);
6129 fputc ('(', dmpout
);
6130 ffestt_dimlist_dump (dims
);
6131 fputc (')', dmpout
);
6133 fputc (',', dmpout
);
6134 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6140 /* ffestd_V016_finish -- RECORD statement list complete
6142 ffestd_V016_finish();
6144 Just wrap up any local activities. */
6147 ffestd_V016_finish ()
6149 ffestd_check_finish_ ();
6151 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6152 fputc ('\n', dmpout
);
6153 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6159 /* ffestd_V018_start -- REWRITE(...) statement list begin
6161 ffestd_V018_start();
6163 Verify that REWRITE is valid here, and begin accepting items in the
6167 ffestd_V018_start (ffestvFormat format
)
6169 ffestd_check_start_ ();
6171 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6174 ffestd_subr_line_now_ ();
6175 ffeste_V018_start (&ffestp_file
.rewrite
, format
);
6180 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV018_
);
6181 ffestd_stmt_append_ (stmt
);
6182 ffestd_subr_line_save_ (stmt
);
6183 stmt
->u
.V018
.pool
= ffesta_output_pool
;
6184 stmt
->u
.V018
.params
= ffestd_subr_copy_rewrite_ ();
6185 stmt
->u
.V018
.format
= format
;
6186 stmt
->u
.V018
.list
= NULL
;
6187 ffestd_expr_list_
= &stmt
->u
.V018
.list
;
6188 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6193 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6194 ffestd_subr_vxt_ ();
6198 /* ffestd_V018_item -- REWRITE statement i/o item
6200 ffestd_V018_item(expr,expr_token);
6202 Implement output-list expression. */
6205 ffestd_V018_item (ffebld expr
)
6207 ffestd_check_item_ ();
6209 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6212 ffeste_V018_item (expr
);
6215 ffestdExprItem_ item
6216 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6221 *ffestd_expr_list_
= item
;
6222 ffestd_expr_list_
= &item
->next
;
6227 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6231 /* ffestd_V018_finish -- REWRITE statement list complete
6233 ffestd_V018_finish();
6235 Just wrap up any local activities. */
6238 ffestd_V018_finish ()
6240 ffestd_check_finish_ ();
6242 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6245 ffeste_V018_finish ();
6247 /* Nothing to do, it's implicit. */
6251 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6255 /* ffestd_V019_start -- ACCEPT statement list begin
6257 ffestd_V019_start();
6259 Verify that ACCEPT is valid here, and begin accepting items in the
6263 ffestd_V019_start (ffestvFormat format
)
6265 ffestd_check_start_ ();
6267 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6270 ffestd_subr_line_now_ ();
6271 ffeste_V019_start (&ffestp_file
.accept
, format
);
6276 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV019_
);
6277 ffestd_stmt_append_ (stmt
);
6278 ffestd_subr_line_save_ (stmt
);
6279 stmt
->u
.V019
.pool
= ffesta_output_pool
;
6280 stmt
->u
.V019
.params
= ffestd_subr_copy_accept_ ();
6281 stmt
->u
.V019
.format
= format
;
6282 stmt
->u
.V019
.list
= NULL
;
6283 ffestd_expr_list_
= &stmt
->u
.V019
.list
;
6284 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6289 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6290 ffestd_subr_vxt_ ();
6294 /* ffestd_V019_item -- ACCEPT statement i/o item
6296 ffestd_V019_item(expr,expr_token);
6298 Implement output-list expression. */
6301 ffestd_V019_item (ffebld expr
)
6303 ffestd_check_item_ ();
6305 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6308 ffeste_V019_item (expr
);
6311 ffestdExprItem_ item
6312 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6317 *ffestd_expr_list_
= item
;
6318 ffestd_expr_list_
= &item
->next
;
6323 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6327 /* ffestd_V019_finish -- ACCEPT statement list complete
6329 ffestd_V019_finish();
6331 Just wrap up any local activities. */
6334 ffestd_V019_finish ()
6336 ffestd_check_finish_ ();
6338 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6341 ffeste_V019_finish ();
6343 /* Nothing to do, it's implicit. */
6347 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6352 /* ffestd_V020_start -- TYPE statement list begin
6354 ffestd_V020_start();
6356 Verify that TYPE is valid here, and begin accepting items in the
6360 ffestd_V020_start (ffestvFormat format UNUSED
)
6362 ffestd_check_start_ ();
6364 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6367 ffestd_subr_line_now_ ();
6368 ffeste_V020_start (&ffestp_file
.type
, format
);
6373 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV020_
);
6374 ffestd_stmt_append_ (stmt
);
6375 ffestd_subr_line_save_ (stmt
);
6376 stmt
->u
.V020
.pool
= ffesta_output_pool
;
6377 stmt
->u
.V020
.params
= ffestd_subr_copy_type_ ();
6378 stmt
->u
.V020
.format
= format
;
6379 stmt
->u
.V020
.list
= NULL
;
6380 ffestd_expr_list_
= &stmt
->u
.V020
.list
;
6381 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6386 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6387 ffestd_subr_vxt_ ();
6391 /* ffestd_V020_item -- TYPE statement i/o item
6393 ffestd_V020_item(expr,expr_token);
6395 Implement output-list expression. */
6398 ffestd_V020_item (ffebld expr UNUSED
)
6400 ffestd_check_item_ ();
6402 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6405 ffeste_V020_item (expr
);
6408 ffestdExprItem_ item
6409 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6414 *ffestd_expr_list_
= item
;
6415 ffestd_expr_list_
= &item
->next
;
6420 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6424 /* ffestd_V020_finish -- TYPE statement list complete
6426 ffestd_V020_finish();
6428 Just wrap up any local activities. */
6431 ffestd_V020_finish ()
6433 ffestd_check_finish_ ();
6435 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6438 ffeste_V020_finish ();
6440 /* Nothing to do, it's implicit. */
6444 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6448 /* ffestd_V021 -- DELETE statement
6452 Make sure a DELETE is valid in the current context, and implement it. */
6458 ffestd_check_simple_ ();
6460 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6463 ffestd_subr_line_now_ ();
6464 ffeste_V021 (&ffestp_file
.delete);
6469 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV021_
);
6470 ffestd_stmt_append_ (stmt
);
6471 ffestd_subr_line_save_ (stmt
);
6472 stmt
->u
.V021
.pool
= ffesta_output_pool
;
6473 stmt
->u
.V021
.params
= ffestd_subr_copy_delete_ ();
6474 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6479 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6480 ffestd_subr_vxt_ ();
6484 /* ffestd_V022 -- UNLOCK statement
6488 Make sure a UNLOCK is valid in the current context, and implement it. */
6493 ffestd_check_simple_ ();
6495 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6498 ffestd_subr_line_now_ ();
6499 ffeste_V022 (&ffestp_file
.beru
);
6504 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV022_
);
6505 ffestd_stmt_append_ (stmt
);
6506 ffestd_subr_line_save_ (stmt
);
6507 stmt
->u
.V022
.pool
= ffesta_output_pool
;
6508 stmt
->u
.V022
.params
= ffestd_subr_copy_beru_ ();
6509 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6514 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6515 ffestd_subr_vxt_ ();
6519 /* ffestd_V023_start -- ENCODE(...) statement list begin
6521 ffestd_V023_start();
6523 Verify that ENCODE is valid here, and begin accepting items in the
6527 ffestd_V023_start ()
6529 ffestd_check_start_ ();
6531 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6534 ffestd_subr_line_now_ ();
6535 ffeste_V023_start (&ffestp_file
.vxtcode
);
6540 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV023_
);
6541 ffestd_stmt_append_ (stmt
);
6542 ffestd_subr_line_save_ (stmt
);
6543 stmt
->u
.V023
.pool
= ffesta_output_pool
;
6544 stmt
->u
.V023
.params
= ffestd_subr_copy_vxtcode_ ();
6545 stmt
->u
.V023
.list
= NULL
;
6546 ffestd_expr_list_
= &stmt
->u
.V023
.list
;
6547 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6552 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6553 ffestd_subr_vxt_ ();
6557 /* ffestd_V023_item -- ENCODE statement i/o item
6559 ffestd_V023_item(expr,expr_token);
6561 Implement output-list expression. */
6564 ffestd_V023_item (ffebld expr
)
6566 ffestd_check_item_ ();
6568 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6571 ffeste_V023_item (expr
);
6574 ffestdExprItem_ item
6575 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6580 *ffestd_expr_list_
= item
;
6581 ffestd_expr_list_
= &item
->next
;
6586 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6590 /* ffestd_V023_finish -- ENCODE statement list complete
6592 ffestd_V023_finish();
6594 Just wrap up any local activities. */
6597 ffestd_V023_finish ()
6599 ffestd_check_finish_ ();
6601 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6604 ffeste_V023_finish ();
6606 /* Nothing to do, it's implicit. */
6610 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6614 /* ffestd_V024_start -- DECODE(...) statement list begin
6616 ffestd_V024_start();
6618 Verify that DECODE is valid here, and begin accepting items in the
6622 ffestd_V024_start ()
6624 ffestd_check_start_ ();
6626 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6629 ffestd_subr_line_now_ ();
6630 ffeste_V024_start (&ffestp_file
.vxtcode
);
6635 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV024_
);
6636 ffestd_stmt_append_ (stmt
);
6637 ffestd_subr_line_save_ (stmt
);
6638 stmt
->u
.V024
.pool
= ffesta_output_pool
;
6639 stmt
->u
.V024
.params
= ffestd_subr_copy_vxtcode_ ();
6640 stmt
->u
.V024
.list
= NULL
;
6641 ffestd_expr_list_
= &stmt
->u
.V024
.list
;
6642 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6647 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6648 ffestd_subr_vxt_ ();
6652 /* ffestd_V024_item -- DECODE statement i/o item
6654 ffestd_V024_item(expr,expr_token);
6656 Implement output-list expression. */
6659 ffestd_V024_item (ffebld expr
)
6661 ffestd_check_item_ ();
6663 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6666 ffeste_V024_item (expr
);
6669 ffestdExprItem_ item
6670 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6675 *ffestd_expr_list_
= item
;
6676 ffestd_expr_list_
= &item
->next
;
6681 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6685 /* ffestd_V024_finish -- DECODE statement list complete
6687 ffestd_V024_finish();
6689 Just wrap up any local activities. */
6692 ffestd_V024_finish ()
6694 ffestd_check_finish_ ();
6696 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6699 ffeste_V024_finish ();
6701 /* Nothing to do, it's implicit. */
6705 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6709 /* ffestd_V025_start -- DEFINEFILE statement list begin
6711 ffestd_V025_start();
6713 Verify that DEFINEFILE is valid here, and begin accepting items in the
6717 ffestd_V025_start ()
6719 ffestd_check_start_ ();
6721 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6724 ffestd_subr_line_now_ ();
6725 ffeste_V025_start ();
6730 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV025start_
);
6731 ffestd_stmt_append_ (stmt
);
6732 ffestd_subr_line_save_ (stmt
);
6733 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6738 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6739 ffestd_subr_vxt_ ();
6743 /* ffestd_V025_item -- DEFINE FILE statement item
6745 ffestd_V025_item(u,ut,m,mt,n,nt,asv,asvt);
6747 Implement item. Treat each item kind of like a separate statement,
6748 since there's really no need to treat them as an aggregate. */
6751 ffestd_V025_item (ffebld u
, ffebld m
, ffebld n
, ffebld asv
)
6753 ffestd_check_item_ ();
6755 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6758 ffeste_V025_item (u
, m
, n
, asv
);
6763 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV025item_
);
6764 ffestd_stmt_append_ (stmt
);
6765 stmt
->u
.V025item
.u
= u
;
6766 stmt
->u
.V025item
.m
= m
;
6767 stmt
->u
.V025item
.n
= n
;
6768 stmt
->u
.V025item
.asv
= asv
;
6773 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6777 /* ffestd_V025_finish -- DEFINE FILE statement list complete
6779 ffestd_V025_finish();
6781 Just wrap up any local activities. */
6784 ffestd_V025_finish ()
6786 ffestd_check_finish_ ();
6788 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6791 ffeste_V025_finish ();
6796 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV025finish_
);
6797 stmt
->u
.V025finish
.pool
= ffesta_output_pool
;
6798 ffestd_stmt_append_ (stmt
);
6803 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6807 /* ffestd_V026 -- FIND statement
6811 Make sure a FIND is valid in the current context, and implement it. */
6816 ffestd_check_simple_ ();
6818 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6821 ffestd_subr_line_now_ ();
6822 ffeste_V026 (&ffestp_file
.find
);
6827 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV026_
);
6828 ffestd_stmt_append_ (stmt
);
6829 ffestd_subr_line_save_ (stmt
);
6830 stmt
->u
.V026
.pool
= ffesta_output_pool
;
6831 stmt
->u
.V026
.params
= ffestd_subr_copy_find_ ();
6832 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6837 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6838 ffestd_subr_vxt_ ();
6843 /* ffestd_V027_start -- VXT PARAMETER statement list begin
6845 ffestd_V027_start();
6847 Verify that PARAMETER is valid here, and begin accepting items in the list. */
6850 ffestd_V027_start ()
6852 ffestd_check_start_ ();
6854 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6855 fputs ("* PARAMETER_vxt ", dmpout
);
6857 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6858 ffestd_subr_vxt_ ();
6863 /* ffestd_V027_item -- VXT PARAMETER statement assignment
6865 ffestd_V027_item(dest,dest_token,source,source_token);
6867 Make sure the source is a valid source for the destination; make the
6871 ffestd_V027_item (ffelexToken dest_token UNUSED
, ffebld source UNUSED
)
6873 ffestd_check_item_ ();
6875 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6876 fputs (ffelex_token_text (dest_token
), dmpout
);
6877 fputc ('=', dmpout
);
6878 ffebld_dump (source
);
6879 fputc (',', dmpout
);
6880 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6886 /* ffestd_V027_finish -- VXT PARAMETER statement list complete
6888 ffestd_V027_finish();
6890 Just wrap up any local activities. */
6893 ffestd_V027_finish ()
6895 ffestd_check_finish_ ();
6897 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6898 fputc ('\n', dmpout
);
6899 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6905 /* Any executable statement. */
6910 ffestd_check_simple_ ();
6913 ffestd_subr_line_now_ ();
6919 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR841_
);
6920 ffestd_stmt_append_ (stmt
);
6921 ffestd_subr_line_save_ (stmt
);