Pristine Ack-5.5
[Ack-5.5.git] / modules / src / em_opt / outcalls.c
1 #ifndef NORCSID
2 static char rcsidp4[] = "$Id: outcalls.c,v 2.8 1994/06/24 11:14:23 ceriel Exp $";
3 #endif
4
5 #include "parser.h"
6
7 outputincalls()
8 {
9         struct idf *op;
10         char *s;
11         for(op=ops;op!=(struct idf *)NULL;op=op->id_nextidf) {
12                 s = op->id_text;
13                 switch(op->id_argfmt) {
14                 case NOARG:
15                         fprintf(ofile,"%s\t|\t|\n",s);
16                         if(op->id_used) {
17                                 fprintf(ofile,"\tEM_Nop(op_%s);\n",s);
18                                 fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
19                         }
20                         else {
21                                 fprintf(ofile,"\tFLUSHDFA();\n");
22                                 fprintf(ofile,"\tC_%s();\n",s);
23                         }
24                         break;
25                 case CSTOPT:
26                         fprintf(ofile,"%s_narg\t|\t|\n",s);
27                         if(op->id_used) {
28                                 fprintf(ofile,"\tEM_Nnarg(op_%s);\n",s);
29                                 fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
30                         }
31                         else {
32                                 fprintf(ofile,"\tFLUSHDFA();\n");
33                                 fprintf(ofile,"\tC_%s_narg();\n",s);
34                         }
35                         /* fall thru */
36                 case CST:
37                         fprintf(ofile,"%s\t| arith:n\t|\n",s);
38                         if(op->id_used) {
39                                 fprintf(ofile,"\tEM_Ncst(op_%s,n);\n",s);
40                                 fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
41                         }
42                         else {
43                                 fprintf(ofile,"\tFLUSHDFA();\n");
44                                 fprintf(ofile,"\tC_%s(n);\n",s);
45                         }
46                         break;
47                 case DEFILB:
48                         fprintf(ofile,"df_ilb\t| label:l\t|\n");
49                         if(op->id_used) {
50                                 fprintf(ofile,"\tEM_Ndefilb(op_%s,l);\n",s);
51                                 fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
52                         }
53                         else {
54                                 fprintf(ofile,"\tFLUSHDFA();\n");
55                                 fprintf(ofile,"\tC_df_ilb(l);\n",s);
56                         }
57                         break;
58                 case PNAM:
59                         fprintf(ofile,"%s\t| char *:s\t|\n",s);
60                         if(op->id_used) {
61                                 fprintf(ofile,"\tEM_Npro(op_%s,s);\n",s);
62                                 fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
63                         }
64                         else {
65                                 fprintf(ofile,"\tFLUSHDFA();\n");
66                                 fprintf(ofile,"\tC_%s(s);\n",s);
67                         }
68                         break;
69                 case LAB:
70                         fprintf(ofile,"%s\t| label:l\t|\n",s);
71                         if(op->id_used) {
72                                 fprintf(ofile,"\tEM_Nilb(op_%s,l);\n",s);
73                                 fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
74                         }
75                         else {
76                                 fprintf(ofile,"\tFLUSHDFA();\n");
77                                 fprintf(ofile,"\tC_%s(l);\n",s);
78                         }
79                         break;
80                 case EXT:
81                         fprintf(ofile,"%s\t| arith:n\t|\n",s);
82                         if(op->id_used) {
83                                 fprintf(ofile,"\tEM_Ncst(op_%s,n);\n",s);
84                                 fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
85                         }
86                         else {
87                                 fprintf(ofile,"\tFLUSHDFA();\n");
88                                 fprintf(ofile,"\tC_%s(n);\n",s);
89                         }
90                         fprintf(ofile,"%s_dnam\t| char *:s arith:n\t|\n",s);
91                         if(op->id_used) {
92                                 fprintf(ofile,"\tEM_Nsof(op_%s,s,n);\n",s);
93                                 fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
94                         }
95                         else {
96                                 fprintf(ofile,"\tFLUSHDFA();\n");
97                                 fprintf(ofile,"\tC_%s_dnam(s,n);\n",s);
98                         }
99                         fprintf(ofile,"%s_dlb\t| label:l arith:n\t|\n",s);
100                         if(op->id_used) {
101                                 fprintf(ofile,"\tEM_Nnof(op_%s,l,n);\n",s);
102                                 fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
103                         }
104                         else {
105                                 fprintf(ofile,"\tFLUSHDFA();\n");
106                                 fprintf(ofile,"\tC_%s_dlb(l,n);\n",s);
107                         }
108                         break;
109                 }
110         }
111 }