Table of Contents
parses a sequence diagram generating an
Encapsulated PostScript (.eps) file with the diagram. If the optional argument
is not given, the program will parse standard input.
The
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:
This creates an object, which we will later refer to with the name The
life line of this object will be horizontally centered around and the
square at the top of the page will contain the text The width of this
square will be or some reasonable default size if no width is specified.
Here's an example: (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 the objects start passing messages to each other. A function call looks
like this: and must be paired with a return statement: For instance,
to ask the object in the previous example how much money is left on the
bank account, one could put the following in the action section:
Another function call might not return a value:
Obviously, function calls may be nested. Objects are also allowed to pass
messages to themselves. 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: This will end the life line of
the object with a large X. If a is specified, the message will be printed
next to an arrow, which will be drawn from the current object to the X.
Extra spacing can be added anywhere, using the Finally, in the third
section of the descriptor file, one can instruct to place arbitrary text
anywhere in the diagram. The following syntax is used: The text will
appear with it's lower left corner at the specified PostScript coordinates.
The following example covers most of the functionality of 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 It asks the symbol
table to return an object with more information about this symbol. However,
the symbol table finds out that this is the first time is used, so it
creates a new symbol by that name, and returns it. Then the symbol table
dies of a heart attack.
Error messages should be self-explanatory. The most common
error message is 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.
The output generated by this program aims to be compliant.
Written by
Homepage:
It is not possible to omit arbitrary sections from the input
file. Currently, only the text section, the text section and the action
section, or all the three sections can be omitted. Of course, this bug is
only a theoretical flaw.
Do what thou wilt shall be the whole of
the law.
Table of Contents