annotate python/tree.py @ 318:e84047f29c78

Add burg and yacc initial attempts
author Windel Bouwman
date Tue, 31 Dec 2013 12:38:15 +0100
parents
children 8d07a4254f04
rev   line source
318
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
1
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
2 class Tree:
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
3 def __init__(self, name, *args):
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
4 self.name = name
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
5 self.children = args
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
6
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
7 def __repr__(self):
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
8 return 'Tree({}, {})'.format(self.name, self.children)