void add_scope (SCM);
SCM set_current_scope ();
+ bool has_scope () const;
SCM remove_scope ();
void start_main_input ();
DECLARE_SCHEME_CALLBACK (layout_description, ());
+ void clear ();
void do_init_file ();
void do_yyparse ();
void parse_file (string init, string name, string out_name);
set_current_scope ();
}
+bool
+Lily_lexer::has_scope () const
+{
+ return scm_is_pair (scopes_);
+}
SCM
Lily_lexer::remove_scope ()
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_);
error = parser->error_level_;
+ parser->clear ();
parser->unprotect ();
}
}
error_level_ = error_level_ | lexer_->error_level_;
- lexer_ = 0;
+ clear ();
}
void
error_level_ = error_level_ | lexer_->error_level_;
}
+void
+Lily_parser::clear ()
+{
+ if (lexer_)
+ {
+ while (lexer_->has_scope ())
+ lexer_->remove_scope ();
+
+
+ }
+ lexer_ = 0;
+}
+
char const *
Lily_parser::here_str0 () const
{