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	   [/home/ubuntu/veenaModal/venv/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