
    ,                         S r SSKJrJrJrJrJrJr  SSKJ	r	J
r
JrJrJrJrJrJrJrJr  / SQr " S S\5      r " S S\5      r " S	 S
\5      r " S S\5      rg)z
pygments.lexers.grammar_notation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lexers for grammar notations like BNF.

:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
    )
RegexLexerbygroupsincludethisusingwords)
CommentKeywordLiteralNameNumberOperatorPunctuationStringText
Whitespace)BnfLexer	AbnfLexer	JsgfLexerPegLexerc                   r    \ rS rSrSrSrS/rS/rS/rSS\	" \
\R                  \
5      4S	\4S
\4S\4/0rSrg)r      a  
This lexer is for grammar notations which are similar to
original BNF.

In order to maximize a number of targets of this lexer,
let's decide some designs:

* We don't distinguish `Terminal Symbol`.

* We do assume that `NonTerminal Symbol` are always enclosed
  with arrow brackets.

* We do assume that `NonTerminal Symbol` may include
  any printable characters except arrow brackets and ASCII 0x20.
  This assumption is for `RBNF <http://www.rfc-base.org/txt/rfc-5511.txt>`_.

* We do assume that target notation doesn't support comment.

* We don't distinguish any operators and punctuation except
  `::=`.

Though these decision making might cause too minimal highlighting
and you might be disappointed, but it is reasonable for us.

.. versionadded:: 2.1
BNFbnfz*.bnfz
text/x-bnfrootz(<)([ -;=?-~]+)(>)z::=z[^<>:]+. N)__name__
__module____qualname____firstlineno____doc__namealiases	filenames	mimetypesr   r   r   Classr   r   tokens__static_attributes__r       3lib/third_party/pygments/lexers/grammar_notation.pyr   r      sg    6 DgG	II 	"k4::{;= X 4L

Fr*   r   c                       \ rS rSrSrSrSrS/rS/rS/r	Sr
S	S
\R                  4S\4S\4S\4S\4S\4S\4S\4S\4S\4S\4S\4\" \
SS9\4S\R$                  4S\4S\4S\4S\4/0rSrg)r   B   zu
Lexer for IETF 7405 ABNF.

(Updates `5234 <http://www.ietf.org/rfc/rfc5234.txt>`_) grammars.

.. versionadded:: 2.1
ABNFz#http://www.ietf.org/rfc/rfc7405.txtabnfz*.abnfztext/x-abnf)ALPHABITCHARCRCRLFCTLDIGITDQUOTEHEXDIGHTABLFLWSPOCTETSPVCHARWSPr   z;.*$z(%[si])?"[^"]*"z%b[01]+\-[01]+\bz%b[01]+(\.[01]+)*\bz%d[0-9]+\-[0-9]+\bz%d[0-9]+(\.[0-9]+)*\bz%x[0-9a-fA-F]+\-[0-9a-fA-F]+\bz!%x[0-9a-fA-F]+(\.[0-9a-fA-F]+)*\bz\b[0-9]+\*[0-9]+z
\b[0-9]+\*z\b[0-9]+\*\bsuffixz[a-zA-Z][a-zA-Z0-9-]*\bz(=/|=|/)z[\[\]()]\s+r   r   N)r   r   r    r!   r"   r#   urlr$   r%   r&   _core_rulesr	   Singler   r   r   r
   r   r'   r   r   r   r(   r)   r   r*   r+   r   r   B   s     D
/ChG
IIK 	gnn%  ) !'*#W- #G,%w/ /817; !(+H%(#H ;u-w7 (4 (# +& Z 4LS*
,Fr*   r   c                      \ rS rSrSrSrSrS/rS/r/ SQr	\
" S5      \
" S	5      /S
\R                  S4S\R                  4S\R                  4/S\R                  4S\4S\4S\4S\R&                  4S\R*                  S4S\R,                  S4\" SSS9\R2                  4S\R2                  S4S\" \\R8                  \5      4S\S4S\4/S\R*                  S 4S!\R<                  4S"\R*                  4/S#\R,                  S 4S!\R<                  4S$\R,                  4/S\S 4S\4S%\4S&\R>                  4/S'\S 4S(\4S\4S)\" \R>                  \\5      4S*\R@                  4/S+\R                  S 4S,\" \\R                  \\RB                  \\"" \#S-S.95      4S/\" \R                  \RB                  5      4S0\R                  4/S1\" \\R                  5      4\
" S	5      S2\R                  4/S3.	r$S4r%g5)6r      z=
For JSpeech Grammar Format grammars.

