Abstract Syntax Tree Extensions for Automated Code Transformation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The labor-intensive and costly process of manually porting and refactoring computer programs across different programming languages and platforms, which often requires duplicating development and validation efforts, while ensuring semantic fidelity and optimizing performance.

Innovation Solution

The use of abstract syntax tree extensions with annotations to automate programming language transformations, enabling seamless porting and refactoring across multiple grammars, ensuring semantic equivalence, optimizing execution time and memory footprint, and adapting to changing conditions, including platform and topology changes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual porting and refactoring is performed, then semantic fidelity can be ensured through human verification, but development time and cost increase significantly

Engineering Contradiction:
Improvesemantic fidelityVSAvoiddevelopment time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent creates a systematic copy of the source code's abstract syntax tree and transforms it into the target programming language. This copying approach preserves the semantic structure while enabling automated translation, thus maintaining semantic fidelity without requiring manual reimplementation.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent replaces the mechanical process of manual coding and verification with an automated computational system. The system uses abstract syntax tree manipulation and transformation rules to automatically generate code in target languages, eliminating the need for human developers to manually rewrite and verify code.

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

2Productivity

If automated transformation is implemented, then development time is reduced, but ensuring semantic equivalence becomes more difficult

Engineering Contradiction:
Improvedevelopment speedVSAvoidsemantic equivalence
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent segments the code transformation process into distinct stages: parsing source code into abstract syntax trees, applying transformation rules to convert between language constructs, and generating target code. This segmentation allows each stage to be optimized independently, ensuring semantic correctness while maintaining high automation levels.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The abstract syntax tree serves as an intermediary representation between source and target languages. This intermediate form allows the system to preserve semantic meaning while transforming syntax, acting as a mediator that ensures semantic equivalence during automated translation.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Adaptability or versatility

If code is rewritten for new platforms, then platform compatibility is achieved, but validation and verification efforts must be duplicated

Engineering Contradiction:
Improveplatform compatibilityVSAvoidvalidation complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent creates a universal transformation system that can handle multiple programming languages and platforms through a single abstract syntax tree framework. This multi-functional approach allows the same system to transform code between different languages (e.g., COBOL to Java, Visual Basic to C#) without requiring separate validation processes for each language pair.

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

Data Source

PatentUS9239710B2Programming language transformations with abstract syntax tree extensions
Publication Date: 2016.01.19 SNOWFLAKE INC
  • US9239710B2 patent drawing
  • US9239710B2 patent drawing
  • US9239710B2 patent drawing

AI summary

Techniques to automate the transformation of an application involving programming language constructs from a composite of source grammars to a composite of target grammars, while maintaining the fidelity of the program semantics and functionality, or extending or changing it to explode the capabilities and avoid the limitations of new technologies are disclosed. The different stages of the transformation are persisted in an annotated abstract syntax tree where the annotations represent semantic preserving transformation rules. The abstract syntax tree is then transformed according to the transformational rules. The transformed abstract syntax tree may then be traversed to generate a new translated source code application or be queried to generate output reports. Alternatively, the transformed abstract syntax tree may be subjected to another transformation as part of a chain of transformations.