MSC-News: Proposed changes to MSC'96 grammar to make it parsable.


Subject: MSC-News: Proposed changes to MSC'96 grammar to make it parsable.
From: Jan Docekal (jan.docekal#telelogic.se)
Date: Thu May 14 1998 - 12:17:37 GMT


The originator of this message is responsible for its content.
-----From Jan Docekal <jan.docekal#telelogic.se> to mscnews -----

Dear MSC friends,

I hope that you will remain friends after you have read this letter.

In the ITU meeting in may it was agreed that the MSC'96 grammar should
be parsable by a LALR(1) parser and that the should be aligned with the
recommended ANNEX B (formal semantics). I got the task to perform the
changes. I have found two issues that I would like to have feedback on
before i submit a proposition to a solution to the ITU. The first
problem is an issue for *all* MSC users since it affects which text is
allowed in refernce symbols.

Problem 1: Substitutions
====================

In the MSC'96 grammar approved in 96 the grammar looked like this:

<parameter substitution> ::=
                subst <substitution list>

<substitution list> ::=
                <substitution> [ , <substitution list> ]

<substitution> ::=
                <replace message> | <replace instance> | <replace msc>

<replace message> ::=
                [msg] <message name> by <message name>

<replace instance> ::=
                [inst] <instance name> by <instance name>

<replace msc> ::=
                [msc] {empty | <msc name> } by {empty | <msc name> }

This grammar caused no problems. At later ITU meeting it was rightly
decided that the possible substitutions where not sufficient and that
also conditions, timers and messages with their parameter list should be
possible to substitute. The following grammar was then decided upon.

<parameter substitution> ::=
                subst <substitution list>

<substitution list> ::=
                <substitution> [ , <substitution list> ]

<substitution> ::=
                <replace message> | <replace instance> | <replace msc> |
                 <replace timer> | <replace condition>

<replace message> ::=
                [msg] <msg identification> by <msg identification>

<replace instance> ::=
                [inst] <instance name> by <instance name>

<replace msc> ::=
                [msc] {empty | <msc name> } by {empty | <msc name> }

<replace timer> ::=
                [tim] <timer identification> by <timer identification>

<timer identification> ::=
                <timer name> [, <timer instance name>] [(<duration
name>)]

<replace condition> ::=
                [cond] <condition name list> by <condition name list>

The problem with this grammar is that an LALR(1) parser (and possibly a
human reader) has a problem with deciding when substitution elements
that may contain commas end (This is due to the fact that <replace xxx>
rules may contain commas and that <substitution list>s are separated by
commas. Consider the following substitution example:

reference R subst
        a1, b1, c1 by a2, b2, c2, /* <replace condition>
(note the comma after c2) */
        d1, e1, f1, by d2, e2, f2 /* <replace condition>
*/

Here the semantics has been expressed by putting the substitutions on
different lines, but the substitution could as well been interpreted as
follows:

reference R subst
        a1, b1, c1 by a2, b2, c2, d1, e1, /* <replace condition>
*/
        f1, by d2, e2, f2 /* <replace
condition> */

A similar problem might occur when substituting timers. This ambiguity
is a "true" ambiguity in the sense that using a more complicated parser
can not solve the problem.

Proposed solution:

The keyword subst should be dropped. The following syntax should be used
for substitutions (examples analogous to the two substitutions above):

reference R (a1, b1, c1 := a2, b2, c2; d1, e1, f1:= d2, e2, f2)
reference R (a1, b1, c1 := a2, b2, c2, d1, e1; f1:= d2, e2, f2)

No grammar will be given for this syntax proposal at this point since
the syntax might be changed base on Your feedback. If the syntax is
accepted by the MSC community, a grammar will naturally be provided.

Problem 2: Event "labels"
==================

The reason why this problem is brought forward to the MSC community is
the fact that its solution requires an extra keyword (generally
considered bad).

The MSC'96 syntax allows events to be labeled by an optional name:

a: in msg from b;
    lab1 in data from c; /* <== (X) */
b: out msg to a;

When a parser encounters the name 'lab1' at position (X) it can not
decide if it is an optional name of an event or the start the instance
list of the following event definition.

Proposed solution:

The grammar should be changed in the following way.

From

<orderable event> ::=
                [ <event name> ] /* !!!! */
                { <message event> | <incomplete message event> |
<create> | <timer statement> | <action> }
                [ before <event name list> ]

<orderable event> ::=
                [ label <event name> ; ] /* !!!! */
                { <message event> | <incomplete message event> |
<create> | <timer statement> | <action> }
                [ before <event name list> ]

The change has no practical effect on users who use a tool since the
change does not affect the "graphical form" of the language in a major
way (names in diagrams may no longer be called "label").

To be truthful this problem could have been solved by using various
tricks in the parser, or by selecting some other kind of separators for
the <event name>. The later solution would have lead to a more confusing
PR (<events name>s was added in MSCī96 to support the ordering
relation).

Best regards, Jan Docekal

-----End text from Jan Docekal <jan.docekal#telelogic.se> to mscnews -----
For help, email "majordomo#sdl-forum.org" with the body of your email as:
    help
or (iff this does not answer your question) email: owner-mscnews#sdl-forum.org



This archive was generated by hypermail 2a23 : Wed Jun 19 2013 - 13:16:38 GMT