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

📄 2.2.2e.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='2.2.2d.htm'" width="24" height="24"></img></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='2.2.2f.htm'" width="26" height="24"></img></td>
</tr>
</table>
<br><br>

<table><tr><td>&nbsp&nbsp&nbsp&nbsp</td>
<td class="content">
<p> 
如果存在一个直接推导序列:<br> 
<center>α<sub>0</sub> <img src="IMG/equal.gif" width="19" height="13"></img> α<sub>1</sub> 
<img src="IMG/equal.gif" width="19" height="13"></img> α<sub>2</sub> 
<img src="IMG/equal.gif" width="19" height="13"></img> … 
<img src="IMG/equal.gif" width="19" height="13"></img> α<sub>n</sub>(n>0) </center> 
则我们称这个序列是一个从α<sub>0</sub>至α<sub>n</sub>的<font class="definition2">长度为n的推导</font>(简称推导)。或说α<sub>0</sub>可推导出α<sub>n</sub>,或α<sub>n</sub>可归约到α<sub>0</sub>。记作: 
<center> α<sub>0</sub><img src="IMG/equaladd.gif"  width="20" height="19">α<sub>n</sub> </center> 
即α<sub>0</sub><img src="IMG/equaladd.gif"  width="20" height="19">α<sub>n</sub>表示:从α<sub>0</sub>出发,经一步或若干步,可推导出α<sub>n</sub>。而用: 
<center> α<sub>0</sub><img src="IMG/equalstar.gif"  width="20" height="23">α<sub>n</sub> </center> 
表示:从α<sub>0</sub>出发,经0步或若干步,可推导出α<sub>n</sub>。换言之,α<sub>0</sub><img src="IMG/equalstar.gif"  width="20" height="23">α<sub>n</sub>意味着,或者α<sub>0</sub>=α<sub>n</sub>或者α<sub>0</sub><img src="IMG/equaladd.gif"  width="20" height="19">α<sub>n</sub>。<br> 
例如可从前面所得到的直接推导序列<br> 
<center> E <img src="IMG/equal.gif" width="19" height="13"></img> E+T 
<img src="IMG/equal.gif" width="19" height="13"></img> … 
<img src="IMG/equal.gif" width="19" height="13"></img> a+a </center> 
中看到:<br>  
<center> E<img src="IMG/equaladd.gif"  width="20" height="19">E+T </center> 
是长度为1的推导。而 <br> 
<center> E<img src="IMG/equaladd.gif"  width="20" height="19">T+T </center> 
是长度为2的推导。类似于此,<br> 
<center> E<img src="IMG/equaladd.gif"  width="20" height="19">a+a </center> 
是长度为6的推导。      
</p> 
<p> 
在图2.2中列出了上述推导中的每一个直接推导的详细情况。 <br><br> 
<table align = center border = 1 width = 550 cellspacing="0" cellpadding="5"> 
<tr> 
<td width=25% align=center>αAβ</td> 
<td width=25% align=center>αγβ</td> 
<td width=26% align=center>所用规则(产生式)</td> 
<td width=12% align=center>α</td> 
<td width=12% align=center>β</td> 
</tr> 
<tr> 
<td align=center>E</td> 
<td>&nbsp <img src="IMG/equal.gif" width="19" height="13"></img> E+T</td> 
<td>&nbspE->E+T</td> 
<td align=center>ε</td> 
<td align=center>ε</td> 
</tr> 
<tr> 
<td align=center>E+T</td> 
<td>&nbsp <img src="IMG/equal.gif" width="19" height="13"></img> T+T</td> 
<td>&nbspE->T</td> 
<td align=center>ε</td> 
<td align=center>+T</td> 
</tr> 
<tr> 
<td align=center>T+T</td> 
<td>&nbsp <img src="IMG/equal.gif" width="19" height="13"></img> F+T</td> 
<td>&nbspT->F</td> 
<td align=center>ε</td> 
<td align=center>+T</td> 
</tr> 
<tr> 
<td align=center>F+T</td> 
<td>&nbsp <img src="IMG/equal.gif" width="19" height="13"></img> a+F</td> 
<td>&nbspF-&gt;a</td> 
<td align=center>ε</td> 
<td align=center>+T</td> 
</tr> 
<tr> 
<td align=center>a+T</td> 
<td>&nbsp <img src="IMG/equal.gif" width="19" height="13"></img> a+F</td> 
<td>&nbspT->F</td> 
<td align=center>a+</td> 
<td align=center>ε</td> 
</tr> 
<tr> 
<td align=center>a+F</td> 
<td>&nbsp <img src="IMG/equal.gif" width="19" height="13"></img> a+a</td> 
<td>&nbspF-&gt;a</td> 
<td align=center>a+</td> 
<td align=center>ε</td> 
</tr> 
</table> 
<center>图2.2 直接推导的例子</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='2.2.2d.htm'" width="24" height="24"></img></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='2.2.2f.htm'" width="26" height="24"></img></td>
</tr> 
</table> 
 
</BODY> 
</html>

⌨️ 快捷键说明

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