(self, product, name, depth)
| 325 | self.emit("%(ctype)s %(name)s;" % locals(), depth) |
| 326 | |
| 327 | def visitProduct(self, product, name, depth): |
| 328 | self.emit("struct _%(name)s {" % locals(), depth) |
| 329 | for f in product.fields: |
| 330 | self.visit(f, depth + 1) |
| 331 | for field in product.attributes: |
| 332 | # rudimentary attribute handling |
| 333 | type = str(field.type) |
| 334 | assert type in asdl.builtin_types, type |
| 335 | self.emit("%s %s;" % (type, field.name), depth + 1); |
| 336 | self.emit("};", depth) |
| 337 | self.emit("", depth) |
| 338 | |
| 339 | |
| 340 | def ast_func_name(name): |