Binary Intermediate Representation for Source Code Parsing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing intermediate representation techniques for software engineering fail to meet the requirements of expressivity, efficiency, and interoperability, leading to slower parsing times and increased structural difference analysis in evolving software systems.

Innovation Solution

A computer-implemented method using binary intermediate representations to speed up parsing and loading processes while preserving hierarchical abstract syntax trees, involving the generation of a binary representation based on a syntax tree, semi-structured data, or JSON format, and utilizing protocols like protocol buffers or flattened buffers to flatten these representations into compact, navigable binary arrays.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If source code is parsed into structural representations for software engineering activities, then analysis accuracy is improved, but parsing time increases as software systems evolve and source code structures grow in size

Engineering Contradiction:
Improveanalysis accuracyVSAvoidparsing time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent applies preliminary action by pre-parsing source code into intermediate representations (such as abstract syntax trees) and storing them for later use. This allows software engineering tools to perform analysis on pre-processed data without repeating the parsing step, thereby maintaining analysis accuracy while significantly reducing the time required for subsequent operations.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent uses copying by creating intermediate representation copies of the source code in structured formats (XML, JSON, binary). These copies preserve the hierarchical structure and semantic information of the original code while enabling efficient access and manipulation without needing to re-parse the original source code, thus resolving the contradiction between accurate analysis and parsing time.

Inventive Principle:
Principle #26Copying

2Productivity

If intermediate representations are stored persistently to avoid re-parsing, then productivity is improved, but memory loading time increases without optimized formats

Engineering Contradiction:
Improvetool manipulation efficiencyVSAvoidmemory loading time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent applies parameter changes by transforming intermediate representations into optimized binary formats with specific structural parameters (flat arrays, compact encoding schemes). This changes the physical representation parameters of the data while preserving its logical structure, enabling faster memory loading and more efficient manipulation by software engineering tools.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent substitutes the mechanical parsing process with direct binary data loading and manipulation. Instead of using text-based parsers that require complex syntax analysis, the system loads pre-compiled binary intermediate representations that can be directly accessed and manipulated through simple memory operations, dramatically improving both productivity and loading speed.

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

3Adaptability or versatility

If hierarchical abstract syntax trees are preserved for accurate code representation, then expressivity is improved, but data structure complexity and storage size increase

Engineering Contradiction:
Improvecode structure expressivityVSAvoiddata structure complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent applies segmentation by dividing the hierarchical abstract syntax tree into flat, segmented arrays where parent-child relationships are represented through index references rather than nested object structures. This segmentation maintains the expressive hierarchical relationships while representing them in a simpler, more storage-efficient flat array format that reduces structural complexity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent transforms the multi-dimensional hierarchical tree structure into a one-dimensional flat array representation. By adding dimensional indices (parent pointers, child offsets) to the flat array, it preserves the hierarchical relationships in a different dimensional space, thereby maintaining expressivity while reducing structural complexity and improving storage efficiency.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Data Source

PatentEP3827335B1Processing method using binary intermediate representations
Publication Date: 2023.11.08 THE OPEN UNIV
  • EP3827335B1 patent drawingFigure 1
  • EP3827335B1 patent drawingFigure 2
  • EP3827335B1 patent drawingFigure 3

AI summary

A computer-implemented method includes the steps of receiving source code, the source code having an associated grammar; generating a binary intermediate representation of the source code; and performing subsequent processing on the binary intermediate representation.