Ë
    òU.j,  ã                   ó¦  — d dl mZ d dlZd dlmZ  G d„ d«      Z G d„ d«      ZdZd	Ze	d
k(  r˜ej                  j                  ej                  j                  e«      «      Zej                  j                  ed«      Zej                  j                  ed«      Z ee«      Z eed«      5 Zej+                  e«       ddd«       yy# 1 sw Y   yxY w)é    )ÚTemplateN)ÚIOc                   ó0   — e Zd Zdd„Zdee   ddfd„Zd„ Zy)ÚASTCodeGeneratorc                 ó„   — || _         | j                  |«      D ��cg c]  \  }}t        ||«      ‘Œ c}}| _        yc c}}w )zIInitialize the code generator from a configuration
        file.
        N)Úcfg_filenameÚparse_cfgfileÚNodeCfgÚnode_cfg)Úselfr   ÚnameÚcontentss       úTC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\pycparser/_ast_gen.pyÚ__init__zASTCodeGenerator.__init__   sI   € ð )ˆÔð %)×$6Ñ$6°|Ô$Dô
á$DÑ ��xô �D˜(Õ#Ø$Dò
ˆ�ùó 
s   œ<ÚfileÚreturnNc                 óØ   — t        t        «      j                  | j                  ¬«      }|t        z  }| j
                  D ]  }||j                  «       dz   z  }Œ |j                  |«       y)z2Generates the code into file, an open file buffer.)r   z

