# US 2017/0286077 A1 · Interface definition language compiler with version reconciliation

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2017/0286077 A1
- Document ID: US20170286077A1
- Status: Published application
- Kind: A1
- Application number: 15/087,116
- Filed: 2016-03-31
- Published: 2017-10-05
- Earliest claimed: 2016-03-31
- Assignees: CA, Inc.
- Applicants: CA, Inc.
- Inventors: Josiah Daniel Haswell; James Andrew Perkins
- Web page: https://patentgrep.com/patent/US20170286077A1

## CPC

- G06F 8/436: {Semantic checking}
- G06F 8/71: Version control (security arrangements therefor G06F21/57); Configuration management
- G06F 8/40: Transformation of program code
- G06F 8/41: Compilation
- G06F 8/42: {Syntactic analysis}
- G06F 8/433: {Dependency analysis; Data or control flow analysis}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An interface definition language compiler can be designed to generate different versions of stubs or library files from a same IDL source code. A developer can maintain a single IDL file with code for various versions by using version directives. As part of front end compiling, the IDL compiler will determine which sections of IDL code are compatible with a specified version and compile those determined sections of IDL code. When performing semantic analysis, the IDL compiler will determine whether changes across versions create semantic issues that can be resolved in the target program language by the backend of the compiler. For those changes that cannot be resolved in the target program language, the IDL compiler can generate error notifications.

## Claims

### Claim 1

A method comprising:
determining a set of code sections from a plurality of code sections to analyze for compiling based, at least in part, on a target version indicated in a compile command and on a plurality of compile directives that indicate interface versions that direct compiling, wherein the set of code sections is associated with a set of the plurality of compile directives that indicates interface versions that correspond to the target version, wherein an interface definition language program code comprises the plurality of code sections and the plurality of compile directives;
determining whether a change between a first of the set of code sections and a second of the set of code sections causes a semantic error, wherein the first code section is associated with a first of a set of version directives that indicates a first range of interface versions and the second code section is associated with a second of the set of version directives that indicates a second range of interface versions; and
providing the set of code sections for generation of an intermediate representation of the set of code sections in response to a determination that no semantic error is caused by a change among the set of code sections corresponding to different version ranges.

### Claim 2 (depends on 1)

The method of claim 1 further comprising associating the semantic error with an expression in the second code section in response to determining that the change causes the semantic error and based, at least in part, on a determination that the second range is later than the first range.

### Claim 3 (depends on 1)

The method of claim 1 further comprising detecting the plurality of compile directives and determining that the set of the plurality of compile directives indicates interface versions that correspond to the target version.

### Claim 4 (depends on 3)

The method of claim 3, wherein determining that the set of compile directives indicates interface versions that correspond to the target version comprises determining that each of the set of compile directives either indicates the target version or indicates a range of interface versions that encompasses the target version.

### Claim 5 (depends on 1)

The method of claim 1, wherein determining the set of code sections from the plurality of code sections comprises determining, for each of the set of compile directives, which of the plurality of code sections is governed by the compile directive.

### Claim 6 (depends on 1)

The method of claim 1, wherein determining whether the change causes a semantic error comprises determining at least one of whether the change comprises adding an expression or parameter in the second code section that does not redefine an expression or parameter in the first code section, whether the change comprises an optional expression or optional parameter in either the first or the second code section, and whether the change relates to type checking.

### Claim 7 (depends on 6)

The method of claim 6, further comprising generating an indication of a semantic error if the change comprises adding an expression or parameter in the second code section that redefines an expression or parameter in the first code section, or if the change comprises a type checking error that cannot be resolved with a target language indicated in the compile command..

### Claim 8 (depends on 6)

The method of claim 6, wherein determining whether the change relates to type checking comprises determining whether the change causes overloading or a type conflict.

### Claim 9 (depends on 8)

The method of claim 8, wherein determining whether the change causes a semantic error comprises determining whether the overloading or the type conflict can be resolved by a compiler backend for a target program language indicated in the compile command.

### Claim 10 (depends on 1)

