o
    ¯N i%  ã                   @   s‚   d Z G dd„ dƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG d	d
„ d
eƒZG dd„ deƒZeƒ ZG dd„ deƒZeƒ Z	dS )zB
Python Lexical Analyser

Actions for use in token specifications
c                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )ÚActionc                 C   ó   d S ©N© ©ÚselfÚtoken_streamÚtextr   r   úG/home/ubuntu/.local/lib/python3.10/site-packages/Cython/Plex/Actions.pyÚperform   ó   zAction.performc                 C   ó   | S r   r   ©r   r   r   r	   Ú__copy__   r   zAction.__copy__c                 C   r   r   r   )r   Úmemor   r   r	   Ú__deepcopy__   r   zAction.__deepcopy__N)Ú__name__Ú
__module__Ú__qualname__r
   r   r   r   r   r   r	   r      s    r   c                   @   ó(   e Zd ZdZdd„ Zdd„ Zdd„ ZdS )	ÚReturnzk
    Internal Plex action which causes |value| to
    be returned as the value of the associated token
    c                 C   ó
   || _ d S r   ©Úvalue)r   r   r   r   r	   Ú__init__   ó   
zReturn.__init__c                 C   s   | j S r   r   r   r   r   r	   r
      s   zReturn.performc                 C   ó
   d| j  S )Nz
Return(%r)r   r   r   r   r	   Ú__repr__   r   zReturn.__repr__N©r   r   r   Ú__doc__r   r
   r   r   r   r   r	   r      s
    r   c                   @   r   )	ÚCallzD
    Internal Plex action which causes a function to be called.
    c                 C   r   r   ©Úfunction)r   r!   r   r   r	   r   '   r   zCall.__init__c                 C   s   |   ||¡S r   r    r   r   r   r	   r
   *   ó   zCall.performc                 C   s   d| j j S )NzCall(%s))r!   r   r   r   r   r	   r   -   r"   zCall.__repr__Nr   r   r   r   r	   r   "   s
    r   c                   @   r   )	ÚMethodz‘
    Plex action that calls a specific method on the token stream,
    passing the matched text and any provided constant keyword arguments.
    c                 K   s   || _ |pd | _d S r   )ÚnameÚkwargs)r   r$   r%   r   r   r	   r   7   s   zMethod.__init__c                 C   s0   t || jƒ}| jd ur||fi | j¤ŽS ||ƒS r   )Úgetattrr$   r%   )r   r   r   Úmethodr   r   r	   r
   ;   s   $zMethod.performc                 C   sJ   | j d urd tdd„ | j  ¡ D ƒƒ¡nd}d| j|r d|f S d|f S )Nz, c                 S   s   g | ]}d | ‘qS )z%s=%rr   )Ú.0Úitemr   r   r	   Ú
<listcomp>B   s    z#Method.__repr__.<locals>.<listcomp>Ú zMethod(%s%s%s))r%   ÚjoinÚsortedÚitemsr$   )r   r%   r   r   r	   r   @   s
   
ÿþzMethod.__repr__Nr   r   r   r   r	   r#   1   s
    r#   c                   @   r   )	ÚBeginz¦
    Begin(state_name) is a Plex action which causes the Scanner to
    enter the state |state_name|. See the docstring of Plex.Lexicon
    for more information.
    c                 C   r   r   ©Ú
state_name)r   r1   r   r   r	   r   N   r   zBegin.__init__c                 C   s   |  | j¡ d S r   )Úbeginr1   r   r   r   r	   r
   Q   s   zBegin.performc                 C   r   )Nz	Begin(%s)r0   r   r   r   r	   r   T   r   zBegin.__repr__Nr   r   r   r   r	   r/   G   s
    r/   c                   @   ó    e Zd ZdZdd„ Zdd„ ZdS )ÚIgnorez“
    IGNORE is a Plex action which causes its associated token
    to be ignored. See the docstring of Plex.Lexicon  for more
    information.
    c                 C   r   r   r   r   r   r   r	   r
   _   r   zIgnore.performc                 C   ó   dS )NÚIGNOREr   r   r   r   r	   r   b   r   zIgnore.__repr__N©r   r   r   r   r
   r   r   r   r   r	   r4   X   ó    r4   c                   @   r3   )ÚTextz«
    TEXT is a Plex action which causes the text of a token to
    be returned as the value of the token. See the docstring of
    Plex.Lexicon  for more information.
    c                 C   s   |S r   r   r   r   r   r	   r
   p   r   zText.performc                 C   r5   )NÚTEXTr   r   r   r   r	   r   s   r   zText.__repr__Nr7   r   r   r   r	   r9   i   r8   r9   N)
r   r   r   r   r#   r/   r4   r6   r9   r:   r   r   r   r	   Ú<module>   s    
