Method for compile-time type-checking of arguments for externally-specified format strings
First Claim
Patent Images
1. A method for error-checking format arguments comprising:
- a) providing a program source file for compilation;
b) providing an error message text file having data for output by said program source file;
c) converting said error message text file into a generated source file suitable for inclusion into said program source file;
d) including said generated source file into said program source file; and
e) compiling said program source file together with said generated source file.
1 Assignment
0 Petitions
Accused Products
Abstract
A method for type-checking format arguments during compile time which uses data in an external file. Data from the external file is converted into a generated source file suitable for “inclusion” in a program source file, which is the subject of compilation. The generated source file is compiled together with the program source file and performs, among other things, type-checking of format arguments contained within the program source file and the generated source file.
-
Citations
19 Claims
-
1. A method for error-checking format arguments comprising:
-
a) providing a program source file for compilation;
b) providing an error message text file having data for output by said program source file;
c) converting said error message text file into a generated source file suitable for inclusion into said program source file;
d) including said generated source file into said program source file; and
e) compiling said program source file together with said generated source file. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
a) reading said error message text file;
b) identifying global sections within said error message text file;
c) identifying message subsections within each said global section;
d) iterating through each said global section and each said message subsection;
e) determining format string for each said message subsection; and
f) creating a generated source file having a function definition for each message subsection in said error message text file.
-
-
5. The method of claim 4, further comprising determining at least one format specifier for each said format string before creating said generated source file.
-
6. The method of claim 5, wherein said function definition requires arguments for each said format specifier.
-
7. The method of claim 4, further comprising determining a plurality of format specifiers for each said format string before creating said generated source file.
-
8. The method of claim 7, wherein said function definition requires arguments for each said format specifier.
-
9. The method of claim 1, wherein said steps are provided in a perl script.
-
10. The method of claim 1, wherein said converting said data file into a generated source file comprises:
-
a) reading said error message text file;
b) determining format string of an error message from said error message text file;
c) determining at least one format specifier for said format string; and
d) creating a generated source file having a function definition for said error message in said error message text file, said function definition requiring arguments for each said format specifier.
-
-
11. A method for converting an error message text file into a generated source file suitable for inclusion into and compilation with a program source file comprising:
-
a) reading said error message text file;
b) determining format string of an error message from said error message text file;
c) determining at least one format specifier for each said format string before creating said generated source file; and
d) creating a generated source file having a function definition for said error message in said error message text file, said function definition requiring arguments for each said format specifier.
-
-
12. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform a method for converting an error message text file into a generated source file suitable for inclusion into and compilation with a program source file, the method including:
-
a) reading said error message text file;
b) determining format string of an error message from said error message text file;
c) determining at least one format specifier for each said format string before creating said generated source file; and
d) creating a generated source file having a function definition for said error message in said error message text file, said function definition requiring arguments for each said format specifier.
-
-
13. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform a method for error-checking format arguments, the method including:
-
a) providing a program source file for compilation;
b) providing an error message text file having data for output by said program source file;
c) converting said error message text file into a generated source file suitable for inclusion into said program source file;
d) including said generated source file into said program source file; and
e) compiling said program source file together with said generated source file. - View Dependent Claims (14, 15, 16, 17, 18, 19)
a) reading said error message text file;
b) identifying global sections within said error message text file;
c) identifying message subsections within each said global section;
d) iterating through each said global section and each said message subsection;
e) determining format string for each said message subsection; and
f) creating a generated source file having a function definition for each message subsection in said error message text file.
-
-
15. The program storage device of claim 14, said method further comprising determining at least one format specifier for each said format string before creating said generated source file.
-
16. The program storage device of claim 15, wherein said function definition requires arguments for each said format specifier.
-
17. The program storage device of claim 14, further comprising determining a plurality of format specifiers for each said format string before creating said generated source file.
-
18. The program storage device of claim 17, wherein said function definition requires arguments for each said format specifier.
-
19. The program storage device of claim 13, wherein said steps are provided in a perl script.
20.The program storage device of claim 13, wherein said converting said data file into a generated source file comprises: -
a) reading said error message text file;
b) determining format string of an error message from said error message text file;
c) determining at least one format specifier for said format string; and
d) creating a generated source file having a function definition for said error message in said error message text file, said function definition requiring arguments for each said format specifier.
-
Specification