ok

Mini Shell

Direktori : /usr/lib64/python3.6/lib2to3/pgen2/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/lib2to3/pgen2/__pycache__/driver.cpython-36.opt-2.pyc

3


 \��@s�dZddgZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZmZm
Z
Gdd�de�Zdd	�Zdd
d�Zdd�Zdd�Zdd�Zedkr�ejee���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&||_|dkrtj�}||_||_dS)N)r�logging�	getLogger�logger�convert)�selfrr
r�r�,/usr/lib64/python3.6/lib2to3/pgen2/driver.py�__init__ s
zDriver.__init__FcCsvtj|j|j�}|j�d}d}d}}}}	}
d}�x4|D�]}|\}}}}	}
|||fkr�|\}
}||
kr�|d|
|7}|
}d}||kr�||
||�7}|}|tjtjfkr�||7}|	\}}|jd�r@|d7}d}q@|t	j
kr�tj|}|�r|jj
dt	j|||�|j||||f��r6|�r4|jj
d�Pd}|	\}}|jd�r@|d7}d}q@Wtjd||||f��|jS)Nrr��
z%s %r (prefix=%r)zStop.zincomplete input)rZParserrr
Zsetupr�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'sR



zDriver.parse_tokenscCstj|j�}|j||�S)N)r�generate_tokens�readliner#)r�streamrrrrr�parse_stream_rawWszDriver.parse_stream_rawcCs|j||�S)N)r')rr&rrrr�parse_stream\szDriver.parse_streamc
Cs*tj|d|�}z|j||�S|j�XdS)N�r)�codecs�openr(�close)r�filename�encodingrr&rrr�
parse_file`szDriver.parse_filecCstjtj|�j�}|j||�S)N)rr$�io�StringIOr%r#)r�textrrrrr�parse_stringhszDriver.parse_string)NN)F)F)F)NF)F)	�__name__�
__module__�__qualname__rr#r'r(r/r3rrrrrs

0


cCs:tjj|�\}}|dkrd}||djtttj��dS)Nz.txtr�.z.pickle)�os�path�splitext�join�map�str�sys�version_info)�gt�head�tailrrr�_generate_pickle_namensrC�Grammar.txtTFcCs�|dkrtj�}|dkr t|�n|}|s4t||�r�|jd|�tj|�}|r�|jd|�y|j|�Wq�tk
r�}z|jd|�WYdd}~Xq�Xnt	j
�}|j|�|S)Nz!Generating grammar tables from %szWriting grammar tables to %szWriting failed: %s)r
rrC�_newer�infor	Zgenerate_grammar�dump�OSErrorr�Grammar�load)r@Zgp�save�forcer�g�errrrus
 
cCs8tjj|�sdStjj|�s dStjj|�tjj|�kS)NFT)r8r9�exists�getmtime)�a�brrrrE�s
rEcCsFtjj|�rt|�Sttjj|��}tj||�}tj	�}|j
|�|S)N)r8r9�isfilerrC�basename�pkgutil�get_datarrI�loads)�packageZgrammar_sourceZpickled_name�datarMrrr�load_packaged_grammar�s
rZcGsF|stjdd�}tjtjtjdd�x|D]}t|ddd�q,WdS)Nrz%(message)s)�levelr&�formatT)rKrL)r>�argvr
ZbasicConfig�INFO�stdoutr)�argsr@rrr�main�s
ra�__main__)rDNTFN)�
__author__�__all__r*r0r8r
rUr>rrrrrr	�objectrrCrrErZrar4�exit�intrrrr�<module>s"P
	


Zerion Mini Shell 1.0