Re: SDL-News: SDL syntax for SYNONYM


Subject: Re: SDL-News: SDL syntax for SYNONYM
From: Rick Reed TSE (rickreed#tseng.co.uk)
Date: Mon Apr 03 2006 - 14:42:41 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 -----

Hoerni Frédéric at fhoerni#sopragroup.com wrote on 3/4/06 13:29:

> Hello,
> I have 2 questions.
>
> 1. Is the following syntax correct ? (the type is missing)
>
> SYNONYM S1 = 'Z';
>
> if so, what is the type of S1 ? Character or Charstring ?
>
>
>
> 2. (second question) Is the following correct ?
>
> SYNONYM S1 Charstring = 'Z';
>
> (the Z100 considers 'Z' as a character literal)
>
> thanks for any answer.

Dear Frédéric,

The relevant grammar syntax for an (internal) synonym definition is:

---
<synonym definition> ::=
   synonym <synonym definition item> { , <synonym definition item> }*<end>

<synonym definition item> ::= <internal synonym definition item> | <external synonym definition item>

<internal synonym definition item> ::= <synonym name> [<sort>] <equals sign> <constant expression>

...

If the sort of the <constant expression> cannot be uniquely determined, then a sort must be specified in the <synonym definition>. ---

The <constant expression> is 'Z', but this can be Character sort literal or a Charstring of length 1 containing the Character sort literal 'Z'. Because the sort cannot be determined from the expression, the sort must be specified in the <synonym definition>. In other words, SYNONYM S1 = 'Z'; is not grammatically correct (though it is actually syntactically correct).

SYNONYM S1 Charstring = 'Z'; is correct. If the sort of an expression (in this case 'Z') is ambiguous, the ambiguity can be determined by context. Because Charstring has been specified, the expression has to be the Charstring 'Z'.

-- Rick Reed - rickreed#tseng.co.uk Tel:+44 15394 88462 Mob.:+44 7970 50 96 50 Skype: rickreed_windermere

--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:50 GMT