Pārlūkot izejas kodu

ast corrections

fixing syntax, atoms, let vs begin
Peter Thiemann 3 gadi atpakaļ
vecāks
revīzija
804bdf6412
1 mainītis faili ar 12 papildinājumiem un 10 dzēšanām
  1. 12 10
      book.tex

+ 12 - 10
book.tex

@@ -10409,9 +10409,9 @@ Figure~\ref{fig:Rwhile-anf-syntax} defines the output language
 \begin{array}{rcl}
 \Atm &::=& \INT{\Int} \MID \VAR{\Var} \MID \BOOL{\itm{bool}}\\
 \Exp &::=& \Atm \MID \READ{} \\
-  &\MID& \BINOP{\itm{binaryop}}{\Atm}{\Atm} \MID \UNIOP{\key{unaryop}}{\Atm} \\
+  &\MID& \BINOP{\Atm}{\itm{binaryop}}{\Atm} \MID \UNIOP{\itm{unaryop}}{\Atm} \\
   &\MID& \CMP{\Atm}{\itm{cmp}}{\Atm} \MID \IF{\Exp}{\Exp}{\Exp} \\
-%  &\MID& \LET{\Var}{\Exp}{\Exp}\\
+%  &\MID& \LET{\Var}{\Exp}{\Exp}\\ % Why?
 \Stmt{} &::=& \PRINT{\Atm} \MID \EXPR{\Exp} \\
   &\MID& \ASSIGN{\VAR{\Var}}{\Exp} \MID \IFSTMT{\Exp}{\Stmt^{+}}{\Stmt^{+}}\\
   &\MID& \WHILESTMT{\Exp}{\Stmt^{+}} \\
@@ -11732,17 +11732,18 @@ pass, which is \LangAlloc{} in monadic normal form.
 \itm{bool} &::=& \code{True} \MID \code{False} \\
 \Atm &::=& \INT{\Int} \MID \VAR{\Var} \MID \BOOL{\itm{bool}} \\
 \Exp &::=& \Atm \MID \READ{} \MID \\
-     &\MID& \BINOP{\Exp}{\itm{binaryop}}{\Exp}
-     \MID \UNIOP{\itm{unaryop}}{\Exp}\\
-     &\MID& \CMP{\Exp}{\itm{cmp}}{\Exp} 
-     \MID \BOOLOP{\itm{boolop}}{\Exp}{\Exp}\\
+     &\MID& \BINOP{\Atm}{\itm{binaryop}}{\Atm}
+     \MID \UNIOP{\itm{unaryop}}{\Atm}\\
+     &\MID& \CMP{\Atm}{\itm{cmp}}{\Atm} \\
+%     \MID \BOOLOP{\itm{boolop}}{\Exp}{\Exp} \\ % removed by RCO
      &\MID& \IF{\Exp}{\Exp}{\Exp} \\
      &\MID& \GET{\Atm}{\Atm} \\
      &\MID& \LEN{\Exp}\\
    &\MID& \ALLOCATE{\Int}{\Type}
      \MID \GLOBALVALUE{\Var}\RP\\
-   &\MID& \BEGIN{\Stmt^{*}}{\Exp} \\
-\Stmt{} &::=& \PRINT{\Exp} \MID \EXPR{\Exp} \\
+   &\MID& \BEGIN{\Stmt^{*}}{\Atm} \\ % can use this in place of \LET;
+                                % why have \LET?
+\Stmt{} &::=& \PRINT{\Atm} \MID \EXPR{\Exp} \\
   &\MID& \ASSIGN{\VAR{\Var}}{\Exp} \\
   &\MID& \ASSIGN{\PUT{\Atm}{\Atm}}{\Exp} \\
   &\MID& \IFSTMT{\Exp}{\Stmt^{+}}{\Stmt^{+}}\\
@@ -11814,8 +11815,9 @@ pass, which is \LangAlloc{} in monadic normal form.
 \fi}
 \end{minipage}
 }
-\caption{The abstract syntax of \LangCVec{}, extending \LangCLoop{}
-   (Figure~\ref{fig:c7-syntax}).}
+\caption{The abstract syntax of \LangCVec{}, extending
+  \racket{\LangCLoop{} (Figure~\ref{fig:c7-syntax})}\python{\LangCIf{}
+  (Figure~\ref{fig:c1-syntax})}.}
 \label{fig:c2-syntax}
 \end{figure}