NAME
SYNOPSIS
DESCRIPTION
DESCRIPTOR FILE FORMAT
EXAMPLES
SEE ALSO
STANDARDS
AUTHORS
BUGS
LICENSE

UMLSEQ ( 1 ) System Reference Manual UMLSEQ ( 1 )

NAME

umlseq - Generate UML sequence diagrams in eps format.

SYNOPSIS

umlseq [ infile ]

DESCRIPTION

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.

DESCRIPTOR FILE FORMAT

The
the

In
this:

(object

This
horizontally
width
ple:

(acct

Note:
right
diagram.

In
call

[ *

and

<-

For
one

acct
<-

Another

acct
<-

Obviously,

A
the

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()"
<- "1000"

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
printed

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.

EXAMPLES

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)
(symtab ":SymbolTable" 200)
(foo "foo:Symbol" 400)

parser
symtab
"getSymbol(\"foo\")"
symtab "find(\"foo\")"
<- "null"
&
*foo "create Symbol(\"foo\")"
<- "foo"
&
symtab
"add(foo)"
<-
<-
"foo"
<-

~

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.

SEE ALSO

gv(1)

STANDARDS

The output generated by this program aims to be UML compliant.

AUTHORS

Written by Linus Akesson <lft@df.lth.se>.
Homepage: http://www.df.lth.se/~lft

BUGS

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 )

LICENSE

Do what thou wilt shall be the whole of the law.

FNORD December 30, 2001 3