Mercurial > hg > Papers > 2012 > aplas
changeset 24:17ce985c1cb3
modify
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 15 Jun 2012 17:49:39 +0900 |
parents | e9d317e4ea70 |
children | 18ee51dfe7fc |
files | paper/rectype.ind |
diffstat | 1 files changed, 35 insertions(+), 37 deletions(-) [+] |
line wrap: on
line diff
--- a/paper/rectype.ind Fri Jun 15 17:33:28 2012 +0900 +++ b/paper/rectype.ind Fri Jun 15 17:49:39 2012 +0900 @@ -220,6 +220,41 @@ p's argument type is same csA that function pointer. +--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}). + +\begin{figure}[htpb] + \begin{minipage}{0.5\hsize} + \begin{center} +\scalebox{0.35}{\includegraphics{figure/tree1.pdf}} + \end{center} + \caption{AST of function pointer} + \label{fig:tree1} + \end{minipage} + \begin{minipage}{0.2\hsize} + \begin{center} +\scalebox{0.35}{\includegraphics{figure/tree2.pdf}} + \end{center} + \caption{AST of \rectype} + \label{fig:tree2} +\end{minipage} +\end{figure} + +This AST(\ref{fig:tree2}) is made by syntax of \verb+__code csA(__rectype *p)+ . +TREE_LIST have infomation of argument. +First TREE_LIST represent that argument is function pointer(\verb+__code (*p)()+) . +Second TREE_LIST represent that csA is Fixed-length argument. +First TREE_LIST is connected with POINTER_TYPE. +POINTER_TYPE have pointer of function(FUNCTION_TYPE). +We have to override it in the pointer of csA. + + +-- + + --Problems with implementation of \rectype. Segmentation fault has occurred in the following program on compile. @@ -263,43 +298,6 @@ ---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}). - -\begin{figure}[htpb] - \begin{minipage}{0.5\hsize} - \begin{center} -\scalebox{0.35}{\includegraphics{figure/tree1.pdf}} - \end{center} - \caption{AST of function pointer} - \label{fig:tree1} - \end{minipage} - \begin{minipage}{0.2\hsize} - \begin{center} -\scalebox{0.35}{\includegraphics{figure/tree2.pdf}} - \end{center} - \caption{AST of \rectype} - \label{fig:tree2} -\end{minipage} -\end{figure} - -Above AST(\ref{fig:tree2}) is made by syntax of \verb+__code csA(__rectype *p)+ . -TREE_LIST have infomation of argument. -First TREE_LIST represent that argument is function pointer(\verb+__code (*p)()+) . -Second TREE_LIST represent that csA is Fixed-length argument. -First TREE_LIST is connected with POINTER_TYPE. -POINTER_TYPE have pointer of function(FUNCTION_TYPE). -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.