소스 검색

fixes to concrete and abstract syntax

Peter Thiemann 3 년 전
부모
커밋
f9a8f0da42
1개의 변경된 파일26개의 추가작업 그리고 7개의 파일을 삭제
  1. 26 7
      book.tex

+ 26 - 7
book.tex

@@ -12962,10 +12962,13 @@ definitions does not matter).
 }
 %
 The concrete syntax for function application\index{subject}{function
-  application} is $\CAPPLY{\Exp}{\Exp \ldots}$ where the first expression
-must evaluate to a function and the rest are the arguments.  The
+  application} is 
+\python{$\CAPPLY{\Exp}{\Exp\code{,} \ldots}$}
+\racket{$\CAPPLY{\Exp}{\Exp \ldots}$}
+ where the first expression
+must evaluate to a function and the remaining expressions are the arguments.  The
 abstract syntax for function application is
-$\APPLY{\Exp}{\Exp\ldots}$.
+$\APPLY{\Exp}{\Exp^*}$.
 
 %% The syntax for function application does not include an explicit
 %% keyword, which is error prone when using \code{match}. To alleviate
@@ -13024,7 +13027,9 @@ nested inside each other.
     \Type &::=& \key{FunctionType}\LP \Type^{*} \key{, } \Type \RP \\
     \Exp &::=& \CALL{\Exp}{\Exp^{*}}\\
     \Stmt &::=& \RETURN{\Exp} \\
-   \Params &::=& \LS\LP\Var\key{,}\Type\RP\code{,}\ldots\RS \\
+   \Params &::=&                  \LP\Var\key{,}\Type\RP^*
+   % was: \LS\LP\Var\key{,}\Type\RP\code{,}\ldots\RS 
+    \\
    \Def &::=& \FUNDEF{\Var}{\Params}{\Type}{}{\Stmt^{+}} 
   \end{array}
 }
@@ -13705,7 +13710,7 @@ Module(|$\Def\ldots\Stmt\ldots$|)
 \end{lstlisting}
 where $\itm{mainDef}$ is
 \begin{lstlisting}
-FunctionDef('main', [], int, None, |$\Stmt'\ldots$|Return(Constant(0)), None)
+FunctionDef('main', [], int, None, |$\Stmt\ldots$|Return(Constant(0)), None)
 \end{lstlisting}
 \fi}
 
@@ -13808,7 +13813,7 @@ the $k$th element of the tuple, where $k = i - 6$.
 \fi}
 {\if\edition\pythonEd   
 \begin{lstlisting}
-  Name(|$x_i$|) |$\Rightarrow$| Subscript(tup, Constant(|$k$|))
+  Name(|$x_i$|) |$\Rightarrow$| Subscript(tup, Constant(|$k$|), Load())
 \end{lstlisting}
 \fi}
 
@@ -14058,7 +14063,7 @@ language, whose syntax is defined in Figure~\ref{fig:x86-3}.
      &\MID& \gray{ \GLOBAL{\Var} } \MID \FUNREF{\itm{label}} \\
   \Instr &::=& \ldots \MID \INDCALLQ{\Arg}{\itm{int}}
     \MID \TAILJMP{\Arg}{\itm{int}}\\
-    &\MID& \BININSTR{\code{leaq}}{\Arg}{\REG{\Reg}}\\
+    &\MID& \BININSTR{\scode{leaq}}{\Arg}{\REG{\Reg}}\\
   \Def &::= & \DEF{\itm{label}}{\LS\RS}{\LC\itm{label}\key{:}\,\Instr^{*}\code{,}\ldots\RC}{\_}{\Type}{\_} \\
 \LangXIndCallM{} &::= & \XPROGRAMDEFS{\LS\Def\code{,}\ldots\RS}
 \end{array}
@@ -14078,17 +14083,31 @@ is the translation of $\itm{lhs}$ from \Atm{} in \LangCFun{}
 to \Arg{} in \LangXIndCallVar{}. \\
 \begin{tabular}{lcl}
 \begin{minipage}{0.35\textwidth}
+{\if\edition\racketEd
 \begin{lstlisting}
   |$\itm{lhs}$| = (fun-ref |$f$|);
 \end{lstlisting}
+\fi}
+{\if\edition\pythonEd
+\begin{lstlisting}
+  |$\itm{lhs}$| = FunRef(|$f$|);
+\end{lstlisting}
+\fi}
 \end{minipage}
 &
 $\Rightarrow$\qquad\qquad
 &
 \begin{minipage}{0.3\textwidth}
+{\if\edition\racketEd
 \begin{lstlisting}
 leaq (fun-ref |$f$|), |$\itm{lhs}'$|
 \end{lstlisting}
+\fi}
+{\if\edition\pythonEd
+\begin{lstlisting}
+leaq (FunRef(|$f$|)), |$\itm{lhs}'$|
+\end{lstlisting}
+\fi}
 \end{minipage}
 \end{tabular} \\