Automatic Programming Language Translation via Abstract Syntax Tree

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Manual translation of programming languages is time-consuming and requires in-depth knowledge, making it inefficient, especially with the rapid development and modification of languages and the increasing number of device platforms.

Innovation Solution

A method for automatic translation of programming language code that tokenizes characters to generate a list of tokens, parses them into an abstract syntax tree, processes it to create a document object model, and analyzes it to produce code in a target language, using a tokenizer, parser, generator, and analyzer.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If manual translation of programming code is used, then translation accuracy can be maintained, but translation time and complexity increase significantly

Engineering Contradiction:
Improvetranslation accuracyVSAvoidtranslation time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent introduces an intermediary system consisting of abstract syntax trees and document object models that mediate between source and target programming languages. The translation system uses these intermediate representations to automatically translate code while maintaining accuracy, resolving the contradiction between manual translation accuracy and automated translation speed.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces the mechanical manual translation process with an automated computer-based system. By substituting human translators with an automated translation engine that uses abstract syntax trees and document object models, the system achieves both speed and accuracy without requiring manual intervention.

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

2Adaptability or versatility

If emulation mechanisms are used to support multiple devices, then device compatibility is improved, but application code size and processing time increase

Engineering Contradiction:
Improvedevice compatibilityVSAvoidapplication code size
Core Design Contradiction:
Adaptability or versatilityVSQuantity of substance

Solution Approach 1:

The patent changes the parameters of the application code by translating it into different programming languages suitable for different device platforms. Instead of using emulation that increases code size, the system translates the core logic into native code for each platform, maintaining compatibility while keeping code size manageable.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent segments the translation process into distinct phases: tokenization, abstract syntax tree generation, document object model creation, and target code generation. This segmentation allows the system to handle multiple device platforms efficiently by processing only the necessary portions of code for each platform.

Inventive Principle:
Principle #1Segmentation

3Adaptability or versatility

If programming languages are constantly modified and new platforms are added, then technological capability is improved, but translation complexity and required expertise increase

Engineering Contradiction:
Improvetechnological capabilityVSAvoidtranslation complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent creates a universal translation system that can handle multiple programming languages and device platforms through a common intermediate representation. The document object model serves as a universal interface that works across different languages and platforms, reducing translation complexity despite increasing technological capability.

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

Data Source

PatentUS8762962B2Methods and apparatus for automatic translation of a computer program language code
Publication Date: 2014.06.24 XENOGENIC DEVELOPMENT LIMITED LIABILITY COMPANY
  • US8762962B2 patent drawing
  • US8762962B2 patent drawing
  • US8762962B2 patent drawing

AI summary

Embodiments of the methods and apparatus for automatic cross language program code translation are provided. One or more characters of a source programming language code are tokenized to generate a list of tokens. Thereafter, the list of tokens is parsed to generate a grammatical data structure comprising one or more data nodes. The grammatical data structure may be an abstract syntax tree. The one or more data nodes of the grammatical data structure are processed to generate a document object model comprising one or more portable data nodes. Subsequently, the one or more portable data nodes in the document object model are analyzed to generate one or more characters of a target programming language code.