Patent US6006031A successfully refreshed from Google Patents.
US6006031A
Expired / Lapsed
US
⏱️ 0.0 years remaining
Method and apparatus for reconciling conflicting translations by factoring and parameterizing differences
Assignee: Hewlett Packard Development Co LP
•
Filing: 1996-06-14
•
Granted: 1999-12-21
•
Expires: 2016-06-14
Abstract
Abstract A method and apparatus for translating source code written in one computer language to source code written in another language wherein translated static fragments are generated in the face of textual inconsistencies. Exactly one target language definition of each source language static fragment is generated and the differences are encapsulated in new parameters.
Inventors
- 👤 Kristy A. Andrews
- 👤 Paul Del Vigna
- 👤 Mark E. Molloy
Bibliographic Details
Application Number
—
Jurisdiction
US
Data Source
google_patents
Last Synchronized
2026-11-09 23:13
CPC Classifications
G; G06; G06F; G06F8/00; G06F8/40; G06F8/51
Claims Analysis
Total Claims: 20
Claim 1
Independent Claim
138 words
A method for translating a source program in a first-high level language to a target program in a second high-level language, said method comprising: producing target program virtual source from a source program in a first high-level language, said virtual source comprising textually different first and second macro expansions corresponding to said first and second invocation expressions, respectively, of a source macro in said source program; and producing only one target macro in a target program in a second high-level language as the translation of said source macro, said target program comprising first and second invocation expressions of said target macro corresponding to said first and second invocation expressions of said source macro; checking for said textual differences between said first and second macro expansions; and encapsulating said textual differences in a new parameter of said target macro.
Claim 2
Independent Claim
138 words
A method for translating a source program in a first-high level language to a target program in a second high-level language, said method comprising: producing target program virtual source from a source program in a first high-level language, said virtual source comprising textually different first and second macro expansions corresponding to said first and second invocation expressions, respectively, of a source macro in said source program; and producing only one target macro in a target program in a second high-level language as the translation of said source macro, said target program comprising first and second invocation expressions of said target macro corresponding to said first and second invocation expressions of said source macro; checking for said textual differences between said first and second macro expansions; and encapsulating said textual differences in a new parameter of said target macro.
Claim 3
Dependent Claim
24 words
The method of claim 1 wherein said step of checking comprises calculating respective subsequences of differing tokens, said respective subsequences comprising said textual difference.
Claim 4
Dependent Claim
34 words
The method of claim 1 wherein said step of encapsulating comprises informing a user of said textual difference; and informing a user of said textual difference; and requesting a name for said new parameter.
Claim 5
Dependent Claim
35 words
The method of claim 1 wherein said step of encapsulating comprises modifying said source program to include said new parameter in a comment in said source program, leaving unaffected the behavior of said source program.
Claim 6
Independent Claim
59 words
The method of 1, further comprising the step of producing a fragment tree including textually mismatched first and second macro expansion fragments corresponding to said first and second macro expansions, respectively, wherein said step of producing said only one target macro comprises adjusting said first and second macro expansion fragments to include a new parameter encapsulating said textual mismatch.
Claim 7
Independent Claim
59 words
The method of 1, further comprising the step of producing a fragment tree including textually mismatched first and second macro expansion fragments corresponding to said first and second macro expansions, respectively, wherein said step of producing said only one target macro comprises adjusting said first and second macro expansion fragments to include a new parameter encapsulating said textual mismatch.
Claim 8
Independent Claim
17 words
The method of 5 wherein said step of adjusting comprises performing tree surgery on said fragment tree.
Claim 9
Independent Claim
17 words
The method of 5 wherein said step of adjusting comprises performing tree surgery on said fragment tree.
Claim 10
Independent Claim
27 words
The method of 5, further comprising the step of adjusting a macro expansion fragment of said target macro in said fragment tree to include said new parameter.
Claim 11
Independent Claim
27 words
The method of 5, further comprising the step of adjusting a macro expansion fragment of said target macro in said fragment tree to include said new parameter.
Claim 12
Independent Claim
32 words
The method of 5, further comprising the step of adjusting all macro expansion fragments of said target macro in said fragment tree not including said new parameter to include said new parameter.
Claim 13
Independent Claim
32 words
The method of 5, further comprising the step of adjusting all macro expansion fragments of said target macro in said fragment tree not including said new parameter to include said new parameter.
Claim 14
Dependent Claim
43 words
The method of claim 1, further comprising the steps of recognizing a second macro in said source program; recognizing no macro expansion in said virtual source corresponding to said second macro; and omitting a translation for said second macro in said target program.
Claim 15
Dependent Claim
207 words
The method of claim 7 wherein said step of adjusting a macro expansion fragment comprises traversing a first ordered list of elements in a shallow in-order manner, producing a first ordered yield of elements, and traversing a second ordered list in a shallow in-order manner, producing a second ordered yield of elements; comparing said first and second yields; identifying a first element in said first yield and a second element in said second yield, said first and second elements being the respective first element where said first and second yields differ; identifying a first sub-list of adjacent elements of said first yield beginning with said first element and a second sub-list of adjacent elements of said second yield beginning with said second element, such that removal of the first sub-list from the first yield and removal of the second sub-list from the second yield would cause the first and second removal-modified yields elements to be equivalent; removing the first sub-list from the first list, thus creating a former position of the first sub-list; inserting a first new element at the former position of the first sub-list, said first new element representing similarities between said first and second sub-lists and differences between the similarities and the first sub-list.
Claim 16
Dependent Claim
341 words
The method of claim 8 wherein said step of adjusting all macro expansion fragments comprises a. ordering all macro expansion fragments of said target macro, including first- and second-in-order macro expansion fragments; b. selecting said first- and second-in-order macro expansion fragments as the set and next-in-order macro expansion fragments, respectively; c. calculating ordered pairs of token subsequences which differ between said set- and said next-in-order macro expansion fragments; d. continuing from the step of selecting (29.m), if there is no pair of differing token subsequences; e. otherwise, selecting said first-in-order pair of token subsequences as the next-in-order pair of token subsequences; f. firstly determining whether a member of said next-in-order pair of token subsequences represents an invocation expression; g. encapsulating said representing member in a static fragment corresponding to the fragment that said invocation expression invokes, and continuing at the step of selecting (29.l), all if said first determination is TRUE; h. otherwise, secondly determining whether the first member of said next-in-order pair of token subsequences matches tokens in a first subordinate fragment; i. encapsulating each member of said next-in-order pair of token subsequences in respective instances of a new static fragment, and continuing at the step of selecting (29.l), all if said second determination is FALSE; j. otherwise, thirdly determining whether the second member of said next-in-order pair of token subsequences matches tokens in a second subordinate fragment corresponding to said set subordinate fragment; k. encapsulating the first and second members of said next-in-order pair of token subsequences in respective instances of static fragments corresponding to respective subordinate fragments; l. selecting the next-in-order pair of token subsequence, if any, and continuing from said step of firstly determining (29.f); m. otherwise, selecting either of said set and next-in-order macro expansion fragments whose token subsequence was encapsulated in said encapsulation of steps (29.g), (29.i) or (29.k) as the set macro expansion fragment, selecting the next-in-order macro expansion fragment, if any, and continuing from said step of calculating (29.c); n. otherwise, ending said method, if a next-in-order macro expansion fragment is not selectable.
Claim 17
Dependent Claim
85 words
The method of claim 5 wherein said step of adjusting a macro expansion fragment to encapsulate comprises allocating an encapsulation expansion fragment to encapsulate said textual mismatch; creating an invocation expression for said encapsulation expansion fragment; associating said invocation expression with said encapsulation fragment; removing the text of said textual mismatch from said macro expansion fragment; adding said encapsulation fragment to said macro expansion fragment where said text was removed from said macro expansion fragment; and adding said removed text to said encapsulation expansion fragment.
Claim 18
Dependent Claim
76 words
The method of claim 5 wherein said step of adjusting a macro expansion fragment to encapsulate comprises linking an invocation expression for an encapsulation fragment that is an instance of a static fragment to said encapsulation fragment; removing tokens from a location in a first fragment in which said token subsequence resides; adding said invocation expression to said first fragment at said location no longer occupied by said tokens; and placing token in said encapsulation fragment.
Claim 19
Independent Claim
180 words
A system for translating a source program in a first high-level language to a target program in a second high-level language, said system comprising: a central processing unit; a memory unit, coupled to said central processing unit, said memory unit including a computer usable medium for data storage wherein is located a computer readable program code for translating a source program in a first high-level language to a target program in a second high-level language, said computer readable program code including; computer readable program code for producing a target program virtual source from a source program in a first high-level language, said virtual source comprising textually different first and second macro expansions corresponding to first and second invocation expressions, respectively, of a source macro in said source program; and computer readable program code for producing only one target macro in a target program in a second high-level language as the translation of said source macro, said target program comprising first and second invocation expressions of said target macro corresponding to said first and second invocation expressions of said source macro.
Claim 20
Independent Claim
180 words
A system for translating a source program in a first high-level language to a target program in a second high-level language, said system comprising: a central processing unit; a memory unit, coupled to said central processing unit, said memory unit including a computer usable medium for data storage wherein is located a computer readable program code for translating a source program in a first high-level language to a target program in a second high-level language, said computer readable program code including; computer readable program code for producing a target program virtual source from a source program in a first high-level language, said virtual source comprising textually different first and second macro expansions corresponding to first and second invocation expressions, respectively, of a source macro in said source program; and computer readable program code for producing only one target macro in a target program in a second high-level language as the translation of said source macro, said target program comprising first and second invocation expressions of said target macro corresponding to said first and second invocation expressions of said source macro.
References Cited (Backward Citations)
US4568743A
Cited
US4599691A
Cited
US4794528A
Cited
EP0361737A2
Cited
US5276874A
Cited
US5151697A
Cited
US5392390A
Cited
EP0583117A2
Cited
USPTO Annuity & Maintenance Windows
| Annuity Stage | Window Opens | Payment Deadline | Surcharge Period Until | Estimated Fee | Status |
|---|---|---|---|---|---|
| 3.5 Years (Year 4) | 2002-12-20 | 2003-06-21 | 2003-12-21 | $2000.00 | Window Closed / Lapsed |
| 7.5 Years (Year 8) | 2006-12-20 | 2007-06-21 | 2007-12-21 | $3760.00 | Window Closed / Lapsed |
| 11.5 Years (Year 12) | 2010-12-20 | 2011-06-21 | 2011-12-21 | $7700.00 | Window Closed / Lapsed |