The Design and Implementation of C-like Language Interpreter

Xiaohong Xiao, You Xu
{"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}
引用次数: 2

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.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
类c语言解释器的设计与实现
本文基于模块化思想,用c++语言设计并实现了一个类C语言解释器。整个系统可分为三个模块,即词法分析器、句法分析器和表达式求值。在设计期间,使用令牌。该设计非常强调代码的可重用性和可扩展性,这使得将代码嵌入到其他c++程序中变得很容易。最终的测试结果表明,所实现的解释器几乎实现了类c语言的所有解释功能,包括接口函数调用的解释。它也可以作为游戏的脚本引擎,通过文本来控制游戏逻辑,并且可以在运行过程中修改游戏,而无需重新编译源代码。此外,它具有良好的可移植性。它可以在Windows XP、MAC OS X 10.6.1和iPhone OS 3.0等不同的操作系统上成功运行。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
A New Method for Impossible Differential Cryptanalysis of 7-Round AES-192 Automatic Summarization for Chinese Text Based on Sub Topic Partition and Sentence Features The Color Components' Exchanging on Different Color Spaces and the Using for Image Segmentation An Improved Multi-objective Population Migration Optimization Algorithm The Application of MapReduce in the Cloud Computing
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1