mirror of
https://github.com/achlipala/frap.git
synced 2025-02-17 16:17:40 +00:00
Merge pull request #11 from ZiyaoWei/patch-1
Fix compiler for stack machine
This commit is contained in:
commit
a2c453c075
1 changed files with 1 additions and 1 deletions
|
@ -595,7 +595,7 @@ Here is the compiler that concerns us now, where we write $\concat{s_1}{s_2}$ fo
|
||||||
\encoding
|
\encoding
|
||||||
\begin{eqnarray*}
|
\begin{eqnarray*}
|
||||||
\compile{n} &=& \mathsf{PushConst}(n) \\
|
\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 + 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}}}
|
\compile{e_1 \times e_2} &=& \concat{\compile{e_1}}{\concat{\compile{e_2}}{\mathsf{Multiply}}}
|
||||||
\end{eqnarray*}
|
\end{eqnarray*}
|
||||||
|
|
Loading…
Add table
Reference in a new issue