]> git.donarmstrong.com Git - lilypond.git/blob - table.cc
release: 0.0.4
[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     0,0
21 } ;
22
23
24 int
25 lookup_keyword(String s)
26 {
27     static Keyword_table table(the_key_tab);
28     return table.lookup(s);
29 }
30
31 Assoc<String, Identifier*> the_id_tab;
32
33 Identifier*
34 lookup_identifier(String s)
35 {
36     if (!the_id_tab.elt_query(s))
37          the_id_tab[s]= new Identifier;
38     
39     return the_id_tab[s];
40 }