]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.0.29 release/0.0.29
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 7 Feb 1997 19:19:41 +0000 (20:19 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 7 Feb 1997 19:19:41 +0000 (20:19 +0100)
48 files changed:
Documentation/faq.pod
Makefile
NEWS
TODO
Variables.make
configure
flower/NEWS
flower/Sources.make
flower/Variables.make
flower/matdebug.cc
flower/sstack.hh [deleted file]
flower/textstr.hh
flower/varray.hh
hdr/lexer.hh
hdr/register.hh
hdr/request.hh
input/error.ly
input/scsii-menuetto.ly
input/standchen.ly
input/wohltemperirt.ly
src/Makefile
src/break.cc
src/complexstaff.cc
src/complexwalker.cc
src/grouping.cc
src/groupregs.cc
src/inputcommands.cc
src/inputstaff.cc
src/lexer.l
src/lexerinit.cc
src/lookup.cc
src/lyriccolumn.cc
src/mylexer.cc
src/note.cc
src/parser.y
src/pscore.cc
src/score.cc
src/scores.cc
src/simplestaff.cc
src/slur.cc
src/sourcefile.cc
src/stem.cc
src/template6.cc
src/timedescription.cc
src/voiceregs.cc
src/warn.cc
src/windhoos-suck-suck-suck-thank-you-cygnus.cc
src/wordwrap.cc

index 2544a71338a39f95f9ac71fb03492019721b0f54..df28977c5c4d89b5962a3439a408bd1f960b528f 100644 (file)
@@ -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?
 
index e55ebd0dc997b205de3e656c6a7192a78f15459c..10ad8c1642fd81fb2f7248f877002dc001955e5e 100644 (file)
--- 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 4592ee36f952ea45e8ba3e561363ca780418c988..932246fcb996871212198d939e562306601c19e8 100644 (file)
--- 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 ad7d69049e31e74bd22ed0ed1e31f8c42b40af4f..a931f47d05d5458d61ec1aa18d460e67360a4ef9 100644 (file)
--- 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,
index f0a26c0c3d659bcb3517c7bdad91543b21ca5222..c53033674cc3810022852d14ac1f4aa303540627 100644 (file)
@@ -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
index e07c529a01f55c9a3d7409946ac64d3c740a09a0..6ecf9b11043ace96008bf891c461cf8f310002a2 100755 (executable)
--- 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
index 77591bb6cb353e3ea92b009ece116ca8887747a5..aac5b758ffcc954869628fce47237d7187f4eb1d 100644 (file)
@@ -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
index c0097bdcf82497e99d974ee82eed5422a22aea9a..1e4fb2bc02f7f4fad594abef5bff6cf73464fbf0 100644 (file)
@@ -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
        
 
index ea51570ce7daf04bdefeafa043568f28efd3c1a3..90d8cc8dc6a5eddba64d59c889fc62b9351e0719 100644 (file)
@@ -1,6 +1,6 @@
 MAJVER=1
 MINVER=0
-PATCHLEVEL=24
+PATCHLEVEL=25
 PACKAGENAME=flower
 
 #PROFILEFLAG=-pg
index 7aec81909f6aec5f6bca08e65bdbc2a9916b6a9f..4c7866f09372fa8742277420556bb5f88f5956e4 100644 (file)
@@ -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 (file)
index adbc66b..0000000
+++ /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<class T>
-struct sstack : Array<T> { 
-    T top()const { return last(); }
-    T pop() {
-       assert(!empty());
-       T l = last();
-        Array<T>::pop();
-       return l;
-    }
-};
-/**
-  Same as for #Array# goes here.
-*/
-
-
-#endif // SSTACK_HH
-
index 63369ac2584e2efffc3aab5bb5d6eb1415d5323d..c89f58cf8db52c29d6b37f7e45ba980cdf152a44 100644 (file)
@@ -4,7 +4,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #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<char> pushback;
+       Array<char> pushback;
     String name;
     
  public:
index 40e76a3dc72bc220420864d40837dd850302d1e0..229fdf3c4567728973d0412132e9bb22ab938c99 100644 (file)
@@ -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 T>
 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
index 0617b9742cf6547ffbd31339801b0daf858a8865..9e5cf1b3039248ceaf2bff58da1c35f30bd33d2e 100644 (file)
@@ -3,7 +3,7 @@
 #include <FlexLexer.h>
 #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<Input_file*> include_stack;
+    Array<Input_file*> include_stack;
     Assoc<String, Identifier*> *the_id_tab;
     Keyword_table * keytable;
     Notename_tab * defaulttab;
index 42574ed5bcc80f6fc90219d8693d805514db227e..e2b5167d8d0d405f70967708fc86bf5213606ff4 100644 (file)
@@ -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<Slur_req*> requests_arr_;
-    sstack<Slur *> slur_l_stack_;
+    Array<Slur_req*> requests_arr_;
+    Array<Slur *> slur_l_stack_;
     Array<Slur*> end_slur_l_arr_;
     
     /****************/
index 203fc9ab059adaf472edef0dcacb64b076daa462..44d42e5301ac57ffe40ea1c0533444d0c9f6ae12 100644 (file)
@@ -96,6 +96,7 @@ struct Spacing_req :virtual Request {
     Real distance;
     Real strength;
     /****************/
+    Spacing_req();
     REQUESTMETHODS(Spacing_req, spacing);
 };
 
index 49dd24665b95d15ad2b448263bec40332c803ac3..9aa92d0710327365ca9df97aaf941adcb3e15b2a 100644 (file)
@@ -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
        }
 }
