spiffyscore

Check-in [029fd48614]
Login
Overview
Comment:Added a name parameter to the Tree class that will prove helpful in generating the score
Timelines: family | ancestors | descendants | both | feature/abc
Files: files | file ages | folders
SHA1: 029fd48614c00050b97642b9b0a7802e8c20a202
User & Date: brian on 2011-09-13 20:08:17
Other Links: branch diff | manifest | tags
Context
2011-09-15
15:28
Got the program to run through again. Now without the roman numerals check-in: 33ddc6fee4 user: brian tags: feature/abc
2011-09-13
20:08
Added a name parameter to the Tree class that will prove helpful in generating the score check-in: 029fd48614 user: brian tags: feature/abc
20:02
Changed parser to include nodes check-in: 18dba95a2e user: brian tags: feature/abc
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified parse.py from [751d12bb6a] to [e9eede661e].

   154    154           p[0] = Rest()
   155    155           if len(p) > 2:
   156    156               p[0].duration = p[2]
   157    157   
   158    158       def node(p):
   159    159           '''node: NODE
   160    160           '''
   161         -        p[0] = tree.tree(node.strip("(").strip(")"))
          161  +        p[0] = tree.Tree(node.strip("(").strip(")"))
   162    162   
   163    163   
   164    164       def p_error(p):
   165    165           raise Exception("Syntax error at '%s' of element type %s" % (p.value, p.type))
   166    166           
   167    167       yacc.yacc()
   168    168   
   169    169       #print yacc.parse("GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD")
   170    170       return yacc.parse(score)

Modified tree.py from [7aba067c30] to [29c78902c8].

     1      1   import pdb
     2      2   
     3      3   class Tree():
     4         -    def __init__(self):
            4  +    def __init__(self, name):
     5      5           self.nodes = []
            6  +        self.name = name
     6      7   
     7      8       def traverse_depth_first(self):
     8      9           all_nodes = []
     9     10           for node in self.nodes:
    10     11               if isinstance(node, Node):
    11     12                   all_nodes.append(node)
    12     13               elif isinstance(node, Tree):