共查询到18条相似文献,搜索用时 78 毫秒
1.
饶伟 《数字社区&智能家居》2006,(3):117-119
通常的C/C++预处理器是一个宏处理器,在编译前自动地把源文件转换为编译器可识别的形式。传统的预处理方法基于文本行替换,没有考虑到具体的上下文环境。这种预处理机制在文件包含、宏作用域、头文件关系上存在着一些缺陷,会影响工程项目代码重用,降低程序的可维护性、可扩展性等。通过从分析C预处理器缺陷出发,并利用FOG【1】及其语言可以得到一种基于元变量和元函数的语法替换机制的解决方案。 相似文献
2.
预处理在C/C 中发挥着重要作用,然而这些预处理功能存在着一些缺陷,例如在头文件包含进来时,无法改变头文件中的内容;代码的重用性不高;大量重复代码等等。本文提出用一种高级配置语言XVCL(XML-basedVariantConfigura-tionLanguage)代替原来的预处理机制,来克服以上提出的问题。文件被组织为树形结构,并定义了利于提高重用性的变量作用域机制。文章通过一个实例来验证本文提出的方法的有效性。 相似文献
3.
本文以实例程序及其在3种不同编译器上的不同运行结果,表明C/C 运算求值顺序存在缺陷。并利用3种命令行编译器生成实例程序对应的汇编语言程序,深入分析了各编译器在运算求值顺序实现中的具体差异,这对准确、高效地运用C/C 是有益的。 相似文献
4.
5.
针对Java语言与C/C++语言在功能、安全性、可移植性等方面各自不同的特点进行技术分析,同时展望Java语言的发展前景。 相似文献
6.
8.
C++编译器应用研究与评析 总被引:1,自引:0,他引:1
王凤英 《计算机工程与应用》2002,38(15):121-123
该文针对几种典型的C++编译器进行研究。通过一些有代表性的实例在不同的编译器上编译,并将结果与C++Standard进行比较并评析,找出了几个编译器之间的差异。为C++程序移植,为高效、准确地利用面向对象语言C++编程起到了积极的指导作用。 相似文献
9.
10.
11.
RTTI(Run-Time Type Information,运行时类型识别)是C++等面向对象编程语言的一种重要语言机制。目前流行的C++编译器中的RTTI实现机制在应用中存在一些不足,主要体现在动态类型转换操作的低效率和RTTI实现机制的不可定制性。本文通过分析研究标准C++的RTTI机制,提出一种基于元数据和宏,以可定制和高效率为目标的RTTI实现方法。在文章的最后仿真这种RTTI实现方法,证明其可行性和高效性(仿真数据其效率比为5.8)。 相似文献
12.
As software systems become increasingly massive, the advantages of automated transformation tools are clearly evident. These tools allow the machine to both reason about and manipulate high-level source code. They enable off-loading of mundane and laborious programming tasks from human developer to machine, thereby reducing cost and development timeframes.Although there has been much academic work in software transformation, there still exists many hurdles in realising this technology in a commercial domain. From our own experience, there are two significant problems that must be addressed before transformation technology can be usefully applied in a commercial setting. These are: 1.) avoiding disruption of style (i.e. layout and commenting) and the introduction of any undesired modifications which occur as a side effect of the transformation process. 2.) correct handling of C preprocessing and the presentation of a semantically correct view of the program during transformation. Many existing automated transformation tools inherently disrupt style through the use of pretty printing and the need to perform preprocessing before any transformation. Some also require source to be modified so that it conforms to a subset of the grammar. In this paper we describe our own C/C++ transformation system, Proteus, that is able to meet the stringent criteria laid out by Lucent's own software developers. 相似文献
13.
《Science of Computer Programming》2007,68(2):64-78
As software systems become increasingly massive, the advantages of automated transformation tools are clearly evident. These tools allow the machine to both reason about and manipulate high-level source code. They enable off-loading of mundane and laborious programming tasks from human developer to machine, thereby reducing cost and development time frames.Although there has been much work in software transformation, there still exist many hurdles in realizing this technology in a commercial domain. From our own experience, there are two significant problems that must be addressed before transformation technology can be usefully applied in a commercial setting. These are: (1) Avoiding disruption of the style (i.e., layout and commenting) of source code and the introduction of any undesired modifications that can occur as a side effect of the transformation process. (2) Correct automated handling of C preprocessing and the presentation of a semantically correct view of the program during transformation. Many existing automated transformation tools require source to be manually modified so that preprocessing constructs can be parsed. The real semantic of the program remains obscured resulting in the need for complicated analysis during transformation. Many systems also resort to pretty printing to generate transformed programs, which inherently disrupts coding style. In this paper we describe our own C/C++ transformation system, Proteus, that addresses both these issues. It has been tested on millions of lines of commercial C/C++ code and has been shown to meet the stringent criteria laid out by Lucent’s own software developers. 相似文献
14.
C/C 中宏的编制和使用 总被引:1,自引:1,他引:0
目前 ,C和C 语言得到了广泛的运用。宏的编制和使用属于其中的高级编程主题。本文结合作者的编程体会 ,论述了宏的编制和使用的具体方法。 相似文献
15.
16.
提高程序设计和编译效率是计算机科学的一个普遍性问题,本文介绍了将C语言的词法单位-标识定义为扩展键盘宏的方法,并讨论了交互式宏编辑技术在编程和编译方面的显著优点。 相似文献
17.
Fortran与C/C++的混合编译 总被引:10,自引:0,他引:10
在长期的数值计算中人们积累了大量宝贵的程序资源--Fortran、C/C 源程序,为了能综合利用这些资源,Win32环境下多采取基于动态链接库DLL的混合编程方法,增加了额外建造、加载DLL的负担.提出一种Fortran与C/C 混合编程的便捷途径:在特定集成开发环境下的混合编译,系统探讨Fortran与C/C 在调用约定上的协调问题,并用典型实例加以说明. 相似文献
18.
为减少软件静态分析中信息冗余度并提高信息提取的准确率和效率,提出了一种基于关系存储模式的关系语法树模型,以终结符之间的依存关系建模,有效地减少了信息冗余度,并以可扩展标记语言(extensible markup language,XML)标准格式存储.利用了成熟的XML解析技术,设计了一种基于XML中间模型的静态检测方法,并将该方法应用于编程规范检测申.实验结果表明,该方法有效地提高了检测效率和精度. 相似文献