]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/identifier.cc
release: 1.3.8
[lilypond.git] / lily / identifier.cc
index bf9205579f4a742c7be2029ec37a7ab557e3d9dc..e8421fb70db9a435634d3c2fc5f5b6730dbe9cdc 100644 (file)
@@ -13,9 +13,8 @@
 #include "identifier.hh"
 #include "my-lily-lexer.hh"
 #include "debug.hh"
-#include "script-def.hh"
 #include "request.hh"
-#include "translator.hh"
+#include "translator-group.hh"
 #include "notename-table.hh"
 
 
@@ -44,9 +43,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
@@ -64,7 +61,7 @@ Identifier::do_str () const
 void
 Identifier::print () const
 {
-  DOUT << "identifier ";
+  DEBUG_OUT << "identifier ";
   do_print ();
 }
 void
@@ -82,8 +79,7 @@ Class ## _identifier::do_print () const { \
 
 
 
-DEFAULT_PRINT(General_script_def);
-DEFAULT_PRINT(Translator);
+DEFAULT_PRINT(Translator_group);
 DEFAULT_PRINT(Music);
 DEFAULT_PRINT(Request);
 DEFAULT_PRINT(Score);
@@ -99,8 +95,7 @@ Class ## _identifier::do_str () const { \
 
 
 DUMMY_STR(Notename_table);
-DUMMY_STR(General_script_def);
-DUMMY_STR(Translator);
+DUMMY_STR(Translator_group);
 DUMMY_STR(Music);
 DUMMY_STR(Request);
 DUMMY_STR(Score);
@@ -112,7 +107,7 @@ DUMMY_STR(Duration);
 void \
 Class ## _identifier::do_print () const\
 {\
-  DOUT << do_str () << '\n';\
+  DEBUG_OUT << do_str () << '\n';\
 }\
 
 
@@ -149,7 +144,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<Class*> (data_p_->clone()) : data_p_;\
 }
 
 #define IMPLEMENT_ID_CLASS(Class)      \
@@ -167,11 +162,10 @@ Class ## _identifier::Class ## _identifier (Class ## _identifier const &s) \
 
 
 IMPLEMENT_ID_CLASS(Duration);
-IMPLEMENT_ID_CLASS(Translator);
+IMPLEMENT_ID_CLASS(Translator_group);
 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);
@@ -180,8 +174,7 @@ IMPLEMENT_ID_CLASS(Paper_def);
 IMPLEMENT_ID_CLASS(Notename_table);
 VIRTUAL_ACCESSOR(Music);
 VIRTUAL_ACCESSOR(Request);
-VIRTUAL_ACCESSOR(Translator);
-VIRTUAL_ACCESSOR(General_script_def);
+VIRTUAL_ACCESSOR(Translator_group);
 DEFAULT_ACCESSOR(Notename_table);
 DEFAULT_ACCESSOR(Duration);
 DEFAULT_ACCESSOR(int);