Grammar of Collaboration Diagrams

Below, we give the grammar for collaboration diagrams.

CollD = ["frequency=" integer] startMessage {object}.

startMessage = [message] object.

object =

["new" | "destroyed" |

"transient"] ["*"]

[objectName]

":" className

{link}.

link =

linkedObject [role] [linkType] {message}.


role =

["new" | "destroyed" |

"transient"] roleName.

linkType =

"association" | "global" |

"local" | "parameter" | "self".

message =

controlFlowType

[predecessor]

[sequenceExpression]

[returnValue ":="]

messageName ["("

[ argument {"," argument} ] ")"]

[ constraint ].

controlFlowType =

"procedure_call" | "flat_flow" |

"asynchronous_flow".

predecessor =

sequenceNumber

{"," sequenceNumber } "/".

sequenceExpression =

sequenceNumber [recurrence] ":".

sequenceNumber =

"#" integer_literal {("." integer_literal) | character_literal }.

recurrence =

"*" iteration_clause | condition_clause.

constraint =

"*" "[" iteration_clause "]" | "[" condition_clause "]".

"{" ( ( "inputData(" className "." ( operationName | attributeName )

")" )

| ( "outputData(" ( ( className "." attributeName ) |

<String_Litteral> ) ")" ) "}".

argument =

identifier | string_litteral | integer_litteral |

character_litteral | "true" | "false".

iteration_clause =

( identifier "=" integer_literal ".." integer_literal ) | condition_clause

condition_clause =

ifExpression | ( "(" ifExpression ("or" ifExpression )+ ")")

| orExpression.

ifExpression =

"(IF" orExpression "THEN" orExpression "ENDIF)".

orExpression =

andExpression | ( "(" andExpression ("or" andExpression )+ ")").

andExpression =

basicExpression | ( "(" basicExpression ("and" basicExpression ")")+ ).

basicExpression =

"(" identifier ( ( ( "=" | "<" | ">" "<=" | ">=" ) ( string_literal |

character_literal | interger_literal | floating_point_literal ) )

| ("=" ( "true" | "false" ) ).

 

ObjectName, className, packageName, className, attributeName, roleName,

returnValue, messageName , linkedObject, roleName = identifier

A CollD specifies one scenario and thus contains in the top of its description an information about the frequency of the use of the scenario. The vocabulary provided by CollDs for specifying an operation consists of three basic elements: objects, links, and messages. Objects are connected to each other by links. Messages can be attached to links to show communication between objects.

An object may show the following details:

A link may show the following details:

A link is a unidirectional connection between two objects. Several messages can be attached to a link, all of which are sent to the linked object. If the modeling problem requires a bidirectional connection between two objects, two links - one in each direction - have to be established.

A full-fledged message may show the following details: