⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 8.4.0b.htm

📁 建立《编译原理网络课程》的目的不仅使学生掌握构造编译程序的原理和技术
💻 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='8.4.0.htm'"></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='8.5.0.htm'"></img></td>
</tr>
</table>
<br><br>

<table><tr><td>&nbsp&nbsp&nbsp&nbsp</td>
<td class="content" width="865">
<P>下面介绍计算变量下次引用信息的算法。假定变量的符号表表项中含有记录下次引用信息和活跃信息的域,算法如下:</P>
<P>1.开始时,把基本块中各变量的符号表表项中的下次引用信息域置为“无下次引用”,把活跃信息域置为“活跃”。</P>
<P>2.从基本块出口到基本块入口由后向前依次处理各个三地址语句。对每一个三地址语句i:x:=y op z,依次执行下述步骤:</P> 
<P>  &nbsp;&nbsp;&nbsp; (a)把当前符号表中变量x的下次引用信息和活跃信息附加到语句i上; </P>
<p>&nbsp;&nbsp;&nbsp;&nbsp;(b)把符号表中x的下次引用信息和活跃信息分别置为“无下次引用”和“非活跃”;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;(c)把当前符号表中变量y和z的下次引用信息和活跃信息附加到语句i上;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;(d)把符号表中y和z的下次引用信息均置为i,活跃信息均置为“活跃”。</P>
<P>注意,以上次序不可颠倒,因为y和z也可能是x。按以上算法,如果一个变量在基本块中被引用,则各个引用所在的位置,将由该变量在符号表中的下次引用信息以及附加在各个三地址语句i上的信息,从前到后依次指示出来。</P>
<P>如果三地址语句i形如x:=y或x:= op y,以上执行步骤完全相同,只是其中不涉及z。 </P></td></tr></table>


<table>
<tr>
<td>
<font class="yanshi">&nbsp&nbsp&nbsp&nbsp&nbsp;&nbsp;&nbsp; 观看演示&nbsp</font></td> 
<td>
	<font color=blue onmouseover="javascript:style.cursor='hand';" onclick="javascript:open('images/test8_2/Page1.htm','_blank','left=100,top=100,scrollbars=yes,resizable=yes,width=850,height=600')">
	计算变量的下次引用信息</font>
</td>
<td><img src="../images/yanshi.gif"></img></td>
</tr>
</table>


  

<br>
<table align=right width=300>
<tr>
<td><img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='8.4.0.htm'"></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='8.5.0.htm'"></img></td>
</tr>
</table>

</BODY>

<html><script language="JavaScript">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -