o
    ‡ÎÖaV  ã                   @   s¨   d Z ddl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„ deƒZG dd	„ d	eƒZG d
d„ deƒZG dd„ deƒZdS )zë
    pygments.lexers.grammar_notation
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for grammar notations like BNF.

    :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    N)Ú
RegexLexerÚbygroupsÚincludeÚthisÚusingÚwords)
ÚCommentÚKeywordÚLiteralÚNameÚNumberÚOperatorÚPunctuationÚStringÚTextÚ
Whitespace)ÚBnfLexerÚ	AbnfLexerÚ	JsgfLexerÚPegLexerc                   @   sP   e Zd ZdZdZdgZdgZdg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 desision 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__Ú__doc__ÚnameÚaliasesÚ	filenamesÚ	mimetypesr   r   r   ÚClassr   r   Útokens© r$   r$   úB/usr/lib/python3/dist-packages/pygments/lexers/grammar_notation.pyr      s    ÿ÷ÿr   c                   @   sª   e 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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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   z´
    Lexer for `IETF 7405 ABNF
    <http://www.ietf.org/rfc/rfc7405.txt>`_
    (Updates `5234 <http://www.ietf.org/rfc/rfc5234.txt>`_)
    grammars.

    .. versionadded:: 2.1
    ÚABNFÚ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   N)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   D   s8    	×ÿr   c                   @   sº  e Zd ZdZdZdgZdgZg d¢Zej	ej
B 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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+d,�ƒfd-eejej#ƒfd.ejfgd/eeejƒfedƒd0ejfgd1œ	Z&d2S )3r   zn
    For `JSpeech Grammar Format <https://www.w3.org/TR/jsgf/>`_
    grammars.

    .. versionadded:: 2.2
    ÚJSGFÚjsgfz*.jsgf)zapplication/jsgfzapplication/x-jsgfz	text/jsgfÚcommentsúnon-commentsz
/\*\*(?!/)údocumentation commentz/\*[\w\W]*?\*/z//.*$z\A#JSGF[^;]*r<   ú;z[=|()\[\]*+]z/[^/]+/ú"Ústringz\{Útag)ÚimportÚpublicr9   r:   z	grammar\búgrammar namez(<)(NULL|VOID)(>)ú<Úrulenamez\w+|[^\s;=|()\[\]*+/"{<\w]+z#popz\\.z[^\\"]+z\}z[^\\}]+ú\.z[^;\s.]+ú>r8   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   rA   rB   rF   rG   rJ   rL   rC   rO   N)'r   r   r   r   r   r   r    r!   ÚreÚ	MULTILINEÚUNICODEÚflagsr   r   Ú	Multiliner>   ÚPreprocr   r   r   r   ÚFloatr   ÚDoubleÚOtherr   r	   ÚReservedr   r   ÚBuiltinr   ÚEscapeÚ	NamespaceÚConstantÚSpecialr   r   r#   r$   r$   r$   r%   r   ‡   s€    þ
ý


ÿó
ý
ýüû
ÿþÿøý
Ær   c                   @   st   e Zd ZdZdZdgZdgZdg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   uZ  
    This lexer is for `Parsing Expression Grammars
    <https://bford.info/pub/lang/peg.pdf>`_ (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
    ÚPEGÚpegz*.pegz
text/x-pegr   z#.*$u   <-|[â†�:=/|&!?*+^â†‘~]z[()]rM   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   r   r	   r   r   rX   r   r"   r   r#   r$   r$   r$   r%   r   ×   s(    
ÿçÿr   )r   rQ   Ú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$   r%   Ú<module>   s    
 00CP