
M { -- dub:111 
 iso member-body(2) f(250) type-org(1) ft(16) asn1-book(9) chapter9(1) module1(0) 
} 

DEFINITIONS 
  AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::=
BEGIN

  -- wh: more than one export section is accepted by the parser.
  EXPORTS;
  EXPORTS ALL;
  EXPORTS T{},T,v;
  
  -- wh: more than one import section will be syntactially allowed - shall be 
  -- checked during semantic analysis. This will allow to have multiple variants
  -- within one file to be syntax checked.
  IMPORTS 
      ;

  IMPORTS -- dub:111
     Type1 FROM Module1 { 
       iso member-body(2) f(250) type-org(1) ft(16) asn1-book(9) chapter9(1) module1(0) }
     value2 FROM Module2 { 
       iso member-body(2) f(250) type-org(1) ft(16) asn1-book(9) chapter9(1) module2(1) }
       ;  

   IMPORTS
     P{} FROM Module3 { 
       iso member-body(2) f(250) type-org(1) ft(16) asn1-book(9) chapter9(1) module2(1) }
       ;  
   
   IMPORTS
       T{} FROM Module3
       ;
  
   IMPORTS
       T  FROM Module3 
       ;  

   IMPORTS
       v FROM Module3
       ;  

   IMPORTS
       T{},T,v FROM Module3
       ; 

   IMPORTS
       T{} FROM Module m
       T   FROM Module m
       v   FROM Module m
       ;  

   IMPORTS
       T{} FROM Module
       T   FROM Module
       v   FROM Module
       ;  

  I ::= INTEGER
  R ::= REAL
  v X ::= 5
  cr IA5String ::= "\r"
  S00 ::= SEQUENCE { }
  S01 ::= SEQUENCE { a INTEGER }
  S02 ::= SEQUENCE { 
    a INTEGER, 
    b INTEGER OPTIONAL, 
    c INTEGER DEFAULT 0 , 
    COMPONENTS OF X 
  }
  S03 ::= SEQUENCE {
    ...
  }
  S04 ::= SEQUENCE {
    ... !INTEGER:4
  }
  S05 ::= SEQUENCE {
    ... !-5
  }
  S65 ::= SEQUENCE {
    ... !a
  }
  S07 ::= SEQUENCE {
    ... !SEQUENCE { a INTEGER } : 5
  }
  S08 ::= SEQUENCE {
    a INTEGER,
    ...
  }
  S09 ::= SEQUENCE {
    a INTEGER,
    ... !INTEGER:4
  }
  S10 ::= SEQUENCE {
    a INTEGER,
    ... !-5
  }
  S11 ::= SEQUENCE {
    a INTEGER,
    ... !a
  }
  S12 ::= SEQUENCE {
    a INTEGER,
    ... !SEQUENCE { a INTEGER } : 5
  }
  S13 ::= SEQUENCE {
    ...,
    a INTEGER,
    ...
  }
  S14 ::= SEQUENCE {
    ... !INTEGER:4,
    a INTEGER,
    ... !INTEGER:4
  }
  S15 ::= SEQUENCE {
    ... !-5,
    a INTEGER,
    ... !-5
  }
  S16 ::= SEQUENCE {
    ... !a,
    a INTEGER,
    ... !a
  }
  S17 ::= SEQUENCE {
    ... !SEQUENCE { a INTEGER } : 5,
    a INTEGER,
    ... !SEQUENCE { a INTEGER } : 5
  }

  S18 ::= SEQUENCE {
    a INTEGER,
    ...,
    [[d D, e E]],
    ...,
    c C
  }

  C ::= CLASS {
    &T,
    &T OPTIONAL,
    &T DEFAULT INTEGER,
    &c INTEGER,
    &c INTEGER OPTIONAL,
    &c INTEGER DEFAULT 5,
    &c INTEGER UNIQUE,
    &c INTEGER UNIQUE OPTIONAL,
    &c INTEGER UNIQUE DEFAULT 5
    } 

  OTHER-FUNCTION ::= CLASS {
   -- fixed-type value field spec -- 
   &code INTEGER -- (0 .. MAX) -- UNIQUE,
   -- fixed-type value set field spec --
   &Alphabet BMPString DEFAULT {Latin1 INTERSECTION Level1} ,
   -- type field spec --
   &ArgumentType,
   -- variable-type value set field spec
   &SupportedArguments &ArgumentType OPTIONAL,
   -- variable type value field spec
   &result-if-error &ResultType DEFAULT NULL,
   -- object field spec
   &associated-function OTHER-FUNCTION OPTIONAL,
   -- object set field spec --
   &Errors ERROR DEFAULT { rejected-memory | memory-fault } ,
   -- type field spec
   &ResultType DEFAULT NULL
  }

  v X ::= {}
  v X ::= { 1 UNION 2 }
  v X ::= { (2|3) INTERSECTION (3|4) }
  v X ::= { ALL EXCEPT 1 }
  v X ::= { ALL EXCEPT 1 }
  v X ::= { 1|2|3^4|5 }
  v X ::= { {1|2|3^4|5} }
  v X ::= { {{1}|2|3^4|5} }
  v X ::= { (1|2|3) EXCEPT 3 } 
  v X ::= {  1|2|3 EXCEPT 3 } 
  v X ::= { 5 , ... }
  v X ::= { 5 , ... , 5 }
  v X ::= { ... }
  v X ::= { ..., 5 }

  Person ::= SEQUENCE {
   age INTEGER ,
   name IA5String
  }

  -- pki93
  Extension         ::=   SEQUENCE {
  extnId            EXTENSION.&id ({ExtensionSet}),
  critical          BOOLEAN DEFAULT FALSE,
  extnValue         OCTET STRING }
  
  EXTENSION       ::=     CLASS {
  &id          OBJECT IDENTIFIER UNIQUE,
  &ExtnType }
  WITH SYNTAX  {
  SYNTAX               &ExtnType
  IDENTIFIED BY        &id 
  }

  T ::= INTEGER ( {SupportedAttributes} {@type} )


  AttributeTypeAndValue           ::=     SEQUENCE {
  type            ATTRIBUTE.&id ({SupportedAttributes}),
  value   ATTRIBUTE.&Type ({SupportedAttributes}{@type})
  }

  Attribute       ::=     SEQUENCE {
  type            ATTRIBUTE.&id ({SupportedAttributes}),
  values  SET SIZE (1 .. MAX) OF ATTRIBUTE.&Type
  ({SupportedAttributes}{@type})}


  C::= CLASS {
   &T,
   &id INTEGER
  }
  WITH SYNTAX {
   TYPE &T MAPPED BY &id
   [&a]
   [A [&b] C]
  }

  c C ::= { TYPE IA5String MAPPED BY 5 }

  -- dub: 106
  TypeReference ::= CHOICE { integer INTEGER, boolean BOOLEAN }

  value-reference TypeReference ::= integer : 12

  -- dub: 107
  Pair ::= SEQUENCE { x INTEGER, y INTEGER }
  Couple ::= SEQUENCE { x INTEGER, y INTEGER }

  pair Pair ::= { x 5, y 13 }
  couple Couple ::= pair

  Lighter-state ::= ENUMERATED {
    on(0), off(1), out-of-order(2) 
  }
  Kettle-state ::= ENUMERATED {
    on(0), off(1), out-of-order(2) 
  }
  
  lighter Lighter-state  ::= on
  kettle  Kettle-state   ::= lighter

  PrimeNumbers INTEGER ::= { 2 | 3 | 5 | 7 | 11 | 13 }

  -- dub: 112
  Type2 ::= SET { a Type1 DEFAULT value1, b BOOLEAN }  

  -- dub: 125
  T1 ::= [0] SET { name PrintableString, age INTEGER, gender BOOLEAN -- male = TRUE -- }
  U1 ::= [1] SET { gender Male, name VisibleString, age INTEGER }

  -- dub: 126
  T2 ::= [0] SEQUENCE { name [0] PrintableString, age INTEGER }
  U2 ::= [2] SEQUENCE { name [1] PrintableString, age INTEGER }

  -- dub: 128
  RoundResult ::= BOOLEAN
  ok RoundResult ::= TRUE
  ko RoundResult ::= FALSE

  Married ::= BOOLEAN
  kim MALE ::= TRUE

  -- dub: 129
  Ack ::= NULL
  Clock ::= CHOICE { time UTCTime, out-of-order NULL }

  battery-down Clock ::= out-of-order:NULL

  -- dub: 130
  LinkedList ::= SEQUENCE {
    data Data,
    next CHOICE { linked-list LinkedList, end NULL} 
  }
  
  --LinkedList ::= SEQUENCE OF Data

  -- dub: 131
  zero INTEGER ::= 0
  french-population INTEGER ::= 60000000000
  fridge-temperature INTEGER ::= -18 -- in Centigrade scale

  -- no constraints yet
  Interval ::= INTEGER (123456789..1234567890)

  -- dub: 132
  ErrorCode ::= INTEGER {
  disk-full(1), no-disk(-1), disk-not-formatted(2) 
  }

  stupid-error ErrorCode ::= disk-full

  ok ErrorCode ::= 0

  stupid-error ErrorCode ::= 1

  AbortReason ::= INTEGER {
  reason-not-specified(0),
  unrecognized-ppdu(1),
  unexpected-ppdu(2),
  unexpected-session-service-primitive(3),
  unrecognized-ppdu-parameter(4),
  unexpected-ppdu-parameter(5), 
  invalid-ppdu-parameter-value(6)
  }

  -- dub: 133
  Temperature ::= INTEGER {
  freezing(0), boiling(100)
  }

  alpha INTEGER ::= 1
  Type1 ::= INTEGER { alpha(2) }
  Type2 ::= INTEGER { alpha(3), beta(alpha) }
  gamma Type2 ::= beta
  delta Type2 ::= alpha

  -- dub: 136
  -- [..]

  -- dub: 137
  RadioButton ::= ENUMERATED { button1,button2,button3 } 
  
  RadioButton ::= ENUMERATED { button1, button2, button3, ...}

  RadioButton ::= ENUMERATED { button1, button2, button3, ..., button4, button5 }

  -- dub: 138
  -- [..]

  -- dub: 141
  ExtendedReal ::= CHOICE {
  decimal REAL,
  particular-real ENUMERATED { one-third,pi,e, ...}
  }

  pi REAL ::= { mantissa 314159, base 10, exponent -5 }
  e  REAL ::= { mantissa 271828128459045235360287, base 10, exponent -23 }
  zero REAL ::= 0

  -- dub: 142
  -- [..]

  -- dub: 145
  SubjectPublicKeyInfo ::= SEQUENCE {
  algorithm AlgorithmIdentifier ,
  subjectPublicKey BIT STRING
  }
  
  pi-decimals BIT STRING ::= '001000100'B
  pi-decimals BIT STRING ::= '243F68885A'H

  -- dub: 146
  -- [..]

  Rights ::= BIT STRING {
  user-read(0), user-write(1), group-read(2), group-write(3), other-read(4), other-write(5)
  }

  group1 Rights ::= { group-read,group-write}
  group2 Rights ::= '0011'B
  group3 Rights ::= '3'H
  group4 Rights ::= '001100'B
  weired-rights Rights ::= '000001'B

  -- dub: 148
  -- [..]
  alpha INTEGER ::= 1
  BinaryString ::= BIT STRING { alpha(3), beta(alpha) }

  
  -- dub: 151
  icon OCTET STRING ::= '00110010100101'B
  icon OCTET STRING ::= '349aB'H


  internet-id OBJECT IDENTIFIER ::= { iso(1) identified-organization(4) dod(6) internet(1)}
  francetelecom-id OBJECT IDENTIFIER ::= { iso member-body f(250) type-org(1) ft(16)}
  ber-id  OBJECT IDENTIFIER ::= { 2 1 1 }


  -- dub: 260
  Two ::= INTEGER (2)
  Day ::= ENUMERATED { tuesday(2), wednesday(3), thursday(4) }
  Wednesday ::= Day (wednesday)
  FourZ ::= IA5String ("ZZZZ")
  Afters ::= CHOICE {
  cheese IA5String,
  dessert ENUMERATED { profiteroles(1), sabayon(2), fraisier(3) }
  }
  CompulsoryAfters ::= Afters (desert:sabayon)

  -- dub: 262
  Weekend ::= Day(saturday|sunday)
  PushButtonDial ::= IA5String ("0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"|"*"|"#")

  FrenchWeekend ::= Day(Weekend)
  
  -- dub: 263
  LongWeekend ::= Day(Weekend|monday)
  T1 ::= INTEGER { trois(3), quatre(4) }
  T2 ::= INTEGER { one(1),two(2),three(3), four(4) } (T1)

  FrenchWeekend ::= Day(INCLUDES Weekend)

  -- dub: 264
  Number ::= INTEGER
  From3to15 ::= Number (3 .. 15)
  From4to14 ::= Number (3<..<15)
  
  Positive ::= NUMBER (0<..MAX)
  Negative ::= NUMBER (MIN..<0)
  Zero     ::= NUMBER (-1<..<1)

  T ::= REAL (0..<{mantissa 5,base 10, exponent 0})
  U ::= T({mantissa 2, base 10, exponent 0} .. MAX)


  T ::= INTEGER ({ExtensionSet})


  --dub: 266
Exactly31BitsString ::= BIT STRING (SIZE (31))
StringOf31BitsAtTheMost ::= BIT STRING (SIZE (0..31))
EvenNumber ::= INTEGER (2|4|6|8|10)
EvenLengthString ::=
IA5String (SIZE (INCLUDES EvenNumber))
NonEmptyString ::= OCTET STRING (SIZE (1..MAX))

ListOfStringsOf5Characters ::=
SEQUENCE OF PrintableString (SIZE (5))

 -- dub: 267
ListOfStrings ::= SEQUENCE OF PrintableString
ListOf5Strings ::= ListOfStrings (SIZE (5))
ListOf5Strings ::= SEQUENCE (SIZE (5)) OF PrintableString

ListOf5StringsOf5Characters ::=
SEQUENCE (SIZE (5)) OF PrintableString (SIZE (5))

ListOf5StringsOf5Characters ::=
SEQUENCE SIZE (5) OF PrintableString (SIZE (5))

-- dub: 268
Morse ::= PrintableString (FROM ("."|"-"|" "))
IDCardNumber ::=
NumericString (FROM ("0".."9"))
PushButtonDialSequence ::=
IA5String (FROM ("0".."9"|"*"|"#"))


 --dub: 271
DateAndTime ::=
VisibleString(PATTERN "\d#2/\d#2/\d#4-\d#2:\d#2") -- DD/MM/YYYY-HH:MM

