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 (burley@gnu.ai.mit.edu).
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
221 unsigned long casenum
;
236 ffelexToken start_token
;
238 ffelexToken end_token
;
240 ffelexToken incr_token
;
311 ffestpOpenStmt
*params
;
317 ffestpCloseStmt
*params
;
323 ffestpReadStmt
*params
;
329 ffestdExprItem_ list
;
335 ffestpWriteStmt
*params
;
339 ffestdExprItem_ list
;
345 ffestpPrintStmt
*params
;
347 ffestdExprItem_ list
;
353 ffestpBeruStmt
*params
;
359 ffestpBeruStmt
*params
;
365 ffestpBeruStmt
*params
;
371 ffestpInquireStmt
*params
;
378 ffestpInquireStmt
*params
;
379 ffestdExprItem_ list
;
410 ffestpRewriteStmt
*params
;
412 ffestdExprItem_ list
;
418 ffestpAcceptStmt
*params
;
420 ffestdExprItem_ list
;
427 ffestpTypeStmt
*params
;
429 ffestdExprItem_ list
;
436 ffestpDeleteStmt
*params
;
442 ffestpBeruStmt
*params
;
448 ffestpVxtcodeStmt
*params
;
449 ffestdExprItem_ list
;
455 ffestpVxtcodeStmt
*params
;
456 ffestdExprItem_ list
;
474 ffestpFindStmt
*params
;
484 /* Static objects accessed by functions in this module. */
486 static ffestdStatelet_ ffestd_statelet_
= FFESTD_stateletSIMPLE_
;
487 static int ffestd_block_level_
= 0; /* Block level for reachableness. */
488 static bool ffestd_is_reachable_
; /* Is the current stmt reachable? */
489 static ffelab ffestd_label_formatdef_
= NULL
;
491 static ffestdExprItem_
*ffestd_expr_list_
;
505 #if FFECOM_targetCURRENT == FFECOM_targetGCC
506 static int ffestd_2pass_entrypoints_
= 0; /* # ENTRY statements
510 /* Static functions (internal). */
513 static void ffestd_stmt_append_ (ffestdStmt_ stmt
);
514 static ffestdStmt_
ffestd_stmt_new_ (ffestdStmtId_ id
);
515 static void ffestd_stmt_pass_ (void);
517 #if FFESTD_COPY_EASY_ && FFECOM_TWOPASS
518 static ffestpInquireStmt
*ffestd_subr_copy_easy_ (ffestpInquireIx max
);
520 #if FFECOM_targetCURRENT == FFECOM_targetGCC
521 static void ffestd_subr_vxt_ (void);
524 static void ffestd_subr_f90_ (void);
526 static void ffestd_subr_labels_ (bool unexpected
);
527 static void ffestd_R1001dump_ (ffests s
, ffesttFormatList list
);
528 static void ffestd_R1001dump_1005_1_ (ffests s
, ffesttFormatList f
,
530 static void ffestd_R1001dump_1005_2_ (ffests s
, ffesttFormatList f
,
532 static void ffestd_R1001dump_1005_3_ (ffests s
, ffesttFormatList f
,
534 static void ffestd_R1001dump_1005_4_ (ffests s
, ffesttFormatList f
,
536 static void ffestd_R1001dump_1005_5_ (ffests s
, ffesttFormatList f
,
538 static void ffestd_R1001dump_1010_1_ (ffests s
, ffesttFormatList f
,
540 static void ffestd_R1001dump_1010_2_ (ffests s
, ffesttFormatList f
,
542 static void ffestd_R1001dump_1010_3_ (ffests s
, ffesttFormatList f
,
544 static void ffestd_R1001dump_1010_4_ (ffests s
, ffesttFormatList f
,
546 static void ffestd_R1001dump_1010_5_ (ffests s
, ffesttFormatList f
,
548 static void ffestd_R1001error_ (ffesttFormatList f
);
549 static void ffestd_R1001rtexpr_ (ffests s
, ffesttFormatList f
, ffebld expr
);
551 /* Internal macros. */
553 #if FFECOM_targetCURRENT == FFECOM_targetGCC
554 #define ffestd_subr_line_now_() \
555 ffeste_set_line (ffelex_token_where_filename (ffesta_tokens[0]), \
556 ffelex_token_where_filelinenum (ffesta_tokens[0]))
557 #define ffestd_subr_line_restore_(s) \
558 ffeste_set_line ((s)->filename, (s)->filelinenum)
559 #define ffestd_subr_line_save_(s) \
560 ((s)->filename = ffelex_token_where_filename (ffesta_tokens[0]), \
561 (s)->filelinenum = ffelex_token_where_filelinenum (ffesta_tokens[0]))
563 #define ffestd_subr_line_now_()
565 #define ffestd_subr_line_restore_(s)
566 #define ffestd_subr_line_save_(s)
567 #endif /* FFECOM_TWOPASS */
568 #endif /* FFECOM_targetCURRENT != FFECOM_targetGCC */
569 #define ffestd_check_simple_() \
570 assert(ffestd_statelet_ == FFESTD_stateletSIMPLE_)
571 #define ffestd_check_start_() \
572 assert(ffestd_statelet_ == FFESTD_stateletSIMPLE_); \
573 ffestd_statelet_ = FFESTD_stateletATTRIB_
574 #define ffestd_check_attrib_() \
575 assert(ffestd_statelet_ == FFESTD_stateletATTRIB_)
576 #define ffestd_check_item_() \
577 assert(ffestd_statelet_ == FFESTD_stateletATTRIB_ \
578 || ffestd_statelet_ == FFESTD_stateletITEM_); \
579 ffestd_statelet_ = FFESTD_stateletITEM_
580 #define ffestd_check_item_startvals_() \
581 assert(ffestd_statelet_ == FFESTD_stateletATTRIB_ \
582 || ffestd_statelet_ == FFESTD_stateletITEM_); \
583 ffestd_statelet_ = FFESTD_stateletITEMVALS_
584 #define ffestd_check_item_value_() \
585 assert(ffestd_statelet_ == FFESTD_stateletITEMVALS_)
586 #define ffestd_check_item_endvals_() \
587 assert(ffestd_statelet_ == FFESTD_stateletITEMVALS_); \
588 ffestd_statelet_ = FFESTD_stateletITEM_
589 #define ffestd_check_finish_() \
590 assert(ffestd_statelet_ == FFESTD_stateletATTRIB_ \
591 || ffestd_statelet_ == FFESTD_stateletITEM_); \
592 ffestd_statelet_ = FFESTD_stateletSIMPLE_
594 #if FFESTD_COPY_EASY_ && FFECOM_TWOPASS
595 #define ffestd_subr_copy_accept_() (ffestpAcceptStmt *) \
596 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_acceptix)
597 #define ffestd_subr_copy_beru_() (ffestpBeruStmt *) \
598 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_beruix)
599 #define ffestd_subr_copy_close_() (ffestpCloseStmt *) \
600 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_closeix)
601 #define ffestd_subr_copy_delete_() (ffestpDeleteStmt *) \
602 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_deleteix)
603 #define ffestd_subr_copy_find_() (ffestpFindStmt *) \
604 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_findix)
605 #define ffestd_subr_copy_inquire_() (ffestpInquireStmt *) \
606 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_inquireix)
607 #define ffestd_subr_copy_open_() (ffestpOpenStmt *) \
608 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_openix)
609 #define ffestd_subr_copy_print_() (ffestpPrintStmt *) \
610 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_printix)
611 #define ffestd_subr_copy_read_() (ffestpReadStmt *) \
612 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_readix)
613 #define ffestd_subr_copy_rewrite_() (ffestpRewriteStmt *) \
614 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_rewriteix)
615 #define ffestd_subr_copy_type_() (ffestpTypeStmt *) \
616 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_typeix)
617 #define ffestd_subr_copy_vxtcode_() (ffestpVxtcodeStmt *) \
618 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_vxtcodeix)
619 #define ffestd_subr_copy_write_() (ffestpWriteStmt *) \
620 ffestd_subr_copy_easy_((ffestpInquireIx) FFESTP_writeix)
623 /* ffestd_stmt_append_ -- Append statement to end of stmt list
625 ffestd_stmt_append_(ffestd_stmt_new_(FFESTD_stmtidR737A_)); */
629 ffestd_stmt_append_ (ffestdStmt_ stmt
)
631 stmt
->next
= (ffestdStmt_
) &ffestd_stmt_list_
.first
;
632 stmt
->previous
= ffestd_stmt_list_
.last
;
633 stmt
->next
->previous
= stmt
;
634 stmt
->previous
->next
= stmt
;
638 /* ffestd_stmt_new_ -- Make new statement with given id
641 stmt = ffestd_stmt_new_(FFESTD_stmtidR737A_); */
645 ffestd_stmt_new_ (ffestdStmtId_ id
)
649 stmt
= malloc_new_kp (ffe_pool_any_unit (), "ffestdStmt_", sizeof (*stmt
));
655 /* ffestd_stmt_pass_ -- Pass all statements on list to ffeste
657 ffestd_stmt_pass_(); */
664 ffestdExprItem_ expr
; /* For traversing lists. */
666 #if FFECOM_targetCURRENT == FFECOM_targetGCC
667 if (ffestd_2pass_entrypoints_
!= 0)
669 tree which
= ffecom_which_entrypoint_decl ();
673 int ents
= ffestd_2pass_entrypoints_
;
676 expand_start_case (0, which
, TREE_TYPE (which
), "entrypoint dispatch");
679 stmt
= ffestd_stmt_list_
.first
;
682 while (stmt
->id
!= FFESTD_stmtidR1226_
)
685 if (stmt
->u
.R1226
.entry
!= NULL
)
687 value
= build_int_2 (stmt
->u
.R1226
.entrynum
, 0);
688 /* Yes, we really want to build a null LABEL_DECL here and not
689 put it on any list. That's what pushcase wants, so that's
691 label
= build_decl (LABEL_DECL
, NULL_TREE
, NULL_TREE
);
693 pushok
= pushcase (value
, convert
, label
, &duplicate
);
694 assert (pushok
== 0);
696 label
= ffecom_temp_label ();
697 TREE_USED (label
) = 1;
701 ffesymbol_hook (stmt
->u
.R1226
.entry
).length_tree
= label
;
708 expand_end_case (which
);
713 for (stmt
= ffestd_stmt_list_
.first
;
714 stmt
!= (ffestdStmt_
) &ffestd_stmt_list_
.first
;
719 case FFESTD_stmtidENDDOLOOP_
:
720 ffestd_subr_line_restore_ (stmt
);
721 ffeste_do (stmt
->u
.enddoloop
.block
);
722 ffestw_kill (stmt
->u
.enddoloop
.block
);
725 case FFESTD_stmtidENDLOGIF_
:
726 ffestd_subr_line_restore_ (stmt
);
730 case FFESTD_stmtidEXECLABEL_
:
731 ffeste_labeldef_branch (stmt
->u
.execlabel
.label
);
734 case FFESTD_stmtidFORMATLABEL_
:
735 ffeste_labeldef_format (stmt
->u
.formatlabel
.label
);
738 case FFESTD_stmtidR737A_
:
739 ffestd_subr_line_restore_ (stmt
);
740 ffeste_R737A (stmt
->u
.R737A
.dest
, stmt
->u
.R737A
.source
);
741 malloc_pool_kill (stmt
->u
.R737A
.pool
);
744 case FFESTD_stmtidR803_
:
745 ffestd_subr_line_restore_ (stmt
);
746 ffeste_R803 (stmt
->u
.R803
.expr
);
747 malloc_pool_kill (stmt
->u
.R803
.pool
);
750 case FFESTD_stmtidR804_
:
751 ffestd_subr_line_restore_ (stmt
);
752 ffeste_R804 (stmt
->u
.R804
.expr
);
753 malloc_pool_kill (stmt
->u
.R804
.pool
);
756 case FFESTD_stmtidR805_
:
757 ffestd_subr_line_restore_ (stmt
);
761 case FFESTD_stmtidR806_
:
762 ffestd_subr_line_restore_ (stmt
);
766 case FFESTD_stmtidR807_
:
767 ffestd_subr_line_restore_ (stmt
);
768 ffeste_R807 (stmt
->u
.R807
.expr
);
769 malloc_pool_kill (stmt
->u
.R807
.pool
);
772 case FFESTD_stmtidR809_
:
773 ffestd_subr_line_restore_ (stmt
);
774 ffeste_R809 (stmt
->u
.R809
.block
, stmt
->u
.R809
.expr
);
775 malloc_pool_kill (stmt
->u
.R809
.pool
);
778 case FFESTD_stmtidR810_
:
779 ffestd_subr_line_restore_ (stmt
);
780 ffeste_R810 (stmt
->u
.R810
.block
, stmt
->u
.R810
.casenum
);
781 malloc_pool_kill (stmt
->u
.R810
.pool
);
784 case FFESTD_stmtidR811_
:
785 ffestd_subr_line_restore_ (stmt
);
786 ffeste_R811 (stmt
->u
.R811
.block
);
787 malloc_pool_kill (ffestw_select (stmt
->u
.R811
.block
)->pool
);
788 ffestw_kill (stmt
->u
.R811
.block
);
791 case FFESTD_stmtidR819A_
:
792 ffestd_subr_line_restore_ (stmt
);
793 ffeste_R819A (stmt
->u
.R819A
.block
, stmt
->u
.R819A
.label
,
795 stmt
->u
.R819A
.start
, stmt
->u
.R819A
.start_token
,
796 stmt
->u
.R819A
.end
, stmt
->u
.R819A
.end_token
,
797 stmt
->u
.R819A
.incr
, stmt
->u
.R819A
.incr_token
);
798 ffelex_token_kill (stmt
->u
.R819A
.start_token
);
799 ffelex_token_kill (stmt
->u
.R819A
.end_token
);
800 if (stmt
->u
.R819A
.incr_token
!= NULL
)
801 ffelex_token_kill (stmt
->u
.R819A
.incr_token
);
802 malloc_pool_kill (stmt
->u
.R819A
.pool
);
805 case FFESTD_stmtidR819B_
:
806 ffestd_subr_line_restore_ (stmt
);
807 ffeste_R819B (stmt
->u
.R819B
.block
, stmt
->u
.R819B
.label
,
809 malloc_pool_kill (stmt
->u
.R819B
.pool
);
812 case FFESTD_stmtidR825_
:
813 ffestd_subr_line_restore_ (stmt
);
817 case FFESTD_stmtidR834_
:
818 ffestd_subr_line_restore_ (stmt
);
819 ffeste_R834 (stmt
->u
.R834
.block
);
822 case FFESTD_stmtidR835_
:
823 ffestd_subr_line_restore_ (stmt
);
824 ffeste_R835 (stmt
->u
.R835
.block
);
827 case FFESTD_stmtidR836_
:
828 ffestd_subr_line_restore_ (stmt
);
829 ffeste_R836 (stmt
->u
.R836
.label
);
832 case FFESTD_stmtidR837_
:
833 ffestd_subr_line_restore_ (stmt
);
834 ffeste_R837 (stmt
->u
.R837
.labels
, stmt
->u
.R837
.count
,
836 malloc_pool_kill (stmt
->u
.R837
.pool
);
839 case FFESTD_stmtidR838_
:
840 ffestd_subr_line_restore_ (stmt
);
841 ffeste_R838 (stmt
->u
.R838
.label
, stmt
->u
.R838
.target
);
842 malloc_pool_kill (stmt
->u
.R838
.pool
);
845 case FFESTD_stmtidR839_
:
846 ffestd_subr_line_restore_ (stmt
);
847 ffeste_R839 (stmt
->u
.R839
.target
);
848 malloc_pool_kill (stmt
->u
.R839
.pool
);
851 case FFESTD_stmtidR840_
:
852 ffestd_subr_line_restore_ (stmt
);
853 ffeste_R840 (stmt
->u
.R840
.expr
, stmt
->u
.R840
.neg
, stmt
->u
.R840
.zero
,
855 malloc_pool_kill (stmt
->u
.R840
.pool
);
858 case FFESTD_stmtidR841_
:
859 ffestd_subr_line_restore_ (stmt
);
863 case FFESTD_stmtidR842_
:
864 ffestd_subr_line_restore_ (stmt
);
865 ffeste_R842 (stmt
->u
.R842
.expr
);
866 malloc_pool_kill (stmt
->u
.R842
.pool
);
869 case FFESTD_stmtidR843_
:
870 ffestd_subr_line_restore_ (stmt
);
871 ffeste_R843 (stmt
->u
.R843
.expr
);
872 malloc_pool_kill (stmt
->u
.R843
.pool
);
875 case FFESTD_stmtidR904_
:
876 ffestd_subr_line_restore_ (stmt
);
877 ffeste_R904 (stmt
->u
.R904
.params
);
878 malloc_pool_kill (stmt
->u
.R904
.pool
);
881 case FFESTD_stmtidR907_
:
882 ffestd_subr_line_restore_ (stmt
);
883 ffeste_R907 (stmt
->u
.R907
.params
);
884 malloc_pool_kill (stmt
->u
.R907
.pool
);
887 case FFESTD_stmtidR909_
:
888 ffestd_subr_line_restore_ (stmt
);
889 ffeste_R909_start (stmt
->u
.R909
.params
, stmt
->u
.R909
.only_format
,
890 stmt
->u
.R909
.unit
, stmt
->u
.R909
.format
,
891 stmt
->u
.R909
.rec
, stmt
->u
.R909
.key
);
892 for (expr
= stmt
->u
.R909
.list
; expr
!= NULL
; expr
= expr
->next
)
894 ffeste_R909_item (expr
->expr
, expr
->token
);
895 ffelex_token_kill (expr
->token
);
897 ffeste_R909_finish ();
898 malloc_pool_kill (stmt
->u
.R909
.pool
);
901 case FFESTD_stmtidR910_
:
902 ffestd_subr_line_restore_ (stmt
);
903 ffeste_R910_start (stmt
->u
.R910
.params
, stmt
->u
.R910
.unit
,
904 stmt
->u
.R910
.format
, stmt
->u
.R910
.rec
);
905 for (expr
= stmt
->u
.R910
.list
; expr
!= NULL
; expr
= expr
->next
)
907 ffeste_R910_item (expr
->expr
, expr
->token
);
908 ffelex_token_kill (expr
->token
);
910 ffeste_R910_finish ();
911 malloc_pool_kill (stmt
->u
.R910
.pool
);
914 case FFESTD_stmtidR911_
:
915 ffestd_subr_line_restore_ (stmt
);
916 ffeste_R911_start (stmt
->u
.R911
.params
, stmt
->u
.R911
.format
);
917 for (expr
= stmt
->u
.R911
.list
; expr
!= NULL
; expr
= expr
->next
)
919 ffeste_R911_item (expr
->expr
, expr
->token
);
920 ffelex_token_kill (expr
->token
);
922 ffeste_R911_finish ();
923 malloc_pool_kill (stmt
->u
.R911
.pool
);
926 case FFESTD_stmtidR919_
:
927 ffestd_subr_line_restore_ (stmt
);
928 ffeste_R919 (stmt
->u
.R919
.params
);
929 malloc_pool_kill (stmt
->u
.R919
.pool
);
932 case FFESTD_stmtidR920_
:
933 ffestd_subr_line_restore_ (stmt
);
934 ffeste_R920 (stmt
->u
.R920
.params
);
935 malloc_pool_kill (stmt
->u
.R920
.pool
);
938 case FFESTD_stmtidR921_
:
939 ffestd_subr_line_restore_ (stmt
);
940 ffeste_R921 (stmt
->u
.R921
.params
);
941 malloc_pool_kill (stmt
->u
.R921
.pool
);
944 case FFESTD_stmtidR923A_
:
945 ffestd_subr_line_restore_ (stmt
);
946 ffeste_R923A (stmt
->u
.R923A
.params
, stmt
->u
.R923A
.by_file
);
947 malloc_pool_kill (stmt
->u
.R923A
.pool
);
950 case FFESTD_stmtidR923B_
:
951 ffestd_subr_line_restore_ (stmt
);
952 ffeste_R923B_start (stmt
->u
.R923B
.params
);
953 for (expr
= stmt
->u
.R923B
.list
; expr
!= NULL
; expr
= expr
->next
)
954 ffeste_R923B_item (expr
->expr
);
955 ffeste_R923B_finish ();
956 malloc_pool_kill (stmt
->u
.R923B
.pool
);
959 case FFESTD_stmtidR1001_
:
960 ffeste_R1001 (&stmt
->u
.R1001
.str
);
961 ffests_kill (&stmt
->u
.R1001
.str
);
964 case FFESTD_stmtidR1103_
:
968 case FFESTD_stmtidR1112_
:
972 case FFESTD_stmtidR1212_
:
973 ffestd_subr_line_restore_ (stmt
);
974 ffeste_R1212 (stmt
->u
.R1212
.expr
);
975 malloc_pool_kill (stmt
->u
.R1212
.pool
);
978 case FFESTD_stmtidR1221_
:
982 case FFESTD_stmtidR1225_
:
986 case FFESTD_stmtidR1226_
:
987 ffestd_subr_line_restore_ (stmt
);
988 if (stmt
->u
.R1226
.entry
!= NULL
)
989 ffeste_R1226 (stmt
->u
.R1226
.entry
);
992 case FFESTD_stmtidR1227_
:
993 ffestd_subr_line_restore_ (stmt
);
994 ffeste_R1227 (stmt
->u
.R1227
.block
, stmt
->u
.R1227
.expr
);
995 malloc_pool_kill (stmt
->u
.R1227
.pool
);
999 case FFESTD_stmtidV018_
:
1000 ffestd_subr_line_restore_ (stmt
);
1001 ffeste_V018_start (stmt
->u
.V018
.params
, stmt
->u
.V018
.format
);
1002 for (expr
= stmt
->u
.V018
.list
; expr
!= NULL
; expr
= expr
->next
)
1003 ffeste_V018_item (expr
->expr
);
1004 ffeste_V018_finish ();
1005 malloc_pool_kill (stmt
->u
.V018
.pool
);
1008 case FFESTD_stmtidV019_
:
1009 ffestd_subr_line_restore_ (stmt
);
1010 ffeste_V019_start (stmt
->u
.V019
.params
, stmt
->u
.V019
.format
);
1011 for (expr
= stmt
->u
.V019
.list
; expr
!= NULL
; expr
= expr
->next
)
1012 ffeste_V019_item (expr
->expr
);
1013 ffeste_V019_finish ();
1014 malloc_pool_kill (stmt
->u
.V019
.pool
);
1018 case FFESTD_stmtidV020_
:
1019 ffestd_subr_line_restore_ (stmt
);
1020 ffeste_V020_start (stmt
->u
.V020
.params
, stmt
->u
.V020
.format
);
1021 for (expr
= stmt
->u
.V020
.list
; expr
!= NULL
; expr
= expr
->next
)
1022 ffeste_V020_item (expr
->expr
);
1023 ffeste_V020_finish ();
1024 malloc_pool_kill (stmt
->u
.V020
.pool
);
1028 case FFESTD_stmtidV021_
:
1029 ffestd_subr_line_restore_ (stmt
);
1030 ffeste_V021 (stmt
->u
.V021
.params
);
1031 malloc_pool_kill (stmt
->u
.V021
.pool
);
1034 case FFESTD_stmtidV023_
:
1035 ffestd_subr_line_restore_ (stmt
);
1036 ffeste_V023_start (stmt
->u
.V023
.params
);
1037 for (expr
= stmt
->u
.V023
.list
; expr
!= NULL
; expr
= expr
->next
)
1038 ffeste_V023_item (expr
->expr
);
1039 ffeste_V023_finish ();
1040 malloc_pool_kill (stmt
->u
.V023
.pool
);
1043 case FFESTD_stmtidV024_
:
1044 ffestd_subr_line_restore_ (stmt
);
1045 ffeste_V024_start (stmt
->u
.V024
.params
);
1046 for (expr
= stmt
->u
.V024
.list
; expr
!= NULL
; expr
= expr
->next
)
1047 ffeste_V024_item (expr
->expr
);
1048 ffeste_V024_finish ();
1049 malloc_pool_kill (stmt
->u
.V024
.pool
);
1052 case FFESTD_stmtidV025start_
:
1053 ffestd_subr_line_restore_ (stmt
);
1054 ffeste_V025_start ();
1057 case FFESTD_stmtidV025item_
:
1058 ffeste_V025_item (stmt
->u
.V025item
.u
, stmt
->u
.V025item
.m
,
1059 stmt
->u
.V025item
.n
, stmt
->u
.V025item
.asv
);
1062 case FFESTD_stmtidV025finish_
:
1063 ffeste_V025_finish ();
1064 malloc_pool_kill (stmt
->u
.V025finish
.pool
);
1067 case FFESTD_stmtidV026_
:
1068 ffestd_subr_line_restore_ (stmt
);
1069 ffeste_V026 (stmt
->u
.V026
.params
);
1070 malloc_pool_kill (stmt
->u
.V026
.pool
);
1075 assert ("bad stmt->id" == NULL
);
1082 /* ffestd_subr_copy_easy_ -- Copy I/O statement data structure
1084 ffestd_subr_copy_easy_();
1086 Copies all data except tokens in the I/O data structure into a new
1087 structure that lasts as long as the output pool for the current
1088 statement. Assumes that they are
1089 overlaid with each other (union) in stp.h and the typing
1090 and structure references assume (though not necessarily dangerous if
1091 FALSE) that INQUIRE has the most file elements. */
1093 #if FFESTD_COPY_EASY_ && FFECOM_TWOPASS
1094 static ffestpInquireStmt
*
1095 ffestd_subr_copy_easy_ (ffestpInquireIx max
)
1097 ffestpInquireStmt
*stmt
;
1100 stmt
= (ffestpInquireStmt
*) malloc_new_kp (ffesta_output_pool
,
1101 "FFESTD easy", sizeof (ffestpFile
) * max
);
1103 for (ix
= 0; ix
< max
; ++ix
)
1105 if ((stmt
->inquire_spec
[ix
].kw_or_val_present
1106 = ffestp_file
.inquire
.inquire_spec
[ix
].kw_or_val_present
)
1107 && (stmt
->inquire_spec
[ix
].value_present
1108 = ffestp_file
.inquire
.inquire_spec
[ix
].value_present
))
1110 if ((stmt
->inquire_spec
[ix
].value_is_label
1111 = ffestp_file
.inquire
.inquire_spec
[ix
].value_is_label
))
1112 stmt
->inquire_spec
[ix
].u
.label
1113 = ffestp_file
.inquire
.inquire_spec
[ix
].u
.label
;
1115 stmt
->inquire_spec
[ix
].u
.expr
1116 = ffestp_file
.inquire
.inquire_spec
[ix
].u
.expr
;
1124 /* ffestd_subr_labels_ -- Handle any undefined labels
1126 ffestd_subr_labels_(FALSE);
1128 For every undefined label, generate an error message and either define
1129 label as a FORMAT() statement (for FORMAT labels) or as a STOP statement
1130 (for all other labels). */
1133 ffestd_subr_labels_ (bool unexpected
)
1140 undef
= ffelab_number () - ffestv_num_label_defines_
;
1142 for (h
= ffelab_handle_first (); h
!= NULL
; h
= ffelab_handle_next (h
))
1144 l
= ffelab_handle_target (h
);
1145 if (ffewhere_line_is_unknown (ffelab_definition_line (l
)))
1146 { /* Undefined label. */
1147 assert (!unexpected
);
1150 ffebad_start (FFEBAD_UNDEF_LABEL
);
1151 if (ffelab_type (l
) == FFELAB_typeLOOPEND
)
1152 ffebad_here (0, ffelab_doref_line (l
), ffelab_doref_column (l
));
1153 else if (ffelab_type (l
) != FFELAB_typeANY
)
1154 ffebad_here (0, ffelab_firstref_line (l
), ffelab_firstref_column (l
));
1155 else if (!ffewhere_line_is_unknown (ffelab_firstref_line (l
)))
1156 ffebad_here (0, ffelab_firstref_line (l
), ffelab_firstref_column (l
));
1157 else if (!ffewhere_line_is_unknown (ffelab_doref_line (l
)))
1158 ffebad_here (0, ffelab_doref_line (l
), ffelab_doref_column (l
));
1160 ffebad_here (0, ffelab_definition_line (l
), ffelab_definition_column (l
));
1163 switch (ffelab_type (l
))
1165 case FFELAB_typeFORMAT
:
1166 ffelab_set_definition_line (l
,
1167 ffewhere_line_use (ffelab_firstref_line (l
)));
1168 ffelab_set_definition_column (l
,
1169 ffewhere_column_use (ffelab_firstref_column (l
)));
1170 ffestv_num_label_defines_
++;
1171 f
= ffestt_formatlist_create (NULL
, NULL
);
1172 ffestd_labeldef_format (l
);
1174 ffestt_formatlist_kill (f
);
1177 case FFELAB_typeASSIGNABLE
:
1178 ffelab_set_definition_line (l
,
1179 ffewhere_line_use (ffelab_firstref_line (l
)));
1180 ffelab_set_definition_column (l
,
1181 ffewhere_column_use (ffelab_firstref_column (l
)));
1182 ffestv_num_label_defines_
++;
1183 ffelab_set_type (l
, FFELAB_typeNOTLOOP
);
1184 ffelab_set_blocknum (l
, ffestw_blocknum (ffestw_stack_top ()));
1185 ffestd_labeldef_notloop (l
);
1189 case FFELAB_typeNOTLOOP
:
1190 ffelab_set_definition_line (l
,
1191 ffewhere_line_use (ffelab_firstref_line (l
)));
1192 ffelab_set_definition_column (l
,
1193 ffewhere_column_use (ffelab_firstref_column (l
)));
1194 ffestv_num_label_defines_
++;
1195 ffelab_set_blocknum (l
, ffestw_blocknum (ffestw_stack_top ()));
1196 ffestd_labeldef_notloop (l
);
1201 assert ("bad label type" == NULL
);
1203 case FFELAB_typeUNKNOWN
:
1204 case FFELAB_typeANY
:
1209 ffelab_handle_done (h
);
1210 assert (undef
== 0);
1213 /* ffestd_subr_f90_ -- Report error about lack of full F90 support
1215 ffestd_subr_f90_(); */
1221 ffebad_start (FFEBAD_F90
);
1222 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
1223 ffelex_token_where_column (ffesta_tokens
[0]));
1228 /* ffestd_subr_vxt_ -- Report error about lack of full VXT support
1230 ffestd_subr_vxt_(); */
1232 #if FFECOM_targetCURRENT == FFECOM_targetGCC
1236 ffebad_start (FFEBAD_VXT_UNSUPPORTED
);
1237 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
1238 ffelex_token_where_column (ffesta_tokens
[0]));
1243 /* ffestd_begin_uses -- Start a bunch of USE statements
1245 ffestd_begin_uses();
1247 Invoked before handling the first USE statement in a block of one or
1248 more USE statements. _end_uses_(bool ok) is invoked before handling
1249 the first statement after the block (there are no BEGIN USE and END USE
1250 statements, but the semantics of USE statements effectively requires
1251 handling them as a single block rather than one statement at a time). */
1254 ffestd_begin_uses ()
1256 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1257 fputs ("; begin_uses\n", dmpout
);
1258 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1264 /* ffestd_do -- End of statement following DO-term-stmt etc
1268 Also invoked by _labeldef_branch_finish_ (or, in cases
1269 of errors, other _labeldef_ functions) when the label definition is
1270 for a DO-target (LOOPEND) label, once per matching/outstanding DO
1271 block on the stack. These cases invoke this function with ok==TRUE, so
1272 only forced stack popping (via ffestd_eof_()) invokes it with ok==FALSE. */
1275 ffestd_do (bool ok UNUSED
)
1278 ffestd_subr_line_now_ ();
1279 ffeste_do (ffestw_stack_top ());
1284 stmt
= ffestd_stmt_new_ (FFESTD_stmtidENDDOLOOP_
);
1285 ffestd_stmt_append_ (stmt
);
1286 ffestd_subr_line_save_ (stmt
);
1287 stmt
->u
.enddoloop
.block
= ffestw_stack_top ();
1291 --ffestd_block_level_
;
1292 assert (ffestd_block_level_
>= 0);
1295 /* ffestd_end_uses -- End a bunch of USE statements
1297 ffestd_end_uses(TRUE);
1299 ok==TRUE means simply not popping due to ffestd_eof_()
1300 being called, because there is no formal END USES statement in Fortran. */
1304 ffestd_end_uses (bool ok
)
1306 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1307 fputs ("; end_uses\n", dmpout
);
1308 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1314 /* ffestd_end_R740 -- End a WHERE(-THEN)
1316 ffestd_end_R740(TRUE); */
1319 ffestd_end_R740 (bool ok
)
1325 /* ffestd_end_R807 -- End of statement following logical IF
1327 ffestd_end_R807(TRUE);
1329 Applies ONLY to logical IF, not to IF-THEN. For example, does not
1330 ffelex_token_kill the construct name for an IF-THEN block (the name
1331 field is invalid for logical IF). ok==TRUE iff statement following
1332 logical IF (substatement) is valid; else, statement is invalid or
1333 stack forcibly popped due to ffestd_eof_(). */
1336 ffestd_end_R807 (bool ok UNUSED
)
1339 ffestd_subr_line_now_ ();
1345 stmt
= ffestd_stmt_new_ (FFESTD_stmtidENDLOGIF_
);
1346 ffestd_stmt_append_ (stmt
);
1347 ffestd_subr_line_save_ (stmt
);
1351 --ffestd_block_level_
;
1352 assert (ffestd_block_level_
>= 0);
1355 /* ffestd_exec_begin -- Executable statements can start coming in now
1357 ffestd_exec_begin(); */
1360 ffestd_exec_begin ()
1362 ffecom_exec_transition ();
1364 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1365 fputs ("{ begin_exec\n", dmpout
);
1368 #if FFECOM_targetCURRENT == FFECOM_targetGCC
1369 if (ffestd_2pass_entrypoints_
!= 0)
1370 { /* Process pending ENTRY statements now that
1373 int ents
= ffestd_2pass_entrypoints_
;
1375 stmt
= ffestd_stmt_list_
.first
;
1378 while (stmt
->id
!= FFESTD_stmtidR1226_
)
1381 if (!ffecom_2pass_advise_entrypoint (stmt
->u
.R1226
.entry
))
1383 stmt
->u
.R1226
.entry
= NULL
;
1384 --ffestd_2pass_entrypoints_
;
1388 while (--ents
!= 0);
1393 /* ffestd_exec_end -- Executable statements can no longer come in now
1395 ffestd_exec_end(); */
1400 #if FFECOM_targetCURRENT == FFECOM_targetGCC
1401 int old_lineno
= lineno
;
1402 char *old_input_filename
= input_filename
;
1405 ffecom_end_transition ();
1408 ffestd_stmt_pass_ ();
1411 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1412 fputs ("} end_exec\n", dmpout
);
1413 fputs ("> end_unit\n", dmpout
);
1416 #if FFECOM_targetCURRENT == FFECOM_targetGCC
1417 ffecom_finish_progunit ();
1419 if (ffestd_2pass_entrypoints_
!= 0)
1421 int ents
= ffestd_2pass_entrypoints_
;
1422 ffestdStmt_ stmt
= ffestd_stmt_list_
.first
;
1426 while (stmt
->id
!= FFESTD_stmtidR1226_
)
1429 if (stmt
->u
.R1226
.entry
!= NULL
)
1431 ffestd_subr_line_restore_ (stmt
);
1432 ffecom_2pass_do_entrypoint (stmt
->u
.R1226
.entry
);
1436 while (--ents
!= 0);
1439 ffestd_stmt_list_
.first
= NULL
;
1440 ffestd_stmt_list_
.last
= NULL
;
1441 ffestd_2pass_entrypoints_
= 0;
1443 lineno
= old_lineno
;
1444 input_filename
= old_input_filename
;
1448 /* ffestd_init_3 -- Initialize for any program unit
1456 ffestd_stmt_list_
.first
= (ffestdStmt_
) &ffestd_stmt_list_
.first
;
1457 ffestd_stmt_list_
.last
= (ffestdStmt_
) &ffestd_stmt_list_
.first
;
1461 /* Generate "code" for "any" label def. */
1464 ffestd_labeldef_any (ffelab label UNUSED
)
1466 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1467 fprintf (dmpout
, "; any_label_def %lu\n", ffelab_value (label
));
1468 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1474 /* ffestd_labeldef_branch -- Generate "code" for branch label def
1476 ffestd_labeldef_branch(label); */
1479 ffestd_labeldef_branch (ffelab label
)
1482 ffeste_labeldef_branch (label
);
1487 stmt
= ffestd_stmt_new_ (FFESTD_stmtidEXECLABEL_
);
1488 ffestd_stmt_append_ (stmt
);
1489 stmt
->u
.execlabel
.label
= label
;
1493 ffestd_is_reachable_
= TRUE
;
1496 /* ffestd_labeldef_format -- Generate "code" for FORMAT label def
1498 ffestd_labeldef_format(label); */
1501 ffestd_labeldef_format (ffelab label
)
1503 ffestd_label_formatdef_
= label
;
1506 ffeste_labeldef_format (label
);
1511 stmt
= ffestd_stmt_new_ (FFESTD_stmtidFORMATLABEL_
);
1512 ffestd_stmt_append_ (stmt
);
1513 stmt
->u
.formatlabel
.label
= label
;
1518 /* ffestd_labeldef_useless -- Generate "code" for useless label def
1520 ffestd_labeldef_useless(label); */
1523 ffestd_labeldef_useless (ffelab label UNUSED
)
1525 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1526 fprintf (dmpout
, "; useless_label_def %lu\n", ffelab_value (label
));
1527 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1533 /* ffestd_R423A -- PRIVATE statement (in R422 derived-type statement)
1541 ffestd_check_simple_ ();
1543 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1544 fputs ("* PRIVATE_derived_type\n", dmpout
);
1545 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1551 /* ffestd_R423B -- SEQUENCE statement (in R422 derived-type-stmt)
1558 ffestd_check_simple_ ();
1560 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1561 fputs ("* SEQUENCE_derived_type\n", dmpout
);
1562 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1568 /* ffestd_R424 -- derived-TYPE-def statement
1570 ffestd_R424(access_token,access_kw,name_token);
1572 Handle a derived-type definition. */
1575 ffestd_R424 (ffelexToken access
, ffestrOther access_kw
, ffelexToken name
)
1577 ffestd_check_simple_ ();
1579 ffestd_subr_f90_ ();
1586 fprintf (dmpout
, "* TYPE %s\n", ffelex_token_text (name
));
1591 case FFESTR_otherPUBLIC
:
1595 case FFESTR_otherPRIVATE
:
1602 fprintf (dmpout
, "* TYPE,%s: %s\n", a
, ffelex_token_text (name
));
1607 /* ffestd_R425 -- End a TYPE
1609 ffestd_R425(TRUE); */
1612 ffestd_R425 (bool ok
)
1614 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1615 fprintf (dmpout
, "* END_TYPE %s\n", ffelex_token_text (ffestw_name (ffestw_stack_top ())));
1616 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1622 /* ffestd_R519_start -- INTENT statement list begin
1624 ffestd_R519_start();
1626 Verify that INTENT is valid here, and begin accepting items in the list. */
1629 ffestd_R519_start (ffestrOther intent_kw
)
1631 ffestd_check_start_ ();
1633 ffestd_subr_f90_ ();
1641 case FFESTR_otherIN
:
1645 case FFESTR_otherOUT
:
1649 case FFESTR_otherINOUT
:
1656 fprintf (dmpout
, "* INTENT (%s) ", a
);
1660 /* ffestd_R519_item -- INTENT statement for name
1662 ffestd_R519_item(name_token);
1664 Make sure name_token identifies a valid object to be INTENTed. */
1667 ffestd_R519_item (ffelexToken name
)
1669 ffestd_check_item_ ();
1674 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
1678 /* ffestd_R519_finish -- INTENT statement list complete
1680 ffestd_R519_finish();
1682 Just wrap up any local activities. */
1685 ffestd_R519_finish ()
1687 ffestd_check_finish_ ();
1692 fputc ('\n', dmpout
);
1696 /* ffestd_R520_start -- OPTIONAL statement list begin
1698 ffestd_R520_start();
1700 Verify that OPTIONAL is valid here, and begin accepting items in the list. */
1703 ffestd_R520_start ()
1705 ffestd_check_start_ ();
1707 ffestd_subr_f90_ ();
1711 fputs ("* OPTIONAL ", dmpout
);
1715 /* ffestd_R520_item -- OPTIONAL statement for name
1717 ffestd_R520_item(name_token);
1719 Make sure name_token identifies a valid object to be OPTIONALed. */
1722 ffestd_R520_item (ffelexToken name
)
1724 ffestd_check_item_ ();
1729 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
1733 /* ffestd_R520_finish -- OPTIONAL statement list complete
1735 ffestd_R520_finish();
1737 Just wrap up any local activities. */
1740 ffestd_R520_finish ()
1742 ffestd_check_finish_ ();
1747 fputc ('\n', dmpout
);
1751 /* ffestd_R521A -- PUBLIC statement
1755 Verify that PUBLIC is valid here. */
1760 ffestd_check_simple_ ();
1762 ffestd_subr_f90_ ();
1766 fputs ("* PUBLIC\n", dmpout
);
1770 /* ffestd_R521Astart -- PUBLIC statement list begin
1772 ffestd_R521Astart();
1774 Verify that PUBLIC is valid here, and begin accepting items in the list. */
1777 ffestd_R521Astart ()
1779 ffestd_check_start_ ();
1781 ffestd_subr_f90_ ();
1785 fputs ("* PUBLIC ", dmpout
);
1789 /* ffestd_R521Aitem -- PUBLIC statement for name
1791 ffestd_R521Aitem(name_token);
1793 Make sure name_token identifies a valid object to be PUBLICed. */
1796 ffestd_R521Aitem (ffelexToken name
)
1798 ffestd_check_item_ ();
1803 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
1807 /* ffestd_R521Afinish -- PUBLIC statement list complete
1809 ffestd_R521Afinish();
1811 Just wrap up any local activities. */
1814 ffestd_R521Afinish ()
1816 ffestd_check_finish_ ();
1821 fputc ('\n', dmpout
);
1825 /* ffestd_R521B -- PRIVATE statement
1829 Verify that PRIVATE is valid here (outside a derived-type statement). */
1834 ffestd_check_simple_ ();
1836 ffestd_subr_f90_ ();
1840 fputs ("* PRIVATE_outside_of_R422_derived_type_def\n", dmpout
);
1844 /* ffestd_R521Bstart -- PRIVATE statement list begin
1846 ffestd_R521Bstart();
1848 Verify that PRIVATE is valid here, and begin accepting items in the list. */
1851 ffestd_R521Bstart ()
1853 ffestd_check_start_ ();
1855 ffestd_subr_f90_ ();
1859 fputs ("* PRIVATE ", dmpout
);
1863 /* ffestd_R521Bitem -- PRIVATE statement for name
1865 ffestd_R521Bitem(name_token);
1867 Make sure name_token identifies a valid object to be PRIVATEed. */
1870 ffestd_R521Bitem (ffelexToken name
)
1872 ffestd_check_item_ ();
1877 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
1881 /* ffestd_R521Bfinish -- PRIVATE statement list complete
1883 ffestd_R521Bfinish();
1885 Just wrap up any local activities. */
1888 ffestd_R521Bfinish ()
1890 ffestd_check_finish_ ();
1895 fputc ('\n', dmpout
);
1900 /* ffestd_R522 -- SAVE statement with no list
1904 Verify that SAVE is valid here, and flag everything as SAVEd. */
1909 ffestd_check_simple_ ();
1911 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1912 fputs ("* SAVE_all\n", dmpout
);
1913 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1919 /* ffestd_R522start -- SAVE statement list begin
1923 Verify that SAVE is valid here, and begin accepting items in the list. */
1928 ffestd_check_start_ ();
1930 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1931 fputs ("* SAVE ", dmpout
);
1932 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1938 /* ffestd_R522item_object -- SAVE statement for object-name
1940 ffestd_R522item_object(name_token);
1942 Make sure name_token identifies a valid object to be SAVEd. */
1945 ffestd_R522item_object (ffelexToken name UNUSED
)
1947 ffestd_check_item_ ();
1949 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1950 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
1951 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1957 /* ffestd_R522item_cblock -- SAVE statement for common-block-name
1959 ffestd_R522item_cblock(name_token);
1961 Make sure name_token identifies a valid common block to be SAVEd. */
1964 ffestd_R522item_cblock (ffelexToken name UNUSED
)
1966 ffestd_check_item_ ();
1968 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1969 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
1970 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1976 /* ffestd_R522finish -- SAVE statement list complete
1978 ffestd_R522finish();
1980 Just wrap up any local activities. */
1983 ffestd_R522finish ()
1985 ffestd_check_finish_ ();
1987 #if FFECOM_targetCURRENT == FFECOM_targetFFE
1988 fputc ('\n', dmpout
);
1989 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
1995 /* ffestd_R524_start -- DIMENSION statement list begin
1997 ffestd_R524_start(bool virtual);
1999 Verify that DIMENSION is valid here, and begin accepting items in the list. */
2002 ffestd_R524_start (bool virtual UNUSED
)
2004 ffestd_check_start_ ();
2006 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2008 fputs ("* VIRTUAL ", dmpout
); /* V028. */
2010 fputs ("* DIMENSION ", dmpout
);
2011 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2017 /* ffestd_R524_item -- DIMENSION statement for object-name
2019 ffestd_R524_item(name_token,dim_list);
2021 Make sure name_token identifies a valid object to be DIMENSIONd. */
2024 ffestd_R524_item (ffelexToken name UNUSED
, ffesttDimList dims UNUSED
)
2026 ffestd_check_item_ ();
2028 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2029 fputs (ffelex_token_text (name
), dmpout
);
2030 fputc ('(', dmpout
);
2031 ffestt_dimlist_dump (dims
);
2032 fputs ("),", dmpout
);
2033 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2039 /* ffestd_R524_finish -- DIMENSION statement list complete
2041 ffestd_R524_finish();
2043 Just wrap up any local activities. */
2046 ffestd_R524_finish ()
2048 ffestd_check_finish_ ();
2050 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2051 fputc ('\n', dmpout
);
2052 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2058 /* ffestd_R525_start -- ALLOCATABLE statement list begin
2060 ffestd_R525_start();
2062 Verify that ALLOCATABLE is valid here, and begin accepting items in the
2067 ffestd_R525_start ()
2069 ffestd_check_start_ ();
2071 ffestd_subr_f90_ ();
2075 fputs ("* ALLOCATABLE ", dmpout
);
2079 /* ffestd_R525_item -- ALLOCATABLE statement for object-name
2081 ffestd_R525_item(name_token,dim_list);
2083 Make sure name_token identifies a valid object to be ALLOCATABLEd. */
2086 ffestd_R525_item (ffelexToken name
, ffesttDimList dims
)
2088 ffestd_check_item_ ();
2093 fputs (ffelex_token_text (name
), dmpout
);
2096 fputc ('(', dmpout
);
2097 ffestt_dimlist_dump (dims
);
2098 fputc (')', dmpout
);
2100 fputc (',', dmpout
);
2104 /* ffestd_R525_finish -- ALLOCATABLE statement list complete
2106 ffestd_R525_finish();
2108 Just wrap up any local activities. */
2111 ffestd_R525_finish ()
2113 ffestd_check_finish_ ();
2118 fputc ('\n', dmpout
);
2122 /* ffestd_R526_start -- POINTER statement list begin
2124 ffestd_R526_start();
2126 Verify that POINTER is valid here, and begin accepting items in the
2130 ffestd_R526_start ()
2132 ffestd_check_start_ ();
2134 ffestd_subr_f90_ ();
2138 fputs ("* POINTER ", dmpout
);
2142 /* ffestd_R526_item -- POINTER statement for object-name
2144 ffestd_R526_item(name_token,dim_list);
2146 Make sure name_token identifies a valid object to be POINTERd. */
2149 ffestd_R526_item (ffelexToken name
, ffesttDimList dims
)
2151 ffestd_check_item_ ();
2156 fputs (ffelex_token_text (name
), dmpout
);
2159 fputc ('(', dmpout
);
2160 ffestt_dimlist_dump (dims
);
2161 fputc (')', dmpout
);
2163 fputc (',', dmpout
);
2167 /* ffestd_R526_finish -- POINTER statement list complete
2169 ffestd_R526_finish();
2171 Just wrap up any local activities. */
2174 ffestd_R526_finish ()
2176 ffestd_check_finish_ ();
2181 fputc ('\n', dmpout
);
2185 /* ffestd_R527_start -- TARGET statement list begin
2187 ffestd_R527_start();
2189 Verify that TARGET is valid here, and begin accepting items in the
2193 ffestd_R527_start ()
2195 ffestd_check_start_ ();
2197 ffestd_subr_f90_ ();
2201 fputs ("* TARGET ", dmpout
);
2205 /* ffestd_R527_item -- TARGET statement for object-name
2207 ffestd_R527_item(name_token,dim_list);
2209 Make sure name_token identifies a valid object to be TARGETd. */
2212 ffestd_R527_item (ffelexToken name
, ffesttDimList dims
)
2214 ffestd_check_item_ ();
2219 fputs (ffelex_token_text (name
), dmpout
);
2222 fputc ('(', dmpout
);
2223 ffestt_dimlist_dump (dims
);
2224 fputc (')', dmpout
);
2226 fputc (',', dmpout
);
2230 /* ffestd_R527_finish -- TARGET statement list complete
2232 ffestd_R527_finish();
2234 Just wrap up any local activities. */
2237 ffestd_R527_finish ()
2239 ffestd_check_finish_ ();
2244 fputc ('\n', dmpout
);
2249 /* ffestd_R537_start -- PARAMETER statement list begin
2251 ffestd_R537_start();
2253 Verify that PARAMETER is valid here, and begin accepting items in the list. */
2256 ffestd_R537_start ()
2258 ffestd_check_start_ ();
2260 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2261 fputs ("* PARAMETER (", dmpout
);
2262 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2268 /* ffestd_R537_item -- PARAMETER statement assignment
2270 ffestd_R537_item(dest,dest_token,source,source_token);
2272 Make sure the source is a valid source for the destination; make the
2276 ffestd_R537_item (ffebld dest UNUSED
, ffebld source UNUSED
)
2278 ffestd_check_item_ ();
2280 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2282 fputc ('=', dmpout
);
2283 ffebld_dump (source
);
2284 fputc (',', dmpout
);
2285 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2291 /* ffestd_R537_finish -- PARAMETER statement list complete
2293 ffestd_R537_finish();
2295 Just wrap up any local activities. */
2298 ffestd_R537_finish ()
2300 ffestd_check_finish_ ();
2302 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2303 fputs (")\n", dmpout
);
2304 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2310 /* ffestd_R539 -- IMPLICIT NONE statement
2314 Verify that the IMPLICIT NONE statement is ok here and implement. */
2319 ffestd_check_simple_ ();
2321 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2322 fputs ("* IMPLICIT_NONE\n", dmpout
);
2323 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2329 /* ffestd_R539start -- IMPLICIT statement
2333 Verify that the IMPLICIT statement is ok here and implement. */
2338 ffestd_check_start_ ();
2340 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2341 fputs ("* IMPLICIT ", dmpout
);
2342 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2348 /* ffestd_R539item -- IMPLICIT statement specification (R540)
2350 ffestd_R539item(...);
2352 Verify that the type and letter list are all ok and implement. */
2355 ffestd_R539item (ffestpType type UNUSED
, ffebld kind UNUSED
,
2356 ffelexToken kindt UNUSED
, ffebld len UNUSED
,
2357 ffelexToken lent UNUSED
, ffesttImpList letters UNUSED
)
2359 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2363 ffestd_check_item_ ();
2365 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2368 case FFESTP_typeINTEGER
:
2372 case FFESTP_typeBYTE
:
2376 case FFESTP_typeWORD
:
2380 case FFESTP_typeREAL
:
2384 case FFESTP_typeCOMPLEX
:
2388 case FFESTP_typeLOGICAL
:
2392 case FFESTP_typeCHARACTER
:
2396 case FFESTP_typeDBLPRCSN
:
2397 a
= "DOUBLE PRECISION";
2400 case FFESTP_typeDBLCMPLX
:
2401 a
= "DOUBLE COMPLEX";
2405 case FFESTP_typeTYPE
:
2415 fprintf (dmpout
, "%s(", a
);
2418 fputs ("kind=", dmpout
);
2420 fputs (ffelex_token_text (kindt
), dmpout
);
2424 fputc (',', dmpout
);
2428 fputs ("len=", dmpout
);
2430 fputs (ffelex_token_text (lent
), dmpout
);
2434 fputs (")(", dmpout
);
2435 ffestt_implist_dump (letters
);
2436 fputs ("),", dmpout
);
2437 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2443 /* ffestd_R539finish -- IMPLICIT statement
2445 ffestd_R539finish();
2447 Finish up any local activities. */
2450 ffestd_R539finish ()
2452 ffestd_check_finish_ ();
2454 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2455 fputc ('\n', dmpout
);
2456 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2462 /* ffestd_R542_start -- NAMELIST statement list begin
2464 ffestd_R542_start();
2466 Verify that NAMELIST is valid here, and begin accepting items in the list. */
2469 ffestd_R542_start ()
2471 ffestd_check_start_ ();
2473 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2474 fputs ("* NAMELIST ", dmpout
);
2475 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2481 /* ffestd_R542_item_nlist -- NAMELIST statement for group-name
2483 ffestd_R542_item_nlist(groupname_token);
2485 Make sure name_token identifies a valid object to be NAMELISTd. */
2488 ffestd_R542_item_nlist (ffelexToken name UNUSED
)
2490 ffestd_check_item_ ();
2492 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2493 fprintf (dmpout
, "/%s/", ffelex_token_text (name
));
2494 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2500 /* ffestd_R542_item_nitem -- NAMELIST statement for variable-name
2502 ffestd_R542_item_nitem(name_token);
2504 Make sure name_token identifies a valid object to be NAMELISTd. */
2507 ffestd_R542_item_nitem (ffelexToken name UNUSED
)
2509 ffestd_check_item_ ();
2511 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2512 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
2513 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2519 /* ffestd_R542_finish -- NAMELIST statement list complete
2521 ffestd_R542_finish();
2523 Just wrap up any local activities. */
2526 ffestd_R542_finish ()
2528 ffestd_check_finish_ ();
2530 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2531 fputc ('\n', dmpout
);
2532 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2538 /* ffestd_R544_start -- EQUIVALENCE statement list begin
2540 ffestd_R544_start();
2542 Verify that EQUIVALENCE is valid here, and begin accepting items in the
2547 ffestd_R544_start ()
2549 ffestd_check_start_ ();
2551 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2552 fputs ("* EQUIVALENCE (", dmpout
);
2553 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2560 /* ffestd_R544_item -- EQUIVALENCE statement assignment
2562 ffestd_R544_item(exprlist);
2564 Make sure the equivalence is valid, then implement it. */
2568 ffestd_R544_item (ffesttExprList exprlist
)
2570 ffestd_check_item_ ();
2572 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2573 ffestt_exprlist_dump (exprlist
);
2574 fputs ("),", dmpout
);
2575 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2582 /* ffestd_R544_finish -- EQUIVALENCE statement list complete
2584 ffestd_R544_finish();
2586 Just wrap up any local activities. */
2590 ffestd_R544_finish ()
2592 ffestd_check_finish_ ();
2594 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2595 fputs (")\n", dmpout
);
2596 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2603 /* ffestd_R547_start -- COMMON statement list begin
2605 ffestd_R547_start();
2607 Verify that COMMON is valid here, and begin accepting items in the list. */
2610 ffestd_R547_start ()
2612 ffestd_check_start_ ();
2614 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2615 fputs ("* COMMON ", dmpout
);
2616 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2622 /* ffestd_R547_item_object -- COMMON statement for object-name
2624 ffestd_R547_item_object(name_token,dim_list);
2626 Make sure name_token identifies a valid object to be COMMONd. */
2629 ffestd_R547_item_object (ffelexToken name UNUSED
,
2630 ffesttDimList dims UNUSED
)
2632 ffestd_check_item_ ();
2634 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2635 fputs (ffelex_token_text (name
), dmpout
);
2638 fputc ('(', dmpout
);
2639 ffestt_dimlist_dump (dims
);
2640 fputc (')', dmpout
);
2642 fputc (',', dmpout
);
2643 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2649 /* ffestd_R547_item_cblock -- COMMON statement for common-block-name
2651 ffestd_R547_item_cblock(name_token);
2653 Make sure name_token identifies a valid common block to be COMMONd. */
2656 ffestd_R547_item_cblock (ffelexToken name UNUSED
)
2658 ffestd_check_item_ ();
2660 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2662 fputs ("//,", dmpout
);
2664 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
2665 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2671 /* ffestd_R547_finish -- COMMON statement list complete
2673 ffestd_R547_finish();
2675 Just wrap up any local activities. */
2678 ffestd_R547_finish ()
2680 ffestd_check_finish_ ();
2682 #if FFECOM_targetCURRENT == FFECOM_targetFFE
2683 fputc ('\n', dmpout
);
2684 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
2690 /* ffestd_R620 -- ALLOCATE statement
2692 ffestd_R620(exprlist,stat,stat_token);
2694 Make sure the expression list is valid, then implement it. */
2698 ffestd_R620 (ffesttExprList exprlist
, ffebld stat
)
2700 ffestd_check_simple_ ();
2702 ffestd_subr_f90_ ();
2706 fputs ("+ ALLOCATE (", dmpout
);
2707 ffestt_exprlist_dump (exprlist
);
2710 fputs (",stat=", dmpout
);
2713 fputs (")\n", dmpout
);
2717 /* ffestd_R624 -- NULLIFY statement
2719 ffestd_R624(pointer_name_list);
2721 Make sure pointer_name_list identifies valid pointers for a NULLIFY. */
2724 ffestd_R624 (ffesttExprList pointers
)
2726 ffestd_check_simple_ ();
2728 ffestd_subr_f90_ ();
2732 fputs ("+ NULLIFY (", dmpout
);
2733 assert (pointers
!= NULL
);
2734 ffestt_exprlist_dump (pointers
);
2735 fputs (")\n", dmpout
);
2739 /* ffestd_R625 -- DEALLOCATE statement
2741 ffestd_R625(exprlist,stat,stat_token);
2743 Make sure the equivalence is valid, then implement it. */
2746 ffestd_R625 (ffesttExprList exprlist
, ffebld stat
)
2748 ffestd_check_simple_ ();
2750 ffestd_subr_f90_ ();
2754 fputs ("+ DEALLOCATE (", dmpout
);
2755 ffestt_exprlist_dump (exprlist
);
2758 fputs (",stat=", dmpout
);
2761 fputs (")\n", dmpout
);
2766 /* ffestd_R737A -- Assignment statement outside of WHERE
2768 ffestd_R737A(dest_expr,source_expr); */
2771 ffestd_R737A (ffebld dest
, ffebld source
)
2773 ffestd_check_simple_ ();
2776 ffestd_subr_line_now_ ();
2777 ffeste_R737A (dest
, source
);
2782 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR737A_
);
2783 ffestd_stmt_append_ (stmt
);
2784 ffestd_subr_line_save_ (stmt
);
2785 stmt
->u
.R737A
.pool
= ffesta_output_pool
;
2786 stmt
->u
.R737A
.dest
= dest
;
2787 stmt
->u
.R737A
.source
= source
;
2788 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
2793 /* ffestd_R737B -- Assignment statement inside of WHERE
2795 ffestd_R737B(dest_expr,source_expr); */
2799 ffestd_R737B (ffebld dest
, ffebld source
)
2801 ffestd_check_simple_ ();
2806 fputs ("+ let_inside_where ", dmpout
);
2808 fputs ("=", dmpout
);
2809 ffebld_dump (source
);
2810 fputc ('\n', dmpout
);
2814 /* ffestd_R738 -- Pointer assignment statement
2816 ffestd_R738(dest_expr,source_expr,source_token);
2818 Make sure the assignment is valid. */
2821 ffestd_R738 (ffebld dest
, ffebld source
)
2823 ffestd_check_simple_ ();
2825 ffestd_subr_f90_ ();
2829 fputs ("+ let_pointer ", dmpout
);
2831 fputs ("=>", dmpout
);
2832 ffebld_dump (source
);
2833 fputc ('\n', dmpout
);
2837 /* ffestd_R740 -- WHERE statement
2839 ffestd_R740(expr,expr_token);
2841 Make sure statement is valid here; implement. */
2844 ffestd_R740 (ffebld expr
)
2846 ffestd_check_simple_ ();
2848 ffestd_subr_f90_ ();
2852 fputs ("+ WHERE (", dmpout
);
2854 fputs (")\n", dmpout
);
2856 ++ffestd_block_level_
;
2857 assert (ffestd_block_level_
> 0);
2861 /* ffestd_R742 -- WHERE-construct statement
2863 ffestd_R742(expr,expr_token);
2865 Make sure statement is valid here; implement. */
2868 ffestd_R742 (ffebld expr
)
2870 ffestd_check_simple_ ();
2872 ffestd_subr_f90_ ();
2876 fputs ("+ WHERE_construct (", dmpout
);
2878 fputs (")\n", dmpout
);
2880 ++ffestd_block_level_
;
2881 assert (ffestd_block_level_
> 0);
2885 /* ffestd_R744 -- ELSE WHERE statement
2889 Make sure ffestd_kind_ identifies a WHERE block.
2890 Implement the ELSE of the current WHERE block. */
2895 ffestd_check_simple_ ();
2900 fputs ("+ ELSE_WHERE\n", dmpout
);
2904 /* ffestd_R745 -- Implicit END WHERE statement
2908 Implement the end of the current WHERE "block". ok==TRUE iff statement
2909 following WHERE (substatement) is valid; else, statement is invalid
2910 or stack forcibly popped due to ffestd_eof_(). */
2913 ffestd_R745 (bool ok
)
2918 fputs ("+ END_WHERE\n", dmpout
); /* Also see ffestd_R745. */
2920 --ffestd_block_level_
;
2921 assert (ffestd_block_level_
>= 0);
2926 /* ffestd_R803 -- Block IF (IF-THEN) statement
2928 ffestd_R803(construct_name,expr,expr_token);
2930 Make sure statement is valid here; implement. */
2933 ffestd_R803 (ffelexToken construct_name UNUSED
, ffebld expr
)
2935 ffestd_check_simple_ ();
2938 ffestd_subr_line_now_ ();
2939 ffeste_R803 (expr
); /* Don't bother with name. */
2944 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR803_
);
2945 ffestd_stmt_append_ (stmt
);
2946 ffestd_subr_line_save_ (stmt
);
2947 stmt
->u
.R803
.pool
= ffesta_output_pool
;
2948 stmt
->u
.R803
.expr
= expr
;
2949 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
2953 ++ffestd_block_level_
;
2954 assert (ffestd_block_level_
> 0);
2957 /* ffestd_R804 -- ELSE IF statement
2959 ffestd_R804(expr,expr_token,name_token);
2961 Make sure ffestd_kind_ identifies an IF block. If not
2962 NULL, make sure name_token gives the correct name. Implement the else
2966 ffestd_R804 (ffebld expr
, ffelexToken name UNUSED
)
2968 ffestd_check_simple_ ();
2971 ffestd_subr_line_now_ ();
2972 ffeste_R804 (expr
); /* Don't bother with name. */
2977 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR804_
);
2978 ffestd_stmt_append_ (stmt
);
2979 ffestd_subr_line_save_ (stmt
);
2980 stmt
->u
.R804
.pool
= ffesta_output_pool
;
2981 stmt
->u
.R804
.expr
= expr
;
2982 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
2987 /* ffestd_R805 -- ELSE statement
2989 ffestd_R805(name_token);
2991 Make sure ffestd_kind_ identifies an IF block. If not
2992 NULL, make sure name_token gives the correct name. Implement the ELSE
2996 ffestd_R805 (ffelexToken name UNUSED
)
2998 ffestd_check_simple_ ();
3001 ffestd_subr_line_now_ ();
3002 ffeste_R805 (); /* Don't bother with name. */
3007 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR805_
);
3008 ffestd_stmt_append_ (stmt
);
3009 ffestd_subr_line_save_ (stmt
);
3014 /* ffestd_R806 -- End an IF-THEN
3016 ffestd_R806(TRUE); */
3019 ffestd_R806 (bool ok UNUSED
)
3022 ffestd_subr_line_now_ ();
3028 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR806_
);
3029 ffestd_stmt_append_ (stmt
);
3030 ffestd_subr_line_save_ (stmt
);
3034 --ffestd_block_level_
;
3035 assert (ffestd_block_level_
>= 0);
3038 /* ffestd_R807 -- Logical IF statement
3040 ffestd_R807(expr,expr_token);
3042 Make sure statement is valid here; implement. */
3045 ffestd_R807 (ffebld expr
)
3047 ffestd_check_simple_ ();
3050 ffestd_subr_line_now_ ();
3056 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR807_
);
3057 ffestd_stmt_append_ (stmt
);
3058 ffestd_subr_line_save_ (stmt
);
3059 stmt
->u
.R807
.pool
= ffesta_output_pool
;
3060 stmt
->u
.R807
.expr
= expr
;
3061 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3065 ++ffestd_block_level_
;
3066 assert (ffestd_block_level_
> 0);
3069 /* ffestd_R809 -- SELECT CASE statement
3071 ffestd_R809(construct_name,expr,expr_token);
3073 Make sure statement is valid here; implement. */
3076 ffestd_R809 (ffelexToken construct_name UNUSED
, ffebld expr
)
3078 ffestd_check_simple_ ();
3081 ffestd_subr_line_now_ ();
3082 ffeste_R809 (ffestw_stack_top (), expr
);
3087 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR809_
);
3088 ffestd_stmt_append_ (stmt
);
3089 ffestd_subr_line_save_ (stmt
);
3090 stmt
->u
.R809
.pool
= ffesta_output_pool
;
3091 stmt
->u
.R809
.block
= ffestw_use (ffestw_stack_top ());
3092 stmt
->u
.R809
.expr
= expr
;
3093 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3094 malloc_pool_use (ffestw_select (ffestw_stack_top ())->pool
);
3098 ++ffestd_block_level_
;
3099 assert (ffestd_block_level_
> 0);
3102 /* ffestd_R810 -- CASE statement
3104 ffestd_R810(case_value_range_list,name);
3106 If casenum is 0, it's CASE DEFAULT. Else it's the case ranges at
3107 the start of the first_stmt list in the select object at the top of
3108 the stack that match casenum. */
3111 ffestd_R810 (unsigned long casenum
)
3113 ffestd_check_simple_ ();
3116 ffestd_subr_line_now_ ();
3117 ffeste_R810 (ffestw_stack_top (), casenum
);
3122 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR810_
);
3123 ffestd_stmt_append_ (stmt
);
3124 ffestd_subr_line_save_ (stmt
);
3125 stmt
->u
.R810
.pool
= ffesta_output_pool
;
3126 stmt
->u
.R810
.block
= ffestw_stack_top ();
3127 stmt
->u
.R810
.casenum
= casenum
;
3128 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3133 /* ffestd_R811 -- End a SELECT
3135 ffestd_R811(TRUE); */
3138 ffestd_R811 (bool ok UNUSED
)
3141 ffestd_subr_line_now_ ();
3142 ffeste_R811 (ffestw_stack_top ());
3147 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR811_
);
3148 ffestd_stmt_append_ (stmt
);
3149 ffestd_subr_line_save_ (stmt
);
3150 stmt
->u
.R811
.block
= ffestw_stack_top ();
3154 --ffestd_block_level_
;
3155 assert (ffestd_block_level_
>= 0);
3158 /* ffestd_R819A -- Iterative DO statement
3160 ffestd_R819A(construct_name,label_token,expr,expr_token);
3162 Make sure statement is valid here; implement. */
3165 ffestd_R819A (ffelexToken construct_name UNUSED
, ffelab label
,
3166 ffebld var
, ffebld start
, ffelexToken start_token
,
3167 ffebld end
, ffelexToken end_token
,
3168 ffebld incr
, ffelexToken incr_token
)
3170 ffestd_check_simple_ ();
3173 ffestd_subr_line_now_ ();
3174 ffeste_R819A (ffestw_stack_top (), label
, var
, start
, end
, incr
,
3180 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR819A_
);
3181 ffestd_stmt_append_ (stmt
);
3182 ffestd_subr_line_save_ (stmt
);
3183 stmt
->u
.R819A
.pool
= ffesta_output_pool
;
3184 stmt
->u
.R819A
.block
= ffestw_use (ffestw_stack_top ());
3185 stmt
->u
.R819A
.label
= label
;
3186 stmt
->u
.R819A
.var
= var
;
3187 stmt
->u
.R819A
.start
= start
;
3188 stmt
->u
.R819A
.start_token
= ffelex_token_use (start_token
);
3189 stmt
->u
.R819A
.end
= end
;
3190 stmt
->u
.R819A
.end_token
= ffelex_token_use (end_token
);
3191 stmt
->u
.R819A
.incr
= incr
;
3192 stmt
->u
.R819A
.incr_token
= (incr_token
== NULL
) ? NULL
3193 : ffelex_token_use (incr_token
);
3194 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3198 ++ffestd_block_level_
;
3199 assert (ffestd_block_level_
> 0);
3202 /* ffestd_R819B -- DO WHILE statement
3204 ffestd_R819B(construct_name,label_token,expr,expr_token);
3206 Make sure statement is valid here; implement. */
3209 ffestd_R819B (ffelexToken construct_name UNUSED
, ffelab label
,
3212 ffestd_check_simple_ ();
3215 ffestd_subr_line_now_ ();
3216 ffeste_R819B (ffestw_stack_top (), label
, expr
);
3221 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR819B_
);
3222 ffestd_stmt_append_ (stmt
);
3223 ffestd_subr_line_save_ (stmt
);
3224 stmt
->u
.R819B
.pool
= ffesta_output_pool
;
3225 stmt
->u
.R819B
.block
= ffestw_use (ffestw_stack_top ());
3226 stmt
->u
.R819B
.label
= label
;
3227 stmt
->u
.R819B
.expr
= expr
;
3228 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3232 ++ffestd_block_level_
;
3233 assert (ffestd_block_level_
> 0);
3236 /* ffestd_R825 -- END DO statement
3238 ffestd_R825(name_token);
3240 Make sure ffestd_kind_ identifies a DO block. If not
3241 NULL, make sure name_token gives the correct name. Do whatever
3242 is specific to seeing END DO with a DO-target label definition on it,
3243 where the END DO is really treated as a CONTINUE (i.e. generate th
3244 same code you would for CONTINUE). ffestd_do handles the actual
3245 generation of end-loop code. */
3248 ffestd_R825 (ffelexToken name UNUSED
)
3250 ffestd_check_simple_ ();
3253 ffestd_subr_line_now_ ();
3259 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR825_
);
3260 ffestd_stmt_append_ (stmt
);
3261 ffestd_subr_line_save_ (stmt
);
3266 /* ffestd_R834 -- CYCLE statement
3268 ffestd_R834(name_token);
3270 Handle a CYCLE within a loop. */
3273 ffestd_R834 (ffestw block
)
3275 ffestd_check_simple_ ();
3278 ffestd_subr_line_now_ ();
3279 ffeste_R834 (block
);
3284 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR834_
);
3285 ffestd_stmt_append_ (stmt
);
3286 ffestd_subr_line_save_ (stmt
);
3287 stmt
->u
.R834
.block
= block
;
3292 /* ffestd_R835 -- EXIT statement
3294 ffestd_R835(name_token);
3296 Handle a EXIT within a loop. */
3299 ffestd_R835 (ffestw block
)
3301 ffestd_check_simple_ ();
3304 ffestd_subr_line_now_ ();
3305 ffeste_R835 (block
);
3310 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR835_
);
3311 ffestd_stmt_append_ (stmt
);
3312 ffestd_subr_line_save_ (stmt
);
3313 stmt
->u
.R835
.block
= block
;
3318 /* ffestd_R836 -- GOTO statement
3322 Make sure label_token identifies a valid label for a GOTO. Update
3323 that label's info to indicate it is the target of a GOTO. */
3326 ffestd_R836 (ffelab label
)
3328 ffestd_check_simple_ ();
3331 ffestd_subr_line_now_ ();
3332 ffeste_R836 (label
);
3337 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR836_
);
3338 ffestd_stmt_append_ (stmt
);
3339 ffestd_subr_line_save_ (stmt
);
3340 stmt
->u
.R836
.label
= label
;
3344 if (ffestd_block_level_
== 0)
3345 ffestd_is_reachable_
= FALSE
;
3348 /* ffestd_R837 -- Computed GOTO statement
3350 ffestd_R837(labels,expr);
3352 Make sure label_list identifies valid labels for a GOTO. Update
3353 each label's info to indicate it is the target of a GOTO. */
3356 ffestd_R837 (ffelab
*labels
, int count
, ffebld expr
)
3358 ffestd_check_simple_ ();
3361 ffestd_subr_line_now_ ();
3362 ffeste_R837 (labels
, count
, expr
);
3367 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR837_
);
3368 ffestd_stmt_append_ (stmt
);
3369 ffestd_subr_line_save_ (stmt
);
3370 stmt
->u
.R837
.pool
= ffesta_output_pool
;
3371 stmt
->u
.R837
.labels
= labels
;
3372 stmt
->u
.R837
.count
= count
;
3373 stmt
->u
.R837
.expr
= expr
;
3374 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3379 /* ffestd_R838 -- ASSIGN statement
3381 ffestd_R838(label_token,target_variable,target_token);
3383 Make sure label_token identifies a valid label for an assignment. Update
3384 that label's info to indicate it is the source of an assignment. Update
3385 target_variable's info to indicate it is the target the assignment of that
3389 ffestd_R838 (ffelab label
, ffebld target
)
3391 ffestd_check_simple_ ();
3394 ffestd_subr_line_now_ ();
3395 ffeste_R838 (label
, target
);
3400 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR838_
);
3401 ffestd_stmt_append_ (stmt
);
3402 ffestd_subr_line_save_ (stmt
);
3403 stmt
->u
.R838
.pool
= ffesta_output_pool
;
3404 stmt
->u
.R838
.label
= label
;
3405 stmt
->u
.R838
.target
= target
;
3406 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3411 /* ffestd_R839 -- Assigned GOTO statement
3413 ffestd_R839(target,labels);
3415 Make sure label_list identifies valid labels for a GOTO. Update
3416 each label's info to indicate it is the target of a GOTO. */
3419 ffestd_R839 (ffebld target
, ffelab
*labels UNUSED
, int count UNUSED
)
3421 ffestd_check_simple_ ();
3424 ffestd_subr_line_now_ ();
3425 ffeste_R839 (target
);
3430 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR839_
);
3431 ffestd_stmt_append_ (stmt
);
3432 ffestd_subr_line_save_ (stmt
);
3433 stmt
->u
.R839
.pool
= ffesta_output_pool
;
3434 stmt
->u
.R839
.target
= target
;
3435 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3439 if (ffestd_block_level_
== 0)
3440 ffestd_is_reachable_
= FALSE
;
3443 /* ffestd_R840 -- Arithmetic IF statement
3445 ffestd_R840(expr,expr_token,neg,zero,pos);
3447 Make sure the labels are valid; implement. */
3450 ffestd_R840 (ffebld expr
, ffelab neg
, ffelab zero
, ffelab pos
)
3452 ffestd_check_simple_ ();
3455 ffestd_subr_line_now_ ();
3456 ffeste_R840 (expr
, neg
, zero
, pos
);
3461 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR840_
);
3462 ffestd_stmt_append_ (stmt
);
3463 ffestd_subr_line_save_ (stmt
);
3464 stmt
->u
.R840
.pool
= ffesta_output_pool
;
3465 stmt
->u
.R840
.expr
= expr
;
3466 stmt
->u
.R840
.neg
= neg
;
3467 stmt
->u
.R840
.zero
= zero
;
3468 stmt
->u
.R840
.pos
= pos
;
3469 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3473 if (ffestd_block_level_
== 0)
3474 ffestd_is_reachable_
= FALSE
;
3477 /* ffestd_R841 -- CONTINUE statement
3482 ffestd_R841 (bool in_where UNUSED
)
3484 ffestd_check_simple_ ();
3487 ffestd_subr_line_now_ ();
3493 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR841_
);
3494 ffestd_stmt_append_ (stmt
);
3495 ffestd_subr_line_save_ (stmt
);
3500 /* ffestd_R842 -- STOP statement
3502 ffestd_R842(expr); */
3505 ffestd_R842 (ffebld expr
)
3507 ffestd_check_simple_ ();
3510 ffestd_subr_line_now_ ();
3516 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR842_
);
3517 ffestd_stmt_append_ (stmt
);
3518 ffestd_subr_line_save_ (stmt
);
3519 stmt
->u
.R842
.pool
= ffesta_output_pool
;
3520 stmt
->u
.R842
.expr
= expr
;
3521 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3525 if (ffestd_block_level_
== 0)
3526 ffestd_is_reachable_
= FALSE
;
3529 /* ffestd_R843 -- PAUSE statement
3531 ffestd_R843(expr,expr_token);
3533 Make sure statement is valid here; implement. expr and expr_token are
3534 both NULL if there was no expression. */
3537 ffestd_R843 (ffebld expr
)
3539 ffestd_check_simple_ ();
3542 ffestd_subr_line_now_ ();
3548 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR843_
);
3549 ffestd_stmt_append_ (stmt
);
3550 ffestd_subr_line_save_ (stmt
);
3551 stmt
->u
.R843
.pool
= ffesta_output_pool
;
3552 stmt
->u
.R843
.expr
= expr
;
3553 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3558 /* ffestd_R904 -- OPEN statement
3562 Make sure an OPEN is valid in the current context, and implement it. */
3567 ffestd_check_simple_ ();
3569 #if FFECOM_targetCURRENT == FFECOM_targetGCC
3570 #define specified(something) \
3571 (ffestp_file.open.open_spec[something].kw_or_val_present)
3573 /* Warn if there are any thing we don't handle via f2c libraries. */
3575 if (specified (FFESTP_openixACTION
)
3576 || specified (FFESTP_openixASSOCIATEVARIABLE
)
3577 || specified (FFESTP_openixBLOCKSIZE
)
3578 || specified (FFESTP_openixBUFFERCOUNT
)
3579 || specified (FFESTP_openixCARRIAGECONTROL
)
3580 || specified (FFESTP_openixDEFAULTFILE
)
3581 || specified (FFESTP_openixDELIM
)
3582 || specified (FFESTP_openixDISPOSE
)
3583 || specified (FFESTP_openixEXTENDSIZE
)
3584 || specified (FFESTP_openixINITIALSIZE
)
3585 || specified (FFESTP_openixKEY
)
3586 || specified (FFESTP_openixMAXREC
)
3587 || specified (FFESTP_openixNOSPANBLOCKS
)
3588 || specified (FFESTP_openixORGANIZATION
)
3589 || specified (FFESTP_openixPAD
)
3590 || specified (FFESTP_openixPOSITION
)
3591 || specified (FFESTP_openixREADONLY
)
3592 || specified (FFESTP_openixRECORDTYPE
)
3593 || specified (FFESTP_openixSHARED
)
3594 || specified (FFESTP_openixUSEROPEN
))
3596 ffebad_start (FFEBAD_OPEN_UNSUPPORTED
);
3597 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
3598 ffelex_token_where_column (ffesta_tokens
[0]));
3606 ffestd_subr_line_now_ ();
3607 ffeste_R904 (&ffestp_file
.open
);
3612 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR904_
);
3613 ffestd_stmt_append_ (stmt
);
3614 ffestd_subr_line_save_ (stmt
);
3615 stmt
->u
.R904
.pool
= ffesta_output_pool
;
3616 stmt
->u
.R904
.params
= ffestd_subr_copy_open_ ();
3617 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3622 /* ffestd_R907 -- CLOSE statement
3626 Make sure a CLOSE is valid in the current context, and implement it. */
3631 ffestd_check_simple_ ();
3634 ffestd_subr_line_now_ ();
3635 ffeste_R907 (&ffestp_file
.close
);
3640 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR907_
);
3641 ffestd_stmt_append_ (stmt
);
3642 ffestd_subr_line_save_ (stmt
);
3643 stmt
->u
.R907
.pool
= ffesta_output_pool
;
3644 stmt
->u
.R907
.params
= ffestd_subr_copy_close_ ();
3645 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3650 /* ffestd_R909_start -- READ(...) statement list begin
3652 ffestd_R909_start(FALSE);
3654 Verify that READ is valid here, and begin accepting items in the
3658 ffestd_R909_start (bool only_format
, ffestvUnit unit
,
3659 ffestvFormat format
, bool rec
, bool key
)
3661 ffestd_check_start_ ();
3663 #if FFECOM_targetCURRENT == FFECOM_targetGCC
3664 #define specified(something) \
3665 (ffestp_file.read.read_spec[something].kw_or_val_present)
3667 /* Warn if there are any thing we don't handle via f2c libraries. */
3668 if (specified (FFESTP_readixADVANCE
)
3669 || specified (FFESTP_readixEOR
)
3670 || specified (FFESTP_readixKEYEQ
)
3671 || specified (FFESTP_readixKEYGE
)
3672 || specified (FFESTP_readixKEYGT
)
3673 || specified (FFESTP_readixKEYID
)
3674 || specified (FFESTP_readixNULLS
)
3675 || specified (FFESTP_readixSIZE
))
3677 ffebad_start (FFEBAD_READ_UNSUPPORTED
);
3678 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
3679 ffelex_token_where_column (ffesta_tokens
[0]));
3687 ffestd_subr_line_now_ ();
3688 ffeste_R909_start (&ffestp_file
.read
, only_format
, unit
, format
, rec
, key
);
3693 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR909_
);
3694 ffestd_stmt_append_ (stmt
);
3695 ffestd_subr_line_save_ (stmt
);
3696 stmt
->u
.R909
.pool
= ffesta_output_pool
;
3697 stmt
->u
.R909
.params
= ffestd_subr_copy_read_ ();
3698 stmt
->u
.R909
.only_format
= only_format
;
3699 stmt
->u
.R909
.unit
= unit
;
3700 stmt
->u
.R909
.format
= format
;
3701 stmt
->u
.R909
.rec
= rec
;
3702 stmt
->u
.R909
.key
= key
;
3703 stmt
->u
.R909
.list
= NULL
;
3704 ffestd_expr_list_
= &stmt
->u
.R909
.list
;
3705 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3710 /* ffestd_R909_item -- READ statement i/o item
3712 ffestd_R909_item(expr,expr_token);
3714 Implement output-list expression. */
3717 ffestd_R909_item (ffebld expr
, ffelexToken expr_token
)
3719 ffestd_check_item_ ();
3722 ffeste_R909_item (expr
);
3725 ffestdExprItem_ item
3726 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
3731 item
->token
= ffelex_token_use (expr_token
);
3732 *ffestd_expr_list_
= item
;
3733 ffestd_expr_list_
= &item
->next
;
3738 /* ffestd_R909_finish -- READ statement list complete
3740 ffestd_R909_finish();
3742 Just wrap up any local activities. */
3745 ffestd_R909_finish ()
3747 ffestd_check_finish_ ();
3750 ffeste_R909_finish ();
3752 /* Nothing to do, it's implicit. */
3756 /* ffestd_R910_start -- WRITE(...) statement list begin
3758 ffestd_R910_start();
3760 Verify that WRITE is valid here, and begin accepting items in the
3764 ffestd_R910_start (ffestvUnit unit
, ffestvFormat format
, bool rec
)
3766 ffestd_check_start_ ();
3768 #if FFECOM_targetCURRENT == FFECOM_targetGCC
3769 #define specified(something) \
3770 (ffestp_file.write.write_spec[something].kw_or_val_present)
3772 /* Warn if there are any thing we don't handle via f2c libraries. */
3773 if (specified (FFESTP_writeixADVANCE
)
3774 || specified (FFESTP_writeixEOR
))
3776 ffebad_start (FFEBAD_WRITE_UNSUPPORTED
);
3777 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
3778 ffelex_token_where_column (ffesta_tokens
[0]));
3786 ffestd_subr_line_now_ ();
3787 ffeste_R910_start (&ffestp_file
.write
, unit
, format
, rec
);
3792 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR910_
);
3793 ffestd_stmt_append_ (stmt
);
3794 ffestd_subr_line_save_ (stmt
);
3795 stmt
->u
.R910
.pool
= ffesta_output_pool
;
3796 stmt
->u
.R910
.params
= ffestd_subr_copy_write_ ();
3797 stmt
->u
.R910
.unit
= unit
;
3798 stmt
->u
.R910
.format
= format
;
3799 stmt
->u
.R910
.rec
= rec
;
3800 stmt
->u
.R910
.list
= NULL
;
3801 ffestd_expr_list_
= &stmt
->u
.R910
.list
;
3802 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3807 /* ffestd_R910_item -- WRITE statement i/o item
3809 ffestd_R910_item(expr,expr_token);
3811 Implement output-list expression. */
3814 ffestd_R910_item (ffebld expr
, ffelexToken expr_token
)
3816 ffestd_check_item_ ();
3819 ffeste_R910_item (expr
);
3822 ffestdExprItem_ item
3823 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
3828 item
->token
= ffelex_token_use (expr_token
);
3829 *ffestd_expr_list_
= item
;
3830 ffestd_expr_list_
= &item
->next
;
3835 /* ffestd_R910_finish -- WRITE statement list complete
3837 ffestd_R910_finish();
3839 Just wrap up any local activities. */
3842 ffestd_R910_finish ()
3844 ffestd_check_finish_ ();
3847 ffeste_R910_finish ();
3849 /* Nothing to do, it's implicit. */
3853 /* ffestd_R911_start -- PRINT statement list begin
3855 ffestd_R911_start();
3857 Verify that PRINT is valid here, and begin accepting items in the
3861 ffestd_R911_start (ffestvFormat format
)
3863 ffestd_check_start_ ();
3866 ffestd_subr_line_now_ ();
3867 ffeste_R911_start (&ffestp_file
.print
, format
);
3872 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR911_
);
3873 ffestd_stmt_append_ (stmt
);
3874 ffestd_subr_line_save_ (stmt
);
3875 stmt
->u
.R911
.pool
= ffesta_output_pool
;
3876 stmt
->u
.R911
.params
= ffestd_subr_copy_print_ ();
3877 stmt
->u
.R911
.format
= format
;
3878 stmt
->u
.R911
.list
= NULL
;
3879 ffestd_expr_list_
= &stmt
->u
.R911
.list
;
3880 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3885 /* ffestd_R911_item -- PRINT statement i/o item
3887 ffestd_R911_item(expr,expr_token);
3889 Implement output-list expression. */
3892 ffestd_R911_item (ffebld expr
, ffelexToken expr_token
)
3894 ffestd_check_item_ ();
3897 ffeste_R911_item (expr
);
3900 ffestdExprItem_ item
3901 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
3906 item
->token
= ffelex_token_use (expr_token
);
3907 *ffestd_expr_list_
= item
;
3908 ffestd_expr_list_
= &item
->next
;
3913 /* ffestd_R911_finish -- PRINT statement list complete
3915 ffestd_R911_finish();
3917 Just wrap up any local activities. */
3920 ffestd_R911_finish ()
3922 ffestd_check_finish_ ();
3925 ffeste_R911_finish ();
3927 /* Nothing to do, it's implicit. */
3931 /* ffestd_R919 -- BACKSPACE statement
3935 Make sure a BACKSPACE is valid in the current context, and implement it. */
3940 ffestd_check_simple_ ();
3943 ffestd_subr_line_now_ ();
3944 ffeste_R919 (&ffestp_file
.beru
);
3949 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR919_
);
3950 ffestd_stmt_append_ (stmt
);
3951 ffestd_subr_line_save_ (stmt
);
3952 stmt
->u
.R919
.pool
= ffesta_output_pool
;
3953 stmt
->u
.R919
.params
= ffestd_subr_copy_beru_ ();
3954 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3959 /* ffestd_R920 -- ENDFILE statement
3963 Make sure a ENDFILE is valid in the current context, and implement it. */
3968 ffestd_check_simple_ ();
3971 ffestd_subr_line_now_ ();
3972 ffeste_R920 (&ffestp_file
.beru
);
3977 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR920_
);
3978 ffestd_stmt_append_ (stmt
);
3979 ffestd_subr_line_save_ (stmt
);
3980 stmt
->u
.R920
.pool
= ffesta_output_pool
;
3981 stmt
->u
.R920
.params
= ffestd_subr_copy_beru_ ();
3982 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
3987 /* ffestd_R921 -- REWIND statement
3991 Make sure a REWIND is valid in the current context, and implement it. */
3996 ffestd_check_simple_ ();
3999 ffestd_subr_line_now_ ();
4000 ffeste_R921 (&ffestp_file
.beru
);
4005 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR921_
);
4006 ffestd_stmt_append_ (stmt
);
4007 ffestd_subr_line_save_ (stmt
);
4008 stmt
->u
.R921
.pool
= ffesta_output_pool
;
4009 stmt
->u
.R921
.params
= ffestd_subr_copy_beru_ ();
4010 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
4015 /* ffestd_R923A -- INQUIRE statement (non-IOLENGTH version)
4017 ffestd_R923A(bool by_file);
4019 Make sure an INQUIRE is valid in the current context, and implement it. */
4022 ffestd_R923A (bool by_file
)
4024 ffestd_check_simple_ ();
4026 #if FFECOM_targetCURRENT == FFECOM_targetGCC
4027 #define specified(something) \
4028 (ffestp_file.inquire.inquire_spec[something].kw_or_val_present)
4030 /* Warn if there are any thing we don't handle via f2c libraries. */
4031 if (specified (FFESTP_inquireixACTION
)
4032 || specified (FFESTP_inquireixCARRIAGECONTROL
)
4033 || specified (FFESTP_inquireixDEFAULTFILE
)
4034 || specified (FFESTP_inquireixDELIM
)
4035 || specified (FFESTP_inquireixKEYED
)
4036 || specified (FFESTP_inquireixORGANIZATION
)
4037 || specified (FFESTP_inquireixPAD
)
4038 || specified (FFESTP_inquireixPOSITION
)
4039 || specified (FFESTP_inquireixREAD
)
4040 || specified (FFESTP_inquireixREADWRITE
)
4041 || specified (FFESTP_inquireixRECORDTYPE
)
4042 || specified (FFESTP_inquireixWRITE
))
4044 ffebad_start (FFEBAD_INQUIRE_UNSUPPORTED
);
4045 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
4046 ffelex_token_where_column (ffesta_tokens
[0]));
4054 ffestd_subr_line_now_ ();
4055 ffeste_R923A (&ffestp_file
.inquire
, by_file
);
4060 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR923A_
);
4061 ffestd_stmt_append_ (stmt
);
4062 ffestd_subr_line_save_ (stmt
);
4063 stmt
->u
.R923A
.pool
= ffesta_output_pool
;
4064 stmt
->u
.R923A
.params
= ffestd_subr_copy_inquire_ ();
4065 stmt
->u
.R923A
.by_file
= by_file
;
4066 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
4071 /* ffestd_R923B_start -- INQUIRE(IOLENGTH=expr) statement list begin
4073 ffestd_R923B_start();
4075 Verify that INQUIRE is valid here, and begin accepting items in the
4079 ffestd_R923B_start ()
4081 ffestd_check_start_ ();
4084 ffestd_subr_line_now_ ();
4085 ffeste_R923B_start (&ffestp_file
.inquire
);
4090 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR923B_
);
4091 ffestd_stmt_append_ (stmt
);
4092 ffestd_subr_line_save_ (stmt
);
4093 stmt
->u
.R923B
.pool
= ffesta_output_pool
;
4094 stmt
->u
.R923B
.params
= ffestd_subr_copy_inquire_ ();
4095 stmt
->u
.R923B
.list
= NULL
;
4096 ffestd_expr_list_
= &stmt
->u
.R923B
.list
;
4097 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
4102 /* ffestd_R923B_item -- INQUIRE statement i/o item
4104 ffestd_R923B_item(expr,expr_token);
4106 Implement output-list expression. */
4109 ffestd_R923B_item (ffebld expr
)
4111 ffestd_check_item_ ();
4114 ffeste_R923B_item (expr
);
4117 ffestdExprItem_ item
4118 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
4123 *ffestd_expr_list_
= item
;
4124 ffestd_expr_list_
= &item
->next
;
4129 /* ffestd_R923B_finish -- INQUIRE statement list complete
4131 ffestd_R923B_finish();
4133 Just wrap up any local activities. */
4136 ffestd_R923B_finish ()
4138 ffestd_check_finish_ ();
4141 ffeste_R923B_finish ();
4143 /* Nothing to do, it's implicit. */
4147 /* ffestd_R1001 -- FORMAT statement
4149 ffestd_R1001(format_list); */
4152 ffestd_R1001 (ffesttFormatList f
)
4157 ffestd_check_simple_ ();
4159 if (ffestd_label_formatdef_
== NULL
)
4160 return; /* Nothing to hook it up to (no label def). */
4162 ffests_new (s
, malloc_pool_image (), 80);
4163 ffests_putc (s
, '(');
4164 ffestd_R1001dump_ (s
, f
); /* Build the string in s. */
4165 ffests_putc (s
, ')');
4169 ffests_kill (s
); /* Kill the string in s. */
4174 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1001_
);
4175 ffestd_stmt_append_ (stmt
);
4176 stmt
->u
.R1001
.str
= str
;
4180 ffestd_label_formatdef_
= NULL
;
4183 /* ffestd_R1001dump_ -- Dump list of formats
4185 ffesttFormatList list;
4186 ffestd_R1001dump_(list,0);
4188 The formats in the list are dumped. */
4191 ffestd_R1001dump_ (ffests s
, ffesttFormatList list
)
4193 ffesttFormatList next
;
4195 for (next
= list
->next
; next
!= list
; next
= next
->next
)
4197 if (next
!= list
->next
)
4198 ffests_putc (s
, ',');
4201 case FFESTP_formattypeI
:
4202 ffestd_R1001dump_1005_3_ (s
, next
, "I");
4205 case FFESTP_formattypeB
:
4206 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4207 ffestd_R1001dump_1005_3_ (s
, next
, "B");
4208 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4209 ffestd_R1001error_ (next
);
4215 case FFESTP_formattypeO
:
4216 ffestd_R1001dump_1005_3_ (s
, next
, "O");
4219 case FFESTP_formattypeZ
:
4220 ffestd_R1001dump_1005_3_ (s
, next
, "Z");
4223 case FFESTP_formattypeF
:
4224 ffestd_R1001dump_1005_4_ (s
, next
, "F");
4227 case FFESTP_formattypeE
:
4228 ffestd_R1001dump_1005_5_ (s
, next
, "E");
4231 case FFESTP_formattypeEN
:
4232 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4233 ffestd_R1001dump_1005_5_ (s
, next
, "EN");
4234 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4235 ffestd_R1001error_ (next
);
4241 case FFESTP_formattypeG
:
4242 ffestd_R1001dump_1005_5_ (s
, next
, "G");
4245 case FFESTP_formattypeL
:
4246 ffestd_R1001dump_1005_2_ (s
, next
, "L");
4249 case FFESTP_formattypeA
:
4250 ffestd_R1001dump_1005_1_ (s
, next
, "A");
4253 case FFESTP_formattypeD
:
4254 ffestd_R1001dump_1005_4_ (s
, next
, "D");
4257 case FFESTP_formattypeQ
:
4258 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4259 ffestd_R1001dump_1010_1_ (s
, next
, "Q");
4260 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4261 ffestd_R1001error_ (next
);
4267 case FFESTP_formattypeDOLLAR
:
4268 ffestd_R1001dump_1010_1_ (s
, next
, "$");
4271 case FFESTP_formattypeP
:
4272 ffestd_R1001dump_1010_4_ (s
, next
, "P");
4275 case FFESTP_formattypeT
:
4276 ffestd_R1001dump_1010_5_ (s
, next
, "T");
4279 case FFESTP_formattypeTL
:
4280 ffestd_R1001dump_1010_5_ (s
, next
, "TL");
4283 case FFESTP_formattypeTR
:
4284 ffestd_R1001dump_1010_5_ (s
, next
, "TR");
4287 case FFESTP_formattypeX
:
4288 ffestd_R1001dump_1010_3_ (s
, next
, "X");
4291 case FFESTP_formattypeS
:
4292 ffestd_R1001dump_1010_1_ (s
, next
, "S");
4295 case FFESTP_formattypeSP
:
4296 ffestd_R1001dump_1010_1_ (s
, next
, "SP");
4299 case FFESTP_formattypeSS
:
4300 ffestd_R1001dump_1010_1_ (s
, next
, "SS");
4303 case FFESTP_formattypeBN
:
4304 ffestd_R1001dump_1010_1_ (s
, next
, "BN");
4307 case FFESTP_formattypeBZ
:
4308 ffestd_R1001dump_1010_1_ (s
, next
, "BZ");
4311 case FFESTP_formattypeSLASH
:
4312 ffestd_R1001dump_1010_2_ (s
, next
, "/");
4315 case FFESTP_formattypeCOLON
:
4316 ffestd_R1001dump_1010_1_ (s
, next
, ":");
4319 case FFESTP_formattypeR1016
:
4320 switch (ffelex_token_type (next
->t
))
4322 case FFELEX_typeCHARACTER
:
4324 char *p
= ffelex_token_text (next
->t
);
4325 ffeTokenLength i
= ffelex_token_length (next
->t
);
4327 ffests_putc (s
, '\002');
4331 ffests_putc (s
, '\002');
4332 ffests_putc (s
, *p
);
4335 ffests_putc (s
, '\002');
4339 case FFELEX_typeHOLLERITH
:
4341 char *p
= ffelex_token_text (next
->t
);
4342 ffeTokenLength i
= ffelex_token_length (next
->t
);
4344 ffests_printf_1U (s
,
4345 "%" ffeTokenLength_f
"uH",
4349 ffests_putc (s
, *p
);
4360 case FFESTP_formattypeFORMAT
:
4361 if (next
->u
.R1003D
.R1004
.present
)
4363 if (next
->u
.R1003D
.R1004
.rtexpr
)
4364 ffestd_R1001rtexpr_ (s
, next
, next
->u
.R1003D
.R1004
.u
.expr
);
4366 ffests_printf_1U (s
, "%lu",
4367 next
->u
.R1003D
.R1004
.u
.unsigned_val
);
4370 ffests_putc (s
, '(');
4371 ffestd_R1001dump_ (s
, next
->u
.R1003D
.format
);
4372 ffests_putc (s
, ')');
4381 /* ffestd_R1001dump_1005_1_ -- Dump a particular format
4384 ffestd_R1001dump_1005_1_(f,"I");
4386 The format is dumped with form [r]X[w]. */
4389 ffestd_R1001dump_1005_1_ (ffests s
, ffesttFormatList f
, char *string
)
4391 assert (!f
->u
.R1005
.R1007_or_R1008
.present
);
4392 assert (!f
->u
.R1005
.R1009
.present
);
4394 if (f
->u
.R1005
.R1004
.present
)
4396 if (f
->u
.R1005
.R1004
.rtexpr
)
4397 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4399 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4402 ffests_puts (s
, string
);
4404 if (f
->u
.R1005
.R1006
.present
)
4406 if (f
->u
.R1005
.R1006
.rtexpr
)
4407 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4409 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4413 /* ffestd_R1001dump_1005_2_ -- Dump a particular format
4416 ffestd_R1001dump_1005_2_(f,"I");
4418 The format is dumped with form [r]Xw. */
4421 ffestd_R1001dump_1005_2_ (ffests s
, ffesttFormatList f
, char *string
)
4423 assert (!f
->u
.R1005
.R1007_or_R1008
.present
);
4424 assert (!f
->u
.R1005
.R1009
.present
);
4425 assert (f
->u
.R1005
.R1006
.present
);
4427 if (f
->u
.R1005
.R1004
.present
)
4429 if (f
->u
.R1005
.R1004
.rtexpr
)
4430 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4432 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4435 ffests_puts (s
, string
);
4437 if (f
->u
.R1005
.R1006
.rtexpr
)
4438 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4440 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4443 /* ffestd_R1001dump_1005_3_ -- Dump a particular format
4446 ffestd_R1001dump_1005_3_(f,"I");
4448 The format is dumped with form [r]Xw[.m]. */
4451 ffestd_R1001dump_1005_3_ (ffests s
, ffesttFormatList f
, char *string
)
4453 assert (!f
->u
.R1005
.R1009
.present
);
4454 assert (f
->u
.R1005
.R1006
.present
);
4456 if (f
->u
.R1005
.R1004
.present
)
4458 if (f
->u
.R1005
.R1004
.rtexpr
)
4459 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4461 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4464 ffests_puts (s
, string
);
4466 if (f
->u
.R1005
.R1006
.rtexpr
)
4467 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4469 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4471 if (f
->u
.R1005
.R1007_or_R1008
.present
)
4473 ffests_putc (s
, '.');
4474 if (f
->u
.R1005
.R1007_or_R1008
.rtexpr
)
4475 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1007_or_R1008
.u
.expr
);
4477 ffests_printf_1U (s
, "%lu",
4478 f
->u
.R1005
.R1007_or_R1008
.u
.unsigned_val
);
4482 /* ffestd_R1001dump_1005_4_ -- Dump a particular format
4485 ffestd_R1001dump_1005_4_(f,"I");
4487 The format is dumped with form [r]Xw.d. */
4490 ffestd_R1001dump_1005_4_ (ffests s
, ffesttFormatList f
, char *string
)
4492 assert (!f
->u
.R1005
.R1009
.present
);
4493 assert (f
->u
.R1005
.R1007_or_R1008
.present
);
4494 assert (f
->u
.R1005
.R1006
.present
);
4496 if (f
->u
.R1005
.R1004
.present
)
4498 if (f
->u
.R1005
.R1004
.rtexpr
)
4499 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4501 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4504 ffests_puts (s
, string
);
4506 if (f
->u
.R1005
.R1006
.rtexpr
)
4507 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4509 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4511 ffests_putc (s
, '.');
4512 if (f
->u
.R1005
.R1007_or_R1008
.rtexpr
)
4513 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1007_or_R1008
.u
.expr
);
4515 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1007_or_R1008
.u
.unsigned_val
);
4518 /* ffestd_R1001dump_1005_5_ -- Dump a particular format
4521 ffestd_R1001dump_1005_5_(f,"I");
4523 The format is dumped with form [r]Xw.d[Ee]. */
4526 ffestd_R1001dump_1005_5_ (ffests s
, ffesttFormatList f
, char *string
)
4528 assert (f
->u
.R1005
.R1007_or_R1008
.present
);
4529 assert (f
->u
.R1005
.R1006
.present
);
4531 if (f
->u
.R1005
.R1004
.present
)
4533 if (f
->u
.R1005
.R1004
.rtexpr
)
4534 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1004
.u
.expr
);
4536 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1004
.u
.unsigned_val
);
4539 ffests_puts (s
, string
);
4541 if (f
->u
.R1005
.R1006
.rtexpr
)
4542 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1006
.u
.expr
);
4544 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1006
.u
.unsigned_val
);
4546 ffests_putc (s
, '.');
4547 if (f
->u
.R1005
.R1007_or_R1008
.rtexpr
)
4548 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1007_or_R1008
.u
.expr
);
4550 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1007_or_R1008
.u
.unsigned_val
);
4552 if (f
->u
.R1005
.R1009
.present
)
4554 ffests_putc (s
, 'E');
4555 if (f
->u
.R1005
.R1009
.rtexpr
)
4556 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1005
.R1009
.u
.expr
);
4558 ffests_printf_1U (s
, "%lu", f
->u
.R1005
.R1009
.u
.unsigned_val
);
4562 /* ffestd_R1001dump_1010_1_ -- Dump a particular format
4565 ffestd_R1001dump_1010_1_(f,"I");
4567 The format is dumped with form X. */
4570 ffestd_R1001dump_1010_1_ (ffests s
, ffesttFormatList f
, char *string
)
4572 assert (!f
->u
.R1010
.val
.present
);
4574 ffests_puts (s
, string
);
4577 /* ffestd_R1001dump_1010_2_ -- Dump a particular format
4580 ffestd_R1001dump_1010_2_(f,"I");
4582 The format is dumped with form [r]X. */
4585 ffestd_R1001dump_1010_2_ (ffests s
, ffesttFormatList f
, char *string
)
4587 if (f
->u
.R1010
.val
.present
)
4589 if (f
->u
.R1010
.val
.rtexpr
)
4590 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4592 ffests_printf_1U (s
, "%lu", f
->u
.R1010
.val
.u
.unsigned_val
);
4595 ffests_puts (s
, string
);
4598 /* ffestd_R1001dump_1010_3_ -- Dump a particular format
4601 ffestd_R1001dump_1010_3_(f,"I");
4603 The format is dumped with form nX. */
4606 ffestd_R1001dump_1010_3_ (ffests s
, ffesttFormatList f
, char *string
)
4608 assert (f
->u
.R1010
.val
.present
);
4610 if (f
->u
.R1010
.val
.rtexpr
)
4611 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4613 ffests_printf_1U (s
, "%lu", f
->u
.R1010
.val
.u
.unsigned_val
);
4615 ffests_puts (s
, string
);
4618 /* ffestd_R1001dump_1010_4_ -- Dump a particular format
4621 ffestd_R1001dump_1010_4_(f,"I");
4623 The format is dumped with form kX. Note that k is signed. */
4626 ffestd_R1001dump_1010_4_ (ffests s
, ffesttFormatList f
, char *string
)
4628 assert (f
->u
.R1010
.val
.present
);
4630 if (f
->u
.R1010
.val
.rtexpr
)
4631 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4633 ffests_printf_1D (s
, "%ld", f
->u
.R1010
.val
.u
.signed_val
);
4635 ffests_puts (s
, string
);
4638 /* ffestd_R1001dump_1010_5_ -- Dump a particular format
4641 ffestd_R1001dump_1010_5_(f,"I");
4643 The format is dumped with form Xn. */
4646 ffestd_R1001dump_1010_5_ (ffests s
, ffesttFormatList f
, char *string
)
4648 assert (f
->u
.R1010
.val
.present
);
4650 ffests_puts (s
, string
);
4652 if (f
->u
.R1010
.val
.rtexpr
)
4653 ffestd_R1001rtexpr_ (s
, f
, f
->u
.R1010
.val
.u
.expr
);
4655 ffests_printf_1U (s
, "%lu", f
->u
.R1010
.val
.u
.unsigned_val
);
4658 /* ffestd_R1001error_ -- Complain about FORMAT specification not supported
4661 ffestd_R1001error_(f);
4663 An error message is produced. */
4666 ffestd_R1001error_ (ffesttFormatList f
)
4668 ffebad_start (FFEBAD_FORMAT_UNSUPPORTED
);
4669 ffebad_here (0, ffelex_token_where_line (f
->t
), ffelex_token_where_column (f
->t
));
4674 ffestd_R1001rtexpr_ (ffests s
, ffesttFormatList f
, ffebld expr
)
4677 || (ffebld_op (expr
) != FFEBLD_opCONTER
)
4678 || (ffeinfo_basictype (ffebld_info (expr
)) != FFEINFO_basictypeINTEGER
)
4679 || (ffeinfo_kindtype (ffebld_info (expr
)) == FFEINFO_kindtypeINTEGER4
))
4681 ffebad_start (FFEBAD_FORMAT_VARIABLE
);
4682 ffebad_here (0, ffelex_token_where_line (f
->t
), ffelex_token_where_column (f
->t
));
4689 switch (ffeinfo_kindtype (ffebld_info (expr
)))
4691 #if FFETARGET_okINTEGER1
4692 case FFEINFO_kindtypeINTEGER1
:
4693 val
= ffebld_constant_integer1 (ffebld_conter (expr
));
4697 #if FFETARGET_okINTEGER2
4698 case FFEINFO_kindtypeINTEGER2
:
4699 val
= ffebld_constant_integer2 (ffebld_conter (expr
));
4703 #if FFETARGET_okINTEGER3
4704 case FFEINFO_kindtypeINTEGER3
:
4705 val
= ffebld_constant_integer3 (ffebld_conter (expr
));
4710 assert ("bad INTEGER constant kind type" == NULL
);
4712 case FFEINFO_kindtypeANY
:
4715 ffests_printf_1D (s
, "%ld", val
);
4719 /* ffestd_R1102 -- PROGRAM statement
4721 ffestd_R1102(name_token);
4723 Make sure ffestd_kind_ identifies an empty block. Make sure name_token
4724 gives a valid name. Implement the beginning of a main program. */
4727 ffestd_R1102 (ffesymbol s
, ffelexToken name UNUSED
)
4729 ffestd_check_simple_ ();
4731 assert (ffestd_block_level_
== 0);
4732 ffestd_is_reachable_
= TRUE
;
4734 ffecom_notify_primary_entry (s
);
4735 ffe_set_is_mainprog (TRUE
); /* Is a main program. */
4736 ffe_set_is_saveall (TRUE
); /* Main program always has implicit SAVE. */
4738 ffestw_set_sym (ffestw_stack_top (), s
);
4740 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4742 fputs ("< PROGRAM_unnamed\n", dmpout
);
4744 fprintf (dmpout
, "< PROGRAM %s\n", ffelex_token_text (name
));
4745 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4751 /* ffestd_R1103 -- End a PROGRAM
4756 ffestd_R1103 (bool ok UNUSED
)
4758 assert (ffestd_block_level_
== 0);
4760 if (FFESTD_IS_END_OPTIMIZED_
&& ffestd_is_reachable_
)
4761 ffestd_R842 (NULL
); /* Generate STOP. */
4763 if (ffestw_state (ffestw_stack_top ()) != FFESTV_statePROGRAM5
)
4764 ffestd_subr_labels_ (FALSE
);/* Handle any undefined labels. */
4772 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1103_
);
4773 ffestd_stmt_append_ (stmt
);
4778 /* ffestd_R1105 -- MODULE statement
4780 ffestd_R1105(name_token);
4782 Make sure ffestd_kind_ identifies an empty block. Make sure name_token
4783 gives a valid name. Implement the beginning of a module. */
4787 ffestd_R1105 (ffelexToken name
)
4789 assert (ffestd_block_level_
== 0);
4791 ffestd_check_simple_ ();
4793 ffestd_subr_f90_ ();
4797 fprintf (dmpout
, "* MODULE %s\n", ffelex_token_text (name
));
4801 /* ffestd_R1106 -- End a MODULE
4803 ffestd_R1106(TRUE); */
4806 ffestd_R1106 (bool ok
)
4808 assert (ffestd_block_level_
== 0);
4810 /* Generate any wrap-up code here (unlikely in MODULE!). */
4812 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateMODULE5
)
4813 ffestd_subr_labels_ (TRUE
); /* Handle any undefined labels (unlikely). */
4818 fprintf (dmpout
, "< END_MODULE %s\n",
4819 ffelex_token_text (ffestw_name (ffestw_stack_top ())));
4823 /* ffestd_R1107_start -- USE statement list begin
4825 ffestd_R1107_start();
4827 Verify that USE is valid here, and begin accepting items in the list. */
4830 ffestd_R1107_start (ffelexToken name
, bool only
)
4832 ffestd_check_start_ ();
4834 ffestd_subr_f90_ ();
4838 fprintf (dmpout
, "* USE %s,", ffelex_token_text (name
)); /* NB
4839 _shriek_begin_uses_. */
4841 fputs ("only: ", dmpout
);
4845 /* ffestd_R1107_item -- USE statement for name
4847 ffestd_R1107_item(local_token,use_token);
4849 Make sure name_token identifies a valid object to be USEed. local_token
4850 may be NULL if _start_ was called with only==TRUE. */
4853 ffestd_R1107_item (ffelexToken local
, ffelexToken use
)
4855 ffestd_check_item_ ();
4856 assert (use
!= NULL
);
4862 fprintf (dmpout
, "%s=>", ffelex_token_text (local
));
4863 fprintf (dmpout
, "%s,", ffelex_token_text (use
));
4867 /* ffestd_R1107_finish -- USE statement list complete
4869 ffestd_R1107_finish();
4871 Just wrap up any local activities. */
4874 ffestd_R1107_finish ()
4876 ffestd_check_finish_ ();
4881 fputc ('\n', dmpout
);
4886 /* ffestd_R1111 -- BLOCK DATA statement
4888 ffestd_R1111(name_token);
4890 Make sure ffestd_kind_ identifies no current program unit. If not
4891 NULL, make sure name_token gives a valid name. Implement the beginning
4892 of a block data program unit. */
4895 ffestd_R1111 (ffesymbol s
, ffelexToken name UNUSED
)
4897 assert (ffestd_block_level_
== 0);
4898 ffestd_is_reachable_
= TRUE
;
4900 ffestd_check_simple_ ();
4902 ffecom_notify_primary_entry (s
);
4903 ffestw_set_sym (ffestw_stack_top (), s
);
4905 #if FFECOM_targetCURRENT == FFECOM_targetFFE
4907 fputs ("< BLOCK_DATA_unnamed\n", dmpout
);
4909 fprintf (dmpout
, "< BLOCK_DATA %s\n", ffelex_token_text (name
));
4910 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
4916 /* ffestd_R1112 -- End a BLOCK DATA
4918 ffestd_R1112(TRUE); */
4921 ffestd_R1112 (bool ok UNUSED
)
4923 assert (ffestd_block_level_
== 0);
4925 /* Generate any return-like code here (not likely for BLOCK DATA!). */
4927 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateBLOCKDATA5
)
4928 ffestd_subr_labels_ (TRUE
); /* Handle any undefined labels. */
4936 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1112_
);
4937 ffestd_stmt_append_ (stmt
);
4942 /* ffestd_R1202 -- INTERFACE statement
4944 ffestd_R1202(operator,defined_name);
4946 Make sure ffestd_kind_ identifies an INTERFACE block.
4947 Implement the end of the current interface.
4950 Allow no operator or name to mean INTERFACE by itself; missed this
4951 valid form when originally doing syntactic analysis code. */
4955 ffestd_R1202 (ffestpDefinedOperator
operator, ffelexToken name
)
4957 ffestd_check_simple_ ();
4959 ffestd_subr_f90_ ();
4965 case FFESTP_definedoperatorNone
:
4967 fputs ("* INTERFACE_unnamed\n", dmpout
);
4969 fprintf (dmpout
, "* INTERFACE %s\n", ffelex_token_text (name
));
4972 case FFESTP_definedoperatorOPERATOR
:
4973 fprintf (dmpout
, "* INTERFACE_OPERATOR (.%s.)\n", ffelex_token_text (name
));
4976 case FFESTP_definedoperatorASSIGNMENT
:
4977 fputs ("* INTERFACE_ASSIGNMENT (=)\n", dmpout
);
4980 case FFESTP_definedoperatorPOWER
:
4981 fputs ("* INTERFACE_OPERATOR (**)\n", dmpout
);
4984 case FFESTP_definedoperatorMULT
:
4985 fputs ("* INTERFACE_OPERATOR (*)\n", dmpout
);
4988 case FFESTP_definedoperatorADD
:
4989 fputs ("* INTERFACE_OPERATOR (+)\n", dmpout
);
4992 case FFESTP_definedoperatorCONCAT
:
4993 fputs ("* INTERFACE_OPERATOR (//)\n", dmpout
);
4996 case FFESTP_definedoperatorDIVIDE
:
4997 fputs ("* INTERFACE_OPERATOR (/)\n", dmpout
);
5000 case FFESTP_definedoperatorSUBTRACT
:
5001 fputs ("* INTERFACE_OPERATOR (-)\n", dmpout
);
5004 case FFESTP_definedoperatorNOT
:
5005 fputs ("* INTERFACE_OPERATOR (.not.)\n", dmpout
);
5008 case FFESTP_definedoperatorAND
:
5009 fputs ("* INTERFACE_OPERATOR (.and.)\n", dmpout
);
5012 case FFESTP_definedoperatorOR
:
5013 fputs ("* INTERFACE_OPERATOR (.or.)\n", dmpout
);
5016 case FFESTP_definedoperatorEQV
:
5017 fputs ("* INTERFACE_OPERATOR (.eqv.)\n", dmpout
);
5020 case FFESTP_definedoperatorNEQV
:
5021 fputs ("* INTERFACE_OPERATOR (.neqv.)\n", dmpout
);
5024 case FFESTP_definedoperatorEQ
:
5025 fputs ("* INTERFACE_OPERATOR (==)\n", dmpout
);
5028 case FFESTP_definedoperatorNE
:
5029 fputs ("* INTERFACE_OPERATOR (/=)\n", dmpout
);
5032 case FFESTP_definedoperatorLT
:
5033 fputs ("* INTERFACE_OPERATOR (<)\n", dmpout
);
5036 case FFESTP_definedoperatorLE
:
5037 fputs ("* INTERFACE_OPERATOR (<=)\n", dmpout
);
5040 case FFESTP_definedoperatorGT
:
5041 fputs ("* INTERFACE_OPERATOR (>)\n", dmpout
);
5044 case FFESTP_definedoperatorGE
:
5045 fputs ("* INTERFACE_OPERATOR (>=)\n", dmpout
);
5055 /* ffestd_R1203 -- End an INTERFACE
5057 ffestd_R1203(TRUE); */
5060 ffestd_R1203 (bool ok
)
5065 fputs ("* END_INTERFACE\n", dmpout
);
5069 /* ffestd_R1205_start -- MODULE PROCEDURE statement list begin
5071 ffestd_R1205_start();
5073 Verify that MODULE PROCEDURE is valid here, and begin accepting items in
5077 ffestd_R1205_start ()
5079 ffestd_check_start_ ();
5084 fputs ("* MODULE_PROCEDURE ", dmpout
);
5088 /* ffestd_R1205_item -- MODULE PROCEDURE statement for name
5090 ffestd_R1205_item(name_token);
5092 Make sure name_token identifies a valid object to be MODULE PROCEDUREed. */
5095 ffestd_R1205_item (ffelexToken name
)
5097 ffestd_check_item_ ();
5098 assert (name
!= NULL
);
5103 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
5107 /* ffestd_R1205_finish -- MODULE PROCEDURE statement list complete
5109 ffestd_R1205_finish();
5111 Just wrap up any local activities. */
5114 ffestd_R1205_finish ()
5116 ffestd_check_finish_ ();
5121 fputc ('\n', dmpout
);
5126 /* ffestd_R1207_start -- EXTERNAL statement list begin
5128 ffestd_R1207_start();
5130 Verify that EXTERNAL is valid here, and begin accepting items in the list. */
5133 ffestd_R1207_start ()
5135 ffestd_check_start_ ();
5137 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5138 fputs ("* EXTERNAL (", dmpout
);
5139 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5145 /* ffestd_R1207_item -- EXTERNAL statement for name
5147 ffestd_R1207_item(name_token);
5149 Make sure name_token identifies a valid object to be EXTERNALd. */
5152 ffestd_R1207_item (ffelexToken name
)
5154 ffestd_check_item_ ();
5155 assert (name
!= NULL
);
5157 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5158 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
5159 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5165 /* ffestd_R1207_finish -- EXTERNAL statement list complete
5167 ffestd_R1207_finish();
5169 Just wrap up any local activities. */
5172 ffestd_R1207_finish ()
5174 ffestd_check_finish_ ();
5176 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5177 fputs (")\n", dmpout
);
5178 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5184 /* ffestd_R1208_start -- INTRINSIC statement list begin
5186 ffestd_R1208_start();
5188 Verify that INTRINSIC is valid here, and begin accepting items in the list. */
5191 ffestd_R1208_start ()
5193 ffestd_check_start_ ();
5195 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5196 fputs ("* INTRINSIC (", dmpout
);
5197 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5203 /* ffestd_R1208_item -- INTRINSIC statement for name
5205 ffestd_R1208_item(name_token);
5207 Make sure name_token identifies a valid object to be INTRINSICd. */
5210 ffestd_R1208_item (ffelexToken name
)
5212 ffestd_check_item_ ();
5213 assert (name
!= NULL
);
5215 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5216 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
5217 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5223 /* ffestd_R1208_finish -- INTRINSIC statement list complete
5225 ffestd_R1208_finish();
5227 Just wrap up any local activities. */
5230 ffestd_R1208_finish ()
5232 ffestd_check_finish_ ();
5234 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5235 fputs (")\n", dmpout
);
5236 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5242 /* ffestd_R1212 -- CALL statement
5244 ffestd_R1212(expr,expr_token);
5246 Make sure statement is valid here; implement. */
5249 ffestd_R1212 (ffebld expr
)
5251 ffestd_check_simple_ ();
5254 ffestd_subr_line_now_ ();
5255 ffeste_R1212 (expr
);
5260 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1212_
);
5261 ffestd_stmt_append_ (stmt
);
5262 ffestd_subr_line_save_ (stmt
);
5263 stmt
->u
.R1212
.pool
= ffesta_output_pool
;
5264 stmt
->u
.R1212
.expr
= expr
;
5265 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5270 /* ffestd_R1213 -- Defined assignment statement
5272 ffestd_R1213(dest_expr,source_expr,source_token);
5274 Make sure the assignment is valid. */
5278 ffestd_R1213 (ffebld dest
, ffebld source
)
5280 ffestd_check_simple_ ();
5282 ffestd_subr_f90_ ();
5286 fputs ("+ let_defined ", dmpout
);
5288 fputs ("=", dmpout
);
5289 ffebld_dump (source
);
5290 fputc ('\n', dmpout
);
5295 /* ffestd_R1219 -- FUNCTION statement
5297 ffestd_R1219(funcname,arglist,ending_token,kind,kindt,len,lent,
5300 Make sure statement is valid here, register arguments for the
5301 function name, and so on.
5304 Added the kind, len, and recursive arguments. */
5307 ffestd_R1219 (ffesymbol s
, ffelexToken funcname UNUSED
,
5308 ffesttTokenList args UNUSED
, ffestpType type UNUSED
,
5309 ffebld kind UNUSED
, ffelexToken kindt UNUSED
,
5310 ffebld len UNUSED
, ffelexToken lent UNUSED
,
5311 bool recursive UNUSED
, ffelexToken result UNUSED
,
5312 bool separate_result UNUSED
)
5314 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5318 assert (ffestd_block_level_
== 0);
5319 ffestd_is_reachable_
= TRUE
;
5321 ffestd_check_simple_ ();
5323 ffecom_notify_primary_entry (s
);
5324 ffestw_set_sym (ffestw_stack_top (), s
);
5326 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5329 case FFESTP_typeINTEGER
:
5333 case FFESTP_typeBYTE
:
5337 case FFESTP_typeWORD
:
5341 case FFESTP_typeREAL
:
5345 case FFESTP_typeCOMPLEX
:
5349 case FFESTP_typeLOGICAL
:
5353 case FFESTP_typeCHARACTER
:
5357 case FFESTP_typeDBLPRCSN
:
5358 a
= "DOUBLE PRECISION";
5361 case FFESTP_typeDBLCMPLX
:
5362 a
= "DOUBLE COMPLEX";
5366 case FFESTP_typeTYPE
:
5371 case FFESTP_typeNone
:
5380 fprintf (dmpout
, "< FUNCTION %s ", ffelex_token_text (funcname
));
5382 fputs ("RECURSIVE ", dmpout
);
5383 fprintf (dmpout
, "%s(", a
);
5386 fputs ("kind=", dmpout
);
5388 fputs (ffelex_token_text (kindt
), dmpout
);
5392 fputc (',', dmpout
);
5396 fputs ("len=", dmpout
);
5398 fputs (ffelex_token_text (lent
), dmpout
);
5402 fprintf (dmpout
, ")");
5405 fputs (" (", dmpout
);
5406 ffestt_tokenlist_dump (args
);
5407 fputc (')', dmpout
);
5410 fprintf (dmpout
, " result(%s)", ffelex_token_text (result
));
5411 fputc ('\n', dmpout
);
5412 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5418 /* ffestd_R1221 -- End a FUNCTION
5420 ffestd_R1221(TRUE); */
5423 ffestd_R1221 (bool ok UNUSED
)
5425 assert (ffestd_block_level_
== 0);
5427 if (FFESTD_IS_END_OPTIMIZED_
&& ffestd_is_reachable_
)
5428 ffestd_R1227 (NULL
); /* Generate RETURN. */
5430 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateFUNCTION5
)
5431 ffestd_subr_labels_ (FALSE
);/* Handle any undefined labels. */
5439 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1221_
);
5440 ffestd_stmt_append_ (stmt
);
5445 /* ffestd_R1223 -- SUBROUTINE statement
5447 ffestd_R1223(subrname,arglist,ending_token,recursive_token);
5449 Make sure statement is valid here, register arguments for the
5450 subroutine name, and so on.
5453 Added the recursive argument. */
5456 ffestd_R1223 (ffesymbol s
, ffelexToken subrname UNUSED
,
5457 ffesttTokenList args UNUSED
, ffelexToken final UNUSED
,
5458 bool recursive UNUSED
)
5460 assert (ffestd_block_level_
== 0);
5461 ffestd_is_reachable_
= TRUE
;
5463 ffestd_check_simple_ ();
5465 ffecom_notify_primary_entry (s
);
5466 ffestw_set_sym (ffestw_stack_top (), s
);
5468 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5469 fprintf (dmpout
, "< SUBROUTINE %s ", ffelex_token_text (subrname
));
5471 fputs ("recursive ", dmpout
);
5474 fputc ('(', dmpout
);
5475 ffestt_tokenlist_dump (args
);
5476 fputc (')', dmpout
);
5478 fputc ('\n', dmpout
);
5479 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5485 /* ffestd_R1225 -- End a SUBROUTINE
5487 ffestd_R1225(TRUE); */
5490 ffestd_R1225 (bool ok UNUSED
)
5492 assert (ffestd_block_level_
== 0);
5494 if (FFESTD_IS_END_OPTIMIZED_
&& ffestd_is_reachable_
)
5495 ffestd_R1227 (NULL
); /* Generate RETURN. */
5497 if (ffestw_state (ffestw_stack_top ()) != FFESTV_stateSUBROUTINE5
)
5498 ffestd_subr_labels_ (FALSE
);/* Handle any undefined labels. */
5506 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1225_
);
5507 ffestd_stmt_append_ (stmt
);
5512 /* ffestd_R1226 -- ENTRY statement
5514 ffestd_R1226(entryname,arglist,ending_token);
5516 Make sure we're in a SUBROUTINE or FUNCTION, register arguments for the
5517 entry point name, and so on. */
5520 ffestd_R1226 (ffesymbol entry
)
5522 ffestd_check_simple_ ();
5524 #if (FFECOM_targetCURRENT == FFECOM_targetFFE) || FFECOM_ONEPASS
5525 ffestd_subr_line_now_ ();
5526 ffeste_R1226 (entry
);
5528 if (!ffesta_seen_first_exec
|| ffecom_2pass_advise_entrypoint (entry
))
5532 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1226_
);
5533 ffestd_stmt_append_ (stmt
);
5534 ffestd_subr_line_save_ (stmt
);
5535 stmt
->u
.R1226
.entry
= entry
;
5536 stmt
->u
.R1226
.entrynum
= ++ffestd_2pass_entrypoints_
;
5540 ffestd_is_reachable_
= TRUE
;
5543 /* ffestd_R1227 -- RETURN statement
5547 Make sure statement is valid here; implement. expr and expr_token are
5548 both NULL if there was no expression. */
5551 ffestd_R1227 (ffebld expr
)
5553 ffestd_check_simple_ ();
5556 ffestd_subr_line_now_ ();
5557 ffeste_R1227 (ffestw_stack_top (), expr
);
5562 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR1227_
);
5563 ffestd_stmt_append_ (stmt
);
5564 ffestd_subr_line_save_ (stmt
);
5565 stmt
->u
.R1227
.pool
= ffesta_output_pool
;
5566 stmt
->u
.R1227
.block
= ffestw_stack_top ();
5567 stmt
->u
.R1227
.expr
= expr
;
5568 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5572 if (ffestd_block_level_
== 0)
5573 ffestd_is_reachable_
= FALSE
;
5576 /* ffestd_R1228 -- CONTAINS statement
5584 assert (ffestd_block_level_
== 0);
5586 ffestd_check_simple_ ();
5588 /* Generate RETURN/STOP code here */
5590 ffestd_subr_labels_ (ffestw_state (ffestw_stack_top ())
5591 == FFESTV_stateMODULE5
); /* Handle any undefined
5594 ffestd_subr_f90_ ();
5598 fputs ("- CONTAINS\n", dmpout
);
5603 /* ffestd_R1229_start -- STMTFUNCTION statement begin
5605 ffestd_R1229_start(func_name,func_arg_list,close_paren);
5607 This function does not really need to do anything, since _finish_
5608 gets all the info needed, and ffestc_R1229_start has already
5609 done all the stuff that makes a two-phase operation (start and
5610 finish) for handling statement functions necessary.
5613 Do nothing, now that _finish_ does everything. */
5616 ffestd_R1229_start (ffelexToken name UNUSED
, ffesttTokenList args UNUSED
)
5618 ffestd_check_start_ ();
5620 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5621 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5627 /* ffestd_R1229_finish -- STMTFUNCTION statement list complete
5629 ffestd_R1229_finish(s);
5631 The statement function's symbol is passed. Its list of dummy args is
5632 accessed via ffesymbol_dummyargs and its expansion expression (expr)
5633 is accessed via ffesymbol_sfexpr.
5635 If sfexpr is NULL, an error occurred parsing the expansion expression, so
5636 just cancel the effects of ffestd_R1229_start and pretend nothing
5637 happened. Otherwise, install the expression as the expansion for the
5638 statement function, then clean up.
5641 Takes sfunc sym instead of just the expansion expression as an
5642 argument, so this function can do all the work, and _start_ is just
5643 a nicety than can do nothing in a back end. */
5646 ffestd_R1229_finish (ffesymbol s
)
5648 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5649 ffebld args
= ffesymbol_dummyargs (s
);
5651 ffebld expr
= ffesymbol_sfexpr (s
);
5653 ffestd_check_finish_ ();
5656 return; /* Nothing to do, definition didn't work. */
5658 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5659 fprintf (dmpout
, "* stmtfunction %s(", ffesymbol_text (s
));
5660 for (; args
!= NULL
; args
= ffebld_trail (args
))
5661 fprintf (dmpout
, "%s,", ffesymbol_text (ffebld_symter (ffebld_head (args
))));
5662 fputs (")=", dmpout
);
5664 fputc ('\n', dmpout
);
5665 #if 0 /* Normally no need to preserve the
5667 ffesymbol_set_sfexpr (s
, NULL
); /* Except expr.c sees NULL
5668 as recursive reference!
5669 So until we can use something
5670 convenient, like a "permanent"
5671 expression, don't worry about
5672 wasting some memory in the
5675 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5677 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5678 /* With gcc, cannot do anything here, because the backend hasn't even
5679 (necessarily) been notified that we're compiling a program unit! */
5681 #if 0 /* Must preserve the expression for gcc. */
5682 ffesymbol_set_sfexpr (s
, NULL
);
5684 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
5691 /* ffestd_S3P4 -- INCLUDE line
5693 ffestd_S3P4(filename,filename_token);
5695 Make sure INCLUDE not preceded by any semicolons or a label def; implement. */
5698 ffestd_S3P4 (ffebld filename
)
5701 ffetargetCharacterDefault buildname
;
5704 ffestd_check_simple_ ();
5706 assert (filename
!= NULL
);
5707 if (ffebld_op (filename
) != FFEBLD_opANY
)
5709 assert (ffebld_op (filename
) == FFEBLD_opCONTER
);
5710 assert (ffeinfo_basictype (ffebld_info (filename
))
5711 == FFEINFO_basictypeCHARACTER
);
5712 assert (ffeinfo_kindtype (ffebld_info (filename
))
5713 == FFEINFO_kindtypeCHARACTERDEFAULT
);
5714 buildname
= ffebld_constant_characterdefault (ffebld_conter (filename
));
5715 wf
= ffewhere_file_new (ffetarget_text_characterdefault (buildname
),
5716 ffetarget_length_characterdefault (buildname
));
5717 fi
= ffecom_open_include (ffewhere_file_name (wf
),
5718 ffelex_token_where_line (ffesta_tokens
[0]),
5719 ffelex_token_where_column (ffesta_tokens
[0]));
5721 ffewhere_file_kill (wf
);
5723 ffelex_set_include (wf
, (ffelex_token_type (ffesta_tokens
[0])
5724 == FFELEX_typeNAME
), fi
);
5728 /* ffestd_V003_start -- STRUCTURE statement list begin
5730 ffestd_V003_start(structure_name);
5732 Verify that STRUCTURE is valid here, and begin accepting items in the list. */
5736 ffestd_V003_start (ffelexToken structure_name
)
5738 ffestd_check_start_ ();
5740 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5741 if (structure_name
== NULL
)
5742 fputs ("* STRUCTURE_unnamed ", dmpout
);
5744 fprintf (dmpout
, "* STRUCTURE %s ", ffelex_token_text (structure_name
));
5745 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5746 ffestd_subr_vxt_ ();
5752 /* ffestd_V003_item -- STRUCTURE statement for object-name
5754 ffestd_V003_item(name_token,dim_list);
5756 Make sure name_token identifies a valid object to be STRUCTUREd. */
5759 ffestd_V003_item (ffelexToken name
, ffesttDimList dims
)
5761 ffestd_check_item_ ();
5763 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5764 fputs (ffelex_token_text (name
), dmpout
);
5767 fputc ('(', dmpout
);
5768 ffestt_dimlist_dump (dims
);
5769 fputc (')', dmpout
);
5771 fputc (',', dmpout
);
5772 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5778 /* ffestd_V003_finish -- STRUCTURE statement list complete
5780 ffestd_V003_finish();
5782 Just wrap up any local activities. */
5785 ffestd_V003_finish ()
5787 ffestd_check_finish_ ();
5789 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5790 fputc ('\n', dmpout
);
5791 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5797 /* ffestd_V004 -- End a STRUCTURE
5799 ffestd_V004(TRUE); */
5802 ffestd_V004 (bool ok
)
5804 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5805 fputs ("* END_STRUCTURE\n", dmpout
);
5806 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5812 /* ffestd_V009 -- UNION statement
5819 ffestd_check_simple_ ();
5821 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5822 fputs ("* UNION\n", dmpout
);
5823 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5829 /* ffestd_V010 -- End a UNION
5831 ffestd_V010(TRUE); */
5834 ffestd_V010 (bool ok
)
5836 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5837 fputs ("* END_UNION\n", dmpout
);
5838 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5844 /* ffestd_V012 -- MAP statement
5851 ffestd_check_simple_ ();
5853 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5854 fputs ("* MAP\n", dmpout
);
5855 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5861 /* ffestd_V013 -- End a MAP
5863 ffestd_V013(TRUE); */
5866 ffestd_V013 (bool ok
)
5868 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5869 fputs ("* END_MAP\n", dmpout
);
5870 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5877 /* ffestd_V014_start -- VOLATILE statement list begin
5879 ffestd_V014_start();
5881 Verify that VOLATILE is valid here, and begin accepting items in the list. */
5884 ffestd_V014_start ()
5886 ffestd_check_start_ ();
5888 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5889 fputs ("* VOLATILE (", dmpout
);
5890 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5891 ffestd_subr_vxt_ ();
5897 /* ffestd_V014_item_object -- VOLATILE statement for object-name
5899 ffestd_V014_item_object(name_token);
5901 Make sure name_token identifies a valid object to be VOLATILEd. */
5904 ffestd_V014_item_object (ffelexToken name UNUSED
)
5906 ffestd_check_item_ ();
5908 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5909 fprintf (dmpout
, "%s,", ffelex_token_text (name
));
5910 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5916 /* ffestd_V014_item_cblock -- VOLATILE statement for common-block-name
5918 ffestd_V014_item_cblock(name_token);
5920 Make sure name_token identifies a valid common block to be VOLATILEd. */
5923 ffestd_V014_item_cblock (ffelexToken name UNUSED
)
5925 ffestd_check_item_ ();
5927 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5928 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
5929 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5935 /* ffestd_V014_finish -- VOLATILE statement list complete
5937 ffestd_V014_finish();
5939 Just wrap up any local activities. */
5942 ffestd_V014_finish ()
5944 ffestd_check_finish_ ();
5946 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5947 fputs (")\n", dmpout
);
5948 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5954 /* ffestd_V016_start -- RECORD statement list begin
5956 ffestd_V016_start();
5958 Verify that RECORD is valid here, and begin accepting items in the list. */
5962 ffestd_V016_start ()
5964 ffestd_check_start_ ();
5966 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5967 fputs ("* RECORD ", dmpout
);
5968 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5969 ffestd_subr_vxt_ ();
5975 /* ffestd_V016_item_structure -- RECORD statement for common-block-name
5977 ffestd_V016_item_structure(name_token);
5979 Make sure name_token identifies a valid structure to be RECORDed. */
5982 ffestd_V016_item_structure (ffelexToken name
)
5984 ffestd_check_item_ ();
5986 #if FFECOM_targetCURRENT == FFECOM_targetFFE
5987 fprintf (dmpout
, "/%s/,", ffelex_token_text (name
));
5988 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
5994 /* ffestd_V016_item_object -- RECORD statement for object-name
5996 ffestd_V016_item_object(name_token,dim_list);
5998 Make sure name_token identifies a valid object to be RECORDd. */
6001 ffestd_V016_item_object (ffelexToken name
, ffesttDimList dims
)
6003 ffestd_check_item_ ();
6005 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6006 fputs (ffelex_token_text (name
), dmpout
);
6009 fputc ('(', dmpout
);
6010 ffestt_dimlist_dump (dims
);
6011 fputc (')', dmpout
);
6013 fputc (',', dmpout
);
6014 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6020 /* ffestd_V016_finish -- RECORD statement list complete
6022 ffestd_V016_finish();
6024 Just wrap up any local activities. */
6027 ffestd_V016_finish ()
6029 ffestd_check_finish_ ();
6031 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6032 fputc ('\n', dmpout
);
6033 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6039 /* ffestd_V018_start -- REWRITE(...) statement list begin
6041 ffestd_V018_start();
6043 Verify that REWRITE is valid here, and begin accepting items in the
6047 ffestd_V018_start (ffestvFormat format
)
6049 ffestd_check_start_ ();
6051 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6054 ffestd_subr_line_now_ ();
6055 ffeste_V018_start (&ffestp_file
.rewrite
, format
);
6060 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV018_
);
6061 ffestd_stmt_append_ (stmt
);
6062 ffestd_subr_line_save_ (stmt
);
6063 stmt
->u
.V018
.pool
= ffesta_output_pool
;
6064 stmt
->u
.V018
.params
= ffestd_subr_copy_rewrite_ ();
6065 stmt
->u
.V018
.format
= format
;
6066 stmt
->u
.V018
.list
= NULL
;
6067 ffestd_expr_list_
= &stmt
->u
.V018
.list
;
6068 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6073 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6074 ffestd_subr_vxt_ ();
6078 /* ffestd_V018_item -- REWRITE statement i/o item
6080 ffestd_V018_item(expr,expr_token);
6082 Implement output-list expression. */
6085 ffestd_V018_item (ffebld expr
)
6087 ffestd_check_item_ ();
6089 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6092 ffeste_V018_item (expr
);
6095 ffestdExprItem_ item
6096 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6101 *ffestd_expr_list_
= item
;
6102 ffestd_expr_list_
= &item
->next
;
6107 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6111 /* ffestd_V018_finish -- REWRITE statement list complete
6113 ffestd_V018_finish();
6115 Just wrap up any local activities. */
6118 ffestd_V018_finish ()
6120 ffestd_check_finish_ ();
6122 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6125 ffeste_V018_finish ();
6127 /* Nothing to do, it's implicit. */
6131 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6135 /* ffestd_V019_start -- ACCEPT statement list begin
6137 ffestd_V019_start();
6139 Verify that ACCEPT is valid here, and begin accepting items in the
6143 ffestd_V019_start (ffestvFormat format
)
6145 ffestd_check_start_ ();
6147 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6150 ffestd_subr_line_now_ ();
6151 ffeste_V019_start (&ffestp_file
.accept
, format
);
6156 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV019_
);
6157 ffestd_stmt_append_ (stmt
);
6158 ffestd_subr_line_save_ (stmt
);
6159 stmt
->u
.V019
.pool
= ffesta_output_pool
;
6160 stmt
->u
.V019
.params
= ffestd_subr_copy_accept_ ();
6161 stmt
->u
.V019
.format
= format
;
6162 stmt
->u
.V019
.list
= NULL
;
6163 ffestd_expr_list_
= &stmt
->u
.V019
.list
;
6164 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6169 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6170 ffestd_subr_vxt_ ();
6174 /* ffestd_V019_item -- ACCEPT statement i/o item
6176 ffestd_V019_item(expr,expr_token);
6178 Implement output-list expression. */
6181 ffestd_V019_item (ffebld expr
)
6183 ffestd_check_item_ ();
6185 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6188 ffeste_V019_item (expr
);
6191 ffestdExprItem_ item
6192 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6197 *ffestd_expr_list_
= item
;
6198 ffestd_expr_list_
= &item
->next
;
6203 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6207 /* ffestd_V019_finish -- ACCEPT statement list complete
6209 ffestd_V019_finish();
6211 Just wrap up any local activities. */
6214 ffestd_V019_finish ()
6216 ffestd_check_finish_ ();
6218 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6221 ffeste_V019_finish ();
6223 /* Nothing to do, it's implicit. */
6227 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6232 /* ffestd_V020_start -- TYPE statement list begin
6234 ffestd_V020_start();
6236 Verify that TYPE is valid here, and begin accepting items in the
6240 ffestd_V020_start (ffestvFormat format UNUSED
)
6242 ffestd_check_start_ ();
6244 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6247 ffestd_subr_line_now_ ();
6248 ffeste_V020_start (&ffestp_file
.type
, format
);
6253 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV020_
);
6254 ffestd_stmt_append_ (stmt
);
6255 ffestd_subr_line_save_ (stmt
);
6256 stmt
->u
.V020
.pool
= ffesta_output_pool
;
6257 stmt
->u
.V020
.params
= ffestd_subr_copy_type_ ();
6258 stmt
->u
.V020
.format
= format
;
6259 stmt
->u
.V020
.list
= NULL
;
6260 ffestd_expr_list_
= &stmt
->u
.V020
.list
;
6261 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6266 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6267 ffestd_subr_vxt_ ();
6271 /* ffestd_V020_item -- TYPE statement i/o item
6273 ffestd_V020_item(expr,expr_token);
6275 Implement output-list expression. */
6278 ffestd_V020_item (ffebld expr UNUSED
)
6280 ffestd_check_item_ ();
6282 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6285 ffeste_V020_item (expr
);
6288 ffestdExprItem_ item
6289 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6294 *ffestd_expr_list_
= item
;
6295 ffestd_expr_list_
= &item
->next
;
6300 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6304 /* ffestd_V020_finish -- TYPE statement list complete
6306 ffestd_V020_finish();
6308 Just wrap up any local activities. */
6311 ffestd_V020_finish ()
6313 ffestd_check_finish_ ();
6315 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6318 ffeste_V020_finish ();
6320 /* Nothing to do, it's implicit. */
6324 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6328 /* ffestd_V021 -- DELETE statement
6332 Make sure a DELETE is valid in the current context, and implement it. */
6338 ffestd_check_simple_ ();
6340 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6343 ffestd_subr_line_now_ ();
6344 ffeste_V021 (&ffestp_file
.delete);
6349 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV021_
);
6350 ffestd_stmt_append_ (stmt
);
6351 ffestd_subr_line_save_ (stmt
);
6352 stmt
->u
.V021
.pool
= ffesta_output_pool
;
6353 stmt
->u
.V021
.params
= ffestd_subr_copy_delete_ ();
6354 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6359 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6360 ffestd_subr_vxt_ ();
6364 /* ffestd_V022 -- UNLOCK statement
6368 Make sure a UNLOCK is valid in the current context, and implement it. */
6373 ffestd_check_simple_ ();
6375 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6378 ffestd_subr_line_now_ ();
6379 ffeste_V022 (&ffestp_file
.beru
);
6384 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV022_
);
6385 ffestd_stmt_append_ (stmt
);
6386 ffestd_subr_line_save_ (stmt
);
6387 stmt
->u
.V022
.pool
= ffesta_output_pool
;
6388 stmt
->u
.V022
.params
= ffestd_subr_copy_beru_ ();
6389 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6394 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6395 ffestd_subr_vxt_ ();
6399 /* ffestd_V023_start -- ENCODE(...) statement list begin
6401 ffestd_V023_start();
6403 Verify that ENCODE is valid here, and begin accepting items in the
6407 ffestd_V023_start ()
6409 ffestd_check_start_ ();
6411 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6414 ffestd_subr_line_now_ ();
6415 ffeste_V023_start (&ffestp_file
.vxtcode
);
6420 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV023_
);
6421 ffestd_stmt_append_ (stmt
);
6422 ffestd_subr_line_save_ (stmt
);
6423 stmt
->u
.V023
.pool
= ffesta_output_pool
;
6424 stmt
->u
.V023
.params
= ffestd_subr_copy_vxtcode_ ();
6425 stmt
->u
.V023
.list
= NULL
;
6426 ffestd_expr_list_
= &stmt
->u
.V023
.list
;
6427 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6432 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6433 ffestd_subr_vxt_ ();
6437 /* ffestd_V023_item -- ENCODE statement i/o item
6439 ffestd_V023_item(expr,expr_token);
6441 Implement output-list expression. */
6444 ffestd_V023_item (ffebld expr
)
6446 ffestd_check_item_ ();
6448 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6451 ffeste_V023_item (expr
);
6454 ffestdExprItem_ item
6455 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6460 *ffestd_expr_list_
= item
;
6461 ffestd_expr_list_
= &item
->next
;
6466 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6470 /* ffestd_V023_finish -- ENCODE statement list complete
6472 ffestd_V023_finish();
6474 Just wrap up any local activities. */
6477 ffestd_V023_finish ()
6479 ffestd_check_finish_ ();
6481 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6484 ffeste_V023_finish ();
6486 /* Nothing to do, it's implicit. */
6490 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6494 /* ffestd_V024_start -- DECODE(...) statement list begin
6496 ffestd_V024_start();
6498 Verify that DECODE is valid here, and begin accepting items in the
6502 ffestd_V024_start ()
6504 ffestd_check_start_ ();
6506 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6509 ffestd_subr_line_now_ ();
6510 ffeste_V024_start (&ffestp_file
.vxtcode
);
6515 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV024_
);
6516 ffestd_stmt_append_ (stmt
);
6517 ffestd_subr_line_save_ (stmt
);
6518 stmt
->u
.V024
.pool
= ffesta_output_pool
;
6519 stmt
->u
.V024
.params
= ffestd_subr_copy_vxtcode_ ();
6520 stmt
->u
.V024
.list
= NULL
;
6521 ffestd_expr_list_
= &stmt
->u
.V024
.list
;
6522 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6527 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6528 ffestd_subr_vxt_ ();
6532 /* ffestd_V024_item -- DECODE statement i/o item
6534 ffestd_V024_item(expr,expr_token);
6536 Implement output-list expression. */
6539 ffestd_V024_item (ffebld expr
)
6541 ffestd_check_item_ ();
6543 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6546 ffeste_V024_item (expr
);
6549 ffestdExprItem_ item
6550 = (ffestdExprItem_
) malloc_new_kp (ffesta_output_pool
, "ffestdExprItem_",
6555 *ffestd_expr_list_
= item
;
6556 ffestd_expr_list_
= &item
->next
;
6561 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6565 /* ffestd_V024_finish -- DECODE statement list complete
6567 ffestd_V024_finish();
6569 Just wrap up any local activities. */
6572 ffestd_V024_finish ()
6574 ffestd_check_finish_ ();
6576 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6579 ffeste_V024_finish ();
6581 /* Nothing to do, it's implicit. */
6585 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6589 /* ffestd_V025_start -- DEFINEFILE statement list begin
6591 ffestd_V025_start();
6593 Verify that DEFINEFILE is valid here, and begin accepting items in the
6597 ffestd_V025_start ()
6599 ffestd_check_start_ ();
6601 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6604 ffestd_subr_line_now_ ();
6605 ffeste_V025_start ();
6610 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV025start_
);
6611 ffestd_stmt_append_ (stmt
);
6612 ffestd_subr_line_save_ (stmt
);
6613 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6618 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6619 ffestd_subr_vxt_ ();
6623 /* ffestd_V025_item -- DEFINE FILE statement item
6625 ffestd_V025_item(u,ut,m,mt,n,nt,asv,asvt);
6627 Implement item. Treat each item kind of like a separate statement,
6628 since there's really no need to treat them as an aggregate. */
6631 ffestd_V025_item (ffebld u
, ffebld m
, ffebld n
, ffebld asv
)
6633 ffestd_check_item_ ();
6635 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6638 ffeste_V025_item (u
, m
, n
, asv
);
6643 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV025item_
);
6644 ffestd_stmt_append_ (stmt
);
6645 stmt
->u
.V025item
.u
= u
;
6646 stmt
->u
.V025item
.m
= m
;
6647 stmt
->u
.V025item
.n
= n
;
6648 stmt
->u
.V025item
.asv
= asv
;
6653 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6657 /* ffestd_V025_finish -- DEFINE FILE statement list complete
6659 ffestd_V025_finish();
6661 Just wrap up any local activities. */
6664 ffestd_V025_finish ()
6666 ffestd_check_finish_ ();
6668 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6671 ffeste_V025_finish ();
6676 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV025finish_
);
6677 stmt
->u
.V025finish
.pool
= ffesta_output_pool
;
6678 ffestd_stmt_append_ (stmt
);
6683 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6687 /* ffestd_V026 -- FIND statement
6691 Make sure a FIND is valid in the current context, and implement it. */
6696 ffestd_check_simple_ ();
6698 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6701 ffestd_subr_line_now_ ();
6702 ffeste_V026 (&ffestp_file
.find
);
6707 stmt
= ffestd_stmt_new_ (FFESTD_stmtidV026_
);
6708 ffestd_stmt_append_ (stmt
);
6709 ffestd_subr_line_save_ (stmt
);
6710 stmt
->u
.V026
.pool
= ffesta_output_pool
;
6711 stmt
->u
.V026
.params
= ffestd_subr_copy_find_ ();
6712 ffesta_set_outpooldisp (FFESTA_pooldispPRESERVE
);
6717 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6718 ffestd_subr_vxt_ ();
6723 /* ffestd_V027_start -- VXT PARAMETER statement list begin
6725 ffestd_V027_start();
6727 Verify that PARAMETER is valid here, and begin accepting items in the list. */
6730 ffestd_V027_start ()
6732 ffestd_check_start_ ();
6734 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6735 fputs ("* PARAMETER_vxt ", dmpout
);
6737 #if FFECOM_targetCURRENT == FFECOM_targetGCC
6738 ffestd_subr_vxt_ ();
6743 /* ffestd_V027_item -- VXT PARAMETER statement assignment
6745 ffestd_V027_item(dest,dest_token,source,source_token);
6747 Make sure the source is a valid source for the destination; make the
6751 ffestd_V027_item (ffelexToken dest_token UNUSED
, ffebld source UNUSED
)
6753 ffestd_check_item_ ();
6755 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6756 fputs (ffelex_token_text (dest_token
), dmpout
);
6757 fputc ('=', dmpout
);
6758 ffebld_dump (source
);
6759 fputc (',', dmpout
);
6760 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6766 /* ffestd_V027_finish -- VXT PARAMETER statement list complete
6768 ffestd_V027_finish();
6770 Just wrap up any local activities. */
6773 ffestd_V027_finish ()
6775 ffestd_check_finish_ ();
6777 #if FFECOM_targetCURRENT == FFECOM_targetFFE
6778 fputc ('\n', dmpout
);
6779 #elif FFECOM_targetCURRENT == FFECOM_targetGCC
6785 /* Any executable statement. */
6790 ffestd_check_simple_ ();
6793 ffestd_subr_line_now_ ();
6799 stmt
= ffestd_stmt_new_ (FFESTD_stmtidR841_
);
6800 ffestd_stmt_append_ (stmt
);
6801 ffestd_subr_line_save_ (stmt
);