Source Code Conversion with Temporary Object Emulation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing tools for translating computer program source code from one high-level language to another often result in errors and deficiencies, requiring extensive debugging and modification to ensure syntactic correctness and functional equivalence.

Innovation Solution

A system and method that analyzes source code in a first high-level language, generates a data structure with globally unique identifiers for symbols, explicitly creates and tracks temporary objects, and modifies the code to emulate the functionality of temporary objects in the target language, ensuring functional equivalence and correcting name collisions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Extent of automation

If existing tools are used to translate source code from one high-level language to another, then code conversion is automated, but the resulting translations are fraught with errors and deficiencies

Engineering Contradiction:
Improvecode conversion automationVSAvoidtranslation accuracy
Core Design Contradiction:
Extent of automationVSReliability

Solution Approach 1:

The code conversion process is divided into distinct phases: source code analysis phase where a data structure representing the source code is generated, and target code generation phase where functionally equivalent code is produced. This segmentation allows each phase to be optimized independently, improving overall translation accuracy while maintaining automation.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Before generating target code, the system performs preliminary analysis to generate a comprehensive data structure representing the source code, including identification of all symbols and their scopes. This preliminary action enables the generation of globally unique identifiers and proper handling of temporary objects, reducing errors in the translated code.

Inventive Principle:
Principle #10Preliminary action

2Adaptability or versatility

If source code is converted from one high-level language to another, then portability and access to new features are improved, but extensive debugging and modification are required

Engineering Contradiction:
Improvelanguage portabilityVSAvoiddebugging time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The system employs feedback mechanisms by analyzing the source code to identify all symbols, their scopes, and usage patterns, then using this information to generate appropriate target code with correct scoping and temporary object handling. This feedback loop ensures the translated code is functionally equivalent, minimizing debugging requirements.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent introduces an intermediate data structure that represents the source code semantically. This intermediary representation serves as a bridge between source and target languages, preserving the meaning and behavior of the original code while enabling translation to different language paradigms without extensive debugging.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Ease of manufacture

If implicit temporary objects in the source code are not explicitly handled, then the source code structure is preserved, but the translated code lacks functional equivalence

Engineering Contradiction:
Improvecode structure preservationVSAvoidfunctional equivalence
Core Design Contradiction:
Ease of manufactureVSReliability

Solution Approach 1:

During the source code analysis phase, the system performs preliminary identification of all temporary objects and determines their scopes. This preliminary action enables the generation of explicit target code that correctly handles temporary objects, ensuring functional equivalence while maintaining the original code structure's intent.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system creates explicit copies of temporary objects in the target language with properly defined scopes. By copying the temporary object creation and destruction patterns from the source code and translating them into the target language's idioms, the system preserves the original structure's behavior while ensuring functional equivalence.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS10545743B2Enhanced programming language source code conversion with implicit temporary object emulation
Publication Date: 2020.01.28 ORACLE INT CORP
  • US10545743B2 patent drawing
  • US10545743B2 patent drawing
  • US10545743B2 patent drawing

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 that includes implicitly created temporary objects is analyzed. Source code in the second high level programming language is generated that is functionally equivalent to the source code in the first high level programming language. The second high level language does not support temporary objects. For temporary objects identified in the first high level source language, source code is generated to explicitly create and track a corresponding object within a similar scope. In addition, source code is generated to destroy the explicitly created object at a time that generally corresponds to destruction of the temporary object in the original source language.