类c语言解释器的设计与实现

Xiaohong Xiao, You Xu
{"title":"类c语言解释器的设计与实现","authors":"Xiaohong Xiao, You Xu","doi":"10.1109/IPTC.2011.33","DOIUrl":null,"url":null,"abstract":"This paper designs and implements a C-like language interpreter using C++ based on the idea of modularity. The whole system can be divided into three modules, namely, lexical analyzer, syntactic analyzer and evaluation of expression. During the design, token is being used. The design puts great emphasis towards code reusability and extensibility, which makes it easy to embed the code into other C++ programs. The final testing result shows that the implemented interpreter realizes almost all the interpretation functions of C-like language, including the interpretation of interface function call. It can also be used as script engine of games to control game logic through text, and games can be modified during running without recompiling the source code. Moreover, it has good portability. It can successfully run on different operating systems like Windows XP, MAC OS X 10.6.1, and iPhone OS 3.0.","PeriodicalId":388589,"journal":{"name":"2011 2nd International Symposium on Intelligence Information Processing and Trusted Computing","volume":"84 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2011-10-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":"{\"title\":\"The Design and Implementation of C-like Language Interpreter\",\"authors\":\"Xiaohong Xiao, You Xu\",\"doi\":\"10.1109/IPTC.2011.33\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"This paper designs and implements a C-like language interpreter using C++ based on the idea of modularity. The whole system can be divided into three modules, namely, lexical analyzer, syntactic analyzer and evaluation of expression. During the design, token is being used. The design puts great emphasis towards code reusability and extensibility, which makes it easy to embed the code into other C++ programs. The final testing result shows that the implemented interpreter realizes almost all the interpretation functions of C-like language, including the interpretation of interface function call. It can also be used as script engine of games to control game logic through text, and games can be modified during running without recompiling the source code. Moreover, it has good portability. It can successfully run on different operating systems like Windows XP, MAC OS X 10.6.1, and iPhone OS 3.0.\",\"PeriodicalId\":388589,\"journal\":{\"name\":\"2011 2nd International Symposium on Intelligence Information Processing and Trusted Computing\",\"volume\":\"84 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2011-10-22\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"2\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2011 2nd International Symposium on Intelligence Information Processing and Trusted Computing\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/IPTC.2011.33\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2011 2nd International Symposium on Intelligence Information Processing and Trusted Computing","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/IPTC.2011.33","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2

摘要

本文基于模块化思想,用c++语言设计并实现了一个类C语言解释器。整个系统可分为三个模块,即词法分析器、句法分析器和表达式求值。在设计期间,使用令牌。该设计非常强调代码的可重用性和可扩展性,这使得将代码嵌入到其他c++程序中变得很容易。最终的测试结果表明,所实现的解释器几乎实现了类c语言的所有解释功能,包括接口函数调用的解释。它也可以作为游戏的脚本引擎,通过文本来控制游戏逻辑,并且可以在运行过程中修改游戏,而无需重新编译源代码。此外,它具有良好的可移植性。它可以在Windows XP、MAC OS X 10.6.1和iPhone OS 3.0等不同的操作系统上成功运行。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
The Design and Implementation of C-like Language Interpreter
This paper designs and implements a C-like language interpreter using C++ based on the idea of modularity. The whole system can be divided into three modules, namely, lexical analyzer, syntactic analyzer and evaluation of expression. During the design, token is being used. The design puts great emphasis towards code reusability and extensibility, which makes it easy to embed the code into other C++ programs. The final testing result shows that the implemented interpreter realizes almost all the interpretation functions of C-like language, including the interpretation of interface function call. It can also be used as script engine of games to control game logic through text, and games can be modified during running without recompiling the source code. Moreover, it has good portability. It can successfully run on different operating systems like Windows XP, MAC OS X 10.6.1, and iPhone OS 3.0.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信