index 840148481103ff550a6524e2fc1b9016a35bc83a..d9b570bf0bb21cf793474a57fe82df716f5fa78c 100644 (file)
@@ -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 <jan@digicash.com>
+% 
+% 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
index 87c317b403f9db3b894a97eb445c2005cc9bc5b0..d10b99a27b5d4943dc68d6c8c2823911d6fd3666 100644 (file)
@@ -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 { 
index 3163a7bf3c3caa3fabf68116a72064b7d05fabb0..ae48f898cccc1abba847b31faddab1c31138b7cb 100644 (file)
@@ -48,6 +48,8 @@ basstaf = staff { melodic
 
 score {
        staff { melodic
+
+               % every "music {} " in a staff has its own "voicegroup"
                music { dux }
                music { comes }
                
index 55fba019b21441427d464c574df332aa01a0673e..8c88c5dbc787adbf7a31f5fdd78a465369a68fcc 100644 (file)
@@ -1,6 +1,9 @@
 default:
        $(MAKE) -C ..
 
+win32:
+       $(MAKE) -C .. Windows_NT
+
 DISTFILES=Makefile $(mycc) $(othersrc)
 dist:
        ln $(DISTFILES) $(DDIR)/$(SUBDIR)
index a138049471a88a95bbf2e59b995caa0f8a2d8142..70ff864e9de23b1d46e70b00432e411cdfa967ce 100644 (file)
@@ -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<Real> 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;
index 8f961b7d7b60baf92e959ef60127d29fe34ff6d4..7e21bf225213e2ff5b825ed90d808bb8e6c5a9bc 100644 (file)
@@ -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;
            }
index 87e3729a072da364c3550acca35f5884320d42f8..378f486a08265f6452b613cf350d7fabcdabf0d1 100644 (file)
@@ -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
index 91c9a66d0a7d6a78ed8152163021c609a7aabc1d..8c7e0e5d5b858e5ab1e986bfebfacefa76b04f7e 100644 (file)
@@ -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<Rhythmic_grouping*> 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);
     }
index ae790ab9c61b59f9a60b7053aacce9224b78fe91..9367c92cd50ae04cff393edc4643c791596d5ad5 100644 (file)
@@ -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_);
index d9f6910cf56caf8e8d77c879579e72994a38db84..093938737553b680a0ee2563e5ae32662b4b6019 100644 (file)
@@ -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<String,Moment> &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 {
index 8a56643f5c8aeffc7f86c198e48a1e5fb57102c4..27e9a55732a462a1be2696009483dd4d19d3b978 100644 (file)
@@ -10,6 +10,7 @@
 #include "lyricstaff.hh"
 #include "staff.hh"
 #include "complexstaff.hh"
+#include "lexer.hh"
 
 void
 Input_staff::add(Array<Input_command*> &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
     
index 00b4c70c159e012edeec94402bc9c4eb25329663..0771cafcde864e89880e08155405d98733b84c2b 100644 (file)
@@ -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];
 }
 
