Labels and References

Angle brackets are used both for labeling substrings as well as for referencing defined strings by name.

LabelPrefix : EXTENDED_NAME  ':'

AngleBracketString : 
    '<' LabelPrefix BASIC_NAME ExponentExpr? Subclass '>'
|   '<' LabelPrefix CSN1String '>'
|   '<' EXTENDED_NAME ParenExponentOpt SubclassOpt '>'
        
  1. The first two alternatives specify a label for the string that follows. A label may be used to communicate to readers the semantics of the labeled string. A label name may also be used as a reference to the labeled string by using its name in exactly one place: the argument for a function inside an exponent.

  2. The first and third alternatives constitute a reference to a defined string. In the case of the first alternative, the BASIC_NAME is the referenced name while in the third alternative the EXTENDED_NAME is the referenced name. The referenced name will normally correspond to the EXTENDED_NAME of a Definition. However, as will be discussed elsewhere, when there is not a match, we assume that the name will be resolved at the ASN.1 level.

  3. The first and third alternatives both allow (or require, for the first) a subclass expression. A subclass expression can only be applied to references, and therefore it is not allowed in the second alternative.

  4. The second alternative can also represent a reference. This will be the case if the CSN1String is a BASIC_NAME. In that case, however, the BASIC_NAME must not be a multi-word name. If the CSN1String is not a BASIC_NAME, then the second alternative is simply labeling the given string.

  5. The third alternative lets you reference any defined string (not just ones whose name is a BASIC_NAME, as in the first and second alternatives). You may optionally provide an exponent and/or a subclass expression. A label is not allowed in this alternative because if it were, there would be a conflict between it and the second alternative, since some inputs (e.g. a-b) could be parsed as either an EXTENDED_NAME or a CSN1String (an Exclusion in the case of a-b).

  6. When using the third alternative, exponents must use the parenthetical notation. An attempt to use the * notation will have the * treated as part of the name: use <pig(4)> not <pig*4>. The latter would be treated as a reference to the name "pig*4".

  7. According to an unofficial source, <mylabel : a b> is supposed to be interpreted as <mylabel : <a b>>. However, we report an error in this case and require you to use the extra brackets. The reason for this is that <maylabel : a b> is matched by the second alternative, so that "a b" is taken to be a CSN1String. But, in order to avoid ambiguities involved in using multi-word names outside of angle brackets, we report an error whenever a multi-word name is used for a CSN1String.

  8. In order apply a label to an EXTENDED_NAME, simply use extra angle brackets: <mylabel : <crazy-name>>