-
Notifications
You must be signed in to change notification settings - Fork 1
/
dcl1.c
474 lines (333 loc) · 5.23 KB
/
dcl1.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
signed TS_SIGNED;
unsigned TS_UNSIGNED;
char TS_CHAR;
signed char TS_SCHAR;
unsigned char TS_UCHAR;
int TS_INT;
signed int TS_SINT;
unsigned int TS_UINT;
short TS_SHORT;
signed short TS_SSHORT;
unsigned short TS_USHORT;
short int TS_SHORT_INT;
signed short int TS_SSHORT_INT;
unsigned short int TS_USHORT_INT;
long TS_LONG;
signed long TS_SLONG;
unsigned long TS_ULONG;
long int TS_LONG_INT;
signed long int TS_SLONG_INT;
unsigned long int TS_ULONG_INT;
float TS_FLOAT;
long long TS_LONG_LONG;
signed long long TS_SLONG_LONG;
unsigned long long TS_ULONG_LONG;
long long int TS_LONG_LONG_INT;
signed long long int TS_SLONG_LONG_INT;
unsigned long long int TS_ULONG_LONG_INT;
double TS_DOUBLE;
long double TS_LONG_DOUBLE;
double long TS_DOUBLE_LONG;
typedef int III;
int a_func(int a)
{
}
int a_func(int a);
int a_func(a);
int b_func(a, b, c)
register int a,b;
int c();
{
}
enum en;
enum en;
enum en {A,B,C};
enum {D=2,E=4, F} enn;
enum en en1;
typedef void (*ptr_to_func) (int);
ptr_to_func signal2(int, ptr_to_func);
void * const func(int, ...);
const char *pc;
void restoretoken2(char *s);
int f1;
char a;
extern char *ar[];
typedef char t_a;
t_a cha;
char (*ar2)[10];
void b(int *, int b, int c);
void ffffffff(void);
void (*signal(int sig, void (*func)(long int a, int signed b)))(int b);
typedef int *INT;
typedef INT * p;
typedef p pp;
typedef int const *ii;
extern ii * const p2;
pp f2();
long int li;
unsigned const long typedef int volatile *kum;
typedef int int1;
volatile int1 const int2;
char r( p param);
const p extern extp;
void v( const void *);
int function(a,b,c);
typedef int ia[10];
ia *ia_p;
void f__(ia *, int a);
int i1,i2,*i3;
struct a;
struct a;
struct a{ int v;
};
union {
int c;
}cc1, cc2, cc3;
union uuu{int a;};
typedef union ttt{
int v;
} ttt;
typedef struct {
struct {
int b;
}b;
struct a am;
struct empty {
char *p;
/* struct empty { // error
int i;
} e; */
struct empty *ep;
};
struct empty ppp;
union c {char *p;} c1;
ttt ll;
int a;
}at;
at c1, c2, c3;
at *c4;
struct empty out_ppp;
unsigned si;
long li1;
long signed const lsi;
signed long lsi2;
struct ss{
int ss;
};
struct {
int a :1;
int b :1;
int c :1;
t_a ch :4;
at aa;
float ff;
char *p;
}b_b, *p_bb;
struct {
int :1;
const int b :1, c:1;
double f;
}a_a;
extern at aa;
struct ss aaaaa;
typedef char *ppc, c_, ffc(int);
/* ffc ffffc(); // error */
typedef int _;
typedef char a_[100];
a_ *px;
/* a_ FFF(); error */
/* ffc bbb[10]; error */
int Fu(struct ss ss, char);
int Fu1(struct ss{int g;} ss, char, ...);
int Fu2(struct ss__SS{int g;} ss, char, ...);
/* struct ss__SS ffff__SS; //error */
struct struct_a;
/*
struct struct_a *p_ddd;
struct struct_a ___b;
*/
struct ss ss_a[10];
char *ps;
void print(char *s, ...){}
int function2(a);
int function2(float a);
int function2(float a);
function2(float a) {
}
main()
{
03545;
55ull;
5ul;
5lu;
5LLu;
4675486;
45.6565;
-675;
100.;
.565;
.100e-1;
0xa4.44P0f;
0x.4AP-1;
'\333';
"hello\n";
'\x5454';
L'\x3444';
L"hello\n";
'c';
'\?';
++si;
--si;
+si;
-si;
*p_bb;
sizeof(int);
aaaaa.ss;
b_b.a;
b_b.p;
p_bb;
p_bb->a;
p_bb->p;
&p_bb;
si++;
si--;
++p_bb->a;
/* &p_bb->a; */
c1.c1.p;
c4->c1.p;
*c4;
ss_a->ss;
ar;
ar[1];
ar+1;
/*c1->c1; //error*/
a_func;
(long)si;
(int *)p_bb;
si = 4;
si >>= 4*8-3;
*(ar+1);
&ar[3];
(&b_b)->aa;
c4->a += c4->a + 67;
a_func((long int)1);
a_func(1);
print(ps);
print(ps, 1 == 4, (&b_b)->aa);
(&b_b)->aa, si, 4;
}
a_func(int d);
const *nn;
*m1,m2, m4;
arr[20];
//int f(int (*)(), double (*)[3]);
//int f(int (*)(char *), double (*)[]);
/*
test comment
*
//
*/
int blala(int pa)
{
pa++;
c4->a = pa;
int i;
for(i = 0; i < 10; i++)
arr[i] = 9;
if(1) ;
else {
int a;
a = 0x12;
}
return 0;
}
int haha()
{
int aa;
struct ll {
int a;
};
struct ll c1;
HAHA2:
c1.a = sizeof(struct mm {int m;});
struct mm la;
goto HAHA;
HAHA:
la.m = sizeof(5+7);
goto HAHA2;
}
struct tnode {
int count;
struct tnode *left, *right;
};
void haha2()
{
int haha(int a);
int haha(int a);
haha(1);
struct tnode tn;
tn.left = &tn;
tn.right = &tn;
int i;
LABEL:
switch(i) {
case 3:
i = 1;
while(1) {
case 1:
print("ao\n");
break;
case 2:
break;
default:
break;
}
print("break while\n");
break;
case 4:
print("first\n");
case 5:
print("seconed\n");
break;
}
do {
struct tnode * ptn;
ptn->left = ptn->right = &tn; // test
switch(i)
case (1): continue;
} while (1);
//ptn = 0;
}
typedef struct a2 haha3, haha4;
struct a2;
struct a2 {int ba;};
struct a2 bd;
haha3 bd2;
haha4 bd3;
enum ena{N};
//enum ena{M}; // error
enum ena enb;
typedef struct aaal{int b;};
struct aaal aaal;
int test_struct()
{
bd2.ba;
bd3.ba;
aaal.b;
}
//int fff3(){}, ii1, ii2; // error
int fff4(a);
int fff4(b,c);
int fff4(a, b, c)
float c,a;
{
//int c = li = 9; // error
//int a = test_struct(); // error
int c1 = li = 9;
int a1 = test_struct();
c = 0.0;
int aa=aa, bb=aa;
*(&aa) = 1;
}
//typedef int III2 = 7; // error
//int gfgf() = 5; // error