📄 7.2.1b.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.2.1.htm'" ></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'"
onclick="vbscript:window.location.href='7.2.2.htm'" ></td>
</tr>
</table>
<p><br>
<br>
<table>
<tr>
<td> </td>
<td class="content">
<p>过程enter(name,type,offset)用来为名字name建立一个符号表表项,井给出此名字的类型type及在过程数据区中的相对地址offset。非终结符号T有两个综合属性T.type和T.width。属性type表示名字的类型,如图7.4中有实型、整型、数组类型(指定了数组的长度和数组元素的基类型)、指针类型(指定了指针所指示对象的基类型)。属性width表示名字的域宽,即该类型名字所占用的存储单元个数。在图7.4中,假定整数类型域宽为4;实数域宽为8;一个数组的域宽可以通过把数组元素数目与一个元素的域宽相乘获得;一个指针类型的域宽假定为4。 </p>
<p>在图7.4中,可把第一条产生式写在一行,如下式所示: </p>
</td>
</tr>
</table>
<table>
<tr>
<td width=200> </td>
<td class="content">
P→{ offset:=0}D (7.1)
</td>
</tr>
</table>
<table>
<tr>
<td > </td>
<td class="content">
<p>我们在5.6节曾谈到产生e的标记非终结符号,它可以用来重新改写上述产生式以便语义动作均出现在整个产生式的右边。我们可采用标记非终结符号M来重写(7.1)式如下:
</p>
</td>
</tr>
</table>
<table>
<tr>
<td width=200> </td>
<td class="content">
P→M D<br>
M→ε{offset:=0} </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_2/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.2.1.htm'" ></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'"
onclick="vbscript:window.location.href='7.2.2.htm'" ></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -