From: fred Date: Sun, 24 Mar 2002 19:46:38 +0000 (+0000) Subject: lilypond-0.0.71pre X-Git-Tag: release/1.5.59~4537 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b87e5abb6f11361327e72b772dda647781c161d8;p=lilypond.git lilypond-0.0.71pre --- diff --git a/lily/parser.y b/lily/parser.y index 1beab2956e..cf4b75c8c2 100644 --- a/lily/parser.y +++ b/lily/parser.y @@ -79,17 +79,13 @@ yylex(YYSTYPE *s, void * v_l) My_lily_parser *pars_l = (My_lily_parser*) v_l; My_lily_lexer * lex_l = pars_l->lexer_p_; - if (pars_l->first_b_) { - pars_l->first_b_ = false; - pars_l->do_init_file(); - } - lex_l->lexval_l = (void*) s; return lex_l->yylex(); } %} + %pure_parser /* tokens which are not keywords */ @@ -189,7 +185,7 @@ yylex(YYSTYPE *s, void * v_l) %type pitch_list %type midi_block midi_body %type duration_length -%type init_melodic init_lyrics init_music + %type Music transposed_music %type Voice Voice_body %type Chord Chord_body @@ -220,16 +216,9 @@ mudela: /* empty */ | mudela error | mudela check_version { } | mudela add_notenames { } - | mudela init_end {} | mudela input_register_spec { add_global_input_register($2); } ; -init_end: INIT_END ';' { - THIS->print_declarations(); - THIS->init_parse_b_ = false; - THIS->set_debug(); - } - ; check_version: VERSION STRING ';' { if (*$2 != MUDELA_VERSION) { @@ -299,7 +288,7 @@ declaration: $$ = new Script_id(*$1, $3, SCRIPT_IDENTIFIER); delete $1; } - | declarable_identifier '=' init_music { + | declarable_identifier '=' Music { $$ = new Music_id(*$1, $3, MUSIC_IDENTIFIER); delete $1; } @@ -370,7 +359,7 @@ score_body: { | SCORE_IDENTIFIER { $$ = $1->score(true); } - | score_body init_music { + | score_body Music { $$->music_p_ = $2; } | score_body paper_block { @@ -443,27 +432,6 @@ midi_body: { -/* - let the lexer switch mode. -*/ -init_music: - init_melodic { $$ = $1; } - | init_lyrics { $$ = $1; } - ; - -init_lyrics: - LYRIC - { THIS->lexer_p_->push_lyric_state(); } - Music - { $$ = $3; THIS->lexer_p_->pop_state(); } - ; - -init_melodic: - MELODIC - { THIS->lexer_p_->push_note_state(); } - Music - { $$=$3; THIS->lexer_p_->pop_state(); } - ; /* MUSIC @@ -497,6 +465,15 @@ Music: | Chord { $$ = $1; } | transposed_music { $$ = $1; } | MUSIC_IDENTIFIER { $$ = $1->music(true); } + | MELODIC + { THIS->lexer_p_->push_note_state(); } + Music + { $$=$3; THIS->lexer_p_->pop_state(); } + + | LYRIC + { THIS->lexer_p_->push_lyric_state(); } + Music + { $$ = $3; THIS->lexer_p_->pop_state(); } ; Chord: