Data processing: software development – installation – and managem – Software program development tool – Translation of code
Reexamination Certificate
1999-04-16
2002-06-11
Dam, Tuan Q. (Department: 2122)
Data processing: software development, installation, and managem
Software program development tool
Translation of code
C717S102000
Reexamination Certificate
active
06405368
ABSTRACT:
BACKGROUND OF THE INVENTION
1. Field of the Invention
The present invention relates to the field of programming languages and more specifically to compilation of programs having templates.
2. Description of the Related Art
The ANSI/ISO working group X3J16/WG21 has standardized a new programming language, C++, based upon C. One of the many features included in the language is “templates”. A template allows the definition of a set of classes, functions, or variables, paramaterized by a set of template parameters. A program which references a template name must specify the values of the template parameters for the reference (either explicitly or implicitly). When a compiler encounters such a reference, the definition of the referenced template instance is generated from the template definition through a process known as instantiation.
One feature of most programming languages is the notion of separate compilation. This is illustrated by FIG.
1
A. As shown in
FIG. 1A
, a plurality of separate source files
101
,
102
and
103
are utilized as inputs to a compilation process. The source files include both source code and definitions of templates. Thus, separate compilation allows different parts of a complete program to be defined in multiple source files. Each source file
101
-
103
can be separately compiled into an object file
121
-
123
using a compilation step
111
-
113
. Each source file thus compiled is referred to as a translation unit. A linker process
134
combines multiple object files into a single executable program
144
.
FIG. 1B
illustrates an alternative prior art process for forming an executable program. The source/definition
101
remains unchanged. However, the source for
102
and
103
includes a template instantiation in place of the definition. The source
101
is compiled first and provides as outputs an object file (as in
FIG. 1A
) and a template database
154
. The template database, together with the source files
152
and
153
are used as inputs to the compilation process
112
and
113
, respectively. In this way, the definition does not have to be repeated in each of source files
152
and
153
.
Thus, while the process of
FIG. 1B
offers the advantage over
FIG. 1A
of avoiding repeating the template definitions, it requires that a separate template database
154
be provided. In addition, in both the process of FIG.
1
A and
FIG. 1B
, a change in the template definition requires recompiling all of the source files.
The draft ANSI standard provides for the separate compilation of templates in C++. The definition of an instantiated template is only required to exist in one translation unit of the program. However, due to difficulties of implementing this strategy, there were proposals to the standard committee to relax this restriction.
SUMMARY OF THE INVENTION
This invention provides a simple method of implementing the separate compilation of templates by creating an executable program from source programs having templates comprising the steps of: providing a first source file having a template definition; providing a second source file having a template instantiation; compiling the first source file and the second source file into first and second object files, the first object file comprising a template definition; and linking the first and second object files into an executable program.
REFERENCES:
patent: 5715460 (1998-02-01), Acker et al.
patent: 5864700 (1999-01-01), Barton et al.
patent: 5911076 (1999-06-01), Acker et al.
patent: 5956725 (1999-09-01), Burroughs et al.
patent: 5978585 (1999-11-01), Crelier
patent: 6141792 (2000-10-01), Acker et al.
patent: 6317871 (2001-11-01), Andrews et al.
IBM Techical Disclosure Bulletin, “Directives for Controlling Automatic Document Generator for System Object Model Interface Definition Language,” vol. 38, Issue 9, Sep. 1995, pp. 115-116.*
Bjarne Stroustrup, “Separate Compilation Must Stay!,” X3J16/96-0067, WG21/N0885, Mar. 12, 1996, pp. 1-2.*
IBM Technical Disclosure Bulletin, “Build Create C++ Template Instantiations,”, vol. 39, Issue 3, Mar. 1, 1996, pp. 333-338.*
Jaakko Jarvi, “Compiler Time Recursive Objects in C++,” IEEE Tools 27 Proceedings of Technology of Object-Oriented Langauges, 1998, pp. 66-77.
Blakely , Sokoloff, Taylor & Zafman LLP
Dam Tuan Q.
LandOfFree
Method for separate compilation of templates does not yet have a rating. At this time, there are no reviews or comments for this patent.
If you have personal experience with Method for separate compilation of templates, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Method for separate compilation of templates will most certainly appreciate the feedback.
Profile ID: LFUS-PAI-O-2962768