404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.190.253.57: ~ $
3

Kl�fd�
@s
ddlZddlZddlZddlZddlZddlZdZdZdZ	dZ
dZdZdZ
d	Zd
ZdZejddkrleZneZejZGdd�de�ZGd
d�de�ZGdd�de�Zdd�Zdd�Zdadada dZ!dd�Z"dd�Z#dd�Z$dd�Z%Gdd�d�Z&Gd d!�d!�Z'Gd"d#�d#�Z(ej)d$�Z*Gd%d&�d&e�Z+Gd'd(�d(e�Z,Gd)d*�d*e�Z-d+d,�Z.Gd-d.�d.e�Z/Gd/d0�d0e�Z0Gd1d2�d2e�Z1Gd3d4�d4e�Z2d5d6�Z3d7d8�Z4Gd9d:�d:e�Z5Gd;d<�d<e2�Z6d=d>�Z7d?d@�Z8GdAdB�dBe�Z9de	deddd	de
ddddf
dCdD�Z:dS)E�Nz3.11z3.10Tz
parser.out�parsetab�LALR�F�(c@s4eZdZdd�Zdd�ZeZdd�Zdd�ZeZd	S)
�	PlyLoggercCs
||_dS)N)�f)�selfr�r	�/usr/lib/python3.6/yacc.py�__init__mszPlyLogger.__init__cOs|jj||d�dS)N�
)r�write)r�msg�args�kwargsr	r	r
�debugpszPlyLogger.debugcOs|jjd||d�dS)Nz	WARNING: r)rr
)rrrrr	r	r
�warninguszPlyLogger.warningcOs|jjd||d�dS)NzERROR: r)rr
)rrrrr	r	r
�errorxszPlyLogger.errorN)	�__name__�
__module__�__qualname__rr�inforrZcriticalr	r	r	r
rlsrc@seZdZdd�Zdd�ZdS)�
NullLoggercCs|S)Nr	)r�namer	r	r
�__getattribute__szNullLogger.__getattribute__cOs|S)Nr	)rrrr	r	r
�__call__�szNullLogger.__call__N)rrrrrr	r	r	r
r~src@seZdZdS)�	YaccErrorN)rrrr	r	r	r
r�srcCsPt|�}d|krt|�}t|�tkr4|dt�d}dt|�jt|�|f}|S)Nrz ...z<%s @ 0x%x> (%s))�repr�len�resultlimit�typer�id)�r�repr_str�resultr	r	r
�
format_result�sr%cCsBt|�}d|krt|�}t|�dkr(|Sdt|�jt|�fSdS)Nr�z<%s @ 0x%x>)rrr rr!)r"r#r	r	r
�format_stack_entry�sr'aPLY: 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()
cCstjt�t�S)N)�warnings�warn�_warnmsg�_errokr	r	r	r
�errok�s
r,cCstjt�t�S)N)r(r)r*�_restartr	r	r	r
�restart�s
r.cCstjt�t�S)N)r(r)r*�_tokenr	r	r	r
�token�s
r0cCs>|ja|ja|ja||�}y
bbbWntk
r8YnX|S)N)r,r+r0r/r.r-�	NameError)�	errorfuncr0�parserr"r	r	r
�call_errorfunc�s
r4c@seZdZdd�Zdd�ZdS)�
YaccSymbolcCs|jS)N)r )rr	r	r
�__str__�szYaccSymbol.__str__cCst|�S)N)�str)rr	r	r
�__repr__�szYaccSymbol.__repr__N)rrrr6r8r	r	r	r
r5�sr5c@sneZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�YaccProductionNcCs||_||_d|_d|_dS)N)�slice�stack�lexerr3)r�sr;r	r	r
r�szYaccProduction.__init__cCsBt|t�rdd�|j|D�S|dkr2|j|jS|j|jSdS)NcSsg|]
}|j�qSr	)�value)�.0r=r	r	r
�
<listcomp>�sz.YaccProduction.__getitem__.<locals>.<listcomp>r)�
isinstancer:r>r;)r�nr	r	r
�__getitem__�s

zYaccProduction.__getitem__cCs||j|_dS)N)r:r>)rrB�vr	r	r
�__setitem__�szYaccProduction.__setitem__cCsdd�|j||�D�S)NcSsg|]
}|j�qSr	)r>)r?r=r	r	r
r@�sz/YaccProduction.__getslice__.<locals>.<listcomp>)r:)r�i�jr	r	r
�__getslice__�szYaccProduction.__getslice__cCs
t|j�S)N)rr:)rr	r	r
�__len__�szYaccProduction.__len__cCst|j|dd�S)N�linenor)�getattrr:)rrBr	r	r
rJszYaccProduction.linenocCs||j|_dS)N)r:rJ)rrBrJr	r	r
�
set_linenoszYaccProduction.set_linenocCs,t|j|dd�}t|j|d|�}||fS)NrJr�	endlineno)rKr:)rrB�	startlineZendliner	r	r
�linespanszYaccProduction.linespancCst|j|dd�S)N�lexposr)rKr:)rrBr	r	r
rPszYaccProduction.lexposcCs||j|_dS)N)r:rP)rrBrPr	r	r
�
set_lexposszYaccProduction.set_lexposcCs,t|j|dd�}t|j|d|�}||fS)NrPr�	endlexpos)rKr:)rrB�startpos�endposr	r	r
�lexspanszYaccProduction.lexspancCst�dS)N)�SyntaxError)rr	r	r
rszYaccProduction.error)N)rrrrrCrErHrIrJrLrOrPrQrUrr	r	r	r
r9�s
r9c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd
d�Zddd�Z	ddd�Z
ddd�ZdS)�LRParsercCs0|j|_|j|_|j|_||_|j�d|_dS)NT)	�lr_productions�productions�	lr_action�action�lr_goto�gotor2�set_defaulted_states�errorok)rZlrtabZerrorfr	r	r
r szLRParser.__init__cCs
d|_dS)NT)r_)rr	r	r
r,(szLRParser.errokcCs@|jdd�=|jdd�=t�}d|_|jj|�|jjd�dS)Nz$endr)�
statestack�symstackr5r �append)r�symr	r	r
r.+szLRParser.restartcCsTi|_xH|jj�D]:\}}t|j��}t|�dkr|ddkr|d|j|<qWdS)N�r)�defaulted_statesr[�items�list�valuesr)r�state�actionsZrulesr	r	r
r^;s
zLRParser.set_defaulted_statescCs
i|_dS)N)re)rr	r	r
�disable_defaulted_statesBsz!LRParser.disable_defaulted_statesNFcCsZ|str.t|t�rttj�}|j|||||�S|rD|j|||||�S|j|||||�SdS)N)	�	yaccdevelrA�intr�sys�stderr�
parsedebug�parseopt�parseopt_notrack)r�inputr<r�tracking�	tokenfuncr	r	r
�parseEs

