]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.38
authorfred <fred>
Sun, 24 Mar 2002 19:29:44 +0000 (19:29 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:29:44 +0000 (19:29 +0000)
src/identifier.cc
src/symbol.cc

index d55c3fc4e42da7f0611f615609334e03dca9cb8e..59f1ff5d83c0cfdc288728f995b74d11e3c066d3 100644 (file)
@@ -1,6 +1,14 @@
+/*
+  identifier.cc -- implement identifier and derived classes
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include <assert.h>
 
-#include "identparent.hh"
+#include "identifier.hh"
 #include "lexer.hh"
 #include "debug.hh"
 
@@ -11,3 +19,38 @@ Identifier::error(String expect)
     e += String(classname()) + "(expected " + expect + ")";
     ::error(e);
 }
+
+void
+Identifier::print()const
+{
+    mtor << "identifier \'" << name << "\'=";
+    do_print();
+}
+
+/* ugh. */
+#define DEFAULT_PRINT(Class, Content_type, accessor) \
+void \
+Class::do_print() const { \
+    ((Class*)this)->accessor(false)->print(); \
+} \
+class Class
+
+DEFAULT_PRINT(Script_id, Script_def, script);
+DEFAULT_PRINT(Lookup_id, Lookup, lookup);
+DEFAULT_PRINT(Symtables_id, Symtables, symtables);
+DEFAULT_PRINT(Staff_id, Input_staff, staff);
+DEFAULT_PRINT(M_chord_id, Music_general_chord, mchord);
+DEFAULT_PRINT(M_voice_id, Music_voice, mvoice);
+
+void
+Real_id::do_print() const
+{
+    Identifier::print();
+    mtor << *((Real_id*)this)->real(false)<< "\n";
+}
+
+void
+Notetab_id::do_print() const
+{
+    mtor << "unknown" << "\n";
+}
index 01b235679b7016b5cd18932629b5135c6000ec97..becdf1e29f63862f2f73a7a6daf7c79b16ccf921 100644 (file)
@@ -14,3 +14,8 @@ Symbol::Symbol(String s, Box b)
 }
 
 
+String
+Symbol::str()const return s;
+{
+    s = "symbol(\'"+tex+"\', (" + dim.x.str() + ", " + dim.y.str() + "))";
+}