add todot method

generates dot file (graphviz) for graphic representation of state
machine.