Previous Next
Enabling full preprocessing

You should enable full preprocessing if your code heavily uses non-syntactic macros and you don't want to configure the Parser.
To enable full preprocessing:

  1. In any open SNiFF+ tool, choose Tools > Project Editor to open the Project Editor.
    In the Project Tree, checkmark the projects for which you want to enable full preprocessing.
  2. Check out the PDFs of the checkmarked projects.
  3. Choose Project > Attributes of Checkmarked Projects....
  4. Select the Parser node.
In the Group Project Attributes dialog
  • Select the Parser node.

  • Click for full size, then use Back button

In the Parser View
  1. Select the Preprocess Source Code before Parsing check box.
  2. Select the check box to the right of the above, this will make the attribute applicable to all Projects in the list on the right.
  3. Press the Set for All button.
  4. Select the Directives node.

    Click for full size, then use Back button

In the Directives view
  1. Specify preprocessor directives.

        Note
        The syntax used by cpp applies to this field ( -Dmacro-spec or -Umacro-spec directives separated by blanks).

    Specifying the "-L" option for selective preprocessing
    If you have an include file that defines problematic macros, you can just process this file using the "-L" option.

Specifying multiple "-L" options
  1. Enter -L"foo.h" -L<include/bar.h> in the Preprocessor Directive(s) field.
    This includes and expands the macros defined in the two files
    foo.h and include/ bar.h in all files of the project as if the files were included with the normal #include statement. No other include files are processed, even if the source files contain #include statements.
  2. To apply the settings in the Preprocessor Directive(s) field to all checkmarked projects, select the check box to its right.
  3. Press the Set For All button.
    The attributes now apply to all the projects checkmarked in the Project Tree.
  4. Press the OK button to close the Group Project Attributes dialog.
In the Project Editor
  1. Save all modified projects.
  2. In order for full processing to take effect, you must also reparse the projects that you just modified. In the Project Tree, make sure the projects for which you've enabled full preprocessing are still checkmarked.
  3. Choose Project > Force Reparse.
Include path used by preprocessor
SNiff+ supplies the same include directives used by your compiler to your preprocessor.
Speeding up preprocessing by caching
When preprocessing is enabled, parsing takes longer since all include files are parsed and macros are expanded. To speed up this process, SNiFF+ has an intelligent include file caching mechanism that only loads and parses an include file once.
Advantages of the caching mechanism