Lev Walkin | b266466 | 2004-08-18 04:54:10 +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) |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 6 | -- .50 1 |
| 7 | -- .50 2 |
Lev Walkin | b266466 | 2004-08-18 04:54:10 +0000 | [diff] [blame] | 8 | |
| 9 | ModuleNestedConstraintsCheck |
| 10 | { iso org(3) dod(6) internet (1) private(4) enterprise(1) |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 11 | spelio(9363) software(1) asn1c(5) test(1) 50 1 } |
Lev Walkin | b266466 | 2004-08-18 04:54:10 +0000 | [diff] [blame] | 12 | DEFINITIONS ::= |
| 13 | BEGIN |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 14 | IMPORTS Identifier FROM IdentifierModule; |
Lev Walkin | b266466 | 2004-08-18 04:54:10 +0000 | [diff] [blame] | 15 | |
| 16 | Int1 ::= INTEGER |
| 17 | Int2 ::= Int1 (0..MAX) -- X.680-0207::41.4.4 |
| 18 | Int3 ::= Int2 (MIN..ten) -- Means (0..10) |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 19 | Int4 ::= Int3 (5..MAX,...,1..4) -- Means (1..10,...) |
Lev Walkin | b266466 | 2004-08-18 04:54:10 +0000 | [diff] [blame] | 20 | Int5 ::= Int4 (MIN..5) -- Means (5) |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 21 | -- Int6 ::= INTEGER (Int5) -- -- Not yet supported |
Lev Walkin | b266466 | 2004-08-18 04:54:10 +0000 | [diff] [blame] | 22 | |
| 23 | ten Int1 ::= other-ten |
| 24 | other-ten Int2 ::= 10 |
| 25 | |
| 26 | -- G.4.3.4 |
| 27 | ExtensibleExtensions ::= INTEGER ((1..256,...) INTERSECTION (1..256)) |
| 28 | |
| 29 | Str1 ::= IA5String |
| 30 | Str2 ::= Str1 (SIZE(MIN..20 | 25..30)) |
| 31 | -- Means (SIZE(0..20 | 25..30)) |
| 32 | Str3 ::= Str2 (SIZE(10..27))(FROM("ABC"|"def")) |
| 33 | -- (SIZE(10..20,25..27))(FROM("ABCdef")) |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 34 | Str4 ::= IA5String ("ABCD"|SIZE(4)) |
| 35 | -- Not PER-visible |
Lev Walkin | b266466 | 2004-08-18 04:54:10 +0000 | [diff] [blame] | 36 | |
| 37 | PER-Visible ::= IA5String (FROM("A".."F")) |
| 38 | PER-Visible-2 ::= PER-Visible (FROM("E".."F")) -- Means (FROM("EF")) |
| 39 | -- The following maintain parent permitted alphabet constraint |
| 40 | Not-PER-Visible-1 ::= PER-Visible (FROM("AB") | SIZE(1..2)) |
| 41 | Not-PER-Visible-2 ::= PER-Visible (FROM("AB",...)) |
| 42 | Not-PER-Visible-3 ::= PER-Visible (FROM("AB"),...) |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 43 | |
Lev Walkin | b266466 | 2004-08-18 04:54:10 +0000 | [diff] [blame] | 44 | SIZE-but-not-FROM ::= PER-Visible (SIZE(1..4) ^ FROM("ABCD",...)) |
| 45 | SIZE-and-FROM ::= PER-Visible (SIZE(1..4) ^ FROM("ABCD")) |
| 46 | Neither-SIZE-nor-FROM ::= PER-Visible (SIZE(1..4) | FROM("ABCD",...)) |
| 47 | |
Lev Walkin | 00df16d | 2004-10-02 16:44:30 +0000 | [diff] [blame] | 48 | Utf8-4 ::= UTF8String (FROM("A".."Z")) -- Alphabet |
Lev Walkin | fac2e94 | 2004-10-02 16:33:46 +0000 | [diff] [blame] | 49 | Utf8-3 ::= Utf8-2 (FROM("A".."Z"|"a".."z")) -- Alphabet and size |
| 50 | Utf8-2 ::= Utf8-1 (SIZE(1..2)) -- Size |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 51 | Utf8-1 ::= UTF8String |
| 52 | |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 53 | VisibleIdentifier ::= Identifier |
| 54 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 55 | Sequence ::= SEQUENCE { |
| 56 | int1-c Int1 (-2..MAX) DEFAULT 3, |
| 57 | int4 [2] Int4, |
| 58 | int4-c Int4 (MIN..7), |
| 59 | bool BOOLEAN DEFAULT 1, |
| 60 | enum-c ENUMERATED { one(1), two(2), ..., three(3) }, |
| 61 | ..., |
| 62 | int5-c Int5 (5) OPTIONAL, |
| 63 | ..., |
| 64 | null NULL OPTIONAL |
| 65 | } |
| 66 | |
| 67 | SequenceOf ::= SEQUENCE (SIZE(1..2)) OF Sequence |
| 68 | |
| 69 | Enum0 ::= ENUMERATED { one, two } |
| 70 | Enum1 ::= ENUMERATED { one, two } (one) |
| 71 | |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 72 | END |
| 73 | |
| 74 | |
| 75 | IdentifierModule |
| 76 | { iso org(3) dod(6) internet (1) private(4) enterprise(1) |
| 77 | spelio(9363) software(1) asn1c(5) test(1) 50 2 } |
| 78 | DEFINITIONS ::= |
| 79 | BEGIN |
| 80 | EXPORTS Identifier; |
| 81 | |
| 82 | maxIdentifier INTEGER ::= 32 |
| 83 | |
| 84 | Identifier ::= |
| 85 | VisibleString ( FROM |
| 86 | ("A"|"a"|"B"|"b"|"C"|"c"|"D"|"d"|"E"|"e"|"F"|"f"| |
| 87 | "G"|"g"|"H"|"h"|"I"|"i"|"J"|"j"|"K"|"k"|"L"|"l"| |
| 88 | "M"|"m"|"N"|"n"|"O"|"o"|"P"|"p"|"Q"|"q"|"R"|"r"| |
| 89 | "S"|"s"|"T"|"t"|"U"|"u"|"V"|"v"|"W"|"w"|"X"|"x"| |
| 90 | "Y"|"y"|"Z"|"z"|"$"|"_"|"0"|"1"|"2"|"3"|"4"|"5"| |
| 91 | "6"|"7"|"8"|"9") ) (SIZE(1..maxIdentifier)) |
| 92 | |
Lev Walkin | b266466 | 2004-08-18 04:54:10 +0000 | [diff] [blame] | 93 | END |