Control flow conversion in course of heritage code into modern language

A technology for controlling flow and code, applied in the field of valence transformation, it can solve problems such as unfamiliarity with traditional languages, unexpected termination of program execution, and destruction of program structure, so as to maintain program readability and control code expansion.

Active Publication Date: 2005-10-12
INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF0 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The second problem is that the existence of legacy code affects the interoperability of software
New software written in modern languages ​​and old software in the same industry use different programming languages, and most of the programmers of new software are not familiar with traditional languages, which leads to the link and interaction between new and old software becoming a new technology barrier
The third problem is that it is not conducive to cross-platform migration of code
An obvious feature of this method is to use recursion to implement loops, and for structures with a large number of loops, it may lead to too deep recursion, so that the stack cannot withstand overflow, causing the execution of the program to stop unexpectedly
In addition, this type of method also destroys the structure of the program, and the readability of the transformed program is poor
[0008] Since the GOTO statement affects the structure of the program, people have been studying how to eliminate the GOTO statement for many years, and many methods have been proposed, but these methods are not suitable for the composite structure formed by the PERFORM and GOTO statements in the COBOL language. The readability of the program is poor, and the code expansion rate is high

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Control flow conversion in course of heritage code into modern language
  • Control flow conversion in course of heritage code into modern language
  • Control flow conversion in course of heritage code into modern language

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0032] The technical solution of the present invention will be described in detail below in conjunction with the accompanying drawings and the following embodiments.

[0033] When it is necessary to translate legacy code (COBOL program) into modern language Java, it is necessary to eliminate the PERFORM and GOTO statements that exist in COBOL language but cannot be expressed in Java language, so as to realize code translation smoothly.

[0034] The present invention emulates PERFORM and GOTO statements in COBOL by using the control flow statements Switch and while statements existing in Java.

[0035] The function of the GOTO statement in COBOL is the same as the GOTO statement in C language, that is, to transfer control to another location in the process.

[0036] The PERFORM statement is a statement with two functions. On the one hand, it is equivalent to a loop statement, which executes the loop object under certain loop conditions. On the other hand, it has the function o...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

A control flow conversion method includes converting a 'course' in COBOL program to be a Java category; setting ' entry function ''and its content in Java category; numbering section name of COBOL program; processing COBOL course body structure, PERFORM statement and GOTO statement. In course of converting heritage code to modern language, the method utilizes switch and while statements of senior language to eliminate both GOTO and PERFORM complex control structure.

Description

technical field [0001] The present invention relates to the conversion technology from traditional high-level language to modern high-level language in the compiling field, especially relates to the equivalent conversion method for realizing the difference of the control structure of two languages ​​(cobol and java). Background technique [0002] Traditional languages ​​(such as COBOL, FORTRAN, etc.) have a history of nearly 50 years since their birth. A large number of existing commercial and scientific computing programs are written in these traditional languages. Many of the programs currently running in the banking, securities, and insurance industries were born during that period. According to incomplete statistics, about 100 billion lines of code are written in the traditional language COBOL. Since modern languages ​​replace traditional languages ​​with their superiority, few software practitioners learn and use traditional languages, so programs written in these lan...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/45
Inventor 武成岗张兆庆冯晓兵石学林高琳
Owner INST OF COMPUTING TECH CHINESE ACAD OF SCI
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products