o
    FZhQ                     @   s  d Z ddlmZmZmZmZmZmZmZm	Z	m
Z
 ddlmZ ddlmZ ddl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
    )		AttributeDeclarationNodeStringTokenTypenoneFunctionCall	CodeBlock)BasicTuplesympifyvoidrestrictvolatilestaticc                 C   "   t dt| trt| gS | gS )z9 Generate of FunctionCall instance for calling 'alignof' alignofr	   
isinstancestrr   arg r   C/var/www/auris/lib/python3.10/site-packages/sympy/codegen/cnodes.pyr      s   "r   c                 C   r   )a   Generate of FunctionCall instance for calling 'sizeof'

    Examples
    ========

    >>> from sympy.codegen.ast import real
    >>> from sympy.codegen.cnodes import sizeof
    >>> from sympy import ccode
    >>> ccode(sizeof(real))
    'sizeof(double)'
    sizeofr   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| gdd |D R  S )Nc                 S      g | ]}t |qS r   r   .0r   r   r   r   
<listcomp>+       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                   @   0   e Zd ZdZd ZZdeiZeZ	e
dd ZdS )Labela/   Label for use with e.g. goto statement.

    Examples
    ========

    >>> from sympy import ccode, Symbol
    >>> from sympy.codegen.cnodes import Label, PreIncrement
    >>> print(ccode(Label('foo')))
    foo:
    >>> print(ccode(Label('bar', [PreIncrement(Symbol('a'))])))
    bar:
    ++(a);

    )namebodyr/   c                 C   s   t |tr|S t| S )N)r   r
   )r&   itrr   r   r   _construct_bodyA   s   
zLabel._construct_bodyN)r(   r)   r*   r+   	__slots___fieldsr   defaultsr   _construct_nameclassmethodr1   r   r   r   r   r-   .   s    r-   c                   @   s   e Zd ZdZd ZZeZdS )gotoz Represents goto in C )labelN)r(   r)   r*   r+   r2   r3   r-   Z_construct_labelr   r   r   r   r7   I   s    r7   c                   @      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 import ccode
    >>> ccode(PreDecrement(x))
    '--(x)'

       Nr(   r)   r*   r+   nargsr   r   r   r   r:   O       r:   c                   @   r9   )PostDecrementz Represents the post-decrement operator

    Examples
    ========

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

    r;   Nr<   r   r   r   r   r?   _   r>   r?   c                   @   r9   )PreIncrementz Represents the pre-increment operator

    Examples
    ========

    >>> from sympy.abc import x
    >>> from sympy.codegen.cnodes import PreIncrement
    >>> from sympy import ccode
    >>> ccode(PreIncrement(x))
    '++(x)'

    r;   Nr<   r   r   r   r   r@   o   r>   r@   c                   @   r9   )PostIncrementz Represents the post-increment operator

    Examples
    ========

    >>> from sympy.abc import x
    >>> from sympy.codegen.cnodes import PostIncrement
    >>> from sympy import ccode
    >>> ccode(PostIncrement(x))
    '(x)++'

    r;   Nr<   r   r   r   r   rA      r>   rA   c                   @   r,   )structz Represents a struct in C )r.   Zdeclarationsr.   c                 C   s   t dd |D  S )Nc                 S   r   r   )r   r    r   r   r   r"      r#   z2struct._construct_declarations.<locals>.<listcomp>r   r%   r   r   r   _construct_declarations   s   zstruct._construct_declarationsN)r(   r)   r*   r+   r2   r3   r   r4   r   r5   r6   rC   r   r   r   r   rB      s    rB   c                   @   r9   )unionz Represents a union in C r   N)r(   r)   r*   r+   r2   r   r   r   r   rD      s    rD   N) r+   Zsympy.codegen.astr   r   r   r   r   r   r   r	   r
   Zsympy.core.basicr   Zsympy.core.containersr   Zsympy.core.sympifyr   r   r   r   r   r   r   r   r-   r7   r:   r?   r@   rA   rB   rD   r   r   r   r   <module>   s(    ,