📄 4.10.0b.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.10.0.htm'"></img></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='4.10.0.1.htm'"></img></td>
</tr>
</table>
<br><br>
<font class="title2"><b>练习</b></font>
<table><tr><td> </td>
<td class="content">
<a name="4.5"></a>
4.5 已知文法G[S],其产生式如下: <br>
S→(L)|a <br>
L→ L,S|S <br>
从G[S]中消除左递归,并为之构造一个非递归预测分析器LL(1)分析表。请说明在句子(a,(a,a))上的分析器的动作。
<table align=center width=70%>
<tr><td align=right>
<img src="../images/key.gif" onmouseover="javascript:style.cursor='hand'" onclick="javascript:window.open('4.10.5.htm','','left=100,top=100,scrollbars=yes,resizable=yes,toolbar=no,width=620,height=500,scrolling=yes')"></img>
</td></tr>
</table>
<a name="4.6"></a>
<hr size=2 align=center color=red><br>
4.6 对于练习4.1的文法,构造它的LL(1)分析表。 <br>
<table align=center width=70%>
<tr><td align=right>
<img src="../images/key.gif" onmouseover="javascript:style.cursor='hand'" onclick="javascript:window.open('4.10.6.htm','','left=100,top=100,scrollbars=yes,resizable=yes,toolbar=no,width=610,height=500,scrolling=yes')"></img>
</td></tr>
</table>
<a name="4.7"></a>
<hr size=2 align=center color=red><br>
4.7 试说明没有一个左递归文法是LL(1)的。 <br>
<table align=center width=70%>
<tr><td align=right>
<img src="../images/key.gif" onmouseover="javascript:style.cursor='hand'" onclick="javascript:window.open('4.10.7.htm','','left=100,top=100,scrollbars=yes,resizable=yes,toolbar=no,width=510,height=500,scrolling=yes')"></img>
</td></tr>
</table>
<a name="4.8"></a>
<hr size=2 align=center color=red><br>
4.8 试说明没有一个LL(1)文法是二义性的。 <br>
<table align=center width=70%>
<tr><td align=right>
<img src="../images/key.gif" onmouseover="javascript:style.cursor='hand'" onclick="javascript:window.open('4.10.8.htm','','left=100,top=100,scrollbars=yes,resizable=yes,toolbar=no,width=500,height=500,scrolling=yes')"></img>
</td></tr>
</table>
<a name="4.9"></a>
<hr size=2 align=center color=red><br>
4.9 对于文法G[S],其产生式如下<br>
S→(L)|a
(4.22)<br>
L→L,S|S <br>
(1)给出句子(a,((a,a),(a,a)))的一个最右推导,并指出右句型的句柄。<br>
(2)按照(a)的最右推导,说明移进-归约分析器的工作步骤。<br>
<table align=center width=70%>
<tr><td align=right>
<img src="../images/key.gif" onmouseover="javascript:style.cursor='hand'" onclick="javascript:window.open('4.10.9.htm','','left=100,top=100,scrollbars=yes,resizable=yes,toolbar=no,width=610,height=500,scrolling=yes')"></img>
</td></tr>
</table>
</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='4.10.0.htm'"></img></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='4.10.0.1.htm'"></img></td>
</tr>
</table>
</BODY>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -