]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.6
authorfred <fred>
Fri, 1 Nov 1996 12:50:17 +0000 (12:50 +0000)
committerfred <fred>
Fri, 1 Nov 1996 12:50:17 +0000 (12:50 +0000)
identifier.cc
identifier.hh [new file with mode: 0644]

index 9eab42e114e57aef4e0901e5c13f4260955f7378..94d48c8d7455990c08e0a2a7265178c02120346d 100644 (file)
@@ -1,22 +1,21 @@
 #include <assert.h>
-#include "keyword.hh"
+#include "identifier.hh"
+#include "staff.hh"
 #include "lexer.hh"
 #include "parser.hh"
 
-Identifier::Identifier()
+Identifier::Identifier(String n)
+    :name  (n)
 {
     data = 0;
-    type = IDENTIFIER;
 }
 
 
 Identifier::~Identifier()
 {
-    if (!data)
-       return;
-    switch (type) {
-    case IDENTIFIER:
-    default:
-       assert(false);
-    }
+}
+
+Staff_id::~Staff_id()
+{
+    delete staff();
 }
diff --git a/identifier.hh b/identifier.hh
new file mode 100644 (file)
index 0000000..0510f18
--- /dev/null
@@ -0,0 +1,32 @@
+
+/*
+  identifier.hh -- part of LilyPond
+
+  (c) 1996 Han-Wen Nienhuys
+*/
+
+#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); }
+};
+
+struct Staff_id : Identifier {
+    Staff_id(String s, Staff*st):Identifier(s) { data = st; }
+    virtual Staff* staff() { return (Staff*) data; }
+    ~Staff_id();
+};
+
+
+
+#endif // IDENTIFIER_HH
+