Project links: Downloads | CVS | Statistics


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.



Class hierarchy

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


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


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


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


CppFSMDoc.py [sourcefiles ...]


  • 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...]