📄 4.10.0.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='4.10.0.1.htm'"></img></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='4.10.0.2.htm'"></img></td>
</tr>
</table>
<br><br>
<font class="title2"><b>练习</b></font>
<table><tr><td> </td>
<td class="content">
<a name="4.12"></a>
4.12 证明下面文法是SLR(1)文法,并构造其SLR分析表。<br>
E→E+T|T <br>
T→TF|F <br>
F→F*|a|b <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.12.htm','','left=100,top=100,scrollbars=yes,resizable=yes,toolbar=no,width=610,height=500,scrolling=yes')"></img>
</td></tr>
</table>
<a name="4.13"></a>
<hr size=2 align=center color=red><br>
4.13 下面文法属于哪类LR文法?试构造其分析表。<br>
S→(SR|a <br>
R→,SR|) <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.13.htm','','left=100,top=100,scrollbars=yes,resizable=yes,toolbar=no,width=610,height=500,scrolling=yes')"></img>
</td></tr>
</table>
<a name="4.14"></a>
<hr size=2 align=center color=red><br>
4.14 设文法G为 <br>
S→A <br>
A→BA|ε<br>
B→aB|b<br>
(1)证明它是LR(1)文法。<br>
(2)构造它的LR(1)分析表。<br>
(3)给出输入符号串abab的分析过程。<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.14.htm','','left=100,top=100,scrollbars=yes,resizable=yes,toolbar=no,width=610,height=500,scrolling=yes')"></img>
</td></tr>
</table>
<a name="4.15"></a>
<hr size=2 align=center color=red><br>
4.15 为下面的文法构造LALR(1)分析表<br>
S→E <br>
E→E+T|T<br>
T→(E)|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.15.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.1.htm'"></img></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='4.10.0.2.htm'"></img></td>
</tr>
</table>
</BODY>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -