From 4400e6a334eec3cb014f05d9dc9e098907291bfd Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 7 Feb 1997 20:19:41 +0100 Subject: [PATCH] release: 0.0.29 --- Documentation/faq.pod | 16 +- Makefile | 5 +- NEWS | 4 + TODO | 2 + Variables.make | 10 +- configure | 4 +- flower/NEWS | 7 +- flower/Sources.make | 2 +- flower/Variables.make | 2 +- flower/matdebug.cc | 2 +- flower/sstack.hh | 29 -- flower/textstr.hh | 4 +- flower/varray.hh | 23 +- hdr/lexer.hh | 5 +- hdr/register.hh | 6 +- hdr/request.hh | 1 + input/error.ly | 24 +- input/scsii-menuetto.ly | 152 ++++++++++ input/standchen.ly | 285 +++++++++--------- input/wohltemperirt.ly | 2 + src/Makefile | 3 + src/break.cc | 7 +- src/complexstaff.cc | 4 +- src/complexwalker.cc | 3 +- src/grouping.cc | 6 +- src/groupregs.cc | 2 +- src/inputcommands.cc | 7 +- src/inputstaff.cc | 5 +- src/lexer.l | 4 +- src/lexerinit.cc | 8 +- src/lookup.cc | 6 +- src/lyriccolumn.cc | 4 +- src/mylexer.cc | 31 +- src/note.cc | 66 ++-- src/parser.y | 54 ++-- src/pscore.cc | 6 +- src/score.cc | 3 +- src/scores.cc | 2 +- src/simplestaff.cc | 5 +- src/slur.cc | 6 +- src/sourcefile.cc | 28 +- src/stem.cc | 2 +- src/template6.cc | 4 +- src/timedescription.cc | 2 +- src/voiceregs.cc | 6 +- src/warn.cc | 10 +- ...indhoos-suck-suck-suck-thank-you-cygnus.cc | 58 +++- src/wordwrap.cc | 2 +- 48 files changed, 602 insertions(+), 327 deletions(-) delete mode 100644 flower/sstack.hh diff --git a/Documentation/faq.pod b/Documentation/faq.pod index 2544a71338..df28977c5c 100644 --- a/Documentation/faq.pod +++ b/Documentation/faq.pod @@ -8,15 +8,25 @@ FAQ - LilyPond FAQs Q: Why are [] around the notes, and () inbetween? A: [] designate beams, a note can only be in one beam at the same -time. () is a slur, which connects notes. You need to be able to specify +time. () is a slur, which connects notes. You need to be able to +specify a()a()a Q: I want a DOS/NT/W95 port. -A: I haven't had time to find a GCC crosscompiler to DOS/win (in rpm, -please :). No, I'm not considering compilation in W95, but feel free to give it a try. +A0: Reconsider. Try Linux. It-s fun! + +A1: Currently (patchlevel 27), LilyPond (and flowerLib) compiles, links +and runs on windhoos-nt, using the cygnus gnu port (release b17.1). +I (JCN) only had to make a minor workaround for missing library calls. +Have a look at http://www.cygnus.com/gnu-win32. To make LilyPond type +make $OS. (I am not promising to maintain this platform, it is just that +when having to use doze, i-m sometimes too lazy to reboot.) + +A2: I haven't had time to find a GCC crosscompiler to DOS/win (in rpm, +please :). Q: Why GPL? diff --git a/Makefile b/Makefile index e55ebd0dc9..10ad8c1642 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ include Variables.make $(exe): $(obs) - strip --strip-debug $(STABLEOBS) + $(STRIPDEBUG) $(STABLEOBS) $(CXX) -o $@ $^ $(LOADLIBES) @@ -23,6 +23,9 @@ distclean: clean all: kompijl doc +win32: # value of $(OSTYPE) on windhoos; "make $OSTYPE" if u use bash :-) + $(MAKE) -C . CXX=g++ + doc: $(MAKE) -C Documentation doc diff --git a/NEWS b/NEWS index 4592ee36f9..932246fcb9 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +pl 29 + - multiplatform Makefile + - context errors: bugfixes + pl 28 Internal diff --git a/TODO b/TODO index ad7d69049e..a931f47d05 100644 --- a/TODO +++ b/TODO @@ -26,6 +26,8 @@ INPUTLANGUAGE SMALLISH PROJECTS + * stafftypes: voice names/ instrument names. + * make spanner for staffsym * Lookup::tex_glissando, Lookup::tex_bracket, diff --git a/Variables.make b/Variables.make index f0a26c0c3d..c53033674c 100644 --- a/Variables.make +++ b/Variables.make @@ -1,3 +1,8 @@ +# version info +MAJVER=0 +MINVER=0 +PATCHLEVEL=29 +include Site.make #### #### USER CONFIGURABLE #### @@ -37,10 +42,6 @@ endif -# version info -MAJVER=0 -MINVER=0 -PATCHLEVEL=28 VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL) CXXVER=`$(CXX) --version` @@ -105,3 +106,4 @@ SUBDIRS=Documentation $(OBJECTDIR) $(CCDIR) $(HEADERDIR) $(INITDIR) $(DEPDIR) \ depfile=deps/$(subst .o,.dep,$(notdir $@)) DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(OBJECTDIR)/$(notdir $@)" +STRIPDEBUG=strip --strip-debug \ No newline at end of file diff --git a/configure b/configure index e07c529a01..6ecf9b1104 100755 --- a/configure +++ b/configure @@ -3,7 +3,7 @@ PREFIX=${PREFIX:-.} echo using PREFIX=$PREFIX -NEEDFLOWERVER=1.0.24 +NEEDFLOWERVER=1.0.25 flowertar=flower-$NEEDFLOWERVER here=`pwd` cd .. @@ -27,5 +27,5 @@ echo Compiling Library cd $here echo '#define LIBDIR "'$PREFIX'/"'> hdr/config.hh - +touch Site.make make -f Initial.make diff --git a/flower/NEWS b/flower/NEWS index 77591bb6cb..aac5b758ff 100644 --- a/flower/NEWS +++ b/flower/NEWS @@ -1,4 +1,9 @@ + +pl 25 + - merge sstack and Array +pl 24 + - small fix in vector print pl 23 - win32 patches (JN) -pl 22: +pl 22 - Array::add -> Array::push \ No newline at end of file diff --git a/flower/Sources.make b/flower/Sources.make index c0097bdcf8..1e4fb2bc02 100644 --- a/flower/Sources.make +++ b/flower/Sources.make @@ -12,7 +12,7 @@ hh=cursor.hh pcursor.hh lgetopt.hh link.hh list.hh dstream.hh \ findcurs.hh unionfind.hh compare.hh handle.hh matrix.hh\ smat.hh vsmat.hh vector.hh real.hh choleski.hh\ tsmat.hh tvsmat.hh plist.hh associter.hh fproto.hh\ - interval.hh scalar.hh sstack.hh rational.hh iterate.hh\ + interval.hh scalar.hh rational.hh iterate.hh\ path.hh diff --git a/flower/Variables.make b/flower/Variables.make index ea51570ce7..90d8cc8dc6 100644 --- a/flower/Variables.make +++ b/flower/Variables.make @@ -1,6 +1,6 @@ MAJVER=1 MINVER=0 -PATCHLEVEL=24 +PATCHLEVEL=25 PACKAGENAME=flower #PROFILEFLAG=-pg diff --git a/flower/matdebug.cc b/flower/matdebug.cc index 7aec81909f..4c7866f093 100644 --- a/flower/matdebug.cc +++ b/flower/matdebug.cc @@ -37,7 +37,7 @@ Vector::operator String() const String s("vector ["); #ifndef NPRINT for (int i=0; i < dim(); i++) { - s += String(dat[i], "%6f") + ' '; + s += String(dat[i], "%6f") + String(' '); } #endif s+="]"; diff --git a/flower/sstack.hh b/flower/sstack.hh deleted file mode 100644 index adbc66b4e5..0000000000 --- a/flower/sstack.hh +++ /dev/null @@ -1,29 +0,0 @@ -/* - sstack.hh -- part of Flower lib - - (c) 1996 Han-Wen Nienhuys -*/ - -#ifndef SSTACK_HH -#define SSTACK_HH - -#include "varray.hh" - -/// A simple stack based on Array. -template -struct sstack : Array { - T top()const { return last(); } - T pop() { - assert(!empty()); - T l = last(); - Array::pop(); - return l; - } -}; -/** - Same as for #Array# goes here. -*/ - - -#endif // SSTACK_HH - diff --git a/flower/textstr.hh b/flower/textstr.hh index 63369ac258..c89f58cf8d 100644 --- a/flower/textstr.hh +++ b/flower/textstr.hh @@ -4,7 +4,7 @@ #include #include #include "string.hh" -#include "sstack.hh" +#include "varray.hh" /// line counting input stream. class Text_stream @@ -13,7 +13,7 @@ class Text_stream // could just have used streams. FILE *f; - sstack pushback; + Array pushback; String name; public: diff --git a/flower/varray.hh b/flower/varray.hh index 40e76a3dc7..229fdf3c45 100644 --- a/flower/varray.hh +++ b/flower/varray.hh @@ -15,7 +15,7 @@ inline void arrcpy(T*dest, T*src, int count) { *dest++ = *src++; } -///scaleable array template, for T with def ctor. +///scaleable array/stack template, for T with def ctor. template class Array { protected: @@ -99,17 +99,23 @@ public: // vars thearray[size_++] = x; } - - /// junk last entry. - void pop() { size_ -- ; } - - /// return last entry - T& last(int j=0) { + /// remove and return last entry + T pop() { + assert(!empty()); + T l = top(0); + set_size(size()-1); + return l; + } + /// access last entry + T& top(int j=0) { return (*this)[size_-j-1]; } - T last(int j=0) const { + /// return last entry + T top (int j=0) const { return (*this)[size_-j-1]; } + + void swap (int i,int j) { T t((*this)[i]); (*this)[i]=(*this)[j]; @@ -167,6 +173,7 @@ public: destructors. The type T should have a default constructor. It is best suited for simple types, such as int, double or String + It uses stack terminology, (push, pop, top), and can be used as a stack. */ #endif diff --git a/hdr/lexer.hh b/hdr/lexer.hh index 0617b9742c..9e5cf1b303 100644 --- a/hdr/lexer.hh +++ b/hdr/lexer.hh @@ -3,7 +3,7 @@ #include #include "proto.hh" #include "fproto.hh" -#include "sstack.hh" +#include "varray.hh" #include "string.hh" int yylex(); @@ -14,6 +14,7 @@ void set_lexer(); struct Input_file { istream* is; + char const* defined_ch_c_l_m; Source_file* sourcefile_l_; int line; String name; @@ -26,7 +27,7 @@ struct Input_file { /// lexer with provisions for include files. struct My_flex_lexer : yyFlexLexer { - sstack include_stack; + Array include_stack; Assoc *the_id_tab; Keyword_table * keytable; Notename_tab * defaulttab; diff --git a/hdr/register.hh b/hdr/register.hh index 42574ed5bc..e2b5167d8d 100644 --- a/hdr/register.hh +++ b/hdr/register.hh @@ -7,7 +7,7 @@ #ifndef REGISTER_HH #define REGISTER_HH #include "proto.hh" -#include "sstack.hh" +#include "varray.hh" /// data container. struct Staff_elem_info { @@ -79,8 +79,8 @@ struct Notehead_register : Request_register { }; struct Slur_register : Request_register { - sstack requests_arr_; - sstack slur_l_stack_; + Array requests_arr_; + Array slur_l_stack_; Array end_slur_l_arr_; /****************/ diff --git a/hdr/request.hh b/hdr/request.hh index 203fc9ab05..44d42e5301 100644 --- a/hdr/request.hh +++ b/hdr/request.hh @@ -96,6 +96,7 @@ struct Spacing_req :virtual Request { Real distance; Real strength; /****************/ + Spacing_req(); REQUESTMETHODS(Spacing_req, spacing); }; diff --git a/input/error.ly b/input/error.ly index 49dd24665b..9aa92d0710 100644 --- a/input/error.ly +++ b/input/error.ly @@ -1,18 +1,24 @@ mwa = music { $ - ab % ok, warning, still output? -% \bla % ok, fatal -% & % ok, fatal -% c d ) ] % ok, fatal - c [ d -% c ) d ] e % no location :-( - + a ) b ] c % warning + & % ok; error + a b ) ] % ok; error +% a......... % fatal error -- assert + a b c + ||| % + abc % ok; print error, no output + \bla % no warning-> this STRING, reduced to lyric_elt. + a [ b % warning, still output + { a( b } % warning, still output + a b ,c + a b c-* + a b c& $ } bla = music { @ - These Gates will open just like windows. + These Gates will open just like windows. % ok; warning @ } @@ -24,6 +30,6 @@ score { melodic music { mwa } } commands { - meter 2*4 + meter 3*4 } } diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index 8401484811..d9b570bf0b 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -119,6 +119,158 @@ ii_menuetto = music { $ } +score { + staff { + melodic music { ii_menuetto } + commands { + key $bes$ + clef "alto" + skip 8:0 + clef "violin" + skip 5:0 + clef "alto" + skip 12:0 + } + } + commands { + meter 3*4 + skip 8:0 + bar ":|:" +% clef "violin" + skip 5:0 +% \clef "alto" + skip 12:0 + bar ":||" + } + paper { + symboltables { table_sixteen } + width 195mm +% unitspace 12mm % this should do, really + unitspace 8mm % to get lily to use only three lines + output "scsii-menuetto.out" + } +} +% scsii-menuetto.ly +% +% Solo Cello Suites +% J. S. Bach +% +% Suite II part v +% Menuetto I +% +% Copyright (c) 1995,1996,1997 Jan Nieuwenhuizen +% +% The purpose of this file is to demonstrate features of LilyPond. +% (there is an accompanying LaTeX file, scsii-menuetto.tex) +% + +% \lefttitle{Menuetto} +% \tempo{Moderato} +% \metron{4=120} +% +% \meter{3/4} +% \key\F % key is F ( f-major ) +% \clef\alto % use alto clef +% \duration8 % default duration is 'eight note +% +% \verb{\nobarnumbers} % issue MusiXTeX command +% \barnumbering0 +% \slope{30} % Fool MusiXTeX into 30 / 10 steeper beam +% \stemlength3 % shorter stemlength +% % because piece is set very tightly +%%1 % double comments are included in .tex file +ii_menuetto = music { + $ + \octave{} + \duration{8} + { a2 f2 d2_"\f" } bes4-. | +%%2 + { [ bes^"1" e c_"2"_"4" } +% (^ ) + a bes-. g-. ] a4-.^"4" | +%%3 +% { d4 `bes4-.\stemup } stemup: 2 voices? + { d4 `bes4-. } g4-. [ f-. e-. ] | +%%4 +% { f `a } (^ e ) d cis-. `b-. `a-. ] +% [ f ( e ) d cis-. `b-. `a-. ] + { [ f `a } e d cis-. `b-. `a-. ] +%%5 + { a2 f2 d2 } bes4-. | % @bes4-. | +%%6 +% { bes( e } ) a + { [ bes e } a bes-. g-. ] + 'c4-. | % ='c4-. | +%%7 + { a4-. f4} +% { 'd4-.-\upbow f4 `bes4\stemdown } + { 'd4-.-\upbow f4 `bes4 } +% { 'e4-.-\downbow g4 `g4\stemdown } | + { 'e4-.-\downbow g4 `g4 } | +%%8 +% { 'cis2.-\upbow e2. `a2.\stemdown } :||: + { 'cis2.-\upbow e2. `a2. } | % :||: +%%9 +% \clef "violin" +% { 'e2 a2_f\stemdown } + { 'e2 a2_"\f" } + [ 'd( 'e16 )'f16 ] | +%%10 +% [ { 'e( g } ) 'd 'cis_{ }_{ }_2 'e + { [ 'e g } 'd 'cis_"2" 'e a( )g ] | +%%11 +% { a4\stemup( f2\stemdown } ) 'd4\stemup +% { 'cis4\stemup-. e4\stemdown } + { \music { a4 'd4 'cis4-. } \music { f2 e4 } } | +%%12 +% { 'g^4 d\stemdown } (^ 'f 'e ) 'f 'd^3(^ ) ='c ] | + { [ 'g^"4" d } 'f 'e 'f 'd^"3"( ) 'c ] | +% %13 +% { bes2\stemup g4\stemdown } ( ) f4 +% { 'c4\stemup e4\stemdown } +% { bes2 g4 } f4 { 'c4 e4 } | % \clef "alto" | + { \music { bes2 'c4 } \music { g4 f4 e4 } } | +%%%14 +%% [ { a( f } ) g a f ] { 'd4-\upbow e4 `bes4\stemdown } | + { [ a f } g a f ] { 'd4-\upbow e4 `bes4 } | +%%%15 +%% { 'c4-\downbow f4 `a4\stemdown } [ bes( )a g a ] | +% { 'c4-\downbow f4 `a4 } [ bes( )a g a ] | +%%%16 + [ f( e )f a-. g-. bes-. ] | +%% \tighten % use one line less +%% \newline % start new line +%% | +%%%17 +%% { a2^0^\tr fis2_3 } bes4 | + { a2^"0" fis2_"3" } bes4 | +%%%18 +%% [ { 'c( es } ) bes 'c a ] fis4^\tr | + { [ 'c es } bes 'c a ] fis4 | +%%%19 +%% { 'd4-\downbow g4 `bes4\stemdown } { 'c4-\upbow g4 c4\stemdown } [ { bes d } a ] | + { 'd4-\downbow g4 `bes4 } { 'c4-\upbow g4 c4 } { [ bes d } a ] | +%%%20 +%% [ { 'c( d `g } bes a ) bes g ( ) bes ] | + { [ 'c d `g } bes a bes g( )bes ] | +%%%21 +%% { 'd4\stemup g2\stemdown } (^ ) 'cis4\stemup { 'd4\stemup =f4\stemdown } | +% { 'd4 g2 } 'cis4 { 'd4 f4 } | + { \music { 'd4 'cis4 'd4 } \music { g2 f4 } } | +%%%22 +%% [ { g( cis } )f g e ] { f4 d4 } | + { [ g cis } f g e ] { f4 d4 } | +%%%23 +%% [ `g g ] { e4.\stemup^\tr `a4.\stemdown } d\stemup-\upbow | + [ `g g ] { e4. `a4. } d-\upbow | +%%%24 +%% { d2.^{fine} `a2. `d2.\stemup_{ }_{ }_{3 mins.}} s4 :|| +%% { \textstyle "italic" d2.^"fine" `a2. \textstyle "roman" `d2._"3 mins."} | % :|| + { d2.^"fine" `a2. `d2._"3 mins."} | % :|| +%% \tighten % use one line less + $ +} + score { staff { melodic diff --git a/input/standchen.ly b/input/standchen.ly index 87c317b403..d10b99a27b 100644 --- a/input/standchen.ly +++ b/input/standchen.ly @@ -128,7 +128,7 @@ melodie = music { $ { a2 fis2_"\pp" } { a4 fis4 } %%33 %#% { b2(^ g2 } [v { 'd8.( b8. } { b16 ) ) g16 } ] - { b2( g2 } { [ 'd8. b8. } { b16 g16 ] } + { b2 g2 } { [ 'd8. b8. } { b16 g16 ] } %%34 %#% { a4. fis4. } [ { a_. fis_.( } { a_. fis_. } { a_. ) fis_. } ] { a4. fis4. } { [ a_. fis_. } { a_. fis_. } { a_. fis_. ] } @@ -359,165 +359,158 @@ begeleiding = music { $ { `d2.^\fermata ``d2. } $ } + tekst1 = music { - @ - \duration{4} - _ _ _ - _ _ _ - _ _ _ - _ _ _ - % 5 - \plet{ 2/3 } Lei- se8 \plet{ 1/1 } fleh-4. en8 - \plet{ 2/3 } mei- ne8 \plet{ 1/1 } Lie- der8 _8 - Durch4. die8 \plet{ 2/3 } Nacht zu8 \plet{ 1/1 } - dir;2 _ - _ _ _ - _ _ _ - % 11 - \plet{ 2/3 } In den8 \plet{ 1/1 } stil-4. len8 - \plet{ 2/3 } Hain her-8 \plet{ 1/1 } nie-4. der,8 - Lieb4. chen,8 \plet{ 2/3 } komm zu8 \plet{ 1/1 } - mir!2 _ - _ _ _ - _ _ _ - - % 17 - Fl\"us-8. ternd16 schlan-4. ke8 - Wip-8. fel16 rau-4. schen8 - \plet{ 2/3 } In des8 \plet{ 1/1 } Mon-4. des8 - Licht;2. - _ _ _ - _ _ _ - - % 23 - Des8. Ver-16 r\"a-4. ters8 - feind-8. lich16 Lau-4. schen8 - \plet{ 2/3 } F\"urch- te,8 \plet{ 1/1 } Hol-4. de,8 - nicht.2. - _ _ _ - _ _ _ - - % volta 1 - % 29 - _ _ _ _ _ _ - _ _ _ _ _ _ - _ _ _ _ _ _ - _ _ _ _ _ _ - - % volta 2 - % 37 - La\ss8. auch16 dir8. die16 Brust8. be-16 - we- gen, _ - Lieb-4. chen,8 h\"o-8. re16 - mich!2 _ - _ _ _ - _ _ _ - Be-8. bend16 harr' ich8 _8 - dir8. ent-16 ge- gen!8 _8 - \plet{ 2/3 } Komm, be-8 \plet{ 1/1 } gl\"u4. cke8 - mich!2. - % 47 - _ _ _ _ _ _ - _ _ _ _ _ _ - _ _ _ _ _ _ - _ _ _ _ _ _ - _ _ _ _ _ _ - % 57 - _ _ _ _ _ _ - @ - } - - tekst2 = music { - @ - \duration{4} - _ _ _ - _ _ _ - _ _ _ - _ _ _ - % 5 - \plet{ 2/3 } H\"orst die8 \plet{ 1/1 } Nach-4. ti-8 - \plet{ 2/3 } gal- len8 \plet{ 1/1 } schla- gen?8 _8 - Ach!4. sie8 \plet{ 2/3 } fleh- en8 \plet{ 1/1 } - dich,2 _ - _ _ _ - _ _ _ - - % 11 - \plet{ 2/3 } Mit der8 \plet{ 1/1 } T\"o-4. ne8 - \plet{ 2/3 } s\"u\ss- en8 \plet{ 1/1 } Kla-4. gen8 - Fleh-4. en8 \plet{ 2/3 } sie f\"ur8 \plet{ 1/1 } - mich.2 _ - _ _ _ - _ _ _ - - % 17 ok tot hier - Sie-8. ver-16 stehn4. des8 - Bus-8. ens16 Seh-4. nen,8 - \plet{ 2/3 } Ken- nen8 \plet{ 1/1 } Lieb-4. es-8 - schmerz,2. - _ _ _ - _ _ _ - - % 23 - R\"uh-8. ren16 mit4. den8 - Sil-8. ber-16 t\"o-4. nen8 - \plet{ 2/3 } Jed- es8 \plet{ 1/1 } wei-4. che8 - Herz.2. - _ _ _ - _ _ _ - - % volta 1 - % 29 - _ _ _ _ _ _ - _ _ _ _ _ _ - _ _ _ _ _ _ - _ _ _ _ _ _ - - % volta 2 - % 37 - % _ _ _ _ _ _ - % _ _ _ _ _ _ - % _ _ _ _ _ _ - % _ _ _ _ _ _ - % _ _ _ _ _ _ - % 47 - % _ _ _ _ _ _ - % _ _ _ _ _ _ - % _ _ _ _ _ _ - % _ _ _ _ _ _ - % _ _ _ _ _ _ - % 57 - % _ _ _ _ _ _ - @ - } - + @ + \duration{4} + _ _ _ + _ _ _ + _ _ _ + _ _ _ +% 5 + \plet{ 2/3 } Lei- se8 \plet{ 1/1 } fleh-4. en8 + \plet{ 2/3 } mei- ne8 \plet{ 1/1 } Lie- der8 _8 + Durch4. die8 \plet{ 2/3 } Nacht zu8 \plet{ 1/1 } + dir;2 _ + _ _ _ + _ _ _ +% 11 + \plet{ 2/3 } In den8 \plet{ 1/1 } stil-4. len8 + \plet{ 2/3 } Hain her-8 \plet{ 1/1 } nie-4. der,8 + Lieb4. chen,8 \plet{ 2/3 } komm zu8 \plet{ 1/1 } + mir!2 _ + _ _ _ + _ _ _ + +% 17 + Fl\"us-8. ternd16 schlan-4. ke8 + Wip-8. fel16 rau-4. schen8 + \plet{ 2/3 } In des8 \plet{ 1/1 } Mon-4. des8 + Licht;2. + _ _ _ + _ _ _ + +% 23 + Des8. Ver-16 r\"a-4. ters8 + feind-8. lich16 Lau-4. schen8 + \plet{ 2/3 } F\"urch- te,8 \plet{ 1/1 } Hol-4. de,8 + nicht.2. + _ _ _ + _ _ _ + +% volta 1 +% 29 + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ + +% volta 2 +% 37 + La\ss8. auch16 dir8. die16 Brust8. be-16 + we- gen, _ + Lieb-4. chen,8 h\"o-8. re16 + mich!2 _ + Be-8. bend16 harr' ich8 _8 + dir8. ent-16 ge- gen!8 _8 + \plet{ 2/3 } Komm, be-8 \plet{ 1/1 } gl\"u4. cke8 + mich!2. + _ _ _ _ _ _ +% 47 + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ +% 57 + _ _ _ _ _ _ + @ +} + +tekst2 = music { + @ + \duration{4} + _ _ _ + _ _ _ + _ _ _ + _ _ _ +% 5 + \plet{ 2/3 } H\"orst die8 \plet{ 1/1 } Nach-4. ti-8 + \plet{ 2/3 } gal- len8 \plet{ 1/1 } schla- gen?8 _8 + Ach!4. sie8 \plet{ 2/3 } fleh- en8 \plet{ 1/1 } + dich,2 _ + _ _ _ + _ _ _ + +% 11 + \plet{ 2/3 } Mit der8 \plet{ 1/1 } T\"o-4. ne8 + \plet{ 2/3 } s\"u\ss- en8 \plet{ 1/1 } Kla-4. gen8 + Fleh-4. en8 \plet{ 2/3 } sie f\"ur8 \plet{ 1/1 } + mich.2 _ + _ _ _ + _ _ _ + +% 17 ok tot hier + Sie-8. ver-16 stehn4. des8 + Bus-8. ens16 Seh-4. nen,8 + \plet{ 2/3 } Ken- nen8 \plet{ 1/1 } Lieb-4. es-8 + schmerz,2. + _ _ _ + _ _ _ + +% 23 + R\"uh-8. ren16 mit4. den8 + Sil-8. ber-16 t\"o-4. nen8 + \plet{ 2/3 } Jed- es8 \plet{ 1/1 } wei-4. che8 + Herz.2. + _ _ _ + _ _ _ + +% volta 1 +% 29 + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ + _ _ _ _ _ _ + +% volta 2 +% 37 +% _ _ _ _ _ _ +% _ _ _ _ _ _ +% _ _ _ _ _ _ +% _ _ _ _ _ _ +% _ _ _ _ _ _ +% 47 +% _ _ _ _ _ _ +% _ _ _ _ _ _ +% _ _ _ _ _ _ +% _ _ _ _ _ _ +% _ _ _ _ _ _ +% 57 +% _ _ _ _ _ _ + @ +} + score { - paper { - symboltables { table_sixteen } - output "standchen.uit" - unitspace 2.4 cm - % unitspace 4.0 cm % leaves all text stand free - geometric 1.4 + staff { + lyric + music { tekst1 } + music { tekst2 } } staff { - melodic + melodic music { melodie } commands { key $bes$ clef "violin" } } - staff { - lyric - music { tekst1 } - music { tekst2 } - } staff { - melodic + melodic music { begeleiding } commands { key $bes$ - clef "bass" + clef "bass" } } commands { diff --git a/input/wohltemperirt.ly b/input/wohltemperirt.ly index 3163a7bf3c..ae48f898cc 100644 --- a/input/wohltemperirt.ly +++ b/input/wohltemperirt.ly @@ -48,6 +48,8 @@ basstaf = staff { melodic score { staff { melodic + + % every "music {} " in a staff has its own "voicegroup" music { dux } music { comes } diff --git a/src/Makefile b/src/Makefile index 55fba019b2..8c88c5dbc7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,9 @@ default: $(MAKE) -C .. +win32: + $(MAKE) -C .. Windows_NT + DISTFILES=Makefile $(mycc) $(othersrc) dist: ln $(DISTFILES) $(DDIR)/$(SUBDIR) diff --git a/src/break.cc b/src/break.cc index a138049471..70ff864e9d 100644 --- a/src/break.cc +++ b/src/break.cc @@ -19,7 +19,7 @@ Break_algorithm::find_breaks() const for (iter_top(pscore_.cols,c); c.ok(); c++) if (c->breakable()) retval.push(c); - assert(retval.last() == pscore_.cols.bottom().ptr()); + assert(retval.top() == pscore_.cols.bottom().ptr()); return retval; } @@ -32,7 +32,7 @@ Break_algorithm::solve_line(Line_of_cols curline) const sp.add_column(curline[0], true, 0.0); for (int i=1; i< curline.size()-1; i++) sp.add_column(curline[i]); - sp.add_column(curline.last(), true, linelength); + sp.add_column(curline.top(), true, linelength); // misschien moeven uit Spacing_problem? for (iter_top(pscore_.suz,i); i.ok(); i++) { @@ -41,8 +41,7 @@ Break_algorithm::solve_line(Line_of_cols curline) const Array the_sol=sp.solve(); Col_hpositions col_hpos; col_hpos.cols = curline; - col_hpos.energy = the_sol.last(); - the_sol.pop(); + col_hpos.energy = the_sol.pop(); col_hpos.config = the_sol; col_hpos.OK(); return col_hpos; diff --git a/src/complexstaff.cc b/src/complexstaff.cc index 8f961b7d7b..7e21bf2252 100644 --- a/src/complexstaff.cc +++ b/src/complexstaff.cc @@ -8,6 +8,7 @@ #include "complexstaff.hh" #include "sccol.hh" #include "complexwalker.hh" +#include "main.hh" @@ -30,7 +31,8 @@ Complex_column::setup_requests() if (j->barcheck()) { if (tdescription_->whole_in_measure) { - error( "Barcheck failed", j->defined_ch_c_l_m ); + warning( "Barcheck failed", j->defined_ch_c_l_m ); +// staff_l_->the_line_->pscore_l_->heu errorlevel_i_ |= 1; } continue; } diff --git a/src/complexwalker.cc b/src/complexwalker.cc index 87e3729a07..378f486a08 100644 --- a/src/complexwalker.cc +++ b/src/complexwalker.cc @@ -205,8 +205,7 @@ Complex_walker::try_request(Request*req) } if (!b) - warning("junking request: " + String(req->name()), - req->defined_ch_c_l_m); + warning("junking request: " + String(req->name()), req->defined_ch_c_l_m); } void diff --git a/src/grouping.cc b/src/grouping.cc index 91c9a66d0a..8c7e0e5d5b 100644 --- a/src/grouping.cc +++ b/src/grouping.cc @@ -38,7 +38,7 @@ Rhythmic_grouping::interval()const else return MInterval(children[0]->interval().left, - children.last()->interval().right); + children.top()->interval().right); } void @@ -217,7 +217,7 @@ bool Rhythmic_grouping::child_fit_query(Moment start) { if (children.size()) - return ( children.last()->interval().right== start); + return ( children.top()->interval().right== start); return true; } @@ -311,7 +311,7 @@ Rhythmic_grouping::extend(MInterval m) Array a(children); for (int i=0; i < a.size(); i++) { a[i] =new Rhythmic_grouping(*children[i]); - a[i]->translate(children.last()->interval().right); + a[i]->translate(children.top()->interval().right); } children.concat(a); } diff --git a/src/groupregs.cc b/src/groupregs.cc index ae790ab9c6..9367c92cd5 100644 --- a/src/groupregs.cc +++ b/src/groupregs.cc @@ -82,7 +82,7 @@ Stem_beam_register::process_request() if (beam_p_) { if (stem_req_l_->balltype<= 4) - warning( "stem doesn't fit in Beam.", + warning( "stem doesn't fit in Beam", stem_req_l_->defined_ch_c_l_m); else beam_p_->add(stem_p_); diff --git a/src/inputcommands.cc b/src/inputcommands.cc index d9f6910cf5..0939387375 100644 --- a/src/inputcommands.cc +++ b/src/inputcommands.cc @@ -7,6 +7,7 @@ #include "stcol.hh" #include "staff.hh" #include "assoc.hh" +#include "lexer.hh" void Commands_at::print() const @@ -181,8 +182,10 @@ Input_commands::add(Input_command c, Assoc &marks_assoc_r) } else if (s=="GOTO") { ptr = top(); String m(c.args[1]); - if (!marks_assoc_r.elt_query(m)) - error("Unknown marker: `" +m + "\'"); + if (!marks_assoc_r.elt_query(m)) { + warning( "Unknown marker: `" +m + "\'", 0 ); + return; + } ptr.find_moment(marks_assoc_r[m]); } else { diff --git a/src/inputstaff.cc b/src/inputstaff.cc index 8a56643f5c..27e9a55732 100644 --- a/src/inputstaff.cc +++ b/src/inputstaff.cc @@ -10,6 +10,7 @@ #include "lyricstaff.hh" #include "staff.hh" #include "complexstaff.hh" +#include "lexer.hh" void Input_staff::add(Array &s) @@ -46,8 +47,8 @@ Input_staff::parse(Score*score_l) else if (type == "lyric") p = new Lyric_staff; else - error("Unknown staff-type `" + type +"\'"); - + error( "Unknown staff-type `" + type +"\'", 0 ); + p->score_l_ = score_l; p->define_spot_str_ = ""; // todo diff --git a/src/lexer.l b/src/lexer.l index 00b4c70c15..0771cafcde 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -270,9 +270,7 @@ include { //ignore } . { -// error( "lexer error: illegal character '"+String(YYText()[0])+ "' encountered"); - error( String( "illegal character: " ) + String( YYText()[0] ) + ": ", - here_ch_c_l() ); + error( String( "illegal character: " ) + String( YYText()[0] ), here_ch_c_l() ); return YYText()[0]; } diff --git a/src/lexerinit.cc b/src/lexerinit.cc index 92b52ad8b2..5840b3c62e 100644 --- a/src/lexerinit.cc +++ b/src/lexerinit.cc @@ -15,12 +15,6 @@ yylex() { return lexer->yylex(); } -void -yyerror(const char *s) -{ - lexer->LexerError(s); -} - bool busy_parsing() { @@ -34,6 +28,7 @@ Input_file::Input_file(String s) String pf(s); if (pf=="") { is = &cin; + defined_ch_c_l_m = 0; sourcefile_l_ = 0; } else { @@ -41,6 +36,7 @@ Input_file::Input_file(String s) source_global_l->add( sourcefile_p ); sourcefile_l_ = sourcefile_p; is = sourcefile_l_->istream_l(); + defined_ch_c_l_m = sourcefile_l_->ch_c_l(); } cout << "["< a) Symbol Lookup::stem(Real y1,Real y2) { - assert(y1 <= y2); + if (y1 > y2) { + Real t = y1; + y1 = y2; + y2 = t; + } Symbol s; s.dim.x = Interval(0,0); diff --git a/src/lyriccolumn.cc b/src/lyriccolumn.cc index 108d5953ce..c016957eb6 100644 --- a/src/lyriccolumn.cc +++ b/src/lyriccolumn.cc @@ -7,7 +7,7 @@ #include "lyriccolumn.hh" #include "sccol.hh" #include "pscore.hh" - +#include "main.hh" Lyric_column::Lyric_column(Score_column*s, Lyric_staff* lstaff_l) : Staff_column(s) @@ -23,7 +23,7 @@ Lyric_column::setup_requests() Request* req_l = j; if (req_l->barcheck()) { if (tdescription_->whole_in_measure) { - error( "Barcheck failed ", req_l->defined_ch_c_l_m ); + warning( "Barcheck failed ", req_l->defined_ch_c_l_m ); } } if (req_l->lreq_l()) { diff --git a/src/mylexer.cc b/src/mylexer.cc index 9465279c4a..4575fa78d3 100644 --- a/src/mylexer.cc +++ b/src/mylexer.cc @@ -7,10 +7,10 @@ #include "keyword.hh" #include "assoc.hh" #include "lexer.hh" -#include "sstack.hh" #include "debug.hh" #include "notename.hh" #include "sourcefile.hh" +#include "parseconstruct.hh" static Keyword_ent the_key_tab[]={ "bar", BAR, @@ -70,7 +70,7 @@ My_flex_lexer::ret_notename(int *p, String text, int octave_mod) if (p[0] < 0) { errorlevel_i_ |= 1; - warning( String( "notename does not exist: " ) +YYText() + ": ", ch_c_l ); + warning( String( "notename does not exist: " ) + YYText(), ch_c_l ); p[0] = p[1] = 0; } return NOTENAME; @@ -103,7 +103,7 @@ My_flex_lexer::lookup_identifier(String s) char const* My_flex_lexer::here_ch_c_l() { - return data_ch_c_l_m + yyin->tellg(); + return data_ch_c_l_m ? data_ch_c_l_m + yyin->tellg() : 0; } void @@ -137,11 +137,14 @@ My_flex_lexer::LexerError(const char *s) *mlog << "error at EOF" << s << '\n'; } else { char const* ch_c_l = here_ch_c_l(); - ch_c_l--; - while ( ( *ch_c_l == ' ' ) || ( *ch_c_l == '\t' ) || ( *ch_c_l == '\n' ) ) - ch_c_l--; - ch_c_l++; - error( s, ch_c_l ); + if ( ch_c_l ) { + ch_c_l--; + while ( ( *ch_c_l == ' ' ) || ( *ch_c_l == '\t' ) || ( *ch_c_l == '\n' ) ) + ch_c_l--; + ch_c_l++; + } + errorlevel_i_ |= 1; + warning( s, ch_c_l ); } } @@ -149,13 +152,20 @@ My_flex_lexer::LexerError(const char *s) void My_flex_lexer::new_input(String s) { - if (!include_stack.empty()) + if (!include_stack.empty()) { include_stack.top()->line = lineno(); + // should this be saved at all? + include_stack.top()->defined_ch_c_l_m = defined_ch_c_l; + } Input_file *newin = new Input_file(s); include_stack.push(newin); switch_streams(newin->is); - data_ch_c_l_m = newin->sourcefile_l_->ch_c_l(); + if ( newin->sourcefile_l_ ) + data_ch_c_l_m = newin->sourcefile_l_->ch_c_l(); + else + data_ch_c_l_m = 0; + yylineno = 1; } @@ -171,6 +181,7 @@ My_flex_lexer::close_input() Input_file *i = include_stack.top(); switch_streams(i->is); yylineno = i->line; + defined_ch_c_l = i->defined_ch_c_l_m; } delete old; return ok; diff --git a/src/note.cc b/src/note.cc index 9519371175..226b10a601 100644 --- a/src/note.cc +++ b/src/note.cc @@ -98,15 +98,17 @@ Voice_element * get_note_element(String pitch, int * notename, int * duration ) { Voice_element*v = new Voice_element; + v->defined_ch_c_l_m = defined_ch_c_l; int i=0; int dur = duration[0]; int dots=duration[1]; if (dur >= 2) { - Stem_req * st = new Stem_req(dur,dots); - st->plet_factor = Moment(default_plet_dur, default_plet_type); - v->add(st); + Stem_req * stem_req_p = new Stem_req(dur,dots); + stem_req_p->plet_factor = Moment(default_plet_dur, default_plet_type); + stem_req_p->defined_ch_c_l_m = defined_ch_c_l; + v->add(stem_req_p); } if ( !defined_ch_c_l ) @@ -128,7 +130,6 @@ get_note_element(String pitch, int * notename, int * duration ) rq->print(); v->add(rq); - v->defined_ch_c_l_m = defined_ch_c_l; return v; } @@ -137,7 +138,7 @@ Voice_element* get_word_element(Text_def* tdef_p, int* duration) { Voice_element* velt_p = new Voice_element; - + velt_p->defined_ch_c_l_m = defined_ch_c_l; int dur = duration[0]; int dots=duration[1]; @@ -155,6 +156,7 @@ get_word_element(Text_def* tdef_p, int* duration) lreq_p->dots = dots; lreq_p->plet_factor = Moment(default_plet_dur, default_plet_type); lreq_p->print(); + lreq_p->defined_ch_c_l_m = defined_ch_c_l; velt_p->add(lreq_p); @@ -164,16 +166,19 @@ get_word_element(Text_def* tdef_p, int* duration) Voice_element * get_rest_element(String, int * duration ) { - Voice_element*v = new Voice_element; + Voice_element* velt_p = new Voice_element; + velt_p->defined_ch_c_l_m = defined_ch_c_l; - Rest_req * rq = new Rest_req; - rq->plet_factor = Moment(default_plet_dur, default_plet_type); - rq->balltype = duration[0]; - rq->dots = duration[1]; - rq->print(); - v->add(rq); + Rest_req * rest_req_p = new Rest_req; + rest_req_p->plet_factor = Moment(default_plet_dur, default_plet_type); + rest_req_p->balltype = duration[0]; + rest_req_p->dots = duration[1]; + rest_req_p->print(); + rest_req_p->defined_ch_c_l_m = defined_ch_c_l; - return v; + velt_p->add(rest_req_p); + + return velt_p; } void @@ -283,45 +288,58 @@ get_scriptdef(char c) Request* get_script_req(int d , Script_def*def) { - return new Script_req(d, def); + Script_req* script_req_p = new Script_req(d, def); + script_req_p->defined_ch_c_l_m = defined_ch_c_l; + return script_req_p; } Request* get_text_req(int d , Text_def*def) { - return new Text_req(d, def); + Text_req* text_req_p = new Text_req(d, def); + text_req_p->defined_ch_c_l_m = defined_ch_c_l; + return text_req_p; } Voice_element* get_mark_element(String s) { Voice_element*v_p = new Voice_element; - v_p->add( new Mark_req(s)); - + v_p->defined_ch_c_l_m = defined_ch_c_l; + Mark_req* mark_req_p = new Mark_req(s); + mark_req_p->defined_ch_c_l_m = defined_ch_c_l; + v_p->add(mark_req_p); return v_p; } Voice_element* get_command_element(Input_command*com_p) { - Voice_element *v_p = new Voice_element; - v_p->add(new Staff_command_req(com_p)); - return v_p; + Voice_element *velt_p = new Voice_element; + velt_p->defined_ch_c_l_m = defined_ch_c_l; + Staff_command_req* scommand_req_p = new Staff_command_req(com_p); + scommand_req_p->defined_ch_c_l_m = defined_ch_c_l; + velt_p->add(scommand_req_p); + return velt_p; } Voice_element* get_barcheck_element() { - Voice_element*v_p = new Voice_element; - v_p->add( new Barcheck_req); - - return v_p; + Voice_element* velt_p = new Voice_element; + velt_p->defined_ch_c_l_m = req_defined_ch_c_l; + Barcheck_req* barcheck_req_p = new Barcheck_req; + barcheck_req_p->defined_ch_c_l_m = req_defined_ch_c_l; + velt_p->add(barcheck_req_p); + return velt_p; } Voice_element* get_stemdir_element(int d) { Voice_element*v_p = new Voice_element; + v_p->defined_ch_c_l_m = req_defined_ch_c_l; Group_feature_req * gfreq_p = new Group_feature_req; gfreq_p->stemdir_i_ =d; + gfreq_p->defined_ch_c_l_m = req_defined_ch_c_l; v_p->add(gfreq_p); return v_p; } diff --git a/src/parser.y b/src/parser.y index 3f01afb423..09e4bd310a 100644 --- a/src/parser.y +++ b/src/parser.y @@ -19,10 +19,11 @@ #endif Array pre_reqs, post_reqs; -sstack define_spots; +Array define_spots; Paperdef*default_paper(); char const* defined_ch_c_l; char const* req_defined_ch_c_l; +int fatal_error_i = 0; %} @@ -171,7 +172,7 @@ declaration: delete $1; } | declarable_identifier error '}' { - warning( "parse error", lexer->here_ch_c_l() ); +// warning( "parse error", lexer->here_ch_c_l() ); } ; @@ -224,7 +225,7 @@ score_body: { score_commands_block: COMMANDS '{' score_commands_body '}' { $$ =$3;} | COMMANDS '{' error '}' { - warning( "parse error", lexer->here_ch_c_l() ); +// warning( "parse error", lexer->here_ch_c_l() ); } ; @@ -325,7 +326,7 @@ paper_body: | paper_body UNITSPACE dim { $$->whole_width = $3; } | paper_body GEOMETRIC REAL { $$->geometric_ = $3; } | paper_body error { - warning( "parse error", lexer->here_ch_c_l() ); +// warning( "parse error", lexer->here_ch_c_l() ); } ; @@ -361,7 +362,7 @@ staff_body: delete $2; } | staff_body error { - warning( "parse error", lexer->here_ch_c_l() ); +// warning( "parse error", lexer->here_ch_c_l() ); } ; @@ -392,7 +393,7 @@ music_voice_body: $$->add($2); } | music_voice_body error { - warning( "parse error", lexer->here_ch_c_l() ); +// warning( "parse error", lexer->here_ch_c_l() ); } ; @@ -416,7 +417,7 @@ music_chord_body: $$ ->add_elt($2); } | music_chord_body error { - warning( "parse error", lexer->here_ch_c_l() ); +// warning( "parse error", lexer->here_ch_c_l() ); } ; @@ -436,8 +437,12 @@ full_element: pre_requests voice_elt post_requests { } | COMMAND '{' staff_command '}' { $$=get_command_element($3); } | COMMAND '{' score_command '}' { $$=get_command_element($3); } - | '|' { $$ = get_barcheck_element(); } + | '|' { + req_defined_ch_c_l = lexer->here_ch_c_l(); + $$ = get_barcheck_element(); + } | STEM '{' int '}' { + req_defined_ch_c_l = lexer->here_ch_c_l(); $$ = get_stemdir_element($3); } | lyrics_elt @@ -459,8 +464,8 @@ post_requests: post_request: close_request_parens { - $$ = get_request($1); req_defined_ch_c_l = lexer->here_ch_c_l(); + $$ = get_request($1); } | script_req | textscript_req @@ -468,23 +473,23 @@ post_request: close_request_parens: '(' { - $$='('; req_defined_ch_c_l = lexer->here_ch_c_l(); + $$='('; } | ']' { - $$ = ']'; req_defined_ch_c_l = lexer->here_ch_c_l(); + $$ = ']'; } ; open_request_parens: ')' { - $$=')'; req_defined_ch_c_l = lexer->here_ch_c_l(); + $$=')'; } | '[' { - $$='['; req_defined_ch_c_l = lexer->here_ch_c_l(); + $$='['; } ; @@ -505,9 +510,9 @@ textscript_req: mudela_text: STRING { + defined_ch_c_l = lexer->here_ch_c_l(); $$ = get_text(*$1); delete $1; - defined_ch_c_l = lexer->here_ch_c_l(); } ; @@ -530,6 +535,10 @@ mudela_script: warning( "too many staccato dots", lexer->here_ch_c_l() ); $$ = get_scriptdef('.'); } + | error { + $$ = get_scriptdef('.'); + yyerrok; + } ; script_dir: @@ -546,8 +555,8 @@ pre_requests: pre_request: open_request_parens { - $$ = get_request($1); defined_ch_c_l = lexer->here_ch_c_l(); + $$ = get_request($1); } ; @@ -622,12 +631,12 @@ default_duration: ; pitchmod: { - $$ = new String; defined_ch_c_l = lexer->here_ch_c_l(); + $$ = new String; } | PITCHMOD { - $$ = $1; defined_ch_c_l = lexer->here_ch_c_l(); + $$ = $1; } ; @@ -770,6 +779,17 @@ dinterval: dim dim { %% +void +yyerror(const char *s) +{ +// if ( YYRECOVERING() ) +// return; + lexer->LexerError(s); + + if ( fatal_error_i ) + exit( fatal_error_i ); +} + void parse_file(String init, String s) { diff --git a/src/pscore.cc b/src/pscore.cc index 89a58be790..728b083f4e 100644 --- a/src/pscore.cc +++ b/src/pscore.cc @@ -254,10 +254,10 @@ void PScore::process() { clean_cols(); - *mlog << "Preprocessing ... "; + *mlog << "Preprocessing" << endl; preprocess(); - *mlog << "Calculating ... "; + *mlog << "Calculating" << endl; calc_breaking(); - *mlog << "Postprocessing ... "; + *mlog << "Postprocessing" << endl; postprocess(); } diff --git a/src/score.cc b/src/score.cc index f784f30efa..0f697655b2 100644 --- a/src/score.cc +++ b/src/score.cc @@ -12,7 +12,7 @@ void Score::process() { - *mlog << "\nProcessing music ... "; + *mlog << "\nProcessing music" << endl; assert (paper_p_); if (last() == Moment(0)) { @@ -35,7 +35,6 @@ Score::process() // debugging OK(); pscore_p_->process(); - *mlog << "\n"; } // remove empty cols. diff --git a/src/scores.cc b/src/scores.cc index 06a401fd82..59b6f6670d 100644 --- a/src/scores.cc +++ b/src/scores.cc @@ -33,7 +33,7 @@ Input_score* current_iscore_l() { if ( score_array_global.size() ) - return score_array_global.last(); // UGH + return score_array_global.top(); // UGH else return 0; } diff --git a/src/simplestaff.cc b/src/simplestaff.cc index 30ef3e84e1..4f7b5bd2e2 100644 --- a/src/simplestaff.cc +++ b/src/simplestaff.cc @@ -37,15 +37,14 @@ Simple_column::setup_requests() Request *rq= j; if (rq->barcheck()) { if (tdescription_->whole_in_measure) { -// error("Barcheck failed, " + tdescription_->str()); - error( "Barcheck failed", rq->defined_ch_c_l_m ); + warning( "Barcheck failed", rq->defined_ch_c_l_m ); } } if (rq->rhythmic()){ notes.push(rq->rhythmic()); } if (rq->script()) { - notes.last().scripts.push(rq->script()); + notes.top().scripts.push(rq->script()); } if (rq->stem()) { stem_ = rq->stem(); diff --git a/src/slur.cc b/src/slur.cc index bd1f4c3d1d..5b7f99d16e 100644 --- a/src/slur.cc +++ b/src/slur.cc @@ -22,7 +22,7 @@ Slur::Slur() Offset Slur::center() const { - int pos1 = encompass.last()->position; + int pos1 = encompass.top()->position; int pos2 = encompass[0]->position; int dy = pos1-pos2; @@ -58,7 +58,7 @@ Slur::set_default_dir() void Slur::do_pre_processing() { - right = encompass.last()->pcol_l_; + right = encompass.top()->pcol_l_; left = encompass[0]->pcol_l_; } @@ -101,7 +101,7 @@ Slur::brew_molecule_p() const assert(encompass.size()>0); // todo Notehead *lnote_p =encompass[0]; - Notehead *rnote_p =encompass.last(); + Notehead *rnote_p =encompass.top(); int lpos_i = lnote_p->position; int rpos_i = rnote_p->position; Offset left_off(lnote_p->x_dir, lpos_i + 2*dir); diff --git a/src/sourcefile.cc b/src/sourcefile.cc index f279fae129..1fe2aa3d53 100644 --- a/src/sourcefile.cc +++ b/src/sourcefile.cc @@ -45,6 +45,7 @@ Source_file::~Source_file() char const* Source_file::ch_c_l() { + assert( this ); return (char const*)data_caddr_m; } @@ -60,6 +61,7 @@ Source_file::close() String Source_file::error_str( char const* pos_ch_c_l ) { + assert( this ); if ( !in_b( pos_ch_c_l ) ) return ""; @@ -78,13 +80,13 @@ Source_file::error_str( char const* pos_ch_c_l ) } end_ch_c_l--; -// String( char const* p, int size ) is missing!? +// String( char const* p, int length ) is missing!? // String line_str( begin_ch_c_l, end_ch_c_l - begin_ch_c_l ); - int size_i = end_ch_c_l - begin_ch_c_l; - char* ch_p = new char[ size_i ]; - strncpy( ch_p, begin_ch_c_l, size_i ); - ch_p[ size_i ] = 0; + int length_i = end_ch_c_l - begin_ch_c_l; + char* ch_p = new char[ length_i + 1 ]; + strncpy( ch_p, begin_ch_c_l, length_i ); + ch_p[ length_i ] = 0; String line_str( ch_p ); delete ch_p; @@ -106,15 +108,21 @@ Source_file::error_str( char const* pos_ch_c_l ) bool Source_file::in_b( char const* pos_ch_c_l ) { - return ( pos_ch_c_l >= ch_c_l() ) && ( pos_ch_c_l < ch_c_l() + size_off_m ); + return ( pos_ch_c_l && ( pos_ch_c_l >= ch_c_l() ) && ( pos_ch_c_l < ch_c_l() + size_off_m ) ); } istream* Source_file::istream_l() { assert( fildes_i_m ); - if ( !istream_p_m ) - istream_p_m = new istrstream( ch_c_l(), size_off_m ); + if ( !istream_p_m ) { + if ( size_off_m ) // can-t this be done without such a hack? + istream_p_m = new istrstream( ch_c_l(), size_off_m ); + else { + istream_p_m = new istrstream( "", 0 ); + istream_p_m->set(ios::eofbit); + } + } return istream_p_m; } @@ -124,7 +132,7 @@ Source_file::line_i( char const* pos_ch_c_l ) if ( !in_b( pos_ch_c_l ) ) return 0; - int i = 0; + int i = 1; char const* scan_ch_c_l = ch_c_l(); while ( scan_ch_c_l < pos_ch_c_l ) if ( *scan_ch_c_l++ == '\n' ) @@ -135,7 +143,7 @@ Source_file::line_i( char const* pos_ch_c_l ) void Source_file::map() { - data_caddr_m = (caddr_t)mmap( (void*)0, size_off_m, PROT_READ, MAP_FILE | MAP_SHARED, fildes_i_m, 0 ); + data_caddr_m = (caddr_t)mmap( (void*)0, size_off_m, PROT_READ, MAP_SHARED, fildes_i_m, 0 ); if ( (int)data_caddr_m == -1 ) { cerr << "lilypond: can't map: " << name_str_m << ": " << strerror( errno ) << endl; diff --git a/src/stem.cc b/src/stem.cc index fc5f9accb4..dc63e9e7eb 100644 --- a/src/stem.cc +++ b/src/stem.cc @@ -121,7 +121,7 @@ Stem::set_noteheads() { heads.sort(Notehead::compare); heads[0]->extremal = -1; - heads.last()->extremal = 1; + heads.top()->extremal = 1; int parity=1; int lastpos = heads[0]->position; for (int i=1; i < heads.size(); i ++) { diff --git a/src/template6.cc b/src/template6.cc index 880a5fb6e0..1f94149abf 100644 --- a/src/template6.cc +++ b/src/template6.cc @@ -1,8 +1,8 @@ +#include "proto.hh" +#include "plist.tcc" #include "register.hh" #include "voicegroup.hh" -#include "pcursor.tcc" -#include "plist.tcc" IPL_instantiate(Voice_registers); IPL_instantiate(Voice_group_registers); diff --git a/src/timedescription.cc b/src/timedescription.cc index 1a66b44a44..5026656c2b 100644 --- a/src/timedescription.cc +++ b/src/timedescription.cc @@ -10,7 +10,7 @@ Time_description::str()const s+= "at "; s+=when; s+="\nmeter " + String(whole_per_measure/one_beat) +":" + - String(Rational(1/one_beat)); + String(Rational(Rational(1)/one_beat)); s+= "\nposition "+String( bars) + ":"+ whole_in_measure +"\n}\n"; return s; } diff --git a/src/voiceregs.cc b/src/voiceregs.cc index a70a01a419..fa95ae9e18 100644 --- a/src/voiceregs.cc +++ b/src/voiceregs.cc @@ -84,7 +84,7 @@ Notehead_register::process_request() if (!accepted_req_arr_.size()) return; - Request* req_l = accepted_req_arr_.last(); + Request* req_l = accepted_req_arr_.top(); if (req_l->note()) { Notehead*n_p = new Notehead(8); // ugh note_p_ = n_p; @@ -151,7 +151,7 @@ Slur_register::process_request() // end slur: move the slur to other array if (slur_req_l->spantype == Span_req::STOP) { if (slur_l_stack_.empty()) - warning("can't find slur to end; ", + warning("can't find slur to end", slur_req_l->defined_ch_c_l_m); else { end_slur_l_arr_.push(slur_l_stack_.pop()); @@ -181,6 +181,6 @@ Slur_register::do_pre_move_process() Slur_register::~Slur_register() { for (int i=0; i < requests_arr_.size(); i++) { - warning("unterminated slur: ", requests_arr_[i]->defined_ch_c_l_m); + warning("unterminated slur", requests_arr_[i]->defined_ch_c_l_m); } } diff --git a/src/warn.cc b/src/warn.cc index f8688d7227..a7d9ba18be 100644 --- a/src/warn.cc +++ b/src/warn.cc @@ -24,7 +24,7 @@ error(String s) if (busy_parsing()) yyerror(s); else - cerr << "\nerror: " << s << "\n"; + cerr << "error: " << s << "\n"; exit(1); } @@ -50,14 +50,16 @@ message( String message_str, char const* context_ch_c_l ) String str = "lilypond: "; Source_file* sourcefile_l = source_global_l->sourcefile_l( context_ch_c_l ); if ( sourcefile_l ) { - str += sourcefile_l->file_line_no_str(context_ch_c_l); + str += sourcefile_l->file_line_no_str(context_ch_c_l) + String(": "); } str += message_str; if ( sourcefile_l ) { - str += "\n"; + str += ":\n"; str += sourcefile_l->error_str( context_ch_c_l ); } - cerr << endl << str << endl; + if ( busy_parsing() ) + cerr << endl; + cerr << str << endl; } void diff --git a/src/windhoos-suck-suck-suck-thank-you-cygnus.cc b/src/windhoos-suck-suck-suck-thank-you-cygnus.cc index 8ed1d6b990..caecb610da 100644 --- a/src/windhoos-suck-suck-suck-thank-you-cygnus.cc +++ b/src/windhoos-suck-suck-suck-thank-you-cygnus.cc @@ -4,6 +4,7 @@ #ifdef _WIN32 #include +#include #include /* @@ -25,16 +26,42 @@ LPVOID MapViewOfFile( DWORD dwNumberOfBytesToMap // number of bytes to map ); + +io.h: +long _get_osfhandle( int filehandle ); */ +// cygnus's gnu-win32-b17.1 does not have _get_osfhandle +// however, after some hacking, it turns out that: + +static const int OSF_OFFSET_i = 72; +static const int OSF_BASE_i = -3; +static const int OSF_FACTOR_i = 8; +// let-s hope bill doesn-t change his mind any time soon :-) + +// so that, while waiting for cygnus's mmap, we can write: + +// #define HAVE_GET_OSFHANDLE // no we still cannot; works only with cl.exe +long +_get_osfhandle( int filedes_i ) +{ + return (long)( OSF_OFFSET_i + ( filedes_i + OSF_BASE_i ) * OSF_FACTOR_i ); +} + +#ifdef HAVE_GET_OSFHANDLE + +#include + caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset) { (void)flags; (void)prot; - HANDLE file_handle = CreateFileMapping( fd, (void*)0, PAGE_READONLY, + (void)addr; + HANDLE osf = (HANDLE)_get_osfhandle( fd ); + HANDLE file_handle = CreateFileMapping( osf, (void*)0, PAGE_READONLY, 0, len, 0 ); - return (caddr_t)MapViewOfFile( file_handle, addr, 0, offset, len ); + return (caddr_t)MapViewOfFile( file_handle, FILE_MAP_READ, 0, offset, len ); } @@ -45,4 +72,31 @@ munmap(caddr_t addr, size_t len) return UnmapViewOfFile( addr ); } +#else // ! HAVE_GET_OSFHANDLE // + +caddr_t +mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset) +{ + (void)flags; + (void)prot; + (void)addr; + (void)offset; + char* ch_p = new char[ len ]; + if ( ch_p ) + read( fd, (void*)ch_p, len ); + return ch_p; +} + + +int +munmap(caddr_t addr, size_t len) +{ + (void)len; + delete (char*)addr; + return 0; +} + +#endif // !HAVE_GET_OSFHANDLE // + + #endif // _WIN32 // diff --git a/src/wordwrap.cc b/src/wordwrap.cc index cc114e9e52..469d2d1d29 100644 --- a/src/wordwrap.cc +++ b/src/wordwrap.cc @@ -60,7 +60,7 @@ Word_wrap::solve() // add nobreak version of breakable column - current.cols.last()=breakpoints[break_idx_i]; + current.cols.top()=breakpoints[break_idx_i]; curcol ++; break_idx_i++; } -- 2.39.5