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

C/C++预处理分析与改进
引用本文:饶伟. C/C++预处理分析与改进[J]. 数字社区&智能家居, 2006, 0(8)
作者姓名:饶伟
作者单位:同济大学软件学院 上海2018041
摘    要:通常的C/C 预处理器是一个宏处理器,在编译前自动地把源文件转换为编译器可识别的形式。传统的预处理方法基于文本行替换,没有考虑到具体的上下文环境。这种预处理机制在文件包含、宏作用域、头文件关系上存在着一些缺陷,会影响工程项目代码重用,降低程序的可维护性、可扩展性等。通过从分析c预处理器缺陷出发,并利用FOG[1]及其语言可以得到一种基于元变量和元函数的语法替换机制的解决方案。

关 键 词:预编译器    FOG  元层次

Improvement on C/C++ Preprocessor
RAO Wei. Improvement on C/C++ Preprocessor[J]. Digital Community & Smart Home, 2006, 0(8)
Authors:RAO Wei
Abstract:C and C are very popular languages. Macro preprocessing (C preprocessing, CPP in short) mechanism plays an important role in C and C . Usually C preprocessor (CPP) mainly operates on macros which input source file, output a target file accessible to C compiler before compiler stage. The former preprocessor is based on lexical substitution mechanism. According to this mechanism, many defects are brought out which decrease maintainability and extensibility of the projects. This article assesses the defects and resolves these limitations by presenting a syntax substitution method based on meta-variant and meta-function with FOG (supporting AOP concept and implement reusability of design pattern).
Keywords:Precompiler  Macro  FOG  Meta-level
本文献已被 CNKI 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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