lilypond-0.0.39
[lilypond.git] / lily / include / identparent.hh
blob3e6d566ee7c431338ce35f977ca9ebf02065ee39
1 /*
2 identparent.hh -- part of LilyPond
4 (c) 1996,97 Han-Wen Nienhuys
5 */
7 #ifndef IDENTPARENT_HH
8 #define IDENTPARENT_HH
10 #include "proto.hh"
11 #include "string.hh"
13 /* boolean argument to accesor is copy_b..*/
14 #define IDACCESSOR( Input_staff, staff)\
15 virtual Input_staff * staff(bool) { error(#Input_staff); return 0; }
17 struct Identifier {
18 void *data;
19 String name;
21 Identifier(String n) : name(n) { }
22 virtual ~Identifier() {}
24 void print()const;
25 virtual const char*classname() { return "new Identifier"; }
26 void error(String);
27 IDACCESSOR(Input_staff, staff)
28 IDACCESSOR(Input_music, music)
29 IDACCESSOR(Music_voice, mvoice)
30 IDACCESSOR(Script_def, script)
31 IDACCESSOR(Symtables, symtables)
32 IDACCESSOR(Music_general_chord, mchord)
33 IDACCESSOR(Lookup,lookup)
34 IDACCESSOR(Real,real)
35 IDACCESSOR(Notename_tab, notename_tab)
36 protected:
37 virtual void do_print()const=0;
38 private:
39 Identifier(Identifier const&){}
42 #endif // IDENTPARENT_HH