3 ��XI � @ s� d Z ddlZddlmZmZmZmZmZmZ ddl m Z mZmZm Z mZmZmZmZmZ dddgZG dd� de�ZG d d� de�ZG d d� de�ZdS )z� pygments.lexers.hdl ~~~~~~~~~~~~~~~~~~~ Lexers for hardware descriptor languages. :copyright: Copyright 2006-2017 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�Error�VerilogLexer�SystemVerilogLexer� VhdlLexerc � @ s� e Zd ZdZdZddgZdgZdgZdZde j dfd efd efdefde jfd e j fdefdedfdejfdejfdejfdejfdejfdejfdejfdefdejfdefdefdefdejfdeeeje�fdeeeje�d fe�dd�d��efe�d d�d�d��e j fe�d d�d�d��ejfe�dd�d��ej fd�ej!fd�efgd�ed�fd�ej"fd�efdefd�efgd�e j fd�e j f�d e jd�f�de j f�de j fd e j d�fg�dejd�fg�d�Z#�d�d� 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\nz\s+z\\\nz/(\\\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 [()\[\],.;\']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�woshortreal�realz[a-zA-Z_]\w*:(?!:)z\$?[a-zA-Z_]\w*�"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 [\w:]+\*?)�rootr r r c c sB x<t j| |�D ],\}}}|tkr.|j� r.tj}|||fV qW d S )N)r �get_tokens_unprocessedr �isupper�Constant)�self�text�index�token�value� r� �/usr/lib/python3.6/hdl.pyr� � s z#VerilogLexer.get_tokens_unprocessedN)qr r r r r r r r r r! r"