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