1 # -*- coding: utf-8 -*- |
1 # -*- coding: utf-8 -*- |
2 """ |
2 """ |
3 pygments.lexers.grammar_notation |
3 pygments.lexers.grammar_notation |
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
5 |
5 |
6 Lexers for grammer notations like BNF. |
6 Lexers for grammar notations like BNF. |
7 |
7 |
8 :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. |
8 :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. |
9 :license: BSD, see LICENSE for details. |
9 :license: BSD, see LICENSE for details. |
10 """ |
10 """ |
11 |
11 |
12 import re |
12 import re |
13 |
13 |
18 __all__ = ['BnfLexer', 'AbnfLexer', 'JsgfLexer', 'PegLexer'] |
18 __all__ = ['BnfLexer', 'AbnfLexer', 'JsgfLexer', 'PegLexer'] |
19 |
19 |
20 |
20 |
21 class BnfLexer(RegexLexer): |
21 class BnfLexer(RegexLexer): |
22 """ |
22 """ |
23 This lexer is for grammer notations which are similar to |
23 This lexer is for grammar notations which are similar to |
24 original BNF. |
24 original BNF. |
25 |
25 |
26 In order to maximize a number of targets of this lexer, |
26 In order to maximize a number of targets of this lexer, |
27 let's decide some designs: |
27 let's decide some designs: |
28 |
28 |