chordmodifier_tab_ = scm_make_vector (scm_from_int (1), SCM_EOL);
}
-Lily_lexer::Lily_lexer (Lily_lexer const &src)
+Lily_lexer::Lily_lexer (Lily_lexer const &src, Lily_parser *parser)
: Includable_lexer ()
{
+ parser_ = parser;
keytable_ = (src.keytable_) ? new Keyword_table (*src.keytable_) : 0;
chordmodifier_tab_ = src.chordmodifier_tab_;
pitchname_tab_stack_ = src.pitchname_tab_stack_;
set_current_scope ();
}
+bool
+Lily_lexer::has_scope () const
+{
+ return scm_is_pair (scopes_);
+}
SCM
Lily_lexer::remove_scope ()
return keytable_->lookup (s.c_str ());
}
+SCM
+Lily_lexer::keyword_list () const
+{
+ if (!keytable_)
+ return SCM_EOL;
+
+ SCM l = SCM_EOL;
+ SCM *tail = &l;
+ for (vsize i = 0; i < keytable_->table_.size (); i++)
+ {
+ *tail = scm_acons (scm_makfrom0str (keytable_->table_[i].name_),
+ scm_from_int (keytable_->table_[i].tokcode_),
+ SCM_EOL);
+
+ tail = SCM_CDRLOC(*tail);
+ }
+
+ return l;
+}
+
SCM
Lily_lexer::lookup_identifier_symbol (SCM sym)
{
SCM
Lily_lexer::mark_smob (SCM s)
{
+ ASSERT_LIVE_IS_ALLOWED();
+
Lily_lexer *lexer = (Lily_lexer *) SCM_CELL_WORD_1 (s);
scm_gc_mark (lexer->chordmodifier_tab_);