]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.21
authorfred <fred>
Sun, 24 Mar 2002 19:27:03 +0000 (19:27 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:27:03 +0000 (19:27 +0000)
hdr/identparent.hh
hdr/lexer.hh

index addfd26e0befe479548e569e0e24263715992296..653158da4d90d43f717b0e50bb43ab056746ceb2 100644 (file)
@@ -9,23 +9,25 @@
 
 #include "proto.hh"
 #include "string.hh"
+#define IDACCESSOR( Input_staff, staff)\
+    virtual Input_staff * staff(bool = false) { error(#Input_staff); return 0; }
 
-struct Identifier
-{
+struct Identifier {
     void *data;
     String name;
     
     Identifier(String n) : name(n) { }
     virtual ~Identifier() {}
     virtual const char*classname() { return "new Identifier"; }
-    void error();
-    virtual Input_staff * staff(bool = false) { error(); return 0; }
-    virtual Input_music *music(bool = false) { error(); return 0; }
-    virtual Music_voice *mvoice(bool = false) { error(); return 0; }
-    virtual Symtables *symtables(bool = false) { error(); return 0; }
-    virtual Music_general_chord *mchord(bool = false) { error(); return 0; }
-    virtual Lookup*lookup(bool = false) { error(); return 0; }
-    virtual Notename_tab*notename_tab(bool = false) { error(); return 0; }
+    void error(String);
+    IDACCESSOR(Input_staff, staff)
+    IDACCESSOR(Input_music, music)
+    IDACCESSOR(Music_voice, mvoice)
+    IDACCESSOR(Script_def, script)     
+    IDACCESSOR(Symtables, symtables)
+    IDACCESSOR(Music_general_chord, mchord)
+    IDACCESSOR(Lookup,lookup)
+    IDACCESSOR(Notename_tab, notename_tab)
 };
 #endif // IDENTPARENT_HH
 
index 239b7bbe0b979c36bfdb036efaaa99b86ea0298e..767a12c95efdb18db69d31defb73cd76c34044e5 100644 (file)
@@ -33,7 +33,7 @@ struct My_flex_lexer : yyFlexLexer {
     /****************/
     
     void set(Notename_tab *n);
-    int     lookup_keyword(String);
+    int lookup_keyword(String);
     void lookup_notename(int &large, int &small, String s);
     void LexerError(const char *);
     Identifier*lookup_identifier(String s);