×

Method and apparatus for translating source code from one high-level computer language to another

  • US 5,768,564 A
  • Filed: 10/07/1994
  • Issued: 06/16/1998
  • Est. Priority Date: 10/07/1994
  • Status: Expired due to Fees
First Claim
Patent Images

1. 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.

View all claims
  • 4 Assignments
Timeline View
Assignment View
    ×
    ×