N)r   Ú_PROLOGUE_COMMENTÚ
substituter   Ú_PROLOGUE_CODEr   Úgenerate_sourceÚwrite)r   r   Úsrcr   s       r   ÚgeneratezASTCodeGenerator.generate    s^   € äÔ(Ó)×4Ñ4À$×BSÑBSÐ4ÓTˆàŒ~ÑˆØŸœˆHØ�8×+Ñ+Ó-°Ñ6Ñ6‰Cð &ð 	�
‰
�3�ó    c           	   #   óà  K  — t        |d«      5 }|D ]¾  }|j                  «       }|r|j                  d«      rŒ'|j                  d«      }|j                  d«      }|j                  d«      }|dk  s
||k  s||k  rt	        d|› d|› d	�«      ‚|d
| }||dz   | }|r-|j                  d«      D �	cg c]  }	|	j                  «       ‘Œ c}	ng }
||
f–— ŒÀ 	 d
d
d
«       y
c c}	w # 1 sw Y   y
xY w­w)z`Parse the configuration file and yield pairs of
        (name, contents) for each node.
        ÚrÚ#Ú:Ú[Ú]é   zInvalid line in ú:
Ú
NÚ,)ÚopenÚstripÚ
startswithÚfindÚRuntimeErrorÚsplit)r   ÚfilenameÚfÚlineÚcolon_iÚ
lbracket_iÚ
rbracket_ir   ÚvalÚvÚvallists              r   r	   zASTCodeGenerator.parse_cfgfile*   sñ   è ø€ ô �(˜CÔ  AÛ�Ø—z‘z“|�Ù˜tŸ™¨sÔ3ØØŸ)™) C›.�Ø!ŸY™Y s›^�
Ø!ŸY™Y s›^�
Ø˜Q’; *°Ò"7¸:ÈÒ;SÜ&Ð)9¸(¸À3ÀtÀfÈBÐ'OÓPÐPà˜H˜W�~�Ø˜:¨™>¨JÐ7�ÙAD¨c¯i©i¸¬nÓ=©n¨˜1Ÿ7™7�9¨nÒ=È"�Ø˜G�mÓ#ñ ÷ !Ð ùò >÷ !Ð üs/   ‚C.�B C"Â/CÃC"Ã	C.ÃC"Ã"C+Ã'C.)ú
_c_ast.cfg)Ú__name__Ú
__module__Ú__qualname__r   r   Ústrr   r	   © r   r   r   r      s#   „ ó
ð˜R ™Wð ¨ó ó$r   r   c                   ó4   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	y)	r
   z­Node configuration.

    name: node name
    contents: a list of contents - attributes and child nodes
    See comment at the top of the configuration file for details.
    c                 óš  — || _         g | _        g | _        g | _        g | _        |D ]£  }|j                  d«      }| j                  j                  |«       |j                  d«      r| j                  j                  |«       Œ\|j                  d«      r| j                  j                  |«       Œ‰| j                  j                  |«       Œ¥ y )NÚ*z**)r   Úall_entriesÚattrÚchildÚ	seq_childÚrstripÚappendÚendswith)r   r   r   ÚentryÚclean_entrys        r   r   zNodeCfg.__init__G   s    € ØˆŒ	ØˆÔØˆŒ	ØˆŒ
ØˆŒãˆEØŸ,™, sÓ+ˆKØ×Ñ×#Ñ# KÔ0à�~‰~˜dÔ#Ø—‘×%Ñ% kÕ2Ø—‘ Ô$Ø—
‘
×!Ñ! +Õ.à—	‘	× Ñ  Õ'ñ r   c                 óª   — | j                  «       }|d| j                  «       z   z  }|d| j                  «       z   z  }|d| j                  «       z   z  }|S )Nr$   )Ú	_gen_initÚ_gen_childrenÚ	_gen_iterÚ_gen_attr_names©r   r   s     r   r   zNodeCfg.generate_sourceY   sY   € Ø�n‰nÓˆØˆt�d×(Ñ(Ó*Ñ*Ñ*ˆØˆt�d—n‘nÓ&Ñ&Ñ&ˆØˆt�d×*Ñ*Ó,Ñ,Ñ,ˆØˆ
r   c                 ó>  — d| j                   › d�}| j                  rIdj                  | j                  «      }dj                  d„ | j                  D «       «      }|dz  }d|› d�}nd}d	}|d
|› d�z  }|d|› d�z  }| j                  dgz   D ]  }|d|› d|› d�z  }Œ |S )Nzclass z(Node):
ú, c              3   ó(   K  — | ]
  }d |› d �–— Œ y­w)Ú'Nr:   )Ú.0Úes     r   Ú	<genexpr>z$NodeCfg._gen_init.<locals>.<genexpr>e   s   è ø€ ÐAÑ0@¨1  !  AœhÑ0@ùs   ‚z, 'coord', '__weakref__'z(self, z, coord=None)z'coord', '__weakref__'z(self, coord=None)z    __slots__ = (z)
z    def __init__r#   Úcoordz        self.z = r$   )r   r>   Újoin)r   r   ÚargsÚslotsÚarglistr   s         r   rH   zNodeCfg._gen_init`   sÍ   € Ø�t—y‘y�k Ð+ˆà×ÒØ—9‘9˜T×-Ñ-Ó.ˆDØ—I‘IÑA°×0@Ò0@ÓAÓAˆEØÐ/Ñ/ˆEØ ˜v ]Ð3‰Gà,ˆEØ*ˆGàÐ" 5 '¨Ð-Ñ-ˆØÐ! ' ¨#Ð.Ñ.ˆà×$Ñ$¨ yÔ0ˆDØ�] 4 &¨¨D¨6°Ð4Ñ4‰Cð 1ð ˆ
r   c                 óÖ   — d}| j                   rU|dz  }| j                  D ]  }|d|› d�z  }|d|› d|› d�z  }Œ | j                  D ]  }|d|› d	�z  }|d
|› d�z  }Œ |dz  }|S |dz  }|S )Nz    def children(self):
z        nodelist = []
ú        if self.ú is not None:
z            nodelist.append(("z", self.z))
z'        for i, child in enumerate(self.ú	 or []):
z            nodelist.append((f"z[{i}]", child))
z        return tuple(nodelist)
z        return ()
©r>   r@   rA   ©r   r   r@   rA   s       r   rI   zNodeCfg._gen_childrent   s¶   € Ø)ˆà×ÒØÐ,Ñ,ˆCàŸœ�ØÐ)¨%¨°Ð@Ñ@�ØÐ7¸°w¸hÀuÀgÈTÐRÑR‘ð $ð "Ÿ^œ^�	ØÐ@ÀÀÈ:ÐVÑV�ØÐ8¸¸ÐCVÐWÑW‘ð ,ð Ð5Ñ5ˆCð ˆ
ð Ð(Ñ(ˆCàˆ
r   c                 óî   — d}| j                   ra| j                  D ]  }|d|› d�z  }|d|› d�z  }Œ | j                  D ]  }|d|› d�z  }|dz  }Œ | j                  s| j                  s|d	z  }|S |d	z  }|S )
Nz    def __iter__(self):
rZ   r[   z            yield self.r$   z        for child in (self.r\   z            yield child
z        return
        yield
r]   r^   s       r   rJ   zNodeCfg._gen_iterˆ   s¨   € Ø)ˆà×ÒØŸœ�ØÐ)¨%¨°Ð@Ñ@�ØÐ0°°°rÐ:Ñ:‘ð $ð "Ÿ^œ^�	ØÐ4°Y°K¸zÐJÑJ�ØÐ2Ñ2‘ð ,ð —J’J $§.¢.àÐ=Ñ=�ð
 ˆ
