Your IP : 18.117.254.202


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/pycparser/ply/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/pycparser/ply/__pycache__/yacc.cpython-311.pyc

�

P�Dgk�
���ddlZddlZddlZddlZddlZddlZddlZdZdZ	dZ
dZdZdZ
dZdZd	ZdZejddkreZneZejZGd
�de��ZGd�d
e��ZGd�de��Zd�Zd�Zdada da!dZ"d�Z#d�Z$d�Z%d�Z&Gd�d��Z'Gd�d��Z(Gd�d��Z)ej*d��Z+Gd�de��Z,Gd �d!e��Z-Gd"�d#e��Z.d$�Z/Gd%�d&e��Z0Gd'�d(e��Z1Gd)�d*e��Z2Gd+�d,e��Z3d-�Z4d.�Z5Gd/�d0e��Z6Gd1�d2e3��Z7d3�Z8d4�Z9Gd5�d6e��Z:de
deddddeddddf
d7�Z;dS)8�Nz3.10Tz
parser.out�parsetab�LALR�F�(c�.�eZdZd�Zd�ZeZd�Zd�ZeZdS)�	PlyLoggerc��||_dS�N)�f)�selfrs  �r/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/pycparser/ply/yacc.py�__init__zPlyLogger.__init__ns
�������c�F�|j�||zdz��dS)N�
�r�write�r�msg�args�kwargss    r
�debugzPlyLogger.debugqs%������c�D�j�D�(�)�)�)�)�)rc�L�|j�d||zzdz��dS)Nz	WARNING: rrrs    r
�warningzPlyLogger.warningvs*������[�C�$�J�/�$�6�7�7�7�7�7rc�L�|j�d||zzdz��dS)NzERROR: rrrs    r
�errorzPlyLogger.errorys*������Y�#��*�-��4�5�5�5�5�5rN)	�__name__�
__module__�__qualname__rr�inforr�critical�rr
rrmsX���������*�*�*��D�8�8�8�6�6�6��H�H�Hrrc��eZdZd�Zd�ZdS)�
NullLoggerc��|Sr
r")r�names  r
�__getattribute__zNullLogger.__getattribute__�����rc��|Sr
r")rrrs   r
�__call__zNullLogger.__call__�r(rN)rrrr'r*r"rr
r$r$s2�������������rr$c��eZdZdS)�	YaccErrorN�rrrr"rr
r,r,���������Drr,c���t|��}d|vrt|��}t|��tkr|dt�dz}dt|��jt|��|fz}|S)Nrz ...z<%s @ 0x%x> (%s))�repr�len�resultlimit�typer�id)�r�repr_str�results   r
�
format_resultr8�sl���A�w�w�H��x�����>�>��
�8�}�}�{�"�"��L�[�L�)�F�2��
�4��7�7�#3�R��U�U�H�"E�
E�F��Mrc��t|��}d|vrt|��}t|��dkr|Sdt|��jt	|��fzS)Nr�z<%s @ 0x%x>)r0r1r3rr4)r5r6s  r
�format_stack_entryr;�sX���A�w�w�H��x�����>�>��
�8�}�}�r�������Q��� 0�"�Q�%�%�8�8�8raPLY: Don't use global functions errok(), token(), and restart() in p_error().
Instead, invoke the methods on the associated parser instance:

    def p_error(p):
        ...
        # Use parser.errok(), parser.token(), parser.restart()
        ...

    parser = yacc.yacc()
c�P�tjt��t��Sr
)�warnings�warn�_warnmsg�_errokr"rr
�errokrA�����M�(�����8�8�Orc�P�tjt��t��Sr
)r=r>r?�_restartr"rr
�restartrE�s���M�(�����:�:�rc�P�tjt��t��Sr
)r=r>r?�_tokenr"rr
�tokenrH�rBrc�p�|ja|ja|ja||��}	bbbn#t$rYnwxYw|Sr
)rAr@rHrGrErD�	NameError)�	errorfuncrH�parserr5s    r
�call_errorfuncrM�sY��
�\�F�
�\�F��~�H��	�%���A�
��F�H�H���
�
�
���
�����Hs�&�
3�3c��eZdZd�Zd�ZdS)�
YaccSymbolc��|jSr
�r3�rs r
�__str__zYaccSymbol.__str__�s
���y�rc� �t|��Sr
��strrRs r
�__repr__zYaccSymbol.__repr__�s���4�y�y�rN)rrrrSrWr"rr
rOrO�s2�������������rrOc�R�eZdZd
d�Zd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
dS)�YaccProductionNc�>�||_||_d|_d|_dSr
)�slice�stack�lexerrL)r�sr\s   r
rzYaccProduction.__init__�s"����
���
���
�����rc��t|t��rd�|j|D��S|dkr|j|jS|j|jS)Nc��g|]	}|j��
Sr"��value��.0r^s  r
�
<listcomp>z.YaccProduction.__getitem__.<locals>.<listcomp>�s��3�3�3��A�G�3�3�3rr)�
isinstancer[rbr\�r�ns  r
�__getitem__zYaccProduction.__getitem__�sU���a����	'�3�3�T�Z��]�3�3�3�3�
�!�V�V��:�a�=�&�&��:�a�=�&�&rc�*�||j|_dSr
)r[rb)rrh�vs   r
�__setitem__zYaccProduction.__setitem__�s����
�1�
���rc�4�d�|j||�D��S)Nc��g|]	}|j��
Sr"rarcs  r
rez/YaccProduction.__getslice__.<locals>.<listcomp>�s��1�1�1�A���1�1�1r)r[)r�i�js   r
�__getslice__zYaccProduction.__getslice__�s ��1�1���A�a�C��1�1�1�1rc�*�t|j��Sr
)r1r[rRs r
�__len__zYaccProduction.__len__�s���4�:���rc�:�t|j|dd��S)N�linenor��getattrr[rgs  r
ruzYaccProduction.lineno����t�z�!�}�h��2�2�2rc�*�||j|_dSr
)r[ru)rrhrus   r
�
set_linenozYaccProduction.set_linenos��%��
�1�
���rc�z�t|j|dd��}t|j|d|��}||fS)Nrur�	endlinenorv)rrh�	startline�endlines    r
�linespanzYaccProduction.linespans;���D�J�q�M�8�Q�7�7�	��$�*�Q�-��i�@�@���'�!�!rc�:�t|j|dd��S)N�lexposrrvrgs  r
r�zYaccProduction.lexposrxrc�z�t|j|dd��}t|j|d|��}||fS)Nr�r�	endlexposrv)rrh�startpos�endposs    r
�lexspanzYaccProduction.lexspans;���4�:�a�=�(�A�6�6�����A���X�>�>�����rc��t�r
)�SyntaxErrorrRs r
rzYaccProduction.errors���rr
)rrrrrirlrqrsrurzrr�r�rr"rr
rYrY�s�����������'�'�'� � � �2�2�2����3�3�3�&�&�&�"�"�"�
3�3�3� � � �
����rrYc�L�eZdZd�Zd�Zd�Zd�Zd�Zdd�Zdd	�Z	dd
�Z
dd�ZdS)
�LRParserc��|j|_|j|_|j|_||_|���d|_dS�NT)	�lr_productions�productions�	lr_action�action�lr_goto�gotorK�set_defaulted_states�errorok)r�lrtab�errorfs   r
rzLRParser.__init__sC�� �/����o����M��	�����!�!�#�#�#�����rc��d|_dSr�)r�rRs r
rAzLRParser.errok&s
������rc��|jdd�=|jdd�=t��}d|_|j�|��|j�d��dS)N�$endr)�
statestack�symstackrOr3�append)r�syms  r
rEzLRParser.restart)s`���O�A�A�A���M�!�!�!���l�l������
���S�!�!�!�����q�!�!�!�!�!rc���i|_|j���D]U\}}t|�����}t|��dkr|ddkr|d|j|<�VdS�N�r)�defaulted_statesr��items�list�valuesr1)r�state�actions�ruless    r
r�zLRParser.set_defaulted_states9sy�� "���"�k�/�/�1�1�	8�	8�N�E�7�����)�)�*�*�E��5�z�z�Q���5��8�a�<�<�/4�Q�x��%�e�,��	8�	8rc��i|_dSr
)r�rRs r
�disable_defaulted_statesz!LRParser.disable_defaulted_states@s�� "����rNFc�
�|strGt|t��rttj��}|�|||||��S|r|�|||||��S|�|||||��Sr
)	�	yaccdevelrf�intr�sys�stderr�
parsedebug�parseopt�parseopt_notrack)r�inputr]r�tracking�	tokenfuncs      r
�parsezLRParser.parseCs����	S�I�	S��%��%�%�
.�!�#�*�-�-���?�?�5�%���)�L�L�L�
�	S��=�=���u�h�	�J�J�J��(�(���u�h�	�R�R�Rrc��d}g}|j}|j}	|j}
|j}t	d��}d}
|�d��|s
ddlm}|j}||_||_	|�|�
|��|�|j}n|}||_g}||_g}||_
||_d}|�d��t!��}d|_|�|��d}	|�d��|�d|��||vr]|s8|s|��}n|���}|st!��}d|_|j}||�|��}n ||}|�d	||��|�d
d�d�|D��dd����d
t-|���������|��|dkrM|�|��|}|�d|��|�|��d}|
r|
dz}
��b|dk�rY|
|}|j}|j}t!��}||_d|_|r_|�d|jdd�d�||d�D����zdz|	|d|z
|��n/|�d|jg|	|d|��|�r�||dz
d�}||d<|r^|d}|j|_|j|_|d}t;|d|j��|_t;|d|j��|_||_ 	||d�=||_!|�"|��||d�=|�dtG|d����|�|��|	|d|}|�|��n|#tH$ro|�|��|�%|dd���|���|d}d|_d|_|}tL}
d|_'YnwxYw���|r|j|_|j|_|g}||_ 	||_!|�"|��|�dtG|d����|�|��|	|d|}|�|��n_#tH$rR|�|��|���|d}d|_d|_|}tL}
d|_'YnwxYw���|dkrS|d}t;|dd��}|�dtG|����|�d��|S|���|�(dd�d�|D��dd����d
t-|���������|
dks|j'r�tL}
d|_'|}|jdkrd}|j)rD|rtU|d��s||_||_!tW|j)||��}|j'r|}d}���n�|rntU|d ��r|j}nd}|r*tXj-�.d!||jfz��nPtXj-�.d"|jz��n(tXj-�.d#��dStL}
t3|��dkr|jdkr
d}d}d}|dd�=���|jdkrdS|jdkr�|d}|jdkr<|r6t;|d |j��|_t;|d$|j��|_d}��t!��}d|_tU|d ��r|jx|_|_tU|d$��r|jx|_|_||_|�|��|}nJ|���}|r|j|_|j|_|���|d}���t_d%���)&NrzPLY: PARSE DEBUG STARTr���lexr�T�zState  : %sz#Defaulted state %s: Reduce using %dzStack  : %s� c��g|]	}|j��
Sr"rQ�rd�xxs  r
rez'LRParser.parsedebug.<locals>.<listcomp>�s��/K�/K�/K�B���/K�/K�/Krz . z Action : Shift and goto state %sz3Action : Reduce rule [%s] with %s and goto state %d�[�,c�6�g|]}t|j����Sr")r;rb)rd�_vs  r
rez'LRParser.parsedebug.<locals>.<listcomp>�s$��0i�0i�0i�RT�1C�B�H�1M�1M�0i�0i�0ir�]���r|r�zResult : %srFrbzDone   : Returning %szPLY: PARSE DEBUG ENDzError  : %sc��g|]	}|j��
Sr"rQr�s  r
rez'LRParser.parsedebug.<locals>.<listcomp>Bs��3O�3O�3O��B�G�3O�3O�3Orr]ru�(yacc: Syntax error at line %d, token=%s
�yacc: Syntax error, token=%s� yacc: Parse error in input. EOF
r��yacc: internal parser error!!!
)0r�r�r�r�rYr r�r�r]rLr�rHr�r�r\r�rOr3r�pop�get�joinrV�lstripr&r1rbrur�rwr|r�r[r��callabler8r��extend�error_countr�rrK�hasattrrMr�r�r�RuntimeError� rr�r]rr�r��	lookahead�lookaheadstackr�r��prodr��pslice�
errorcountr��	get_tokenr�r��errtokenr�r��ltype�t�p�pname�plen�targ�t1rhr7�tokrus                                 r
r�zLRParser.parsedebug\s�	���	����+���)���"���0�� ��&�&���
�	�
�
�+�,�,�,��	��������I�E������
����K�K���������I�I�!�I���
��
�$����� ��
������	���!�����l�l��������������Y	C�
�K�K��O�O�O��K�K�
�u�-�-�-��,�,�,� �0�)�9�$-�I�K�K�	�	�$2�$6�$6�$8�$8�	�$�0�$.�L�L�	�)/�	��"����E�N�&�&�u�-�-���$�U�+�����A�5�1�"�M�M�M�
�K�K�
�&)�h�h�/K�/K�(�/K�/K�/K�A�B�B�/O�&P�&P�&P�&P�RU�V_�R`�R`�R`�a�i�i�k�k�
m�
m�
m��}��q�5�5��%�%�a�(�(�(��E��K�K� B�A�F�F�F��O�O�I�.�.�.� $�I�"�(�"�a��
���q�5�5��a�R��A��F�E��E�D�%�,�,�C�$�C�H� $�C�I��@��
�
�#X�Z[�Z_�#&�s�x�x�0i�0i�X`�bf�af�ag�ag�Xh�0i�0i�0i�'j�'j�#j�kn�#n�#'�
�2�d�7�(;�#<�U�#C�E�E�E�E��
�
�#X�Z[�Z_�ac�#'�
�2��#7��#>�@�@�@�
�V!�'���a����1��"%��Q��$�P�!%�a��B�)+��C�J�)+��C�J�!%�b��B�,3�B��R�Y�,O�,O�C�M�,3�B��R�Y�,O�,O�C�M�(,���1� (�$���� 0�).�D�J��J�J�v�.�.�.� *�D�5�6�6� 2�!�J�J�}�m�F�1�I�6N�6N�O�O�O�$�O�O�C�0�0�0�$(��B��$8��$?�E�&�-�-�e�4�4�4�4��*�
1�
1�
1�*�1�1�)�<�<�<�$�O�O�D��2��J�7�7�7�&�N�N�,�,�,�$.�r�N�E�'.�C�H�(/�C�I�(+�I�)4�J�+0�D�L�L�L�
1����!�$�6�).��C�J�).��C�J�!$�u��(,���1�).�D�J��J�J�v�.�.�.�!�J�J�}�m�F�1�I�6N�6N�O�O�O�$�O�O�C�0�0�0�$(��B��$8��$?�E�&�-�-�e�4�4�4�4��*�	1�	1�	1�*�1�1�)�<�<�<�&�N�N�,�,�,�$.�r�N�E�'.�C�H�(/�C�I�(+�I�)4�J�+0�D�L�L�L�	1����!���6�6� ���A�$�Q���6�6�F��J�J�6�
�f�8M�8M�N�N�N��J�J�5�6�6�6�!�M��y����M�*-�(�(�3O�3O�h�3O�3O�3O�PQ�PR�PR�3S�*T�*T�*T�*T�VY�Zc�Vd�Vd�Vd�e�m�m�o�o�q�q�q���?�?�d�l�?�!,�J�#(�D�L�(�H��}��.�.�#'���~�#�#�3�G�H�g�,F�,F�3�-2�H�N�%*��
�,�T�^�X�t�L�L���<�%�),�I�'+�H�$�
%�$�#�&�x��:�:�+�)2�)9���)*��%�a� #�
� 0� 0�1\�`f�hp�hu�_v�1v� w� w� w� w� #�
� 0� 0�1O�RZ�R_�1_� `� `� `� `��J�,�,�-P�Q�Q�Q�"�F�"-�J��z�?�?�a�'�'�I�N�f�,D�,D� $�I�#�H��E�&�q�q�q�)���>�V�+�+��F��>�W�,�,�"�2�,�C��x�7�*�*�$�U�,3�I�x���,T�,T�C�M�,3�I�x���,T�,T�C�M�$(�	� �#���A�$�A�F��y�(�3�3�B�1:�1A�A���1�;��y�(�3�3�B�1:�1A�A���1�;�'�A�G�"�)�)�)�4�4�4� !�I�I�"�,�,�.�.�C��6�+.�:�	�(�+.�:�	�(��N�N�$�$�$�&�r�N�E���A�B�B�Bs(�BP$�$A6R�R�BU�AV'�&V'c�(
�d}g}|j}|j}	|j}
|j}t	d��}d}
|s
ddlm}|j}||_||_|�|�	|��|�|j
}n|}||_
g}||_g}||_||_
d}|�d��t��}d|_|�|��d}	||vr]|s8|s|��}n|���}|st��}d|_|j}||�|��}n||}|���|dkr6|�|��|}|�|��d}|
r|
dz}
��|dk�rw|
|}|j}|j}t��}||_d|_|�r`||dz
d�}||d<|r^|d}|j|_|j|_|d}t1|d|j��|_t1|d|j��|_||_	||d�=||_|�|��||d�=|�|��|	|d|}|�|��n|#t<$ro|�|��|�|dd���|���|d}d	|_d	|_|}t@}
d
|_!YnwxYw��F|r|j|_|j|_|g}||_	||_|�|��|�|��|	|d|}|�|��n_#t<$rR|�|��|���|d}d	|_d	|_|}t@}
d
|_!YnwxYw��'|dkr|d}t1|dd��}|S|��e|
dks|j!r�t@}
d
|_!|}|jdkrd}|j"rD|rtG|d��s||_||_tI|j"||��}|j!r|}d}���n�|rntG|d
��r|j}nd}|r*tJj&�'d||jfz��nPtJj&�'d|jz��n(tJj&�'d��dSt@}
t)|��dkr|jdkr
d}d}d}|dd�=���|jdkrdS|jd	kr�|d}|jd	kr<|r6t1|d
|j��|_t1|d|j��|_d}���t��}d	|_tG|d
��r|jx|_|_tG|d��r|jx|_|_||_|�|��|}nJ|���}|r|j|_|j|_|���|d}���tQd���)Nrr�r�r�Tr�r|r�rFrbr]rur�r�r�r�r�))r�r�r�r�rYr�r�r]rLr�rHr�r�r\r�rOr3r�r�r&r1rbrur�rwr|r�r[r�r�r�r�r�r�rKr�rMr�r�rr�r�s                                 r
r�zLRParser.parseopt�s����	����+���)���"���0�� ��&�&���
��	��������I�E������
����K�K���������I�I�!�I���
��
�$����� ��
������	���!�����l�l��������������s	C��,�,�,� �0�)�9�$-�I�K�K�	�	�$2�$6�$6�$8�$8�	�$�0�$.�L�L�	�)/�	��"����E�N�&�&�u�-�-���$�U�+���}��q�5�5��%�%�a�(�(�(��E��O�O�I�.�.�.� $�I�"�(�"�a��
���q�5�5��a�R��A��F�E��E�D�%�,�,�C�$�C�H� $�C�I��P!�'���a����1��"%��Q��$�P�!%�a��B�)+��C�J�)+��C�J�!%�b��B�,3�B��R�Y�,O�,O�C�M�,3�B��R�Y�,O�,O�C�M�(,���1� (�$���� 0�).�D�J��J�J�v�.�.�.� *�D�5�6�6� 2�$�O�O�C�0�0�0�$(��B��$8��$?�E�&�-�-�e�4�4�4�4��*�
1�
1�
1�*�1�1�)�<�<�<�$�O�O�D��2��J�7�7�7�&�N�N�,�,�,�$.�r�N�E�'.�C�H�(/�C�I�(+�I�)4�J�+0�D�L�L�L�
1����!�$�6�).��C�J�).��C�J�!$�u��(,���1�).�D�J��J�J�v�.�.�.�$�O�O�C�0�0�0�$(��B��$8��$?�E�&�-�-�e�4�4�4�4��*�	1�	1�	1�*�1�1�)�<�<�<�&�N�N�,�,�,�$.�r�N�E�'.�C�H�(/�C�I�(+�I�)4�J�+0�D�L�L�L�	1����!���6�6� ���A�$�Q���6�6�F�!�M��y���?�?�d�l�?�!,�J�#(�D�L�(�H��}��.�.�#'���~�#�#�3�G�H�g�,F�,F�3�-2�H�N�%*��
�,�T�^�X�t�L�L���<�%�),�I�'+�H�$�
%�$�#�&�x��:�:�+�)2�)9���)*��%�a� #�
� 0� 0�1\�`f�hp�hu�_v�1v� w� w� w� w� #�
� 0� 0�1O�RZ�R_�1_� `� `� `� `��J�,�,�-P�Q�Q�Q�"�F�"-�J��z�?�?�a�'�'�I�N�f�,D�,D� $�I�#�H��E�&�q�q�q�)���>�V�+�+��F��>�W�,�,�"�2�,�C��x�7�*�*�$�U�,3�I�x���,T�,T�C�M�,3�I�x���,T�,T�C�M�$(�	� �#���A�$�A�F��y�(�3�3�B�1:�1A�A���1�;��y�(�3�3�B�1:�1A�A���1�;�'�A�G�"�)�)�)�4�4�4� !�I�I�"�,�,�.�.�C��6�+.�:�	�(�+.�:�	�(��N�N�$�$�$�&�r�N�E���A�B�B�Bs(�6A&J�A6L�L�AN�AO7�6O7c��d}g}|j}|j}	|j}
|j}t	d��}d}
|s
ddlm}|j}||_||_|�|�	|��|�|j
}n|}||_
g}||_g}||_||_
d}|�d��t��}d|_|�|��d}	||vr]|s8|s|��}n|���}|st��}d|_|j}||�|��}n||}|��a|dkr6|�|��|}|�|��d}|
r|
dz}
��|dk�r�|
|}|j}|j}t��}||_d|_|�r||dz
d�}||d<||_	||d�=||_|�|��||d�=|�|��|	|d|}|�|��n|#t2$ro|�|��|�|dd���|���|d}d|_d|_|}t6}
d|_YnwxYw���|g}||_	||_|�|��|�|��|	|d|}|�|��n_#t2$rR|�|��|���|d}d|_d|_|}t6}
d|_YnwxYw���|dkr|d}t;|d	d��}|S|��|
dks|jr�t6}
d|_|}|jdkrd}|jrD|rt?|d
��s||_||_tA|j||��}|jr|}d}��En�|rnt?|d��r|j!}nd}|r*tDj#�$d||jfz��nPtDj#�$d
|jz��n(tDj#�$d��dSt6}
t)|��dkr|jdkr
d}d}d}|dd�=��	|jdkrdS|jdkr�|d}|jdkrd}��8t��}d|_t?|d��r|j!x|_!|_%t?|d��r|j&x|_&|_'||_|�|��|}n0|���}|���|d}���tQd���)Nrr�r�r�Tr�rFrbr]rur�r�r�r�r�))r�r�r�r�rYr�r�r]rLr�rHr�r�r\r�rOr3r�r�r&r1rbr[r�r�r�r�r�r�rwrKr�rMrur�r�rr|r�r�r�)rr�r]rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rhr7r�rus                               r
r�zLRParser.parseopt_notrack�s����	����+���)���"���0�� ��&�&���
��	��������I�E������
����K�K���������I�I�!�I���
��
�$����� ��
������	���!�����l�l��������������[	C��,�,�,� �0�)�9�$-�I�K�K�	�	�$2�$6�$6�$8�$8�	�$�0�$.�L�L�	�)/�	��"����E�N�&�&�u�-�-���$�U�+���}��q�5�5��%�%�a�(�(�(��E��O�O�I�.�.�.� $�I�"�(�"�a��
���q�5�5��a�R��A��F�E��E�D�%�,�,�C�$�C�H� $�C�I��B!�'���a����1��"%��Q��(,���1� (�$���� 0�).�D�J��J�J�v�.�.�.� *�D�5�6�6� 2�$�O�O�C�0�0�0�$(��B��$8��$?�E�&�-�-�e�4�4�4�4��*�
1�
1�
1�*�1�1�)�<�<�<�$�O�O�D��2��J�7�7�7�&�N�N�,�,�,�$.�r�N�E�'.�C�H�(/�C�I�(+�I�)4�J�+0�D�L�L�L�
1����!�!$�u��(,���1�).�D�J��J�J�v�.�.�.�$�O�O�C�0�0�0�$(��B��$8��$?�E�&�-�-�e�4�4�4�4��*�	1�	1�	1�*�1�1�)�<�<�<�&�N�N�,�,�,�$.�r�N�E�'.�C�H�(/�C�I�(+�I�)4�J�+0�D�L�L�L�	1����!���6�6� ���A�$�Q���6�6�F�!�M��y���?�?�d�l�?�!,�J�#(�D�L�(�H��}��.�.�#'���~�#�#�3�G�H�g�,F�,F�3�-2�H�N�%*��
�,�T�^�X�t�L�L���<�%�),�I�'+�H�$�
%�$�#�&�x��:�:�+�)2�)9���)*��%�a� #�
� 0� 0�1\�`f�hp�hu�_v�1v� w� w� w� w� #�
� 0� 0�1O�RZ�R_�1_� `� `� `� `��J�,�,�-P�Q�Q�Q�"�F�"-�J��z�?�?�a�'�'�I�N�f�,D�,D� $�I�#�H��E�&�q�q�q�)���>�V�+�+��F��>�W�,�,�"�2�,�C��x�7�*�*�%)�	� �#���A�$�A�F��y�(�3�3�B�1:�1A�A���1�;��y�(�3�3�B�1:�1A�A���1�;�'�A�G�"�)�)�)�4�4�4� !�I�I�"�,�,�.�.�C��N�N�$�$�$�&�r�N�E���A�B�B�Bs(�A&H=�=A6J6�5J6�AL!�!AM=�<M=)NNFFN)rrrrrArEr�r�r�r�r�r�r"rr
r�r�s�������������"�"�"� 8�8�8�#�#�#�S�S�S�S�2OC�OC�OC�OC�v
fC�fC�fC�fC�d	NC�NC�NC�NC�NC�NCrr�z^[a-zA-Z0-9_-]+$c�D�eZdZdZd
d�Zd�Zd�Zd�Zd	�Zd
�Z	d�Z
d�ZdS)�
Productionr��rightrNr�c���||_t|��|_||_||_d|_||_||_||_t|j��|_	g|_
|jD]%}||j
vr|j
�|���&g|_d|_
|jr+|j�dd�|j����|_dSd|jz|_dS�N� -> r�z
%s -> <empty>)r&�tupler��number�funcr��file�line�precr1�usymsr��lr_items�lr_nextr�rV)	rr�r&r��
precedencer�r�r�r^s	         r
rzProduction.__init__s�����	��d����	������	���
���	���	�"��	���	�N�N�����
���	%�	%�A���
�"�"��
�!�!�!�$�$�$����
�����9�	3�%)�Y�Y�Y������0C�0C�0C�D�D�H�H�H�&���2�D�H�H�Hrc��|jSr
rUrRs r
rSzProduction.__str__=�	���x�rc�,�dt|��zdzS)NzProduction(�)rUrRs r
rWzProduction.__repr__@s���s�4�y�y�(�3�.�.rc�*�t|j��Sr
)r1r�rRs r
rszProduction.__len__Cs���4�9�~�~�rc��dS�Nr�r"rRs r
�__nonzero__zProduction.__nonzero__Fs���qrc��|j|Sr
)r��r�indexs  r
rizProduction.__getitem__Is���y���rc�6�|t|j��krdSt||��}	t|j|dz|_n#t
tf$r
g|_YnwxYw	|j|dz
|_n#t
$r
d|_YnwxYw|Sr�)r1r��LRItem�	Prodnames�lr_after�
IndexError�KeyError�	lr_before)rrhr�s   r
�lr_itemzProduction.lr_itemMs����s�4�9�~�~����4��4��O�O��	�"�1�6�!�A�#�;�/�A�J�J���H�%�	�	�	��A�J�J�J�	����	��&��1��+�A�K�K���	�	�	��A�K�K�K�	�����s#� A
�
A(�'A(�,B�B�Bc�<�|jr||j|_dSdSr
�r�r��r�pdicts  r
�bindzProduction.bind]�(���9�	-�!�$�)�,�D�M�M�M�	-�	-r)r�Nr�r)rrr�reducedrrSrWrsr�rirrr"rr
r�r�s��������G�3�3�3�3�<���/�/�/������� � � �
�
�
� -�-�-�-�-rr�c�&�eZdZd�Zd�Zd�Zd�ZdS)�MiniProductionc�h�||_||_||_d|_||_||_||_dSr
)r&r1r�r�r�r�rV)rrVr&r1r�r�r�s       r
rzMiniProduction.__init__fs7����	������	���
���	���	�����rc��|jSr
rUrRs r
rSzMiniProduction.__str__or�rc��d|jzS)NzMiniProduction(%s)rUrRs r
rWzMiniProduction.__repr__rs��#�d�h�.�.rc�<�|jr||j|_dSdSr
r	r
s  r
rzMiniProduction.bindvr
rN)rrrrrSrWrr"rr
rresP������������/�/�/�-�-�-�-�-rrc� �eZdZd�Zd�Zd�ZdS)rc�6�|j|_t|j��|_|j|_||_i|_|j�|d��t|j��|_t|j��|_|j	|_	dS)N�.)
r&r�r�r��lr_index�
lookaheads�insertr�r1r�)rr�rhs   r
rzLRItem.__init__�sv���&��	��q�v�,�,��	��(�����
�����	����C� � � ���	�*�*��	��d�i�.�.����'��
�
�
rc�r�|jr%|j�dd�|j����}n
d|jz}|Sr�)r�r&r�)rr^s  r
rSzLRItem.__str__�s@���9�	,�"�i�i�i����$�)�)<�)<�)<�=�A�A��$�)�+�A��rc�,�dt|��zdzS)NzLRItem(r�rUrRs r
rWzLRItem.__repr__�s���3�t�9�9�$�s�*�*rN)rrrrrSrWr"rr
rr�sA������	"�	"�	"����+�+�+�+�+rrc�p�t|��dz
}|dkr|||vr||S|dz}|dk�dSr�)r1)�symbols�	terminalsros   r
�rightmost_terminalr �sO���G���q��A�
�q�&�&��1�:��"�"��1�:��	�Q����q�&�&��4rc��eZdZdS)�GrammarErrorNr-r"rr
r"r"�r.rr"c�t�eZdZd�Zd�Zd�Zd�Zdd�Zdd	�Zd
�Z	d�Z
d�Zd
�Zd�Z
d�Zd�Zd�Zdd�Zd�ZdS)�Grammarc���dg|_i|_i|_i|_|D]}g|j|<�
g|jd<i|_i|_i|_i|_t��|_	d|_
dS�Nr)�Productionsr�Prodmap�	Terminals�Nonterminals�First�Follow�
Precedence�set�UsedPrecedence�Start)rr�terms   r
rzGrammar.__init__�s���!�F�������������	&�	&�D�#%�D�N�4� � �"$���w�������
�������"�e�e�����
�
�
rc�*�t|j��Sr
)r1r'rRs r
rszGrammar.__len__�s���4�#�$�$�$rc��|j|Sr
)r'r�s  r
rizGrammar.__getitem__�s�����&�&rc��|jdgks
Jd���||jvrtd|z���|dvrtd���||f|j|<dS)Nz2Must call set_precedence() before add_production()z,Precedence already specified for terminal %r)�leftr��nonassocz:Associativity must be one of 'left','right', or 'nonassoc')r'r-r")rr1�assoc�levels    r
�set_precedencezGrammar.set_precedence�st����D�6�)�)�)�+_�)�)�)��4�?�"�"��M�PT�T�U�U�U��5�5�5��[�\�\�\�!&��������rNr�rc	�d�||jvrtd|||fz���|dkrtd|||fz���t�|��std|||fz���t	|��D]�\}}|ddvrb	t|��}t
|��dkrtd||||fz���||jvr
g|j|<|||<�a#t$rYnwxYwt�|��s|d	krtd
||||fz�����d	|vr�|dd	krtd||fz���|d
d	krtd||fz���|d}	|j�	|	��}
|
std|||	fz���|j
�|	��|d
d�=n0t||j��}	|j�	|	d��}
|�d|��}||j
vr4|j
|}td|||fzd|j|jfzz���t
|j��}
||jvr
g|j|<|D]_}||jvr!|j|�|
���,||jvr
g|j|<|j|�|
���`t'|
|||
|||��}|j�|��||j
|<	|j|�|��dS#t*$r|g|j|<YdSwxYw)Nz7%s:%d: Illegal rule name %r. Already defined as a tokenrz5%s:%d: Illegal rule name %r. error is a reserved wordz%s:%d: Illegal rule name %rrz'"r�zA%s:%d: Literal token %s in rule %r may only be a single characterz%precz!%s:%d: Illegal name %r in rule %rr�z+%s:%d: Syntax error. Nothing follows %%prec���zH%s:%d: Syntax error. %%prec can only appear at the end of a grammar rulez/%s:%d: Nothing known about the precedence of %rr�r�z%s:%d: Duplicate rule %s. zPrevious definition at %s:%d)r)r"�_is_identifier�match�	enumerate�evalr1r�r-r�r/�addr r(r�r�r'r*r�r�rr)r�prodname�symsr�r�r�rhr^�c�precname�prodprec�map�m�pnumberr�r�s                r
�add_productionzGrammar.add_production
s���t�~�%�%��X�\`�bf�hp�[q�q�r�r�r��w����V�Z^�`d�fn�Yo�o�p�p�p��#�#�H�-�-�	W��<��d�H�?U�U�V�V�V��d�O�O�	d�	d�D�A�q���t�u�}�}�
��Q���A��A����
�
�*�+n�,0�$��8�+D�,E�F�F�F����.�.�,.���q�)��D��G���"�����D�����!�'�'��*�*�
d�q�G�|�|�"�#F�$�PT�VW�Ya�Ib�#b�c�c�c���d�?�?��B�x�7�"�"�"�#P�TX�Z^�S_�#_�`�`�`��B�x�7�"�"�"�#m�$(�$�<�$0�1�1�1��B�x�H���*�*�8�4�4�H��
2�"�#T�X\�^b�dl�Wm�#m�n�n�n��#�'�'��1�1�1��R�S�S�	�	�*�$���?�?�H���*�*�8�\�B�B�H�%�H�H�d�d�+���$�,�����S�!�A��;�t�T�1�o�M�=�����@P�P� Q�R�R�
R��t�'�(�(���4�,�,�,�*,�D��h�'��	5�	5�A��D�N�"�"���q�!�(�(��1�1�1�1��D�-�-�-�+-�D�%�a�(��!�!�$�+�+�G�4�4�4�4�
�w��$��$��d�K�K�������"�"�"����S��	+��N�8�$�+�+�A�.�.�.�.�.���	+�	+�	+�()�s�D�N�8�$�$�$�$�	+���s%�AC�
C&�%C&�4 L�L/�.L/c���|s|jdj}||jvrtd|z���t	dd|g��|jd<|j|�d��||_dS)Nr�zstart symbol %s undefinedr�S')r'r&r*r"r�r�r0)r�starts  r
�	set_startzGrammar.set_startas~���	-��$�Q�'�,�E���)�)�)��:�U�B�C�C�C�(��D�5�'�:�:�������%� �'�'��*�*�*���
�
�
rc��������fd��t�����jdjd���fd��jD��S)Nc���|�vrdS��|���j�|g��D]}|jD]
}�|����dSr
)r@rr�r�)r^r�r5�mark_reachable_from�	reachablers   ���r
rPz5Grammar.find_unreachable.<locals>.mark_reachable_fromtsx����I�~�~����M�M�!�����^�'�'��2�.�.�
+�
+����+�+�A�'�'��*�*�*�*�+�
+�
+rrc���g|]}|�v�|��	Sr"r")rdr^rQs  �r
rez,Grammar.find_unreachable.<locals>.<listcomp>~s#���C�C�C�a���0B�0B��0B�0B�0Br)r.r'r�r*)rrPrQs`@@r
�find_unreachablezGrammar.find_unreachableqsq�����	+�	+�	+�	+�	+�	+�	+��E�E�	���D�,�Q�/�4�Q�7�8�8�8�C�C�C�C�4�,�C�C�C�Crc��i}|jD]}d||<�d|d<|jD]}d||<�	d}|j���D]5\}}|D]-}|jD]}||sd}n�d}|r||sd||<d}n�.�6|sn�Ug}	|���D]5\}}
|
s.||jvr||jvr|dkr� |	�|���6|	S)NTr�Fr)r)r*rr�r�r�)r�
terminatesr�rh�some_change�plr�r^�p_terminates�infiniter1s           r
�infinite_cycleszGrammar.infinite_cycles�si���
���	!�	!�A� �J�q�M�M�!�
�6��
�"�	"�	"�A�!�J�q�M�M�	��K��>�/�/�1�1�
�
���B����A��V�
,�
,��)�!�}�"�,1�L�!�E�	"�(,��#��)�!�}�/�,0�J�q�M�*.�K���
���
��7	�:��#�)�)�+�+�	'�	'�I�Q���
'��D�N�*�*�q���/F�/F�1�PW�<�<���O�O�A�&�&�&���rc��g}|jD]>}|s�|jD]1}||jvr&||jvr|dkr|�||f���2�?|Sr&)r'r�rr)r�)rr7r�r^s    r
�undefined_symbolszGrammar.undefined_symbols�sz�����!�	*�	*�A��
���V�
*�
*���D�N�*�*�q���/F�/F�1�PW�<�<��M�M�1�a�&�)�)�)��
*��
rc��g}|j���D]"\}}|dkr|s|�|���#|Sr&)r)r�r�)r�
unused_tokr^rks    r
�unused_terminalszGrammar.unused_terminals�sP���
��N�(�(�*�*�	%�	%�D�A�q��G�|�|�A�|��!�!�!�$�$�$���rc��g}|j���D]/\}}|s(|j|d}|�|���0|S�Nr)r*r�rr�)r�unused_prodr^rkr�s     r
�unused_ruleszGrammar.unused_rules�s]�����%�+�+�-�-�	&�	&�D�A�q��
&��N�1�%�a�(���"�"�1�%�%�%���rc��g}|jD]<}||jvs1||jvs(|�||j|df���=|Sra)r-r)r/r�)r�unused�termnames   r
�unused_precedencezGrammar.unused_precedence�s]������	H�	H�H����.�.�(�d�>Q�2Q�2Q��
�
�x����)B�1�)E�F�G�G�G���
rc��g}|D]:}d}|j|D]$}|dkrd}�||vr|�|���%|r�9n|�d��|S)NF�<empty>T)r+r�)r�betar7�x�x_produces_emptyrs      r
�_firstzGrammar._first	s������	%�	%�A�$���Z��]�
)�
)���	�>�>�'+�$�$������
�
�a�(�(�(���
����

�M�M�)�$�$�$��
rc�r�|jr|jS|jD]
}|g|j|<�dg|jd<|jD]}g|j|<�
	d}|jD]`}|j|D]P}|�|j��D]3}||j|vr"|j|�|��d}�4�Q�a|sn�n|jS)Nr�TF)r+r)r*rrmr�r�)rr�rhrVr�rs      r
�
compute_firstzGrammar.compute_first,s���:�	��:����	 �	 �A��C�D�J�q�M�M�$�X��
�6��
�"�	�	�A��D�J�q�M�M�		��K��&�
/�
/�����*�/�/�A�!�[�[���0�0�/�/���D�J�q�M�1�1� �J�q�M�0�0��3�3�3�*.�K��/�/�
�
��		��z�rc���|jr|jS|js|���|jD]}g|j|<�
|s|jdj}dg|j|<	d}|jdd�D]�}t
|j��D]�\}}||jvr�|�|j|dzd���}d}|D]A}	|	dkr1|	|j|vr"|j|�	|	��d}|	dkrd}�B|s|t|j��dz
krF|j|jD]3}	|	|j|vr"|j|�	|	��d}�4�݌�|sn��
|jS)Nr�r�TFri)r,r+ror*r'r&r>r�rmr�r1)
rrL�k�didaddr�ro�B�fst�hasemptyrs
          r
�compute_followzGrammar.compute_followQs����;�	��;���z�	!���� � � ��"�	 �	 �A��D�K��N�N��	-��$�Q�'�,�E�$�X���E��	��F��%�a�b�b�)�
2�
2��%�a�f�-�-�2�2�D�A�q��D�-�-�-�"�k�k�!�&��1����,�7�7��#(��!$�0�0�A� �I�~�~�!�4�;�q�>�2I�2I� $��A�� 5� 5�a� 8� 8� 8�)-�� �I�~�~�+/���#�2�q�S���[�[��]�';�';�%)�[���%8�2�2��#$�D�K��N�#:�#:�$(�K��N�$9�$9�!�$<�$<�$<�-1�F���!2�"�
��-	�.�{�rc��|jD]�}|}d}g}	|t|��krd}n~t||��}	|j|j|dz|_n#ttf$r
g|_YnwxYw	|j|dz
|_n#t$r
d|_YnwxYw||_	|sn|�
|��|}|dz
}��||_��dS�NrTr�)r'r1rrr�rrrrr�r�r�)rr��lastlriror��lris      r
�
build_lritemszGrammar.build_lritems�s!���!�	"�	"�A��G��A��H�
��s�1�v�v�:�:��C�C� ��A�,�,�C�*�'+�~�c�h�q��s�m�'D�����&��1�*�*�*�')�����*����-�(+���1��
��
�
��%�-�-�-�(,��
�
�
�-����#&����������$�$�$����Q���)
�*"�A�J�J�3	"�	"s#� A�A4�3A4�8B�B"�!B")Nr�rr
)rrrrrsrir9rIrMrSrZr\r_rcrgrmrorvr{r"rr
r$r$�s ������!�!�!�H%�%�%�'�'�'�/�/�/�2K+�K+�K+�K+�h���� 
D�
D�
D�.7�7�7�@	�	�	�"������"��� ���F���J)�)�)�)�v"�"�"�"�"rr$c��eZdZdS)�VersionErrorNr-r"rr
r}r}�r.rr}c�&�eZdZd�Zd�Zd�Zd�ZdS)�LRTablec�>�d|_d|_d|_d|_dSr
)r�r�r��	lr_methodrRs r
rzLRTable.__init__�s#��������"�������rc�|�t|tj��r|}n$td|z��tj|}|jtkrtd���|j	|_
|j|_g|_
|jD]#}|j
�t!|����$|j|_|jS)N�	import %s�&yacc table file version is out of date)rf�types�
ModuleType�execr��modules�_tabversion�__tabversion__r}�
_lr_actionr��_lr_gotor�r��_lr_productionsr�r�
_lr_methodr��
_lr_signature)r�modulerr�s    r
�
read_tablezLRTable.read_table�s����f�e�.�/�/�	+��H�H���v�%�&�&�&��{�6�*�H���>�1�1��G�H�H�H�!�,����(��� ����)�	;�	;�A���&�&�~�q�'9�:�:�:�:�!�,����%�%rc�v�	ddl}n#t$rddl}YnwxYwtj�|��st�t
|d��}|�|��}|tkrtd���|�|��|_
|�|��}|�|��|_|�|��|_|�|��}g|_
|D]#}|j
�t|����$|���|S)Nr�rbr�)�cPickle�ImportError�pickle�os�path�exists�open�loadr�r}r�r�r�r�r�r�close)r�filenamer��in_f�
tabversion�	signaturer�r�s        r
�read_picklezLRTable.read_pickle�s:��	�$�$�$�$�$���	�	�	��M�M�M�M�M�	�����w�~�~�h�'�'�	��
��H�d�#�#���[�[��&�&�
���'�'��G�H�H�H����T�*�*������T�*�*�	����T�*�*������T�*�*������T�*�*�� ����	;�	;�A���&�&�~�q�'9�:�:�:�:��
�
�����s���c�D�|jD]}|�|���dSr
)r�r)rrr�s   r
�bind_callableszLRTable.bind_callables�s/���$�	�	�A�
�F�F�5�M�M�M�M�	�	rN)rrrrr�r�r�r"rr
rr�sP���������&�&�&�(���8����rrc
�r�i}|D]}d||<�g}i}|D]#}||dkrt|||||||���$|Sra)�traverse)�X�R�FP�Nrkr\�Fs       r
�digraphr�sg��
�A�
������!����E�
�A�
�/�/���Q�4�1�9�9��Q��5�!�Q��2�.�.�.���Hrc
��|�|��t|��}|||<||��||<||��}|D]�}	||	dkrt|	||||||��t||||	��||<|�|	g��D]'}
|
||vr||�|
���(��|||krxt
||d<||||d<|���}||kr?t
||d<||||d<|���}||k�;dSdSdS)Nrr�)r�r1r��minr��MAXINTr�)rkr�r\r�r�r�r��d�rel�y�a�elements            r
r�r�s^��	�L�L��O�O�O��E�
�
�A��A�a�D�
�2�a�5�5�A�a�D�
�!�A�$�$�C�
�����Q�4�1�9�9��Q��5�!�Q��2�.�.�.��1�Q�4��1�����!�����q�"���	�	�A���!��}�}��!����A�����	�	��t�q�y�y���%��)����t��%��)���)�)�+�+����l�l�!�A�e�B�i�L��Q�4�A�e�B�i�L��i�i�k�k�G���l�l�l�l�	�y��lrc��eZdZdS)�	LALRErrorNr-r"rr
r�r�)r.rr�c�t�eZdZdd�Zd�Zd�Zd�Zd�Zd�Zd	�Z	d
�Z
d�Zd�Zd
�Z
d�Zd�Zd�Zdd�Zdd�ZdS)�LRGeneratedTablerNc���|dvrtd|z���||_||_|st��}||_i|_i|_|j|_i|_	i|_
d|_d|_d|_
g|_g|_g|_|j���|j���|j���|���dS)N)�SLRrzUnsupported method %sr)r��grammarr�r$�logr�r�r'r��
lr_goto_cache�lr0_cidhash�
_add_count�sr_conflict�rr_conflict�	conflicts�sr_conflicts�rr_conflictsr{rorv�lr_parse_table)rr��methodr�s    r
rzLRGeneratedTable.__init__4s�����(�(��3�f�<�=�=�=��������	��,�,�C���� ������&�2���������������������������	
��"�"�$�$�$���"�"�$�$�$���#�#�%�%�%��������rc���|xjdz
c_|dd�}d}|rVd}|D]O}|jD]E}t|dd��|jkr�|�|j��|j|_d}�F�P|�V|S)Nr�TF�	lr0_addedr)r�rrwr�r�r�)r�I�Jrrrprks      r
�lr0_closurezLRGeneratedTable.lr0_closureYs������1����
�a�a�a�D�����		"��F��
"�
"����"�"�A��q�+�q�1�1�T�_�D�D� ��H�H�Q�Y�'�'�'�"&�/�A�K�!�F�F�
"��		"��rc�(�|j�t|��|f��}|r|S|j�|��}|si}||j|<g}|D]e}|j}|rZ|j|krO|�t|����}|si}||t|��<|�|��|}�f|�d��}|s"|r|�|��}||d<n||d<||jt|��|f<|S)Nr�)r�r�r4r�rr�r�)	rr�rk�gr^�gsr�rh�s1s	         r
�lr0_gotozLRGeneratedTable.lr0_gotoss8����"�"�B�q�E�E�1�:�.�.���	��H�

��"�"�1�%�%���	&��A�$%�D��q�!�
���	�	�A��	�A��
�Q�[�A�%�%��U�U�2�a�5�5�\�\���"��B�!�A�b��e�e�H��	�	�!�������
�E�E�&�M�M���	��
��$�$�R�(�(����&�	�	���&�	�)*���B�q�E�E�1�:�&��rc��|�|jjdjg��g}d}|D]}||jt|��<|dz
}�d}|t
|��kr�||}|dz
}i}|D]}|jD]}d||<��|D]j}|�||��}|rt|��|jvr�1t
|��|jt|��<|�	|���k|t
|��k��|S)Nrr�)
r�r�r'r�r�r4r1r�r�r�)	r�Cror��asyms�iir^rkr�s	         r
�	lr0_itemszLRGeneratedTable.lr0_items�s=��
�
�
�t�|�7��:�B�C�
D�
D�E��
���	�	�A�&'�D��R��U�U�#�
��F�A�A�
���#�a�&�&�j�j��!��A�
��F�A��E��
$�
$����$�$�A�#�E�!�H�H�$��
�
���M�M�!�Q�'�'����B�q�E�E�T�%5�5�5��*-�a�&�&�� ��A���'����������#�a�&�&�j�j�"�rc�>�t��}d}	|jjdd�D]R}|jdkr|�|j���(|jD]}||vrn�	|�|j���St|��|krnt|��}��|Srx)r.r�r'r1r@r&r�)r�nullable�num_nullabler�r�s     r
�compute_nullable_nonterminalsz.LRGeneratedTable.compute_nullable_nonterminals�s����5�5����	)��\�-�a�b�b�1�
)�
)���5�A�:�:��L�L���(�(�(����)�)�A���(�(���)��L�L���(�(�(���8�}�}��,�,���x�=�=�L�	)��rc���g}t|��D]a\}}|D]Y}|j|jdz
krD||j|jdzf}|d|jjvr||vr|�|���Z�b|Sr�)r>rr1r�r�r*r�)rr��trans�statenor�r�r�s       r
�find_nonterminal_transitionsz-LRGeneratedTable.find_nonterminal_transitions�s�����'��l�l�	,�	,�N�G�U��
,�
,���:����	�)�)� �!�&���A��"6�7�A���t�t�|�8�8�8��E�>�>�!�L�L��O�O�O��
,��rc�p�i}|\}}g}|�|||��}|D]Q}	|	j|	jdz
kr<|	j|	jdz}
|
|jjvr|
|vr|�|
���R|dkr6||jjdjdkr|�d��|S)Nr�rr�)r�rr1r�r�r)r�r')rr�r�r��dr_setr�r��termsr�r�r�s           r
�dr_relationzLRGeneratedTable.dr_relation�s��������q����M�M�!�E�(�A�&�&���	(�	(�A��z�A�E�A�I�%�%��F�1�:�a�<�(�����.�.�.���~�~����Q������A�:�:�!�t�|�7��:�?��B�B�B��L�L�� � � ��rc�,�g}|\}}|�|||��}|j�t|��d��}|D]E}	|	j|	jdz
kr0|	j|	jdz}
|
|vr|�||
f���F|S)Nr�r�)r�r�r�r4rr1r�r�)rr�r��emptyr�r�r�r�rpr�r�s           r
�reads_relationzLRGeneratedTable.reads_relation	s��������q��M�M�!�E�(�A�&�&���� � ��A����+�+���	'�	'�A��z�A�E�A�I�%�%��F�1�:��>�*����:�:��J�J��1�v�&�&�&���
rc��i}i}i}|D]}d||<�|D�]�\}}	g}
g}||D�]r}|j|	kr�|j}
|}|
|jdz
kr�|
dz}
|j|
}||f|vra|
dz}||jkr:|j||jjvrn7|j||vrn'|dz}||jk�:|�||f��|�|||��}|j�	t|��d��}|
|jdz
k��||D]x}|j|jkr�|j|jkr�$d}||jkr0|j||j|dzkrn'|dz}||jk�0|
�||f���y��t|D](}||vrg||<||�||	f���)|
|||	f<���||fS)Nr�r�r)r&rr1r�r�r)r�r�r�r�r4)rr�r�r��lookdict�includedict�dtransr�r�r��lookb�includesr�rrp�lir�r5ros                   r
�compute_lookback_includesz*LRGeneratedTable.compute_lookback_includesC	sd���������	�	�A��F�1�I�I��6	)�6	)�H�E�1��E��H��u�X�.
-�.
-���6�Q�;�;��
�:���������*�*�'�!�|�H���x�(�A��1�v��'�'�
&��\�� �1�5�j�j� �v�b�z�T�\�-C�C�C� %� �v�b�z��9�9� %�!#�a��B�!�1�5�j�j�%�O�O�Q��F�3�3�3��
�
�a��d�A�.�.�A��(�,�,�R��U�U�B�7�7�A�-�����*�*�2�1��-�-�A��v���'�'� ��u���~�~� ��A��a�j�.�.��6�!�9���q��s��3�3�!���E���a�j�.�.�
���a��V�,�,�,��-��
2�
2���K�'�'�%'�K��N��A��%�%�u�a�j�1�1�1�1�#(�H�e�Q�Z� � ���$�$rc�J�������fd�}���fd�}t|||��}|S)Nc�2�����|���Sr
)r��rkr�r�rs ���r
�<lambda>z4LRGeneratedTable.compute_read_sets.<locals>.<lambda>�	s���t�'�'��1�h�7�7�rc�2�����|���Sr
)r�r�s ���r
r�z4LRGeneratedTable.compute_read_sets.<locals>.<lambda>�	s���t�*�*�1�a��:�:�r�r�)rr��ntransr�r�r�r�s`` `   r
�compute_read_setsz"LRGeneratedTable.compute_read_sets�	sC�����
7�
7�
7�
7�
7�
7��
:�
:�
:�
:�
:�
:���F�A�r�"�"���rc�@����fd�}�fd�}t|||��}|S)Nc����|Sr
r")rk�readsetss �r
r�z6LRGeneratedTable.compute_follow_sets.<locals>.<lambda>�	s���x��{�rc�0����|g��Sr
)r�)rk�inclsetss �r
r�z6LRGeneratedTable.compute_follow_sets.<locals>.<lambda>�	s���x�|�|�A�r�*�*�rr�)rr�r�r�r�r�r�s  ``   r
�compute_follow_setsz$LRGeneratedTable.compute_follow_sets�	s6����
"�
"�
"�
"��
*�
*�
*�
*���F�A�r�"�"���rc��|���D]j\}}|D]b\}}||jvr
g|j|<|�|g��}|D]1}||j|vr |j|�|���2�c�kdSr
)r�rr�r�)	r�	lookbacks�	followsetr��lbr�r�rr�s	         r
�add_lookaheadszLRGeneratedTable.add_lookaheads�	s���"���*�*�	6�	6�I�E�2��
6�
6���q����,�,�*,�A�L��'��M�M�%��,�,���6�6�A����U� 3�3�3���U�+�2�2�1�5�5�5��6�	
6�	6�	6rc��|���}|�|��}|�|||��}|�|||��\}}|�|||��}|�||��dSr
)r�r�r�r�r�r�)rr�r�r�r��lookd�included�
followsetss        r
�add_lalr_lookaheadsz$LRGeneratedTable.add_lalr_lookaheads�	s����5�5�7�7���1�1�!�4�4���)�)�!�U�H�=�=���8�8��E�8�L�L���x��-�-�e�X�x�H�H�
�	
���E�:�.�.�.�.�.rc
�b
�|jj}|jj}|j}|j}|j}i}|�d|j��|���}|jdkr|�	|��d}|D�]*}	g}
i}i}i}
|�d��|�d|��|�d��|	D]}|�d|j
|���|�d��|	D�]f}|j|jdzk�r{|j
dkrd|d	<||d	<�-|jdkr|j|}n|jj|j
}|D�]/}|
�||d
|j
|fzf��|�|��}|���|dkr�|�|d��\}}||j
j\}}||ks||kri|dkrc|j
||<|||<|s5|s3|�d
|��|j�||df��||j
xjdz
c_��||kr|dkrd||<��|s3|�d|��|j�||df����/|dkr�||}||j
}|j|jkrK|j
||<|||<||}}||j
xjdz
c_||j
xjdzc_n||}}|j�|||f��|�d|||j
||�����t/d|z���|j
||<|||<||j
xjdz
c_��1���|j}|j|dz}||jjv�r�|�|	|��}|j�t9|��d��}|dk�ri|
�||d|zf��|�|��}|��,|dkr||krt/d|z�����P|dkr�|�|d��\}}|||j
j\}}||ks||krh|dkrb|||j
xjdzc_|||<|||<|s3|�d|��|j�||df�����||kr
|dkrd||<��|s5|s3|�d
|��|j�||df����Jt/d|z���|||<|||<��hi}|
D]2\}}}||vr(|||ur|�d||��d|||f<�3|�d��d}|
D]:\}}}||vr0|||ur&||f|vr |�d||��d}d|||f<�;|r|�d��i} |	D]}!|!jD]}"|"|jjvrd| |"<�� | D]b}#|�|	|#��}|j�t9|��d��}|dkr||
|#<|�d|#|���c|||<|||<|
||<|dz
}��,dS)NzParsing method: %srrr�zstate %dz    (%d) %sr�rKr�zreduce using rule %d (%s)r�r5z3  ! shift/reduce conflict for %s resolved as reduce�reducer6z2  ! shift/reduce conflict for %s resolved as shift�shiftz=  ! reduce/reduce conflict for %s resolved using rule %d (%s)zUnknown conflict in state %dr�zshift and go to state %dz Shift/shift conflict in state %dr�z    %-15s %sz  ! %-15s [ %s ]z"    %-30s shift and go to state %d) r�r'r-r�r�r�r r�r�rr�r1rr&rr,r�r�r�r�rr�r�r�r�r)r�r�r4rr�r*)$rr'r-r�r�r��actionpr��str��actlist�	st_action�
st_actionp�st_gotor��laheadsr�r5�sprec�slevel�rprec�rlevel�oldp�pp�chosenp�rejectpror�rp�	_actprintrG�not_used�nkeysr�r^rhs$                                    r
r�zLRGeneratedTable.lr_parse_table�	s8���l�.���l�-�
���������������%�t�~�6�6�6�

