[−][src]Module abnf::abnf
Parsing of ABNF
See https://tools.ietf.org/html/rfc5234#section-4
Functions
alternation | alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) |
bin_val | bin-val = "b" 1BIT [ 1("." 1BIT) / ("-" 1BIT) ] ; series of concatenated bit values ; or single ONEOF range |
c_nl | c-nl = comment / CRLF ; comment or newline |
c_wsp | c-wsp = WSP / (c-nl WSP) |
char_val | char-val = DQUOTE *(%x20-21 / %x23-7E) DQUOTE ; quoted string of SP and VCHAR ; without DQUOTE |
comment | comment = ";" *(WSP / VCHAR) CRLF |
concatenation | concatenation = repetition (1c-wsp repetition) |
dec_val | dec-val = "d" 1DIGIT [ 1("." 1DIGIT) / ("-" 1DIGIT) ] |
defined_as | defined-as = *c-wsp ("=" / "=/") *c-wsp ; basic rules definition and ; incremental alternatives |
element | element = rulename / group / option / char-val / num-val / prose-val |
elements | Errata ID: 2968 elements = alternation *WSP |
group | group = "(" *c-wsp alternation *c-wsp ")" |
hex_val | hex-val = "x" 1HEXDIG [ 1("." 1HEXDIG) / ("-" 1HEXDIG) ] |
num_val | num-val = "%" (bin-val / dec-val / hex-val) |
option | option = "[" *c-wsp alternation *c-wsp "]" |
prose_val | prose-val = "<" *(%x20-3D / %x3F-7E) ">" ; bracketed string of SP and VCHAR without angles ; prose description, to be used as last resort |
repeat | repeat = 1*DIGIT / (DIGIT "" *DIGIT) |
repetition | repetition = repeat element |
rule | rule = rulename defined-as elements c-nl ; continues if next line starts ; with white space |
rulelist | Errata ID: 3076 rulelist = 1*( rule / (*WSP c-nl) ) |
rulename | rulename = ALPHA *(ALPHA / DIGIT / "-") |