📄 4.8.1.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.8.0.htm'" width="24" height="24"></img></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='4.8.1b.htm'" width="26" height="24"></img></td>
</tr>
</table>
<br><br>
<table><tr><td>    </td>
<td class="content">
<p>让我们考虑输入符号串id+id*id。在处理了id+id之后分析器进入状态I<sub>7</sub>。这时分析栈的内容为0E1+4E7,输入符号串剩余部分为*id$,即
<table align=center width=450 class="content">
<tr><td>栈</td><td>输入</td></tr>
<tr><td>OE1+4E7</td><td>*id$ </td></tr>
</table>
<p>假定*的优先级高于+,则应把*推进栈,准备先把*和它的左右操作数id归约成表达式E。表4.12的LR分析就是这样行事的。另一方面若让+的优先级高于*,则分析器就应该把E+E归约为E。因此+和*的相对优先关系为在状态I<sub>7</sub>和I<sub>8</sub>的“移进-归约”决策提供了依据。
</p>
</td></tr></table>
<p>
<center><img src="images/table4.17.gif" width="425" height="523" ></center><br>
</p>
<table align=right width=300>
<tr>
<td>
<img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='4.8.0.htm'" width="24" height="24"></img></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='4.8.1b.htm'" width="26" height="24"></img></td>
</tr>
</table>
</BODY>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -