Compiler Generator Unified Representation for Interspersed Code

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current compiler generators cannot effectively check interspersed C code fragments for correctness and type compatibility, leading to errors that may remain undetected during the generation process, affecting productivity, execution time, and the reliability of the final product.

Innovation Solution

A unified internal representation is generated from input descriptions containing syntax rules, context-free expressions, and interspersed code, allowing for comprehensive checks of regular expressions, context-free expressions, and interspersed code, including type checking, to ensure the correctness and compatibility of the generated executable.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If compiler generators process regular expressions and context-free grammars separately with interspersed C code, then they can generate scanners and parsers, but they cannot effectively check the interspersed C code for correctness and type compatibility

Engineering Contradiction:
Improvecode correctnessVSAvoidchecking capability
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent merges the processing of regular expressions, context-free grammars, and interspersed C code into a single unified input description format. This allows the compiler generator to handle all three components simultaneously and perform comprehensive checking including type compatibility verification, eliminating the need for separate processing stages and enabling reliable detection of errors in the interspersed code.

Inventive Principle:
Principle #5Merging (Combining)

2Reliability

If comprehensive checking of interspersed code is implemented, then error detection improves, but the complexity of the generator increases

Engineering Contradiction:
Improveerror detectionVSAvoidgenerator structure
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The unified input description format serves multiple functions: it describes regular expressions, context-free grammars, and interspersed C code fragments simultaneously. This universal format enables a single compiler generator to perform syntax analysis, semantic analysis, and type checking without requiring multiple separate tools or complex interconnected systems, thereby improving error detection while controlling complexity.

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

3Reliability

If type checking and compatibility verification are performed, then code reliability improves, but processing time increases

Engineering Contradiction:
Improvetype compatibilityVSAvoidgeneration time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The compiler generator performs type checking and compatibility verification during the code generation process itself, rather than requiring separate verification passes. By integrating these checks into the unified processing stage where the input description is parsed and compiled, the system detects type errors early and avoids subsequent reprocessing, thereby improving reliability while minimizing time loss.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS9038036B2Generation of source code and executable code from formal descriptions
Publication Date: 2015.05.19 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US9038036B2 patent drawing
  • US9038036B2 patent drawing
  • US9038036B2 patent drawing

AI summary

A method of generating an executable that operates as a compiler includes: receiving a unified input description containing syntax rules for both regular and context-free expressions and interspersed code; generating a common internal representation from the unified input description; checking regular expressions in the common internal representation; checking context-free expressions in the common representation; checking the interspersed code; and outputting the executable.