AlkantarClanX12

Your IP : 3.144.100.252


Current Path : /opt/alt/python39/lib64/python3.9/lib2to3/pgen2/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/lib2to3/pgen2/__pycache__/conv.cpython-39.opt-2.pyc

a

R�f�%�@s.ddlZddlmZmZGdd�dej�ZdS)�N)�grammar�tokenc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�	ConvertercCs |�|�|�|�|��dS�N)�parse_graminit_h�parse_graminit_c�
finish_off)�selfZ
graminit_hZ
graminit_c�r
�7/opt/alt/python39/lib64/python3.9/lib2to3/pgen2/conv.py�run/s

z
Converter.runc	
Cs�zt|�}Wn6tyB}ztd||f�WYd}~dSd}~00i|_i|_d}|D]d}|d7}t�d|�}|s�|��r�td|||��f�qX|��\}}t	|�}||j|<||j|<qXdS)N�Can't open %s: %sFr�z^#define\s+(\w+)\s+(\d+)$z%s(%s): can't parse %sT)
�open�OSError�printZ
symbol2numberZ
number2symbol�re�match�strip�groups�int)	r	�filename�f�err�lineno�line�mo�symbol�numberr
r
rr5s(�

zConverter.parse_graminit_hc!
Cs�zt|�}Wn6tyB}ztd||f�WYd}~dSd}~00d}|dt|�}}|dt|�}}|dt|�}}i}g}|�d��r�|�d��rHt�d|�}ttt	|�
���\}	}
}g}t|�D]F}
|dt|�}}t�d|�}ttt	|�
���\}}|�||f�q�|dt|�}}|||	|
f<|dt|�}}q�t�d|�}ttt	|�
���\}}g}t|�D]R}
|dt|�}}t�d	|�}ttt	|�
���\}}	}
||	|
f}|�|��qv|�|�|dt|�}}|dt|�}}q�||_
i}t�d
|�}t	|�d��}t|�D]�}|dt|�}}t�d|�}|�d�}ttt	|�dd
dd���\}}}}||}|dt|�}}t�d|�}i}t|�d��}t|�D]@\}}t|�}td�D]$}|d|>@�r�d||d|<�q̐q�||f||<�q&|dt|�}}||_g}|dt|�}}t�d|�}t	|�d��}t|�D]^}|dt|�}}t�d|�}|�
�\}}t	|�}|dk�r�d}nt|�}|�||f��qV|dt|�}}||_|dt|�}}|dt|�}}t�d|�}t	|�d��}|dt|�}}|dt|�}}t�d|�}t	|�d��}|dt|�}}t�d|�}t	|�d��} | |_|dt|�}}z|dt|�}}Wnt�y�Yn0dS)Nr
Frrzstatic arc z)static arc arcs_(\d+)_(\d+)\[(\d+)\] = {$z\s+{(\d+), (\d+)},$z'static state states_(\d+)\[(\d+)\] = {$z\s+{(\d+), arcs_(\d+)_(\d+)},$zstatic dfa dfas\[(\d+)\] = {$z0\s+{(\d+), "(\w+)", (\d+), (\d+), states_(\d+),$����z\s+("(?:\\\d\d\d)*")},$�z!static label labels\[(\d+)\] = {$z\s+{(\d+), (0|"\w+")},$�0z
\s+(\d+),$z\s+{(\d+), labels},$z	\s+(\d+)$)rrr�next�
startswithrr�list�maprr�range�append�states�group�eval�	enumerate�ord�dfas�labels�start�
StopIteration)!r	rrrrrZallarcsr+r�n�m�kZarcs�_�i�j�s�t�stater0Zndfasrr�x�y�z�firstZ	rawbitset�cZbyter1Znlabelsr2r
r
rrTs��
�
"
zConverter.parse_graminit_ccCsXi|_i|_t|j�D]<\}\}}|tjkr@|dur@||j|<q|dur||j|<qdSr)�keywords�tokensr.r1r�NAME)r	Zilabel�type�valuer
r
rr�szConverter.finish_offN)�__name__�
__module__�__qualname__rrrrr
r
r
rr$s
&r)rZpgen2rrZGrammarrr
r
r
r�<module>s