-- dub: 275
DateAndTime ::= VisibleString
(PATTERN "((\d#2)/(\d#2)/(\d#4)-(\d#2:\d#2))")
-- \1 is a date in which \2 is the month, \3 the day,
-- \4 the year and \5 the time (in hours and minutes)
  -- dub: 280

ROIV-m-Linked-Reply-Action ::=
ROIV-m-Linked-Reply (WITH COMPONENTS {
invokedID PRESENT,
linked-ID PRESENT,
operation-value (m-Linked-Reply),
argument (INCLUDES LinkedReplyArgument
(WITH COMPONENTS {
getResult ABSENT,
getListError ABSENT,
setResult ABSENT,
setListError ABSENT,
actionResult PRESENT,
processingFailure PRESENT,
deleteResult ABSENT,
actionError PRESENT,
deleteError ABSENT }))})


  Choice ::= CHOICE {
  a A,
  b B,
  c C,
  d D
  }

  ChoicesCD ::= Choice (
  WITH COMPONENTS {...,a ABSENT, b ABSENT}
  )
  
ChoiceCD ::=
Choice (WITH COMPONENTS {..., a ABSENT, b ABSENT})
ChoiceA1 ::= Choice (WITH COMPONENTS {..., a PRESENT})
ChoiceA2 ::= Choice (WITH COMPONENTS {a PRESENT})
ChoiceBCD ::= Choice (WITH COMPONENTS {a ABSENT, b, c})

