Grammar Documentation
Grammar Reference
abnf_grammar
entry pointGrammar definition
abnf_grammar
: rule_def* EOF
;Railroad diagram
References
rule_def
rule = rulename defined-as elements c-nl
Grammar definition
rule_def
: rule_name defined_as alternation c_nl
;Railroad diagram
Referenced by
References
rule_name
rulename = ALPHA *(ALPHA / DIGIT / "-")
Grammar definition
rule_name
: RULENAME
;Railroad diagram
Referenced by
defined_as
defined-as = *c-wsp ("=" / "=/") *c-wsp
Grammar definition
defined_as
: EQUALS
| INCREMENTAL_ALT
;Railroad diagram
Referenced by
alternation
alternation = concatenation *(*c-wsp "/" *c-wsp concatenation)
Grammar definition
alternation
: concatenation (SLASH concatenation)*
;Railroad diagram
Referenced by
References
concatenation
concatenation = repetition *(1*c-wsp repetition)
Grammar definition
concatenation
: repetition+
;Railroad diagram
Referenced by
References
repetition
repetition = [repeat] element
Grammar definition
repetition
: repeat? element
;Railroad diagram
Referenced by
References
repeat
repeat = 1*DIGIT / (*DIGIT "*" *DIGIT)
Grammar definition
repeat
: n = DIGIT_VAL ASTERISK m = DIGIT_VAL // n*m — between n and m
| n = DIGIT_VAL ASTERISK // n* — n or more
| ASTERISK m = DIGIT_VAL // *m — up to m
| ASTERISK // * — zero or more
| n = DIGIT_VAL // n — exactly n
;Railroad diagram
Referenced by
element
element = rulename / group / option / char-val / num-val / prose-val
Grammar definition
element
: rule_name
| group
| option
| char_val
| num_val
| PROSE_VAL
;Railroad diagram
Referenced by
References
group
group = "(" *c-wsp alternation *c-wsp ")"
Grammar definition
group
: LPAREN alternation RPAREN
;Railroad diagram
Referenced by
References
option
option = "[" *c-wsp alternation *c-wsp "]"
Grammar definition
option
: LBRACKET alternation RBRACKET
;Railroad diagram
Referenced by
References
char_val
char-val = case-insensitive-string / case-sensitive-string case-insensitive-string = [ "%i" ] quoted-string case-sensitive-string = "%s" quoted-string (RFC 7405)
Grammar definition
char_val
: CASE_SENSITIVE_STRING
| CASE_INSENSITIVE_STRING
| QUOTED_STRING
;Railroad diagram
Referenced by
num_val
num-val = "%" (bin-val / dec-val / hex-val)
Grammar definition
num_val
: BIN_VAL
| DEC_VAL
| HEX_VAL
;Railroad diagram
Referenced by
c_nl
c-nl = comment / CRLF / LF
Grammar definition
c_nl
: CRLF
| LF
| EOF
;Railroad diagram
Referenced by