Index: parse.py ================================================================== --- parse.py +++ parse.py @@ -156,11 +156,11 @@ p[0].duration = p[2] def node(p): '''node: NODE ''' - p[0] = tree.tree(node.strip("(").strip(")")) + p[0] = tree.Tree(node.strip("(").strip(")")) def p_error(p): raise Exception("Syntax error at '%s' of element type %s" % (p.value, p.type)) Index: tree.py ================================================================== --- tree.py +++ tree.py @@ -1,10 +1,11 @@ import pdb class Tree(): - def __init__(self): + def __init__(self, name): self.nodes = [] + self.name = name def traverse_depth_first(self): all_nodes = [] for node in self.nodes: if isinstance(node, Node):