2 Copyright (C) 1997 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
22 /* From f/proj.h, which uses #error -- not all C compilers
23 support that, and we want _this_ program to be compilable
24 by pretty much any C compiler. */
26 #include "assert.j" /* Use gcc's assert.h. */
31 #define FFEINTRIN_DOC 1
36 #if !defined(false) || !defined(true)
39 #if !defined(FALSE) || !defined(TRUE)
42 Doggone_Trailing_Comma_Dont_Work
= 1
45 #define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
47 char *family_name (ffeintrinFamily family
);
48 static void dumpif (ffeintrinFamily fam
);
49 static void dumpendif (void);
50 static void dumpclearif (void);
51 static void dumpem (void);
52 static void dumpgen (int menu
, char *name
, char *name_uc
,
54 static void dumpspec (int menu
, char *name
, char *name_uc
,
56 static void dumpimp (int menu
, char *name
, char *name_uc
, size_t genno
, ffeintrinFamily family
,
57 ffeintrinImp imp
, ffeintrinSpec spec
);
58 static char *argument_info_ptr (ffeintrinImp imp
, int argno
);
59 static char *argument_info_string (ffeintrinImp imp
, int argno
);
60 static char *argument_name_ptr (ffeintrinImp imp
, int argno
);
61 static char *argument_name_string (ffeintrinImp imp
, int argno
);
63 static char *elaborate_if_complex (ffeintrinImp imp
, int argno
);
64 static char *elaborate_if_maybe_complex (ffeintrinImp imp
, int argno
);
65 static char *elaborate_if_real (ffeintrinImp imp
, int argno
);
67 static void print_type_string (char *c
);
70 main (int argc
, char **argv
)
75 Usage: intdoc > intdoc.texi\n\
76 Collects and dumps documentation on g77 intrinsics\n\
77 to the file named intdoc.texi.\n");
85 struct _ffeintrin_name_
91 ffeintrinSpec specific
;
94 struct _ffeintrin_gen_
96 char *name
; /* Name as seen in program. */
97 ffeintrinSpec specs
[2];
100 struct _ffeintrin_spec_
102 char *name
; /* Uppercase name as seen in source code,
103 lowercase if no source name, "none" if no
104 name at all (NONE case). */
105 bool is_actualarg
; /* Ok to pass as actual arg if -pedantic. */
106 ffeintrinFamily family
;
107 ffeintrinImp implementation
;
110 struct _ffeintrin_imp_
112 char *name
; /* Name of implementation. */
113 #if 0 /* FFECOM_targetCURRENT == FFECOM_targetGCC */
114 ffecomGfrt gfrt
; /* gfrt index in library. */
115 #endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
119 static struct _ffeintrin_name_ names
[] = {
120 #define DEFNAME(UPPER,LOWER,MIXED,GEN,SPEC) \
121 { UPPER, LOWER, MIXED, FFEINTRIN_ ## GEN, FFEINTRIN_ ## SPEC },
122 #define DEFGEN(CODE,NAME,SPEC1,SPEC2)
123 #define DEFSPEC(CODE,NAME,CALLABLE,FAMILY,IMP)
124 #define DEFIMP(CODE,NAME,GFRTDIRECT,GFRTF2C,GFRTGNU,CONTROL)
125 #include "intrin.def"
132 static struct _ffeintrin_gen_ gens
[] = {
133 #define DEFNAME(UPPER,LOWER,MIXED,GEN,SPEC)
134 #define DEFGEN(CODE,NAME,SPEC1,SPEC2) \
135 { NAME, { SPEC1, SPEC2, }, },
136 #define DEFSPEC(CODE,NAME,CALLABLE,FAMILY,IMP)
137 #define DEFIMP(CODE,NAME,GFRTDIRECT,GFRTF2C,GFRTGNU,CONTROL)
138 #include "intrin.def"
145 static struct _ffeintrin_imp_ imps
[] = {
146 #define DEFNAME(UPPER,LOWER,MIXED,GEN,SPEC)
147 #define DEFGEN(CODE,NAME,SPEC1,SPEC2)
148 #define DEFSPEC(CODE,NAME,CALLABLE,FAMILY,IMP)
149 #if 0 /* FFECOM_targetCURRENT == FFECOM_targetGCC */
150 #define DEFIMP(CODE,NAME,GFRTDIRECT,GFRTF2C,GFRTGNU,CONTROL) \
151 { NAME, FFECOM_gfrt ## GFRT, CONTROL },
152 #elif 1 /* FFECOM_targetCURRENT == FFECOM_targetFFE */
153 #define DEFIMP(CODE,NAME,GFRTDIRECT,GFRTF2C,GFRTGNU,CONTROL) \
158 #include "intrin.def"
165 static struct _ffeintrin_spec_ specs
[] = {
166 #define DEFNAME(UPPER,LOWER,MIXED,GEN,SPEC)
167 #define DEFGEN(CODE,NAME,SPEC1,SPEC2)
168 #define DEFSPEC(CODE,NAME,CALLABLE,FAMILY,IMP) \
169 { NAME, CALLABLE, FAMILY, IMP, },
170 #define DEFIMP(CODE,NAME,GFRTDIRECT,GFRTF2C,GFRTGNU,CONTROL)
171 #include "intrin.def"
177 struct cc_pair
{ ffeintrinImp imp
; char *text
; };
179 static char *descriptions
[FFEINTRIN_imp
] = { 0 };
180 static struct cc_pair cc_descriptions
[] = {
181 #define DEFDOC(IMP,SUMMARY,DESCRIPTION) { FFEINTRIN_imp ## IMP, DESCRIPTION },
186 static char *summaries
[FFEINTRIN_imp
] = { 0 };
187 static struct cc_pair cc_summaries
[] = {
188 #define DEFDOC(IMP,SUMMARY,DESCRIPTION) { FFEINTRIN_imp ## IMP, SUMMARY },
194 family_name (ffeintrinFamily family
)
198 case FFEINTRIN_familyF77
:
201 case FFEINTRIN_familyASC
:
204 case FFEINTRIN_familyMIL
:
207 case FFEINTRIN_familyGNU
:
210 case FFEINTRIN_familyF90
:
213 case FFEINTRIN_familyVXT
:
216 case FFEINTRIN_familyFVZ
:
219 case FFEINTRIN_familyF2C
:
222 case FFEINTRIN_familyF2U
:
225 case FFEINTRIN_familyBADU77
:
226 return "familyBADU77";
229 assert ("bad family" == NULL
);
234 static int in_ifset
= 0;
235 static ffeintrinFamily latest_family
= FFEINTRIN_familyNONE
;
238 dumpif (ffeintrinFamily fam
)
240 assert (fam
!= FFEINTRIN_familyNONE
);
242 || (fam
!= latest_family
))
245 printf ("@end ifset\n");
247 printf ("@ifset %s\n", family_name (fam
));
262 || (latest_family
!= FFEINTRIN_familyNONE
))
263 printf ("@end ifset\n");
264 latest_family
= FFEINTRIN_familyNONE
;
273 for (i
= 0; ((size_t) i
) < ARRAY_SIZE (cc_descriptions
); ++i
)
275 assert (descriptions
[cc_descriptions
[i
].imp
] == NULL
);
276 descriptions
[cc_descriptions
[i
].imp
] = cc_descriptions
[i
].text
;
279 for (i
= 0; ((size_t) i
) < ARRAY_SIZE (cc_summaries
); ++i
)
281 assert (summaries
[cc_summaries
[i
].imp
] == NULL
);
282 summaries
[cc_summaries
[i
].imp
] = cc_summaries
[i
].text
;
285 printf ("@c This file is automatically derived from intdoc.c, intdoc.in,\n");
286 printf ("@c ansify.c, intrin.def, and intrin.h. Edit those files instead.\n");
288 for (i
= 0; ((size_t) i
) < ARRAY_SIZE (names
); ++i
)
290 if (names
[i
].generic
!= FFEINTRIN_genNONE
)
291 dumpgen (1, names
[i
].name_ic
, names
[i
].name_uc
,
293 if (names
[i
].specific
!= FFEINTRIN_specNONE
)
294 dumpspec (1, names
[i
].name_ic
, names
[i
].name_uc
,
299 printf ("@end menu\n\n");
301 for (i
= 0; ((size_t) i
) < ARRAY_SIZE (names
); ++i
)
303 if (names
[i
].generic
!= FFEINTRIN_genNONE
)
304 dumpgen (0, names
[i
].name_ic
, names
[i
].name_uc
,
306 if (names
[i
].specific
!= FFEINTRIN_specNONE
)
307 dumpspec (0, names
[i
].name_ic
, names
[i
].name_uc
,
314 dumpgen (int menu
, char *name
, char *name_uc
, ffeintrinGen gen
)
321 for (i
= 0; i
< ARRAY_SIZE (gens
[gen
].specs
); ++i
)
323 if (gens
[gen
].specs
[i
] != FFEINTRIN_specNONE
)
328 for (i
= 0; i
< ARRAY_SIZE (gens
[gen
].specs
); ++i
)
333 if ((spec
= gens
[gen
].specs
[i
]) == FFEINTRIN_specNONE
)
336 dumpif (specs
[spec
].family
);
337 dumpimp (menu
, name
, name_uc
, i
, specs
[spec
].family
, specs
[spec
].implementation
,
339 if (!menu
&& (total
> 0))
344 For information on another intrinsic with the same name:\n");
349 For information on other intrinsics with the same name:\n");
351 for (j
= 0; j
< ARRAY_SIZE (gens
[gen
].specs
); ++j
)
355 if ((spec
= gens
[gen
].specs
[j
]) == FFEINTRIN_specNONE
)
357 printf ("@xref{%s Intrinsic (%s)}.\n",
358 name
, specs
[spec
].name
);
367 dumpspec (int menu
, char *name
, char *name_uc
, ffeintrinSpec spec
)
369 dumpif (specs
[spec
].family
);
370 dumpimp (menu
, name
, name_uc
, 0, specs
[spec
].family
, specs
[spec
].implementation
,
376 dumpimp (int menu
, char *name
, char *name_uc
, size_t genno
, ffeintrinFamily family
, ffeintrinImp imp
,
386 assert ((imp
!= FFEINTRIN_impNONE
) || !genno
);
390 printf ("* %s Intrinsic",
392 if (spec
!= FFEINTRIN_specNONE
)
393 printf (" (%s)", specs
[spec
].name
); /* See XYZZY1 below */
395 #define INDENT_SUMMARY 24
396 if ((imp
== FFEINTRIN_impNONE
)
397 || (summaries
[imp
] != NULL
))
399 int spaces
= INDENT_SUMMARY
- 14 - strlen (name
);
402 if (spec
!= FFEINTRIN_specNONE
)
403 spaces
-= (3 + strlen (specs
[spec
].name
)); /* See XYZZY1 above */
409 if (imp
== FFEINTRIN_impNONE
)
411 printf ("(Reserved for future use.)\n");
415 for (c
= summaries
[imp
]; c
[0] != '\0'; ++c
)
421 int argno
= c
[1] - '0';
427 argno
= 10 * argno
+ (c
[0] - '0');
430 assert (c
[0] == '@');
433 else if (argno
== 99)
434 { /* Yeah, this is a major kludge. */
436 spaces
= INDENT_SUMMARY
+ 1;
441 printf ("%s", argument_name_string (imp
, argno
- 1));
444 fputc (c
[0], stdout
);
451 printf ("@node %s Intrinsic", name
);
452 if (spec
!= FFEINTRIN_specNONE
)
453 printf (" (%s)", specs
[spec
].name
);
454 printf ("\n@subsubsection %s Intrinsic", name
);
455 if (spec
!= FFEINTRIN_specNONE
)
456 printf (" (%s)", specs
[spec
].name
);
457 printf ("\n@cindex %s intrinsic\n@cindex intrinsics, %s\n",
460 if (imp
== FFEINTRIN_impNONE
)
463 This intrinsic is not yet implemented.\n\
464 The name is, however, reserved as an intrinsic.\n\
465 Use @samp{EXTERNAL %s} to use this name for an\n\
466 external procedure.\n\
473 c
= imps
[imp
].control
;
474 subr
= (c
[0] == '-');
475 colon
= (c
[2] == ':') ? 2 : 3;
481 (subr
? "CALL " : ""), name
);
485 for (argno
= 0; ; ++argno
)
487 argc
= argument_name_ptr (imp
, argno
);
492 printf ("@var{%s}", argc
);
493 argi
= argument_info_string (imp
, argno
);
498 printf ("-1, @var{%s}-2, @dots{}, @var{%s}-n",
513 if ((c
[colon
+ 1] >= '0')
514 && (c
[colon
+ 1] <= '9'))
516 other_arg
= c
[colon
+ 1] - '0';
517 arg_string
= argument_name_string (imp
, other_arg
);
518 arg_info
= argument_info_string (imp
, other_arg
);
530 print_type_string (c
);
531 printf (" function");
536 assert (other_arg
>= 0);
538 if ((arg_info
[0] == '?') || (arg_info
[0] == '!') || (arg_info
[0] == '+')
539 || (arg_info
[0] == '*') || (arg_info
[0] == 'n') || (arg_info
[0] == 'p'))
541 if ((arg_info
[0] == 'F') || (arg_info
[0] == 'N'))
543 The exact type is @samp{REAL(KIND=1)} when argument @var{%s} is\n\
544 any type other than @code{COMPLEX}, or when it is @code{COMPLEX(KIND=1)}.\n\
545 When @var{%s} is any @code{COMPLEX} type other than @code{COMPLEX(KIND=1)},\n\
546 this intrinsic is valid only when used as the argument to\n\
547 @code{REAL()}, as explained below.\n\n",
552 This intrinsic is valid when argument @var{%s} is\n\
553 @code{COMPLEX(KIND=1)}.\n\
554 When @var{%s} is any other @code{COMPLEX} type,\n\
555 this intrinsic is valid only when used as the argument to\n\
556 @code{REAL()}, as explained below.\n\n",
561 else if ((c
[0] == 'I')
563 printf (", the exact type being wide enough to hold a pointer\n\
564 on the target system (typically @code{INTEGER(KIND=1)} or @code{INTEGER(KIND=4)}).\n\n");
566 else if ((c
[1] == '=')
567 && (c
[colon
+ 1] >= '0')
568 && (c
[colon
+ 1] <= '9'))
570 assert (other_arg
>= 0);
572 if ((arg_info
[0] == '?') || (arg_info
[0] == '!') || (arg_info
[0] == '+')
573 || (arg_info
[0] == '*') || (arg_info
[0] == 'n') || (arg_info
[0] == 'p'))
576 if (((c
[0] == arg_info
[0])
577 && ((c
[0] == 'A') || (c
[0] == 'C') || (c
[0] == 'I')
578 || (c
[0] == 'L') || (c
[0] == 'R')))
580 && (arg_info
[0] == 'C'))
582 && (arg_info
[0] == 'R')))
583 printf (", the @samp{KIND=} value of the type being that of argument @var{%s}.\n\n",
585 else if ((c
[0] == 'S')
586 && ((arg_info
[0] == 'C')
587 || (arg_info
[0] == 'F')
588 || (arg_info
[0] == 'N')))
590 The exact type depends on that of argument @var{%s}---if @var{%s} is\n\
591 @code{COMPLEX}, this function's type is @code{REAL}\n\
592 with the same @samp{KIND=} value as the type of @var{%s}.\n\
593 Otherwise, this function's type is the same as that of @var{%s}.\n\n",
594 arg_string
, arg_string
, arg_string
, arg_string
);
596 printf (", the exact type being that of argument @var{%s}.\n\n",
599 else if ((c
[1] == '=')
600 && (c
[colon
+ 1] == '*'))
601 printf (", the exact type being the result of cross-promoting the\n\
602 types of all the arguments.\n\n");
603 else if (c
[1] == '=')
604 assert ("?0:?:" == NULL
);
609 for (argno
= 0, argc
= &c
[colon
+ 3]; *argc
!= '\0'; ++argno
)
611 char optionality
= '\0';
625 printf ("%c", *argc
);
636 optionality
= *(argc
++);
641 length
= *++argc
- '0';
643 length
= 10 * length
+ (*(argc
++) - '0');
650 elements
= *++argc
- '0';
652 elements
= 10 * elements
+ (*(argc
++) - '0');
655 else if (*argc
== '&')
680 assert ("kind arg" == NULL
);
686 assert ((kind
== '1') || (kind
== '*'));
687 printf ("@code{CHARACTER");
689 printf ("*%d", length
);
697 printf ("@code{COMPLEX}");
700 case '1': case '2': case '3': case '4': case '5':
701 case '6': case '7': case '8': case '9':
702 printf ("@code{COMPLEX(KIND=%d)}", (kind
- '0'));
706 printf ("Same @samp{KIND=} value as for @var{%s}",
707 argument_name_string (imp
, 0));
711 assert ("Ca" == NULL
);
720 printf ("@code{INTEGER}");
723 case '1': case '2': case '3': case '4': case '5':
724 case '6': case '7': case '8': case '9':
725 printf ("@code{INTEGER(KIND=%d)}", (kind
- '0'));
729 printf ("@code{INTEGER} with same @samp{KIND=} value as for @var{%s}",
730 argument_name_string (imp
, 0));
734 printf ("@code{INTEGER} wide enough to hold a pointer");
738 assert ("Ia" == NULL
);
747 printf ("@code{LOGICAL}");
750 case '1': case '2': case '3': case '4': case '5':
751 case '6': case '7': case '8': case '9':
752 printf ("@code{LOGICAL(KIND=%d)}", (kind
- '0'));
756 printf ("@code{LOGICAL} with same @samp{KIND=} value as for @var{%s}",
757 argument_name_string (imp
, 0));
761 assert ("La" == NULL
);
770 printf ("@code{REAL}");
773 case '1': case '2': case '3': case '4': case '5':
774 case '6': case '7': case '8': case '9':
775 printf ("@code{REAL(KIND=%d)}", (kind
- '0'));
779 printf ("@code{REAL} with same @samp{KIND=} value as for @var{%s}",
780 argument_name_string (imp
, 0));
784 assert ("Ra" == NULL
);
793 printf ("@code{INTEGER} or @code{LOGICAL}");
796 case '1': case '2': case '3': case '4': case '5':
797 case '6': case '7': case '8': case '9':
798 printf ("@code{INTEGER(KIND=%d)} or @code{LOGICAL(KIND=%d)}",
799 (kind
- '0'), (kind
- '0'));
803 printf ("Same type and @samp{KIND=} value as for @var{%s}",
804 argument_name_string (imp
, 0));
808 assert ("Ba" == NULL
);
817 printf ("@code{REAL} or @code{COMPLEX}");
820 case '1': case '2': case '3': case '4': case '5':
821 case '6': case '7': case '8': case '9':
822 printf ("@code{REAL(KIND=%d)} or @code{COMPLEX(KIND=%d)}",
823 (kind
- '0'), (kind
- '0'));
827 printf ("Same type as @var{%s}",
828 argument_name_string (imp
, 0));
832 assert ("Fa" == NULL
);
841 printf ("@code{INTEGER}, @code{REAL}, or @code{COMPLEX}");
844 case '1': case '2': case '3': case '4': case '5':
845 case '6': case '7': case '8': case '9':
846 printf ("@code{INTEGER(KIND=%d)}, @code{REAL(KIND=%d)}, or @code{COMPLEX(KIND=%d)}",
847 (kind
- '0'), (kind
- '0'), (kind
- '0'));
851 assert ("N1" == NULL
);
860 printf ("@code{INTEGER} or @code{REAL}");
863 case '1': case '2': case '3': case '4': case '5':
864 case '6': case '7': case '8': case '9':
865 printf ("@code{INTEGER(KIND=%d)} or @code{REAL(KIND=%d)}",
866 (kind
- '0'), (kind
- '0'));
870 printf ("@code{INTEGER} or @code{REAL} with same @samp{KIND=} value as for @var{%s}",
871 argument_name_string (imp
, 0));
875 assert ("Sa" == NULL
);
881 printf ("@samp{*@var{label}}, where @var{label} is the label\n\
882 of an executable statement");
886 printf ("Signal handler (@code{INTEGER FUNCTION} or @code{SUBROUTINE})\n\
887 or dummy/global @code{INTEGER(KIND=1)} scalar");
891 assert ("arg type?" == NULL
);
901 printf ("; OPTIONAL (must be omitted if @var{%s} is @code{COMPLEX})",
902 argument_name_string (imp
, argno
-1));
906 printf ("; OPTIONAL");
910 printf ("; OPTIONAL");
918 printf ("; at least two such arguments must be provided");
922 assert ("optionality!" == NULL
);
938 assert (extra
!= '\0');
939 printf ("; DIMENSION(%d)", elements
);
948 printf ("; INTENT(IN)");
955 printf ("; cannot be a constant or expression");
959 printf ("; INTENT(OUT)");
963 printf ("; INTENT(INOUT)");
972 Intrinsic groups: ");
975 case FFEINTRIN_familyF77
:
976 printf ("(standard FORTRAN 77).");
979 case FFEINTRIN_familyGNU
:
980 printf ("@code{gnu}.");
983 case FFEINTRIN_familyASC
:
984 printf ("@code{f2c}, @code{f90}.");
987 case FFEINTRIN_familyMIL
:
988 printf ("@code{mil}, @code{f90}, @code{vxt}.");
991 case FFEINTRIN_familyF90
:
992 printf ("@code{f90}.");
995 case FFEINTRIN_familyVXT
:
996 printf ("@code{vxt}.");
999 case FFEINTRIN_familyFVZ
:
1000 printf ("@code{f2c}, @code{vxt}.");
1003 case FFEINTRIN_familyF2C
:
1004 printf ("@code{f2c}.");
1007 case FFEINTRIN_familyF2U
:
1008 printf ("@code{unix}.");
1011 case FFEINTRIN_familyBADU77
:
1012 printf ("@code{badu77}.");
1016 assert ("bad family" == NULL
);
1017 printf ("@code{???}.");
1022 if (descriptions
[imp
] != NULL
)
1024 char *c
= descriptions
[imp
];
1031 while (c
[0] != '\0')
1037 int argno
= c
[1] - '0';
1040 while ((c
[0] >= '0')
1043 argno
= 10 * argno
+ (c
[0] - '0');
1046 assert (c
[0] == '@');
1048 printf ("%s", name_uc
);
1050 printf ("%s", argument_name_string (imp
, argno
- 1));
1053 fputc (c
[0], stdout
);
1062 argument_info_ptr (ffeintrinImp imp
, int argno
)
1064 char *c
= imps
[imp
].control
;
1065 static char arginfos
[8][32];
1066 static int argx
= 0;
1076 while ((c
[0] != ',') && (c
[0] != '\0'))
1086 for (; (c
[0] != '=') && (c
[0] != '\0'); ++c
)
1089 assert (c
[0] == '=');
1091 for (i
= 0, ++c
; (c
[0] != ',') && (c
[0] != '\0'); ++c
, ++i
)
1092 arginfos
[argx
][i
] = c
[0];
1094 arginfos
[argx
][i
] = '\0';
1096 c
= &arginfos
[argx
][0];
1098 if (((size_t) argx
) >= ARRAY_SIZE (arginfos
))
1105 argument_info_string (ffeintrinImp imp
, int argno
)
1109 p
= argument_info_ptr (imp
, argno
);
1115 argument_name_ptr (ffeintrinImp imp
, int argno
)
1117 char *c
= imps
[imp
].control
;
1118 static char argnames
[8][32];
1119 static int argx
= 0;
1129 while ((c
[0] != ',') && (c
[0] != '\0'))
1139 for (i
= 0; (c
[0] != '=') && (c
[0] != '\0'); ++c
, ++i
)
1140 argnames
[argx
][i
] = c
[0];
1142 assert (c
[0] == '=');
1143 argnames
[argx
][i
] = '\0';
1145 c
= &argnames
[argx
][0];
1147 if (((size_t) argx
) >= ARRAY_SIZE (argnames
))
1154 argument_name_string (ffeintrinImp imp
, int argno
)
1158 p
= argument_name_ptr (imp
, argno
);
1164 print_type_string (char *c
)
1172 assert ((kind
== '1') || (kind
== '='));
1174 printf ("@code{CHARACTER*1}");
1177 assert (c
[2] == '*');
1178 printf ("@code{CHARACTER*(*)}");
1186 printf ("@code{COMPLEX}");
1189 case '1': case '2': case '3': case '4': case '5':
1190 case '6': case '7': case '8': case '9':
1191 printf ("@code{COMPLEX(KIND=%d)}", (kind
- '0'));
1195 assert ("Ca" == NULL
);
1204 printf ("@code{INTEGER}");
1207 case '1': case '2': case '3': case '4': case '5':
1208 case '6': case '7': case '8': case '9':
1209 printf ("@code{INTEGER(KIND=%d)}", (kind
- '0'));
1213 printf ("@code{INTEGER(KIND=0)}");
1217 assert ("Ia" == NULL
);
1226 printf ("@code{LOGICAL}");
1229 case '1': case '2': case '3': case '4': case '5':
1230 case '6': case '7': case '8': case '9':
1231 printf ("@code{LOGICAL(KIND=%d)}", (kind
- '0'));
1235 assert ("La" == NULL
);
1244 printf ("@code{REAL}");
1247 case '1': case '2': case '3': case '4': case '5':
1248 case '6': case '7': case '8': case '9':
1249 printf ("@code{REAL(KIND=%d)}", (kind
- '0'));
1253 printf ("@code{REAL}");
1257 assert ("Ra" == NULL
);
1266 printf ("@code{INTEGER} or @code{LOGICAL}");
1269 case '1': case '2': case '3': case '4': case '5':
1270 case '6': case '7': case '8': case '9':
1271 printf ("@code{INTEGER(KIND=%d)} or @code{LOGICAL(KIND=%d)}",
1272 (kind
- '0'), (kind
- '0'));
1276 assert ("Ba" == NULL
);
1285 printf ("@code{REAL} or @code{COMPLEX}");
1288 case '1': case '2': case '3': case '4': case '5':
1289 case '6': case '7': case '8': case '9':
1290 printf ("@code{REAL(KIND=%d)} or @code{COMPLEX(KIND=%d)}",
1291 (kind
- '0'), (kind
- '0'));
1295 assert ("Fa" == NULL
);
1304 printf ("@code{INTEGER}, @code{REAL}, or @code{COMPLEX}");
1307 case '1': case '2': case '3': case '4': case '5':
1308 case '6': case '7': case '8': case '9':
1309 printf ("@code{INTEGER(KIND=%d)}, @code{REAL(KIND=%d)}, or @code{COMPLEX(KIND=%d)}",
1310 (kind
- '0'), (kind
- '0'), (kind
- '0'));
1314 assert ("N1" == NULL
);
1323 printf ("@code{INTEGER} or @code{REAL}");
1326 case '1': case '2': case '3': case '4': case '5':
1327 case '6': case '7': case '8': case '9':
1328 printf ("@code{INTEGER(KIND=%d)} or @code{REAL(KIND=%d)}",
1329 (kind
- '0'), (kind
- '0'));
1333 assert ("Sa" == NULL
);
1339 assert ("arg type?" == NULL
);