编译原理.zip

  • PUDN用户
    了解作者
  • C/C++
    开发工具
  • 14KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 1
    下载次数
  • 2021-04-17 21:12
    上传日期
依据实验指导书做的一个简单的词法分析器。
编译原理.zip
  • 第一次实验.doc
    79KB
  • 编译原理.txt
    0B
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/628191d73b39c07824fa49cb/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/628191d73b39c07824fa49cb/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">&#12298;&#32534;&#35793;&#21407;&#29702;&#12299;&#23454;&#39564;&#25351;&#23548;&#20070; &#35745;&#31639;&#26426;&#31185;&#23398;&#31995;</div><div class="t m0 x2 h4 y3 ff1 fs1 fc0 sc0 ls0 ws0">&#12298;&#32534;&#35793;&#21407;&#29702;&#12299;&#23454;&#39564;&#19968;</div><div class="t m0 x3 h5 y4 ff1 fs2 fc0 sc0 ls0 ws0">&#35789;&#27861;&#20998;&#26512;&#22120;</div><div class="t m0 x4 h5 y5 ff1 fs2 fc0 sc0 ls0 ws0">&#32771;&#34385;&#22914;&#19979;<span class="_ _0"> </span><span class="ff2">C<span class="_ _0"> </span></span>&#35821;&#35328;&#23376;&#38598;</div><div class="t m0 x5 h5 y6 ff1 fs2 fc0 sc0 ls0 ws0">&#21333;&#35789;<span class="_ _1"> </span>&#31867;&#21035;&#32534;&#30721;<span class="_ _2"> </span>&#21161;&#35760;&#31526;<span class="_ _3"> </span>&#20540;<span class="_ _4"> </span>&#22791;&#27880;</div><div class="t m0 x6 h6 y7 ff2 fs2 fc0 sc0 ls0 ws0">break<span class="_ _5"> </span>1</div><div class="t m0 x7 h6 y8 ff2 fs2 fc0 sc0 ls0 ws0">BREAK</div><div class="t m0 x8 h6 y7 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 x9 h6 y9 ff2 fs2 fc0 sc0 ls0 ws0">char<span class="_ _6"> </span>2</div><div class="t m0 xa h6 ya ff2 fs2 fc0 sc0 ls0 ws0">CHAR</div><div class="t m0 x8 h6 y9 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 xb h6 yb ff2 fs2 fc0 sc0 ls0 ws0">do<span class="_ _7"> </span>3</div><div class="t m0 xc h6 yc ff2 fs2 fc0 sc0 ls0 ws0">DO</div><div class="t m0 x8 h6 yb ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 xd h6 yd ff2 fs2 fc0 sc0 ls0 ws0">double<span class="_ _8"> </span>4</div><div class="t m0 xe h6 ye ff2 fs2 fc0 sc0 ls0 ws0">DOUBLE</div><div class="t m0 x8 h6 yd ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 xf h6 yf ff2 fs2 fc0 sc0 ls0 ws0">else<span class="_ _9"> </span>5</div><div class="t m0 x10 h6 y10 ff2 fs2 fc0 sc0 ls0 ws0">ELSE</div><div class="t m0 x8 h6 yf ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 x11 h6 y11 ff2 fs2 fc0 sc0 ls0 ws0">if<span class="_ _a"> </span>6</div><div class="t m0 x12 h6 y12 ff2 fs2 fc0 sc0 ls0 ws0">IF</div><div class="t m0 x8 h6 y11 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 xb h6 y13 ff2 fs2 fc0 sc0 ls0 ws0">int<span class="_ _7"> </span>7</div><div class="t m0 x13 h6 y14 ff2 fs2 fc0 sc0 ls0 ws0">INT</div><div class="t m0 x8 h6 y13 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 x14 h6 y15 ff2 fs2 fc0 sc0 ls0 ws0">return<span class="_ _b"> </span>8</div><div class="t m0 xe h6 y16 ff2 fs2 fc0 sc0 ls0 ws0">RETURN</div><div class="t m0 x8 h6 y15 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 x9 h6 y17 ff2 fs2 fc0 sc0 ls0 ws0">void<span class="_ _c"> </span>9</div><div class="t m0 x10 h6 y18 ff2 fs2 fc0 sc0 ls0 ws0">VOID</div><div class="t m0 x8 h6 y17 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 x6 h6 y19 ff2 fs2 fc0 sc0 ls0 ws0">while</div><div class="t m0 x15 h6 y1a ff2 fs2 fc0 sc0 ls0 ws0">10<span class="_ _d"> </span>WHILE</div><div class="t m0 x8 h6 y19 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 x16 h5 y1b ff1 fs2 fc0 sc0 ls0 ws0">&#26631;&#35782;&#31526;</div><div class="t m0 x15 h6 y1c ff2 fs2 fc0 sc0 ls0 ws0">11</div><div class="t m0 x17 h6 y1d ff2 fs2 fc0 sc0 ls0 ws0">ID</div><div class="t m0 x18 h5 y1b ff1 fs2 fc0 sc0 ls0 ws0">&#26500;&#25104;&#26631;&#35782;&#31526;&#30340;&#23383;&#31526;&#20018;</div><div class="t m0 x5 h5 y1e ff1 fs2 fc0 sc0 ls0 ws0">&#24120;&#25968;</div><div class="t m0 x15 h6 y1f ff2 fs2 fc0 sc0 ls0 ws0">12</div><div class="t m0 x10 h6 y20 ff2 fs2 fc0 sc0 ls0 ws0">NUM</div><div class="t m0 x19 h5 y1e ff1 fs2 fc0 sc0 ls0 ws0">&#25968;&#20540;</div><div class="t m0 x16 h5 y21 ff1 fs2 fc0 sc0 ls0 ws0">&#23383;&#31526;&#20018;</div><div class="t m0 x15 h6 y22 ff2 fs2 fc0 sc0 ls0 ws0">13<span class="_ _e"> </span>STRING</div><div class="t m0 x1a h5 y21 ff1 fs2 fc0 sc0 ls0 ws0">&#23383;&#31526;&#20018;</div><div class="t m0 x11 h6 y23 ff2 fs2 fc0 sc0 ls0 ws0">+</div><div class="t m0 x15 h6 y24 ff2 fs2 fc0 sc0 ls0 ws0">14<span class="_ _f"> </span>ADD</div><div class="t m0 x8 h6 y23 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 x1b h6 y25 ff2 fs2 fc0 sc0 ls0 ws0">&#8211;</div><div class="t m0 x15 h6 y26 ff2 fs2 fc0 sc0 ls0 ws0">15</div><div class="t m0 x1c h6 y25 ff2 fs2 fc0 sc0 ls0 ws0">SUB<span class="_ _10"> </span>_</div><div class="t m0 x1b h6 y27 ff2 fs2 fc0 sc0 ls0 ws0">*</div><div class="t m0 x15 h6 y28 ff2 fs2 fc0 sc0 ls0 ws0">16<span class="_ _8"> </span>MUL</div><div class="t m0 x8 h6 y27 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 x1d h6 y29 ff2 fs2 fc0 sc0 ls0 ws0">/</div><div class="t m0 x15 h6 y2a ff2 fs2 fc0 sc0 ls0 ws0">17<span class="_ _11"> </span>DIV</div><div class="t m0 x8 h6 y29 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 x11 h6 y2b ff2 fs2 fc0 sc0 ls0 ws0">&gt;</div><div class="t m0 x15 h6 y2c ff2 fs2 fc0 sc0 ls0 ws0">18<span class="_ _12"> </span>GT</div><div class="t m0 x8 h6 y2b ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 x1e h6 y2d ff2 fs2 fc0 sc0 ls0 ws0">&gt;=</div><div class="t m0 x15 h6 y2e ff2 fs2 fc0 sc0 ls0 ws0">19</div><div class="t m0 x1f h6 y2d ff2 fs2 fc0 sc0 ls0 ws0">GE<span class="_ _13"> </span>_</div><div class="t m0 x11 h6 y2f ff2 fs2 fc0 sc0 ls0 ws0">&lt;</div><div class="t m0 x15 h6 y30 ff2 fs2 fc0 sc0 ls0 ws0">20</div><div class="t m0 x17 h6 y2f ff2 fs2 fc0 sc0 ls0 ws0">L<span class="_ _14"></span>T<span class="_ _15"> </span>_</div><div class="t m0 x1e h6 y31 ff2 fs2 fc0 sc0 ls0 ws0">&lt;=</div><div class="t m0 x15 h6 y32 ff2 fs2 fc0 sc0 ls0 ws0">21</div><div class="t m0 x1f h6 y31 ff2 fs2 fc0 sc0 ls0 ws0">LE<span class="_ _16"> </span>_</div><div class="t m0 x1e h6 y33 ff2 fs2 fc0 sc0 ls0 ws0">==</div><div class="t m0 x15 h6 y34 ff2 fs2 fc0 sc0 ls0 ws0">22<span class="_ _12"> </span>EQ</div><div class="t m0 x8 h6 y33 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 xb h6 y35 ff2 fs2 fc0 sc0 ls0 ws0">!=</div><div class="t m0 x15 h6 y36 ff2 fs2 fc0 sc0 ls0 ws0">23<span class="_ _12"> </span>NE</div><div class="t m0 x8 h6 y35 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 x11 h6 y37 ff2 fs2 fc0 sc0 ls0 ws0">=</div><div class="t m0 x15 h6 y38 ff2 fs2 fc0 sc0 ls0 ws0">24<span class="_ _e"> </span>ASSIGN</div><div class="t m0 x8 h6 y37 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 x1b h6 y39 ff2 fs2 fc0 sc0 ls0 ws0">{</div><div class="t m0 x15 h6 y3a ff2 fs2 fc0 sc0 ls0 ws0">25<span class="_ _c"> </span>LB</div><div class="t m0 x8 h6 y39 ff2 fs2 fc0 sc0 ls0 ws0">_</div><div class="t m0 x20 h7 y3b ff1 fs3 fc0 sc0 ls0 ws0">&#31532;<span class="ff2"> 1 </span>&#39029;<span class="ff2"> </span>&#20849;<span class="ff2"> 4 </span>&#39029;</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐
    • 词法分析器
      这是一个用c++编写的词法分析器,一个完整的C语言词法分析器。输入一段源程序,能够正确输出单词符号。
    • 词法分析器
      这是一个用MFC编写的词法分析器,适用于编译原理中对词法的分析过程,包括源代码等。
    • 词法分析器
      设计并实现一个词法分析器,实现对指定位置的类C语言源程序文本文件的读取,并能够对该源程序中的所有单词进行分类,指出其所属类型,实现简单的词法分析操作。
    • 词法分析器
      词法分析器,基本的C语言词法分析。。。。。。。。。。。。。。。。。。
    • 词法分析器
      手撸纯C词法分析器一枚,可以试下多种语言的词法分析功能。 只要改一下keywd表就行了。主要是一个自动机。。。。。。。 可以实现跨平台,gcc vc均有测试。大家可以自己接语法树生成处理。
    • 词法分析器
      词法分析器可实现编译原理中词法的功能 包括程序段中关键字、数据类型、数值型变量、字符串的有效识别和分类,并有详细的注释,代码可读性很强。
    • 词法分析器
      待分析的简单的词法 (1)注释: 以“//”开头到该行尾部为注释 (2)关键字(共6个): int real if then else while (3)标识符(ID)和整型常数(NUM): ...符和关键字,词法分析阶段通常被忽略。
    • 词法分析器.zip
      C-语言的词法分析器,能够逐行对C-进行编译,进行词法分析
    • 词法分析器.rar
      实现标准C语言词法分析器。 单词种别编码要求: 基本字、运算符、界符:一符一种 标识符:统一为一种 常量:按类型编码
    • 词法分析器.zip
      可以对PL/0的程序进行词法分析归类,并实现文件的输出