daa798572e33971b3e595507ce9d7ffad1433522
[deliverable/titan.core.git] / regression_test / compileonly / openTypeNames / IO_based_message.asn
1 --*****************************************************************************
2 -- Copyright (c) 2000-2015 Ericsson Telecom AB
3 -- All rights reserved. This program and the accompanying materials
4 -- are made available under the terms of the Eclipse Public License v1.0
5 -- which accompanies this distribution, and is available at
6 -- http://www.eclipse.org/legal/epl-v10.html
7 --*****************************************************************************
8
9 IO-based-message DEFINITIONS
10
11 AUTOMATIC TAGS ::=
12
13 BEGIN
14
15 --Types to be used in IO definitions
16 MySeq ::= SEQUENCE {
17 field1 INTEGER,
18 field2 OCTET STRING OPTIONAL
19 }
20
21 MyEnum ::= ENUMERATED { first, second, third, fourth, fifth }
22
23 --Defining IO class
24 MY-CLASS ::= CLASS {
25 &id INTEGER UNIQUE, -- id to distinguish the different IO instances
26 &OpenTypeField -- Open type field
27 }
28 WITH SYNTAX { ID &id TYPE &OpenTypeField }
29
30 -- Defining the information objects
31 myIo1 MY-CLASS ::= { ID 1 TYPE MySeq } -- defining the type MySeq for the open type field,
32 -- instances of the object shall contain a value of this type
33
34 myIo2 MY-CLASS ::= { ID 2 TYPE MyEnum }
35
36 myIo3 MY-CLASS ::= { ID 3 TYPE INTEGER }
37
38 myIo4 MY-CLASS ::= { ID 4 TYPE NULL }
39
40 -- Defining IO set to be used in message contraction
41
42 MyIOSet MY-CLASS ::= { myIo1 | myIo2 | myIo3 | myIo4 }
43
44 -- and now finally constructing the type
45
46 MyMessage ::= SEQUENCE {
47 id MY-CLASS.&id ({MyIOSet}), -- integer field, values constrained to one of
48 -- the value defined for an IO, member of the set
49 content MY-CLASS.&OpenTypeField ({MyIOSet} {@id})
50 -- open type field constrainedto the types defined for
51 -- the objects in the set; this is handled as an implicit
52 -- union by Titan and should be an anytype, i.e. using the
53 -- names of the types to select the given type.
54 }
55
56 -- Values
57 a-message-id1-lower MyMessage ::= {
58 id 1,
59 content mySeq : { field1 23, field2 '1234'H }
60 }
61
62 a-message-id2-lower MyMessage ::= {
63 id 2,
64 content myEnum : third
65 }
66
67 a-message-id3-lower MyMessage ::= {
68 id 3,
69 content iNTEGER : 7
70 }
71
72 a-message-id4-lower MyMessage ::= {
73 id 4,
74 content nULL : NULL
75 }
76 /*
77 -- Not supported values
78 a-message-id1-upper MyMessage ::= {
79 id 1,
80 content MySeq : { field1 23, field2 '1234'H }
81 }
82
83 a-message-id2-upper MyMessage ::= {
84 id 2,
85 content MyEnum : third
86 }
87
88 a-message-id3-upper MyMessage ::= {
89 id 3,
90 content INTEGER : 7
91 }
92
93 a-message-id4-lower MyMessage ::= {
94 id 4,
95 content NULL : NULL
96 }
97 */
98 END
This page took 0.035223 seconds and 5 git commands to generate.