首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 15 毫秒
1.
讨论了C++中的继承关系,阐述了类型的重要性,着重探讨继承所产的二义性问题。  相似文献   

2.
廉婷丽  刘坚 《微机发展》2004,14(6):71-74
文中分析了C 程序中与继承相关的错误模式,这些错误会引起程序的数据流异常和行为异常。给出了几种常见错误模式的表现形式,结合实例详细分析了这些错误模式的产生原因及特点,重点讨论了容易产生数据流异常的基类与派生类之间的状态一致性问题,得到错误模式的分类。最终达到使用错误模式指导程序分析,检测面向对象程序中的潜在异常,维护系统的安全的目的。  相似文献   

3.
分析了C++程序中与继承相关的错误模式,这些错误会引起程序的数据流异常和行为异常.给出了几种常见错误模式的表现形式,结合实例详细分析了这些错误模式的产生原因及特点,重点讨论了容易产生数据流异常的基类与派生类之间的状态一致性问题,得到错误模式的分类.最终达到使用错误模式指导程序分析,检测面向对象程序中的潜在异常,维护系统的安全的目的.  相似文献   

4.
廉婷丽  刘坚 《微机发展》2004,14(7):12-15
分析了C 程序中与继承相关的错误模式,这些错误会引起程序的数据流异常和行为异常。给出了几种常见错误模式的表现形式,结合实例详细分析了这些错误模式的产生原因及特点,重点讨论了容易产生数据流异常的基类与派生类之间的状态一致性问题,得到错误模式的分类。最终达到使用错误模式指导程序分析,检测面向对象程序中的潜在异常,维护系统的安全的目的。  相似文献   

5.
文中分析了C+ +程序中与继承相关的错误模式,这些错误会引起程序的数据流异常和行为异常.给出了几种常见错误模式的表现形式,结合实例详细分析了这些错误模式的产生原因及特点,重点讨论了容易产生数据流异常的基类与派生类之间的状态一致性问题,得到错误模式的分类.最终达到使用错误模式指导程序分析,检测面向对象程序中的潜在异常,维护系统的安全的目的.  相似文献   

6.
李频 《微机发展》2003,13(9):63-64,67
面向对象编程语言的语义是目前面向对象技术中研究的重点之一,而其中继承机制的语义研究尤为重要。文章主要分析了C 语言中公有派生、私有派生和对象成员的语义,并且给出了这些语义的联系和区别。特别指出的是,在对象成员和私有派生都可用的情况下,尽可能用对象成员实现。  相似文献   

7.
面向对象编程语言的语义是目前面向对象技术中研究的重点之一,而其中继承机制的语义研究尤为重要.文章主要分析了C++语言中公有派生、私有派生和对象成员的语义,并且给出了这些语义的联系和区别.特别指出的是,在对象成员和私有派生都可用的情况下,尽可能用对象成员实现.  相似文献   

8.
预处理在C/C 中发挥着重要作用,然而这些预处理功能存在着一些缺陷,例如在头文件包含进来时,无法改变头文件中的内容;代码的重用性不高;大量重复代码等等。本文提出用一种高级配置语言XVCL(XML-basedVariantConfigura-tionLanguage)代替原来的预处理机制,来克服以上提出的问题。文件被组织为树形结构,并定义了利于提高重用性的变量作用域机制。文章通过一个实例来验证本文提出的方法的有效性。  相似文献   

9.
通常的C/C 预处理器是一个宏处理器,在编译前自动地把源文件转换为编译器可识别的形式。传统的预处理方法基于文本行替换,没有考虑到具体的上下文环境。这种预处理机制在文件包含、宏作用域、头文件关系上存在着一些缺陷,会影响工程项目代码重用,降低程序的可维护性、可扩展性等。通过从分析c预处理器缺陷出发,并利用FOG[1]及其语言可以得到一种基于元变量和元函数的语法替换机制的解决方案。  相似文献   

10.
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.  相似文献   

11.
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.  相似文献   

