From 6f57f228774688ffcdcca7aa7d3ac60100438659 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:56:07 +0000 Subject: [PATCH] lilypond-0.1.11 --- lily/include/text-item.hh | 4 +- lily/my-lily-parser.cc | 134 +++++++++++++-------------- lily/parser.y | 188 ++++++++++++++++++++------------------ lily/stem-grav.cc | 59 ++++++++++++ lily/text-def.cc | 4 +- lily/text-item.cc | 26 +++--- lily/text-spanner.cc | 10 +- lily/tie.cc | 84 ++++++++--------- lily/voice-group-gravs.cc | 14 +-- 9 files changed, 284 insertions(+), 239 deletions(-) create mode 100644 lily/stem-grav.cc diff --git a/lily/include/text-item.hh b/lily/include/text-item.hh index 4543640540..ba7ae59db6 100644 --- a/lily/include/text-item.hh +++ b/lily/include/text-item.hh @@ -24,14 +24,14 @@ public: /* ***************/ - Text_item (General_script_def*,int dir=0); + Text_item (General_script_def*,Direction dir=0); virtual ~Text_item(); DECLARE_MY_RUNTIME_TYPEINFO; protected: General_script_def * tdef_p_; - virtual Interval symbol_height()const; + virtual Interval symbol_height() const; virtual Molecule* brew_molecule_p() const; virtual void do_pre_processing(); diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index eb5d2f0d82..0b1121190a 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -33,7 +33,7 @@ My_lily_parser::set_debug() #ifndef NPRINT String s = ""; if (init_parse_b_) - s = "Init"; + s = "Init"; set_yydebug (!monitor->silence (s+"Parser") && check_debug); lexer_p_->set_debug (!monitor->silence (s+"Lexer") && check_debug); #endif @@ -46,10 +46,10 @@ My_lily_parser::print_declarations() String s = ""; if (init_parse_b_) - s = "Init"; + s = "Init"; if (!monitor->silence (s+"Declarations") && check_debug) { - lexer_p_->print_declarations (init_parse_b_); + lexer_p_->print_declarations (init_parse_b_); } #endif } @@ -69,14 +69,14 @@ My_lily_parser::parse_file (String init, String s) print_declarations(); init_parse_b_ = false; - set_debug(); + set_debug(); lexer_p_->new_input (s , source_l_); do_yyparse(); print_declarations(); if (!define_spot_array_.empty()) - warning ("Braces don't match."); + warning ("Braces don't match."); } My_lily_parser::~My_lily_parser() @@ -92,7 +92,7 @@ My_lily_parser::remember_spot() } char const * -My_lily_parser::here_ch_C()const +My_lily_parser::here_ch_C() const { return lexer_p_->here_ch_C(); } @@ -101,8 +101,8 @@ void My_lily_parser::parser_error (String s) { here_input().error (s); - if ( fatal_error_i_) - exit (fatal_error_i_); + if (fatal_error_i_) + exit (fatal_error_i_); error_level_i_ = 1; } @@ -125,7 +125,7 @@ void My_lily_parser::set_last_duration (Duration const *d) { if (last_duration_mode_b_) - default_duration_ = *d; + default_duration_ = *d; } @@ -151,25 +151,22 @@ My_lily_parser::get_rest_element (String s, Duration * duration_p) Chord* velt_p = new Request_chord; velt_p->set_spot (here_input()); - if (s=="s") { /* Space */ - Skip_req * skip_p = new Skip_req; - skip_p->duration_ = *duration_p; + if (s=="s") + { /* Space */ + Skip_req * skip_p = new Skip_req; + skip_p->duration_ = *duration_p; - skip_p->set_spot (here_input()); - velt_p->add (skip_p); + skip_p->set_spot (here_input()); + velt_p->add (skip_p); } else { - Rest_req * rest_req_p = new Rest_req; - rest_req_p->duration_ = *duration_p; - rest_req_p->set_spot (here_input()); + Rest_req * rest_req_p = new Rest_req; + rest_req_p->duration_ = *duration_p; + rest_req_p->set_spot (here_input()); - velt_p->add (rest_req_p); + velt_p->add (rest_req_p); } - Stem_req * stem_p = new Stem_req; - stem_p->duration_ = *duration_p; - stem_p->set_spot ( here_input()); - velt_p->add (stem_p); delete duration_p; return velt_p; @@ -183,15 +180,6 @@ My_lily_parser::get_note_element (Note_req *rq, Duration * duration_p) v->add (rq); - if (duration_p->durlog_i_ >= 1) - { - Stem_req * stem_req_p = new Stem_req(); - stem_req_p->duration_ = *duration_p; - - stem_req_p->set_spot (here_input()); - v->add (stem_req_p); - } - rq->set_duration (*duration_p); rq->set_spot (here_input()); delete duration_p ; @@ -205,57 +193,57 @@ My_lily_parser::get_parens_request (char c) switch (c) { - case '~': - req_p = new Tie_req; - break; - case '[': - case ']': - { + case '~': + req_p = new Tie_req; + break; + case '[': + case ']': + { Beam_req*b = new Beam_req; int p_i=plet_.type_i_ ; // ugh . Should junk? if (p_i!= 1) - b->nplet = p_i; + b->nplet = p_i; req_p = b; - } - break; - - case '>': - case '!': - case '<': - req_p = new Span_dynamic_req; - break; + } + break; + + case '>': + case '!': + case '<': + req_p = new Span_dynamic_req; + break; - case ')': - case '(': - req_p = new Slur_req; - break; - default: - assert (false); - break; + case ')': + case '(': + req_p = new Slur_req; + break; + default: + assert (false); + break; } switch (c) { - case '<': - case '>': - case '(': - case '[': - req_p->span()->spantype = Span_req::START; - break; - case '!': - case ')': - case ']': - req_p->span()->spantype = Span_req::STOP; - break; + case '<': + case '>': + case '(': + case '[': + req_p->span()->spantype = Span_req::START; + break; + case '!': + case ')': + case ']': + req_p->span()->spantype = Span_req::STOP; + break; - default: - break; + default: + 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; + if (req_p->musical()->span_dynamic ()) + { + Span_dynamic_req* s_l= (req_p->musical()->span_dynamic ()) ; + s_l->dynamic_dir_ = (c == '<') ? UP:DOWN; } req_p->set_spot (here_input()); @@ -281,12 +269,12 @@ My_lily_parser::add_requests (Chord*v) { for (int i = 0; i < pre_reqs.size(); i++) { - v->add (pre_reqs[i]); + v->add (pre_reqs[i]); } pre_reqs.clear(); for (int i = 0; i add (post_reqs[i]); + v->add (post_reqs[i]); } post_reqs.clear(); } @@ -298,7 +286,7 @@ My_lily_parser::pop_spot() } Input -My_lily_parser::here_input()const +My_lily_parser::here_input() const { Source_file * f_l= lexer_p_->source_file_l(); return Input (f_l, here_ch_C()); diff --git a/lily/parser.y b/lily/parser.y index 288d1407f1..a8612c44d4 100644 --- a/lily/parser.y +++ b/lily/parser.y @@ -59,7 +59,7 @@ Box *box; Chord * chord; Duration *duration; - Identifier *id; + Identifier *id; Input_translator* itrans; Music *music; Music_list *musiclist; @@ -68,6 +68,7 @@ Interval *interval; Lookup*lookup; Melodic_req * melreq; + Music_output_def * outputdef; Midi_def* midi; Moment *moment; Note_req *notereq; @@ -88,12 +89,12 @@ } %{ -int +int 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_; - + lex_l->lexval_l = (void*) s; return lex_l->yylex(); } @@ -163,7 +164,7 @@ yylex(YYSTYPE *s, void * v_l) %token NOTENAME_ID %token DURATION_IDENTIFIER %token IDENTIFIER -%token MELODIC_REQUEST_IDENTIFIER +%token MELODIC_REQUEST_IDENTIFIER %token MUSIC_IDENTIFIER %token VOICE_IDENTIFIER %token POST_REQUEST_IDENTIFIER @@ -176,14 +177,14 @@ yylex(YYSTYPE *s, void * v_l) %token MIDI_IDENTIFIER %token PAPER_IDENTIFIER %token REQUEST_IDENTIFIER -%token REAL +%token REAL %token DURATION RESTNAME -%token STRING +%token STRING %token FIELDNAME RECORDLINE -%token POST_QUOTES +%token POST_QUOTES %token PRE_QUOTES - +%type output_def %type
mudela_header mudela_header_body %type box %type open_request_parens close_request_parens @@ -192,26 +193,26 @@ yylex(YYSTYPE *s, void * v_l) %type int %type script_dir %type identifier_init -%type explicit_steno_duration notemode_duration +%type explicit_steno_duration notemode_duration %type entered_notemode_duration explicit_duration %type dinterval %type intastint_list %type symtables symtables_body %type melodic_request steno_melodic_req %type steno_note_req -%type pitch_list +%type pitch_list %type midi_block midi_body %type duration_length %type Music transposed_music -%type Voice Voice_body +%type Voice Voice_body %type Chord Chord_body %type paper_block paper_body %type dim real %type unit -%type post_request pre_request command_req verbose_command_req +%type post_request pre_request command_req verbose_command_req %type abbrev_command_req -%type script_req dynamic_req +%type script_req dynamic_req %type score_block score_body %type