]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.14
authorfred <fred>
Mon, 2 Dec 1996 22:44:48 +0000 (22:44 +0000)
committerfred <fred>
Mon, 2 Dec 1996 22:44:48 +0000 (22:44 +0000)
hdr/identifier.hh
hdr/identparent.hh [new file with mode: 0644]
src/table.cc

index f1d99678d9ab7499614bfe04b0af2ccbb89c4de3..c5d7a5b5b729a858057181ba594a407f940e0245 100644 (file)
@@ -7,30 +7,21 @@
 
 #ifndef IDENTIFIER_HH
 #define IDENTIFIER_HH
-#include "proto.hh"
-#include "string.hh"
-
-struct Identifier
-{
-    void *data;
-    String name;
-    
-    Identifier(String n) ;
-    virtual ~Identifier();
-    virtual Staff * staff() { assert(false); }
-    virtual Voice_list * voices() { assert(false); }
-};
-
-struct Staff_id : Identifier {
-    Staff_id(String s, Staff*st):Identifier(s) { data = st; }
-    virtual Staff* staff() { return (Staff*) data; }
-    ~Staff_id();
-};
-
-struct Voices_id : Identifier {
-    Voices_id(String s, Voice_list*st):Identifier(s) { data = st; }
-    virtual Voice_list * voices() { return (Voice_list*)data; }
-    ~Voices_id();
-};
+#include "identparent.hh"
+#include "inputstaff.hh"
+#include "inputmusic.hh"
+
+#define make_id_class(Idclass, Class, accessor)        \
+struct Idclass : Identifier {\
+    Idclass(String s, Class*st):Identifier(s) { data = st; }\
+    virtual Class* accessor() { return (Class*) data; }\
+    ~Idclass() { delete accessor(); }\
+}\
+
+
+make_id_class(Staff_id, Input_staff, staff);
+make_id_class(M_chord_id, Music_general_chord, mchord);
+make_id_class(M_voice_id, Music_voice, mvoice);
+
 #endif // IDENTIFIER_HH
 
diff --git a/hdr/identparent.hh b/hdr/identparent.hh
new file mode 100644 (file)
index 0000000..d8d3cb1
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+  identparent.hh -- part of LilyPond
+
+  (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef IDENTPARENT_HH
+#define IDENTPARENT_HH
+
+#include "proto.hh"
+#include "string.hh"
+
+struct Identifier
+{
+    void *data;
+    String name;
+    
+    Identifier(String n) : name(n) { }
+    virtual ~Identifier() {}
+    virtual Input_staff * staff() { assert(false); }
+    virtual Voice_list * voices() { assert(false); }
+    virtual Horizontal_music*hmusic() { assert(false); }
+    virtual Vertical_music*vmusic() { assert(false); }
+    virtual Music_voice *mvoice() { assert(false); }
+    virtual Music_general_chord *mchord() { assert(false); }    
+};
+#endif // IDENTPARENT_HH
+
+
+
index 7a54241f9f7b0a627bd19c7811b390ee1f8a89d3..cfb0db0cb9ab8cd6fce8acd2a52bcc274e3ba697 100644 (file)
@@ -1,7 +1,8 @@
 #include "glob.hh"
 #include "debug.hh"
 #include "string.hh"
-#include "identifier.hh"
+#include "inputstaff.hh"
+#include "identparent.hh"
 #include "keyword.hh"
 #include "associter.hh"
 #include "parser.hh"
@@ -16,7 +17,7 @@ static Keyword_ent the_key_tab[]={
     "geometric", GEOMETRIC,
     "in", IN,
     "key", KEY, 
-    "melodicstaff", MELODICSTAFF,
+    "melodic", MELODIC,
     "meter", METER,
     "mm", MM,
     "octave", OCTAVECOMMAND,
@@ -24,7 +25,7 @@ static Keyword_ent the_key_tab[]={
     "partial", PARTIAL,
     "paper", PAPER,
     "pt", PT,
-    "rhythmstaff", RHYTHMSTAFF,
+    "rhythmic", RHYTHMIC,
     "score", SCORE,
     "skip", SKIP,
     "staff", STAFF,
@@ -36,9 +37,10 @@ static Keyword_ent the_key_tab[]={
     "violin", VIOLIN,
     "voice", VOICE,
     "voices", VOICES,
-    "width", WIDTH,   
+    "width", WIDTH,
+    "music", MUSIC,
     0,0
-} ;
+};
 
 
 int