#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();
}
--- /dev/null
+
+/*
+ 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
+