Source Code Translation via Parse Tree Mutation Scripts

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Manual translation of source code from legacy systems to cloud-based environments is time-consuming, error-prone, and introduces inconsistencies due to differing coding styles and logic, making large-scale data migration costly and risky.

Innovation Solution

A system and method for automatically translating source code using a mutator framework that generates a parse tree, applies mutation scripts to create stream expressions, and formats output in the target language, reducing the need for manual coding and allowing for continuous improvement of translation rules.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Extent of automation

If manual translation of source code is performed by a team of developers, then the source code can be translated from legacy language to target language, but inconsistencies are introduced due to different coding styles and logic applied by each developer

Engineering Contradiction:
Improveautomation of source code translationVSAvoidconsistency of translated code
Core Design Contradiction:
Extent of automationVSReliability

Solution Approach 1:

The patent replaces the mechanical system of manual code translation by human developers with an automated computational system. The system uses a parser to generate a parse tree from source code, applies mutation scripts to transform the parse tree, and generates target language code automatically. This substitution eliminates human variability and ensures consistent translation across all code while maintaining high automation extent.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Productivity

If manual translation of source code is performed, then the translation can be completed, but the process is time-consuming and error-prone

Engineering Contradiction:
Improvetranslation speedVSAvoidtime required for code translation
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent implements a self-service system where the translation process operates autonomously without requiring continuous human intervention. The parser automatically generates parse trees, mutation scripts automatically transform the trees, and the system automatically generates target code. This self-service mechanism dramatically increases productivity while minimizing time loss, as the system handles the entire translation workflow automatically.

Inventive Principle:
Principle #25Self-service

3Adaptability or versatility

If manual source code translation is performed to migrate applications to cloud-based systems, then data migration can be completed, but the process is costly and introduces operational risks

Engineering Contradiction:
Improveability to migrate to different cloud environmentsVSAvoidcomplexity of translation process
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent segments the source code into its fundamental syntactic components through parse tree generation. By breaking down code into nodes and leaves representing different linguistic elements, the system can systematically apply transformation rules to each segment. This segmentation approach enables adaptable migration to various cloud environments while managing complexity through structured, rule-based transformation rather than complex manual rewriting.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS11487521B2System and method for source code translation using stream expressions
Publication Date: 2022.11.01 NEXT PATHWAY INC
  • US11487521B2 patent drawing
  • US11487521B2 patent drawing
  • US11487521B2 patent drawing

AI summary

A system and method to translate source code in a source language executable in a source computing system to a target language executable in a target computing system. Source code in the source language is parsed to generate a corresponding parse tree containing at least one tree node and at least one leaf. During traversal of the parse tree, at least one mutation script is applied. The mutation script directs at least one of: generating a stream expression comprising at least one token corresponding to values of the at least one node and the at least one leaf of the parse tree; and formulating at least one text output containing a text pattern specified in the mutation script and/or values of the at least one token. Source code in the target language is outputted based on the at least one text output.