]> git.donarmstrong.com Git - lilypond.git/blob - table.cc
release: 0.0.6
[lilypond.git] / table.cc
1 #include "glob.hh"
2 #include "debug.hh"
3 #include "string.hh"
4 #include "identifier.hh"
5 #include "keyword.hh"
6 #include "parser.hh"
7
8 static Keyword_ent  the_key_tab[]={
9     "voice", VOICE,
10     "rhythmstaff", RHYTHMSTAFF,
11     "melodicstaff", MELODICSTAFF,
12     "score", SCORE,
13     "bar", BAR,
14     "output", OUTPUT,
15     "cm", CM,
16     "pt", PT,
17     "in", IN,
18     "mm", MM,
19     "paper", PAPER,
20     "width", WIDTH,
21     "meter", METER,
22     "unitspace", UNITSPACE,
23     "skip", SKIP,
24     "commands", COMMANDS,
25     "staff", STAFF,
26     0,0
27 } ;
28
29
30 int
31 lookup_keyword(String s)
32 {
33     static Keyword_table table(the_key_tab);
34     return table.lookup(s);
35 }
36
37 Assoc<String, Identifier*> the_id_tab;
38
39 Identifier*
40 lookup_identifier(String s)
41 {
42     if (!the_id_tab.elt_query(s))
43         return 0;
44     
45     return the_id_tab[s];
46 }
47
48 void
49 add_identifier(Identifier*i)
50 {    
51     the_id_tab[i->name] = i;
52 }