Parsing Files

The parser is a work in progress. There are many areas of both C and C++ where the parser has difficulty. For the most part, the parser just skips over the problem areas and keeps parsing. However there are still some open defects that may cause incorrect information to be displayed. See readme.txt for a list of some of the known problems.

File Types

The parser looks for files with certain extensions like .cpp or .h when deciding whether to attempt a parse of the file. The list of extensions that the parser considers to be C/C++ files is defined in the file called CPPExtensions.dat located in the plugins/com.ibm.cpp.miners.parser directory. If you find that the parser doesn't seem to be parsing certain files, you should check this file to make sure that your C/C++ file extensions are shown, and add them if not.

Invoking The Parser

There are 4 ways that a parse can be invoked:

  1. By opening a file in the Editor. From within the C/C++ Projects View, if you double-click on a C/C++ file, the file will be opened in the editor, and an "implicit" parse will be initiated.
  2. By saving a file in the Editor. Assuming you already have a C/C++ file open in the Editor, when you make a change and save the file, an "implicit" parse is initiated to keep the parse information up-to-date.
  3. By invoking the "Parse...Begin Parse" action on a file. From the C/C++ Projects View, if you Right-Click on a file, the "Parse" menu option is available:

    This will kick-off a parse of that file, that will step into any other files that may be included.


  4. By invoking the "Parse... Project" action on a directory or the project. The same "Parse" action is available for a Directory or Project. When this action is chosen, the Parser recursively parses every C/C++ file it can find below the selected directory, stepping any included files as well.

Setting The Parse Include Path

The parser needs to know where to look to find include files. By default, only the directory of the file doing the including is searched, so if you want to be able to browse included source in other directories, you will need to set the Parse Include Path.

Select menu item Properties from the pop-up menu for your Project in the C/C++ Projects view.

The Project Properties dialog is opened where you can set the Parse Include Path.

Usability note: After browsing for or typing your include path, you click to add the path to that large list box in the centre of the dialog. If you don't, the path won't be remembered.

Removing Parse Information

In some cases, the parser may step into so many files and create so many objects, that the views become hard to navigate. One solution is to filter the views using the drop-down menus. Another option is to explicitly remove a file's parse information. This will remove all the objects in the Project Objects view and the System Objects view that come from the removed file, as well as remove it from the Parsed Files view.

To remove a file's parse information, find the file in the Parsed Files view, Right-Click on the file, and choose Remove Parse Information from the pop-up menu: (Note: Currently this feature only removes the selected file's parse information. In the future, this feature will be more intelligent and remove the selected file's included files as well.)

Contact Us