[1] DXL (JISX0130-1995) の構文定義に使われている BNF
変種について。
[2] JIS X 0130-1995 5. で定義されています。
[3]
- DEF = "::=" ;; 定義する
- OR = "|"
- option = "[" elements "]" ;; 0*1
- repetition = "{" elements "}" ;; 0*∞
- char-val = terminal-zero / terminal-one ;; 終端記号
- terminal-zero = "‘" 1*CHAR "’" ;; 水準 0
- terminal-one = "“" 1*CHAR "”" ;; 水準 1
- rule-name = rule-name-zero / rule-name-one ;; 非終端記号
- rule-name-zero = "<" 1*name-char ">"
- rule-name-one = "<<" 1*name-char ">>"
- rule = rule-name defined-as elements [FWS] EOD
- defined-as = [FWS] DEF [FWS]
- elements = [FWS] alternation [FWS]
- alternation = concatenation *(or-operator concatenation)
- or-operator = [FWS] OR [FWS]
- concatenation = element *(FWS element)
- element = rule-name / repetition / option / char-val
なお、水準 ("0" / "1")
は規格の実装水準。