📄 4.6.4.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.6.4.0.htm'"></img></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='4.6.4.0c.htm'"></img></td>
</tr>
</table>
<br><br>
<table><tr><td>    </td>
<td class="content">
<p>对于第一种情况下出现的错误的处理方法是:为不存在优先关系的终结符号对在优先矩阵的相应位置上填入错误处理子程序的入口。上述文法的优先矩阵由表4.9给出。表4.10给出了带有错误处理的子程序人口的优先矩阵。除了这些人口以外,表4.10和表4.9的内容是相同的。这些错误处理子程序的内容如下: </p>
<p>e1:/*当栈顶符号是$并且当前输入符号是$时被调用 */ <br>
把id插入到输入符号串上。<br>
给出诊断信息:“缺少运算对象”。<br>
e2:/*当栈顶符号是$并且当前输入符号是)时被调用,即当表达式以右括号开始时被调用*/ <br>
把)从输入符号串中删除。 <br>
给出诊断信息:“右括号不配对”。<br>
e3:/*当栈顶符号是id或)并且当前输入符号是id或(时被调用,即当id或)之后跟以id或(时被调用*/ <br>
把+ 插入到输入符号串上。<br>
给出诊断信息:“缺少运算符号”。<br>
e4:/*当栈顶符号是(并且当前输入符号是$时被调用*/ <br>
把(从栈中弹出。 <br>
给出诊断信息:“缺少右括号”。</p>
</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.6.4.0.htm'"></img></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='4.6.4.0c.htm'"></img></td>
</tr>
</table>
</BODY>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -