lilypond-0.1.57
[lilypond.git] / lily / notename.cc
blob99abaf605fb04732497273ffa79a45f9f152e749
1 #include "glob.hh"
2 #include "string.hh"
3 #include "notename.hh"
4 #include "lexer.hh"
5 #include "identifier.hh"
9 void
10 Notename_tab::lookup(int &large, int &small, String s)
12 large = -1;
13 small = 0;
15 for (int i =0; i < 7*5; i++)
16 if (s == notetab[i])
18 large = i /5;
19 small = i %5 - 2;
20 return;
25 void
26 Notename_tab::set(int l, int s, String n)
28 assert(l < 8 && s <= 2 && s >= -2 && l >=0);
29 notetab[l * 5 + s +2] = n;
31 /* *************** */
33 #if 0
34 void
35 My_flex_lexer::set(Notename_tab *n)
37 delete defaulttab;
38 defaulttab = n;
41 void
42 My_flex_lexer::lookup_notename(int &large, int &small, String s)
44 if (!defaulttab)
45 set(lookup_identifier("default_table")->
46 notename_tab(true));
48 defaulttab->lookup(large, small, s);
50 #endif