Text File Format for Simple UML Diagrams



This document defines the syntactic format of text files that store Simple UML diagrams. The file contains zero or more definitions for the three kind of diagram element: pacakge, class, and operation. The order of the elements within the file is irrelevant, since each element is defined with all the information needed to render it in a display.

The syntactic format for each element parallels the Java API specification of Simple UML diagrams. This API spec is in the ../java_api directory. The comments in the API spec have further explantory details about structure and display of Simple UML diagrams.

Here is the syntax:

page: 1
  package:
    name: <identifier>
    height: <int>
    width: <int>
    x_coord: <int>
    y_corrd: <int>
    components: <element_name> ...
    show_as_contained: <boolean>

  class:
    name: <identifier>
    height: <int>
    width: <int>
    x_coord: <int>
    y_corrd: <int>
    inherits_from: <class_name> ...
    attributes: <name_type_pair> ...
    strong_aggregates: <name_type_pair> ...
    weak_aggregates: <name_type_pair> ...
    operation_attributes: <operation_signature>
    operation_aggregates: <operation_signature>

  operation:
    name: <identifier>
    height: <int>
    width: <int>
    x_coord: <int>
    y_corrd: <int>
    inputs: <name_type_pair> ...
    outputs: <name_type_pair> ...

page: 2

...
page: n

Here are defintions of non-terminals used above: