changeset 38:ae00fdac2e99

update
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 31 Jan 2021 21:29:23 +0900
parents b8cb6fcd9342
children 4f4d3f1fc568
files paper/chapter/02-interface.tex paper/master_paper.pdf paper/src/pop2test.cbc
diffstat 3 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/paper/chapter/02-interface.tex	Sun Jan 31 21:04:41 2021 +0900
+++ b/paper/chapter/02-interface.tex	Sun Jan 31 21:29:23 2021 +0900
@@ -81,10 +81,13 @@
 この例では\texttt{pop2Test}Code Gearから \texttt{stack->pop2}を呼び出し、 継続として\texttt{pop2Test1}を渡している。
 \texttt{pop2Test}自体はStackTest Interfaceであり、 \texttt{stack->pop2}の\texttt{stack}はStack Interfaceである。
 
-\lstinputlisting[label=src:insertTest1, caption=2つ以上の出力があるCodeGearからの遷移例]{src/pop2test.cbc}
+\lstinputlisting[label=src:insertTest1, caption=別Interfaceからの書き出しを取得するCodeGearの例]{src/pop2test.cbc}
 
-当初Perlスクリプトが生成した\texttt{insertCase1}のstub CodeGearはソースコード\ref{src:pop2stub-origin}のものである。
-\texttt{insertCase1}はtree, parent, grandparentの3引数必要であるが、生成されたコードの引数がそろっていないことがわかる。
-
-
-\lstinputlisting[label=src:pop2stub-origin, caption=生成されたStub]{src/pop2stub-origin.cbc}
\ No newline at end of file
+当初Perlスクリプトが生成した\texttt{pop2Test1}のstub CodeGearはソースコード\ref{src:pop2stub-origin}のものである。
+\lstinputlisting[label=src:pop2stub-origin, caption=生成されたStub]{src/pop2stub-origin.cbc}
+\texttt{\_\_code pop2Test}で遷移する先のCodeGearはStackInterfaceであり、 呼び出しているAPIは\texttt{pop2}である。
+pop2はスタックから値を2つ取得するAPIである。
+取得したAPIはGearsOSのInterfaceの処理ルールにより、 Context中のStack Interfaceのデータ格納場所に書き込まれる。
+しかしソースコード\ref{src:pop2stub-origin}の例では\texttt{Gearef(context, StackTest)}でContext中の\texttt{StackTest} Interfaceのdataの置き場所から値を取得している。
+これではpop2でせっかく取り出した値を取得できない。
+ここで必要となってくるのは、 呼び出し元のInterfaceからの値の取得である。
\ No newline at end of file
Binary file paper/master_paper.pdf has changed
--- a/paper/src/pop2test.cbc	Sun Jan 31 21:04:41 2021 +0900
+++ b/paper/src/pop2test.cbc	Sun Jan 31 21:29:23 2021 +0900
@@ -1,3 +1,10 @@
+#interface "String.h"
+#interface "Stack.h"
+
+#impl "StackTest.h" for "StackTestImpl3.h"
+
+/* 略 */
+
 __code pop2Test(struct StackTestImpl3* stackTest, struct Stack* stack, __code next(...)) {
     goto stack->pop2(pop2Test1);
 }