�N�N�����>�V�#�#��$�$�Q�'�'�'����d	�d	�A��G��I��J��G��H�H�R�L�L�L��H�H�Z��$�$�$��H�H�R�L�L�L��
5�
5��������!�4�4�4�4��H�H�R�L�L�L��p
6�p
6���u��
�Q��.�.��6�T�>�>�01�I�f�-�12�J�v�.�.� $�~��7�7�*+�,�r�*:���*.�,�*=�a�f�*E��%,�4G�4G�� '����1�6Q�UV�U]�_`�Ta�6a�/b� c� c� c�$-�M�M�!�$4�$4��#$�=�'(�1�u�u�9C���q�,�8W�8W�
��v�9D�A�H�8M�8R�
��v�,2�V�O�O�&�F�BR�BR�Y^�bh�Yh�Yh�<=�H�9�I�a�L�<=�J�q�M�39�-\�&�-\�03���9n�pq�0r�0r�0r�04�0A�0H�0H�"�a�QY�IZ�0[�0[�0[�,7���,A�,I�,I�Q�,N�,I�,I�,I�.4��.>�.>�U�j�EX�EX�;?�I�a�L�L�4:�-[�03���9m�op�0q�0q�0q�04�0A�0H�0H�"�a�QX�IY�0Z�0Z�0Z��)*�Q���0;�A�2���-8���-B��+/�9�r�w�+>�+>�<=�H�9�I�a�L�<=�J�q�M�?A�4�W�G�,7���,A�,I�,I�Q�,N�,I�,I�,7���,D�,L�,L�PQ�,Q�,L�,L�,L�?C�R�W�G�(,�(9�(@�(@�"�g�w�AW�(X�(X�(X�(+���1p�12�J�q�M�4H�*�UV�-�)Y�)Y�)Y�)Y�/8�8V�Y[�8[�.\�.\�(\�45�H�9�I�a�L�45�J�q�M�$/���$9�$A�$A�Q�$F�$A�$A�$A�i4G�l�J���F�1�Q�3�K����� 6�6�6� $�
�
�a�� 3� 3�A� $� 0� 4� 4�R��U�U�B� ?� ?�A� �A�v�v� '����1�6P�ST�6T�/U� V� V� V�$-�M�M�!�$4�$4��#$�=�'(�1�u�u�+,��6�6�2;�<^�ac�<c�2d�2d�,d�,2�)*�Q���9C���q�,�8W�8W�
��v�9D�J�q�M�DX�8Y�8^�
��v�,2�V�O�O�&�F�BR�BR�Y^�bi�Yi�Yi�,7�
�1�
�8L�,M�,U�,U�YZ�,Z�,U�,U�;<�I�a�L�<=�J�q�M�39�-[�03���9m�op�0q�0q�0q�04�0A�0H�0H�"�a�QX�IY�0Z�0Z�0Z��.4��.>�.>�U�j�EX�EX�;?�I�a�L�L�4:�-\�&�-\�03���9n�pq�0r�0r�0r�04�0A�0H�0H�"�a�QY�IZ�0[�0[�0[��/8�8V�Y[�8[�.\�.\�(\�34�I�a�L�45�J�q�M���I�"�
.�
.���1�a��	�>�>��J�q�M�)�)������A�6�6�6�,-�	�1�a�&�)���H�H�R�L�L�L��H�"�
2�
2���1�a��	�>�>��
�1�
�-�-� !�1�v��2�2��I�I�&8�!�Q�?�?�?�'(�H�01�I�q�!�f�-���
��	�	�"�
�
�
��E��
(�
(����(�(�A��D�L�5�5�5�#'��a���(��
I�
I���M�M�!�Q�'�'���$�(�(��A����3�3����6�6�!"�G�A�J��H�H�A�1�a�H�H�H��"�F�2�J�$�G�B�K��D��H��!�G�B�B�Id	�d	rr�c��t|tj��rtd���|�d��d}t
j�||��dz}	t|d��}|�	dt
j�
|���dt�d|j�d	|�d
�	��d}|�rsi}|j
���D]u\}	}
|
���D][\}}|�|��}
|
s	ggf}
|
||<|
d�|	��|
d�|���\�v|�	d
��|���D]�\}}|�	d|z��|dD]}
|�	d|
z���|�	d��|dD]}
|�	d|
z���|�	d����|�	d��|�	d��nt|�	d��|j
���D]0\}}|�	d|d�d|d�d|�d����1|�	d��|�rsi}|j���D]u\}	}
|
���D][\}}|�|��}
|
s	ggf}
|
||<|
d�|	��|
d�|���\�v|�	d��|���D]�\}}|�	d|z��|dD]}
|�	d|
z���|�	d��|dD]}
|�	d|
z���|�	d����|�	d��|�	d��nt|�	d��|j���D]0\}}|�	d|d�d|d�d|�d����1|�	d��|�	d��|jD]�}|jrZ|�	d|j|j|j|jt
j�
|j��|jfz���c|�	dt)|��|j|jfz����|�	d��|���dS#t$r}�d}~wwxYw)Nz"Won't overwrite existing tabmodulerr�z.py�wz
# zD
# This file is automatically generated. Do not edit.
_tabversion = z

