ó
xiù\c           @   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 d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ d e f d
 „  ƒ  YZ d S(   së   
    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.
iÿÿÿÿN(   t
   RegexLexert   bygroupst   includet   thist   usingt   words(	   t   Commentt   Keywordt   Literalt   Namet   Numbert   Operatort   Punctuationt   Stringt   Textt   BnfLexert	   AbnfLexert	   JsgfLexerc           B   so   e  Z d  Z d Z d g Z d g Z d g Z i d e e e	 j
 e ƒ f d e f d e f d e f g d	 6Z RS(
   s>  
    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
    t   BNFt   bnfs   *.bnfs
   text/x-bnfs   (<)([ -;=?-~]+)(>)s   ::=s   [^<>:]+t   .t   root(   t   __name__t
   __module__t   __doc__t   namet   aliasest	   filenamest	   mimetypesR   R   R	   t   ClassR   R   t   tokens(    (    (    s?   lib/python2.7/site-packages/pygments/lexers/grammar_notation.pyR      s   					c           B   sö   e  Z d  Z d Z d g Z d g Z d g Z d) Z i 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 d( 6Z RS(*   s´   
    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
    t   ABNFt   abnfs   *.abnfs   text/x-abnft   ALPHAt   BITt   CHARt   CRt   CRLFt   CTLt   DIGITt   DQUOTEt   HEXDIGt   HTABt   LFt   LWSPt   OCTETt   SPt   VCHARt   WSPs   ;.*$s   (%[si])?"[^"]*"s   %b[01]+\-[01]+\bs   %b[01]+(\.[01]+)*\bs   %d[0-9]+\-[0-9]+\bs   %d[0-9]+(\.[0-9]+)*\bs   %x[0-9a-fA-F]+\-[0-9a-fA-F]+\bs!   %x[0-9a-fA-F]+(\.[0-9a-fA-F]+)*\bs   \b[0-9]+\*[0-9]+s
   \b[0-9]+\*s   \b[0-9]+s   \*t   suffixs   \bs   [a-zA-Z][a-zA-Z0-9-]+\bs   (=/|=|/)s   [\[\]()]s   \s+R   R   (   R!   R"   R#   R$   R%   R&   R'   R(   R)   R*   R+   R,   R-   R.   R/   R0   (   R   R   R   R   R   R   R   t   _core_rulesR   t   SingleR   R   R   R   R	   R   R   R   R   (    (    (    s?   lib/python2.7/site-packages/pygments/lexers/grammar_notation.pyR   E   s6   			  														c           B   s  e  Z d  Z d Z d g Z d g Z d d d g Z e j e j	 BZ
 i	 e d ƒ e d ƒ g d	 6d
 e j d f d e j f d e j f g d 6d 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 d4 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 6d e j d! f d" e j f d# e j f g d 6d$ e j d! f d" e j f d% e j f g d 6d e d! f d e f d& e f d' e j f g d 6d( e d! f d) e f d e f d* e e j e e ƒ f d+ e j  f g d 6d, e j d! f d- e e j e j! e" e# d. d/ ƒƒ f d0 e e j e j! ƒ f d1 e j f g d 6d2 e j f e d ƒ d3 e j f g d/ 6Z$ RS(5   sn   
    For `JSpeech Grammar Format <https://www.w3.org/TR/jsgf/>`_
    grammars.

    .. versionadded:: 2.2
    t   JSGFt   jsgfs   *.jsgfs   application/jsgfs   application/x-jsgfs	   text/jsgft   commentss   non-commentsR   s
   /\*\*(?!/)s   documentation comments   /\*[\w\W]*?\*/s   //.*s   \A#JSGF[^;]*s   \s+t   ;s   [=|()\[\]*+]s   /[^/]+/t   "t   strings   \{t   tagt   importt   publicR1   s   \bs	   grammar\bs   grammar names   (<)(NULL|VOID)(>)t   <t   rulenames   \w+|[^\s;=|()\[\]*+/"{<\w]+s   #pops   \\.s   [^\\"]+s   \}s   [^\\}]+s   \.s   [^;\s.]+t   >s   \*s   ([^.>]+)(\s*)(\.)s   [^.>]+s   \*/sB   (^\s*\*?\s*)(@(?:example|see)\s+)([\w\W]*?(?=(?:^\s*\*?\s*@|\*/)))t   statet   examples   (^\s*\*?\s*)(@\S*)s   [^*\n@]+|\w|\Ws   \n\s*\*R   (   R;   R<   (%   R   R   R   R   R   R   R   t   ret	   MULTILINEt   UNICODEt   flagsR   R   t	   MultilineR3   t   PreprocR   R   R   R
   t   FloatR   t   Doublet   OtherR   R   t   ReservedR   R	   t   Builtint   Escapet	   Namespacet   Constantt   SpecialR   R   R   (    (    (    s?   lib/python2.7/site-packages/pygments/lexers/grammar_notation.pyR   ˆ   sd   											(   R   RB   t   pygments.lexerR    R   R   R   R   R   t   pygments.tokenR   R   R   R	   R
   R   R   R   R   t   __all__R   R   R   (    (    (    s?   lib/python2.7/site-packages/pygments/lexers/grammar_notation.pyt   <module>
   s   .@0C