Re: SDL-News: Operator I defined can't be converted to C


Subject: Re: SDL-News: Operator I defined can't be converted to C
doldi.laurent#wanadoo.fr
Date: Thu Feb 20 2003 - 08:52:21 GMT


Become an SDL Forum Society member <http://www.sdl-forum.org/Society/members.htm>
The originator of this message is responsible for its content.
-----From doldi.laurent#wanadoo.fr to sdlnews -----

Dear Yang,

As you have experienced, axioms are not supported by some code generators.
In the last version of the language, SDL-2000, axioms have been removed.

Rather than using axioms, you can use the algorithmic form to
define operators in Tau SDL Suite. Here is a copy-paste from
an SDL model (described in my book) that works with Tau, where the
operator fill_Iframe is defined in textual algorithmic form:

  NEWTYPE Iframe
    STRUCT
      DLCi DLCident;
      data Idata;
      length Integer; /* octets in data */
      CRC Integer;
    OPERATORS
      fill_Iframe: DLCident, Idata, Integer, Integer->Iframe;
    OPERATOR fill_Iframe;
      FPAR dlc DLCident, D Idata, len Integer, Crc Integer;
      RETURNS res Iframe;
      START;
      /* here you can use DECISION, JOIN, etc. */
      TASK res := (. dlc, D, len, Crc .);
      RETURN res;
    ENDOPERATOR;
  ENDNEWTYPE;

You can also use (in Tau) the graphical algorithmic operator
form. The syntax is similar to an SDL procedure.

The other option (tool-dependent) is to code SDL operators
(or procedures) in C.

Regards,
Laurent Doldi.

At 14:04 20/02/2003 +0800, you wrote:
>Become an SDL Forum Society member
<http://www.sdl-forum.org/Society/members.htm>
>The originator of this message is responsible for its content.
>-----From "Yang LIU" <lyly97#mails.tsinghua.edu.cn> to sdlnews -----
>
>I am using Telelogic tau suite 4.3, now I have a problem:
>I define a NewType and Operator in SDl like this:
>
>newtype Usec inherits Integer operators all;
> adding operators
> dUsec : Usec -> Duration;
> axioms
> for all u in Usec (for all d in Duration( for all r in Real(
> r = float(u) ==> dUsec(u) == Duration!(r); )));
> endnewtype Usec;
>
>But in generated C file, there have no C code for function dUsec,
>my question is :
>Is axioms useless in telelogic SDL?
>how generate C code of Operator dUsec?
>
>
>--End text from "Yang LIU" <lyly97#mails.tsinghua.edu.cn> to sdlnews ---
>For extra SDL Forum Society benefits join at
<http://www.sdl-forum.org/Society/members.htm>
>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
>

Laurent DOLDI
*** book: SDL Illustrated *** see http://perso.wanadoo.fr/doldi/sdl
TransMeth Sud-Ouest
27, av. Segoffin 31400 TOULOUSE FRANCE
Tel.: +33 5 61 25 59 54 Fax: +33 6 07 74 87 71
Mobile: +33 6 80 26 62 31
--End text from doldi.laurent#wanadoo.fr to sdlnews ---
For extra SDL Forum Society benefits join at <http://www.sdl-forum.org/Society/members.htm>



This archive was generated by hypermail 2a23 : Thu May 09 2013 - 16:05:49 GMT