2 identifier.hh -- part of GNU LilyPond
4 (c) 1996--2000 Han-Wen Nienhuys
10 #include "lily-proto.hh"
11 #include "lily-guile.hh"
14 #include "virtual-methods.hh"
18 #define DECLARE_TYPE_NAME(Class)
20 class Translator_group_identifier;
21 class Music_identifier;
22 class Articulation_req_identifier;
23 class Midi_def_identifier;
24 class Paper_def_identifier;
25 class Real_identifier;
27 class String_identifier;
28 class Request_identifier;
29 class Score_identifier;
30 class Duration_identifier;
34 #define IDACCESSOR(Class)\
35 virtual Class * access_content_ ## Class (bool) const { error (#Class + String ("_identifier")); return 0; }\
39 A declarable data structure in mudela.
41 TODO: use SMOBS for the union type, and junk all derived classes.
43 struct Identifier : public Input {
49 Identifier (Identifier const&);
50 Identifier (int code) ;
51 virtual ~Identifier() ;
56 void error (String) const;
58 IDACCESSOR(Translator_group)
68 VIRTUAL_COPY_CONS(Identifier);
71 virtual void do_print () const;
72 virtual String do_str () const;
75 #define DECLARE_ID_CLASS(Class) \
76 struct Class ## _identifier : Identifier {\
79 Class ## _identifier (Class ## _identifier const&);\
80 Class ## _identifier (Class*st, int code);\
81 VIRTUAL_COPY_CONS(Identifier);\
82 virtual Class* access_content_ ## Class (bool copy_b) const;\
83 ~Class ## _identifier();\
84 virtual void do_print () const; \
85 virtual String do_str () const; \
89 DECLARE_ID_CLASS(Translator_group);
90 DECLARE_ID_CLASS(Duration);
91 DECLARE_ID_CLASS(Real);
92 DECLARE_ID_CLASS(String);
93 DECLARE_ID_CLASS(General_script_def);
94 DECLARE_ID_CLASS(Music);
95 DECLARE_ID_CLASS(int);
96 DECLARE_ID_CLASS(Score);
97 DECLARE_ID_CLASS(Request);
98 DECLARE_ID_CLASS(Paper_def);
99 DECLARE_ID_CLASS(Midi_def);
101 Identifier * unsmob_identifier (SCM);
102 SCM smobify (Identifier*);
104 #endif // IDENTIFIER_HH