cCompiler:c语言编译器,用lex和yacc工具完成词法分析与语法分析并生成语法树,C ++实现了语法树的解析并生成中间代码,生成中间代码的过程中实现了错误检测。之后利用python对中间代码进行处理并生成mips汇流编码并且可以成功在PCSpim(mips模拟器)上运行-源码

上传者: 42118423 | 上传时间: 2021-03-02 16:17:41 | 文件大小: 5.1MB | 文件类型: ZIP
C语言编译器 lex和yacc编写的c语言编译器 词法分析与语法分析的原始文件扩展: ://www.quut.com/c/ANSI-C-grammar-l-1998.html和 实现了C语言除了struct和指针几乎所有的语法。 运行 环境要求:flex bison g ++ 11 python3 中间代码生成 Windows命令行输入: flex compiler.l bison -vdty compiler.y g++ -std=c++11 -o compiler tree.cpp Praser.cpp innerCode.cpp tools.cpp codeOptimize.cpp lex.yy.c y.tab.c compiler.exe test/test.c 或者 makefile.bat 目标代码生成 进入objectcode文件夹,命令行输入 python objectcode.py objectcode.py读取的源文件为inter.txt,生成的mips汇流编码在result.asm文件中 中间代码格式定义 语法 描述 标签1: 定义标签label1 功能f:

文件下载

资源详情

[{"title":"( 53 个子文件 5.1MB ) cCompiler:c语言编译器,用lex和yacc工具完成词法分析与语法分析并生成语法树,C ++实现了语法树的解析并生成中间代码,生成中间代码的过程中实现了错误检测。之后利用python对中间代码进行处理并生成mips汇流编码并且可以成功在PCSpim(mips模拟器)上运行-源码","children":[{"title":"cCompiler-master","children":[{"title":".vs","children":[{"title":"cCompiler","children":[{"title":"v14","children":[{"title":".suo <span style='color:#111;'> 48.00KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"innerCode.h <span style='color:#111;'> 797B </span>","children":null,"spread":false},{"title":"codeOptimize.cpp <span style='color:#111;'> 1.34KB </span>","children":null,"spread":false},{"title":"objectcode","children":[{"title":"objectcode.py <span style='color:#111;'> 5.65KB </span>","children":null,"spread":false},{"title":"inter.txt <span style='color:#111;'> 728B </span>","children":null,"spread":false},{"title":"result.asm <span style='color:#111;'> 1.53KB </span>","children":null,"spread":false}],"spread":true},{"title":"cCompiler.vcxproj.filters <span style='color:#111;'> 1.90KB </span>","children":null,"spread":false},{"title":"compiler.y <span style='color:#111;'> 16.90KB </span>","children":null,"spread":false},{"title":"codeOptimize.h <span style='color:#111;'> 488B </span>","children":null,"spread":false},{"title":"readme.md <span style='color:#111;'> 6.18KB </span>","children":null,"spread":false},{"title":"test","children":[{"title":"test.c <span style='color:#111;'> 371B </span>","children":null,"spread":false}],"spread":true},{"title":"tools.cpp <span style='color:#111;'> 201B </span>","children":null,"spread":false},{"title":"y.output <span style='color:#111;'> 131.57KB </span>","children":null,"spread":false},{"title":"compiler.exe <span style='color:#111;'> 2.53MB </span>","children":null,"spread":false},{"title":"lex.yy.c <span style='color:#111;'> 57.69KB </span>","children":null,"spread":false},{"title":"innerCode.cpp <span style='color:#111;'> 2.37KB </span>","children":null,"spread":false},{"title":"innerCode.txt <span style='color:#111;'> 729B </span>","children":null,"spread":false},{"title":"compiler.l <span style='color:#111;'> 7.17KB </span>","children":null,"spread":false},{"title":"tree.h <span style='color:#111;'> 704B </span>","children":null,"spread":false},{"title":"output","children":[{"title":"output.txt <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":false},{"title":"tools.h <span style='color:#111;'> 147B </span>","children":null,"spread":false},{"title":"makefile.bat <span style='color:#111;'> 169B </span>","children":null,"spread":false},{"title":"cCompiler.vcxproj <span style='color:#111;'> 5.62KB </span>","children":null,"spread":false},{"title":"block.h <span style='color:#111;'> 796B </span>","children":null,"spread":false},{"title":"cCompiler.sln <span style='color:#111;'> 1.24KB </span>","children":null,"spread":false},{"title":"tree.cpp <span style='color:#111;'> 3.27KB </span>","children":null,"spread":false},{"title":"cCompiler.VC.db <span style='color:#111;'> 11.94MB </span>","children":null,"spread":false},{"title":"y.tab.c <span style='color:#111;'> 66.72KB </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"tree.obj <span style='color:#111;'> 161.41KB </span>","children":null,"spread":false},{"title":"cCompiler.log <span style='color:#111;'> 3.25KB </span>","children":null,"spread":false},{"title":"vc140.pdb <span style='color:#111;'> 772.00KB </span>","children":null,"spread":false},{"title":"innerCode.obj <span style='color:#111;'> 373.75KB </span>","children":null,"spread":false},{"title":"cCompiler.tlog","children":[{"title":"CL.write.1.tlog <span style='color:#111;'> 1.20KB </span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'> 62.72KB </span>","children":null,"spread":false},{"title":"unsuccessfulbuild <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"CL.command.1.tlog <span style='color:#111;'> 2.34KB </span>","children":null,"spread":false},{"title":"link-cvtres.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link-rc.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link-cvtres.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link-rc.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"cCompiler.lastbuildstate <span style='color:#111;'> 177B </span>","children":null,"spread":false}],"spread":false},{"title":"vc140.idb <span style='color:#111;'> 595.00KB </span>","children":null,"spread":false},{"title":"block.obj <span style='color:#111;'> 1.34KB </span>","children":null,"spread":false},{"title":"tools.obj <span style='color:#111;'> 122.43KB </span>","children":null,"spread":false},{"title":"cCompiler.pdb <span style='color:#111;'> 60.00KB </span>","children":null,"spread":false},{"title":"Praser.obj <span style='color:#111;'> 2.33MB </span>","children":null,"spread":false}],"spread":false},{"title":"y.tab.h <span style='color:#111;'> 1018B </span>","children":null,"spread":false},{"title":"block.cpp <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"Praser.h <span style='color:#111;'> 2.63KB </span>","children":null,"spread":false},{"title":"Praser.cpp <span style='color:#111;'> 50.63KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

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