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

📄 词法分析程序.htm

📁 语法分析程序 必须先编写一个program的文本文件 再对该文本文件的程序进行语法分析
💻 HTM
📖 第 1 页 / 共 5 页
字号:
"Times New Roman"'>项</span><span lang=EN-US>&gt;{&lt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>加型运算符</span><span lang=EN-US>&gt;&lt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>项</span><span lang=EN-US>&gt;}</span></p>

<p class=MsoNormal style='text-indent:27.0pt;mso-char-indent-count:2.57;
mso-char-indent-size:10.5pt;line-height:150%'><span lang=EN-US>&lt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>项</span><span lang=EN-US>&gt;</span><span style='font-family:
宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman"'>→</span><span
lang=EN-US>&lt;</span><span style='font-family:宋体;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman"'>因子</span><span lang=EN-US>&gt;{&lt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>乘型运算符</span><span lang=EN-US>&gt;&lt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>因子</span><span lang=EN-US>&gt;}</span></p>

<p class=MsoNormal style='text-indent:27.0pt;mso-char-indent-count:2.57;
mso-char-indent-size:10.5pt;line-height:150%'><span lang=EN-US>&lt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>因子</span><span lang=EN-US>&gt;</span><span style='font-family:
宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman"'>→标识符</span><span
lang=EN-US> | </span><span style='font-family:宋体;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman"'>无符号整数</span><span lang=EN-US> | (&lt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>表达式</span><span lang=EN-US>&gt;)</span></p>

<p class=MsoNormal style='text-indent:27.0pt;mso-char-indent-count:2.57;
mso-char-indent-size:10.5pt;line-height:150%'><span lang=EN-US>&lt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>加型运算符</span><span lang=EN-US>&gt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>→</span><span lang=EN-US>+|-</span></p>

<p class=MsoNormal style='text-indent:27.0pt;mso-char-indent-count:2.57;
mso-char-indent-size:10.5pt;line-height:150%'><span lang=EN-US>&lt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>乘型运算符</span><span lang=EN-US>&gt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>→</span><span lang=EN-US>* | /</span></p>

<p class=MsoNormal style='text-indent:27.0pt;mso-char-indent-count:2.57;
mso-char-indent-size:10.5pt;line-height:150%'><span lang=EN-US>&lt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>关系运算符</span><span lang=EN-US>&gt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>→</span><span lang=EN-US>=|&lt;&gt;|&lt;|&lt;=|&gt;|&gt;=</span></p>

<p class=MsoNormal style='text-indent:27.0pt;mso-char-indent-count:2.57;
mso-char-indent-size:10.5pt;line-height:150%'><span style='font-family:宋体;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman"'>其中:</span></p>

<p class=MsoNormal style='text-indent:27.0pt;mso-char-indent-count:2.57;
mso-char-indent-size:10.5pt;line-height:150%'><span lang=EN-US>&nbsp;&lt;<span
style="mso-spacerun: yes">&nbsp;&nbsp; </span>&gt;</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>:用左右尖括号括起的字符串表示非终结符号</span></p>

<p class=MsoNormal style='text-indent:27.0pt;mso-char-indent-count:2.57;
mso-char-indent-size:10.5pt;line-height:150%'><span style='font-family:宋体;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman"'>::</span><span
lang=EN-US>= </span><span style='font-family:宋体;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman"'>:</span> <span style='font-family:
宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman"'>定义为</span></p>

<p class=MsoNormal style='text-indent:27.0pt;mso-char-indent-count:2.57;
mso-char-indent-size:10.5pt;line-height:150%'><span lang=EN-US>{<span
style="mso-spacerun: yes">&nbsp; </span>}</span><span style='font-family:宋体;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman"'>:表示该语法成分可以</span><span
lang=EN-US>0</span><span style='font-family:宋体;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman"'>—</span><span lang=EN-US>n</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>次重复。</span></p>

<p class=MsoNormal style='text-indent:27.0pt;mso-char-indent-count:2.57;
mso-char-indent-size:10.5pt;line-height:150%'><span lang=EN-US>[<span
style="mso-spacerun: yes">&nbsp; </span>]</span><span style='font-family:宋体;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman"'>:表示方括号内为可选项,即</span><span
lang=EN-US>0</span><span style='font-family:宋体;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman"'>或</span><span lang=EN-US>1</span><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>次。</span></p>

<p class=MsoNormal style='line-height:150%'><span lang=EN-US style='font-family:
宋体'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoNormal style='line-height:150%'><b><span style='font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>三、程序设计语言单词的内部编码</span></b><span lang=EN-US style='font-family:
宋体'><o:p></o:p></span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:150%'><span
style='font-family:宋体'>如表<span lang=EN-US>1-1为词法分析中的内码单词对照表。<b><o:p></o:p></b></span></span></p>

