# HG changeset patch # User Nobuyasu Oshiro # Date 1339700136 -32400 # Node ID 33b7a54edaa9ca5ef3770e04c8afb2e6d1afce76 # Parent 02bd9a41010f619074a98446373606e9e8eae2e8 method other rectype diff -r 02bd9a41010f -r 33b7a54edaa9 paper/rectype.ind --- a/paper/rectype.ind Fri Jun 15 02:50:28 2012 +0900 +++ b/paper/rectype.ind Fri Jun 15 03:55:36 2012 +0900 @@ -223,8 +223,8 @@ --How to implement \rectype \rectype syntx is implemented overriding AST. First, \rectype syntax make Tree same \code(\ref{fig:tree1}). -Second, Tree was created to be rectype flag. -Thrid, To override AST(\ref{fig:tree2}). +Second, tree was created to be rectype flag. +Thrid, to override AST(\ref{fig:tree2}). \begin{figure}[htpb] \begin{minipage}{0.5\hsize} @@ -252,28 +252,37 @@ We have to override it in the pointer of csA. +-- + + + + --Method other than \rectype +The recursively program of C's syntax can be solved using struct syntax. +For example, if we write + struct interface { __code (*next)(struct interface); }; __code csA(struct interface p) { - struct interface ds = { csB }; + struct interface ds; + ds.next = csB; goto p.next(ds); } int main() { - struct interface ds = { print }; + struct interface ds; + ds = print; goto csA(ds); return 0; } - - - - - __code fibonacci(__rectype *p, int num, int count, int result, int prev) { +there is no need to write recursively. +Because the struct syntax wrapped in a function pointer. +Code segment does not receive function pointer in arguments. +Recursively program does not occur.