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

📄 temp.html

📁 LL(1)文法判定(C#) SimpleLL1目录下为源程序 EXE目录下为编译好的可执行文件 Product1.txt~Product4.txt为测试用产生式(可直接在程序中加载) Symb
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>>简单LL(1)文法示例</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
<!--
.style1 {
	font-size: 14px;
	font-weight: bold;
}
/* Global Styles */

body {
	margin:0px;
	}
	
td {
	font:11px Verdana, Arial, Helvetica, sans-serif;
	color:#003366;
	}
	
a {
	color: #FF6600;
	font-weight:bold;
	}
	
a:hover {
	color: #3366CC;
	}

/* ID Styles */

#navigation td {
	border-bottom: 2px solid #C0DFFD;
	}
	
#navigation a {
	font: 11px Verdana, Arial, Helvetica, sans-serif;
	color: #003366;
	line-height:16px;
	letter-spacing:.1em;
	text-decoration: none;
	display:block;
	padding:8px 6px 10px 26px;
	background: url("mm_arrow.gif") 14px 45% no-repeat;
	}
	
#navigation a:hover {
	background: #ffffff url("mm_arrow.gif") 14px 45% no-repeat;
	color:#FF6600;
	}
	
.bodyText {
	font:11px Verdana, Arial, Helvetica, sans-serif;
	color:#003366;
	line-height:20px;
	margin-top:0px;
	}
	
-->
</style>
</head>
<body bgcolor="#C0DFFD">
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="3" bgcolor="#003366"><img src="images/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
  </tr>

  <tr bgcolor="#CCFF99">
  	<td>&nbsp;</td>
  	<td width="469" height="25" colspan="2" id="dateformat"><span class="style1">简单LL(1)文法示例</span> Author:<a href="mailto:shootsoft@yahoo.com.cn">shootsoft</a></td>
  </tr>
 <tr>
    <td colspan="3" bgcolor="#003366"><img src="images/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
  </tr>
 <tr>
    <td width="4">&nbsp;</td>
    <td colspan="2" valign="top"><br />
   <table border="0" cellspacing="0" cellpadding="2">
        <tr>
          <td width="465" class="bodyText"><strong>非终结符集:</strong>&lt;A B C D E F G H I J K L M N O P Q R S T U V W X Y Z&gt;</td>
        </tr>
        <tr>
          <td class="bodyText"><strong>终结符集:&nbsp;&nbsp;</strong>&lt;a b c d e f g h i j k o p q + - * / ( )&gt;</td>
        </tr>
        <tr>
          <td class="bodyText"><strong>产生式集:</strong></td>
        </tr>
        <tr>
          <td class="bodyText">S→aH<br>H→aMd<br>H→d<br>M→Ab<br>M→$<br>A→aM<br>A→e<br></td>
        </tr>
        <tr>
          <td class="bodyText"><strong>测试结果:</strong></td>
        </tr>
        <tr>
          <td height="28" class="bodyText"><table width="465" border="0" cellpadding="2" cellspacing="0">
            <tr>
              <td width="63" class="bodyText"><strong>非终结符</strong></td>
              <td width="78" class="bodyText"><strong>推出空$</strong></td>
              <td width="120" class="bodyText"><strong>FIRST集</strong></td>
              <td width="188" class="bodyText"><strong>FOLLOW集</strong></td>
            </tr>
            <tr>
<td width="64" class="bodyText"><strong>S</strong></td>
<td width="64" class="bodyText"><strong>False</strong></td>
<td width="64" class="bodyText"><strong>a</strong></td>
<td width="64" class="bodyText"><strong>#</strong></td>
</tr>
<tr>
<td width="64" class="bodyText"><strong>H</strong></td>
<td width="64" class="bodyText"><strong>False</strong></td>
<td width="64" class="bodyText"><strong>a d</strong></td>
<td width="64" class="bodyText"><strong>#</strong></td>
</tr>
<tr>
<td width="64" class="bodyText"><strong>M</strong></td>
<td width="64" class="bodyText"><strong>True</strong></td>
<td width="64" class="bodyText"><strong>$ a e</strong></td>
<td width="64" class="bodyText"><strong>d b</strong></td>
</tr>
<tr>
<td width="64" class="bodyText"><strong>A</strong></td>
<td width="64" class="bodyText"><strong>False</strong></td>
<td width="64" class="bodyText"><strong>a e</strong></td>
<td width="64" class="bodyText"><strong>b</strong></td>
</tr>

          </table></td>
        </tr>
        <tr>
          <td class="bodyText"><table border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td width="128" class="bodyText"><strong>产生式</strong></td>
              <td width="290" class="bodyText"><strong>SELECT集</strong></td>
             </tr>
             <tr>