<p class=MsoNormal align=center style='text-align:center;line-height:150%'><b><span
style='font-family:宋体'>表<span lang=EN-US>1-1<span style="mso-spacerun:
yes">&nbsp; </span>内部码对照表</span></span></b><span lang=EN-US style='font-family:
宋体'><o:p></o:p></span></p>

<table border=1 cellspacing=0 cellpadding=0 style='border-collapse:collapse;
 border:none;mso-border-top-alt:solid windowtext .5pt;mso-border-bottom-alt:
 solid windowtext .5pt;mso-padding-alt:0cm 5.4pt 0cm 5.4pt'>
 <tr>
  <td width=55 style='width:41.4pt;border:solid windowtext .5pt;border-left:
  none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
  "Times New Roman"'>内码</span></p>
  </td>
  <td width=98 style='width:73.2pt;border:solid windowtext .5pt;border-left:
  none;mso-border-left-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
  "Times New Roman"'>单词</span></p>
  </td>
  <td width=69 style='width:51.9pt;border:solid windowtext .5pt;border-left:
  none;mso-border-left-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
  "Times New Roman"'>内码</span></p>
  </td>
  <td width=69 style='width:51.9pt;border:solid windowtext .5pt;border-left:
  none;mso-border-left-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
  "Times New Roman"'>单词</span></p>
  </td>
  <td width=69 style='width:51.9pt;border:solid windowtext .5pt;border-left:
  none;mso-border-left-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
  "Times New Roman"'>内码</span></p>
  </td>
  <td width=69 style='width:51.9pt;border:solid windowtext .5pt;border-left:
  none;mso-border-left-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
  "Times New Roman"'>单词</span></p>
  </td>
  <td width=69 style='width:51.95pt;border:solid windowtext .5pt;border-left:
  none;mso-border-left-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
  "Times New Roman"'>内码</span></p>
  </td>
  <td width=69 style='width:51.95pt;border-top:solid windowtext .5pt;
  border-left:none;border-bottom:solid windowtext .5pt;border-right:none;
  mso-border-left-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
  "Times New Roman"'>单词</span></p>
  </td>
 </tr>
 <tr>
  <td width=55 style='width:41.4pt;border-top:none;border-left:none;border-bottom:
  solid windowtext .5pt;border-right:solid windowtext .5pt;mso-border-top-alt:
  solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  lang=EN-US>1</span></p>
  </td>
  <td width=98 style='width:73.2pt;border-top:none;border-left:none;border-bottom:
  solid windowtext .5pt;border-right:solid windowtext .5pt;mso-border-top-alt:
  solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  lang=EN-US>PROGRAM</span></p>
  </td>
  <td width=69 style='width:51.9pt;border-top:none;border-left:none;border-bottom:
  solid windowtext .5pt;border-right:solid windowtext .5pt;mso-border-top-alt:
  solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  lang=EN-US>2</span></p>
  </td>
  <td width=69 style='width:51.9pt;border-top:none;border-left:none;border-bottom:
  solid windowtext .5pt;border-right:solid windowtext .5pt;mso-border-top-alt:
  solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  lang=EN-US>CONST</span></p>
  </td>
  <td width=69 style='width:51.9pt;border-top:none;border-left:none;border-bottom:
  solid windowtext .5pt;border-right:solid windowtext .5pt;mso-border-top-alt:
  solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  lang=EN-US>3</span></p>
  </td>
  <td width=69 style='width:51.9pt;border-top:none;border-left:none;border-bottom:
  solid windowtext .5pt;border-right:solid windowtext .5pt;mso-border-top-alt:
  solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  lang=EN-US>VAR</span></p>
  </td>
  <td width=69 style='width:51.95pt;border-top:none;border-left:none;
  border-bottom:solid windowtext .5pt;border-right:solid windowtext .5pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  lang=EN-US>4</span></p>
  </td>
  <td width=69 style='width:51.95pt;border:none;border-bottom:solid windowtext .5pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  lang=EN-US>INTEGER</span></p>
  </td>
 </tr>
 <tr>
  <td width=55 style='width:41.4pt;border-top:none;border-left:none;border-bottom:
  solid windowtext .5pt;border-right:solid windowtext .5pt;mso-border-top-alt:
  solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center;line-height:150%'><span
  lang=EN-US>5</span></p>
  </td>
  <td width=98 style='width:73.2pt;border-top:none;border-left:none;border-bottom:

⌨️ 快捷键说明

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