o
    ‹Ù·i  ã                   @   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                   @   sn   e Zd ZdZeƒ fdefdd„Zededefdd„ƒZ	d	e
fd
d„Zdedede
fdd„Zdd„ Zdd„ ZdS )ÚLexerActionExecutor)ÚlexerActionsÚhashCoder   c                 C   s$   || _ td dd„ |D ƒ¡ƒ| _d S )NÚ c                 S   s   g | ]}t |ƒ‘qS © )Ústr©Ú.0Úlar	   r	   úR/home/ubuntu/.local/lib/python3.10/site-packages/antlr4/atn/LexerActionExecutor.pyÚ
<listcomp>   s    z0LexerActionExecutor.__init__.<locals>.<listcomp>)r   ÚhashÚjoinr   )Úselfr   r	   r	   r   Ú__init__   s   zLexerActionExecutor.__init__ÚlexerActionExecutorÚlexerActionc                 C   s&   | d u r	t |gƒS | j|g }t |ƒS ©N)r   r   )r   r   r   r	   r	   r   Úappend-   s   
zLexerActionExecutor.appendÚoffsetc                 C   sv   d }t dt| jƒƒD ]&}| j| jr0t| j| tƒs0|d u r&dd„ | jD ƒ}t|| j| ƒ||< q
|d u r7| S t|ƒS )Nr   c                 S   s   g | ]}|‘qS r	   r	   r   r	   r	   r   r   V   s    z<LexerActionExecutor.fixOffsetBeforeMatch.<locals>.<listcomp>)ÚrangeÚlenr   ÚisPositionDependentÚ
isinstancer   r   )r   r   ÚupdatedLexerActionsÚir	   r	   r   ÚfixOffsetBeforeMatchQ   s   €z(LexerActionExecutor.fixOffsetBeforeMatchÚlexerÚinputÚ
startIndexc              	   C   s’   d}|j }z:| jD ]*}t|tƒr$|j}| || ¡ |j}|| |k}n
|jr.| |¡ d}| |¡ q	W |r>| |¡ d S d S |rH| |¡ w w )NF)	Úindexr   r   r   r   ÚseekÚactionr   Úexecute)r   r    r!   r"   ÚrequiresSeekÚ	stopIndexr   r   r	   r	   r   r&   q   s&   


÷ÿÿzLexerActionExecutor.executec                 C   s   | j S r   )r   )r   r	   r	   r   Ú__hash__ƒ   s   zLexerActionExecutor.__hash__c                 C   s2   | |u rdS t |tƒsdS | j|jko| j|jkS )NTF)r   r   r   r   )r   Úotherr	   r	   r   Ú__eq__†   s   

ÿzLexerActionExecutor.__eq__N)Ú__name__Ú
__module__Ú__qualname__Ú	__slots__Úlistr   Ústaticmethodr   r   r   Úintr   ÚLexerr   r&   r)   r+   r	   r	   r	   r   r      s    # r   )Úantlr4.InputStreamr   Úantlr4.atn.LexerActionr   r   r3   r   Úobjectr	   r	   r	   r   Ú<module>   s   y