U
    :qLeæ  ã                   @   s:   d dl mZ d dlmZmZ dZdZG dd„ deƒZ[dS )é    )ÚInputStream)ÚLexerActionÚLexerIndexedCustomActionNc                   @   sd   e Zd Zeƒ fedœdd„Zeeedœdd„ƒZe	dœdd	„Z
eee	d
œdd„Zdd„ Zdd„ ZdS )ÚLexerActionExecutor)ÚlexerActionsc                 C   s$   || _ td dd„ |D ƒ¡ƒ| _d S )NÚ c                 S   s   g | ]}t |ƒ‘qS © )Ústr©Ú.0Úlar   r   úu/home/p21-0144/sympy/latex2sympy2solve-back-end/sympyEq/lib/python3.8/site-packages/antlr4/atn/LexerActionExecutor.pyÚ
<listcomp>   s     z0LexerActionExecutor.__init__.<locals>.<listcomp>)r   ÚhashÚjoinÚhashCode)Úselfr   r   r   r   Ú__init__   s    zLexerActionExecutor.__init__)ÚlexerActionExecutorÚlexerActionc                 C   s&   | d krt |gƒS | j|g }t |ƒS ©N)r   r   )r   r   r   r   r   r   Úappend,   s    
zLexerActionExecutor.append)Úoffsetc                 C   sz   d }t dt| jƒƒD ]L}| j| jrt| j| tƒs|d krLdd„ | jD ƒ}t|| j| ƒ||< q|d krn| S t|ƒS d S )Nr   c                 S   s   g | ]}|‘qS r   r   r
   r   r   r   r   U   s     z<LexerActionExecutor.fixOffsetBeforeMatch.<locals>.<listcomp>)ÚrangeÚlenr   ÚisPositionDependentÚ
isinstancer   r   )r   r   ZupdatedLexerActionsÚir   r   r   ÚfixOffsetBeforeMatchP   s    z(LexerActionExecutor.fixOffsetBeforeMatch)ÚlexerÚinputÚ
startIndexc              	   C   s€   d}|j }z`| jD ]T}t|tƒrH|j}| || ¡ |j}|| |k}n|jr\| |¡ d}| |¡ qW 5 |rz| |¡ X d S )NF)	ÚindexÚseekr   r   r   r   Úactionr   Úexecute)r   r   r    r!   ZrequiresSeekÚ	stopIndexr   r   r   r   r   r%   p   s    


zLexerActionExecutor.executec                 C   s   | j S r   )r   )r   r   r   r   Ú__hash__‚   s    zLexerActionExecutor.__hash__c                 C   s6   | |krdS t |tƒsdS | j|jko0| j|jkS d S )NTF)r   r   r   r   )r   Úotherr   r   r   Ú__eq__…   s    

ÿzLexerActionExecutor.__eq__N)Ú__name__Ú
__module__Ú__qualname__Úlistr   Ústaticmethodr   r   r   Úintr   ÚLexerr   r%   r'   r)   r   r   r   r   r      s   # r   )Úantlr4.InputStreamr   Zantlr4.atn.LexerActionr   r   r0   r   Úobjectr   r   r   r   Ú<module>   s
   x