Code Transformation via Abstract Syntax Tree

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The transformation of legacy code from outdated programming languages to modern languages is complex and often requires significant manual translation, limiting the quality and semantic equivalence of the converted code, as highlighted by the challenges in automated language conversion.

Innovation Solution

A method involving the creation of a tree structure using nodes that represent generic executable operations, allowing for the transformation of executable code across different programming languages by reducing each segment to its basic meaning, thereby avoiding the reflection of syntactical differences and enabling automated code transformation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If automated language conversion is used, then transformation speed and productivity are improved, but quality and semantic equivalence of the converted code deteriorate

Engineering Contradiction:
Improvetransformation speedVSAvoidquality and semantic equivalence
Core Design Contradiction:
ProductivityVSManufacturing precision

Solution Approach 1:

The patent introduces an intermediary abstract syntax tree (AST) as a universal representation layer between source and target programming languages. This AST serves as a mediator that captures the semantic essence of code without being tied to specific language syntax, enabling automated transformation while preserving meaning. The AST acts as the 'intermediary' that resolves the contradiction by providing a language-independent representation that can be systematically converted between different programming languages.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent transforms code representation from language-specific syntactic parameters to semantic parameters in the abstract syntax tree. By changing the representation parameters from concrete syntax to abstract semantic structure, the system achieves language-independent transformation. This parameter change enables automated conversion while maintaining quality, as the semantic structure preserves the essential meaning regardless of the target language's specific syntax rules.

Inventive Principle:
Principle #35Parameter changes

2Manufacturing precision

If manual translation is used, then quality and semantic equivalence of transformed code are improved, but transformation time and complexity increase

Engineering Contradiction:
Improvequality and semantic equivalenceVSAvoidtransformation time
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The patent replaces the mechanical manual translation process with an automated system based on abstract syntax tree manipulation. Instead of human translators mechanically converting syntax one by one, the system uses computational algorithms to automatically traverse and transform the AST. This substitution of mechanical manual work with automated computational processes dramatically reduces transformation time while maintaining high quality through systematic semantic preservation.

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

Solution Approach 2:

The patent segments the code transformation process into distinct phases: parsing source code into AST, analyzing semantic structure, and generating target language code from the AST. This segmentation allows each phase to be optimized independently and enables automated processing at each stage. By breaking down the transformation into manageable segments, the system achieves both speed and quality through systematic processing of code components.

Inventive Principle:
Principle #1Segmentation

3Adaptability or versatility

If workbench based approach with disparate tools is used, then flexibility and adaptability are improved, but device complexity and difficulty of operation increase

Engineering Contradiction:
ImproveflexibilityVSAvoidcomplexity of transformation system
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent merges multiple disparate code transformation tools and functions into a unified system based on a common abstract syntax tree framework. Instead of using separate tools for different transformation tasks, the system combines parsing, analysis, and code generation functions into a single integrated platform. This merging reduces overall system complexity while maintaining flexibility, as the unified AST framework can handle various language conversions through a consistent architecture.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent creates a universal abstract syntax tree framework that serves multiple functions: parsing different programming languages, analyzing code semantics, and generating code in target languages. This multi-functional universal system replaces the need for multiple specialized tools. The single AST-based platform provides adaptability across different language pairs while reducing complexity through functional consolidation and shared infrastructure.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS8438551B2Code transformation
Publication Date: 2013.05.07 CSC TECH SINGAPORE PTE
  • US8438551B2 patent drawing
  • US8438551B2 patent drawing
  • US8438551B2 patent drawing

AI summary

The invention concerns the transformation of executable code from one language to another. In particular, the invention concerns the automated transformation of code. The invention concerns methods, software and computer systems for the creation of a tree comprised of nodes to be used in the transformation of code. The invention also concerns the methods, software and computer systems for the building of a parser to be used in the transformation of code. Finally, the invention also concerns an automated and iterative method of transforming, assessing and re-transforming code. The invention is advantageous in its ability to avoid usage of an intermediate transformation language, and its high level of automation that reduces manual transformation and accordingly is more efficient and less costly.