Re: SDL-News: A strange question (without Chinese characters).


Subject: Re: SDL-News: A strange question (without Chinese characters).
From: Rick Reed TSE (rickreed#tseng.co.uk)
Date: Fri Oct 11 2002 - 15:23:59 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 Rick Reed TSE <rickreed#tseng.co.uk> to sdlnews -----

thomas.hjelm#telelogic.com at thomas.hjelm#telelogic.com wrote on
10/10/2002 10:17:

> Hi,
>
> we recommend that you address any issues you come across with our tools
> directly to our tech support as we do not provide support via this mailing
> list.
>
> In this case, however, one of our support engineers has already found the
> solution:
>
> For the tool to do the translation as indicated, you must set the
> environment variable "SDTSAN_ASN1_ENUM_OP" to any value. Once this variable
> is set, this code will compile without a problem.

which I confirm works and produces the SDL code from ASN.1

newtype Color
  literals red,yellow,blue
  operators
    first: Color -> Color;
    last: Color -> Color;
    succ: Color -> Color;
    pred: Color -> Color;
    num: Color -> Integer;
    ordering;
    
    operator first fpar par1 Color returns Color {
      return red;
    }
    
    operator last fpar par1 Color returns Color {
      return blue;
    }
    
    operator succ fpar par1 Color returns Color {
      decision (par1) {
        (red) : return yellow;
        (yellow) : return blue;
        (blue) : return error;
      }
    }
    
    operator pred fpar par1 Color returns Color {
      decision (par1) {
        (red) : return error;
        (yellow) : return red;
        (blue) : return yellow;
      }
    }
    
    operator num fpar par1 Color returns Integer {
      decision (par1) {
        (red) : return 0;
        (yellow) : return 1;
        (blue) : return 2;
      }
    }
endnewtype;

--
Rick Reed, TSE Limited

--End text from Rick Reed TSE <rickreed#tseng.co.uk> 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