-- dub: 284
MoreCompact ::= OCTET STRING (CONTAINING MyType ENCODED BY
{joint-iso-itu-t asn1 packed-encoding(3)
basic(0) unaligned(1)})

-- dub: 285
PhoneNumber ::=
NumericString (FROM ("0".."9"))(SIZE (10))

Row ::= SEQUENCE OF INTEGER

-- dub: 287
Lipogramme ::=
IA5String (FROM (ALL EXCEPT ("e"|"E")))

SaudiName ::= BasicArabic (SIZE (1..100) ^ Level2)
ISO-10646-String ::= BMPString (FROM
(Level2 ^ (BasicLatin | HebrewExtended | Hiragana)))
KatakanaAndBasicLatin ::=
UniversalString (FROM (Katakana | BasicLatin))

CapitalAndSmall ::= IA5String (FROM ("A".."Z"|"a".."z"))
CapitalOrSmall ::=
IA5String (FROM ("A".."Z")|FROM ("a".."z"))
ExoticString ::= IA5String (SIZE (1..4)|FROM ("abc"))

-- dub: 288
InvokeId ::= CHOICE { present INTEGER,
absent NULL }

DAP-InvokeIdSet ::= InvokeId (ALL EXCEPT absent:NULL)

Identifications ::= SEQUENCE {
idNumber NumericString (FROM (ALL EXCEPT " "))
(SIZE (6)) OPTIONAL,
telephone NumericString (FROM (ALL EXCEPT " "))
(SIZE (13)) OPTIONAL }

Person ::= SEQUENCE {
name PrintableString (SIZE (1..20)),
ident Identifications (WITH COMPONENTS {idNumber}
|WITH COMPONENTS {telephone}) }


-- dub: 291
A ::= INTEGER (0..10, ...)
A ::= INTEGER (0..10, ..., 12)

-- dub: 292
S ::= IA5String (SIZE (1..10, ...))
E ::= INTEGER (1..10, ...!Exception:too-large-integer)
Exception ::= ENUMERATED {too-large-integer, ...}

ImplementedUnivStr{UniversalString:Level} ::=
UniversalString (FROM ((Level UNION BasicLatin))
!characterSet-problem)
characterSet-problem INTEGER ::= 4

T ::= INTEGER (0..10, ...!10)
U ::= T (2..6, ...!6)

-- dub: 293
ImplementedUnivStgLevel1{UniversalString:ImplementedSubset}
::= UniversalString (ImplementedUnivStr{{Level1}}
INTERSECTION ImplementedSubset, ...!level1-problem)
level1-problem INTEGER ::= 5


-- dub: 295
PDV-List ::= SEQUENCE {
transfer-syntax-name Transfer-syntax-name OPTIONAL,
presentation-context-identifier
Presentation-context-identifier,
presentation-data-values CHOICE {
single-ASN1-type [0] ABSTRACT-SYNTAX.&Type
(CONSTRAINED BY {-- Type corresponding --
-- to presentation-context-identifier --}),
octet-aligned [1] IMPLICIT OCTET STRING,
arbitrary [2] IMPLICIT BIT STRING } }



Reject ::= SEQUENCE {
invokeId InvokeId,
problem CHOICE {
general [0] GeneralProblem,
invoke [1] InvokeProblem,
returnResult [2] ReturnResultProblem,
returnError [3] ReturnErrorProblem }}
(CONSTRAINED BY {-- must conform to the above --
-- definition --} ! RejectProblem:general-mistypedPDU)


Encrypted{TypeToBeEnciphered} ::= BIT STRING (CONSTRAINED
BY {-- must be the result of the encipherment --
-- of some BER-encoded value of --
TypeToBeEnciphered} !Error:securityViolation)
Error ::= ENUMERATED {securityViolation}


-- dub: 299
EXTERNAL ::= [UNIVERSAL 8] IMPLICIT SEQUENCE {
direct-reference OBJECT IDENTIFIER OPTIONAL,
indirect-reference INTEGER OPTIONAL,
data-value-descriptor ObjectDescriptor OPTIONAL,
encoding CHOICE {
single-ASN1-type [0] ANY,
octet-aligned [1] IMPLICIT OCTET STRING,
arbitrary [2] IMPLICIT BIT STRING }}


CoordinateMatrix ::= SEQUENCE SIZE (6) OF Row ( SIZE (6)) (WITH COMPONENT (-100..100))

TextBlock ::= SEQUENCE OF VisibleString
Address ::= TextBlock (SIZE (3..6))(WITH COMPONENT (SIZE (1..32)))
Address ::= TextBlock (WITH COMPONENT (SIZE (1..32)))

PushButtonDialSequence ::=
IA5String (FROM ("0".."9"|"*"|"#"))

  SIGNED { ToBeSigned } ::= SEQUENCE {
     toBeSigned  ToBeSigned,
     algorithm   AlgorithmIdentifier,
     signature   BIT STRING
  }

  DirectoryString { INTEGER:maxSize } ::= CHOICE {
        teletexString           TeletexString (SIZE (1..maxSize)),
        printableString         PrintableString (SIZE (1..maxSize)),
        universalString         UniversalString (SIZE (1..maxSize)),
        bmpString               BMPString (SIZE(1..maxSize)),
        utf8String              UTF8String (SIZE(1..maxSize))
        }

  LinkedList ::= SEQUENCE SIZE (1..MAX) OF T

