2 Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
3 Contributed by Steven Bosscher
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
23 /* Actually this is just a collection of routines that used to be
24 scattered around the sources. Now that they are all in a single
25 file, almost all of them can be static, and the other files don't
26 have this mess in them.
28 As a nice side-effect, this file can act as documentation of the
29 gfc_code and gfc_expr structures and all their friends and
37 /* Keep track of indentation for symbol tree dumps. */
38 static int show_level
= 0;
41 /* Forward declaration because this one needs all, and all need
43 static void gfc_show_expr (gfc_expr
*);
45 /* Do indentation for a specific level. */
48 code_indent (int level
, gfc_st_label
* label
)
53 gfc_status ("%-5d ", label
->value
);
57 for (i
= 0; i
< 2 * level
; i
++)
58 gfc_status_char (' ');
62 /* Simple indentation at the current level. This one
63 is used to show symbols. */
68 code_indent (show_level
, NULL
);
72 /* Show type-specific information. */
74 gfc_show_typespec (gfc_typespec
* ts
)
77 gfc_status ("(%s ", gfc_basic_typename (ts
->type
));
82 gfc_status ("%s", ts
->derived
->name
);
86 gfc_show_expr (ts
->cl
->length
);
90 gfc_status ("%d", ts
->kind
);
98 /* Show an actual argument list. */
101 gfc_show_actual_arglist (gfc_actual_arglist
* a
)
106 for (; a
; a
= a
->next
)
108 gfc_status_char ('(');
110 gfc_status ("%s = ", a
->name
);
112 gfc_show_expr (a
->expr
);
114 gfc_status ("(arg not-present)");
116 gfc_status_char (')');
125 /* Show a gfc_array_spec array specification structure. */
128 gfc_show_array_spec (gfc_array_spec
* as
)
139 gfc_status ("(%d", as
->rank
);
145 case AS_EXPLICIT
: c
= "AS_EXPLICIT"; break;
146 case AS_DEFERRED
: c
= "AS_DEFERRED"; break;
147 case AS_ASSUMED_SIZE
: c
= "AS_ASSUMED_SIZE"; break;
148 case AS_ASSUMED_SHAPE
: c
= "AS_ASSUMED_SHAPE"; break;
151 ("gfc_show_array_spec(): Unhandled array shape type.");
153 gfc_status (" %s ", c
);
155 for (i
= 0; i
< as
->rank
; i
++)
157 gfc_show_expr (as
->lower
[i
]);
158 gfc_status_char (' ');
159 gfc_show_expr (as
->upper
[i
]);
160 gfc_status_char (' ');
168 /* Show a gfc_array_ref array reference structure. */
171 gfc_show_array_ref (gfc_array_ref
* ar
)
175 gfc_status_char ('(');
184 for (i
= 0; i
< ar
->dimen
; i
++)
186 /* There are two types of array sections: either the
187 elements are identified by an integer array ('vector'),
188 or by an index range. In the former case we only have to
189 print the start expression which contains the vector, in
190 the latter case we have to print any of lower and upper
191 bound and the stride, if they're present. */
193 if (ar
->start
[i
] != NULL
)
194 gfc_show_expr (ar
->start
[i
]);
196 if (ar
->dimen_type
[i
] == DIMEN_RANGE
)
198 gfc_status_char (':');
200 if (ar
->end
[i
] != NULL
)
201 gfc_show_expr (ar
->end
[i
]);
203 if (ar
->stride
[i
] != NULL
)
205 gfc_status_char (':');
206 gfc_show_expr (ar
->stride
[i
]);
210 if (i
!= ar
->dimen
- 1)
216 for (i
= 0; i
< ar
->dimen
; i
++)
218 gfc_show_expr (ar
->start
[i
]);
219 if (i
!= ar
->dimen
- 1)
225 gfc_status ("UNKNOWN");
229 gfc_internal_error ("gfc_show_array_ref(): Unknown array reference");
232 gfc_status_char (')');
236 /* Show a list of gfc_ref structures. */
239 gfc_show_ref (gfc_ref
* p
)
242 for (; p
; p
= p
->next
)
246 gfc_show_array_ref (&p
->u
.ar
);
250 gfc_status (" %% %s", p
->u
.c
.component
->name
);
254 gfc_status_char ('(');
255 gfc_show_expr (p
->u
.ss
.start
);
256 gfc_status_char (':');
257 gfc_show_expr (p
->u
.ss
.end
);
258 gfc_status_char (')');
262 gfc_internal_error ("gfc_show_ref(): Bad component code");
267 /* Display a constructor. Works recursively for array constructors. */
270 gfc_show_constructor (gfc_constructor
* c
)
273 for (; c
; c
= c
->next
)
275 if (c
->iterator
== NULL
)
276 gfc_show_expr (c
->expr
);
279 gfc_status_char ('(');
280 gfc_show_expr (c
->expr
);
282 gfc_status_char (' ');
283 gfc_show_expr (c
->iterator
->var
);
284 gfc_status_char ('=');
285 gfc_show_expr (c
->iterator
->start
);
286 gfc_status_char (',');
287 gfc_show_expr (c
->iterator
->end
);
288 gfc_status_char (',');
289 gfc_show_expr (c
->iterator
->step
);
291 gfc_status_char (')');
300 /* Show an expression. */
303 gfc_show_expr (gfc_expr
* p
)
314 switch (p
->expr_type
)
317 c
= p
->value
.character
.string
;
319 for (i
= 0; i
< p
->value
.character
.length
; i
++, c
++)
324 gfc_status ("%c", *c
);
327 gfc_show_ref (p
->ref
);
331 gfc_status ("%s(", p
->ts
.derived
->name
);
332 gfc_show_constructor (p
->value
.constructor
);
333 gfc_status_char (')');
338 gfc_show_constructor (p
->value
.constructor
);
341 gfc_show_ref (p
->ref
);
345 gfc_status ("NULL()");
352 mpz_out_str (stdout
, 10, p
->value
.integer
);
354 if (p
->ts
.kind
!= gfc_default_integer_kind
)
355 gfc_status ("_%d", p
->ts
.kind
);
359 if (p
->value
.logical
)
360 gfc_status (".true.");
362 gfc_status (".false.");
366 mpfr_out_str (stdout
, 10, 0, p
->value
.real
, GFC_RND_MODE
);
367 if (p
->ts
.kind
!= gfc_default_real_kind
)
368 gfc_status ("_%d", p
->ts
.kind
);
372 c
= p
->value
.character
.string
;
374 gfc_status_char ('\'');
376 for (i
= 0; i
< p
->value
.character
.length
; i
++, c
++)
381 gfc_status_char (*c
);
384 gfc_status_char ('\'');
389 gfc_status ("(complex ");
391 mpfr_out_str (stdout
, 10, 0, p
->value
.complex.r
, GFC_RND_MODE
);
392 if (p
->ts
.kind
!= gfc_default_complex_kind
)
393 gfc_status ("_%d", p
->ts
.kind
);
397 mpfr_out_str (stdout
, 10, 0, p
->value
.complex.i
, GFC_RND_MODE
);
398 if (p
->ts
.kind
!= gfc_default_complex_kind
)
399 gfc_status ("_%d", p
->ts
.kind
);
412 if (p
->symtree
->n
.sym
->ns
&& p
->symtree
->n
.sym
->ns
->proc_name
)
413 gfc_status ("%s:", p
->symtree
->n
.sym
->ns
->proc_name
->name
);
414 gfc_status ("%s", p
->symtree
->n
.sym
->name
);
415 gfc_show_ref (p
->ref
);
420 switch (p
->value
.op
.operator)
422 case INTRINSIC_UPLUS
:
425 case INTRINSIC_UMINUS
:
431 case INTRINSIC_MINUS
:
434 case INTRINSIC_TIMES
:
437 case INTRINSIC_DIVIDE
:
440 case INTRINSIC_POWER
:
443 case INTRINSIC_CONCAT
:
456 gfc_status ("NEQV ");
482 ("gfc_show_expr(): Bad intrinsic in expression!");
485 gfc_show_expr (p
->value
.op
.op1
);
490 gfc_show_expr (p
->value
.op
.op2
);
497 if (p
->value
.function
.name
== NULL
)
499 gfc_status ("%s[", p
->symtree
->n
.sym
->name
);
500 gfc_show_actual_arglist (p
->value
.function
.actual
);
501 gfc_status_char (']');
505 gfc_status ("%s[[", p
->value
.function
.name
);
506 gfc_show_actual_arglist (p
->value
.function
.actual
);
507 gfc_status_char (']');
508 gfc_status_char (']');
514 gfc_internal_error ("gfc_show_expr(): Don't know how to show expr");
519 /* Show symbol attributes. The flavor and intent are followed by
520 whatever single bit attributes are present. */
523 gfc_show_attr (symbol_attribute
* attr
)
526 gfc_status ("(%s %s %s %s", gfc_code2string (flavors
, attr
->flavor
),
527 gfc_intent_string (attr
->intent
),
528 gfc_code2string (access_types
, attr
->access
),
529 gfc_code2string (procedures
, attr
->proc
));
531 if (attr
->allocatable
)
532 gfc_status (" ALLOCATABLE");
534 gfc_status (" DIMENSION");
536 gfc_status (" EXTERNAL");
538 gfc_status (" INTRINSIC");
540 gfc_status (" OPTIONAL");
542 gfc_status (" POINTER");
544 gfc_status (" SAVE");
546 gfc_status (" TARGET");
548 gfc_status (" DUMMY");
550 gfc_status (" RESULT");
552 gfc_status (" ENTRY");
555 gfc_status (" DATA");
557 gfc_status (" USE-ASSOC");
558 if (attr
->in_namelist
)
559 gfc_status (" IN-NAMELIST");
561 gfc_status (" IN-COMMON");
564 gfc_status (" FUNCTION");
565 if (attr
->subroutine
)
566 gfc_status (" SUBROUTINE");
567 if (attr
->implicit_type
)
568 gfc_status (" IMPLICIT-TYPE");
571 gfc_status (" SEQUENCE");
573 gfc_status (" ELEMENTAL");
575 gfc_status (" PURE");
577 gfc_status (" RECURSIVE");
583 /* Show components of a derived type. */
586 gfc_show_components (gfc_symbol
* sym
)
590 for (c
= sym
->components
; c
; c
= c
->next
)
592 gfc_status ("(%s ", c
->name
);
593 gfc_show_typespec (&c
->ts
);
595 gfc_status (" POINTER");
597 gfc_status (" DIMENSION");
598 gfc_status_char (' ');
599 gfc_show_array_spec (c
->as
);
602 gfc_status_char (' ');
607 /* Show a symbol. If a symbol is an ENTRY, SUBROUTINE or FUNCTION, we
608 show the interface. Information needed to reconstruct the list of
609 specific interfaces associated with a generic symbol is done within
613 gfc_show_symbol (gfc_symbol
* sym
)
615 gfc_formal_arglist
*formal
;
623 gfc_status ("symbol %s ", sym
->name
);
624 gfc_show_typespec (&sym
->ts
);
625 gfc_show_attr (&sym
->attr
);
630 gfc_status ("value: ");
631 gfc_show_expr (sym
->value
);
637 gfc_status ("Array spec:");
638 gfc_show_array_spec (sym
->as
);
644 gfc_status ("Generic interfaces:");
645 for (intr
= sym
->generic
; intr
; intr
= intr
->next
)
646 gfc_status (" %s", intr
->sym
->name
);
652 gfc_status ("result: %s", sym
->result
->name
);
658 gfc_status ("components: ");
659 gfc_show_components (sym
);
665 gfc_status ("Formal arglist:");
667 for (formal
= sym
->formal
; formal
; formal
= formal
->next
)
669 if (formal
->sym
!= NULL
)
670 gfc_status (" %s", formal
->sym
->name
);
672 gfc_status (" [Alt Return]");
679 gfc_status ("Formal namespace");
680 gfc_show_namespace (sym
->formal_ns
);
683 gfc_status_char ('\n');
687 /* Show a user-defined operator. Just prints an operator
688 and the name of the associated subroutine, really. */
690 show_uop (gfc_user_op
* uop
)
695 gfc_status ("%s:", uop
->name
);
697 for (intr
= uop
->operator; intr
; intr
= intr
->next
)
698 gfc_status (" %s", intr
->sym
->name
);
702 /* Workhorse function for traversing the user operator symtree. */
705 traverse_uop (gfc_symtree
* st
, void (*func
) (gfc_user_op
*))
713 traverse_uop (st
->left
, func
);
714 traverse_uop (st
->right
, func
);
718 /* Traverse the tree of user operator nodes. */
721 gfc_traverse_user_op (gfc_namespace
* ns
, void (*func
) (gfc_user_op
*))
724 traverse_uop (ns
->uop_root
, func
);
728 /* Function to display a common block. */
731 show_common (gfc_symtree
* st
)
736 gfc_status ("common: /%s/ ", st
->name
);
738 s
= st
->n
.common
->head
;
741 gfc_status ("%s", s
->name
);
746 gfc_status_char ('\n');
749 /* Worker function to display the symbol tree. */
752 show_symtree (gfc_symtree
* st
)
756 gfc_status ("symtree: %s Ambig %d", st
->name
, st
->ambiguous
);
758 if (st
->n
.sym
->ns
!= gfc_current_ns
)
759 gfc_status (" from namespace %s", st
->n
.sym
->ns
->proc_name
->name
);
761 gfc_show_symbol (st
->n
.sym
);
765 /******************* Show gfc_code structures **************/
769 static void gfc_show_code_node (int level
, gfc_code
* c
);
771 /* Show a list of code structures. Mutually recursive with
772 gfc_show_code_node(). */
775 gfc_show_code (int level
, gfc_code
* c
)
778 for (; c
; c
= c
->next
)
779 gfc_show_code_node (level
, c
);
783 /* Show a single code node and everything underneath it if necessary. */
786 gfc_show_code_node (int level
, gfc_code
* c
)
788 gfc_forall_iterator
*fa
;
798 code_indent (level
, c
->here
);
807 gfc_status ("CONTINUE");
811 gfc_status ("ENTRY %s", c
->ext
.entry
->sym
->name
);
815 gfc_status ("ASSIGN ");
816 gfc_show_expr (c
->expr
);
817 gfc_status_char (' ');
818 gfc_show_expr (c
->expr2
);
821 case EXEC_LABEL_ASSIGN
:
822 gfc_status ("LABEL ASSIGN ");
823 gfc_show_expr (c
->expr
);
824 gfc_status (" %d", c
->label
->value
);
827 case EXEC_POINTER_ASSIGN
:
828 gfc_status ("POINTER ASSIGN ");
829 gfc_show_expr (c
->expr
);
830 gfc_status_char (' ');
831 gfc_show_expr (c
->expr2
);
835 gfc_status ("GOTO ");
837 gfc_status ("%d", c
->label
->value
);
840 gfc_show_expr (c
->expr
);
845 for (; d
; d
= d
->block
)
847 code_indent (level
, d
->label
);
848 if (d
->block
!= NULL
)
849 gfc_status_char (',');
851 gfc_status_char (')');
858 gfc_status ("CALL %s ", c
->resolved_sym
->name
);
859 gfc_show_actual_arglist (c
->ext
.actual
);
863 gfc_status ("RETURN ");
865 gfc_show_expr (c
->expr
);
869 gfc_status ("PAUSE ");
872 gfc_show_expr (c
->expr
);
874 gfc_status ("%d", c
->ext
.stop_code
);
879 gfc_status ("STOP ");
882 gfc_show_expr (c
->expr
);
884 gfc_status ("%d", c
->ext
.stop_code
);
888 case EXEC_ARITHMETIC_IF
:
890 gfc_show_expr (c
->expr
);
891 gfc_status (" %d, %d, %d",
892 c
->label
->value
, c
->label2
->value
, c
->label3
->value
);
898 gfc_show_expr (d
->expr
);
899 gfc_status_char ('\n');
900 gfc_show_code (level
+ 1, d
->next
);
903 for (; d
; d
= d
->block
)
905 code_indent (level
, 0);
908 gfc_status ("ELSE\n");
911 gfc_status ("ELSE IF ");
912 gfc_show_expr (d
->expr
);
913 gfc_status_char ('\n');
916 gfc_show_code (level
+ 1, d
->next
);
919 code_indent (level
, c
->label
);
921 gfc_status ("ENDIF");
926 gfc_status ("SELECT CASE ");
927 gfc_show_expr (c
->expr
);
928 gfc_status_char ('\n');
930 for (; d
; d
= d
->block
)
932 code_indent (level
, 0);
934 gfc_status ("CASE ");
935 for (cp
= d
->ext
.case_list
; cp
; cp
= cp
->next
)
937 gfc_status_char ('(');
938 gfc_show_expr (cp
->low
);
939 gfc_status_char (' ');
940 gfc_show_expr (cp
->high
);
941 gfc_status_char (')');
942 gfc_status_char (' ');
944 gfc_status_char ('\n');
946 gfc_show_code (level
+ 1, d
->next
);
949 code_indent (level
, c
->label
);
950 gfc_status ("END SELECT");
954 gfc_status ("WHERE ");
957 gfc_show_expr (d
->expr
);
958 gfc_status_char ('\n');
960 gfc_show_code (level
+ 1, d
->next
);
962 for (d
= d
->block
; d
; d
= d
->block
)
964 code_indent (level
, 0);
965 gfc_status ("ELSE WHERE ");
966 gfc_show_expr (d
->expr
);
967 gfc_status_char ('\n');
968 gfc_show_code (level
+ 1, d
->next
);
971 code_indent (level
, 0);
972 gfc_status ("END WHERE");
977 gfc_status ("FORALL ");
978 for (fa
= c
->ext
.forall_iterator
; fa
; fa
= fa
->next
)
980 gfc_show_expr (fa
->var
);
981 gfc_status_char (' ');
982 gfc_show_expr (fa
->start
);
983 gfc_status_char (':');
984 gfc_show_expr (fa
->end
);
985 gfc_status_char (':');
986 gfc_show_expr (fa
->stride
);
988 if (fa
->next
!= NULL
)
989 gfc_status_char (',');
994 gfc_status_char (',');
995 gfc_show_expr (c
->expr
);
997 gfc_status_char ('\n');
999 gfc_show_code (level
+ 1, c
->block
->next
);
1001 code_indent (level
, 0);
1002 gfc_status ("END FORALL");
1008 gfc_show_expr (c
->ext
.iterator
->var
);
1009 gfc_status_char ('=');
1010 gfc_show_expr (c
->ext
.iterator
->start
);
1011 gfc_status_char (' ');
1012 gfc_show_expr (c
->ext
.iterator
->end
);
1013 gfc_status_char (' ');
1014 gfc_show_expr (c
->ext
.iterator
->step
);
1015 gfc_status_char ('\n');
1017 gfc_show_code (level
+ 1, c
->block
->next
);
1019 code_indent (level
, 0);
1020 gfc_status ("END DO");
1024 gfc_status ("DO WHILE ");
1025 gfc_show_expr (c
->expr
);
1026 gfc_status_char ('\n');
1028 gfc_show_code (level
+ 1, c
->block
->next
);
1030 code_indent (level
, c
->label
);
1031 gfc_status ("END DO");
1035 gfc_status ("CYCLE");
1037 gfc_status (" %s", c
->symtree
->n
.sym
->name
);
1041 gfc_status ("EXIT");
1043 gfc_status (" %s", c
->symtree
->n
.sym
->name
);
1047 gfc_status ("ALLOCATE ");
1050 gfc_status (" STAT=");
1051 gfc_show_expr (c
->expr
);
1054 for (a
= c
->ext
.alloc_list
; a
; a
= a
->next
)
1056 gfc_status_char (' ');
1057 gfc_show_expr (a
->expr
);
1062 case EXEC_DEALLOCATE
:
1063 gfc_status ("DEALLOCATE ");
1066 gfc_status (" STAT=");
1067 gfc_show_expr (c
->expr
);
1070 for (a
= c
->ext
.alloc_list
; a
; a
= a
->next
)
1072 gfc_status_char (' ');
1073 gfc_show_expr (a
->expr
);
1079 gfc_status ("OPEN");
1084 gfc_status (" UNIT=");
1085 gfc_show_expr (open
->unit
);
1089 gfc_status (" IOMSG=");
1090 gfc_show_expr (open
->iomsg
);
1094 gfc_status (" IOSTAT=");
1095 gfc_show_expr (open
->iostat
);
1099 gfc_status (" FILE=");
1100 gfc_show_expr (open
->file
);
1104 gfc_status (" STATUS=");
1105 gfc_show_expr (open
->status
);
1109 gfc_status (" ACCESS=");
1110 gfc_show_expr (open
->access
);
1114 gfc_status (" FORM=");
1115 gfc_show_expr (open
->form
);
1119 gfc_status (" RECL=");
1120 gfc_show_expr (open
->recl
);
1124 gfc_status (" BLANK=");
1125 gfc_show_expr (open
->blank
);
1129 gfc_status (" POSITION=");
1130 gfc_show_expr (open
->position
);
1134 gfc_status (" ACTION=");
1135 gfc_show_expr (open
->action
);
1139 gfc_status (" DELIM=");
1140 gfc_show_expr (open
->delim
);
1144 gfc_status (" PAD=");
1145 gfc_show_expr (open
->pad
);
1147 if (open
->err
!= NULL
)
1148 gfc_status (" ERR=%d", open
->err
->value
);
1153 gfc_status ("CLOSE");
1154 close
= c
->ext
.close
;
1158 gfc_status (" UNIT=");
1159 gfc_show_expr (close
->unit
);
1163 gfc_status (" IOMSG=");
1164 gfc_show_expr (close
->iomsg
);
1168 gfc_status (" IOSTAT=");
1169 gfc_show_expr (close
->iostat
);
1173 gfc_status (" STATUS=");
1174 gfc_show_expr (close
->status
);
1176 if (close
->err
!= NULL
)
1177 gfc_status (" ERR=%d", close
->err
->value
);
1180 case EXEC_BACKSPACE
:
1181 gfc_status ("BACKSPACE");
1185 gfc_status ("ENDFILE");
1189 gfc_status ("REWIND");
1193 gfc_status ("FLUSH");
1196 fp
= c
->ext
.filepos
;
1200 gfc_status (" UNIT=");
1201 gfc_show_expr (fp
->unit
);
1205 gfc_status (" IOMSG=");
1206 gfc_show_expr (fp
->iomsg
);
1210 gfc_status (" IOSTAT=");
1211 gfc_show_expr (fp
->iostat
);
1213 if (fp
->err
!= NULL
)
1214 gfc_status (" ERR=%d", fp
->err
->value
);
1218 gfc_status ("INQUIRE");
1223 gfc_status (" UNIT=");
1224 gfc_show_expr (i
->unit
);
1228 gfc_status (" FILE=");
1229 gfc_show_expr (i
->file
);
1234 gfc_status (" IOMSG=");
1235 gfc_show_expr (i
->iomsg
);
1239 gfc_status (" IOSTAT=");
1240 gfc_show_expr (i
->iostat
);
1244 gfc_status (" EXIST=");
1245 gfc_show_expr (i
->exist
);
1249 gfc_status (" OPENED=");
1250 gfc_show_expr (i
->opened
);
1254 gfc_status (" NUMBER=");
1255 gfc_show_expr (i
->number
);
1259 gfc_status (" NAMED=");
1260 gfc_show_expr (i
->named
);
1264 gfc_status (" NAME=");
1265 gfc_show_expr (i
->name
);
1269 gfc_status (" ACCESS=");
1270 gfc_show_expr (i
->access
);
1274 gfc_status (" SEQUENTIAL=");
1275 gfc_show_expr (i
->sequential
);
1280 gfc_status (" DIRECT=");
1281 gfc_show_expr (i
->direct
);
1285 gfc_status (" FORM=");
1286 gfc_show_expr (i
->form
);
1290 gfc_status (" FORMATTED");
1291 gfc_show_expr (i
->formatted
);
1295 gfc_status (" UNFORMATTED=");
1296 gfc_show_expr (i
->unformatted
);
1300 gfc_status (" RECL=");
1301 gfc_show_expr (i
->recl
);
1305 gfc_status (" NEXTREC=");
1306 gfc_show_expr (i
->nextrec
);
1310 gfc_status (" BLANK=");
1311 gfc_show_expr (i
->blank
);
1315 gfc_status (" POSITION=");
1316 gfc_show_expr (i
->position
);
1320 gfc_status (" ACTION=");
1321 gfc_show_expr (i
->action
);
1325 gfc_status (" READ=");
1326 gfc_show_expr (i
->read
);
1330 gfc_status (" WRITE=");
1331 gfc_show_expr (i
->write
);
1335 gfc_status (" READWRITE=");
1336 gfc_show_expr (i
->readwrite
);
1340 gfc_status (" DELIM=");
1341 gfc_show_expr (i
->delim
);
1345 gfc_status (" PAD=");
1346 gfc_show_expr (i
->pad
);
1350 gfc_status (" ERR=%d", i
->err
->value
);
1354 gfc_status ("IOLENGTH ");
1355 gfc_show_expr (c
->expr
);
1359 gfc_status ("READ");
1363 gfc_status ("WRITE");
1369 gfc_status (" UNIT=");
1370 gfc_show_expr (dt
->io_unit
);
1373 if (dt
->format_expr
)
1375 gfc_status (" FMT=");
1376 gfc_show_expr (dt
->format_expr
);
1379 if (dt
->format_label
!= NULL
)
1380 gfc_status (" FMT=%d", dt
->format_label
->value
);
1382 gfc_status (" NML=%s", dt
->namelist
->name
);
1386 gfc_status (" IOMSG=");
1387 gfc_show_expr (dt
->iomsg
);
1391 gfc_status (" IOSTAT=");
1392 gfc_show_expr (dt
->iostat
);
1396 gfc_status (" SIZE=");
1397 gfc_show_expr (dt
->size
);
1401 gfc_status (" REC=");
1402 gfc_show_expr (dt
->rec
);
1406 gfc_status (" ADVANCE=");
1407 gfc_show_expr (dt
->advance
);
1413 gfc_status ("TRANSFER ");
1414 gfc_show_expr (c
->expr
);
1418 gfc_status ("DT_END");
1421 if (dt
->err
!= NULL
)
1422 gfc_status (" ERR=%d", dt
->err
->value
);
1423 if (dt
->end
!= NULL
)
1424 gfc_status (" END=%d", dt
->end
->value
);
1425 if (dt
->eor
!= NULL
)
1426 gfc_status (" EOR=%d", dt
->eor
->value
);
1430 gfc_internal_error ("gfc_show_code_node(): Bad statement code");
1433 gfc_status_char ('\n');
1437 /* Show and equivalence chain. */
1440 gfc_show_equiv (gfc_equiv
*eq
)
1443 gfc_status ("Equivalence: ");
1446 gfc_show_expr (eq
->expr
);
1454 /* Show a freakin' whole namespace. */
1457 gfc_show_namespace (gfc_namespace
* ns
)
1459 gfc_interface
*intr
;
1460 gfc_namespace
*save
;
1461 gfc_intrinsic_op op
;
1465 save
= gfc_current_ns
;
1469 gfc_status ("Namespace:");
1477 while (i
< GFC_LETTERS
- 1
1478 && gfc_compare_types(&ns
->default_type
[i
+1],
1479 &ns
->default_type
[l
]))
1483 gfc_status(" %c-%c: ", l
+'A', i
+'A');
1485 gfc_status(" %c: ", l
+'A');
1487 gfc_show_typespec(&ns
->default_type
[l
]);
1489 } while (i
< GFC_LETTERS
);
1491 if (ns
->proc_name
!= NULL
)
1494 gfc_status ("procedure name = %s", ns
->proc_name
->name
);
1497 gfc_current_ns
= ns
;
1498 gfc_traverse_symtree (ns
->common_root
, show_common
);
1500 gfc_traverse_symtree (ns
->sym_root
, show_symtree
);
1502 for (op
= GFC_INTRINSIC_BEGIN
; op
!= GFC_INTRINSIC_END
; op
++)
1504 /* User operator interfaces */
1505 intr
= ns
->operator[op
];
1510 gfc_status ("Operator interfaces for %s:", gfc_op2string (op
));
1512 for (; intr
; intr
= intr
->next
)
1513 gfc_status (" %s", intr
->sym
->name
);
1516 if (ns
->uop_root
!= NULL
)
1519 gfc_status ("User operators:\n");
1520 gfc_traverse_user_op (ns
, show_uop
);
1524 for (eq
= ns
->equiv
; eq
; eq
= eq
->next
)
1525 gfc_show_equiv (eq
);
1527 gfc_status_char ('\n');
1528 gfc_status_char ('\n');
1530 gfc_show_code (0, ns
->code
);
1532 for (ns
= ns
->contained
; ns
; ns
= ns
->sibling
)
1535 gfc_status ("CONTAINS\n");
1536 gfc_show_namespace (ns
);
1540 gfc_status_char ('\n');
1541 gfc_current_ns
= save
;