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

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

<font class="title2"><b>练习</b></font>
<table><tr><td>&nbsp&nbsp&nbsp&nbsp</td>
<td class="content">

2.4 从供选择的答案中,选出应填入<u>&nbsp&nbsp</u>的正确答案。 <br>
已知文法G[S]的山城式如下:
<table align=center width=40%>
<tr><td>S → (L)|a</td></tr>
<tr><td>L → L,S|S</td></tr>
</table>
属于L(G[S])的句子是<u> A </u>,(a,a)是L(G[S])的句子,这个句子的最左推导是<u> B </u>,最右推导是<u> C </u>,分析树是<u> D </u>,句柄是<u> E </u>。<br>
<b>供选择的答案:</b><br>
A:① a &nbsp ② a,a &nbsp ③ (L) &nbsp ④ (L,a)<br>
B,C:① S <img src="IMG/equal.gif"></img> (L) <img src="IMG/equal.gif"></img> (L,S) <img src="IMG/equal.gif"></img> (L,a) <img src="IMG/equal.gif"></img> (S,a) <img src="IMG/equal.gif"></img> (a,a)<br>
&nbsp &nbsp &nbsp② S <img src="IMG/equal.gif"></img> (L) <img src="IMG/equal.gif"></img> (L,S) <img src="IMG/equal.gif"></img> (S,S) <img src="IMG/equal.gif"></img> (S,a) <img src="IMG/equal.gif"></img> (a,a)<br>
&nbsp &nbsp &nbsp③ S <img src="IMG/equal.gif"></img> (L) <img src="IMG/equal.gif"></img> (L,S) <img src="IMG/equal.gif"></img> (S,S) <img src="IMG/equal.gif"></img> (a,S) <img src="IMG/equal.gif"></img> (a,a)<br>
D:<br>&nbsp;&nbsp;<img src="img/2.5.4.gif"><br>
E:① (a,a) &nbsp ② a,a &nbsp ③ (a) &nbsp ④ a
<table align=center width=70%>
<tr><td align=right>
<img src="../images/key.gif" onmouseover="javascript:style.cursor='hand'" onclick="javascript:window.open('2.5.4.htm','','left=150,top=240,toolbar=no,width=200,height=250')"></img>
</td></tr>
</table>
<hr size=2 align=center color=red><br>               

2.5 试构造生成下列语言的上下文无关文法:<br>
(1) { a<sup>n</sup>b<sup>n</sup>c<sup>i</sup> | n≥1,i≥0 }<br>
(2) { w | w∈{a,b}<sup>+</sup>,且w中a的个数恰好比b多1 }<br>
(3) { w | w∈{a,b}<sup>+</sup>,且|a|≤|b|≤2|a| }<br>
(4) { w | w是不以0开始的奇数集 }<br>
<table align=center width=70%>
<tr><td align=right>
<img src="../images/key.gif" onmouseover="javascript:style.cursor='hand'" onclick="javascript:window.open('2.5.5.htm','','left=50,top=40,toolbar=no,width=500,height=520')"></img>
</td></tr>
</table>

<hr size=2 align=center color=red><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='2.5.htm'"></img></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='../c_3/preface.htm'"></img></td>
</tr>
</table>

</BODY>
</html>



<html><script language="JavaScript">

⌨️ 快捷键说明

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