GeneralName ::= CHOICE {
        otherName                   [0] INSTANCE OF OTHER-NAME,
        rfc822Name                  [1] IA5String,
        dNSName                     [2] IA5String,
        x400Address                 [3] ORAddress,
        directoryName               [4] Name,
        ediPartyName                [5] EDIPartyName,
        uniformResourceIdentifier   [6] IA5String,
        iPAddress                   [7] OCTET STRING,
        registeredID                [8] OBJECT IDENTIFIER }

OTHER-NAME ::= TYPE-IDENTIFIER

EDIPartyName ::= SEQUENCE {
  nameAssigner DirectoryString {ub-name}
}

extendedKeyUsage EXTENSION ::= 
{
    SYNTAX         SEQUENCE SIZE (1..MAX) OF KeyPurposeId
    IDENTIFIED BY id-ce-extKeyUsage 
}


-- dub: 313
FUNCTION ::= CLASS {
 &ArgumentType ,
 &ResultType   DEFAULT NULL,
 &Errors       ERROR OPTIONAL,
 &code         INTEGER UNIQUE 
}

addition-of-2-integers FUNCTION ::= {

  &ArgumentType SEQUENCE { a INTEGER, b INTEGER },
  &ResultType INTEGER,
  -- empty error list by default
  &code 1 
}
-- dub: 314
OTHER-FUNCTION ::= CLASS {
&code INTEGER (0..MAX) UNIQUE,
&Alphabet BMPString
DEFAULT {Latin1 INTERSECTION Level1},
&ArgumentType ,
&SupportedArguments &ArgumentType OPTIONAL,
&ResultType DEFAULT NULL,
&result-if-error &ResultType DEFAULT NULL,
&associated-function OTHER-FUNCTION OPTIONAL,
&Errors ERROR DEFAULT
{rejected-argument | memory-fault} }
rejected-argument ERROR ::=
{-- object definition --}
memory-fault ERROR ::=
{-- object definition --}

-- dub: 315
other-addition-of-2-integers 
  OTHER-FUNCTION ::= {
  &ArgumentType Pair,
  &SupportedArguments {PosPair | NegPair},
  &ResultType INTEGER,
  &result-if-error 0,
  &code 1 
}

Pair ::= SEQUENCE {a INTEGER, b INTEGER}

PosPair ::= Pair (WITH COMPONENTS {a(0..MAX), b(0..MAX)})

NegPair ::= Pair (WITH COMPONENTS {a(MIN..0), b(MIN..0)})


-- dub: 323
OTHER-FUNCTION ::= CLASS {
 &code INTEGER (0..MAX) UNIQUE,
 &Alphabet BMPString DEFAULT {Latin1 INTERSECTION Level1},
 &ArgumentType ,
 &SupportedArguments &ArgumentType OPTIONAL,
 &ResultType DEFAULT NULL,
 &result-if-error &ResultType DEFAULT NULL,
 &associated-function OTHER-FUNCTION OPTIONAL,
 &Errors ERROR DEFAULT {rejected-argument|memory-fault} 
}
WITH SYNTAX {
 ARGUMENT TYPE &ArgumentType,
 [SUPPORTED ARGUMENTS &SupportedArguments,]
 [RESULT TYPE &ResultType,
 [RETURNS &result-if-error IN CASE OF ERROR,]] -- syntax error if ']]' (solved)
 [ERRORS &Errors,]
 [MESSAGE ALPHABET &Alphabet,]
 [ASSOCIATED FUNCTION &associated-function,]
 CODE &code }

memory-fault ERROR ::= {-- object definition --}

-- dub: 315
other-addition-of-2-integers OTHER-FUNCTION ::= {
&ArgumentType Pair,
&SupportedArguments {PosPair | NegPair},
&ResultType INTEGER,
&result-if-error 0,
&code 1 }
Pair ::= SEQUENCE {a INTEGER, b INTEGER}
PosPair ::= Pair (WITH COMPONENTS {a(0..MAX), b(0..MAX)})
NegPair ::= Pair (WITH COMPONENTS {a(MIN..0), b(MIN..0)})



-- dub: 327
ATTRIBUTE ::= CLASS {
&derivation ATTRIBUTE OPTIONAL,
&Type OPTIONAL,
&equality-match MATCHING-RULE OPTIONAL,
&ordering-match MATCHING-RULE OPTIONAL,
&substrings-match MATCHING-RULE OPTIONAL,
&single-valued BOOLEAN DEFAULT FALSE,
&collective BOOLEAN DEFAULT FALSE,
&no-user-modification BOOLEAN DEFAULT FALSE,
&usage Attribute-Usage
DEFAULT userApplications,
&id OBJECT IDENTIFIER UNIQUE}
WITH SYNTAX {
[SUBTYPE OF &derivation]
[WITH SYNTAX &Type]
[EQUALITY MATCHING RULE &equality-match]
[ORDERING MATCHING RULE &ordering-match]
[SUBSTRINGS MATCHING RULE &substrings-match]
[SINGLE VALUE &single-valued]
[COLLECTIVE &collective]
[NO USER MODIFICATION &no-user-modification]
[USAGE &usage]
ID &id }