.. versionadded:: 2.2
JSGFzhttps://www.w3.org/TR/jsgf/jsgfz*.jsgf)zapplication/jsgfzapplication/x-jsgfz	text/jsgfcommentsnon-commentsz
/\*\*(?!/)documentation commentz/\*[\w\W]*?\*/z//.*$z\A#JSGF[^;]*rD   ;z[=|()\[\]*+]z/[^/]+/"stringz\{tag)importpublicrA   rB   z	grammar\bgrammar namez(<)(NULL|VOID)(>)<rulenamez\w+|[^\s;=|()\[\]*+/"{<\w]+z#popz\\.z[^\\"]+z\}z[^\\}]+\.z[^;\s.]+>r@   z([^.>]+)(\s*)(\.)z[^.>]+z\*/zH^(\s*)(\*?)(\s*)(@(?:example|see))(\s+)([\w\W]*?(?=(?:^\s*\*?\s*@|\*/)))example)statez(^\s*\*?\s*)(@\S*)z[^*\n@]+|\w|\Wz(\n\s*)(\*)r   )	r   rL   rM   rQ   rR   rU   rW   rN   rZ   r   N)&r   r   r    r!   r"   r#   rE   r$   r%   r&   r   r	   	MultilinerG   Preprocr   r   r   r   Floatr   DoubleOtherr   r
   Reservedr   r   Builtinr   Escape	NamespaceConstantSpecialr   r   r(   r)   r   r*   r+   r   r      s   
 D
'ChG
IGI JN#

 G--/FG 1 12w~~&
 goo.Z ;h'&6==(+FLL%('68H8HI7++^<!k4<<=?;
++T2
  6==&)V]]#'
 FLL&)V]]#&
 ;'Z K $..)	
 ;'K Z !8DNND+#NO&
 W&&/2j'"3"3Z %I">@A #g''9; 1 12	"
 Xj'2C2CDEN#7$$%
u?Fr*   r   c                       \ rS rSrSrSrSrS/rS/rS/r	SS	\
R                  4S
\4S\4S\4S\" \\\5      4S\R"                  4S\R                  4S\R&                  4S\4/	0rSrg)r      u  
This lexer is for Parsing Expression Grammars (PEG).

Various implementations of PEG have made different decisions
regarding the syntax, so let's try to be accommodating:

* `<-`, `←`, `:`, and `=` are all accepted as rule operators.

* Both `|` and `/` are choice operators.

* `^`, `↑`, and `~` are cut operators.

* A single `a-z` character immediately before a string, or
  multiple `a-z` characters following a string, are part of the
  string (e.g., `r"..."` or `"..."ilmsuxa`).

.. versionadded:: 2.6
PEGz#https://bford.info/pub/lang/peg.pdfpegz*.pegz
text/x-pegr   z#.*$u   <-|[←:=/|&!?*+^↑~]z[()]rX   z (\[)([^\]]*(?:\\.[^\]\\]*)*)(\])z$[a-z]?"[^"\\]*(?:\\.[^"\\]*)*"[a-z]*z$[a-z]?'[^'\\]*(?:\\.[^'\\]*)*'[a-z]*u#   [^\s<←:=/|&!?*+\^↑~()\[\]"\'#]+r   r   N)r   r   r    r!   r"   r#   rE   r$   r%   r&   r	   rG   r   r   r
   r   r   r_   r   r'   r   r(   r)   r   r*   r+   r   r      s    & D
/CgG	II 	gnn% '1 k" G 1k6;79 5fmmD4fmmD 4TZZ@ 4L3
Fr*   r   N)r"   pygments.lexerr   r   r   r   r   r   pygments.tokenr	   r
   r   r   r   r   r   r   r   r   __all__r   r   r   r   r   r*   r+   <module>rn      s`    M L4 4 4 =-z -`@
 @FK
 K\6z 6r*   