
    Mhk                         d Z ddlmZmZmZmZmZmZ ddlm	Z	m
Z
mZmZmZmZmZmZmZmZ g dZ G d de          Z G d de          Z G d	 d
e          Z G d de          ZdS )z
    pygments.lexers.grammar_notation
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for grammar notations like BNF.

    :copyright: Copyright 2006-2025 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                   p    e Zd ZdZdZdgZdgZdgZdZdZ	dd	 e
eej        e          fd
efdefdefgiZdS )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.
    BNFbnfz*.bnfz
text/x-bnfz6https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form2.1rootz(<)([ -;=?-~]+)(>)z::=z[^<>:]+.N)__name__
__module____qualname____doc__namealiases	filenames	mimetypesurlversion_addedr   r   r   Classr   r   tokens     `/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pygments/lexers/grammar_notation.pyr   r      s         2 DgG	II
BCM 	"Xk4:{;;= X 4L

FFFr*   r   c                       e Zd ZdZdZdZdgZdgZdgZdZ	dZ
d	d
ej        fdefdefdefdefdefdefdefdefdefdefdef ee
d          efdej        fdefdefdefdefgiZdS )r   zj
    Lexer for IETF 7405 ABNF.

    (Updates `5234 <http://www.ietf.org/rfc/rfc5234.txt>`_) grammars.
    ABNFz#http://www.ietf.org/rfc/rfc7405.txtabnfz*.abnfztext/x-abnfr   )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   N)r   r   r   r    r!   r%   r"   r#   r$   r&   _core_rulesr	   Singler   r   r   r
   r   r'   r   r   r   r(   r)   r*   r+   r   r   B   s         D
/ChG
IIMK 	gn%  ) !'*#W- #G,%w/ /817; !(+H%(#H U;u---w7 (4 (# +& Z 4LS*
,FFFr*   r   c                      e Zd ZdZdZdZdgZdgZg dZdZ	 e
d           e
d	          gd
ej        dfdej        fdej        fgdej        fdefdefdefdej        fdej        dfdej        df edd          ej        fdej        dfd eeej        e          fdedfdefgdej        d fd!ej        fd"ej        fgd#ej        d fd!ej        fd$ej        fgded fdefd%efd&ej        fgd'ed fd(efdefd) eej        ee          fd*ej         fgd+ej        d fd, eeej        eej!        e e"e#d-.                    fd/ eej        ej!                  fd0ej        fgd1 eeej                  f e
d	          d2ej        fgd3	Z$d4S )5r   z.
    For JSpeech Grammar Format grammars.
    JSGFzhttps://www.w3.org/TR/jsgf/jsgfz*.jsgf)zapplication/jsgfzapplication/x-jsgfz	text/jsgfz2.2commentsnon-commentsz
/\*\*(?!/)documentation commentz/\*[\w\W]*?\*/z//.*$z\A#JSGF[^;]*rC   ;z[=|()\[\]*+]z/[^/]+/"stringz\{tag)importpublicr@   rA   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   rI   rJ   rN   rO   rR   rT   rK   rW   N)%r   r   r   r    r!   r%   r"   r#   r$   r&   r   r	   	MultilinerE   Preprocr   r   r   r   Floatr   DoubleOtherr   r
   Reservedr   r   Builtinr   Escape	NamespaceConstantSpecialr   r   r(   r)   r*   r+   r   r      s         D
'ChG
IGGGIM GJGN##

 G-/FG 12w~&
 go.Z ;h'&6=(+FL%(U'6668HI7+^<!Xk4<==?;
++T2
  6=&)V]#'
 FL&)V]#&
 ;'Z K $.)	
 ;'K Z !88DND+#N#NO&
 W&/2Xj'"3Z %%I">">">@ @A #Xg'99; 12	"
 XXj'2CDDEGN##7$%
u? ?FFFr*   r   c                       e Zd ZdZdZdZdgZdgZdgZdZ	dd	e
j        fd
efdefdefd eeee          fdej        fdej        fdej        fdefg	iZdS )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`).
    PEGz#https://bford.info/pub/lang/peg.pdfpegz*.pegz
text/x-pegz2.6r   z#.*$u   <-|[←:=/|&!?*+^↑~]z[()]rU   z (\[)([^\]]*(?:\\.[^\]\\]*)*)(\])z$[a-z]?"[^"\\]*(?:\\.[^"\\]*)*"[a-z]*z$[a-z]?'[^'\\]*(?:\\.[^'\\]*)*'[a-z]*u#   [^\s<←:=/|&!?*+\^↑~()\[\]"\'#]+r   N)r   r   r   r    r!   r%   r"   r#   r$   r&   r	   rE   r   r   r
   r   r   r\   r   r'   r   r(   r)   r*   r+   r   r      s         " D
/CgG	IIM 	gn% '1 k" G 1Xk6;779 5fmD4fmD 4TZ@ 4L3
FFFr*   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>rj      s    M L L L L L L L L L L L L L L L4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 =
<
<- - - - -z - - -`? ? ? ? ?
 ? ? ?DJ J J J J
 J J JZ5 5 5 5 5z 5 5 5 5 5r*   