index 92b52ad8b2020e6b8f0d3481f48234cd0f16d651..5840b3c62eb98dc599af3ce8c8b7b2c50e0aae9c 100644 (file)
@@ -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 << "["<<pf<<flush;
 }
index 77cf12554cf984c6e429beeb2123d5b363c3e20c..be3466e092458ed7e92ba204d29c410e1b7fd188 100644 (file)
@@ -174,7 +174,11 @@ Lookup::meter(Array<Scalar> 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);
index 108d5953ce188b925da36b434216d774df3b9b0b..c016957eb64f846d198fd2b7ef7bf2f3838921a2 100644 (file)
@@ -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()) {
index 9465279c4a74d1981970e106f5a85bad438a6436..4575fa78d365fdd12f673a77bab7d109f0e55834 100644 (file)
@@ -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;
index 9519371175ecbd335519fe1dfd1b436a6a67ceb2..226b10a6015942e9e5938d1c2bff95831d84019a 100644 (file)
@@ -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;
 }
index 3f01afb423c8ca44d8e2d0cb5ab0178ac1af039a..09e4bd310aa9a101b1cabb12c40693d1c188378f 100644 (file)
 #endif
 
 Array<Request*> pre_reqs, post_reqs;
-sstack<const char *> define_spots;
+Array<const char *> 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)
 {
index 89a58be790d59e0adce89aefbd1ffe8f26d9e226..728b083f4e353c36ec0fc91b00aebae8aa1c081a 100644 (file)
@@ -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();
 }
index f784f30efae50bb074b93bf087fb79befacdf64c..0f697655b24b2f46ec14d6dae35421cda423bc52 100644 (file)
@@ -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.
index 06a401fd82d3d26751f263afd6268d8dd2fcf4e6..59b6f6670deba01704e125f9336879341c479984 100644 (file)
@@ -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;
 }
index 30ef3e84e1831df4bb60604c12c89ee4f8ce9480..4f7b5bd2e22644ecb9b7e40193c48183a4f289b6 100644 (file)
@@ -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();
index bd1f4c3d1d8941f1c213f03811c298a4456c16e5..5b7f99d16ed4fb157de1cf6d1431f93cf71dc939 100644 (file)
@@ -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);
index f279fae129e55ef2d0c96635bb153c21d88fdfcc..1fe2aa3d53cab26beb474293efbebd2d2192992a 100644 (file)
@@ -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;
index fc5f9accb4be67c5c93c9ac10f2e39763f873b67..dc63e9e7eb8bc61270249380c672ea5ce1e321b2 100644 (file)
@@ -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 ++) {
index 880a5fb6e00bb162ace2e21181c2797151a1b2f6..1f94149abfe7de72bdb31f0010c201b70764427f 100644 (file)
@@ -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);
index 1a66b44a44e426b9356c8ea30cbc7a8649783e89..5026656c2bb052341538b5e01fbf3ba9fbae2808 100644 (file)
@@ -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;
 }
index a70a01a4190f83219dc5df05996c4097e62ecdbd..fa95ae9e18c943828269b6796e7a4bde346b9fde 100644 (file)
@@ -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);
     }
 }
index f8688d72277131451a89557960c69159b3093f17..a7d9ba18beae9ba3d77fe25fb760fb9669e4334b 100644 (file)
@@ -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
index 8ed1d6b9905baf9d6cd4d2d9af20706cfa2259ac..caecb610da9877209def4265bbe5264c1000a4ab 100644 (file)
@@ -4,6 +4,7 @@
 #ifdef _WIN32
 
 #include <sys/types.h>
+#include <sys/mman.h>
 #include <winbase.h>
 
 /* 
@@ -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 <iostream.h>
+
 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 //
index cc114e9e5249852a69b6dd04466bfaffa50fa62b..469d2d1d293205919a0ce4b9b9020c37a4c0083a 100644 (file)
@@ -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++;
        }