
-P_Tc           @   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-2014 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(    (    s7   /usr/lib/python2.7/dist-packages/pygments/lexers/hdl.pyR      s    (q   s   alwaysR   R   R   R   R   R   R   R   R    R!   R"   R#   R$   R%   R&   R'   R(   R)   s   defaultR+   R,   R-   R.   s   elses   endR1   R2   R3   R4   R5   R6   R7   R8   R9   R:   R;   s   finalR=   R>   R?   s   forkRA   RB   RC   RD   RE   RF   RG   RH   s   inputRJ   s   joinRL   RM   RN   RO   s   moduleRQ   RR   RS   RT   RU   RV   RW   s   ors   outputRZ   R[   R\   R]   R^   R_   R`   Ra   Rb   Rc   s   refs   releases   repeatRg   Rh   Ri   Rj   Rk   Rl   Rm   Rn   Ro   Rp   Rq   Rr   s   stringRs   Rt   Ru   s   tableRw   Rx   Ry   Rz   s   typeR|   R}   s   varR   s   voids   waitR   R   R   R   R   (   R   R   R   R   s   elseR   R   R   R   R   R   R   R   s   includeR   R   R   R   R   R   R   R   R   R   R   R   R   (4   s   bitsR   R   R   R   R   R   R   R   R   R   R   R   R   R   R   s   inputR   s   keys   lists   logR   R   R   R   R   R   R   R   R   R   R   s   resetR   R   R   R   R   R   R   R   R   R   R   R   R   R   s   stopR   R   R   s   write(   R   R   s   intR   RJ   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   s   realR   ($   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   (    (    (    s7   /usr/lib/python2.7/dist-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   #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   (    (    s7   /usr/lib/python2.7/dist-packages/pygments/lexers/hdl.pyR     s    (   R  s   aliass   alwayss   always_combs	   always_ffs   always_latchs   ands   asserts   assignR  s	   automaticR  s   beginR  R  R  s   bits   breaks   bufs   bufif0s   bufif1s   bytes   cases   casexs   casezR  R  R  R  R  s   cmosR  s   constR  R  s   continueR  R  R   R!  s   deassigns   defaults   defparamR"  s   disableR#  s   dos   edges   elses   ends   endcaseR$  R%  R&  R'  s   endfunctions   endgenerateR(  R)  s	   endmodules
   endpackages   endprimitiveR*  R+  R,  s
   endspecifys   endtables   endtasks   enums   eventR-  R.  R/  R0  R1  s   finalR2  s   fors   forceR3  s   forevers   forkR4  s   functions   generates   genvarR5  s   highz0s   highz1s   ifR6  R7  R8  R9  R:  s   importR;  s   includes   initials   inouts   inputR<  s   instances   ints   integerR>  R?  s   joinR@  RA  s   largeRB  RC  RD  RE  s
   localparams   logics   longints   macromoduleRF  s   mediumRG  s   modules   nands   negedges   newRI  s   nmoss   norRJ  s   nots   notif0s   notif1RK  s   ors   outputs   packages   packeds	   parameters   pmoss   posedges	   primitiveRM  RN  s   propertys	   protecteds   pull0s   pull1s   pulldowns   pullupRP  RQ  RR  RS  RT  RU  RV  s   rcmoss   reals   realtimes   refs   regRW  s   releases   repeatRX  s   returns   rnmoss   rpmoss   rtrans   rtranif0s   rtranif1RY  RZ  R[  R\  R]  s   scalaredR^  s   shortintR_  R`  s   signeds   smallRa  s   specifys	   specparamRb  s   stringRc  s   strong0s   strong1s   structs   supers   supply0s   supply1Re  Rf  s   tableRg  s   tasks   thisRh  s   timeRi  Rj  s   trans   tranif0s   tranif1s   tris   tri0s   tri1s   triands   triors   triregs   types   typedefs   unionRl  Rm  s   unsignedRn  Ro  Rp  Rq  s   uwires   vars   vectoredRr  s   voids   waitRs  s   wandRt  s   weak0s   weak1s   whileRu  s   wireRv  Rw  Rx  s   xnors   xor(   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(   s   bytes   shortints   ints   longints   integers   times   bits   logics   regs   supply0s   supply1s   tris   triands   triors   tri0s   tri1s   triregs   uwires   wires   wands   woshortreals   reals   realtime(%   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   (    (    (    s7   /usr/lib/python2.7/dist-packages/pygments/lexers/hdl.pyR      s   									                                  	             	   			c        `   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  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 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.]*)s"   (entity|component)(\s+)([a-z_]\w*)sN   (architecture|configuration)(\s+)([a-z_]\w*)(\s+)(of)(\s+)([a-z_]\w*)(\s+)(is)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_vectorR   s   \bt   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   rejectRg   t   rolt   rort   selectt   severityt   signalt   sharedt   slat   slit   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  s   bitR  R  s   integers   timeR  R  R  s   stringR  R  R  R  R  R  R  (^   s   abss   accesss   afters   aliass   alls   andR  s   arrays   assertR  s   begins   blockR  s   bufferR  s   caseR  R  R  R  R  s   elses   elsifs   endR  s   exits   files   fors   functions   generateR  s   groupR  s   ifR  s   inR  s   inoutR  R  s   libraryR  s   literalR  s   maps   mods   nands   news   nexts   nors   nots   nullR  R  s   opens   orR  s   outs   packageR  R  R  R  s   pures   ranges   records   registerR  s   returnR  R  R  R  s   signalR  R  R  R  R  s   subtypeR  R  R  s   typeR  s   untils   useR  s   waitR  s   whiles   withs   xnors   xor($   R   R   R   R   R   R   R   t   ret	   MULTILINEt
   IGNORECASEt   flagsR   R   R   R   R   R   R
   t	   AttributeR   R   R	   R  Rz  R   R   R   R   R  R   R  R  R  R  R  R  (    (    (    s7   /usr/lib/python2.7/dist-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   (    (    (    s7   /usr/lib/python2.7/dist-packages/pygments/lexers/hdl.pyt   <module>
   s   .@{