Your IP : 3.141.19.115


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

U

e5d��@s0ddlmZGdd�de�ZGdd�de�ZdS)�)�tokenc@seZdZdd�Zdd�ZdS)�
ParseErrorcCs4t�|d||||f�||_||_||_||_dS)Nz!%s: type=%r, value=%r, context=%r)�	Exception�__init__�msg�type�value�context)�selfrrrr	�r�+/usr/lib64/python3.8/lib2to3/pgen2/parse.pyrs
�zParseError.__init__cCst|�|j|j|j|jffS�N)rrrr	)r
rrr�
__reduce__szParseError.__reduce__N)�__name__�
__module__�__qualname__rrrrrrrsrc@sHeZdZddd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�ParserNcCs||_|pdd�|_dS)NcSs|Sr
r)�grammar�noderrr�<lambda>Z�z!Parser.__init__.<locals>.<lambda>)r�convert)r
rrrrrr<szParser.__init__cCsH|dkr|jj}|ddgf}|jj|d|f}|g|_d|_t�|_dS)N�)r�start�dfas�stack�rootnode�set�
used_names)r
r�newnodeZ
stackentryrrr�setup\s
zParser.setupcCs0|�|||�}|jd\}}}|\}}	||}
|
D]�\}}|jj|\}
}||kr�|�||||�|}||d|fgkr�|��|js�dS|jd\}}}|\}}	qfdS|
dkr2|jj|
}|\}}||kr2|�|
|jj|
||�qq2d|f|
k�r|��|j�s*td|||��qtd|||��qdS)N���rTF�ztoo much inputz	bad input)	�classifyrr�labels�shift�popr�pushr)r
rrr	�ilabel�dfa�staterZstates�firstZarcs�i�newstate�t�vZitsdfaZ	itsstatesZitsfirstrrr�addtokents>
�zParser.addtokencCsX|tjkr0|j�|�|jj�|�}|dk	r0|S|jj�|�}|dkrTtd|||��|S)Nz	bad token)	r�NAMEr�addr�keywords�get�tokensr)r
rrr	r(rrrr#�s
zParser.classifyc	CsT|jd\}}}|||df}|�|j|�}|dk	r@|d�|�|||f|jd<dS�Nr!)rrr�append)	r
rrr-r	r)r*rrrrrr%�szParser.shiftc	CsB|jd\}}}|d|gf}|||f|jd<|j�|d|f�dS)Nr!r)rr7)	r
rZnewdfar-r	r)r*rrrrrr'�szParser.pushcCs`|j��\}}}|�|j|�}|dk	r\|jrL|jd\}}}|d�|�n||_|j|j_dSr6)rr&rrr7rr)r
ZpopdfaZpopstateZpopnoderr)r*rrrrr&�sz
Parser.pop)N)N)
rrrrr r0r#r%r'r&rrrrrs
 
0	rN)�rrr�objectrrrrr�<module>s

?>