The method of claim 1 further comprising disregarding those of the plurality of code sections associated with those of the plurality of compile directives that indicate interface versions that do not correspond to the target version.

### Claim 11

One or more non-transitory machine readable media comprising program code for compiling an interface definition language program code, the program code to:
in response to receipt of a compile command that indicates a target version and a target program language, determine which of a plurality of code sections in the interface definition language program code is governed by a compile directive that indicates a range of versions that encompasses the target version;
disregard those of the plurality of code sections governed by a compile directive that indicates a range of versions that does not encompass the target version;
determine whether changes between code sections that have not been disregarded and are governed by compile directives that indicate different ranges of versions cause a semantic error;
provide the code sections that have not been disregarded for generation of an intermediate representation in response to a determination that the changes do not cause semantic errors; and
associate a semantic error caused by a change between code sections with a corresponding expression or parameter in the code section of a later range of versions.

### Claim 12 (depends on 11)

The one or more non-transitory machine readable media of claim 11, wherein the semantic error comprises a type check error that is impermissible for a target program language indicated in the compile command.

### Claim 13

An apparatus comprising:
a processor; and
a machine readable medium comprising program code executable by the processor to cause the apparatus to,
determine a set of code sections from a plurality of code sections to analyze for compiling based, at least in part, on a target version indicated in a compile command and on a plurality of compile directives that indicate interface versions that direct compiling, wherein the set of code sections is associated with a set of the plurality of compile directives that indicates interface versions that correspond to the target version, wherein an interface definition language program code comprises the plurality of code sections and the plurality of compile directives;
determine whether a change between a first of the set of code sections and a second of the set of code sections causes a semantic error, wherein the first code section is associated with a first of a set of version directives that indicates a first range of interface versions and the second code section is associated with a second of the set of version directives that indicates a second range of interface versions; and
provide the set of code sections for generation of an intermediate representation of the set of code sections in response to a determination that no semantic error is caused by a change among the set of code sections corresponding to different version ranges.

### Claim 14 (depends on 13)

The apparatus of claim 13, wherein the machine readable medium further comprises program code executable by the processor to cause the apparatus to associate the semantic error with an expression in the second code section in response to a determination that the change causes the semantic error and based, at least in part, on a determination that the second range is later than the first range.

### Claim 15 (depends on 13)

The apparatus of claim 13 wherein the machine readable medium further comprises program code executable by the processor to cause the apparatus to detecting the plurality of compile directives and determining that the set of the plurality of compile directives indicates interface versions that correspond to the target version.

### Claim 16 (depends on 15)

The apparatus of claim 15, wherein the program code to determine that the set of compile directives indicates interface versions that correspond to the target version comprises program code executable by the processor to cause the apparatus to determine that each of the set of compile directives either indicates the target version or indicates a range of interface versions that encompasses the target version.

### Claim 17 (depends on 13)

The apparatus of claim 13, wherein the program code to determine the set of code sections from the plurality of code sections comprises program code executable by the processor to cause the apparatus to determine, for each of the set of compile directives, which of the plurality of code sections is governed by the compile directive.

### Claim 18 (depends on 13)

The apparatus of claim 13, wherein the program code to determine whether the change causes a semantic error comprises program code executable by the processor to cause the apparatus to determine at least one of whether the change comprises adding an expression or parameter in the second code section that does not redefine an expression or parameter in the first code section, whether the change comprises an optional expression or optional parameter in either the first or the second code section, and whether the change relates to type checking.

### Claim 19 (depends on 18)

The apparatus of claim 18, wherein the machine readable medium further comprises program code executable by the processor unit to cause the apparatus to generate an indication of a semantic error if the change comprises adding an expression or parameter in the second code section that redefines an expression or parameter in the first code section, or if the change comprises a type checking error that cannot be resolved with a target language indicated in the compile command.

### Claim 20 (depends on 18)

The apparatus of claim 18, wherein the program code to determine whether the change relates to type checking comprises program code executable by the processor to cause the apparatus to determine whether the change causes overloading or a type conflict.
