spiffyscore

Diff
Login

Diff

Differences From Artifact [ba81961e5a]:

To Artifact [09e3498be3]:


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

51
52
53
54
55
56
57
    raise TypeError("Unknown text '%s'" % (t.value,))

t_ignore = " |"

lex.lex()

#lex.input("GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD")
#s = "GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD"
s = "GF_G,/2"
lex.input(s)
for tok in iter(lex.token, None):
    print repr(tok.type), repr(tok.value)


# Parse (yacc)

class Note(object):
    def __init__(self, value, duration=.25, octave=8):
        self.value = value
        self.duration = duration
        self.octave = octave

    def __repr__(self):
        return "Note %s %s %s" % (self.value, self.duration, self.octave)

#def p_element(p):
#    "element : note_element"
#    p[0] = p[1]
#







|
|












>







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    raise TypeError("Unknown text '%s'" % (t.value,))

t_ignore = " |"

lex.lex()

#lex.input("GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD")
s = "GFG B'AB,, | g/2fg gab | GFG BAB | d2A AFD"
#s = "GF_G,/2"
lex.input(s)
for tok in iter(lex.token, None):
    print repr(tok.type), repr(tok.value)


# Parse (yacc)

class Note(object):
    def __init__(self, value, duration=.25, octave=8):
        self.value = value
        self.duration = duration
        self.octave = octave
        self.accidental = None
    def __repr__(self):
        return "Note %s %s %s" % (self.value, self.duration, self.octave)

#def p_element(p):
#    "element : note_element"
#    p[0] = p[1]
#