_lr_method = z

_lr_signature = z
    r�rz
_lr_action_items = {z%r:([z%r,z],[z]),z}
z�
_lr_action = {}
for _k, _v in _lr_action_items.items():
   for _x,_y in zip(_v[0],_v[1]):
      if not _x in _lr_action:  _lr_action[_x] = {}
      _lr_action[_x][_k] = _y
del _lr_action_items
z
_lr_action = { �(r�z):z
_lr_goto_items = {z�
_lr_goto = {}
for _k, _v in _lr_goto_items.items():
   for _x, _y in zip(_v[0], _v[1]):
       if not _x in _lr_goto: _lr_goto[_x] = {}
       _lr_goto[_x][_k] = _y
del _lr_goto_items
z
_lr_goto = { z_lr_productions = [
z  (%r,%r,%d,%r,%r,%d),
z  (%r,%r,%d,None,None,None),
z]
)rfr�r��IOError�splitr�r�r�r�r�basenamer�r�r�r�r�r�r�r�r�rVr&r1r�r�r�)r�	tabmodule�	outputdirr��basemodulenamer�r�smallerr�r^�ndr&rkrorqr��es                 r
�write_tablezLRGeneratedTable.write_table�
s����i��!1�2�2�	@��>�?�?�?�"����-�-�b�1���7�<�<�	�>�:�:�U�B��k	��X�s�#�#�A�
�G�G�G��7���H�%�%�%�%�~�~�~�t�~�~�~�y�y�y�R�
S�
S�
S��G��%
���!�^�1�1�3�3�'�'�E�A�r�#%�8�8�:�:�'�'���a�!�I�I�d�O�O�� �,�!#�R��A�*+�E�$�K��!����A�����!����A�����
'����0�1�1�1�!�K�K�M�M�#�#�D�A�q��G�G�G�a�K�(�(�(��q�T�+�+�������	�*�*�*�*��G�G�E�N�N�N��q�T�+�+�������	�*�*�*�*��G�G�E�N�N�N�N�������������������+�,�,�,� �N�0�0�2�2�=�=�D�A�q��G�G�G�Q�q�T�T�T�1�Q�4�4�4����;�<�<�<�<���������%
���!�\�/�/�1�1�'�'�E�A�r�#%�8�8�:�:�'�'���a�!�I�I�d�O�O�� �,�!#�R��A�*+�E�$�K��!����A�����!����A�����
'����.�/�/�/�!�K�K�M�M�#�#�D�A�q��G�G�G�a�K�(�(�(��q�T�+�+�������	�*�*�*�*��G�G�E�N�N�N��q�T�+�+�������	�*�*�*�*��G�G�E�N�N�N�N�������������������)�*�*�*� �L�.�.�0�0�=�=�D�A�q��G�G�G�Q�q�T�T�T�1�Q�4�4�4����;�<�<�<�<��������
�G�G�+�,�,�,��(�
X�
X���6�X��G�G�6�!�%�����:;�&�"�'�BR�BR�ST�SY�BZ�BZ�\]�\b�:d�d�e�e�e�e��G�G�<��A�����PQ�PU�?V�V�W�W�W�W�
�G�G�E�N�N�N�
�G�G�I�I�I�I�I���	�	�	������	���s�)T
U5�5
V�?V�Vc�<�	ddl}n#t$rddl}YnwxYwt|d��5}|�t
|t��|�|j|t��|�||t��|�|j|t��|�|j	|t��g}|j
D]�}|jrW|�|j
|j|j|jt j�|j��|jf���`|�t|��|j|jdddf����|�||t��ddd��dS#1swxYwYdS)Nr�wb)r�r�r�r��dumpr��pickle_protocolr�r�r�r�r�r�rVr&r1r�r�rr�r�)rr�r�r��outf�outpr�s       r
�pickle_tablezLRGeneratedTable.pickle_table s���	�$�$�$�$�$���	�	�	��M�M�M�M�M�	����
�(�D�
!�
!�
	5�T��K�K���o�>�>�>��K�K����o�>�>�>��K�K�	�4��9�9�9��K�K����o�>�>�>��K�K���d�O�<�<�<��D��(�
K�
K���6�K��K�K�������q�v�r�w�?O�?O�PQ�PV�?W�?W�YZ�Y_� `�a�a�a�a��K�K��Q��������d�D� I�J�J�J�J��K�K��d�O�4�4�4�
	5�
	5�
	5�
	5�
	5�
	5�
	5�
	5�
	5�
	5�
	5�
	5����
	5�
	5�
	5�
	5�
	5�
	5s����EF�F�F)rN)r�r��r�)rrrrr�r�r�r�r�r�r�r�r�r�r�rr�r%r,r"rr
