AlkantarClanX12

Your IP : 3.15.12.95


Current Path : /opt/alt/python38/lib64/python3.8/lib2to3/pgen2/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/lib2to3/pgen2/__pycache__/driver.cpython-38.opt-2.pyc

U

i�fQ�@s�dZddgZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZGdd�de
�Zdd	�Zdd
d�Zdd�Zdd�Zdd�Zedkr�e�ee���dS)z#Guido van Rossum <guido@python.org>�Driver�load_grammar�N�)�grammar�parse�token�tokenize�pgenc@sHeZdZddd�Zddd�Zddd�Zdd	d
�Zddd�Zdd
d�ZdS)rNcCs&||_|dkrt��}||_||_dS�N)r�logging�	getLogger�logger�convert)�selfrrr
�r�9/opt/alt/python38/lib64/python3.8/lib2to3/pgen2/driver.py�__init__s
zDriver.__init__FcCstt�|j|j�}|��d}d}d}}}}	}
d}|D�]}|\}}}}	}
|||fkr�|\}
}||
kr�|d|
|7}|
}d}||kr�||
||�7}|}|tjtjfkr�||7}|	\}}|�d�r<|d7}d}q<|t	j
kr�tj|}|�r
|j�
dt	j|||�|�||||f��r6|�r0|j�
d��qnd}|	\}}|�d�r<|d7}d}q<t�d||||f��|jS)Nrr��
z%s %r (prefix=%r)zStop.zincomplete input)rZParserrrZsetupr�COMMENT�NL�endswithr�OPZopmapr
�debug�tok_nameZaddtokenZ
ParseErrorZrootnode)r�tokensr�p�lineno�column�type�value�start�endZ	line_text�prefixZ	quintupleZs_linenoZs_columnrrr�parse_tokens&s^



�
�zDriver.parse_tokenscCst�|j�}|�||�Sr
)r�generate_tokens�readliner$)r�streamrrrrr�parse_stream_rawVszDriver.parse_stream_rawcCs|�||�Sr
)r()rr'rrrr�parse_stream[szDriver.parse_streamc
Cs4tj|d|d��}|�||�W5QR�SQRXdS)N�r)�encoding)�io�openr))r�filenamer+rr'rrr�
parse_file_szDriver.parse_filecCst�t�|�j�}|�||�Sr
)rr%r,�StringIOr&r$)r�textrrrrr�parse_stringdszDriver.parse_string)NN)F)F)F)NF)F)	�__name__�
__module__�__qualname__rr$r(r)r/r2rrrrrs

0


cCs:tj�|�\}}|dkrd}||d�tttj��dS)Nz.txtr�.z.pickle)�os�path�splitext�join�map�str�sys�version_info)�gt�head�tailrrr�_generate_pickle_namejsrB�Grammar.txtTFc
Cs�|dkrt��}|dkr t|�n|}|s2t||�s�|�d|�t�|�}|r�|�d|�z|�|�Wq�tk
r�}z|�d|�W5d}~XYq�Xnt	�
�}|�|�|S)Nz!Generating grammar tables from %szWriting grammar tables to %szWriting failed: %s)rrrB�_newer�infor	Zgenerate_grammar�dump�OSErrorr�Grammar�load)r?Zgp�save�forcer
�g�errrrqs
 
cCs8tj�|�sdStj�|�s dStj�|�tj�|�kS)NFT)r7r8�exists�getmtime)�a�brrrrD�s
rDcCsFtj�|�rt|�Sttj�|��}t�||�}t�	�}|�
|�|Sr
)r7r8�isfilerrB�basename�pkgutil�get_datarrH�loads)�packageZgrammar_sourceZpickled_name�datarLrrr�load_packaged_grammar�s
rYcGsB|stjdd�}tjtjtjdd�|D]}t|ddd�q*dS)Nrz%(message)s)�levelr'�formatT)rJrK)r=�argvrZbasicConfig�INFO�stdoutr)�argsr?rrr�main�s�r`�__main__)rCNTFN)�
__author__�__all__r,r7rrTr=rrrrrr	�objectrrBrrDrYr`r3�exit�intrrrr�<module>s&M