📄 7.4.2b.htm
字号:
<html>
<head>
<title>编译原理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link type="text/css" rel="stylesheet" href="../css/specification.css">
</head>
<body>
<table align="right" width="300">
<tr>
<td><img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'"
onclick="vbscript:window.location.href='7.4.2.htm'" ></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'"
onclick="vbscript:window.location.href='7.4.3.htm'" ></td>
</tr>
</table>
<br>
<br>
<table width="100%">
<tr>
<td width="18"> </td>
<td class="content" width="865">
<p>产生布尔表达式的三地址代码的翻译模式见图7.11。在此翻译模式中,我们假定过程emit以正确的形式将三地址代码送到输出文件中,nextstat给出输出序列中下一条三地址语句的地址索引,每产生一条三地址语句后,过程emit便把nextstat加1。
<br>
<font class="example">例7.2</font> 根据图7.11,对布尔表达式a<b
or c<d and e<f可以生成图7.12中的三地址代码。 <br>
100 : <b>if</b> a<b <b>goto</b>
103 <br>
101 : t<span class="down">1</span>
:=0 <br>
102 : <b>goto</b> l04 <br>
103 : t<span class="down">1</span>
:=1 <br>
104 : <b>if</b> c<d <b>goto</b>
l07<br>
105 : t<span class="down">2</span>
:=0 <br>
106 : <b>goto</b> l08 <br>
107 : t<span class="down">2</span>:=
1 <br>
108 : <b>if</b> e<f <b>goto</b>
111 <br>
109 : t<span class="down">3</span>:=
0 <br>
110 : <b>goto</b> 112 <br>
112 : t<span class="down">4</span>:=
t<span class="down">2</span> <b>and</b> t<span class="down">3</span> <br>
113 : t<span class="down">5</span>:=
t<span class="down">1</span> <b>or</b> t<span class="down">4</span> </p>
<p> 图7.12 布尔表达式a<b or c<d and e<f的翻译
</td>
</tr>
</table>
<table>
<tr>
<td><font class="yanshi"> 观看演示 </font></td>
<td><font color="blue" onmouseover="javascript:style.cursor='hand'"
onclick="javascript:open('applets/test7_5/Page1.htm','_blank','menu=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,left=100,top=100,width=800,height=600')">用数值表示发翻译布尔表达式</font></td>
<td><img src="../images/yanshi.gif" width="36" height="35"></td>
</tr>
</table>
<p><br>
</p>
<table align="right" width="300">
<tr>
<td><img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'"
onclick="vbscript:window.location.href='7.4.2.htm'" ></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'"
onclick="vbscript:window.location.href='7.4.3.htm'" ></td>
</tr>
</table>
</body>
</html>
<html><script language="JavaScript">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -