COBOL to C++ Translation Preserving Variable Names
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for translating COBOL source programs into modern programming languages like C or JAVA result in code that is difficult to read and maintain, due to differences in data types and memory formats, leading to obfuscated code that requires additional effort for debugging and maintenance.
Innovation Solution
A machine-implemented method that uses object-oriented programming features of C++ to translate COBOL programs into C++, maintaining readable and maintainable code by representing COBOL variables as objects, using descriptive text, and allocating memory in a format identical to the original COBOL program, allowing for mathematical operations and file descriptions in a COBOL-like syntax.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If COBOL programs are translated into modern programming languages like C or JAVA using traditional compilers, then the translation process can be completed, but the resulting code becomes difficult to read and maintain due to obfuscation of variable names and structural changes
Solution Approach 1:
The patent introduces an intermediary translation process that uses COBOL-style comments and descriptors to bridge the gap between COBOL and modern languages. The translator generates C/C++ code that preserves COBOL variable names and structures through comment-based documentation, allowing the code to remain readable while being compatible with modern compilers and tools.
Solution Approach 2:
The patent creates a copy of the COBOL program structure in the translated code by preserving variable names, data type descriptors, and program logic in C/C++ syntax. This copying approach maintains the original COBOL semantics while enabling execution on modern systems, thus improving both adaptability and readability.
2Productivity
If traditional COBOL to C translation is performed, then the code can be compiled with modern compilers, but variable names and program structure become obfuscated requiring extra effort for debugging and maintenance
Solution Approach 1:
The translator acts as an intermediary that preserves COBOL variable names and program structure in the generated C/C++ code through comment-based documentation. This allows modern compilers to process the code efficiently while maintaining readability that reduces debugging and maintenance time.
Solution Approach 2:
The patent changes the translation parameters by preserving COBOL-specific data type descriptors and variable naming conventions in the translated code, rather than converting everything to standard C/C++ types and names. This parameter change maintains a direct correspondence between original and translated code, reducing maintenance overhead.
3Adaptability or versatility
If COBOL programs are translated using prior art methods, then translation can be achieved, but code in the new language becomes difficult to understand and requires retaining copies of original source code for retranslation
Solution Approach 1:
The patent copies the COBOL program structure, variable names, and logic directly into C/C++ code with minimal transformation. This copying strategy maintains simplicity by preserving the original program's organizational structure, reducing the complexity of the translation process while achieving language portability.
4Ease of manufacture
If direct translation of COBOL data types to C/C++ is performed, then the translation process is simplified, but compatibility issues arise due to differences in memory formats and data type representations
Solution Approach 1:
The patent changes the approach to data type translation by preserving COBOL data type descriptors in comments and using them to guide the translation process. This maintains parameter compatibility between COBOL and C/C++ representations while keeping the translation process simple and systematic.
Solution Approach 2:
The translator serves as an intermediary that mediates between COBOL and C/C++ data type systems by preserving COBOL data type descriptors in the translated code. This intermediary approach ensures data compatibility is maintained through explicit type information while allowing the translation process to proceed systematically.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
A method is disclosed for translating by a computer system of a COBOL computer program into a translated computer program that is in a readable and maintainable syntax in an object oriented programming language. The translated program including variable names equivalent to the original COBOL variable names and with attributes described in COBOL syntax. The translating method further providing for memory allocation in the translated computer program for the storage of "COBOL" variables that is compatible with that of the original COBOL program; a description of program flow that is readable, and utilizing arithmetic operators in the translated program to describe operations between Cobol variables. Also disclosed is a special object oriented run-time library for creating and performing operations between COBOL numeric objects, including maintaining storage of variable content in the original COBOL format, and for enabling readability of calling source code by allowing arguments for variable type descriptions to be expressed in COBOL syntax.