/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 1997--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
main_input_level_ = 0;
extra_tokens_ = SCM_EOL;
- if (unsmob_input (override_input))
- override_input_ = *unsmob_input (override_input);
+ if (Input::is_smob (override_input))
+ override_input_ = *Input::unsmob (override_input);
smobify_self ();
}
int
-Lily_lexer::lookup_keyword (string s)
+Lily_lexer::lookup_keyword (const string &s)
{
return keytable_->lookup (s.c_str ());
}
}
SCM
-Lily_lexer::lookup_identifier (string name)
+Lily_lexer::lookup_identifier (const string &name)
{
return lookup_identifier_symbol (ly_symbol2scm (name.c_str ()));
}
}
void
-Lily_lexer::new_input (string str, string d, Sources *ss)
+Lily_lexer::new_input (const string &str, string d, Sources *ss)
{
Includable_lexer::new_input (str, d, ss);
}
void
-Lily_lexer::new_input (string str, Sources *ss)
+Lily_lexer::new_input (const string &str, Sources *ss)
{
if (is_main_input_ && be_safe_global)
{
char_count_stack_.back () += count;
}
-#include "ly-smobs.icc"
-IMPLEMENT_SMOBS (Lily_lexer);
-IMPLEMENT_TYPE_P (Lily_lexer, "ly:lily-lexer?");
-IMPLEMENT_DEFAULT_EQUAL_P (Lily_lexer);
+const char Lily_lexer::type_p_name_[] = "ly:lily-lexer?";
SCM
-Lily_lexer::mark_smob (SCM s)
+Lily_lexer::mark_smob ()
{
- ASSERT_LIVE_IS_ALLOWED (s);
-
- Lily_lexer *lexer = (Lily_lexer *) SCM_CELL_WORD_1 (s);
-
- scm_gc_mark (lexer->chordmodifier_tab_);
- if (lexer->parser_)
- scm_gc_mark (lexer->parser_->self_scm ());
- scm_gc_mark (lexer->pitchname_tab_stack_);
- scm_gc_mark (lexer->start_module_);
- scm_gc_mark (lexer->extra_tokens_);
- return lexer->scopes_;
+ ASSERT_LIVE_IS_ALLOWED (self_scm ());
+
+ scm_gc_mark (chordmodifier_tab_);
+ if (parser_)
+ scm_gc_mark (parser_->self_scm ());
+ scm_gc_mark (pitchname_tab_stack_);
+ scm_gc_mark (start_module_);
+ scm_gc_mark (extra_tokens_);
+ return scopes_;
}
int
-Lily_lexer::print_smob (SCM s, SCM port, scm_print_state *)
+Lily_lexer::print_smob (SCM port, scm_print_state *)
{
- Lily_lexer *lexer = Lily_lexer::unsmob (s);
-
scm_puts ("#<Lily_lexer ", port);
- scm_display (lexer->scopes_, port);
+ scm_display (scopes_, port);
scm_puts (" >", port);
return 1;
}