3

V'ícøWã@s–dZddlZddlmZmZmZmZmZmZddl	m
Z
mZmZm
Z
mZmZmZmZmZdddgZGdd„deƒZGd	d„deƒZGd
d„deƒZdS)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ÎeZdZdZdZddgZdgZdgZdZde	j
dfd	efd
ee
jeƒfde	jfde	jfd
efde
dfde
jfdejfdejfdejfdejfdejfdejfdefdejfdefdefdejfdeeejeƒfdeeejeƒdfedddefed	d«dd¬e	j
fed
dàdd¬ej fedddej!fdõej"fdöefd÷efgdøe
dùfdúe
jfdûe
fd
ee
jeƒfdüe
fgdýe	j
fdþe	jfdÿe	jdùfde	j
fde	j
fdedùfgdejdùfgdœZ#dd„Z$dS(rzZ
    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:]+\*?)ÚrootrrrcCs8d}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.rrÝgš™™™™™¹?rçr©)ÚtextÚresultrîrîú7/tmp/pip-build-gk9425m9/Pygments/pygments/lexers/hdl.pyÚanalyse_text„szVerilogLexer.analyse_textN)qrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrrtrurvrwrxryrzr{r|r}r~rr€rr‚rƒr„r…r†r‡)r‰rŠr‹rŒr0rrŽrrr‘r’r“r”rr•r–r—r˜r™ršr›rœrržrŸr r¡)4r¤r¥r¦r§r¨r©rªr«r¬r­r®r¯r°r±r²r³rJr´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ÚrKrÔrÛrÜrÝrÞrßràrárârãrärårærçrèrérêrÁ)%Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesÚ	mimetypesÚ_wsr	ÚPreprocrrr
ÚEscapeÚSingleÚ	MultilinerÚCharrÚFloatÚHexÚBinÚIntegerÚOctr
rÚConstantrÚ	NamespacerrÚBuiltinÚTypeÚLabelÚtokensròrîrîrîrñrs²





cé@s.eZdZdZdZddgZddgZdgZdZde	e
ejƒd	fd
e	e
e
je
ƒfde	e
e
je
ƒdfd
e
fde	eje
ƒfdejfdejfdefdedfdejfdejfdejfdejfdejfdejfdejfdefdejfdefedd d!ejfd"efd#ejfedd d!e
fdõe	e
j e
ej!ƒfdöe	e
j e
ej!ƒfd÷e	e
j e
ee
ej!ƒfedd d!e
j"fedd d!ejfedd d!ej#fdòej$fdóefdôefg dõedöfd÷ejfdøefde	eje
ƒfdùefgdúejfdûejfdüejdöfdýejfdþejfdÿe
döfgdejdöfgdœZ%dS(rz„
    Extends verilog lexer to recognise all SystemVerilog keywords from IEEE
    1800-2009 standard.

    .. versionadded:: 1.5
    Z
systemverilogÚsvz*.svz*.svhztext/x-systemverilogz(?:\s|//.*?\n|/[*].*?[*]/)+z^(\s*)(`define)rz^(\s*)(package)(\s+)z^(\s*)(import)(\s+)rz\s+z(\\)(\n)z/(\\\n)?/(\n|(.|\n)*?[^\\]\n)z/(\\\n)?[*](.|\n)*?[*](\\\n)?/z[{}#@]zL?"rz4L?'(\\.|\\[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]?z4([1-9][_0-9]*)?\s*\'[sS]?[bB]\s*[xXzZ?01][_xXzZ?01]*z6([1-9][_0-9]*)?\s*\'[sS]?[oO]\s*[xXzZ?0-7][_xXzZ?0-7]*z6([1-9][_0-9]*)?\s*\'[sS]?[dD]\s*[xXzZ?0-9][_xXzZ?0-9]*zB([1-9][_0-9]*)?\s*\'[sS]?[hH]\s*[xXzZ?0-9a-fA-F][_xXzZ?0-9a-fA-F]*z
\'[01xXzZ]z[0-9][_0-9]*z[~!%^&*+=|?:<>/-]ÚinsideÚdistz\b)rˆz[()\[\],.;\'$]z
`[a-zA-Z_]\w*Ú	accept_onÚaliasrrrrrÚassertrÚassumerÚbeforerÚbindÚbinsÚbinsofr r!r"r#r$r%r&ÚcellÚcheckerÚclockingr'ÚconfigÚ
constraintÚcontextr)ÚcoverÚ
covergroupÚ
coverpointÚcrossr*r+r,Údesignr-r.r/r0r1r2Ú
endcheckerÚendclockingÚ	endconfigr3r4ÚendgroupÚendinterfacer5r6r7Ú
endprogramÚendpropertyÚendsequencer8r9r:r;Ú
eventuallyÚexpectÚexportÚexternr=Úfirst_matchr>r?Úforeachr@rAÚforkjoinrBrCrDÚglobalrErFrGÚiffÚifnoneÚignore_binsÚillegal_binsÚimpliesÚ
implementsÚincdirrrHrIrJÚinstanceÚinterconnectÚ	interfaceÚ	intersectrLÚjoin_anyÚ	join_nonerMÚletÚliblistÚlibraryÚlocalrNrOÚmatchesrPÚmodportrQrRrSÚnettypeÚnewÚnexttimerTrUÚnoshowcancelledrVrWrXÚnullrYrZÚpackager[r\r]r^r_ÚpriorityÚprogramÚpropertyr›r`rarbrcÚpulsestyle_ondetectÚpulsestyle_oneventÚpureÚrandÚrandcÚrandcaseÚrandsequencerdreÚ	reject_onrfrgÚrestrictrhrirjrkrlrmÚs_alwaysÚs_eventuallyÚ
s_nexttimeÚs_untilÚs_until_withrnÚsequenceÚ
showcancelledrpÚsoftÚsolverqrrÚstaticÚstrongrtrurvÚsuperÚsync_accept_onÚsync_reject_onrwÚtaggedrxrÚ
throughoutÚ
timeprecisionÚtimeunitryrzr{r}ÚunionÚuniqueÚunique0ÚuntilÚ
until_withÚuntypedÚuser€Úvirtualr‚Ú
wait_orderÚweakrƒr„r…ÚwildcardÚwithÚwithinr†r‡z(class)(\s+)([a-zA-Z_]\w*)z(extends)(\s+)([a-zA-Z_]\w*)z,(endclass\b)(?:(\s*)(:)(\s*)([a-zA-Z_]\w*))?rÛr×Úchandler(r<rÙrKrÜrÚrêrÁrÝrØÚ	shortrealrorÔr|r~rrrÞrßràrárârårãrärærèrçÚworú	`__FILE__ú	`__LINE__ú`begin_keywordsú`celldefineú`default_nettypeú`defineú`elseú`elsifú
`end_keywordsú`endcelldefineú`endifú`ifdefú`ifndefú`includeú`lineú`nounconnected_driveú`pragmaú	`resetallú
`timescaleú`unconnected_driveú`undefú`undefineallú$exitú$finishú$stopú	$realtimeú$stimeú$timeú$printtimescaleú$timeformatú$bitstorealú$bitstoshortrealú$castú$itorú$realtobitsú$rtoiú$shortrealtobitsú$signedú	$unsignedú$bitsú$isunboundedú	$typenameú$dimensionsú$highú
$incrementú$leftú$lowú$rightú$sizeú$unpacked_dimensionsú$acosú$acoshú$asinú$asinhú$atanú$atan2ú$atanhú$ceilú$clog2ú$cosú$coshú$expú$floorú$hypotú$lnú$log10ú$powú$sinú$sinhú$sqrtú$tanú$tanhú
$countbitsú
$countonesú
$isunknownú$onehotú$onehot0ú$infoú$errorú$fatalú$warningú$assertcontrolú$assertfailoffú
$assertfailonú$assertkillú$assertnonvacuousonú
$assertoffú	$assertonú$assertpassoffú
$assertpassonú$assertvacuousoffú$changedú
$changed_gclkú$changing_gclkú
$falling_gclkú$fellú
$fell_gclkú$future_gclkú$pastú
$past_gclkú$rising_gclkú$roseú
$rose_gclkú$sampledú$stableú$stable_gclkú$steady_gclkú$coverage_controlú
$coverage_getú$coverage_get_maxú$coverage_mergeú$coverage_saveú
$get_coverageú$load_coverage_dbú$set_coverage_db_nameú$dist_chi_squareú$dist_erlangú$dist_exponentialú$dist_normalú
$dist_poissonú$dist_tú
$dist_uniformú$randomú$q_addú$q_examú$q_fullú
$q_initializeú	$q_removeú$async$and$arrayú$async$and$planeú$async$nand$arrayú$async$nand$planeú$async$nor$arrayú$async$nor$planeú$async$or$arrayú$async$or$planeú$sync$and$arrayú$sync$and$planeú$sync$nand$arrayú$sync$nand$planeú$sync$nor$arrayú$sync$nor$planeú$sync$or$arrayú$sync$or$planeú$systemú$displayú	$displaybú	$displayhú	$displayoú$monitorú	$monitorbú	$monitorhú	$monitoroú$monitoroffú
$monitoronú$strobeú$strobebú$strobehú$strobeoú$writeú$writebú$writehú$writeoú$fcloseú	$fdisplayú
$fdisplaybú
$fdisplayhú
$fdisplayoú$feofú$ferrorú$fflushú$fgetcú$fgetsú	$fmonitorú
$fmonitorbú
$fmonitorhú
$fmonitoroú$fopenú$freadú$fscanfú$fseekú$fstrobeú	$fstrobebú	$fstrobehú	$fstrobeoú$ftellú$fwriteú$fwritebú$fwritehú$fwriteoú$rewindú$sformatú	$sformatfú$sscanfú$swriteú$swritebú$swritehú$swriteoú$ungetcú	$readmembú	$readmemhú
$writemembú
$writememhú$test$plusargsú$value$plusargsú$dumpallú	$dumpfileú
$dumpflushú
$dumplimitú$dumpoffú$dumponú
$dumpportsú
$dumpportsallú$dumpportsflushú$dumpportslimitú
$dumpportsoffú$dumpportsonú	$dumpvarsz[a-zA-Z_]\w*:(?!:)z\$?[a-zA-Z_]\w*z\\(\S+)rëz#popz/\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})z	[^\\"\n]+z\\z[^/\n]+z/[*](.|\n)*?[*]/z//.*?$rìz	(?<=\\)\nz\nz	[\w:]+\*?)rírrrN)r
r)Òrrrrrrrrrrrrrrrrr r!r"r#r$r%r&rrrr'rrrr)rrrr r*r+r,r!r-r.r/r0r1r2r"r#r$r3r4r%r&r5r6r7r'r(r)r8r9r:r;r*r+r,r-r=r.r>r?r/r@rAr0rBrCrDr1rErFrGr2r3r4r5r6r7rr8rrHrIrJr9r:r;r<rLr=r>rMr?r@rArBrNrOrCrPrDrQrRrSrErFrGrTrUrHrVrWrXrIrYrZrJr[r\r]r^r_rKrLrMr›r`rarbrcrNrOrPrQrRrSrTrdrerUrfrgrVrhrirjrkrlrmrWrXrYrZr[rnr\r]rpr^r_rqrrr`rartrurvrbrcrdrwrerxrrfrgrhryrzr{r}rirjrkrlrmrnror€rpr‚rqrrrƒr„r…rsrtrur†r‡)!rÛr×rvr(r<rÙrKrÜrÚrêrÁrÝrØrwrorrÔr|r~rrrÞrßràrárârårãrärærèrçrx)ryrzr{r|r}r~rr€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³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æ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ÿrrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrR)&rórôrõrör÷rørùrúrûrrr	rürrr
rýrþrÿrrrrrrrrr
rÚWordrrZDeclarationÚClassr	rr
rrîrîrîrñr’sT







cc@s¶eZdZdZdZdgZddgZdgZej	ej
BZdefde
ejeƒfdejfd	ejfd
efdejfdefd
efde
eeejƒfde
eeeƒfde
eeejeƒfde
eeejƒfde
ejejƒfedddejfde
eeejƒfde
eeejeeeejeeƒ	fde
ejeeeƒfde
eeƒeƒdfedƒedƒedƒd efgedƒd ejfdefd!ed"fgedžddejfgedŸddefgd•ej fd–ej fd—ej!fd˜ej"fd™ej#fdšej$fgd›œZ%dœS) rz:
    For VHDL source code.

    .. versionadded:: 1.5
    Zvhdlz*.vhdlz*.vhdztext/x-vhdlz\s+z(\\)(\n)z--.*?$z'(U|X|0|1|Z|W|L|H|-)'z[~!%^&*+=|?:<>/-]z
'[a-z_]\w*z
[()\[\],.;\']z"[^\n\\"]*"z(library)(\s+)([a-z_]\w*)z(use)(\s+)(entity)z(use)(\s+)([a-z_][\w.]*\.)(all)z(use)(\s+)([a-z_][\w.]*)z(std|ieee)(\.[a-z_]\w*)ÚstdÚieeeÚworkz\b)rˆz"(entity|component)(\s+)([a-z_]\w*)zN(architecture|configuration)(\s+)([a-z_]\w*)(\s+)(of)(\s+)([a-z_]\w*)(\s+)(is)z ([a-z_]\w*)(:)(\s+)(process|for)z
(end)(\s+)ÚendblockÚtypesÚkeywordsÚnumbersz	[a-z_]\w*ú;z#popÚbooleanrÛÚ	characterÚseverity_levelrKrÔÚdelay_lengthÚnaturalÚpositiverÚ
bit_vectorÚfile_open_kindÚfile_open_statusÚ
std_ulogicÚstd_ulogic_vectorÚ	std_logicÚstd_logic_vectorror~ÚabsÚaccessÚafterrÚallrÚarchitectureÚarrayrÚ	attributerÚblockÚbodyÚbufferÚbusr$Ú	componentÚ
configurationÚconstantÚ
disconnectÚdowntor0rr1ÚentityÚexitÚfiler>rBrCÚgenericÚgroupÚguardedrGÚimpureÚinÚinertialrIÚisÚlabelrAÚlinkageÚliteralÚloopÚmapÚmodrRrFÚnextrUrVrIÚofÚonÚopenrYÚothersÚoutrJÚportÚ	postponedÚ	procedureÚprocessrPÚrangeÚrecordÚregisterÚrejectÚremrhÚrolÚrorÚselectÚseverityÚsignalÚsharedÚslaÚsllÚsraÚsrlÚsubtypeÚthenÚtoÚ	transportr|ÚunitsrlroÚvariabler‚Úwhenr…rtr†r‡z\d{1,2}#[0-9a-f_]+#?z\d+z(\d+\.\d*|\.\d+|\d+)E[+-]?\d+z
X"[0-9a-f_]+"z
O"[0-7_]+"z	B"[01_]+")rírXrYrZr[N)rUrVrW)r]rÛr^r_rKrÔr`rarbrrcrdrerfrgrhriror~)_rjrkrlrrmrrnrorrprrqrrrsrtr$rurvrwrxryr0rr1rzr{r|r>rBrCr}r~rrGr€rr‚rIrƒr„rAr…r†r‡rˆr‰rRrFrŠrUrVrIr‹rŒrrYrŽrrJrr‘r’r“rPr”r•r–r—r˜rhr™ršr›rœrržrŸr r¡r¢r£r¤r¥r¦r|r§rlror¨r‚r©r…rtr†r‡)&rórôrõrör÷rørùrúÚreÚ	MULTILINEÚ
IGNORECASEÚflagsrrr
rýr	rþrr
rÚ	AttributerrrrrTrrrr	rrrrrrrrîrîrîrñrusŽ

)rörªZpygments.lexerrrrrrrZpygments.tokenrr	r
rrr
rrrÚ__all__rrrrîrîrîrñÚ<module>	s ,
~d