词法分析Lexer.zip

上传者: 45500521 | 上传时间: 2021-04-11 10:01:39 | 文件大小: 71.76MB | 文件类型: ZIP
用C或C++或其他程序设计语言写一个简单的词法分析程序,程序可以满足下列要求: 1、能分析如下几种简单的语言词法 (1) 标识符: ID=letter(letter|digit)* (2) 关键字(全部小写) main int float double char if then else switch case break continue while do for (3)整型常量:NUM=digit digit* (4)运算符 = + - * / < >= ; ( )? : (5)空格由空白、制表符和换行符组成,用以分隔ID、NUM、运算符等,字符分析时被忽略。 2、单词符号和相应的类别码 假定单词符号和相应的类别码如下: 单词符号 种别码 int 1 = 17 float 2 < 20 if 3 24 标识符 10 >= 25 整型常量 11 ; 26 + 13 ( 27 - 14 ) 28 * 15 ? 29 / 16 : 30 3、词法分析程序实现的功能 输入:单词序列(以文件形式提供),输出识别的单词的二元组序列到文件和屏幕 输出:二元组构成: (syn,token或sum)其中: syn 为单词的种别码 token 为存放的单词自身符号串 sum 为整型常数

文件下载

资源详情

[{"title":"( 48 个子文件 71.76MB ) 词法分析Lexer.zip","children":[{"title":"resource.h <span style='color:#111;'> 822B </span>","children":null,"spread":false},{"title":"LX.cpp <span style='color:#111;'> 6.76KB </span>","children":null,"spread":false},{"title":"Lexer.cpp <span style='color:#111;'> 2.82KB </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"Lexer.log <span style='color:#111;'> 96B </span>","children":null,"spread":false},{"title":"vc142.idb <span style='color:#111;'> 1.39MB </span>","children":null,"spread":false},{"title":"Lexer.exe.recipe <span style='color:#111;'> 315B </span>","children":null,"spread":false},{"title":"Lexer.ilk <span style='color:#111;'> 2.27MB </span>","children":null,"spread":false},{"title":"pch.obj <span style='color:#111;'> 683.03KB </span>","children":null,"spread":false},{"title":"Lexer.pch <span style='color:#111;'> 55.44MB </span>","children":null,"spread":false},{"title":"Lexer.vcxproj.FileListAbsolute.txt <span style='color:#111;'> 74B </span>","children":null,"spread":false},{"title":"Lexer.pdb <span style='color:#111;'> 2.89MB </span>","children":null,"spread":false},{"title":"LX.obj <span style='color:#111;'> 840.56KB </span>","children":null,"spread":false},{"title":"Lexer.obj <span style='color:#111;'> 71.75KB </span>","children":null,"spread":false},{"title":"Lexer.res <span style='color:#111;'> 68.06KB </span>","children":null,"spread":false},{"title":"Lexer.tlog","children":[{"title":"rc.command.1.tlog <span style='color:#111;'> 460B </span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'> 120.50KB </span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'> 6.45KB </span>","children":null,"spread":false},{"title":"rc.read.1.tlog <span style='color:#111;'> 3.25KB </span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'> 1.15KB </span>","children":null,"spread":false},{"title":"CL.write.1.tlog <span style='color:#111;'> 4.21KB </span>","children":null,"spread":false},{"title":"Lexer.lastbuildstate <span style='color:#111;'> 188B </span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'> 2.03KB </span>","children":null,"spread":false},{"title":"CL.command.1.tlog <span style='color:#111;'> 3.33KB </span>","children":null,"spread":false},{"title":"rc.write.1.tlog <span style='color:#111;'> 286B </span>","children":null,"spread":false}],"spread":false},{"title":"vc142.pdb <span style='color:#111;'> 7.08MB </span>","children":null,"spread":false},{"title":"Lexer.exe <span style='color:#111;'> 377.00KB </span>","children":null,"spread":false},{"title":"LexerDlg.obj <span style='color:#111;'> 315.22KB </span>","children":null,"spread":false}],"spread":false},{"title":"framework.h <span style='color:#111;'> 1.52KB </span>","children":null,"spread":false},{"title":"pch.h <span style='color:#111;'> 544B </span>","children":null,"spread":false},{"title":".vs","children":[{"title":"Lexer","children":[{"title":"v16","children":[{"title":"ipch","children":[{"title":"20cb2e22141e1673.ipch <span style='color:#111;'> 122.56MB </span>","children":null,"spread":false}],"spread":true},{"title":".suo <span style='color:#111;'> 36.00KB </span>","children":null,"spread":false},{"title":"Browse.VC.db <span style='color:#111;'> 71.91MB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"Lexer.h <span style='color:#111;'> 472B </span>","children":null,"spread":false},{"title":"Lexer.vcxproj.user <span style='color:#111;'> 231B </span>","children":null,"spread":false},{"title":"LX.h <span style='color:#111;'> 480B </span>","children":null,"spread":false},{"title":"Lexer.rc <span style='color:#111;'> 11.03KB </span>","children":null,"spread":false},{"title":"pch.cpp <span style='color:#111;'> 158B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"Lexer.rc2 <span style='color:#111;'> 666B </span>","children":null,"spread":false},{"title":"Lexer.ico <span style='color:#111;'> 66.19KB </span>","children":null,"spread":false}],"spread":true},{"title":"Lexer.vcxproj.filters <span style='color:#111;'> 2.20KB </span>","children":null,"spread":false},{"title":"Lexer.vcxproj <span style='color:#111;'> 10.21KB </span>","children":null,"spread":false},{"title":"LexerDlg.cpp <span style='color:#111;'> 4.93KB </span>","children":null,"spread":false},{"title":"Lexer.sln <span style='color:#111;'> 1.40KB </span>","children":null,"spread":false},{"title":"Lexer.aps <span style='color:#111;'> 106.25KB </span>","children":null,"spread":false},{"title":"LexerDlg.h <span style='color:#111;'> 688B </span>","children":null,"spread":false},{"title":"targetver.h <span style='color:#111;'> 299B </span>","children":null,"spread":false},{"title":"TestData.txt <span style='color:#111;'> 28B </span>","children":null,"spread":false},{"title":"Result.txt <span style='color:#111;'> 222B </span>","children":null,"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明