首页 | 本学科首页   官方微博 | 高级检索  
     

改进C/C++的预处理功能
引用本文:初永丽. 改进C/C++的预处理功能[J]. 微计算机信息, 2006, 22(9): 281-284
作者姓名:初永丽
作者单位:264005,山东工商学院信电学院
摘    要:预处理在C/C 中发挥着重要作用,然而这些预处理功能存在着一些缺陷,例如在头文件包含进来时,无法改变头文件中的内容;代码的重用性不高;大量重复代码等等。本文提出用一种高级配置语言XVCL(XML-basedVariantConfigura-tionLanguage)代替原来的预处理机制,来克服以上提出的问题。文件被组织为树形结构,并定义了利于提高重用性的变量作用域机制。文章通过一个实例来验证本文提出的方法的有效性。

关 键 词:预处理  重用  作用域
文章编号:1008-0570(2006)03-3-0281-04
修稿时间:2005-09-06

Extending Preprocessing of C/C++
Chu,Yongli. Extending Preprocessing of C/C++[J]. Control & Automation, 2006, 22(9): 281-284
Authors:Chu  Yongli
Abstract:C and C are very popular languages. Macro preprocessing (C preprocessing, CPP in short) mechanism plays an impor- tant role in C and C . However, there are some shortcomings in CPP. For example, the frigid inclusion mechanism makes it harder to change the contents before the header is included; code reuse is not efficient, there tends to be lots of replicated code both in the implementation files and header files. Other problems include cross including effects problem, macro scoping problem, etc. In this pa- per, a method is presented with XVCL to alleviate these problems. Files are organized with tree structure to improve code reuse and provide a better variable functioning scope. With this approach, you can manipulate the importing file flexibly by inserting/deleting. And most important, you can reuse code more efficiently which makes maintenance much easier. At the end of this paper, the impact of our solutions is discussed.
Keywords:XVCL
本文献已被 CNKI 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号