zLRParser.parsec Cs�d}g}|j}|j}	|j}
|j}td�}d}
|jd�|sLddlm}|j}||_||_	|dk	rj|j
|�|dkrz|j}n|}||_g}||_g}||_
||_d}|jd�t�}d|_|j|�d}�x�|jd�|jd|�||k�r.|�s|�s�|�}n|j�}|�st�}d|_|j}||j|�}n||}|jd||�|jd	d
djdd
�|D�dd��t|�fj��|dk	�r�|dk�r�|j|�|}|jd|�|j|�d}|
r�|
d8}
q�|dk�rN|
|}|j}|j}t�}||_d|_|�rB|jd|jddjdd
�||d�D��d|	|d%||�n|jd|jg|	|d&|�|�r�||dd�}||d<|�r�|d}|j|_|j|_|d'}t|d|j�|_t|d|j�|_||_ yd||d�=||_!|j"|�||d�=|jdt#|d��|j|�|	|d(|}|j|�Wq�t$k
�r�|j|�|j%|dd)��|j�|d*}d|_d|_|}t&}
d|_'Yq�Xq�n�|�r�|j|_|j|_|g}||_ yL||_!|j"|�|jdt#|d��|j|�|	|d+|}|j|�Wq�t$k
�rJ|j|�|j�|d,}d|_d|_|}t&}
d|_'Yq�Xq�|dk�r�|d-}t|dd�}|jdt#|��|jd�|S|dk�r�|j(dd
djdd
�|D�dd��t|�fj��|
dk�s�|j'�r�t&}
d|_'|}|jdk�r�d}|j)�rB|�rt*|d��r||_||_!t+|j)||�}|j'�r�|}d}q�n`|�r�t*|d��r\|j}nd}|�r~t,j-j.d ||jf�nt,j-j.d!|j�nt,j-j.d"�dSnt&}
t|�dk�r�|jdk�r�d}d}d}|dd�=q�|jdk�r�dS|jdk�r�|d.}|jdk�r6|�r0t|d|j�|_t|d#|j�|_d}q�t�}d|_t*|d��r\|j|_|_t*|d#��rv|j|_|_||_|j|�|}q�|j�}|�r�|j|_|j|_|j�|d/}q�t/d$��q�WdS)0NrzPLY: PARSE DEBUG STARTrd)�lexz$end�zState  : %sz#Defaulted state %s: Reduce using %dzStack  : %sz%s . %s� cSsg|]
}|j�qSr	)r )r?�xxr	r	r
r@�sz'LRParser.parsedebug.<locals>.<listcomp>z Action : Shift and goto state %sz3Action : Reduce rule [%s] with %s and goto state %d�[�,cSsg|]}t|j��qSr	)r'r>)r?Z_vr	r	r
r@�s�]rMrRzResult : %srFr>zDone   : Returning %szPLY: PARSE DEBUG ENDzError  : %scSsg|]
}|j�qSr	)r )r?rzr	r	r
r@Dsr<rJz(yacc: Syntax error at line %d, token=%s
zyacc: Syntax error, token=%sz yacc: Parse error in input. EOF
rPzyacc: internal parser error!!!
���r~r~r~r~r~r~r~r~r~r~)0r[r]rYrer9rrxrwr<r3rsr0r`rar;rbr5r r�pop�get�joinr7�lstriprrr>rJrPrKrMrRr:ri�callabler%rV�extend�error_countr_rr2�hasattrr4rnror
�RuntimeError) rrsr<rrtru�	lookahead�lookaheadstackrjr]�prodre�pslice�
errorcountrw�	get_tokenr`ra�errtokenrcri�ltype�t�p�pname�plen�targ�t1rBr$�tokrJr	r	r
rp^s~





.






$








.


zLRParser.parsedebugc Csvd}g}|j}|j}	|j}
|j}td�}d}
|sBddlm}|j}||_||_|dk	r`|j	|�|dkrp|j
}n|}||_
g}||_g}||_||_
d}|jd�t�}d|_|j|�d}�x�||k�r|s�|s�|�}n|j�}|s�t�}d|_|j}||j|�}n||}|dk	�rh|dk�rN|j|�|}|j|�d}|
r�|
d8}
q�|dk�rF|
|}|j}|j}t�}||_d|_|�r�||dd�}||d<|�r�|d}|j|_|j|_|d}t|d|j�|_t|d|j�|_||_yP||d�=||_|j|�||d�=|j|�|	|d|}|j|�Wq�tk
�r�|j|�|j|dd��|j�|d}d|_d|_|}t }
d|_!Yq�Xq�n�|�r�|j|_|j|_|g}||_y8||_|j|�|j|�|	|d|}|j|�Wq�tk
�rB|j|�|j�|d}d|_d|_|}t }
d|_!Yq�Xq�|dk�rh|d}t|d	d�}|S|dk�rf|
dk�s�|j!�rNt }
d|_!|}|jdk�r�d}|j"�r�|�r�t#|d
��r�||_||_t$|j"||�}|j!�rL|}d}q�n`|�r<t#|d��r|j}nd}|�r(t%j&j'd||jf�nt%j&j'd
|j�nt%j&j'd�dSnt }
t|�dk�r�|jdk�r�d}d}d}|dd�=q�|jdk�r�dS|jdk�r6|d}|jdk�r�|�r�t|d|j�|_t|d|j�|_d}q�t�}d|_t#|d��r|j|_|_t#|d��r |j|_|_||_|j|�|}q�|j�}|�rT|j|_|j|_|j�|d}q�t(d��q�WdS)Nrrd)rwz$endrMrRrFr>r<rJz(yacc: Syntax error at line %d, token=%s
zyacc: Syntax error, token=%sz yacc: Parse error in input. EOF
rPzyacc: internal parser error!!!
r~r~r~r~r~r~r~r~r~))r[r]rYrer9rxrwr<r3rsr0r`rar;rbr5r rr�rrr>rJrPrKrMrRr:rir�rVr�r�r_r2r�r4rnror
r�) rrsr<rrtrur�r�rjr]r�rer�r�rwr�r`rar�rcrir�r�r�r�r�r�r�rBr$r�rJr	r	r
rq�sX




