r�r�3s$������!�!�!�!�J���4 � � �F���p���:	�	�	�(���2
�
�
�VB%�B%�B%�`���,���$	6�	6�	6�$/�/�/�0y�y�y�Bq�q�q�q�t5�5�5�5�5�5rr�c��tj|��}|j���}|j|jkr|�|j��|Sr
)r��	_getframe�	f_globals�copy�f_locals�update)�levelsr�ldicts   r
�get_caller_module_dictr6CsL���
�f���A�
�K�����E��{�a�j� � �
���Q�Z� � � ��Lrc	��g}|���}d}|}|D]�}|dz
}|���}|s�	|ddkr#|std||fz���|}	|dd�}
n<|d}	|	}|dd�}
|d}|dkr|dkrtd||fz���|�|||	|
f����#t$r�t$r(td	|||���fz���wxYw|S)
Nr�r�|z%s:%d: Misplaced '|'��:z::=z!%s:%d: Syntax error. Expected ':'z%s:%d: Syntax error in rule %r)�
splitlinesrr�r��	Exception�strip)�docr�r�r��pstrings�lastp�dline�psr�rArB�assigns            r
�
parse_grammarrDOsd���G��~�~���H��E��E��\�\��
��
���H�H�J�J���	��	\���t�s�{�{��N�%�&<��e�}�&L�M�M�M� ������u����Q�4�� ���1�2�2����1����S�=�=�V�u�_�_�%�&I�T�SX�M�&Y�Z�Z�Z��N�N�D�%��4�8�9�9�9�9���	�	�	���	\�	\�	\��>�$��r�x�x�z�z�AZ�Z�[�[�[�	\�����Ns�BC�<C=c�j�eZdZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�ZdS)�
ParserReflectNc���||_d|_d|_d|_t	��|_g|_d|_|� ttj
��|_dS||_dS)NF)rrL�
error_func�tokensr.r�r�rrr�r�r�)rrr�s   r
rzParserReflect.__init__ys\����
���
��������%�%��������
��;� ���,�,�D�H�H�H��D�H�H�Hrc���|���|���|���|���|���dSr
)�	get_start�get_error_func�
get_tokens�get_precedence�get_pfunctionsrRs r
�get_allzParserReflect.get_all�s^���������������������������������rc��|���|���|���|���|���|���|jSr
)�validate_start�validate_error_func�validate_tokens�validate_precedence�validate_pfunctions�validate_modulesrrRs r
�validate_allzParserReflect.validate_all�sv��������� � �"�"�"�������� � �"�"�"�� � �"�"�"��������z�rc���g}	|jr|�|j��|jr7|�d�d�|jD������|jr-|�d�|j����|jD]%}|dr|�|d���&n#ttf$rYnwxYwd�|��S)Nr�c�8�g|]}d�|����Sr-)r�)rdr�s  r
rez+ParserReflect.signature.<locals>.<listcomp>�s"��%D�%D�%D�Q�b�g�g�a�j�j�%D�%D�%Drr�r)rLr�r�r�rI�pfuncs�	TypeError�
ValueError)r�partsrs   r
r�zParserReflect.signature�s�����	��z�
)����T�Z�(�(�(��y�
G����R�W�W�%D�%D�$�)�%D�%D�%D�E�E�F�F�F��{�
4����S�X�X�d�k�2�2�3�3�3��[�
'�
'���Q�4�'��L�L��1��&�&�&��
'���:�&�	�	�	��D�	�����w�w�u�~�~�s�CC�C�Cc	���tjd��}|jD]�}	tj|��\}}n#t
$rY�'wxYwi}t
|��D]�\}}|dz
}|�|��}|rd|�d��}|�	|��}	|	s|||<�Stj
|��}
|j�d|
|||	������dS)Nz\s*def\s+(p_[a-zA-Z_0-9]*)\(r�z;%s:%d: Function %s redefined. Previously defined on line %d)
�re�compiler��inspect�getsourcelinesrr>r=�groupr��
getsourcefiler�r)r�frer��lines�linen�	counthashr�rGr&�prevr�s           r
rWzParserReflect.validate_modules�s%���j�8�9�9���l�	F�	F�F�
�&�5�f�=�=���u�u���
�
�
���
�����I�(��/�/�
F�
F���t���
���I�I�d�O�O���F��7�7�1�:�:�D�$�=�=��.�.�D��F�*/�	�$���#*�#8��#@�#@����(�(�)f�)1�5�$��F�F�F��
F�	F�	Fs�7�
A�Ac�D�|j�d��|_dS)NrL)rr�rLrRs r
rKzParserReflect.get_start�s���Z�^�^�G�,�,��
�
�
rc��|j�6t|jt��s|j�d��dSdSdS)Nz'start' must be a string)rLrf�string_typesr�rrRs r
rRzParserReflect.validate_start�sK���:�!��d�j�,�7�7�
;�����9�:�:�:�:�:�"�!�
;�
;rc�D�|j�d��|_dS)N�p_error)rr�rHrRs r
rLzParserReflect.get_error_func�s���*�.�.��3�3����rc��|jr�t|jtj��rd}nEt|jtj��rd}n#|j�d��d|_dS|jjj}|jjj	}tj|j��}|j�
|��|jjj|z
}|dkr'|j�d||��d|_dSdSdS)Nrr�z2'p_error' defined, but is not a function or methodTz$%s:%d: p_error() requires 1 argument)rHrfr��FunctionType�
MethodTyper�r�__code__�co_firstlineno�co_filenamerb�	getmoduler�r@�co_argcount)r�ismethod�eline�efiler��argcounts      r
rSz!ParserReflect.validate_error_func�s����?�	"��$�/�5�+=�>�>�
�����D�O�U�-=�>�>�
��������S�T�T�T�!��
����O�,�;�E��O�,�8�E��&�t��7�7�F��L���V�$�$�$���/�;�h�F�H��1�}�}�����E�u�e�T�T�T�!��
�
�
�%	"�	"� �}rc�Z�|j�d��}|s#|j�d��d|_dSt	|t
tf��s#|j�d��d|_dS|s#|j�d��d|_dS||_dS)NrIzNo token list is definedTztokens must be a list or tupleztokens is empty)rr�r�rrfr�r�rI)rrIs  r
rMzParserReflect.get_tokens�s��������)�)���	��H�N�N�5�6�6�6��D�J��F��&�4��-�0�0�	��H�N�N�;�<�<�<��D�J��F��	��H�N�N�,�-�-�-��D�J��F�����rc��d|jvr#|j�d��d|_dSt��}|jD]6}||vr|j�d|��|�|���7dS)Nrz.Illegal token name 'error'. Is a reserved wordTzToken %r multiply defined)rIr�rr.rr@)rrrhs   r
rTzParserReflect.validate_tokenss����d�k�!�!��H�N�N�K�L�L�L��D�J��F��E�E�	���	�	�A��I�~�~��� � �!<�a�@�@�@��M�M�!�����	�	rc�D�|j�d��|_dS)Nr�)rr�r�rRs r
rNzParserReflect.get_precedences���J�N�N�<�0�0��	�	�	rc��g}|j�r{t|jttf��s#|j�d��d|_dSt
|j��D�]!\}}t|ttf��s$|j�d��d|_dSt|��dkr%|j�d|��d|_dS|d}t|t��s$|j�d��d|_dS|dd�D]W}t|t��s%|j�d	��d|_dS|�	|||dzf���X��#||_
dS)
Nz"precedence must be a list or tupleTzBad precedence tabler9z?Malformed precedence entry %s. Must be (assoc, term, ..., term)rz)precedence associativity must be a stringr�z precedence items must be strings)r�rfr�r�r�rr>r1rmr��preclist)rr�r8r�r7r1s      r
rUz!ParserReflect.validate_precedences������9�	<��d�i�$���7�7�
�����C�D�D�D�!��
���%�d�i�0�0�
<�
<���q�!�!�d�E�]�3�3���H�N�N�#9�:�:�:�!%�D�J��F�F��q�6�6�A�:�:��H�N�N�#d�fg�h�h�h�!%�D�J��F�F��!���!�%��6�6���H�N�N�#N�O�O�O�!%�D�J��F�F��a�b�b�E�<�<�D�%�d�L�9�9������'I�J�J�J�%)��
������O�O�T�5�%��'�$:�;�;�;�;�<�!��
�
�
rc��g}|j���D]�\}}|�d��r|dkr�!t|tjtjf��rMt|d|jj	��}tj|��}|�||||j
f����|�d����||_dS)N�p_rortc�X�|dt|d��|d|dfS)Nrr�r9rrU)�
p_functions r
r�z.ParserReflect.get_pfunctions.<locals>.<lambda>Ds-���q�M��
�1�
����q�M��q�M�	1�r)�key)rr��
startswithrfr�rqrrrwrsrtrbrvr��__doc__�sortr[)r�p_functionsr&�itemr�r�s      r
rOzParserReflect.get_pfunctions7s������*�*�*�,�,�	G�	G�J�D�$��?�?�4�(�(�
�D�I�,=�,=���$��!3�U�5E� F�G�G�
G��t�%5�t�}�7S�T�T�� �*�4�0�0���"�"�D�&�$���#E�F�F�F��
	������	�	�	�
"����rc�p�g}t|j��dkr#|j�d��d|_dS|jD�]t\}}}}t	j|��}|j|}t|tj	��rd}nd}|j
j|kr*|j�d|||j��d|_��|j
j|kr*|j�d|||j��d|_��|j
s#|j�d|||j����	t|||��}	|	D]}
|�||
f���nE#t"$r8}|j�t%|����d|_Yd}~nd}~wwxYw|j�|����v|j���D�]Y\}}
|�d	��r't|
tjtj	f��r�B|�d
��r�X|�d	��r!|dkr|j�d|��t|
tj��r|
j
jdks/t|
tj	��r�|
jj
jdkrr|
j
rk	|
j
�d
��}|ddkr1|j�d|
j
j|
j
j|����H#t8$rY��UwxYw��[||_dS)Nrz+no rules of the form p_rulename are definedTr9r�z%%s:%d: Rule %r has too many argumentsz#%s:%d: Rule %r requires an argumentzA%s:%d: No documentation string specified in function %r (ignored)r��t_roz%r not defined as a functionr�r:z9%s:%d: Possible grammar rule %r defined without p_ prefix)r1r[r�rrbrerrfr�rrrsrwrr�rrDr�r�rVr�r@r�r�rq�__func__rrurtrr�)rr�r�r�r&r>r�r��reqargs�parsed_gr�r$rhrks              r
rVz!ParserReflect.validate_pfunctionsLsc�����t�{���q� � ��H�N�N�H�I�I�I��D�J��F�'+�{�	)�	)�#�D�&�$���(��0�0�D��:�d�#�D��$�� 0�1�1�
�������}�(�7�2�2�����F��d�TX�Ta�b�b�b�!��
�
���*�W�4�4�����D�d�D�RV�R_�`�`�`�!��
�
��\�
)��� � �!d�!%�t�T�]�<�<�<�<�&�,�S�$��=�=�H�%�2�2������a�y�1�1�1�1�2��"�&�&�&��H�N�N�3�q�6�6�*�*�*�!%�D�J�J�J�J�J�J�����&������ � ��(�(�(�(�
�J�$�$�&�&�	�	�D�A�q��|�|�D�!�!�
�j��U�5G��IY�4Z�&[�&[�
���|�|�D�!�!�
���|�|�D�!�!�
D�a�9�n�n��� � �!?��C�C�C��A�u�1�2�2�	
�q�z�7M�QR�7R�7R��q�%�"2�3�3�8S�89�
�8K�8W�[\�8\�8\��9����i�o�o�c�2�2���q�6�S�=�=� �H�,�,�-h�-.�Z�-C�Q�Z�E^�`a�c�c�c���%���������������s+�,-E�
F�$.F�F�AL�
L*�)L*r
)rrrrrPrXr�rWrKrRrLrSrMrTrNrUrOrVr"rr
rFrFxs��������������������6F�F�F�2-�-�-�;�;�;�4�4�4�"�"�"�,���(���1�1�1�!�!�!�>"�"�"�*:�:�:�:�:rrFc

����|�t}|rd}|�ttj��}�rO�fd�t	���D��}
t|
��}d|vr tj|dj|d<ntd��}|	��t|tj��r|j}nrd|vr	|d}ne|�d��}d�
|dd���}td|z��ttj|dd	��}t j�|��}	|�d
��}|r!t|t(��rd|vr|dz|z}|�||d<t+||���}|���|jrt1d
���|���}	t5��}|r|�|��}n|�|��}|s||krf	|�|j��t?||j ��}|j!a!|S#tD$r }|�#d|��Yd}~nd}~wwxYwnD#tH$r,}|�#t)|����Yd}~nd}~wtJ$rYnwxYw|
��|r}	ttMt j�
|	|��d����}
nN#tN$r3}|�#d|�d|����tQ��}
Yd}~nd}~wwxYwtQ��}
|
�)dtT��d}|�+��rt1d
���|j s|�#d��tY|j-��}|j.D]K\}}}	|�/|||���#t`$r }|�#d|��Yd}~�Dd}~wwxYw|j1D]U\}}|\} }!}"}#	|�2|"|#|| |!���'#t`$r"}|�d|��d}Yd}~�Nd}~wwxYw	|�|�3|j4��n|�3|��n;#t`$r.}|�t)|����d}Yd}~nd}~wwxYw|rt1d
���|�5��}$|$D])\}%}&|�d|&j6|&j7|%��d}�*|�8��}'|'rp|
�)d	��|
�)d��|
�)d	��|'D].}|�#d|��|
�)d|���/|rp|
�)d	��|
�)d��|
�)d	��ts|j:��D]\}(})|
�)d|(|)���|�;��}*|*D])}&|�#d|&j6|&j7|&j<���*t{|'��dkr|�#d��t{|'��dkr#|�#d t{|'����t{|*��dkr|�#d!��t{|*��dkr#|�#d"t{|*����|�rk|
�)d	��|
�)d#��|
�)d	��t}|j?��}+|+�@��|+D]A}|
�)d$|d%�
d&�|j?|D�������B|
�)d	��|
�)d'��|
�)d	��t}|jA��},|,�@��|,D]A}-|
�)d$|-d%�
d(�|jA|-D�������B|
�)d	��|r`|�B��}.|.D]}/|�#d)|/���|�C��}0|0D]}1|�d*|1��d}�|�D��}2|2D]\}}|�d+||��d}�|rt1d
���|r|�Ed,|��t�|||
��}|r�t{|jG��}3|3dkr|�#d-��n|3dkr|�#d.|3��t{|jH��}4|4dkr|�#d/��n|4dkr|�#d0|4��|�r�|jGs|jH�r�|
�#d	��|
�#d1��|
�#d	��|jGD]\}5}6}7|
�#d2|6|5|7���t���}8|jHD]�\}5}9}:|5t�|9��t�|:��f|8vr�(|
�#d3|5|9��|
�#d4|:|5��|�#d3|5|9��|�#d4|:|5��|8�K|5t�|9��t�|:��f����g};|jHD]R\}5}9}:|:jLsE|:|;vrA|
�#d5|:��|�#d5|:��|;�M|:���S|rK	|�N||	|��n2#tN$r%}|�#d6|�d|����Yd}~nd}~wwxYw|rJ	|�O||��n2#tN$r%}|�#d6|�d|����Yd}~nd}~wwxYw|�|j��t?||j ��}|j!a!|S)7Nrc�4��g|]}|t�|��f��Sr")rw)rdrqr�s  �r
rezyacc.<locals>.<listcomp>�s(���?�?�?�a�1�g�f�a�(�(�)�?�?�?r�__file__rr9rr�r�r��__package__rL)r�zUnable to build parserz.There was a problem loading the table file: %rrzCouldn't open z. z5Created by PLY version %s (http://www.dabeaz.com/ply)Fz no p_error() function is definedz%sTz;%s:%d: Symbol %r used, but not defined as a token or a rulezUnused terminals:zToken %r defined, but not usedz    %sr$zRule %-5d %sz$%s:%d: Rule %r defined, but not usedr�zThere is 1 unused tokenzThere are %d unused tokenszThere is 1 unused rulezThere are %d unused rulesz'Terminals, with rules where they appearz
%-20s : %sr�c�,�g|]}t|����Sr"rUrcs  r
rezyacc.<locals>.<listcomp>G
s��7`�7`�7`�1��A���7`�7`�7`rz*Nonterminals, with rules where they appearc�,�g|]}t|����Sr"rUrcs  r
rezyacc.<locals>.<listcomp>O
s��:i�:i�:i�a�3�q�6�6�:i�:i�:irzSymbol %r is unreachablez)Infinite recursion detected for symbol %rz0Precedence rule %r defined for unknown symbol %rzGenerating %s tablesz1 shift/reduce conflictz%d shift/reduce conflictsz1 reduce/reduce conflictz%d reduce/reduce conflictsz
Conflicts:z7shift/reduce conflict for %s in state %d resolved as %sz;reduce/reduce conflict in state %d resolved using rule (%s)zrejected rule (%s) in state %dzRule (%s) is never reducedzCouldn't create )P�
tab_modulerr�r��dir�dictr�r�r6rfr�r�rr�r�rwr�r��dirnamer�rVrFrPrr,r�rr�r�r�rr�rHr�r<rr}r�r�rr$r �__version__rXr$rIr�r9r"r�rIrMrLr\r�r�r_r>r'rcr&r1r�r)r�r*rSrZrgrr�r�r�r.r4r@rr�r%r,)<r�rr�rrL�check_recursion�optimize�write_tables�	debugfiler �debuglog�errorlog�
picklefile�_itemsr�srcfiler^�pkgname�pkg�pinfor��lr�read_signaturerLr$�errorsr�r1r7r8�funcname�gramr�r�rArBr\r�r�r_rhr�rcr��nonterms�nonterm�unreachable�urY�inf�unused_prec�num_sr�num_rrr�r��
resolution�already_reported�rule�rejected�warned_nevers<  `                                                         r
�yaccr��s7������	��������S�Z�(�(���*�?�?�?�?�3�v�;�;�?�?�?���V�����U�"�"� #��E�,�,?� @� I�E�*���&�q�)�)����
�i��!1�2�2�		H��(�G�G��)�#�#��
�+���!����,�,���(�(�5��"��:�.�.���[�7�*�+�+�+�!�#�+�g�"6�
�B�G�G���G�O�O�G�,�,�	��)�)�M�
"�
"�C�
�.�z�)�S�)�)�.��i����c�	�I�-�I�

