我无法理解RFC2141中的一些BNF语法。
线是<NID> ::= <let-num> [ 1,31<let-num-hyp> ]
。我认为这意味着它<NID>
是一个字符串的符号,受两个规则的约束:
- 字符串必须以任何
<let-num>
字符的单次出现开始。 - 此字符后面可能出现 0-31 次出现*的任何
<let-num-hyp>
字符。
我读对了吗?因为,如果我是,其中的一些含义有点令人困惑。
*相当于“可选,1-31 次出现
RFC2141<NID>
中(命名空间标识符)的完整 BNF 语法是:
<NID> ::= <let-num> [ 1,31<let-num-hyp> ]
<let-num-hyp> ::= <upper> | <lower> | <number> | "-"
<let-num> ::= <upper> | <lower> | <number>
<upper> ::= "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" |
"I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" |
"Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" |
"Y" | "Z"
<lower> ::= "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" |
"i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" |
"q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" |
"y" | "z"
<number> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |
"8" | "9"