arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1206.5648cs.PL
收藏

C到O-O的翻译:超越简单的东西

C to O-O Translation: Beyond the Easy Stuff

Marco Trudel, Carlo A. Furia, Martin Nordio, Bertrand Meyer, Manuel Oriol

摘要:

我们是否可以重用一些用C开发的庞大代码库,以利用现代程序设计语言的特性,如类型安全、面向对象和契约?本文介绍了一个源到源的C代码到Eiffel,现代面向对象的程序设计语言,和支持工具C2Eif的翻译。翻译是完全自动的,并支持整个C语言(ANSI,以及许多GNU C语言扩展,通过CIL)在实践中使用,包括其使用本机系统库和内联汇编代码。我们的实验表明,C2Eif可以处理C应用程序和大型库(如vim和libgsl),以及具有挑战性的基准测试,如GCC酷刑测试。生成的Eiffel代码在功能上等同于原始C代码,并利用Eiffel的一些面向对象特性来生成安全且易于调试的翻译。

英文摘要:

Can we reuse some of the huge code-base developed in C to take advantage of modern programming language features such as type safety, object-orientation, and contracts? This paper presents a source-to-source translation of C code into Eiffel, a modern object-oriented programming language, and the supporting tool C2Eif. The translation is completely automatic and supports the entire C language (ANSI, as well as many GNU C Compiler extensions, through CIL) as used in practice, including its usage of native system libraries and inlined assembly code. Our experiments show that C2Eif can handle C applications and libraries of significant size (such as vim and libgsl), as well as challenging benchmarks such as the GCC torture tests. The produced Eiffel code is functionally equivalent to the original C code, and takes advantage of some of Eiffel's object-oriented features to produce safe and easy-to-debug translations.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