From c7cfd843900d21f3ef780f15d9c568b4214f5694 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:29:44 +0000 Subject: [PATCH] lilypond-0.0.38 --- src/identifier.cc | 45 ++++++++++++++++++++++++++++++++++++++++++++- src/symbol.cc | 5 +++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/identifier.cc b/src/identifier.cc index d55c3fc4e4..59f1ff5d83 100644 --- a/src/identifier.cc +++ b/src/identifier.cc @@ -1,6 +1,14 @@ +/* + identifier.cc -- implement identifier and derived classes + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + #include -#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"; +} diff --git a/src/symbol.cc b/src/symbol.cc index 01b235679b..becdf1e29f 100644 --- a/src/symbol.cc +++ b/src/symbol.cc @@ -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() + "))"; +} -- 2.39.5