理解包含预处理器结构的代码

P. Livadas, David T Small
{"title":"理解包含预处理器结构的代码","authors":"P. Livadas, David T Small","doi":"10.1109/WPC.1994.341255","DOIUrl":null,"url":null,"abstract":"Understanding, debugging, and maintaining software is a costly and difficult task. The difficulties are exacerbated in programs written to take advantage of preprocessing facilities. This paper examines problems associated with source code containing preprocessor constructs-i.e. included files, conditional compilation and macros. We define the useful mappings from tokens in the preprocessor's output to the source file(s), and propose that by capturing these correspondences, an internal program representation can be built which allows for the use of maintenance techniques including program slicing, ripple analysis and dicing. The method presented is generic; to illustrate that the technique is feasible, we discuss ANSI C preprocessor constructs-in particular, macro substitution-and explain the modus developed to handle them in GHINSU-an integrated maintenance environment for ANSI C programs.<<ETX>>","PeriodicalId":308971,"journal":{"name":"Proceedings 1994 IEEE 3rd Workshop on Program Comprehension- WPC '94","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1994-11-14","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"50","resultStr":"{\"title\":\"Understanding code containing preprocessor constructs\",\"authors\":\"P. Livadas, David T Small\",\"doi\":\"10.1109/WPC.1994.341255\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Understanding, debugging, and maintaining software is a costly and difficult task. The difficulties are exacerbated in programs written to take advantage of preprocessing facilities. This paper examines problems associated with source code containing preprocessor constructs-i.e. included files, conditional compilation and macros. We define the useful mappings from tokens in the preprocessor's output to the source file(s), and propose that by capturing these correspondences, an internal program representation can be built which allows for the use of maintenance techniques including program slicing, ripple analysis and dicing. The method presented is generic; to illustrate that the technique is feasible, we discuss ANSI C preprocessor constructs-in particular, macro substitution-and explain the modus developed to handle them in GHINSU-an integrated maintenance environment for ANSI C programs.<<ETX>>\",\"PeriodicalId\":308971,\"journal\":{\"name\":\"Proceedings 1994 IEEE 3rd Workshop on Program Comprehension- WPC '94\",\"volume\":\"1 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"1994-11-14\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"50\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings 1994 IEEE 3rd Workshop on Program Comprehension- WPC '94\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/WPC.1994.341255\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings 1994 IEEE 3rd Workshop on Program Comprehension- WPC '94","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/WPC.1994.341255","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 50

摘要

理解、调试和维护软件是一项昂贵而困难的任务。在利用预处理设施编写的程序中,困难加剧了。本文研究了与包含预处理器结构的源代码相关的问题。包括文件、条件编译和宏。我们定义了从预处理器输出中的令牌到源文件的有用映射,并建议通过捕获这些对应关系,可以构建内部程序表示,从而允许使用维护技术,包括程序切片,纹波分析和切块。所提出的方法是通用的;为了说明该技术是可行的,我们讨论了ANSI C预处理器的结构,特别是宏替换,并解释了在ghinsu (ANSI C程序的集成维护环境)中开发的处理它们的方法。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Understanding code containing preprocessor constructs
Understanding, debugging, and maintaining software is a costly and difficult task. The difficulties are exacerbated in programs written to take advantage of preprocessing facilities. This paper examines problems associated with source code containing preprocessor constructs-i.e. included files, conditional compilation and macros. We define the useful mappings from tokens in the preprocessor's output to the source file(s), and propose that by capturing these correspondences, an internal program representation can be built which allows for the use of maintenance techniques including program slicing, ripple analysis and dicing. The method presented is generic; to illustrate that the technique is feasible, we discuss ANSI C preprocessor constructs-in particular, macro substitution-and explain the modus developed to handle them in GHINSU-an integrated maintenance environment for ANSI C programs.<>
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
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学术文献互助群
群 号:604180095
Book学术官方微信