Source Code Conversion for Multiple Inheritance
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for translating computer program source code from one high-level language to another often fail to maintain functional equivalence and original code relationships, particularly when dealing with multiple inheritance and separation of translation units, leading to inefficiencies and large, unwieldy code files.
Innovation Solution
A system and method that analyzes source code to generate functionally equivalent code in a new high-level language by identifying derived classes, separating base classes with state information, and maintaining the separation of translation units, using a code conversion tool that processes metadata to bind converted code to original code, and generates new source code that emulates the original structure and separation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If source code is translated from one high-level language to another using existing tools, then code conversion is achieved, but functional equivalence and original code relationships are not maintained
Solution Approach 1:
The patent segments the source code into translation units with separate interfaces for each base class. This allows the conversion process to handle each unit independently while maintaining functional equivalence, resolving the contradiction between reliability and complexity by breaking down the complex translation task into manageable segments.
Solution Approach 2:
The patent performs preliminary analysis of the source code to identify derived classes, base classes, and state information before conversion. This preliminary action ensures that functional equivalence is maintained during translation, as the converter can preserve class relationships and inheritance structures in advance rather than attempting to maintain them during the conversion process.
2Reliability
If multiple inheritance is handled in the translated code, then code functionality is preserved, but code files become large and unwieldy
Solution Approach 1:
The patent separates multiple inheritance relationships into distinct interfaces, each corresponding to a base class. This segmentation prevents code bloat by organizing inherited functionality into modular interface blocks rather than consolidating all inheritance into a single large class definition, thus maintaining functionality while controlling file size.
Solution Approach 2:
The patent extracts state information from base classes into separate data structures. By taking out the state information and handling it separately from the interface definitions, the patent reduces code file size while preserving the functional capabilities of multiple inheritance, resolving the contradiction between functionality and file size.
3Ease of manufacture
If translation units are combined in the converted code, then code compilation is simplified, but maintainability and performance deteriorate
Solution Approach 1:
The patent maintains separate translation units in the converted code, each with its own interface definitions. This segmentation improves maintainability by allowing developers to work with and modify individual units independently, while the converter ensures that compilation remains efficient by preserving the modular structure of the original source code rather than forcing consolidation.
Data Source
AI summary
Systems, apparatuses, and methods for converting computer program source code from a first high level language to a functionally equivalent second high level language different from the first high level language. Source code in a first high level language is analyzed. In response to identifying a derived class in the source code in and determining that the derived class includes more than one base class that includes state information, new source code in the second high level language is generated that includes a class with fields for only one of the base classes that includes state information, separate interfaces in the second high level language that correspond to each base class of the more than one base class other than the one of the base classes that includes state information, and a derived class that corresponds to the derived class in the first high level language. The derived class implements the separate interfaces.


