| 1 | /****************************************************************************** |
| 2 | * Copyright (c) 2000-2014 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 | module three { |
| 10 | |
| 11 | import from one all; |
| 12 | import from two all; |
| 13 | import from Zero language "ASN.1" all; |
| 14 | |
| 15 | type union Thing { |
| 16 | boolean b, |
| 17 | integer i, |
| 18 | charstring cs, |
| 19 | record { integer num } rec |
| 20 | } with { |
| 21 | variant "JSON : as value"; |
| 22 | variant(i) "JSON : name as int"; |
| 23 | variant(cs) "JSON : name as str"; |
| 24 | } |
| 25 | |
| 26 | type record of Thing Stuff; |
| 27 | |
| 28 | type set Barrels { |
| 29 | integer numBarrels, |
| 30 | record { |
| 31 | enumerated { Small, Medium, Large } size, |
| 32 | boolean filled |
| 33 | } barrelType |
| 34 | } |
| 35 | |
| 36 | type set of record { integer num } Nums |
| 37 | with { variant([-].num) "JSON: name as number" } |
| 38 | |
| 39 | type record Numz { |
| 40 | Nums nums |
| 41 | } |
| 42 | |
| 43 | type record of Rec Rex; |
| 44 | |
| 45 | external function f_enc_ints(in Ints eents, out octetstring octus) |
| 46 | with { extension "prototype(fast) encode(JSON) printing(pretty)" } |
| 47 | |
| 48 | external function f_enc_bigset(in Big_Set x) return octetstring |
| 49 | with { extension "prototype(convert) encode(JSON)" } |
| 50 | |
| 51 | external function f_dec_bigset(in octetstring os) return Big_Set |
| 52 | with { extension "prototype(convert) decode(JSON)" } |
| 53 | |
| 54 | } with { |
| 55 | encode "JSON" |
| 56 | } |