]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/identparent.hh
release: 0.0.40
[lilypond.git] / lily / include / identparent.hh
1 /*
2   identparent.hh -- part of LilyPond
3
4   (c) 1996,97 Han-Wen Nienhuys
5 */
6
7 #ifndef IDENTPARENT_HH
8 #define IDENTPARENT_HH
9
10 #include "proto.hh"
11 #include "string.hh"
12
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; }
16
17
18 struct Identifier {
19     void *data;
20     String name;
21     int token_code_i_;
22     
23     Identifier(String n, int code) : name(n) { token_code_i_ = code; }
24     virtual ~Identifier() {}
25
26     void print()const;
27     virtual const char*classname() { return "new Identifier"; }
28     void error(String);
29     IDACCESSOR(Input_staff, staff)
30     IDACCESSOR(Input_music, music)
31     IDACCESSOR(Music_voice, mvoice)
32     IDACCESSOR(Script_def, script)      
33     IDACCESSOR(Symtables, symtables)
34     IDACCESSOR(Music_general_chord, mchord)
35     IDACCESSOR(Lookup,lookup)
36     IDACCESSOR(Real,real)
37     IDACCESSOR(Notename_tab, notename_tab)
38     IDACCESSOR(Request, request)
39         
40 protected:
41     virtual void do_print()const=0;
42 private:
43     Identifier(Identifier const&){}
44     
45 };
46 #endif // IDENTPARENT_HH
47
48
49