{"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}
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.<>