<td width="64" class="bodyText"><strong>S→aH</strong></td>
<td width="64" class="bodyText"><strong>a</strong></td>
</tr>
<tr>
<td width="64" class="bodyText"><strong>H→aMd</strong></td>
<td width="64" class="bodyText"><strong>a</strong></td>
</tr>
<tr>
<td width="64" class="bodyText"><strong>H→d</strong></td>
<td width="64" class="bodyText"><strong>d</strong></td>
</tr>
<tr>
<td width="64" class="bodyText"><strong>M→Ab</strong></td>
<td width="64" class="bodyText"><strong>a e</strong></td>
</tr>
<tr>
<td width="64" class="bodyText"><strong>M→$</strong></td>
<td width="64" class="bodyText"><strong>d b</strong></td>
</tr>
<tr>
<td width="64" class="bodyText"><strong>A→aM</strong></td>
<td width="64" class="bodyText"><strong>a</strong></td>
</tr>
<tr>
<td width="64" class="bodyText"><strong>A→e</strong></td>
<td width="64" class="bodyText"><strong>e</strong></td>
</tr>

          </table></td>
        </tr>
        <tr>
          <td class="bodyText"><strong>该文法是LL(1)文法</strong></td>
        </tr>
        <tr>
          <td class="bodyText"><strong>测试字符串: </strong>aaabd</td>
        </tr>
        <tr>
          <td class="bodyText"><strong>预测分析表:</strong></td>
        </tr>
        <tr>
          <td class="bodyText"><table border="1" cellspacing="1" cellpadding="4">
<tr>
<td class="bodyText"><strong>&nbsp;</strong></td>
<td class="bodyText"><strong>a</strong></td>
<td class="bodyText"><strong>d</strong></td>
<td class="bodyText"><strong>b</strong></td>
<td class="bodyText"><strong>e</strong></td>
<td class="bodyText"><strong>#</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>S</strong></td>
<td class="bodyText"><strong>S→aH</strong></td>
<td class="bodyText"><strong>&nbsp;</strong></td>
<td class="bodyText"><strong>&nbsp;</strong></td>
<td class="bodyText"><strong>&nbsp;</strong></td>
<td class="bodyText"><strong>&nbsp;</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>H</strong></td>
<td class="bodyText"><strong>H→aMd</strong></td>
<td class="bodyText"><strong>H→d</strong></td>
<td class="bodyText"><strong>&nbsp;</strong></td>
<td class="bodyText"><strong>&nbsp;</strong></td>
<td class="bodyText"><strong>&nbsp;</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>M</strong></td>
<td class="bodyText"><strong>M→Ab</strong></td>
<td class="bodyText"><strong>M→$</strong></td>
<td class="bodyText"><strong>M→$</strong></td>
<td class="bodyText"><strong>M→Ab</strong></td>
<td class="bodyText"><strong>&nbsp;</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>A</strong></td>
<td class="bodyText"><strong>A→aM</strong></td>
<td class="bodyText"><strong>&nbsp;</strong></td>
<td class="bodyText"><strong>&nbsp;</strong></td>
<td class="bodyText"><strong>A→e</strong></td>
<td class="bodyText"><strong>&nbsp;</strong></td>
</tr>
</table></td>
        </tr>
        <tr>
          <td class="bodyText"><table border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td width="35" class="bodyText"><strong>步骤</strong></td>
              <td width="92" class="bodyText"><strong>分析栈</strong></td>
              <td width="133" class="bodyText"><p><strong>剩余</strong><strong>输入字符</strong></p>
                </td>
              <td width="191" class="bodyText"><strong>使用产生式或匹配</strong></td>
            </tr>
            <tr>
<td class="bodyText"><strong>1</strong></td>
<td class="bodyText"><strong>#S</strong></td>
<td class="bodyText"><strong>aaabd#</strong></td>
<td class="bodyText"><strong>S→aH</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>2</strong></td>
<td class="bodyText"><strong>#Ha</strong></td>
<td class="bodyText"><strong>aaabd#</strong></td>
<td class="bodyText"><strong>'a'匹配</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>3</strong></td>
<td class="bodyText"><strong>#H</strong></td>
<td class="bodyText"><strong>aabd#</strong></td>
<td class="bodyText"><strong>H→aMd</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>4</strong></td>
<td class="bodyText"><strong>#dMa</strong></td>
<td class="bodyText"><strong>aabd#</strong></td>
<td class="bodyText"><strong>'a'匹配</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>5</strong></td>
<td class="bodyText"><strong>#dM</strong></td>
<td class="bodyText"><strong>abd#</strong></td>
<td class="bodyText"><strong>M→Ab</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>6</strong></td>
<td class="bodyText"><strong>#dbA</strong></td>
<td class="bodyText"><strong>abd#</strong></td>
<td class="bodyText"><strong>A→aM</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>7</strong></td>
<td class="bodyText"><strong>#dbMa</strong></td>
<td class="bodyText"><strong>abd#</strong></td>
<td class="bodyText"><strong>'a'匹配</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>8</strong></td>
<td class="bodyText"><strong>#dbM</strong></td>
<td class="bodyText"><strong>bd#</strong></td>
<td class="bodyText"><strong>M→$</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>9</strong></td>
<td class="bodyText"><strong>#db</strong></td>
<td class="bodyText"><strong>bd#</strong></td>
<td class="bodyText"><strong>'b'匹配</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>10</strong></td>
<td class="bodyText"><strong>#d</strong></td>
<td class="bodyText"><strong>d#</strong></td>
<td class="bodyText"><strong>'d'匹配</strong></td>
</tr>
<tr>
<td class="bodyText"><strong>11</strong></td>
<td class="bodyText"><strong>#</strong></td>
<td class="bodyText"><strong>#</strong></td>
<td class="bodyText"><strong>分析成功</strong></td>
</tr>

          </table></td>
        </tr>
        <tr>
          <td class="bodyText"><strong>结论:字符串aaabd是该文法的句子</strong></td>
        </tr>
        <tr>
          <td height="24" class="bodyText">&nbsp;</td>
        </tr>
      </table>	  </td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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