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