zLRParser.parseoptcCs�d}g}|j}|j}	|j}
|j}td�}d}
|sBddlm}|j}||_||_|dk	r`|j	|�|dkrp|j
}n|}||_
g}||_g}||_||_
d}|jd�t�}d|_|j|�d}�x||k�r|s�|s�|�}n|j�}|s�t�}d|_|j}||j|�}n||}|dk	�r|dk�rN|j|�|}|j|�d}|
r�|
d8}
q�|dk�r�|
|}|j}|j}t�}||_d|_|�rX||dd�}||d<||_yP||d�=||_|j|�||d�=|j|�|	|d|}|j|�Wq�tk
�rR|j|�|j|dd��|j�|d}d|_d|_|}t}
d|_Yq�Xq�n�|g}||_y8||_|j|�|j|�|	|d|}|j|�Wq�tk
�r�|j|�|j�|d}d|_d|_|}t}
d|_Yq�Xq�|dk�r|d}t|dd�}|S|dk�r�|
dk�s(|j�r�t}
d|_|}|jdk�rFd}|j�r�|�rht|d��rh||_||_t |j||�}|j�r�|}d}q�n`|�r�t|d	��r�|j!}nd}|�r�t"j#j$d
||jf�nt"j#j$d|j�nt"j#j$d�dSnt}
t|�dk�r(|jdk�r(d}d}d}|dd�=q�|jdk�r8dS|jdk�r�|d}|jdk�r^d}q�t�}d|_t|d	��r�|j!|_!|_%t|d
��r�|j&|_&|_'||_|j|�|}q�|j�}|j�|d}q�t(d��q�WdS)Nrrd)rwz$endrFr>r<rJz(yacc: Syntax error at line %d, token=%s
zyacc: Syntax error, token=%sz yacc: Parse error in input. EOF
rPzyacc: internal parser error!!!
r~r~r~r~r~r~r~r~))r[r]rYrer9rxrwr<r3rsr0r`rar;rbr5r rr�rrr>r:rir�rVr�r�r_rKr2r�r4rJrnror
rMrPrRr�)rrsr<rrtrur�r�rjr]r�rer�r�rwr�r`rar�rcrir�r�r�r�r�r�rBr$r�rJr	r	r
rr�s8




















zLRParser.parseopt_notrack)NNFFN)NNFFN)NNFFN)NNFFN)rrrrr,r.r^rkrvrprqrrr	r	r	r
rWs

]
4rWz^[a-zA-Z0-9_-]+$c@sReZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�ZdS)�
Productionr�rightNrxc	Cs�||_t|�|_||_||_d|_||_||_||_t	|j�|_	g|_
x$|jD]}||j
krN|j
j|�qNWg|_d|_
|jr�d|jdj|j�f|_nd|j|_dS)Nz%s -> %sryz
%s -> <empty>)r�tupler��number�funcr��file�line�precr�usymsrb�lr_items�lr_nextr�r7)	rr�rr��
precedencer�r�r�r=r	r	r
r!s$

zProduction.__init__cCs|jS)N)r7)rr	r	r
r6?szProduction.__str__cCsdt|�dS)NzProduction(�))r7)rr	r	r
r8BszProduction.__repr__cCs
t|j�S)N)rr�)rr	r	r
rIEszProduction.__len__cCsdS)Nrdr	)rr	r	r
�__nonzero__HszProduction.__nonzero__cCs
|j|S)N)r�)r�indexr	r	r
rCKszProduction.__getitem__cCs�|t|j�krdSt||�}y|j|j|d|_Wnttfk
rTg|_YnXy|j|d|_Wntk
r�d|_YnX|S)Nrd)rr��LRItem�	Prodnames�lr_after�
IndexError�KeyError�	lr_before)rrBr�r	r	r
�lr_itemOs
zProduction.lr_itemcCs|jr||j|_dS)N)r�r�)r�pdictr	r	r
�bind_szProduction.bind�r�r)r�Nrxr)rrr�reducedrr6r8rIr�rCr�r�r	r	r	r
r�s
r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�MiniProductioncCs.||_||_||_d|_||_||_||_dS)N)rrr�r�r�r�r7)rr7rrr�r�r�r	r	r
rhszMiniProduction.__init__cCs|jS)N)r7)rr	r	r
r6qszMiniProduction.__str__cCs
d|jS)NzMiniProduction(%s))r7)rr	r	r
r8tszMiniProduction.__repr__cCs|jr||j|_dS)N)r�r�)rr�r	r	r
r�xszMiniProduction.bindN)rrrrr6r8r�r	r	r	r
r�gs	r�c@s$eZdZdd�Zdd�Zdd�ZdS)r�cCsZ|j|_t|j�|_|j|_||_i|_|jj|d�t|j�|_t|j�|_|j	|_	dS)N�.)
rrgr�r��lr_index�
lookaheads�insertr�rr�)rr�rBr	r	r
r�szLRItem.__init__cCs,|jrd|jdj|j�f}n
d|j}|S)Nz%s -> %sryz
%s -> <empty>)r�rr�)rr=r	r	r
r6�s
zLRItem.__str__cCsdt|�dS)NzLRItem(r�)r7)rr	r	r
r8�szLRItem.__repr__N)rrrrr6r8r	r	r	r
r��sr�cCs:t|�d}x(|dkr4|||kr*||S|d8}qWdS)Nrdr)r)Zsymbols�	terminalsrFr	r	r
�rightmost_terminal�s
r�c@seZdZdS)�GrammarErrorN)rrrr	r	r	r
r��sr�c@s�eZdZdd�Zdd�Zdd�Zdd�Zd$dd
�Zd%dd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd&d d!�Zd"d#�Zd	S)'�GrammarcCsfdg|_i|_i|_i|_x|D]}g|j|<q Wg|jd<i|_i|_i|_i|_t�|_	d|_
dS)Nr)�Productionsr��Prodmap�	Terminals�Nonterminals�First�Follow�
Precedence�set�UsedPrecedence�Start)rr��termr	r	r
r�s

zGrammar.__init__cCs
t|j�S)N)rr�)rr	r	r
rI�szGrammar.__len__cCs
|j|S)N)r�)rr�r	r	r
rC�szGrammar.__getitem__cCs8||jkrtd|��|dkr&td��||f|j|<dS)Nz,Precedence already specified for terminal %r�leftr��nonassocz:Associativity must be one of 'left','right', or 'nonassoc')r�r�r�)r�r�)rr��assoc�levelr	r	r
�set_precedence�s

zGrammar.set_precedenceNrxrcCs�||jkrtd|||f��|dkr6td|||f��tj|�sRtd|||f��x�t|�D]�\}}|ddkr�yJt|�}t|�dkr�td||||f��||jkr�g|j|<|||<w\Wntk
r�YnXtj|�r\|d	kr\td
||||f��q\Wd	|k�r�|dd	k�r$td||f��|dd	k�rBtd
||f��|d}	|jj	|	�}
|
�sptd|||	f��n|j
j|	�|dd�=nt||j�}	|jj	|	d�}
d||f}||j
k�r�|j
|}td|||fd|j|jf��t|j�}
||jk�rg|j|<xR|D]J}||jk�r.|j|j|
�n&||jk�rDg|j|<|j|j|
��qWt|
|||
|||�}|jj|�||j
|<y|j|j|�Wn"tk
�r�|g|j|<YnXdS)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'"rdzA%s:%d: Literal token %s in rule %r may only be a single characterz%precz!%s:%d: Illegal name %r in rule %rz+%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�z%s -> %sz%s:%d: Duplicate rule %s. zPrevious definition at %s:%dr~���r~r�)r�r)r�r��_is_identifier�match�	enumerate�evalrrVr�r�r��addr�r�r�r�r�r�rbr�r�r�)r�prodname�symsr�r�r�rBr=�cZprecnameZprodprec�map�mZpnumberr�r�r	r	r
�add_productionsp










zGrammar.add_productioncCsT|s|jdj}||jkr&td|��tdd|g�|jd<|j|jd�||_dS)Nrdzstart symbol %s undefinedrzS')r�rr�r�r�rbr�)r�startr	r	r
�	set_startcs
zGrammar.set_startcs>���fdd��t����jdjd��fdd��jD�S)NcsJ|�krdS�j|�x.�jj|g�D]}x|jD]}�|�q2Wq&WdS)N)r�r�r�r�)r=r�r")�mark_reachable_from�	reachablerr	r
r�vs
z5Grammar.find_unreachable.<locals>.mark_reachable_fromrcsg|]}|�kr|�qSr	r	)r?r=)r�r	r
r@�sz,Grammar.find_unreachable.<locals>.<listcomp>)r�r�r�r�)rr	)r�r�rr
�find_unreachablesszGrammar.find_unreachablecCs�i}x|jD]}d||<qWd|d<x|jD]}d||<q,Wxpd}x`|jj�D]R\}}xH|D]@}x |jD]}||shd}PqhWd}|r\||s�d||<d}Pq\WqNW|s>Pq>Wg}	x@|j�D]4\}}
|
s�||jkr�||jkr�|dkr�q�|	j|�q�W|	S)NTz$endFr)r�r�r�rfr�rb)rZ
terminatesr�rB�some_changeZplr�r=Zp_terminates�infiniter�r	r	r
�infinite_cycles�s:

zGrammar.infinite_cyclescCsXg}xN|jD]D}|sqx8|jD].}||jkr||jkr|dkr|j||f�qWqW|S)Nr)r�r�r�r�rb)rr$r�r=r	r	r
�undefined_symbols�szGrammar.undefined_symbolscCs8g}x.|jj�D] \}}|dkr|r|j|�qW|S)Nr)r�rfrb)rZ
unused_tokr=rDr	r	r
�unused_terminals�s
zGrammar.unused_terminalscCs<g}x2|jj�D]$\}}|s|j|d}|j|�qW|S)Nr)r�rfr�rb)rZunused_prodr=rDr�r	r	r
�unused_rules�szGrammar.unused_rulescCsDg}x:|jD]0}||jkp"||jks|j||j|df�qW|S)Nr)r�r�r�rb)rZunusedZtermnamer	r	r
�unused_precedence�s
zGrammar.unused_precedencecCs`g}xV|D]D}d}x2|j|D]$}|dkr0d}q||kr|j|�qW|rLq
Pq
W|jd�|S)NFz<empty>T)r�rb)rZbetar$�xZx_produces_emptyrr	r	r
�_firsts

zGrammar._firstcCs�|jr|jSx|jD]}|g|j|<qWdg|jd<x|jD]}g|j|<q<Wxjd}xZ|jD]P}xJ|j|D]<}x6|j|j�D]&}||j|kr~|j|j|�d}q~WqlWq\W|sPPqPW|jS)Nz$endFT)r�r�r�r�r�r�rb)rr�rBr�r�rr	r	r
�
compute_first.s$zGrammar.compute_firstc
CsV|jr|jS|js|j�x|jD]}g|j|<q"W|sD|jdj}dg|j|<�x�d}x�|jdd�D]�}x�t|j�D]�\}}||jkrx|j|j|dd��}d}xB|D]:}	|	dkr�|	|j|kr�|j|j	|	�d}|	dkr�d}q�W|�s|t
|j�dkrxx:|j|jD]*}	|	|j|k�r|j|j	|	�d}�qWqxWqhW|sTPqTW|jS)Nrdz$endFz<empty>T)r�r�r�r�r�rr�r�r�rbr)
rr��k�didaddr�rF�BZfstZhasemptyrr	r	r
�compute_followSs<

zGrammar.compute_followcCs�x�|jD]�}|}d}g}x�|t|�kr,d}ntt||�}y|j|j|d|_Wnttfk
rng|_YnXy|j|d|_Wntk
r�d|_YnX||_	|s�P|j
|�|}|d7}qW||_qWdS)Nrrd)r�rr�r�r�r�r�r�r�r�rbr�)rr�ZlastlrirFr�Zlrir	r	r
�
build_lritems�s.

zGrammar.build_lritems)Nrxr)N)N)rrrrrIrCr�r�r�r�r�r�r�r�r�r�r�r�r�r	r	r	r
r��s $
T
@#%
;r�c@seZdZdS)�VersionErrorN)rrrr	r	r	r
r��sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�LRTablecCsd|_d|_d|_d|_dS)N)rZr\rX�	lr_method)rr	r	r
r�szLRTable.__init__cCs~t|tj�r|}ntd|�tj|}|jtkr:td��|j	|_
|j|_g|_
x|jD]}|j
jt|��qXW|j|_|jS)Nz	import %sz&yacc table file version is out of date)rA�types�
ModuleType�execrn�modulesZ_tabversion�__tabversion__r�Z
_lr_actionrZZ_lr_gotor\rXZ_lr_productionsrbr�Z
_lr_methodr�Z
_lr_signature)r�modulerr�r	r	r
�
read_table�s

zLRTable.read_tablecCs�yddl}Wntk
r(ddl}YnXtjj|�s:t�t|d�}|j|�}|tkr^t	d��|j|�|_
|j|�}|j|�|_|j|�|_|j|�}g|_
x|D]}|j
jt|��q�W|j�|S)Nr�rbz&yacc table file version is out of date)�cPickle�ImportError�pickle�os�path�exists�open�loadr�r�r�rZr\rXrbr��close)r�filenamer�Zin_fZ
tabversion�	signaturerYr�r	r	r
�read_pickle�s(




zLRTable.read_picklecCsx|jD]}|j|�qWdS)N)rXr�)rr�r�r	r	r
�bind_callables�szLRTable.bind_callablesN)rrrrr�rrr	r	r	r
r��sr�c	CsTi}x|D]}d||<q
Wg}i}x,|D]$}||dkr(t|||||||�q(W|S)Nr)�traverse)�X�R�FP�Nr�r;�Fr	r	r
�digraph	s

