static Keyword_ent the_key_tab[]={
{"absdynamic", ABSDYNAMIC},
{"accepts", ACCEPTS},
- {"accidentals", ACCIDENTALS},
{"bar", BAR},
{"cadenza", CADENZA},
- {"clear", CLEAR},
{"clef", CLEF},
{"cm", CM_T},
{"consists", CONSISTS},
- {"contains", CONTAINS},
{"duration", DURATION},
{"font", FONT},
{"grouping", GROUPING},
+ {"header", HEADER},
{"in", IN_T},
- {"lyric", LYRIC},
+ {"lyrics", LYRICS},
{"key", KEY},
+ {"keysignature", KEYSIGNATURE},
{"mark", MARK},
- {"melodic" , MELODIC},
{"musicalpitch", MUSICAL_PITCH},
{"time", TIME_T},
+ {"times", TIMES},
{"midi", MIDI},
{"mm", MM_T},
- {"multi", MULTI},
- {"header", HEADER},
+ {"name", NAME},
{"notenames", NOTENAMES},
- {"octave", OCTAVE},
+ {"notes" , NOTES},
{"output", OUTPUT},
{"partial", PARTIAL},
{"paper", PAPER},
{"property", PROPERTY},
{"pt", PT_T},
{"relative", RELATIVE},
+ {"remove", REMOVE},
+ {"scm", SCHEME},
{"score", SCORE},
{"script", SCRIPT},
{"shape", SHAPE},
{"skip", SKIP},
- {"staff", STAFF},
{"table", TABLE},
{"spandynamic", SPANDYNAMIC},
{"symboltables", SYMBOLTABLES},
My_lily_lexer::lookup_identifier (String s)
{
for (int i = scope_l_arr_.size (); i--; )
- if (scope_l_arr_[i]->elt_b (s))
+ if (scope_l_arr_[i]->elem_b (s))
return (*scope_l_arr_[i])[s];
return 0;
}
void
My_lily_lexer::set_identifier (String name_str, Identifier* i, bool unique_b)
{
- Identifier *old = lookup_identifier (name_str);
+ Identifier *old =0;
+ if (scope_l_arr_.top ()->elem_b (name_str))
+ old = scope_l_arr_.top ()->elem(name_str);
+
+
if (old)
{
#if 0
#endif
delete old;
}
+ if (lookup_keyword (name_str) >= 0)
+ {
+ warning ( _f ("Identifier name is a keyword (`%s')", name_str));
+ }
+
(*scope_l_arr_.top ())[name_str] = i;
}
bool
My_lily_lexer::notename_b (String s) const
{
- return note_tab_p_->elt_b (s);
+ return note_tab_p_->elem_b (s);
}
void
}
void
-My_lily_lexer::clear_notenames()
+My_lily_lexer::set_notename_table(Notename_table *p)
{
delete note_tab_p_;
- note_tab_p_ = new Notename_table;
+ note_tab_p_ = p;
}
char