3
V'ícøW ã @ s d Z ddlZddlmZmZmZmZmZmZ ddl m
Z
mZmZm
Z
mZmZmZmZmZ dddgZG dd deZG d d deZG d
d deZdS )zÔ
pygments.lexers.hdl
~~~~~~~~~~~~~~~~~~~
Lexers for hardware descriptor languages.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
é N)Ú
RegexLexerÚbygroupsÚincludeÚusingÚthisÚwords) ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚ
WhitespaceÚVerilogLexerÚSystemVerilogLexerÚ VhdlLexerc @ sÎ e Zd ZdZdZddgZdgZdgZdZde j
dfd efd
ee
jefde jfde jfd
efde
dfde
jfdejfdejfdejfdejfdejfdejfdefdejfdefdefdejfdeeejefdeeejedfedddefed d«dd¬e j
fed
dàdd¬ej fedddej!fdõej"fdöefd÷efgdøe
dùfdúe
jfdûe
fd
ee
jefdüe
fgdýe j
fdþe jfdÿe jdùfd e j
fde j
fdedùfgdejdùfgdZ#dd Z$dS ( r zZ
For verilog source code with preprocessor directives.
.. versionadded:: 1.4
ZverilogÚvz*.vztext/x-verilogz(?:\s|//.*?\n|/[*].*?[*]/)+z^\s*`defineÚmacroz\s+z(\\)(\n)z/(\\\n)?/(\n|(.|\n)*?[^\\]\n)z/(\\\n)?[*](.|\n)*?[*](\\\n)?/z[{}#@]zL?"Ústringz4L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'z%(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?z(\d+\.\d*|\.\d+|\d+[fF])[fF]?z([0-9]+)|(\'h)[0-9a-fA-F]+z([0-9]+)|(\'b)[01]+z([0-9]+)|(\'d)[0-9]+z([0-9]+)|(\'o)[0-7]+z\'[01xz]z\d+[Ll]?z[~!%^&*+=|?:<>/-]z
[()\[\],.;\']z
`[a-zA-Z_]\w*z^(\s*)(package)(\s+)z^(\s*)(import)(\s+)ÚimportÚalwaysÚalways_combÚ always_ffÚalways_latchÚandÚassignÚ automaticÚbeginÚbreakÚbufÚbufif0Úbufif1ÚcaseÚcasexÚcasezÚcmosÚconstÚcontinueÚdeassignÚdefaultÚdefparamÚdisableÚdoÚedgeÚelseÚendÚendcaseÚendfunctionÚendgenerateÚ endmoduleÚ
endpackageÚendprimitiveÚ
endspecifyÚendtableÚendtaskÚenumÚeventÚfinalÚforÚforceÚforeverÚforkÚfunctionÚgenerateÚgenvarÚhighz0Úhighz1ÚifÚinitialÚinoutÚinputÚintegerÚjoinÚlargeÚ
localparamÚmacromoduleÚmediumÚmoduleÚnandÚnegedgeÚnmosÚnorÚnotÚnotif0Únotif1ÚorÚoutputÚpackedÚ parameterÚpmosÚposedgeÚ primitiveÚpull0Úpull1ÚpulldownÚpullupÚrcmosÚrefÚreleaseÚrepeatÚreturnÚrnmosÚrpmosÚrtranÚrtranif0Úrtranif1ÚscalaredÚsignedÚsmallÚspecifyÚ specparamÚstrengthÚstrong0Ústrong1ÚstructÚtableÚtaskÚtranÚtranif0Útranif1ÚtypeÚtypedefÚunsignedÚvarÚvectoredÚvoidÚwaitÚweak0Úweak1ÚwhileÚxnorÚxorz\b)ÚsuffixÚ
accelerateÚautoexpand_vectornetsÚ
celldefineÚdefault_nettypeÚelsifÚ
endcelldefineÚendifÚ
endprotectÚendprotectedÚexpand_vectornetsÚifdefÚifndefr ÚnoaccelerateÚnoexpand_vectornetsÚnoremove_gatenamesÚnoremove_netnamesÚnounconnected_driveÚprotectÚ protectedÚremove_gatenamesÚremove_netnamesÚresetallÚ timescaleÚunconnected_driveÚundefú`)Úprefixr ÚbitsÚ
bitstorealÚbitstoshortrealÚcountdriversÚdisplayÚfcloseÚfdisplayÚfinishÚfloorÚfmonitorÚfopenÚfstrobeÚfwriteÚ
getpatternÚhistoryÚincsaveÚitorÚkeyÚlistÚlogÚmonitorÚ
monitoroffÚ monitoronÚnokeyÚnologÚprinttimescaleÚrandomÚreadmembÚreadmemhÚrealtimeÚ
realtobitsÚresetÚreset_countÚreset_valueÚrestartÚrtoiÚsaveÚscaleÚscopeÚshortrealtobitsÚ
showscopesÚ
showvariablesÚshowvarsÚ sreadmembÚ sreadmemhÚstimeÚstopÚstrobeÚtimeÚ
timeformatÚwritez\$ÚbyteÚshortintÚintÚlongintÚbitÚlogicÚregÚsupply0Úsupply1ÚtriÚtriandÚtriorÚtri0Útri1ÚtriregÚuwireÚwireÚwandÚworshortrealÚrealz[a-zA-Z_]\w*:(?!:)z\$?[a-zA-Z_]\w*z\\(\S+)ú"z#popz/\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})z [^\\"\n]+z\\z[^/\n]+z/[*](.|\n)*?[*]/z//.*?\nú/z (?<=\\)\nz\nz [\w:]+\*?)Úrootr r r c C s8 d}d| kr|d7 }d| kr$|d7 }d| kr4|d7 }|S )z`Verilog code will use one of reg/wire/assign for sure, and that
is not common elsewhere.r rÝ g¹?rç r © )ÚtextÚresultrî rî ú7/tmp/pip-build-gk9425m9/Pygments/pygments/lexers/hdl.pyÚanalyse_text s zVerilogLexer.analyse_textN)qr r r r r r r r r r! r"