§
    aÒ³g;)  ã                   óR   — d dl mZ  G d„ de¦  «        Z G d„ de¦  «        ZdZdZdS )	é    )ÚTemplatec                   ó$   — e Zd Zdd„Zdd„Zd„ ZdS )ÚASTCodeGeneratorú
_c_ast.cfgc                 ó\   — || _         d„ |                      |¦  «        D ¦   «         | _        dS )zN Initialize the code generator from a configuration
            file.
        c                 ó4   — g | ]\  }}t          ||¦  «        ‘ŒS © )ÚNodeCfg)Ú.0ÚnameÚcontentss      úP/var/www/html/mpstechhub/venv/lib/python3.11/site-packages/pycparser/_ast_gen.pyú
<listcomp>z-ASTCodeGenerator.__init__.<locals>.<listcomp>   s<   € ð Fð Fð FÙ ��xõ !  xÑ0Ô0ð Fð Fð Fó    N)Úcfg_filenameÚparse_cfgfileÚnode_cfg)Úselfr   s     r   Ú__init__zASTCodeGenerator.__init__   sC   € ð )ˆÔðFð FØ$(×$6Ò$6°|Ñ$DÔ$DðFñ Fô FˆŒˆˆr   Nc                 óæ   — t          t          ¦  «                             | j        ¬¦  «        }|t          z  }| j        D ]}||                     ¦   «         dz   z  }Œ|                     |¦  «         dS )z< Generates the code into file, an open file buffer.
        )r   z

N)r   Ú_PROLOGUE_COMMENTÚ
substituter   Ú_PROLOGUE_CODEr   Úgenerate_sourceÚwrite)r   ÚfileÚsrcr   s       r   ÚgeneratezASTCodeGenerator.generate   sz   € õ Õ(Ñ)Ô)×4Ò4ØÔ*ð 5ñ ,ô ,ˆð 	�~ÑˆØœð 	7ð 	7ˆHØ�8×+Ò+Ñ-Ô-°Ñ6Ñ6ˆCˆCà�
Š
�3‰Œˆˆˆr   c           	   #   ó  K  — t          |d¦  «        5 }|D ]Õ}|                     ¦   «         }|r|                     d¦  «        rŒ.|                     d¦  «        }|                     d¦  «        }|                     d¦  «        }|dk     s||k    s||k    rt	          d|›d|›d	�¦  «        ‚|d
|…         }||dz   |…         }|rd„ |                     d¦  «        D ¦   «         ng }	||	fV — ŒÖ	 d
d
d
¦  «         d
S # 1 swxY w Y   d
S )ze Parse the configuration file and yield pairs of
            (name, contents) for each node.
        Úrú#ú:ú[ú]é   zInvalid line in z:
ú
Nc                 ó6   — g | ]}|                      ¦   «         ‘ŒS r	   )Ústrip)r   Úvs     r   r   z2ASTCodeGenerator.parse_cfgfile.<locals>.<listcomp>6   s    € Ð=Ð=Ð=¨˜1Ÿ7š7™9œ9Ð=Ð=Ð=r   ú,)Úopenr(   Ú
startswithÚfindÚRuntimeErrorÚsplit)
r   ÚfilenameÚfÚlineÚcolon_iÚ
lbracket_iÚ
rbracket_ir   ÚvalÚvallists
             r   r   zASTCodeGenerator.parse_cfgfile%   s}  è è € õ �(˜CÑ Ô ð 	$ AØð $ð $�Ø—z’z‘|”|�Øð ˜tŸš¨sÑ3Ô3ð ØØŸ)š) C™.œ.�Ø!ŸYšY s™^œ^�
Ø!ŸYšY s™^œ^�
Ø˜Q’;�; *°Ò"7Ð"7¸:ÈÒ;SÐ;SÝ&˜,ÀhÀhÀhÐPTÐPTÐPTÐ'UÑVÔVÐVà˜H˜W˜H”~�Ø˜:¨™>¨*Ð4Ô5�ØADÐLÐ=Ð=¨c¯iªi¸©n¬nÐ=Ñ=Ô=Ð=È"�Ø˜G�mÐ#Ð#Ð#Ð#ð$ð	$ð 	$ð 	$ñ 	$ô 	$ð 	$ð 	$ð 	$ð 	$ð 	$ð 	$ð 	$øøøð 	$ð 	$ð 	$ð 	$ð 	$ð 	$s   “CC:Ã:C>ÄC>)r   )N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r	   r   r   r   r      sO   € € € € € ðFð Fð Fð Fð
ð 
ð 
ð 
ð$ð $ð $ð $ð $r   r   c                   ó6   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	dS )	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 ]«}|                     d¦  «        }| j                             |¦  «         |                     d¦  «        r| j                             |¦  «         Œa|                     d¦  «        r| j                             |¦  «         Œ‘| j                             |¦  «         Œ¬d S )NÚ*z**)r   Úall_entriesÚattrÚchildÚ	seq_childÚrstripÚappendÚendswith)r   r   r   ÚentryÚclean_entrys        r   r   zNodeCfg.__init__B   sÚ   € ØˆŒ	ØˆÔØˆŒ	ØˆŒ
ØˆŒàð 		(ð 		(ˆEØŸ,š, sÑ+Ô+ˆKØÔ×#Ò# KÑ0Ô0Ð0à�~Š~˜dÑ#Ô#ð (Ø”×%Ò% kÑ2Ô2Ð2Ð2Ø—’ Ñ$Ô$ð (Ø”
×!Ò! +Ñ.Ô.Ð.Ð.à”	× Ò  Ñ'Ô'Ð'Ð'ð		(ð 		(r   c                 óÊ   — |                       ¦   «         }|d|                      ¦   «         z   z  }|d|                      ¦   «         z   z  }|d|                      ¦   «         z   z  }|S )Nr&   )Ú	_gen_initÚ_gen_childrenÚ	_gen_iterÚ_gen_attr_names©r   r   s     r   r   zNodeCfg.generate_sourceT   se   € Ø�nŠnÑÔˆØˆt�d×(Ò(Ñ*Ô*Ñ*Ñ*ˆØˆt�d—n’nÑ&Ô&Ñ&Ñ&ˆØˆt�d×*Ò*Ñ,Ô,Ñ,Ñ,ˆØˆ
r   c                 ó  — d| j         z  }| j        rId                     | j        ¦  «        }d                     d„ | j        D ¦   «         ¦  «        }|dz  }d|z  }nd}d}|d|z  z  }|d	|z  z  }| j        d
gz   D ]}|d|›d|›d�z  }Œ|S )Nzclass %s(Node):
z, c              3   ó@   K  — | ]}d                       |¦  «        V — ŒdS )z'{0}'N)Úformat)r   Úes     r   ú	<genexpr>z$NodeCfg._gen_init.<locals>.<genexpr>`   s.   è è € ÐJÐJ°A˜gŸnšn¨QÑ/Ô/ÐJÐJÐJÐJÐJÐJr   z, 'coord', '__weakref__'z(self, %s, coord=None)z'coord', '__weakref__'z(self, coord=None)z    __slots__ = (%s)
z    def __init__%s:
Úcoordz        self.z = r&   )r   r>   Újoin)r   r   ÚargsÚslotsÚarglistr   s         r   rH   zNodeCfg._gen_init[   sÊ   € Ø! D¤IÑ-ˆàÔð 	+Ø—9’9˜TÔ-Ñ.Ô.ˆDØ—I’IÐJÐJ¸Ô9IÐJÑJÔJÑJÔJˆEØÐ/Ñ/ˆEØ.°Ñ5ˆGˆGà,ˆEØ*ˆGàÐ'¨%Ñ/Ñ/ˆØÐ&¨Ñ0Ñ0ˆàÔ$¨ yÑ0ð 	;ð 	;ˆDØˆC¨t¨t¨t°T°T°TÐ:Ñ:ˆCˆCàˆ
r   c                 ó¸   — d}| j         rK|dz  }| j        D ]}|dt          |¬¦  «        z  z  }Œ| j        D ]}|dt          |¬¦  «        z  z  }Œ|dz  }n|dz  }|S )Nz    def children(self):
z        nodelist = []
zV        if self.%(child)s is not None: nodelist.append(("%(child)s", self.%(child)s))
©r@   zu        for i, child in enumerate(self.%(child)s or []):
            nodelist.append(("%(child)s[%%d]" %% i, child))
z        return tuple(nodelist)
z        return ()
©r>   r@   ÚdictrA   ©r   r   r@   rA   s       r   rI   zNodeCfg._gen_childreno   sª   € Ø)ˆàÔð 	)ØÐ,Ñ,ˆCàœð +ð +�ØðHå 5Ð)Ñ)Ô)ñ+ñ +��ð
 "œ^ð /ð /�	ØðTå 9Ð-Ñ-Ô-ñ/ñ /��ð
 Ð5Ñ5ˆCˆCàÐ(Ñ(ˆCàˆ
r   c                 óÊ   — d}| j         rT| j        D ]}|dt          |¬¦  «        z  z  }Œ| j        D ]}|dt          |¬¦  «        z  z  }Œ| j        s| j        s|dz  }n|dz  }|S )Nz    def __iter__(self):
zH        if self.%(child)s is not None:
            yield self.%(child)s
rX   zE        for child in (self.%(child)s or []):
            yield child
z        return
        yield
rY   r[   s       r   rJ   zNodeCfg._gen_iter‡   sÃ   € Ø)ˆàÔð 	#Øœð Pð P�Øð9Ý=AÈÐ=NÑ=NÔ=NñPñ P��ð "œ^ð Kð K�	Øð0Ý48¸yÐ4IÑ4IÔ4IñKñ K��ð ”Jð ' $¤.ð 'àð&ñ'�øð
 ð"ñ#ˆCð ˆ
r   c                 óZ   — dd                      d„ | j        D ¦   «         ¦  «        z   dz   }|S )Nz    attr_names = (Ú c              3   ó    K  — | ]	}d |z  V — Œ
dS )z%r, Nr	   )r   Únms     r   rQ   z*NodeCfg._gen_attr_names.<locals>.<genexpr>£   s&   è è € Ð,MÐ,M¸R¨V°b©[Ð,MÐ,MÐ,MÐ,MÐ,MÐ,Mr   ú))rS   r?   rL   s     r   rK   zNodeCfg._gen_attr_names¢   s4   € Ø" R§W¢WÐ,MÐ,MÀ4Ä9Ð,MÑ,MÔ,MÑ%MÔ%MÑMÐPSÑSˆØˆ
r   N)
r8   r9   r:   Ú__doc__r   r   rH   rI   rJ   rK   r	   r   r   r
   r
   :   sx   € € € € € ðð ð(ð (ð (ð$ð ð ðð ð ð(ð ð ð0ð ð ð6ð ð ð ð r   r
   a¾  #-----------------------------------------------------------------
# ** ATTENTION **
# This code was automatically generated from the file:
# $cfg_filename
#
# 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
#-----------------------------------------------------------------

a3  
import sys

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(object):
    __slots__ = ()
    """ Abstract base class for AST nodes.
    """
    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=sys.stdout, offset=0, attrnames=False, nodenames=False, showcoord=False, _my_node_name=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.

            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:
            if attrnames:
                nvlist = [(n, getattr(self,n)) for n in self.attr_names]
                attrstr = ', '.join('%s=%s' % nv for nv in nvlist)
            else:
                vlist = [getattr(self, n) for n in self.attr_names]
                attrstr = ', '.join('%s' % v for v in vlist)
            buf.write(attrstr)

        if showcoord:
            buf.write(' (at %s)' % self.coord)
        buf.write('\n')

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


class NodeVisitor(object):
    """ 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):
        """ 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):
        """ Called if no explicit visitor function exists for a
            node. Implements preorder visiting of the node.
        """
        for c in node:
            self.visit(c)

N)Ústringr   Úobjectr   r
   r   r   r	   r   r   ú<module>re      s�   ðð Ð Ð Ð Ð Ð ð'$ð '$ð '$ð '$ð '$�vñ '$ô '$ð '$ðTjð jð jð jð jˆfñ jô jð jð\ð ð(U€€€r   