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

📄 6.6.5d.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='6.6.5c.htm'"></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='6.6.5e.htm'"></img></td>
</tr>
</table>
<br><br>

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

 6.5 (a) 对以下的Pascal程序画出过程c第二次被激活时的运行栈,控制链和存取链。说明在c中如何访问变量x。<br>                                    
&nbsp;&nbsp;&nbsp; (b) 把存取链改成DISPLAY表,重做(a).<p><b><font color="#0000FF">program</font></b> env;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<b><font color="#0000FF">procedure</font></b> a;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<font color="#0000FF"><b>var</b></font> x:integer;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<font color="#0000FF"><b>procedure</b></font>                   
b;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><font color="#0000FF">procedure</font></b> c;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<font color="#0000FF"><b>begin</b></font> x:=2;b <font color="#0000FF"><b> end</b></font>;<font color="#008000">{procedure c}</font><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<b><font color="#0000FF">begin</font></b> c <font color="#0000FF"><b> end</b></font>;<font color="#008000">{procedure b}</font><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<b><font color="#0000FF">begin</font></b>               
b <font color="#0000FF"><b> end</b></font>;<font color="#008000">{procedure a}</font>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<b><font color="#0000FF">begin</font></b> a <b><font color="#0000FF">end</font></b>. 
<font color="#008000">            
{main}</font>&nbsp;&nbsp;</p>  
<table align=center width=70%>
<tr><td align=right>
<img src="../images/key.gif" onmouseover="javascript:style.cursor='hand'" onclick="javascript:window.open('key/a_6.5.htm','','left=100,top=100,toolbar=no,scrollbars=yes,width=700,height=600')"></img>
</td></tr>
</table>
<hr size=2 align=center color=red><br>


6.6 一个Pascal语言程序在执行到某一时刻时,其活动记录和DISPLAY表如下所示:                   
<p align=center><img src="a_6.6.gif" width="512" height="257"></p>
                
<p >(a) 试问此时正在执行的调用有哪些(用→表示调用)?<br>&nbsp;&nbsp;&nbsp;         
(b) 指出P,Q,R,S它们之间的嵌套关系。</p>        
                
<table align=center width=70%>
<tr><td align=right>
<img src="../images/key.gif" onmouseover="javascript:style.cursor='hand'" onclick="javascript:window.open('key/a_6.6.htm','','left=100,top=100,toolbar=no,scrollbars=yes,width=600,height=500')"></img>
</td></tr>
</table>
<hr size=2 align=center color=red><br>



<br>
<table align=right width=300>
<tr>
<td><img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='6.6.5c.htm'"></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='6.6.5e.htm'"></img></td>
</tr>
</table>

</BODY>

<html><script language="JavaScript">

⌨️ 快捷键说明

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