
    Ed                        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
 Zd Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G 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                 l    t          dt          | t                    rt          |           n| g          S )z9 Generate of FunctionCall instance for calling 'alignof' alignofr
   
isinstancestrr   args    4lib/python3.11/site-packages/sympy/codegen/cnodes.pyr   r      s.    	:c33G3G$PF3KKKS#QRRR    c                 l    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 import ccode
    >>> ccode(sizeof(real))
    'sizeof(double)'
    sizeofr   r   s    r   r   r      s0     *S#2F2F#O6#;;;C"PQQQr   c                       e Zd ZdZd ZdS )CommaOperatorz$ Represents the comma operator in C c                 :    t          j        | gd |D             R  S )Nc                 ,    g | ]}t          |          S  r   .0r   s     r   
<listcomp>z)CommaOperator.__new__.<locals>.<listcomp>+   s    #A#A#ASGCLL#A#A#Ar   )r   __new__clsargss     r   r(   zCommaOperator.__new__*   s)    }SB#A#AD#A#A#ABBBBr   N)__name__
__module____qualname____doc__r(   r$   r   r   r!   r!   (   s.        ..C C C C Cr   r!   c                   <    e Zd ZdZdxZZdeiZeZ	e
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bodyr3   c                 B    t          |t                    r|S t          | S )N)r   r   )r*   itrs     r   _construct_bodyzLabel._construct_bodyA   s#    c9%% 	#Jc?"r   N)r,   r-   r.   r/   	__slots___fieldsr	   defaultsr   _construct_nameclassmethodr6   r$   r   r   r1   r1   .   sQ          +*I~HO# # [# # #r   r1   c                       e Zd ZdZdxZZeZdS )gotoz Represents goto in C )labelN)r,   r-   r.   r/   r7   r8   r1   _construct_labelr$   r   r   r=   r=   I   s&          $$Ir   r=   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   rA   rA   O   s          EEEr   rA   c                       e Zd ZdZdZdS )PostDecrementz( Represents the post-decrement operator rB   NrC   r$   r   r   rF   rF   _           22EEEr   rF   c                       e Zd ZdZdZdS )PreIncrementz' Represents the pre-increment operator rB   NrC   r$   r   r   rI   rI   d   s        11EEEr   rI   c                       e Zd ZdZdZdS )PostIncrementz( Represents the post-increment operator rB   NrC   r$   r   r   rK   rK   i   rG   r   rK   c                   <    e Zd ZdZdxZZdeiZeZ	e
d             ZdS )structz Represents a struct in C )r2   declarationsr2   c                 (    t          d |D              S )Nc                 ,    g | ]}t          |          S r$   )r   r%   s     r   r'   z2struct._construct_declarations.<locals>.<listcomp>v   s     888C{3''888r   r   r)   s     r   _construct_declarationszstruct._construct_declarationst   s    88488899r   N)r,   r-   r.   r/   r7   r8   r	   r9   r   r:   r;   rQ   r$   r   r   rM   rM   n   sK        $$22I~HO: : [: : :r   rM   c                       e Zd ZdZdZdS )unionz Represents a union in C r$   N)r,   r-   r.   r/   r7   r$   r   r   rS   rS   y   s        ##IIIr   rS   N) r/   sympy.codegen.astr   r   r   r   r   r   r	   r
   r   sympy.core.basicr   sympy.core.containersr   sympy.core.sympifyr   r   r   r   r   r   r   r!   r1   r=   rA   rF   rI   rK   rM   rS   r$   r   r   <module>rX      s                         # " " " " " ' ' ' ' ' ' & & & & & &tF||9Z  9Z  	8		S S S
R R RC C C C CE C C C# # # # #D # # #6    5       5        E   
    5   
    E   
: : : : :T : : :    F     r   