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

📄 5.6.3_1.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.6.3b.htm'"></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='5.6.3_1b.htm'"></img></td>
</tr>
</table>
<br><br>


<table><tr><td>&nbsp&nbsp&nbsp&nbsp</td>
<td class="content">
<P>
<b>例5.19</b>  表5.10中使用了三个标记非终结符号L,M和N,以使得当B的子树被归约时,继承属性B.ps的值在分析栈中的位置是可知的。原来的语法制导定义在表5.7中给出,与其相应的说明在例5.13中已经解释了。     
</p>
</td></tr></table>
<br><br>
<center>表5.10 &nbsp所有继承属性都由复写规则赋值</center>    
<table width="75%" align=center valign=top border=1 cellspacing=0 cellpadding=5>
<tr>
<td width="42%" height=30 align=center>产生式</td>
<td width="58%" align=center>语义规则</td>
</tr>
<tr>
<td align=left valign=top>
	<br>
	<p>S -> L B<br></p>    
	<br>
	<p>L -> ε</p>    
	<p>B -> B<sub>1</sub> M B<sub>2</sub><br></p>    
	<br><br><br>
	<p>B -> B<sub>1</sub> sub N B<sub>2</sub></p>
	<br><br><br><br>
	<p>B -> <b>text</b></p>
	<p>M -> ε</p>   
	<p>N -> ε</p>   
	<br>
</td>
<td align=leftj valigh=top>
        <br>
        <p>&nbsp&nbsp;B.ps := L.s<br>   
	&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp;S.ht := B.ht</p>   
	<p>&nbsp&nbsp;L.s := 10</p>  
	<p>&nbsp&nbsp;B<sub>1</sub>.ps := B.ps<br>  
	&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp;M.i := B.ps<br>  
	&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp;B<sub>2</sub>.ps := M.s<br>  
	&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp;B.ht := max(B<sub>1</sub>.ht,B<sub>2</sub>.ht)</p>  
	<p>&nbsp&nbsp;B<sub>1</sub>.ps := B.ps<br>  
	&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp;N.i := B.ps<br>  
	&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp;B<sub>2</sub>.ps := N.s<br> 
	&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp;B.ht := disp(B<sub>1</sub>.ht,B<sub>2</sub>.ht)</p>  
	<p>&nbsp&nbsp;B.ht := <b>text</b>.h&#215B.ps</p> 
	<p>&nbsp&nbsp;M.s := M.i</p> 
	<p>&nbsp&nbsp;N.s := shrink(N.i)</p> 
	<br>
</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.6.3b.htm'"></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='5.6.3_1b.htm'"></img></td>
</tr>
</table>

</BODY>

<html><script language="JavaScript">

⌨️ 快捷键说明

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