
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
U
    Ó—_:  ã                   @   s4   G d d„ de ƒZG dd„ deƒZG dd„ de ƒZdS )c                   @   s&   e Zd ZdZdZddd„Zdd„ ZdS )	ÚCoordzž Coordinates of a syntactic element. Consists of:
            - File name
            - Line number
            - (optional) column number, for the Lexer
    )ÚfileÚlineÚcolumnÚ__weakref__Nc                 C   s   || _ || _|| _d S )N©r   r   r   )Úselfr   r   r   © r   ú../pycparser/plyparser.pyÚ__init__   s    zCoord.__init__c                 C   s(   d| j | jf }| jr$|d| j 7 }|S )Nz%s:%sz:%sr   )r   Ústrr   r   r	   Ú__str__   s     zCoord.__str__)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r
   r   r   r   r   r	   r      s   
r   c                   @   s   e Zd ZdS )Ú
ParseErrorN)r   r   r   r   r   r   r	   r      s    r   c                   @   s&   e Zd Zdd„ Zddd„Zdd„ ZdS )	Ú	PLYParserc                 C   s<   |d }dd„ }d||f |_ d| |_t| j|j|ƒ dS )zŽ Given a rule name, creates an optional ply.yacc rule
            for it. The name of the optional rule is
            <rulename>_opt
        Z_optc                 S   s   |d |d< d S )Né   é    r   )r   Úpr   r   r	   Úoptrule)   s    z+PLYParser._create_opt_rule.<locals>.optrulez%s : empty
| %szp_%sN)r   r   ÚsetattrÚ	__class__)r   ZrulenameZoptnamer   r   r   r	   Ú_create_opt_rule"   s
    
zPLYParser._create_opt_ruleNc                 C   s   t | jj||d�S )Nr   )r   ÚclexÚfilename)r   Úlinenor   r   r   r	   Ú_coord0   s
    ýzPLYParser._coordc                 C   s   t d||f ƒ‚d S )Nz%s: %s)r   )r   ÚmsgÚcoordr   r   r	   Ú_parse_error6   s    zPLYParser._parse_error)N)r   r   r   r   r   r!   r   r   r   r	   r   !   s   
r   N)Úobjectr   Ú	Exceptionr   r   r   r   r   r	   Ú<module>   s   