ó
¡Œ\c           @   s  d  Z  d d l 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 d d l m Z e d  Z e d  Z e d	  Z e d
  Z d   Z d   Z d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ  d S(    s1   
AST nodes specific to the C family of languages
iÿÿÿÿ(   t	   Attributet   Declarationt   Nodet   Stringt   Tokent   Typet   nonet   FunctionCall(   t   Basic(   t   string_types(   t   Tuple(   t   sympifyt   voidt   restrictt   volatilet   staticc         C   s+   t  d t |  t  r! t |   n |  g  S(   s9    Generate of FunctionCall instance for calling 'alignof' t   alignof(   R   t
   isinstanceR	   R   (   t   arg(    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyR      s    c         C   s+   t  d t |  t  r! t |   n |  g  S(   s   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)'
    t   sizeof(   R   R   R	   R   (   R   (    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyR      s    t   CommaOperatorc           B   s   e  Z d  Z d   Z RS(   s$    Represents the comma operator in C c         G   s)   t  j |  g  | D] } t |  ^ q  S(   N(   R   t   __new__R   (   t   clst   argsR   (    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyR   (   s    (   t   __name__t
   __module__t   __doc__R   (    (    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyR   &   s   t   Labelc           B   s   e  Z d  Z RS(   sÔ    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:

    (   R   R   R   (    (    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyR   ,   s   t   gotoc           B   s   e  Z d  Z d g Z e Z RS(   s    Represents goto in C t   label(   R   R   R   t	   __slots__R   t   _construct_label(    (    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyR   9   s   	t   PreDecrementc           B   s   e  Z d  Z d Z RS(   sø    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)'

    i   (   R   R   R   t   nargs(    (    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyR    ?   s   t   PostDecrementc           B   s   e  Z d  Z d Z RS(   s(    Represents the post-decrement operator i   (   R   R   R   R!   (    (    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyR"   O   s   t   PreIncrementc           B   s   e  Z d  Z d Z RS(   s'    Represents the pre-increment operator i   (   R   R   R   R!   (    (    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyR#   T   s   t   PostIncrementc           B   s   e  Z d  Z d Z RS(   s(    Represents the post-increment operator i   (   R   R   R   R!   (    (    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyR$   Y   s   t   structc           B   s<   e  Z d  Z d d g Z i e d 6Z e Z e d    Z	 RS(   s    Represents a struct in C t   namet   declarationsc         C   s#   t  g  | D] } t |  ^ q
   S(   N(   R
   R   (   R   R   R   (    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyt   _construct_declarationsd   s    (
   R   R   R   R   R   t   defaultsR   t   _construct_namet   classmethodR(   (    (    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyR%   ^   s
   t   unionc           B   s   e  Z d  Z RS(   s    Represents a union in C (   R   R   R   (    (    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyR,   i   s   N(!   R   t   sympy.codegen.astR    R   R   R   R   R   R   R   t   sympy.core.basicR   t   sympy.core.compatibilityR	   t   sympy.core.containersR
   t   sympy.core.sympifyR   R   R   R   R   R   R   R   R   R   R    R"   R#   R$   R%   R,   (    (    (    s3   lib/python2.7/site-packages/sympy/codegen/cnodes.pyt   <module>   s(   :		