Patent ID: 8677314

Claim:
A method for modifying a source code file to reduce dependencies included therein, the method comprising: parsing the source code file to identify plural symbols within the source code file, wherein each symbol of the identified plural symbols corresponds to at least one of a variable, function, type or macro within the source code file; for each of the identified plural symbols: identifying one or more header files based on the identified symbol, such that each of the one or more header files is capable of resolving the symbol for the source code file; selecting a single header file or no header file from the one or more header files for inclusion in the source code file, based on a predetermined set of rules which direct header file selection; modifying, in a case where a single header file is selected, the source code file to include the selected header file; and adding, in a case where no header file is selected, the symbol to a set of symbols; selecting one or more additional header files which resolve the set of symbols from a group of header files, H ij , wherein H ij corresponds to a data structure with i by j header files, and wherein i and j are greater than 1, the selecting the one or more additional header files comprising: identifying a header file which is listed the most times in H ij wherein the header file listed the most time in H ij resolves the most symbols within the set of symbols; determining, in a case where more than one header file is listed the most times in H ij , which of the header files from among those listed the most times in H ij is listed the most times in H i1 ; and selecting the one or more additional header files based on the identification or the determination; including the one or more additional header files in the source code file; and modifying the source code to remove header files other than those header files selected for inclusion in the source code file.