Sync with 5.4.0
[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 -- Defining IO set to be used in message contraction
39
40 MyIOSet MY-CLASS ::= { myIo1 | myIo2 | myIo3 }
41
42 -- and now finally constructing the type
43
44 MyMessage ::= SEQUENCE {
45 id MY-CLASS.&id ({MyIOSet}), -- integer field, values constrained to one of
46 -- the value defined for an IO, member of the set
47 content MY-CLASS.&OpenTypeField ({MyIOSet} {@id})
48 -- open type field constrainedto the types defined for
49 -- the objects in the set; this is handled as an implicit
50 -- union by Titan and should be an anytype, i.e. using the
51 -- names of the types to select the given type.
52 }
53
54 -- Values
55 a-message-id1-lower MyMessage ::= {
56 id 1,
57 content mySeq : { field1 23, field2 '1234'H }
58 }
59
60 a-message-id2-lower MyMessage ::= {
61 id 2,
62 content myEnum : third
63 }
64
65 a-message-id3-lower MyMessage ::= {
66 id 3,
67 content iNTEGER : 7
68 }
69 /*
70 -- Not supported values
71 a-message-id1-upper MyMessage ::= {
72 id 1,
73 content MySeq : { field1 23, field2 '1234'H }
74 }
75
76 a-message-id2-upper MyMessage ::= {
77 id 2,
78 content MyEnum : third
79 }
80
81 a-message-id3-upper MyMessage ::= {
82 id 3,
83 content INTEGER : 7
84 }
85 */
86 END
This page took 0.04651 seconds and 5 git commands to generate.