Hallo Michael,
Your question is far from trivial!
The Change Request which you refer to indicates that type = parameterization is
not permitted in TTCN-3. Note that type parameterization is however permitted
in ASN.1 which can be used in TTCN-3.
Whether using ASN.1 parameterized types, imported into a TTCN-3 module = is
permitted, I'll leave to you to investigate. :-)
What you are referring to in your mail, is more appropriately referred = to as
either sub-typing, or type aliasing.
A type alias is simply a type that is given another name without placing = any
restrictions (range, value, or value list) on the referenced type.
A sub-type is a 'new' type which further restricts values allowed; that = is
range, value, or value list restrictions are placed on the new type.
Here is an example of a TTCN-3 type alias:
type integer MyInt /* ex. Of a type alias */
Here is an example of a TTCN-3 sub-type:
Note how MySmallerInt is restricted to the values 0 up to and including = 123.
type MyInt MySmallerInt ( 0 .. 123 )
Because TTCN-3 is a weakly typed language the following is possible
Var MyInt a := 1000;
Var MySmallerInt b := 1;
a := b; /* syntactically and semantically valid */
b := a; /* syntactically and semantically valid, however, */
/* this assignment will cause a run-time error as */
/* the range of MySmallerInt is violated 1000 > 123 */
There is a whole section in the standard explaining type compatibility
rules.
Actually, if you read part 1 of ES 201 873-1 (describing the TTCN-3 Core
Notation), or if you have the book, An Introduction to TTCN-3 by Colin Willcock,
et. Al) read chapter 8 TTCN-3 Data Types for a further explanation. Also refer
to section 3.1.7 Basic Data Types and 3.1.8 Subtypes of the same book for clear
explanations.
Regarding type parameterization in ASN.1, you should read either John
Larmouth's book: ASN.1 Complete, or for a more complete = explanation, read
Olivier Dubuisson's book: ASN.1 Communication between = Heterogeneous Systems.
Both ASN.1 books are freely available from
www.ossnokalva.com/
Cheers,
Claude.
Blue Cactus Consulting phone: +49 (0)30 9606 7985
Edinburger Str. 39 fax: +49 (0)30 9606 7987
13349 Berlin mobile: +49 (0)174 701 6792
Germany email:
This email address is being protected from spambots. You need JavaScript enabled to view it.
Original Message
From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
[
This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Michael Sperber
Sent: 18 April 2008 17:07
To:
This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: How does type parameterization work?
Hello,
I'm new to TTCN-3 - please forgive me if this is an inappropriate or trivial
question, and let me know if it is:
I'm wondering how type parameterization works, i.e. what kind of parameters can
be passed, and where can they be used in the type definition itself? I'm
thinking array bounds, ranges and such, but can't be sure. I've seen this:
t-ort.etsi.org/view.php?id=3011
... which doesn't really answer the question directly.
Any help on this would be much appreciated!
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla