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

📄 4.7.1.0b.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='4.7.1.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.7.1.1.htm'" width="26" height="24"></img></td>
</tr>
</table>
<br><br>
  
<p>     
<center><img src="images/4.15.gif" width="355" height="286"></center><br> 
<center class="content">图4.15 一个LR分析器的模型</center></p>  
<table><tr><td>&nbsp&nbsp&nbsp&nbsp</td>        
<td class="content">    
 
<p>分析表包含两部分,一个是动作(action)表,另一个是状态转换(goto)表。action[s<sub>m</sub>,a<sub>i</sub>]规定了当前状态s<sub>m</sub>面临当前输入符号a<sub>i</sub> 时应采取什么动作。goto[s<sub>m</sub>,X〕规定了当前状态s<sub>m</sub>面对文法符号X时下一个状态是什么,这就是说goto[s,X] 定义了一个以文法的全部符号为字母表的有限自动机。每一个action[s<sub>m</sub>,a<sub>i</sub>]所规定的动作不外是移进、归约、接受和出错。移进的意思是把当前输入符号a<sub>i</sub>及由[s<sub>m</sub>,a<sub>i</sub>]所决定的下一个状态s =goto「s<sub>m</sub>,a<sub>i</sub>]推进栈,下一个输入符号变为当前输入符号。归约的意思是指用某产生式A→β进行归约,若β的长度是r,归约的动作是从栈顶起往下弹出2r项,使s<sub>m-r</sub>变为栈顶状态,然后把文法符号A和状态s=goto[s<sub>m-r</sub>,A]推进栈。归约的动作不改变现在的输入符号,对我们将要构造的LR分析器而言,从栈中弹出的文法符号序列X<sub>m-r+1</sub>X<sub>m-r+2</sub>…X<sub>m</sub>是与产生式右端β相匹配的,即β=X<sub>m-r+1</sub>…X<sub>m</sub>。</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.7.1.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.7.1.1.htm'" width="26" height="24"></img></td>
</tr>      
</table>      
      
</BODY>      
</html>

⌨️ 快捷键说明

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