Method of implementing parameterized types to be compatible with existing unparameterized libraries
First Claim
1. A method for generating code using parameterized classes, such that the code is compatible with existing compiled code that was generated using unparameterized classes, the method comprising the steps of:
- receiving parameterized source code that contains variables that belong to a plurality of classes which are defined by supplying parameter values to a parameterized class definition for one of said unparameterized classes defined in said existing compiled code;
performing static type checking on said parameterized source code to determine if incompatible type assignments exist between variables that belong to said plurality of classes and values assigned to said variables;
if no incompatible type assignments exist, thenperforming a homogeneous translation on the parameterized source code to generate unparameterized class code; and
compiling the unparameterized class code to produce code that is compatible with the existing compiled code.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus for generating code using parameterized classes which is compatible with an existing class library that was previously generated using unparameterized classes is disclosed. According to the method, parameterized source code is received that contains variables that belong to a plurality of types which are defined by supplying parameter values to a parameterized class definition. Static type checking is performed on the parameterized source code to determine if any incompatible type assignments exist between variables that belong to the plurality of types and values assigned to the variables. If no incompatible type assignments exist, then a homogeneous translation is performed on the parameterized source code to generate unparameterized class code. The unparameterized class code is then compiled to produce code that is compatible with the existing class library that was generated using unparameterized classes.
79 Citations
18 Claims
-
1. A method for generating code using parameterized classes, such that the code is compatible with existing compiled code that was generated using unparameterized classes, the method comprising the steps of:
-
receiving parameterized source code that contains variables that belong to a plurality of classes which are defined by supplying parameter values to a parameterized class definition for one of said unparameterized classes defined in said existing compiled code; performing static type checking on said parameterized source code to determine if incompatible type assignments exist between variables that belong to said plurality of classes and values assigned to said variables; if no incompatible type assignments exist, then performing a homogeneous translation on the parameterized source code to generate unparameterized class code; and compiling the unparameterized class code to produce code that is compatible with the existing compiled code. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A computer-readable medium carrying one or more sequences of instructions for generating code using parameterized classes, such that the code is compatible with existing compiled code that was generated using unparameterized classes, wherein execution of the one or more sequences of instructions by one or more processors causes the one or more processors to perform the steps of:
-
receiving parameterized source code that contains variables that belong to a plurality of classes which are defined by supplying parameter values to a parameterized class definition for one of said unparameterized classes defined in said existing compiled code; performing static type checking on said parameterized source code to determine if incompatible type assignments exist between variables that belong to said plurality of classes and values assigned to said variables; if no incompatible type assignments exist, then performing a homogeneous translation on the parameterized source code to generate unparameterized class code; and compiling the unparameterized class code to produce code that is compatible with the existing compiled code. - View Dependent Claims (8, 9, 10, 11, 12)
-
-
13. A system for generating code using parameterized classes, such that the code is compatible with existing compiled code that was generated using unparameterized classes, the system comprising:
-
a memory; one or more processors coupled to the memory; and a set of computer instructions contained in the memory, the set of computer instructions including computer instructions which when executed by the one or more processors, cause the one or more processors to perform the steps of; receiving parameterized source code that contains variables that belong to a plurality of classes which are defined by supplying parameter values to a parameterized class definition for one of said unparameterized classes defined in said existing compiled code; performing static type checking on said parameterized source code to determine if incompatible type assignments exist between variables that belong to said plurality of classes and values assigned to said variables; if no incompatible type assignments exist, then performing a homogeneous translation on the parameterized source code to generate unparameterized class code; and compiling the unparameterized class code to produce code that is compatible with the existing compiled code. - View Dependent Claims (14, 15, 16, 17, 18)
-
Specification