Hello there, funny enough you had me pull out my GoF book just to be sure, and guess to what you are referring to, because you didn't really ask the question clearly... but I'll attempt to answer.
There are 2 different diagrams which you could be wanting:
A State Diagram = Tracks a programs persistent state as the program executes, in a stepwise manner
A Control flow graph = A hierarchical logical way to mind map how the program should function
For the GoF book, they mainly use control flow graphs, having the function encapsulate other functions to hand control into other defined objects.
For tools on how to create them, there are 2 I've been having fun with lately, Visio 2010 which is in a free Beta right now, and Visual Studio 2010 also has UML modeling capabilities. You can currently create UML diagrams from existing code now, but you
can't yet create skeleton templates of code from the UML diagrams you create(yet).
So those two programs would be my suggestions.