§
    ×‘ÚjK2  ã                   óÌ  — d dl Z d dlmZ d dlmZ  G d„ d¦  «        Z G d„ d¦  «        ZdZd	Ze	d
k    r¯e j
                             e j
                             e¦  «        ¦  «        Ze j
                             ed¦  «        Ze j
                             ed¦  «        Z ee¦  «        Z eed¦  «        5 Ze                     e¦  «         ddd¦  «         dS # 1 swxY w Y   dS dS )é    N)ÚTemplate)ÚIOc                   ó8   — e Zd Zdd„Zdee         ddfd„Zd„ ZdS )	ÚASTCodeGeneratorú
_c_ast.cfgc                 ó\   — || _         d„ |                      |¦  «        D ¦   «         | _        dS )zIInitialize the code generator from a configuration
        file.
        c                 ó4   — g | ]\  }}t          ||¦  «        ‘ŒS © )ÚNodeCfg)Ú.0ÚnameÚcontentss      ú„/Users/tedpeters/Documents/Projects/Claude Projects/TPC Houses/house-viewer/.venv/lib/python3.11/site-packages/pycparser/_ast_gen.pyú
<listcomp>z-ASTCodeGenerator.__init__.<locals>.<listcomp>   s6   € ð 
ð 
ð 
á ��xõ �D˜(Ñ#Ô#ð
ð 
ð 
ó    N)Úcfg_filenameÚparse_cfgfileÚnode_cfg)Úselfr   s     r   Ú__init__zASTCodeGenerator.__init__   s>   € ð )ˆÔð
ð 
à$(×$6Ò$6°|Ñ$DÔ$Dð
ñ 
ô 
ˆŒˆˆr   ÚfileÚreturnNc                 óæ   — t          t          ¦  «                             | j        ¬¦  «        }|t          z  }| j        D ]}||                     ¦   «         dz   z  }Œ|                     |¦  «         dS )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    so   € åÕ(Ñ)Ô)×4Ò4À$ÔBSÐ4ÑTÔTˆà�~ÑˆØœð 	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 )z`Parse the configuration file and yield pairs of
        (name, contents) for each node.
        Úrú#ú:ú[ú]é   zInvalid line in ú:
ú
Nc                 ó6   — g | ]}|                      ¦   «         ‘ŒS r
   )Ústrip)r   Úvs     r   r   z2ASTCodeGenerator.parse_cfgfile.<locals>.<listcomp><   s    € Ð=Ð=Ð=¨˜1Ÿ7š7™9œ9Ð=Ð=Ð=r   ú,)Úopenr+   Ú
startswithÚfindÚrfindÚ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™^œ^�
à!ŸZšZ¨™_œ_�
Ø˜Q’;�; *°Ò"7Ð"7¸:ÈÒ;SÐ;SÝ&Ð'O¸(Ð'OÐ'OÀtÐ'OÐ'OÐ'OÑPÔPÐPà˜H˜W˜H”~�Ø˜:¨™>¨JÐ6Ô7�ØADÐLÐ=Ð=¨c¯iªi¸©n¬nÐ=Ñ=Ô=Ð=È"�Ø˜G�mÐ#Ð#Ð#Ð#ð$ð	$ð 	$ð 	$ñ 	$ô 	$ð 	$ð 	$ð 	$ð 	$ð 	$ð 	$ð 	$øøøð 	$ð 	$ð 	$ð 	$ð 	$ð 	$s   “CC:Ã:C>ÄC>)r   )Ú__name__Ú
__module__Ú__qualname__r   r   Ústrr    r   r
   r   r   r   r      s]   € € € € € ð
ð 
ð 
ð 
ð˜R œWð ¨ð ð ð ð ð$ð $ð $ð $ð $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 | _        i | _        |D �]}|                     d¦  «        \  }}}|                     ¦   «         }|                     d¦  «        }| j         	                    |¦  «         |r;|                     ¦   «         }|dvrt          d|›d|› d|› d�¦  «        ‚|| j        |<   |                     d¦  «        r| j         	                    |¦  «         ŒÌ|                     d¦  «        r| j         	                    |¦  «         Œü| j         	                    |¦  «         �Œd S )	Nú=Ú*)ÚNoneú[]zUnsupported default z for ú.z; expected None or []z**)r   Úall_entriesÚattrÚchildÚ	seq_childÚdefaultsÚ	partitionr+   ÚrstripÚappendr2   Úendswith)r   r   r   ÚentryÚhas_defaultÚdefaultÚclean_entrys          r   r   zNodeCfg.__init__H   st  € ØˆŒ	ØˆÔØˆŒ	ØˆŒ
ØˆŒØˆŒàð 	(ñ 	(ˆEØ*/¯/ª/¸#Ñ*>Ô*>Ñ'ˆE�; Ø—K’K‘M”MˆEØŸ,š, sÑ+Ô+ˆKØÔ×#Ò# KÑ0Ô0Ð0àð 5Ø!Ÿ-š-™/œ/�Ø .Ð0Ð0Ý&ð.¨wð .ð .¸tð .ð .Àkð .ð .ð .ñô ð ð .5�”˜kÑ*à�~Š~˜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_sourcef   se   € Ø�nŠnÑÔˆØˆt�d×(Ò(Ñ*Ô*Ñ*Ñ*ˆØˆt�d—n’nÑ&Ô&Ñ&Ñ&ˆØˆt�d×*Ò*Ñ,Ô,Ñ,Ñ,ˆØˆ
r   c           	      óR  ‡ — d‰ j         › d�}dg}|                     ˆ fd„‰ j        D ¦   «         ¦  «         |                     d¦  «         ‰ j        r9|                     d¦  «         |                     d„ ‰ j        D ¦   «         ¦  «         dd	                     |¦  «        › d
�}d	                     d„ ‰ j        ddgz   D ¦   «         ¦  «        }|d|› d�z  }|d|› d�z  }‰ j        dgz   D ]<}‰ j                             |¦  «        dk    r|d|› d|› d|› d�z  }Œ0|d|› d|› d�z  }Œ=|S )Nzclass z(Node):
r   c              3   ó.   •K  — | ]}|‰j         v¯|V — Œd S ©N)rK   )r   r   r   s     €r   ú	<genexpr>z$NodeCfg._gen_init.<locals>.<genexpr>q   s/   øè è € ÐSÐS˜T¸ÀTÄ]Ð9RÐ9R�DÐ9RÐ9RÐ9RÐ9RÐSÐSr   z
coord=NonerC   c              3   ó    K  — | ]	}|› d �V — Œ
dS )z=NoneNr
   ©r   r   s     r   r]   z$NodeCfg._gen_init.<locals>.<genexpr>x   s(   è è € ÐAÐA¨4˜4˜˜˜ÐAÐAÐAÐAÐAÐAr   ú(ú, ú)c              3   ó4   K  — | ]}t          |¦  «        V — Œd S r\   )Úreprr_   s     r   r]   z$NodeCfg._gen_init.<locals>.<genexpr>}   s9   è è € ð 
ð 
Ø�D�‰JŒJð
ð 
ð 
ð 
ð 
ð 
r   ÚcoordÚ__weakref__z    __slots__ = (z)
z    def __init__r(   rE   z        self.z	 = [] if z is None else r)   z = )r   ÚextendrG   rN   rK   ÚjoinÚget)r   r   ÚargsÚarglistÚslotsr   s   `     r   rU   zNodeCfg._gen_initm   s¡  ø€ Ø+�t”yÐ+Ð+Ð+ˆàˆxˆØ�ŠÐSÐSÐSÐS TÔ%5ÐSÑSÔSÑSÔSÐSØ�Š�LÑ!Ô!Ð!ð Œ=ð 	BØ�KŠK˜ÑÔÐØ�KŠKÐAÐA°4´=ÐAÑAÔAÑAÔAÐAØ(�d—i’i ‘o”oÐ(Ð(Ð(ˆð —	’	ð 
ð 
Ø#'Ô#3°wÀÐ6NÑ#Nð
ñ 
ô 
ñ 
ô 
ˆð 	Ð- 5Ð-Ð-Ð-Ñ-ˆØÐ. 'Ð.Ð.Ð.Ñ.ˆàÔ$¨ yÑ0ð 	9ð 	9ˆDØŒ}× Ò  Ñ&Ô&¨$Ò.Ð.ØÐR tÐRÐR°dÐRÐRÈ$ÐRÐRÐRÑR��àÐ8 tÐ8Ð8°Ð8Ð8Ð8Ñ8��àˆ
r   c                 ó®   — d}| j         rF|dz  }| j        D ]}|d|› d�z  }|d|› d|› d�z  }Œ| j        D ]}|d|› d	�z  }|d
|› d�z  }Œ|dz  }n|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.z	 or []):
z            nodelist.append((f"z[{i}]", child))
z        return tuple(nodelist)
z        return ()
©rG   rI   rJ   ©r   r   rI   rJ   s       r   rV   zNodeCfg._gen_children‹   sÄ   € Ø)ˆàÔð 	)ØÐ,Ñ,ˆCàœð Sð S�ØÐ@¨%Ð@Ð@Ð@Ñ@�ØÐR¸ÐRÐRÀuÐRÐRÐRÑR��à!œ^ð Xð X�	ØÐVÀÐVÐVÐVÑV�ØÐW¸ÐWÐWÐWÑW��àÐ5Ñ5ˆCˆCàÐ(Ñ(ˆCàˆ
r   c                 ó¨   — d}| j         rC| j        D ]}|d|› d�z  }|d|› d�z  }Œ| j        D ]}|d|› d�z  }Œ| j        s| j        s|dz  }n|dz  }|S )	Nz    def __iter__(self):
rn   ro   z            yield self.r)   z        yield from self.z or []
z        return
        yield
