+ print('module_1', list(p))
+ params = p[7]
+ clsname = [Leaf(token.NAME, 'class'),
+ Leaf(token.NAME, p[4], prefix=' '),
+ Leaf(token.COLON, ':')]
+ pass_stmt = Node(syms.pass_stmt, [Leaf(token.NAME, "pass"),])
+ if params:
+ params = [Leaf(token.LPAR, '(')] + params + [Leaf(token.RPAR, ')')]
+ fn = [Leaf(token.NAME, 'def'),
+ Leaf(token.NAME, '__init__', prefix=' '),
+ Node(syms.parameters, params),
+ Leaf(token.COLON, ':')]
+ fndef = Node(syms.funcdef, fn)
+ stmts = Node(syms.stmt, [fndef])
+ else:
+ stmts = Node(syms.small_stmt, [pass_stmt, Leaf(token.NEWLINE, '\n')])
+ stmts = Node(syms.stmt, [stmts])
+
+ # XXX TODO ports as py nodes
+ ports = p[8]
+ stmts.children.append(Leaf(token.STRING, '\n' + indent(ports, 8)))
+ suite = Node(syms.suite, [Leaf(token.NEWLINE, '\n'),
+ Leaf(token.INDENT, ' '),
+ stmts,
+ Leaf(token.DEDENT, '')
+ ])
+ clsdecl = Node(syms.classdef, clsname + [suite])
+ clsdecl = Node(syms.compound_stmt, [clsdecl])
+ print ("clsdecl", repr(clsdecl))
+ print ("clsstr:")
+ print (str(clsdecl))
+ p[0] = clsdecl