]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/my-lily-parser.cc
release: 0.1.1
[lilypond.git] / lily / my-lily-parser.cc
index a4b7f13a8e25a7d075290b7c5e3333f727859aeb..5c14442745860ffb32fef0245173469b6d690165 100644 (file)
@@ -42,6 +42,7 @@ My_lily_parser::print_declarations()
 {
 #ifndef NPRINT
     String s = "";
+    
     if (init_parse_b_) 
        s = "Init";
     if (!monitor->silence(s+"Declarations") && check_debug) {
@@ -50,31 +51,25 @@ My_lily_parser::print_declarations()
 #endif   
 }
 
-void
-My_lily_parser::do_init_file()
-{
-    init_parse_b_ = true;
-    set_debug();
-    lexer_p_->new_input(init_str_, source_l_);
-}
-
 void
 My_lily_parser::parse_file(String init, String s)
 {
     lexer_p_ = new My_lily_lexer;
     init_str_ = init;
     
+    *mlog << "Parsing ... ";
     
+    init_parse_b_ = true;
+    lexer_p_->new_input( init, source_l_);
+    do_yyparse();
+    print_declarations();
 
-    *mlog << "Parsing ... ";
-    lexer_p_->new_input(s, source_l_);
-    if (!lexer_p_->source_file_l()) {
-       warning("Can not find toplevel file. Ignoring " + s);
-       return; 
-    }
+    init_parse_b_ = false;
+    lexer_p_->new_input( s , source_l_);
     do_yyparse();
     print_declarations();
 
+    
     if(!define_spot_array_.empty())
        warning("Braces don't match.");
 }
@@ -131,7 +126,7 @@ My_lily_parser::set_last_duration(Duration const *d)
 Chord*
 My_lily_parser::get_word_element(Text_def* tdef_p, Duration * duration_p)
 {
-    Chord* velt_p = new Voice_element;
+    Chord* velt_p = new Request_chord;
     
     Lyric_req* lreq_p = new Lyric_req(tdef_p);
 
@@ -147,7 +142,7 @@ My_lily_parser::get_word_element(Text_def* tdef_p, Duration * duration_p)
 Chord *
 My_lily_parser::get_rest_element(String s,  Duration * duration_p )
 {    
-    Chord* velt_p = new Voice_element;
+    Chord* velt_p = new Request_chord;
     velt_p->set_spot( here_input());
 
     if (s=="s") { /* Space */
@@ -176,7 +171,7 @@ My_lily_parser::get_rest_element(String s,  Duration * duration_p )
 Chord *
 My_lily_parser::get_note_element(Note_req *rq, Duration * duration_p )
 {
-    Chord*v = new Voice_element;
+    Chord*v = new Request_chord;
     v->set_spot( here_input());
 
     v->add(rq);