
    ۏDj                         d Z  G d d      Z G d de      Z G d de      Z G d de      Z G d	 d
e      Z G d de      Z e       Z G d de      Z e       Z	y)zB
Python Lexical Analyser

Actions for use in token specifications
c                       e Zd Zd Zd Zd Zy)Actionc                      y N selftoken_streamtexts      WC:\Crop_Prediction\Backend\crop-ai-system\venv\Lib\site-packages\Cython/Plex/Actions.pyperformzAction.perform   s        c                     | S r   r   r   s    r   __copy__zAction.__copy__       r   c                     | S r   r   )r   memos     r   __deepcopy__zAction.__deepcopy__   r   r   N)__name__
__module____qualname__r   r   r   r   r   r   r   r      s    r   r   c                   "    e Zd ZdZd Zd Zd Zy)Returnzk
    Internal Plex action which causes |value| to
    be returned as the value of the associated token
    c                     || _         y r   value)r   r   s     r   __init__zReturn.__init__   s	    
r   c                     | j                   S r   r   r   s      r   r   zReturn.perform   s    zzr   c                      d| j                   z  S )Nz
Return(%r)r   r   s    r   __repr__zReturn.__repr__   s    djj((r   Nr   r   r   __doc__r   r   r    r   r   r   r   r      s    
)r   r   c                   "    e Zd ZdZd Zd Zd Zy)CallzD
    Internal Plex action which causes a function to be called.
    c                     || _         y r   function)r   r'   s     r   r   zCall.__init__'   s	     r   c                 &    | j                  ||      S r   r&   r   s      r   r   zCall.perform*   s    }}\400r   c                 4    d| j                   j                  z  S )NzCall(%s))r'   r   r   s    r   r    zCall.__repr__-   s    DMM2222r   Nr!   r   r   r   r$   r$   "   s    !13r   r$   c                   "    e Zd ZdZd Zd Zd Zy)Methodz
    Plex action that calls a specific method on the token stream,
    passing the matched text and any provided constant keyword arguments.
    c                 (    || _         |xs d | _        y r   )namekwargs)r   r-   r.   s      r   r   zMethod.__init__7   s    	nr   c                 |    t        || j                        }| j                   ||fi | j                  S  ||      S r   )getattrr-   r.   )r   r	   r
   methods       r   r   zMethod.perform;   s9    tyy1.2kk.Evd*dkk*W6RV<Wr   c           	          | j                   Cdj                  t        | j                   j                         D cg c]  }d|z  	 c}            nd}d| j                  |rdnd|dS c c}w )Nz, z%s=%r zMethod())r.   joinsorteditemsr-   )r   itemr.   s      r   r    zMethod.__repr__@   se     {{& IIf9J9J9LMgnMNO,. 	 $(99fd".DfMM Ns   A*Nr!   r   r   r   r+   r+   1   s    
%X
Nr   r+   c                   "    e Zd ZdZd Zd Zd Zy)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                     || _         y r   
state_name)r   r=   s     r   r   zBegin.__init__N   s	    $r   c                 :    |j                  | j                         y r   )beginr=   r   s      r   r   zBegin.performQ   s    4??+r   c                      d| j                   z  S )Nz	Begin(%s)r<   r   s    r   r    zBegin.__repr__T   s    T__,,r   Nr!   r   r   r   r:   r:   G   s    %,-r   r:   c                       e Zd ZdZd Zd Zy)Ignorez
    IGNORE is a Plex action which causes its associated token
    to be ignored. See the docstring of Plex.Lexicon  for more
    information.
    c                      y r   r   r   s      r   r   zIgnore.perform_   s    r   c                      y)NIGNOREr   r   s    r   r    zIgnore.__repr__b   s    r   Nr   r   r   r"   r   r    r   r   r   rB   rB   X   s    r   rB   c                       e Zd ZdZd Zd Zy)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                     |S r   r   r   s      r   r   zText.performp   r   r   c                      y)NTEXTr   r   s    r   r    zText.__repr__s   s    r   NrF   r   r   r   rH   rH   i   s    r   rH   N)
r"   r   r   r$   r+   r:   rB   rE   rH   rK   r   r   r   <module>rL      sp    )V ) 36 3NV N,-F -"V  
6  vr   