2 identifier.cc -- implement identifier and derived classes
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
11 #include "identifier.hh"
16 Identifier::error(String expect)
18 String e("Wrong identifier type: ");
19 e += String(classname()) + "(expected " + expect + ")";
24 Identifier::print()const
26 mtor << "identifier \'" << name << "\'=";
31 #define DEFAULT_PRINT(Class, Content_type, accessor) \
33 Class::do_print() const { \
34 ((Class*)this)->accessor(false)->print(); \
38 DEFAULT_PRINT(Script_id, Script_def, script);
39 DEFAULT_PRINT(Lookup_id, Lookup, lookup);
40 DEFAULT_PRINT(Symtables_id, Symtables, symtables);
41 DEFAULT_PRINT(Staff_id, Input_staff, staff);
42 DEFAULT_PRINT(M_chord_id, Music_general_chord, mchord);
43 DEFAULT_PRINT(M_voice_id, Music_voice, mvoice);
44 DEFAULT_PRINT(Request_id, Request, request);
46 Real_id::do_print() const
49 mtor << *((Real_id*)this)->real(false)<< "\n";
53 Notetab_id::do_print() const
55 mtor << "unknown" << "\n";