作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2011, Vol. 37 ›› Issue (16): 62-64. doi: 10.3969/j.issn.1000-3428.2011.16.021

• 软件技术与数据库 • 上一篇    下一篇

C to Java自动转换系统中C指针的实现

严忠林   

  1. (上海师范大学信息与机电工程学院,上海 200234)
  • 收稿日期:2011-01-15 出版日期:2011-08-20 发布日期:2011-08-20
  • 作者简介:严忠林(1964-),男,讲师、硕士,主研方向:Java应用,软件转换技术
  • 基金资助:
    上海市教委基金资助项目(05DZ14)

Realization of C Pointer in C to Java Automatic Transformation System

YAN Zhong-lin   

  1. (College of Information, Mechanical and Electrical Engineering, Shanghai Normal University, Shanghai 200234, China)
  • Received:2011-01-15 Online:2011-08-20 Published:2011-08-20

摘要: C指针的处理是C to Java代码自动转换系统中一个重要而困难的问题。已有的方法大多不能处理含有技巧的指针代码,转换生成的代码难以理解,往往无法正确执行。基于此,提出一种可用Java实现C指针所有功能的方案,该方案在类型转换后不改变原程序结构,并保持尽可能高的运行效率。示例分析表明,运用该方法可使各种类型的C指针运用都能自动转换为执行正确、结构清晰、修改方便、运行快捷的Java代码。

关键词: 程序语言转换, C指针, Java引用, 数据布局模型, 类型转换

Abstract: How to deal with C pointers is an important and difficult issue in C to Java automatic program transformation System. The existing methods are powerless for ingenious C codes. It is difficult to understand codes generated by some transformation system. These codes are not always correct. This paper presents a set of methods. They implements all the functions of C pointer by Java. This transformation keeps original program structure, and runs as fast as possible. Using it can automatically convert various C pointer applications into correct, clear, changeable and efficient Java code.

Key words: program language transformation, C pointer, Java reference, data layout model, type conversion

中图分类号: