$76 GRAYBYTE WORDPRESS FILE MANAGER $71

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.217.71
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/python311/lib64/python3.11/lib2to3/pgen2/__pycache__/

HOME
Current File : /opt/alt/python311/lib64/python3.11/lib2to3/pgen2/__pycache__//conv.cpython-311.opt-1.pyc
�

�0�i�%��H�dZddlZddlmZmZGd�dej��ZdS)a�Convert graminit.[ch] spit out by pgen to Python code.

Pgen is the Python parser generator.  It is useful to quickly create a
parser from a grammar file in Python's grammar notation.  But I don't
want my parsers to be written in C (yet), so I'm translating the
parsing tables to Python data structures and writing a Python parse
engine.

Note that the token numbers are constants determined by the standard
Python tokenizer.  The standard token module defines these numbers and
their names (the names are not used much).  The token numbers are
hardcoded into the Python tokenizer and into pgen.  A Python
implementation of the Python tokenizer is also available, in the
standard tokenize module.

On the other hand, symbol numbers (representing the grammar's
non-terminals) are assigned by pgen based on the actual grammar
input.

Note: this module is pretty much obsolete; the pgen module generates
equivalent grammar tables directly from the Grammar.txt input file
without having to invoke the Python pgen C program.

�N)�grammar�tokenc�*�eZdZdZd�Zd�Zd�Zd�ZdS)�	Convertera2Grammar subclass that reads classic pgen output files.

    The run() method reads the tables as produced by the pgen parser
    generator, typically contained in two C files, graminit.h and
    graminit.c.  The other methods are for internal use only.

    See the base class for more documentation.

    c��|�|��|�|��|���dS)z<Load the grammar tables from the text files written by pgen.N)�parse_graminit_h�parse_graminit_c�
finish_off)�self�
graminit_h�
graminit_cs   �9/opt/alt/python311/lib64/python3.11/lib2to3/pgen2/conv.py�runz
Converter.run/s@�����j�)�)�)����j�)�)�)���������c	���	t|��}n-#t$r }td|�d|����Yd}~dSd}~wwxYwi|_i|_d}|D]�}|dz
}tjd|��}|s>|���r*t|�d|�d	|��������\|���\}}t|��}||j|<||j|<��d
S)z�Parse the .h file written by pgen.  (Internal)

        This file is a sequence of #define statements defining the
        nonterminals of the grammar as numbers.  We build two tables
        mapping the numbers to names and back.

        �Can't open �: NFr�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	         rrzConverter.parse_graminit_h5s/��	��X���A�A���	�	�	��E����3�3�7�8�8�8��5�5�5�5�5�����	���� ���������	4�	4�D��a�K�F���6��=�=�B��	
4�$�*�*�,�,�	
4��(�(�(�F�F�F�26�*�*�,�,�,�@�A�A�A�A�"$���������V����.4��"�6�*�-3��"�6�*�*��ts��
<�7�<c�
�	t|��}n-#t$r }td|�d|����Yd}~dSd}~wwxYwd}|dzt|��}}|dzt|��}}|dzt|��}}i}g}|�d���rf|�d���rtjd|��}ttt|�
������\}	}
}g}t|��D]y}
|dzt|��}}tjd	|��}ttt|�
������\}}|�||f���z|dzt|��}}|||	|
f<|dzt|��}}|�d����tjd
|��}ttt|�
������\}}g}t|��D]�}
|dzt|��}}tjd|��}ttt|�
������\}}	}
||	|
f}|�|����|�|��|dzt|��}}|dzt|��}}|�d����f||_
i}tjd|��}t|�d����}t|��D�]#}|dzt|��}}tjd
|��}|�d��}ttt|�dddd������\}}}}||}|dzt|��}}tjd|��}i}t|�d����}t!|��D]9\}}t#|��}td��D]}|d|zzrd||dz|z<��:||f||<��%|dzt|��}}||_g}|dzt|��}}tjd|��}t|�d����}t|��D]�}|dzt|��}}tjd|��}|�
��\}}t|��}|dkrd}nt|��}|�||f����|dzt|��}}||_|dzt|��}}|dzt|��}}tjd|��}t|�d����}|dzt|��}}|dzt|��}}tjd|��}t|�d����}|dzt|��}}tjd|��}t|�d����} | |_|dzt|��}}	|dzt|��}}dS#t*$rYdSwxYw)a�Parse the .c file written by pgen.  (Internal)

        The file looks as follows.  The first two lines are always this:

        #include "pgenheaders.h"
        #include "grammar.h"

        After that come four blocks:

        1) one or more state definitions
        2) a table defining dfas
        3) a table defining labels
        4) a struct defining the grammar

        A state definition has the following form:
        - one or more arc arrays, each of the form:
          static arc arcs_<n>_<m>[<k>] = {
                  {<i>, <j>},
                  ...
          };
        - followed by a state array, of the form:
          static state states_<s>[<t>] = {
                  {<k>, arcs_<n>_<m>},
                  ...
          };

        rrNFrrzstatic 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)!rr r!r"r#r$�allarcsr5r%�n�m�k�arcs�_�i�j�s�t�stater:�ndfasr&r'�x�y�z�first�	rawbitset�c�byter;�nlabelsr<s!                                 rr	zConverter.parse_graminit_cTs���8	��X���A�A���	�	�	��E����3�3�7�8�8�8��5�5�5�5�5�����	�������a�x��a������a�x��a������a�x��a����������o�o�m�,�,�!	-��/�/�-�0�0�
1��X�J�"�$�$���s�3��	�	���4�4�5�5���1�a����q���(�(�A�#)�!�8�T�!�W�W�D�F���"8�$�?�?�B���C������ 5� 5�6�6�D�A�q��K�K��A��'�'�'�'�%�a�x��a�����"&���A���%�a�x��a������/�/�-�0�0�
1� ��D�d�K�K�B���C������-�-�.�.�D�A�q��E��1�X�X�
#�
#��%�a�x��a������X�?��F�F���s�3��	�	���4�4�5�5���1�a��q�!�t�}�����T�"�"�"�"��M�M�%� � � �!�!�8�T�!�W�W�D�F�!�!�8�T�!�W�W�D�F�C�o�o�m�,�,�!	-�D�����
�X�6��
=�
=���B�H�H�Q�K�K� � ���u���	*�	*�A�!�!�8�T�!�W�W�D�F���M�� � �B��X�X�a�[�[�F�"�3�s�B�H�H�Q��1�a�,@�,@�#A�#A�B�B�O�F�A�q�!��1�I�E�!�!�8�T�!�W�W�D�F���4�d�;�;�B��E��R�X�X�a�[�[�)�)�I�!�)�,�,�
+�
+���1��1�v�v���q���+�+�A��q�!�t�}�+�)*��a��c�A�g���+�"�5�>�D��L�L��a�x��a�������	����a�x��a�����
�X�:�D�
A�
A���b�h�h�q�k�k�"�"���w���
	"�
	"�A�!�!�8�T�!�W�W�D�F���4�d�;�;�B��9�9�;�;�D�A�q��A���A��C�x�x������G�G���M�M�1�a�&�!�!�!�!��a�x��a���������a�x��a������a�x��a�����
�X�m�T�
*�
*���B�H�H�Q�K�K� � ���a�x��a������a�x��a�����
�X�-�t�
4�
4���b�h�h�q�k�k�"�"���a�x��a�����
�X�l�D�
)�
)���B�H�H�Q�K�K� � ����
��a�x��a�����	%�!�!�8�T�!�W�W�D�F�F�F���	�	�	��D�D�	���s"��
<�7�<�)Z?�?
[
�[
c��i|_i|_t|j��D]1\}\}}|tjkr
|�||j|<�%|�
||j|<�2dS)z1Create additional useful structures.  (Internal).N)�keywords�tokensr8r;r�NAME)r�ilabel�type�values    rr
zConverter.finish_off�so����
����%.�t�{�%;�%;�	+�	+�!�F�M�T�5��u�z�!�!�e�&7�'-��
�e�$�$���$*���D�!��		+�	+rN)�__name__�
__module__�__qualname__�__doc__rrr	r
�rrrr$s^��������������>c%�c%�c%�J+�+�+�+�+rr)r\r�pgen2rr�Grammarrr]rr�<module>r`st����4
�	�	�	�!� � � � � � � �]+�]+�]+�]+�]+���]+�]+�]+�]+�]+r

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
4 May 2026 11.11 PM
root / linksafe
0755
__init__.cpython-311.opt-1.pyc
0.199 KB
17 Apr 2026 11.29 AM
root / linksafe
0644
__init__.cpython-311.opt-2.pyc
0.164 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
__init__.cpython-311.pyc
0.199 KB
17 Apr 2026 11.29 AM
root / linksafe
0644
conv.cpython-311.opt-1.pyc
10.817 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
conv.cpython-311.opt-2.pyc
8.415 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
conv.cpython-311.pyc
12.95 KB
17 Apr 2026 11.29 AM
root / linksafe
0644
driver.cpython-311.opt-1.pyc
8.533 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
driver.cpython-311.opt-2.pyc
7.605 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
driver.cpython-311.pyc
8.615 KB
17 Apr 2026 11.29 AM
root / linksafe
0644
grammar.cpython-311.opt-1.pyc
7.394 KB
17 Apr 2026 11.29 AM
root / linksafe
0644
grammar.cpython-311.opt-2.pyc
4.341 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
grammar.cpython-311.pyc
7.394 KB
17 Apr 2026 11.29 AM
root / linksafe
0644
literals.cpython-311.opt-1.pyc
2.418 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
literals.cpython-311.opt-2.pyc
2.344 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
literals.cpython-311.pyc
3.018 KB
17 Apr 2026 11.29 AM
root / linksafe
0644
parse.cpython-311.opt-1.pyc
8.808 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
parse.cpython-311.opt-2.pyc
5.695 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
parse.cpython-311.pyc
8.834 KB
17 Apr 2026 11.29 AM
root / linksafe
0644
pgen.cpython-311.opt-1.pyc
18.604 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
pgen.cpython-311.opt-2.pyc
18.604 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
pgen.cpython-311.pyc
19.794 KB
17 Apr 2026 11.29 AM
root / linksafe
0644
token.cpython-311.opt-1.pyc
2.323 KB
17 Apr 2026 11.29 AM
root / linksafe
0644
token.cpython-311.opt-2.pyc
2.275 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
token.cpython-311.pyc
2.323 KB
17 Apr 2026 11.29 AM
root / linksafe
0644
tokenize.cpython-311.opt-1.pyc
23.479 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
tokenize.cpython-311.opt-2.pyc
19.704 KB
17 Apr 2026 11.30 AM
root / linksafe
0644
tokenize.cpython-311.pyc
23.597 KB
17 Apr 2026 11.29 AM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF