From: fred Date: Sun, 24 Mar 2002 19:38:36 +0000 (+0000) Subject: lilypond-0.0.49 X-Git-Tag: release/1.5.59~4997 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=352f7e18ca57a2e1ad3f5befc89a37c0a4916a8a;p=lilypond.git lilypond-0.0.49 --- diff --git a/lily/include/my-lily-lexer.hh b/lily/include/my-lily-lexer.hh index 8dbc42e861..f69b7e0fb4 100644 --- a/lily/include/my-lily-lexer.hh +++ b/lily/include/my-lily-lexer.hh @@ -11,6 +11,7 @@ #include +#include "lily-proto.hh" #include "proto.hh" #include "fproto.hh" #include "varray.hh" @@ -26,23 +27,23 @@ void set_lexer(); /// lexer for Mudela class My_lily_lexer : public Includable_lexer { int lookup_keyword(String); - void lookup_notename(int &large, int &small, String s); int scan_bare_word(String); int scan_escaped_word(String); bool post_quotes_b_; public: - void * lexval_l; - + void * lexval_l; + Notename_table *note_tab_p_; Assoc *identifier_assoc_p_; Keyword_table * keytable_p_; int errorlevel_i_; /* *************** */ + void clear_notenames(); Identifier*lookup_identifier(String s); - + Melodic_req* lookup_melodic_req_l(String s); void push_note_state(); void push_lyric_state(); void pop_state(); @@ -52,7 +53,7 @@ public: ~My_lily_lexer(); int yylex(); void print_declarations(bool init_b) const; - + void add_notename(String, Melodic_req*); bool note_state_b() const; bool lyric_state_b() const; }; diff --git a/lily/include/my-lily-parser.hh b/lily/include/my-lily-parser.hh index 2eef0929a4..1da7940b69 100644 --- a/lily/include/my-lily-parser.hh +++ b/lily/include/my-lily-parser.hh @@ -1,5 +1,5 @@ /* - my-lily-parser.hh -- declare + my-lily-parser.hh -- declare My_lily_parser source file of the LilyPond music typesetter @@ -32,15 +32,13 @@ class My_lily_parser { Voice_element* get_word_element(Text_def*, Duration*); void set_last_duration(Duration const *); void set_duration_mode(String s); -public: friend int yyparse( void*); - +public: int default_octave_i_; Duration default_duration_; String textstyle_str_; bool last_duration_mode ; - Array pre_reqs, post_reqs; int fatal_error_i_; Sources * source_l_; @@ -49,6 +47,7 @@ public: My_lily_lexer * lexer_p_; Moment plet_mom(); + void add_notename(String, Melodic_req* req_p); Input here_input()const; void remember_spot(); Input pop_spot(); @@ -56,6 +55,7 @@ public: Paper_def*default_paper(); void do_yyparse(); void parser_error(String); + void clear_notenames(); Request* get_parens_request(char c); diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index 0463a9d077..b46d6dd1a0 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -13,6 +13,13 @@ #include "voice-element.hh" #include "musical-request.hh" #include "command-request.hh" +#include "parser.hh" + +void +My_lily_parser::clear_notenames() +{ + lexer_p_->clear_notenames(); +} void My_lily_parser::set_debug() @@ -81,8 +88,7 @@ My_lily_parser::here_ch_C()const void My_lily_parser::parser_error(String s) { - lexer_p_->LexerError(s); - + here_input().error(s); if ( fatal_error_i_ ) exit( fatal_error_i_ ); error_level_i_ = 1; @@ -162,9 +168,6 @@ My_lily_parser::get_parens_request(char c) { Request* req_p=0; switch (c) { - case '|': - req_p = new Barcheck_req; - break; case '[': case ']': @@ -177,7 +180,12 @@ My_lily_parser::get_parens_request(char c) } break; - + case '>': + case '!': + case '<': + req_p = new Span_dynamic_req; + break; + case ')': case '(': req_p = new Slur_req; @@ -188,10 +196,13 @@ My_lily_parser::get_parens_request(char c) } switch (c) { + case '<': + case '>': case '(': case '[': req_p->span()->spantype = Span_req::START; break; + case '!': case ')': case ']': req_p->span()->spantype = Span_req::STOP; @@ -201,6 +212,11 @@ My_lily_parser::get_parens_request(char c) break; } + if (req_p->musical()->span_dynamic()) { + Span_dynamic_req* s_l= (req_p->musical()->span_dynamic()) ; + s_l->dynamic_dir_i_ = (c == '<') ? 1:-1; + } + req_p->set_spot( here_input()); return req_p; } @@ -242,3 +258,9 @@ My_lily_parser::here_input()const Source_file * f_l= lexer_p_->source_file_l(); return Input(f_l, here_ch_C()); } + +void +My_lily_parser::add_notename(String s, Melodic_req * m_p) +{ + lexer_p_->add_notename(s, m_p); +}