From 0aac2cbdda39bafce3f88eb66dcf658957ede36d Mon Sep 17 00:00:00 2001 From: WZY Date: Tue, 8 Mar 2016 09:49:27 -0500 Subject: [PATCH] Fix compiler for stack machine I think there's a typo for stack machine compiler - PushVar should push x not n. --- frap_book.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frap_book.tex b/frap_book.tex index 1a29a6d..bd383c4 100644 --- a/frap_book.tex +++ b/frap_book.tex @@ -595,7 +595,7 @@ Here is the compiler that concerns us now, where we write $\concat{s_1}{s_2}$ fo \encoding \begin{eqnarray*} \compile{n} &=& \mathsf{PushConst}(n) \\ - \compile{x} &=& \mathsf{PushVar}(n) \\ + \compile{x} &=& \mathsf{PushVar}(x) \\ \compile{e_1 + e_2} &=& \concat{\compile{e_1}}{\concat{\compile{e_2}}{\mathsf{Add}}} \\ \compile{e_1 \times e_2} &=& \concat{\compile{e_1}}{\concat{\compile{e_2}}{\mathsf{Multiply}}} \end{eqnarray*}