From 5f9f6495d54cd061c30ed9d989620e416f26db6a Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 1 Nov 1996 12:50:17 +0000 Subject: [PATCH] lilypond-0.0.6 --- identifier.cc | 19 +++++++++---------- identifier.hh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 identifier.hh diff --git a/identifier.cc b/identifier.cc index 9eab42e114..94d48c8d74 100644 --- a/identifier.cc +++ b/identifier.cc @@ -1,22 +1,21 @@ #include -#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 index 0000000000..0510f181d1 --- /dev/null +++ b/identifier.hh @@ -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 + -- 2.39.5