Your IP : 3.15.186.27


Current Path : /opt/alt/python312/lib64/python3.12/lib2to3/pgen2/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/lib2to3/pgen2/__pycache__/conv.cpython-312.opt-2.pyc

�

�Q�f�%��H�	ddlZddlmZmZGd�dej�Zy)�N)�grammar�tokenc�&�eZdZ	d�Zd�Zd�Zd�Zy)�	Converterc�j�	|j|�|j|�|j�y�N)�parse_graminit_h�parse_graminit_c�
finish_off)�self�
graminit_h�
graminit_cs   �9/opt/alt/python312/lib64/python3.12/lib2to3/pgen2/conv.py�runz
Converter.run/s+��J����j�)����j�)�����c	��		t|�}i|_i|_d}|D]�}|dz
}tjd|�}|s2|j�r"t|�d|�d|j�����R|j�\}}t|�}||j|<||j|<��y	#t$r}td|�d|���Yd}~yd}~wwxYw)
N�Can't open �: Fr�z^#define\s+(\w+)\s+(\d+)$�(z): can't parse T)
�open�OSError�print�
symbol2number�
number2symbol�re�match�strip�groups�int)	r�filename�f�err�lineno�line�mo�symbol�numbers	         rr	zConverter.parse_graminit_h5s���	�	��X��A� ���������D��a�K�F����6��=�B��$�*�*�,��(�F�26�*�*�,�@�A�"$��������V���.4��"�"�6�*�-3��"�"�6�*����'�	���3�7�8���	�s�B1�1	C�:C�Cc�|�		t|�}d}|dzt|�}}|dzt|�}}|dzt|�}}i}g}|j	d��r�|j	d�r�tjd|�}ttt|j���\}	}
}g}t|�D]e}
|dzt|�}}tjd|�}ttt|j���\}}|j||f��g|dzt|�}}|||	|
f<|dzt|�}}|j	d�r��tjd	|�}ttt|j���\}}g}t|�D]k}
|dzt|�}}tjd
|�}ttt|j���\}}	}
||	|
f}|j|��m|j|�|dzt|�}}|dzt|�}}|j	d�r���||_
i}tjd|�}t|jd��}t|�D]�}|dzt|�}}tjd|�}|jd
�}ttt|jdddd���\}}}}||}|dzt|�}}tjd|�}i}t|jd��}t!|�D]4\}}t#|�}td�D]}|d|zzs�d||dz|z<��6||f||<��|dzt|�}}||_g}|dzt|�}}tjd|�}t|jd��}t|�D]l}|dzt|�}}tjd|�}|j�\}}t|�}|dk(rd}nt|�}|j||f��n|dzt|�}}||_|dzt|�}}|dzt|�}}tjd|�}t|jd��}|dzt|�}}|dzt|�}}tjd|�}t|jd��}|dzt|�}}tjd|�}t|jd��} | |_|dzt|�}}	|dzt|�}}y#t$r}td|�d|���Yd}~yd}~wwxYw#t*$rYywxYw)NrrFrrzstatic 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�mapr r�range�append�states�group�eval�	enumerate�ord�dfas�labels�start�
StopIteration)!rr!r"r#r$r%�allarcsr6r&�n�m�k�arcs�_�i�j�s�t�stater;�ndfasr'r(�x�y�z�first�	rawbitset�c�byter<�nlabelsr=s!                                 rr
zConverter.parse_graminit_cTsU��	�6	��X��A�
���a�x��a�����a�x��a�����a�x��a���������o�o�m�,��/�/�-�0��X�X�J�"�$���s�3��	�	��4�5���1�a����q��A�#)�!�8�T�!�W�D�F����"8�$�?�B���C����� 5�6�D�A�q��K�K��A��'�"� &�a�x��a����"&���A���%�a�x��a�����/�/�-�0� ���D�d�K�B���C�����-�.�D�A�q��E��1�X��%�a�x��a�����X�X�?��F���s�3��	�	��4�5���1�a��q�!�t�}�����T�"��
�M�M�%� �!�!�8�T�!�W�D�F�!�!�8�T�!�W�D�F�C�o�o�m�,�D�����
�X�X�6��
=���B�H�H�Q�K� ���u��A�!�!�8�T�!�W�D�F����M�� �B��X�X�a�[�F�"�3�s�B�H�H�Q��1�a�,@�#A�B�O�F�A�q�!��1�I�E�!�!�8�T�!�W�D�F����4�d�;�B��E��R�X�X�a�[�)�I�!�)�,���1��1�v���q��A��q�!�t�}�)*��a��c�A�g��"�-�
"�5�>�D��L�-�.�a�x��a������	����a�x��a����
�X�X�:�D�
A���b�h�h�q�k�"���w��A�!�!�8�T�!�W�D�F����4�d�;�B��9�9�;�D�A�q��A��A��C�x�����G���M�M�1�a�&�!� ��a�x��a��������a�x��a�����a�x��a����
�X�X�m�T�
*���B�H�H�Q�K� ���a�x��a�����a�x��a����
�X�X�-�t�
4���b�h�h�q�k�"���a�x��a����
�X�X�l�D�
)���B�H�H�Q�K� ����
��a�x��a����	%�!�!�8�T�!�W�D�F��C�	���3�7�8���	��D�	��	�s)�V�7V/�	V,�V'�'V,�/	V;�:V;c���	i|_i|_t|j�D]?\}\}}|tj
k(r|�||j|<�.|��1||j|<�Ayr)�keywords�tokensr9r<r�NAME)r�ilabel�type�values    rrzConverter.finish_off�sa��?���
����%.�t�{�{�%;�!�F�M�T�5��u�z�z�!�e�&7�'-��
�
�e�$���$*����D�!�	&<rN)�__name__�
__module__�__qualname__rr	r
r�rrrr$s�����>c%�J+rr)r�pgen2rr�Grammarrr]rr�<module>r`s&���4
�!�]+����]+r

?>