Connected: An Internet Encyclopedia
13.1. Syntax Rules

Up: Connected: An Internet Encyclopedia
Up: Requests For Comments
Up: RFC 1902
Up: 13. Appendix C: Detailed Sub-typing Rules
Prev: 13. Appendix C: Detailed Sub-typing Rules
Next: 13.2. Examples

13.1. Syntax Rules

13.1. Syntax Rules

The syntax rules for sub-typing are given below. Note that while this syntax is based on ASN.1, it includes some extensions beyond what is allowed in ASN.1, and a number of ASN.1 constructs are not allowed by this syntax.

     <integerSubType>
         ::= <empty>
           | "(" <range> ["|" <range>]... ")"

     <octetStringSubType>
         ::= <empty>
           | "(" "SIZE" "(" <range> ["|" <range>]... ")" ")"

     <range>
         ::= <value>
           | <value> ".." <value>

     <value>
         ::= "-" <number>
           | <number>
           | <hexString>
           | <binString>

     where:
         <empty>     is the empty string
         <number>    is a non-negative integer
         <hexString> is a hexadecimal string (i.e. 'xxxx'H)
         <binString> is a binary string (i.e. 'xxxx'B)

         <range> is further restricted as follows:
             - any <value> used in a SIZE clause must be non-negative.
             - when a pair of values is specified, the first value
               must be less than the second value.
             - when multiple ranges are specified, the ranges may
               not overlap but may touch. For example, (1..4 | 4..9)
               is invalid, and (1..4 | 5..9) is valid.
             - the ranges must be a subset of the maximum range of the
               base type.


Next: 13.2. Examples

Connected: An Internet Encyclopedia
13.1. Syntax Rules