annotate CbC-examples/rectypeTest/instruct.cbc @ 107:a3a2f64cf8f4

modify implementation of rectype
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Thu, 14 Jun 2012 19:44:54 +0900
parents 85047c4f1ca4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
106
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include <stdlib.h>
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
107
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
3 // miss
106
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 struct interface {
107
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
5 __rectype *next;
106
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 };
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 __code print(struct interface p) {
107
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
9 puts("print");
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
10 exit(0);
106
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 }
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 __code csA(struct interface p) {
107
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
14 struct interface ds;
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
15 ds.next = csA;
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
16 goto p.next(ds);
106
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 }
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 void main1() {
107
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
20 struct interface ds;
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
21 ds.next = print;
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
22 goto csA(ds);
106
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 }
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 int main() {
107
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
26 main1();
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
27 return 0;
106
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 }