Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1 | |
| 2 | -- OK: Everything is fine |
| 3 | |
| 4 | -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) |
| 5 | -- .spelio.software.asn1c.test (9363.1.5.1) |
| 6 | -- .31 |
| 7 | |
| 8 | ModuleTestSetOfSimple |
| 9 | { iso org(3) dod(6) internet(1) private(4) enterprise(1) |
| 10 | spelio(9363) software(1) asn1c(5) test(1) 31 } |
| 11 | DEFINITIONS IMPLICIT TAGS ::= |
| 12 | BEGIN |
| 13 | |
| 14 | Forest ::= SET OF Tree |
| 15 | |
| 16 | Tree ::= SEQUENCE { |
| 17 | height INTEGER, |
| 18 | width INTEGER |
| 19 | } |
| 20 | |
Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 21 | -- The following clause tests OPTIONAL. |
| 22 | Stuff ::= SET { |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 23 | trees [1] SET OF Forest OPTIONAL, |
| 24 | ..., |
| 25 | other CHOICE { |
| 26 | a [0] INTEGER, |
| 27 | b [3] INTEGER |
| 28 | }, |
| 29 | ..., |
| 30 | anything [2] SET OF |
Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 31 | SEQUENCE { |
| 32 | cup-of-coffee BIT STRING, |
| 33 | ... |
| 34 | } OPTIONAL |
| 35 | -- The above OPTIONAL applies to the "anything" |
| 36 | -- member of the outer CHOICE, |
| 37 | -- not to the SET OF's embedded SEQUENCE! |
| 38 | } |
| 39 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 40 | END |