
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.hdl
    ~~~~~~~~~~~~~~~~~~~

    Lexers for hardware descriptor languages.

    :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
iN(   t
   RegexLexert   bygroupst   includet   usingt   thist   words(	   t   Textt   Commentt   Operatort   Keywordt   Namet   Stringt   Numbert   Punctuationt   Errort   VerilogLexert   SystemVerilogLexert	   VhdlLexerc           B   s  e  Z d  Z d Z d d g Z d g Z d g Z d Z i d e j	 d f d e
 f d	 e
 f d
 e
 f d e j f d e j f d e f d e d f d e j f d e j f d e j f d e j f d e j f d e j f d e j f d e f d e j f d e f d e f d e f d e j f d e e
 e j e
  f d e e
 e j e
  d f e dd d e f e dd d d d e j	 f e dd d d d e j f e dd d e j f d e j  f d e f g d 6d e d f d e j! f d e f d
 e f d e f g d 6d e j	 f d e j f d e j d f de j	 f de j	 f d e j	 d f g d 6de j d f g d 6Z" d  Z# RS(	  sZ   
    For verilog source code with preprocessor directives.

    .. versionadded:: 1.4
    t   verilogt   vs   *.vs   text/x-verilogs   (?:\s|//.*?\n|/[*].*?[*]/)+s   ^\s*`definet   macros   \ns   \s+s   \\\ns   /(\\\n)?/(\n|(.|\n)*?[^\\]\n)s   /(\\\n)?[*](.|\n)*?[*](\\\n)?/s   [{}#@]s   L?"t   strings4   L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'s%   (\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?s   (\d+\.\d*|\.\d+|\d+[fF])[fF]?s   ([0-9]+)|(\'h)[0-9a-fA-F]+s   ([0-9]+)|(\'b)[01]+s   ([0-9]+)|(\'d)[0-9]+s   ([0-9]+)|(\'o)[0-7]+s   \'[01xz]s   \d+[Ll]?s   \*/s   [~!%^&*+=|?:<>/-]s   [()\[\],.;\']s   `[a-zA-Z_]\w*s   ^(\s*)(package)(\s+)s   ^(\s*)(import)(\s+)t   importt   alwayst   always_combt	   always_fft   always_latcht   andt   assignt	   automatict   begint   breakt   buft   bufif0t   bufif1t   caset   casext   casezt   cmost   constt   continuet   deassignt   defaultt   defparamt   disablet   dot   edget   elset   endt   endcaset   endfunctiont   endgeneratet	   endmodulet
   endpackaget   endprimitivet
   endspecifyt   endtablet   endtaskt   enumt   eventt   finalt   fort   forcet   forevert   forkt   functiont   generatet   genvart   highz0t   highz1t   ift   initialt   inoutt   inputt   integert   joint   larget
   localparamt   macromodulet   mediumt   modulet   nandt   negedget   nmost   nort   nott   notif0t   notif1t   ort   outputt   packedt	   parametert   pmost   posedget	   primitivet   pull0t   pull1t   pulldownt   pullupt   rcmost   reft   releaset   repeatt   returnt   rnmost   rpmost   rtrant   rtranif0t   rtranif1t   scalaredt   signedt   smallt   specifyt	   specparamt   strengtht   strong0t   strong1t   structt   tablet   taskt   trant   tranif0t   tranif1t   typet   typedeft   unsignedt   vart   vectoredt   voidt   waitt   weak0t   weak1t   whilet   xnort   xort   suffixs   \bt
   acceleratet   autoexpand_vectornetst
   celldefinet   default_nettypet   elsift   endcelldefinet   endift
   endprotectt   endprotectedt   expand_vectornetst   ifdeft   ifndefR   t   noacceleratet   noexpand_vectornetst   noremove_gatenamest   noremove_netnamest   nounconnected_drivet   protectt	   protectedt   remove_gatenamest   remove_netnamest   resetallt	   timescalet   unconnected_drivet   undeft   prefixt   `t   bitst
   bitstorealt   bitstoshortrealt   countdriverst   displayt   fcloset   fdisplayt   finisht   floort   fmonitort   fopent   fstrobet   fwritet
   getpatternt   historyt   incsavet   itort   keyt   listt   logt   monitort
   monitorofft	   monitoront   nokeyt   nologt   printtimescalet   randomt   readmembt   readmemht   realtimet
   realtobitst   resett   reset_countt   reset_valuet   restartt   rtoit   savet   scalet   scopet   shortrealtobitst
   showscopest   showvariablest   showvarst	   sreadmembt	   sreadmemht   stimet   stopt   strobet   timet
   timeformatt   writes   \$t   bytet   shortintt   intt   longintt   bitt   logict   regt   supply0t   supply1t   trit   triandt   triort   tri0t   tri1t   triregt   uwiret   wiret   wandt   woshortrealt   reals   [a-zA-Z_]\w*:(?!:)s   \$?[a-zA-Z_]\w*t   roott   "s   #pops/   \\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})s	   [^\\"\n]+s   \\s   [^/\n]+s   /[*](.|\n)*?[*]/s   //.*?\nt   /s	   (?<=\\)\ns	   [\w:]+\*?c         c   s_   xX t  j |  |  D]D \ } } } | t k rI | j   rI t j } qI n  | | | f Vq Wd  S(   N(   R    t   get_tokens_unprocessedR
   t   isuppert   Constant(   t   selft   textt   indext   tokent   value(    (    s2   lib/python2.7/site-packages/pygments/lexers/hdl.pyR      s    (q   R   R   R   R   R   R   R   R   R   R    R!   R"   R#   R$   R%   R&   R'   R(   R)   R*   R+   R,   R-   R.   R/   R0   R1   R2   R3   R4   R5   R6   R7   R8   R9   R:   R;   R<   R=   R>   R?   R@   RA   RB   RC   RD   RE   RF   RG   RH   RI   RJ   RK   RL   RM   RN   RO   RP   RQ   RR   RS   RT   RU   RV   RW   RX   RY   RZ   R[   R\   R]   R^   R_   R`   Ra   Rb   Rc   Rd   Re   Rf   Rg   Rh   Ri   Rj   Rk   Rl   Rm   Rn   Ro   Rp   Rq   Rr   R   Rs   Rt   Ru   Rv   Rw   Rx   Ry   Rz   R{   R|   R}   R~   R   R   R   R   R   R   R   R   (   R   R   R   R   R/   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   (4   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   RI   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   (   R   R   R   R   RJ   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   ($   t   __name__t
   __module__t   __doc__t   namet   aliasest	   filenamest	   mimetypest   _wsR   t   PreprocR   t   Singlet	   MultilineR   R   t   CharR   t   Floatt   Hext   Bint   Integert   OctR   R   R
   R   R   R	   t	   NamespaceR   t   Builtint   Typet   Labelt   Escapet   tokensR   (    (    (    s2   lib/python2.7/site-packages/pygments/lexers/hdl.pyR      s   										                      	       	   			c          B   s  e  Z d  Z d Z d d g Z d d g Z d g Z d Z i d e j	 d f d	 e
 e e j e  f d
 e
 e e j e  d f d e f d e f d e f d e j f d e j f d e f d e d f d e j f d e j f d e j f d e j f d e j f d e j f d e j f d e f d e j f d e f d e f d e f d  e j f e ddde f e ddde j	 f e ddde j f dwe
 e e  dxf e ddde j f dze j  f d{e f g d|6d}e j! d~f g dx6de d~f de j" f de f d e f de f g d 6de j	 f de j f de j d~f de j	 f de j	 f d e j	 d~f g d 6de j d~f g d 6Z# d  Z$ RS(  s   
    Extends verilog lexer to recognise all SystemVerilog keywords from IEEE
    1800-2009 standard.

    .. versionadded:: 1.5
    t   systemverilogt   svs   *.svs   *.svhs   text/x-systemverilogs   (?:\s|//.*?\n|/[*].*?[*]/)+s   ^\s*`defineR   s   ^(\s*)(package)(\s+)s   ^(\s*)(import)(\s+)R   s   \ns   \s+s   \\\ns   /(\\\n)?/(\n|(.|\n)*?[^\\]\n)s   /(\\\n)?[*](.|\n)*?[*](\\\n)?/s   [{}#@]s   L?"R   s4   L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'s%   (\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?s   (\d+\.\d*|\.\d+|\d+[fF])[fF]?s   ([0-9]+)|(\'h)[0-9a-fA-F]+s   ([0-9]+)|(\'b)[01]+s   ([0-9]+)|(\'d)[0-9]+s   ([0-9]+)|(\'o)[0-7]+s   \'[01xz]s   \d+[Ll]?s   \*/s   [~!%^&*+=|?:<>/-]s   [()\[\],.;\']s   `[a-zA-Z_]\w*t	   accept_ont   aliasR   R   R   R   R   t   assertR   t   assumeR   t   beforeR   t   bindt   binst   binsofR   R   R    R!   R"   R   R#   R$   R%   t   cellt   chandlet   checkert   classt   clockingR&   t   configR'   t
   constraintt   contextR(   t   covert
   covergroupt
   coverpointt   crossR)   R*   R+   t   designR,   t   distR-   R.   R/   R0   R1   t
   endcheckert   endclasst   endclockingt	   endconfigR2   R3   t   endgroupt   endinterfaceR4   R5   R6   t
   endprogramt   endpropertyt   endsequenceR7   R8   R9   R:   R;   t
   eventuallyt   expectt   exportt   extendst   externR<   t   first_matchR=   R>   t   foreachR?   R@   t   forkjoinRA   RB   RC   t   globalRD   RE   RF   t   ifft   ifnonet   ignore_binst   illegal_binst   impliest   incdirR   RG   RH   RI   t   insidet   instanceR   RJ   t	   interfacet	   intersectRK   t   join_anyt	   join_noneRL   t   lett   liblistt   libraryt   localRM   R   R   RN   t   matchesRO   t   modportRP   RQ   RR   t   newt   nexttimeRS   RT   t   noshowcancelledRU   RV   RW   t   nullRX   RY   t   packageRZ   R[   R\   R]   R^   t   priorityt   programt   propertyR   R_   R`   Ra   Rb   t   pulsestyle_ondetectt   pulsestyle_oneventt   puret   randt   randct   randcaset   randsequenceRc   R   R   Rd   R   t	   reject_onRe   Rf   t   restrictRg   Rh   Ri   Rj   Rk   Rl   t   s_alwayst   s_eventuallyt
   s_nexttimet   s_untilt   s_until_withRm   t   sequenceR   t	   shortrealt   showcancelledRn   Ro   t   solveRp   Rq   t   statict   strongRs   Rt   Ru   t   superR   R   t   sync_accept_ont   sync_reject_onRv   t   taggedRw   R   t
   throughoutR   t   timeprecisiont   timeunitRx   Ry   Rz   R   R   R   R   R   R   R{   R|   t   uniont   uniquet   unique0R}   t   untilt
   until_witht   untypedt   useR   R~   R   t   virtualR   R   t
   wait_orderR   t   weakR   R   R   t   wildcardR   t   witht   withint   worR   R   R   s   \bs	   `__FILE__s	   `__LINE__s   `begin_keywordss   `celldefines   `default_nettypes   `defines   `elses   `elsifs   `end_keywordss   `endcelldefines   `endifs   `ifdefs   `ifndefs   `includes   `lines   `nounconnected_drives   `pragmas	   `resetalls
   `timescales   `unconnected_drives   `undefs   `undefinealls   $displays	   $displaybs	   $displayhs	   $displayos   $dumpalls	   $dumpfiles
   $dumpflushs
   $dumplimits   $dumpoffs   $dumpons
   $dumpportss   $dumpportsalls   $dumpportsflushs   $dumpportslimits   $dumpportsoffs   $dumpportsons	   $dumpvarss   $fcloses	   $fdisplays
   $fdisplaybs
   $fdisplayhs
   $fdisplayos   $feofs   $ferrors   $fflushs   $fgetcs   $fgetss   $finishs	   $fmonitors
   $fmonitorbs
   $fmonitorhs
   $fmonitoros   $fopens   $freads   $fscanfs   $fseeks   $fstrobes	   $fstrobebs	   $fstrobehs	   $fstrobeos   $ftells   $fwrites   $fwritebs   $fwritehs   $fwriteos   $monitors	   $monitorbs	   $monitorhs	   $monitoros   $monitoroffs
   $monitorons	   $plusargss   $randoms	   $readmembs	   $readmemhs   $rewinds   $sformats	   $sformatfs   $sscanfs   $strobes   $strobebs   $strobehs   $strobeos   $swrites   $swritebs   $swritehs   $swriteos   $tests   $ungetcs   $value$plusargss   $writes   $writebs   $writehs
   $writemembs
   $writememhs   $writeos   (class)(\s+)t	   classnameR   s   [a-zA-Z_]\w*:(?!:)s   \$?[a-zA-Z_]\w*R   s   [a-zA-Z_]\w*s   #popR   s/   \\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})s	   [^\\"\n]+s   \\s   [^/\n]+s   /[*](.|\n)*?[*]/s   //.*?\nR   s	   (?<=\\)\ns	   [\w:]+\*?c         c   s_   xX t  j |  |  D]D \ } } } | t k rI | j   rI t j } qI n  | | | f Vq Wd  S(   N(   R    R   R
   R   R   (   R   R   R   R   R   (    (    s2   lib/python2.7/site-packages/pygments/lexers/hdl.pyR     s    (   R  R  R   R   R   R   R   R  R   R  R   R  R   R  R  R  R   R   R    R!   R"   R   R#   R$   R%   R  R  R  R  R  R&   R  R'   R  R  R(   R  R  R   R!  R)   R*   R+   R"  R,   R#  R-   R.   R/   R0   R1   R$  R%  R&  R'  R2   R3   R(  R)  R4   R5   R6   R*  R+  R,  R7   R8   R9   R:   R;   R-  R.  R/  R0  R1  R<   R2  R=   R>   R3  R?   R@   R4  RA   RB   RC   R5  RD   RE   RF   R6  R7  R8  R9  R:  R   R;  R   RG   RH   RI   R<  R=  R   RJ   R>  R?  RK   R@  RA  RL   RB  RC  RD  RE  RM   R   R   RN   RF  RO   RG  RP   RQ   RR   RH  RI  RS   RT   RJ  RU   RV   RW   RK  RX   RY   RL  RZ   R[   R\   R]   R^   RM  RN  RO  R   R_   R`   Ra   Rb   RP  RQ  RR  RS  RT  RU  RV  Rc   R   R   Rd   R   RW  Re   Rf   RX  Rg   Rh   Ri   Rj   Rk   Rl   RY  RZ  R[  R\  R]  Rm   R^  R   R_  R`  Rn   Ro   Ra  Rp   Rq   Rb  R   Rc  Rs   Rt   Ru   Rd  R   R   Re  Rf  Rv   Rg  Rw   R   Rh  R   Ri  Rj  Rx   Ry   Rz   R   R   R   R   R   R   R{   R|   Rk  Rl  Rm  R}   Rn  Ro  Rp  Rq  R   R~   R   Rr  R   R   Rs  R   Rt  R   R   R   Ru  R   Rv  Rw  Rx  R   R   (   s	   `__FILE__s	   `__LINE__s   `begin_keywordss   `celldefines   `default_nettypes   `defines   `elses   `elsifs   `end_keywordss   `endcelldefines   `endifs   `ifdefs   `ifndefs   `includes   `lines   `nounconnected_drives   `pragmas	   `resetalls
   `timescales   `unconnected_drives   `undefs   `undefineall(L   s   $displays	   $displaybs	   $displayhs	   $displayos   $dumpalls	   $dumpfiles
   $dumpflushs
   $dumplimits   $dumpoffs   $dumpons
   $dumpportss   $dumpportsalls   $dumpportsflushs   $dumpportslimits   $dumpportsoffs   $dumpportsons	   $dumpvarss   $fcloses	   $fdisplays
   $fdisplaybs
   $fdisplayhs
   $fdisplayos   $feofs   $ferrors   $fflushs   $fgetcs   $fgetss   $finishs	   $fmonitors
   $fmonitorbs
   $fmonitorhs
   $fmonitoros   $fopens   $freads   $fscanfs   $fseeks   $fstrobes	   $fstrobebs	   $fstrobehs	   $fstrobeos   $ftells   $fwrites   $fwritebs   $fwritehs   $fwriteos   $monitors	   $monitorbs	   $monitorhs	   $monitoros   $monitoroffs
   $monitorons	   $plusargss   $randoms	   $readmembs	   $readmemhs   $rewinds   $sformats	   $sformatfs   $sscanfs   $strobes   $strobebs   $strobehs   $strobeos   $swrites   $swritebs   $swritehs   $swriteos   $tests   $ungetcs   $value$plusargss   $writes   $writebs   $writehs
   $writemembs
   $writememhs   $writeo(   R   R   R   R   RJ   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   (%   R   R   R   R   R   R   R   R   R   R   R   R   R	   R  R   R   R   R   R   R   R  R  R  R  R  R   R   R
   R   R   R  R  R	  t   ClassR
  R  R   (    (    (    s2   lib/python2.7/site-packages/pygments/lexers/hdl.pyR      s   									                                  	             	   			c        a   B   s  e  Z d  Z d Z d g Z d d g Z d g Z e j e j	 BZ
 i d e f d e f d e f d e j f d	 e j f d
 e f d e j f d e f d e f d e e e e j  f d e e e e  f d e e e e j e  f d e e e e j  f d e e j e j  f e d d d e j f d e e e e j  f d e e e e j e e e e j e e 	 f d e e j e e e  f d e e e  e  d f e d  e d  e d  d  e f g d! 6e d  d  e j f d" e f d# e d$ f g d 6e d d d e j f g d 6e d d d e f g d 6d e j f d e j f d e j f d e j  f d e j! f d e j" f g d 6Z# RS(   s:   
    For VHDL source code.

    .. versionadded:: 1.5
    t   vhdls   *.vhdls   *.vhds   text/x-vhdls   \ns   \s+s   \\\ns   --.*?$s   '(U|X|0|1|Z|W|L|H|-)'s   [~!%^&*+=|?:<>/-]s
   '[a-z_]\w*s   [()\[\],.;\']s   "[^\n\\"]*"s   (library)(\s+)([a-z_]\w*)s   (use)(\s+)(entity)s   (use)(\s+)([a-z_][\w.]*\.)(all)s   (use)(\s+)([a-z_][\w.]*)s   (std|ieee)(\.[a-z_]\w*)t   stdt   ieeet   workR   s   \bs"   (entity|component)(\s+)([a-z_]\w*)sN   (architecture|configuration)(\s+)([a-z_]\w*)(\s+)(of)(\s+)([a-z_]\w*)(\s+)(is)s    ([a-z_]\w*)(:)(\s+)(process|for)s
   (end)(\s+)t   endblockt   typest   keywordst   numberss	   [a-z_]\w*R   s   (\s+)t   ;s   #popt   booleanR   t	   charactert   severity_levelRJ   R   t   delay_lengtht   naturalt   positiveR   t
   bit_vectort   file_open_kindt   file_open_statust
   std_ulogict   std_ulogic_vectort	   std_logict   std_logic_vectorRn   R}   t   abst   accesst   afterR  t   allR   t   architecturet   arrayR  t	   attributeR   t   blockt   bodyt   buffert   busR#   t	   componentt   configurationt   constantt
   disconnectt   downtoR/   R   R0   t   entityt   exitt   fileR=   RA   RB   t   generict   groupt   guardedRF   t   impuret   int   inertialRH   t   ist   labelRD  t   linkaget   literalt   loopt   mapt   modRQ   RH  t   nextRT   RU   RK  t   oft   ont   openRX   t   otherst   outRL  t   portt	   postponedt	   proceduret   processRR  t   ranget   recordt   registert   rejectt   remRg   t   rolt   rort   selectt   severityt   signalt   sharedt   slat   sllt   srat   srlt   subtypet   thent   tot	   transportR{   t   unitsRn  Rq  t   variableR   t   whenR   Rv  R   R   s   \d{1,2}#[0-9a-f_]+#?s   \d+s   (\d+\.\d*|\.\d+|\d+)E[+-]?\d+s   X"[0-9a-f_]+"s
   O"[0-7_]+"s	   B"[01_]+"(   R|  R}  R~  (   R  R   R  R  RJ   R   R  R  R  R   R  R  R  R  R  R  R  Rn   R}   (_   R  R  R  R  R  R   R  R  R  R  R   R  R  R  R  R#   R  R  R  R  R  R/   R   R0   R  R  R  R=   RA   RB   R  R  R  RF   R  R  R  RH   R  R  RD  R  R  R  R  R  RQ   RH  R  RT   RU   RK  R  R  R  RX   R  R  RL  R  R  R  R  RR  R  R  R  R  R  Rg   R  R  R  R  R  R  R  R  R  R  R  R  R  R  R{   R  Rn  Rq  R  R   R  R   Rv  R   R   ($   R   R   R   R   R   R   R   t   ret	   MULTILINEt
   IGNORECASEt   flagsR   R   R   R   R   R   R
   t	   AttributeR   R   R	   R  R   Rz  R   R   R   R  R   R  R  R  R  R  R  (    (    (    s2   lib/python2.7/site-packages/pygments/lexers/hdl.pyR   !  s   														                  (   R   R  t   pygments.lexerR    R   R   R   R   R   t   pygments.tokenR   R   R   R	   R
   R   R   R   R   t   __all__R   R   R   (    (    (    s2   lib/python2.7/site-packages/pygments/lexers/hdl.pyt   <module>
   s   .@{