B
    Í‹dñ	  ã               @   sp   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 )c               @   s   e Zd Zdd„ Zdd„ ZdS )ÚActionc             C   s   d S )N© )ÚselfÚtoken_streamÚtextr   r   ú`/work/yifan.wang/ringdown/master-ringdown-env/lib/python3.7/site-packages/Cython/Plex/Actions.pyÚperform   s    zAction.performc             C   s   | |kS )Nr   )r   Úotherr   r   r   Úsame_as   s    zAction.same_asN)Ú__name__Ú
__module__Ú__qualname__r   r	   r   r   r   r   r   
   s   r   c               @   s0   e Zd ZdZd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   s
   || _ d S )N)Úvalue)r   r   r   r   r   Ú__init__   s    zReturn.__init__c             C   s   | j S )N)r   )r   r   r   r   r   r   r      s    zReturn.performc             C   s   t |tƒo| j|jkS )N)Ú
isinstancer   r   )r   r   r   r   r   r	      s    zReturn.same_asc             C   s   dt | jƒ S )Nz
Return(%s))Úreprr   )r   r   r   r   Ú__repr__!   s    zReturn.__repr__N)r
   r   r   Ú__doc__r   r   r	   r   r   r   r   r   r      s
   r   c               @   s0   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
S )ÚCallzD
    Internal Plex action which causes a function to be called.
    c             C   s
   || _ d S )N)Úfunction)r   r   r   r   r   r   *   s    zCall.__init__c             C   s   |   ||¡S )N)r   )r   r   r   r   r   r   r   -   s    zCall.performc             C   s   d| j j S )NzCall(%s))r   r
   )r   r   r   r   r   0   s    zCall.__repr__c             C   s   t |tƒo| j|jkS )N)r   r   r   )r   r   r   r   r   r	   3   s    zCall.same_asN)r
   r   r   r   r   r   r   r	   r   r   r   r   r   %   s
   r   c               @   s0   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
S )Ú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   s
   || _ d S )N)Ú
state_name)r   r   r   r   r   r   >   s    zBegin.__init__c             C   s   |  | j¡ d S )N)Úbeginr   )r   r   r   r   r   r   r   A   s    zBegin.performc             C   s
   d| j  S )Nz	Begin(%s))r   )r   r   r   r   r   D   s    zBegin.__repr__c             C   s   t |tƒo| j|jkS )N)r   r   r   )r   r   r   r   r   r	   G   s    zBegin.same_asN)r
   r   r   r   r   r   r   r	   r   r   r   r   r   7   s
   r   c               @   s    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   s   d S )Nr   )r   r   r   r   r   r   r   R   s    zIgnore.performc             C   s   dS )NÚIGNOREr   )r   r   r   r   r   U   s    zIgnore.__repr__N)r
   r   r   r   r   r   r   r   r   r   r   K   s   r   c               @   s    e Zd ZdZdd„ Zdd„ ZdS )Ú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 )Nr   )r   r   r   r   r   r   r   d   s    zText.performc             C   s   dS )NÚTEXTr   )r   r   r   r   r   g   s    zText.__repr__N)r
   r   r   r   r   r   r   r   r   r   r   ]   s   r   N)	Úobjectr   r   r   r   r   r   r   r   r   r   r   r   Ú<module>
   s   