view cbc.tex @ 4:00ef3b6ef98a

*** empty log message ***
author akira
date Tue, 04 Mar 2008 19:09:01 +0900
parents 5a47ca319df5
children cba427f17200
line wrap: on
line source

\section{CbCの概要}
CbCはC言語からループ制御構造とサブルーチンコールを取り除き、継続を導入し
た言語である\cite{bib:CbC}。code-segmentは引数付きgotoで接続することで継
続を実現する。以下は階乗の計算の例題である。\\
\begin{small}
\input{src/fact.c}
\end{small}
code-segmentはキーワードcodeを用いることで関数のように定義される。引数部
分はinterfaceと呼ぶ。code-segmentからの脱出は引数付きgotoである。よって
CbCのプログラムは複数のcode-segmentがgotoで接続された物になる。(図\ref{fig:cbc-goto})
\begin{figure}[htb]
\begin{center}
\includegraphics[scale=.7]{./fig/code-goto.pdf}
\end{center}
\caption{CbCプログラムの構成}
\label{fig:cbc-goto}
\end{figure}