12.
通常的C/C++预处理器是一个宏处理器,在编译前自动地把源文件转换为编译器可识别的形式。传统的预处理方法基于文本行替换,没有考虑到具体的上下文环境。这种预处理机制在文件包含、宏作用域、头文件关系上存在着一些缺陷,会影响工程项目代码重用,降低程序的可维护性、可扩展性等。通过从分析C预处理器缺陷出发,并利用FOG【1】及其语言可以得到一种基于元变量和元函数的语法替换机制的解决方案。  相似文献   

13.
Fortran与C/C++的混合编译   总被引:10,自引:0,他引:10  
任慧  周振红  张成才 《计算机工程与设计》2007,28(17):4096-4098,4111
在长期的数值计算中人们积累了大量宝贵的程序资源--Fortran、C/C 源程序,为了能综合利用这些资源,Win32环境下多采取基于动态链接库DLL的混合编程方法,增加了额外建造、加载DLL的负担.提出一种Fortran与C/C 混合编程的便捷途径:在特定集成开发环境下的混合编译,系统探讨Fortran与C/C 在调用约定上的协调问题,并用典型实例加以说明.  相似文献   

14.
Tcl/Tk命令与C/C++的集成研究   总被引:2,自引:0,他引:2  
针对Tcl/Tk脚本中需要调用C/C++函数的问题,简要说明了Tcl/Tk命令的运行机理,给出了一个使用Tcl/Tk命令来调用C/C++动态链接库(DLL)函数的方案,并给出了将C/C++DLL函数封装为Tcl/TkC库函数的解决方法。  相似文献   

15.
16.
过程化编程是面向对象编程的基础,它的规律和特点适合采用案例教学、适合进行思维训练.通过对典型案例的剖析,在给出了多种解决方案的过程中,文章的亮点是哲学视野下的思维拓展和思维创新.作为基础编程训练,本文对《C/C++程序设计》课程教学有实用价值.  相似文献   

17.
针对目前高校开设C/C++课程中出现的问题,结合教学实践,从编程思想、关键字和语法格式三方面论述了二者之间的区别,从主函数、类与结构和模板与宏三方面阐述了二者之间的联系,最后给出培养学生编程思路这一教学原则。  相似文献   

18.
This paper describes how the state space exploration ool VeriSoft can be used to analyze parallel C/C++ programs compositionally. VeriSoft is employed for two analyses: transition traceanalysis and assume/guarantee reasoning. Both analyses are compositional in the sense that the behaviour of a parallel program is determined in terms of the behaviour of its constituent processes. While both analyses have traditionally been carried out with “pencil and paper”, the paper demonstrates how VeriSoft can be used to automate them. In the context of transition trace analysis, the question whether a given program can exhibit a given trace is addressed with VeriSoft. To implement assume/guarantee reasoning, VeriSoft is used to determine whether a given program satisfies a given assume/guarantee specification. Since VeriSoft’s state space exploration is bounded and thus not complete in general, our proposed analyses are only meant to complement standard reasoning about parallel programs using traces or assume/guarantee specifications. For instance, a successful analysis does not always imply the general correctness of an assume/guarantee specification. However, it increases the confidence in the verification effort. On the other hand, an unsuccessful analysis always produces a counterexample which can be used to correct the specification or the program. VeriSoft’s optimization and visualization techniques make the analyses relatively efficient and effective.  相似文献   

19.
Matlab与C/C++混合编程技术研究   总被引:5,自引:0,他引:5  
Matlab具有强大的数值计算和分析等能力,而C/C++是目前最为流行的高级程序设计语言,两者互补结合的混合编程在科学研究和工程实践中具有非常重要的意义.因此,从Matlab调用C/C++代码及C/C++调用m文件两方面,深入地研究了它们之问混合编程的原理和实现机制,并且给出了具体条件下的混合编程方法和步骤.实例表明,提出的Matlab与C/C++混合编程方法是简洁、有效的.  相似文献   

20.
程序优化是提高程序运行效率的重要步骤,程序剖析是程序优化的第一步。对于串行语言,程序剖析代码是由编译器通过一个命令行开关自动插入。但是,大部分并行语言编译器都不具有这个功能。该文以并行C++语言的可移植的动态剖析程序(profiler)为例,从两方面对问题进行了论述:首先给出实现可移植动态剖析程序的一般方法;然后分析一个用于pC++插桩(Instrumentation)工具。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

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