version 1.3, 2000/01/21 08:44:55 |
version 1.9, 2000/09/09 21:59:13 |
|
|
|
%% $OpenXM: OpenXM/doc/OpenXM-specs/stackmachine.tex,v 1.8 2000/09/08 20:01:38 takayama Exp $ |
//&jp \section{ OX ¥¹¥¿¥Ã¥¯¥Þ¥·¥ó } |
//&jp \section{ OX ¥¹¥¿¥Ã¥¯¥Þ¥·¥ó } |
//&eg \section{ OX stackmachine } (This section has not yet been translated.) |
//&eg \section{ OX stack machine } |
|
\label{sec:stackmachine} |
/*&jp |
/*&jp |
¤³¤ÎÀá¤Ç¤Ï, OX ¥¹¥¿¥Ã¥¯¥Þ¥·¥ó operator ¤ÎÀâÌÀ |
¤³¤ÎÀá¤Ç¤Ï, OX ¥¹¥¿¥Ã¥¯¥Þ¥·¥ó operator ¤ÎÀâÌÀ |
(TCP/IP ¥½¥±¥Ã¥È¾å¤Ç¤Îɸ½à encoding Ë¡ ¤òÍѤ¤¤ë), |
(TCP/IP ¥½¥±¥Ã¥È¾å¤Ç¤Îɸ½à encoding Ë¡ ¤òÍѤ¤¤ë), |
Line 39 that for event-driven programming. |
|
Line 40 that for event-driven programming. |
|
{\tt oxserver00.c} is implemented as a sample server. |
{\tt oxserver00.c} is implemented as a sample server. |
If you want to implement you own server, |
If you want to implement you own server, |
write the following functions and use them instead of |
write the following functions and use them instead of |
those in {\tt nullstackmachine.c }. |
those in {\tt nullstackmachine.c}. |
*/ |
*/ |
|
|
//&jp \subsubsection{¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Î¥°¥ë¡¼¥× SMobject/Basic0 ¤Ë°¤¹¤ë¥ª¥Ú¥ì¡¼¥¿} |
//&jp \subsubsection{¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Î¥°¥ë¡¼¥× SMobject/Primitive ¤Ë°¤¹¤ë¥ª¥Ú¥ì¡¼¥¿} |
//&eg \subsubsection{Operators in the group SMobject/Basic0} |
//&eg \subsubsection{Operators in the group SMobject/Primitive} |
|
|
/*&jp |
/*&jp |
\noindent |
\noindent |
Line 78 CMObject ¤ËÂФ¹¤ëºÇÂç¸øÌó¿ôŪ¤Ê¥á¥Ã¥»¡¼¥¸¤Î»ÅÍͤòconte |
|
Line 79 CMObject ¤ËÂФ¹¤ëºÇÂç¸øÌó¿ôŪ¤Ê¥á¥Ã¥»¡¼¥¸¤Î»ÅÍͤòconte |
|
°Õ. CMO ·Á¼°¤Ç½ñ¤¤¤Æ¤¢¤Ã¤Æ¤â, ¤½¤ì¤Ï¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Îlocal ·Á¼° |
°Õ. CMO ·Á¼°¤Ç½ñ¤¤¤Æ¤¢¤Ã¤Æ¤â, ¤½¤ì¤Ï¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Îlocal ·Á¼° |
¤Ç¥¹¥¿¥Ã¥¯¾å¤Ë¤¢¤ë¤È²ò¼á¤·¤Æ²¼¤µ¤¤.) |
¤Ç¥¹¥¿¥Ã¥¯¾å¤Ë¤¢¤ë¤È²ò¼á¤·¤Æ²¼¤µ¤¤.) |
|
|
¤¹¤Ù¤Æ¤Î¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Ï°Ê²¼¤Î´Ø¿ô¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¤È¤¤¤±¤Ê¤¤. |
¤¹¤Ù¤Æ¤Î¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Ï°Ê²¼¤ÎÁàºî¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¤È¤¤¤±¤Ê¤¤. |
|
³ÆÁàºî¤ËÂФ·, ¤½¤ÎÁ°¸å¤Ë¤ª¤±¤ë¥¹¥¿¥Ã¥¯¤Î¾õÂÖ¤ò¼¨¤¹. ¿Þ¤Ë¤ª¤¤¤Æ, |
|
±¦Ã¼¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬¥¹¥¿¥Ã¥¯¤Î¥È¥Ã¥×¤ËÂбþ¤¹¤ë. |
*/ |
*/ |
|
|
/*&eg |
/*&eg |
Line 90 Object xxx_OperandStack[SIZE]; |
|
Line 92 Object xxx_OperandStack[SIZE]; |
|
\end{verbatim} |
\end{verbatim} |
Here {\tt Object} may be local to the system {\tt xxx} wrapped by the stack |
Here {\tt Object} may be local to the system {\tt xxx} wrapped by the stack |
machine. |
machine. |
That is, the server may translate CMObjects into local its |
That is, the server may translate CMObjects into its local |
objects and push them onto the stack. However, it is preferable that |
objects and push them onto the stack. It is preferable that |
the composition of such a translation and its inverse is equal to the |
the composition of such a translation and its inverse is equal to the |
identity map. The translation scheme is called the phrase book of the |
identity map. The translation scheme is called the {\it phrase book} of the |
server and it should be documented for each stack machine. In OpenXM, |
server and it should be documented for each stack machine. In OpenXM, |
any message is private. In future we will provide a content |
any message is private to a connection. In future we will provide a content |
dictionary (CD; see OpenMath \cite{openmath}) for basic specifications |
dictionary (CD; see OpenMath \cite{openmath}) for basic specifications |
of CMObjects. |
of CMObjects. |
|
|
In the following, \verb+ xxx_ + may be omitted if no confusion occurs. |
In the following, \verb+ xxx_ + may be omitted if no confusion occurs. |
As the names of functions and tags are long, one may use abbreviated |
As the names of functions and tags are long, one may use abbreviated |
names. Message packets are represented as follows. Each field is |
names. Message packets are represented as follows. |
shown as \fbox{data type \quad data}. For example {\tt int32 |
|
OX\_DATA} denotes a number {\tt OX\_DATA} which is represented by a 32 |
|
bit network byte order. If a field is displayed by italic characters, |
|
it should be defined elsewhere or its meaning should be clear. For |
|
example {\it String commandName} denotes a local object {\it |
|
commandName} whose data type is String. Note that an object on the |
|
stack may have a local data type even if it is represented as CMO. |
|
|
|
|
Each field is shown as \fbox{data type \quad data}. For example {\tt |
|
int32 OX\_DATA} denotes a number {\tt OX\_DATA} which is represented |
|
by a 32 bit integer with the network byte order. If a field is |
|
displayed by italic characters, it should be defined elsewhere or its |
|
meaning should be clear. For example {\it String commandName} denotes |
|
a local object {\it commandName} whose data type is String. Note that |
|
an object on the stack may have a local data type even if it is |
|
represented as CMO. |
|
|
Any server stack machine has to implement the following operations. |
Any server stack machine has to implement the following operations. |
|
For each operation we show the states of the stack before and after |
|
the operation. In the figures the rightmost object corresponds to the |
|
top of the stack. Only the modified part of the stack are shown. |
*/ |
*/ |
|
|
\begin{enumerate} |
\begin{enumerate} |
\item |
\item |
/*&jp |
/*&jp |
CMObject/Basic0 ¤Î CMO ¥Ç¡¼¥¿¤Î¤¦¤Áɬ¿Ü¤Î¤â¤Î, {\tt CMO\_ERROR2}, {\tt |
CMObject/Primitive ¤Î CMO ¥Ç¡¼¥¿¤Î¤¦¤Áɬ¿Ü¤Î¤â¤Î, {\tt CMO\_ERROR2}, {\tt |
CMO\_NULL}, {\tt CMO\_INT32}, {\tt CMO\_STRING}, {\tt CMO\_LIST}¤¬¤ª¤¯ |
CMO\_NULL}, {\tt CMO\_INT32}, {\tt CMO\_STRING}, {\tt CMO\_LIST}¤¬¤ª¤¯ |
¤é¤ì¤ÆÍ褿¾ì¹ç¤½¤ì¤ò¥¹¥¿¥Ã¥¯¤Ë push ¤¹¤ë. ¤¿¤È¤¨¤Ð, {\tt CMO\_NULL} |
¤é¤ì¤ÆÍ褿¾ì¹ç¤½¤ì¤ò¥¹¥¿¥Ã¥¯¤Ë push ¤¹¤ë. ¤¿¤È¤¨¤Ð, {\tt CMO\_NULL} |
¤¢¤ë¤¤¤Ï {\tt CMO\_String} ¤Î¾ì¹ç¼¡¤Î¤è¤¦¤Ë¤Ê¤ë. |
¤¢¤ë¤¤¤Ï {\tt CMO\_String} ¤Î¾ì¹ç¼¡¤Î¤è¤¦¤Ë¤Ê¤ë. |
*/ |
*/ |
/*&eg |
/*&eg |
Any server should accept CMObjects in the group CMObject/Basic0. |
Any server should accept CMObjects in the group CMObject/Primitive. |
The server pushes such data onto the stack. |
The server pushes such data onto the stack. |
The following examples show the states of the stack after receiving |
The following examples show the states of the stack after receiving |
{\tt CMO\_NULL} or {\tt CMO\_String} respectively. |
{\tt CMO\_NULL} or {\tt CMO\_String} respectively. |
Line 140 Stack after the request: |
|
Line 147 Stack after the request: |
|
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
Result: none. |
Output: none. |
|
|
Request: |
Request:\\ |
\begin{tabular}{|c|c|c|c|c|c|} \hline |
\begin{tabular}{|c|c|c|c|c|c|} \hline |
{\tt int32 OX\_DATA} & {\tt int32 CMO\_String} &{\tt int32} {\rm size} |
{\tt int32 OX\_DATA} & {\tt int32 CMO\_String} &{\tt int32} {\rm size} |
&{\tt byte} {\rm s1} & $\cdots$ &{\tt byte} {\rm ssize}\\ |
&{\tt byte} {\rm s1} & $\cdots$ &{\tt byte} {\rm ssize}\\ |
Line 155 Stack after the request: |
|
Line 162 Stack after the request: |
|
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
Result: none. |
Output: none. |
|
|
//&jp CMO ¥Ç¡¼¥¿¤Î¼õ¤±¼è¤ê¤Ë¼ºÇÔ¤·¤¿»þ¤Î¤ß \\ |
//&jp CMO ¥Ç¡¼¥¿¤Î¼õ¤±¼è¤ê¤Ë¼ºÇÔ¤·¤¿»þ¤Î¤ß \\ |
//&eg If the server fails to receive a CMO data, |
//&eg If the server fails to receive a CMO data,\\ |
\begin{tabular}{|c|c|c|} \hline |
\begin{tabular}{|c|c|c|} \hline |
{\tt int32 OX\_DATA} & {\tt int32 CMO\_ERROR2} & {\it CMObject} ob\\ |
{\tt int32 OX\_DATA} & {\tt int32 CMO\_ERROR2} & {\it CMObject} ob\\ |
\hline |
\hline |
|
|
/*&jp |
/*&jp |
¤³¤Î¥µ¡¼¥Ð¤Î mathcap ¤ò¤â¤É¤¹ (termcap ¤Î¤Þ¤Í). ¥µ¡¼¥Ð¤Î¥¿¥¤¥×, ¥µ¡¼ |
¤³¤Î¥µ¡¼¥Ð¤Î mathcap ¤ò¤â¤É¤¹ (termcap ¤Î¤Þ¤Í). ¥µ¡¼¥Ð¤Î¥¿¥¤¥×, ¥µ¡¼ |
¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤ÎǽÎϤòÃΤ뤳¤È¤¬¤Ç¤¤ë. C ¸À¸ì¤Ç¼ÂÁõ¤¹¤ë¾ì¹ç¤Ï, |
¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤ÎǽÎϤòÃΤ뤳¤È¤¬¤Ç¤¤ë. C ¸À¸ì¤Ç¼ÂÁõ¤¹¤ë¾ì¹ç¤Ï, |
mathCap ¤Î¹½Â¤ÂΤò¥·¥¹¥Æ¥àËè¤Ë¤¤á¤ë¤â¤Î¤È¤·,¤³¤Î´Ø¿ô¤Ï¤½¤Î¹½Â¤ÂΤؤΠ|
mathcap ¤Î¹½Â¤ÂΤò¥·¥¹¥Æ¥àËè¤Ë¤¤á¤ë¤â¤Î¤È¤·,¤³¤Î´Ø¿ô¤Ï¤½¤Î¹½Â¤ÂΤؤΠ|
¥Ý¥¤¥ó¥¿¤òÌ᤹. (open sm1 ¤Ç¤Ï {\tt struct mathCap} ¤òÍѤ¤¤Æ¤¤¤ë. |
¥Ý¥¤¥ó¥¿¤òÌ᤹. (open sm1 ¤Ç¤Ï {\tt struct mathcap} ¤òÍѤ¤¤Æ¤¤¤ë. |
*/ |
*/ |
/*&eg |
/*&eg |
It requests a server to push the mathcap of the server. |
It requests a server to push the mathcap of the server. |
Line 212 Stack after the request: |
|
Line 219 Stack after the request: |
|
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
Result: none. |
Output: none. |
|
|
\item |
\item |
\begin{verbatim} |
\begin{verbatim} |
SM_setMathCap |
SM_setMathcap |
\end{verbatim} |
\end{verbatim} |
/*&jp |
/*&jp |
¼õ¤±¼è¤Ã¤¿ Mathcap {\tt m} ¤ò¼«Ê¬¤Î¥·¥¹¥Æ¥à¤ËÀßÄꤷ¤Æ, Áê¼ê¦¤¬Íý²òÉÔ |
¼õ¤±¼è¤Ã¤¿ Mathcap {\tt m} ¤ò¼«Ê¬¤Î¥·¥¹¥Æ¥à¤ËÀßÄꤷ¤Æ, Áê¼ê¦¤¬Íý²òÉÔ |
ǽ¤Ê CMO ¤ò¤ª¤¯¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤ë. C ¸À¸ì¤Ç¼ÂÁõ¤¹¤ë¾ì¹ç¤Ï, mathCap ¤Î¹½ |
ǽ¤Ê CMO ¤ò¤ª¤¯¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤ë. C ¸À¸ì¤Ç¼ÂÁõ¤¹¤ë¾ì¹ç¤Ï, mathcap ¤Î¹½ |
¤ÂΤò¥·¥¹¥Æ¥àËè¤Ë¤¤á¤ë¤â¤Î¤È¤·,¤³¤Î´Ø¿ô¤Ï¤½¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò°ú |
¤ÂΤò¥·¥¹¥Æ¥àËè¤Ë¤¤á¤ë¤â¤Î¤È¤·,¤³¤Î´Ø¿ô¤Ï¤½¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò°ú |
¿ô¤È¤¹¤ë. (open sm1 ¤Ç¤Ï {\tt struct mathCap} ¤òÍѤ¤¤Æ¤¤¤ë. |
¿ô¤È¤¹¤ë. (open sm1 ¤Ç¤Ï {\tt struct mathcap} ¤òÍѤ¤¤Æ¤¤¤ë. |
*/ |
*/ |
/*&eg |
/*&eg |
It requests a server to register the peer's mathcap {\tt m} in the server. |
It requests a server to register the peer's mathcap {\tt m} in the server. |
Line 230 The server can avoid to send OX messages unknown to it |
|
Line 237 The server can avoid to send OX messages unknown to it |
|
*/ |
*/ |
@plugin/mathcap.h) |
@plugin/mathcap.h) |
|
|
|
Stack before the request: |
|
\begin{tabular}{|c|} \hline |
|
{\it Mathcap m} \\ |
|
\hline |
|
\end{tabular}\\ |
Request: |
Request: |
\begin{tabular}{|c|c|} \hline |
\begin{tabular}{|c|c|} \hline |
{\tt int32 OX\_DATA} & {\sl Mathcap} m \\ \hline |
{\tt int32 OX\_DATA} & {\sl Mathcap} m \\ \hline |
{\tt int32 OX\_COMMAND} & {\tt int32 SM\_setMathCap} \\ |
{\tt int32 OX\_COMMAND} & {\tt int32 SM\_setMathcap} \\ |
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
Result: none. |
Output: none. |
/*&jp |
/*&jp |
\noindent |
\noindent |
Ãí°Õ: mathcap ¤Ï°ìÈ̤˥¯¥é¥¤¥¢¥ó¥È¼çÂΤÇÀßÄꤹ¤ë. |
Ãí°Õ: mathcap ¤Ï°ìÈ̤˥¯¥é¥¤¥¢¥ó¥È¼çÂΤÇÀßÄꤹ¤ë. |
|
|
¤½¤ì¤ò, ¥¯¥é¥¤¥¢¥ó¥È¤Ï¤½¤Î¥µ¡¼¥Ð¤ËÉտ路¤¿ mathcap ¤È¤·¤Æ |
¤½¤ì¤ò, ¥¯¥é¥¤¥¢¥ó¥È¤Ï¤½¤Î¥µ¡¼¥Ð¤ËÉտ路¤¿ mathcap ¤È¤·¤Æ |
ÀßÄꤹ¤ë. |
ÀßÄꤹ¤ë. |
¼¡¤Ë, ¥¯¥é¥¤¥¢¥ó¥È¤Ï¥µ¡¼¥Ð¤Ë¼«Ê¬¤Î mathcap ¤ò |
¼¡¤Ë, ¥¯¥é¥¤¥¢¥ó¥È¤Ï¥µ¡¼¥Ð¤Ë¼«Ê¬¤Î mathcap ¤ò |
{\tt SM\_setMathCap} ¤Ç¤ª¤¯¤ê, ¼«Ê¬¤Î mathcap ¤òÀßÄꤵ¤»¤ë. |
{\tt SM\_setMathcap} ¤Ç¤ª¤¯¤ê, ¼«Ê¬¤Î mathcap ¤òÀßÄꤵ¤»¤ë. |
*/ |
*/ |
/*&eg |
/*&eg |
\noindent |
\noindent |
Remark: In general the exchange of mathcaps is triggered by a client. |
Remark: In general the exchange of mathcaps is triggered by a client. |
A client sends {\tt SM\_mathcap} to a server and obtains the server's |
A client sends {\tt SM\_mathcap} to a server and obtains the server's |
mathcap. Then the client registers the mathcap. Finally the client |
mathcap. Then the client registers the mathcap. Finally the client |
sends its own mathcap by {\tt SM\_setMathCap} and the server |
sends its own mathcap by {\tt SM\_setMathcap} and the server |
registers it. |
registers it. |
*/ |
*/ |
|
|
Line 273 OpenXM ¤Ç¤Ï, ¸½ºß¤Î¤È¤³¤í´Ø¿ô̾¤Îɸ½à²½¤Ï¤ª¤³¤Ê¤Ã¤Æ¤¤¤ |
|
Line 285 OpenXM ¤Ç¤Ï, ¸½ºß¤Î¤È¤³¤í´Ø¿ô̾¤Îɸ½à²½¤Ï¤ª¤³¤Ê¤Ã¤Æ¤¤¤ |
|
/*&eg |
/*&eg |
It requests a server to pop a character string {\tt s}, to |
It requests a server to pop a character string {\tt s}, to |
parse it by the local parser of the stack machine, and |
parse it by the local parser of the stack machine, and |
to interprete by the local interpreter. |
to interpret by the local interpreter. |
If the exececution produces a result, it is pushed onto |
If the execution produces a Output, it is pushed onto |
{\tt OperandStack}. |
{\tt OperandStack}. |
If an error has occured, Error2 Object is pushed onto the stack. |
If an error has occurred, Error2 Object is pushed onto the stack. |
OpenXM does not provide standard function names. |
OpenXM does not provide standard function names. |
If this operation and {\tt SM\_popString} is implemented, the stack machine |
If this operation and {\tt SM\_popString} is implemented, the stack machine |
can be used as an OX server. |
is ready to be used as an OX server. |
*/ |
*/ |
|
|
Stack before the request: |
Stack before the request: |
|
|
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
Result: none. |
Output: none. |
/*&jp |
/*&jp |
\noindent |
\noindent |
»²¹Í: \ ¼Â¹ÔÁ°¤Î¥¹¥¿¥Ã¥¯¤Î¥Ç¡¼¥¿¤Ï, |
»²¹Í: \ ¼Â¹ÔÁ°¤Î¥¹¥¿¥Ã¥¯¤Î¥Ç¡¼¥¿¤Ï, |
{\it String commandString} ¤Ê¤ë local stackmachine ¤Î object ¤È¤·¤Æ¥¹ |
{\it String commandString} ¤Ê¤ë local stack machine ¤Î object ¤È¤·¤Æ¥¹ |
¥¿¥Ã¥¯¾å¤Ë¤¢¤ë¤¬, TCP/IP ¤ÎÄÌ¿®Ï©¤Ç¤Ï, ¼¡¤Î¤è¤¦¤Ê¥Ç¡¼¥¿¤¬¤Þ¤º¤Ê¤¬¤ì¤Æ |
¥¿¥Ã¥¯¾å¤Ë¤¢¤ë¤¬, TCP/IP ¤ÎÄÌ¿®Ï©¤Ç¤Ï, ¼¡¤Î¤è¤¦¤Ê¥Ç¡¼¥¿¤¬¤Þ¤º¤Ê¤¬¤ì¤Æ |
{\it commandName} ¤¬¥¹¥¿¥Ã¥¯¤Ë push ¤µ¤ì¤ë: |
{\it commandName} ¤¬¥¹¥¿¥Ã¥¯¤Ë push ¤µ¤ì¤ë: |
*/ |
*/ |
Line 325 SM_executeStringByLocalParserInBatchMode |
|
Line 337 SM_executeStringByLocalParserInBatchMode |
|
/*&eg |
/*&eg |
This is the same request as {\tt SM\_executeStringByLocalParser} |
This is the same request as {\tt SM\_executeStringByLocalParser} |
except that it does not modify the stack. It pushes an Error2 Object |
except that it does not modify the stack. It pushes an Error2 Object |
if an error has occured. |
if an error has occurred. |
*/ |
*/ |
\item |
\item |
\begin{verbatim} |
\begin{verbatim} |
Line 342 It requests a server to pop an object from {\tt Operan |
|
Line 354 It requests a server to pop an object from {\tt Operan |
|
to convert it into a character string according to the output format |
to convert it into a character string according to the output format |
of the local system, and to send the character string via TCP/IP stream. |
of the local system, and to send the character string via TCP/IP stream. |
{\tt (char *)NULL} is returned when the stack is empty. |
{\tt (char *)NULL} is returned when the stack is empty. |
The returned strings is sent as a CMO string data. |
The returned string is sent as a CMO string data. |
{\tt CMO\_ERROR2} should be returned if an error has occured. |
{\tt CMO\_ERROR2} should be returned if an error has occurred. |
*/ |
*/ |
|
|
Stack before the request: |
Stack before the request: |
|
|
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
Result: |
Output: |
\begin{tabular}{|c|c|c|} \hline |
\begin{tabular}{|c|c|c|} \hline |
{\tt int32 OX\_DATA} & {\tt int32 CMO\_STRING} & {\it size and the string s} \\ |
{\tt int32 OX\_DATA} & {\tt int32 CMO\_STRING} & {\it size and the string s} \\ |
\hline |
\hline |
Line 397 Stack after the request: |
|
Line 409 Stack after the request: |
|
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
Result: none. |
Output: none. |
|
|
\item |
\item |
\begin{verbatim} |
\begin{verbatim} |
|
|
It requests a server to push a list object containing all error objects on the stack. |
It requests a server to push a list object containing all error objects on the stack. |
*/ |
*/ |
|
|
Stack before the request: |
Request: |
\begin{tabular}{|c|} \hline |
\begin{tabular}{|c|c|} \hline |
{\it Object} \\ |
{\tt int32 OX\_COMMAND} & {\tt int32 SM\_dupErrors} \\ |
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
|
Stack after the request: |
|
\begin{tabular}{|c|c|c|} \hline |
|
{\tt int32 OX\_DATA} & {\sl CMObject} \ a list of errors\\ |
|
\hline |
|
\end{tabular} |
|
|
|
Output: none. |
|
|
|
\item |
|
\begin{verbatim} |
|
SM_pushCMOtag |
|
\end{verbatim} |
|
/*&jp |
|
¥¹¥¿¥Ã¥¯¤ÎÀèƬ¥ª¥Ö¥¸¥§¥¯¥È¤¬ CMO ¤ËÊÑ´¹¤µ¤ì¤¿¾ì¹ç¤Î CMO tag ¤ò |
|
{\tt CMO\_INT32} ¤È¤·¤Æ¥¹¥¿¥Ã¥¯¤Ø push ¤¹¤ë. |
|
ÀèƬ¥ª¥Ö¥¸¥§¥¯¥È¤Ï¥¹¥¿¥Ã¥¯¤Ëα¤Þ¤ë. |
|
ÀèƬ¥ª¥Ö¥¸¥§¥¯¥È¤òCMO ¤ØÊÑ´¹¤¹¤ëÊýË¡¤¬Ìµ¤¤¾ì¹ç¤Ï, ¥¨¥é¡¼ object ¤òÀѤà. |
|
*/ |
|
/*&eg |
|
It requests a server to push the CMO tag of the top object on the server |
|
stack. The tag is pushed as {\tt CMO\_INT32}. |
|
The top object remains on the stack. |
|
If there is no way to translate the object into CMO, |
|
push an error object. |
|
*/ |
|
|
Request: |
Request: |
\begin{tabular}{|c|c|} \hline |
\begin{tabular}{|c|c|} \hline |
{\tt int32 OX\_COMMAND} & {\tt int32 SM\_dupErrors} \\ |
{\tt int32 OX\_COMMAND} & {\tt int32 SM\_pushCMOtag} \\ |
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
Stack after the request: |
Stack after the request: |
\begin{tabular}{|c|c|c|} \hline |
\begin{tabular}{|c|c|c|} \hline |
{\tt int32 OX\_DATA} & {\sl CMObject} \ a list of errors\\ |
{\tt int32 OX\_DATA} & {\sl CMO\_INT32} \ tag\\ |
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
Result: none. |
Output: none. |
\end{enumerate} |
\end{enumerate} |
|
|
\medbreak |
\medbreak |
\noindent |
\noindent |
|
|
|
//&C \subsubsection{ MathCap } \label{subsubsection:mathcap} |
|
|
/*&jp |
/*&jp |
{\bf Îã}: \ |
{\bf Îã}: \ |
mathcap ¤ÎÌ䤤¹ç¤ï¤»¤ËÂФ·¤Æ, {\tt ox\_sm1} ¤Ï¼¡¤Î¤è¤¦¤ËÅú¤¨¤ë. |
mathcap ¤ÎÌ䤤¹ç¤ï¤»¤ËÂФ·¤Æ, {\tt ox\_sm1} ¤Ï¼¡¤Î¤è¤¦¤ËÅú¤¨¤ë. |
Line 442 mathcap ¤ÎÌ䤤¹ç¤ï¤»¤ËÂФ·¤Æ, {\tt ox\_sm1} ¤Ï¼¡¤Î¤è¤¦ |
|
Line 483 mathcap ¤ÎÌ䤤¹ç¤ï¤»¤ËÂФ·¤Æ, {\tt ox\_sm1} ¤Ï¼¡¤Î¤è¤¦ |
|
{\bf Example}: \ |
{\bf Example}: \ |
{\tt ox\_sm1} returns the following data as its mathcap. |
{\tt ox\_sm1} returns the following data as its mathcap. |
*/ |
*/ |
%%Prog: [(cmoMathCap)] extension :: |
%%Prog: [(cmoMathcap)] extension :: |
\begin{verbatim} |
\begin{verbatim} |
Class.mathcap |
Class.mathcap |
[ [199909080 , $Ox_system=ox_sm1.plain$ , $Version=2.990911$ , |
[ [199909080 , $Ox_system=ox_sm1.plain$ , $Version=2.990911$ , |
|
|
|
|
/*&jp |
/*&jp |
mathcap ¤Ï 3¤Ä¤ÎÍ×ÁǤò¤â¤Ä¥ê¥¹¥È¤Ç¤¢¤ë. ¤Þ¤Å, ºÇ½é¤ÎÍ×ÁǤò¸«¤è¤¦. |
mathcap ¤Ï 3¤Ä¤ÎÍ×ÁǤò¤â¤Ä¥ê¥¹¥È¤Ç¤¢¤ë. ¤Þ¤Å, ºÇ½é¤ÎÍ×ÁǤò¸«¤è¤¦. |
Ox\_system ¤Ï open xxx ¥·¥¹¥Æ¥à̾¤Ç¤¢¤ë. Æɤ߹þ¤à¥é¥¤¥Ö¥é¥ê¤¬¤Á¤¬¤Ã¤Æ |
ºÇ½é¤Î¿ô»ú¤Ï OpenXM ¥×¥í¥È¥³¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë. |
|
¸½ºß¤Ç¤Ï 1.1.3 Åù¤Î¥Ð¡¼¥¸¥ç¥ó¤¬ 001001003 ¤È¿ô»ú¤Ë¥¨¥ó¥³¡¼¥É¤µ¤ì¤Æ |
|
¤³¤³¤Ë³ÊǼ¤µ¤ì¤ë. |
|
Ox\_system ¤Ï openXM ¥·¥¹¥Æ¥à̾¤Ç¤¢¤ë. Æɤ߹þ¤à¥é¥¤¥Ö¥é¥ê¤¬¤Á¤¬¤Ã¤Æ |
¤¤¤Æ, ´Ø¿ô̾(¤Þ¤¿¤Ï ¥·¥ó¥Ü¥ë)¤Î°ÕÌ£¤¬¤Á¤¬¤¦¤È¤¤Ï¤³¤Î̾Á°¤â¤«¤¨¤ë. ¤¿ |
¤¤¤Æ, ´Ø¿ô̾(¤Þ¤¿¤Ï ¥·¥ó¥Ü¥ë)¤Î°ÕÌ£¤¬¤Á¤¬¤¦¤È¤¤Ï¤³¤Î̾Á°¤â¤«¤¨¤ë. ¤¿ |
¤È¤¨¤Ð, open math ¤Î basic content dictionary Âбþ¤Î´Ø¿ôÄêµÁ¥Þ¥¯¥í¤òÆÉ |
¤È¤¨¤Ð, open math ¤Î basic content dictionary Âбþ¤Î´Ø¿ôÄêµÁ¥Þ¥¯¥í¤òÆÉ |
¤ß¤³¤ó¤À sm1 ¤Ï, ox\_sm1\_basicCD ¤Ê¤ë̾Á°¤Ë¤¹¤ë. HOSTTYPEÃͤÏ, CPU |
¤ß¤³¤ó¤À sm1 ¤Ï, ox\_sm1\_basicCD ¤Ê¤ë̾Á°¤Ë¤¹¤ë. HOSTTYPE ÃͤÏ, CPU |
¤Î¼ïÎà¤ò¤¢¤é¤ï¤·unix ¤Ç¤Ï´Ä¶ÊÑ¿ô\verb+$HOSTTYPE+ ¤ÎÃͤǤ¢¤ë. 2 ÈÖÌÜ |
¤Î¼ïÎà¤ò¤¢¤é¤ï¤·unix ¤Ç¤Ï´Ä¶ÊÑ¿ô\verb+$HOSTTYPE+ ¤ÎÃͤǤ¢¤ë. 2 ÈÖÌÜ |
¤ÎÍ×ÁÇ¤Ï ÍøÍѲÄǽ¤Ê SM ¥³¥Þ¥ó¥É¤ò¤¢¤Ä¤á¤¿¥ê¥¹¥È¤Ç¤¢¤ë. 3 ÈÖÌܤΥꥹ¥È |
¤ÎÍ×ÁÇ¤Ï ÍøÍѲÄǽ¤Ê SM ¥³¥Þ¥ó¥É¤ò¤¢¤Ä¤á¤¿¥ê¥¹¥È¤Ç¤¢¤ë. 3 ÈÖÌܤΥꥹ¥È |
¤Ï, ½èÍý²Äǽ¤Ê¿ô³Ø¥Ç¡¼¥¿¤Î·Á¼°, ¤ª¤è¤ÓCMO¤Î¾ì¹ç¤Ê¤é½èÍý²Äǽ¤ÊCMO¤Î¥¿¥° |
¤Ï, ½èÍý²Äǽ¤Ê¿ô³Ø¥Ç¡¼¥¿¤Î·Á¼°, ¤ª¤è¤ÓCMO¤Î¾ì¹ç¤Ê¤é½èÍý²Äǽ¤ÊCMO¤Î¥¿¥° |
Line 466 Ox\_system ¤Ï open xxx ¥·¥¹¥Æ¥à̾¤Ç¤¢¤ë. Æɤ߹þ¤à¥é¥¤ |
|
Line 510 Ox\_system ¤Ï open xxx ¥·¥¹¥Æ¥à̾¤Ç¤¢¤ë. Æɤ߹þ¤à¥é¥¤ |
|
*/ |
*/ |
/*&eg |
/*&eg |
A mathcap has three components. The first one contains informations |
A mathcap has three components. The first one contains informations |
to identify the system and hosts on which the application runs. |
to identify the version number of the OpenXM protocol, |
In the above example, Ox\_system denotes the system name. |
the system and hosts on which the application runs. |
HOSTTYPE represents the OS type and taken from \verb+$HOSTTYPE+ |
In the above example, {\tt Ox\_system} denotes the system name. |
|
{\tt HOSTTYPE} represents the OS type and taken from \verb+$HOSTTYPE+ |
enviroment variable. |
enviroment variable. |
The second component consists of avaiable SM commands. |
The second component consists of avaiable SM commands. |
The third component is a list of pairs. Each pair consists |
The third component is a list of pairs. Each pair consists |
of an OX message tag and the available message tags. |
of an OX message tag and the list of available message tags. |
Again in the above example, 514 is the value of {\tt OX\_DATA} |
Again in the above example, 514 is the value of {\tt OX\_DATA} |
and it indicates that the server accepts CMO (without size information) |
and it indicates that the server accepts CMO (without size information) |
as mathematical data messages. In this case the subsequent |
as mathematical data messages. In this case the subsequent |
list represents available CMO tags. |
list represents available CMO tags. |
*/ |
*/ |
|
|
|
/*&C |
|
\noindent |
|
OpenXM/XML expression of the example above: |
|
\begin{verbatim} |
|
<cmo_mathcap> |
|
<cmo_list for="mathcap"> |
|
|
|
<cmo_list> |
|
<int32 for="length"> 4 </int32> |
|
<int32 for="Protocol version"> 001001003 </int32> |
|
<cmo_string for="system name"> Ox_system=ox_sm1.plain </cmo_string> |
|
<cmo_string for="system version"> Version=2.990911 </cmo_string> |
|
<cmo_string for="hosttype"> HOSTTYPE=i386 </cmo_string> |
|
</cmo_list> |
|
|
|
<cmo_list for="Available SM tags"> |
|
<int32 for="length"> 11 </int32> |
|
<int32> 262 </int32> |
|
<int32> 263 </int32> |
|
... |
|
</cmo_list> |
|
|
|
<cmo_list for="Available OX_DATA tags"> |
|
<int32 for="length"> 2 </int32> |
|
<cmo_list for="OX_DATA tag"> |
|
<int32 for="length"> 1 </int32> |
|
<int32 comment="OX_DATA"> 514 </int32> |
|
</cmo_list> |
|
<cmo_list for="Available CMO tags"> |
|
<int32 for="length"> 21 </int32> |
|
<int32 comment="CMO_ERROR2"> 2130706434 </int32> |
|
<int32 comment="CMO_NULL"> 1 </int32> |
|
.... |
|
</cmo_list> |
|
|
|
</cmo_list> |
|
</cmo_list> |
|
</cmo_mathcap> |
|
\end{verbatim} |
|
*/ |
|
|
\medbreak |
\medbreak |
|
|
|
//&jp \subsubsection{ Îã } |
|
//&eg \subsubsection{ Examples } |
|
|
\noindent |
\noindent |
//&jp {\bf Îã}: \ |
//&jp {\bf Îã}: \ |
//&eg {\bf Example}: \ |
//&eg {\bf Example}: \ |
Line 549 Each data has the following meaning. |
|
Line 639 Each data has the following meaning. |
|
(OX\_DATA, (CMO\_STRING, 7, "12345 ;")). |
(OX\_DATA, (CMO\_STRING, 7, "12345 ;")). |
\end{enumerate} |
\end{enumerate} |
|
|
//&jp \subsubsection{¥°¥ë¡¼¥× SMobject/Basic1 ¤Ë°¤¹¤ë¥ª¥Ú¥ì¡¼¥¿} |
//&jp \subsubsection{¥°¥ë¡¼¥× SMobject/Basic ¤Ë°¤¹¤ë¥ª¥Ú¥ì¡¼¥¿} |
//&eg \subsubsection{Operators in the group SMobject/Basic1} |
//&eg \subsubsection{Operators in the group SMobject/Basic} |
|
|
\begin{enumerate} |
\begin{enumerate} |
\item |
\item |
Line 558 Each data has the following meaning. |
|
Line 648 Each data has the following meaning. |
|
SM_pops |
SM_pops |
\end{verbatim} |
\end{verbatim} |
/*&jp |
/*&jp |
operand stack ¤è¤ê, {\it n} ¸Ä¤Î¸µ ({\it obj1, obj2, $\ldots$, objn}) |
operand stack ¤è¤ê, {\it n} ¸Ä¤Î¸µ ({\it obj1, obj2, $\ldots$, objn} |
¤ò pop ¤·¤Æ¼Î¤Æ¤ë. |
¤ò pop ¤·¤Æ¼Î¤Æ¤ë. |
*/ |
*/ |
/*&eg |
/*&eg |
It requests a server to pop {\it n} and to discard elements {\it obj1, obj2, |
It requests a server to pop {\it n} and to discard elements {\it obj1, obj2, |
$\ldots$, objn}) from the stack. |
$\ldots$, objn} from the stack. |
*/ |
*/ |
|
|
//&jp Stack before the request: (±¦¤¬ stack ¤Î¥È¥Ã¥×¤Ç¤¢¤ë.) \\ |
//&jp Stack before the request: \\ |
//&eg Stack before the request: (The rightmost one is the top of the stack.) \\ |
//&eg Stack before the request: \\ |
\begin{tabular}{|c|c|c|c|c|} \hline |
\begin{tabular}{|c|c|c|c|c|} \hline |
{\it obj1} & {\it obj2} & $\cdots$ & {\it objn} &{\it INT32 n} \\ |
{\it obj1} & {\it obj2} & $\cdots$ & {\it objn} &{\it Integer32 n} \\ |
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
|
|
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
Result: none. |
Output: none. |
|
|
|
|
\item |
\item |
Line 594 bind ¤¹¤ë. Àµ¾ï½ªÎ»¤Ê¤é 0 ¤ò, °Û¾ï½ªÎ»¤Ê¤é -1 ¤ò¤â¤É¤ |
|
Line 684 bind ¤¹¤ë. Àµ¾ï½ªÎ»¤Ê¤é 0 ¤ò, °Û¾ï½ªÎ»¤Ê¤é -1 ¤ò¤â¤É¤ |
|
*/ |
*/ |
/*&eg |
/*&eg |
It requests a server to pop {\it name}, to pop {\it obj}, and to |
It requests a server to pop {\it name}, to pop {\it obj}, and to |
bind {\it obj} to a variable {\it name} in the current name space. |
bind {\it obj} to a variable {\it name} in the current name space |
If an error has occured {\tt CMO\_ERROR2} is pushed to the stack. |
of the server. |
|
If an error has occurred {\tt CMO\_ERROR2} is pushed onto the stack. |
*/ |
*/ |
//&jp Stack before the request: (±¦¤¬ stack ¤Î top.) |
//&jp Stack before the request: |
//&eg Stack before the request: (The rightmost one is the top of the stack.) |
//&eg Stack before the request: |
\begin{tabular}{|c|c|} \hline |
\begin{tabular}{|c|c|} \hline |
{\it obj} & {\it String name} \\ |
{\it obj} & {\it String name} \\ |
\hline |
\hline |
|
|
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
Result: none. |
Output: none. |
|
|
\item |
\item |
\begin{verbatim} |
\begin{verbatim} |
|
|
|
|
/*&jp |
/*&jp |
¸½ºß¤Î̾Á°¶õ´Ö¤ÇÊÑ¿ô {\it name} ¤òɾ²Á¤¹¤ë. ɾ²Á¤Î·ë²Ì {\it |
¸½ºß¤Î̾Á°¶õ´Ö¤ÇÊÑ¿ô {\it name} ¤òɾ²Á¤¹¤ë. ɾ²Á¤Î·ë²Ì {\it |
resultObj} ¤ò¥¹¥¿¥Ã¥¯¤ØÌ᤹. ´Ø¿ô¼«ÂΤÏÀµ¾ï½ªÎ»¤Ê¤é 0 ¤ò, °Û¾ï½ªÎ»¤Ê |
OutputObj} ¤ò¥¹¥¿¥Ã¥¯¤ØÌ᤹. ´Ø¿ô¼«ÂΤÏÀµ¾ï½ªÎ»¤Ê¤é 0 ¤ò, °Û¾ï½ªÎ»¤Ê |
¤é -1 ¤ò¤â¤É¤¹. TCP/IP ¤Î¾ì¹ç, °Û¾ï½ªÎ»¤Î¾ì¹ç¤Î¤ß {\tt CMO\_ERROR2} |
¤é -1 ¤ò¤â¤É¤¹. TCP/IP ¤Î¾ì¹ç, °Û¾ï½ªÎ»¤Î¾ì¹ç¤Î¤ß {\tt CMO\_ERROR2} |
¤ò stack ¤Ø push ¤¹¤ë. |
¤ò stack ¤Ø push ¤¹¤ë. |
*/ |
*/ |
|
|
/*&eg |
/*&eg |
It requests a server to pop {\it name} and to evaluate a variable |
It requests a server to pop {\it name} and to evaluate a variable |
{\it name} in the current name space. The result of the evaluation |
{\it name} in the current name space. The Output of the evaluation |
{\it resultObj} is pushed to the stack. |
{\it OutputObj} is pushed to the stack. |
If an error has occured {\tt CMO\_ERROR2} is pushed to the stack. |
If an error has occurred {\tt CMO\_ERROR2} is pushed onto the stack. |
*/ |
*/ |
|
|
//&jp Stack before the request: (±¦¤¬ stack ¤Î top.) |
//&jp Stack before the request: |
//&eg Stack before the request: (The rightmost one is the top of the stack.) |
//&eg Stack before the request: |
\begin{tabular}{|c|} \hline |
\begin{tabular}{|c|} \hline |
{\it String name} \\ |
{\it String name} \\ |
\hline |
\hline |
|
|
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
//&jp Stack after the request: (±¦¤¬ stack ¤Î top.) |
//&jp Stack after the request: |
//&eg Stack after the request: (The rightmost one is the top of the stack.) |
//&eg Stack after the request: |
\begin{tabular}{|c|} \hline |
\begin{tabular}{|c|} \hline |
{\it resultObj} \\ |
{\it OutputObj} \\ |
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
Result: none. |
Output: none. |
|
|
\item |
\item |
\begin{verbatim} |
\begin{verbatim} |
Line 667 It requests a server to pop {\it s} as a function name |
|
Line 758 It requests a server to pop {\it s} as a function name |
|
to pop {\it n} as the number of arguments and to execute |
to pop {\it n} as the number of arguments and to execute |
a local function {\it s} with {\it n} arguments popped from |
a local function {\it s} with {\it n} arguments popped from |
the stack. |
the stack. |
If an error has occured {\tt CMO\_ERROR2} is pushed to the stack. |
If an error has occurred {\tt CMO\_ERROR2} is pushed to the stack. |
*/ |
*/ |
|
|
//&jp Stack before the request: (±¦¤¬ stack ¤Î top.) \\ |
//&jp Stack before the request: \\ |
//&eg Stack before the request: (±¦¤¬ stack ¤Î top.) \\ |
//&eg Stack before the request: \\ |
\begin{tabular}{|c|c|c|c|c|} \hline |
\begin{tabular}{|c|c|c|c|c|} \hline |
{\it objn} & $\cdots$ & {\it obj1} & {\it INT32 n} & {\it String s} \\ |
{\it objn} & $\cdots$ & {\it obj1} & {\it INT32 n} & {\it String s} \\ |
\hline |
\hline |
|
|
\end{tabular} |
\end{tabular} |
|
|
//&jp Stack after the request: ´Ø¿ô¼Â¹Ô¤Î·ë²Ì. |
//&jp Stack after the request: ´Ø¿ô¼Â¹Ô¤Î·ë²Ì. |
//&eg Stack after the request: The result of the execution. |
//&eg Stack after the request: The Output of the execution. |
|
|
Result: none. |
Output: none. |
|
|
\item |
\item |
\begin{verbatim} |
\begin{verbatim} |
|
|
\hline |
\hline |
\end{tabular} |
\end{tabular} |
|
|
Result: |
Output: |
\begin{tabular}{|c|c|} \hline |
\begin{tabular}{|c|c|} \hline |
{\tt int32 OX\_DATA} & {\it Serialized CMO} \\ |
{\tt int32 OX\_DATA} & {\it Serialized CMO} \\ |
\hline |
\hline |