����g��
�%�X�.�.�.�E�	�M�M�O�O�O��{�2��0�1�1�1����!�!�I�
�
�Y�Y���	6��^�^�J�7�7�N�N��]�]�9�5�5�N��	V��)�3�3�
V��!�!�%�+�.�.�.�!�"�e�&6�7�7������
���
V�
V�
V�� � �!Q�ST�U�U�U�U�U�U�U�U�����
V�������!�!�!�����Q��� � � � � � � � ������
�
�
���
�������	$�
(�$�T�"�'�,�,�y�)�*L�*L�c�%R�%R�S�S�����
(�
(�
(�� � � �9�9�9�a�a�!H�I�I�I�%�<�<�����������
(����"�|�|�H��M�M�I�;�W�W�W�
�F�
�����2��0�1�1�1���=����;�<�<�<��e�l�#�#�G�$�n�&�&���e�U�	&��"�"�4���6�6�6�6���	&�	&�	&����T�1�%�%�%�%�%�%�%�%�����	&���� �-�����$�%)�"��d�H�d�	��"�"�8�T�8�T�4�H�H�H�H���	�	�	��N�N�4��#�#�#��F�F�F�F�F�F�����	����
��=����e�k�*�*�*�*����e�$�$�$����������s�1�v�v��������������������2��0�1�1�1� �1�1�3�3��&���	��T����T�VZ�V_�ae�aj�lo�p�p�p�����/�/�1�1���*��
�
�b�����
�
�)�*�*�*��
�
�b����$�	*�	*�D����=�t�D�D�D��M�M�(�D�)�)�)�)�
�0��
�
�b�����
�
�i� � � ��
�
�b�����g�1�2�2�	0�	0�D�A�q��M�M�.�!�Q�/�/�/�/��'�'�)�)�L��b�b�����?���D�I�W[�W`�a�a�a�a�
�����!�!����2�3�3�3�
����q� � ����5�s�;K�7L�7L�M�M�M�
�<���A������1�2�2�2�
�<���1������4�c�,�6G�6G�H�H�H����
�
�b�����
�
�?�@�@�@��
�
�b�����W�&�'�'��
�
�
�����	c�	c�D��M�M�,��c�h�h�7`�7`��HY�Z^�H_�7`�7`�7`�.a�.a�b�b�b�b��
�
�b�����
�
�B�C�C�C��
�
�b������,�-�-���
�
�����	l�	l�G��M�M�,�����:i�:i�7�K_�`g�Kh�:i�:i�:i�1j�1j�k�k�k�k��
�
�b�������.�.�0�0���	<�	<�A����7��;�;�;�;��*�*�,�,���	�	�C��N�N�F��L�L�L��F�F��+�+�-�-�K�"�����e����I�5�RV�W�W�W����
�2��0�1�1�1�
�7����-�v�6�6�6�	�'�6�8�	4�	4�B��
C��R�_�%�%���Q�;�;����6�7�7�7�7�
�a�Z�Z����8�&�A�A�A��R�_�%�%���Q�;�;����7�8�8�8�8�
�a�Z�Z����9�6�B�B�B�
�.�"�/�.�R�_�.������������&�&�&��������&(�o�	q�	q�"�E�3�
����V�Y\�^c�eo�p�p�p�p��5�5��%'�_�	B�	B�!�E�4���r�$�x�x��H���.�2B�B�B�����Z�\a�cg�h�h�h����=�x��O�O�O����Z�\a�cg�h�h�h����=�x��O�O�O�� � �%��D���2�h�<�<�!@�A�A�A�A���%'�_�	.�	.�!�E�4���#�
.���)E�)E�� � �!=�x�H�H�H�� � �!=�x�H�H�H��#�#�H�-�-�-���H�	H��N�N�9�i��;�;�;�;���	H�	H�	H��������A�A�F�G�G�G�G�G�G�G�G�����	H�����I�	I��O�O�J�	�2�2�2�2���	I�	I�	I��������Q�Q�G�H�H�H�H�H�H�H�H�����	I�������e�k�"�"�"�
�b�%�*�
+�
+�F��L�E��Ms��AI8�7I
�

I4�I/�*I8�/I4�4I8�8
J9�"J)�)
J9�8J9�;K=�=
L:�)L5�5L:�	O!�!
P�+P�P�"P<�<
Q(�Q#�#Q(�,2R�
S�)$S�S�n2�2
o!�<o�o!�'o>�>
p-�p(�(p-)<r`r�r��os.pathr�rb�base64r=r�r��	yaccdebug�
debug_filer��
default_lrr�r�r2r)�version_info�
basestringrmrV�maxsizer��objectrr$r<r,r8r;r@rGrDr?rArErHrMrOrYr�rar<r�rrr r"r$r}rr�r�r�r�r6rDrFr�r"rr
�<module>r�s���|
�	�	�	�����
�
�
�
���������
�
�
�
����������	��
��
��
����	�������A������L�L��L�	������������$���������	�	�	�	�	�	�	�	�	����9�9�9�
��	
����	�����������


�

�

�:�������� ,�,�,�,�,�,�,�,�hZC�ZC�ZC�ZC�ZC�ZC�ZC�ZC�L���/�0�0��4B-�B-�B-�B-�B-��B-�B-�B-�P-�-�-�-�-�V�-�-�-�\+�+�+�+�+�V�+�+�+�6��� 	�	�	�	�	�9�	�	�	�e"�e"�e"�e"�e"�f�e"�e"�e"�^	�	�	�	�	�9�	�	�	�9�9�9�9�9�f�9�9�9�h	
�	
�	
�"�"�"�.	�	�	�	�	�	�	�	�	�5�5�5�5�5�w�5�5�5�`��� � � �RN�N�N�N�N�F�N�N�N�l�i��
�RV���D�J��$��$�X�X�X�X�X�Xr

?>