Mercurial > hg > CbC > CbC_gcc
annotate CbC-examples/rectypeTest/struct2.cbc @ 108:7ad14f446135
add CbC-example/rectypeTest/
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 14 Jun 2012 20:30:24 +0900 |
parents | |
children |
rev | line source |
---|---|
108
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 struct interface { |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 __code (*next)(); |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 __rectype child; |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 // __rectype *child; |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 // struct interface *child; |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 }; |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 #include <stdio.h> |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 __code csA() |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 { |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 printf("csA\n"); |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 } |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 __code csB() |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 { |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 printf("csB\n"); |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 } |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 int main() |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 { |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 struct interface p; |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 p.next = csA; |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 struct interface pp; |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 pp.next = csB; |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 p.child = &pp; |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 // goto p.child->next(); |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 goto p.child->next(); |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 return 0; |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 } |