annotate conv/c.c @ 411:32c1914308db

ENDIAN_L ENDIAN_D
author kono
date Tue, 19 Oct 2004 18:15:41 +0900
parents e77b3a7002ad
children 464e7480395c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
60
aa779bcffef7 CwC converters
kono
parents:
diff changeset
1 #define EXTERN /**/
aa779bcffef7 CwC converters
kono
parents:
diff changeset
2
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 82
diff changeset
3 #include <stdio.h>
60
aa779bcffef7 CwC converters
kono
parents:
diff changeset
4 #include "mc.h"
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 82
diff changeset
5 #include "mc-parse.h"
60
aa779bcffef7 CwC converters
kono
parents:
diff changeset
6
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 82
diff changeset
7 #include "conv/conv.h"
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
8 #include "conv/convdef.h"
82
25654dc29ecc First Floating Point coding done.
kono
parents: 79
diff changeset
9 #include "conv/c.h"
60
aa779bcffef7 CwC converters
kono
parents:
diff changeset
10
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
11 extern void type_print(int type,NMTBL *nptr,FILE *out);
74
6de658ae384c *** empty log message ***
kono
parents: 72
diff changeset
12 extern void type_print1(int type,NMTBL *nptr,FILE *out,int cont);
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
13 extern void sym_print(int type,FILE *out);
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
14
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
15 static FILE *vout,*svout;
dba8d111b7a0 c output
kono
parents: 68
diff changeset
16 static FILE *null;
60
aa779bcffef7 CwC converters
kono
parents:
diff changeset
17
aa779bcffef7 CwC converters
kono
parents:
diff changeset
18 static void
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
19 comment_(int c)
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
20 {
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
21 fprintf(vout,"%c",c);
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
22 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
23
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
24 static void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
25 open_(char *s)
65
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
26 {
346
969089695850 name reconfigure.... continue...
kono
parents: 327
diff changeset
27 char *p;
969089695850 name reconfigure.... continue...
kono
parents: 327
diff changeset
28 p = make_filename_with_extension(s,".cc");
77
2b8ba655e572 fix arg type
kono
parents: 76
diff changeset
29 #if 1
65
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
30 vout = fopen(p,"w");
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
31 #else
dba8d111b7a0 c output
kono
parents: 68
diff changeset
32 vout = stderr;p=p;
dba8d111b7a0 c output
kono
parents: 68
diff changeset
33 #endif
dba8d111b7a0 c output
kono
parents: 68
diff changeset
34 null=fopen("/dev/null","w");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
35 if (!vout) error(-1);
65
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
36 }
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
37
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
38 static void
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
39 conv_()
dba8d111b7a0 c output
kono
parents: 68
diff changeset
40 {
dba8d111b7a0 c output
kono
parents: 68
diff changeset
41 vout=svout;
dba8d111b7a0 c output
kono
parents: 68
diff changeset
42 }
dba8d111b7a0 c output
kono
parents: 68
diff changeset
43
dba8d111b7a0 c output
kono
parents: 68
diff changeset
44 static void
dba8d111b7a0 c output
kono
parents: 68
diff changeset
45 noconv_(int c)
dba8d111b7a0 c output
kono
parents: 68
diff changeset
46 {
dba8d111b7a0 c output
kono
parents: 68
diff changeset
47 svout=vout;
dba8d111b7a0 c output
kono
parents: 68
diff changeset
48 vout=c?null:vout;
dba8d111b7a0 c output
kono
parents: 68
diff changeset
49 }
dba8d111b7a0 c output
kono
parents: 68
diff changeset
50
dba8d111b7a0 c output
kono
parents: 68
diff changeset
51 static void
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
52 print_(char *s)
60
aa779bcffef7 CwC converters
kono
parents:
diff changeset
53 {
aa779bcffef7 CwC converters
kono
parents:
diff changeset
54 fprintf(vout,"c: %s\n",s);
aa779bcffef7 CwC converters
kono
parents:
diff changeset
55 }
65
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
56
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
57 static void
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
58 close_()
65
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
59 {
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
60 fclose(vout);
8ad746efa4f8 *** empty log message ***
kono
parents: 60
diff changeset
61 }
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
62
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
63 void
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
64 case_begin_(int cases,int def){
254a0c576114 argument type list
kono
parents: 66
diff changeset
65 fprintf(vout,"case ");
254a0c576114 argument type list
kono
parents: 66
diff changeset
66 }
254a0c576114 argument type list
kono
parents: 66
diff changeset
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
68 void
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
69 case_(int cases,int def){
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
70 if (def)
254a0c576114 argument type list
kono
parents: 66
diff changeset
71 fprintf(vout,"default:");
254a0c576114 argument type list
kono
parents: 66
diff changeset
72 else
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
73 fprintf(vout,"%d:",car(cases));
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
74 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
75
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
76 void
79
82d0e30f61dd *** empty log message ***
kono
parents: 77
diff changeset
77 code_(NMTBL *n){
82d0e30f61dd *** empty log message ***
kono
parents: 77
diff changeset
78 int args;
82d0e30f61dd *** empty log message ***
kono
parents: 77
diff changeset
79 args=n->dsp;
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
80 fprintf(vout,"code %s(",n->nm);
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
81 while(args) {
79
82d0e30f61dd *** empty log message ***
kono
parents: 77
diff changeset
82 n=(NMTBL *)caddr(args);
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
83 type_print(n->ty,n,vout);
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
84 args=cadr(args);
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
85 if(args) fprintf(vout,",");
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
86 }
76
fb3fb9e9a462 *** empty log message ***
kono
parents: 75
diff changeset
87 fprintf(vout,")\n{");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
88 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
89
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
90 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
91 code_end_(){
76
fb3fb9e9a462 *** empty log message ***
kono
parents: 75
diff changeset
92 fprintf(vout,"}");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
93 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
94
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
95 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
96 comma_(){
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
97 fprintf(vout,",");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
98 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
99
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
100 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
101 cond_(){
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
102
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
103 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
104
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
105 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
106 cond1_(){
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
107 fprintf(vout,"?");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
108 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
109
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
110 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
111 cond2_(){
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
112 fprintf(vout,":");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
113 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
114
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
115 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
116 cond_end_(){
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
117
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
118 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
119
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
120 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
121 decl_data_begin_(){
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
122
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
123 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
124
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
125 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
126 decl_data_end_(){
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
127
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
128 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
129
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
130 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
131 def_(NMTBL *n){
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
132 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
133
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
134 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
135 dowhile_(){
72
3b5d293cea36 type def etc
kono
parents: 71
diff changeset
136 fprintf(vout,"do");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
137 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
138
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
139 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
140 dowhile_cond_(){
72
3b5d293cea36 type def etc
kono
parents: 71
diff changeset
141 fprintf(vout,"while(");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
142 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
143
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
144 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
145 dowhile_end_(){
72
3b5d293cea36 type def etc
kono
parents: 71
diff changeset
146 fprintf(vout,");");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
147 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
148
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
149 int
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
150 error_(n){
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
151 return 0;
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
152 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
153
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
154 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
155 extern_(){
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
156 fprintf(vout,"extern ");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
157 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
158
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
159 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
160 for_(){
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
161 fprintf(vout,"for(");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
162 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
163
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
164 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
165 for1_(){
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
166 fprintf(vout,";");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
167 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
168
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
169 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
170 for2_(){
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
171 fprintf(vout,";");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
172 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
173
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
174 void
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
175 for_body_(){
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
176 fprintf(vout,")");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
177 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
178
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
179 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
180 for_end_(){
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
181
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
182 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
183
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
184 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
185 funcall_(int type){
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
186 fprintf(vout,"(");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
187 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
188
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
189 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
190 funcall_args_(){
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
191 fprintf(vout,")");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
192 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
193
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
194 void
79
82d0e30f61dd *** empty log message ***
kono
parents: 77
diff changeset
195 function_(NMTBL *n,int cont){
82d0e30f61dd *** empty log message ***
kono
parents: 77
diff changeset
196 int args;
75
92dcf107a837 c code output
kono
parents: 74
diff changeset
197 type_print1(n->ty,0,vout,cont);
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
198 fprintf(vout,"%s(",n->nm);
79
82d0e30f61dd *** empty log message ***
kono
parents: 77
diff changeset
199 args=n->dsp;
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
200 while(args) {
79
82d0e30f61dd *** empty log message ***
kono
parents: 77
diff changeset
201 n=(NMTBL *)caddr(args);
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
202 type_print(n->ty,n,vout);
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
203 args=cadr(args);
76
fb3fb9e9a462 *** empty log message ***
kono
parents: 75
diff changeset
204 if(args) {
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 82
diff changeset
205 /* if(caddr(args)==(int)&str_ret) break; */
76
fb3fb9e9a462 *** empty log message ***
kono
parents: 75
diff changeset
206 fprintf(vout,",");
fb3fb9e9a462 *** empty log message ***
kono
parents: 75
diff changeset
207 }
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
208 }
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
209 fprintf(vout,")");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
210 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
211
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
212 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
213 function_end_(){
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
214
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
215 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
216
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
217 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
218 goto_(){
76
fb3fb9e9a462 *** empty log message ***
kono
parents: 75
diff changeset
219 fprintf(vout,"goto ");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
220 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
221
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
222 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
223 goto_label_(){
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
224
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
225 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
226
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
227 void
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
228 id_(int sym,NMTBL *nptr){
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
229 fprintf(vout,"%s",nptr->nm);
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
230 }
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
231
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
232 void
348
e77b3a7002ad name table reconfigure compiled. debug start.
kono
parents: 346
diff changeset
233 string_(char *s,int len){
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
234 int c;
dba8d111b7a0 c output
kono
parents: 68
diff changeset
235 fprintf(vout,"\"");
dba8d111b7a0 c output
kono
parents: 68
diff changeset
236 while((c=*s++)) {
dba8d111b7a0 c output
kono
parents: 68
diff changeset
237 if(c=='\n') fprintf(vout,"\\n");
dba8d111b7a0 c output
kono
parents: 68
diff changeset
238 else if(c=='\r') fprintf(vout,"\\r");
dba8d111b7a0 c output
kono
parents: 68
diff changeset
239 else if(c=='\e') fprintf(vout,"\\e");
dba8d111b7a0 c output
kono
parents: 68
diff changeset
240 else if(!(' '<=c&&c<=0x7f)) fprintf(vout,"\\%03o",c);
dba8d111b7a0 c output
kono
parents: 68
diff changeset
241 else fprintf(vout,"%c",c);
dba8d111b7a0 c output
kono
parents: 68
diff changeset
242 }
dba8d111b7a0 c output
kono
parents: 68
diff changeset
243 fprintf(vout,"\"");
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
244 }
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
245
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
246 void
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
247 const_(int symval){
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
248 fprintf(vout,"%d",symval);
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
249 }
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
250
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
251 void
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
252 return_f_(){
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
253 fprintf(vout,"return");
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
254 }
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
255
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
256 void
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
257 defined_(char *s){
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
258 fprintf(vout,"defined(%s)",s);
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
259 }
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
260
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
261 void
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
262 environment_(){
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
263 fprintf(vout,"environment");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
264 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
265
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
266 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
267 if_(){
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
268 fprintf(vout,"if (");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
269 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
270
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
271 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
272 if_else_(){
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
273 fprintf(vout," else ");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
274 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
275
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
276 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
277 if_endif_(){
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
278 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
279
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
280 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
281 if_then_(){
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
282 fprintf(vout,")");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
283 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
284
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
285 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
286 jump_(int env){
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
287
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
288 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
289
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
290 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
291 label_(){
72
3b5d293cea36 type def etc
kono
parents: 71
diff changeset
292 fprintf(vout,"%s:",nptr->nm);
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
293 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
294
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
295 void
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
296 lpar_(){
254a0c576114 argument type list
kono
parents: 66
diff changeset
297 fprintf(vout,"(");
254a0c576114 argument type list
kono
parents: 66
diff changeset
298 }
254a0c576114 argument type list
kono
parents: 66
diff changeset
299
254a0c576114 argument type list
kono
parents: 66
diff changeset
300 void
254a0c576114 argument type list
kono
parents: 66
diff changeset
301 rpar_(){
254a0c576114 argument type list
kono
parents: 66
diff changeset
302 fprintf(vout,")");
254a0c576114 argument type list
kono
parents: 66
diff changeset
303 }
254a0c576114 argument type list
kono
parents: 66
diff changeset
304
254a0c576114 argument type list
kono
parents: 66
diff changeset
305 void
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
306 lbra_(int sym){
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
307 fprintf(vout,"[");
254a0c576114 argument type list
kono
parents: 66
diff changeset
308 }
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
309
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
310 void
254a0c576114 argument type list
kono
parents: 66
diff changeset
311 rbra_(int sym){
254a0c576114 argument type list
kono
parents: 66
diff changeset
312 fprintf(vout,"]");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
313 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
314
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
315 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
316 lc_(){
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
317 fprintf(vout,"{");
254a0c576114 argument type list
kono
parents: 66
diff changeset
318 }
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
319
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
320 void
254a0c576114 argument type list
kono
parents: 66
diff changeset
321 rc_(){
254a0c576114 argument type list
kono
parents: 66
diff changeset
322 fprintf(vout,"}");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
323 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
324
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
325 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
326 localvar_end_(){
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
327
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
328 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
329
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
330 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
331 op_(int sym){
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
332 sym_print(sym,vout);
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
333 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
334
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
335 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
336 postfix_(int sym){
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
337 sym_print(sym,vout);
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
338 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
339
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
340 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
341 prefix_(int sym){
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
342 sym_print(sym,vout);
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
343 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
344
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
345 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
346 register_(){
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
347 fprintf(vout,"register ");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
348 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
349
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
350 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
351 return_(){
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
352 fprintf(vout,"return ");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
353 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
354
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
355 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
356 return_end_(){
70
2e84590720a6 typedef name
kono
parents: 69
diff changeset
357 fprintf(vout,";");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
358 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
359
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
360 void
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
361 return_type_(int t,NMTBL *nptr,int cont){
74
6de658ae384c *** empty log message ***
kono
parents: 72
diff changeset
362 type_print1(t,nptr,vout,cont);
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
363 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
364
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
365 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
366 sm_(){
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
367 fprintf(vout,";");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
368 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
369
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
370 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
371 static_(){
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
372 fprintf(vout,"static ");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
373 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
374
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
375 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
376 switch_(){
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
377 fprintf(vout,"switch (");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
378 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
379
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
380 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
381 switch_body_(){
71
be313430f90b *** empty log message ***
kono
parents: 70
diff changeset
382 fprintf(vout,")");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
383 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
384
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
385 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
386 switch_end_(){
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
387 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
388
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
389 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
390 typedef_(){
67
254a0c576114 argument type list
kono
parents: 66
diff changeset
391 fprintf(vout,"typedef ");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
392 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
393
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
394 void
70
2e84590720a6 typedef name
kono
parents: 69
diff changeset
395 sdecl_(int s)
2e84590720a6 typedef name
kono
parents: 69
diff changeset
396 {
2e84590720a6 typedef name
kono
parents: 69
diff changeset
397 fprintf(vout,s==UNION?"union ":"struct ");
2e84590720a6 typedef name
kono
parents: 69
diff changeset
398 }
2e84590720a6 typedef name
kono
parents: 69
diff changeset
399
2e84590720a6 typedef name
kono
parents: 69
diff changeset
400 void
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
401 while_(){
68
0266905063b5 *** empty log message ***
kono
parents: 67
diff changeset
402 fprintf(vout,"while (");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
403 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
404
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
405 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
406 while_body_(){
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
407 fprintf(vout,")");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
408 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
409
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
410 void
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
411 while_end_(){
69
dba8d111b7a0 c output
kono
parents: 68
diff changeset
412 }
dba8d111b7a0 c output
kono
parents: 68
diff changeset
413
dba8d111b7a0 c output
kono
parents: 68
diff changeset
414 void
dba8d111b7a0 c output
kono
parents: 68
diff changeset
415 decl_data_()
dba8d111b7a0 c output
kono
parents: 68
diff changeset
416 {
dba8d111b7a0 c output
kono
parents: 68
diff changeset
417 }
dba8d111b7a0 c output
kono
parents: 68
diff changeset
418
dba8d111b7a0 c output
kono
parents: 68
diff changeset
419 void
dba8d111b7a0 c output
kono
parents: 68
diff changeset
420 break_()
dba8d111b7a0 c output
kono
parents: 68
diff changeset
421 {
dba8d111b7a0 c output
kono
parents: 68
diff changeset
422 fprintf(vout,"break;");
dba8d111b7a0 c output
kono
parents: 68
diff changeset
423 }
dba8d111b7a0 c output
kono
parents: 68
diff changeset
424
dba8d111b7a0 c output
kono
parents: 68
diff changeset
425 void
dba8d111b7a0 c output
kono
parents: 68
diff changeset
426 continue_()
dba8d111b7a0 c output
kono
parents: 68
diff changeset
427 {
dba8d111b7a0 c output
kono
parents: 68
diff changeset
428 fprintf(vout,"continue;");
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
429 }
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
430
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
431 /* end */