Method and apparatus for generating executable code from object-oriented source code
First Claim
1. A method, using a digital computer, for generating executable computer code for an application program, said application program including at least one reference to one or more header files, each of the header files comprising one or more class definitions, each of said class definitions deeming a class of object instances, and said application program further comprising a plurality of source code instructions, said source code instructions including one or more references to one or more object instances of the class definitions, and said method comprising the steps of:
- compiling the header files, thereby generating compiled header file code comprising one or more accessors, each of the accessors being a procedure operative to access the object instances of an associated one of the class definitions;
compiling the application program, thereby generating compiled application program code corresponding to the plurality of source code instructions, said compiled application program code including one or more procedure calls to one or more of the accessors, each of said procedure calls corresponding to the one or more references in the source code instructions to one or more object instances of the class definitions;
linking the compiled header file code and the compiled application program code;
modifying one or more header files;
recompiling the one or more modified header files thereby generating recompiled header file code;
selectively recompiling only those portions of the application program which are affected by the recompiled header files; and
linking the recompiled header file code and the compiled application code, and the recompiled application program code if any, thereby generating the executable computer code.
0 Assignments
0 Petitions
Accused Products
Abstract
The present invention provides an improved method and apparatus for generating executable computer code for an application program written in C++ source code. In typical prior art systems, application program source code that has not itself been modified must still generally be recompiled in the event that object-oriented class definitions used by the application program and contained in separate header files have been modified. The methods and apparatus of the present invention reduce the need for such recompilation, by using procedural interfaces to implement object-oriented interfaces at the compiled code level. Thus, in accordance with the present invention, compiled header file code is generated that includes accessors for accessing object instances of the class definitions, each of the accessors being a procedure operative to access the object instances of the corresponding class definition. Compiled application program code is generated which replaces object references with procedure calls to appropriate accessors. In this way, the application program and the header file class definitions remain relatively independent of each other with respect to implementation details, even at the compiled code level.
108 Citations
34 Claims
-
1. A method, using a digital computer, for generating executable computer code for an application program, said application program including at least one reference to one or more header files, each of the header files comprising one or more class definitions, each of said class definitions deeming a class of object instances, and said application program further comprising a plurality of source code instructions, said source code instructions including one or more references to one or more object instances of the class definitions, and said method comprising the steps of:
-
compiling the header files, thereby generating compiled header file code comprising one or more accessors, each of the accessors being a procedure operative to access the object instances of an associated one of the class definitions; compiling the application program, thereby generating compiled application program code corresponding to the plurality of source code instructions, said compiled application program code including one or more procedure calls to one or more of the accessors, each of said procedure calls corresponding to the one or more references in the source code instructions to one or more object instances of the class definitions; linking the compiled header file code and the compiled application program code; modifying one or more header files; recompiling the one or more modified header files thereby generating recompiled header file code; selectively recompiling only those portions of the application program which are affected by the recompiled header files; and linking the recompiled header file code and the compiled application code, and the recompiled application program code if any, thereby generating the executable computer code. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. An apparatus for generating executable computer code for an application program, said application program including at least one reference to one or more header files, each of the header files comprising one or more class definitions, each of said class definitions defining a class of object instances, and said application program further comprising a plurality of source code instructions, said source code instructions including one or more references to one or more object instances of the class definitions, said apparatus comprising:
-
a compiler operative to generate compiled header file code and recompiled header file code after a header file has been modified by a user, said compiled and recompiled header file code comprising one or more accessors, each of the accessors being a procedure operative to access the object instances of an associated one of the class definitions, said compiler further operative to generate compiled application program code corresponding to the plurality of source code instructions, said compiled application program code including one or more procedure calls to one or more of the accessors, each of said procedure calls corresponding to the one or more references in the source code instructions to one or more object instances of the class definitions, said compiler further operative to selectively recompile and generate recompiled application program code for only those portion of the application program which are affected by the recompiled header code; and a linker operative to link the recompiled header file code and the compiled application program code, and recompiled application program code if any produced by the compiler, thereby generating the executable computer code. - View Dependent Claims (14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25)
-
-
26. A computer program product comprising a computer-usable medium, and computer-readable program code embodied in said medium for generating executable computer code for an application program, said application program including at least one reference to one or more header files, each of the header files comprising one or more class definitions, each of said class definitions defining a class of object instances, and said application program further comprising a plurality of source code instructions, said source code instructions including one or more references to one or more object instances of the class definitions, said computer-readable program code comprising:
-
computer-readable header file compiler code configured to cause a computer to generate compiled header file code comprising one or more accessors, each of the accessors being a procedure operative to access the object instances of an associated one of the class definitions, said computer-readable header file compiler code further configured to cause a computer to generate recompiled header file code after a header file has been modified by user; computer-readable application compiler code configured to cause a computer to generate compiled application program code corresponding to the plurality of source code instructions, said compiled application program code including one or more procedure calls to one or more of the accessors, each of said procedure calls corresponding to the one or more references in the source code instructions to one or more object instances of the class definitions, said computer-readable application compiler code further configured to cause a computer to recompile and generate recompiled application program code for only those portions of the application program which are affected by the recompiled header files; and computer-readable linker code configured to cause a computer to link the compiled header file code and the compiled application program code, and the recompiled application code if any, thereby generating the executable computer code. - View Dependent Claims (27, 28, 29)
-
-
30. A method for providing a mechanism for generating executable computer code for an application program, said application program including at least one reference to one or more header files, each of the header files comprising one or more class definitions, each of said class definitions defining a class of object instances, and said application program further comprising a plurality of source code instructions, said source code instructions including one or more references to one or more object instances of the class definitions, and said method comprising the steps of:
-
providing a first mechanism for compiling the header files, said first mechanism being operable to generate compiled header file code comprising one or more accessors, each of the accessors being a procedure operative to access the object instances of an associated one of the class definitions, said first mechanism further for recompiling the header files after the header files have been modified by a user, thereby generating recompiled header file code; providing a second mechanism for compiling the application program, said second mechanism being operable to generate compiled application program code corresponding to the plurality of source code instructions, said compiled application program code including one or more procedure calls to one or more of the accessors, each of said procedure calls corresponding to the one or more references in the source code instructions to one or more object instances of the class definitions, said second mechanism further for selectively recompiling only those portions of the application program which are affected by the recompiled header files; and providing a third mechanism for linking the compiled header file code and the compiled application program code, and for linking the recompiled header file code and the compiled application code, and the recompiled application program code if any, said third mechanism being thereby operable to generate the executable computer code.
-
-
31. A method, using a computer, for generating executable computer code for an application program, said application program including at least one reference to one or more header files, each of the header files comprising one or more class definitions, each of said class definitions deeming a class of object instances, and said application program further comprising a plurality of source code instructions, said source code instructions including one or more references to one or more object instances of the class definitions, the method comprising the steps of:
-
compiling the one or more header files which generates compiled header file code; compiling the application program which generates compiled application program code, wherein the application program and the compiled application program code each include a timestamp; linking the compiled header file code and the compiled application program code; recompiling the one or more header file code which generates recompiled header file code; selectively recompiling one or more portions of the application program which are affected by the recompiled header file code, selective recompilation including the steps of, comparing the timestamp of the application program to the timestamp of the compiled application program code timestamp, and recompiling all of the application program if the timestamp of the application program is later than the timestamp of the compiled application program code, and selectively recompiling the one or more portions of the application program which are affected by the recompiled header file code if the timestamp of the application program is not later than the timestamp of the compiled application program code. - View Dependent Claims (32, 33, 34)
-
Specification