AttributeUsage ::= ENUMERATED { userApplications(0),
directoryOperation(1), distributedOperation(2),
dSAOperation(3) }

MATCHING-RULE ::= CLASS {
 &AssertionType OPTIONAL,
 &id OBJECT IDENTIFIER UNIQUE }
WITH SYNTAX {
 [SYNTAX &AssertionType]
 ID &id 
}

name ATTRIBUTE ::= {
 WITH SYNTAX DirectoryString
 EQUALITY MATCHING RULE caseIgnoreMatch
 ID {joint-iso-itu-t ds(5) attributeType(4) 2} 
}

DirectoryString ::= CHOICE {
  teletexString TeletexString (SIZE (1..maxSize)),
  printableString PrintableString (SIZE (1..maxSize)),
  universalString UniversalString (SIZE (1..maxSize)),
  bmpString BMPString (SIZE (1..maxSize)),
  utf8String UTF8String (SIZE (1..maxSize)) 
}

maxSize INTEGER ::= 25

caseIgnoreMatch MATCHING-RULE ::= {
 SYNTAX DirectoryString
 ID {id-mr 2} }

id-mr OBJECT IDENTIFIER ::=
{ joint-iso-itu-t ds(5) matchingRule(13) }

MatchingRules MATCHING-RULE ::= {
  caseIgnoreMatch | booleanMatch | integerMatch }

--dub: 328
AttributeUsage ::= ENUMERATED { userApplications(0),
directoryOperation(1), distributedOperation(2),
dSAOperation(3) }

MATCHING-RULE ::= CLASS {
&AssertionType OPTIONAL,
&id OBJECT IDENTIFIER UNIQUE }
WITH SYNTAX {
[SYNTAX &AssertionType]
ID &id }

--dub: 329
name ATTRIBUTE ::= {
WITH SYNTAX DirectoryString
EQUALITY MATCHING RULE caseIgnoreMatch
ID {joint-iso-itu-t ds(5) attributeType(4) 2} }
DirectoryString ::= CHOICE {
teletexString TeletexString (SIZE (1..maxSize)),
printableString PrintableString (SIZE (1..maxSize)),
universalString UniversalString (SIZE (1..maxSize)),
bmpString BMPString (SIZE (1..maxSize)),
utf8String UTF8String (SIZE (1..maxSize)) }
maxSize INTEGER ::= 25
caseIgnoreMatch MATCHING-RULE ::= {
SYNTAX DirectoryString
ID {id-mr 2} }
id-mr OBJECT IDENTIFIER ::=
{ joint-iso-itu-t ds(5) matchingRule(13) }

--dub: 330
LessMatchingRules MATCHING-RULE ::= {
MatchingRules EXCEPT caseIgnoreMatch }

ExtensibleMatchingRules MATCHING-RULE ::= {
caseIgnoreMatch | booleanMatch | integerMatch, ... }

ExtensibleMatchingRules MATCHING-RULE ::= {...}

--dub: 331
Values INTEGER ::= { 1 | 2 | 3 }
Values ::= INTEGER (1|2|3)

--dub: 337
id-mr-caseIgnoreMatch OBJECT IDENTIFIER ::=
caseIgnoreMatch.&id

CLASS1 ::= CLASS { &obj CLASS2 }
CLASS2 ::= CLASS { &val INTEGER }
object1 CLASS1 ::= { &obj object2 }
object2 CLASS2 ::= { &val 5 }
value INTEGER ::= object1.&obj.&val

Oids OBJECT IDENTIFIER ::= {MatchingRules.&id}

Oids OBJECT IDENTIFIER ::=
{ {id-mr 2} | {id-mr 12} | {id-mr 13} }

SupportedFunctions OTHER-FUNCTION ::= {
addition-of-2-integers | substraction-of-2-integers |
multiplication-of-2-integers }
-- dub: 342
surname ATTRIBUTE ::= { -- family name
SUBTYPE OF name
WITH SYNTAX DirectoryString
ID id-at-surname }
givenName ATTRIBUTE ::= { -- first name
SUBTYPE OF name
WITH SYNTAX DirectoryString
ID id-at-givenName }
countryName ATTRIBUTE ::= { -- country
SUBTYPE OF name
WITH SYNTAX PrintableString (SIZE (2)) -- [ISO3166]
SINGLE VALUE TRUE
ID id-at-countryName}

SupportedAttributes ATTRIBUTE ::=
{surname | givenName | countryName}

AttributeIdAndValue1 ::= SEQUENCE {
ident ATTRIBUTE.&id,
value ATTRIBUTE.&Type }

-- dub: 343
AttributeIdAndValue2 ::= SEQUENCE {
ident ATTRIBUTE.&id({SupportedAttributes}),
value ATTRIBUTE.&Type({SupportedAttributes}) }

-- dub: 344
value AttributeIdAndValue2 ::= {
  ident id-at-countryName,
--  value DirectoryString:universalString:"$$Escher$$"     -- -- wh: bug   
}

-- dub: 345
AttributeIdAndValue3 ::= SEQUENCE {
 ident ATTRIBUTE.&id({SupportedAttributes}),
 value ATTRIBUTE.&Type({SupportedAttributes}{@ident}) 
}

