📄 4.7.2.6.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='4.7.2.5b.htm'"></img></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='4.7.2.6b.htm'"></img></td>
</tr>
</table>
<br><br>
<table><tr><td>    </td>
<td class="content">
<p><font class="example">例4.17 </font>设文法G的产生式为:<br>
(1)S→L=R <br>
(2)S→R <br>
(3)L→*R (4.17) <br>
(4)L→id <br>
(5)R→L <br>
</p>
<p>这个文法的拓广文法G'的LR(0)项目集规范族为:<br>
I<sub>0</sub> = {S'→·S, S→·L=R,S→·R,L→·*R,<br>
L→·id, R→·L} <br>
I<sub>1</sub> = {S'→S·} <br>
I<sub>2</sub> = {S→L·=R,R→L·} <br>
I<sub>3</sub> = {S→R·}<br>
I<sub>4</sub> = {L→*·R,R→·L,L→·*R,L→·id}<br>
I<sub>5</sub> = {L→id·} <br>
I<sub>6</sub> = {S→LR,R→·L,L→·*R,L→·id}<br>
I<sub>7</sub> = {L→*R·}<br>
I<sub>8</sub> = {R→L·}<br>
I<sub>9</sub> = {S→L=R·}
</p>
<p>识别这个文法的所有活前缀的DFA如图4.21所示。图中用双圆圈表示句柄识别态。 </p>
</td></tr></table>
<p>
<center><img src="images/4_21.gif" ></center><br>
<center class="content">图4.21 识别文法(4.17)活前缀的DFA</center></p>
<br>
<table align=right width=300>
<tr>
<td><img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='4.7.2.5b.htm'"></img></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='4.7.2.6b.htm'"></img></td>
</tr>
</table>
</BODY>
</html>
<html><script language="JavaScript">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -