]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.38
authorfred <fred>
Sun, 24 Mar 2002 19:34:03 +0000 (19:34 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:34:03 +0000 (19:34 +0000)
hdr/identifier.hh
hdr/identparent.hh
src/parser.y

index 0c9b252afa3eeed26ab48bdd8aa36c11da5a5729..1aa7f7d0c4982c12ea3feec1387c78d2532a49ae 100644 (file)
@@ -9,11 +9,11 @@
 #define IDENTIFIER_HH
 #include "identparent.hh"
 #include "symtable.hh"
-#include "inputstaff.hh"
-#include "inputmusic.hh"
+#include "input-staff.hh"
+#include "input-music.hh"
 #include "notename.hh"
 #include "lookup.hh"
-#include "scriptdef.hh"
+#include "script-def.hh"
 
 #define make_id_class(Idclass, Class, accessor)        \
 struct Idclass : Identifier {\
@@ -26,6 +26,7 @@ struct Idclass : Identifier {\
            return (Class*) data;\
     }\
     ~Idclass() { delete accessor(false); }\
+    virtual void do_print()const; \
 }\
 
 make_id_class(Real_id, Real, real);
index da7ab7012cb88ece848d2dbb1c2e64ccbf99ddbf..3e6d566ee7c431338ce35f977ca9ebf02065ee39 100644 (file)
@@ -20,6 +20,8 @@ struct Identifier {
     
     Identifier(String n) : name(n) { }
     virtual ~Identifier() {}
+
+    void print()const;
     virtual const char*classname() { return "new Identifier"; }
     void error(String);
     IDACCESSOR(Input_staff, staff)
@@ -31,8 +33,11 @@ struct Identifier {
     IDACCESSOR(Lookup,lookup)
     IDACCESSOR(Real,real)
     IDACCESSOR(Notename_tab, notename_tab)
+protected:
+    virtual void do_print()const=0;
 private:
     Identifier(Identifier const&){}
+    
 };
 #endif // IDENTPARENT_HH
 
index b8b175ef1a5f30cf9710bf374a6982e2d34bf45e..08ea828119f561caeef6e0c0943468f8623ba86a 100644 (file)
@@ -4,9 +4,9 @@
 #include "lookup.hh"
 #include "misc.hh"
 #include "lexer.hh"
-#include "paperdef.hh"
-#include "mididef.hh"
-#include "inputscore.hh"
+#include "paper-def.hh"
+#include "midi-def.hh"
+#include "input-score.hh"
 #include "main.hh"
 #include "keyword.hh"
 #include "debug.hh"
@@ -15,6 +15,7 @@
 #include "identifier.hh"
 #include "commandrequest.hh"
 #include "musicalrequest.hh"
+#include "voice-element.hh"
 
 #ifndef NDEBUG
 #define YYDEBUG 1
@@ -22,7 +23,7 @@
 
 Array<Request*> pre_reqs, post_reqs;
 Array<const char *> define_spots;
-Paperdef*default_paper();
+Paper_def*default_paper();
 char const* defined_ch_c_l;
 char const* req_defined_ch_c_l;
 int fatal_error_i = 0;
@@ -38,7 +39,7 @@ int fatal_error_i = 0;
     Voice_element *el; 
     String *string;
     const char *consstr;
-    Paperdef *paper;
+    Paper_def *paper;
     Midi_def* midi;
     Input_music *music;
     Music_general_chord *chord;
@@ -795,15 +796,19 @@ parse_file(String init, String s)
    *mlog << "Parsing ... ";
    lexer = new My_flex_lexer;
 
-#ifdef YYDEBUG
+#ifndef NDEBUG
    yydebug = !monitor->silence("InitParser") && check_debug;
    lexer->set_debug( !monitor->silence("InitLexer") && check_debug);
 #endif
 
    lexer->new_input(init);
+
    yyparse();
 
-#ifdef YYDEBUG
+#ifndef NDEBUG
+   if (check_debug && !monitor->silence("InitDeclarations"))
+       lexer->print_declarations();
+
    yydebug = !monitor->silence("Parser") && check_debug;
    lexer->set_debug( !monitor->silence("Lexer") && check_debug);
 #endif
@@ -817,10 +822,10 @@ parse_file(String init, String s)
        warning("Braces don't match.",0);
 }
 
-Paperdef*
+Paper_def*
 default_paper()
 {
-    return new Paperdef(
+    return new Paper_def(
        lexer->lookup_identifier("default_table")->lookup(true));
 }