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

📄 5.8.1_2c.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='5.8.1_2b.htm'"></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='5.8.2.htm'"></img></td>
</tr>
</table>
<br><br>

<table><tr><td>&nbsp&nbsp&nbsp&nbsp</td>
<td class="content">
<P>
<b>例5.27</b>  在一些Pascal的实现中,用隐含的类型名和每个声明的变量标识符相联系,如果声明中出现没有名字的类型表达式,就建立一个隐含的类型名。每当变量声明中出现类型表达式,就建立一个新的类型名。于是,在(5.9)中,分别为p,q和r的声明建立两个隐含的类型名np和nqr。即,把(5.9)看成:  
</p>
</td></tr></table>

<table><tr><td>&nbsp&nbsp&nbsp&nbsp</td>
<td class="content">
<P>
<b><font color="#0000FF">TYPE</font></b> <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;sLink=↑cell; <br> 
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;np=↑cell; <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nqr=↑cell; <br>
        &nbsp;&nbsp;&nbsp; <b><font color="#0000FF">VAR</font></b> <br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next:link; <br> 
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;last:link; <br> 
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p:np; <br> 
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q,r:nqr; <br> 
</p>
</td></tr></table>

<table><tr><td>&nbsp&nbsp&nbsp&nbsp</td>
<td class="content">
<P>
在名字等价下,next和last类型等价,q和r类型等价,而next、p、q类型不等价。 典型的实现是构造一张类型图,每当遇到类型构造符和基本类型,就建立一个新结点,但要记住类型名所命名的类型表达式。在这种方法中,如果两个类型表达式用类型图中同样的结点表示,那么,它们等价。图5.31描述了(5.9)声明的类型图。虚线表示变量和类型图结点的联系。注意,类型名cell有三个父结点,它们都标记为POINTER,等价出现在类型名Link和用它命名的类型图之间。
</p>
<center><img src="images/5_31.gif"></center>
</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='5.8.1_2b.htm'"></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='5.8.2.htm'"></img></td>
</tr>
</table>

</BODY>

⌨️ 快捷键说明

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