source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+
+/*
+ JUNKTHIS!
+ */
#include <assert.h>
-#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 "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()
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
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(Translator);
-DEFAULT_PRINT(Music);
-DEFAULT_PRINT(Request);
-DEFAULT_PRINT(Score);
-DEFAULT_PRINT(Midi_def);
-DEFAULT_PRINT(Paper_def);
/* ugh. */
#define DUMMY_STR(Class) \
return String (#Class); \
}
-
-DUMMY_STR(Notename_table);
-DUMMY_STR(Translator);
-DUMMY_STR(Music);
-DUMMY_STR(Request);
DUMMY_STR(Score);
-DUMMY_STR(Midi_def);
-DUMMY_STR(Paper_def);
-DUMMY_STR(Duration);
-
-#define STRING_PRINT(Class) \
-void \
-Class ## _identifier::do_print () const\
-{\
- DOUT << do_str () << '\n';\
-}\
-
+DUMMY_STR(Music_output_def);
-STRING_PRINT(Duration);
-STRING_PRINT(Real);
-STRING_PRINT(int);
-STRING_PRINT(String);
-STRING_PRINT(Notename_table);
#define DEFAULT_STR(Class) \
String \
return to_str (*data_p_);\
}
-DEFAULT_STR(int);
-DEFAULT_STR(Real);
-DEFAULT_STR(String);
/*
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<Class*> (data_p_->clone()) : data_p_;\
}
#define IMPLEMENT_ID_CLASS(Class) \
}
-IMPLEMENT_ID_CLASS(Duration);
-IMPLEMENT_ID_CLASS(Translator);
-IMPLEMENT_ID_CLASS(int);
-IMPLEMENT_ID_CLASS(Real);
-IMPLEMENT_ID_CLASS(String);
-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);
-DEFAULT_ACCESSOR(Notename_table);
-DEFAULT_ACCESSOR(Duration);
-DEFAULT_ACCESSOR(int);
-DEFAULT_ACCESSOR(Real);
-DEFAULT_ACCESSOR(String);
+IMPLEMENT_ID_CLASS(Music_output_def);
+VIRTUAL_ACCESSOR(Music_output_def);
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;
+}
+
+