Mercurial > hg > Papers > 2012 > aplas
changeset 12:a41427ab4d3b
add src/
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 14 Jun 2012 20:45:37 +0900 |
parents | bf3c780d3039 |
children | 66931f63db4d |
files | paper/src/rectype.cbc paper/src/struct.cbc |
diffstat | 2 files changed, 52 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paper/src/rectype.cbc Thu Jun 14 20:45:37 2012 +0900 @@ -0,0 +1,22 @@ +#include <stdio.h> +#include <stdlib.h> +__code print(__rectype *p) +{ + printf("print\n"); + exit(0); +} +__code csA(__rectype *p) +{ + goto p(csA); +} + +void main1() +{ + goto csA(print); +} + +int main() +{ + main1(); + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paper/src/struct.cbc Thu Jun 14 20:45:37 2012 +0900 @@ -0,0 +1,30 @@ +#include <stdio.h> +#include <stdlib.h> +struct interface { + __code (*next)(struct interface); +}; + +__code print(struct interface p) +{ + printf("print\n"); + exit(0); +} +__code csA(struct interface p) +{ + struct interface ds; + ds.next = csA; + goto p.next(ds); +} + +void main1() +{ + struct interface ds; + ds.next = print; + goto csA(ds); +} + +int main() +{ + main1(); + return 0; +}