3
.ßL]¹  ã               @   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 dddg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 grammer notations like BNF.

    :copyright: Copyright 2006-2019 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ÚBnfLexerÚ	AbnfLexerÚ	JsgfLexerc               @   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 grammer 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
    ZBNFZbnfz*.bnfz
text/x-bnfÚrootz(<)([ -;=?-~]+)(>)z::=z[^<>:]+Ú.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesÚ	mimetypesr   r   r   ÚClassr   r   Útokens© r    r    úF/tmp/pip-install-5sebvq2j/pygments/pygments/lexers/grammar_notation.pyr      s   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
    ZABNFZ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]+z\*z\b)Úsuffixz[a-zA-Z][a-zA-Z0-9-]+\bz(=/|=|/)z[\[\]()]z\s+r   N)r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   )r   r   r   r   r   r   r   r   Z_core_rulesr   ÚSingler
   r   r   r	   r   r   r   r   r   r    r    r    r!   r   E   s6     c               @   s°  e Zd ZdZdZdgZdgZdddg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d6d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jej"e#e$d.d/�ƒfd0eejej"ƒfd1ejfgd2ejfed	ƒd3ejfgd4œ	Z%d5S )7r   zn
    For `JSpeech Grammar Format <https://www.w3.org/TR/jsgf/>`_
    grammars.

    .. versionadded:: 2.2
    ZJSGFZjsgfz*.jsgfzapplication/jsgfzapplication/x-jsgfz	text/jsgfÚcommentsznon-commentsz
/\*\*(?!/)zdocumentation commentz/\*[\w\W]*?\*/z//.*z\A#JSGF[^;]*z\s+ú;z[=|()\[\]*+]z/[^/]+/ú"Ústringz\{ÚtagÚimportÚpublicz\b)r2   z	grammar\bzgrammar namez(<)(NULL|VOID)(>)ú<Úrulenamez\w+|[^\s;=|()\[\]*+/"{<\w]+z#popz\\.z[^\\"]+z\}z[^\\}]+z\.z[^;\s.]+ú>z\*z([^.>]+)(\s*)(\.)z[^.>]+z\*/zB(^\s*\*?\s*)(@(?:example|see)\s+)([\w\W]*?(?=(?:^\s*\*?\s*@|\*/)))Úexample)Ústatez(^\s*\*?\s*)(@\S*)z[^*\n@]+|\w|\Wz\n\s*\*r   )	r   r4   znon-commentsr7   r8   zgrammar namer<   zdocumentation commentr>   N)r9   r:   )&r   r   r   r   r   r   r   r   ÚreÚ	MULTILINEÚUNICODEÚflagsr   r   Z	Multiliner3   ZPreprocr   r   r   r   ZFloatr   ÚDoubleZOtherr   r	   ZReservedr   r   ZBuiltinZEscapeÚ	NamespaceÚConstantÚSpecialr   r   r   r    r    r    r!   r   ˆ   sb   














)r   r@   Zpygments.lexerr   r   r   r   r   r   Zpygments.tokenr   r	   r
   r   r   r   r   r   r   Ú__all__r   r   r   r    r    r    r!   Ú<module>
   s    ,
0C