Enhanced source code translator from procedural programming language (PPL) to an object oriented programming language (OOPL)
First Claim
1. A method to translate procedural source code to Object Oriented (OO) source code comprising the steps of:
- a) defining patterns of said procedural source code according to a semantic grammar of said procedural language;
b) performing a lexical and a syntactical reading of said procedural source code and determining sequences of instructions in said procedural source code corresponding to said identified patterns;
c) identifying new objects, attributes, access methods to objects or access methods to attributes identified in said sequences and storing them in an Object Dictionary; and
d) for each said sequence of source code, if not yet existing, creating a new type of OO class, and new OO source code classes using said Object Dictionary.
1 Assignment
0 Petitions
Accused Products
Abstract
A method for translating source code programs written in a procedural computer language in source code programs written in an Object Oriented language. The method of the invention provides a parser which adds to the lexicographic and syntactical analysis of the source code a semantic analysis: a parser is written for identifying the semantic patterns in the source code. At execution, the parser reads the instructions of the procedural language and classify the sequences of instructions identified as using a known pattern. According to the matched patterns, the parser creates different categories of classes containing both functional (linearly translated code) or references to other object instances. Each time an object is discovered in the code it is stored in an Object Dictionary with its description and reused when referred later in the code. The parser is executed for each program and at each execution new classes and new objects are created; when all the programs are translated the OO classes and objects form the target object model.
-
Citations
7 Claims
-
1. A method to translate procedural source code to Object Oriented (OO) source code comprising the steps of:
-
a) defining patterns of said procedural source code according to a semantic grammar of said procedural language;
b) performing a lexical and a syntactical reading of said procedural source code and determining sequences of instructions in said procedural source code corresponding to said identified patterns;
c) identifying new objects, attributes, access methods to objects or access methods to attributes identified in said sequences and storing them in an Object Dictionary; and
d) for each said sequence of source code, if not yet existing, creating a new type of OO class, and new OO source code classes using said Object Dictionary. - View Dependent Claims (2, 3, 4, 5)
repeating steps b to d for all source code programs of one application.
-
-
3. The method of claim 1 wherein said procedural source code language is Nat Systems-Development Kit (NS-DK) language and said OO language is Java.
-
4. The method of claim 1 wherein at least one pattern identified in step b is an external function and that the corresponding OO source code classes created in step d are a stub class, a skeleton class, an interface class, and an implementation class according to the Remote Method Invocation distributed architecture.
-
5. The method of claim 1 wherein said Object Dictionary comprises two hash tables accessed by object name, a first hash table of said two hash tables storing variable object definitions and a second hash table of said two hash tables storing method object definitions.
-
6. A program product for translating procedural source code to Object Oriented (OO) source code, said program product comprising:
-
a translator, said translator configured to perform the following steps, a) defining patterns of said procedural source code according to a semantic grammar of said procedural language;
b) performing a lexical and a syntactical reading of said procedural source code and determining sequences of instructions in said procedural source code corresponding to said identified patterns;
c) identifying new objects, attributes, access methods to objects or access methods to attributes identified in said sequences and storing them in an Object Dictionary;
d) for each said sequence of source code, if not yet existing, creating a new type of OO class, and new OO source code classes using said Object Dictionary; and
a storage medium, said translator being stored on said storage medium. - View Dependent Claims (7)
repeating steps b to d for all source code programs of one application.
-
Specification