Sync with 5.4.0
[deliverable/titan.core.git] / regression_test / json / JsonData.asn
CommitLineData
970ed795 1--*****************************************************************************
3abe9331 2-- Copyright (c) 2000-2015 Ericsson Telecom AB
970ed795
EL
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--*****************************************************************************
8JsonData
9DEFINITIONS
10
11AUTOMATIC TAGS
12
13::=
14
15BEGIN
16
17IMPORTS ;
18
19-- Type definitions --
20----------------------
21
af710487 22-- Sequence of
970ed795
EL
23SeqOfInt ::= SEQUENCE OF INTEGER
24
af710487 25-- Sequence
970ed795
EL
26SeqProduct ::= SEQUENCE {
27 name UniversalString,
28 price REAL,
29 id OCTET STRING OPTIONAL,
30 available BOOLEAN
31}
32
af710487 33-- Choice
970ed795
EL
34Number ::= CHOICE {
35 decimal INTEGER,
36 binary BIT STRING,
37 hexadecimal OCTET STRING
38}
39
af710487 40-- Choice containing all string types
970ed795
EL
41AnyString ::= CHOICE {
42 generalstr GeneralString,
43 numericstr NumericString,
44 utf8str UTF8String,
45 printablestr PrintableString,
46 universalstr UniversalString,
47 bmpstr BMPString,
48 graphicstr GraphicString,
49 ia5str IA5String,
50 teletexstr TeletexString,
51 videotexstr VideotexString,
52 visiblestr VisibleString
53}
54
af710487 55-- Sequence of strings
970ed795
EL
56ManyStrings ::= SEQUENCE OF AnyString
57
af710487 58-- Set containing all of the above
970ed795
EL
59ComplexSet ::= SET {
60 product SeqProduct,
61 numbers SET OF Number,
62 strings ManyStrings
63}
64
af710487 65Priority ::= ENUMERATED { low, normal, medium, high, urgent }
66
67Conditionality ::= ENUMERATED { optional, conditional, mandatory }
68
69ProtocolElem-ID ::= INTEGER (0..65535)
70
71-- IOC
72PROTOCOL-ELEMS ::= CLASS
73{
74 &id ProtocolElem-ID UNIQUE,
75 &priority Priority,
76 &Value,
77 &conditionality Conditionality
78}
79WITH SYNTAX
80{
81 ID &id
82 PRIORITY &priority
83 TYPE &Value
84 CONDITIONALITY &conditionality
85}
86
87-- parameterized type
88ProtocolElem-Field {PROTOCOL-ELEMS : ElemsSetParam} ::= SEQUENCE
89{
90 id PROTOCOL-ELEMS.&id ({ElemsSetParam}),
91 priority PROTOCOL-ELEMS.&priority ({ElemsSetParam}{@id}),
92 val PROTOCOL-ELEMS.&Value ({ElemsSetParam}{@id})
93}
94
95
96-- Information objects
97ies-Set-Element-1 PROTOCOL-ELEMS ::=
98{
99 ID 0
100 PRIORITY low
101 TYPE INTEGER
102 CONDITIONALITY mandatory
103}
104
105ies-Set-Element-2 PROTOCOL-ELEMS ::=
106{
107 ID 1
108 PRIORITY high
109 TYPE IA5String
110 CONDITIONALITY optional
111}
112-- Information Object Set
113Elems-Set PROTOCOL-ELEMS ::= { ies-Set-Element-1 | ies-Set-Element-2 }
114
115
116-- instantiation
117ProtocolElem-Field1 ::= ProtocolElem-Field {{Elems-Set}}
118
119ProtocolElem-Field2 ::= ProtocolElem-Field {{ies-Set-Element-2 }}
120
121-- Choice containing NULL
122Price ::= CHOICE
123{
124 value REAL,
125 invaluable NULL
126}
127
128-- Sequence containing an object identifier and an ANY type
129Object ::= SEQUENCE
130{
131 id OBJECT IDENTIFIER,
132 data ANY
133}
134
135-- Sequence containing an optional NULL field
136HasNull ::= SEQUENCE
137{
138 theNull NULL OPTIONAL
139}
140
3abe9331 141-- Renaming basic ASN.1 types for use in TTCN-3
142AsnNull ::= NULL
143AsnInt ::= INTEGER
144AsnVisibleString ::= VisibleString
145AsnAny ::= ANY
146
af710487 147
970ed795
EL
148-- Values and their encoding --
149-------------------------------
150
151-- SeqOfInt
152c-ints SeqOfInt ::= { 1, 3, 6 }
153
154c-ints-str VisibleString ::= "[1,3,6]"
155
156-- SeqProduct
157c-product SeqProduct ::= {
158 name "TV",
159 price 250.0,
160 id '1D65'H,
161 available TRUE
162}
163
164c-product-str VisibleString ::= "{""name"":""TV"",""price"":250.000000,""id"":""1D65"",""available"":true}"
165
166-- Number
167c-number Number ::= binary : '1100'B
168
169c-number-str VisibleString ::= "{""binary"":""1100""}"
170
171-- ManyStrings
172c-strings ManyStrings ::= {
173 generalstr : "General String <o",
174 numericstr : "1 457 664",
175 utf8str : "Doesn't actually contain non-ASCII characters",
176 printablestr : "hello",
177 universalstr : "not so universal, apparently",
178 bmpstr : "abc",
179 ia5str : "one two three",
180 teletexstr : "Let's just bug out and call it even, OK?!",
181 videotexstr : "abc123;.",
182 visiblestr : "invisible"
183}
184
185c-strings-str VisibleString ::= "[{""generalstr"":""General String <o""},{""numericstr"":""1 457 664""},{""utf8str"":""Doesn't actually contain non-ASCII characters""},{""printablestr"":""hello""},{""universalstr"":""not so universal, apparently""},{""bmpstr"":""abc""},{""ia5str"":""one two three""},{""teletexstr"":""Let's just bug out and call it even, OK?!""},{""videotexstr"":""abc123;.""},{""visiblestr"":""invisible""}]"
186
187-- ComplexSet
188c-set-val ComplexSet ::= {
189 product {
190 name "Headset",
191 price 28.5,
192 available FALSE
193 },
194 numbers {
195 hexadecimal : '16678D'H,
196 decimal : 12
197 },
198 strings {
199 printablestr : "first",
200 numericstr : "2"
201 }
202}
203
204c-set-val-str VisibleString ::= "{""product"":{""name"":""Headset"",""price"":28.500000,""available"":false},""numbers"":[{""hexadecimal"":""16678D""},{""decimal"":12}],""strings"":[{""printablestr"":""first""},{""numericstr"":""2""}]}"
205
af710487 206-- Object
207c-obj Object ::= {
208 id { joint-iso-itu-t remote-operations(4) informationObjects(5) version1(0) },
209 data 'DEADBEEF'H
210}
211
212c-obj-str VisibleString ::= "{""id"":""2.4.5.0"",""data"":""DEADBEEF""}"
213
214-- HasNull
215c-null HasNull ::= { theNull NULL }
216c-not-null HasNull ::= {}
217
218c-null-str VisibleString ::= "{""theNull"":null}"
219c-not-null-str VisibleString ::= "{}"
220
970ed795 221END
This page took 0.032574 seconds and 5 git commands to generate.