-- dub: 346
AttributeIdAndValue3 ::= SEQUENCE {
ident ATTRIBUTE.&id({SupportedAttributes}),
value ATTRIBUTE.&Type({SupportedAttributes}{@ident}) }

-- dub: 353
AttributeIdAndValue3 ::= SEQUENCE {
ident ATTRIBUTE.&id({SupportedAttributes}),
value ATTRIBUTE.&Type({SupportedAttributes}{@.ident})}

AttributeIdsAndValues ::= SET OF SEQUENCE {
ident ATTRIBUTE.&id({SupportedAttributes}),
value ATTRIBUTE.&Type({SupportedAttributes}{@.ident})}

AttributeValueAssertion ::= SEQUENCE {
type ATTRIBUTE.&Id({SupportedAttributes}),
assertion ATTRIBUTE.&equality-match.&AssertionType
({SupportedAttributes}{@type}) }

-- dub: 354
FilterItem ::= CHOICE {
equality [0] AttributeValueAssertion,
substrings [1] SEQUENCE {
type Attribute.&id({SupportedAttributes}),
strings SEQUENCE OF CHOICE {
initial [0] ATTRIBUTE.&Type
({SupportedAttributes}{@substrings.type}),
any [1] ATTRIBUTE.&Type
({SupportedAttributes}{@substrings.type}),
final [2] ATTRIBUTE.&Type
({SupportedAttributes}{@substrings.type}) }},
greaterOrEqual [2] AttributeValueAssertion,
lessOrEqual [3] AttributeValueAssertion,
present [4] AttributeType,
approximateMatch [5] AttributeValueAssertion,
extensibleMatch [6] MatchingRuleAssertion }

Attribute-desc ::= SEQUENCE {
usage ATTRIBUTE.&usage({SupportedAttributes}),
list SEQUENCE OF SEQUENCE {
ident ATTRIBUTE.&id({SupportedAttributes}{@usage}),
value ATTRIBUTE.&Type
({SupportedAttributes}{@usage,@.ident}) }}


-- dub: 355
att-desc Attribute-desc ::= {
usage userApplications,
list { { ident id-at-objectClass,
value oid },
{ ident id-at-aliasedEntryName,
value distinguishedName }}}

-- dub: 356
Authentication-value ::= CHOICE {
charstring [0] IMPLICIT GraphicString,
bitstring [1] BIT STRING,
external [2] EXTERNAL,
other [3] IMPLICIT SEQUENCE {
other-mechanism-name MECHANISM-NAME.&id({ObjectSet}),
other-mechanism-value MECHANISM-NAME.&Type
({ObjectSet}{@.other-mechanism-name}) }}

TYPE-IDENTIFIER ::= CLASS {
&id OBJECT IDENTIFIER UNIQUE,
&Type }
WITH SYNTAX {&Type IDENTIFIED BY &id}

MECHANISM-NAME ::= TYPE-IDENTIFIER

Authentication-value ::= CHOICE {
charstring [0] IMPLICIT GraphicString,
bitstring [1] BIT STRING,
external [2] EXTERNAL,
other [3] IMPLICIT SEQUENCE {
other-mechanism-name MECHANISM-NAME.&id({ObjectSet}),
other-mechanism-value MECHANISM-NAME.&Type
({ObjectSet}{@.other-mechanism-name}) }}

T::= SEQUENCE { 
  type-id TYPE-IDENTIFIER.&id,
  value [0] EXPLICIT TYPE-IDENTIFIER.&Type 
}


-- dub: 358
ExtendedBodyPart ::= SEQUENCE {
 parameters [0] INSTANCE OF TYPE-IDENTIFIER OPTIONAL,
 data INSTANCE OF TYPE-IDENTIFIER 
}
(CONSTRAINED BY { 
  -- must correspond to the &parameters --
  -- and &data fields of a member of    -- 
 IPMBodyPartTable}
)

TYPE-IDENTIFIER ::= CLASS {
&id OBJECT IDENTIFIER UNIQUE,
&Type }
WITH SYNTAX { &Type IDENTIFIED BY &id }


-- dub: 360
ABSTRACT-SYNTAX ::= CLASS {
&id OBJECT IDENTIFIER,
&Type ,
&property BIT STRING {handles-invalid-encodings(0)}
DEFAULT {} }
WITH SYNTAX { &Type IDENTIFIED BY &id
[HAS PROPERTY &property] }

-- dub: 361
PDV-list ::= SEQUENCE {
transfer-syntax-name
Transfer-syntax-name OPTIONAL,
presentation-context-identifier
Presentation-context-identifier,
presentation-data-values CHOICE {
single-ASN1-type [0] ABSTRACT-SYNTAX.&Type
(CONSTRAINED BY {-- Type which corresponds to --
-- the presentation context identifier --}),
octet-aligned [1] IMPLICIT OCTET STRING,
arbitrary [2] IMPLICIT BIT STRING }}

-- dub: 379
DirectoryString{INTEGER:maxSize} ::= CHOICE {
teletexString TeletexString (SIZE (1..maxSize)),
printableString PrintableString (SIZE (1..maxSize)),
universalString UniversalString (SIZE (1..maxSize)),
bmpString BMPString (SIZE (1..maxSize)),
utf8String UTF8String (SIZE (1..maxSize)) }

