CPPTools::Documentation
Project links: Downloads | CVS | Statistics

Overview

We developers are always trying to find ways to simplify someonelse's tasks. We have coded electronic stylesheets, word processors, payroll systems. But when it comes out to make our own tasks easier, we are reticents, at least.

Andrew Hunt and Thomas Dave, in their fantastic book The Pragmatic Programmer put it in a clear case form: every repetitive task must be automatized. We all agree with that, but how many files we have to edit to rename a class? How many days we spend writing system documentation just to see it obsoletes as we write? How many times did we think: there must be a simple way to accomplish that?

Cpptools is a set of tools for C/C++ development. It tries to simplify many common development tasks. It is intended to support code generation, code analysis, code refactoring and system documentation.

This section partially describes cpptools' features:

  • Cpptools is coded almost exclusively in Python. It is platform independent, running on any platform that supports Python.
  • It uses Graphviz to render vectorial diagrams.

Tools

CppClassHierarchy.py

Class hierarchy

CppClassHierarchy parses source files and generates class hierarchy diagrams, showing inheritance relationships and some cases of template instantiations.

Syntax

CppClassHierarchy.py [-f format] [-o output] [sourcefiles ...]
-f
Specifies output format. There are two valid formats: xml and dot). Default = dot.
-o
Sets output filename. If -o is omitted, information will be sent to standard output.

Examples

  • CppClassHierarchy.py -f dot -o x.dot *.hpp
  • CppClassHierarchy.py -f xml -o ch.xml *.h dir/*.hpp

CppFSMDoc.py

Finite State Machine

CppFSMDoc scans sourcefiles looking for @FSM tags inside comments and generates a finite state machine (FSM) diagram for each ocurrence of a block beginning with:

//@FSM begin mydiagram
containing zero or more transitions, like:
//@FSM 0,1 x=y
//@FSM 1,2 y=2
//@FSM 1,3 a=b
//@FSM 2,4 c=3
//@FSM 2,5 c=4
//@FSM 3,5 c=5
and finishing with:
//@FSM end

Syntax

CppFSMDoc.py [sourcefiles ...]

Examples

  • CppFSMDoc.py prog1.c prog2.cpp
  • CppFSMDoc.py prog.h prog.c
Latest News
17/09/2003 - cpptools 0.1.5 released [Read more...]
26/08/2003 - cpptools 0.1.4 released [Read more...]
02/08/2003 - cpptools 0.1.3 released [Read more...]