From: fred Date: Sun, 24 Mar 2002 19:34:03 +0000 (+0000) Subject: lilypond-0.0.38 X-Git-Tag: release/1.5.59~5259 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3b2f78fed770f8211fc04ab467eeb20e62a8ecfb;p=lilypond.git lilypond-0.0.38 --- diff --git a/hdr/identifier.hh b/hdr/identifier.hh index 0c9b252afa..1aa7f7d0c4 100644 --- a/hdr/identifier.hh +++ b/hdr/identifier.hh @@ -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); diff --git a/hdr/identparent.hh b/hdr/identparent.hh index da7ab7012c..3e6d566ee7 100644 --- a/hdr/identparent.hh +++ b/hdr/identparent.hh @@ -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 diff --git a/src/parser.y b/src/parser.y index b8b175ef1a..08ea828119 100644 --- a/src/parser.y +++ b/src/parser.y @@ -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 pre_reqs, post_reqs; Array 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)); }