3
¬øÖhg  ã               @   s„   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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   s   d S )N© )ÚselfÚtoken_streamÚtextr   r   úe/var/www/html/CrowdFlow/Picklecon/ble_analysis_env/lib/python3.6/site-packages/Cython/Plex/Actions.pyÚperform
   s    zAction.performc             C   s   | S )Nr   )r   r   r   r   Ú__copy__   s    zAction.__copy__c             C   s   | S )Nr   )r   Úmemor   r   r   Ú__deepcopy__   s    zAction.__deepcopy__N)Ú__name__Ú
__module__Ú__qualname__r   r   r
   r   r   r   r   r   	   s   r   c               @   s(   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   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
   d| j  S )Nz
Return(%r))r   )r   r   r   r   Ú__repr__    s    zReturn.__repr__N)r   r   r   Ú__doc__r   r   r   r   r   r   r   r      s   r   c               @   s(   e Zd Z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   | j ||ƒ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   /   s    zCall.__repr__N)r   r   r   r   r   r   r   r   r   r   r   r   $   s   r   c               @   s(   e Zd ZdZdd„ Zdd„ Zdd„ ZdS )	Ú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 )N)ÚnameÚkwargs)r   r   r   r   r   r   r   9   s    zMethod.__init__c             C   s,   t || jƒ}| jd k	r$||f| jŽS ||ƒS )N)Úgetattrr   r   )r   r   r   Úmethodr   r   r   r   =   s    zMethod.performc             C   sD   | j d k	r(djtdd„ | j jƒ D ƒƒƒnd}d| j|r:dnd|f S )Nz, c             S   s   g | ]}d | ‘qS )z%s=%rr   )Ú.0Úitemr   r   r   ú
<listcomp>D   s    z#Method.__repr__.<locals>.<listcomp>Ú zMethod(%s%s%s))r   ÚjoinÚsortedÚitemsr   )r   r   r   r   r   r   B   s    ,zMethod.__repr__N)r   r   r   r   r   r   r   r   r   r   r   r   3   s   r   c               @   s(   e Zd Z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   P   s    zBegin.__init__c             C   s   |j | jƒ d S )N)Úbeginr"   )r   r   r   r   r   r   r   S   s    zBegin.performc             C   s
   d| j  S )Nz	Begin(%s))r"   )r   r   r   r   r   V   s    zBegin.__repr__N)r   r   r   r   r   r   r   r   r   r   r   r!   I   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   a   s    zIgnore.performc             C   s   dS )NÚIGNOREr   )r   r   r   r   r   d   s    zIgnore.__repr__N)r   r   r   r   r   r   r   r   r   r   r$   Z   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   r   s    zText.performc             C   s   dS )NÚTEXTr   )r   r   r   r   r   u   s    zText.__repr__N)r   r   r   r   r   r   r   r   r   r   r&   k   s   r&   N)r   Úobjectr   r   r   r   r!   r$   r%   r&   r'   r   r   r   r   Ú<module>   s   