X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fidentifier.cc;h=d46460f71b03306f8d23fe4a82a8cd272993cc5c;hb=c5402461ab1d1cdbaa684b0e55d4851f0e28e37a;hp=bf9205579f4a742c7be2029ec37a7ab557e3d9dc;hpb=8aad615ea7bb31f49a0c2afc21eea5ff5de20437;p=lilypond.git diff --git a/lily/identifier.cc b/lily/identifier.cc index bf9205579f..d46460f71b 100644 --- a/lily/identifier.cc +++ b/lily/identifier.cc @@ -3,38 +3,40 @@ source file of the GNU LilyPond music typesetter - (c) 1997--1999 Han-Wen Nienhuys + (c) 1997--2000 Han-Wen Nienhuys */ + +/* + JUNKTHIS! + */ #include -#include "midi-def.hh" -#include "paper-def.hh" + +#include "music-output-def.hh" #include "score.hh" #include "identifier.hh" #include "my-lily-lexer.hh" #include "debug.hh" -#include "script-def.hh" -#include "request.hh" -#include "translator.hh" -#include "notename-table.hh" +#include "ly-smobs.icc" +IMPLEMENT_UNSMOB(Identifier, identifier); +IMPLEMENT_SMOBS(Identifier); +IMPLEMENT_DEFAULT_EQUAL_P(Identifier); Identifier::Identifier (int code) { token_code_i_ = code; accessed_b_ = 0; - init_b_ = 0; + smobify_self (); } - - Identifier::Identifier (Identifier const&s) : Input (s) { + smobify_self (); token_code_i_ = s.token_code_i_; accessed_b_ = s.accessed_b_; - init_b_ = s.init_b_; } Identifier::~Identifier() @@ -44,9 +46,7 @@ Identifier::~Identifier() void Identifier::error (String expect) const { - String e (_("Wrong identifier type: ")); - e += _f ("%s expected", expect); - ::error (e); + ::error (_f ("wrong identifier type, expected: `%s'", expect)); } String @@ -61,34 +61,6 @@ Identifier::do_str () const return ""; } -void -Identifier::print () const -{ - DOUT << "identifier "; - do_print (); -} -void -Identifier::do_print () const -{ -} - -/* ugh. */ -#define DEFAULT_PRINT(Class) \ -void \ -Class ## _identifier::do_print () const { \ - Class *cl = ((Class ## _identifier *)this)->access_content_ ## Class(false);\ - cl->print (); \ -} - - - -DEFAULT_PRINT(General_script_def); -DEFAULT_PRINT(Translator); -DEFAULT_PRINT(Music); -DEFAULT_PRINT(Request); -DEFAULT_PRINT(Score); -DEFAULT_PRINT(Midi_def); -DEFAULT_PRINT(Paper_def); /* ugh. */ #define DUMMY_STR(Class) \ @@ -97,30 +69,10 @@ Class ## _identifier::do_str () const { \ return String (#Class); \ } - -DUMMY_STR(Notename_table); -DUMMY_STR(General_script_def); -DUMMY_STR(Translator); -DUMMY_STR(Music); -DUMMY_STR(Request); DUMMY_STR(Score); -DUMMY_STR(Midi_def); -DUMMY_STR(Paper_def); +DUMMY_STR(Music_output_def); DUMMY_STR(Duration); -#define STRING_PRINT(Class) \ -void \ -Class ## _identifier::do_print () const\ -{\ - DOUT << do_str () << '\n';\ -}\ - - -STRING_PRINT(Duration); -STRING_PRINT(Real); -STRING_PRINT(int); -STRING_PRINT(String); -STRING_PRINT(Notename_table); #define DEFAULT_STR(Class) \ String \ @@ -129,9 +81,6 @@ Class ## _identifier::do_str () const\ return to_str (*data_p_);\ } -DEFAULT_STR(int); -DEFAULT_STR(Real); -DEFAULT_STR(String); /* @@ -149,7 +98,7 @@ Class ## _identifier::access_content_ ## Class (bool copy_b) const {\ Class*\ Class ## _identifier::access_content_ ## Class (bool copy_b) const{\ ((Class ## _identifier*)this)->accessed_b_ = true;\ - return copy_b ? (Class*)data_p_->clone() : data_p_;\ + return copy_b ? dynamic_cast (data_p_->clone()) : data_p_;\ } #define IMPLEMENT_ID_CLASS(Class) \ @@ -167,27 +116,24 @@ Class ## _identifier::Class ## _identifier (Class ## _identifier const &s) \ IMPLEMENT_ID_CLASS(Duration); -IMPLEMENT_ID_CLASS(Translator); -IMPLEMENT_ID_CLASS(int); -IMPLEMENT_ID_CLASS(Real); -IMPLEMENT_ID_CLASS(String); -IMPLEMENT_ID_CLASS(General_script_def); -IMPLEMENT_ID_CLASS(Music); IMPLEMENT_ID_CLASS(Score); -IMPLEMENT_ID_CLASS(Request); -IMPLEMENT_ID_CLASS(Midi_def); -IMPLEMENT_ID_CLASS(Paper_def); -IMPLEMENT_ID_CLASS(Notename_table); -VIRTUAL_ACCESSOR(Music); -VIRTUAL_ACCESSOR(Request); -VIRTUAL_ACCESSOR(Translator); -VIRTUAL_ACCESSOR(General_script_def); -DEFAULT_ACCESSOR(Notename_table); +IMPLEMENT_ID_CLASS(Music_output_def); +VIRTUAL_ACCESSOR(Music_output_def); DEFAULT_ACCESSOR(Duration); -DEFAULT_ACCESSOR(int); -DEFAULT_ACCESSOR(Real); -DEFAULT_ACCESSOR(String); DEFAULT_ACCESSOR(Score); -DEFAULT_ACCESSOR(Midi_def); -DEFAULT_ACCESSOR(Paper_def); + + +int +Identifier::print_smob (SCM s, SCM p, scm_print_state*) +{ + return 1; +} + +SCM +Identifier::mark_smob (SCM s) +{ + return SCM_EOL; +} + +