403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.37
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/parso/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/parso/__pycache__/parser.cpython-311.pyc
�

̑�a���dZddlmZmZddlmZddlmZGd�de��Z	Gd�de��Z
Gd	�d
e��ZGd�d��Z
d
�ZGd�d��ZdS)a�
The ``Parser`` tries to convert the available Python code in an easy to read
format, something like an abstract syntax tree. The classes who represent this
tree, are sitting in the :mod:`parso.tree` module.

The Python module ``tokenize`` is a very important part in the ``Parser``,
because it splits the code into different words (tokens).  Sometimes it looks a
bit messy. Sorry for that! You might ask now: "Why didn't you use the ``ast``
module for this? Well, ``ast`` does a very good job understanding proper Python
code, but fails to work as soon as there's a single line of broken code.

There's one important optimization that needs to be known: Statements are not
being parsed completely. ``Statement`` is just a representation of the tokens
within the statement. This lowers memory usage and cpu time and reduces the
complexity of the ``Parser`` (there's another parser sitting inside
``Statement``, which produces ``Array`` and ``Call``).
�)�Dict�Type)�tree)�ReservedStringc��eZdZdZd�ZdS)�ParserSyntaxErrorz_
    Contains error information about the parser tree.

    May be raised as an exception.
    c�"�||_||_dS�N)�message�
error_leaf)�selfrrs   �./usr/lib/python3/dist-packages/parso/parser.py�__init__zParserSyntaxError.__init__&s�����$�����N��__name__�
__module__�__qualname__�__doc__r�rrrr s-��������
%�%�%�%�%rrc��eZdZdZd�ZdS)�InternalParseErrorz�
    Exception to signal the parser is stuck and error recovery didn't help.
    Basically this shouldn't happen. It's a sign that something is really
    wrong.
    c
