代码翻译中PERFORM和GOTO语句复合结构的变换  被引量:3

Converting the Compound Control Structure of PERFORM and GOTO Statements in Code Translation

在线阅读下载全文

作  者:武成岗[1] 张兆庆[1] 乔如良[1] 冯晓兵[1] 高琳[1] 石学林[1] 蒋弘山[2] 崔慧敏[2] 

机构地区:[1]中国科学院计算技术研究所,北京100080 [2]清华大学计算机科学与技术系,北京100084

出  处:《软件学报》2004年第4期475-486,共12页Journal of Software

基  金:国家自然科学基金~~

摘  要:传统语言COBOL从诞生至今已有近50年历史,现存约有1 000亿行代码是用COBOL编写的.维护这些遗产代码的一个有效方法是将其翻译成现代语言,例如Java.其中将COBOL语言中GOTO和PERFORM语句及其复合控制结构消除是翻译过程中的一个关键步骤.提出一种利用switch,while语句来消除GOTO和PERFORM复合控制结构的方法,实现了程序的等价变换.该方法不改变程序的控制结构,保持其可读性,并将代码膨胀率控制到2倍左右.该方法已在所开发的C2J翻译系统中进行应用,通过了400万行实际商用程序的测试,结果证明,该方法是正确、有效的.COBOL, a traditional language, has been presented for more than 50 years. There are at least 100 billion lines of legacy codes written in COBOL up to now. An effective way to maintain these legacy codes is to translate them into modern languages, such as Java. While translating, it is a key-step to eliminate GOTO and PERFORM and their compound control structures in COBOL programs. A method which uses switch and while statements is proposed instead of GOTO and PERFORM and their compound control structures. It preserves the readability because the target Java program has the similar control structures. The code size of the target program expands only 2 times in average. This method is applied in the C2J translation system. It is proved sound and effective since 4 million lines of real COBOL program have been translated and its target program has passed the test.

关 键 词:遗产代码 COBOL JAVA 翻译 PERFORM GOTO 控制流 

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

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

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