1-- The idea with this spec is to gather definitions that has a 2-- complicated structure of table constraints. 3TConstr DEFINITIONS AUTOMATIC TAGS ::= 4 5BEGIN 6 7MYCLASS ::= CLASS { 8 &id OBJECT IDENTIFIER UNIQUE, 9 &Type, 10 &Result OPTIONAL 11} WITH SYNTAX { 12 ID &id 13 TYPE &Type 14 [RESULT &Result] 15} 16 17object1 MYCLASS ::= {ID id-object1 TYPE Type-object1 RESULT INTEGER} 18object2 MYCLASS ::= {ID id-object2 TYPE Type-object2} 19object3 MYCLASS ::= {ID id-object3 TYPE Type-object3 RESULT BOOLEAN} 20 21ObjectSet MYCLASS ::= {object1 | object2 | object3} 22 23id-object1 OBJECT IDENTIFIER ::= {2 4} 24id-object2 OBJECT IDENTIFIER ::= {2 5} 25id-object3 OBJECT IDENTIFIER ::= {2 6 7} 26 27 28Type-object1 ::= SEQUENCE { 29 a INTEGER, 30 b BOOLEAN 31} 32 33Type-object2 ::= ENUMERATED {first, second, third} 34 35Type-object3 ::= CHOICE { 36 first SEQUENCE {a BOOLEAN, b INTEGER}, 37 second INTEGER 38} 39 40Seq1 ::= SEQUENCE { 41 a SEQUENCE {aa INTEGER, ab MYCLASS.&id ({ObjectSet})}, 42 b SEQUENCE {ba INTEGER, bb MYCLASS.&Type ({ObjectSet}{@a.ab})} 43} 44 45Seq2 ::= SEQUENCE { 46 identity INTEGER, 47 content SEQUENCE { 48 subid MYCLASS.&id ({ObjectSet}), 49 subcontent MYCLASS.&Type ({ObjectSet}{@content.subid}), 50 subresult MYCLASS.&Result ({ObjectSet}{@content.subid}) 51 } 52} 53 54Deeper ::= SEQUENCE { 55 a SEQUENCE {aa INTEGER, 56 s SEQUENCE { ab MYCLASS.&id ({ObjectSet}), 57 ac INTEGER }}, 58 b SEQUENCE {ba INTEGER, bb MYCLASS.&Type ({ObjectSet}{@a.s.ab})} 59} 60 61Seq3 ::= SEQUENCE { 62 a SEQUENCE { 63 aa INTEGER, 64 ab MYCLASS.&id ({ObjectSet}) 65 }, 66 -- Multiple references from the same SEQUENCE... 67 b SEQUENCE { 68 ba MYCLASS.&Type ({ObjectSet}{@a.ab}), 69 bb MYCLASS.&Result ({ObjectSet}{@a.ab}), 70 -- ... and references from multiple SEQUENCEs... 71 bc SEQUENCE { 72 bca MYCLASS.&Result ({ObjectSet}{@a.ab}), 73 bcb MYCLASS.&Type ({ObjectSet}{@a.ab}) 74 } 75 } 76} 77 78Seq3-Opt ::= SEQUENCE { 79 a SEQUENCE { 80 aa INTEGER, 81 ab MYCLASS.&id ({ObjectSet}) 82 }, 83 -- Multiple references from the same SEQUENCE... 84 b SEQUENCE { 85 ba MYCLASS.&Type ({ObjectSet}{@a.ab}) OPTIONAL, 86 bb MYCLASS.&Result ({ObjectSet}{@a.ab}) OPTIONAL, 87 -- ... and references from multiple SEQUENCEs... 88 bc SEQUENCE { 89 bca MYCLASS.&Result ({ObjectSet}{@a.ab}), 90 bcb MYCLASS.&Type ({ObjectSet}{@a.ab}) 91 } OPTIONAL 92 } 93} 94 95-- following from Peter's definitions 96 97 98MY-CLASS ::= CLASS { 99 &id OBJECT IDENTIFIER UNIQUE, 100 &Type } 101 WITH SYNTAX { 102 ID &id 103 TYPE &Type } 104 105Info ::= SEQUENCE { 106 xyz SEQUENCE { 107 abc MY-CLASS.&id({Supported}) 108 }, 109 uvw MY-CLASS.&Type ({Supported}{@xyz.abc}) } 110 111Supported MY-CLASS ::= { dsa | rsa } 112 113-- dsa 114 115 id-dsa OBJECT IDENTIFIER ::= { 1 2 } 116 117 DSAPublicKey ::= INTEGER -- public key, y 118 119 dsa MY-CLASS ::= { 120 ID id-dsa 121 TYPE DSAPublicKey } 122 123-- rsa 124 125 rsaEncryption OBJECT IDENTIFIER ::= { 1 3 4 } 126 127 RSAPublicKey ::= SEQUENCE { 128 modulus INTEGER, -- n 129 publicExponent INTEGER } -- e 130 131 rsa MY-CLASS ::= { 132 ID rsaEncryption 133 TYPE RSAPublicKey } 134 135END 136