rp   rq   s       r   rW   zNodeCfg._gen_iterŸ   s­   € Ø)ˆàÔð 	:Øœð ;ð ;�ØÐ@¨%Ð@Ð@Ð@Ñ@�ØÐ:°Ð:Ð:Ð:Ñ:��à!œ^ð Fð F�	ØÐE°)ÐEÐEÐEÑE��à”Jð > $¤.ð >àÐ=Ñ=�øð Ð9Ñ9ˆCàˆ
r   c                 óZ   — dd                      d„ | j        D ¦   «         ¦  «        z   dz   }|S )Nz    attr_names = (Ú c              3   ó    K  — | ]	}|›d �V — Œ
dS )ra   Nr
   )r   Únms     r   r]   z*NodeCfg._gen_attr_names.<locals>.<genexpr>´   s(   è è € Ð,MÐ,M¸R°¨[¨[¨[Ð,MÐ,MÐ,MÐ,MÐ,MÐ,Mr   rb   )rh   rH   rY   s     r   rX   zNodeCfg._gen_attr_names³   s4   € Ø" R§W¢WÐ,MÐ,MÀ4Ä9Ð,MÑ,MÔ,MÑ%MÔ%MÑMÐPSÑSˆØˆ
r   N)
r<   r=   r>   Ú__doc__r   r   rU   rV   rW   rX   r
   r   r   r   r   @   sx   € € € € € ðð ð(ð (ð (ð<ð ð ðð ð ð<ð ð ð(ð ð ð(ð ð ð ð r   r   a<  #-----------------------------------------------------------------
# ** ATTENTION **
# This code was automatically generated from _c_ast.cfg
#
# Do not modify it directly. Modify the configuration file and
# run 'make regen-ast' from the repository root to regenerate and format it.
# ** ** *** ** **
#
# The order of generated __slots__ is significant to Node.__repr__.
# ruff: noqa: RUF023
#
# pycparser: c_ast.py
#
# AST Node classes.
#
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-----------------------------------------------------------------

a‰  
import sys
from typing import IO, Any, ClassVar


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: Any | None
    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):
        """Return a tuple of (name, child) pairs for immediate child nodes.

        Names identify the field and, for list fields, the index, such as
        "type" or "ext[0]". Optional children that are None are omitted.
        The returned tuple supports len() and indexing. Iterating over the
        node itself yields just the child nodes, without their names.
        """

    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: str | None = 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):
                return 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__r   zc_ast.pyÚw)ÚosÚstringr   Útypingr   r   r   r   r   r<   ÚpathÚdirnameÚabspathÚ__file__Úbase_dirrh   Úcfg_pathÚout_pathÚast_genr.   Úoutr    r
   r   r   ú<module>r†      s–  ðð  
€	€	€	Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ð($ð ($ð ($ð ($ð ($ñ ($ô ($ð ($ðVuð uð uð uð uñ uô uð uðpÐ ð(l€ð^ ˆzÒÐØŒw�Š˜rœwŸš¨xÑ8Ô8Ñ9Ô9€HØŒw�|Š|˜H lÑ3Ô3€HØŒw�|Š|˜H jÑ1Ô1€HØÐ˜xÑ(Ô(€GØ	ˆˆh˜Ñ	Ô	ð  Ø×Ò˜ÑÔÐðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð ð Ðs   Â4CÃCÃC