r	c	Cs|j|�t|�}|||<||�||<||�}xr|D]j}	||	dkrXt|	||||||�t||||	�||<x.|j|	g�D]}
|
||kr|||j|
�q|Wq4W|||k�rt||d<||||d<|j�}x2||k�rt||d<||||d<|j�}q�WdS)Nrrdr~r~r~r~)rbrr�minr��MAXINTr)r�rr;rrrr�d�rel�y�a�elementr	r	r
rs(

rc@seZdZdS)�	LALRErrorN)rrrr	r	r	r
r+src@s�eZdZd$dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd%d d!�Zd&d"d#�ZdS)'�LRGeneratedTablerNcCs�|dkrtd|��||_||_|s*t�}||_i|_i|_|j|_i|_	i|_
d|_d|_d|_
g|_g|_g|_|jj�|jj�|jj�|j�dS)N�SLRrzUnsupported method %sr)rr)r�grammarr�r�logrZr\r�rX�
lr_goto_cache�lr0_cidhash�
_add_countZsr_conflictZrr_conflictZ	conflicts�sr_conflicts�rr_conflictsr�r�r��lr_parse_table)rr�methodrr	r	r
r6s,


zLRGeneratedTable.__init__cCsz|jd7_|dd�}d}xV|rtd}xH|D]@}x:|jD]0}t|dd�|jkrRq:|j|j�|j|_d}q:Wq.Wq W|S)NrdTF�	lr0_addedr)rr�rKrbr�r)r�I�Jr�rGr�r	r	r
�lr0_closure[s
zLRGeneratedTable.lr0_closurec	Cs�|jjt|�|f�}|r|S|jj|�}|s:i}||j|<g}xP|D]H}|j}|rD|j|krD|jt|��}|s~i}||t|�<|j|�|}qDW|jd�}|s�|r�|j|�}||d<n||d<||jt|�|f<|S)Nz$end)rr�r!r�r�rbr )	rrr��gr=Zgsr�rB�s1r	r	r
�lr0_gotous2





zLRGeneratedTable.lr0_gotoc	Cs�|j|jjdjg�g}d}x"|D]}||jt|�<|d7}q"Wd}x�|t|�kr�||}|d7}i}x$|D]}x|jD]}d||<qxWqlWxJ|D]B}|j||�}|s�t|�|jkr�q�t|�|jt|�<|j	|�q�WqFW|S)Nrrd)
r rr�r�rr!rr�r#rb)	r�CrFrZasyms�iir=r�r!r	r	r
�	lr0_items�s(


zLRGeneratedTable.lr0_itemscCs�t�}d}xrxV|jjdd�D]B}|jdkr:|j|j�qx$|jD]}||krBPqBW|j|j�qWt|�|krrPt|�}qW|S)Nrrd)r�rr�rr�rr�)r�nullableZnum_nullabler�r�r	r	r
�compute_nullable_nonterminals�s
z.LRGeneratedTable.compute_nullable_nonterminalscCsrg}xht|�D]\\}}xR|D]J}|j|jdkr||j|jdf}|d|jjkr||kr|j|�qWqW|S)Nrd)r�r�rr�rr�rb)rr$�transZstatenorir�r�r	r	r
�find_nonterminal_transitions�s
z-LRGeneratedTable.find_nonterminal_transitionsc
Cs�|\}}g}|j|||�}xJ|D]B}|j|jdkr"|j|jd}	|	|jjkr"|	|kr"|j|	�q"W|dkr�||jjdjdkr�|jd�|S)Nrdrz$end)r#r�rr�rr�rbr�)
rr$r)r'rir�termsr!r�rr	r	r
�dr_relation	s

zLRGeneratedTable.dr_relationcCsvg}|\}}|j|||�}|jjt|�d�}xB|D]:}	|	j|	jdkr4|	j|	jd}
|
|kr4|j||
f�q4W|S)Nrdr~)r#rr�r!r�rr�rb)rr$r)�emptyr
rirr!rGr�rr	r	r
�reads_relation	s
zLRGeneratedTable.reads_relationcCs�i}i}i}x|D]}d||<qW�x�|D�]�\}}	g}
g}�xR||D�]D}|j|	krZqH|j}
|}x�|
|jdk�r
|
d}
|j|
}||f|kr�|
d}xH||jkr�|j||jjkr�P|j||kr�P|d}q�W|j||f�|j|||�}|jj	t
|�d�}qfWx�||D]t}|j|jk�r,�q|j|jk�r>�qd}xD||jk�rx|j||j|dk�rlP|d}�qDW|
j||f��qWqHWx2|D]*}||k�r�g||<||j||	f��q�W|
|||	f<q*W||fS)Nrdrr~)rr�rr�rr�rbr#rr�r!)rr$r)r'ZlookdictZincludedictZdtransr�rirZlookbZincludesr�r�rGZlir!r"rFr	r	r
�compute_lookback_includesD	sX




z*LRGeneratedTable.compute_lookback_includescs0���fdd�}���fdd�}t|||�}|S)Ncs�j�|��S)N)r,)r�)r$r'rr	r
�<lambda>�	sz4LRGeneratedTable.compute_read_sets.<locals>.<lambda>cs�j�|��S)N)r.)r�)r$r'rr	r
r0�	s)r	)rr$�ntransr'rrrr	)r$r'rr
�compute_read_sets�	sz"LRGeneratedTable.compute_read_setscs(�fdd�}�fdd�}t|||�}|S)Ncs�|S)Nr	)r�)�readsetsr	r
r0�	sz6LRGeneratedTable.compute_follow_sets.<locals>.<lambda>cs�j|g�S)N)r�)r�)�inclsetsr	r
r0�	s)r	)rr1r3r4rrrr	)r4r3r
�compute_follow_sets�	sz$LRGeneratedTable.compute_follow_setsc	Csxxr|j�D]f\}}x\|D]T\}}||jkr4g|j|<|j|g�}x*|D]"}||j|krF|j|j|�qFWqWq
WdS)N)rfr�r�rb)	rZ	lookbacksZ	followsetr)Zlbrir�rrr	r	r
�add_lookaheads�	s


zLRGeneratedTable.add_lookaheadscCsP|j�}|j|�}|j|||�}|j|||�\}}|j|||�}|j||�dS)N)r(r*r2r/r5r6)rr$r'r)r3ZlookdZincludedZ
followsetsr	r	r
�add_lalr_lookaheads�	s
z$LRGeneratedTable.add_lalr_lookaheadsc$	Cs8|jj}|jj}|j}|j}|j}i}|jd|j�|j�}|jdkrP|j	|�d}�x�|D�]�}	g}
i}i}i}
|jd�|jd|�|jd�x|	D]}|jd|j
|�q�W|jd��x|	D�]�}|j|jdk�r(|j
dkr�d|d	<||d	<�q�|jdk�r|j|}n|jj|j
}�x�|D�]�}|
j||d
|j
|ff�|j|�}|dk	�r�|dk�r>|j|d�\}}||j
j\}}||k�s�||k�r�|dk�r�|j
||<|||<|�r�|�r�|jd
|�|jj||df�||j
jd7_nB||k�r|dk�rd||<n$|�s�|jd|�|jj||df�n�|dk�r�||}||j
}|j|jk�r�|j
||<|||<||}}||j
jd7_||j
jd8_n
||}}|jj|||f�|jd|||j
||�ntd|��n(|j
||<|||<||j
jd7_�q&Wq�|j}|j|d}||jjkr�|j|	|�}|jjt|�d�}|dkr�|
j||d|f�|j|�}|dk	�r�|dk�r�||k�r�td|��n�|dk�r�|j|d�\}}|||j
j\}}||k�s||k�rR|dk�rR|||j
jd8_|||<|||<|�s�|jd|�|jj||df�nL||k�rp|dk�rpd||<n.|�r�|�r�|jd
|�|jj||df�ntd|��q�|||<|||<q�Wi}xF|
D]>\}}}||k�r�|||k�r�|jd||�d|||f<�q�W|jd�d}xX|
D]P\}}}||k�r"|||k	�r"||f|k�r"|jd||�d}d|||f<�q"W|�r�|jd�i} x6|	D].}!x&|!jD]}"|"|jjk�r�d| |"<�q�W�q�WxL| D]D}#|j|	|#�}|jjt|�d�}|dk�r�||
|#<|jd|#|��q�W|||<|||<|
||<|d7}q\WdS)NzParsing method: %srrrxzstate %dz    (%d) %srdzS'z$endzreduce using rule %d (%s)r�r�z3  ! shift/reduce conflict for %s resolved as reduce�reducer�z2  ! shift/reduce conflict for %s resolved as shiftZshiftz=  ! reduce/reduce conflict for %s resolved using rule %d (%s)zUnknown conflict in state %dzshift and go to state %dz Shift/shift conflict in state %dz    %-15s %sz  ! %-15s [ %s ]z"    %-30s shift and go to state %d)r�rr~)r�rr~) rr�r�r\rZrrr�r&r7r�rr�rr�r�rbr�r�rr�r�rrr�r�r#rr!rr�r�)$rr�r�r]r[rZactionpr$�strZactlistZ	st_actionZ
st_actionpZst_gotor�Zlaheadsrr"ZsprecZslevelZrprecZrlevelZoldpZppZchosenpZrejectprFr!rGZ	_actprintr�Znot_usedZnkeysr%r=rBr	r	r
r�	s




























zLRGeneratedTable.lr_parse_tablerxcCs�t|tj�rtd��|jd�d}tjj||�d}�ylt|d�}|j	dtjj
|�t|j|f�d}|�rti}xf|j
j�D]X\}	}
xN|
j�D]B\}}|j|�}
|
s�ggf}
|
||<|
dj|	�|
dj|�q�Wq|W|j	d�xz|j�D]n\}}|j	d	|�x |dD]}
|j	d
|
��qW|j	d�x |dD]}
|j	d
|
��q8W|j	d�q�W|j	d
�|j	d�nJ|j	d�x4|j
j�D]&\}}|j	d|d|d|f��q�W|j	d
�|�r�i}xl|jj�D]^\}	}
xR|
j�D]F\}}|j|�}
|
�sggf}
|
||<|
dj|	�|
dj|��q�W�q�W|j	d�x||j�D]p\}}|j	d	|�x |dD]}
|j	d
|
��qjW|j	d�x |dD]}
|j	d
|
��q�W|j	d��qJW|j	d
�|j	d�nJ|j	d�x4|jj�D]&\}}|j	d|d|d|f��q�W|j	d
�|j	d�xd|jD]Z}|j�rl|j	d|j|j|j|jtjj
|j�|jf�n|j	dt|�|j|jf��q0W|j	d�|j�Wn&tk
�r�}z�WYdd}~XnXdS)Nz"Won't overwrite existing tabmoduler�rdz.py�wz�
# %s
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = %r

_lr_method = %r

_lr_signature = %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 = { z(%r,%r):%r,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]
r~)rAr�r��IOError�splitr�r�r�r�r
�basenamer�r�rZrfr�rbr\rXr�r7rrr�r�r�)r�	tabmodule�	outputdirrZbasemodulenamer�rZsmallerrfr=ZndrrDrFr�r��er	r	r
�write_table�
s�
	




"





"

"
zLRGeneratedTable.write_tablecCsyddl}Wntk
r(ddl}YnXt|d���}|jt|t�|j|j|t�|j||t�|j|j|t�|j|j	|t�g}x^|j
D]T}|jr�|j|j
|j|j|jtjj|j�|jf�q�|jt
|�|j|jdddf�q�W|j||t�WdQRXdS)Nr�wb)r�r�r�r��dumpr��pickle_protocolr�rZr\rXr�rbr7rrr�r�r=r�r�)rr�rr�ZoutfZoutpr�r	r	r
�pickle_table"s ,"zLRGeneratedTable.pickle_table)rN)rxrx)rx)rrrrr r#r&r(r*r,r.r/r2r5r6r7rrArEr	r	r	r
r5s"
%#8+PB
{rcCs0tj|�}|jj�}|j|jkr,|j|j�|S)N)rn�	_getframe�	f_globals�copy�f_locals�update)ZlevelsrZldictr	r	r
�get_caller_module_dictEs


rKcCsg}|j�}d}|}x�|D]�}|d7}|j�}|s4qy�|ddkrh|sVtd||f��|}	|dd�}
n@|d}	|	}|dd�}
|d}|dkr�|dkr�td||f��|j|||	|
f�Wqtk
r��Yqtk
r�td	|||j�f��YqXqW|S)
Nrdr�|z%s:%d: Misplaced '|'r��:z::=z!%s:%d: Syntax error. Expected ':'z%s:%d: Syntax error in rule %r)�
splitlinesr<rVrb�	Exception�strip)�docr�r�rZpstringsZlastpZdlineZpsr�r�r�Zassignr	r	r
�
parse_grammarQs6
 rRc@s�eZdZd dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS)!�
ParserReflectNcCsL||_d|_d|_d|_t�|_g|_d|_|dkrBtt	j
�|_n||_dS)NF)r�r��
error_func�tokensr�r�rrrrnror)rr�rr	r	r
r{szParserReflect.__init__cCs,|j�|j�|j�|j�|j�dS)N)�	get_start�get_error_func�
get_tokens�get_precedence�get_pfunctions)rr	r	r
�get_all�s
zParserReflect.get_allcCs6|j�|j�|j�|j�|j�|j�|jS)N)�validate_start�validate_error_func�validate_tokens�validate_precedence�validate_pfunctions�validate_modulesr)rr	r	r
�validate_all�szParserReflect.validate_allcCs�g}yv|jr|j|j�|jr:|jdjdd�|jD���|jrR|jdj|j��x$|jD]}|drZ|j|d�qZWWnttfk
r�YnXdj|�S)NrxcSsg|]}dj|��qS)rx)r�)r?r�r	r	r
r@�sz+ParserReflect.signature.<locals>.<listcomp>ryr)r�rbr�r�rU�pfuncs�	TypeError�
ValueError)r�partsrr	r	r
r�szParserReflect.signaturecCs�tjd�}x�|jD]�}ytj|�\}}Wntk
r>wYnXi}xjt|�D]^\}}|d7}|j|�}|rN|jd�}|j	|�}	|	s�|||<qNtj
|�}
|jjd|
|||	�qNWqWdS)Nz\s*def\s+(p_[a-zA-Z_0-9]*)\(rdz;%s:%d: Function %s redefined. Previously defined on line %d)
�re�compiler��inspectZgetsourcelinesr;r�r��groupr��
getsourcefilerr)rZfrer��linesZlinenZ	counthashr�r�r�prevr�r	r	r
ra�s$





zParserReflect.validate_modulescCs|jjd�|_dS)Nr�)r�r�r�)rr	r	r
rV�szParserReflect.get_startcCs&|jdk	r"t|jt�s"|jjd�dS)Nz'start' must be a string)r�rA�string_typesrr)rr	r	r
r\�s
zParserReflect.validate_startcCs|jjd�|_dS)N�p_error)r�r�rT)rr	r	r
rW�szParserReflect.get_error_funccCs�|jr�t|jtj�rd}n*t|jtj�r.d}n|jjd�d|_dS|jjj}|jjj	}t
j|j�}|jj
|�|jjj|}|dkr�|jjd||�d|_dS)Nrrdz2'p_error' defined, but is not a function or methodTz$%s:%d: p_error() requires 1 argument)rTrAr��FunctionType�
MethodTyperr�__code__�co_firstlineno�co_filenameri�	getmoduler�r��co_argcount)rZismethodZelineZefiler�Zargcountr	r	r
r]�s 

z!ParserReflect.validate_error_funccCsr|jjd�}|s&|jjd�d|_dSt|ttf�sJ|jjd�d|_dS|sd|jjd�d|_dSt|�|_dS)NrUzNo token list is definedTztokens must be a list or tupleztokens is empty)	r�r�rrrArgr��sortedrU)rrUr	r	r
rX�szParserReflect.get_tokenscCsZd|jkr |jjd�d|_dSt�}x.|jD]$}||krH|jjd|�|j|�q.WdS)Nrz.Illegal token name 'error'. Is a reserved wordTzToken %r multiply defined)rUrrr�rr�)rr�rBr	r	r
r^s
zParserReflect.validate_tokenscCs|jjd�|_dS)Nr�)r�r�r�)rr	r	r
rYszParserReflect.get_precedencecCsg}|j�rt|jttf�s2|jjd�d|_dSx�t|j�D]�\}}t|ttf�sj|jjd�d|_dSt|�dkr�|jjd|�d|_dS|d}t|t�s�|jjd�d|_dSxH|dd�D]8}t|t�s�|jjd	�d|_dS|j	|||df�q�Wq>W||_
dS)
Nz"precedence must be a list or tupleTzBad precedence tabler�z?Malformed precedence entry %s. Must be (assoc, term, ..., term)rz)precedence associativity must be a stringrdz precedence items must be strings)r�rArgr�rrr�rrnrb�preclist)rrxr�r�r�r�r	r	r
r_s6

z!ParserReflect.validate_precedencecCs�g}xl|jj�D]^\}}|jd�s|dkr.qt|tjtjf�rt|d|jj	�}t
j|�}|j||||j
f�qW|jdd�d�||_dS)N�p_rorscSs |dt|d�|d|dfS)Nrrdr�r)r7)Z
p_functionr	r	r
r0Fs
z.ParserReflect.get_pfunctions.<locals>.<lambda>)�key)r�rf�
startswithrAr�rprqrKrrrsrirurb�__doc__�sortrc)rZp_functionsr�itemr�r�r	r	r
rZ9s
zParserReflect.get_pfunctionscCs^g}t|j�dkr(|jjd�d|_dS�x"|jD�]\}}}}tj|�}|j|}t|tj	�rfd}nd}|j
j|kr�|jjd|||j�d|_q2|j
j|kr�|jjd|||j�d|_q2|j
s�|jjd|||j�q2y,t|||�}	x|	D]}
|j||
f�q�WWn:tk
�r<}z|jjt|��d|_WYdd}~XnX|jj|�q2W�x|jj�D]�\}}
|jd	��r�t|
tjtj	f��r��q\|jd
��r��q\|jd	��r�|dk�r�|jjd|�t|
tj��r�|
j
jdk�s�t|
tj	��r\|
jj
jdk�r\|
j
�r\y8|
j
jd
�}|ddk�r4|jjd|
j
j|
j
j|�Wntk
�rLYnX�q\W||_dS)Nrz+no rules of the form p_rulename are definedTr�rdz%%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)ryZt_roz%r not defined as a functionryrMz9%s:%d: Possible grammar rule %r defined without p_ prefix)rrcrrrirkr�rAr�rqrrrvrr|rrRrbrVr7r�r�rfr{rp�__func__r<rtrsr�r)rrr�r�rrQr�r�ZreqargsZparsed_gr!r@rBrDr	r	r
r`Ns\


 z!ParserReflect.validate_pfunctions)N)rrrrr[rbrrarVr\rWr]rXr^rYr_rZr`r	r	r	r
rSzs

