Patent US5768564A successfully refreshed from Google Patents.
US5768564A
Expired / Lapsed
US
⏱️ 0.0 years remaining
Method and apparatus for translating source code from one high-level computer language to another
Assignee: Hewlett Packard Development Co LP
•
Filing: 1994-10-07
•
Granted: 1998-06-16
•
Expires: 2014-10-07
Abstract
Abstract A method, system, apparatus, and program for translating one computer language to another using doubly-rooted tree data structures. A doubly-rooted tree is the combination of two sets of hierarchically related objects sharing a common set of leaves. An N-rooted tree is also described. When a doubly-rooted tree is constructed in the specified manner and then translated to a second doubly-rooted tree, source language code is transformed into target language code. In addition, the translation preserves preprocessor characteristics of the source language code including macros, conditionally compiled regions of code, source inclusion statements, and comments.
Inventors
- 👤 Kristy A. Andrews
- 👤 Paul Del Vigna
- 👤 Mark E. Molloy
Bibliographic Details
Application Number
—
Jurisdiction
US
Data Source
google_patents
Last Synchronized
2026-10-27 16:19
CPC Classifications
G; G06; G06F; G06F8/00; G06F8/30; G06F8/33; G06F8/40; G06F8/41; G06F8/42; G06F8/423; G06F8/48; G06F8/51; Y; Y10; Y10S; Y10S707/00; Y10S707/99941; Y10S707/99942
Claims Analysis
Total Claims: 5
Claim 1
Independent Claim
243 words
A method for use in a computer system for translating a first source code of a source computer language into a second source code of a target computer language, said method comprising: creating a source doubly-rooted tree data structure, said creating including: retrieving the first source code; producing virtual source from the first source code to create a source fragment tree; scanning the first source code to form a virtual source; identifying the virtual source as leaves of the source doubly-rooted tree; identifying leaves of the source fragment tree with the leaves of the source doubly-rooted tree; parsing the virtual source into a source syntax tree such that the leaves of the source syntax tree are identified with the leaves of the source doubly-rooted tree; and obtaining and storing semantic information completing a description of the source code in the source syntax tree; creating a target doubly-rooted tree data structure including: translating the source syntax tree and creating a target syntax tree; identifying leaves of the target syntax tree with leaves of the target doubly-rooted tree; associating leaves of the target doubly-rooted tree with corresponding leaves of the source doubly-rooted tree; translating the source fragment tree and creating a target fragment tree so that leaves of the target fragment tree are ordered; and identifying leaves of the target fragment tree with leaves of the target doubly-rooted tree; generating the second source code from the target doubly-rooted tree; and storing the second source code.
Claim 2
Independent Claim
243 words
A method for use in a computer system for translating a first source code of a source computer language into a second source code of a target computer language, said method comprising: creating a source doubly-rooted tree data structure, said creating including: retrieving the first source code; producing virtual source from the first source code to create a source fragment tree; scanning the first source code to form a virtual source; identifying the virtual source as leaves of the source doubly-rooted tree; identifying leaves of the source fragment tree with the leaves of the source doubly-rooted tree; parsing the virtual source into a source syntax tree such that the leaves of the source syntax tree are identified with the leaves of the source doubly-rooted tree; and obtaining and storing semantic information completing a description of the source code in the source syntax tree; creating a target doubly-rooted tree data structure including: translating the source syntax tree and creating a target syntax tree; identifying leaves of the target syntax tree with leaves of the target doubly-rooted tree; associating leaves of the target doubly-rooted tree with corresponding leaves of the source doubly-rooted tree; translating the source fragment tree and creating a target fragment tree so that leaves of the target fragment tree are ordered; and identifying leaves of the target fragment tree with leaves of the target doubly-rooted tree; generating the second source code from the target doubly-rooted tree; and storing the second source code.
Claim 3
Dependent Claim
353 words
The method of claim 1 wherein the step of translating the source fragment tree and creating a target fragment tree comprises: locating the root of the source fragment tree; translating the source root to the root of the target fragment tree; and building the target fragment tree based on the position of leaves in the source fragment tree including the steps of: locating a target fragment tree leaf; examining a source fragment tree leaf associated with the target fragment tree leaf; examining a parent node of the source fragment tree leaf; firstly testing whether the most recent translation of the parent node is an ancestor of the most recently attached target fragment tree leaf or is the root of the target fragment tree; attaching the target fragment tree leaf to the parent node of the most recently attached leaf; attaching the target fragment tree leaf to the parent node; and examining a next target fragment tree leaf, if any, if the first test result is TRUE; translating the parent node; adding the parent node to the target fragment tree; attaching the target fragment tree leaf to the parent node; assigning the parent node to a first temporary object; assigning a parent of the parent node to a second temporary object , if the first . test result is FALSE; secondly testing whether the second temporary object is an ancestor of the most recently attached target fragment tree leaf or is the root of the target fragment tree, if the first test result is FALSE; adding the second temporary object to the target fragment tree; attaching the first temporary object to the ancestor node; examining a next target fragment tree leaf, if any, if the first test result is FALSE and the second test result is TRUE; and translating the second temporary object; attaching the second temporary object to the fragment tree; attaching the first temporary object to the second temporary object; assigning the second temporary object to the first temporary object; and continuing from said step of secondly testing, if the first test result is FALSE and the second test result is FALSE.
Claim 4
Independent Claim
217 words
An apparatus for translating a first source code of a source computer language into a second source code of a target computer language while preserving text preprocessor statements and expressions comprising: source computer language file means with memory allocated for storing the first source code; target computer language file means with memory allocated for storing the second source code; means for creating a first and second doubly-rooted tree data structures with memory allocated for information to be stored within the first and second data structures; means for retrieving the first source code from memory; means for scanning and parsing the first source code into a first virtual source; means coupled to the scanning and parsing means for storing the first virtual source code while scanning and parsing in the first doubly-rooted tree data structure so that text preprocessor statements and expressions are preserved; means for translating the first doubly-rooted tree structure into a second virtual source code; means coupled to the translating means for storing the second virtual source code in the second doubly-rooted tree data structure so that text preprocessor statements and expressions are preserved; means for traversing the second data structure coupled to means for creating the second source code; means for storing the second source code coupled to the target computer language file means.
Claim 5
Independent Claim
217 words
An apparatus for translating a first source code of a source computer language into a second source code of a target computer language while preserving text preprocessor statements and expressions comprising: source computer language file means with memory allocated for storing the first source code; target computer language file means with memory allocated for storing the second source code; means for creating a first and second doubly-rooted tree data structures with memory allocated for information to be stored within the first and second data structures; means for retrieving the first source code from memory; means for scanning and parsing the first source code into a first virtual source; means coupled to the scanning and parsing means for storing the first virtual source code while scanning and parsing in the first doubly-rooted tree data structure so that text preprocessor statements and expressions are preserved; means for translating the first doubly-rooted tree structure into a second virtual source code; means coupled to the translating means for storing the second virtual source code in the second doubly-rooted tree data structure so that text preprocessor statements and expressions are preserved; means for traversing the second data structure coupled to means for creating the second source code; means for storing the second source code coupled to the target computer language file means.
References Cited (Backward Citations)
US4599691A
Cited
US4667290A
Cited
US4794528A
Cited
US4956809A
Cited
US4868743A
Cited
US5239663A
Cited
EP0361737A2
Cited
US4989132A
Cited
US5276874A
Cited
US5173853A
Cited
US5151697A
Cited
US5392390A
Cited
US5367683A
Cited
EP0583117A2
Cited
US5384568A
Cited
USPTO Annuity & Maintenance Windows
| Annuity Stage | Window Opens | Payment Deadline | Surcharge Period Until | Estimated Fee | Status |
|---|---|---|---|---|---|
| 3.5 Years (Year 4) | 2001-06-15 | 2001-12-15 | 2002-06-16 | $2000.00 | Window Closed / Lapsed |
| 7.5 Years (Year 8) | 2005-06-15 | 2005-12-15 | 2006-06-16 | $3760.00 | Window Closed / Lapsed |
| 11.5 Years (Year 12) | 2009-06-15 | 2009-12-15 | 2010-06-16 | $7700.00 | Window Closed / Lapsed |