B
    ˜‘[Â	  ã               @   s   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
mZmZmZmZmZmZmZ edƒZe
dƒZe
d	ƒZe
d
ƒZdd„ Z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G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd „ d eƒZ d!S )"z1
AST nodes specific to the C family of languages
é    )ÚBasic)Ústring_types)ÚTuple)Úsympify)Ú	AttributeÚDeclarationÚNodeÚStringÚTokenÚTypeÚnoneÚFunctionCallÚvoidÚrestrictÚvolatileÚstaticc             C   s   t dt| tƒrt| ƒn| gƒS )z9 Generate of FunctionCall instance for calling 'alignof' Úalignof)r   Ú
isinstancer   r	   )Úarg© r   ú3lib/python3.7/site-packages/sympy/codegen/cnodes.pyr      s    r   c             C   s   t dt| tƒrt| ƒn| gƒS )a   Generate of FunctionCall instance for calling 'sizeof'

    Examples
    ========

    >>> from sympy.codegen.ast import real
    >>> from sympy.codegen.cnodes import sizeof
    >>> from sympy.printing.ccode import ccode
    >>> ccode(sizeof(real))
    'sizeof(double)'
    Úsizeof)r   r   r   r	   )r   r   r   r   r      s    r   c               @   s   e Zd ZdZdd„ ZdS )ÚCommaOperatorz$ Represents the comma operator in C c             G   s   t j| fdd„ |D ƒžŽ S )Nc             S   s   g | ]}t |ƒ‘qS r   )r   )Ú.0r   r   r   r   ú
<listcomp>)   s    z)CommaOperator.__new__.<locals>.<listcomp>)r   Ú__new__)ÚclsÚargsr   r   r   r   (   s    zCommaOperator.__new__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   &   s   r   c               @   s   e Zd ZdZdS )ÚLabelzÔ Label for use with e.g. goto statement.

    Examples
    ========

    >>> from sympy.codegen.cnodes import Label
    >>> from sympy.printing.ccode import ccode
    >>> print(ccode(Label('foo')))
    foo:

    N)r   r   r    r!   r   r   r   r   r"   ,   s   r"   c               @   s   e Zd ZdZdgZeZdS )Úgotoz Represents goto in C ZlabelN)r   r   r    r!   Ú	__slots__r"   Z_construct_labelr   r   r   r   r#   9   s   r#   c               @   s   e Zd ZdZdZdS )ÚPreDecrementzø Represents the pre-decrement operator

    Examples
    ========

    >>> from sympy.abc import x
    >>> from sympy.codegen.cnodes import PreDecrement
    >>> from sympy.printing.ccode import ccode
    >>> ccode(PreDecrement(x))
    '--(x)'

    é   N)r   r   r    r!   Únargsr   r   r   r   r%   ?   s   r%   c               @   s   e Zd ZdZdZdS )ÚPostDecrementz( Represents the post-decrement operator r&   N)r   r   r    r!   r'   r   r   r   r   r(   O   s   r(   c               @   s   e Zd ZdZdZdS )ÚPreIncrementz' Represents the pre-increment operator r&   N)r   r   r    r!   r'   r   r   r   r   r)   T   s   r)   c               @   s   e Zd ZdZdZdS )ÚPostIncrementz( Represents the post-increment operator r&   N)r   r   r    r!   r'   r   r   r   r   r*   Y   s   r*   c               @   s0   e Zd ZdZddgZdeiZeZe	dd„ ƒZ
dS )Ústructz Represents a struct in C ÚnameZdeclarationsc             C   s   t dd„ |D ƒŽ S )Nc             S   s   g | ]}t |ƒ‘qS r   )r   )r   r   r   r   r   r   f   s    z2struct._construct_declarations.<locals>.<listcomp>)r   )r   r   r   r   r   Ú_construct_declarationsd   s    zstruct._construct_declarationsN)r   r   r    r!   r$   r   Údefaultsr	   Z_construct_nameÚclassmethodr-   r   r   r   r   r+   ^   s
   r+   c               @   s   e Zd ZdZdS )Úunionz Represents a union in C N)r   r   r    r!   r   r   r   r   r0   i   s   r0   N)!r!   Zsympy.core.basicr   Zsympy.core.compatibilityr   Zsympy.core.containersr   Zsympy.core.sympifyr   Zsympy.codegen.astr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r"   r#   r%   r(   r)   r*   r+   r0   r   r   r   r   Ú<module>   s(   (