Method

The programming aid will be designed to work with the C++ language. This language was chosen because it is one of the most frequently used languages in practice, and therefore the usefulness of the programming aid will be maximised. Furthermore, the use of classes and encapsulation in C++ means that, to a certain extent, grouping of functions will already have been defined by the programmer. However, some degree of language independence is desirable, and in the future support for other languages may be added. Design of the programming aid will keep these factors in mind.

The first phase of the project will be to create a parser which will examine source code and extract information about functions and variables. The proposed strategy is to modify an existing parsing system; the GNU C Compiler (``gcc''). The modified program will run through the code and construct a number of tables:

The parser should not need any information apart from the source code itself, although it may store information for future sessions.

The second phase will be to implement the front end to these tables using the X-window environment. The user will be able to call up a window which shows the functions (or some subset of the functions) as icons, linked together by lines, representing calls to those functions, producing a call dependency graph. The user will then be able to group functions into ``packages'': this will allow the user to simplify the graph to any level desired. Member functions of classes will automatically be grouped in this way. It might be possible for the package to suggest groupings automatically, by searching for sets of functions with high interdependency--but it is anticipated that unless the interdependency is particularly strong this method is unlikely to produce useful results. Experimentation will be required.

Double-clicking on a function will call up its source code in a separate window. It may be possible to use an existing editing program for this, so that the function could be edited, but this is not crucial. However, it will be possible to select a variable, function, or macro and call up its declaration, its source code, or its value respectively. For a particular function, the user will also be able to call up a list of all the functions and variables whose scope includes the function.

The user will be able to call up a list of all the functions and variables used by the program, and by selecting one have the dependency graph display which functions use it. The dependency graph could also display the scope of the function or variable.

The programming aid will also offer the option to reorganise the text of a project in a logical way based on the organisation that the user has created. Thus, functions that are grouped together would appear in the same file, blank lines and comment lines would separate groups within a file, etc. The trade-off here would be between making the software configurable enough to meet the user's needs, but simple enough to be used easily.

The software will be developed for an IBM-compatible PC running the Linux operating system and the X-Window system.

A proposed timetable for the project is the following:

Matthew Exon 2004-05-28