Contents
C++ Analyzer V1.0beta

"C++ Analyzer" is a tool to reverse engineer C++ code. The tool has a build in preprocessor and C++ parser and recognizes almost all C++ constructs including templates and exceptions.

The C++ parser is based on the public domain PCCTS C++ grammar.

Copyright 1995 Dirk Vermeersch.

This program is shareware. You are allowed to try this software  for 30 days. If you want to continue using this software after the trial period you have to register the program.

Note that this is a BETA version of the software it lacks a lot of functionality which will be added in later versions. Please send bug reports and requests to dirkv@netcom.com or on compuserve : 71202.2323

Liability

Adding sources to the project

Setting the preprocessor switches

Analyzing the project


LIABILITY

LIMITATION OF LIABILITY: UNDER NO CIRCUMSTANCES AND UNDER NO

LEGAL THEORY, TORT, CONTRACT, OR OTHERWISE, SHALL THE AUTHOR OR

ITS SUPPLIERS BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY

INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY

CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF

GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR

ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES. IN NO EVENT

WILL THE AUTHOR BE LIABLE FOR ANY DAMAGES, EVEN IF THE AUTHOR

SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES, OR

FOR ANY CLAIM BY ANY OTHER PARTY. THIS LIMITATION OF LIABILITY

SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY TO THE

EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. FURTHERMORE,

SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF

INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION AND

EXCLUSION MAY NOT APPLY TO YOU.


Ordering Info

This program is not public domain or freeware! It is being distributed as shareware. You are only allowed to evaluate this program for a trial period of 30 days. If you want to continue using this program after the trial period you need to register your copy. Not registering after the trial period is a copyright violation.

The shareware version has exactly the same as the official 1.07 version except that the printout will contain a message about this being an evaluation version only.

Also by registering you will receive the latest version (bug fixes + new features if available ).

The current version of the C++ Analyzer is not available separate it is part of the Object Domain toolkit. See the Object Domain help file for pricing and order information.


Adding Sources To The Project

From the edit menu select "Add..." , this will pop up a file selection dialog from which you can select a file to add to the project. The newly added file will have a default category assigned to it. A category is a set of classes, currently the C++ analyzer assumes that all classes defined within a file all belong to the same category.

If you want to change the category of a file select the file from the project window and execute the "Assign Category" command from the edit menu. This will popup a dialog in which you can enter the new category name.

Multiple files can have the same category, this means that all the classes in those file will be assigned to the same category.


Preprocessor
Preprocessor Switches:

In order for the parser and preprocessor to work correctly you will need to specify some settings for the preprocessor. These switches include : a search path for the include files. Predefined macros. and a preinclude file.

Include path:

You can specify multiple directories to be searched for include files. If you specify multiple include directories you can separate the with a new line or a space or semicolon.

The preprocessor will search the include files in the specified order!

Defines:

Here you can specify some predefined macros. The syntax of a define statement is as follows :

name=value

or

name=

or simply

name

You can separate diffrent define statements by newline(s),space(s) or semicolon(s).

Source has type modifiers

Check this box when the source code contains MS-DOS/MS-Windows specific type modifiers ( such as far,near,huge,__cdecl,_pascal,....) . This will automatically define thes modifiers so they don't cause parse errors.

Pre Include

Here you can specify a source file which needs to be read before the first line of every source file is read. When this file is specified it will be as if you have :

#include <pre_include_file>

as the first line of every specified source file. This is useful for several reasons :

1. If your compiler has some non standard build in types you can declare them in the pre include file.

2. If the parser gives errors because of some invalid syntax which your compiler allows: for example : some of the borland template include file reference other templates which are not declared when referenced (they are declared later in the file). This is invalid syntax but the Borland Compiler does not see this because it will only compile the template contents when the template is instantiated.

3. If your compiler accepts some special type modifiers which the parser does not recognize.


PCCTS C++ grammar
PCCTS

The underlying parser of this C++ analyzer is based on the C++ grammar put in the public domain by the authors of PCCTS :

From the header of the grammar :

/*

 * PUBLIC DOMAIN PCCTS-BASED C++ GRAMMAR (cplusplus.g, stat.g, expr.g)

 *

 * Authors: Sumana Srinivasan, NeXT Inc.;            sumana_srinivasan@next.com

 *          Terence Parr, Parr Research Corporation; parrt@parr-research.com

 *          Russell Quong, Purdue University;        quong@ecn.purdue.edu

 *

 * SOFTWARE RIGHTS

 *

 * This file is a part of the ANTLR-based C++ grammar and is free

 * software.  We do not reserve any LEGAL rights to its use or

 * distribution, but you may NOT claim ownership or authorship of this

 * grammar or support code.  An individual or company may otherwise do

 * whatever they wish with the grammar distributed herewith including the

 * incorporation of the grammar or the output generated by ANTLR into

 * commercial software.  You may redistribute in source or binary form

 * without payment of royalties to us as long as this header remains

 * in all source distributions.

 *

 * We encourage users to develop parsers/tools using this grammar.

 * In return, we ask that credit is given to us for developing this

 * grammar.  By "credit", we mean that if you incorporate our grammar or

 * the generated code into one of your programs (commercial product,

 * research project, or otherwise) that you acknowledge this fact in the

 * documentation, research report, etc....  In addition, you should say nice

 * things about us at every opportunity.

 *

 * As long as these guidelines are kept, we expect to continue enhancing

 * this grammar.  Feel free to send us enhancements, fixes, bug reports,

 * suggestions, or general words of encouragement at parrt@parr-research.com.

 *

 * NeXT Computer Inc.

 * 900 Chesapeake Dr.

 * Redwood City, CA 94555

 * 12/02/1994

 *

 * Restructured for public consumption by Terence Parr late February, 1995.

 *

 * Requires PCCTS 1.32b4 or higher to get past ANTLR.

 *

 * DISCLAIMER: we make no guarantees that this grammar works, makes sense,

 *             or can be used to do anything useful.

 */


Analyzing The Project

After you have specified all the files which make up your project. And your preprocessor switches are set you can analyze the project by selecting the analyze command from the edit menu.

A status dialog will show you the progress of the analysis.

If there were errors during the analysis of the project you can view those error by selecting the View Errors command from the view menu.

The analysis part of the program will also perform the layout of the generated diagrams. To view the diagrams you will have to save you project and import the saved file into "Object Domain". See the Object Domain help file on how to import the analyzed data.