Sequence Diagrams

One specifies a sequence diagram using pic macros to define objects and method invocations. The GNU plotutils pic2plot program can then process the sequence diagram to create a PNG, PNM, (pseudo)GIF, SVG, AI, Postscript, CGM, FIG, PCL, HPGL, Regis, or TEK drawing.

The following is an example of a specification and the resulting UML sequence diagram:

.PS
copy "sequence.pic";

# Define the objects
object(O,"o:Toolkit");
placeholder_object(P);
step();

# Message sequences
active(O);
step();
active(O);
message(O,O,"callbackLoop()");
inactive(O);
create_message(O,P,"p:Peer");
message(O,P,"handleExpose()");
active(P);
return_message(P,O,"");
inactive(P);
destroy_message(O,P);
inactive(O);

# Complete the lifelines
step();
complete(O);
.PE
Simple UML sequence diagram
The diagram is drawn from its source code specification using a command like:
pic2plot -Tgif FILENAME.pic >FILENAME.gif