diff options
| author | hhsprings <xwhhsprings@gmail.com> | 2015-11-05 14:50:08 +0900 |
|---|---|---|
| committer | hhsprings <xwhhsprings@gmail.com> | 2015-11-05 14:50:08 +0900 |
| commit | a52ee9df900b5a77ffbfa9ef15cdf20461979957 (patch) | |
| tree | 11fe5baba9e1eea808d11dd86533dd79d9ae4129 /tests/examplefiles/abnf_example2.abnf | |
| parent | 39b04c956deca69ff5befcfdcc76c5212f65d972 (diff) | |
| download | pygments-a52ee9df900b5a77ffbfa9ef15cdf20461979957.tar.gz | |
Add the lexer for IETF 7405 ABNF <http://www.ietf.org/rfc/rfc7405.txt>.
Diffstat (limited to 'tests/examplefiles/abnf_example2.abnf')
| -rw-r--r-- | tests/examplefiles/abnf_example2.abnf | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/examplefiles/abnf_example2.abnf b/tests/examplefiles/abnf_example2.abnf new file mode 100644 index 00000000..77c79cb4 --- /dev/null +++ b/tests/examplefiles/abnf_example2.abnf @@ -0,0 +1,58 @@ + rulelist = 1*( rule / (*c-wsp c-nl) ) + + rule = rulename defined-as elements c-nl + ; continues if next line starts + ; with white space + + rulename = ALPHA *(ALPHA / DIGIT / "-") + defined-as = *c-wsp ("=" / "=/") *c-wsp + ; basic rules definition and + ; incremental alternatives + + elements = alternation *c-wsp + + c-wsp = WSP / (c-nl WSP) + + c-nl = comment / CRLF + ; comment or newline + + comment = ";" *(WSP / VCHAR) CRLF + + alternation = concatenation + *(*c-wsp "/" *c-wsp concatenation) + + concatenation = repetition *(1*c-wsp repetition) + + repetition = [repeat] element + + repeat = 1*DIGIT / (*DIGIT "*" *DIGIT) + + element = rulename / group / option / + char-val / num-val / prose-val + + group = "(" *c-wsp alternation *c-wsp ")" + + option = "[" *c-wsp alternation *c-wsp "]" + + char-val = DQUOTE *(%x20-21 / %x23-7E) DQUOTE + ; quoted string of SP and VCHAR + ; without DQUOTE + + num-val = "%" (bin-val / dec-val / hex-val) + + bin-val = "b" 1*BIT + [ 1*("." 1*BIT) / ("-" 1*BIT) ] + ; series of concatenated bit values + ; or single ONEOF range + + dec-val = "d" 1*DIGIT + [ 1*("." 1*DIGIT) / ("-" 1*DIGIT) ] + + hex-val = "x" 1*HEXDIG + [ 1*("." 1*HEXDIG) / ("-" 1*HEXDIG) ] + + prose-val = "<" *(%x20-3D / %x3F-7E) ">" + ; bracketed string of SP and VCHAR + ; without angles + ; prose description, to be used as + ; last resort |
