blob: 62c4fdffbc05fc58e3084b60101d6c4ec8cfe3e5 [file] [log] [blame]
Lev Walkinb2664662004-08-18 04:54:10 +00001
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 Walkine4ca5ce2004-09-15 11:44:13 +00006-- .50 1
7-- .50 2
Lev Walkinb2664662004-08-18 04:54:10 +00008
9ModuleNestedConstraintsCheck
10 { iso org(3) dod(6) internet (1) private(4) enterprise(1)
Lev Walkine4ca5ce2004-09-15 11:44:13 +000011 spelio(9363) software(1) asn1c(5) test(1) 50 1 }
Lev Walkinb2664662004-08-18 04:54:10 +000012 DEFINITIONS ::=
13BEGIN
Lev Walkine4ca5ce2004-09-15 11:44:13 +000014 IMPORTS Identifier FROM IdentifierModule;
Lev Walkinb2664662004-08-18 04:54:10 +000015
16 Int1 ::= INTEGER
17 Int2 ::= Int1 (0..MAX) -- X.680-0207::41.4.4
18 Int3 ::= Int2 (MIN..ten) -- Means (0..10)
Lev Walkin59b176e2005-11-26 11:25:14 +000019 Int4 ::= Int3 (5..MAX,...,1..4) -- Means (1..10,...)
Lev Walkinb2664662004-08-18 04:54:10 +000020 Int5 ::= Int4 (MIN..5) -- Means (5)
Lev Walkin8a99bf72004-09-10 06:07:39 +000021 -- Int6 ::= INTEGER (Int5) -- -- Not yet supported
Lev Walkinb2664662004-08-18 04:54:10 +000022
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 Walkin8a99bf72004-09-10 06:07:39 +000034 Str4 ::= IA5String ("ABCD"|SIZE(4))
35 -- Not PER-visible
Lev Walkinb2664662004-08-18 04:54:10 +000036
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 Walkind35c8b52004-08-25 02:08:08 +000043
Lev Walkinb2664662004-08-18 04:54:10 +000044 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 Walkin00df16d2004-10-02 16:44:30 +000048 Utf8-4 ::= UTF8String (FROM("A".."Z")) -- Alphabet
Lev Walkinfac2e942004-10-02 16:33:46 +000049 Utf8-3 ::= Utf8-2 (FROM("A".."Z"|"a".."z")) -- Alphabet and size
50 Utf8-2 ::= Utf8-1 (SIZE(1..2)) -- Size
Lev Walkin2e3055d2004-08-20 13:36:32 +000051 Utf8-1 ::= UTF8String
52
Lev Walkine4ca5ce2004-09-15 11:44:13 +000053 VisibleIdentifier ::= Identifier
54
Lev Walkin59b176e2005-11-26 11:25:14 +000055 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 Walkine4ca5ce2004-09-15 11:44:13 +000072END
73
74
75IdentifierModule
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 ::=
79BEGIN
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 Walkinb2664662004-08-18 04:54:10 +000093END