📄 7.6.2_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.6.2_2.htm'" ></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'"
onclick="vbscript:window.location.href='7.6.2_2c.htm'" ></td>
</tr>
</table>
<p><br>
<br>
</p>
<table>
<tr>
<td class="content">
<p>
另外的语义动作见翻译模式中的产生式(7)。即执行 </p>
<p>{S<span class="down">1</span>.nextlist:=makelist( )}<br>
指针S<sub>1</sub>.nextlist将指向一个空表。 </p>
<p>(d)在S<span class="down">1</span>之后有N,此时的语义动作为: </p>
<p>{ N.nextlist :=makelist(nextquad); emit(' goto-' )}<br>
执行语义动作后,得到指针N.nextlist指向一个表,表中存放标号'116'
。而且产生一条指令: </p>
<p>116 : goto- </p>
<p>(e)在A<span class="down">2</span>之前加入M<sub>2</sub>,相应语义动作执行后得到M<sub>2</sub>.quad之值为117。
</p>
<p>(f)我们仍无妨假设当第二个赋值语句A<span class="down">2</span>归约为S<span
class="down">2</span>时,也已产生了10条四元式代码,即有: </p>
<p> 117: </p>
<div align="right"><table border="0" width="100%">
<TBODY>
<tr>
<td width="18%"> .</td>
<td width="82%"></td>
</tr>
<tr>
<td width="18%"> .</td>
<td width="82%">关于A2的四元式 } 共10条</td>
</tr>
<tr>
<td width="18%"> .</td>
<td width="82%"></td>
</tr>
</TBODY>
</table>
</div><p> 126: <br>
另外,归约时的语义动作: </p>
<p>{S<sub>2</sub>.nextlist : =makelist( )}<br>
执行后,指针S<sub>2</sub>.nextlist将指向一个空表。 </p>
<table align="right" width="300">
<tr>
<td><img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'"
onclick="vbscript:window.location.href='7.6.2_2.htm'" ></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'"
onclick="vbscript:window.location.href='7.6.2_2c.htm'" ></td>
</tr>
</table>
</body>
</html>
<html><script language="JavaScript">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -