Browse Source

fix x86 Name => Variable

Jeremy G. Siek 1 year ago
parent
commit
49d4f25907
2 changed files with 3 additions and 1 deletions
  1. 1 1
      book.tex
  2. 2 0
      defs.tex

+ 1 - 1
book.tex

@@ -3728,7 +3728,7 @@ list of \code{passes} and then run the script to test your compiler.
 In the \code{select\_instructions} pass we begin the work of
 translating \racket{from \LangCVar{}} to \LangXVar{}. The target
 language of this pass is a variant of x86 that still uses variables,
-so we add an AST node of the form $\VAR{\itm{var}}$ to the \Arg{}
+so we add an AST node of the form $\XVAR{\itm{var}}$ to the \Arg{}
 nonterminal of the \LangXInt{} abstract syntax
 (figure~\ref{fig:x86-int-ast}).
 \racket{We recommend implementing the

+ 2 - 0
defs.tex

@@ -374,6 +374,7 @@
 \newcommand{\SEQ}[2]{\key{(Seq}~#1~#2\key{)}}
 
 \if\edition\racketEd
+\newcommand{\XVAR}[1]{\key{(Var}~#1\key{)}}
 \newcommand{\CGDEF}[4]{\LP\key{define}~\LP#1~#2\RP\,#3~#4\RP}
 \newcommand{\IMM}[1]{\key{(Imm}~#1\key{)}}
 \newcommand{\REG}[1]{\key{(Reg}~#1\key{)}}
@@ -396,6 +397,7 @@
 \newcommand{\INST}[3]{\LP\key{Inst}~#1~#2~#3\RP}
 \fi
 \if\edition\pythonEd
+\newcommand{\XVAR}[1]{\key{Variable}\LP #1 \RP}
 \newcommand{\CGDEF}[4]{\key{def}~#1\LP #2 \RP~#3 \code{:}~#4}
 \newcommand{\TAILJMP}[2]{\key{TailJmp}\LP#1\code{, }#2\RP}
 \newcommand{\INDCALLQ}[2]{\key{IndirectCallq}\LP#1\code{, }#2\RP}