Subject: RE: SDL-News: Unions
From: SUEL Jean-Francois CNET/DTL/LAN (jeanfrancois.suel#cnet.francetelecom.fr)
Date: Fri Apr 16 1999 - 08:20:51 GMT
The originator of this message is responsible for its content.
-----From SUEL Jean-Francois CNET/DTL/LAN <jeanfrancois.suel#cnet.francetelecom.fr> to sdlnews -----
SDT is a wonderful tool, but if you need to produce a specification
compliant with Z100/105, do not follow this advice and use ASN.1 CHOICE
instead (even with SDT).
J-F
> ----------
> De : Dagbjørn Nogva[SMTP:dagbjorn#telox.no]
> Répondre à : Dagbjørn Nogva
> Date : vendredi 16 avril 1999 09:57
> A : joanna.archer#bt.com
> Cc : sdlnews#sdl-forum.org
> Objet : Re: SDL-news: Unions
>
> The originator of this message is responsible for its content.
> -----From =?iso-8859-1?Q?Dagbj=F8rn?= Nogva <dagbjorn#telox.no> to sdlnews
> -----
>
> Hello Jo,
>
> > I realise unions are not supported by SDL but can't they be specified as
> an
> > Abstract Data Type and if so does anyone know where this has been done
> that
> > I can cut and paste from as I'm not sure I'd like to go through the
> > rigmarole of defining operations and axioms etc....
> >
>
> If you are the privileged user of Telelogic's tool set SDT, you can
> directly benefit from an extension to the SDL data types called choice.
> choice is based on the corresponding ASN.1 data type, however you do
> not have to worry about ASN.1. According to SDT documentation,
> choice in SDL can be seen as a C union with an implicit tag field.
>
> Example (partly from SDT doc):
>
> newtype C1 choice
> a Integer;
> b Charstring;
> c Boolean;
> endnewtype;
>
> dcl var C1;
>
> task var!b := 'hello'; /* Assign component b */
>
> decision var!Present: /* Check which component in use */
> (a): 'task handling a type values, ie Integer';
> (b): 'task handling b type values, ie Charstring';
> (c): 'task handling c type values, ie Boolean';
> enddecision;
>
> Nice and neat, isn't it? However, not portable...
>
> Best regards
> Dagbjørn Nogva <dagbjorn#telox.no>
> Telox AS
>
>
> -----End text from =?iso-8859-1?Q?Dagbj=F8rn?= Nogva <dagbjorn#telox.no>
> to sdlnews -----
> 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-sdlnews#sdl-forum.org
>
-----End text from SUEL Jean-Francois CNET/DTL/LAN <jeanfrancois.suel#cnet.francetelecom.fr> to sdlnews -----
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-sdlnews#sdl-forum.org
This archive was generated by hypermail 2a23 : Sun Jun 16 2013 - 10:41:40 GMT