UMLSEQ ( 1 ) System Reference Manual UMLSEQ ( 1 )
umlseq - Generate UML sequence diagrams in eps format.
umlseq [ infile ]
umlseq parses a sequence diagram descriptor file, generating an Encapsulated PostScript (.eps) file
with the diagram. If the optional argument infile is not given, the program will parse standard input.
The In (object This (acct Note: In [ * and <- For acct Another acct Obviously, A To ~ |
The descriptor file is a text file. It is divided into three (possibly empty) sections: The object definitions, the actions, and the arbitrary text. Lines beginning with # are ignored. In the first section, all the objects participating in the diagram are defined. An object definition looks like this: (object "label" position [ width ]) This creates an object, which we will later refer to with the name object. The life line of this object will be horizontally centered around position, and the square at the top of the page will contain the text label. The width of this square will be width, or some reasonable default size if no width is specified. Here's an exam- ple: (acct ":BankAccount" 100) Note: All dimensions are measured in PostScript points (1 pt = 1/72 inch). X coordinates grow towards the right edge of the diagram, and y coordinates grow upwards. The origin (0, 0) is the lower left corner of the diagram. In the second section, the action section, the objects start passing messages to each other. A function call looks like this: [ * ] recipient [ "message" ] and must be paired with a return statement: <- [ "value" ] For instance, to ask the acct object in the previous example how much money is left on the bank account, one could put the following in the action section: acct "getBalance()" Another function call might not return a value: acct "withdraw(500)" Obviously, function calls may be nested. Objects are also allowed to pass messages to themselves. A star (*) in front of the object name means that this isn't just a function call, it's the construction of the object. To delete an object, use the following notation: ~ |
object This FNORD |
object [ "message" ] This will end the life line of the object with a large X. If a "message" is specified, the message will be printed next to an arrow, which will be drawn from the current object to the X. December 30, 2001 1 |
UMLSEQ ( 1 ) System Reference Manual Extra spacing can be added anywhere, using the ampersand |
(&). |
UMLSEQ ( 1 ) |
Finally, in the third section of the descriptor file, one can instruct umlseq to place arbitrary text any-
where in the diagram. The following syntax is used:
("text" x y)
The text will appear with it's lower left corner at the specified PostScript coordinates.
The following example covers most of the functionality of umlseq. A good idea is to run this example through , and to then study the input along with the output. A parser runs into a symbol named "foo". It asks the symbol table to return an object with more informa- tion about this symbol. However, the symbol table finds out that this is the first time "foo" is used, so it cre- ates a new symbol by that name, and returns it. Then the symbol table dies of a heart attack. (parser ":Parser" 50) parser ~ |
|
symtab ("umlseq" 0 0) |
DIAGNOSTICS
Error messages should be self-explanatory. The most common error message is "parse error", which means that there were syntax errors in the descriptor file. The program returns 0 on success, 1 if the parser failed, 2 if the specified file couldn't be opened and 3 if there were weird internal errors. |
gv(1)
The output generated by this program aims to be UML compliant.
Written by Linus Akesson <lft@df.lth.se>.
Homepage: http://www.df.lth.se/~lft
It is not possible to omit arbitrary sections from the input file. Currently, only the text section, the text sec-
tion and the action section, or all the three sections can be omitted. Of course, this bug is only a theoretical
flaw.
FNORD December 30, 2001 2
UMLSEQ ( 1 ) System Reference Manual UMLSEQ ( 1 )
Do what thou wilt shall be the whole of the law.
FNORD December 30, 2001 3