rSc
<Os�	|dkrt}|rd}|dkr&ttj�}�r��fdd�t��D�}
t|
�}d|krdtj|dj|d<d|kr�d|kr�ttj|dd�r�tj|dj	|d<nt
d�}|	dk�rt|tj
�r�|j}nLd|kr�|d}n:|jd�}dj|dd6��}td
|�ttj|dd�}tjj|�}	|jd�}|�rNt|t��rNd|k�rN|d|}|dk	�r`||d<t||d
�}|j�|j�r�td��|j�}y�t�}|�r�|j|�}n
|j|�}|�s�||k�ry"|j|j �t!||j"�}|j#a#|St$k
�r}z|j%d|�WYdd}~XnXWnFt&k
�rH}z|j%t|��WYdd}~Xnt'k
�r\YnX|
dk�r�|�r�ytt(tjj|	|�d��}
Wn<t)k
�r�}z|j%d||f�t*�}
WYdd}~XnXnt*�}
|
j+dt,�d}|j-��r�td��|j"�s|j%d�t.|j/�}xZ|j0D]P\}}}y|j1|||�Wn0t2k
�rb}z|j%d|�WYdd}~XnX�qWxl|j3D]b\}}|\} }!}"}#y|j4|"|#|| |!�Wn4t2k
�r�}z|jd|�d}WYdd}~XnX�qrWy&|dk�r�|j5|j6�n
|j5|�Wn6t2k
�r4}z|jt|��d}WYdd}~XnX|�rDtd��|j7�}$x*|$D]"\}%}&|jd|&j8|&j9|%�d}�qRW|j:�}'|'�r�|
j+d�|
j+d�|
j+d�x&|'D]}|j%d|�|
j+d|��q�W|�r|
j+d�|
j+d�|
j+d�x&t;|j<�D]\}(})|
j+d|(|)��q�W|j=�}*x$|*D]}&|j%d|&j8|&j9|&j>��q&Wt?|'�d	k�r^|j%d�t?|'�d	k�r||j%dt?|'��t?|*�d	k�r�|j%d �t?|*�d	k�r�|j%d!t?|*��|�r�|
j+d�|
j+d"�|
j+d�t@|jA�}+|+jB�x2|+D]*}|
j+d#|d$jd%d�|jA|D����q�W|
j+d�|
j+d&�|
j+d�t@|jC�},|,jB�x2|,D]*}-|
j+d#|-d$jd'd�|jC|-D����qRW|
j+d�|�r�|jD�}.x|.D]}/|j%d(|/��q�W|jE�}0x|0D]}1|jd)|1�d}�q�W|jF�}2x$|2D]\}}|jd*||�d}�q�W|�rtd��|�r*|jGd+|�tH|||
�}|�r�t?|jI�}3|3d	k�r\|j%d,�n|3d	k�rr|j%d-|3�t?|jJ�}4|4d	k�r�|j%d.�n|4d	k�r�|j%d/|4�|�r�|jI�s�|jJ�r�|
j%d�|
j%d0�|
j%d�x&|jID]\}5}6}7|
j%d1|6|5|7��q�WtK�}8x�|jJD]x\}5}9}:|5tL|9�tL|:�f|8k�r8�q|
j%d2|5|9�|
j%d3|:|5�|j%d2|5|9�|j%d3|:|5�|8jM|5tL|9�tL|:�f��qWg};xL|jJD]B\}5}9}:|:jN�r�|:|;k�r�|
j%d4|:�|j%d4|:�|;jO|:��q�W|�	rDy&|jP||	|�|tjk�	r
tj|=Wn6t)k
�	rB}z|j%d5||f�WYdd}~XnX|�	r�y|jQ||�Wn6t)k
�	r�}z|j%d5||f�WYdd}~XnX|j|j �t!||j"�}|j#a#|S)7Nrcsg|]}|t�|�f�qSr	)rK)r?r�)r�r	r
r@�szyacc.<locals>.<listcomp>�__file__r�__package__r�r�rdz	import %srxr�)rzUnable to build parserz.There was a problem loading the table file: %rr:zCouldn't open %r. %sz5Created 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 usedzThere is 1 unused tokenzThere are %d unused tokenszThere is 1 unused rulezThere are %d unused rulesz'Terminals, with rules where they appearz
%-20s : %srycSsg|]}t|��qSr	)r7)r?r=r	r	r
r@M
sz*Nonterminals, with rules where they appearcSsg|]}t|��qSr	)r7)r?r=r	r	r
r@U
szSymbol %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 %r. %sr~)R�
tab_modulerrnro�dir�dictr�r�r�r�rKrAr�r�r<r�r�rKr�r��dirnamer�r7rSr[rrrr�rr�rr�rWrTrvrOrr�r�r�r;rr�__version__rbr�rUrxr�r�rr�r�r�r�r�r�r�r�r�r�rrrgr�r}r�r�r�r�rrrrr�r!r�r�rbrArE)<rrr�r>r�Zcheck_recursion�optimizeZwrite_tablesZ	debugfiler?ZdebuglogZerrorlogZ
picklefileZ_itemsr�ZsrcfilerfZpkgnameZpkgZpinforZlrZread_signaturer3r@�errorsrr�r�r��funcnameZgramr�r�r�r�r�rcr�r�rBr�r�r+ZnontermsZnontermZunreachable�ur��infZunused_precZnum_srZnum_rrrir�Z
resolutionZalready_reportedZruleZrejectedZwarned_neverr	)r�r
�yacc�s�







"



$
















*




*













$$r�);rgr�rnZos.pathr�rir(r�r�Z	yaccdebugZ
debug_filer�Z
default_lrr�rlrrD�version_infoZ
basestringrnr7�maxsizer�objectrrrOrr%r'r+r/r-r*r,r.r0r4r5r9rWrhr�r�r�r�r�r�r�r�r�r	rrrrKrRrSr�r	r	r	r
�<module>>s�

7m
H.rT
)


Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 113 B 0644
__init__.cpython-36.pyc File 113 B 0644
access.cpython-36.opt-1.pyc File 11.02 KB 0644
access.cpython-36.pyc File 11.02 KB 0644
audit.cpython-36.opt-1.pyc File 17.29 KB 0644
audit.cpython-36.pyc File 17.29 KB 0644
classperms.cpython-36.opt-1.pyc File 2.43 KB 0644
classperms.cpython-36.pyc File 2.43 KB 0644
defaults.cpython-36.opt-1.pyc File 2.19 KB 0644
defaults.cpython-36.pyc File 2.19 KB 0644
interfaces.cpython-36.opt-1.pyc File 12.25 KB 0644
interfaces.cpython-36.pyc File 12.25 KB 0644
lex.cpython-36.opt-1.pyc File 20.92 KB 0644
lex.cpython-36.pyc File 20.92 KB 0644
matching.cpython-36.opt-1.pyc File 5.95 KB 0644
matching.cpython-36.pyc File 5.95 KB 0644
module.cpython-36.opt-1.pyc File 6.95 KB 0644
module.cpython-36.pyc File 6.95 KB 0644
objectmodel.cpython-36.opt-1.pyc File 3.83 KB 0644
objectmodel.cpython-36.pyc File 3.83 KB 0644
output.cpython-36.opt-1.pyc File 3.42 KB 0644
output.cpython-36.pyc File 3.42 KB 0644
policygen.cpython-36.opt-1.pyc File 12.52 KB 0644
policygen.cpython-36.pyc File 12.57 KB 0644
refparser.cpython-36.opt-1.pyc File 28.38 KB 0644
refparser.cpython-36.pyc File 28.38 KB 0644
refpolicy.cpython-36.opt-1.pyc File 39.9 KB 0644
refpolicy.cpython-36.pyc File 39.9 KB 0644
sepolgeni18n.cpython-36.opt-1.pyc File 304 B 0644
sepolgeni18n.cpython-36.pyc File 304 B 0644
util.cpython-36.opt-1.pyc File 6.22 KB 0644
util.cpython-36.pyc File 6.22 KB 0644
yacc.cpython-36.opt-1.pyc File 52.77 KB 0644
yacc.cpython-36.pyc File 52.86 KB 0644