ð Ð9Ñ9ˆCàˆ
r   c                 óV   — ddj                  d„ | j                  D «       «      z   dz   }|S )Nz    attr_names = (Ú c              3   ó&   K  — | ]	  }|›d �–— Œ y­w)rN   Nr:   )rQ   Únms     r   rS   z*NodeCfg._gen_attr_names.<locals>.<genexpr>ž   s   è ø€ Ð,MÁ9¸R°¨v°R¬[Á9ùs   ‚Ú))rU   r?   rL   s     r   rK   zNodeCfg._gen_attr_names�   s*   € Ø" R§W¡WÑ,MÀ4Ç9Â9Ó,MÓ%MÑMÐPSÑSˆØˆ
r   N)
r6   r7   r8   Ú__doc__r   r   rH   rI   rJ   rK   r:   r   r   r
   r
   ?   s%   „ ñò(ò$òò(ò(ó*r   r
   a¯  #-----------------------------------------------------------------
# ** ATTENTION **
# This code was automatically generated from _c_ast.cfg
#
# Do not modify it directly. Modify the configuration file and
# run the generator again.
# ** ** *** ** **
#
# pycparser: c_ast.py
#
# AST Node classes.
#
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-----------------------------------------------------------------

ae  
import sys
from typing import Any, ClassVar, IO, Optional

def _repr(obj):
    """
    Get the representation of an object, with dedicated pprint-like format for lists.
    """
    if isinstance(obj, list):
        return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]'
    else:
        return repr(obj)

class Node:
    __slots__ = ()
    """ Abstract base class for AST nodes.
    """
    attr_names: ClassVar[tuple[str, ...]] = ()
    coord: Optional[Any]
    def __repr__(self):
        """ Generates a python representation of the current node
        """
        result = self.__class__.__name__ + '('

        indent = ''
        separator = ''
        for name in self.__slots__[:-2]:
            result += separator
            result += indent
            result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n  ' + (' ' * (len(name) + len(self.__class__.__name__)))))

            separator = ','
            indent = '\n ' + (' ' * len(self.__class__.__name__))

        result += indent + ')'

        return result

    def children(self):
        """ A sequence of all children that are Nodes
        """
        pass

    def show(
        self,
        buf: IO[str] = sys.stdout,
        offset: int = 0,
        attrnames: bool = False,
        showemptyattrs: bool = True,
        nodenames: bool = False,
        showcoord: bool = False,
        _my_node_name: Optional[str] = None,
    ):
        """ Pretty print the Node and all its attributes and
            children (recursively) to a buffer.

            buf:
                Open IO buffer into which the Node is printed.

            offset:
                Initial offset (amount of leading spaces)

            attrnames:
                True if you want to see the attribute names in
                name=value pairs. False to only see the values.

            showemptyattrs:
                False if you want to suppress printing empty attributes.

            nodenames:
                True if you want to see the actual node names
                within their parents.

            showcoord:
                Do you want the coordinates of each Node to be
                displayed.
        """
        lead = ' ' * offset
        if nodenames and _my_node_name is not None:
            buf.write(lead + self.__class__.__name__+ ' <' + _my_node_name + '>: ')
        else:
            buf.write(lead + self.__class__.__name__+ ': ')

        if self.attr_names:
            def is_empty(v):
                v is None or (hasattr(v, '__len__') and len(v) == 0)
            nvlist = [(n, getattr(self,n)) for n in self.attr_names \
                        if showemptyattrs or not is_empty(getattr(self,n))]
            if attrnames:
                attrstr = ', '.join(f'{name}={value}' for name, value in nvlist)
            else:
                attrstr = ', '.join(f'{value}' for _, value in nvlist)
            buf.write(attrstr)

        if showcoord:
            buf.write(f' (at {self.coord})')
        buf.write('\n')

        for (child_name, child) in self.children():
            child.show(
                buf,
                offset=offset + 2,
                attrnames=attrnames,
                showemptyattrs=showemptyattrs,
                nodenames=nodenames,
                showcoord=showcoord,
                _my_node_name=child_name)


class NodeVisitor:
    """ A base NodeVisitor class for visiting c_ast nodes.
        Subclass it and define your own visit_XXX methods, where
        XXX is the class name you want to visit with these
        methods.

        For example:

        class ConstantVisitor(NodeVisitor):
            def __init__(self):
                self.values = []

            def visit_Constant(self, node):
                self.values.append(node.value)

        Creates a list of values of all the constant nodes
        encountered below the given node. To use it:

        cv = ConstantVisitor()
        cv.visit(node)

        Notes:

        *   generic_visit() will be called for AST nodes for which
            no visit_XXX method was defined.
        *   The children of nodes for which a visit_XXX was
            defined will not be visited - if you need this, call
            generic_visit() on the node.
            You can use:
                NodeVisitor.generic_visit(self, node)
        *   Modeled after Python's own AST visiting facilities
            (the ast module of Python 3.0)
    """

    _method_cache = None

    def visit(self, node: Node):
        """ Visit a node.
        """

        if self._method_cache is None:
            self._method_cache = {}

        visitor = self._method_cache.get(node.__class__.__name__, None)
        if visitor is None:
            method = 'visit_' + node.__class__.__name__
            visitor = getattr(self, method, self.generic_visit)
            self._method_cache[node.__class__.__name__] = visitor

        return visitor(node)

    def generic_visit(self, node: Node):
        """ Called if no explicit visitor function exists for a
            node. Implements preorder visiting of the node.
        """
        for _, c in node.children():
            self.visit(c)

Ú__main__r5   zc_ast.pyÚw)Ústringr   ÚosÚtypingr   r   r
   r   r   r6   ÚpathÚdirnameÚabspathÚ__file__Úbase_dirrU   Úcfg_pathÚout_pathÚast_genr&   Úoutr   r:   r   r   Ú<module>rt      sÄ   ðõ  Û 	Ý ÷'$ñ '$÷T`ñ `ðFÐ ð"g€ðT ˆzÒØ�w‰w�‰˜rŸw™wŸ™¨xÓ8Ó9€HØ�w‰w�|‰|˜H lÓ3€HØ�w‰w�|‰|˜H jÓ1€HÙ˜xÓ(€GÙ	ˆh˜Ô	 Ø×Ñ˜Ô÷ 
Ð	ð ÷
 
Ð	ús   Â+CÃC