@pairling/runtime-darwin-x64 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +1 -1
  2. package/bin/pairling-connectd +0 -0
  3. package/manifest.json +4 -4
  4. package/package.json +3 -3
  5. package/python/bin/python3 +0 -0
  6. package/python/bin/python3.12 +0 -0
  7. package/python/lib/libpython3.12.dylib +0 -0
  8. package/python/lib/python3.12/lib-dynload/_crypt.cpython-312-darwin.so +0 -0
  9. package/python/lib/python3.12/lib-dynload/_dbm.cpython-312-darwin.so +0 -0
  10. package/python/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so +0 -0
  11. package/python/lib/python3.12/site-packages/cffi/__init__.py +14 -0
  12. package/python/lib/python3.12/site-packages/cffi/_cffi_errors.h +149 -0
  13. package/python/lib/python3.12/site-packages/cffi/_cffi_include.h +389 -0
  14. package/python/lib/python3.12/site-packages/cffi/_embedding.h +550 -0
  15. package/python/lib/python3.12/site-packages/cffi/_imp_emulation.py +83 -0
  16. package/python/lib/python3.12/site-packages/cffi/_shimmed_dist_utils.py +45 -0
  17. package/python/lib/python3.12/site-packages/cffi/api.py +967 -0
  18. package/python/lib/python3.12/site-packages/cffi/backend_ctypes.py +1121 -0
  19. package/python/lib/python3.12/site-packages/cffi/cffi_opcode.py +187 -0
  20. package/python/lib/python3.12/site-packages/cffi/commontypes.py +82 -0
  21. package/python/lib/python3.12/site-packages/cffi/cparser.py +1015 -0
  22. package/python/lib/python3.12/site-packages/cffi/error.py +31 -0
  23. package/python/lib/python3.12/site-packages/cffi/ffiplatform.py +113 -0
  24. package/python/lib/python3.12/site-packages/cffi/lock.py +30 -0
  25. package/python/lib/python3.12/site-packages/cffi/model.py +618 -0
  26. package/python/lib/python3.12/site-packages/cffi/parse_c_type.h +181 -0
  27. package/python/lib/python3.12/site-packages/cffi/pkgconfig.py +121 -0
  28. package/python/lib/python3.12/site-packages/cffi/recompiler.py +1598 -0
  29. package/python/lib/python3.12/site-packages/cffi/setuptools_ext.py +216 -0
  30. package/python/lib/python3.12/site-packages/cffi/vengine_cpy.py +1084 -0
  31. package/python/lib/python3.12/site-packages/cffi/vengine_gen.py +679 -0
  32. package/python/lib/python3.12/site-packages/cffi/verifier.py +306 -0
  33. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/INSTALLER +1 -0
  34. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/LICENSE +26 -0
  35. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/METADATA +40 -0
  36. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/RECORD +30 -0
  37. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/WHEEL +5 -0
  38. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/entry_points.txt +2 -0
  39. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/top_level.txt +2 -0
  40. package/python/lib/python3.12/site-packages/cryptography/__about__.py +17 -0
  41. package/python/lib/python3.12/site-packages/cryptography/__init__.py +26 -0
  42. package/python/lib/python3.12/site-packages/cryptography/exceptions.py +52 -0
  43. package/python/lib/python3.12/site-packages/cryptography/fernet.py +224 -0
  44. package/python/lib/python3.12/site-packages/cryptography/hazmat/__init__.py +13 -0
  45. package/python/lib/python3.12/site-packages/cryptography/hazmat/_oid.py +348 -0
  46. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/__init__.py +13 -0
  47. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/__init__.py +9 -0
  48. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/backend.py +308 -0
  49. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/__init__.py +3 -0
  50. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/__init__.pyi +37 -0
  51. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/_openssl.pyi +8 -0
  52. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/asn1.pyi +7 -0
  53. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/exceptions.pyi +17 -0
  54. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/ocsp.pyi +117 -0
  55. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi +75 -0
  56. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/aead.pyi +107 -0
  57. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ciphers.pyi +38 -0
  58. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/cmac.pyi +18 -0
  59. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dh.pyi +51 -0
  60. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dsa.pyi +41 -0
  61. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ec.pyi +52 -0
  62. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed25519.pyi +13 -0
  63. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed448.pyi +13 -0
  64. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hashes.pyi +28 -0
  65. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hmac.pyi +22 -0
  66. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/kdf.pyi +49 -0
  67. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/keys.pyi +34 -0
  68. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/poly1305.pyi +15 -0
  69. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/rsa.pyi +55 -0
  70. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x25519.pyi +13 -0
  71. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x448.pyi +13 -0
  72. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs12.pyi +52 -0
  73. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs7.pyi +50 -0
  74. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/test_support.pyi +23 -0
  75. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/x509.pyi +313 -0
  76. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so +0 -0
  77. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/__init__.py +3 -0
  78. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/_conditional.py +191 -0
  79. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/binding.py +122 -0
  80. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/__init__.py +5 -0
  81. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/__init__.py +5 -0
  82. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/algorithms.py +112 -0
  83. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/__init__.py +3 -0
  84. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_asymmetric.py +19 -0
  85. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_cipheralgorithm.py +60 -0
  86. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_serialization.py +168 -0
  87. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/__init__.py +3 -0
  88. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dh.py +147 -0
  89. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py +167 -0
  90. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ec.py +447 -0
  91. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed25519.py +129 -0
  92. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed448.py +131 -0
  93. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/padding.py +113 -0
  94. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py +277 -0
  95. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/types.py +111 -0
  96. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/utils.py +24 -0
  97. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py +122 -0
  98. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x448.py +125 -0
  99. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/__init__.py +27 -0
  100. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/aead.py +23 -0
  101. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py +183 -0
  102. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/base.py +146 -0
  103. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/modes.py +268 -0
  104. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/cmac.py +10 -0
  105. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/constant_time.py +14 -0
  106. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hashes.py +246 -0
  107. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hmac.py +13 -0
  108. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/__init__.py +23 -0
  109. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/argon2.py +13 -0
  110. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/concatkdf.py +125 -0
  111. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/hkdf.py +101 -0
  112. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.py +305 -0
  113. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/pbkdf2.py +62 -0
  114. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/scrypt.py +19 -0
  115. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/x963kdf.py +61 -0
  116. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/keywrap.py +177 -0
  117. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/padding.py +69 -0
  118. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/poly1305.py +11 -0
  119. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/__init__.py +65 -0
  120. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/base.py +14 -0
  121. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs12.py +176 -0
  122. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs7.py +411 -0
  123. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/ssh.py +1619 -0
  124. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/__init__.py +9 -0
  125. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/hotp.py +101 -0
  126. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/totp.py +56 -0
  127. package/python/lib/python3.12/site-packages/cryptography/py.typed +0 -0
  128. package/python/lib/python3.12/site-packages/cryptography/utils.py +139 -0
  129. package/python/lib/python3.12/site-packages/cryptography/x509/__init__.py +270 -0
  130. package/python/lib/python3.12/site-packages/cryptography/x509/base.py +848 -0
  131. package/python/lib/python3.12/site-packages/cryptography/x509/certificate_transparency.py +35 -0
  132. package/python/lib/python3.12/site-packages/cryptography/x509/extensions.py +2528 -0
  133. package/python/lib/python3.12/site-packages/cryptography/x509/general_name.py +281 -0
  134. package/python/lib/python3.12/site-packages/cryptography/x509/name.py +477 -0
  135. package/python/lib/python3.12/site-packages/cryptography/x509/ocsp.py +379 -0
  136. package/python/lib/python3.12/site-packages/cryptography/x509/oid.py +37 -0
  137. package/python/lib/python3.12/site-packages/cryptography/x509/verification.py +34 -0
  138. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/INSTALLER +1 -0
  139. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/METADATA +139 -0
  140. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/RECORD +106 -0
  141. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/REQUESTED +0 -0
  142. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/WHEEL +4 -0
  143. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE +3 -0
  144. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.APACHE +202 -0
  145. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.BSD +27 -0
  146. package/python/lib/python3.12/site-packages/pycparser/__init__.py +99 -0
  147. package/python/lib/python3.12/site-packages/pycparser/_ast_gen.py +355 -0
  148. package/python/lib/python3.12/site-packages/pycparser/_c_ast.cfg +195 -0
  149. package/python/lib/python3.12/site-packages/pycparser/ast_transforms.py +174 -0
  150. package/python/lib/python3.12/site-packages/pycparser/c_ast.py +1341 -0
  151. package/python/lib/python3.12/site-packages/pycparser/c_generator.py +573 -0
  152. package/python/lib/python3.12/site-packages/pycparser/c_lexer.py +706 -0
  153. package/python/lib/python3.12/site-packages/pycparser/c_parser.py +2376 -0
  154. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/INSTALLER +1 -0
  155. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/METADATA +244 -0
  156. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/RECORD +14 -0
  157. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/WHEEL +5 -0
  158. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/licenses/LICENSE +27 -0
  159. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1341 @@
1
+ # -----------------------------------------------------------------
2
+ # ** ATTENTION **
3
+ # This code was automatically generated from _c_ast.cfg
4
+ #
5
+ # Do not modify it directly. Modify the configuration file and
6
+ # run the generator again.
7
+ # ** ** *** ** **
8
+ #
9
+ # pycparser: c_ast.py
10
+ #
11
+ # AST Node classes.
12
+ #
13
+ # Eli Bendersky [https://eli.thegreenplace.net/]
14
+ # License: BSD
15
+ # -----------------------------------------------------------------
16
+
17
+
18
+ import sys
19
+ from typing import Any, ClassVar, IO, Optional
20
+
21
+
22
+ def _repr(obj):
23
+ """
24
+ Get the representation of an object, with dedicated pprint-like format for lists.
25
+ """
26
+ if isinstance(obj, list):
27
+ return "[" + (",\n ".join((_repr(e).replace("\n", "\n ") for e in obj))) + "\n]"
28
+ else:
29
+ return repr(obj)
30
+
31
+
32
+ class Node:
33
+ __slots__ = ()
34
+ """ Abstract base class for AST nodes.
35
+ """
36
+ attr_names: ClassVar[tuple[str, ...]] = ()
37
+ coord: Optional[Any]
38
+
39
+ def __repr__(self):
40
+ """Generates a python representation of the current node"""
41
+ result = self.__class__.__name__ + "("
42
+
43
+ indent = ""
44
+ separator = ""
45
+ for name in self.__slots__[:-2]:
46
+ result += separator
47
+ result += indent
48
+ result += (
49
+ name
50
+ + "="
51
+ + (
52
+ _repr(getattr(self, name)).replace(
53
+ "\n",
54
+ "\n " + (" " * (len(name) + len(self.__class__.__name__))),
55
+ )
56
+ )
57
+ )
58
+
59
+ separator = ","
60
+ indent = "\n " + (" " * len(self.__class__.__name__))
61
+
62
+ result += indent + ")"
63
+
64
+ return result
65
+
66
+ def children(self):
67
+ """A sequence of all children that are Nodes"""
68
+ pass
69
+
70
+ def show(
71
+ self,
72
+ buf: IO[str] = sys.stdout,
73
+ offset: int = 0,
74
+ attrnames: bool = False,
75
+ showemptyattrs: bool = True,
76
+ nodenames: bool = False,
77
+ showcoord: bool = False,
78
+ _my_node_name: Optional[str] = None,
79
+ ):
80
+ """Pretty print the Node and all its attributes and
81
+ children (recursively) to a buffer.
82
+
83
+ buf:
84
+ Open IO buffer into which the Node is printed.
85
+
86
+ offset:
87
+ Initial offset (amount of leading spaces)
88
+
89
+ attrnames:
90
+ True if you want to see the attribute names in
91
+ name=value pairs. False to only see the values.
92
+
93
+ showemptyattrs:
94
+ False if you want to suppress printing empty attributes.
95
+
96
+ nodenames:
97
+ True if you want to see the actual node names
98
+ within their parents.
99
+
100
+ showcoord:
101
+ Do you want the coordinates of each Node to be
102
+ displayed.
103
+ """
104
+ lead = " " * offset
105
+ if nodenames and _my_node_name is not None:
106
+ buf.write(lead + self.__class__.__name__ + " <" + _my_node_name + ">: ")
107
+ else:
108
+ buf.write(lead + self.__class__.__name__ + ": ")
109
+
110
+ if self.attr_names:
111
+
112
+ def is_empty(v):
113
+ v is None or (hasattr(v, "__len__") and len(v) == 0)
114
+
115
+ nvlist = [
116
+ (n, getattr(self, n))
117
+ for n in self.attr_names
118
+ if showemptyattrs or not is_empty(getattr(self, n))
119
+ ]
120
+ if attrnames:
121
+ attrstr = ", ".join(f"{name}={value}" for name, value in nvlist)
122
+ else:
123
+ attrstr = ", ".join(f"{value}" for _, value in nvlist)
124
+ buf.write(attrstr)
125
+
126
+ if showcoord:
127
+ buf.write(f" (at {self.coord})")
128
+ buf.write("\n")
129
+
130
+ for child_name, child in self.children():
131
+ child.show(
132
+ buf,
133
+ offset=offset + 2,
134
+ attrnames=attrnames,
135
+ showemptyattrs=showemptyattrs,
136
+ nodenames=nodenames,
137
+ showcoord=showcoord,
138
+ _my_node_name=child_name,
139
+ )
140
+
141
+
142
+ class NodeVisitor:
143
+ """A base NodeVisitor class for visiting c_ast nodes.
144
+ Subclass it and define your own visit_XXX methods, where
145
+ XXX is the class name you want to visit with these
146
+ methods.
147
+
148
+ For example:
149
+
150
+ class ConstantVisitor(NodeVisitor):
151
+ def __init__(self):
152
+ self.values = []
153
+
154
+ def visit_Constant(self, node):
155
+ self.values.append(node.value)
156
+
157
+ Creates a list of values of all the constant nodes
158
+ encountered below the given node. To use it:
159
+
160
+ cv = ConstantVisitor()
161
+ cv.visit(node)
162
+
163
+ Notes:
164
+
165
+ * generic_visit() will be called for AST nodes for which
166
+ no visit_XXX method was defined.
167
+ * The children of nodes for which a visit_XXX was
168
+ defined will not be visited - if you need this, call
169
+ generic_visit() on the node.
170
+ You can use:
171
+ NodeVisitor.generic_visit(self, node)
172
+ * Modeled after Python's own AST visiting facilities
173
+ (the ast module of Python 3.0)
174
+ """
175
+
176
+ _method_cache = None
177
+
178
+ def visit(self, node: Node):
179
+ """Visit a node."""
180
+
181
+ if self._method_cache is None:
182
+ self._method_cache = {}
183
+
184
+ visitor = self._method_cache.get(node.__class__.__name__, None)
185
+ if visitor is None:
186
+ method = "visit_" + node.__class__.__name__
187
+ visitor = getattr(self, method, self.generic_visit)
188
+ self._method_cache[node.__class__.__name__] = visitor
189
+
190
+ return visitor(node)
191
+
192
+ def generic_visit(self, node: Node):
193
+ """Called if no explicit visitor function exists for a
194
+ node. Implements preorder visiting of the node.
195
+ """
196
+ for _, c in node.children():
197
+ self.visit(c)
198
+
199
+
200
+ class ArrayDecl(Node):
201
+ __slots__ = ("type", "dim", "dim_quals", "coord", "__weakref__")
202
+
203
+ def __init__(self, type, dim, dim_quals, coord=None):
204
+ self.type = type
205
+ self.dim = dim
206
+ self.dim_quals = dim_quals
207
+ self.coord = coord
208
+
209
+ def children(self):
210
+ nodelist = []
211
+ if self.type is not None:
212
+ nodelist.append(("type", self.type))
213
+ if self.dim is not None:
214
+ nodelist.append(("dim", self.dim))
215
+ return tuple(nodelist)
216
+
217
+ def __iter__(self):
218
+ if self.type is not None:
219
+ yield self.type
220
+ if self.dim is not None:
221
+ yield self.dim
222
+
223
+ attr_names = ("dim_quals",)
224
+
225
+
226
+ class ArrayRef(Node):
227
+ __slots__ = ("name", "subscript", "coord", "__weakref__")
228
+
229
+ def __init__(self, name, subscript, coord=None):
230
+ self.name = name
231
+ self.subscript = subscript
232
+ self.coord = coord
233
+
234
+ def children(self):
235
+ nodelist = []
236
+ if self.name is not None:
237
+ nodelist.append(("name", self.name))
238
+ if self.subscript is not None:
239
+ nodelist.append(("subscript", self.subscript))
240
+ return tuple(nodelist)
241
+
242
+ def __iter__(self):
243
+ if self.name is not None:
244
+ yield self.name
245
+ if self.subscript is not None:
246
+ yield self.subscript
247
+
248
+ attr_names = ()
249
+
250
+
251
+ class Assignment(Node):
252
+ __slots__ = ("op", "lvalue", "rvalue", "coord", "__weakref__")
253
+
254
+ def __init__(self, op, lvalue, rvalue, coord=None):
255
+ self.op = op
256
+ self.lvalue = lvalue
257
+ self.rvalue = rvalue
258
+ self.coord = coord
259
+
260
+ def children(self):
261
+ nodelist = []
262
+ if self.lvalue is not None:
263
+ nodelist.append(("lvalue", self.lvalue))
264
+ if self.rvalue is not None:
265
+ nodelist.append(("rvalue", self.rvalue))
266
+ return tuple(nodelist)
267
+
268
+ def __iter__(self):
269
+ if self.lvalue is not None:
270
+ yield self.lvalue
271
+ if self.rvalue is not None:
272
+ yield self.rvalue
273
+
274
+ attr_names = ("op",)
275
+
276
+
277
+ class Alignas(Node):
278
+ __slots__ = ("alignment", "coord", "__weakref__")
279
+
280
+ def __init__(self, alignment, coord=None):
281
+ self.alignment = alignment
282
+ self.coord = coord
283
+
284
+ def children(self):
285
+ nodelist = []
286
+ if self.alignment is not None:
287
+ nodelist.append(("alignment", self.alignment))
288
+ return tuple(nodelist)
289
+
290
+ def __iter__(self):
291
+ if self.alignment is not None:
292
+ yield self.alignment
293
+
294
+ attr_names = ()
295
+
296
+
297
+ class BinaryOp(Node):
298
+ __slots__ = ("op", "left", "right", "coord", "__weakref__")
299
+
300
+ def __init__(self, op, left, right, coord=None):
301
+ self.op = op
302
+ self.left = left
303
+ self.right = right
304
+ self.coord = coord
305
+
306
+ def children(self):
307
+ nodelist = []
308
+ if self.left is not None:
309
+ nodelist.append(("left", self.left))
310
+ if self.right is not None:
311
+ nodelist.append(("right", self.right))
312
+ return tuple(nodelist)
313
+
314
+ def __iter__(self):
315
+ if self.left is not None:
316
+ yield self.left
317
+ if self.right is not None:
318
+ yield self.right
319
+
320
+ attr_names = ("op",)
321
+
322
+
323
+ class Break(Node):
324
+ __slots__ = ("coord", "__weakref__")
325
+
326
+ def __init__(self, coord=None):
327
+ self.coord = coord
328
+
329
+ def children(self):
330
+ return ()
331
+
332
+ def __iter__(self):
333
+ return
334
+ yield
335
+
336
+ attr_names = ()
337
+
338
+
339
+ class Case(Node):
340
+ __slots__ = ("expr", "stmts", "coord", "__weakref__")
341
+
342
+ def __init__(self, expr, stmts, coord=None):
343
+ self.expr = expr
344
+ self.stmts = stmts
345
+ self.coord = coord
346
+
347
+ def children(self):
348
+ nodelist = []
349
+ if self.expr is not None:
350
+ nodelist.append(("expr", self.expr))
351
+ for i, child in enumerate(self.stmts or []):
352
+ nodelist.append((f"stmts[{i}]", child))
353
+ return tuple(nodelist)
354
+
355
+ def __iter__(self):
356
+ if self.expr is not None:
357
+ yield self.expr
358
+ for child in self.stmts or []:
359
+ yield child
360
+
361
+ attr_names = ()
362
+
363
+
364
+ class Cast(Node):
365
+ __slots__ = ("to_type", "expr", "coord", "__weakref__")
366
+
367
+ def __init__(self, to_type, expr, coord=None):
368
+ self.to_type = to_type
369
+ self.expr = expr
370
+ self.coord = coord
371
+
372
+ def children(self):
373
+ nodelist = []
374
+ if self.to_type is not None:
375
+ nodelist.append(("to_type", self.to_type))
376
+ if self.expr is not None:
377
+ nodelist.append(("expr", self.expr))
378
+ return tuple(nodelist)
379
+
380
+ def __iter__(self):
381
+ if self.to_type is not None:
382
+ yield self.to_type
383
+ if self.expr is not None:
384
+ yield self.expr
385
+
386
+ attr_names = ()
387
+
388
+
389
+ class Compound(Node):
390
+ __slots__ = ("block_items", "coord", "__weakref__")
391
+
392
+ def __init__(self, block_items, coord=None):
393
+ self.block_items = block_items
394
+ self.coord = coord
395
+
396
+ def children(self):
397
+ nodelist = []
398
+ for i, child in enumerate(self.block_items or []):
399
+ nodelist.append((f"block_items[{i}]", child))
400
+ return tuple(nodelist)
401
+
402
+ def __iter__(self):
403
+ for child in self.block_items or []:
404
+ yield child
405
+
406
+ attr_names = ()
407
+
408
+
409
+ class CompoundLiteral(Node):
410
+ __slots__ = ("type", "init", "coord", "__weakref__")
411
+
412
+ def __init__(self, type, init, coord=None):
413
+ self.type = type
414
+ self.init = init
415
+ self.coord = coord
416
+
417
+ def children(self):
418
+ nodelist = []
419
+ if self.type is not None:
420
+ nodelist.append(("type", self.type))
421
+ if self.init is not None:
422
+ nodelist.append(("init", self.init))
423
+ return tuple(nodelist)
424
+
425
+ def __iter__(self):
426
+ if self.type is not None:
427
+ yield self.type
428
+ if self.init is not None:
429
+ yield self.init
430
+
431
+ attr_names = ()
432
+
433
+
434
+ class Constant(Node):
435
+ __slots__ = ("type", "value", "coord", "__weakref__")
436
+
437
+ def __init__(self, type, value, coord=None):
438
+ self.type = type
439
+ self.value = value
440
+ self.coord = coord
441
+
442
+ def children(self):
443
+ nodelist = []
444
+ return tuple(nodelist)
445
+
446
+ def __iter__(self):
447
+ return
448
+ yield
449
+
450
+ attr_names = (
451
+ "type",
452
+ "value",
453
+ )
454
+
455
+
456
+ class Continue(Node):
457
+ __slots__ = ("coord", "__weakref__")
458
+
459
+ def __init__(self, coord=None):
460
+ self.coord = coord
461
+
462
+ def children(self):
463
+ return ()
464
+
465
+ def __iter__(self):
466
+ return
467
+ yield
468
+
469
+ attr_names = ()
470
+
471
+
472
+ class Decl(Node):
473
+ __slots__ = (
474
+ "name",
475
+ "quals",
476
+ "align",
477
+ "storage",
478
+ "funcspec",
479
+ "type",
480
+ "init",
481
+ "bitsize",
482
+ "coord",
483
+ "__weakref__",
484
+ )
485
+
486
+ def __init__(
487
+ self, name, quals, align, storage, funcspec, type, init, bitsize, coord=None
488
+ ):
489
+ self.name = name
490
+ self.quals = quals
491
+ self.align = align
492
+ self.storage = storage
493
+ self.funcspec = funcspec
494
+ self.type = type
495
+ self.init = init
496
+ self.bitsize = bitsize
497
+ self.coord = coord
498
+
499
+ def children(self):
500
+ nodelist = []
501
+ if self.type is not None:
502
+ nodelist.append(("type", self.type))
503
+ if self.init is not None:
504
+ nodelist.append(("init", self.init))
505
+ if self.bitsize is not None:
506
+ nodelist.append(("bitsize", self.bitsize))
507
+ return tuple(nodelist)
508
+
509
+ def __iter__(self):
510
+ if self.type is not None:
511
+ yield self.type
512
+ if self.init is not None:
513
+ yield self.init
514
+ if self.bitsize is not None:
515
+ yield self.bitsize
516
+
517
+ attr_names = (
518
+ "name",
519
+ "quals",
520
+ "align",
521
+ "storage",
522
+ "funcspec",
523
+ )
524
+
525
+
526
+ class DeclList(Node):
527
+ __slots__ = ("decls", "coord", "__weakref__")
528
+
529
+ def __init__(self, decls, coord=None):
530
+ self.decls = decls
531
+ self.coord = coord
532
+
533
+ def children(self):
534
+ nodelist = []
535
+ for i, child in enumerate(self.decls or []):
536
+ nodelist.append((f"decls[{i}]", child))
537
+ return tuple(nodelist)
538
+
539
+ def __iter__(self):
540
+ for child in self.decls or []:
541
+ yield child
542
+
543
+ attr_names = ()
544
+
545
+
546
+ class Default(Node):
547
+ __slots__ = ("stmts", "coord", "__weakref__")
548
+
549
+ def __init__(self, stmts, coord=None):
550
+ self.stmts = stmts
551
+ self.coord = coord
552
+
553
+ def children(self):
554
+ nodelist = []
555
+ for i, child in enumerate(self.stmts or []):
556
+ nodelist.append((f"stmts[{i}]", child))
557
+ return tuple(nodelist)
558
+
559
+ def __iter__(self):
560
+ for child in self.stmts or []:
561
+ yield child
562
+
563
+ attr_names = ()
564
+
565
+
566
+ class DoWhile(Node):
567
+ __slots__ = ("cond", "stmt", "coord", "__weakref__")
568
+
569
+ def __init__(self, cond, stmt, coord=None):
570
+ self.cond = cond
571
+ self.stmt = stmt
572
+ self.coord = coord
573
+
574
+ def children(self):
575
+ nodelist = []
576
+ if self.cond is not None:
577
+ nodelist.append(("cond", self.cond))
578
+ if self.stmt is not None:
579
+ nodelist.append(("stmt", self.stmt))
580
+ return tuple(nodelist)
581
+
582
+ def __iter__(self):
583
+ if self.cond is not None:
584
+ yield self.cond
585
+ if self.stmt is not None:
586
+ yield self.stmt
587
+
588
+ attr_names = ()
589
+
590
+
591
+ class EllipsisParam(Node):
592
+ __slots__ = ("coord", "__weakref__")
593
+
594
+ def __init__(self, coord=None):
595
+ self.coord = coord
596
+
597
+ def children(self):
598
+ return ()
599
+
600
+ def __iter__(self):
601
+ return
602
+ yield
603
+
604
+ attr_names = ()
605
+
606
+
607
+ class EmptyStatement(Node):
608
+ __slots__ = ("coord", "__weakref__")
609
+
610
+ def __init__(self, coord=None):
611
+ self.coord = coord
612
+
613
+ def children(self):
614
+ return ()
615
+
616
+ def __iter__(self):
617
+ return
618
+ yield
619
+
620
+ attr_names = ()
621
+
622
+
623
+ class Enum(Node):
624
+ __slots__ = ("name", "values", "coord", "__weakref__")
625
+
626
+ def __init__(self, name, values, coord=None):
627
+ self.name = name
628
+ self.values = values
629
+ self.coord = coord
630
+
631
+ def children(self):
632
+ nodelist = []
633
+ if self.values is not None:
634
+ nodelist.append(("values", self.values))
635
+ return tuple(nodelist)
636
+
637
+ def __iter__(self):
638
+ if self.values is not None:
639
+ yield self.values
640
+
641
+ attr_names = ("name",)
642
+
643
+
644
+ class Enumerator(Node):
645
+ __slots__ = ("name", "value", "coord", "__weakref__")
646
+
647
+ def __init__(self, name, value, coord=None):
648
+ self.name = name
649
+ self.value = value
650
+ self.coord = coord
651
+
652
+ def children(self):
653
+ nodelist = []
654
+ if self.value is not None:
655
+ nodelist.append(("value", self.value))
656
+ return tuple(nodelist)
657
+
658
+ def __iter__(self):
659
+ if self.value is not None:
660
+ yield self.value
661
+
662
+ attr_names = ("name",)
663
+
664
+
665
+ class EnumeratorList(Node):
666
+ __slots__ = ("enumerators", "coord", "__weakref__")
667
+
668
+ def __init__(self, enumerators, coord=None):
669
+ self.enumerators = enumerators
670
+ self.coord = coord
671
+
672
+ def children(self):
673
+ nodelist = []
674
+ for i, child in enumerate(self.enumerators or []):
675
+ nodelist.append((f"enumerators[{i}]", child))
676
+ return tuple(nodelist)
677
+
678
+ def __iter__(self):
679
+ for child in self.enumerators or []:
680
+ yield child
681
+
682
+ attr_names = ()
683
+
684
+
685
+ class ExprList(Node):
686
+ __slots__ = ("exprs", "coord", "__weakref__")
687
+
688
+ def __init__(self, exprs, coord=None):
689
+ self.exprs = exprs
690
+ self.coord = coord
691
+
692
+ def children(self):
693
+ nodelist = []
694
+ for i, child in enumerate(self.exprs or []):
695
+ nodelist.append((f"exprs[{i}]", child))
696
+ return tuple(nodelist)
697
+
698
+ def __iter__(self):
699
+ for child in self.exprs or []:
700
+ yield child
701
+
702
+ attr_names = ()
703
+
704
+
705
+ class FileAST(Node):
706
+ __slots__ = ("ext", "coord", "__weakref__")
707
+
708
+ def __init__(self, ext, coord=None):
709
+ self.ext = ext
710
+ self.coord = coord
711
+
712
+ def children(self):
713
+ nodelist = []
714
+ for i, child in enumerate(self.ext or []):
715
+ nodelist.append((f"ext[{i}]", child))
716
+ return tuple(nodelist)
717
+
718
+ def __iter__(self):
719
+ for child in self.ext or []:
720
+ yield child
721
+
722
+ attr_names = ()
723
+
724
+
725
+ class For(Node):
726
+ __slots__ = ("init", "cond", "next", "stmt", "coord", "__weakref__")
727
+
728
+ def __init__(self, init, cond, next, stmt, coord=None):
729
+ self.init = init
730
+ self.cond = cond
731
+ self.next = next
732
+ self.stmt = stmt
733
+ self.coord = coord
734
+
735
+ def children(self):
736
+ nodelist = []
737
+ if self.init is not None:
738
+ nodelist.append(("init", self.init))
739
+ if self.cond is not None:
740
+ nodelist.append(("cond", self.cond))
741
+ if self.next is not None:
742
+ nodelist.append(("next", self.next))
743
+ if self.stmt is not None:
744
+ nodelist.append(("stmt", self.stmt))
745
+ return tuple(nodelist)
746
+
747
+ def __iter__(self):
748
+ if self.init is not None:
749
+ yield self.init
750
+ if self.cond is not None:
751
+ yield self.cond
752
+ if self.next is not None:
753
+ yield self.next
754
+ if self.stmt is not None:
755
+ yield self.stmt
756
+
757
+ attr_names = ()
758
+
759
+
760
+ class FuncCall(Node):
761
+ __slots__ = ("name", "args", "coord", "__weakref__")
762
+
763
+ def __init__(self, name, args, coord=None):
764
+ self.name = name
765
+ self.args = args
766
+ self.coord = coord
767
+
768
+ def children(self):
769
+ nodelist = []
770
+ if self.name is not None:
771
+ nodelist.append(("name", self.name))
772
+ if self.args is not None:
773
+ nodelist.append(("args", self.args))
774
+ return tuple(nodelist)
775
+
776
+ def __iter__(self):
777
+ if self.name is not None:
778
+ yield self.name
779
+ if self.args is not None:
780
+ yield self.args
781
+
782
+ attr_names = ()
783
+
784
+
785
+ class FuncDecl(Node):
786
+ __slots__ = ("args", "type", "coord", "__weakref__")
787
+
788
+ def __init__(self, args, type, coord=None):
789
+ self.args = args
790
+ self.type = type
791
+ self.coord = coord
792
+
793
+ def children(self):
794
+ nodelist = []
795
+ if self.args is not None:
796
+ nodelist.append(("args", self.args))
797
+ if self.type is not None:
798
+ nodelist.append(("type", self.type))
799
+ return tuple(nodelist)
800
+
801
+ def __iter__(self):
802
+ if self.args is not None:
803
+ yield self.args
804
+ if self.type is not None:
805
+ yield self.type
806
+
807
+ attr_names = ()
808
+
809
+
810
+ class FuncDef(Node):
811
+ __slots__ = ("decl", "param_decls", "body", "coord", "__weakref__")
812
+
813
+ def __init__(self, decl, param_decls, body, coord=None):
814
+ self.decl = decl
815
+ self.param_decls = param_decls
816
+ self.body = body
817
+ self.coord = coord
818
+
819
+ def children(self):
820
+ nodelist = []
821
+ if self.decl is not None:
822
+ nodelist.append(("decl", self.decl))
823
+ if self.body is not None:
824
+ nodelist.append(("body", self.body))
825
+ for i, child in enumerate(self.param_decls or []):
826
+ nodelist.append((f"param_decls[{i}]", child))
827
+ return tuple(nodelist)
828
+
829
+ def __iter__(self):
830
+ if self.decl is not None:
831
+ yield self.decl
832
+ if self.body is not None:
833
+ yield self.body
834
+ for child in self.param_decls or []:
835
+ yield child
836
+
837
+ attr_names = ()
838
+
839
+
840
+ class Goto(Node):
841
+ __slots__ = ("name", "coord", "__weakref__")
842
+
843
+ def __init__(self, name, coord=None):
844
+ self.name = name
845
+ self.coord = coord
846
+
847
+ def children(self):
848
+ nodelist = []
849
+ return tuple(nodelist)
850
+
851
+ def __iter__(self):
852
+ return
853
+ yield
854
+
855
+ attr_names = ("name",)
856
+
857
+
858
+ class ID(Node):
859
+ __slots__ = ("name", "coord", "__weakref__")
860
+
861
+ def __init__(self, name, coord=None):
862
+ self.name = name
863
+ self.coord = coord
864
+
865
+ def children(self):
866
+ nodelist = []
867
+ return tuple(nodelist)
868
+
869
+ def __iter__(self):
870
+ return
871
+ yield
872
+
873
+ attr_names = ("name",)
874
+
875
+
876
+ class IdentifierType(Node):
877
+ __slots__ = ("names", "coord", "__weakref__")
878
+
879
+ def __init__(self, names, coord=None):
880
+ self.names = names
881
+ self.coord = coord
882
+
883
+ def children(self):
884
+ nodelist = []
885
+ return tuple(nodelist)
886
+
887
+ def __iter__(self):
888
+ return
889
+ yield
890
+
891
+ attr_names = ("names",)
892
+
893
+
894
+ class If(Node):
895
+ __slots__ = ("cond", "iftrue", "iffalse", "coord", "__weakref__")
896
+
897
+ def __init__(self, cond, iftrue, iffalse, coord=None):
898
+ self.cond = cond
899
+ self.iftrue = iftrue
900
+ self.iffalse = iffalse
901
+ self.coord = coord
902
+
903
+ def children(self):
904
+ nodelist = []
905
+ if self.cond is not None:
906
+ nodelist.append(("cond", self.cond))
907
+ if self.iftrue is not None:
908
+ nodelist.append(("iftrue", self.iftrue))
909
+ if self.iffalse is not None:
910
+ nodelist.append(("iffalse", self.iffalse))
911
+ return tuple(nodelist)
912
+
913
+ def __iter__(self):
914
+ if self.cond is not None:
915
+ yield self.cond
916
+ if self.iftrue is not None:
917
+ yield self.iftrue
918
+ if self.iffalse is not None:
919
+ yield self.iffalse
920
+
921
+ attr_names = ()
922
+
923
+
924
+ class InitList(Node):
925
+ __slots__ = ("exprs", "coord", "__weakref__")
926
+
927
+ def __init__(self, exprs, coord=None):
928
+ self.exprs = exprs
929
+ self.coord = coord
930
+
931
+ def children(self):
932
+ nodelist = []
933
+ for i, child in enumerate(self.exprs or []):
934
+ nodelist.append((f"exprs[{i}]", child))
935
+ return tuple(nodelist)
936
+
937
+ def __iter__(self):
938
+ for child in self.exprs or []:
939
+ yield child
940
+
941
+ attr_names = ()
942
+
943
+
944
+ class Label(Node):
945
+ __slots__ = ("name", "stmt", "coord", "__weakref__")
946
+
947
+ def __init__(self, name, stmt, coord=None):
948
+ self.name = name
949
+ self.stmt = stmt
950
+ self.coord = coord
951
+
952
+ def children(self):
953
+ nodelist = []
954
+ if self.stmt is not None:
955
+ nodelist.append(("stmt", self.stmt))
956
+ return tuple(nodelist)
957
+
958
+ def __iter__(self):
959
+ if self.stmt is not None:
960
+ yield self.stmt
961
+
962
+ attr_names = ("name",)
963
+
964
+
965
+ class NamedInitializer(Node):
966
+ __slots__ = ("name", "expr", "coord", "__weakref__")
967
+
968
+ def __init__(self, name, expr, coord=None):
969
+ self.name = name
970
+ self.expr = expr
971
+ self.coord = coord
972
+
973
+ def children(self):
974
+ nodelist = []
975
+ if self.expr is not None:
976
+ nodelist.append(("expr", self.expr))
977
+ for i, child in enumerate(self.name or []):
978
+ nodelist.append((f"name[{i}]", child))
979
+ return tuple(nodelist)
980
+
981
+ def __iter__(self):
982
+ if self.expr is not None:
983
+ yield self.expr
984
+ for child in self.name or []:
985
+ yield child
986
+
987
+ attr_names = ()
988
+
989
+
990
+ class ParamList(Node):
991
+ __slots__ = ("params", "coord", "__weakref__")
992
+
993
+ def __init__(self, params, coord=None):
994
+ self.params = params
995
+ self.coord = coord
996
+
997
+ def children(self):
998
+ nodelist = []
999
+ for i, child in enumerate(self.params or []):
1000
+ nodelist.append((f"params[{i}]", child))
1001
+ return tuple(nodelist)
1002
+
1003
+ def __iter__(self):
1004
+ for child in self.params or []:
1005
+ yield child
1006
+
1007
+ attr_names = ()
1008
+
1009
+
1010
+ class PtrDecl(Node):
1011
+ __slots__ = ("quals", "type", "coord", "__weakref__")
1012
+
1013
+ def __init__(self, quals, type, coord=None):
1014
+ self.quals = quals
1015
+ self.type = type
1016
+ self.coord = coord
1017
+
1018
+ def children(self):
1019
+ nodelist = []
1020
+ if self.type is not None:
1021
+ nodelist.append(("type", self.type))
1022
+ return tuple(nodelist)
1023
+
1024
+ def __iter__(self):
1025
+ if self.type is not None:
1026
+ yield self.type
1027
+
1028
+ attr_names = ("quals",)
1029
+
1030
+
1031
+ class Return(Node):
1032
+ __slots__ = ("expr", "coord", "__weakref__")
1033
+
1034
+ def __init__(self, expr, coord=None):
1035
+ self.expr = expr
1036
+ self.coord = coord
1037
+
1038
+ def children(self):
1039
+ nodelist = []
1040
+ if self.expr is not None:
1041
+ nodelist.append(("expr", self.expr))
1042
+ return tuple(nodelist)
1043
+
1044
+ def __iter__(self):
1045
+ if self.expr is not None:
1046
+ yield self.expr
1047
+
1048
+ attr_names = ()
1049
+
1050
+
1051
+ class StaticAssert(Node):
1052
+ __slots__ = ("cond", "message", "coord", "__weakref__")
1053
+
1054
+ def __init__(self, cond, message, coord=None):
1055
+ self.cond = cond
1056
+ self.message = message
1057
+ self.coord = coord
1058
+
1059
+ def children(self):
1060
+ nodelist = []
1061
+ if self.cond is not None:
1062
+ nodelist.append(("cond", self.cond))
1063
+ if self.message is not None:
1064
+ nodelist.append(("message", self.message))
1065
+ return tuple(nodelist)
1066
+
1067
+ def __iter__(self):
1068
+ if self.cond is not None:
1069
+ yield self.cond
1070
+ if self.message is not None:
1071
+ yield self.message
1072
+
1073
+ attr_names = ()
1074
+
1075
+
1076
+ class Struct(Node):
1077
+ __slots__ = ("name", "decls", "coord", "__weakref__")
1078
+
1079
+ def __init__(self, name, decls, coord=None):
1080
+ self.name = name
1081
+ self.decls = decls
1082
+ self.coord = coord
1083
+
1084
+ def children(self):
1085
+ nodelist = []
1086
+ for i, child in enumerate(self.decls or []):
1087
+ nodelist.append((f"decls[{i}]", child))
1088
+ return tuple(nodelist)
1089
+
1090
+ def __iter__(self):
1091
+ for child in self.decls or []:
1092
+ yield child
1093
+
1094
+ attr_names = ("name",)
1095
+
1096
+
1097
+ class StructRef(Node):
1098
+ __slots__ = ("name", "type", "field", "coord", "__weakref__")
1099
+
1100
+ def __init__(self, name, type, field, coord=None):
1101
+ self.name = name
1102
+ self.type = type
1103
+ self.field = field
1104
+ self.coord = coord
1105
+
1106
+ def children(self):
1107
+ nodelist = []
1108
+ if self.name is not None:
1109
+ nodelist.append(("name", self.name))
1110
+ if self.field is not None:
1111
+ nodelist.append(("field", self.field))
1112
+ return tuple(nodelist)
1113
+
1114
+ def __iter__(self):
1115
+ if self.name is not None:
1116
+ yield self.name
1117
+ if self.field is not None:
1118
+ yield self.field
1119
+
1120
+ attr_names = ("type",)
1121
+
1122
+
1123
+ class Switch(Node):
1124
+ __slots__ = ("cond", "stmt", "coord", "__weakref__")
1125
+
1126
+ def __init__(self, cond, stmt, coord=None):
1127
+ self.cond = cond
1128
+ self.stmt = stmt
1129
+ self.coord = coord
1130
+
1131
+ def children(self):
1132
+ nodelist = []
1133
+ if self.cond is not None:
1134
+ nodelist.append(("cond", self.cond))
1135
+ if self.stmt is not None:
1136
+ nodelist.append(("stmt", self.stmt))
1137
+ return tuple(nodelist)
1138
+
1139
+ def __iter__(self):
1140
+ if self.cond is not None:
1141
+ yield self.cond
1142
+ if self.stmt is not None:
1143
+ yield self.stmt
1144
+
1145
+ attr_names = ()
1146
+
1147
+
1148
+ class TernaryOp(Node):
1149
+ __slots__ = ("cond", "iftrue", "iffalse", "coord", "__weakref__")
1150
+
1151
+ def __init__(self, cond, iftrue, iffalse, coord=None):
1152
+ self.cond = cond
1153
+ self.iftrue = iftrue
1154
+ self.iffalse = iffalse
1155
+ self.coord = coord
1156
+
1157
+ def children(self):
1158
+ nodelist = []
1159
+ if self.cond is not None:
1160
+ nodelist.append(("cond", self.cond))
1161
+ if self.iftrue is not None:
1162
+ nodelist.append(("iftrue", self.iftrue))
1163
+ if self.iffalse is not None:
1164
+ nodelist.append(("iffalse", self.iffalse))
1165
+ return tuple(nodelist)
1166
+
1167
+ def __iter__(self):
1168
+ if self.cond is not None:
1169
+ yield self.cond
1170
+ if self.iftrue is not None:
1171
+ yield self.iftrue
1172
+ if self.iffalse is not None:
1173
+ yield self.iffalse
1174
+
1175
+ attr_names = ()
1176
+
1177
+
1178
+ class TypeDecl(Node):
1179
+ __slots__ = ("declname", "quals", "align", "type", "coord", "__weakref__")
1180
+
1181
+ def __init__(self, declname, quals, align, type, coord=None):
1182
+ self.declname = declname
1183
+ self.quals = quals
1184
+ self.align = align
1185
+ self.type = type
1186
+ self.coord = coord
1187
+
1188
+ def children(self):
1189
+ nodelist = []
1190
+ if self.type is not None:
1191
+ nodelist.append(("type", self.type))
1192
+ return tuple(nodelist)
1193
+
1194
+ def __iter__(self):
1195
+ if self.type is not None:
1196
+ yield self.type
1197
+
1198
+ attr_names = (
1199
+ "declname",
1200
+ "quals",
1201
+ "align",
1202
+ )
1203
+
1204
+
1205
+ class Typedef(Node):
1206
+ __slots__ = ("name", "quals", "storage", "type", "coord", "__weakref__")
1207
+
1208
+ def __init__(self, name, quals, storage, type, coord=None):
1209
+ self.name = name
1210
+ self.quals = quals
1211
+ self.storage = storage
1212
+ self.type = type
1213
+ self.coord = coord
1214
+
1215
+ def children(self):
1216
+ nodelist = []
1217
+ if self.type is not None:
1218
+ nodelist.append(("type", self.type))
1219
+ return tuple(nodelist)
1220
+
1221
+ def __iter__(self):
1222
+ if self.type is not None:
1223
+ yield self.type
1224
+
1225
+ attr_names = (
1226
+ "name",
1227
+ "quals",
1228
+ "storage",
1229
+ )
1230
+
1231
+
1232
+ class Typename(Node):
1233
+ __slots__ = ("name", "quals", "align", "type", "coord", "__weakref__")
1234
+
1235
+ def __init__(self, name, quals, align, type, coord=None):
1236
+ self.name = name
1237
+ self.quals = quals
1238
+ self.align = align
1239
+ self.type = type
1240
+ self.coord = coord
1241
+
1242
+ def children(self):
1243
+ nodelist = []
1244
+ if self.type is not None:
1245
+ nodelist.append(("type", self.type))
1246
+ return tuple(nodelist)
1247
+
1248
+ def __iter__(self):
1249
+ if self.type is not None:
1250
+ yield self.type
1251
+
1252
+ attr_names = (
1253
+ "name",
1254
+ "quals",
1255
+ "align",
1256
+ )
1257
+
1258
+
1259
+ class UnaryOp(Node):
1260
+ __slots__ = ("op", "expr", "coord", "__weakref__")
1261
+
1262
+ def __init__(self, op, expr, coord=None):
1263
+ self.op = op
1264
+ self.expr = expr
1265
+ self.coord = coord
1266
+
1267
+ def children(self):
1268
+ nodelist = []
1269
+ if self.expr is not None:
1270
+ nodelist.append(("expr", self.expr))
1271
+ return tuple(nodelist)
1272
+
1273
+ def __iter__(self):
1274
+ if self.expr is not None:
1275
+ yield self.expr
1276
+
1277
+ attr_names = ("op",)
1278
+
1279
+
1280
+ class Union(Node):
1281
+ __slots__ = ("name", "decls", "coord", "__weakref__")
1282
+
1283
+ def __init__(self, name, decls, coord=None):
1284
+ self.name = name
1285
+ self.decls = decls
1286
+ self.coord = coord
1287
+
1288
+ def children(self):
1289
+ nodelist = []
1290
+ for i, child in enumerate(self.decls or []):
1291
+ nodelist.append((f"decls[{i}]", child))
1292
+ return tuple(nodelist)
1293
+
1294
+ def __iter__(self):
1295
+ for child in self.decls or []:
1296
+ yield child
1297
+
1298
+ attr_names = ("name",)
1299
+
1300
+
1301
+ class While(Node):
1302
+ __slots__ = ("cond", "stmt", "coord", "__weakref__")
1303
+
1304
+ def __init__(self, cond, stmt, coord=None):
1305
+ self.cond = cond
1306
+ self.stmt = stmt
1307
+ self.coord = coord
1308
+
1309
+ def children(self):
1310
+ nodelist = []
1311
+ if self.cond is not None:
1312
+ nodelist.append(("cond", self.cond))
1313
+ if self.stmt is not None:
1314
+ nodelist.append(("stmt", self.stmt))
1315
+ return tuple(nodelist)
1316
+
1317
+ def __iter__(self):
1318
+ if self.cond is not None:
1319
+ yield self.cond
1320
+ if self.stmt is not None:
1321
+ yield self.stmt
1322
+
1323
+ attr_names = ()
1324
+
1325
+
1326
+ class Pragma(Node):
1327
+ __slots__ = ("string", "coord", "__weakref__")
1328
+
1329
+ def __init__(self, string, coord=None):
1330
+ self.string = string
1331
+ self.coord = coord
1332
+
1333
+ def children(self):
1334
+ nodelist = []
1335
+ return tuple(nodelist)
1336
+
1337
+ def __iter__(self):
1338
+ return
1339
+ yield
1340
+
1341
+ attr_names = ("string",)