-- dub: 380
SubstringAssertion ::= SEQUENCE OF CHOICE {
initial [0] DirectoryString{ub-match},
any [1] DirectoryString{ub-match},
final [2] DirectoryString{ub-match} }
ub-match INTEGER ::= 128

SubstringAssertion{INTEGER:ub-match} ::= SEQUENCE OF
CHOICE { initial [0] DirectoryString{ub-match},
any [1] DirectoryString{ub-match},
final [2] DirectoryString{ub-match} }


-- dub: 381
T ::= INTEGER
List{T} ::= SEQUENCE OF T

Choice{T} ::= CHOICE { a [0] T,
b INTEGER }

Structure{T} ::= SEQUENCE { a INTEGER,
b [0] T OPTIONAL,
c INTEGER }

GeneralForm{T, T:val} ::= SEQUENCE {
info T DEFAULT val,
comments IA5String }

-- dub: 382
Form ::= GeneralForm{BOOLEAN, TRUE}
Form ::= SEQUENCE { info BOOLEAN DEFAULT TRUE,
comments IA5String }

pariTierce{INTEGER:first, INTEGER:second,
INTEGER:third} SEQUENCE OF INTEGER ::=
{ first, second, third }

-- dub: 382
MESSAGE-PARAMETERS ::= CLASS {
&max-priority-level INTEGER,
&max-message-buffer-size INTEGER,
&max-reference-buffer-size INTEGER }
WITH SYNTAX {
MAXIMUM PRIORITY &max-priority-level
MAXIMUM MESSAGE BUFFER &max-message-buffer-size
MAXIMUM REFERENCE BUFFER &max-reference-buffer-size }
Message-PDU{MESSAGE-PARAMETERS:param} ::= SEQUENCE {
priority INTEGER (0..param.&max-priority-level
!Exception:priority),
message UTF8String (SIZE
(0..param.&max-message-buffer-size)
!Exception:message),
comments UTF8String (SIZE
(0..param.&max-reference-buffer-size)
!Exception:comments) }
Exception ::= ENUMERATED {priority(0), message(1),
comments(2), ...}

-- dub: 383
Forward{OPERATION:OperationSet} OPERATION ::=
{ OperationSet |
OperationSet.&Linked.&Linked |
OperationSet.&Linked.&Linked.&Linked.&Linked }

Reverse{OPERATION:OperationSet} OPERATION ::=
{ Forward{{OperationSet.&Linked}} }

-- dub: 383 
ForwardAndReverse OPERATION ::=
{Forward{{MyOperationSet}} UNION Reverse{{MyOperationSet}}}

--dub: 387
Flag{Color} ::= SEQUENCE {
country VisibleString,
colors SEQUENCE OF Color DEFAULT {blue} }


-- dub: 389
CharacterString{INTEGER:max-length} ::= CHOICE {
 teletexString TeletexString (SIZE (1..max-length) !exceeds-max-length),
 printableString PrintableString (SIZE (1..max-length) !exceeds-max-length) 
}

exceeds-max-length INTEGER ::= 999


-- dub: 390
my-abstract-syntax {INTEGER:maxSize} ABSTRACT-SYNTAX ::=
{ my-PDU{size-max} IDENTIFIED BY {iso
member-body(2) f(250) type-org(1) ft(16)
asn1-book(9) chapter17(4) my-PDU(0)} }
END


-- dub: 499,500
MyHTTP DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
GetRequest ::= SEQUENCE {
header-only BOOLEAN,
lock BOOLEAN,
accept-types AcceptTypes,
url Url,
... }
AcceptTypes ::= SET {
standards BIT STRING {html(0), plain-text(1), gif(2),
jpeg(3)} (SIZE (4)) OPTIONAL,
others SEQUENCE OF VisibleString (SIZE (4)) OPTIONAL }
Url ::= VisibleString (FROM ("a".."z"|"A".."Z"|"0".."9"|
"./-_~%#"))

value GetRequest ::= {
header-only TRUE,
lock FALSE,
accept-types {
standards { html, plain-text } },
url "www.asn1.com" }
END


-- dub: 360
ProtocolName-Abstract-Syntax-Module {iso member-body(2)
f(250) type-org(1) ft(16) asn1-book(9) chapter15(3)
protocol-name(0)}
DEFINITIONS ::= BEGIN
IMPORTS ProtocolName-PDU FROM ProtocolName-Module {iso
member-body(2) f(250) type-org(1) ft(16)
asn1-book(9) chapter15(3) protocol-name(0)
module1(2)};
protocolName-Abstract-Syntax ABSTRACT-SYNTAX ::=
{ProtocolName-PDU IDENTIFIED BY
protocolName-Abstract-Syntax-id}
protocolName-Abstract-Syntax-id OBJECT IDENTIFIER ::=
{iso member-body(2) f(250) type-org(1) ft(16)
asn1-book(9) chapter15(3) protocol-name(0)
abstract-syntax(0)}
protocolName-Abstract-Syntax-descriptor ObjectDescriptor
::= "Abstract syntax of ProtocolName"
protocolName-Transfer-Syntax-id OBJECT IDENTIFIER ::=
{iso member-body(2) f(250) type-org(1) ft(16)
asn1-book(9) chapter15(3) protocol-name(0)
transfer-syntax(1)}
protocolName-Transfer-Syntax-descriptor ObjectDescriptor
::= "Transfer syntax of ProtocolName"
END
