基于源代码静态分析的C++0x泛型概念抽取  被引量:10

Using Static Analysis to Extract C++0x Concepts

在线阅读下载全文

作  者:陈林[1,2,3] 徐宝文[1,2,3] 

机构地区:[1]东南大学计算机科学与工程学院,南京210096 [2]南京大学计算机软件新技术国家重点实验室,南京210093 [3]南京大学计算机科学与技术系,南京210093

出  处:《计算机学报》2009年第9期1792-1803,共12页Chinese Journal of Computers

基  金:国家自然科学基金重大研究计划(90818027);重点项目(60633010);国家"八六三"高技术研究发展计划目标导向类项目(2009AA01Z147)资助~~

摘  要:使用泛型概念对领域知识进行抽象是泛型程序设计方法的基础.在新的C++0x标准中泛型概念将成为一个新的语言设施,这将为设计可复用、可扩展的泛型软件提供坚实的基础.为了更好地利用C++0x的新特性,有必要识别C++遗产代码中的泛型概念,并通过重构得到符合C++0x标准的代码.文中提出了一种基于代码静态分析的泛型概念自动识别方法,通过对泛型程序中类型参数的使用分析,从遗产代码中提取有效表达式约束和关联类型约束,进而推导出泛型概念.将该方法应用于C++标准模板库STL,可以识别出STL算法中绝大部分潜在的泛型概念,表明该方法有助于识别遗产代码中的泛型概念.Using Concepts to abstract domain knowledge is the basis for generic programming. Concept will be a new language feature in C++0x, which provides solid base for developing reusable and extendable generic software. To make better use of new generic programming features of C++0x, it is necessary to identify Concepts in legacy C++ programs, and refactor them to C++0x programs. This paper presents an automatic method to identify Concepts with static analysis, analyzes the usages of type parameters in legacy programs to extract valid expression constraints and associate type constraints. Concepts can be inferred by these constraints. The approach is applied to the C++ Standard Template Library to identify most of the potential Concepts in STIr. The study convinces that this method is helpful to identify Concepts in legacy C++ programs.

关 键 词:泛型程序设计 软件重构 泛型概念 C++0x 约束分析 

分 类 号:TP311[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象