��t�||�d|j�d|�d|����||_t|_||_||_dS)Nz: type=z, value=z, start_pos=)�	Exceptionr�name�msg�type�value�	start_pos)r
r�type_rrs     rrzInternalParseError.__init__2s]�����4��C�C�����U�U�U�I�I�"?�	@�	@�	@������	���
�"����rNrrrrrr+s-��������#�#�#�#�#rrc��eZdZd�ZdS)�Stackc�<���fd�}t|����S)Nc3��K�t���D]C}|jjD]%}t|t��r
|jV��!|V��&|jjsdS�DdSr
)�reversed�dfa�transitions�
isinstancerr�is_final)�
stack_node�
transitionr
s  �r�iteratez@Stack._allowed_transition_names_and_token_types.<locals>.iterate=s������&�t�n�n�
�
�
�",�.�"<�)�)�J�!�*�n�=�=�)�(�.�.�.�.�.�(�(�(�(�(�!�~�.���E�E��
�
r)�list)r
r,s` r�)_allowed_transition_names_and_token_typesz/Stack._allowed_transition_names_and_token_types<s0���
	�
	�
	�
	�
	��G�G�I�I���rN)rrrr.rrrr"r";s#������
�
�
�
�
rr"c�0�eZdZd�Zed���Zd�ZdS)�	StackNodec�"�||_g|_dSr
)r&�nodes)r
r&s  rrzStackNode.__init__Ms�������
�
�
rc��|jjSr
)r&�	from_rule�r
s r�nonterminalzStackNode.nonterminalQs
���x�!�!rc�@�|jj�d|j�d|j�d�S)N�(z, �))�	__class__rr&r2r5s r�__repr__zStackNode.__repr__Us&��#�~�6�6�6�����$�*�*�*�M�MrN)rrrr�propertyr6r;rrrr0r0LsR����������"�"��X�"�N�N�N�N�Nrr0c�Z�|jjr	|j|S#t$rYnwxYw|Sr
)r�contains_syntax�reserved_syntax_strings�KeyError)�grammarr rs   r�_token_to_transitionrBYsI���{�"��	��2�5�9�9���	�	�	��D�	�����Ls��
(�(c���eZdZUdZiZeeeej	fe
d<ejZiZ
eeeejfe
d<ejZdd�Zd�Zd�Zd	�Zd
�Zd�Zd�Zd
S)�
BaseParseraIParser engine.

    A Parser instance contains state pertaining to the current token
    sequence, and should not be used concurrently by different threads
    to parse separate token sequences.

    See python/tokenize.py for how to get input tokens by a string.

    When a syntax error occurs, error_recovery() is called.
    �node_map�leaf_map�
file_inputFc�0�||_||_||_dSr
)�
_pgen_grammar�_start_nonterminal�_error_recovery)r
�pgen_grammar�start_nonterminal�error_recoverys    rrzBaseParser.__init__ws ��)���"3���-����rc���|jj|jd}tt	|��g��|_|D]}|�|���	|jd}|jjs!td|j
|j|j���t|j��dkr|���n |�|j|j��S��)NrT���zincomplete input�)rI�nonterminal_to_dfasrJr"r0�stack�
_add_tokenr&r)rr�stringr�len�_pop�convert_noder6r2)r
�tokens�	first_dfa�token�toss     r�parsezBaseParser.parse|s����&�:�4�;R�S�TU�V�	��I�i�0�0�1�2�2��
��	#�	#�E��O�O�E�"�"�"�"�
	E��*�R�.�C��7�#�
�)�&��
�E�L�%�/�����4�:����"�"��	�	������(�(���#�)�D�D�D�
	Erc��|jrtd���|\}}}}tj||||��}t	d|���)Nz!Error Recovery is not implementedzSyntaxError: invalid syntax)rK�NotImplementedErrorr�	ErrorLeafr)r
r[r rr�prefixrs       rrNzBaseParser.error_recovery�sQ����	O�%�&I�J�J�J�.3�+�E�5�)�V����u�i��H�H�J�#�$A�:�N�N�Nrc��	|j||��}n&#t$r|�||��}YnwxYw|Sr
)rEr@�default_node)r
r6�children�nodes    rrXzBaseParser.convert_node�sX��	<�-�4�=��-�h�7�7�D�D���	<�	<�	<��$�$�[�(�;�;�D�D�D�	<�����s�� <�<c��	|j||||��S#t$r|�|||��cYSwxYwr
)rFr@�default_leaf)r
r rrars     r�convert_leafzBaseParser.convert_leaf�s[��	?�'�4�=��'��y�&�A�A�A���	?�	?�	?��$�$�U�I�v�>�>�>�>�>�	?���s��!>�>c�J�|j}|j}|\}}}}t|||��}		|djj|}	nk#t
$rB|djjr|���n|�|��YdSYnt$rtd|||���wxYw��|	j|d_|	jD]$}
|�
t|
�����%|�||||��}|dj�
|��dS)z�
        This is the only core function for parsing. Here happens basically
        everything. Everything is well prepared by the parser generator and we
        only apply the necessary steps here.
        TrPNztoo much input)rIrSrBr&r'r@r)rWrN�
IndexErrorr�next_dfa�
dfa_pushes�appendr0rhr2)r
r[rArSr rrrar+�plan�push�leafs            rrTzBaseParser._add_token�sX���$���
��*/�'��u�i��)�'�5�%�@�@�
�	T�

T��R�y�}�0��<�����
�
�
���9�=�)���I�I�K�K�K�K��'�'��.�.�.��F�F� �K��
T�
T�
T�(�)9�5�%��S�S�S�
T����	T��
��b�	�
��O�	*�	*�D��L�L��4���)�)�)�)�� � ���v�y�A�A��
�b�	����t�$�$�$�$�$s�A�AB)�
B)c��|j���}t|j��dkr|jd}n%|�|jj|j��}|jdj�|��dS)NrQrrP)rS�poprVr2rXr&r4rm)r
r\�new_nodes   rrWzBaseParser._pop�st���j�n�n����
�s�y�>�>�Q����y��|�H�H��(�(���):�C�I�F�F�H��
�2���#�#�H�-�-�-�-�-rN)rGF)rrrrrEr�strrr�BaseNode�__annotations__�NodercrF�Leafrgrr]rNrXrhrTrWrrrrDrDes��������	�	�02�H�d�3��T�]�+�+�,�1�1�1��9�L�+-�H�d�3��T�Y��'�(�-�-�-��9�L�.�.�.�.�
E�E�E�,O�O�O����?�?�?�%�%�%�@.�.�.�.�.rrDN)r�typingrr�parsor�parso.pgen2.generatorrrrrr-r"r0rBrDrrr�<module>r|sF����"��������������0�0�0�0�0�0�%�%�%�%�%�	�%�%�%�
#�
#�
#�
#�
#��
#�
#�
#� �����D����"
N�
N�
N�
N�
N�
N�
N�
N�	�	�	�m.�m.�m.�m.�m.�m.�m.�m.�m.�m.r

Youez - 2016 - github.com/yon3zu
LinuXploit