]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.0.42.pre3 release/0.0.42.pre3
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 19 Mar 1997 00:52:59 +0000 (01:52 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 19 Mar 1997 00:52:59 +0000 (01:52 +0100)
250 files changed:
.dstreamrc
.version
ANNOUNCE
Documentation/CodingStyle.pod
Documentation/Makefile
Documentation/faq.pod
Documentation/lelie_icon.gif [new file with mode: 0644]
Documentation/lilygut.pod
Documentation/lilyinput-pre-0.1.pod [new file with mode: 0644]
Documentation/lilyinput.pod
Documentation/lilypond.pod
INSTALL.text
Makefile
NEWS
TODO
bin/Makefile
bin/release [new file with mode: 0755]
configure
configure.in
flower/.version
flower/Makefile
flower/NEWS
flower/choleski.cc [new file with mode: 0644]
flower/configure [changed mode: 0644->0755]
flower/configure.in
flower/data-file.cc [new file with mode: 0644]
flower/dstream.cc [new file with mode: 0644]
flower/flower-version.cc [new file with mode: 0644]
flower/include/Makefile [new file with mode: 0644]
flower/include/assoc-iter.hh [new file with mode: 0644]
flower/include/assoc.hh [new file with mode: 0644]
flower/include/choleski.hh [new file with mode: 0644]
flower/include/compare.hh [new file with mode: 0644]
flower/include/cursor.hh [new file with mode: 0644]
flower/include/cursor.inl [new file with mode: 0644]
flower/include/cursor.tcc [new file with mode: 0644]
flower/include/data-file.hh [new file with mode: 0644]
flower/include/dstream.hh [new file with mode: 0644]
flower/include/fproto.hh [new file with mode: 0644]
flower/include/handle.hh [new file with mode: 0644]
flower/include/interval.hh [new file with mode: 0644]
flower/include/interval.tcc [new file with mode: 0644]
flower/include/iterate.hh [new file with mode: 0644]
flower/include/lgetopt.hh [new file with mode: 0644]
flower/include/libc-extension.hh [new file with mode: 0644]
flower/include/link.hh [new file with mode: 0644]
flower/include/link.inl [new file with mode: 0644]
flower/include/list.hh [new file with mode: 0644]
flower/include/list.inl [new file with mode: 0644]
flower/include/list.tcc [new file with mode: 0644]
flower/include/matrix.hh [new file with mode: 0644]
flower/include/path.hh [new file with mode: 0644]
flower/include/pcursor.tcc [new file with mode: 0644]
flower/include/plist.tcc [new file with mode: 0644]
flower/include/pqueue.hh [new file with mode: 0644]
flower/include/rational.hh [new file with mode: 0644]
flower/include/real.hh [new file with mode: 0644]
flower/include/scalar.hh [new file with mode: 0644]
flower/include/smat.hh [new file with mode: 0644]
flower/include/string-convert.hh [new file with mode: 0644]
flower/include/string-data.hh [new file with mode: 0644]
flower/include/string-data.inl [new file with mode: 0644]
flower/include/string-handle.hh [new file with mode: 0644]
flower/include/string-handle.inl [new file with mode: 0644]
flower/include/string.hh [new file with mode: 0644]
flower/include/text-db.hh [new file with mode: 0644]
flower/include/text-stream.hh [new file with mode: 0644]
flower/include/unionfind.hh [new file with mode: 0644]
flower/include/varray.hh [new file with mode: 0644]
flower/include/vector.hh [new file with mode: 0644]
flower/include/vsmat.hh [new file with mode: 0644]
flower/lgetopt.cc [new file with mode: 0644]
flower/lib/Makefile [deleted file]
flower/lib/choleski.cc [deleted file]
flower/lib/data-file.cc [deleted file]
flower/lib/dstream.cc [deleted file]
flower/lib/flower-version.cc [deleted file]
flower/lib/include/Makefile [deleted file]
flower/lib/include/assoc-iter.hh [deleted file]
flower/lib/include/assoc.hh [deleted file]
flower/lib/include/choleski.hh [deleted file]
flower/lib/include/compare.hh [deleted file]
flower/lib/include/cursor.hh [deleted file]
flower/lib/include/cursor.inl [deleted file]
flower/lib/include/cursor.tcc [deleted file]
flower/lib/include/data-file.hh [deleted file]
flower/lib/include/dstream.hh [deleted file]
flower/lib/include/fproto.hh [deleted file]
flower/lib/include/handle.hh [deleted file]
flower/lib/include/interval.hh [deleted file]
flower/lib/include/interval.tcc [deleted file]
flower/lib/include/iterate.hh [deleted file]
flower/lib/include/lgetopt.hh [deleted file]
flower/lib/include/libc-extension.hh [deleted file]
flower/lib/include/link.hh [deleted file]
flower/lib/include/link.inl [deleted file]
flower/lib/include/list.hh [deleted file]
flower/lib/include/list.inl [deleted file]
flower/lib/include/list.tcc [deleted file]
flower/lib/include/matrix.hh [deleted file]
flower/lib/include/path.hh [deleted file]
flower/lib/include/pcursor.tcc [deleted file]
flower/lib/include/plist.tcc [deleted file]
flower/lib/include/pqueue.hh [deleted file]
flower/lib/include/rational.hh [deleted file]
flower/lib/include/real.hh [deleted file]
flower/lib/include/scalar.hh [deleted file]
flower/lib/include/smat.hh [deleted file]
flower/lib/include/string-convert.hh [deleted file]
flower/lib/include/string-data.hh [deleted file]
flower/lib/include/string-data.inl [deleted file]
flower/lib/include/string-handle.hh [deleted file]
flower/lib/include/string-handle.inl [deleted file]
flower/lib/include/string.hh [deleted file]
flower/lib/include/text-db.hh [deleted file]
flower/lib/include/text-stream.hh [deleted file]
flower/lib/include/unionfind.hh [deleted file]
flower/lib/include/varray.hh [deleted file]
flower/lib/include/vector.hh [deleted file]
flower/lib/include/vsmat.hh [deleted file]
flower/lib/lgetopt.cc [deleted file]
flower/lib/libc-extension.cc [deleted file]
flower/lib/matdebug.cc [deleted file]
flower/lib/matrix.cc [deleted file]
flower/lib/path.cc [deleted file]
flower/lib/scalar.cc [deleted file]
flower/lib/smat.cc [deleted file]
flower/lib/string-convert.cc [deleted file]
flower/lib/stringtest.cc [deleted file]
flower/lib/stringutil.cc [deleted file]
flower/lib/text-db.cc [deleted file]
flower/lib/text-stream.cc [deleted file]
flower/lib/unionfind.cc [deleted file]
flower/lib/vector.cc [deleted file]
flower/libc-extension.cc [new file with mode: 0644]
flower/matdebug.cc [new file with mode: 0644]
flower/matrix.cc [new file with mode: 0644]
flower/path.cc [new file with mode: 0644]
flower/scalar.cc [new file with mode: 0644]
flower/smat.cc [new file with mode: 0644]
flower/string-convert.cc [new file with mode: 0644]
flower/stringtest.cc [new file with mode: 0644]
flower/stringutil.cc [new file with mode: 0644]
flower/test/Makefile
flower/test/result [new file with mode: 0644]
flower/text-db.cc [new file with mode: 0644]
flower/text-stream.cc [new file with mode: 0644]
flower/unionfind.cc [new file with mode: 0644]
flower/vector.cc [new file with mode: 0644]
init/Makefile
init/dutch.ini
init/dynamic.ini
init/script.ini
init/swedish.ini
init/symbol.ini
init/table_sixteen.ini
init/table_twenty.ini
input/Makefile
input/cadenza.ly
input/coriolan-alto.ly
input/error.ly
input/fugue1.midi.ly
input/kortjakje.ly
input/maartje.ly
input/martien.ly
input/midi.ly
input/mlalt.ly
input/mlcello.ly
input/mlvio1.ly
input/mlvio2.ly
input/new-twinkle.ly [new file with mode: 0644]
input/plet.ly
input/pre1.midi.ly
input/rhythm.ly
input/scales.ly
input/scsii-menuetto.ly
input/standchen.ly
input/twinkle.ly
input/wohltemperirt.ly
lib/Makefile
lib/include/Makefile
lily/.version
lily/Makefile
lily/beam.cc
lily/clef-reg.cc
lily/command-request.cc
lily/dimen.cc
lily/idealspacing.cc
lily/identifier.cc
lily/include/Makefile
lily/include/class-name.hh
lily/include/idealspacing.hh
lily/include/identifier.hh
lily/include/identparent.hh
lily/include/input-score.hh
lily/include/input-staff.hh
lily/include/keyword.hh
lily/include/lexer.hh
lily/include/linespace.hh
lily/include/local-key-reg.hh
lily/include/musical-request.hh
lily/include/p-col.hh
lily/include/p-score.hh
lily/include/p-staff.hh
lily/include/paper-def.hh
lily/include/qlpsolve.hh
lily/include/score.hh
lily/include/scoreline.hh
lily/include/staff-elem-info.hh
lily/include/staffelem.hh [deleted file]
lily/include/staffeleminfo.hh
lily/include/voice-element.hh
lily/include/voice.hh
lily/input-score.cc
lily/input-staff.cc
lily/key-item.cc
lily/key-reg.cc
lily/keyword.cc
lily/lexer.l
lily/lily-version.cc
lily/linespace.cc
lily/local-key-reg.cc
lily/molecule.cc
lily/musical-request.cc
lily/mylexer.cc
lily/note.cc
lily/p-col.cc
lily/p-score.cc
lily/paper-def.cc
lily/parser.y
lily/stem-beam-reg.cc
lily/tex-stream.cc
lily/text-def.cc
lily/version.cc
lily/warn.cc
make/Builtin-rules.make [deleted file]
make/Configure_variables.make.in
make/Files.make [new file with mode: 0644]
make/Include.make
make/Makefile
make/Rules.make
make/Stuff.make [deleted file]
make/Targets.make
make/Template.make
make/Variables.make
make/Version.make [new file with mode: 0644]
make/lilypond.spec.in
mi2mu/Makefile
mi2mu/include/Makefile
tex/Makefile

index c7b8c24c7701b001462656df759bc49e81c7938e..4448ee7d89b0c44683ac550c55095e4aa3b0bfed 100644 (file)
@@ -1,8 +1,7 @@
 # class name           silence?
 Dstream                        1
 
-My_flex_lexer          1
-yyFlexLexer            1
+My_flex_lexer          0
 PCol                   1
 Score_column           1
 Ineq_constrained_qp    1
@@ -14,7 +13,7 @@ Idealspacing          1
 
 # yydebug
 InitParser             1
-Parser                 1
+Parser                 0
 InitDeclarations       1
 
 # FlexLexer debug
index 71f7750ff1d9fd30008589c27793b8f506a35c1f..e268239e5d9d6ec7f253fcb9d31f170d95943a30 100644 (file)
--- a/.version
+++ b/.version
@@ -4,5 +4,5 @@ TOPLEVEL_PATCH_LEVEL = 42
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
-TOPLEVEL_MY_PATCH_LEVEL =
+TOPLEVEL_MY_PATCH_LEVEL =.3
 #
index df31a15ba0eb004dd2a269af60180847d21d084a..afcf2ffd5dcea4e8282c8ecfc054f67de75ae244 100644 (file)
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,4 +1,4 @@
-[Draft version]
+
 [Draft version]
 
 CALL FOR HACKERS: LilyPond, the Music Typesetter
index 8df4c8fd420e279c2622f25d34ce7b59200662ac..66ee04705f59eff746f3ebbdfc1ec86ae65bc0ef 100644 (file)
@@ -9,26 +9,29 @@ Please use these standards while doing programming for LilyPond
 Functions and methods do not return errorcodes, but use assert for
 checking status. 
 
-               A program should be light and agile, its subroutines
-       connected like a strings of pearls.  The spirit and intent of
-       the program should be retained throughout.  There should be
-       neither too little nor too much, neither needless loops nor
-       useless variables, neither lack of structure nor overwhelming
-       rigidity.
-
-               A program should follow the 'Law of Least
-       Astonishment'.  What is this law?  It is simply that the
-       program should always respond to the user in the way that
-       astonishes him least.
-
-               A program, no matter how complex, should act as a
-       single unit.  The program should be directed by the logic
-       within rather than by outward appearances.
-
-               If the program fails in these requirements, it will be
-       in a state of disorder and confusion.  The only way to correct
-       this is to rewrite the program.
-               -- Geoffrey James, "The Tao of Programming"
+=head2 Quote:
+
+A program should be light and agile, its subroutines
+connected like a strings of pearls.  The spirit and intent of
+the program should be retained throughout.  There should be
+neither too little nor too much, neither needless loops nor
+useless variables, neither lack of structure nor overwhelming
+rigidity.
+
+A program should follow the 'Law of Least
+Astonishment'.  What is this law?  It is simply that the
+program should always respond to the user in the way that
+astonishes him least.
+
+A program, no matter how complex, should act as a
+single unit.  The program should be directed by the logic
+within rather than by outward appearances.
+
+If the program fails in these requirements, it will be
+in a state of disorder and confusion.  The only way to correct
+this is to rewrite the program.
+
+-- Geoffrey James, "The Tao of Programming"
 
 =head2 INDENTATION
 
@@ -109,7 +112,7 @@ symbols. Staff is  the "brains" for PStaff
 NB: in PCursor (which is part of the library) P stands for PointerCursor
 
 
-=head2 MEMBERS(2)
+=head2 MEMBERS (2)
 
 Standard methods:
 
@@ -176,26 +179,33 @@ existed. I feel so stupid and ashamed!
 =over 5
 
 =item *
+
 more keystrokes (disk space!)
 
 =item *
+
 it looks silly C<get_slu_p()>
 
 =item *
+
 it looks like code from micro suckers
 
 =item *
+
 (which) might scare away some (otherwise good?)
 progammers, or make you a paria in the free
 software community
 
 =item *
+
 it has ambiguities
 
 =item *
+
 not very useful if not used consistently
 
 =item *
+
 usefullness in I<very large> 
 (but how many classes is very large?)
 remains an issue.
@@ -209,16 +219,20 @@ remains an issue.
 =over 5
 
 =item *
+
 learn about cut and paste / use emacs or vi
 or lean to type using ten fingers
 
 =item *
+
 Use emacs dabbrev-expand, with dabbrev-case-fold-search set to nil.
 
 =item *
+
 use no, or pick less silly, abbrvs.
 
 =item *
+
 use non-ambiguous postfixes C<identifier_name_type_modifier[_modifier]>
 =back
 
@@ -230,30 +244,41 @@ with the parts of the names separated by underscores.
 =over 5
 
 =item C<byte>
+
+
 unsigned char. (The postfix _by is ambiguous)
 
 =item C<b>
+
+
 bool
 
 =item C<bi>
+
 bit
 
 =item C<ch>
+
 char
 
 =item C<f>
+
 float
 
 =item C<i>
+
 signed integer
 
 =item C<str>
+
 string class
 
 =item C<sz>
+
 Zero terminated c string
 
 =item C<u>
+
 unsigned integer
 
 =back
@@ -275,21 +300,27 @@ These are precede the prefixes:
 =over 5
 
 =item C<a>
+
 array
 
 =item C<array>
+
 user built array.
 
 =item C<c>
-const
+
+const. Note that the proper order C<Type const> i.s.o. C<const Type>
 
 =item C<l>
+
 temporary pointer to object (link)
 
 =item C<p>
+
 pointer to newed object
 
 =item C<r>
+
 reference
 
 =back
@@ -297,24 +328,31 @@ reference
 =over 5
 
 =item C<loop_i>
+
 Variable loop: an integer
 
 =item C<u>
+
 Temporary variable: an unsigned integer
 
 =item C<test_ch>
+
 Variable test: a character
 
 =item C<first_name_str>
+
 Variable first_name: a String class object
 
 =item C<last_name_ch_a>
+
 Variable last_name: a C<char> array
 
 =item C<foo_i_p>
+
 Variable foo: an C<Int*> that you must delete
 
 =item C<bar_i_l>
+
 Variable bar: an C<Int*> that you must not delete
 
 =back
index 9f74fbb9a91b4208f1d6aa74f49d07c40f5c5996..272ea0d2799c04d09fc1dc1e09e9200f12deaa52 100644 (file)
@@ -8,22 +8,18 @@ depth = ..
 # identify module:
 #
 NAME = Documentation
-MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
-MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
-PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = ./$(depth)/lily/$(outdir)/.build
+
 #
 
 # generic variables:
 #
 include ./$(depth)/make/Variables.make 
+include ./$(depth)/make/Version.make
+include ./$(depth)/make/Files.make 
 #
 
-# list of source files:
 #
-PODFILES = $(shell ls *.pod)
+
 OUTPODFILES = $(patsubst %,$(outdir)/%,$(PODFILES))
 TEXTFILES = $(OUTPODFILES:.pod=.text)
 GROFFFILES = $(OUTPODFILES:.pod=.1)
@@ -32,7 +28,7 @@ HTMLFILES = $(OUTPODFILES:.pod=.html)
 
 # list of distribution files:
 #
-DISTFILES = $(PODFILES) Makefile lelie_logo.gif
+EXTRA_DISTFILES = lelie_icon.gif lelie_logo.gif
 #
 
 default: do-doc
index 2c5ceb2cb97673829fa6bbb792e9bb841cb18bab..d63883106d0e61c4af45280c52615cbd227e6407 100644 (file)
@@ -6,6 +6,40 @@ FAQ - LilyPond FAQs
 
 Some questions that have been answered before.
 
+Q: I can type
+
+       <a c> <e g>
+
+to make a few chords, but why do I have to type
+
+
+       < { a() e } { c () g } >
+
+in stead of
+
+       <a( c(> <)e )g>
+
+to generate  slurs between the chords?
+
+A: When you type 
+
+       <a c> <e g>
+
+this is shorthand for
+
+       < { a } { c } > < { e } { g } >
+
+Slurs have to be confined to `voices', and the a and the e are in
+different {} blocks, so they are in different voices. You should view
+the desired construct as a "generalised chord" (two voices stacked
+vertically). It might help you visualise this by using the following
+formatting:
+
+       < { a () e }
+         { c () g }
+       >
+
+
 Q: Why are [] around the notes, and () inbetween?
 
 A: [] designate beams, a note can only be in one beam at the same
diff --git a/Documentation/lelie_icon.gif b/Documentation/lelie_icon.gif
new file mode 100644 (file)
index 0000000..59b6c23
Binary files /dev/null and b/Documentation/lelie_icon.gif differ
index 1ac0c5290d31ae837e68f566d9dc6fcbedbc5e47..b4d2f078137e5303e7664df8821fa05d8784c186 100644 (file)
@@ -174,7 +174,9 @@ To decide on merging, C<Complex_staff> has grouped several
 registers. There are a few groups:
 
 =item *
+
 Staff wide, contains
+
        Local_key_register
        Bar_register
        Key_register
@@ -182,13 +184,17 @@ Staff wide, contains
        Clef_register
 
 =item *
+
 Voice group, contains
+
        Stem_beam_register
        Script_register
        Text_register
 
 =item *
+
 Voice, contains
+       
        Slur_register
        Notehead_register
 
@@ -316,7 +322,7 @@ Ross, Ted. ``Teach yourself the art of music engraving and processing''
        Miami, FL  33139
        (305) 532-5461
 
-[This is about *engraving* i.e. professional music typesetting, and includes 
+[This is about I<engraving> i.e. professional music typesetting, and includes 
 some good spacing tables]
  
 Read, Gardner. ``Modern Rhythmic Notation.'' Indiana University Press, 1978.
diff --git a/Documentation/lilyinput-pre-0.1.pod b/Documentation/lilyinput-pre-0.1.pod
new file mode 100644 (file)
index 0000000..58a4378
--- /dev/null
@@ -0,0 +1,79 @@
+=head1 NAME
+
+LilyInput -  LilyPond input format
+
+=head1 DESCRIPTION
+
+This page globally documents the the LilyPond input format, mudela.
+To get a better impression, please study some examples.
+
+=head2 Overview
+
+General format of a construct:
+
+       BLOCKNAME {  <info to go with this block>   }
+
+Some types allow declarations:
+
+       IDENTIFIER = BLOCKNAME {
+               <info to go with this block>
+       }
+
+       ..
+
+       BLOCKNAME {
+               IDENTIFIER
+               ...
+       }
+
+
+In musicmode, eg,
+
+       ''!c8.-"text"_v
+
+and in lyricmode, eg,
+
+       Twin- kle, twin- kle lit- tle star,2
+
+a lot of characters parse differently
+than in "command" mode, eg,
+
+       identifier = score { .. }
+
+So you have to signal this to the tokenizer. This is done with
+'$'. '$' is a delimiter, which used by the tokenizer only. The same
+goes for lyrics, it has a '@' delimiter.
+
+=item *
+musicmode: The brace still is used to group grammatical groups.
+
+=item *
+musicmode: "word" are preceded by a '\' (backslash)
+
+This means you can write some stuff in a zillion ways:
+
+=item 1.
+       $\var = \blockname { ... } $
+
+=item 2.
+       var = blockname { $ ... $ } 
+
+=item 3.
+       var = $ $ $\blockname {  ... $ } 
+
+=head2 Comments
+
+Not really crystallized; you can use '#' or '%' as line comment
+
+=head2 other
+
+LilyPond first reads 'symbol.ini', which contains declarations crucial
+to proper operation of LilyPond (symbol tables, note names).
+
+This language looks a lot like Rayce's (Rayce is a raytracer that I've
+written as a hobby project. I used as a practice program for writing
+(among others) C++ and Yacc. It also gave me RSI :-( ) which in turn
+owes a lot to the POVRay raytracer. Now, I know, musictypesetting and
+Raytracing do not necessarily require the same input format, but I was
+just to lazy to make up a new and/or better input format. Suggestions
+appreciated.
index 58a4378d4b9ec862f8958a797b2603457a539f4c..b7fe60ff83c5f45ab52b734a7f8b24ccaf23a79a 100644 (file)
 =head1 NAME
 
-LilyInput -  LilyPond input format
+LilyInput -  LilyPond input format -- Mudela 0.1
+
+B<NOTICE:> this doc describes the I<new> input format, S<Mudela 0.1>.
 
 =head1 DESCRIPTION
 
-This page globally documents the the LilyPond input format, mudela.
-To get a better impression, please study some examples.
+This document describes the the LilyPond input format, which is an
+effective language for definining music.  We call this language
+(rather arrogantly) The Musical Definition Language (S<Mudela 0.1>).
 
-=head2 Overview
+The first aim of Mudela is to define a piece of music, 
+being complete from both from a musical typesetting, 
+as from a musical performing point of view.
 
-General format of a construct:
+The design of Mudela has been (perfect past tense, hopefully)
+an ongoing process, 
+the most important criteria being:
 
-       BLOCKNAME {  <info to go with this block>   }
+=over 4
 
-Some types allow declarations:
+=item *
 
-       IDENTIFIER = BLOCKNAME {
-               <info to go with this block>
-       }
+define the (musical) message of the composer as unambiguously as possible,
 
-       ..
+=item *
 
-       BLOCKNAME {
-               IDENTIFIER
-               ...
-       }
+be intuitive, and easily readable 
+(compared to, say, Musi*TeX input, or MIDI :-),
+
+=item *
+
+be writable in ASCII with a simple texteditor, yfte(TM).
+
+=back
+
+Other considerations were (and will be):
+
+=over 4
+
+=item *
+
+be able to edit the layout 
+without danger of changing the original music (Urtekst),
+
+=item *
+
+allow for adding different interpretations, again, 
+without danger of changing the original,
+
+=item *
+
+easy to create a conductor's score, 
+as well as the scores for all individual instruments,
 
+=item *
+
+provide simple musical manipulations, such as 
+S<(i) extracting> a slice of music from a previously defined piece, 
+S<(ii) extracting> only the rhythm from a piece of music, 
+S<(iii) transposing>, etc.,
+
+=item *
+
+easy to comprehend to both programmers and others.
+
+=back
+
+Musical pieces could be
+
+=over 5
+
+=item *
 
-In musicmode, eg,
+Mahlerian orchestral scores,
 
-       ''!c8.-"text"_v
+=item *
 
-and in lyricmode, eg,
+piano pieces (Schubertian, Rachmaninovian),
 
-       Twin- kle, twin- kle lit- tle star,2
+=item *
 
-a lot of characters parse differently
-than in "command" mode, eg,
+pop songs (lyrics and chords),
 
-       identifier = score { .. }
+=item *
 
-So you have to signal this to the tokenizer. This is done with
-'$'. '$' is a delimiter, which used by the tokenizer only. The same
-goes for lyrics, it has a '@' delimiter.
+gregorian chants,
 
 =item *
-musicmode: The brace still is used to group grammatical groups.
+
+Bach multivoice organ pieces,
 
 =item *
-musicmode: "word" are preceded by a '\' (backslash)
 
-This means you can write some stuff in a zillion ways:
+short excerpts to be used in musicological publications.
+
+=back
 
-=item 1.
-       $\var = \blockname { ... } $
 
-=item 2.
-       var = blockname { $ ... $ } 
+=head1 Overview
 
-=item 3.
-       var = $ $ $\blockname {  ... $ } 
+The Musical Definition Language (Mudela) S<version 0.1>,
+has a logical structure, 
+making use of typing and naming (using identifiers),
+that allows for flexible input, and definition reuse.
 
 =head2 Comments
 
-Not really crystallized; you can use '#' or '%' as line comment
+Line comments are introduced by a C<%>
+
+=head2 Keywords
+
+Keywords are preceded by a backslash "\".
+
+The actual musical part of Mudela that defines a melody, is known as 
+I<simple mudela>. 
+
+Mudela uses the brace (C<{> and C<}>) for hierarchical structures. To
+aid the eye in reading, for chords we have used the C<<> and the C<>>
+as nesting braces. 
+
+
+The general structure consists of declarations:
+
+       IDENTIFIER = \TYPE{
+               <type specific data>
+       }
+
+and instantiations:
+
+       \TYPE{ <type specific data> }
+
+(Currently, C<\score> is the only type that can be instantiated
+at top level. Currently declarations can only be done at top level)
+
+Most instantiations that use an IDENTIFIER are specified as follows:
+
+       \TYPE { IDENTIFIER [...] }
+
+Some exceptions on this rule have been made to prevent inputting
+Mudela becoming tedious
+
+=head1 Music
+
+=head2 Simple mudela
+
+Simple mudela is the most common type of music.  It consists of a list
+of notes, chords, and commands.  The below included for explanatory
+purposes only (i.e., for a complete and up-to-date definition, see
+F<lily/parser.y> and F<lily/lexer.l>):
+
+Simple mudela basically is a sequence of the notes you want to
+enter. 
+
+       a'4     % dutch names
+
+is a A-1 pitched quaver. The ' signifies an octave change.
+A-1 is 440 Hz concert-pitch. C<c'> is also known as the central
+c. More examples:
+
+       a`      % 110
+       a       % 220
+       a'      % 440
+       a''     % 880
+
+another example:
+
+       as`4.*2/3
+
+This is an A flat, (just below 110 Hz concert-pitch). The C<*2/3>
+signifies that this note is part of a triplet (3 in stead of 2). The
+duration is one and a half quaver times 2/3. 
+
+The default language for notenames is defined to be dutch,
+
+       % double sharp
+       cisis disis eisis fisis gisis aisis bisis
+       % sharps
+       cis dis eis fis gis ais bis
+       % naturals
+       c d e f g a b 
+       % flats
+       ces des es fes ges as bes
+       % double flats
+       ceses deses eses feses geses ases beses
+
+The standard notenames also have uppercase versions, which octavate
+down:
+
+       a       % 220
+       A       % 110
+       'A      % 55
+       A'      % 220
+
+These notenames along with duration is enough material to construct
+simple melodies:
+
+       c4 c4 g4 g4 a4 a4 g2
+       f4 f4 e4 e4 d4 d4 c2
+
+Music is able to express more. generally speaking, the other
+'features' are either connected between notes (slurs, beams: spanning
+requests) or attached to notes (eg. accents). The former are
+implemented as START and STOP stop features and then attached to the note.
+
+       []      START/STOP a beam
+       ()      START/STOP a slur
+
+
+example: 
+
+       [c8 () d8 () e8 ]
+
+Please note that these two parentheses do I<not> necesarrily nest, eg:
+
+       [c8 e8(] [)g8 c'8]
+
+
+Symbols which can be put at either side of a staff are entered as follows:
+
+       a-^     % marcato, direction: default
+       a^-     % portato, direction: above note
+       a_.     % staccato, direction: below note
+       a^\script { "symbolindex"  . . . } % see script.ini for details.
+
+Dynamics can be put after the notename:
+
+       a4 \dynamic { 0 } % 0 = fff, 7 = ppp
+
+Mudela defines the following dynamic identifiers:
+
+       ppp pp p mp mf df ff fff        % df iso f, f is a notename.
 
-=head2 other
+The general form of a note is:
 
-LilyPond first reads 'symbol.ini', which contains declarations crucial
+       post-requests de-octavate notename octavate duration pre-requests 
+
+Notenames are just identifiers, and can be declared for any
+language appropriate (see F<dutch.ini>). 
+
+
+=head2 Lyrics
+
+Lyrics in Mudela resemble Simple mudela a lot, 
+with notes substituted by text.
+All syllables are entered separately, separated by whitespace
+("Twin-4 kle4 twin-4 kle4 ... ").
+Two syllables or words that compose a single duration entry
+are bound together using an underscore ("He_could4 not4").
+
+=head2 Rhythms
+
+Rhythms in Mudela are entered identical to Simple mudela.
+The melodic part of the information is ignored.
+
+=head1 STRUCTURE
+
+In concrete, a piece of Mudela has the following structure:
+
+       % declare pieces of music:
+       melody = \music{ <simple mudela> }
+       accompany = \music{ <simple mudela> }
+
+       % instantiate (=create tex, midi output) the score:
+       \score{ 
+               \staff{ melody }
+               \staff{ accompany }
+               \commands{ <score global commands> }
+               \midi{ <midi definitions> }
+               \paper{ <paper and layout definitions }
+       }
+
+=head2 Examples
+
+Examples are included with the LilyPond distribution. For the sake of
+maintenance no long examples are included in this document.
+
+
+=head2 Other
+
+LilyPond first reads F<symbol.ini>, which contains declarations crucial
 to proper operation of LilyPond (symbol tables, note names).
 
-This language looks a lot like Rayce's (Rayce is a raytracer that I've
-written as a hobby project. I used as a practice program for writing
-(among others) C++ and Yacc. It also gave me RSI :-( ) which in turn
-owes a lot to the POVRay raytracer. Now, I know, musictypesetting and
-Raytracing do not necessarily require the same input format, but I was
-just to lazy to make up a new and/or better input format. Suggestions
-appreciated.
+=head1 Decisions (Sat 1997-3-15, dommelpijpje no21)
+
+=over 4
+
+=item *
+
+\keyword, bo difference notes vs. notenames,
+
+=item *
+
+{} hierachical, nest.,
+
+=item *
+
+<> chords,
+
+=item *
+
+drop staff (NOT)?,
+
+=item *
+
+melody = \melodic{ } vs. \melodic melody = { }
+
+=item *
+
+lexer mode switch by types: \lyric{ }, \melodic{ }, etc.,
+
+=item *
+
+octaves: low 'C C c c' c'' high; 'c' == c === "c-klein", comment: a '
+' a . Which ' for which a? Now using a!'`.
+
+=over 4
+
+=item *
+
+\meter{ 2/4 },
+
+=item *
+
+\grouping{ 2*8 3*8 },
+
+=item *
+
+\skip{ 2: 2*8 3*32 },
+
+=item *
+
+abbrev: [c2 c2]\noplet{1/2} (wat bout [c2 c2]1/2\noplet?),
+
+=item *
+
+abbrev: c4=16 (heu, =?),
+
+=item *
+
+plet === midi-note: c4*2/3; c4*385/384,
+
+=back
+
+=item *
+
+drop \music,
+
+=item *
+
+\meter compulsory in Simple mudela,
+
+=item *
+
+++ concat
+
+=item *
+
+C<+> is  merge
+
+=item *
+
+       \transpose{ \from c \to g \melodic{ c d e } }
+       \transpose{ \from c \to g melody } %!?
+
+=item *
+
+       \extract{ \from 2:3*4 \to 5 oboe }
+
+=back
+
index 09ce63e36e2d783df928d70af455c84759abbbe5..067c596d743a7bb7c7e694265f2bc8c7aba4df64 100644 (file)
@@ -66,34 +66,43 @@ add F<DIRECTORY> to the search path for input files.
 =over 5
 
 =item *
+
 ASCII script input, with identifiers (for music reuse),
 customizable notenames, customizable fontset
 
 =item *
+
 MIDI output lets you check if you have entered the correct notes.
 
 =item *
+
 MIDI to Mudela conversion through the mi2mu program.
 
 =item *
+
 Multiple staffs in one score. Each staff can have a different meters.
 
 =item *
+
 multiple stafftypes (melodic, rhythmic) [broken from  pl28 on]
 
 =item *
+
 beams, slurs, chords, super/subscripts (accents and text),
 triplets, general n-plet (triplet, quadruplets, etc.), lyrics
 
 =item *
+
 multiple voices within one staff; beams optionally shared
 between voices. (well, more than 2 voices won't look pretty --yet.)
 
 =item *
+
 multiple scores within one input file. Each score is output to
 a different file.
 
 =item *
+
 clef changes, meter changes, cadenza-mode, key changes, repeat bars
 
 =back
@@ -105,29 +114,14 @@ LilyPond was written with some considerations in mind:
 =over 5
 
 =item *
+
 Describing a well-defined language for defining music. We call
 this language (rather arrogantly) The Musical Definition Language
 (mudela for short). LilyPond reads a mudela sourcefile and outputs a
-TeX file.  This musical definition language should:
-
-=over 5
-
-=item 1.
-define the musical message of the writer as unambigiously as
-possible.
-
-=item 2.
-be easily readable. (as compared to, say, MusixTeX input)
-
-=item 3.
-be writable in ASCII (with a simple texteditor).
-
-=back
-
-At this time, the language isn't yet defined precisely. It is evolving as
-LilyPond is getting more complex.
+TeX file.  
 
 =item *
+
 We want to provide an easy-to-use interface for typesetting music in
 its broadest sense. This interface should be intuitive from a musical
 point of view. By broadest sense we mean: it is designed for music
@@ -135,35 +129,41 @@ printed left to right in staffs, using notes to designate rythm and
 pitch.
 
 =item *
+
 LilyPond uses MusiXTeX fonts and TeX for its output. This is not a key
 issue: in a future version, LilyPond might bypass TeX, but at the moment
 TeX is very convenient for producing output.
 
 =item  *
+
 Generate high-quality output. Ideally it should be of a professional
 quality. We'd like to render Herbert Chlapiks words, "Fine music
 setting is not possible without a knowledgeable printer,"  untrue.
 
 =item *
+
 LilyPond does not display notes directly, nor will it be rehacked to be
 used interactively. LilyPond writes output to a file.  It will not be
 extended to play music, or to recognize music.
 
 =item *
+
 LilyPond is intended to run on Unix platforms, but it should
 be portable to any platform which can run TeX and the GNU tools
 
 =item *
+
 LilyPond is free. Commercial windows packages for setting music are
 abundant. Free musicprinting software is scarce.
 
 =item *
+
 LilyPond is written in GNU C++. It will not be downgraded/ported to fit
 broken systems.
 
 =back
 
-=head1 
+=head1
 DISCLAIMER & COPYING POLICY
 
 LilyPond is copyright 1996,97 by its authors. LilyPond is
@@ -177,14 +177,17 @@ the GNU General Public License, which is in the file F<COPYING>
 =over 5
 
 =item *
+
 Han-Wen Nienhuys <hanwen@stack.nl>, Main author
 
 =item *
+
 Jan Nieuwenhuizen <jan@digicash.com>, Context errors, Lyrics,
 mi2mu, MIDI stuff, make structure, bits of FlowerLib, general
 comments.
 
 =item *
+
 Mats Bengtsson <matsb@s3.kth.se>, bugfixes, testing, general comments.
 
 =back
@@ -207,7 +210,7 @@ This is what the output looks like over here:
        LilyPond 0.0.40 #0/FlowerLib 1.1.7 #2. Compile: Mar 11 1997, 22:58:47 (g++ 2.7.2)
        Parsing ... [./init//symbol.ini[./init//dynamic.ini][./init//dutch.ini][./init//script.ini][./init//table_sixteen.ini]][./input/wohltemperirt.ly]
        Setting up music ...Processing music ............
-       Preprocessing ... 
+       Preprocessing ...
        Calculating column positions ... [3][6][9]
        Postprocessing ...
        TeX output to lelie.out ...
@@ -249,7 +252,7 @@ This is a beta version of LilyPond. Please send your helpful comments
 and patches to me (see AUTHORS section)
 
 LilyPond is updated very frequently, the latest version is always available at:
-ftp://pcnov095.win.tue.nl/pub/lilypond. 
+ftp://pcnov095.win.tue.nl/pub/lilypond.
 
 
 =head1 FILES
@@ -265,7 +268,7 @@ includes files from the directory F<init/>.
 =head1 SEE ALSO
 
 There are some documentation files  in the subdirectory F<Documentation/>,
-among others: lilygut, lilyinput, error, faq, 
+among others: lilygut, lilyinput, error, faq,
 
 =head1  REMARKS
 
index 515c41da0f93d4f51e6abc0447a8abeef4460cf4..fa4c437bca4e99f8dc46282c02d6b07fcb46f111 100644 (file)
@@ -61,7 +61,7 @@ C\bC\bC\bCO\bO\bO\bON\bN\bN\bNF\bF\bF\bFI\bI\bI\bIG\bG\bG\bGU\bU\bU\bUR\bR\bR\bRI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG a\b
 
 
 
-14/Mar/97                LilyPond 0.0.41                        1
+14/Mar/97                LilyPond 0.0.42                        1
 
 
 
@@ -127,7 +127,7 @@ R\bR\bR\bRU\bU\bU\bUN\bN\bN\bNN\bN\bN\bNI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG
 
 
 
-14/Mar/97                LilyPond 0.0.41                        2
+14/Mar/97                LilyPond 0.0.42                        2
 
 
 
@@ -193,6 +193,6 @@ A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
 
 
 
-14/Mar/97                LilyPond 0.0.41                        3
+14/Mar/97                LilyPond 0.0.42                        3
 
 
index 9c9f9b7737840bfcfc6b763183599a4dfc79319e..7ac03e335c42fc237ff8e70b40f7a20f9db90777 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,15 +16,8 @@ depth = .
 # identify module:
 #
 NAME = lilypond
-
-# edit in .version only!
-MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
-MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
-PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = ./$(depth)/lily/$(outdir)/.build
-#
+include .version
+include ./$(depth)/make/Version.make
 
 # generic variables:
 #
@@ -42,7 +35,7 @@ SUBDIRS = flower lib lily mi2mu \
 # SYMLINKS = # naah, configure
 SCRIPTS = configure configure.in install-sh
 README_FILES = ANNOUNCE COPYING NEWS README TODO INSTALL.text
-DISTFILES= Makefile .dstreamrc .version $(README_FILES) $(SCRIPTS) $(SYMLINKS)
+EXTRA_DISTFILES=  .dstreamrc .version $(README_FILES) $(SCRIPTS) $(SYMLINKS)
 #
 
 
@@ -55,9 +48,8 @@ include ./$(depth)/make/Rules.make
 localdist: configure
 
 # ugh. I know dep is not quite what is really needed.
-INSTALL.text: Documentation
+INSTALL.text: check-doc-deps
        rm -f INSTALL.text
-       $(MAKE) -C Documentation
        ln `find -name INSTALL.text|head -1` .
 
 localclean:
diff --git a/NEWS b/NEWS
index c4e313d9b958ad92731ce8ae1266e5078b495e5e..0ed6c6a5d514490335c00133d58b7057ec2b56a8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,20 @@
+pl 42.3
+       - const naming change (T const <-> const T)
+       - Mudela 0.1
+
+pl 42.2
+       - new lilyinput (Mudela 0.1) doc.
+Examples
+       - new-twinkle.ly (in Mudela 0.1, hopefully)
+
+pl 42.1
+       - further Makefile revamping.
+       - moved flowerlib
+
+*******
+pl 42
+
+
 pl 41.hwn3
        - struct Lexer_prefs
        - parser bug
diff --git a/TODO b/TODO
index 8f67365717629ad87e4a196d5fe1b1832b9ff54f..6a36fe3b9df73d8627eeb1a820d15b2fe73666db 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,9 +1,8 @@
-       * remove notename.* README.pod LilyPond.pod
-
 before 0.1
+       * fix Lyric mode
 
        * remove spurious/outdated comments in .ly, debug .ly
-       
+
        * pushgroup, popgroup.
 
        * basic dynamics
@@ -11,26 +10,19 @@ before 0.1
        * basic syntax & parser/lexer cleanup.
 
        * decent TeX page layout
-
-       * clean split for m2m of sources.
-
-       * caching of Register_group_register hierarchies.
+       
+       * avoid unnecessary confusing constructs from .ly
 
 This is an assorted collection of stuff that will be done, might be
 done, or is an idea that I want to think about
 
 MAKE-STUFF
 
-       * fix increase build ( libflower rebuilt when making lilypond. )
-
        * sort out headers, see m2m
 
        * do platform stuff: configure, header(s), targets, build (out?)
-
-       * make install.
        
 BUGS
-       * plet bugs: scales.ly
 
        * key at clef change.
 
@@ -48,26 +40,35 @@ BUGS
 
 SEVERELY LACKING:
 
+       * hairpins
+
        * grace notes
 
+FURTHER FOR ORCHESTRAL SCORE:
+
+       * multibar rests
+
+       * barnumbers, markers
+
+       * abbreviations c4=16
+
 INPUTLANGUAGE
 
        * read ENV for include path 
 
-       * lose the $ and @ ?
-
        * figured bass?
 
        * transposition
 
        * rest name configurable
 
-       * < .. > vs. { .. } syntax? ! 
+SMALLISH PROJECTS
 
-       * '*' vs. '/'
+       * use dstream feature in mi2mu
 
-SMALLISH PROJECTS
+        * qtor, btor, mtor-> tor( QUIET_ver ), tor( DEBUG_ver ), etc.
 
+       * use tors feature in lily
 
        * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
 
@@ -101,6 +102,9 @@ SMALLISH PROJECTS
        * Brackets
 
        * space rest.
+       
+       * caching of Register_group_register hierarchies.
+
 
        * use (char *) iso. String for communication between lexer and
        parser.
@@ -151,8 +155,6 @@ FUTURE
 
        * piano staff
 
-       * abbreviations a4*8
-
 IDEAS
 
        * integrate Register/Midi stuff
index c1c076781183d73a953d2074a7690bf69b23e1b2..7284a0b5ffd02a85e8d5b2cb257090d8050fcde4 100644 (file)
@@ -5,16 +5,14 @@
 depth = ..
 #
 
-build = ./$(depth)/lily/$(outdir)/.build
-
+include ./$(depth)/make/Include.make
 # generic stuff/Makefile
 #
-include ./$(depth)/make/Stuff.make
 #
 
 # list of distribution files:
 # 
-SCRIPTS = clearlily cpgento genheader make_patch make_version make_website
-DISTFILES = Makefile $(SCRIPTS)
+SCRIPTS = clearlily cpgento genheader make_patch make_version make_website release
+EXTRA_DISTFILES = $(SCRIPTS)
 #
 
diff --git a/bin/release b/bin/release
new file mode 100755 (executable)
index 0000000..faec64d
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+
+function setversion() {
+eval `sed -n 's/^\([A-Z_]*\) *= *\(.*\)$/\1=\2/p' .version`
+MJ=$TOPLEVEL_MAJOR_VERSION
+MI=$TOPLEVEL_MINOR_VERSION
+PA=$TOPLEVEL_PATCH_LEVEL 
+MP=$TOPLEVEL_MY_PATCH_LEVEL
+NEWVER=$MJ.$MI.$PA$MP
+if [ -z $MP ]
+then
+    LASTVER=$MJ.$MI.`expr $PA - 1`
+else
+       LASTVER=$MJ.$MI.$PA
+fi
+
+echo
+echo "Current  version ("`pwd`") is $NEWVER, Last version:  $LASTVER"
+echo
+}
+heredir=`pwd`
+    make dist; 
+    setversion
+    LILYVER=$NEWVER
+    cp lilypond-$LILYVER.tar.gz ../releases
+    $heredir/bin/make_patch $LASTVER $NEWVER lilypond
+    gzip -f9 patch-$NEWVER
+    mv {lilypond-,patch-}*.gz ../
+cd ..
+tar cf updeet {lily,patch-}*.gz
+
+mv patch-*gz patches/
+mv lilypond*tar.gz releases/
+
+#time make 
index bd351d2ca46ef8a85824ebbee977e8dadc5364d9..c79b71d92c35f6fe2ce096c93d7e6d8bda33fe00 100755 (executable)
--- a/configure
+++ b/configure
@@ -12,15 +12,15 @@ ac_help=
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
 ac_help="$ac_help
-  printing       set debug printing"
+  enable-printing        set debug printing"
 ac_help="$ac_help
-  checking       set runtime checks"
+  disable-checking       set runtime checks"
 ac_help="$ac_help
-  debug          set debug info"
+  disable-debug          set debug info"
 ac_help="$ac_help
-  optimise       use maximal speed optimisations"
+  enable-optimise       use maximal speed optimisations"
 ac_help="$ac_help
-  profiling      compile with gprof support"
+  enable-profiling      compile with gprof support"
 ac_help="$ac_help
   texprefix=DIR  set the tex-directory to put the lilypond subdir in."
 
@@ -457,7 +457,7 @@ echo > confdefs.h
 
 # A filename unique to this package, relative to the directory that
 # configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=flower/lib/choleski.cc
+ac_unique_file=flower/choleski.cc
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
@@ -524,6 +524,8 @@ else
 fi
 
 
+
+
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -542,14 +544,14 @@ fi
 # Check whether --enable-checking or --disable-checking was given.
 if test "${enable_checking+set}" = set; then
   enableval="$enable_checking"
-  :
-else
   DEFINES="$DEFINES -DNDEBUG=1"
 fi
 
 # Check whether --enable-debug or --disable-debug was given.
 if test "${enable_debug+set}" = set; then
   enableval="$enable_debug"
+  :
+else
   DEFINES="$DEFINES -g"
 fi
 
@@ -619,7 +621,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
   ac_cv_prog_gxx=no
@@ -1021,12 +1023,12 @@ ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
 ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
   CXXCPP="${CXX-g++} -E"
   cat > conftest.$ac_ext <<EOF
-#line 1025 "configure"
+#line 1027 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1048,12 +1050,12 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1052 "configure"
+#line 1054 "configure"
 #include "confdefs.h"
 #include <FlexLexer.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1059: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1407,6 +1409,8 @@ touch make/out/Site.make
 # ugr
 (cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
 )
+# rgu
+sed 's/TOPLEVEL_//g' <  .version >  lily/.version
 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
 )
  (cd flower;
index 4e48c76e27d2c76dac2f7f85b207994255747bd2..cbb44304995098b79545ada035624182810715a3 100644 (file)
@@ -34,26 +34,28 @@ AC_DEFUN(AC_TEX_SUBDIR, [
     AC_MSG_RESULT($$1)
 ])
 
+AC_INIT(flower/choleski.cc)
+
 
-AC_INIT(flower/lib/choleski.cc)
 AC_LANG_CPLUSPLUS
 
 AC_ARG_ENABLE(printing,
-       [  printing       set debug printing],
+       [  enable-printing        set debug printing],
        [],
        [DEFINES="$DEFINES -DNPRINT=1"])
 AC_ARG_ENABLE(checking,
-       [  checking       set runtime checks],
-       [],
-       [DEFINES="$DEFINES -DNDEBUG=1"])
+       [  disable-checking       set runtime checks],
+       [DEFINES="$DEFINES -DNDEBUG=1"],
+       [])
 AC_ARG_ENABLE(debug,
-       [  debug          set debug info],
+       [  disable-debug          set debug info],
+       [],
        [DEFINES="$DEFINES -g"])
 AC_ARG_ENABLE(optimise,
-       [  optimise       use maximal speed optimisations],
+       [  enable-optimise       use maximal speed optimisations],
        [DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED"])
 AC_ARG_ENABLE(profiling,
-       [  profiling      compile with gprof support],
+       [  enable-profiling      compile with gprof support],
        [DEFINES="$DEFINES -pg"])
 AC_ARG_ENABLE(texprefix,
        [  texprefix=DIR  set the tex-directory to put the lilypond subdir in.],
@@ -154,6 +156,8 @@ touch make/out/Site.make
 (cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
 dnl    echo 0 > out/.build
 )
+# rgu
+sed 's/TOPLEVEL_//g' <  .version >  lily/.version
 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
 dnl    echo 0 > out/.build
 )
index 45d4ace49282eada95c2aff9d7f143aca304f50e..c4828f0767628534a1996123f5eeb301d72d1d17 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 1
 MINOR_VERSION = 1
-PATCH_LEVEL = 7
+PATCH_LEVEL = 8
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = # include separator: "-1" or ".a"
 #
index a4ee94bd5ddbc4f66414c62754f70d04b1fe53a1..6a71998fdeb983afacf5d0cea099154e3b0b8c4a 100644 (file)
@@ -19,28 +19,29 @@ NAME = flower
 MODULE_NAME = flower
 #
 # edit .version only
-include ./$(depth)/flower/.version
 include ./$(depth)/.version
-build = ./$(depth)/flower/$(outdir)/.build
-#
+include ./$(depth)/flower/.version
 
 # generic variables:
 #
-include ./$(depth)/make/Variables.make 
-#
+include ./$(depth)/make/Variables.make
+include ./$(depth)/make/Files.make 
 
+#
+CXXFLAGS+=-O2
 # descent order into subdirectories:
 #
-SUBDIRS = lib test
+SUBDIRS = test include
 #
 
 # list of distribution files:
 #
 SCRIPTS = 
 README_FILES = NEWS README TODO
-DISTFILES= configure config.hh.in configure.in Makefile .version $(README_FILES) $(SCRIPTS)
+EXTRA_DISTFILES= configure config.hh.in configure.in .version $(README_FILES) $(SCRIPTS)
 #
 
+
 # generic targets and rules:
 #
 include ./$(depth)/make/Targets.make
index e4d17c55f5640778b962a74963f07e08a08ceba1..4dd53307435b0c69d7ac1052fbfe0da9b374df44 100644 (file)
@@ -1,3 +1,6 @@
+pl 1.1.8
+       
+
 pl 1.1.7
        - PQueue blondification.
        - String_convert::i2hex_str fix, unsigned eqvs introduced
diff --git a/flower/choleski.cc b/flower/choleski.cc
new file mode 100644 (file)
index 0000000..1d64f94
--- /dev/null
@@ -0,0 +1,91 @@
+#include "choleski.hh"
+const Real EPS = 1e-7;         // so sue me. Hard coded
+
+Vector
+Choleski_decomposition::solve(Vector rhs)const
+{
+    int n= rhs.dim();
+    assert(n == L.dim());
+    Vector y(n);
+
+    // forward substitution
+    for (int i=0; i < n; i++) {
+       Real sum(0.0);
+       for (int j=0; j < i; j++)
+           sum += y(j) * L(i,j);
+       y(i) = (rhs(i) - sum)/L(i,i);
+    }
+    for (int i=0; i < n; i++)
+       y(i) /= D(i);
+
+    // backward subst
+    Vector &x(rhs);            // using input as return val.
+    for (int i=n-1; i >= 0; i--) {
+       Real sum(0.0);
+       for (int j=i+1; j < n; j++)
+           sum += L(j,i)*x(j);
+       x(i) = (y(i) - sum)/L(i,i);
+    }
+    return x;
+}
+
+/*
+  Standard matrix algorithm.
+  */
+
+Choleski_decomposition::Choleski_decomposition(Matrix P)
+    : L(P.dim()), D(P.dim())
+{
+    int n = P.dim();
+    assert((P-P.transposed()).norm()/P.norm() < EPS);
+
+    L.unit();
+    for (int k= 0; k < n; k++) {
+       for (int j = 0; j < k; j++){
+           Real sum(0.0);
+           for (int l=0; l < j; l++)
+               sum += L(k,l)*L(j,l)*D(l);
+           L(k,j) = (P(k,j) - sum)/D(j);
+       }
+       Real sum=0.0;
+       
+       for (int l=0; l < k; l++)
+           sum += sqr(L(k,l))*D(l);
+       Real d = P(k,k) - sum;
+       D(k) = d;
+    }
+
+#ifdef NDEBUG
+    assert((original()-P).norm() / P.norm() < EPS);
+#endif
+}
+
+Matrix
+Choleski_decomposition::original() const
+{
+    Matrix T(L.dim());
+    T.set_diag(D);
+    return L*T*L.transposed();
+}
+
+Matrix
+Choleski_decomposition::inverse() const
+{
+    int n=L.dim();
+    Matrix invm(n);
+    Vector e_i(n);
+    for (int i = 0; i < n; i++) {
+       e_i.set_unit(i);
+       Vector inv(solve(e_i));
+       for (int j = 0 ; j<n; j++)
+           invm(i,j) = inv(j);
+    }
+    
+#ifdef NDEBUG
+    Matrix I1(n), I2(original());
+    I1.unit();
+    assert((I1-original()*invm).norm()/original.norm() < EPS);
+#endif
+    
+    return invm;
+}
old mode 100644 (file)
new mode 100755 (executable)
index 0376cf7..8d4e1ac
@@ -445,7 +445,7 @@ echo > confdefs.h
 
 # A filename unique to this package, relative to the directory that
 # configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=lib/choleski.cc
+ac_unique_file=choleski.cc
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
@@ -916,7 +916,7 @@ done
 
 ac_given_srcdir=$srcdir
 
-trap 'rm -fr `echo " lib/out/config.hh:config.hh.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo " out/config.hh:config.hh.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -1023,7 +1023,7 @@ ac_eB='$%\1#\2define\3'
 ac_eC=' '
 ac_eD='%g'
 
-CONFIG_HEADERS=${CONFIG_HEADERS-"lib/out/config.hh:config.hh.in"}
+CONFIG_HEADERS=${CONFIG_HEADERS-"out/config.hh:config.hh.in"}
 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
   # Support "outfile[:infile]", defaulting infile="outfile.in".
   case "$ac_file" in
index abfa94ca2e40e7451cfac38eb6835f5a74662739..fd3376dceee3d359c3d81516d6166eea96931c86 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(lib/choleski.cc)
+AC_INIT(choleski.cc)
 AC_LANG_CPLUSPLUS
 
 dnl should enable flower specific compile flags.
@@ -8,7 +8,7 @@ AC_PROG_CXX
 AC_FUNC_MEMCMP
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS(memmem snprintf foobar)
-AC_CONFIG_HEADER(lib/out/config.hh:config.hh.in)
+AC_CONFIG_HEADER(out/config.hh:config.hh.in)
 
 CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
 
diff --git a/flower/data-file.cc b/flower/data-file.cc
new file mode 100644 (file)
index 0000000..0dad79c
--- /dev/null
@@ -0,0 +1,95 @@
+#include <fstream.h>
+#include <ctype.h>
+
+#include "data-file.hh"
+
+void 
+Data_file::gobble_white()
+{
+    char c;
+    
+    while ((c=data_get()) == ' ' ||c == '\t')
+       if (eof()) 
+           break;
+
+    data_unget(c);
+}
+
+String
+Data_file::get_word() 
+{// should handle escape seq's
+    String s;
+
+    while (1) 
+       {
+       char    c  = data_get();
+       
+       if (isspace(c) || eof()) 
+           {
+           data_unget(c);
+           break;
+           }
+       
+       
+       if (c == '\"')
+           {
+           rawmode= true;
+
+           while ((c  = data_get()) != '\"')
+               if (eof())
+                   error("EOF in a string");           
+               else
+                   s += c;
+           
+
+           rawmode= false;
+           }       
+       else
+           s += c;             
+       }
+    
+    return s;        
+}
+
+/**  get a char 
+   Only class member who uses text_file::get
+   */
+char
+Data_file::data_get() {
+    char c =  get(); 
+    if (!rawmode && c == '#') // gobble comment
+       {       
+       while ((c = get()) != '\n' && !eof()) 
+           ;
+           return '\n';
+       }    
+
+    return c;
+}
+
+/// read line, gobble '\n'    
+String Data_file::get_line()     
+{
+    char c; 
+    String s;
+
+    while ((c  = data_get()) != '\n' && !eof())
+       s += c;
+    return s;  
+}
+
+/// gobble stuff before first entry on a line.    
+void
+Data_file::gobble_leading_white() 
+{
+    // eat blank lines.
+    while (!eof()) {
+       char c = data_get();                
+       if (!isspace(c)) {
+           data_unget(c);
+           break;
+       }
+    }
+}
+
+
diff --git a/flower/dstream.cc b/flower/dstream.cc
new file mode 100644 (file)
index 0000000..05ee3e6
--- /dev/null
@@ -0,0 +1,161 @@
+
+
+#include <fstream.h>
+#include "assoc.hh"
+#include "dstream.hh"
+#include "scalar.hh"
+#include "text-db.hh"
+#include "string-convert.hh"
+
+/// indent of each level 
+const INDTAB = 2;
+
+/*
+  should use Regexp library.
+  */
+static String
+strip_pretty(String pretty_str)
+{
+    int i = pretty_str.index_i('(');
+    if (i>=0)
+       pretty_str = pretty_str.left_str(i);
+    
+    int l = pretty_str.index_last_i(' '); // strip until last ' '
+    if (l>=0)
+       pretty_str = pretty_str.nomid_str(0,l+1);
+    return pretty_str;
+}
+
+static String
+strip_member(String pret)
+{
+    int l=pret.index_last_i(':')-1;
+    if (l>=0)
+       pret = pret.left_str(l );
+    return pret;
+}
+
+Dstream&
+Dstream::identify_as(String name)
+{
+    if (!os)
+       return *this;
+    
+    String mem(strip_pretty(name));
+    String cl(strip_member(mem));
+    String idx = cl;
+    
+    if (silent->elt_query(mem))
+       idx  = mem;
+    else if (silent->elt_query(cl))
+       idx = cl;
+    else {
+       (*silent)[idx] = false;
+    }
+    local_silence = (*silent)[idx];
+    if (classname != idx && !local_silence) {
+       classname=idx;
+       if (!(*silent)["Dstream"])
+           *os << "[" << classname << ":]"; // messy.
+    }
+    return *this;
+}
+
+bool
+Dstream::silence(String s)
+{
+    if (!silent->elt_query(s))
+       return false;
+    return (*silent)[s];
+}
+
+/** Output a string via the Dstream. This is the only output
+ interface. It delegates all conversion to String class.  */
+Dstream &
+Dstream::operator<<(String s)
+{
+    output(s);
+    return *this;
+}
+
+Dstream &
+Dstream::operator<<(void const *v_l)
+{
+    output(String_convert::pointer_str(v_l));
+    return *this;
+}
+
+Dstream &
+Dstream::operator<<(char const *ch_l)
+{
+    output(ch_l);
+    return *this;
+}
+
+void
+Dstream::output(String s)
+{
+    if (local_silence|| !os)
+       return ;
+    
+    for (char const *cp = s  ; *cp; cp++)
+       switch(*cp) {
+           case '{':
+           case '[':
+           case '(': indentlvl += INDTAB;
+               *os << *cp;             
+               break;
+               
+           case ')':
+           case ']':
+           case '}':
+               indentlvl -= INDTAB;
+               *os << *cp              ;
+               
+               assert  (indentlvl>=0) ;
+               break;
+               
+           case '\n':
+               *os << '\n' << String (' ', indentlvl) << flush;
+               break;        
+           default:
+               *os << *cp;
+               break;
+           }
+    return ;    
+}
+
+
+Dstream::Dstream(ostream *r, char const * cfg_nm )
+{
+    os = r;
+    silent = new Assoc<String,bool>;
+    indentlvl = 0;
+    if (!os)
+       return;
+    
+    char const * fn =cfg_nm ? cfg_nm : ".dstreamrc";
+    {
+       ifstream ifs(fn);       // can't open
+       if (!ifs)
+           return;
+    }
+
+    Text_db cfg(fn);
+    while (! cfg.eof()){            
+        Text_record  r(  cfg++);
+        if (r.size() != 2) {
+            r.message("not enough fields in Dstream init.");
+            continue;
+        }
+        (*silent)[r[0]] = (bool)(int)(Scalar(r[1]));
+    }
+
+}
+
+
+Dstream::~Dstream()
+{    
+    delete silent;
+    assert(!indentlvl) ;
+}
diff --git a/flower/flower-version.cc b/flower/flower-version.cc
new file mode 100644 (file)
index 0000000..fd37845
--- /dev/null
@@ -0,0 +1,16 @@
+#include "version.hh"  // urg
+#include <stdio.h>
+
+static char *s = "FlowerLib " MAJOR_VERSION "." MINOR_VERSION "."  PATCH_LEVEL MY_PATCH_LEVEL " #%d";
+
+static const int build=
+#include ".build"
+;
+
+char const * 
+flower_version_sz()
+{
+    static char v[1024];
+    sprintf(v, s, build);
+    return v;
+}
diff --git a/flower/include/Makefile b/flower/include/Makefile
new file mode 100644 (file)
index 0000000..e783a73
--- /dev/null
@@ -0,0 +1,18 @@
+# flower/lib/include/Makefile
+
+# subdir level:
+#
+depth = ../..
+#
+
+# generic stuff/Makefile
+#
+include ./$(depth)/make/Include.make
+include ./$(depth)/flower/.version
+
+# identify module:
+#
+MODULE_NAME = flower
+
+#
+
diff --git a/flower/include/assoc-iter.hh b/flower/include/assoc-iter.hh
new file mode 100644 (file)
index 0000000..34b88df
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+  associter.hh -- part of flowerlib
+
+  (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef ASSOCITER_HH
+#define ASSOCITER_HH
+
+#include "assoc.hh"
+
+/// an iterator for the #Assoc# class
+template<class K, class V>
+struct Assoc_iter {
+    int i;
+    Assoc<K,V> &assoc_;
+    /// we don't want to be bothered by const correctness
+    Assoc_iter(const Assoc<K,V> &a) :
+       assoc_((Assoc<K,V> &)a)
+    {  
+       i= next(0);
+    }
+    int next(int j) {
+       while (j < assoc_.arr.size() && assoc_.arr[j].free)
+           j++;
+       return j;
+    }
+    bool ok() const {
+       return i < assoc_.arr.size();
+    }
+    void OK()const {
+       assert(!ok() || !assoc_.arr[i].free);
+    }
+    void operator++(int) { i++; i = next(i); }
+    K key() { return assoc_.arr[i].key; }
+    V &val() { return assoc_.arr[i].val; }    
+};
+
+#endif
diff --git a/flower/include/assoc.hh b/flower/include/assoc.hh
new file mode 100644 (file)
index 0000000..bf22881
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef ASSOC_HH
+#define ASSOC_HH
+
+#include "varray.hh"
+#include <assert.h>
+
+/**
+  A helper for Assoc
+ */
+template<class K, class V>
+struct Assoc_ent_ {
+    bool free;
+    K key;
+    V val;
+};
+
+
+/** mindblowingly stupid Associative array implementation.
+  Hungarian: map
+ */
+template<class K, class V>
+struct Assoc {
+    Array< Assoc_ent_<K,V> > arr;
+
+    /* ************** */
+    
+    int find(K key) const {
+       for (int i = 0; i < arr.size(); i++) {
+           if (!arr[i].free && key == arr[i].key)
+               return i;
+       }
+       return -1;
+    }
+    int find_creat(K key) {
+       int free = -1;
+       for (int i = 0; i < arr.size(); i++) {
+           if (key == arr[i].key) {            
+               return i;
+           } else if (arr[i].free ) {
+               free = i;
+           }
+       }
+       if (free >= 0){
+           arr[free].free = false;
+           arr[free].key = key;
+           return free;
+       }
+
+       Assoc_ent_<K,V> ae;
+       ae.free = false;
+       ae.key = key;
+       arr.push(ae);
+       return arr.size() -1;
+    }
+public:
+    bool elt_query(K key) const {
+       return find(key) >= 0;
+    }
+    void del(K key) {
+       assert(elt_query(key));
+       int i= find(key);
+       arr[i].free = true;
+    }
+    void
+    add(K key, V val) {
+       int i = find_creat(key);
+       arr[i].val = val;
+    }
+    V& operator[](K key) {
+       return arr[find_creat(key)].val;
+    }
+    V const & operator[](K key) const {
+       assert(elt_query(key));
+       return arr[find(key)].val;
+    }
+};
+
+#endif
diff --git a/flower/include/choleski.hh b/flower/include/choleski.hh
new file mode 100644 (file)
index 0000000..f5e9fb4
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef CHOLESKI_HH
+#define CHOLESKI_HH
+
+#include "matrix.hh"
+
+/**
+  Choleski decomposition of a matrix
+    structure for using the LU decomposition of a positive definite matrix.
+
+    #P# is split  into
+
+    LD transpose(L)
+    */
+struct Choleski_decomposition {
+
+    /// lower triangle of Choleski decomposition
+    Matrix L;
+
+    /// diagonal 
+    Vector D;
+
+    /** Create decomposition of P. 
+    PRE
+    P needs to be symmetric positive definite
+    */
+    
+    Choleski_decomposition(Matrix P);
+
+    /**
+    solve Px = rhs
+    */
+    Vector solve(Vector rhs) const;
+
+    Vector operator * (Vector rhs) const { return solve (rhs); }
+  /**
+    return the inverse of the matrix P.
+    */
+    Matrix inverse() const;
+    /**
+    return P,  calc'ed from L and D
+    */
+    Matrix original() const;
+  
+        
+};
+#endif
diff --git a/flower/include/compare.hh b/flower/include/compare.hh
new file mode 100644 (file)
index 0000000..203ba01
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+  flowerlib
+
+  (c) 1996 Han-Wen Nienhuys
+  */
+#ifndef COMPARE_HH
+#define COMPARE_HH
+
+#define one_operator(type, function, op) \
+inline bool \
+operator op (type t1, type t2) {\
+    return function(t1, t2) op 0;\
+}\
+
+#define gpp_minmax_operator(type, op, opp) \
+inline type \
+operator op(type t1, type t2)\
+{\
+     return (t1 opp t2) ? t1 :  t2;\
+}\
+
+
+#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
+#define gpp_minmax(type, prefix)\
+       prefix gpp_minmax_operator(type, <?, <)\
+       prefix gpp_minmax_operator(type, >?, >)
+#else
+#define gpp_minmax(type, prefix)
+#endif
+
+/**  handy notations for a signed comparison. 
+    make the operators{<,<=,==,>=,>} and the MAX and MIN of two.
+    Please fill a & in the type argument if necessary.    
+    */
+#define template_instantiate_compare(type, function, prefix) \
+prefix one_operator(type, function, >)\
+prefix one_operator(type, function, >=)\
+prefix one_operator(type, function, ==)\
+prefix one_operator(type, function, !=)\
+prefix one_operator(type, function, <)\
+prefix one_operator(type, function, <=)\
+gpp_minmax(type, prefix)\
+prefix inline type max(type t1, type t2) {  return (t1 > t2 )? t1 : t2; }\
+prefix inline type min(type t1, type t2) {  return (t1 < t2 )? t1 : t2; }\
+  \
+prefix  bool operator<(type t1, type t2) /* stupid fix to allow ; */
+
+
+    
+#define instantiate_compare(type, func) template_instantiate_compare(type,func, )
+     
+
+     
+#endif
+     
diff --git a/flower/include/cursor.hh b/flower/include/cursor.hh
new file mode 100644 (file)
index 0000000..af2e251
--- /dev/null
@@ -0,0 +1,113 @@
+// cursor.hh
+
+#ifndef __CURSOR_HH
+#define __CURSOR_HH
+
+#include "link.hh"
+template<class T> class List;
+
+/**  iterator to List.  
+  add and insert extend the list
+  items are always stored as copies in List, but:
+  List<String> :  copies of String stored 
+  List<String*> : copies of String* stored!
+
+    the operations add and insert actually delegate the work to List class.
+ */
+template<class T>
+class Cursor 
+{
+ public:
+    /** create cursor, set at top. The const part isn't true, actually, #list#
+      surely isn't const, but I get tired of the warning messages.  */
+    Cursor( const List<T>& list, Link<T>* pointer = 0 );
+    
+    Cursor( const Cursor<T>& cursor );
+
+    T& thing();
+
+    /// return current T
+    T& operator *() { return thing(); }
+    operator T() { return thing(); }
+    Cursor<T> operator =( const Cursor<T>& c );
+
+    /// make cursor with #no# items back
+    Cursor<T> operator -( int no) const;
+
+    /// make cursor with #no# items further
+    Cursor<T> operator +( int no) const;
+    int operator -(Cursor<T> op) const;
+    Cursor<T> operator -=(int);
+    Cursor<T> operator +=(int);
+    
+    /// return current and move one down
+    Cursor<T> operator ++( int );
+    
+    /// return current and move one up
+    Cursor<T> operator --( int ); 
+
+    /// point to link?
+    bool ok();                  
+
+    /// ++ items left?
+    bool forward();            
+
+    /// -- items left?
+    bool backward();
+
+    /**  put (copy) after me in List. 
+      analogously to editor. ok() interpreted as at end
+      of line.
+
+      PRE: !ok, POST: added to bottom()
+
+      PRE: ok, POST: added after me
+
+      cursor points to same object, cursor.next() is newly added
+      object.
+      */
+    void add( T const & thing );
+
+    /**  put (copy) before me in List. 
+      analogously to editor. ok() interpreted as at begin of
+      line.
+      
+      PRE: !ok, POST: add to top()
+
+      PRE: ok, POST: add before me
+
+      cursor points to same object, cursor.previous()
+      is newly inserted object.
+      */
+    
+    void insert( T const & thing );
+    ///
+    void backspace();
+
+    /// 
+    void del();
+    
+    /// access the list this came from
+    List<T>& list() const ;
+    Link<T>* pointer();
+    static   int compare(Cursor<T> a,Cursor<T>b) { return a-b; }
+private:
+    List<T>& list_;
+    Link<T>* pointer_;
+};
+
+
+/*
+  comparisons.
+  */
+#include "compare.hh"
+
+
+template_instantiate_compare(Cursor<T>, Cursor<T>::compare, template<class T>);
+
+#include "pcursor.hh"
+#include "list.hh"
+#include "cursor.inl"
+#include "iterate.hh"
+
+#endif // CURSOR_HH 
diff --git a/flower/include/cursor.inl b/flower/include/cursor.inl
new file mode 100644 (file)
index 0000000..54d3703
--- /dev/null
@@ -0,0 +1,113 @@
+ // cursor.inl -*-c++-*-
+#ifndef CURSOR_INL
+#define CURSOR_INL
+#include <assert.h>
+
+
+template<class T>
+inline
+Cursor<T>::Cursor( const List<T>& list, Link<T>* pointer ) : 
+    list_((List<T>&) list )
+{
+    if ( list.size() )
+        pointer_ = pointer ? pointer : list.top_;
+    else
+        pointer_ = pointer;
+}
+
+template<class T>
+inline
+Cursor<T>::Cursor( const Cursor<T>& cursor ) :
+    list_( cursor.list_ )
+{
+    pointer_ = cursor.pointer_;
+}
+
+template<class T>
+inline T&
+Cursor<T>::thing()
+{
+    assert( pointer_ );
+    return pointer_->thing();
+}
+
+template<class T>
+Cursor<T>
+Cursor<T>::operator =( const Cursor<T>& c )
+{   
+    assert( &list_ == &c.list_ );
+    pointer_ = c.pointer_;
+    return *this;
+}
+
+template<class T>
+inline void
+Cursor<T>::add( const T& th )
+{
+    list_.add( th, *this );
+}
+
+template<class T>
+inline void
+Cursor<T>::insert( const T& th )
+{
+    list_.insert( th, *this );
+}
+
+template<class T>
+inline  List<T>&
+Cursor<T>::list() const
+{
+    return list_;
+}
+
+template<class T>
+inline Link<T>*
+Cursor<T>::pointer()
+{
+    return pointer_;
+}
+
+template<class T>
+inline bool
+Cursor<T>::backward()
+{
+    return ( pointer_ != 0 );
+}
+
+template<class T>
+inline bool
+Cursor<T>::forward()
+{
+    return ( pointer_ != 0 );
+}
+
+template<class T>
+inline bool
+Cursor<T>::ok()
+{
+    return ( pointer_ != 0 );
+}
+
+
+template<class T>
+inline Cursor<T> 
+Cursor<T>::operator ++( int )    
+{
+    Cursor<T> r (*this);
+    assert( pointer_ );
+    pointer_ = pointer_->next();
+    return r;
+}
+
+template<class T>
+inline Cursor<T>
+Cursor<T>::operator --( int )
+{
+    Cursor<T> r (*this);
+    assert( pointer_ );
+    pointer_ = pointer_->previous();
+    return r;
+}
+
+#endif
diff --git a/flower/include/cursor.tcc b/flower/include/cursor.tcc
new file mode 100644 (file)
index 0000000..3be73fe
--- /dev/null
@@ -0,0 +1,109 @@
+#ifndef CURSOR_CC
+#define CURSOR_CC
+
+#include "cursor.hh"
+#include <assert.h>
+
+template<class T>
+ void
+Cursor<T>::backspace()
+{
+    Cursor<T> c(*this);
+    if ( c.ok() )
+       c--;        
+    list_.remove( *this );
+}
+
+template<class T>
+ void
+Cursor<T>::del()
+{
+    Cursor<T> c(*this);
+    if ( c.ok() )
+       c++;
+    list_.remove( *this );    
+    *this = c;
+}
+
+
+template<class T>
+Cursor<T> 
+Cursor<T>::operator -=( int j )    
+{
+    while (j--)
+       (*this)--;
+    return *this;
+}
+template<class T>
+Cursor<T> 
+Cursor<T>::operator +=( int j )    
+{
+    while (j++)
+       (*this)++;
+    return *this;
+}
+
+template<class T>
+Cursor<T> 
+Cursor<T>::operator +( int i ) const    
+{
+    Cursor<T> r = *this;
+
+    if (i<0)
+       return r -(-i);
+
+    while (i--)
+       r++;
+
+    return r;
+}
+
+template<class T>
+Cursor<T>
+Cursor<T>::operator -( int i ) const
+{
+    Cursor<T> r = *this;
+    if (i<0)
+       return r +(-i);
+
+    while (i--)
+       r--;
+    
+    return r;
+}
+/*
+  warning:  can't use Cursor::operator == (Cursor),
+  since it uses Cursor::operator-(Cursor)
+ */
+template<class T>
+int
+Cursor<T>::operator-(Cursor<T> rhs) const
+{
+    assert(rhs.list == list);
+    int dif = 0;
+
+    // search from *this on further up (positive difference)
+    Cursor<T> c(*this);
+    while (c.ok() && c.pointer_ != rhs.pointer_) {
+       c--;
+       dif++;
+    }
+    
+    if (c.ok())
+       goto gotcha;            // so, sue me.
+
+    // search in direction of bottom. (negative diff)
+    dif =0;
+    c=*this;    
+    while (c.ok() && c.pointer_ !=rhs.pointer_) {
+       dif --;
+       c++;
+    }
+    assert(c.ok());
+
+gotcha:
+    assert((*this - dif).pointer_ == c.pointer_);
+    return dif;
+}
+
+#endif
diff --git a/flower/include/data-file.hh b/flower/include/data-file.hh
new file mode 100644 (file)
index 0000000..dae9e56
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+  data-file.hh -- declare Data_file
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DATAFILE_HH
+#define DATAFILE_HH
+
+#include "text-stream.hh"
+
+/// read a data file
+class Data_file : private Text_stream
+{
+    
+ public:
+    bool rawmode;
+
+    Text_stream::line;    
+    Text_stream::eof;
+    Text_stream::get_name;    
+
+    char data_get();    
+    void data_unget(char c) {
+       unget(c);
+    }
+
+    /// read line, eat #\n#
+    String get_line();
+    
+    /// read a word till next space, leave space. Also does quotes
+    String get_word();
+
+    /// gobble horizontal white stuff.
+    void gobble_white();
+
+    /// gobble empty stuff before first field.
+    void gobble_leading_white();
+    Data_file(String s) : Text_stream(s) {
+       //*mlog << "(" << s << flush;   
+       rawmode=  false;        
+    }
+
+    ~Data_file()  {
+       //      *mlog << ")"<<flush;    
+    }    
+
+    warning(String s) {
+       message("warning: " + s);
+    }
+    error(String s){
+       message(s);
+       exit(1);    
+    }
+};
+#endif // DATAFILE_HH
diff --git a/flower/include/dstream.hh b/flower/include/dstream.hh
new file mode 100644 (file)
index 0000000..19f78ad
--- /dev/null
@@ -0,0 +1,54 @@
+
+#ifndef DSTREAM_HH
+#define DSTREAM_HH
+
+#include "string.hh"
+
+const char eol= '\n';
+
+template<class K,class V>
+struct Assoc;
+
+/**  debug stream. 
+   a class for providing debug output of nested structures,
+   with indents according to \{\}()[].
+
+   One can turn on and off specific messages using the Assoc silent.
+   This can be done automatically:
+
+   #define DEBUG  dstream_.identify_as(__PRETTY_FUNCTION__) 
+
+   DEBUG << "a message\n";
+   
+   Init for the class names which should be silent can be given in a rc file. 
+   
+  */
+class Dstream
+{
+    ostream *os;
+    int indentlvl;
+    bool local_silence;
+    String classname;
+    void output(String s);
+    Assoc<String, bool> *silent;
+public:
+
+    bool silence(String);
+    
+    /**
+      if rcfile == 0, then do not read any rc file.
+      */
+      
+    Dstream(ostream *r, char const * rcfile);
+    virtual ~Dstream();
+    Dstream &identify_as(String s);
+
+    Dstream &operator << (String s);
+    /**
+      Output memory locations.
+     */
+    Dstream &operator << (void const *);
+    Dstream &operator << (char const *);
+};
+#endif
+
diff --git a/flower/include/fproto.hh b/flower/include/fproto.hh
new file mode 100644 (file)
index 0000000..c2fc983
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+  fproto.hh -- typenames in flowerlib
+
+  (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef FPROTO_HH
+#define FPROTO_HH
+
+
+char const * flower_version_sz();
+
+// what the F*** is "int" ?
+// depreciate int, long, etc., use i32, i64, remember: linux-16/linux-64 ?
+/// (i32)
+typedef int i32;
+/// (i64)
+typedef long long I64;
+
+template<class T> struct Array;
+template<class T> struct sstack;
+template<class T,class K> struct Assoc;
+template<class T> struct List;
+template<class T> struct PointerList;
+template<class T> struct IPointerList;
+template<class T> struct Cursor;
+template<class T> struct PCursor;
+template<class T> struct Link;
+template<class T> struct Handle;
+template<class T> struct Interval_t;
+template<class T,class Q> struct PQueue;
+
+#include "real.hh"
+
+typedef Interval_t<Real> Interval;
+
+struct Choleski_decomposition;
+
+struct Long_option_init;
+struct Getopt_long;
+struct Matrix;
+struct String_data;
+struct String_handle;
+struct String_convert;
+struct String;
+struct virtual_smat;
+struct Vector ;
+struct Text_stream;
+struct Data_file;
+struct Text_db;
+struct Scalar;
+typedef unsigned char Byte;
+#endif // FPROTO_HH
+
diff --git a/flower/include/handle.hh b/flower/include/handle.hh
new file mode 100644 (file)
index 0000000..26328bd
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef HANDLE_HH
+#define HANDLE_HH
+
+/// reference counting handle
+template<class T>
+class Handle {
+    T *obj;
+    int *refs;
+
+    /// let go of ref. Delete if necessary
+    void down() {
+       if (!(*refs--)) {
+           delete obj;
+           delete refs;
+       }
+       obj = 0;
+       refs = 0;
+    }
+    /// point to new object. 
+    void up(T *t, int *r) {
+       if (!r) {
+           refs = new int;
+           *refs = 1;
+       } else {
+           refs =r;
+           *refs++;
+       }
+       obj = t;
+    }
+    /// POST: *refs == 1
+    void copy() {
+       if(*refs != 1){
+           T * newobj = new T(*obj );
+           down();
+           up(newobj);
+       }
+    }
+    Handle(Handle const &src) {
+       up(src.obj, src.refs);
+    }
+    Handle(T & o) {
+       up (&o);
+    }
+    void operator=(Handle const& src) {
+       if (this == &src)
+           return;
+       down();
+       up(src.o, src.refs);
+    }
+    operator T const &() {
+       return *obj;
+    }
+    operator T&() {
+       copy();
+       return *obj;
+    }
+}
+#endif
diff --git a/flower/include/interval.hh b/flower/include/interval.hh
new file mode 100644 (file)
index 0000000..aae1638
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+  interval.hh -- part of flowerlib
+  
+  (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef INTERVAL_HH
+#define INTERVAL_HH
+
+#include <assert.h> 
+#include "fproto.hh"
+#include "real.hh"
+
+
+/**  a T interval. 
+  this represents the closed interval [left,right].
+  No invariants. T must be a totally ordered ring
+  */
+template<class T>
+struct Interval_t {
+    T left, right;
+
+    /* ************** */
+    
+    T center() { return (left + right) / T(2);}
+    void translate(T t) {
+       left += t;
+       right += t;
+    }
+    T& idx(int j) {
+       if (j==-1)
+           return left;
+       else if (j==1)
+           return right;
+       else
+           assert(false);
+       return left;            
+    }
+    T& operator[](int j) {
+       return idx(j);
+    }
+    T operator[](int j) const {
+       return ((Interval_t<T> *)this)->idx(j);
+    }
+    T &max() { return right;}
+    T max()const { return right;}
+    T min()const{ return left; }
+    T &min(){ return left; }
+    /**
+      PRE
+      *this and h are comparable
+      */
+    void unite(Interval_t<T> h);
+    void intersect(Interval_t<T> h);
+
+    T length() const;
+    void set_empty() ;
+    bool empty() const { return left > right; }
+    Interval_t() {
+       set_empty();
+    }
+    Interval_t(T m, T M) {
+       left =m;
+       right = M;
+    }
+    Interval_t<T> &operator += (T r) {
+       left += r;
+       right +=r;
+       return *this;
+    }
+    String str() const;    
+    bool elt_q(T r);
+};
+
+
+/**
+  inclusion ordering. Crash if not comparable.
+  */
+template<class T>
+int Interval__compare(const Interval_t<T>&,Interval_t<T> const&);
+
+/*
+  INLINE
+ */
+
+#include "compare.hh"
+
+template_instantiate_compare(Interval_t<T>&, Interval__compare, template<class T>);
+
+
+template<class T>
+inline Interval_t<T>
+intersection(Interval_t<T> a, Interval_t<T> const&b)
+{
+    a.intersect(b);
+    return a;
+    
+}
+
+
+template<class T>
+inline
+Interval_t<T> operator +(T a,Interval_t<T> i )
+{
+    i += a;
+    return i;
+}
+
+template<class T>
+inline
+Interval_t<T> operator +(Interval_t<T> i,T a ){
+    return a+i;
+}
+
+typedef Interval_t<Real> Interval;
+
+
+#define Interval__instantiate(T) template struct Interval_t<T>;\
+  template  int Interval__compare(const Interval_t<T>&,Interval_t<T> const&)
+
+
+#endif // INTERVAL_HH
+
+
+
diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc
new file mode 100644 (file)
index 0000000..6e7b0b1
--- /dev/null
@@ -0,0 +1,106 @@
+#include <assert.h> 
+#include <math.h>
+#include "interval.hh"
+#include "string.hh"
+
+
+template<class T>
+int
+_Interval__compare(const Interval_t<T>&a,Interval_t<T> const&b)
+{
+    if (a.left == b.left && a.right == b.right)
+       return 0;
+    
+    if (a.left <= b.left && a.right >= b.right)
+       return 1;
+
+    if (a.left >= b.left && a.right <= b.right)
+       return -1;
+
+    return -2;
+}
+
+
+template<class T>
+int
+Interval__compare(const Interval_t<T>&a,Interval_t<T> const&b)
+{
+    int i = _Interval__compare(a,b);
+    if (i < -1)
+       assert(false);
+    return i;
+}
+
+#ifdef AIX
+const Real INFTY = 1e8;        // ARGh. AIX sucks
+#else
+const Real INFTY = HUGE_VAL;
+#endif
+
+template<class T>
+void
+Interval_t<T>::set_empty()
+{
+    left = INFTY;
+    right = -INFTY;
+}
+
+template<class T>
+T
+Interval_t<T>::length() const {
+    assert(right >= left);
+    return right-left;
+}
+
+template<class T>
+void
+Interval_t<T>::unite(Interval_t<T> h)
+{
+    if (h.left<left)
+       left = h.left;
+    if (h.right>right)
+       right = h.right;
+}
+
+/**
+  smallest Interval which includes *this and #h#
+ */
+
+template<class T>
+void
+Interval_t<T>::intersect(Interval_t<T> h)
+{
+#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
+    left = h.left >? left;
+    right = h.right <?right;
+#else
+    left = max(h.left, left);
+    right = min(h.right, right);
+#endif
+}
+
+template<class T>
+Interval_t<T>
+intersect(Interval_t<T> x, Interval_t<T> const &y)
+{
+    x.intersect(y);
+    return x;
+}
+
+template<class T>
+String
+Interval_t<T>::str() const
+{
+    if (empty())
+       return "[empty]";
+    String s("[");
+    return s + left + "," + right +"]";
+}
+
+template<class T>
+bool
+Interval_t<T>::elt_q(T r)
+{
+    return r >= left && r <= right;
+}
diff --git a/flower/include/iterate.hh b/flower/include/iterate.hh
new file mode 100644 (file)
index 0000000..1e924f0
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+  iterate.hh -- define some list macros
+
+  source file of the flowerlib
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef ITERATE_HH
+#define ITERATE_HH
+
+
+
+#define iterator(set)          typeof((set).top())
+#define iterator_bot(set)              typeof((set).bottom())
+
+// should use top()
+#define iter_top(set,var)      iterator(set) var(set)
+#define iter_bot(set,var)      iterator(set) var(set.bottom())
+
+#endif // ITERATE_HH
diff --git a/flower/include/lgetopt.hh b/flower/include/lgetopt.hh
new file mode 100644 (file)
index 0000000..22f45d2
--- /dev/null
@@ -0,0 +1,94 @@
+#ifndef LGETOPT_HH
+#define LGETOPT_HH
+
+#include <string.h>
+
+
+class ostream;
+
+/**
+  a struct this for initialising the commandline options.
+ */
+struct Long_option_init {
+    bool take_arg;
+    char const * longname;
+    char        shortname;
+
+    ostream &printon(ostream &errorout);
+};
+
+
+/** C++ for version of long_getopt.  For processing GNU style command
+  line arguments.  No pointer (return values, arguments) contents are
+  copied.  */
+class Getopt_long {
+public:
+    /** errorcodes: no error, argument expected, no argument expected,
+      unknown option, illegal argument (eg. int expected).  */
+    enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
+               E_ILLEGALARG } ;
+
+
+private:
+
+    /// the option info.
+    Long_option_init *the_opts;
+    int table_len;
+    
+    /// if doing short option, argv[optind][optindind] is processed next.
+    int optindind;
+
+    /// the option found
+    Long_option_init *beet;
+
+    /// get ready for processing next error.
+    bool next();
+    Long_option_init *parselong();
+    Long_option_init *parseshort();
+    
+    ostream *errorout;
+
+    /// report an error and abort
+    void report(Errorcod c);
+public:
+
+    /// argument. Set to 0 if not present
+    char* optarg;
+
+    /// current error status
+    Errorcod error;
+
+    /// return an integer (with err. detect)
+    long intarg();
+    /// argv[optind] will be processed next.
+    int optind;
+
+    /// the arguments
+    char **argv;
+
+    /// the arg. count
+    int argc;
+    
+    /* *************** */
+    
+    /**
+      What to do with  errors. 
+       report messages on  #*os#, and abort.
+       if #os# is null, then do not report nor abort, just set #error#
+      */
+       
+    void seterror(ostream *os);
+
+    /// construct: pass arguments and option info.
+    Getopt_long(int c,  char **v, Long_option_init *lo);
+
+    /**  get the next option. 
+      @return pointer to next option found.
+      0 if error occurred, or next argument is no option.
+      */
+    Long_option_init *operator()();
+
+    char *current_arg();
+    char * get_next_arg();
+};
+#endif
diff --git a/flower/include/libc-extension.hh b/flower/include/libc-extension.hh
new file mode 100644 (file)
index 0000000..96f3df0
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+  libc-extension.hh -- declare some string.h extensions
+
+  source file of the flowerlib
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef LIBC_EXTENSION_HH
+#define LIBC_EXTENSION_HH
+#include "fproto.hh"
+#include "config.hh"
+
+char* strnlwr( char* start_l ,int n);
+char* strnupr( char* start_l, int n);
+
+#if !HAVE_MEMMEM               // GNU extension.
+char *memmem(Byte const * haystack, int haystack_len,
+            Byte const *needle, int needle_len);
+#endif HAVE_MEMMEM
+
+#if !HAVE_SNPRINTF             // GNU extension.
+int snprintf (char *str, size_t n,
+             char const *format, ... );
+#endif
+
+
+Byte *memrchr(Byte const * p, int n, char c);
+Byte *strrev( Byte* byte_l, int length_i );
+
+
+#endif // LIBC_EXTENSION_HH
diff --git a/flower/include/link.hh b/flower/include/link.hh
new file mode 100644 (file)
index 0000000..22fcec4
--- /dev/null
@@ -0,0 +1,38 @@
+// link.hh
+
+#ifndef __LINK_HH
+#define __LINK_HH
+template<class T>
+class List;
+
+
+/// class for List 
+template<class T>
+class Link
+{
+//    friend class Cursor<T>;
+public:    
+    Link( T const & thing );
+    
+    Link<T>* previous();
+    Link<T>* next();
+
+    /// put new Link item after me in list
+    void add( T const & thing );
+    /// put new Link item before me in list
+    void insert( T const & thing );    
+    void remove(List<T> &l);
+    
+    T& thing();
+    void OK() const;
+private:    
+    Link( Link<T>* previous, Link<T>* next, T const & thing );
+
+    T thing_;
+    Link<T>* previous_;
+    Link<T>* next_;
+};
+
+#include "link.inl"
+
+#endif // __LINK_HH //
diff --git a/flower/include/link.inl b/flower/include/link.inl
new file mode 100644 (file)
index 0000000..3926d6b
--- /dev/null
@@ -0,0 +1,102 @@
+// link.inl -*-c++-*-
+#ifndef LINK_INL
+#define LINK_INL
+#include <assert.h>
+template<class T>
+inline
+void
+Link<T>::OK() const
+{
+#ifndef NDEBUG
+    if (previous_) {
+       assert(previous_->next_ == this);
+    }
+    if (next_) {
+       assert(next_->previous_ == this);
+    }
+#endif    
+}
+
+template<class T>
+inline
+Link<T>::Link( const T& thing ) : 
+    thing_( thing )
+{
+    previous_ = next_ = 0;
+}
+
+template<class T>
+inline
+Link<T>::Link( Link<T>* previous, Link<T>* next, const T& thing ) : 
+    thing_( thing )
+{
+    previous_ = previous;
+    next_ = next;
+}
+
+template<class T>
+inline
+Link<T>*
+Link<T>::next()
+{
+    return next_;
+}
+
+template<class T>
+inline
+Link<T>*
+Link<T>::previous()
+{
+    return previous_;
+}
+
+template<class T>
+inline
+void
+Link<T>::add( const T& thing )
+{
+    
+    Link<T>* l = new Link<T>( this, next_, thing );
+    if ( next_ )
+        next_->previous_ = l;
+    next_ = l;
+}
+
+template<class T>
+inline void
+Link<T>::insert( const T& thing )
+{
+    //    Link<T>* l = new Link<T>( next_, this, thing );
+                               // bugfix hwn 16/9/96
+    Link<T>* l = new Link<T>( previous_, this, thing );
+    if ( previous_ )
+        previous_->next_ = l;
+    previous_ = l;
+}
+
+/*
+    don't forget to adjust #l#'s top_ and bottom_.
+    */
+template<class T>
+inline void
+Link<T>::remove(List<T> &l)
+{
+    if ( previous_ ) 
+        previous_->next_ = next_;
+    else 
+       l.top_ = next_;
+
+    if ( next_ )
+        next_->previous_ = previous_;
+    else
+       l.bottom_ = previous_;
+}
+
+template<class T>
+inline
+T&
+Link<T>::thing()
+{
+    return thing_;
+}
+#endif
diff --git a/flower/include/list.hh b/flower/include/list.hh
new file mode 100644 (file)
index 0000000..fbb79e6
--- /dev/null
@@ -0,0 +1,98 @@
+#ifndef __LIST_HH
+#define __LIST_HH
+
+class ostream;
+template<class T> class Cursor;
+template<class T> class Link;
+
+/**  all-purpose doubly linked list. 
+
+  List can be seen as all items written down on paper,
+  from top to bottom
+
+  class Cursor is used to extend List
+
+   items are always stored as copies in List, but:
+   #List<String># :  copies of #String# stored 
+   #List<String*># : copies of #String*# stored! 
+   (do not use, use \Ref{PointerList} #<String*># instead.)
+   {\bf note:} 
+   retrieving "invalid" cursors, i.e. 
+   #top()/bottom()# from empty list, #find()# without success,
+    results in a nonvalid Cursor ( #!ok()# )
+
+
+    INVARIANTEN!
+*/
+
+template<class T>
+class List
+{
+ public:
+    List(List const&src);
+
+    /// construct empty list                
+    List();    
+    virtual ~List();
+       
+    int size() const;
+
+    Cursor<T> bottom() const;  // const sucks.
+    Cursor<T> top() const;
+
+    void OK() const;           // check list
+    
+ protected:
+    friend class Cursor<T>;
+    friend class Link<T>;
+
+    void concatenate(List<T> const &s);
+    
+    /**  make *this empty. 
+
+      POST:
+      size == 0
+      
+      WARNING:
+      contents lost, and not deleted.
+      */
+     void set_empty();
+  
+    void add( T const & thing, Cursor<T> &after_me );
+
+    /// put thing before #before_me#
+    void insert( T const & thing, Cursor<T> &before_me );
+
+    /** Remove link pointed to by me. Destructor of contents called
+      (nop for pointers)
+
+      POST
+      none;
+
+
+      WARNING: do not use #me# after calling
+      */
+    void remove( Cursor<T> me );
+   
+
+    /* ************** */
+    
+    int size_;
+    Link<T>* top_;
+    Link<T>* bottom_;
+};
+
+#include "list.inl"
+#include "cursor.hh"
+
+// instantiate a template:  explicit instantiation.
+#define L_instantiate(a)  template class List<a>; template class Cursor<a>; \
+  template class Link<a>
+
+
+#endif // __LIST_HH //
+    
+   
+
+
diff --git a/flower/include/list.inl b/flower/include/list.inl
new file mode 100644 (file)
index 0000000..df0687b
--- /dev/null
@@ -0,0 +1,56 @@
+// -*-c++-*-
+
+#ifndef LIST_INL
+#define LIST_INL
+
+template<class T>
+inline
+List<T>::List()
+{
+    set_empty();
+}
+
+template<class T>
+inline void
+List<T>::set_empty()
+{
+    top_ = bottom_ = 0;
+    size_ = 0;
+}
+
+template<class T>
+inline void
+List<T>::remove( Cursor<T> me )
+{
+    if ( me.ok() ){
+       Link<T> *lp = me.pointer();     
+       lp->remove(*this);
+       delete lp;
+        size_--;
+    }
+}
+
+template<class T>
+inline int
+List<T>::size() const
+{ 
+    return size_;
+}
+
+template<class T>
+inline Cursor<T>
+List<T>::top()const
+{
+    return Cursor<T>( *this, top_ );
+}
+
+
+template<class T>
+inline Cursor<T>
+List<T>::bottom()const
+{
+    return Cursor<T>( *this, bottom_ );
+}
+
+
+#endif
diff --git a/flower/include/list.tcc b/flower/include/list.tcc
new file mode 100644 (file)
index 0000000..bd3a16b
--- /dev/null
@@ -0,0 +1,112 @@
+#ifndef LIST_CC
+#define LIST_CC
+
+#include "list.hh"
+
+template<class T>
+List<T>::List(List const&src)
+{
+    set_empty();
+    // probably el stupido
+    for (Cursor<T> c(src); c.ok(); c++)
+       bottom().add(c);
+}
+
+template<class T>
+void
+List<T>::OK() const
+{
+    int i = size_;
+    Link<T> *lp = top_;
+    while (i--) {
+       assert(lp);
+       lp->OK();
+       lp = lp->next();
+    }
+    assert(!lp);
+     i = size_;
+    lp = bottom_;
+    while (i--) {
+       assert(lp);
+       lp->OK();
+       lp = lp->previous();
+    }
+    assert(!lp);
+}
+
+
+template<class T>
+List<T>::~List()
+{
+    Cursor<T> c(*this);
+    while (c.ok())
+       c.del();
+}
+
+/** 
+
+  add after after_me.
+
+  Procedure:
+  \begin{itemize}
+  \item if #after_me# is #ok()#, add after #after_me#, else
+  \item if list !empty simply add to bottom, else
+  \item list is empty: create first \Ref{Link} and initialize 
+  #bottom_# and #top_#.
+  \end{itemize}
+*/
+template<class T>
+void
+List<T>::add( T const & thing, Cursor<T> &after_me )
+{
+    if (!size_) {              // not much choice if list is empty
+        bottom_ = top_ = new Link<T>( thing );
+       if (!after_me.ok())
+           after_me = bottom();
+    } else {                   // add at aprioprate place
+       if (!after_me.ok())
+           after_me = bottom();
+       Link<T> *p =after_me.pointer();
+       p->add(thing);
+       if (p == bottom_)       // adjust bottom_ if necessary.
+           bottom_ = p->next();
+    }
+
+    size_++;
+}
+
+template<class T>
+void
+List<T>::insert( T const & thing, Cursor<T> &before_me )
+{
+    if (!size_) {
+       bottom_ = top_ = new Link<T>( thing );
+       if (!before_me.ok())
+           before_me = top();
+       
+    } else {
+       if (!before_me.ok())
+           before_me = top();
+       
+       Link<T> *p = before_me.pointer() ;
+
+       p->insert(thing);
+       if (p == top_)
+           top_ = p->previous();
+    }
+
+    size_++;
+}
+
+
+template<class T>
+void
+List<T>::concatenate(List<T> const&s)
+{
+    Cursor<T> b(bottom());
+    for (Cursor<T> c(s); c.ok(); c++) {
+       b.add(c);
+       b++;
+    }
+}
+#endif
diff --git a/flower/include/matrix.hh b/flower/include/matrix.hh
new file mode 100644 (file)
index 0000000..e4f4470
--- /dev/null
@@ -0,0 +1,135 @@
+#ifndef MATRIX_HH
+#define MATRIX_HH
+
+
+#include "vsmat.hh"
+#include "vector.hh"
+
+/**  a Real matrix.  This is a class for a nonsquare block of #Real#s.  The
+    implementation of sparse matrices is done in the appropriate #smat#
+    class. Matrix only does the mathematical actions (adding,
+    multiplying, etc.)
+
+    
+    TODO
+    implement ref counting?  */
+
+
+class Matrix {
+    virtual_smat *dat;
+    
+public:
+    void OK() const { dat->OK(); }
+    int cols() const { return dat->cols(); }
+    int rows() const { return dat->rows(); }
+
+    /**  return the size of a matrix. 
+      PRE
+      the matrix needs to be square.
+    */
+    int dim() const;
+     
+    // Matrix() { dat = 0; } 
+    ~Matrix() { delete dat; }
+
+    /// set entries to r 
+    void fill(Real r);
+
+    /// set diagonal to d
+    void set_diag(Real d);
+
+    void set_diag(Vector d);
+    /// set unit matrix
+    void unit() { set_diag(1.0); }
+
+    void operator+=(Matrix const &m);
+    void operator-=(Matrix const &m);    
+    void operator*=(Real a);
+    void operator/=(Real a) { (*this) *= 1/a; }
+    
+    /**  add a row. 
+      add a row to the matrix before  row k
+
+      PRE
+      v.dim() == cols()
+      0 <= k <= rows()
+    */
+    void insert_row(Vector v,int k);
+    /** . 
+      delete a row from this matrix.
+
+      PRE
+      0 <= k < rows();
+    */
+    void delete_row(int k) { dat->delete_row(k); }
+    void delete_column(int k) { dat->delete_column(k); }
+
+    /**
+      square n matrix, initialised to null
+    */
+    Matrix(int n);
+
+    /**
+      n x m matrix, init to 0
+    */
+    Matrix(int n, int m);
+    Matrix(Matrix const &m);
+
+    /// dyadic product: v * w.transpose
+    Matrix(Vector v, Vector w);
+    void operator=(Matrix const &m);
+
+    /// access an element
+    Real operator()(int i,int j) const { return dat->elem(i,j); }
+
+    /// access an element
+    Real &operator()(int i, int j) { return dat->elem(i,j); }
+
+    /// Matrix multiply with vec (from right)
+    Vector operator *(Vector const &v) const;
+
+    /// set this to m1*m2.
+    void set_product(Matrix const &m1, Matrix const &m2);
+
+
+    Vector left_multiply(Vector const &) const;
+    
+    Matrix operator-() const;
+    
+    /// transpose this.
+    void transpose();
+    
+    /// return a transposed copy.
+    Matrix transposed() const ;
+
+    Real norm() const;
+    /**  swap. 
+      PRE
+      0 <= c1,c2 < cols()
+    */
+    void swap_columns(int c1, int c2);
+
+    /**  swap. 
+      PRE
+      0 <= c1,c2 < rows()
+    */
+    void swap_rows(int c1, int c2);
+
+
+    Vector row(int ) const;
+    Vector col(int) const;
+
+    operator String() const;
+    void print() const;
+};
+
+inline Vector
+operator *(Vector &v, Matrix const & m) { return m.left_multiply(v); }
+Matrix operator *(Matrix const & m1,Matrix const &m2);
+Matrix operator /(Matrix const &m1,Real a);
+inline Matrix operator -(Matrix m1,const Matrix m2)
+{
+    m1 -= m2;
+    return m1;
+}
+#endif
diff --git a/flower/include/path.hh b/flower/include/path.hh
new file mode 100644 (file)
index 0000000..bc4d9f3
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef PATH_HH
+#define PATH_HH
+#include "string.hh"
+#include "varray.hh"
+
+
+/**    searching directory for file.
+
+   Abstraction of PATH variable. An interface for searching input files.
+   Search a number of dirs for a file.
+
+   Should use kpathsea?
+   
+*/
+
+class File_path : private Array<String>
+{
+public:
+    /// locate a file in the search path
+    String find(String nm);
+
+    /// construct using prefix. Normally argv[0].
+    File_path(String);
+
+    /// add to end of path.
+    Array<String>::push;
+    void add(String str) { push(str); }
+};
+/// split path into its components
+void split_path(String path, String &drive, String &dirs, String &filebase, String &extension);
+
+#endif
diff --git a/flower/include/pcursor.tcc b/flower/include/pcursor.tcc
new file mode 100644 (file)
index 0000000..ffb01bc
--- /dev/null
@@ -0,0 +1,16 @@
+#include "pcursor.hh"
+
+template<class T>
+void
+PCursor<T>::junk()
+{
+#if !defined(NDEBUG) && defined(PARANOID)
+    list().OK();
+#endif
+
+    delete ptr();
+#if !defined(NDEBUG)&&defined(PARANOID)
+    thing() = 0;
+    list().OK();
+#endif
+}
diff --git a/flower/include/plist.tcc b/flower/include/plist.tcc
new file mode 100644 (file)
index 0000000..ac9daed
--- /dev/null
@@ -0,0 +1,21 @@
+#include "plist.hh"
+
+template<class T>
+IPointerList<T>::~IPointerList()
+{
+    PCursor<T> c( *this );
+    while (c.ok()) {
+       delete c.remove_p();
+    }
+}
+
+template<class T>
+PCursor<T> 
+PointerList<T>::find(T what ) const
+{
+    PCursor<T> i(*this);
+    for (; i.ok(); i++)
+       if (i.ptr() == what)
+          break;
+    return i;    
+}
diff --git a/flower/include/pqueue.hh b/flower/include/pqueue.hh
new file mode 100644 (file)
index 0000000..c8dfe1b
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+  pqueue.hh -- declare 
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef PQUEUE_HH
+#define PQUEUE_HH
+
+#include "varray.hh"
+
+/**
+  Stupid Prioq. Should use Lists and STL.
+  Smallest is put at the front.
+
+Actually, this sux. Should use a template struct PQuee_ent<V,I>
+ */
+
+template<class V, class I>
+struct PQueue
+{
+    Array<V> value_arr_;
+    Array<I> indices_arr_;
+    void OK() const 
+    {
+       
+       assert(value_arr_.size() == indices_arr_.size());
+    }
+    
+    void enter(V v, I idx) {
+       int j=0;
+       for (; j < value_arr_.size(); j++)
+           if (indices_arr_[j] > idx) 
+               break;
+
+       insert(j,v,idx);
+       
+    }
+    int size() { return value_arr_.size(); }
+    V front_val() { return value_arr_[0]; }
+    I front_idx() { return indices_arr_[0]; }
+    void del(int i) 
+    {
+       value_arr_.del(i);
+       indices_arr_.del(i);
+    }
+    int size() const
+    {
+       OK();
+       return value_arr_.size();
+    }
+    
+
+    void insert(int j, V v, I idx)
+    {
+       value_arr_.insert(v, j);
+       indices_arr_.insert(idx, j);
+    }
+    
+
+
+    V get() {
+       V retval = front_val();
+       del(0);
+       return retval;
+    }
+    
+};
+#endif // PQUEUE_HH
diff --git a/flower/include/rational.hh b/flower/include/rational.hh
new file mode 100644 (file)
index 0000000..30fa2cb
--- /dev/null
@@ -0,0 +1 @@
+#include <Rational.h>
diff --git a/flower/include/real.hh b/flower/include/real.hh
new file mode 100644 (file)
index 0000000..0533af2
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef REAL_HH
+#define REAL_HH
+
+
+#include <builtin.h>
+#include <minmax.h>
+#include <math.h>
+
+typedef double Real;
+
+inline Real
+distance(Real x,Real y)
+{
+    return abs(x-y);
+}
+#endif
diff --git a/flower/include/scalar.hh b/flower/include/scalar.hh
new file mode 100644 (file)
index 0000000..08897ce
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+  scalar.hh -- part of LilyPond
+
+  (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef SCALAR_HH
+#define SCALAR_HH
+#include "string.hh"
+#include "real.hh"
+
+/// Perl -like scalar type.
+struct Scalar : public String {
+    
+    Scalar(Real r) : String(r) {}
+    Scalar(int i) : String(i) {}
+    Scalar(char c) : String(c) {}
+    Scalar(char const *c) : String(c) {}    
+    Scalar(String s ):String(s) {}
+    Scalar(Rational );
+    operator Rational();
+    Scalar() {}
+    bool isnum();
+    operator Real();
+    operator int();
+
+    /**   perl -like string to bool conversion.
+     */
+    operator bool() const;
+
+};
+
+#endif // SCALAR_HH
+
diff --git a/flower/include/smat.hh b/flower/include/smat.hh
new file mode 100644 (file)
index 0000000..05bdac4
--- /dev/null
@@ -0,0 +1,93 @@
+#ifndef SMAT_HH
+#define SMAT_HH
+#include "varray.hh"
+#include "vsmat.hh"
+#include "real.hh"
+/// simplest matrix storage. refer to its baseclass for the doco.
+class Full_storage : public virtual_smat
+{
+    /// height, width
+    int h,w;
+    /// maxima.
+    int maxh, maxw;
+    
+    /// the storage
+    Real** els;
+    void
+    init() {
+       els=0;
+       h=w=maxh=maxw=0;
+
+    }
+    
+    bool valid(int i, int j) const {
+       return (i>=0 && i < h)
+           && (j < w && j >=0);
+    }
+    
+
+    void resize_rows(int);
+    void resize_cols(int);
+
+public:
+    virtual int rows() const {
+       return h;
+    }
+    virtual int cols() const {
+       return w;
+    }
+    
+    
+    virtual void set_size(int i, int j)
+    {
+       resize(i,j); //this could be more efficient.
+    }
+    
+    virtual void set_size(int i) {
+       set_size(i,i);
+    }
+    virtual void resize(int i, int j);
+    virtual void resize(int i) {
+       resize(i,i);
+    }
+    
+    virtual Real& elem(int i,int j) {
+       assert(valid(i,j));
+       return els[i][j];
+    }
+    virtual Real const & elem(int i, int j) const {
+       assert(valid(i,j));
+       return els[i][j];
+    }
+    virtual Array<Real> row(int i) const;
+    virtual Array<Real> column(int j) const;
+
+    Full_storage() {
+       init();
+    }
+    Full_storage(int i, int j) {
+       init();
+       set_size(i,j);
+    }
+    Full_storage(Full_storage&);
+    Full_storage(int i) {
+       init();
+       set_size(i);
+    }
+    void OK() const;
+    void operator=(Full_storage const &);
+    
+    virtual void insert_row(int k);
+    virtual void delete_row(int k);
+    virtual void delete_column(int k);
+
+    
+    ~Full_storage();
+    virtual bool mult_ok(int i, int j)const;
+    virtual void mult_next(int &i, int &j) const ;
+    virtual bool trans_ok(int i, int j) const;
+    virtual void trans_next(int &i, int &j) const;
+    virtual virtual_smat * clone();
+};
+
+#endif
diff --git a/flower/include/string-convert.hh b/flower/include/string-convert.hh
new file mode 100644 (file)
index 0000000..9eb9869
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+  PROJECT: FlowerSoft C++ library
+  FILE   : string-convert.hh
+
+*/
+
+#ifndef STRING_CONVERT_HH
+#define STRING_CONVERT_HH
+
+/*
+  ///a class which only has functions.
+//#define functor class // cute. docxx fucks up
+*/
+
+/**
+       The functor String_convert handles all conversions to/from String (some 
+       time, anyway).
+       The class is quite empty from data view.
+  */
+class String_convert {
+    static int hex2bin_i( String hex_str, String& bin_str_r );
+    static int hex2nibble_i( Byte byte );
+    static Byte nibble2hex_byte( Byte byte );
+public:
+    static String bin2dec_str( String bin_str );
+    static String bin2hex_str( String bin_str );
+    static String dec2bin_str( String str );
+    static int bin2_i( String str );
+    static String char_str(char c, int n);
+    static int dec2_i( String dec_str );
+    static double dec2_f( String dec_str );
+    static String double_str(double f, char const* fmt=0);
+    static int hex2_i( String str );
+    static unsigned hex2_u( String str );
+    static String hex2bin_str( String str );
+    static String int_str(int i, char const *fmt=0  );
+    static String i2hex_str( int i, int length_i, char ch );
+    static String u2hex_str( unsigned u, int length_i, char ch );
+    static String i2dec_str( int i, int length_i, char ch );
+    static String rational_str(Rational);
+    static String pointer_str(void const *);
+    static String i64_str(I64, char const * fmt = 0);
+};
+
+#endif // __STRING_CONVERT_HH //
diff --git a/flower/include/string-data.hh b/flower/include/string-data.hh
new file mode 100644 (file)
index 0000000..ecd7159
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+  string-data.hh -- declare  String_data
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef STRINGDATA_HH
+#define STRINGDATA_HH
+
+
+/**Internal String struct.
+   the data itself. Handles simple tasks (resizing, resetting)
+   */
+class String_data {
+    // GNU malloc: storage overhead is 8 bytes anyway.
+
+friend class String_handle;
+    int maxlen;        // maxlen is arraysize-1
+    
+    int length_i_;
+    Byte* data_byte_p_;
+    int references;
+
+    /// init to ""
+    String_data();
+
+    /// init from src. Conservative allocation.
+    String_data(String_data const &src); 
+    
+    ~String_data();
+
+    /** POST: maxlen >= j.
+      @param j, maximum stringlength_i_.    
+      contents thrown away.
+    */
+    void setmax(int j);
+    
+    /** POST: maxlen >= j.
+      @param j, maximum stringlength_i_.
+      contents are kept if it grows.
+      */
+    void remax(int j);
+
+    /// check if writeable.
+    void OKW();
+
+    /// check state.
+    void OK();
+
+    /// reduce memory usage.
+    void tighten();
+
+    // assignment.
+    void set( Byte const* byte_c_l, int length_i );
+
+    void set( char const* ch_c_l );
+    
+    /// concatenation.
+    void append( Byte const* byte_c_l, int length_i );
+
+    void operator += ( char const* ch_c_l );
+
+    char const* ch_c_l() const; 
+
+    char* ch_l();
+
+    Byte const* byte_c_l() const;
+
+    // idem, non const
+    Byte* byte_l();
+
+    void trunc(int j);
+
+    /** access element. not really safe. Can alter length_i_ without
+      #String_data# knowing it.  */
+    Byte &operator [](int j);
+    Byte operator [](int j) const;
+    bool is_binary_bo()const;
+};
+
+
+
+#ifdef STRING_UTILS_INLINED
+#ifndef INLINE
+#define INLINE inline
+#endif
+#include "string-data.inl"
+
+#endif
+
+
+#endif // STRING_DATA_HH
diff --git a/flower/include/string-data.inl b/flower/include/string-data.inl
new file mode 100644 (file)
index 0000000..d2b925d
--- /dev/null
@@ -0,0 +1,210 @@
+/* -*-C++-*-
+  String_data.inl -- implement String_data
+
+  source file of Flower lib
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#ifndef STRINGDATA_INL
+#define STRINGDATA_INL
+
+#include <assert.h>
+#include <memory.h>
+
+#include "string-data.hh"
+const int INITIALMAX=8;
+
+#include <sys/types.h>
+
+INLINE void 
+String_data::OKW() 
+{
+    assert (references == 1);
+}
+
+INLINE void 
+String_data::OK() 
+{
+    assert(maxlen >= length_i_);
+    assert(bool(data_byte_p_));
+    assert(references >= 1);
+}
+
+
+INLINE
+String_data::String_data() 
+{
+    references=0;
+    maxlen = INITIALMAX;
+    data_byte_p_ = new Byte[maxlen + 1];
+    data_byte_p_[0] = 0;
+    length_i_ = 0;
+}
+
+INLINE
+String_data::String_data(String_data const &src) 
+{
+    references=0;      
+    maxlen = length_i_ = src.length_i_;                
+    data_byte_p_ = new Byte[maxlen+1]; // should calc GNU 8byte overhead.      
+    memcpy( data_byte_p_, src.data_byte_p_, length_i_ + 1 );   
+}
+
+INLINE
+String_data::~String_data() 
+{
+    assert(references == 0);
+    delete[] data_byte_p_;
+}
+
+INLINE void 
+String_data::setmax(int j) 
+{      
+    OKW();
+    if (j > maxlen) {
+       delete data_byte_p_;
+       maxlen = j;
+       data_byte_p_ = new Byte[maxlen + 1];
+    
+       data_byte_p_[0] = 0;
+       length_i_ = 0;
+    }
+}
+
+/* this is all quite hairy:  
+        update of length_i_
+        update of maxlen
+        alloc of buffer
+        copying of buffer
+ needs blondification: 
+       split tasks
+       define change authority
+*/
+INLINE void 
+String_data::remax(int j) 
+{
+    OKW();
+    if (j > maxlen) {
+       Byte *p = new Byte[j + 1];      
+       memcpy( p, data_byte_p_, ( maxlen <? length_i_ ) + 1 );     
+       maxlen = j;
+       delete[] data_byte_p_;
+       data_byte_p_ = p;
+    }
+}
+
+INLINE void 
+String_data::tighten() 
+{ // should be dec'd const
+    maxlen = length_i_;
+    Byte *p = new Byte[maxlen + 1];        
+    memcpy( p, data_byte_p_, length_i_ + 1 );      
+    delete[] data_byte_p_;
+    data_byte_p_ = p;          
+}
+// assignment.
+INLINE void 
+String_data::set( Byte const* byte_c_l, int length_i ) 
+{
+    OKW();
+
+    assert( byte_c_l && byte_c_l != data_byte_p_);
+
+    length_i_ = length_i;
+    remax( length_i_ );     // copies too
+    memcpy( data_byte_p_, byte_c_l, length_i_ );
+    data_byte_p_[ length_i_ ] = 0;
+}
+
+INLINE
+void 
+String_data::set( char const* ch_c_l ) 
+{
+    set( (Byte const*)ch_c_l, strlen( ch_c_l ) );
+}
+
+
+/// concatenation.
+INLINE void 
+String_data::append( Byte const* byte_c_l, int length_i ) 
+{
+    OK();
+    OKW();
+    int old_i = length_i_;
+    
+    length_i_ += length_i;
+    remax( length_i_ );
+    memcpy( data_byte_p_ + old_i, byte_c_l, length_i );        
+    data_byte_p_[ length_i_ ] = 0;
+}
+
+INLINE
+void 
+String_data::operator += ( char const* ch_c_l ) 
+{
+    append( (Byte const*)ch_c_l, strlen( ch_c_l ) );
+}
+
+
+
+INLINE
+char const*
+String_data::ch_c_l() const
+{
+    return (char const*)data_byte_p_; 
+}
+INLINE char* 
+String_data::ch_l() 
+{ 
+    return (char*)data_byte_p_; 
+}
+
+INLINE Byte const*
+String_data::byte_c_l() const 
+{ 
+    return data_byte_p_; 
+}
+
+INLINE Byte* 
+String_data::byte_l() 
+{
+    OKW();
+    return data_byte_p_;
+}
+
+INLINE
+void 
+String_data::trunc(int j) 
+{
+    OKW(); 
+    assert(j >= 0 && j <= length_i_);
+    data_byte_p_[j] = 0;
+    length_i_ = j;
+}
+
+INLINE bool
+String_data::is_binary_bo()const
+{
+//    return !memchr(data_byte_p_, length_i_, 0);
+    return ( (int)strlen( (char const*)data_byte_p_ ) != length_i_ );
+}
+
+INLINE Byte&
+String_data::operator [](int j) 
+{
+    assert(j >= 0 && j <= length_i_);
+    return data_byte_p_[j] ; 
+}
+
+INLINE Byte 
+String_data::operator [](int j) const 
+{
+    assert(j >= 0 && j <= length_i_);
+    return data_byte_p_[j]; 
+}
+
+
+
+
+#endif // __STRING_UTIL_CC //
diff --git a/flower/include/string-handle.hh b/flower/include/string-handle.hh
new file mode 100644 (file)
index 0000000..5b7a12f
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+  string-handle.hh -- declare String_handle
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef STRINGHANDLE_HH
+#define STRINGHANDLE_HH
+#include "fproto.hh"
+
+
+/**
+  Reference counting for strings.
+  
+   handles ref. counting, and provides a very thin interface using
+   Byte *
+
+   */
+class String_handle {
+    String_data* data;
+    
+    /// decrease ref count. Named kind of like a Tanenbaum semafore 
+    void down();
+
+    /// increase ref count
+    void up(String_data *d);
+    
+    /** make sure data has only one reference.      
+       POST: data->references == 1
+      */
+    void copy();
+    
+public:
+    String_handle();
+    ~String_handle();
+    String_handle(String_handle const & src);
+
+    Byte const* byte_c_l() const;
+    char const* ch_c_l() const;
+    Byte* byte_l();
+    char* ch_l();    
+    bool is_binary_bo()const;
+    void operator =(String_handle const &src);
+    void operator += (char const *s);
+    Byte operator[](int j) const;
+
+    /** Access elements. WARNING: NOT SAFE
+       don't use this for loops. Use byte_c_l()
+       */
+    Byte &operator[](int j);
+    void append( Byte const* byte_c_l, int length_i );
+    void set( Byte const* byte_c_l, int length_i );
+    void operator = (char const *p);
+    void trunc(int j);
+    int length_i() const;
+};
+
+#ifdef STRING_UTILS_INLINED
+#ifndef INLINE
+#define INLINE inline
+#endif
+#include "string-handle.inl"
+/* we should be resetting INLINE. oh well. */
+#endif
+
+
+#endif // STRINGHANDLE_HH
diff --git a/flower/include/string-handle.inl b/flower/include/string-handle.inl
new file mode 100644 (file)
index 0000000..1f1d44a
--- /dev/null
@@ -0,0 +1,156 @@
+/* -*-c++-*-
+   
+  stringhandle.inl -- implement String_handle
+
+  source file of Flower lib
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#ifndef STRINGHANDLE_INL
+#define STRINGHANDLE_INL
+
+#include <assert.h>
+#include <memory.h>
+
+#include "string-data.hh"
+#include "string-handle.hh"
+
+INLINE void 
+String_handle::down() 
+{ 
+    if (!(--data->references)) delete data; data = 0; 
+}
+
+/// increase ref count
+INLINE void 
+String_handle::up(String_data *d) 
+{ 
+    data=d; data->references ++; 
+}
+
+INLINE void 
+String_handle::copy() 
+{
+    if (data->references !=1){
+       String_data *newdata = new String_data(*data);
+       down();
+       up(newdata);
+    }
+}
+
+INLINE
+String_handle::String_handle() 
+{
+    up(new String_data);
+}
+
+INLINE
+String_handle::~String_handle() 
+{      
+    down();
+}    
+
+INLINE
+String_handle::String_handle(String_handle const & src) 
+{      
+    up(src.data);
+}
+
+INLINE Byte* 
+String_handle::byte_l() 
+{
+    copy();
+    return data->byte_l();
+}
+
+INLINE char* 
+String_handle::ch_l() 
+{
+    copy();
+    return (char*)data->byte_l();
+}
+
+INLINE Byte 
+const* String_handle::byte_c_l() const 
+{
+    return data->byte_c_l();
+}
+
+INLINE char const* 
+String_handle::ch_c_l() const 
+{
+    return (char const*)data->byte_c_l();
+}
+
+INLINE void 
+String_handle::operator =(String_handle const &src) 
+{
+    if (this == &src)
+       return;
+    down();
+    up(src.data);
+}
+
+INLINE void 
+String_handle::operator += (char const *s) 
+{      
+    copy();
+    *data += s;
+}    
+
+
+INLINE Byte 
+String_handle::operator[](int j) const 
+{ 
+    return (*data)[j]; 
+}
+
+// !NOT SAFE!
+// don't use this for loops. Use byte_c_l()
+INLINE Byte &
+String_handle::operator[](int j) 
+{
+    copy();    // hmm. Not efficient
+    return data->byte_l()[j];
+}
+
+INLINE void 
+String_handle::append( Byte const* byte_c_l, int length_i ) 
+{
+    copy();
+    data->append( byte_c_l, length_i );
+}
+                          
+INLINE void 
+String_handle::set( Byte const* byte_c_l, int length_i ) 
+{
+    copy();
+    data->set( byte_c_l, length_i );
+}
+                          
+INLINE void 
+String_handle::operator = (char const *p) 
+{
+    copy();
+    data->set( p );
+}
+                          
+INLINE void 
+String_handle::trunc(int j) 
+{
+    copy(); data->trunc(j); 
+}
+
+INLINE int 
+String_handle::length_i() const 
+{ 
+    return data->length_i_; 
+}
+
+INLINE bool
+String_handle::is_binary_bo() const {
+    return data->is_binary_bo();
+}
+
+#endif
diff --git a/flower/include/string.hh b/flower/include/string.hh
new file mode 100644 (file)
index 0000000..8270e01
--- /dev/null
@@ -0,0 +1,193 @@
+/*
+
+  FILE   : string.hh -- declare String
+  Rehacked by HWN 3/nov/95
+  removed String & 's
+  introduced Class String_handle
+ */
+
+#ifndef STRING_HH
+#define STRING_HH
+
+
+#include <string.h>
+#include <iostream.h>
+#include <Rational.h>
+
+#include "string-handle.hh"
+
+/** 
+  Intuitive string class. provides 
+\begin{itemize}
+\item
+  ref counting through #String_handle#
+\item
+  conversion from bool, int, double, char* , char.  
+\item
+  to be moved to String_convert:
+  conversion to int, upcase, downcase 
+
+\item
+  printable. 
+
+\item
+  indexing (index_i, index_any_i, last_index_i)
+
+\item
+  cutting (left_str, right_str, mid_str)
+
+\item
+  concat (+=, +)
+
+\item
+  signed comparison (<, >, ==, etc)
+
+\item
+  No operator[] is provided, since this would be enormously  slow. If needed,
+  convert to char const* .
+\end{itemize}
+
+*/
+class String
+{
+protected:
+    String_handle strh_; 
+
+    bool null_terminated();
+    
+public:
+
+    /** init to empty string. This is needed because other
+      constructors are provided.*/
+    String() {  }                  
+    String(Rational);
+
+    /// String s = "abc";
+    String( char const* source ); 
+    String( Byte const* byte_c_l, int length_i ); 
+    
+    /// "ccccc"
+    String( char c, int n = 1 );
+
+    String( int i , char const *fmt=0);
+    String ( double f , char const* fmt =0);
+    /// 'true' or 'false'
+    String(bool );
+
+    ///  return a "new"-ed copy of contents
+    Byte* copy_byte_p() const; //  return a "new"-ed copy of contents
+
+    char const* ch_c_l() const;
+    Byte const* byte_c_l() const;
+    char* ch_l();
+    Byte* byte_l();
+
+    /// deprecated; use ch_c_l()
+    operator char const* () const { return ch_c_l(); }
+    
+    String &operator =( String const & source );
+
+    /// concatenate s
+    void operator += (char const* s) { strh_ += s; }
+    void operator += (String s);
+
+    void append(String);
+    void prepend(String);
+
+    char operator []( int n ) const { return strh_[n]; }
+
+    /// return n leftmost chars
+    String left_str( int n ) const;
+
+    /// return n rightmost chars
+    String right_str( int n ) const;
+
+    /// return uppercase of *this
+    String upper_str() const;
+
+    /// return lowercase of *this
+    String lower_str() const;
+
+    /// return the "esrever" of *this
+    String reversed_str() const;
+
+
+    /// return a piece starting at index_i (first char = index_i 0), length n
+    String mid_str(int index_i, int n ) const;
+
+    /// cut out a middle piece, return remainder
+    String nomid_str(int index_i, int n ) const;
+
+    /// signed comparison,  analogous to memcmp;
+    static int compare_i(String const & s1,const  String& s2);
+       
+    /// index of rightmost c 
+    int index_last_i( char c) const;
+
+    /// index of rightmost element of string 
+    int index_last_i( char const* string ) const;
+
+    int index_i(char c ) const;
+    int index_i(String ) const;
+    int index_any_i(String ) const;
+
+    void to_upper();
+    void to_lower();
+    /// provide Stream output
+    void print_on(ostream& os) const;
+
+    /// the length of the string
+    int length_i() const;
+
+    // ***** depreciated
+    int len() const {
+       return length_i();
+    }
+
+    /// convert to an integer
+    int value_i() const;
+
+    /// convert to a double
+    double value_f() const;
+};
+
+#include "compare.hh"
+
+instantiate_compare(String const &, String::compare_i);
+
+// because char const* also has an operator ==, this is for safety:
+inline bool operator==(String s1, char const* s2){
+    return s1 == String(s2);
+}
+inline bool operator==(char const* s1, String s2)
+{
+    return String(s1)==s2;
+}
+inline bool operator!=(String s1, char const* s2  ) {
+    return s1!=String(s2);
+}
+inline bool operator!=(char const* s1,String s2) {
+    return String(s2) !=s1;
+}
+
+
+inline String
+operator  + (String s1, String  s2)
+{
+    s1 += s2;
+    return s1;
+}
+
+inline ostream &
+operator << ( ostream& os, String d )
+{
+    d.print_on(os);
+    return os;
+}
+
+
+// String quoteString(String message, String quote);
+
+#endif
diff --git a/flower/include/text-db.hh b/flower/include/text-db.hh
new file mode 100644 (file)
index 0000000..3535a84
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef TEXTDB_HH
+#define TEXTDB_HH
+
+#include "data-file.hh"
+
+/**a "const" Array. Contents can't be changed. do "#" comments, read quote enclosed  fields */
+
+class Text_record : Array<String>  
+{
+    int line_no;
+    String filename;
+    
+public:
+    Text_record() { } // needed because of other ctor
+
+    /// report an error in this line.
+    message(String s) {
+       cerr << '\n'<< filename << ": "<< line_no << s << "\n";
+    }         
+    String operator[](int j) {
+       return Array<String>::operator[](j);
+    }
+
+    Text_record(Array<String> s, String fn, int j) : Array<String>(s) { 
+       filename = fn; line_no = j; 
+    }
+    Array<String>::size;           
+};
+
+/** abstraction for a datafile.
+    add a subrec/fieldsep/record separator
+    */
+
+class Text_db : private Data_file
+{
+    void gobble_leading_white();
+public:
+    /// get a line with records
+    Text_record    get_record();
+
+    Text_db(String fn):Data_file(fn) { }
+    Data_file::error;
+    bool eof();
+
+    /// get next line.
+    Text_record operator++(int) {
+       return get_record();
+    }
+    /// are we done yet?
+    operator bool() {
+       return !eof();
+    }
+};
+
+#endif
diff --git a/flower/include/text-stream.hh b/flower/include/text-stream.hh
new file mode 100644 (file)
index 0000000..437f869
--- /dev/null
@@ -0,0 +1,74 @@
+
+#ifndef TEXTSTR_HH
+#define TEXTSTR_HH
+
+#include <stdio.h>
+#include <ctype.h>
+#include "string.hh"
+#include "varray.hh"
+
+/**
+  line counting input stream. 
+  a stream for textfiles. linecounting. Thin interface getchar and
+  ungetchar.  (ungetc is unlimited) 
+  
+  should protect get and unget against improper use
+*/
+
+
+class Text_stream
+{
+    int line_no;
+
+    // could just have used streams. 
+    FILE *f;  
+    Array<char> pushback;
+    String name;
+    
+ public:
+    Text_stream(String fn);
+    String get_name() { return name; }
+    bool eof() {
+       return feof(f);
+    }
+    bool eol() {
+       return (peek() == '\n');
+    }
+    char peek() {
+       char c = get();
+       unget(c);
+       return c;
+    }
+    int line(){
+       return line_no;
+    }
+
+    char    get() {
+       char c;
+       
+       if (pushback.empty())
+           c = getc(f);        
+       else 
+           c = pushback.pop();
+
+       if (c =='\n')
+           line_no++;
+       return c;       
+    }
+    void unget(char c) {
+       if (c =='\n')
+           line_no--;
+       pushback.push(c);
+    }
+    ~Text_stream (){
+       if (!eof()) 
+           cerr <<__FUNCTION__<< ": closing unended file";
+    
+       fclose(f);
+    }
+
+    /// GNU format message.
+    void message(String s); 
+};
+
+#endif
diff --git a/flower/include/unionfind.hh b/flower/include/unionfind.hh
new file mode 100644 (file)
index 0000000..fbaa51e
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef UNIONFIND_HH
+#define UNIONFIND_HH
+#include "varray.hh"
+
+/*
+    which points of a graph are connected?.
+    Union find, a standard algorithm:
+
+    Union_find represents an undirected graph of N points. You can
+    connect two points using #connect()#. #find(i)# finds a uniquely
+    determined representant of the equivalence class of points
+    connected to #i#.
+    
+    */
+struct Union_find {    
+    void connect(int i, int j);
+    int find(int i);
+    bool equiv(int i, int j) { return find(i) == find(j); }
+    Union_find(int sz);
+
+private:
+    Array<int> classes;
+
+};
+#endif
diff --git a/flower/include/varray.hh b/flower/include/varray.hh
new file mode 100644 (file)
index 0000000..b7400bb
--- /dev/null
@@ -0,0 +1,186 @@
+/*
+  (c) Han-Wen Nienhuys 1995,96
+
+  Distributed under GNU GPL  
+*/
+
+#ifndef ARRAY_H
+#define ARRAY_H
+#include <assert.h>
+
+/// copy a bare (C-)array from #src# to #dest# sized  #count#
+template<class T>
+inline void arrcpy(T*dest, T*src, int count) {
+    for (int i=0; i < count ; i++)
+       *dest++ = *src++;
+}
+
+
+/**
+  Scaleable array/stack template, for a type T with default constructor.
+  
+  
+  This template implements a scaleable vector. With (or without) range
+  checking. It may be flaky for objects with complicated con- and
+  destructors. The type T should have a default constructor. It is
+  best suited for simple types, such as int, double or String, it
+  provides a paranoidly safe replacement for the new T[int] construct.
+
+  It uses stack terminology, (push, pop, top), and  can be used as a stack.
+
+  
+  */
+template<class T>
+class Array {
+protected:
+    /// maximum length of array.
+    int max;
+
+    /// the data itself
+    T *thearray;
+
+    /// stretch or shrink  array.
+    void remax(int newmax) {    
+       T* newarr = new T[newmax];
+       size_ = (newmax < size_) ? newmax : size_;
+       arrcpy(newarr, thearray, size_);
+       
+       delete[] thearray;
+       thearray = newarr;
+       max = newmax;
+    }
+    int size_;
+
+public:
+    /// check invariants
+    void OK() const {
+       assert(max >= size_ && size_ >=0);
+       if (max) assert(thearray);
+    }
+    /** report the size_.
+      @see {setsize_}
+      */
+    int size() const  { return size_; }
+    
+    /// POST: size() == 0
+    void clear() { size_ = 0; }
+
+    Array() { thearray = 0; max =0; size_ =0; }
+
+
+    /** set the size_ to #s#.
+      POST: size() == s.
+    Warning: contents are unspecified */
+    void set_size(int s) {
+       if (s >= max) remax(s);
+       size_ = s;    
+    }
+    
+    ~Array() { delete[] thearray; }
+
+    /// return a  "new"ed copy of array 
+    T* copy_array() const {
+       T* Tarray = new T[size_];
+       arrcpy(Tarray, thearray, size_);
+       return Tarray;
+    }
+    // depracated
+    operator T* () const {
+       return copy_array();    
+    }
+    void operator=(Array const & src) {
+       set_size (src.size_);
+       arrcpy(thearray,src.thearray, size_);
+    }
+    Array(Array const & src) {
+       thearray = src.copy_array();
+       max = size_ = src.size_;        
+    }
+
+    /// tighten array size_.
+    void precompute () { remax(size_); }
+
+    /// this makes Array behave like an array
+    T &operator[] (const int i) const {
+       assert(i >=0&&i<size_);
+       return ((T*)thearray)[i];       
+    }
+
+    /// add to the end of array
+    void push(T x) {
+       if (size_ == max)
+           remax(2*max + 1);
+
+       // T::operator=(T &) is called here. Safe to use with automatic
+       // vars
+       thearray[size_++] = x;
+    }
+    /// 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];
+    }
+     /// 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];
+       (*this)[j]=t;
+    }
+    bool empty() { return !size_; }
+    void insert(T k, int j) {
+       assert(j >=0 && j<= size_);
+       set_size(size_+1);
+       for (int i=size_-1; i > j; i--)
+           thearray[i] = thearray[i-1];
+       thearray[j] = k;
+    }
+    void del(int i) {
+       assert(i >=0&& i < size_);
+       arrcpy(thearray+i, thearray+i+1, size_-i-1);
+       size_--;
+    }
+    // quicksort.
+    void sort (int (*compare)( T const&,T const&),
+              int lower = -1, int upper = -1 ) {
+       if (lower < 0) {
+           lower = 0 ;
+           upper = size()-1;
+       }
+       if (lower >= upper)
+           return;
+       swap(lower, (lower+upper)/2);
+       int last = lower;
+       for (int i= lower +1; i <= upper; i++)
+           if (compare(thearray[i], thearray[lower]) < 0 )
+               swap( ++last,i);
+       swap(lower, last);
+       sort(compare, lower, last-1);
+       sort(compare, last+1, upper);
+    }
+    void concat(Array<T> const &src) {
+       int s = size_;
+       set_size(size_ + src.size_);
+       arrcpy(thearray+s,src.thearray, src.size_);     
+    }
+    Array<T> subvec(int lower, int upper) {
+       assert(lower >= 0 && lower <=upper&& upper <= size_);
+       Array<T> r;
+       int s =upper-lower;
+       r.set_size(s);
+       arrcpy(r.thearray, thearray  + lower, s);
+       return r;
+    }
+};
+
+#endif
diff --git a/flower/include/vector.hh b/flower/include/vector.hh
new file mode 100644 (file)
index 0000000..323d03d
--- /dev/null
@@ -0,0 +1,111 @@
+#ifndef VECTOR_HH
+#define VECTOR_HH
+
+#include <math.h>
+#include "real.hh"
+#include "varray.hh"
+
+class Dstream;
+class String;
+void set_matrix_debug(Dstream&ds);
+
+/**  a row of numbers. 
+    a vector. Storage is handled in Array, Vector only does the mathematics.
+ */
+class Vector  {
+    Array<Real> dat;
+public:
+    void OK() const { dat.OK();}
+    int dim() const { return dat.size(); }
+    Vector() { }
+    Vector(Array<Real> d );
+    Vector(Vector const &n);
+    Vector(int n) {
+       dat.set_size(n);
+       fill(0);
+    }
+    void insert(Real v, int i) {
+       dat.insert(v,i);
+    }
+    void del(int i) { dat.del(i); }
+    operator String() const;
+    void fill(Real r) {
+       for (int i=0; i < dim(); i++)
+           dat[i] =r;
+    }
+
+    void operator +=(Vector v) {
+       assert(v.dim() == dim());
+       for (int i=0; i < dim(); i++)
+           dat[i] += v.dat[i];
+    }
+    
+    void operator /=(Real a) {
+       (*this) *= 1/a;
+    }
+
+    void operator *=(Real a) {
+       for (int i=0; i < dim(); i++)
+           dat[i] *= a;
+    }
+
+    void operator -=(Vector v) {
+       assert(v.dim() == dim());
+       for (int i=0; i < dim(); i++)
+           dat[i] -= v(i);     
+    }
+
+    Real &operator()(int i) { return dat[i]; }
+    Real operator()(int i) const { return dat[i]; }
+    Real elem(int i) { return dat[i]; }
+    Real operator *(Vector v) const {
+       Real ip=0;
+       assert(v.dim() == dim());
+       for (int i=0; i < dim(); i++)
+           ip += dat[i] *v(i);
+       return ip;
+    }
+    Vector operator-() const;
+    Real norm() {
+       return sqrt(norm_sq() );
+    }
+    Real norm_sq() {
+       return ((*this) * (*this));
+    }
+    operator Array<Real> () { return dat; }
+    void print() const;
+    /// set to j-th element of unit-base
+    void set_unit(int j) ;
+};
+
+inline Vector
+operator+(Vector a, Vector const &b) {
+    a += b;
+    return a;
+}
+
+inline Vector
+operator-(Vector a, Vector const &b) {
+    a -= b;
+    return a;
+}
+
+inline Vector
+operator*(Vector v, Real a) {
+    v *= a;
+    return v;
+}
+
+inline Vector
+operator*( Real a,Vector v) {
+    v *= a;
+    return v;
+}
+
+inline Vector
+operator/(Vector v,Real a) {
+    v *= 1/a;
+    return v;
+}
+
+#endif
diff --git a/flower/include/vsmat.hh b/flower/include/vsmat.hh
new file mode 100644 (file)
index 0000000..b9dcdad
--- /dev/null
@@ -0,0 +1,141 @@
+#ifndef VSMAT_HH
+#define VSMAT_HH
+#include "varray.hh"
+#include "real.hh"
+/** base class for interface with matrix storageclasses.  There are no
+    iterators for matrixclasses, since matrices are (like arrays)
+    explicitly int-indexed.
+
+    Iteration is provided by *_next, *_ok, which update and check both
+    index variables simultaneously.
+
+    TODO
+    determine type of product matrix.
+
+*/
+class virtual_smat {
+    
+
+public:
+    /// check invariants
+    virtual void OK() const=0;
+    
+    /// height of matrix
+    virtual int rows() const = 0;
+
+    /// width of matrix
+    virtual int cols() const = 0;
+      
+    /**  set the size. contents lost.       
+      PRE
+      i >=0, j>=0
+    */
+    virtual void set_size(int i, int j) = 0;
+    /**set the size to square dimen. contents lost
+      PRE
+      i>=0
+    */
+    virtual void set_size(int i) = 0;
+     /**set the size to i.
+
+      keep contents. If enlarged contents unspecified
+        
+      PRE
+      i>=0, j>=0
+    
+    */
+    virtual void resize(int i, int j) = 0;
+  /**    
+    set the size to square dimen. contents kept
+    Keep contents. If enlarged contents are unspecified
+    
+    PRE
+    i>=0  
+    */
+    virtual void resize(int i) = 0;
+  
+    
+        /**
+    access an element.
+
+    Generate an errormessage, if this happens
+    in the 0-part of a sparse matrix.
+    */
+
+    virtual Real& elem(int i,int j) = 0;
+
+    /// access a element, no modify
+    virtual Real const & elem(int i, int j) const = 0;
+
+#if 1
+    virtual Array<Real> row(int i) const = 0;
+    virtual Array<Real> column(int j) const = 0;
+#endif
+
+    
+    /**
+    add a row to the matrix before  row k. Contents
+    of added row are unspecified
+
+      0 <= k <= rows()
+    */
+    virtual void insert_row(int k)=0;
+
+    
+      /**
+      delete a row from this matrix.
+
+      PRE
+      0 <= k < rows();
+    */
+    virtual void delete_row(int k)=0;
+        virtual void delete_column(int k)=0;
+    virtual ~virtual_smat() { }
+    virtual virtual_smat *clone()=0;
+
+
+    
+    /**
+      at end of matrix?. when doing loop
+
+      for(i=0; i<h; i++)
+        for(j=0; j<w; j++)
+          ..
+
+    */
+    virtual bool mult_ok(int i, int j) const=0;
+
+    /**
+      walk through matrix (regular multiply).
+      get next j for row i, or get next row i and reset j.
+      this will make sparse matrix implementation easy.
+    
+      PRE
+      mult_ok(i,j)
+     */
+    virtual void mult_next(int &i, int &j) const  = 0;
+
+/**
+      valid matrix entry. return false if at end of row
+    */
+    virtual bool trans_ok(int i, int j) const=0;
+
+    /**
+      walk through matrix (transposed multiply).
+      Get next i (for column j)
+    
+      PRE
+      ver_ok(i,j)
+     */
+
+    virtual void trans_next(int &i, int &j) const  = 0;
+    /// generate a "Full_storage" matrix    
+    static virtual_smat *get_full(int n, int m);
+
+};
+    
+
+#endif
diff --git a/flower/lgetopt.cc b/flower/lgetopt.cc
new file mode 100644 (file)
index 0000000..37e8a00
--- /dev/null
@@ -0,0 +1,222 @@
+/*
+   process command line, GNU style.
+
+   this is (Copyleft) 1996, Han-Wen Nienhuys, <hanwen@stack.nl>
+ */
+#include <stdio.h>
+#include <iostream.h>
+#include <assert.h>
+#include "lgetopt.hh"
+
+long
+Getopt_long::intarg()
+{
+    long l;
+    if (sscanf(optarg, "%ld", &l) != 1)
+       report(E_ILLEGALARG);
+    
+    return l;
+}
+
+Long_option_init *
+Getopt_long::parselong()
+{
+    char const *optnm = argv[optind] + 2 ;
+    assert(*optnm);
+    
+    char *endopt = strchr(optnm, '=');
+    int searchlen  = (endopt) ? endopt - optnm : strlen(optnm);
+    
+    beet=0;
+    for (int i=0; i< table_len; i++) {
+       char const *ln = the_opts[i].longname;
+
+       if (ln && !strncmp(ln, optnm, searchlen)) {
+           beet = the_opts+i;
+           break;
+       }
+    }  
+
+    if (!beet) {
+       report(E_UNKNOWNOPTION);
+       return 0;
+    }
+    optind++;
+    optindind = 0;
+
+    
+    if (beet->take_arg) {
+       if (endopt)
+           optarg = endopt +1; // a '='
+       else {
+           optarg = argv[optind];
+           optind++;
+       }
+       if (!optarg)
+           report(E_ARGEXPECT);
+
+    } else {
+       optarg = 0;
+       if (endopt)
+           report(E_NOARGEXPECT);
+    }
+    
+    return beet;
+}
+
+
+ostream &
+Long_option_init::printon(ostream &errorout)
+{
+    if (shortname)     
+       errorout <<"-" << shortname;
+    if (shortname && longname)
+       errorout << ", ";
+    if (longname)      
+       errorout << "`--" << longname << "'";
+    return errorout;
+}
+
+// report an error, GNU style.
+void
+Getopt_long::report(Errorcod c)
+{
+    error = c;
+    if (!errorout)
+       return;
+
+    *errorout << argv[0] << ": ";
+    switch (c) {
+    case E_ARGEXPECT:
+       *errorout<< "option ";
+       beet->printon(*errorout);
+       *errorout << "requires an argument"<<endl;
+       break;
+    case  E_NOARGEXPECT:
+       *errorout << "option `--" <<
+           beet->longname << "' does not allow an argument"<<endl;
+       break;
+       
+    case E_UNKNOWNOPTION:
+       *errorout << "unrecognized option ";
+       if (optindind)
+           *errorout << "-" << argv[optind][optindind] << endl;
+       else
+           *errorout << argv[optind] << endl;
+
+       break;
+    case E_ILLEGALARG:
+       *errorout << "illegal argument `" << optarg << "\'to option ";
+       beet->printon(*errorout);
+       *errorout << '\n';
+    default:
+       assert(false);
+    }
+    exit(2); 
+}
+    
+Long_option_init *
+Getopt_long::parseshort()
+{
+    char c=argv[optind][optindind];
+    beet=0;
+    assert(c);
+    
+    for (int i=0; i < table_len; i++)
+       if (the_opts[i].shortname == c) {
+           beet  = the_opts+i;
+           break;
+       }
+
+    if (!beet){
+       report(E_UNKNOWNOPTION);
+       return 0;
+    }
+
+    optindind++;
+    if (!beet->take_arg){
+       optarg = 0;
+       return beet;
+    }
+    optarg = argv[optind] + optindind;
+
+    optind ++;
+    optindind = 0;
+    
+    if (!optarg[0]) {
+       optarg = argv[optind];
+       optind ++;
+    }
+    if (!optarg) {
+       report(E_ARGEXPECT);
+    }
+    
+    return beet;
+}
+
+Long_option_init *
+Getopt_long::operator()() {
+    if (!next())
+       return 0;
+    
+    if (optindind)
+       return parseshort();
+    
+    if (argv[optind][0] != '-')
+       return 0;
+
+    if (argv[optind][1] == '-') {// what to do with "command  --  bla"
+       return parselong();
+    } else {
+       optindind = 1;
+       return parseshort();
+    }
+}
+
+Getopt_long::Getopt_long(int c, char **v, Long_option_init *lo)
+{
+    the_opts = lo;
+    errorout = &cerr;
+    argv = v;
+    argc = c;
+    optind = 1;
+    optindind = 0;
+
+    //    reached end of option table?
+    int i;
+    for (i = 0;  the_opts[i].longname ||the_opts[i].shortname; i++)
+       ;
+    table_len = i;
+}
+
+bool
+Getopt_long::next()
+{
+
+    error = E_NOERROR;
+    while (optind < argc && !argv[optind][optindind]) {
+       optind++;
+       optindind = 0;
+    }
+    return (optind < argc);
+}
+   
+char *
+Getopt_long::current_arg()
+{
+    if (optind >= argc)
+       return 0;
+    char * a = argv[optind];
+    return a + optindind;
+}
+
+char *
+Getopt_long::get_next_arg()
+{
+    char * a = current_arg();
+    if ( a) {
+       optind ++;
+       optindind = 0;
+    }
+    return a;
+}
diff --git a/flower/lib/Makefile b/flower/lib/Makefile
deleted file mode 100644 (file)
index 0c1d299..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# project  LilyPond -- the musical typesetter
-# title           makefile for micro-lily-lib
-# file    lib/Makefile 
-#
-# Copyright (c) 1997 by
-#      Jan Nieuwenhuizen <jan@digicash.com>
-#      Han-Wen Nienhuys <hanwen@stack.nl>
-#
-
-# subdir level:
-#
-depth = ../..
-#
-
-# generic variables:
-#
-include ./$(depth)/make/Variables.make 
-#
-
-# identify module:
-#
-NAME = flower
-MODULE_NAME = flower
-include ./$(depth)/flower/.version
-build = ./$(depth)/flower/$(outdir)/.build
-#
-
-# descent order into subdirectories:
-#
-SUBDIRS = include 
-#
-
-# to be remade each build:
-#
-VERSION_DEPENDENCY =#
-#
-
-# list of c++ header files:
-# 
-HHFILES = $(shell ls *.hh $(ERROR_LOG))
-#
-
-# list of c++ source files:
-#
-CCFILES = $(shell ls *.cc $(ERROR_LOG))
-#
-
-# list of other source files:
-#
-EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
-#
-
-# list of distribution files:
-#
-DISTFILES = Makefile $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
-#
-
-# list of custom libraries:
-#
-# yes, i know about the -L and -l options,
-# but these libraries get rebuild when needed.
-CUSTOMLIBES = \
-
-LOADLIBES +=
-#
-
-# main target of this module:
-#
-# MAINTARGET = $(EXECUTABLE)
-# MAINTARGET = $(LIBRARY)
-# MAINTARGET = $(bindir)/$(EXECUTABLE)# huh?
-MAINTARGET = $(libdir)/$(LIBRARY)# huh?
-
-default: $(MAINTARGET)
-#
-
-# # sic.
-# $(include-flower)/flower-config.hh:
-#      touch $@
-
-# generic targets and rules:
-#
-include ./$(depth)/make/Targets.make
-include ./$(depth)/make/Rules.make
-#
-
-# list of depend files:
-#
-DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
-#
-
-# auto dependencies:
-#
--include /dev/null $(DEPFILES)
-#
-
diff --git a/flower/lib/choleski.cc b/flower/lib/choleski.cc
deleted file mode 100644 (file)
index 1d64f94..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#include "choleski.hh"
-const Real EPS = 1e-7;         // so sue me. Hard coded
-
-Vector
-Choleski_decomposition::solve(Vector rhs)const
-{
-    int n= rhs.dim();
-    assert(n == L.dim());
-    Vector y(n);
-
-    // forward substitution
-    for (int i=0; i < n; i++) {
-       Real sum(0.0);
-       for (int j=0; j < i; j++)
-           sum += y(j) * L(i,j);
-       y(i) = (rhs(i) - sum)/L(i,i);
-    }
-    for (int i=0; i < n; i++)
-       y(i) /= D(i);
-
-    // backward subst
-    Vector &x(rhs);            // using input as return val.
-    for (int i=n-1; i >= 0; i--) {
-       Real sum(0.0);
-       for (int j=i+1; j < n; j++)
-           sum += L(j,i)*x(j);
-       x(i) = (y(i) - sum)/L(i,i);
-    }
-    return x;
-}
-
-/*
-  Standard matrix algorithm.
-  */
-
-Choleski_decomposition::Choleski_decomposition(Matrix P)
-    : L(P.dim()), D(P.dim())
-{
-    int n = P.dim();
-    assert((P-P.transposed()).norm()/P.norm() < EPS);
-
-    L.unit();
-    for (int k= 0; k < n; k++) {
-       for (int j = 0; j < k; j++){
-           Real sum(0.0);
-           for (int l=0; l < j; l++)
-               sum += L(k,l)*L(j,l)*D(l);
-           L(k,j) = (P(k,j) - sum)/D(j);
-       }
-       Real sum=0.0;
-       
-       for (int l=0; l < k; l++)
-           sum += sqr(L(k,l))*D(l);
-       Real d = P(k,k) - sum;
-       D(k) = d;
-    }
-
-#ifdef NDEBUG
-    assert((original()-P).norm() / P.norm() < EPS);
-#endif
-}
-
-Matrix
-Choleski_decomposition::original() const
-{
-    Matrix T(L.dim());
-    T.set_diag(D);
-    return L*T*L.transposed();
-}
-
-Matrix
-Choleski_decomposition::inverse() const
-{
-    int n=L.dim();
-    Matrix invm(n);
-    Vector e_i(n);
-    for (int i = 0; i < n; i++) {
-       e_i.set_unit(i);
-       Vector inv(solve(e_i));
-       for (int j = 0 ; j<n; j++)
-           invm(i,j) = inv(j);
-    }
-    
-#ifdef NDEBUG
-    Matrix I1(n), I2(original());
-    I1.unit();
-    assert((I1-original()*invm).norm()/original.norm() < EPS);
-#endif
-    
-    return invm;
-}
diff --git a/flower/lib/data-file.cc b/flower/lib/data-file.cc
deleted file mode 100644 (file)
index 0dad79c..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#include <fstream.h>
-#include <ctype.h>
-
-#include "data-file.hh"
-
-void 
-Data_file::gobble_white()
-{
-    char c;
-    
-    while ((c=data_get()) == ' ' ||c == '\t')
-       if (eof()) 
-           break;
-
-    data_unget(c);
-}
-
-String
-Data_file::get_word() 
-{// should handle escape seq's
-    String s;
-
-    while (1) 
-       {
-       char    c  = data_get();
-       
-       if (isspace(c) || eof()) 
-           {
-           data_unget(c);
-           break;
-           }
-       
-       
-       if (c == '\"')
-           {
-           rawmode= true;
-
-           while ((c  = data_get()) != '\"')
-               if (eof())
-                   error("EOF in a string");           
-               else
-                   s += c;
-           
-
-           rawmode= false;
-           }       
-       else
-           s += c;             
-       }
-    
-    return s;        
-}
-
-/**  get a char 
-   Only class member who uses text_file::get
-   */
-char
-Data_file::data_get() {
-    char c =  get(); 
-    if (!rawmode && c == '#') // gobble comment
-       {       
-       while ((c = get()) != '\n' && !eof()) 
-           ;
-           return '\n';
-       }    
-
-    return c;
-}
-
-/// read line, gobble '\n'    
-String Data_file::get_line()     
-{
-    char c; 
-    String s;
-
-    while ((c  = data_get()) != '\n' && !eof())
-       s += c;
-    return s;  
-}
-
-/// gobble stuff before first entry on a line.    
-void
-Data_file::gobble_leading_white() 
-{
-    // eat blank lines.
-    while (!eof()) {
-       char c = data_get();                
-       if (!isspace(c)) {
-           data_unget(c);
-           break;
-       }
-    }
-}
-
-
diff --git a/flower/lib/dstream.cc b/flower/lib/dstream.cc
deleted file mode 100644 (file)
index 1197dd7..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-
-
-#include <fstream.h>
-#include "assoc.hh"
-#include "dstream.hh"
-#include "scalar.hh"
-#include "text-db.hh"
-#include "string-convert.hh"
-
-/// indent of each level 
-const INDTAB = 2;
-
-/*
-  should use Regexp library.
-  */
-static String
-strip_pretty(String pretty_str)
-{
-    int i = pretty_str.index_i('(');
-    if (i>=0)
-       pretty_str = pretty_str.left_str(i);
-    
-    int l = pretty_str.index_last_i(' '); // strip until last ' '
-    if (l>=0)
-       pretty_str = pretty_str.nomid_str(0,l+1);
-    return pretty_str;
-}
-
-static String
-strip_member(String pret)
-{
-    int l=pret.index_last_i(':')-1;
-    if (l>=0)
-       pret = pret.left_str(l );
-    return pret;
-}
-
-Dstream&
-Dstream::identify_as(String name)
-{
-    if (!os)
-       return *this;
-    
-    String mem(strip_pretty(name));
-    String cl(strip_member(mem));
-    String idx = cl;
-    
-    if (silent->elt_query(mem))
-       idx  = mem;
-    else if (silent->elt_query(cl))
-       idx = cl;
-    else {
-       (*silent)[idx] = false;
-    }
-    local_silence = (*silent)[idx];
-    if (classname != idx && !local_silence) {
-       classname=idx;
-       if (!(*silent)["Dstream"])
-           *os << "[" << classname << ":]"; // messy.
-    }
-    return *this;
-}
-
-bool
-Dstream::silence(String s)
-{
-    if (!silent->elt_query(s))
-       return false;
-    return (*silent)[s];
-}
-
-/** Output a string via the Dstream. This is the only output
- interface. It delegates all conversion to String class.  */
-Dstream &
-Dstream::operator<<(String s)
-{
-    output(s);
-    return *this;
-}
-
-Dstream &
-Dstream::operator<<(const void *v_l)
-{
-    output(String_convert::pointer_str(v_l));
-    return *this;
-}
-
-Dstream &
-Dstream::operator<<(const char *ch_l)
-{
-    output(ch_l);
-    return *this;
-}
-
-void
-Dstream::output(String s)
-{
-    if (local_silence|| !os)
-       return ;
-    
-    for (const char *cp = s  ; *cp; cp++)
-       switch(*cp) {
-           case '{':
-           case '[':
-           case '(': indentlvl += INDTAB;
-               *os << *cp;             
-               break;
-               
-           case ')':
-           case ']':
-           case '}':
-               indentlvl -= INDTAB;
-               *os << *cp              ;
-               
-               assert  (indentlvl>=0) ;
-               break;
-               
-           case '\n':
-               *os << '\n' << String (' ', indentlvl) << flush;
-               break;        
-           default:
-               *os << *cp;
-               break;
-           }
-    return ;    
-}
-
-
-Dstream::Dstream(ostream *r, const char * cfg_nm )
-{
-    os = r;
-    silent = new Assoc<String,bool>;
-    indentlvl = 0;
-    if (!os)
-       return;
-    
-    const char * fn =cfg_nm ? cfg_nm : ".dstreamrc";
-    {
-       ifstream ifs(fn);       // can't open
-       if (!ifs)
-           return;
-    }
-
-    Text_db cfg(fn);
-    while (! cfg.eof()){            
-        Text_record  r(  cfg++);
-        if (r.size() != 2) {
-            r.message("not enough fields in Dstream init.");
-            continue;
-        }
-        (*silent)[r[0]] = (bool)(int)(Scalar(r[1]));
-    }
-
-}
-
-
-Dstream::~Dstream()
-{    
-    delete silent;
-    assert(!indentlvl) ;
-}
diff --git a/flower/lib/flower-version.cc b/flower/lib/flower-version.cc
deleted file mode 100644 (file)
index 83a69c0..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "../out/version.hh"   // urg
-#include <stdio.h>
-
-static char *s = "FlowerLib " MAJOR_VERSION "." MINOR_VERSION "."  PATCH_LEVEL MY_PATCH_LEVEL " #%d";
-
-static const int build=
-#include "../out/.build"
-;
-
-const char * 
-flower_version_sz()
-{
-    static char v[1024];
-    sprintf(v, s, build);
-    return v;
-}
diff --git a/flower/lib/include/Makefile b/flower/lib/include/Makefile
deleted file mode 100644 (file)
index 1a7272a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# flower/lib/include/Makefile
-
-# subdir level:
-#
-depth = ../../..
-#
-
-# generic stuff/Makefile
-#
-include ./$(depth)/make/Include.make
-#
-
-# identify module:
-#
-MODULE_NAME = flower
-include ./$(depth)/flower/.version
-build = ./$(depth)/flower/$(outdir)/.build
-#
-
diff --git a/flower/lib/include/assoc-iter.hh b/flower/lib/include/assoc-iter.hh
deleted file mode 100644 (file)
index 34b88df..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-  associter.hh -- part of flowerlib
-
-  (c) 1996 Han-Wen Nienhuys
-*/
-
-#ifndef ASSOCITER_HH
-#define ASSOCITER_HH
-
-#include "assoc.hh"
-
-/// an iterator for the #Assoc# class
-template<class K, class V>
-struct Assoc_iter {
-    int i;
-    Assoc<K,V> &assoc_;
-    /// we don't want to be bothered by const correctness
-    Assoc_iter(const Assoc<K,V> &a) :
-       assoc_((Assoc<K,V> &)a)
-    {  
-       i= next(0);
-    }
-    int next(int j) {
-       while (j < assoc_.arr.size() && assoc_.arr[j].free)
-           j++;
-       return j;
-    }
-    bool ok() const {
-       return i < assoc_.arr.size();
-    }
-    void OK()const {
-       assert(!ok() || !assoc_.arr[i].free);
-    }
-    void operator++(int) { i++; i = next(i); }
-    K key() { return assoc_.arr[i].key; }
-    V &val() { return assoc_.arr[i].val; }    
-};
-
-#endif
diff --git a/flower/lib/include/assoc.hh b/flower/lib/include/assoc.hh
deleted file mode 100644 (file)
index 99e2091..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef ASSOC_HH
-#define ASSOC_HH
-
-#include "varray.hh"
-#include <assert.h>
-
-/**
-  A helper for Assoc
- */
-template<class K, class V>
-struct Assoc_ent_ {
-    bool free;
-    K key;
-    V val;
-};
-
-
-/** mindblowingly stupid Associative array implementation.
-  Hungarian: map
- */
-template<class K, class V>
-struct Assoc {
-    Array< Assoc_ent_<K,V> > arr;
-
-    /* ************** */
-    
-    int find(K key) const {
-       for (int i = 0; i < arr.size(); i++) {
-           if (!arr[i].free && key == arr[i].key)
-               return i;
-       }
-       return -1;
-    }
-    int find_creat(K key) {
-       int free = -1;
-       for (int i = 0; i < arr.size(); i++) {
-           if (key == arr[i].key) {            
-               return i;
-           } else if (arr[i].free ) {
-               free = i;
-           }
-       }
-       if (free >= 0){
-           arr[free].free = false;
-           arr[free].key = key;
-           return free;
-       }
-
-       Assoc_ent_<K,V> ae;
-       ae.free = false;
-       ae.key = key;
-       arr.push(ae);
-       return arr.size() -1;
-    }
-public:
-    bool elt_query(K key) const {
-       return find(key) >= 0;
-    }
-    void del(K key) {
-       assert(elt_query(key));
-       int i= find(key);
-       arr[i].free = true;
-    }
-    void
-    add(K key, V val) {
-       int i = find_creat(key);
-       arr[i].val = val;
-    }
-    V& operator[](K key) {
-       return arr[find_creat(key)].val;
-    }
-    const V& operator[](K key) const {
-       assert(elt_query(key));
-       return arr[find(key)].val;
-    }
-};
-
-#endif
diff --git a/flower/lib/include/choleski.hh b/flower/lib/include/choleski.hh
deleted file mode 100644 (file)
index f5e9fb4..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef CHOLESKI_HH
-#define CHOLESKI_HH
-
-#include "matrix.hh"
-
-/**
-  Choleski decomposition of a matrix
-    structure for using the LU decomposition of a positive definite matrix.
-
-    #P# is split  into
-
-    LD transpose(L)
-    */
-struct Choleski_decomposition {
-
-    /// lower triangle of Choleski decomposition
-    Matrix L;
-
-    /// diagonal 
-    Vector D;
-
-    /** Create decomposition of P. 
-    PRE
-    P needs to be symmetric positive definite
-    */
-    
-    Choleski_decomposition(Matrix P);
-
-    /**
-    solve Px = rhs
-    */
-    Vector solve(Vector rhs) const;
-
-    Vector operator * (Vector rhs) const { return solve (rhs); }
-  /**
-    return the inverse of the matrix P.
-    */
-    Matrix inverse() const;
-    /**
-    return P,  calc'ed from L and D
-    */
-    Matrix original() const;
-  
-        
-};
-#endif
diff --git a/flower/lib/include/compare.hh b/flower/lib/include/compare.hh
deleted file mode 100644 (file)
index 203ba01..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-  flowerlib
-
-  (c) 1996 Han-Wen Nienhuys
-  */
-#ifndef COMPARE_HH
-#define COMPARE_HH
-
-#define one_operator(type, function, op) \
-inline bool \
-operator op (type t1, type t2) {\
-    return function(t1, t2) op 0;\
-}\
-
-#define gpp_minmax_operator(type, op, opp) \
-inline type \
-operator op(type t1, type t2)\
-{\
-     return (t1 opp t2) ? t1 :  t2;\
-}\
-
-
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
-#define gpp_minmax(type, prefix)\
-       prefix gpp_minmax_operator(type, <?, <)\
-       prefix gpp_minmax_operator(type, >?, >)
-#else
-#define gpp_minmax(type, prefix)
-#endif
-
-/**  handy notations for a signed comparison. 
-    make the operators{<,<=,==,>=,>} and the MAX and MIN of two.
-    Please fill a & in the type argument if necessary.    
-    */
-#define template_instantiate_compare(type, function, prefix) \
-prefix one_operator(type, function, >)\
-prefix one_operator(type, function, >=)\
-prefix one_operator(type, function, ==)\
-prefix one_operator(type, function, !=)\
-prefix one_operator(type, function, <)\
-prefix one_operator(type, function, <=)\
-gpp_minmax(type, prefix)\
-prefix inline type max(type t1, type t2) {  return (t1 > t2 )? t1 : t2; }\
-prefix inline type min(type t1, type t2) {  return (t1 < t2 )? t1 : t2; }\
-  \
-prefix  bool operator<(type t1, type t2) /* stupid fix to allow ; */
-
-
-    
-#define instantiate_compare(type, func) template_instantiate_compare(type,func, )
-     
-
-     
-#endif
-     
diff --git a/flower/lib/include/cursor.hh b/flower/lib/include/cursor.hh
deleted file mode 100644 (file)
index 0ea9903..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-// cursor.hh
-
-#ifndef __CURSOR_HH
-#define __CURSOR_HH
-
-#include "link.hh"
-template<class T> class List;
-
-/**  iterator to List.  
-  add and insert extend the list
-  items are always stored as copies in List, but:
-  List<String> :  copies of String stored 
-  List<String*> : copies of String* stored!
-
-    the operations add and insert actually delegate the work to List class.
- */
-template<class T>
-class Cursor 
-{
- public:
-    /** create cursor, set at top. The const part isn't true, actually, #list#
-      surely isn't const, but I get tired of the warning messages.  */
-    Cursor( const List<T>& list, Link<T>* pointer = 0 );
-    
-    Cursor( const Cursor<T>& cursor );
-
-    T& thing();
-
-    /// return current T
-    T& operator *() { return thing(); }
-    operator T() { return thing(); }
-    Cursor<T> operator =( const Cursor<T>& c );
-
-    /// make cursor with #no# items back
-    Cursor<T> operator -( int no) const;
-
-    /// make cursor with #no# items further
-    Cursor<T> operator +( int no) const;
-    int operator -(Cursor<T> op) const;
-    Cursor<T> operator -=(int);
-    Cursor<T> operator +=(int);
-    
-    /// return current and move one down
-    Cursor<T> operator ++( int );
-    
-    /// return current and move one up
-    Cursor<T> operator --( int ); 
-
-    /// point to link?
-    bool ok();                  
-
-    /// ++ items left?
-    bool forward();            
-
-    /// -- items left?
-    bool backward();
-
-    /**  put (copy) after me in List. 
-      analogously to editor. ok() interpreted as at end
-      of line.
-
-      PRE: !ok, POST: added to bottom()
-
-      PRE: ok, POST: added after me
-
-      cursor points to same object, cursor.next() is newly added
-      object.
-      */
-    void add( const T& thing );
-
-    /**  put (copy) before me in List. 
-      analogously to editor. ok() interpreted as at begin of
-      line.
-      
-      PRE: !ok, POST: add to top()
-
-      PRE: ok, POST: add before me
-
-      cursor points to same object, cursor.previous()
-      is newly inserted object.
-      */
-    
-    void insert( const T& thing );
-    ///
-    void backspace();
-
-    /// 
-    void del();
-    
-    /// access the list this came from
-    List<T>& list() const ;
-    Link<T>* pointer();
-    static   int compare(Cursor<T> a,Cursor<T>b) { return a-b; }
-private:
-    List<T>& list_;
-    Link<T>* pointer_;
-};
-
-
-/*
-  comparisons.
-  */
-#include "compare.hh"
-
-
-template_instantiate_compare(Cursor<T>, Cursor<T>::compare, template<class T>);
-
-#include "pcursor.hh"
-#include "list.hh"
-#include "cursor.inl"
-#include "iterate.hh"
-
-#endif // CURSOR_HH 
diff --git a/flower/lib/include/cursor.inl b/flower/lib/include/cursor.inl
deleted file mode 100644 (file)
index 54d3703..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
- // cursor.inl -*-c++-*-
-#ifndef CURSOR_INL
-#define CURSOR_INL
-#include <assert.h>
-
-
-template<class T>
-inline
-Cursor<T>::Cursor( const List<T>& list, Link<T>* pointer ) : 
-    list_((List<T>&) list )
-{
-    if ( list.size() )
-        pointer_ = pointer ? pointer : list.top_;
-    else
-        pointer_ = pointer;
-}
-
-template<class T>
-inline
-Cursor<T>::Cursor( const Cursor<T>& cursor ) :
-    list_( cursor.list_ )
-{
-    pointer_ = cursor.pointer_;
-}
-
-template<class T>
-inline T&
-Cursor<T>::thing()
-{
-    assert( pointer_ );
-    return pointer_->thing();
-}
-
-template<class T>
-Cursor<T>
-Cursor<T>::operator =( const Cursor<T>& c )
-{   
-    assert( &list_ == &c.list_ );
-    pointer_ = c.pointer_;
-    return *this;
-}
-
-template<class T>
-inline void
-Cursor<T>::add( const T& th )
-{
-    list_.add( th, *this );
-}
-
-template<class T>
-inline void
-Cursor<T>::insert( const T& th )
-{
-    list_.insert( th, *this );
-}
-
-template<class T>
-inline  List<T>&
-Cursor<T>::list() const
-{
-    return list_;
-}
-
-template<class T>
-inline Link<T>*
-Cursor<T>::pointer()
-{
-    return pointer_;
-}
-
-template<class T>
-inline bool
-Cursor<T>::backward()
-{
-    return ( pointer_ != 0 );
-}
-
-template<class T>
-inline bool
-Cursor<T>::forward()
-{
-    return ( pointer_ != 0 );
-}
-
-template<class T>
-inline bool
-Cursor<T>::ok()
-{
-    return ( pointer_ != 0 );
-}
-
-
-template<class T>
-inline Cursor<T> 
-Cursor<T>::operator ++( int )    
-{
-    Cursor<T> r (*this);
-    assert( pointer_ );
-    pointer_ = pointer_->next();
-    return r;
-}
-
-template<class T>
-inline Cursor<T>
-Cursor<T>::operator --( int )
-{
-    Cursor<T> r (*this);
-    assert( pointer_ );
-    pointer_ = pointer_->previous();
-    return r;
-}
-
-#endif
diff --git a/flower/lib/include/cursor.tcc b/flower/lib/include/cursor.tcc
deleted file mode 100644 (file)
index 3be73fe..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#ifndef CURSOR_CC
-#define CURSOR_CC
-
-#include "cursor.hh"
-#include <assert.h>
-
-template<class T>
- void
-Cursor<T>::backspace()
-{
-    Cursor<T> c(*this);
-    if ( c.ok() )
-       c--;        
-    list_.remove( *this );
-}
-
-template<class T>
- void
-Cursor<T>::del()
-{
-    Cursor<T> c(*this);
-    if ( c.ok() )
-       c++;
-    list_.remove( *this );    
-    *this = c;
-}
-
-
-template<class T>
-Cursor<T> 
-Cursor<T>::operator -=( int j )    
-{
-    while (j--)
-       (*this)--;
-    return *this;
-}
-template<class T>
-Cursor<T> 
-Cursor<T>::operator +=( int j )    
-{
-    while (j++)
-       (*this)++;
-    return *this;
-}
-
-template<class T>
-Cursor<T> 
-Cursor<T>::operator +( int i ) const    
-{
-    Cursor<T> r = *this;
-
-    if (i<0)
-       return r -(-i);
-
-    while (i--)
-       r++;
-
-    return r;
-}
-
-template<class T>
-Cursor<T>
-Cursor<T>::operator -( int i ) const
-{
-    Cursor<T> r = *this;
-    if (i<0)
-       return r +(-i);
-
-    while (i--)
-       r--;
-    
-    return r;
-}
-/*
-  warning:  can't use Cursor::operator == (Cursor),
-  since it uses Cursor::operator-(Cursor)
- */
-template<class T>
-int
-Cursor<T>::operator-(Cursor<T> rhs) const
-{
-    assert(rhs.list == list);
-    int dif = 0;
-
-    // search from *this on further up (positive difference)
-    Cursor<T> c(*this);
-    while (c.ok() && c.pointer_ != rhs.pointer_) {
-       c--;
-       dif++;
-    }
-    
-    if (c.ok())
-       goto gotcha;            // so, sue me.
-
-    // search in direction of bottom. (negative diff)
-    dif =0;
-    c=*this;    
-    while (c.ok() && c.pointer_ !=rhs.pointer_) {
-       dif --;
-       c++;
-    }
-    assert(c.ok());
-
-gotcha:
-    assert((*this - dif).pointer_ == c.pointer_);
-    return dif;
-}
-
-#endif
diff --git a/flower/lib/include/data-file.hh b/flower/lib/include/data-file.hh
deleted file mode 100644 (file)
index dae9e56..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-  data-file.hh -- declare Data_file
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef DATAFILE_HH
-#define DATAFILE_HH
-
-#include "text-stream.hh"
-
-/// read a data file
-class Data_file : private Text_stream
-{
-    
- public:
-    bool rawmode;
-
-    Text_stream::line;    
-    Text_stream::eof;
-    Text_stream::get_name;    
-
-    char data_get();    
-    void data_unget(char c) {
-       unget(c);
-    }
-
-    /// read line, eat #\n#
-    String get_line();
-    
-    /// read a word till next space, leave space. Also does quotes
-    String get_word();
-
-    /// gobble horizontal white stuff.
-    void gobble_white();
-
-    /// gobble empty stuff before first field.
-    void gobble_leading_white();
-    Data_file(String s) : Text_stream(s) {
-       //*mlog << "(" << s << flush;   
-       rawmode=  false;        
-    }
-
-    ~Data_file()  {
-       //      *mlog << ")"<<flush;    
-    }    
-
-    warning(String s) {
-       message("warning: " + s);
-    }
-    error(String s){
-       message(s);
-       exit(1);    
-    }
-};
-#endif // DATAFILE_HH
diff --git a/flower/lib/include/dstream.hh b/flower/lib/include/dstream.hh
deleted file mode 100644 (file)
index 5375304..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-
-#ifndef DSTREAM_HH
-#define DSTREAM_HH
-
-#include "string.hh"
-
-const char eol= '\n';
-
-template<class K,class V>
-struct Assoc;
-
-/**  debug stream. 
-   a class for providing debug output of nested structures,
-   with indents according to \{\}()[].
-
-   One can turn on and off specific messages using the Assoc silent.
-   This can be done automatically:
-
-   #define DEBUG  dstream_.identify_as(__PRETTY_FUNCTION__) 
-
-   DEBUG << "a message\n";
-   
-   Init for the class names which should be silent can be given in a rc file. 
-   
-  */
-class Dstream
-{
-    ostream *os;
-    int indentlvl;
-    bool local_silence;
-    String classname;
-    void output(String s);
-    Assoc<String, bool> *silent;
-public:
-
-    bool silence(String);
-    
-    /**
-      if rcfile == 0, then do not read any rc file.
-      */
-      
-    Dstream(ostream *r, const char  * rcfile);
-    virtual ~Dstream();
-    Dstream &identify_as(String s);
-
-    Dstream &operator << (String s);
-    /**
-      Output memory locations.
-     */
-    Dstream &operator << (void const *);
-    Dstream &operator << (char const *);
-};
-#endif
-
diff --git a/flower/lib/include/fproto.hh b/flower/lib/include/fproto.hh
deleted file mode 100644 (file)
index 01ebe64..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-  fproto.hh -- typenames in flowerlib
-
-  (c) 1996 Han-Wen Nienhuys
-*/
-
-#ifndef FPROTO_HH
-#define FPROTO_HH
-
-
-const char * flower_version_sz();
-
-// what the F*** is "int" ?
-// depreciate int, long, etc., use i32, i64, remember: linux-16/linux-64 ?
-/// (i32)
-typedef int i32;
-/// (i64)
-typedef long long I64;
-
-template<class T> struct Array;
-template<class T> struct sstack;
-template<class T,class K> struct Assoc;
-template<class T> struct List;
-template<class T> struct PointerList;
-template<class T> struct IPointerList;
-template<class T> struct Cursor;
-template<class T> struct PCursor;
-template<class T> struct Link;
-template<class T> struct Handle;
-template<class T> struct Interval_t;
-template<class T,class Q> struct PQueue;
-
-#include "real.hh"
-
-typedef Interval_t<Real> Interval;
-
-struct Choleski_decomposition;
-
-struct Long_option_init;
-struct Getopt_long;
-struct Matrix;
-struct String_data;
-struct String_handle;
-struct String_convert;
-struct String;
-struct virtual_smat;
-struct Vector ;
-struct Text_stream;
-struct Data_file;
-struct Text_db;
-struct Scalar;
-typedef unsigned char Byte;
-#endif // FPROTO_HH
-
diff --git a/flower/lib/include/handle.hh b/flower/lib/include/handle.hh
deleted file mode 100644 (file)
index 63c17ef..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef HANDLE_HH
-#define HANDLE_HH
-
-/// reference counting handle
-template<class T>
-class Handle {
-    T *obj;
-    int *refs;
-
-    /// let go of ref. Delete if necessary
-    void down() {
-       if (!(*refs--)) {
-           delete obj;
-           delete refs;
-       }
-       obj = 0;
-       refs = 0;
-    }
-    /// point to new object. 
-    void up(T *t, int *r) {
-       if (!r) {
-           refs = new int;
-           *refs = 1;
-       } else {
-           refs =r;
-           *refs++;
-       }
-       obj = t;
-    }
-    /// POST: *refs == 1
-    void copy() {
-       if(*refs != 1){
-           T * newobj = new T(*obj );
-           down();
-           up(newobj);
-       }
-    }
-    Handle(Handle const &src) {
-       up(src.obj, src.refs);
-    }
-    Handle(T & o) {
-       up (&o);
-    }
-    void operator=(Handle const& src) {
-       if (this == &src)
-           return;
-       down();
-       up(src.o, src.refs);
-    }
-    operator const T&() {
-       return *obj;
-    }
-    operator T&() {
-       copy();
-       return *obj;
-    }
-}
-#endif
diff --git a/flower/lib/include/interval.hh b/flower/lib/include/interval.hh
deleted file mode 100644 (file)
index aae1638..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
-  interval.hh -- part of flowerlib
-  
-  (c) 1996 Han-Wen Nienhuys
-*/
-
-#ifndef INTERVAL_HH
-#define INTERVAL_HH
-
-#include <assert.h> 
-#include "fproto.hh"
-#include "real.hh"
-
-
-/**  a T interval. 
-  this represents the closed interval [left,right].
-  No invariants. T must be a totally ordered ring
-  */
-template<class T>
-struct Interval_t {
-    T left, right;
-
-    /* ************** */
-    
-    T center() { return (left + right) / T(2);}
-    void translate(T t) {
-       left += t;
-       right += t;
-    }
-    T& idx(int j) {
-       if (j==-1)
-           return left;
-       else if (j==1)
-           return right;
-       else
-           assert(false);
-       return left;            
-    }
-    T& operator[](int j) {
-       return idx(j);
-    }
-    T operator[](int j) const {
-       return ((Interval_t<T> *)this)->idx(j);
-    }
-    T &max() { return right;}
-    T max()const { return right;}
-    T min()const{ return left; }
-    T &min(){ return left; }
-    /**
-      PRE
-      *this and h are comparable
-      */
-    void unite(Interval_t<T> h);
-    void intersect(Interval_t<T> h);
-
-    T length() const;
-    void set_empty() ;
-    bool empty() const { return left > right; }
-    Interval_t() {
-       set_empty();
-    }
-    Interval_t(T m, T M) {
-       left =m;
-       right = M;
-    }
-    Interval_t<T> &operator += (T r) {
-       left += r;
-       right +=r;
-       return *this;
-    }
-    String str() const;    
-    bool elt_q(T r);
-};
-
-
-/**
-  inclusion ordering. Crash if not comparable.
-  */
-template<class T>
-int Interval__compare(const Interval_t<T>&,Interval_t<T> const&);
-
-/*
-  INLINE
- */
-
-#include "compare.hh"
-
-template_instantiate_compare(Interval_t<T>&, Interval__compare, template<class T>);
-
-
-template<class T>
-inline Interval_t<T>
-intersection(Interval_t<T> a, Interval_t<T> const&b)
-{
-    a.intersect(b);
-    return a;
-    
-}
-
-
-template<class T>
-inline
-Interval_t<T> operator +(T a,Interval_t<T> i )
-{
-    i += a;
-    return i;
-}
-
-template<class T>
-inline
-Interval_t<T> operator +(Interval_t<T> i,T a ){
-    return a+i;
-}
-
-typedef Interval_t<Real> Interval;
-
-
-#define Interval__instantiate(T) template struct Interval_t<T>;\
-  template  int Interval__compare(const Interval_t<T>&,Interval_t<T> const&)
-
-
-#endif // INTERVAL_HH
-
-
-
diff --git a/flower/lib/include/interval.tcc b/flower/lib/include/interval.tcc
deleted file mode 100644 (file)
index 6e7b0b1..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#include <assert.h> 
-#include <math.h>
-#include "interval.hh"
-#include "string.hh"
-
-
-template<class T>
-int
-_Interval__compare(const Interval_t<T>&a,Interval_t<T> const&b)
-{
-    if (a.left == b.left && a.right == b.right)
-       return 0;
-    
-    if (a.left <= b.left && a.right >= b.right)
-       return 1;
-
-    if (a.left >= b.left && a.right <= b.right)
-       return -1;
-
-    return -2;
-}
-
-
-template<class T>
-int
-Interval__compare(const Interval_t<T>&a,Interval_t<T> const&b)
-{
-    int i = _Interval__compare(a,b);
-    if (i < -1)
-       assert(false);
-    return i;
-}
-
-#ifdef AIX
-const Real INFTY = 1e8;        // ARGh. AIX sucks
-#else
-const Real INFTY = HUGE_VAL;
-#endif
-
-template<class T>
-void
-Interval_t<T>::set_empty()
-{
-    left = INFTY;
-    right = -INFTY;
-}
-
-template<class T>
-T
-Interval_t<T>::length() const {
-    assert(right >= left);
-    return right-left;
-}
-
-template<class T>
-void
-Interval_t<T>::unite(Interval_t<T> h)
-{
-    if (h.left<left)
-       left = h.left;
-    if (h.right>right)
-       right = h.right;
-}
-
-/**
-  smallest Interval which includes *this and #h#
- */
-
-template<class T>
-void
-Interval_t<T>::intersect(Interval_t<T> h)
-{
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
-    left = h.left >? left;
-    right = h.right <?right;
-#else
-    left = max(h.left, left);
-    right = min(h.right, right);
-#endif
-}
-
-template<class T>
-Interval_t<T>
-intersect(Interval_t<T> x, Interval_t<T> const &y)
-{
-    x.intersect(y);
-    return x;
-}
-
-template<class T>
-String
-Interval_t<T>::str() const
-{
-    if (empty())
-       return "[empty]";
-    String s("[");
-    return s + left + "," + right +"]";
-}
-
-template<class T>
-bool
-Interval_t<T>::elt_q(T r)
-{
-    return r >= left && r <= right;
-}
diff --git a/flower/lib/include/iterate.hh b/flower/lib/include/iterate.hh
deleted file mode 100644 (file)
index 1e924f0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-  iterate.hh -- define some list macros
-
-  source file of the flowerlib
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef ITERATE_HH
-#define ITERATE_HH
-
-
-
-#define iterator(set)          typeof((set).top())
-#define iterator_bot(set)              typeof((set).bottom())
-
-// should use top()
-#define iter_top(set,var)      iterator(set) var(set)
-#define iter_bot(set,var)      iterator(set) var(set.bottom())
-
-#endif // ITERATE_HH
diff --git a/flower/lib/include/lgetopt.hh b/flower/lib/include/lgetopt.hh
deleted file mode 100644 (file)
index 3b2b034..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef LGETOPT_HH
-#define LGETOPT_HH
-
-#include <string.h>
-
-
-class ostream;
-
-/**
-  a struct this for initialising the commandline options.
- */
-struct Long_option_init {
-    bool take_arg;
-    const char* longname;
-    char        shortname;
-
-    ostream &printon(ostream &errorout);
-};
-
-
-/** C++ for version of long_getopt.  For processing GNU style command
-  line arguments.  No pointer (return values, arguments) contents are
-  copied.  */
-class Getopt_long {
-public:
-    /** errorcodes: no error, argument expected, no argument expected,
-      unknown option, illegal argument (eg. int expected).  */
-    enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
-               E_ILLEGALARG } ;
-
-
-private:
-
-    /// the option info.
-    Long_option_init *the_opts;
-    int table_len;
-    
-    /// if doing short option, argv[optind][optindind] is processed next.
-    int optindind;
-
-    /// the option found
-    Long_option_init *beet;
-
-    /// get ready for processing next error.
-    bool next();
-    Long_option_init *parselong();
-    Long_option_init *parseshort();
-    
-    ostream *errorout;
-
-    /// report an error and abort
-    void report(Errorcod c);
-public:
-
-    /// argument. Set to 0 if not present
-    char* optarg;
-
-    /// current error status
-    Errorcod error;
-
-    /// return an integer (with err. detect)
-    long intarg();
-    /// argv[optind] will be processed next.
-    int optind;
-
-    /// the arguments
-    char **argv;
-
-    /// the arg. count
-    int argc;
-    
-    /* *************** */
-    
-    /**
-      What to do with  errors. 
-       report messages on  #*os#, and abort.
-       if #os# is null, then do not report nor abort, just set #error#
-      */
-       
-    void seterror(ostream *os);
-
-    /// construct: pass arguments and option info.
-    Getopt_long(int c,  char **v, Long_option_init *lo);
-
-    /**  get the next option. 
-      @return pointer to next option found.
-      0 if error occurred, or next argument is no option.
-      */
-    Long_option_init *operator()();
-
-    char *current_arg();
-    char * get_next_arg();
-};
-#endif
diff --git a/flower/lib/include/libc-extension.hh b/flower/lib/include/libc-extension.hh
deleted file mode 100644 (file)
index dec8f24..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  libc-extension.hh -- declare some string.h extensions
-
-  source file of the flowerlib
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef LIBC_EXTENSION_HH
-#define LIBC_EXTENSION_HH
-#include "fproto.hh"
-#include "config.hh"
-
-char* strnlwr( char* start_l ,int n);
-char* strnupr( char* start_l, int n);
-
-#ifndef HAVE_MEMMEM            // GNU extension.
-char *memmem(const Byte * haystack, int haystack_len,
-            const Byte *needle, int needle_len);
-#endif HAVE_MEMMEM
-
-#ifndef HAVE_SNPRINTF          // GNU extension.
-int snprintf (char *str, size_t n,
-             const char *format, ... );
-#endif
-
-
-Byte *memrchr(const Byte * p, int n, char c);
-Byte *strrev( Byte* byte_l, int length_i );
-
-
-#endif // LIBC_EXTENSION_HH
diff --git a/flower/lib/include/link.hh b/flower/lib/include/link.hh
deleted file mode 100644 (file)
index 6f9c75a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// link.hh
-
-#ifndef __LINK_HH
-#define __LINK_HH
-template<class T>
-class List;
-
-
-/// class for List 
-template<class T>
-class Link
-{
-//    friend class Cursor<T>;
-public:    
-    Link( const T& thing );
-    
-    Link<T>* previous();
-    Link<T>* next();
-
-    /// put new Link item after me in list
-    void add( const T& thing );
-    /// put new Link item before me in list
-    void insert( const T& thing );     
-    void remove(List<T> &l);
-    
-    T& thing();
-    void OK() const;
-private:    
-    Link( Link<T>* previous, Link<T>* next, const T& thing );
-
-    T thing_;
-    Link<T>* previous_;
-    Link<T>* next_;
-};
-
-#include "link.inl"
-
-#endif // __LINK_HH //
diff --git a/flower/lib/include/link.inl b/flower/lib/include/link.inl
deleted file mode 100644 (file)
index 3926d6b..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-// link.inl -*-c++-*-
-#ifndef LINK_INL
-#define LINK_INL
-#include <assert.h>
-template<class T>
-inline
-void
-Link<T>::OK() const
-{
-#ifndef NDEBUG
-    if (previous_) {
-       assert(previous_->next_ == this);
-    }
-    if (next_) {
-       assert(next_->previous_ == this);
-    }
-#endif    
-}
-
-template<class T>
-inline
-Link<T>::Link( const T& thing ) : 
-    thing_( thing )
-{
-    previous_ = next_ = 0;
-}
-
-template<class T>
-inline
-Link<T>::Link( Link<T>* previous, Link<T>* next, const T& thing ) : 
-    thing_( thing )
-{
-    previous_ = previous;
-    next_ = next;
-}
-
-template<class T>
-inline
-Link<T>*
-Link<T>::next()
-{
-    return next_;
-}
-
-template<class T>
-inline
-Link<T>*
-Link<T>::previous()
-{
-    return previous_;
-}
-
-template<class T>
-inline
-void
-Link<T>::add( const T& thing )
-{
-    
-    Link<T>* l = new Link<T>( this, next_, thing );
-    if ( next_ )
-        next_->previous_ = l;
-    next_ = l;
-}
-
-template<class T>
-inline void
-Link<T>::insert( const T& thing )
-{
-    //    Link<T>* l = new Link<T>( next_, this, thing );
-                               // bugfix hwn 16/9/96
-    Link<T>* l = new Link<T>( previous_, this, thing );
-    if ( previous_ )
-        previous_->next_ = l;
-    previous_ = l;
-}
-
-/*
-    don't forget to adjust #l#'s top_ and bottom_.
-    */
-template<class T>
-inline void
-Link<T>::remove(List<T> &l)
-{
-    if ( previous_ ) 
-        previous_->next_ = next_;
-    else 
-       l.top_ = next_;
-
-    if ( next_ )
-        next_->previous_ = previous_;
-    else
-       l.bottom_ = previous_;
-}
-
-template<class T>
-inline
-T&
-Link<T>::thing()
-{
-    return thing_;
-}
-#endif
diff --git a/flower/lib/include/list.hh b/flower/lib/include/list.hh
deleted file mode 100644 (file)
index ec59fbf..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#ifndef __LIST_HH
-#define __LIST_HH
-
-class ostream;
-template<class T> class Cursor;
-template<class T> class Link;
-
-/**  all-purpose doubly linked list. 
-
-  List can be seen as all items written down on paper,
-  from top to bottom
-
-  class Cursor is used to extend List
-
-   items are always stored as copies in List, but:
-   #List<String># :  copies of #String# stored 
-   #List<String*># : copies of #String*# stored! 
-   (do not use, use \Ref{PointerList} #<String*># instead.)
-   {\bf note:} 
-   retrieving "invalid" cursors, i.e. 
-   #top()/bottom()# from empty list, #find()# without success,
-    results in a nonvalid Cursor ( #!ok()# )
-
-
-    INVARIANTEN!
-*/
-
-template<class T>
-class List
-{
- public:
-    List(List const&src);
-
-    /// construct empty list                
-    List();    
-    virtual ~List();
-       
-    int size() const;
-
-    Cursor<T> bottom() const;  // const sucks.
-    Cursor<T> top() const;
-
-    void OK() const;           // check list
-    
- protected:
-    friend class Cursor<T>;
-    friend class Link<T>;
-
-    void concatenate(List<T> const &s);
-    
-    /**  make *this empty. 
-
-      POST:
-      size == 0
-      
-      WARNING:
-      contents lost, and not deleted.
-      */
-     void set_empty();
-  
-    void add( const T& thing, Cursor<T> &after_me );
-
-    /// put thing before #before_me#
-    void insert( const T& thing, Cursor<T> &before_me );
-
-    /** Remove link pointed to by me. Destructor of contents called
-      (nop for pointers)
-
-      POST
-      none;
-
-
-      WARNING: do not use #me# after calling
-      */
-    void remove( Cursor<T> me );
-   
-
-    /* ************** */
-    
-    int size_;
-    Link<T>* top_;
-    Link<T>* bottom_;
-};
-
-#include "list.inl"
-#include "cursor.hh"
-
-// instantiate a template:  explicit instantiation.
-#define L_instantiate(a)  template class List<a>; template class Cursor<a>; \
-  template class Link<a>
-
-
-#endif // __LIST_HH //
-    
-   
-
-
diff --git a/flower/lib/include/list.inl b/flower/lib/include/list.inl
deleted file mode 100644 (file)
index df0687b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// -*-c++-*-
-
-#ifndef LIST_INL
-#define LIST_INL
-
-template<class T>
-inline
-List<T>::List()
-{
-    set_empty();
-}
-
-template<class T>
-inline void
-List<T>::set_empty()
-{
-    top_ = bottom_ = 0;
-    size_ = 0;
-}
-
-template<class T>
-inline void
-List<T>::remove( Cursor<T> me )
-{
-    if ( me.ok() ){
-       Link<T> *lp = me.pointer();     
-       lp->remove(*this);
-       delete lp;
-        size_--;
-    }
-}
-
-template<class T>
-inline int
-List<T>::size() const
-{ 
-    return size_;
-}
-
-template<class T>
-inline Cursor<T>
-List<T>::top()const
-{
-    return Cursor<T>( *this, top_ );
-}
-
-
-template<class T>
-inline Cursor<T>
-List<T>::bottom()const
-{
-    return Cursor<T>( *this, bottom_ );
-}
-
-
-#endif
diff --git a/flower/lib/include/list.tcc b/flower/lib/include/list.tcc
deleted file mode 100644 (file)
index 16e12a3..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef LIST_CC
-#define LIST_CC
-
-#include "list.hh"
-
-template<class T>
-List<T>::List(List const&src)
-{
-    set_empty();
-    // probably el stupido
-    for (Cursor<T> c(src); c.ok(); c++)
-       bottom().add(c);
-}
-
-template<class T>
-void
-List<T>::OK() const
-{
-    int i = size_;
-    Link<T> *lp = top_;
-    while (i--) {
-       assert(lp);
-       lp->OK();
-       lp = lp->next();
-    }
-    assert(!lp);
-     i = size_;
-    lp = bottom_;
-    while (i--) {
-       assert(lp);
-       lp->OK();
-       lp = lp->previous();
-    }
-    assert(!lp);
-}
-
-
-template<class T>
-List<T>::~List()
-{
-    Cursor<T> c(*this);
-    while (c.ok())
-       c.del();
-}
-
-/** 
-
-  add after after_me.
-
-  Procedure:
-  \begin{itemize}
-  \item if #after_me# is #ok()#, add after #after_me#, else
-  \item if list !empty simply add to bottom, else
-  \item list is empty: create first \Ref{Link} and initialize 
-  #bottom_# and #top_#.
-  \end{itemize}
-*/
-template<class T>
-void
-List<T>::add( const T& thing, Cursor<T> &after_me )
-{
-    if (!size_) {              // not much choice if list is empty
-        bottom_ = top_ = new Link<T>( thing );
-       if (!after_me.ok())
-           after_me = bottom();
-    } else {                   // add at aprioprate place
-       if (!after_me.ok())
-           after_me = bottom();
-       Link<T> *p =after_me.pointer();
-       p->add(thing);
-       if (p == bottom_)       // adjust bottom_ if necessary.
-           bottom_ = p->next();
-    }
-
-    size_++;
-}
-
-template<class T>
-void
-List<T>::insert( const T& thing, Cursor<T> &before_me )
-{
-    if (!size_) {
-       bottom_ = top_ = new Link<T>( thing );
-       if (!before_me.ok())
-           before_me = top();
-       
-    } else {
-       if (!before_me.ok())
-           before_me = top();
-       
-       Link<T> *p = before_me.pointer() ;
-
-       p->insert(thing);
-       if (p == top_)
-           top_ = p->previous();
-    }
-
-    size_++;
-}
-
-
-template<class T>
-void
-List<T>::concatenate(List<T> const&s)
-{
-    Cursor<T> b(bottom());
-    for (Cursor<T> c(s); c.ok(); c++) {
-       b.add(c);
-       b++;
-    }
-}
-#endif
diff --git a/flower/lib/include/matrix.hh b/flower/lib/include/matrix.hh
deleted file mode 100644 (file)
index a633d66..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-#ifndef MATRIX_HH
-#define MATRIX_HH
-
-
-#include "vsmat.hh"
-#include "vector.hh"
-
-/**  a Real matrix.  This is a class for a nonsquare block of #Real#s.  The
-    implementation of sparse matrices is done in the appropriate #smat#
-    class. Matrix only does the mathematical actions (adding,
-    multiplying, etc.)
-
-    
-    TODO
-    implement ref counting?  */
-
-
-class Matrix {
-    virtual_smat *dat;
-    
-public:
-    void OK() const { dat->OK(); }
-    int cols() const { return dat->cols(); }
-    int rows() const { return dat->rows(); }
-
-    /**  return the size of a matrix. 
-      PRE
-      the matrix needs to be square.
-    */
-    int dim() const;
-     
-    // Matrix() { dat = 0; } 
-    ~Matrix() { delete dat; }
-
-    /// set entries to r 
-    void fill(Real r);
-
-    /// set diagonal to d
-    void set_diag(Real d);
-
-    void set_diag(Vector d);
-    /// set unit matrix
-    void unit() { set_diag(1.0); }
-
-    void operator+=(const Matrix&m);
-    void operator-=(const Matrix&m);    
-    void operator*=(Real a);
-    void operator/=(Real a) { (*this) *= 1/a; }
-    
-    /**  add a row. 
-      add a row to the matrix before  row k
-
-      PRE
-      v.dim() == cols()
-      0 <= k <= rows()
-    */
-    void insert_row(Vector v,int k);
-    /** . 
-      delete a row from this matrix.
-
-      PRE
-      0 <= k < rows();
-    */
-    void delete_row(int k) { dat->delete_row(k); }
-    void delete_column(int k) { dat->delete_column(k); }
-
-    /**
-      square n matrix, initialised to null
-    */
-    Matrix(int n);
-
-    /**
-      n x m matrix, init to 0
-    */
-    Matrix(int n, int m);
-    Matrix(const Matrix &m);
-
-    /// dyadic product: v * w.transpose
-    Matrix(Vector v, Vector w);
-    void operator=(const Matrix&m);
-
-    /// access an element
-    Real operator()(int i,int j) const { return dat->elem(i,j); }
-
-    /// access an element
-    Real &operator()(int i, int j) { return dat->elem(i,j); }
-
-    /// Matrix multiply with vec (from right)
-    Vector operator *(const Vector &v) const;
-
-    /// set this to m1*m2.
-    void set_product(const Matrix &m1, const Matrix &m2);
-
-
-    Vector left_multiply(Vector const &) const;
-    
-    Matrix operator-() const;
-    
-    /// transpose this.
-    void transpose();
-    
-    /// return a transposed copy.
-    Matrix transposed() const ;
-
-    Real norm() const;
-    /**  swap. 
-      PRE
-      0 <= c1,c2 < cols()
-    */
-    void swap_columns(int c1, int c2);
-
-    /**  swap. 
-      PRE
-      0 <= c1,c2 < rows()
-    */
-    void swap_rows(int c1, int c2);
-
-
-    Vector row(int ) const;
-    Vector col(int) const;
-
-    operator String() const;
-    void print() const;
-};
-
-inline Vector
-operator *(Vector &v, const Matrix& m) { return m.left_multiply(v); }
-Matrix operator *(const Matrix& m1,const Matrix &m2);
-Matrix operator /(const Matrix &m1,Real a);
-inline Matrix operator -(Matrix m1,const Matrix m2)
-{
-    m1 -= m2;
-    return m1;
-}
-#endif
diff --git a/flower/lib/include/path.hh b/flower/lib/include/path.hh
deleted file mode 100644 (file)
index bc4d9f3..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef PATH_HH
-#define PATH_HH
-#include "string.hh"
-#include "varray.hh"
-
-
-/**    searching directory for file.
-
-   Abstraction of PATH variable. An interface for searching input files.
-   Search a number of dirs for a file.
-
-   Should use kpathsea?
-   
-*/
-
-class File_path : private Array<String>
-{
-public:
-    /// locate a file in the search path
-    String find(String nm);
-
-    /// construct using prefix. Normally argv[0].
-    File_path(String);
-
-    /// add to end of path.
-    Array<String>::push;
-    void add(String str) { push(str); }
-};
-/// split path into its components
-void split_path(String path, String &drive, String &dirs, String &filebase, String &extension);
-
-#endif
diff --git a/flower/lib/include/pcursor.tcc b/flower/lib/include/pcursor.tcc
deleted file mode 100644 (file)
index ffb01bc..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "pcursor.hh"
-
-template<class T>
-void
-PCursor<T>::junk()
-{
-#if !defined(NDEBUG) && defined(PARANOID)
-    list().OK();
-#endif
-
-    delete ptr();
-#if !defined(NDEBUG)&&defined(PARANOID)
-    thing() = 0;
-    list().OK();
-#endif
-}
diff --git a/flower/lib/include/plist.tcc b/flower/lib/include/plist.tcc
deleted file mode 100644 (file)
index ac9daed..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "plist.hh"
-
-template<class T>
-IPointerList<T>::~IPointerList()
-{
-    PCursor<T> c( *this );
-    while (c.ok()) {
-       delete c.remove_p();
-    }
-}
-
-template<class T>
-PCursor<T> 
-PointerList<T>::find(T what ) const
-{
-    PCursor<T> i(*this);
-    for (; i.ok(); i++)
-       if (i.ptr() == what)
-          break;
-    return i;    
-}
diff --git a/flower/lib/include/pqueue.hh b/flower/lib/include/pqueue.hh
deleted file mode 100644 (file)
index c8dfe1b..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-  pqueue.hh -- declare 
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef PQUEUE_HH
-#define PQUEUE_HH
-
-#include "varray.hh"
-
-/**
-  Stupid Prioq. Should use Lists and STL.
-  Smallest is put at the front.
-
-Actually, this sux. Should use a template struct PQuee_ent<V,I>
- */
-
-template<class V, class I>
-struct PQueue
-{
-    Array<V> value_arr_;
-    Array<I> indices_arr_;
-    void OK() const 
-    {
-       
-       assert(value_arr_.size() == indices_arr_.size());
-    }
-    
-    void enter(V v, I idx) {
-       int j=0;
-       for (; j < value_arr_.size(); j++)
-           if (indices_arr_[j] > idx) 
-               break;
-
-       insert(j,v,idx);
-       
-    }
-    int size() { return value_arr_.size(); }
-    V front_val() { return value_arr_[0]; }
-    I front_idx() { return indices_arr_[0]; }
-    void del(int i) 
-    {
-       value_arr_.del(i);
-       indices_arr_.del(i);
-    }
-    int size() const
-    {
-       OK();
-       return value_arr_.size();
-    }
-    
-
-    void insert(int j, V v, I idx)
-    {
-       value_arr_.insert(v, j);
-       indices_arr_.insert(idx, j);
-    }
-    
-
-
-    V get() {
-       V retval = front_val();
-       del(0);
-       return retval;
-    }
-    
-};
-#endif // PQUEUE_HH
diff --git a/flower/lib/include/rational.hh b/flower/lib/include/rational.hh
deleted file mode 100644 (file)
index 30fa2cb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <Rational.h>
diff --git a/flower/lib/include/real.hh b/flower/lib/include/real.hh
deleted file mode 100644 (file)
index 0533af2..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef REAL_HH
-#define REAL_HH
-
-
-#include <builtin.h>
-#include <minmax.h>
-#include <math.h>
-
-typedef double Real;
-
-inline Real
-distance(Real x,Real y)
-{
-    return abs(x-y);
-}
-#endif
diff --git a/flower/lib/include/scalar.hh b/flower/lib/include/scalar.hh
deleted file mode 100644 (file)
index 5cdfa42..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-  scalar.hh -- part of LilyPond
-
-  (c) 1996 Han-Wen Nienhuys
-*/
-
-#ifndef SCALAR_HH
-#define SCALAR_HH
-#include "string.hh"
-#include "real.hh"
-
-/// Perl -like scalar type.
-struct Scalar : public String {
-    
-    Scalar(Real r) : String(r) {}
-    Scalar(int i) : String(i) {}
-    Scalar(char c) : String(c) {}
-    Scalar(const char *c) : String(c) {}    
-    Scalar(String s ):String(s) {}
-    Scalar(Rational );
-    operator Rational();
-    Scalar() {}
-    bool isnum();
-    operator Real();
-    operator int();
-
-    /**   perl -like string to bool conversion.
-     */
-    operator bool() const;
-
-};
-
-#endif // SCALAR_HH
-
diff --git a/flower/lib/include/smat.hh b/flower/lib/include/smat.hh
deleted file mode 100644 (file)
index 9b0987c..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#ifndef SMAT_HH
-#define SMAT_HH
-#include "varray.hh"
-#include "vsmat.hh"
-#include "real.hh"
-/// simplest matrix storage. refer to its baseclass for the doco.
-class Full_storage : public virtual_smat
-{
-    /// height, width
-    int h,w;
-    /// maxima.
-    int maxh, maxw;
-    
-    /// the storage
-    Real** els;
-    void
-    init() {
-       els=0;
-       h=w=maxh=maxw=0;
-
-    }
-    
-    bool valid(int i, int j) const {
-       return (i>=0 && i < h)
-           && (j < w && j >=0);
-    }
-    
-
-    void resize_rows(int);
-    void resize_cols(int);
-
-public:
-    virtual int rows() const {
-       return h;
-    }
-    virtual int cols() const {
-       return w;
-    }
-    
-    
-    virtual void set_size(int i, int j)
-    {
-       resize(i,j); //this could be more efficient.
-    }
-    
-    virtual void set_size(int i) {
-       set_size(i,i);
-    }
-    virtual void resize(int i, int j);
-    virtual void resize(int i) {
-       resize(i,i);
-    }
-    
-    virtual Real& elem(int i,int j) {
-       assert(valid(i,j));
-       return els[i][j];
-    }
-    virtual const Real& elem(int i, int j) const {
-       assert(valid(i,j));
-       return els[i][j];
-    }
-    virtual Array<Real> row(int i) const;
-    virtual Array<Real> column(int j) const;
-
-    Full_storage() {
-       init();
-    }
-    Full_storage(int i, int j) {
-       init();
-       set_size(i,j);
-    }
-    Full_storage(Full_storage&);
-    Full_storage(int i) {
-       init();
-       set_size(i);
-    }
-    void OK() const;
-    void operator=(Full_storage const &);
-    
-    virtual void insert_row(int k);
-    virtual void delete_row(int k);
-    virtual void delete_column(int k);
-
-    
-    ~Full_storage();
-    virtual bool mult_ok(int i, int j)const;
-    virtual void mult_next(int &i, int &j) const ;
-    virtual bool trans_ok(int i, int j) const;
-    virtual void trans_next(int &i, int &j) const;
-    virtual virtual_smat * clone();
-};
-
-#endif
diff --git a/flower/lib/include/string-convert.hh b/flower/lib/include/string-convert.hh
deleted file mode 100644 (file)
index f6bcfa7..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  PROJECT: FlowerSoft C++ library
-  FILE   : string-convert.hh
-
-*/
-
-#ifndef STRING_CONVERT_HH
-#define STRING_CONVERT_HH
-
-/*
-  ///a class which only has functions.
-//#define functor class // cute. docxx fucks up
-*/
-
-/**
-       The functor String_convert handles all conversions to/from String (some 
-       time, anyway).
-       The class is quite empty from data view.
-  */
-class String_convert {
-    static int hex2bin_i( String hex_str, String& bin_str_r );
-    static int hex2nibble_i( Byte byte );
-    static Byte nibble2hex_byte( Byte byte );
-public:
-    static String bin2dec_str( String bin_str );
-    static String bin2hex_str( String bin_str );
-    static String dec2bin_str( String str );
-    static int bin2_i( String str );
-    static String char_str(char c, int n);
-    static int dec2_i( String dec_str );
-    static double dec2_f( String dec_str );
-    static String double_str(double f, char const* fmt=0);
-    static int hex2_i( String str );
-    static unsigned hex2_u( String str );
-    static String hex2bin_str( String str );
-    static String int_str(int i, char const *fmt=0  );
-    static String i2hex_str( int i, int length_i, char ch );
-    static String u2hex_str( unsigned u, int length_i, char ch );
-    static String i2dec_str( int i, int length_i, char ch );
-    static String rational_str(Rational);
-    static String pointer_str(const void *);
-    static String i64_str(I64, char const * fmt = 0);
-};
-
-#endif // __STRING_CONVERT_HH //
diff --git a/flower/lib/include/string-data.hh b/flower/lib/include/string-data.hh
deleted file mode 100644 (file)
index ecd7159..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-  string-data.hh -- declare  String_data
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef STRINGDATA_HH
-#define STRINGDATA_HH
-
-
-/**Internal String struct.
-   the data itself. Handles simple tasks (resizing, resetting)
-   */
-class String_data {
-    // GNU malloc: storage overhead is 8 bytes anyway.
-
-friend class String_handle;
-    int maxlen;        // maxlen is arraysize-1
-    
-    int length_i_;
-    Byte* data_byte_p_;
-    int references;
-
-    /// init to ""
-    String_data();
-
-    /// init from src. Conservative allocation.
-    String_data(String_data const &src); 
-    
-    ~String_data();
-
-    /** POST: maxlen >= j.
-      @param j, maximum stringlength_i_.    
-      contents thrown away.
-    */
-    void setmax(int j);
-    
-    /** POST: maxlen >= j.
-      @param j, maximum stringlength_i_.
-      contents are kept if it grows.
-      */
-    void remax(int j);
-
-    /// check if writeable.
-    void OKW();
-
-    /// check state.
-    void OK();
-
-    /// reduce memory usage.
-    void tighten();
-
-    // assignment.
-    void set( Byte const* byte_c_l, int length_i );
-
-    void set( char const* ch_c_l );
-    
-    /// concatenation.
-    void append( Byte const* byte_c_l, int length_i );
-
-    void operator += ( char const* ch_c_l );
-
-    char const* ch_c_l() const; 
-
-    char* ch_l();
-
-    Byte const* byte_c_l() const;
-
-    // idem, non const
-    Byte* byte_l();
-
-    void trunc(int j);
-
-    /** access element. not really safe. Can alter length_i_ without
-      #String_data# knowing it.  */
-    Byte &operator [](int j);
-    Byte operator [](int j) const;
-    bool is_binary_bo()const;
-};
-
-
-
-#ifdef STRING_UTILS_INLINED
-#ifndef INLINE
-#define INLINE inline
-#endif
-#include "string-data.inl"
-
-#endif
-
-
-#endif // STRING_DATA_HH
diff --git a/flower/lib/include/string-data.inl b/flower/lib/include/string-data.inl
deleted file mode 100644 (file)
index d2b925d..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-/* -*-C++-*-
-  String_data.inl -- implement String_data
-
-  source file of Flower lib
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#ifndef STRINGDATA_INL
-#define STRINGDATA_INL
-
-#include <assert.h>
-#include <memory.h>
-
-#include "string-data.hh"
-const int INITIALMAX=8;
-
-#include <sys/types.h>
-
-INLINE void 
-String_data::OKW() 
-{
-    assert (references == 1);
-}
-
-INLINE void 
-String_data::OK() 
-{
-    assert(maxlen >= length_i_);
-    assert(bool(data_byte_p_));
-    assert(references >= 1);
-}
-
-
-INLINE
-String_data::String_data() 
-{
-    references=0;
-    maxlen = INITIALMAX;
-    data_byte_p_ = new Byte[maxlen + 1];
-    data_byte_p_[0] = 0;
-    length_i_ = 0;
-}
-
-INLINE
-String_data::String_data(String_data const &src) 
-{
-    references=0;      
-    maxlen = length_i_ = src.length_i_;                
-    data_byte_p_ = new Byte[maxlen+1]; // should calc GNU 8byte overhead.      
-    memcpy( data_byte_p_, src.data_byte_p_, length_i_ + 1 );   
-}
-
-INLINE
-String_data::~String_data() 
-{
-    assert(references == 0);
-    delete[] data_byte_p_;
-}
-
-INLINE void 
-String_data::setmax(int j) 
-{      
-    OKW();
-    if (j > maxlen) {
-       delete data_byte_p_;
-       maxlen = j;
-       data_byte_p_ = new Byte[maxlen + 1];
-    
-       data_byte_p_[0] = 0;
-       length_i_ = 0;
-    }
-}
-
-/* this is all quite hairy:  
-        update of length_i_
-        update of maxlen
-        alloc of buffer
-        copying of buffer
- needs blondification: 
-       split tasks
-       define change authority
-*/
-INLINE void 
-String_data::remax(int j) 
-{
-    OKW();
-    if (j > maxlen) {
-       Byte *p = new Byte[j + 1];      
-       memcpy( p, data_byte_p_, ( maxlen <? length_i_ ) + 1 );     
-       maxlen = j;
-       delete[] data_byte_p_;
-       data_byte_p_ = p;
-    }
-}
-
-INLINE void 
-String_data::tighten() 
-{ // should be dec'd const
-    maxlen = length_i_;
-    Byte *p = new Byte[maxlen + 1];        
-    memcpy( p, data_byte_p_, length_i_ + 1 );      
-    delete[] data_byte_p_;
-    data_byte_p_ = p;          
-}
-// assignment.
-INLINE void 
-String_data::set( Byte const* byte_c_l, int length_i ) 
-{
-    OKW();
-
-    assert( byte_c_l && byte_c_l != data_byte_p_);
-
-    length_i_ = length_i;
-    remax( length_i_ );     // copies too
-    memcpy( data_byte_p_, byte_c_l, length_i_ );
-    data_byte_p_[ length_i_ ] = 0;
-}
-
-INLINE
-void 
-String_data::set( char const* ch_c_l ) 
-{
-    set( (Byte const*)ch_c_l, strlen( ch_c_l ) );
-}
-
-
-/// concatenation.
-INLINE void 
-String_data::append( Byte const* byte_c_l, int length_i ) 
-{
-    OK();
-    OKW();
-    int old_i = length_i_;
-    
-    length_i_ += length_i;
-    remax( length_i_ );
-    memcpy( data_byte_p_ + old_i, byte_c_l, length_i );        
-    data_byte_p_[ length_i_ ] = 0;
-}
-
-INLINE
-void 
-String_data::operator += ( char const* ch_c_l ) 
-{
-    append( (Byte const*)ch_c_l, strlen( ch_c_l ) );
-}
-
-
-
-INLINE
-char const*
-String_data::ch_c_l() const
-{
-    return (char const*)data_byte_p_; 
-}
-INLINE char* 
-String_data::ch_l() 
-{ 
-    return (char*)data_byte_p_; 
-}
-
-INLINE Byte const*
-String_data::byte_c_l() const 
-{ 
-    return data_byte_p_; 
-}
-
-INLINE Byte* 
-String_data::byte_l() 
-{
-    OKW();
-    return data_byte_p_;
-}
-
-INLINE
-void 
-String_data::trunc(int j) 
-{
-    OKW(); 
-    assert(j >= 0 && j <= length_i_);
-    data_byte_p_[j] = 0;
-    length_i_ = j;
-}
-
-INLINE bool
-String_data::is_binary_bo()const
-{
-//    return !memchr(data_byte_p_, length_i_, 0);
-    return ( (int)strlen( (char const*)data_byte_p_ ) != length_i_ );
-}
-
-INLINE Byte&
-String_data::operator [](int j) 
-{
-    assert(j >= 0 && j <= length_i_);
-    return data_byte_p_[j] ; 
-}
-
-INLINE Byte 
-String_data::operator [](int j) const 
-{
-    assert(j >= 0 && j <= length_i_);
-    return data_byte_p_[j]; 
-}
-
-
-
-
-#endif // __STRING_UTIL_CC //
diff --git a/flower/lib/include/string-handle.hh b/flower/lib/include/string-handle.hh
deleted file mode 100644 (file)
index 5b7a12f..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-  string-handle.hh -- declare String_handle
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef STRINGHANDLE_HH
-#define STRINGHANDLE_HH
-#include "fproto.hh"
-
-
-/**
-  Reference counting for strings.
-  
-   handles ref. counting, and provides a very thin interface using
-   Byte *
-
-   */
-class String_handle {
-    String_data* data;
-    
-    /// decrease ref count. Named kind of like a Tanenbaum semafore 
-    void down();
-
-    /// increase ref count
-    void up(String_data *d);
-    
-    /** make sure data has only one reference.      
-       POST: data->references == 1
-      */
-    void copy();
-    
-public:
-    String_handle();
-    ~String_handle();
-    String_handle(String_handle const & src);
-
-    Byte const* byte_c_l() const;
-    char const* ch_c_l() const;
-    Byte* byte_l();
-    char* ch_l();    
-    bool is_binary_bo()const;
-    void operator =(String_handle const &src);
-    void operator += (char const *s);
-    Byte operator[](int j) const;
-
-    /** Access elements. WARNING: NOT SAFE
-       don't use this for loops. Use byte_c_l()
-       */
-    Byte &operator[](int j);
-    void append( Byte const* byte_c_l, int length_i );
-    void set( Byte const* byte_c_l, int length_i );
-    void operator = (char const *p);
-    void trunc(int j);
-    int length_i() const;
-};
-
-#ifdef STRING_UTILS_INLINED
-#ifndef INLINE
-#define INLINE inline
-#endif
-#include "string-handle.inl"
-/* we should be resetting INLINE. oh well. */
-#endif
-
-
-#endif // STRINGHANDLE_HH
diff --git a/flower/lib/include/string-handle.inl b/flower/lib/include/string-handle.inl
deleted file mode 100644 (file)
index 1f1d44a..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/* -*-c++-*-
-   
-  stringhandle.inl -- implement String_handle
-
-  source file of Flower lib
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#ifndef STRINGHANDLE_INL
-#define STRINGHANDLE_INL
-
-#include <assert.h>
-#include <memory.h>
-
-#include "string-data.hh"
-#include "string-handle.hh"
-
-INLINE void 
-String_handle::down() 
-{ 
-    if (!(--data->references)) delete data; data = 0; 
-}
-
-/// increase ref count
-INLINE void 
-String_handle::up(String_data *d) 
-{ 
-    data=d; data->references ++; 
-}
-
-INLINE void 
-String_handle::copy() 
-{
-    if (data->references !=1){
-       String_data *newdata = new String_data(*data);
-       down();
-       up(newdata);
-    }
-}
-
-INLINE
-String_handle::String_handle() 
-{
-    up(new String_data);
-}
-
-INLINE
-String_handle::~String_handle() 
-{      
-    down();
-}    
-
-INLINE
-String_handle::String_handle(String_handle const & src) 
-{      
-    up(src.data);
-}
-
-INLINE Byte* 
-String_handle::byte_l() 
-{
-    copy();
-    return data->byte_l();
-}
-
-INLINE char* 
-String_handle::ch_l() 
-{
-    copy();
-    return (char*)data->byte_l();
-}
-
-INLINE Byte 
-const* String_handle::byte_c_l() const 
-{
-    return data->byte_c_l();
-}
-
-INLINE char const* 
-String_handle::ch_c_l() const 
-{
-    return (char const*)data->byte_c_l();
-}
-
-INLINE void 
-String_handle::operator =(String_handle const &src) 
-{
-    if (this == &src)
-       return;
-    down();
-    up(src.data);
-}
-
-INLINE void 
-String_handle::operator += (char const *s) 
-{      
-    copy();
-    *data += s;
-}    
-
-
-INLINE Byte 
-String_handle::operator[](int j) const 
-{ 
-    return (*data)[j]; 
-}
-
-// !NOT SAFE!
-// don't use this for loops. Use byte_c_l()
-INLINE Byte &
-String_handle::operator[](int j) 
-{
-    copy();    // hmm. Not efficient
-    return data->byte_l()[j];
-}
-
-INLINE void 
-String_handle::append( Byte const* byte_c_l, int length_i ) 
-{
-    copy();
-    data->append( byte_c_l, length_i );
-}
-                          
-INLINE void 
-String_handle::set( Byte const* byte_c_l, int length_i ) 
-{
-    copy();
-    data->set( byte_c_l, length_i );
-}
-                          
-INLINE void 
-String_handle::operator = (char const *p) 
-{
-    copy();
-    data->set( p );
-}
-                          
-INLINE void 
-String_handle::trunc(int j) 
-{
-    copy(); data->trunc(j); 
-}
-
-INLINE int 
-String_handle::length_i() const 
-{ 
-    return data->length_i_; 
-}
-
-INLINE bool
-String_handle::is_binary_bo() const {
-    return data->is_binary_bo();
-}
-
-#endif
diff --git a/flower/lib/include/string.hh b/flower/lib/include/string.hh
deleted file mode 100644 (file)
index 8cef141..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
-
-  FILE   : string.hh -- declare String
-  Rehacked by HWN 3/nov/95
-  removed String & 's
-  introduced Class String_handle
- */
-
-#ifndef STRING_HH
-#define STRING_HH
-
-
-#include <string.h>
-#include <iostream.h>
-#include <Rational.h>
-
-#include "string-handle.hh"
-
-/** 
-  Intuitive string class. provides 
-\begin{itemize}
-\item
-  ref counting through #String_handle#
-\item
-  conversion from bool, int, double, char* , char.  
-\item
-  to be moved to String_convert:
-  conversion to int, upcase, downcase 
-
-\item
-  printable. 
-
-\item
-  indexing (index_i, index_any_i, last_index_i)
-
-\item
-  cutting (left_str, right_str, mid_str)
-
-\item
-  concat (+=, +)
-
-\item
-  signed comparison (<, >, ==, etc)
-
-\item
-  No operator[] is provided, since this would be enormously  slow. If needed,
-  convert to char const* .
-\end{itemize}
-
-*/
-class String
-{
-protected:
-    String_handle strh_; 
-
-    bool null_terminated();
-    
-public:
-
-    /** init to empty string. This is needed because other
-      constructors are provided.*/
-    String() {  }                  
-    String(Rational);
-
-    /// String s = "abc";
-    String( char const* source ); 
-    String( Byte const* byte_c_l, int length_i ); 
-    
-    /// "ccccc"
-    String( char c, int n = 1 );
-
-    String( int i , char const *fmt=0);
-    String ( double f , char const* fmt =0);
-    /// 'true' or 'false'
-    String(bool );
-
-    ///  return a "new"-ed copy of contents
-    Byte* copy_byte_p() const; //  return a "new"-ed copy of contents
-
-    char const* ch_c_l() const;
-    Byte const* byte_c_l() const;
-    char* ch_l();
-    Byte* byte_l();
-
-    /// deprecated; use ch_c_l()
-    operator char const* () const { return ch_c_l(); }
-    
-    String &operator =( const String & source );
-
-    /// concatenate s
-    void operator += (char const* s) { strh_ += s; }
-    void operator += (String s);
-
-    void append(String);
-    void prepend(String);
-
-    char operator []( int n ) const { return strh_[n]; }
-
-    /// return n leftmost chars
-    String left_str( int n ) const;
-
-    /// return n rightmost chars
-    String right_str( int n ) const;
-
-    /// return uppercase of *this
-    String upper_str() const;
-
-    /// return lowercase of *this
-    String lower_str() const;
-
-    /// return the "esrever" of *this
-    String reversed_str() const;
-
-
-    /// return a piece starting at index_i (first char = index_i 0), length n
-    String mid_str(int index_i, int n ) const;
-
-    /// cut out a middle piece, return remainder
-    String nomid_str(int index_i, int n ) const;
-
-    /// signed comparison,  analogous to memcmp;
-    static int compare_i(const String& s1,const  String& s2);
-       
-    /// index of rightmost c 
-    int index_last_i( char c) const;
-
-    /// index of rightmost element of string 
-    int index_last_i( char const* string ) const;
-
-    int index_i(char c ) const;
-    int index_i(String ) const;
-    int index_any_i(String ) const;
-
-    void to_upper();
-    void to_lower();
-    /// provide Stream output
-    void print_on(ostream& os) const;
-
-    /// the length of the string
-    int length_i() const;
-
-    // ***** depreciated
-    int len() const {
-       return length_i();
-    }
-
-    /// convert to an integer
-    int value_i() const;
-
-    /// convert to a double
-    double value_f() const;
-};
-
-#include "compare.hh"
-
-instantiate_compare(const String &, String::compare_i);
-
-// because char const* also has an operator ==, this is for safety:
-inline bool operator==(String s1, char const* s2){
-    return s1 == String(s2);
-}
-inline bool operator==(char const* s1, String s2)
-{
-    return String(s1)==s2;
-}
-inline bool operator!=(String s1, char const* s2  ) {
-    return s1!=String(s2);
-}
-inline bool operator!=(char const* s1,String s2) {
-    return String(s2) !=s1;
-}
-
-
-inline String
-operator  + (String s1, String  s2)
-{
-    s1 += s2;
-    return s1;
-}
-
-inline ostream &
-operator << ( ostream& os, String d )
-{
-    d.print_on(os);
-    return os;
-}
-
-
-// String quoteString(String message, String quote);
-
-#endif
diff --git a/flower/lib/include/text-db.hh b/flower/lib/include/text-db.hh
deleted file mode 100644 (file)
index 3535a84..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef TEXTDB_HH
-#define TEXTDB_HH
-
-#include "data-file.hh"
-
-/**a "const" Array. Contents can't be changed. do "#" comments, read quote enclosed  fields */
-
-class Text_record : Array<String>  
-{
-    int line_no;
-    String filename;
-    
-public:
-    Text_record() { } // needed because of other ctor
-
-    /// report an error in this line.
-    message(String s) {
-       cerr << '\n'<< filename << ": "<< line_no << s << "\n";
-    }         
-    String operator[](int j) {
-       return Array<String>::operator[](j);
-    }
-
-    Text_record(Array<String> s, String fn, int j) : Array<String>(s) { 
-       filename = fn; line_no = j; 
-    }
-    Array<String>::size;           
-};
-
-/** abstraction for a datafile.
-    add a subrec/fieldsep/record separator
-    */
-
-class Text_db : private Data_file
-{
-    void gobble_leading_white();
-public:
-    /// get a line with records
-    Text_record    get_record();
-
-    Text_db(String fn):Data_file(fn) { }
-    Data_file::error;
-    bool eof();
-
-    /// get next line.
-    Text_record operator++(int) {
-       return get_record();
-    }
-    /// are we done yet?
-    operator bool() {
-       return !eof();
-    }
-};
-
-#endif
diff --git a/flower/lib/include/text-stream.hh b/flower/lib/include/text-stream.hh
deleted file mode 100644 (file)
index 437f869..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-
-#ifndef TEXTSTR_HH
-#define TEXTSTR_HH
-
-#include <stdio.h>
-#include <ctype.h>
-#include "string.hh"
-#include "varray.hh"
-
-/**
-  line counting input stream. 
-  a stream for textfiles. linecounting. Thin interface getchar and
-  ungetchar.  (ungetc is unlimited) 
-  
-  should protect get and unget against improper use
-*/
-
-
-class Text_stream
-{
-    int line_no;
-
-    // could just have used streams. 
-    FILE *f;  
-    Array<char> pushback;
-    String name;
-    
- public:
-    Text_stream(String fn);
-    String get_name() { return name; }
-    bool eof() {
-       return feof(f);
-    }
-    bool eol() {
-       return (peek() == '\n');
-    }
-    char peek() {
-       char c = get();
-       unget(c);
-       return c;
-    }
-    int line(){
-       return line_no;
-    }
-
-    char    get() {
-       char c;
-       
-       if (pushback.empty())
-           c = getc(f);        
-       else 
-           c = pushback.pop();
-
-       if (c =='\n')
-           line_no++;
-       return c;       
-    }
-    void unget(char c) {
-       if (c =='\n')
-           line_no--;
-       pushback.push(c);
-    }
-    ~Text_stream (){
-       if (!eof()) 
-           cerr <<__FUNCTION__<< ": closing unended file";
-    
-       fclose(f);
-    }
-
-    /// GNU format message.
-    void message(String s); 
-};
-
-#endif
diff --git a/flower/lib/include/unionfind.hh b/flower/lib/include/unionfind.hh
deleted file mode 100644 (file)
index fbaa51e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef UNIONFIND_HH
-#define UNIONFIND_HH
-#include "varray.hh"
-
-/*
-    which points of a graph are connected?.
-    Union find, a standard algorithm:
-
-    Union_find represents an undirected graph of N points. You can
-    connect two points using #connect()#. #find(i)# finds a uniquely
-    determined representant of the equivalence class of points
-    connected to #i#.
-    
-    */
-struct Union_find {    
-    void connect(int i, int j);
-    int find(int i);
-    bool equiv(int i, int j) { return find(i) == find(j); }
-    Union_find(int sz);
-
-private:
-    Array<int> classes;
-
-};
-#endif
diff --git a/flower/lib/include/varray.hh b/flower/lib/include/varray.hh
deleted file mode 100644 (file)
index febf3e7..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
-  (c) Han-Wen Nienhuys 1995,96
-
-  Distributed under GNU GPL  
-*/
-
-#ifndef ARRAY_H
-#define ARRAY_H
-#include <assert.h>
-
-/// copy a bare (C-)array from #src# to #dest# sized  #count#
-template<class T>
-inline void arrcpy(T*dest, T*src, int count) {
-    for (int i=0; i < count ; i++)
-       *dest++ = *src++;
-}
-
-
-/**
-  Scaleable array/stack template, for a type T with default constructor.
-  
-  
-  This template implements a scaleable vector. With (or without) range
-  checking. It may be flaky for objects with complicated con- and
-  destructors. The type T should have a default constructor. It is
-  best suited for simple types, such as int, double or String, it
-  provides a paranoidly safe replacement for the new T[int] construct.
-
-  It uses stack terminology, (push, pop, top), and  can be used as a stack.
-
-  
-  */
-template<class T>
-class Array {
-protected:
-    /// maximum length of array.
-    int max;
-
-    /// the data itself
-    T *thearray;
-
-    /// stretch or shrink  array.
-    void remax(int newmax) {    
-       T* newarr = new T[newmax];
-       size_ = (newmax < size_) ? newmax : size_;
-       arrcpy(newarr, thearray, size_);
-       
-       delete[] thearray;
-       thearray = newarr;
-       max = newmax;
-    }
-    int size_;
-
-public:
-    /// check invariants
-    void OK() const {
-       assert(max >= size_ && size_ >=0);
-       if (max) assert(thearray);
-    }
-    /** report the size_.
-      @see {setsize_}
-      */
-    int size() const  { return size_; }
-    
-    /// POST: size() == 0
-    void clear() { size_ = 0; }
-
-    Array() { thearray = 0; max =0; size_ =0; }
-
-
-    /** set the size_ to #s#.
-      POST: size() == s.
-    Warning: contents are unspecified */
-    void set_size(int s) {
-       if (s >= max) remax(s);
-       size_ = s;    
-    }
-    
-    ~Array() { delete[] thearray; }
-
-    /// return a  "new"ed copy of array 
-    T* copy_array() const {
-       T* Tarray = new T[size_];
-       arrcpy(Tarray, thearray, size_);
-       return Tarray;
-    }
-    // depracated
-    operator T* () const {
-       return copy_array();    
-    }
-    void operator=(Array const & src) {
-       set_size (src.size_);
-       arrcpy(thearray,src.thearray, size_);
-    }
-    Array(const Array & src) {
-       thearray = src.copy_array();
-       max = size_ = src.size_;        
-    }
-
-    /// tighten array size_.
-    void precompute () { remax(size_); }
-
-    /// this makes Array behave like an array
-    T &operator[] (const int i) const {
-       assert(i >=0&&i<size_);
-       return ((T*)thearray)[i];       
-    }
-
-    /// add to the end of array
-    void push(T x) {
-       if (size_ == max)
-           remax(2*max + 1);
-
-       // T::operator=(T &) is called here. Safe to use with automatic
-       // vars
-       thearray[size_++] = x;
-    }
-    /// 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];
-    }
-     /// 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];
-       (*this)[j]=t;
-    }
-    bool empty() { return !size_; }
-    void insert(T k, int j) {
-       assert(j >=0 && j<= size_);
-       set_size(size_+1);
-       for (int i=size_-1; i > j; i--)
-           thearray[i] = thearray[i-1];
-       thearray[j] = k;
-    }
-    void del(int i) {
-       assert(i >=0&& i < size_);
-       arrcpy(thearray+i, thearray+i+1, size_-i-1);
-       size_--;
-    }
-    // quicksort.
-    void sort (int (*compare)( T const&,T const&),
-              int lower = -1, int upper = -1 ) {
-       if (lower < 0) {
-           lower = 0 ;
-           upper = size()-1;
-       }
-       if (lower >= upper)
-           return;
-       swap(lower, (lower+upper)/2);
-       int last = lower;
-       for (int i= lower +1; i <= upper; i++)
-           if (compare(thearray[i], thearray[lower]) < 0 )
-               swap( ++last,i);
-       swap(lower, last);
-       sort(compare, lower, last-1);
-       sort(compare, last+1, upper);
-    }
-    void concat(Array<T> const &src) {
-       int s = size_;
-       set_size(size_ + src.size_);
-       arrcpy(thearray+s,src.thearray, src.size_);     
-    }
-    Array<T> subvec(int lower, int upper) {
-       assert(lower >= 0 && lower <=upper&& upper <= size_);
-       Array<T> r;
-       int s =upper-lower;
-       r.set_size(s);
-       arrcpy(r.thearray, thearray  + lower, s);
-       return r;
-    }
-};
-
-#endif
diff --git a/flower/lib/include/vector.hh b/flower/lib/include/vector.hh
deleted file mode 100644 (file)
index 4d91397..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-#ifndef VECTOR_HH
-#define VECTOR_HH
-
-#include <math.h>
-#include "real.hh"
-#include "varray.hh"
-
-class Dstream;
-class String;
-void set_matrix_debug(Dstream&ds);
-
-/**  a row of numbers. 
-    a vector. Storage is handled in Array, Vector only does the mathematics.
- */
-class Vector  {
-    Array<Real> dat;
-public:
-    void OK() const { dat.OK();}
-    int dim() const { return dat.size(); }
-    Vector() { }
-    Vector(Array<Real> d );
-    Vector(const Vector&n);
-    Vector(int n) {
-       dat.set_size(n);
-       fill(0);
-    }
-    void insert(Real v, int i) {
-       dat.insert(v,i);
-    }
-    void del(int i) { dat.del(i); }
-    operator String() const;
-    void fill(Real r) {
-       for (int i=0; i < dim(); i++)
-           dat[i] =r;
-    }
-
-    void operator +=(Vector v) {
-       assert(v.dim() == dim());
-       for (int i=0; i < dim(); i++)
-           dat[i] += v.dat[i];
-    }
-    
-    void operator /=(Real a) {
-       (*this) *= 1/a;
-    }
-
-    void operator *=(Real a) {
-       for (int i=0; i < dim(); i++)
-           dat[i] *= a;
-    }
-
-    void operator -=(Vector v) {
-       assert(v.dim() == dim());
-       for (int i=0; i < dim(); i++)
-           dat[i] -= v(i);     
-    }
-
-    Real &operator()(int i) { return dat[i]; }
-    Real operator()(int i) const { return dat[i]; }
-    Real elem(int i) { return dat[i]; }
-    Real operator *(Vector v) const {
-       Real ip=0;
-       assert(v.dim() == dim());
-       for (int i=0; i < dim(); i++)
-           ip += dat[i] *v(i);
-       return ip;
-    }
-    Vector operator-() const;
-    Real norm() {
-       return sqrt(norm_sq() );
-    }
-    Real norm_sq() {
-       return ((*this) * (*this));
-    }
-    operator Array<Real> () { return dat; }
-    void print() const;
-    /// set to j-th element of unit-base
-    void set_unit(int j) ;
-};
-
-inline Vector
-operator+(Vector a, Vector const &b) {
-    a += b;
-    return a;
-}
-
-inline Vector
-operator-(Vector a, Vector const &b) {
-    a -= b;
-    return a;
-}
-
-inline Vector
-operator*(Vector v, Real a) {
-    v *= a;
-    return v;
-}
-
-inline Vector
-operator*( Real a,Vector v) {
-    v *= a;
-    return v;
-}
-
-inline Vector
-operator/(Vector v,Real a) {
-    v *= 1/a;
-    return v;
-}
-
-#endif
diff --git a/flower/lib/include/vsmat.hh b/flower/lib/include/vsmat.hh
deleted file mode 100644 (file)
index 283b1e5..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-#ifndef VSMAT_HH
-#define VSMAT_HH
-#include "varray.hh"
-#include "real.hh"
-/** base class for interface with matrix storageclasses.  There are no
-    iterators for matrixclasses, since matrices are (like arrays)
-    explicitly int-indexed.
-
-    Iteration is provided by *_next, *_ok, which update and check both
-    index variables simultaneously.
-
-    TODO
-    determine type of product matrix.
-
-*/
-class virtual_smat {
-    
-
-public:
-    /// check invariants
-    virtual void OK() const=0;
-    
-    /// height of matrix
-    virtual int rows() const = 0;
-
-    /// width of matrix
-    virtual int cols() const = 0;
-      
-    /**  set the size. contents lost.       
-      PRE
-      i >=0, j>=0
-    */
-    virtual void set_size(int i, int j) = 0;
-    /**set the size to square dimen. contents lost
-      PRE
-      i>=0
-    */
-    virtual void set_size(int i) = 0;
-     /**set the size to i.
-
-      keep contents. If enlarged contents unspecified
-        
-      PRE
-      i>=0, j>=0
-    
-    */
-    virtual void resize(int i, int j) = 0;
-  /**    
-    set the size to square dimen. contents kept
-    Keep contents. If enlarged contents are unspecified
-    
-    PRE
-    i>=0  
-    */
-    virtual void resize(int i) = 0;
-  
-    
-        /**
-    access an element.
-
-    Generate an errormessage, if this happens
-    in the 0-part of a sparse matrix.
-    */
-
-    virtual Real& elem(int i,int j) = 0;
-
-    /// access a element, no modify
-    virtual const Real& elem(int i, int j) const = 0;
-
-#if 1
-    virtual Array<Real> row(int i) const = 0;
-    virtual Array<Real> column(int j) const = 0;
-#endif
-
-    
-    /**
-    add a row to the matrix before  row k. Contents
-    of added row are unspecified
-
-      0 <= k <= rows()
-    */
-    virtual void insert_row(int k)=0;
-
-    
-      /**
-      delete a row from this matrix.
-
-      PRE
-      0 <= k < rows();
-    */
-    virtual void delete_row(int k)=0;
-        virtual void delete_column(int k)=0;
-    virtual ~virtual_smat() { }
-    virtual virtual_smat *clone()=0;
-
-
-    
-    /**
-      at end of matrix?. when doing loop
-
-      for(i=0; i<h; i++)
-        for(j=0; j<w; j++)
-          ..
-
-    */
-    virtual bool mult_ok(int i, int j) const=0;
-
-    /**
-      walk through matrix (regular multiply).
-      get next j for row i, or get next row i and reset j.
-      this will make sparse matrix implementation easy.
-    
-      PRE
-      mult_ok(i,j)
-     */
-    virtual void mult_next(int &i, int &j) const  = 0;
-
-/**
-      valid matrix entry. return false if at end of row
-    */
-    virtual bool trans_ok(int i, int j) const=0;
-
-    /**
-      walk through matrix (transposed multiply).
-      Get next i (for column j)
-    
-      PRE
-      ver_ok(i,j)
-     */
-
-    virtual void trans_next(int &i, int &j) const  = 0;
-    /// generate a "Full_storage" matrix    
-    static virtual_smat *get_full(int n, int m);
-
-};
-    
-
-#endif
diff --git a/flower/lib/lgetopt.cc b/flower/lib/lgetopt.cc
deleted file mode 100644 (file)
index a56c64c..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
-   process command line, GNU style.
-
-   this is (Copyleft) 1996, Han-Wen Nienhuys, <hanwen@stack.nl>
- */
-#include <stdio.h>
-#include <iostream.h>
-#include <assert.h>
-#include "lgetopt.hh"
-
-long
-Getopt_long::intarg()
-{
-    long l;
-    if (sscanf(optarg, "%ld", &l) != 1)
-       report(E_ILLEGALARG);
-    
-    return l;
-}
-
-Long_option_init *
-Getopt_long::parselong()
-{
-    const char *optnm = argv[optind] + 2 ;
-    assert(*optnm);
-    
-    char *endopt = strchr(optnm, '=');
-    int searchlen  = (endopt) ? endopt - optnm : strlen(optnm);
-    
-    beet=0;
-    for (int i=0; i< table_len; i++) {
-       const char *ln = the_opts[i].longname;
-
-       if (ln && !strncmp(ln, optnm, searchlen)) {
-           beet = the_opts+i;
-           break;
-       }
-    }  
-
-    if (!beet) {
-       report(E_UNKNOWNOPTION);
-       return 0;
-    }
-    optind++;
-    optindind = 0;
-
-    
-    if (beet->take_arg) {
-       if (endopt)
-           optarg = endopt +1; // a '='
-       else {
-           optarg = argv[optind];
-           optind++;
-       }
-       if (!optarg)
-           report(E_ARGEXPECT);
-
-    } else {
-       optarg = 0;
-       if (endopt)
-           report(E_NOARGEXPECT);
-    }
-    
-    return beet;
-}
-
-
-ostream &
-Long_option_init::printon(ostream &errorout)
-{
-    if (shortname)     
-       errorout <<"-" << shortname;
-    if (shortname && longname)
-       errorout << ", ";
-    if (longname)      
-       errorout << "`--" << longname << "'";
-    return errorout;
-}
-
-// report an error, GNU style.
-void
-Getopt_long::report(Errorcod c)
-{
-    error = c;
-    if (!errorout)
-       return;
-
-    *errorout << argv[0] << ": ";
-    switch (c) {
-    case E_ARGEXPECT:
-       *errorout<< "option ";
-       beet->printon(*errorout);
-       *errorout << "requires an argument"<<endl;
-       break;
-    case  E_NOARGEXPECT:
-       *errorout << "option `--" <<
-           beet->longname << "' does not allow an argument"<<endl;
-       break;
-       
-    case E_UNKNOWNOPTION:
-       *errorout << "unrecognized option ";
-       if (optindind)
-           *errorout << "-" << argv[optind][optindind] << endl;
-       else
-           *errorout << argv[optind] << endl;
-
-       break;
-    case E_ILLEGALARG:
-       *errorout << "illegal argument `" << optarg << "\'to option ";
-       beet->printon(*errorout);
-       *errorout << '\n';
-    default:
-       assert(false);
-    }
-    exit(2); 
-}
-    
-Long_option_init *
-Getopt_long::parseshort()
-{
-    char c=argv[optind][optindind];
-    beet=0;
-    assert(c);
-    
-    for (int i=0; i < table_len; i++)
-       if (the_opts[i].shortname == c) {
-           beet  = the_opts+i;
-           break;
-       }
-
-    if (!beet){
-       report(E_UNKNOWNOPTION);
-       return 0;
-    }
-
-    optindind++;
-    if (!beet->take_arg){
-       optarg = 0;
-       return beet;
-    }
-    optarg = argv[optind] + optindind;
-
-    optind ++;
-    optindind = 0;
-    
-    if (!optarg[0]) {
-       optarg = argv[optind];
-       optind ++;
-    }
-    if (!optarg) {
-       report(E_ARGEXPECT);
-    }
-    
-    return beet;
-}
-
-Long_option_init *
-Getopt_long::operator()() {
-    if (!next())
-       return 0;
-    
-    if (optindind)
-       return parseshort();
-    
-    if (argv[optind][0] != '-')
-       return 0;
-
-    if (argv[optind][1] == '-') {// what to do with "command  --  bla"
-       return parselong();
-    } else {
-       optindind = 1;
-       return parseshort();
-    }
-}
-
-Getopt_long::Getopt_long(int c, char **v, Long_option_init *lo)
-{
-    the_opts = lo;
-    errorout = &cerr;
-    argv = v;
-    argc = c;
-    optind = 1;
-    optindind = 0;
-
-    //    reached end of option table?
-    int i;
-    for (i = 0;  the_opts[i].longname ||the_opts[i].shortname; i++)
-       ;
-    table_len = i;
-}
-
-bool
-Getopt_long::next()
-{
-
-    error = E_NOERROR;
-    while (optind < argc && !argv[optind][optindind]) {
-       optind++;
-       optindind = 0;
-    }
-    return (optind < argc);
-}
-   
-char *
-Getopt_long::current_arg()
-{
-    if (optind >= argc)
-       return 0;
-    char * a = argv[optind];
-    return a + optindind;
-}
-
-char *
-Getopt_long::get_next_arg()
-{
-    char * a = current_arg();
-    if ( a) {
-       optind ++;
-       optindind = 0;
-    }
-    return a;
-}
diff --git a/flower/lib/libc-extension.cc b/flower/lib/libc-extension.cc
deleted file mode 100644 (file)
index 3a89e81..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-  libc-extension.cc -- implement some string.h extensions
-
-  source file of the flowerlib
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include <stdarg.h>
-#include <string.h>
-#include <ctype.h>
-#include "libc-extension.hh"
-
-/*
-  compensate for lacking libc functions.
- */
-char* 
-strnlwr( char* start_l ,int n)
-{
-    char * p = start_l + n;
-    while ( --p >= start_l) {
-       *p = tolower( *p );    /* a macro on some compilers */
-    }
-    return start_l;
-}
-
-char* 
-strnupr( char* start_l, int n)
-{
-    char * p = start_l + n;
-    while ( --p >= start_l) {
-       *p = toupper( *p );    /* a macro on some compilers */
-    }
-    return start_l;
-}
-
-#ifndef HAVE_MEMMEM
-
-/** locate a substring. #memmem# finds the first occurrence of
-  #needle# in #haystack#
-  */
-
-char *
-memmem(const Byte * haystack, int haystack_len,
-       const Byte *needle,int needle_len)
-{
-    const Byte * end_haystack = haystack + haystack_len - needle_len;
-    const Byte * end_needle = needle + needle_len ;
-
-    /* Ahhh ... Some minimal lowlevel stuff. This *is* nice; Varation
-      is the spice of life */
-    while (haystack < end_haystack) {
-       const Byte *subneedle_l = needle;
-       const Byte *subhaystack_l = haystack;
-       while (subneedle_l < end_needle) {
-           if (*subneedle_l++ != *subhaystack_l++)
-               goto next;      // yeah. I should be prosecuted.
-       }
-       
-       // completed the needle. Gotcha.
-       return (char*) haystack;
-    next:
-       haystack++;
-    }
-    return 0;
-}
-#endif
-
-Byte *
-memrchr(const Byte * p, int n, char c)
-{
-    const    Byte * q = p+n;
-    while (q > p) {
-       if (*--q == c)
-           return (Byte*)q;
-    }
-    return 0;
-}
-
-
-template<class T>
-inline void
-my_swap(T &t1, T &t2, T &tmp)
-{
-    tmp = t1;
-    t1 = t2;
-    t2 = tmp;
-}
-
-Byte*
-strrev( Byte* byte_l, int length_i )
-{
-  Byte tmp_byte;
-  
-  Byte* left_l = byte_l;
-  Byte* right_l = byte_l + length_i;
-
-  while ( right_l > left_l ) {
-      my_swap(*right_l-- , *left_l++ , tmp_byte);
-  }
-  return byte_l;
-}
-
-#ifndef HAVE_SNPRINTF
-int snprintf ( char *str, size_t,
-              const char *format, ... )
-{
-    va_list ap;
-    va_start(ap, format);
-    int i = vsprintf(str, format, ap);
-    va_end(ap);
-    return i;
-}
-#endif
diff --git a/flower/lib/matdebug.cc b/flower/lib/matdebug.cc
deleted file mode 100644 (file)
index bcc2843..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#include "dstream.hh"
-#include "matrix.hh"
-
-static Dstream *dout = 0;
-
-/**
-  Set the debugging output. Will not delete/swallow argument.
- */
-void set_matrix_debug(Dstream&ds)
-{
-    dout = &ds;
-}
-
-Matrix::operator String() const
-{
-    String s;
-#ifndef NPRINT
-    s="matrix {\n";
-    for (int i=0; i< rows(); i++){
-       for (int j = 0; j < cols(); j++) {
-           s+= String(dat->elem(i,j), "%6f ");
-       }
-       s+="\n";
-    }
-    s+="}\n";
-#endif
-    return s;
-}
-
-
-void
-Matrix::print() const
-{
-#ifndef NPRINT
-    if (!dout)
-       return;
-    *dout << *this;
-#endif
-}
-
-Vector::operator String() const
-{
-    String s;
-#ifndef NPRINT
-    s="vector [";
-    for (int i=0; i < dim(); i++) {
-       s += String(dat[i], "%6f") + String(' ');
-    }
-    s+="]";
-#endif
-    return s;
-}
-
-
-void
-Vector::print() const
-{
-#ifndef NDEBUG
-    if (!dout)
-       return;
-    *dout << *this<<'\n';
-#endif
-}
diff --git a/flower/lib/matrix.cc b/flower/lib/matrix.cc
deleted file mode 100644 (file)
index 63bd85a..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-#include "matrix.hh"
-
-Real
-Matrix::norm() const
-{
-    Real r =0.0;
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       r += sqr(dat->elem(i,j));
-    return sqrt(r);
-}
-
-void
-Matrix::fill(Real r)
-{
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       dat->elem(i,j)=r;
-}
-
-void
-Matrix::set_diag(Real r)
-{
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))   
-       dat->elem(i,j)=(i==j) ? r: 0.0;
-}
-
-void
-Matrix::set_diag(Vector d)
-{
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))   
-       dat->elem(i,j)=(i==j) ? d(i): 0.0;
-}
-
-void
-Matrix::operator+=(const Matrix&m)
-{
-    assert(m.cols() == cols());
-    assert(m.rows() == rows());
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       dat->elem(i,j) += m(i,j);
-}
-void
-Matrix::operator-=(const Matrix&m)
-{
-    assert(m.cols() == cols());
-    assert(m.rows() == rows());
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       dat->elem(i,j) -= m(i,j);
-}
-
-
-void
-Matrix::operator*=(Real a)
-{
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       dat->elem(i,j) *= a;
-}
-
-void
-Matrix::operator=(const Matrix&m)
-{
-    if (&m == this)
-       return ;
-    delete dat;
-    dat = m.dat->clone();
-}
-    
-Matrix::Matrix(const Matrix &m)
-{
-    m.OK();
-    
-    dat = m.dat->clone();
-}
-
-
-Matrix::Matrix(int n, int m)
-{
-    dat = virtual_smat::get_full(n,m);
-    fill(0);
-}
-
-Matrix::Matrix(int n)
-{
-    dat = virtual_smat::get_full(n,n);
-    fill(0);
-}
-
-Matrix::Matrix(Vector v, Vector w)
-{   
-    dat = virtual_smat::get_full(v.dim(), w.dim());
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       dat->elem(i,j)=v(i)*w(j);
-}
-
-
-Vector
-Matrix::row(int k) const
-{
-    int n=cols();
-
-    
-    Vector v(n);
-    for(int i=0; i < n; i++)
-       v(i)=dat->elem(k,i);
-
-    return v;
-}
-
-Vector
-Matrix::col(int k) const
-{
-    int n=rows();
-    Vector v(n);
-    for(int i=0; i < n; i++)
-       v(i)=dat->elem(i,k);
-    return v;
-}
-
-Vector
-Matrix::left_multiply(const Vector& v) const
-{
-     Vector dest(v.dim());
-    assert(dat->cols()==v.dim());
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       dest(i)+= dat->elem(j,i)*v(j);
-    return dest;
-}
-
-Vector
-Matrix::operator *(const Vector& v) const
-{
-    Vector dest(rows());
-    assert(dat->cols()==v.dim());
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
-       dest(i)+= dat->elem(i,j)*v(j);
-    return dest;
-}
-
-Matrix
-operator /(Matrix const& m1,Real a)
-{
-    Matrix m(m1);
-    m /= a;
-    return  m;
-}
-
-void
-Matrix::transpose()            // delegate to storage?
-{
-    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j)) {
-       if (i >= j)
-           continue;
-       Real r=dat->elem(i,j);
-       dat->elem(i,j) = dat->elem(j,i);
-       dat->elem(j,i)=r;
-    }
-}
-
-Matrix
-Matrix::operator-() const
-{
-    OK();
-    Matrix m(*this);
-    m*=-1.0;    
-    return m;
-}
-
-Matrix
-Matrix::transposed() const
-{
-    Matrix m(*this);
-    m.transpose();
-    return m;
-}
-
-
-/* should do something smarter: bandmatrix * bandmatrix is also banded matrix.  */
-Matrix
-operator *(const Matrix &m1, const Matrix &m2)
-{
-    Matrix result(m1.rows(), m2.cols());
-    result.set_product(m1,m2);
-    return result;
-}
-
-void
-Matrix::set_product(const Matrix &m1, const Matrix &m2)
-{
-    assert(m1.cols()==m2.rows());
-    assert(cols()==m2.cols() && rows()==m1.rows());
-    
-    for (int i=0, j=0; dat->mult_ok(i,j);
-        dat->mult_next(i,j)) {
-       Real r=0.0;
-       for (int k = 0; k < m1.cols(); k++)
-           r += m1(i,k)*m2(k,j);
-       dat->elem(i,j)=r;
-    }
-}
-
-void
-Matrix::insert_row(Vector v, int k)
-{
-    assert(v.dim()==cols());
-    dat->insert_row(k);
-    for (int j=0; j < cols(); j++)
-       dat->elem(k,j)=v(j);
-}
-
-
-void
-Matrix::swap_columns(int c1, int c2)
-{
-    assert(c1>=0&& c1 < cols()&&c2 < cols() && c2 >=0);
-    for (int i=0; i< rows(); i++) {
-       Real r=dat->elem(i,c1);
-       dat->elem(i,c1) = dat->elem(i,c2);
-       dat->elem(i,c2)=r;
-    }
-}
-
-void
-Matrix::swap_rows(int c1, int c2)
-{
-    assert(c1>=0&& c1 < rows()&&c2 < rows() && c2 >=0);
-    for (int i=0; i< cols(); i++) {
-       Real r=dat->elem(c1,i);
-       dat->elem(c1,i) = dat->elem(c2,i);
-       dat->elem(c2,i)=r;
-    }
-}
-
-
-int
-Matrix::dim() const
-{
-    assert(cols() == rows());
-    return rows();
-}
-
diff --git a/flower/lib/path.cc b/flower/lib/path.cc
deleted file mode 100644 (file)
index c79962f..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-   path.cc - manipulation of paths and filenames.
-*/
-#include <stdio.h>
-#include "path.hh"
-
-#ifndef PATHSEP
-#define PATHSEP '/'
-#endif
-
-/**
-   @param path the original full filename
-   @return 4 components of the path. They can be empty
-*/
-void
-split_path(String path, 
-          String &drive, String &dirs, String &filebase, String &extension)
-{
-    // peel off components, one by one.
-    int di = path.index_i(':');
-    if (di >= 0) 
-       {
-       drive = path.left_str(di + 1);
-       path = path.right_str(path.len() - di -1);
-       } 
-    else
-       drive = "";
-    
-    di = path.index_last_i(PATHSEP);
-    if (di >=0) 
-       {
-       dirs = path.left_str(di + 1);
-       path = path.right_str(path.len()-di -1);
-       }
-    else
-       dirs = "";
-    
-    di = path.index_last_i('.');
-    if (di >= 0) 
-       {
-       filebase = path.left_str(di);
-       extension =path.right_str(path.len()-di);       
-       } 
-    else 
-       {
-       extension = "";   
-       filebase = path;
-       }
-}
-
-File_path::File_path(String pref)
-{
-    add(".");
-    add(pref);
-}
-
-
-/** find a file. 
-  It will search in the current dir, in the construction-arg, and
-  in any other added path, in this order.
-  */
-String
-File_path::find(String nm)
-{
-     for (int i=0; i < size(); i++) {
-        String path  = (*this)[i];
-        path+= "/"+nm;
-
-
-        FILE *f = fopen(path, "r"); // ugh!
-        if (f) {
-            fclose(f);
-            return path;
-        }
-     }
-     return "";
-}
diff --git a/flower/lib/scalar.cc b/flower/lib/scalar.cc
deleted file mode 100644 (file)
index 5edd9e9..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#include <assert.h>
-#include <stdio.h>
-#include "scalar.hh"
-
-Scalar::Scalar(Rational r)
-    :String(r)
-{
-
-}
-
-Scalar::operator Rational()
-{
-    int p = index_i('/');
-    if (p == -1)
-       return int(*this);
-    
-    String s2 = right_str(len()-p-1);
-    String s1 = left_str(p);
-
-    return Rational(s1.value_i(), s2.value_i());
-}
-
-bool
-Scalar::isnum()
-{
-    int conv = false;
-    if (len()) {
-       long l =0;
-       conv = sscanf(strh_.ch_c_l(), "%ld", &l);
-    }
-    return len() && conv;
-}
-
-Scalar::operator Real()
-{
-    assert (isnum());
-    return value_f();
-}
-
-Scalar::operator int()
-{
-    assert (isnum());
-    return value_i();
-}
-
-
-Scalar::operator bool() const
-{
-    if (!len())
-       return false;
-    if (*this == "0")
-       return false;
-    String u (*this);
-    if ( u.upper_str() == "FALSE")
-       return false;
-    return true;
-}
diff --git a/flower/lib/smat.cc b/flower/lib/smat.cc
deleted file mode 100644 (file)
index dcc61ce..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-#include "smat.hh"
-
-void
-Full_storage::operator=(Full_storage const &fs)
-{
-    resize(fs.h, fs.w);
-    OK();
-    fs.OK();
-    for (int i=0; i<h; i++)
-       for (int j=0; j<w; j++)
-           els[i][j]= fs.els[i][j];
-}
-
-void
-Full_storage::OK() const
-{
-#ifndef NDEBUG
-    //    static Real dummy;           
-    assert(maxh >= h && maxw >= w);
-    assert(h >= 0 && w >= 0);
-    assert(els||!maxh);
-#endif
-}
-void
-Full_storage::resize_cols(int newh)
-{
-    if (newh <= maxh) {
-       h=newh;
-       return;
-    }
-   
-    Real ** newa=new Real*[newh];
-    int j=0;
-    for (; j < h; j++)
-       newa[j] = els[j];
-    for (; j < newh; j++)
-       newa[j] = new Real[maxw];
-    delete[] els;
-    els=newa;
-
-    h = maxh = newh;
-}
-
-void
-Full_storage::resize_rows(int neww)
-{
-    if (neww <= maxw) {
-       w=neww;
-       return;
-    }
-    for (int i=0; i < maxh ; i++) {
-       Real* newa = new Real[neww];
-       for (int k=0; k < w; k++)
-           newa[k] = els[i][k];
-
-       delete[] els[i];
-       els[i] = newa;
-    }
-    w = maxw = neww;   
-}
-
-Full_storage::~Full_storage() {
-    for (int i=0; i < maxh; i++)
-       delete [] els[i];
-    delete[] els;
-}
-
-void
-Full_storage::resize(int rows, int cols)
-{
-    OK();
-    resize_cols(rows);
-    resize_rows(cols);
-
-}
-
-
-bool
-Full_storage::mult_ok(int i, int j) const
-{
-    return valid(i,j);
-}
-
-bool
-Full_storage::trans_ok(int i, int j) const
-{
-       return valid(i,j);
-} 
-
-
-void
-Full_storage::trans_next(int &i, int &j) const
-{
-    assert(trans_ok(i,j));
-    i++;
-    if (i >= h) {
-       i=0;
-       j ++;
-    }
-}
-
-void
-Full_storage::mult_next(int &i, int &j) const
-{
-    assert(mult_ok(i,j));
-    j++;
-    if (j >= w) {
-       j=0;
-       i++;
-    }
-}
-
-void
-Full_storage::delete_column(int k)
-{
-    assert(0 <= k &&k<w);    
-    for (int i=0; i< h ; i++)
-       for (int j=k+1; j <w; j++)
-           els[i][j-1]=els[i][j];
-    w--;
-}
-void
-Full_storage::delete_row(int k)
-{
-    assert(0 <= k &&k<h);
-    for (int i=k+1; i < h ; i++)
-       for (int j=0; j < w; j++)
-           els[i-1][j]=els[i][j];
-    h--;
-}
-
-
-void
-Full_storage::insert_row(int k)
-{
-    assert(0 <= k&& k <=h);
-    resize_cols(h+1);
-    for (int i=h-1; i > k ; i--)
-       for (int j=0; j <w; j++)
-           els[i][j]=els[i-1][j];
-
-}
-
-
-Array<Real>
-Full_storage::row(int n) const
-{
-    Array<Real> r;
-    for (int j = 0; j < w; j++)
-       r.push(els[n][j]);
-    return r;
-}
-
-Array<Real>
-Full_storage::column(int n) const
-{
-    
-    Array<Real> r;
-    for (int i = 0; i<h; i++)
-       r.push(els[i][n]);
-    return r;
-}
-
-
-Full_storage::Full_storage(Full_storage&s)
-{
-    init();
-    (*this) = s;
-}
-virtual_smat*
-Full_storage::clone()
-{
-    return new Full_storage(*this);
-}
-
-
-virtual_smat *
-virtual_smat::get_full(int n, int m)
-{
-    return new Full_storage(n,m);
-}
diff --git a/flower/lib/string-convert.cc b/flower/lib/string-convert.cc
deleted file mode 100644 (file)
index 0e2566f..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
-  PROJECT: FlowerSoft C++ library
-  FILE   : string-convert.cc
-
---*/
-
-
-#include <assert.h>
-#include <limits.h>
-#include "libc-extension.hh"
-#include "string.hh"
-#include "string-convert.hh"
-
-/**
-   a safe length for stringconversion buffers
-
-   worst case would be %f printing HUGE (or 1/HUGE), which is approx
-   2e318, this number would have approx 318 zero's in its string.
-
-   Should enlarge buff dynamically.
-   @see
-   man 3 snprintf
-   */
-static const int STRING_BUFFER_LEN=1024;
-
-String
-String_convert::bin2hex_str( String bin_str )
-{
-    String str;
-    Byte const* byte_c_l = bin_str.byte_c_l();
-    for ( int i = 0; i < bin_str.length_i(); i++ ) {
-       str += (char)nibble2hex_byte( *byte_c_l >> 4 );
-       str += (char)nibble2hex_byte( *byte_c_l++ );
-    }
-    return str;
-}
-
-int
-String_convert::bin2_i( String bin_str )
-{
-    assert( bin_str.length_i() <= 4 );
-
-    int result_i = 0;
-    for ( int i = 0; i < bin_str.length_i(); i++ ) {
-       result_i <<= 8;
-       result_i += (Byte)bin_str[ i ];
-    }
-    return result_i;
-}
-
-// breendet imp from String
-int
-String_convert::dec2_i( String dec_str )
-{
-    if ( !dec_str.length_i() )
-       return 0;
-
-    long l = 0;
-    int conv = sscanf( dec_str.ch_c_l(), "%ld", &l );
-    assert( conv );
-
-    return (int)l;
-}
-
-String
-String_convert::i64_str( I64 i64, char const* fmt)
-{
-    char buffer[STRING_BUFFER_LEN];
-    snprintf(buffer, STRING_BUFFER_LEN,
-            (fmt ? fmt : "%Ld"), i64 );     // assume radix 10
-    return String(buffer);
-
-}
-// breendet imp from String
-double
-String_convert::dec2_f( String dec_str )
-{
-    if ( !dec_str.length_i() )
-       return 0;
-    double d = 0;
-    int conv = sscanf( dec_str.ch_c_l(), "%lf", &d );
-    assert( conv );
-    return d;
-}
-
-int
-String_convert::hex2bin_i( String hex_str, String& bin_str_r )
-{
-    if ( hex_str.length_i() % 2 )
-        hex_str = "0" + hex_str;
-
-    bin_str_r = "";
-    Byte const* byte_c_l= hex_str.byte_c_l();
-    int i = 0;
-    while ( i < hex_str.length_i() ) {   
-        int high_i = hex2nibble_i( *byte_c_l++ );
-        int low_i = hex2nibble_i( *byte_c_l++ );
-        if ( high_i < 0 || low_i < 0 )
-            return 1; // illegal char
-        bin_str_r += String( (char)( high_i << 4 | low_i ), 1 );
-        i += 2;
-    }
-    return 0;
-}
-
-String 
-String_convert::hex2bin_str( String hex_str )
-{
-    String str;
-//  silly, asserts should alway be "on"!
-//    assert( !hex2bin_i( hex_str, str ) );
-    int error_i = hex2bin_i( hex_str, str );
-    assert( !error_i );
-    return str;
-}
-
-int 
-String_convert::hex2nibble_i( Byte byte )
-{
-    if ( byte >= '0' && byte <= '9' )
-        return byte - '0';
-    if ( byte >= 'A' && byte <= 'F' )
-        return byte - 'A' + 10;
-    if ( byte >= 'a' && byte <= 'f')
-        return byte - 'a' + 10;
-    return -1;
-}
-
-// stupido.  Should use int_str()
-String 
-String_convert::i2dec_str( int i, int length_i, char ch )
-{
-    char fill_ch = ch;
-    if ( fill_ch)
-        fill_ch = '0';
-
-    // ugh
-    String dec_str( i );
-    
-    // ugh
-    return String( fill_ch, length_i - dec_str.length_i() ) + dec_str;
-}
-
-
-// stupido.  Should use int_str()
-String 
-String_convert::u2hex_str( unsigned u, int length_i, char fill_ch )
-{
-    String str;
-    if ( !u )
-       str = "0";
-
-#if 1 // both go...
-    while ( u ) {
-       str = String( (char)( ( u % 16 )["0123456789abcdef"] ) ) + str;
-       u /= 16;
-    }
-#else
-    str += int_str( u, "%x" );
-#endif
-
-    str = String( fill_ch, length_i - str.length_i() ) + str;
-    while ( ( str.length_i() > length_i ) &&  ( str[ 0 ] == 'f' ) )
-       str = str.mid_str( 2, INT_MAX );
-
-    return str;
-}
-
-String 
-String_convert::i2hex_str( int i, int length_i, char fill_ch )
-{
-    return u2hex_str( (unsigned)i, length_i, fill_ch );
-}
-
-Byte
-String_convert::nibble2hex_byte( Byte byte )
-{
-    if ( ( byte & 0x0f ) <= 9 )
-       return ( byte & 0x0f ) + '0';
-    else
-       return ( byte & 0x0f ) - 10 + 'a';
-}
-/**
-  Convert an integer to a string
-
-  @param
-  #fmt# is a printf style format, default assumes "%d" as format. 
-  */
-String
-String_convert::int_str(int i, char const* fmt)
-{
-    char buffer[STRING_BUFFER_LEN];
-    snprintf(buffer, STRING_BUFFER_LEN,
-            (fmt ? fmt : "%d"), i );     // assume radix 10
-    return String(buffer);
-}
-
-/**
-  Convert a double to a string.
-
-  @param #fmt# is a printf style format, default assumes "%lf" as format
- */
-String
-String_convert::double_str(double f, char const* fmt)
-{
-    char buf[STRING_BUFFER_LEN]; 
-
-    snprintf(buf, STRING_BUFFER_LEN, fmt ? fmt : "%f", f);
-    return buf;
-}
-
-/**
-  Make a string from a single character.
-
-  @param
-    #n# is a repetition count, default value is 1
- */
-String
-String_convert::char_str(char c, int n)
-{
-    n = n >= 0 ? n : 0;
-    char* ch_p = new char[ n ];
-    memset( ch_p, c, n );
-    String s((Byte*)ch_p, n);
-    delete ch_p;
-    return s;
-}
-
-String
-String_convert::rational_str(Rational r)
-{
-    char * n = Itoa(r.numerator()); // LEAK????
-    
-    String s = n;
-    if (r.denominator() != 1) {
-       char * d = Itoa(r.denominator());
-       s +=  String( '/' ) + String(d);
-       //delete d;
-    }
-/*    delete n;
-    */
-    return s;
-}
-
-String
-String_convert::pointer_str(const void *l)
-{
-    I64 i64 = (I64)l;
-    return String_convert::i64_str(i64,  "0x%0Lx");
-}
diff --git a/flower/lib/stringtest.cc b/flower/lib/stringtest.cc
deleted file mode 100644 (file)
index 0bbde77..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifdef STRING_TEST
-/*
-  stupid test program to verify stringlib
-  stringtest.cc
-  */
-#include <iostream.h>
-#include "string.hh"
-#include "varray.hh"
-#include "string-convert.hh"
-
-void
-ctors()
-{
-    cout << "constructors"<<endl;
-
-    String str( "hai" );
-    String def;
-    String fromi(10);
-    String fromc('c');
-    String fromf(1.32e-2, "%g");
-
-    cout << str << endl;
-    cout << def << endl;
-    cout << fromi<< endl;
-    cout << fromc<< endl;       
-    cout << fromf<< endl;
-}
-
-void
-cmp()
-{
-    Array<String> a;
-    a.push("abcd");
-    a.push("zxy");
-    a.push("abc");
-    a.push("");
-    a.sort(String::compare_i);
-    cout << "compares: "<<endl;
-    for (int i=0; i < a.size(); i++)
-       cout << a[i] << endl;
-}
-
-
-void
-searching()
-{
-    String hay = "foobarbazblub";
-
-    char c =   'b';
-    String cstr =c;
-    String set = "bar";
-    cout << "hay = \"" << hay << "\" len="<< hay.length_i()<<endl;
-    cout << "index_i('"<< c<<"') " << c << "= " << hay.index_i(c) <<endl;
-    cout << "last_index_i('"<< c<<"') " << c << "= " << hay.index_last_i(c) <<endl;    
-//    cout << "last index of cstr " << c << ": " << hay.index_last_i(cstr) <<endl;    
-//    cout << "index_last_i(\""<<set<<"\"): " << hay.index_last_i(set) <<endl;
-    cout << "index_i(\""<<set<<"\"): " << hay.index_i(set) <<endl;    
-    cout << "index_any(\"" << set << "\"): " << cstr << ": " << hay.index_any_i(cstr) <<endl;
-
-    
-    
-}
-
-
-void
-kutenpeer()
-{
-    String str( "hai" );
-    for (int i=-1; i < str.length_i()+2; i++) {
-       cout<<" left_str(" << i<<"): " << str.left_str( i ) << endl;
-       cout<<" right_str( "<<i<<"): " << str.right_str( i ) << endl;
-    }
-    str = "blonde haren";
-    cout << str<<endl;
-    cout << "mid(2,6)="<<str.mid_str(2,3)<<endl;
-    cout << "nomid(2,6)="<<str.nomid_str(2,3)<<endl;
-}
-
-int 
-main()
-{
-    ctors();
-    cmp();
-    searching();
-    kutenpeer();
-    String str( "hai" );
-    cout <<  str << endl;
-    cout << "left" << endl;
-    str += " daar";
-    cout << str << endl;
-
-    str = String( "Hallo" ) + " daaR" + '!';
-    cout << str << endl;
-
-    cout << "up: " << str.upper_str() << " down: " << str.lower_str()<<endl;
-    
-    if ( str == String( "" ) )
-        cout << str << " is empty" << endl;
-    else
-       cout << str << " is not empty"<<endl;
-
-    
-    String fn = "";
-    if ( fn == "" )
-        cout << fn << " is empty" << endl;
-    else
-       assert(false);
-    
-    fn = "";
-    fn += "";
-    delete fn.copy_byte_p();
-    delete str.copy_byte_p();
-
-    cout << String_convert::bin2hex_str( String( (char)0xff ) ) << endl;
-}
-
-#endif STRING_TEST
-
diff --git a/flower/lib/stringutil.cc b/flower/lib/stringutil.cc
deleted file mode 100644 (file)
index 43c8e15..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  stringutil.cc -- generate non-inline members. 
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#ifdef STRING_DEBUG 
-#include <sys/types.h>
-#include <memory.h>
-void* 
-mymemmove( void* dest, void const* src, size_t n )
-{
-       return memcpy( dest, src, n ); // wohltempererit: 69006
-}
-#define memmove mymemmove
-#endif
-
-#ifdef STRING_UTILS_INLINED
-#undef STRING_UTILS_INLINED
-#endif
-
-#ifdef INLINE
-#undef INLINE
-#endif
-
-#define INLINE
-
-#include "string-handle.hh"
-#include "string-data.hh"
-#include "string-data.inl"
-#include "string-handle.inl"
diff --git a/flower/lib/text-db.cc b/flower/lib/text-db.cc
deleted file mode 100644 (file)
index ebfc992..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#include "text-db.hh"
-bool
-Text_db::eof()
-{
-    Data_file::gobble_leading_white();
-    return  Data_file::eof();
-}
-
-void
-Text_db::gobble_leading_white()
-{
-    while (1) {
-       Data_file::gobble_leading_white();
-       if (eof())
-           return ;
-       char c;
-       if  ((c = data_get()) !='\n'){
-           data_unget (c);
-           return ;
-       }       
-    }  
-}
-
-
-Text_record
-Text_db::get_record() 
-{
-   while (1) {
-       String s;
-       Array<String> fields;
-       assert(!eof());
-       
-       while ((s = get_word()) != "")
-           {
-           fields.push(s);     
-           gobble_white();
-           }
-            
-
-       if (get_line() != "")
-           assert(false);
-      
-       assert (fields.size());
-       return Text_record(fields, get_name(), line());
-   }
-}
-
-
diff --git a/flower/lib/text-stream.cc b/flower/lib/text-stream.cc
deleted file mode 100644 (file)
index a2d3e4b..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "text-stream.hh"
-
-Text_stream::Text_stream(String fn)
-{
-    ios::sync_with_stdio();
-    if (fn == "") 
-           {
-           name = "<STDIN>";       
-           f = stdin;
-           }
-       
-       else 
-           {
-           name = fn;      
-           f = fopen(fn, "r");
-           }
-       
-       if (!f) {
-           cerr <<__FUNCTION__<< ": can't open `" << fn << "'\n";
-           exit(1);
-       }
-
-       line_no = 1;
-    }
-
-void
-Text_stream::message(String s)
-{
-    cerr << "\n"<<get_name() << ": " << line()<<": "<<s<<endl;
-}
-
diff --git a/flower/lib/unionfind.cc b/flower/lib/unionfind.cc
deleted file mode 100644 (file)
index e7b0831..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "unionfind.hh"
-/*
-    see a book on data structures
-    */
-
-Union_find::Union_find(int n)
-{
-    classes.set_size(n);
-
-    for (int i=0; i < n; i++) {
-       classes[i] = i;
-    }
-}
-
-int
-Union_find::find(int i)
-{
-    int rep = i;
-    while (classes[rep] != rep)
-       rep = classes[rep];
-    while (classes[i] != rep) {
-       int next =classes[i];
-       classes[i] = rep;
-       i = next;
-    }
-    return rep;
-}
-
-void
-Union_find::connect(int i, int j)
-{
-    i = find(i);
-    j = find(j);
-    classes[i] = j;    
-}
diff --git a/flower/lib/vector.cc b/flower/lib/vector.cc
deleted file mode 100644 (file)
index 5cc76bf..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "vector.hh"
-Vector::Vector(Array<Real> d)
-       : dat(d)
-{
-}
-Vector::Vector(const Vector&n)
-    : dat(n.dat)
-{
-}    
-
-Vector
-Vector::operator-() const
-{
-    Vector v(*this);
-    v*=-1;
-    return v;
-}
-
-void
-Vector::set_unit(int j)
-{
-    fill(0.0);
-    dat[j] = 1.0;
-}
diff --git a/flower/libc-extension.cc b/flower/libc-extension.cc
new file mode 100644 (file)
index 0000000..6e9a9b7
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+  libc-extension.cc --  compensate for lacking libc functions.
+
+
+  source file of the flowerlib
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+#include "libc-extension.hh"
+
+
+char* 
+strnlwr( char* start_l ,int n)
+{
+    char * p = start_l + n;
+    while ( --p >= start_l) {
+       *p = tolower( *p );    /* a macro on some compilers */
+    }
+    return start_l;
+}
+
+char* 
+strnupr( char* start_l, int n)
+{
+    char * p = start_l + n;
+    while ( --p >= start_l) {
+       *p = toupper( *p );    /* a macro on some compilers */
+    }
+    return start_l;
+}
+
+#if !HAVE_MEMMEM
+
+/** locate a substring. #memmem# finds the first occurrence of
+  #needle# in #haystack#
+  */
+
+char *
+memmem(Byte const * haystack, int haystack_len,
+       Byte const *needle,int needle_len)
+{
+    Byte const * end_haystack = haystack + haystack_len - needle_len;
+    Byte const * end_needle = needle + needle_len ;
+
+    /* Ahhh ... Some minimal lowlevel stuff. This *is* nice; Varation
+      is the spice of life */
+    while (haystack < end_haystack) {
+       Byte const *subneedle_l = needle;
+       Byte const *subhaystack_l = haystack;
+       while (subneedle_l < end_needle) {
+           if (*subneedle_l++ != *subhaystack_l++)
+               goto next;      // yeah. I should be prosecuted.
+       }
+       
+       // completed the needle. Gotcha.
+       return (char*) haystack;
+    next:
+       haystack++;
+    }
+    return 0;
+}
+#endif
+
+Byte *
+memrchr(Byte const * p, int n, char c)
+{
+    const    Byte * q = p+n;
+    while (q > p) {
+       if (*--q == c)
+           return (Byte*)q;
+    }
+    return 0;
+}
+
+
+template<class T>
+inline void
+my_swap(T &t1, T &t2, T &tmp)
+{
+    tmp = t1;
+    t1 = t2;
+    t2 = tmp;
+}
+
+Byte*
+strrev( Byte* byte_l, int length_i )
+{
+  Byte tmp_byte;
+  
+  Byte* left_l = byte_l;
+  Byte* right_l = byte_l + length_i;
+
+  while ( right_l > left_l ) {
+      my_swap(*right_l-- , *left_l++ , tmp_byte);
+  }
+  return byte_l;
+}
+
+#if ! HAVE_SNPRINTF
+int snprintf ( char *str, size_t,
+              char const *format, ... )
+{
+    va_list ap;
+    va_start(ap, format);
+    int i = vsprintf(str, format, ap);
+    va_end(ap);
+    return i;
+}
+#endif
diff --git a/flower/matdebug.cc b/flower/matdebug.cc
new file mode 100644 (file)
index 0000000..bcc2843
--- /dev/null
@@ -0,0 +1,63 @@
+#include "dstream.hh"
+#include "matrix.hh"
+
+static Dstream *dout = 0;
+
+/**
+  Set the debugging output. Will not delete/swallow argument.
+ */
+void set_matrix_debug(Dstream&ds)
+{
+    dout = &ds;
+}
+
+Matrix::operator String() const
+{
+    String s;
+#ifndef NPRINT
+    s="matrix {\n";
+    for (int i=0; i< rows(); i++){
+       for (int j = 0; j < cols(); j++) {
+           s+= String(dat->elem(i,j), "%6f ");
+       }
+       s+="\n";
+    }
+    s+="}\n";
+#endif
+    return s;
+}
+
+
+void
+Matrix::print() const
+{
+#ifndef NPRINT
+    if (!dout)
+       return;
+    *dout << *this;
+#endif
+}
+
+Vector::operator String() const
+{
+    String s;
+#ifndef NPRINT
+    s="vector [";
+    for (int i=0; i < dim(); i++) {
+       s += String(dat[i], "%6f") + String(' ');
+    }
+    s+="]";
+#endif
+    return s;
+}
+
+
+void
+Vector::print() const
+{
+#ifndef NDEBUG
+    if (!dout)
+       return;
+    *dout << *this<<'\n';
+#endif
+}
diff --git a/flower/matrix.cc b/flower/matrix.cc
new file mode 100644 (file)
index 0000000..9d229c0
--- /dev/null
@@ -0,0 +1,240 @@
+#include "matrix.hh"
+
+Real
+Matrix::norm() const
+{
+    Real r =0.0;
+    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
+       r += sqr(dat->elem(i,j));
+    return sqrt(r);
+}
+
+void
+Matrix::fill(Real r)
+{
+    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
+       dat->elem(i,j)=r;
+}
+
+void
+Matrix::set_diag(Real r)
+{
+    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))   
+       dat->elem(i,j)=(i==j) ? r: 0.0;
+}
+
+void
+Matrix::set_diag(Vector d)
+{
+    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))   
+       dat->elem(i,j)=(i==j) ? d(i): 0.0;
+}
+
+void
+Matrix::operator+=(Matrix const &m)
+{
+    assert(m.cols() == cols());
+    assert(m.rows() == rows());
+    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
+       dat->elem(i,j) += m(i,j);
+}
+void
+Matrix::operator-=(Matrix const &m)
+{
+    assert(m.cols() == cols());
+    assert(m.rows() == rows());
+    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
+       dat->elem(i,j) -= m(i,j);
+}
+
+
+void
+Matrix::operator*=(Real a)
+{
+    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
+       dat->elem(i,j) *= a;
+}
+
+void
+Matrix::operator=(Matrix const &m)
+{
+    if (&m == this)
+       return ;
+    delete dat;
+    dat = m.dat->clone();
+}
+    
+Matrix::Matrix(Matrix const &m)
+{
+    m.OK();
+    
+    dat = m.dat->clone();
+}
+
+
+Matrix::Matrix(int n, int m)
+{
+    dat = virtual_smat::get_full(n,m);
+    fill(0);
+}
+
+Matrix::Matrix(int n)
+{
+    dat = virtual_smat::get_full(n,n);
+    fill(0);
+}
+
+Matrix::Matrix(Vector v, Vector w)
+{   
+    dat = virtual_smat::get_full(v.dim(), w.dim());
+    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
+       dat->elem(i,j)=v(i)*w(j);
+}
+
+
+Vector
+Matrix::row(int k) const
+{
+    int n=cols();
+
+    
+    Vector v(n);
+    for(int i=0; i < n; i++)
+       v(i)=dat->elem(k,i);
+
+    return v;
+}
+
+Vector
+Matrix::col(int k) const
+{
+    int n=rows();
+    Vector v(n);
+    for(int i=0; i < n; i++)
+       v(i)=dat->elem(i,k);
+    return v;
+}
+
+Vector
+Matrix::left_multiply(Vector const & v) const
+{
+     Vector dest(v.dim());
+    assert(dat->cols()==v.dim());
+    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
+       dest(i)+= dat->elem(j,i)*v(j);
+    return dest;
+}
+
+Vector
+Matrix::operator *(Vector const & v) const
+{
+    Vector dest(rows());
+    assert(dat->cols()==v.dim());
+    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
+       dest(i)+= dat->elem(i,j)*v(j);
+    return dest;
+}
+
+Matrix
+operator /(Matrix const& m1,Real a)
+{
+    Matrix m(m1);
+    m /= a;
+    return  m;
+}
+
+void
+Matrix::transpose()            // delegate to storage?
+{
+    for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j)) {
+       if (i >= j)
+           continue;
+       Real r=dat->elem(i,j);
+       dat->elem(i,j) = dat->elem(j,i);
+       dat->elem(j,i)=r;
+    }
+}
+
+Matrix
+Matrix::operator-() const
+{
+    OK();
+    Matrix m(*this);
+    m*=-1.0;    
+    return m;
+}
+
+Matrix
+Matrix::transposed() const
+{
+    Matrix m(*this);
+    m.transpose();
+    return m;
+}
+
+
+/* should do something smarter: bandmatrix * bandmatrix is also banded matrix.  */
+Matrix
+operator *(Matrix const &m1, Matrix const &m2)
+{
+    Matrix result(m1.rows(), m2.cols());
+    result.set_product(m1,m2);
+    return result;
+}
+
+void
+Matrix::set_product(Matrix const &m1, Matrix const &m2)
+{
+    assert(m1.cols()==m2.rows());
+    assert(cols()==m2.cols() && rows()==m1.rows());
+    
+    for (int i=0, j=0; dat->mult_ok(i,j);
+        dat->mult_next(i,j)) {
+       Real r=0.0;
+       for (int k = 0; k < m1.cols(); k++)
+           r += m1(i,k)*m2(k,j);
+       dat->elem(i,j)=r;
+    }
+}
+
+void
+Matrix::insert_row(Vector v, int k)
+{
+    assert(v.dim()==cols());
+    dat->insert_row(k);
+    for (int j=0; j < cols(); j++)
+       dat->elem(k,j)=v(j);
+}
+
+
+void
+Matrix::swap_columns(int c1, int c2)
+{
+    assert(c1>=0&& c1 < cols()&&c2 < cols() && c2 >=0);
+    for (int i=0; i< rows(); i++) {
+       Real r=dat->elem(i,c1);
+       dat->elem(i,c1) = dat->elem(i,c2);
+       dat->elem(i,c2)=r;
+    }
+}
+
+void
+Matrix::swap_rows(int c1, int c2)
+{
+    assert(c1>=0&& c1 < rows()&&c2 < rows() && c2 >=0);
+    for (int i=0; i< cols(); i++) {
+       Real r=dat->elem(c1,i);
+       dat->elem(c1,i) = dat->elem(c2,i);
+       dat->elem(c2,i)=r;
+    }
+}
+
+
+int
+Matrix::dim() const
+{
+    assert(cols() == rows());
+    return rows();
+}
+
diff --git a/flower/path.cc b/flower/path.cc
new file mode 100644 (file)
index 0000000..c79962f
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+   path.cc - manipulation of paths and filenames.
+*/
+#include <stdio.h>
+#include "path.hh"
+
+#ifndef PATHSEP
+#define PATHSEP '/'
+#endif
+
+/**
+   @param path the original full filename
+   @return 4 components of the path. They can be empty
+*/
+void
+split_path(String path, 
+          String &drive, String &dirs, String &filebase, String &extension)
+{
+    // peel off components, one by one.
+    int di = path.index_i(':');
+    if (di >= 0) 
+       {
+       drive = path.left_str(di + 1);
+       path = path.right_str(path.len() - di -1);
+       } 
+    else
+       drive = "";
+    
+    di = path.index_last_i(PATHSEP);
+    if (di >=0) 
+       {
+       dirs = path.left_str(di + 1);
+       path = path.right_str(path.len()-di -1);
+       }
+    else
+       dirs = "";
+    
+    di = path.index_last_i('.');
+    if (di >= 0) 
+       {
+       filebase = path.left_str(di);
+       extension =path.right_str(path.len()-di);       
+       } 
+    else 
+       {
+       extension = "";   
+       filebase = path;
+       }
+}
+
+File_path::File_path(String pref)
+{
+    add(".");
+    add(pref);
+}
+
+
+/** find a file. 
+  It will search in the current dir, in the construction-arg, and
+  in any other added path, in this order.
+  */
+String
+File_path::find(String nm)
+{
+     for (int i=0; i < size(); i++) {
+        String path  = (*this)[i];
+        path+= "/"+nm;
+
+
+        FILE *f = fopen(path, "r"); // ugh!
+        if (f) {
+            fclose(f);
+            return path;
+        }
+     }
+     return "";
+}
diff --git a/flower/scalar.cc b/flower/scalar.cc
new file mode 100644 (file)
index 0000000..5edd9e9
--- /dev/null
@@ -0,0 +1,57 @@
+#include <assert.h>
+#include <stdio.h>
+#include "scalar.hh"
+
+Scalar::Scalar(Rational r)
+    :String(r)
+{
+
+}
+
+Scalar::operator Rational()
+{
+    int p = index_i('/');
+    if (p == -1)
+       return int(*this);
+    
+    String s2 = right_str(len()-p-1);
+    String s1 = left_str(p);
+
+    return Rational(s1.value_i(), s2.value_i());
+}
+
+bool
+Scalar::isnum()
+{
+    int conv = false;
+    if (len()) {
+       long l =0;
+       conv = sscanf(strh_.ch_c_l(), "%ld", &l);
+    }
+    return len() && conv;
+}
+
+Scalar::operator Real()
+{
+    assert (isnum());
+    return value_f();
+}
+
+Scalar::operator int()
+{
+    assert (isnum());
+    return value_i();
+}
+
+
+Scalar::operator bool() const
+{
+    if (!len())
+       return false;
+    if (*this == "0")
+       return false;
+    String u (*this);
+    if ( u.upper_str() == "FALSE")
+       return false;
+    return true;
+}
diff --git a/flower/smat.cc b/flower/smat.cc
new file mode 100644 (file)
index 0000000..dcc61ce
--- /dev/null
@@ -0,0 +1,181 @@
+#include "smat.hh"
+
+void
+Full_storage::operator=(Full_storage const &fs)
+{
+    resize(fs.h, fs.w);
+    OK();
+    fs.OK();
+    for (int i=0; i<h; i++)
+       for (int j=0; j<w; j++)
+           els[i][j]= fs.els[i][j];
+}
+
+void
+Full_storage::OK() const
+{
+#ifndef NDEBUG
+    //    static Real dummy;           
+    assert(maxh >= h && maxw >= w);
+    assert(h >= 0 && w >= 0);
+    assert(els||!maxh);
+#endif
+}
+void
+Full_storage::resize_cols(int newh)
+{
+    if (newh <= maxh) {
+       h=newh;
+       return;
+    }
+   
+    Real ** newa=new Real*[newh];
+    int j=0;
+    for (; j < h; j++)
+       newa[j] = els[j];
+    for (; j < newh; j++)
+       newa[j] = new Real[maxw];
+    delete[] els;
+    els=newa;
+
+    h = maxh = newh;
+}
+
+void
+Full_storage::resize_rows(int neww)
+{
+    if (neww <= maxw) {
+       w=neww;
+       return;
+    }
+    for (int i=0; i < maxh ; i++) {
+       Real* newa = new Real[neww];
+       for (int k=0; k < w; k++)
+           newa[k] = els[i][k];
+
+       delete[] els[i];
+       els[i] = newa;
+    }
+    w = maxw = neww;   
+}
+
+Full_storage::~Full_storage() {
+    for (int i=0; i < maxh; i++)
+       delete [] els[i];
+    delete[] els;
+}
+
+void
+Full_storage::resize(int rows, int cols)
+{
+    OK();
+    resize_cols(rows);
+    resize_rows(cols);
+
+}
+
+
+bool
+Full_storage::mult_ok(int i, int j) const
+{
+    return valid(i,j);
+}
+
+bool
+Full_storage::trans_ok(int i, int j) const
+{
+       return valid(i,j);
+} 
+
+
+void
+Full_storage::trans_next(int &i, int &j) const
+{
+    assert(trans_ok(i,j));
+    i++;
+    if (i >= h) {
+       i=0;
+       j ++;
+    }
+}
+
+void
+Full_storage::mult_next(int &i, int &j) const
+{
+    assert(mult_ok(i,j));
+    j++;
+    if (j >= w) {
+       j=0;
+       i++;
+    }
+}
+
+void
+Full_storage::delete_column(int k)
+{
+    assert(0 <= k &&k<w);    
+    for (int i=0; i< h ; i++)
+       for (int j=k+1; j <w; j++)
+           els[i][j-1]=els[i][j];
+    w--;
+}
+void
+Full_storage::delete_row(int k)
+{
+    assert(0 <= k &&k<h);
+    for (int i=k+1; i < h ; i++)
+       for (int j=0; j < w; j++)
+           els[i-1][j]=els[i][j];
+    h--;
+}
+
+
+void
+Full_storage::insert_row(int k)
+{
+    assert(0 <= k&& k <=h);
+    resize_cols(h+1);
+    for (int i=h-1; i > k ; i--)
+       for (int j=0; j <w; j++)
+           els[i][j]=els[i-1][j];
+
+}
+
+
+Array<Real>
+Full_storage::row(int n) const
+{
+    Array<Real> r;
+    for (int j = 0; j < w; j++)
+       r.push(els[n][j]);
+    return r;
+}
+
+Array<Real>
+Full_storage::column(int n) const
+{
+    
+    Array<Real> r;
+    for (int i = 0; i<h; i++)
+       r.push(els[i][n]);
+    return r;
+}
+
+
+Full_storage::Full_storage(Full_storage&s)
+{
+    init();
+    (*this) = s;
+}
+virtual_smat*
+Full_storage::clone()
+{
+    return new Full_storage(*this);
+}
+
+
+virtual_smat *
+virtual_smat::get_full(int n, int m)
+{
+    return new Full_storage(n,m);
+}
diff --git a/flower/string-convert.cc b/flower/string-convert.cc
new file mode 100644 (file)
index 0000000..31e7a33
--- /dev/null
@@ -0,0 +1,250 @@
+/*
+  PROJECT: FlowerSoft C++ library
+  FILE   : string-convert.cc
+
+--*/
+
+
+#include <assert.h>
+#include <limits.h>
+#include "libc-extension.hh"
+#include "string.hh"
+#include "string-convert.hh"
+
+/**
+   a safe length for stringconversion buffers
+
+   worst case would be %f printing HUGE (or 1/HUGE), which is approx
+   2e318, this number would have approx 318 zero's in its string.
+
+   Should enlarge buff dynamically.
+   @see
+   man 3 snprintf
+   */
+static const int STRING_BUFFER_LEN=1024;
+
+String
+String_convert::bin2hex_str( String bin_str )
+{
+    String str;
+    Byte const* byte_c_l = bin_str.byte_c_l();
+    for ( int i = 0; i < bin_str.length_i(); i++ ) {
+       str += (char)nibble2hex_byte( *byte_c_l >> 4 );
+       str += (char)nibble2hex_byte( *byte_c_l++ );
+    }
+    return str;
+}
+
+int
+String_convert::bin2_i( String bin_str )
+{
+    assert( bin_str.length_i() <= 4 );
+
+    int result_i = 0;
+    for ( int i = 0; i < bin_str.length_i(); i++ ) {
+       result_i <<= 8;
+       result_i += (Byte)bin_str[ i ];
+    }
+    return result_i;
+}
+
+// breendet imp from String
+int
+String_convert::dec2_i( String dec_str )
+{
+    if ( !dec_str.length_i() )
+       return 0;
+
+    long l = 0;
+    int conv = sscanf( dec_str.ch_c_l(), "%ld", &l );
+    assert( conv );
+
+    return (int)l;
+}
+
+String
+String_convert::i64_str( I64 i64, char const* fmt)
+{
+    char buffer[STRING_BUFFER_LEN];
+    snprintf(buffer, STRING_BUFFER_LEN,
+            (fmt ? fmt : "%Ld"), i64 );     // assume radix 10
+    return String(buffer);
+
+}
+// breendet imp from String
+double
+String_convert::dec2_f( String dec_str )
+{
+    if ( !dec_str.length_i() )
+       return 0;
+    double d = 0;
+    int conv = sscanf( dec_str.ch_c_l(), "%lf", &d );
+    assert( conv );
+    return d;
+}
+
+int
+String_convert::hex2bin_i( String hex_str, String& bin_str_r )
+{
+    if ( hex_str.length_i() % 2 )
+        hex_str = "0" + hex_str;
+
+    bin_str_r = "";
+    Byte const* byte_c_l= hex_str.byte_c_l();
+    int i = 0;
+    while ( i < hex_str.length_i() ) {   
+        int high_i = hex2nibble_i( *byte_c_l++ );
+        int low_i = hex2nibble_i( *byte_c_l++ );
+        if ( high_i < 0 || low_i < 0 )
+            return 1; // illegal char
+        bin_str_r += String( (char)( high_i << 4 | low_i ), 1 );
+        i += 2;
+    }
+    return 0;
+}
+
+String 
+String_convert::hex2bin_str( String hex_str )
+{
+    String str;
+//  silly, asserts should alway be "on"!
+//    assert( !hex2bin_i( hex_str, str ) );
+    int error_i = hex2bin_i( hex_str, str );
+    assert( !error_i );
+    return str;
+}
+
+int 
+String_convert::hex2nibble_i( Byte byte )
+{
+    if ( byte >= '0' && byte <= '9' )
+        return byte - '0';
+    if ( byte >= 'A' && byte <= 'F' )
+        return byte - 'A' + 10;
+    if ( byte >= 'a' && byte <= 'f')
+        return byte - 'a' + 10;
+    return -1;
+}
+
+// stupido.  Should use int_str()
+String 
+String_convert::i2dec_str( int i, int length_i, char ch )
+{
+    char fill_ch = ch;
+    if ( fill_ch)
+        fill_ch = '0';
+
+    // ugh
+    String dec_str( i );
+    
+    // ugh
+    return String( fill_ch, length_i - dec_str.length_i() ) + dec_str;
+}
+
+
+// stupido.  Should use int_str()
+String 
+String_convert::u2hex_str( unsigned u, int length_i, char fill_ch )
+{
+    String str;
+    if ( !u )
+       str = "0";
+
+#if 1 // both go...
+    while ( u ) {
+       str = String( (char)( ( u % 16 )["0123456789abcdef"] ) ) + str;
+       u /= 16;
+    }
+#else
+    str += int_str( u, "%x" );
+#endif
+
+    str = String( fill_ch, length_i - str.length_i() ) + str;
+    while ( ( str.length_i() > length_i ) &&  ( str[ 0 ] == 'f' ) )
+       str = str.mid_str( 2, INT_MAX );
+
+    return str;
+}
+
+String 
+String_convert::i2hex_str( int i, int length_i, char fill_ch )
+{
+    return u2hex_str( (unsigned)i, length_i, fill_ch );
+}
+
+Byte
+String_convert::nibble2hex_byte( Byte byte )
+{
+    if ( ( byte & 0x0f ) <= 9 )
+       return ( byte & 0x0f ) + '0';
+    else
+       return ( byte & 0x0f ) - 10 + 'a';
+}
+/**
+  Convert an integer to a string
+
+  @param
+  #fmt# is a printf style format, default assumes "%d" as format. 
+  */
+String
+String_convert::int_str(int i, char const* fmt)
+{
+    char buffer[STRING_BUFFER_LEN];
+    snprintf(buffer, STRING_BUFFER_LEN,
+            (fmt ? fmt : "%d"), i );     // assume radix 10
+    return String(buffer);
+}
+
+/**
+  Convert a double to a string.
+
+  @param #fmt# is a printf style format, default assumes "%lf" as format
+ */
+String
+String_convert::double_str(double f, char const* fmt)
+{
+    char buf[STRING_BUFFER_LEN]; 
+
+    snprintf(buf, STRING_BUFFER_LEN, fmt ? fmt : "%f", f);
+    return buf;
+}
+
+/**
+  Make a string from a single character.
+
+  @param
+    #n# is a repetition count, default value is 1
+ */
+String
+String_convert::char_str(char c, int n)
+{
+    n = n >= 0 ? n : 0;
+    char* ch_p = new char[ n ];
+    memset( ch_p, c, n );
+    String s((Byte*)ch_p, n);
+    delete ch_p;
+    return s;
+}
+
+String
+String_convert::rational_str(Rational r)
+{
+    char * n = Itoa(r.numerator()); // LEAK????
+    
+    String s = n;
+    if (r.denominator() != 1) {
+       char * d = Itoa(r.denominator());
+       s +=  String( '/' ) + String(d);
+       //delete d;
+    }
+/*    delete n;
+    */
+    return s;
+}
+
+String
+String_convert::pointer_str(void const *l)
+{
+    I64 i64 = (I64)l;
+    return String_convert::i64_str(i64,  "0x%0Lx");
+}
diff --git a/flower/stringtest.cc b/flower/stringtest.cc
new file mode 100644 (file)
index 0000000..0bbde77
--- /dev/null
@@ -0,0 +1,118 @@
+#ifdef STRING_TEST
+/*
+  stupid test program to verify stringlib
+  stringtest.cc
+  */
+#include <iostream.h>
+#include "string.hh"
+#include "varray.hh"
+#include "string-convert.hh"
+
+void
+ctors()
+{
+    cout << "constructors"<<endl;
+
+    String str( "hai" );
+    String def;
+    String fromi(10);
+    String fromc('c');
+    String fromf(1.32e-2, "%g");
+
+    cout << str << endl;
+    cout << def << endl;
+    cout << fromi<< endl;
+    cout << fromc<< endl;       
+    cout << fromf<< endl;
+}
+
+void
+cmp()
+{
+    Array<String> a;
+    a.push("abcd");
+    a.push("zxy");
+    a.push("abc");
+    a.push("");
+    a.sort(String::compare_i);
+    cout << "compares: "<<endl;
+    for (int i=0; i < a.size(); i++)
+       cout << a[i] << endl;
+}
+
+
+void
+searching()
+{
+    String hay = "foobarbazblub";
+
+    char c =   'b';
+    String cstr =c;
+    String set = "bar";
+    cout << "hay = \"" << hay << "\" len="<< hay.length_i()<<endl;
+    cout << "index_i('"<< c<<"') " << c << "= " << hay.index_i(c) <<endl;
+    cout << "last_index_i('"<< c<<"') " << c << "= " << hay.index_last_i(c) <<endl;    
+//    cout << "last index of cstr " << c << ": " << hay.index_last_i(cstr) <<endl;    
+//    cout << "index_last_i(\""<<set<<"\"): " << hay.index_last_i(set) <<endl;
+    cout << "index_i(\""<<set<<"\"): " << hay.index_i(set) <<endl;    
+    cout << "index_any(\"" << set << "\"): " << cstr << ": " << hay.index_any_i(cstr) <<endl;
+
+    
+    
+}
+
+
+void
+kutenpeer()
+{
+    String str( "hai" );
+    for (int i=-1; i < str.length_i()+2; i++) {
+       cout<<" left_str(" << i<<"): " << str.left_str( i ) << endl;
+       cout<<" right_str( "<<i<<"): " << str.right_str( i ) << endl;
+    }
+    str = "blonde haren";
+    cout << str<<endl;
+    cout << "mid(2,6)="<<str.mid_str(2,3)<<endl;
+    cout << "nomid(2,6)="<<str.nomid_str(2,3)<<endl;
+}
+
+int 
+main()
+{
+    ctors();
+    cmp();
+    searching();
+    kutenpeer();
+    String str( "hai" );
+    cout <<  str << endl;
+    cout << "left" << endl;
+    str += " daar";
+    cout << str << endl;
+
+    str = String( "Hallo" ) + " daaR" + '!';
+    cout << str << endl;
+
+    cout << "up: " << str.upper_str() << " down: " << str.lower_str()<<endl;
+    
+    if ( str == String( "" ) )
+        cout << str << " is empty" << endl;
+    else
+       cout << str << " is not empty"<<endl;
+
+    
+    String fn = "";
+    if ( fn == "" )
+        cout << fn << " is empty" << endl;
+    else
+       assert(false);
+    
+    fn = "";
+    fn += "";
+    delete fn.copy_byte_p();
+    delete str.copy_byte_p();
+
+    cout << String_convert::bin2hex_str( String( (char)0xff ) ) << endl;
+}
+
+#endif STRING_TEST
+
diff --git a/flower/stringutil.cc b/flower/stringutil.cc
new file mode 100644 (file)
index 0000000..43c8e15
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+  stringutil.cc -- generate non-inline members. 
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#ifdef STRING_DEBUG 
+#include <sys/types.h>
+#include <memory.h>
+void* 
+mymemmove( void* dest, void const* src, size_t n )
+{
+       return memcpy( dest, src, n ); // wohltempererit: 69006
+}
+#define memmove mymemmove
+#endif
+
+#ifdef STRING_UTILS_INLINED
+#undef STRING_UTILS_INLINED
+#endif
+
+#ifdef INLINE
+#undef INLINE
+#endif
+
+#define INLINE
+
+#include "string-handle.hh"
+#include "string-data.hh"
+#include "string-data.inl"
+#include "string-handle.inl"
index 14bf4b99165454173723d271b88feb4e110074a1..5b6affe77e53229f51f66438ec7c9f6de7771925 100644 (file)
@@ -19,12 +19,13 @@ NAME =stringtest
 # include ./$(depth)/$(NAME)/.version
 MODULE_NAME = flower
 include ./$(depth)/flower/.version
-build = ./$(depth)/flower/test/$(outdir)/.build
+
 #
 
 # generic variables:
 #
-include ./$(depth)/make/Variables.make 
+include ./$(depth)/make/Variables.make
+include ./$(depth)/make/Files.make 
 #
 
 # descent order into subdirectories:
@@ -40,29 +41,12 @@ VERSION_DEPENDENCY = #
 # module compile settings: (not generally needed!
 #
 EXTRA_CFLAGS = -DSTRING_TEST
-EXTRA_CXXFLAGS =
-EXTRA_LDFLAGS =
-#
-
-# list of c++ header files:
-# 
-# HHFILES = $(shell ls *.hh $(ERROR_LOG))
-#
-
-# list of c++ source files:
-#
-CCFILES = $(shell ls *.cc $(ERROR_LOG))
 #
 
-# list of other source files:
-#
-EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
-#
 
 # list of distribution files:
 #
-DISTFILES = Makefile $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
-#
+EXTRA_DISTFILES = result 
 
 # list of custom libraries:
 #
@@ -82,9 +66,11 @@ MAINTARGET = $(lily_bindir)/$(EXECUTABLE)# huh?
 #default: $(MAINTARGET)
 BUILDSTRINGTEST=$(MAINTARGET)
 EXECSTRINGTEST=$(EXECUTABLE)
+
 default:  $(BUILDSTRINGTEST) do-stringtest
 do-stringtest:
-       $(EXECSTRINGTEST)    # should cmp with a 'standard result'
+       $(EXECSTRINGTEST) > $(outdir)/result    # should cmp with a 'standard result'
+       cmp $(outdir)/result result
 
 dummy:
 
@@ -96,7 +82,7 @@ include ./$(depth)/make/Rules.make
 
 # list of depend files:
 #
-DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+DEPFILES = $(wildcard $(depdir)/*.dep )
 #
 
 # auto dependencies:
diff --git a/flower/test/result b/flower/test/result
new file mode 100644 (file)
index 0000000..1351b5b
--- /dev/null
@@ -0,0 +1,40 @@
+constructors
+hai
+
+10
+c
+0.0132
+compares: 
+
+abc
+abcd
+zxy
+hay = "foobarbazblub" len=13
+index_i('b') b= 3
+last_index_i('b') b= 12
+index_i("bar"): 3
+index_any("bar"): b: 3
+ left_str(-1): 
+ right_str( -1): 
+ left_str(0): 
+ right_str( 0): 
+ left_str(1): h
+ right_str( 1): i
+ left_str(2): ha
+ right_str( 2): ai
+ left_str(3): hai
+ right_str( 3): hai
+ left_str(4): hai
+ right_str( 4): hai
+blonde haren
+mid(2,6)=onde h
+nomid(2,6)=blaren
+hai
+left
+hai daar
+Hallo daaR!
+up: HALLO DAAR! down: hallo daar!
+`Hallo daaR!' is not empty
+`' is empty
+ff
+-1:ff
diff --git a/flower/text-db.cc b/flower/text-db.cc
new file mode 100644 (file)
index 0000000..ebfc992
--- /dev/null
@@ -0,0 +1,48 @@
+#include "text-db.hh"
+bool
+Text_db::eof()
+{
+    Data_file::gobble_leading_white();
+    return  Data_file::eof();
+}
+
+void
+Text_db::gobble_leading_white()
+{
+    while (1) {
+       Data_file::gobble_leading_white();
+       if (eof())
+           return ;
+       char c;
+       if  ((c = data_get()) !='\n'){
+           data_unget (c);
+           return ;
+       }       
+    }  
+}
+
+
+Text_record
+Text_db::get_record() 
+{
+   while (1) {
+       String s;
+       Array<String> fields;
+       assert(!eof());
+       
+       while ((s = get_word()) != "")
+           {
+           fields.push(s);     
+           gobble_white();
+           }
+            
+
+       if (get_line() != "")
+           assert(false);
+      
+       assert (fields.size());
+       return Text_record(fields, get_name(), line());
+   }
+}
+
+
diff --git a/flower/text-stream.cc b/flower/text-stream.cc
new file mode 100644 (file)
index 0000000..a2d3e4b
--- /dev/null
@@ -0,0 +1,31 @@
+#include "text-stream.hh"
+
+Text_stream::Text_stream(String fn)
+{
+    ios::sync_with_stdio();
+    if (fn == "") 
+           {
+           name = "<STDIN>";       
+           f = stdin;
+           }
+       
+       else 
+           {
+           name = fn;      
+           f = fopen(fn, "r");
+           }
+       
+       if (!f) {
+           cerr <<__FUNCTION__<< ": can't open `" << fn << "'\n";
+           exit(1);
+       }
+
+       line_no = 1;
+    }
+
+void
+Text_stream::message(String s)
+{
+    cerr << "\n"<<get_name() << ": " << line()<<": "<<s<<endl;
+}
+
diff --git a/flower/unionfind.cc b/flower/unionfind.cc
new file mode 100644 (file)
index 0000000..e7b0831
--- /dev/null
@@ -0,0 +1,35 @@
+#include "unionfind.hh"
+/*
+    see a book on data structures
+    */
+
+Union_find::Union_find(int n)
+{
+    classes.set_size(n);
+
+    for (int i=0; i < n; i++) {
+       classes[i] = i;
+    }
+}
+
+int
+Union_find::find(int i)
+{
+    int rep = i;
+    while (classes[rep] != rep)
+       rep = classes[rep];
+    while (classes[i] != rep) {
+       int next =classes[i];
+       classes[i] = rep;
+       i = next;
+    }
+    return rep;
+}
+
+void
+Union_find::connect(int i, int j)
+{
+    i = find(i);
+    j = find(j);
+    classes[i] = j;    
+}
diff --git a/flower/vector.cc b/flower/vector.cc
new file mode 100644 (file)
index 0000000..5cb2666
--- /dev/null
@@ -0,0 +1,25 @@
+#include "vector.hh"
+Vector::Vector(Array<Real> d)
+       : dat(d)
+{
+}
+Vector::Vector(Vector const &n)
+    : dat(n.dat)
+{
+}    
+
+Vector
+Vector::operator-() const
+{
+    Vector v(*this);
+    v*=-1;
+    return v;
+}
+
+void
+Vector::set_unit(int j)
+{
+    fill(0.0);
+    dat[j] = 1.0;
+}
index 04fb51197d67f5c71b2c5656e30cfdc028ed7e75..c8fee3cd506866aee7334af8d18ceb858059e6e9 100644 (file)
@@ -1,5 +1,6 @@
 # init/Makefile
 
+
 # subdir level:
 #
 depth = ..
@@ -9,12 +10,12 @@ build = ./$(depth)/lily/$(outdir)/.build
 
 # generic stuff/Makefile
 #
-include ./$(depth)/make/Stuff.make
+include ./$(depth)/make/Include.make
 #
 
 # list of distribution files:
 # 
-INIFILES = $(shell ls *.ini)
+INIFILES = $(wildcard *.ini)
 DISTFILES = Makefile $(INIFILES)
 #
 
index 884dfd0df748581d4b5381dc05442c699e9b8353..a44eaca96ba38431d92821ffb42bda2563001a8e 100644 (file)
@@ -2,41 +2,41 @@
 % common dutch names for notes. "es" means flat, "is" means sharp
 %
 
-ceses  = melodic { 0 0 -2 0 }
-ces    = melodic { 0 0 -1 0 }
-c      = melodic { 0 0 0 0 }
-cis    = melodic { 0 0 1 0 }
-cisis  = melodic { 0 0 2 0 }
-deses  = melodic { 0 1 -2 0 }
-des    = melodic { 0 1 -1 0 }
-d      = melodic { 0 1 0 0 }
-dis    = melodic { 0 1 1 0 }
-disis  = melodic { 0 1 2 0 }
-eses   = melodic { 0 2 -2 0 }
-es     = melodic { 0 2 -1 0 }
-e      = melodic { 0 2 0 0 }
-eis    = melodic { 0 2 1 0 }
-eisis  = melodic { 0 2 2 0 }
-feses  = melodic { 0 3 -2 0 }
-fes    = melodic { 0 3 -1 0 }
-f      = melodic { 0 3 0 0 }
-fis    = melodic { 0 3 1 0 }
-fisis  = melodic { 0 3 2 0 }
-geses  = melodic { 0 4 -2 0 }
-ges    = melodic { 0 4 -1 0 }
-g      = melodic { 0 4 0 0 }
-gis    = melodic { 0 4 1 0 }
-gisis  = melodic { 0 4 2 0 }
-ases   = melodic { 0 5 -2 0 }
-as     = melodic { 0 5 -1 0 }
-a      = melodic { 0 5 0 0 }
-ais    = melodic { 0 5 1 0 }
-aisis  = melodic { 0 5 2 0 }
-beses  = melodic { 0 6 -2 0 }
-bes    = melodic { 0 6 -1 0 }
-b      = melodic { 0 6 0 0 }
-bis    = melodic { 0 6 1 0 }
-bisis  = melodic { 0 6 2 0 }
+ceses  = \melodic { 0 0 -2 }
+ces    = \melodic { 0 0 -1 }
+c      = \melodic { 0 0 0 }
+cis    = \melodic { 0 0 1 }
+cisis  = \melodic { 0 0 2 }
+deses  = \melodic { 0 1 -2 }
+des    = \melodic { 0 1 -1 }
+d      = \melodic { 0 1 0 }
+dis    = \melodic { 0 1 1 }
+disis  = \melodic { 0 1 2 }
+eses   = \melodic { 0 2 -2 }
+es     = \melodic { 0 2 -1 }
+e      = \melodic { 0 2 0 }
+eis    = \melodic { 0 2 1 }
+eisis  = \melodic { 0 2 2 }
+feses  = \melodic { 0 3 -2 }
+fes    = \melodic { 0 3 -1 }
+f      = \melodic { 0 3 0 }
+fis    = \melodic { 0 3 1 }
+fisis  = \melodic { 0 3 2 }
+geses  = \melodic { 0 4 -2 }
+ges    = \melodic { 0 4 -1 }
+g      = \melodic { 0 4 0 }
+gis    = \melodic { 0 4 1 }
+gisis  = \melodic { 0 4 2 }
+ases   = \melodic { 0 5 -2 }
+as     = \melodic { 0 5 -1 }
+a      = \melodic { 0 5 0 }
+ais    = \melodic { 0 5 1 }
+aisis  = \melodic { 0 5 2 }
+beses  = \melodic { 0 6 -2 }
+bes    = \melodic { 0 6 -1 }
+b      = \melodic { 0 6 0 }
+bis    = \melodic { 0 6 1 }
+bisis  = \melodic { 0 6 2 }
 
 
 %
@@ -44,40 +44,40 @@ bisis       = melodic { 0 6 2 0 }
 %
 
 
-Ceses  = melodic { -1 0 -2 0 }
-Ces    = melodic { -1 0 -1 0 }
-C      = melodic { -1 0 0 0 }
-Cis    = melodic { -1 0 1 0 }
-Cisis  = melodic { -1 0 2 0 }
-Deses  = melodic { -1 1 -2 0 }
-Des    = melodic { -1 1 -1 0 }
-D      = melodic { -1 1 0 0 }
-Dis    = melodic { -1 1 1 0 }
-Disis  = melodic { -1 1 2 0 }
-Eses   = melodic { -1 2 -2 0 }
-Es     = melodic { -1 2 -1 0 }
-E      = melodic { -1 2 0 0 }
-Eis    = melodic { -1 2 1 0 }
-Eisis  = melodic { -1 2 2 0 }
-Feses  = melodic { -1 3 -2 0 }
-Fes    = melodic { -1 3 -1 0 }
-F      = melodic { -1 3 0 0 }
-Fis    = melodic { -1 3 1 0 }
-Fisis  = melodic { -1 3 2 0 }
-Geses  = melodic { -1 4 -2 0 }
-Ges    = melodic { -1 4 -1 0 }
-G      = melodic { -1 4 0 0 }
-Gis    = melodic { -1 4 1 0 }
-Gisis  = melodic { -1 4 2 0 }
-Ases   = melodic { -1 5 -2 0 }
-As     = melodic { -1 5 -1 0 }
-A      = melodic { -1 5 0 0 }
-Ais    = melodic { -1 5 1 0 }
-Aisis  = melodic { -1 5 2 0 }
-Beses  = melodic { -1 6 -2 0 }
-Bes    = melodic { -1 6 -1 0 }
-B      = melodic { -1 6 0 0 }
-Bis    = melodic { -1 6 1 0 }
-Bisis  = melodic { -1 6 2 0 }
+Ceses  = \melodic { -1 0 -2 }
+Ces    = \melodic { -1 0 -1 }
+C      = \melodic { -1 0 0 }
+Cis    = \melodic { -1 0 1 }
+Cisis  = \melodic { -1 0 2 }
+Deses  = \melodic { -1 1 -2 }
+Des    = \melodic { -1 1 -1 }
+D      = \melodic { -1 1 0 }
+Dis    = \melodic { -1 1 1 }
+Disis  = \melodic { -1 1 2 }
+Eses   = \melodic { -1 2 -2 }
+Es     = \melodic { -1 2 -1 }
+E      = \melodic { -1 2 0 }
+Eis    = \melodic { -1 2 1 }
+Eisis  = \melodic { -1 2 2 }
+Feses  = \melodic { -1 3 -2 }
+Fes    = \melodic { -1 3 -1 }
+F      = \melodic { -1 3 0 }
+Fis    = \melodic { -1 3 1 }
+Fisis  = \melodic { -1 3 2 }
+Geses  = \melodic { -1 4 -2 }
+Ges    = \melodic { -1 4 -1 }
+G      = \melodic { -1 4 0 }
+Gis    = \melodic { -1 4 1 }
+Gisis  = \melodic { -1 4 2 }
+Ases   = \melodic { -1 5 -2 }
+As     = \melodic { -1 5 -1 }
+A      = \melodic { -1 5 0 }
+Ais    = \melodic { -1 5 1 }
+Aisis  = \melodic { -1 5 2 }
+Beses  = \melodic { -1 6 -2 }
+Bes    = \melodic { -1 6 -1 }
+B      = \melodic { -1 6 0 }
+Bis    = \melodic { -1 6 1 }
+Bisis  = \melodic { -1 6 2 }
 
 
index da3725b2edffd39f06fb4e35a0a373cc91a76676..c8d5985f7eb025d9cd78f719660ce7edce6bf58c 100644 (file)
@@ -1,10 +1,10 @@
 
-ppp = dynamic {7 }
-pp = dynamic { 6 }
-p = dynamic { 5 }
-mp = dynamic { 4 }
-mf = dynamic { 3 }
-df = dynamic { 2 } % f is a notename too.
-ff = dynamic { 1 }
-fff = dynamic { 0 }
+ppp = \dynamic {7 }
+pp = \dynamic { 6 }
+p = \dynamic { 5 }
+mp = \dynamic { 4 }
+mf = \dynamic { 3 }
+df = \dynamic { 2 } % f is a notename too.
+ff = \dynamic { 1 }
+fff = \dynamic { 0 }
 
index aeee0b01ac096312f3a4f4a72a123c1d25851195..f800923fdc6db7e3b1e988938552cfa04c7f1668 100644 (file)
@@ -1,16 +1,15 @@
 
-% name = script {
+% name = \script {
 % indexstring same_dir_as_stem above_below_staff symbol_can_beinverted }
 %
 
-accent = script { "sforzato" -1 0 0 }
-marcato = script { "marcato" -1 0 1  }
-staccatissimo = script { "staccatissimo" -1 0 1 }
-portato= script { "portato" -1 0 1 }
-fermata = script { "fermata" 1 0 1 }
-stopped = script { "stopped" 0 1 0 }
-staccato = script { "staccato" -1 0 0 }
-tenuto = script {"tenuto" -1 0 0 }
-portato = script { "portato" -1 0 0  }
-upbow = script { "upbow" 0 1 0 }
-downbow = script { "downbow" 0 1 0 }
+accent = \script { "sforzato" -1 0 0 }
+marcato = \script { "marcato" -1 0 1  }
+staccatissimo = \script { "staccatissimo" -1 0 1 }
+portato= \script { "portato" -1 0 1 }
+fermata = \script { "fermata" 1 0 1 }
+stopped = \script { "stopped" 0 1 0 }
+staccato = \script { "staccato" -1 0 0 }
+tenuto = \script {"tenuto" -1 0 0 }
+upbow = \script { "upbow" 0 1 0 }
+downbow = \script { "downbow" 0 1 0 }
index f120a6a701e97aac4ff3928105ce8c5c811a7e66..fd7333a3ad439e3f7d171eac8de1d5ecb7a9b9d7 100644 (file)
@@ -4,38 +4,38 @@
 % by Mats Bengtsson.
 
 
-cessess        = melodic { 0 0 -2 0 }
-cess   = melodic { 0 0 -1 0 }
-c      = melodic { 0 0 0 0 }
-ciss   = melodic { 0 0 1 0 }
-cississ        = melodic { 0 0 2 0 }
-dessess        = melodic { 0 1 -2 0 }
-dess   = melodic { 0 1 -1 0 }
-d      = melodic { 0 1 0 0 }
-diss   = melodic { 0 1 1 0 }
-dississ        = melodic { 0 1 2 0 }
-essess         = melodic { 0 2 -2 0 }
-ess    = melodic { 0 2 -1 0 }
-e      = melodic { 0 2 0 0 }
-eiss   = melodic { 0 2 1 0 }
-eississ        = melodic { 0 2 2 0 }
-fessess        = melodic { 0 3 -2 0 }
-fess   = melodic { 0 3 -1 0 }
-f      = melodic { 0 3 0 0 }
-fiss   = melodic { 0 3 1 0 }
-fississ        = melodic { 0 3 2 0 }
-gessess        = melodic { 0 4 -2 0 }
-gess   = melodic { 0 4 -1 0 }
-g      = melodic { 0 4 0 0 }
-giss   = melodic { 0 4 1 0 }
-gississ        = melodic { 0 4 2 0 }
-assess         = melodic { 0 5 -2 0 }
-ass    = melodic { 0 5 -1 0 }
-a      = melodic { 0 5 0 0 }
-aiss   = melodic { 0 5 1 0 }
-aississ        = melodic { 0 5 2 0 }
-hessess        = melodic { 0 6 -2 0 }
-b      = melodic { 0 6 -1 0 }
-h      = melodic { 0 6 0 0 }
-hiss   = melodic { 0 6 1 0 }
-hississ        = melodic { 0 6 2 0 }
+cessess        = \melodic { 0 0 -2 }
+cess   = \melodic { 0 0 -1 }
+c      = \melodic { 0 0 0 }
+ciss   = \melodic { 0 0 1 }
+cississ        = \melodic { 0 0 2 }
+dessess        = \melodic { 0 1 -2 }
+dess   = \melodic { 0 1 -1 }
+d      = \melodic { 0 1 0 }
+diss   = \melodic { 0 1 1 }
+dississ        = \melodic { 0 1 2 }
+essess         = \melodic { 0 2 -2 }
+ess    = \melodic { 0 2 -1 }
+e      = \melodic { 0 2 0 }
+eiss   = \melodic { 0 2 1 }
+eississ        = \melodic { 0 2 2 }
+fessess        = \melodic { 0 3 -2 }
+fess   = \melodic { 0 3 -1 }
+f      = \melodic { 0 3 0 }
+fiss   = \melodic { 0 3 1 }
+fississ        = \melodic { 0 3 2 }
+gessess        = \melodic { 0 4 -2 }
+gess   = \melodic { 0 4 -1 }
+g      = \melodic { 0 4 0 }
+giss   = \melodic { 0 4 1 }
+gississ        = \melodic { 0 4 2 }
+assess         = \melodic { 0 5 -2 }
+ass    = \melodic { 0 5 -1 }
+a      = \melodic { 0 5 0 }
+aiss   = \melodic { 0 5 1 }
+aississ        = \melodic { 0 5 2 }
+hessess        = \melodic { 0 6 -2 }
+b      = \melodic { 0 6 -1 }
+h      = \melodic { 0 6 0 }
+hiss   = \melodic { 0 6 1 }
+hississ        = \melodic { 0 6 2 }
index cc0f13d39984ddd6b8abeec044fe20369743cc57..7ed0e0c99ac46d0e46d926dcde21057639091d61 100644 (file)
@@ -1,6 +1,6 @@
 
 include "dynamic.ini"
-include "dutch.ini" # do not include init/ path
+include "dutch.ini" % do not include init/ path
 include "script.ini"
 include "table_sixteen.ini"
 
index 240eae0b8b5de3de0f5ed95d62d7717b004ad3de..dfd036f7410112ec7087b309be00ef91ab85a2de 100644 (file)
@@ -3,36 +3,36 @@
 % It has a lot of hard-wired stringconstants
 %
 
-table_sixteen=
-symboltables {
+tablesixteen= 
+\symboltables {
 
-   texid       "\musixsixteendefs"
+   \texid      "\musixsixteendefs"
 
    % index TeXstring,  xmin xmax ymin ymax
 
-    "scripts" = table {
-           "fermata" "\fermata"                0pt  0pt        0pt 6pt
-           "-fermata" "\ifermata"              0pt  0pt        -6pt 0pt
+    "scripts" = \table {
+           "fermata" "\fermata"                0\pt  0\pt      0\pt 6\pt
+           "-fermata" "\ifermata"              0\pt  0\pt      -6\pt 0\pt
            "portato" "\portato"
            "-portato" "\iportato"
            "tenuto" "\tenuto"  
            "-tenuto" "\itenuto"
-           "sforzato" "\sforzato"              -0.8pt 4.8pt    -1.92pt 1.92pt
-           "marcato" "\marcato"                0pt  4.8pt      0pt 4pt
-           "-marcato" "\imarcato"              0pt  4.8pt      -4pt 0pt
-           "staccato" "\staccato"              0pt  0pt         0pt 5pt
-           "staccatissimo" "\staccatissimo"    0pt 0pt         0pt 7.5pt
-           "-staccatissimo" "\istaccatissimo"  0pt 0pt         -7.5pt 0pt
-           "upbow" "\upbow"                    -1pt 6pt        0pt 5pt
-           "downbow" "\downbow"                0pt 5pt         0pt 7.5pt
+           "sforzato" "\sforzato"              -0.8\pt 4.8\pt  -1.92\pt 1.92\pt
+           "marcato" "\marcato"                0\pt  4.8\pt    0\pt 4\pt
+           "-marcato" "\imarcato"              0\pt  4.8\pt    -4\pt 0\pt
+           "staccato" "\staccato"              0\pt  0\pt       0\pt 5\pt
+           "staccatissimo" "\staccatissimo"    0\pt 0\pt               0\pt 7.5\pt
+           "-staccatissimo" "\istaccatissimo"  0\pt 0\pt       -7.5\pt 0\pt
+           "upbow" "\upbow"                    -1\pt 6\pt      0\pt 5\pt
+           "downbow" "\downbow"                0\pt 5\pt               0\pt 7.5\pt
     }
 
-     "style" = table {
-               "roman" "\settext{%}" 0pt 0pt 0pt 8pt
-               "italic"        "\setitalic{%}" 0pt 0pt 0pt 8pt
-               "dynamic"       "\setdynamic{%}" 0pt 0pt 0pt 8pt
+     "style" = \table {
+               "roman" "\settext{%}" 0\pt 0\pt 0\pt 8\pt
+               "italic"        "\setitalic{%}" 0\pt 0\pt 0\pt 8\pt
+               "dynamic"       "\setdynamic{%}" 0\pt 0\pt 0\pt 8\pt
      }
-     "dynamics" = table {
+     "dynamics" = \table {
 
        "mf" "\dynmf"
        "fff" "\dynfff"
@@ -44,99 +44,99 @@ symboltables {
        "ppp" "\dynppp"
 
        }
-     "align" = table {
+     "align" = \table {
                "-1"    "\leftalign{%}"
                "0"     "\centeralign{%}"
                "1"     "\rightalign{%}"
        }
 
-     "clefs" = table {
-            "violin"   "\violinclef"           0pt     12.8pt  -10pt   18pt
-            "bass"     "\bassclef"             0pt     12.8pt  0pt     16pt
-            "alto"     "\altoclef"             0pt     12.8pt  0pt     16pt
-            "tenor"    "\altoclef"             0pt     12.8pt  0pt     16pt
-            "violin_change"    "\cviolinclef"  0pt     11.2pt  -12pt   12pt
-            "bass_change"      "\cbassclef"    0pt     11.2pt  0pt     16pt
-            "alto_change"      "\caltoclef"    0pt     11.2pt  0pt     16pt
-            "tenor_change"     "\caltoclef"    0pt     11.2pt  0pt     16pt
+     "clefs" = \table {
+            "violin"   "\violinclef"           0\pt    12.8\pt -10\pt  18\pt
+            "bass"     "\bassclef"             0\pt    12.8\pt 0\pt    16\pt
+            "alto"     "\altoclef"             0\pt    12.8\pt 0\pt    16\pt
+            "tenor"    "\altoclef"             0\pt    12.8\pt 0\pt    16\pt
+            "violin_change"    "\cviolinclef"  0\pt    11.2\pt -12\pt  12\pt
+            "bass_change"      "\cbassclef"    0\pt    11.2\pt 0\pt    16\pt
+            "alto_change"      "\caltoclef"    0\pt    11.2\pt 0\pt    16\pt
+            "tenor_change"     "\caltoclef"    0\pt    11.2\pt 0\pt    16\pt
      }
 
-     "balls" = table {
-            "1"        "\wholeball"    0pt     6pt     -2 pt   2pt
-            "2"        "\halfball"     0pt     5pt     -2 pt   2pt
-            "4"        "\quartball"    0pt     5pt     -2 pt   2pt
+     "balls" = \table {
+            "1"        "\wholeball"    0\pt    6\pt    -2 \pt  2\pt
+            "2"        "\halfball"     0\pt    5\pt    -2 \pt  2\pt
+            "4"        "\quartball"    0\pt    5\pt    -2 \pt  2\pt
      }
 
-     "slur" = table {
+     "slur" = \table {
             "whole"    "\slurchar%{%}"
             "half"     "\hslurchar%{%}"
      }
-     "accidentals" = table {
-            "-2"       "\flatflat"     0pt     10.2pt  -2.5pt 7.5pt
-            "-1"       "\flat"         0pt     6pt     -2.5pt 7.5pt
-            "0"        "\natural"      0pt     6pt     -7.5pt 7.5pt
-            "1"        "\sharp"                0pt     6pt     -7.5pt 7.5pt
-            "2"        "\sharpsharp"   0pt     6pt     -2.5pt 7.5pt
+     "accidentals" = \table {
+            "-2"       "\flatflat"     0\pt    10.2\pt -2.5\pt 7.5\pt
+            "-1"       "\flat"         0\pt    6\pt    -2.5\pt 7.5\pt
+            "0"        "\natural"      0\pt    6\pt    -7.5\pt 7.5\pt
+            "1"        "\sharp"                0\pt    6\pt    -7.5\pt 7.5\pt
+            "2"        "\sharpsharp"   0\pt    6\pt    -2.5\pt 7.5\pt
      }
 
-     "streepjes" = table {
-            "toplines" "\toplines{%}"  -3pt    9pt 0pt 0pt
-            "botlines" "\botlines{%}"  -3pt    9pt 0pt 0pt
+     "streepjes" = \table {
+            "toplines" "\toplines{%}"  -3\pt   9\pt 0\pt       0\pt
+            "botlines" "\botlines{%}"  -3\pt   9\pt 0\pt       0\pt
      }
 
-     "bars" = table {
+     "bars" = \table {
        "empty" "\emptybar"
-       "|"     "\maatstreep"           0pt     0.4pt   -8pt    8pt
-       "||"    "\finishbar"            0pt     2pt     -8pt    8pt
-       ":|"    "\repeatbar"            -4pt    0pt     -8pt    8pt
-       "|:"    "\startrepeat"          0pt     4pt     -8pt    8pt
-       ":|:"   "\repeatbarstartrepeat" 0pt     16pt    -8pt    8pt
+       "|"     "\maatstreep"           0\pt    0.4\pt  -8\pt   8\pt
+       "||"    "\finishbar"            0\pt    2\pt    -8\pt   8\pt
+       ":|"    "\repeatbar"            -4\pt   0\pt    -8\pt   8\pt
+       "|:"    "\startrepeat"          0\pt    4\pt    -8\pt   8\pt
+       ":|:"   "\repeatbarstartrepeat" 0\pt    16\pt   -8\pt   8\pt
 
      }
 
-     "rests" = table {
-            "1"        "\wholerest"            -5pt    1pt     -1pt    1pt
-            "2"        "\halfrest"             -5pt    1pt     -1pt    1pt
-            "4"        "\quartrest"            -5pt    2pt     -5pt    5pt
-            "8"        "\eighthrest"           0pt     5pt     0pt     8pt
-            "16"       "\sixteenthrest"                0pt     6pt     0pt     12pt
-            "32"       "\thirtysecondrest"     0pt     6pt     0pt     16pt
+     "rests" = \table {
+            "1"        "\wholerest"            -5\pt   1\pt    -1\pt   1\pt
+            "2"        "\halfrest"             -5\pt   1\pt    -1\pt   1\pt
+            "4"        "\quartrest"            -5\pt   2\pt    -5\pt   5\pt
+            "8"        "\eighthrest"           0\pt    5\pt    0\pt    8\pt
+            "16"       "\sixteenthrest"                0\pt    6\pt    0\pt    12\pt
+            "32"       "\thirtysecondrest"     0\pt    6\pt    0\pt    16\pt
      }
 
-     "meters" = table {
-            "C"        "\fourfourmeter"                0pt     10pt    -5pt    5pt
-            "C2"       "\allabreve"            0pt     10pt    -5pt    5pt
+     "meters" = \table {
+            "C"        "\fourfourmeter"                0\pt    10\pt   -5\pt   5\pt
+            "C2"       "\allabreve"            0\pt    10\pt   -5\pt   5\pt
      }
 
      % dims ignored for this table
-     "param" = table {
-            "meter"    "\generalmeter{%}{%}"   0pt     10pt    -5pt    5pt
+     "param" = \table {
+            "meter"    "\generalmeter{%}{%}"   0\pt    10\pt   -5\pt   5\pt
             "linestaf" "\linestafsym{%}{%}"
             "stem"     "\stem{%}{%}"
             "fill"     "\hbox{}"
-            "crescendo" "\crescendosym{%}"     0pt     0pt     -3pt    3pt
-            "decrescendo" "\decrescendosym{%}" 0pt     0pt     -3pt    3pt
+            "crescendo" "\crescendosym{%}"     0\pt    0\pt    -3\pt   3\pt
+            "decrescendo" "\decrescendosym{%}" 0\pt    0\pt    -3\pt   3\pt
      }
 
-     "dots" = table {
-            "1"        "\lsingledot"           0pt     2pt     -1pt    1pt
-            "2"        "\ldoubledot"           0pt     5pt     -1pt    1pt
-            "3"        "\ltripledot"           0pt     8pt     -1pt    1pt
+     "dots" = \table {
+            "1"        "\lsingledot"           0\pt    2\pt    -1\pt   1\pt
+            "2"        "\ldoubledot"           0\pt    5\pt    -1\pt   1\pt
+            "3"        "\ltripledot"           0\pt    8\pt    -1\pt   1\pt
      }
 
-     "flags" = table {
-            "8"        "\eigthflag"            0pt     4pt     0pt     0pt
-            "16"       "\sixteenthflag"                0pt     4pt     0pt     0pt
-            "32"       "\thirtysecondflag"     0pt     4pt     0pt     0pt
-            "-8"       "\deigthflag"           0pt     4pt     0pt     0pt
-            "-16"      "\dsixteenthflag"               0pt     4pt     0pt     0pt
-            "-32"      "\dthirtysecondflag"    0pt     4pt     0pt     0pt
+     "flags" = \table {
+            "8"        "\eigthflag"            0\pt    4\pt    0\pt    0\pt
+            "16"       "\sixteenthflag"                0\pt    4\pt    0\pt    0\pt
+            "32"       "\thirtysecondflag"     0\pt    4\pt    0\pt    0\pt
+            "-8"       "\deigthflag"           0\pt    4\pt    0\pt    0\pt
+            "-16"      "\dsixteenthflag"               0\pt    4\pt    0\pt    0\pt
+            "-32"      "\dthirtysecondflag"    0\pt    4\pt    0\pt    0\pt
      }
 
-     "beamslopes" = table {
+     "beamslopes" = \table {
             "slope"    "\beamslope{%}{%}"
             "horizontal"       "\rulesym{%}{%}"
      }
 
 }
-default_table = symboltables { table_sixteen }
+defaulttable = \symboltables { tablesixteen }
index 6e2b8836a3aad92ab92768d283b7e2916c15789c..e4a5f780013b4ee58b39f414cf5622bda8bf67c3 100644 (file)
@@ -3,15 +3,15 @@
 % It has a lot of hard-wired stringconstants
 %
 
-table_twenty = symboltables {
+table_twenty = \symboltables {
 
     texid      "\musixtwentydefs"
 
-     "style" = table {
+     "style" = \table {
                "roman" "\settext{%}" 0pt 0pt 0pt 0pt
                "italic"        "\setitalic{%}" 0pt 0pt 0pt 0pt
      }
-     "align" = table {
+     "align" = \table {
                "-1"    "\leftalign{%}" 0pt 0pt 0pt 0pt
                "0"     "\centeralign{%}" 0pt 0pt 0pt 0pt
                "1"     "\rightalign{%}" 0pt 0pt 0pt 0pt
@@ -22,7 +22,7 @@ table_twenty = symboltables {
     % be careful with editing this:
     % the "index" entry is hardwired into lilypond.
 
-    "clefs" = table {
+    "clefs" = \table {
            "violin"    "\violinclef"   0pt     16pt    -12.5pt 22.5pt
            "bass"      "\bassclef"             0pt     16pt    0pt     20pt
            "alto"      "\altoclef"             0pt     16pt    0pt     20pt
@@ -33,17 +33,17 @@ table_twenty = symboltables {
            "tenor_change"      "\caltoclef"    0pt     16pt    0pt     20pt
     }
 
-    "balls" = table {
+    "balls" = \table {
            "1" "\wholeball"    0pt     7.5pt   -2.5pt  2.5pt
            "2" "\halfball"     0pt     6pt     -2.5pt  2.5pt
            "4" "\quartball"    0pt     6pt     -2.5pt  2.5pt
     }
 
-    "slur" = table {
+    "slur" = \table {
            "whole"     "\slurchar%{%}" 0pt     0pt     0pt     0pt
            "half"      "\hslurchar%{%}"        0pt     0pt     0pt     0pt
     }
-    "accidentals" = table {
+    "accidentals" = \table {
            "-2"        "\flatflat"     0pt     10.2pt  -2.5pt 7.5pt
            "-1"        "\flat"         0pt     6pt     -2.5pt 7.5pt
            "0" "\natural"      0pt     6pt     -7.5pt 7.5pt
@@ -51,18 +51,18 @@ table_twenty = symboltables {
            "2" "\sharpsharp"   0pt     6pt     -2.5pt 7.5pt
     }
 
-    "streepjes" = table {
+    "streepjes" = \table {
            "toplines"  "\toplines{%}"  -3pt    9pt 0pt 0pt
            "botlines"  "\botlines{%}"  -3pt    9pt 0pt 0pt
     }
 
-    "bars" = table {
+    "bars" = \table {
            "empty"     "\emptybar"     0pt     0pt     0pt     0pt
            "|" "\maatstreep"   0pt     5pt     -12pt   12pt
            "||"        "\finishbar"    0pt     2pt     -12pt   12pt
     }
 
-    "rests" = table {
+    "rests" = \table {
            "1" "\wholerest"            -5pt    1pt     -1pt    1pt
            "2" "\halfrest"             -5pt    1pt     -1pt    1pt
            "4" "\quartrest"            -5pt    2pt     -5pt    5pt
@@ -71,26 +71,26 @@ table_twenty = symboltables {
            "32"        "\thirtysecondrest"     0pt     6pt     0pt     16pt
     }
 
-    "meters" = table {
+    "meters" = \table {
            "C" "\fourfourmeter"                0pt     10pt    -5pt    5pt
            "C2"        "\allabreve"            0pt     10pt    -5pt    5pt
     }
 
     % dims ignored for this table
-    "param" = table {
+    "param" = \table {
            "meter"     "\generalmeter{%}{%}"   -3pt    10pt    -5pt    5pt
            "linestaf"  "\linestafsym{%}{%}"    
            "stem"      "\stem{%}{%}"           
             "fill"     "\hbox{}"
     }
 
-    "dots" = table {
+    "dots" = \table {
            "1" "\lsingledot"           0pt     8pt     -1pt    1pt
            "2" "\ldoubledot"           0pt     12pt    -1pt    1pt
            "3" "\ltripledot"           0pt     16pt    -1pt    1pt
     }
 
-    "flags" = table {
+    "flags" = \table {
            "8" "\eigthflag"            0pt     5pt     0pt     0pt     
            "16"        "\sixteenthflag"                0pt     5pt     0pt     0pt
            "32"        "\thirtysecondflag"     0pt     5pt     0pt     0pt
@@ -99,10 +99,10 @@ table_twenty = symboltables {
            "-32"       "\dthirtysecondflag"    0pt     5pt     0pt     0pt
     }
 
-    "beamslopes" = table {
+    "beamslopes" = \table {
            "slope"     "\beamslope{%}{%}"
            "horizontal"        "\rulesym{%}{%}"        
     }
 
 }
-default_table = symboltables { table_twenty }
+default_table = \symboltables { table_twenty }
index 94970aa5c0d348288246a7284271b4990e6f3b1b..d2e1363371e9d723bbf44839689fbe2cc3260396 100644 (file)
@@ -9,7 +9,7 @@ build = ./$(depth)/lily/$(outdir)/.build
 
 # generic stuff/Makefile
 #
-include ./$(depth)/make/Stuff.make
+include ./$(depth)/make/Include.make
 #
 
 # list of distribution files:
index ecfda88354394f7891170add78543ef747ce1207..b1fe77a160f492847bd12f2ca037c2fe7b990ca0 100644 (file)
@@ -4,17 +4,17 @@
 % author: unknown. Copyright: none
 %
 
-cad = music { $
+cad = \music { 
        \duration { 8}
        \textstyle "italic"
        \clef \violin 
-       'c4.\mf g8
+       c'4.\mf g8
        \textstyle  "roman" 
 
-       ['e^"accel" ()'d 'c b]
-       [b()'c] g-\fermata
+       [e'^"accel" ()d' c' b]
+       [b()c'] g-\fermata
                \bar \empty
-                       c [c_"rubato" e g 'c]
+                       c [c_"rubato" e g c']
        \octave{'}
        e4. e [g ()f_"rit" e d]
 
@@ -33,26 +33,26 @@ cad = music { $
        \duration{16}   [d cis d e]
        f4()[f e d c]
        `b4
-       \octave{} ['d8 'c8 a8]2/3
+       \octave{} [d'8 c'8 a8]2/3
        g2
                \bar \empty 
-       [g c e g] ['c e g 'c]\octave{'} 
+       [g c e g] [c' e g c']\octave{'} 
        [e `g c e] g4^\fermata %()% BUG!
                \bar \empty 
-       [g8.(_"a tempo" e g8. )e]
+       [g8.(_"a \tempo" e g8. )e]
        a4. g8 [f8 e8 d8 c8]
        `g2 d2^"tr"
        c4
-       $}
+       }
 
 score {
-       staff { melodic
-               music { cad }
+       \staff { \melodic
+               \music { cad }
        }
-       commands {
-               cadenza {1}
+       \co\mmands {
+               \cadenza {1}
                grouping{1*4}
        }
-       paper {}
-       midi { tempo 4:80 }
+       \paper {}
+       \midi { \tempo 4:80 }
 }
index 2037580f1366d187282b75b8c08c768984d107ba..29a7b38c02562615ddba836efccd674b5c3c7038 100644 (file)
@@ -3,16 +3,17 @@
 % Opus 62
 % Ouverture zu Collins Trauerspiel "Coriolan"
 %
-% a 5 bar fragment of the alto part
+% a 5 \bar fragment of the alto part
 %
 % Copyright (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
 %
-% when lily can handle this, i-ll type the other 304 bars 
+% when lily can handle this, i-ll type the other 304 \bars 
 % (maybe even sooner :-)
 %
 
-alto = music { 
-       $
+alto = \music { 
+       
+               \meter {4/4} \grouping {4*4}
        \duration{ 8 }
        \key {bes es as}
                
@@ -21,8 +22,8 @@ alto = music {
        % that-s why i-d rather type chords, 
        % but how to type slurs?
 %30     
-               {       
-               \music
+       <       
+               { 
                        [ c c-. ] c2.( | 
 %31
                        [ ) c c-. ] c2.( | 
@@ -32,10 +33,10 @@ alto = music {
                        [ ) c c-. ] c4. c-. c4 
                }
 %30:2
-               \music
+               { 
                        \octave{ ` }
                        \textstyle "italic"
-                       % this should be a dynamic, rather than text
+                       % this should be a \dynamic, rather than text
                        [ c c_"cresc. \ \ - \ \ \ \ - \ \ \ \ - \ \ \ \
                                - \ \ \ \ - \ \ \ \ - \ \ \ \ - \ \ \ \
                                - \ \ \ \ - \ \ \ \ - \ \ \ \ - \ \ \ \
@@ -49,34 +50,32 @@ alto = music {
                        [ ) c c-. ] c4. c-. c4 |
                        \octave{ }
                }
-       }
 %34
-       % these are two voices (i.e. divisi)
+       >
+       % these are two \voices (i.e. divisi)
        % the c4 and c2, however are really 16th...
        % e.g.: c16*4 and c16*8  or
        %       [ c4 c2 ]*16 ?
        % we-ll say "simile" for now...
        % 
-               { \multivoice
-               \music{ \stem{ 1 }[ c16^"div." c16 c16 c16 ] c4 c2 }
-               \music  { 
+               < \multivoice
+               { \stem{ 1 }[ c16^"div." c16 c16 c16 ] c4 c2 }
+                 { 
                        \octave{ ` }
                        \textstyle "italic"
                        \stem{ -1 } [ as16_"\ff" as16 as16 as16 ] as4_"simile" as2
                        \textstyle "roman"
                }
-       }
-       $
+       >
+       
 }
 
 score {
-       staff { melodic music { alto }}
+       \staff { \melodic \music { alto }}
 
-       commands { 
-               meter {4*4} grouping {4*4}
        }
-       paper { 
-               unitspace 14mm
-               geometric 1.4
+       \paper { 
+               \unitspace 14\mm
+               \geometric 1.4
        }
 }
index 283f48922d8491e0bec716d3deb60257ef019e72..66b3760844bd0d4087207b29e518c4ff627e8d8f 100644 (file)
@@ -1,29 +1,29 @@
 include "this-is-hopefully-a-nonexisting-file"
 
-mwa = music {
-       $
+mwa = \music {
+       
        [ a8 a8 a8 a8 a8 ]      % 
        [ a8 ]  % 
 %       segfault
-       { \music{ [ bes^"1"( )a bes-. g-. ] a4-.^"4" } \music{ [ e ] } \music{ [ c ] } } |
+       { \\music{ [ bes^"1"( )a bes-. g-. ] a4-.^"4" } \\music{ [ e ] } \\music{ [ c ] } } |
        a ) b ] c       % warning
        &               % ok; error
        a b ) ]         % ok; error
 %        a.........    % fatal error -- assert
        a b c
        |||             % 
-       abc             % ok; print error, no output
+       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           % warning, still \output
+        { a( b }       % warning, still \output
        a b ,c
        a b c-*
        a b c&
        { a-. b-. }
-       $
+       
 }
 
-bla = music {
+bla = \music {
        @ 
        These Gates will open just like windows. % ok; warning
        @
@@ -33,13 +33,13 @@ bla = music {
 include "this-is-hopefully-a-nonexisting-file"
 
 score {
-       staff { 
-               lyric music { bla }
+       \staff { 
+               lyric \music { bla }
        }
-       staff { 
-               melodic music { mwa }
+       \staff { 
+               \melodic \music { mwa }
        }
-       commands {
-               meter {3*4}
+       \co\mmands {
+               \meter {3/4}
        }
 }
index 1c730a67834f1aff2d32e9b92af8bd52da1003f6..c42cc42775db08b01c8610fe0d8dd690f691f084 100644 (file)
 % Creator: This is mi2mu 0.0.11.2 #14/FlowerLib 1.1.7 #1 of Mar 12 1997 02:11:21
 % Automatically generated, at Wed Mar 12 02:22:22 1997
-% from input file: fugue1.midi
+% from input file: fugue1.\midi
 
-track0 = music { $
-       % midi copyright:
+track0 = \music { 
+       % \midi copyright:
        % instrument:
        
-$} % track0
+} % track0
 
-track1 = music { $
-       % midi copyright:
+track1 = \music { 
+       % \midi copyright:
        % instrument:
-       g8 a8 b8 'c8. { \music{ 'd16 } } { \music{ 'c16 } } 
-       { \music{ b8 } } 'e8 a8 { \music{ 'd8. } } 'e16 
-       'd16 'c16 b16 g16 a16 b16 'c16 b16 'c16 'd16 'e16 
-       'd16 'e16 'fis16 'g8 b8 'c8 a8 'd16 'c16 b16 a16 { 
-       \music{ g8. } } g16 f16 e16 f16 g16 a16 g16 a16 b16 
-       'c2 b4 'c8 'd8 'e8 'f8. { \music{ 'f16 } \music{ 
-       'g16 } } 'e8 'a8 'd8 'g8. 'a16 'g16 'f16 'e8 'a8. 
-       'b16 'a16 'g16 'f2 'e8. 'fis16 'g2 'fis4 'g16 'f16 
-       'e16 'd16 'c16 'd16 'c16 b16 a16 'c16 b16 a16 'c16 
-       a16 gis8 'e8 'd8 'c16 b16 a16 gis16 a16 b16 'c16 
-       fis16 gis16 a16 b8 a16 b16 'c8 'f8 'e8 'd4 'c16 b16 
-       { \music{ 'c16 } } { \music{ b16 } } { \music{ b16 
-       b16 } \music{ 'c16 'c16 } \music{ b16 } \music{ 
-       'c16 'c16 } } { } { \music{ b16 } } { \music{ a16 } 
-       } a4 g8 a8 b8 'c8. { \music{ 'd16 } } { \music{ 
-       'c16 } } { \music{ b8 } } 'c8 'd8 'e8 'f8. { \music{
-        'g16 } } { \music{ 'f16 } } { \music{ 'e8 } } 'a
-       'd8 'g8. 'a16 'g16 'f16 'e8 'a8 'd8 'ais8 'a8 'g16 
-       'f16 'g16 'f16 'g16 'e16 'f16 { \music{ 'g16 } } { 
-       \music{ 'g16 } } { \music{ 'a16 } } { \music{ 'g16 }
-        } { } { } { \music{ 'f16 } } { \music{ 'g16 } } { 
-       \music{ 'a16 } } 'cis16 'd16 'g16 { \music{ 'f16 } 
-       } { \music{ 'e16 } } { \music{ 'f16 } } { \music{ 
-       'e16 } } { } { \music{ 'f16 } } { } { } { } { 
-       \music{ 'e8 } } { } 'd16 'd8 g8 a8 b8 'c8 'd16 { 
-       \music{ 'c16 } } { \music{ b8 } } 'e8 a8 { \music{ 
-       'd8. } } 'e16 'd16 'c16 b16 'c16 'd16 'e16 'f16 
-       'g16 'a16 'g16 'f16 'e16 'd16 'c16 { \music{ 'c16 } 
-       } { \music{ b16 } } { \music{ 'c16 } } { } { } { 
-       \music{ b8. } } 'c8 'd8 g8 { \music{ 'c4 } } b8 'c
-       b8 ais8 a8 { \music{ 'd4 } } 'c8 'd8 'e8 'f4 'a16 { 
-       \music{ 'g16 } } 'f16 'e16 { \music{ 'f16 } } { 
-       \music{ 'e16 } } 'd16 'c2 g16 { \music{ a16 } } b16 
-       'c16 'd16 'e16 { \music{ 'f8. } } { \music{ 'd16 } 
-       \music{ 'c16 'e16 } } 'f16 { \music{ 'g16 } } { 
-       \music{ 'a8. } } 'b16 ''c
-$} % track1
+       g8 a8 b8 c'8. { \\music{ d'16 } } { \\music{ c'16 } } 
+       { \\music{ b8 } } e'8 a8 { \\music{ d'8. } } e'16 
+       d'16 c'16 b16 g16 a16 b16 c'16 b16 c'16 d'16 e'16 
+       d'16 e'16 fis'16 g'8 b8 c'8 a8 d'16 c'16 b16 a16 { 
+       \\music{ g8. } } g16 f16 e16 f16 g16 a16 g16 a16 b16 
+       c'2 b4 c'8 d'8 e'8 f'8. { \\music{ f'16 } \\music{ 
+       g'16 } } e'8 a'8 d'8 g'8. a'16 g'16 f'16 e'8 a'8. 
+       b'16 a'16 g'16 f'2 e'8. fis'16 g'2 fis'4 g'16 f'16 
+       e'16 d'16 c'16 d'16 c'16 b16 a16 c'16 b16 a16 c'16 
+       a16 gis8 e'8 d'8 c'16 b16 a16 gis16 a16 b16 c'16 
+       fis16 gis16 a16 b8 a16 b16 c'8 f'8 e'8 d'4 c'16 b16 
+       { \\music{ c'16 } } { \\music{ b16 } } { \\music{ b16 
+       b16 } \\music{ c'16 c'16 } \\music{ b16 } \\music{ 
+       c'16 c'16 } } { } { \\music{ b16 } } { \\music{ a16 } 
+       } a4 g8 a8 b8 c'8. { \\music{ d'16 } } { \\music{ 
+       c'16 } } { \\music{ b8 } } c'8 d'8 e'8 f'8. { \\music{
+        g'16 } } { \\music{ f'16 } } { \\music{ e'8 } } a'
+       d'8 g'8. a'16 g'16 f'16 e'8 a'8 d'8 ais'8 a'8 g'16 
+       f'16 g'16 f'16 g'16 e'16 f'16 { \\music{ g'16 } } { 
+       \\music{ g'16 } } { \\music{ a'16 } } { \\music{ g'16 }
+        } { } { } { \\music{ f'16 } } { \\music{ g'16 } } { 
+       \\music{ a'16 } } cis'16 d'16 g'16 { \\music{ f'16 } 
+       } { \\music{ e'16 } } { \\music{ f'16 } } { \\music{ 
+       e'16 } } { } { \\music{ f'16 } } { } { } { } { 
+       \\music{ e'8 } } { } d'16 d'8 g8 a8 b8 c'8 d'16 { 
+       \\music{ c'16 } } { \\music{ b8 } } e'8 a8 { \\music{ 
+       d'8. } } e'16 d'16 c'16 b16 c'16 d'16 e'16 f'16 
+       g'16 a'16 g'16 f'16 e'16 d'16 c'16 { \\music{ c'16 } 
+       } { \\music{ b16 } } { \\music{ c'16 } } { } { } { 
+       \\music{ b8. } } c'8 d'8 g8 { \\music{ c'4 } } b8 c'
+       b8 ais8 a8 { \\music{ d'4 } } c'8 d'8 e'8 f'4 a'16 { 
+       \\music{ g'16 } } f'16 e'16 { \\music{ f'16 } } { 
+       \\music{ e'16 } } d'16 c'2 g16 { \\music{ a16 } } b16 
+       c'16 d'16 e'16 { \\music{ f'8. } } { \\music{ d'16 } 
+       \\music{ c'16 e'16 } } f'16 { \\music{ g'16 } } { 
+       \\music{ a'8. } } b'16 c''
+} % track1
 
-track2 = music { $
-       % midi copyright:
+track2 = \music { 
+       % \midi copyright:
        % instrument:
-       c8 d8 e8 f8. { \music{ g16 } } { \music{ f16 } } { 
-       \music{ e8 } } a8 d8 { \music{ g8. } } a16 g16 f16 
-       e16 f16 e16 d16 c16 d16 c16 `b16 `a8 fis8 { \music{ 
+       c8 d8 e8 f8. { \\music{ g16 } } { \\music{ f16 } } { 
+       \\music{ e8 } } a8 d8 { \\music{ g8. } } a16 g16 f16 
+       e16 f16 e16 d16 c16 d16 c16 `b16 `a8 fis8 { \\music{ 
        g4. } } f16 e16 f8 d8 g8 f8 e8 d8 g4 f16 e16 f4 f16 
        e8 d4 c8 f8 g16 f16 e16 f8 d8 g4.. g8 a8 b8 { 
-       \music{ 'c8. } } { \music{ 'd16 } } { \music{ 'c16 }
-        } { \music{ b8 } } 'e8 a8 { \music{ 'd8. } } 'e16 
-       'd16 'c16 b8 d8 e8 fis8 { \music{ g8. } } { \music{ 
-       a16 } } { \music{ g16 } } { \music{ f8 } } b8 e8 
+       \\music{ c'8. } } { \\music{ d'16 } } { \\music{ c'16 }
+        } { \\music{ b8 } } e'8 a8 { \\music{ d'8. } } e'16 
+       d'16 c'16 b8 d8 e8 fis8 { \\music{ g8. } } { \\music{ 
+       a16 } } { \\music{ g16 } } { \\music{ f8 } } b8 e8 
        a8. b16 a16 gis16 fis8 f8 e8 d8. e16 fis16 gis16 
        a16 gis16 a16 b16 gis16 fis16 gis16 a16 b8 c8 d8 e8 
-       { \music{ f8. } } { \music{ g16 } } { \music{ f16 } 
-       } { \music{ e8 } } a8 d8 g8. a16 g16 f16 e16 e16 
-       fis16 g4 fis8 gis8 { \music{ a4 } } g8 a8 b8 { 
-       \music{ 'c8. } } { \music{ 'd16 } } { \music{ 'c16 }
-        } { \music{ b8 } } 'e8 a8 'd8. 'e16 'd16 'c16 b8 
-       'g8 'cis8 'd8 'e8 'cis8 'd8 'e8 a8 e8 fis8 g8 { 
-       \music{ a8. } } { \music{ b16 } } { \music{ a16 } } 
-       { \music{ g8 } } 'c8 fis8 { \music{ b8. } } 'c16 
+       { \\music{ f8. } } { \\music{ g16 } } { \\music{ f16 } 
+       } { \\music{ e8 } } a8 d8 g8. a16 g16 f16 e16 e16 
+       fis16 g4 fis8 gis8 { \\music{ a4 } } g8 a8 b8 { 
+       \\music{ c'8. } } { \\music{ d'16 } } { \\music{ c'16 }
+        } { \\music{ b8 } } e'8 a8 d'8. e'16 d'16 c'16 b8 
+       g'8 cis'8 d'8 e'8 cis'8 d'8 e'8 a8 e8 fis8 g8 { 
+       \\music{ a8. } } { \\music{ b16 } } { \\music{ a16 } } 
+       { \\music{ g8 } } c'8 fis8 { \\music{ b8. } } c'16 
        b16 a16 g16 fis16 e16 d16 e4 d4 a16 g16 f16 e16 g16 
-       f16 a16 g4 a16 ais8 { \music{ 'c4 } } 'd8 g8 { 
-       \music{ g4. } } f4 e8 d4 e16 a4 g4 f8 g8 a8 { 
-       \music{ ais8. } } { \music{ 'c16 } } { \music{ 
-       ais16 } } { \music{ a8 } } 'd8 g8 { \music{ 'c8. } 
-       } 'd16 'c16 ais16 a16 ais16 a16 g16 f16 g16 f16 e16 
-       g16 a4 'f16 'd8 { \music{ 'e2 } \music{ 'g2 } } 
-$} % track2
+       f16 a16 g4 a16 ais8 { \\music{ c'4 } } d'8 g8 { 
+       \\music{ g4. } } f4 e8 d4 e16 a4 g4 f8 g8 a8 { 
+       \\music{ ais8. } } { \\music{ c'16 } } { \\music{ 
+       ais16 } } { \\music{ a8 } } d'8 g8 { \\music{ c'8. } 
+       } d'16 c'16 ais16 a16 ais16 a16 g16 f16 g16 f16 e16 
+       g16 a4 f'16 d'8 { \\music{ e'2 } \\music{ g'2 } } 
+} % track2
 
-track3 = music { $
-       % midi copyright:
+track3 = \music { 
+       % \midi copyright:
        % instrument:
-       `g8 `a8 `b8 c8. { \music{ d16 } } { \music{ c16 } } 
-       { \music{ `b8 } } e8 `a8 { \music{ d8. } } e16 d16 
+       `g8 `a8 `b8 c8. { \\music{ d16 } } { \\music{ c16 } } 
+       { \\music{ `b8 } } e8 `a8 { \\music{ d8. } } e16 d16 
        c16 `b8 c4 `ais8 `a8 d8 `g8 c8 `a16 `b16 c16 d4 `g4 
-       `g8 `a8 `b8 c8. { \music{ d16 } } { \music{ c16 } } 
+       `g8 `a8 `b8 c8. { \\music{ d16 } } { \\music{ c16 } } 
        { } `b8 e8 `a8 d8. e16 d16 c16 `b8 e4. d4 `b16 c16 
        `a16 e16 d16 c16 `b16 c16 `a16 `b16 c16 d16 c16 
-       `b16 `a16 `g4 `e8 `fis8 `gis8 `a8. { \music{ `b16 } 
-       } { \music{ `a16 } } { \music{ `g8 } } c8 `fis8 
-       `b8. c16 `b16 `a16 `gis8 { \music{ `a4 } } `gis8 
-       `a4 `g8 `a8 `b8 c8. { \music{ d16 } } { \music{ c16 
-       } } { \music{ `b8 } } e8 `a8 d4 `g8 d4 c8 `a8 e4 d8 
-       `a8 `b8 cis8 d8. { \music{ e16 } } { \music{ d16 } 
-       } { \music{ c8 } } f8 `b8 e8. f16 e16 d16 cis8 `a8 
-       `b8 cis8 d8. { \music{ e16 } } { \music{ d16 } } { 
-       \music{ c8 } } fis8 `b8 e8. fis16 e16 d16 c4.. d16 
-       c16 `b16 `a16 `g16 `a16 `fis16 `g8 `b8 c8 { \music{ 
-       d8 } } e8. { \music{ f16 } } { \music{ e16 } } { 
-       \music{ d8 } } g8 c8 f8. g16 f16 e16 d4 e8 d4 { 
-       \music{ `g8 } } `g4. `c8 `d8 `e8 `f8. { \music{ 
-       `g16 } } { \music{ `f16 } } { \music{ `e8 } } `a8 
-       `d8 { \music{ `g8. } } `a16 `g16 `f16 `e16 `d16 
+       `b16 `a16 `g4 `e8 `fis8 `gis8 `a8. { \\music{ `b16 } 
+       } { \\music{ `a16 } } { \\music{ `g8 } } c8 `fis8 
+       `b8. c16 `b16 `a16 `gis8 { \\music{ `a4 } } `gis8 
+       `a4 `g8 `a8 `b8 c8. { \\music{ d16 } } { \\music{ c16 
+       } } { \\music{ `b8 } } e8 `a8 d4 `g8 d4 c8 `a8 e4 d8 
+       `a8 `b8 cis8 d8. { \\music{ e16 } } { \\music{ d16 } 
+       } { \\music{ c8 } } f8 `b8 e8. f16 e16 d16 cis8 `a8 
+       `b8 cis8 d8. { \\music{ e16 } } { \\music{ d16 } } { 
+       \\music{ c8 } } fis8 `b8 e8. fis16 e16 d16 c4.. d16 
+       c16 `b16 `a16 `g16 `a16 `fis16 `g8 `b8 c8 { \\music{ 
+       d8 } } e8. { \\music{ f16 } } { \\music{ e16 } } { 
+       \\music{ d8 } } g8 c8 f8. g16 f16 e16 d4 e8 d4 { 
+       \\music{ `g8 } } `g4. `c8 `d8 `e8 `f8. { \\music{ 
+       `g16 } } { \\music{ `f16 } } { \\music{ `e8 } } `a8 
+       `d8 { \\music{ `g8. } } `a16 `g16 `f16 `e16 `d16 
        `e16 `f16 `g16 `a16 `ais16 `g16 `a16 `e16 `f16 `g16 
-       `a16 `b16 c16 { \music{ `a16 } \music{ d2 } } c1 
-$} % track3
+       `a16 `b16 c16 { \\music{ `a16 } \\music{ d2 } } c1 
+} % track3
 
-track4 = music { $
-       % midi copyright:
+track4 = \music { 
+       % \midi copyright:
        % instrument:
-       `c8 `d8 `e8 `f8. { \music{ `g16 } } { \music{ `f16 }
-        } { \music{ `e8 } } `a8 `d8 { \music{ `g8. } } 
+       `c8 `d8 `e8 `f8. { \\music{ `g16 } } { \\music{ `f16 }
+        } { \\music{ `e8 } } `a8 `d8 { \\music{ `g8. } } 
        `a16 `g16 `f16 `e16 `f16 `e16 `d16 `c16 `d16 `c16 
        ``b16 ``a8 `d8 `a8 `fis8 `g16 `a16 `ais16 `g16 
        `cis8 `d8 `a4 `e4 `a16 `b16 c16 d16 c16 `b16 `a16 
-       `g16 c8 ``g8 ``a8 ``b8 `c8. { \music{ `d16 } } { 
-       \music{ `c16 } } { \music{ ``b8 } } `e8 ``a8 `d8. 
-       `e16 `d16 `c16 { \music{ ``b8 } } `e4 `d8 `c8 `f4 
+       `g16 c8 ``g8 ``a8 ``b8 `c8. { \\music{ `d16 } } { 
+       \\music{ `c16 } } { \\music{ ``b8 } } `e8 ``a8 `d8. 
+       `e16 `d16 `c16 { \\music{ ``b8 } } `e4 `d8 `c8 `f4 
        `e4 `d4 `e8 `f8 `e16 `d16 `e4 ``a4 ``g8 ``a8 ``b8 
-       `c8. { \music{ `d16 } } { \music{ `c16 } } { \music{
-        ``b8 } } `e8 ``a8 `d8. `e16 `d16 `c16 ``b8 ``ais8 
+       `c8. { \\music{ `d16 } } { \\music{ `c16 } } { \\music{
+        ``b8 } } `e8 ``a8 `d8. `e16 `d16 `c16 ``b8 ai``s8 
        ``a8 ``g8 ``a8 `fis8 `g8 `e8 `d4 `e8 `f8 `g8. { 
-       \music{ `a16 } } { \music{ `g16 } } { \music{ `f8 } 
-       } `ais8 `e8 `a8. `b16 { \music{ `a16 } } `g16 `f16 
+       \\music{ `a16 } } { \\music{ `g16 } } { \\music{ `f8 } 
+       } `ais8 `e8 `a8. `b16 { \\music{ `a16 } } `g16 `f16 
        `e16 `f16 `d16 `g8 `a8 `d4.. `e16 `d16 `c16 ``b16 
-       ``a16 ``g16 ``fis16 ``e8 `e8 `fis8 `g4 `a16 `g16 
+       ``a16 ``g16 fi``s16 ``e8 `e8 `fis8 `g4 `a16 `g16 
        `fis8 `d8 `g1 `a4 `b8 c8 `f16 `a16 `g16 `f16 `e16 
        `d16 `c16 ``b16 `c16 `d16 `e16 `f16 `g8 ``g8 `b2 
-$} % track4
+} % track4
 
 score {
-       staff { melodic music { track0 } }
-       staff { melodic music { track1 } }
-       staff { melodic music { track2 } }
-       staff { melodic music { track3 } }
-       staff { melodic music { track4 } }
+       \staff { \melodic \music { track0 } }
+       \staff { \melodic \music { track1 } }
+       \staff { \melodic \music { track2 } }
+       \staff { \melodic \music { track3 } }
+       \staff { \melodic \music { track4 } }
 
-       commands {
-               meter { 4*4 } 
-       }
-       midi {
-               tempo 4:60 
+       \midi {
+               \tempo 4:60 
        }
 }
index 645c1f9d4b19c9e353bfd94b6e11f9e39a4083f5..d1e704afe21d780a018398350d875541d5fa8f51 100644 (file)
@@ -1,18 +1,18 @@
 % "Ah,  vous dirais-je, maman" (Mozart, KV 265)
 % 
-% bare bones version. (written down from memory :-)
+% \bare bones version. (written down from memory :-)
 % for lyrics, see twinkle.ly
 
-% the % is a comment.
+% the % is a co\mment.
 %
 % copyright: None
 %
-% declare music (which will be in *one* staff ) for the lead voice
+% declare \music (which will be in *one* \staff ) for the lead \voice
 
-melodie = music {
-       $                       % switch Lilypond in note-mode
+melodie = \music {
+                               % switch Lilypond in note-mode
        \clef\violin
-       \octave {}              % set the default octave
+       \octave {}              % set the default \octave
        % the default note duratino is 4
        %%% theme
        c c |                   % the '|' checks if there is a new measure here.
@@ -24,24 +24,24 @@ melodie = music {
        g g|    f f|    e e|    d d|    g g|    f f|    e e|    d d|
        %%% var 1
          c r8 c8               % r8 means an 8th rest.
-                 (|            % start a slur
-                               % NOTE: the slurstart should be directly after the note
+                 (|            % \start a slur
+                               % NOTE: the slur\start should be directly after the note
                        )       % end a slur.
                          g r8 g8 (|    ) a r8 a8 (|    ) g r4 
          f r8 f8 (|    ) e4 r8 e8 (    |) d4 r8 d8 (|  ) c4 r4 
-$}
+}
 
                                % more of this.
 begeleiding =
-%      $\clef bass             % bass-clef
-%      \music {                % as you can see, the $ sign obliges 
-                               % you to precede keyword by a backslash: \
-       music { $
+%      \clef bass              % bass-\clef
+%      \\music {               % as you can see, the  sign obliges 
+                               % you to precede \keyword by a backslash: \
+       \music { 
        \clef "bass"
-       \octave { ` }           % default octave: 1 below the first octave.
+       \octave { ` }           % default \octave: 1 below the first \octave.
 
        %%% theme
-       `c                      % ` means one octave lower.
+       `c                      % ` means one \octave lower.
                                % Similarly: ' means one higher.
           c    e c     f c     e c     d `b    c `a    `f `g   `c2
        \octave { ` }
@@ -49,31 +49,30 @@ begeleiding =
        %%%% var 1
        r8 e8() c       r8 e8() c       r8 f8()c        r8 e8()c
        r8 d8()`b       r8 c8()`a       r8 `a8()`f      r8 `e8()`c
-}$
+}
 
 
-% create a staff named bstaf
-bstaf = staff {
-       melodic
-       music { begeleiding }   % use the declared music
+% create a \staff named bstaf
+bstaf = \staff {
+       \melodic
+       \music { begeleiding }  % use the declared \music
+       \music { \meter {2/4 }  }
        }
 
 % another one
-vstaf = staff {
-       melodic
-               music { melodie }
-                               % default clef is violin clef
+vstaf = \staff {
+       \melodic
+               \music { melodie }
+                               % default \clef is violin \clef
+               \music { \meter {2/4 } }
        }
 
 
-score {
-       staff { vstaf }
-       staff { bstaf }
-       paper {
-               unitspace 2.5cm % a whole note takes 2.5 cm ideally.
-       }
-       commands {
-               meter {2* 4}    % a 2/4 meter.
+\score {
+       \staff { vstaf }
+       \staff { bstaf }
+       \paper {
+               \unitspace 2.5\cm       % a whole note takes 2.5 \cm ideally.
        }
 }
 
index cf77a62bcc68ebdc745be2e16b2ba3e3ab77d217..c9cde44649343b3068cd48008695193c5820ddc2 100644 (file)
@@ -4,70 +4,70 @@
 %
 %
 
-ritme = staff {
+ritme = \staff {
        rhythmic
-       music {$
+       \music {
        c8
        |[a8() a8. a8 a16 a16 a16] c4.
                
-       %[c8( )'a8() c8 c8]% BUG!
+       %[c8( )a'8() c8 c8]% BUG!
        |c2 c2
        
-       |[fis16 'dis16( fis16 'dis16 ][fis16) 'dis16 fis16 'dis16]
+       |[fis16 dis'16( fis16 dis'16 ][fis16) dis'16 fis16 dis'16]
        | r32 r32 r16 r8 r4 r2
        |[c8. c16] [c16 c8.] [c16 c16 c8] [c16 c8 c16]
 
         c2 c2 c2 c2 c2 c2 c2 c2 c2 c2
 
-       $}
+       }
 }
 
 melody=
-staff {
-       melodic
-       music{$
+\staff {
+       \melodic
+       \music{
        c8\key{fis cis gis}
        |r4 r4 r4 r4
-       |'cis2..        r8
+       |cis'2..        r8
        | r4 r8 r16 r32 r32 
 
        \duration {4}
        {
-               \music { c () `bes [c8 c8] }
-               \music { 'fis ()'gisis fis8 fis8 }
-               \music { d () d dis8 dis8 }
-               \music {  a  () bes eis8 eis8 }
-               \music { fis () g gis8 gis8 }
+               \\music { c () `bes [c8 c8] }
+               \\music { fis' ()gisis' fis8 fis8 }
+               \\music { d () d dis8 dis8 }
+               \\music {  a  () bes eis8 eis8 }
+               \\music { fis () g gis8 gis8 }
        }
        \clef\tenor
-       { c4 'c4 }
+       { c4 c'4 }
 
-       [d8 e8 'f8 g8]  d8 e8 f8 g8
-       |''fis2
-       | a8 b8 'c8 'd8 |''c8 ```c8 c4 |c4  c4 |c4
+       [d8 e8 f'8 g8]  d8 e8 f8 g8
+       |fis''2
+       | a8 b8 c'8 d'8 |c''8 ```c8 c4 |c4  c4 |c4
        \duration{ 16 } `b `a `g `f \duration{ 4}
        \clef\bass      
 
        |c `b `a `g `f `e `d `c ``b ``a ``g ``f ``e ``d ``c
-       $}
+       }
 
 }
 
 score {
-       paper {
-               geometric 1.4
-               unitspace 3.0 cm
+       \paper {
+               \geometric 1.4
+               \unitspace 3.0 \cm
        }
-%      staff { ritme } % broken for now
-       staff { melody }
-       commands {
-               meter {4* 4}
-               partial {8}
-               skip {1*8}
-               skip {3*2 }
-               bar ":|:"
-               skip {1*2}
-               meter {2*4}
+%      \staff { ritme } % broken for now
+       \staff { melody }
+       \co\mmands {
+               \meter {4* 4}
+               \partial {8}
+               \skip {1*8}
+               \skip {3*2 }
+               \bar ":|:"
+               \skip {1*2}
+               \meter {2*4}
 
        }
 }
index 86c737badcdc393f13d00df107371f835fa9c1b7..56340bddab9ae216362627f0aaeeec9102760925 100644 (file)
@@ -9,7 +9,7 @@
 % quite alive at the time of writing; 
 % copyright by ml
 %
-% lilypond: src/stem.cc:42: void Stem::set_stemend(double): Assertion `(dir > 0 && se >= maxnote) || (se <= minnote && dir <0)' failed.
+% lilypond: src/\stem.cc:42: void Stem::set_\stemend(double): Assertion `(dir > 0 && se >= maxnote) || (se <= minnote && dir <0)' failed.
 % 
 % The purpose of this file is to demonstrate features of LilyPond;
 % respect the copyright.
 % \barnumbering5
 % \barnumberstyle\boxed
 
+globalmusic= \music {
+               \meter {2/4}
+%              \key fis
+               \skip {56*2}
+%              \key bes es as
+               \skip {8*2}
+               \meter {6/8}
+               \skip{ 48*8}
+               \meter {2/4}
+               \skip {16*2}
+%              \key fis
+}
+
 include "mlalt.ly"
 include "mlvio1.ly"
 include "mlvio2.ly"
 include "mlcello.ly"
 
-score {
-       staff { 
-               melodic 
-               music { alto }
+\score {
+       \staff { 
+               \melodic 
+               \music { alto }
+               \music { globalmusic }
        }
-       staff { 
-               melodic 
-               music { violin1 }
+       \staff { 
+               \melodic 
+               \music { violinI }
+               \music { globalmusic }
        }
-       staff { 
-               melodic 
-               music { violin2 }
+       \staff { 
+               \melodic 
+               \music { violinII }
+               \music { globalmusic }
        } 
-       staff { 
-               melodic 
-               music { cello }
+       \staff { 
+               \melodic 
+               \music { cello }
+               \music { globalmusic }
        } 
-       commands {
-               meter {2*4}
-%              key $fis$
-               skip {56*2}
-%              key $bes es as$
-               skip {8*2}
-               meter {6*8}
-               skip{ 48*8}
-               meter {2*4}
-               skip {16*2}
-%              key $fis$
-       }
-       paper {
-               unitspace 24mm
-               width 195mm
-               output "martien.out"
+       \paper {
+               \unitspace 24\mm
+               \width 195\mm
+               \output "martien.out"
        }
-       midi { 
-               tempo 4:80
+       \midi { 
+               \tempo 4:80
        }
 }
index 38e5073778c2d9438fb495a3df4b63e05f3211cb..4382ed3bf2c1e93f741fcf2f44f30f19b97f04ed 100644 (file)
@@ -1,40 +1,40 @@
-% midi.ly
-% test source for lilypond-s midi output
+% \midi.ly
+% test source for lilypond-s \midi \output
 
-melodie = music {
-       $\clef\violin
+melodie = \music {
+       \clef\violin
        c c | g g | a a | g2 
        f f | e e | d d8.( e16 | )c2 | % :|
-       $
+       
 }
 
-begeleiding = music {
-       $
+begeleiding = \music {
+       
        \clef \bass
        \octave{`}
-       c 'c | 'e 'c | 'f 'c | 'e 'c 
-       'd b | 'c a | f g | c2 | 
-       $
+       c c' | e' c' | f' c' | e' c' 
+       d' b | c' a | f g | c2 | 
+       
 }
 
-mstaf = staff {
-       melodic
-       music { melodie }
+mstaf = \staff {
+       \melodic
+       \music { melodie }
 }
 
-bass_staf = staff {
-       melodic 
-       music { begeleiding }
+bass_staf = \staff {
+       \melodic        
+       \music { begeleiding }
 }
 
 score {
-       staff { mstaf }
-       staff { bass_staf }
-       commands {
-               meter { 2 * 4}
+       \staff { mstaf }
+       \staff { bass_staf }
+       \co\mmands {
+               \meter { 2 * 4}
        }
-       midi {
-               tempo 4:120
+       \midi {
+               \tempo 4:120
        }
 }
 
index cbe46e0f2339cca8ecbe44e76351ea2b8fef8190..50563fef843553edeb23e3ce92514b307d54fa06 100644 (file)
@@ -11,8 +11,8 @@
 % The purpose of this file is to demonstrate features of LilyPond;
 % respect the copyright.
 %
-alto = music { 
-       $
+alto = \music { 
+       
        \duration{16}
        \clef\alto
        \octave{}
@@ -84,7 +84,7 @@ alto = music {
 %30
        [ a8 `a8 ] a4 |
 %31
-       [ b8 'cis8 ] [ 'd8 a8 ] |
+       [ b8 cis'8 ] [ d'8 a8 ] |
 %32
        [ g e cis `a ] d4 |
 %variant a
@@ -210,5 +210,5 @@ alto = music {
        \textstyle "roman"
 %\scoreverb{\mulooseness=1}
 %      \key\G ||
-       $
+       
 }
index 558fc1fb15788c5de7566340f6cee5b131241938..c513a366eaa82fd3d8df60588fd9a4f73f95ec66 100644 (file)
@@ -11,8 +11,8 @@
 % The purpose of this file is to demonstrate features of LilyPond;
 % respect the copyright.
 %
-cello = music { 
-       $
+cello = \music { 
+       
 \clef"bass"    \octave{`}
        \duration{4}
        \key{fis}
@@ -41,14 +41,14 @@ cello = music {
 %%12
        ) d g |
 %%13
-       [ d8 'd8 ] g |
+       [ d8 d'8 ] g |
 %%14=10
-       [ d8 'd8 ] g |
+       [ d8 d'8 ] g |
 %%15
        [ c8 e8 ] [ g8 `g8 ] |
 %%16
        \textstyle "italic"
-       [ d8 'c8 ] b_"fine"
+       [ d8 c'8 ] b_"fine"
        \textstyle "roman" |
 % \newline
 %%17=1
@@ -92,7 +92,7 @@ cello = music {
 %%34
        [ `g8 `g `g ] g4 |
 %%35
-       [ c8 c c ] [ c8 'c 'c ] |
+       [ c8 c c ] [ c8 c' c' ] |
 %%36
        g4 b4 |
 %%37
@@ -178,7 +178,7 @@ cello = music {
 %%71
        g2.  |
 %%72
-       'c r4 r4. |
+       c' r4 r4. |
 %%73
 % \meter{2/4} ||
        g r g r |
@@ -216,5 +216,5 @@ cello = music {
        d_"dacapo" \key{fis} |
        \textstyle "roman"
 % \key\`g ||
-       $
+       
 }
index b1d277bd313ff3829f3532ba926a4e11f1d59e36..97078db25541dfced031348bb86d9722831a0e78 100644 (file)
@@ -11,8 +11,8 @@
 % The purpose of this file is to demonstrate features of LilyPond;
 % respect the copyright.
 %
-violin1 = music { 
-       $
+violinI = \music { 
+       
        \clef "violin"
        \octave{}
        \duration{4}
@@ -22,7 +22,7 @@ violin1 = music {
 %2
        g2 |
 %3
-       g [ a16 b16 'c16 a16 ] |
+       g [ a16 b16 c'16 a16 ] |
 %4
        g2 |
 %5=1
@@ -40,13 +40,13 @@ violin1 = music {
 %11=4
        e d |
 %12
-       [ fis8 a8 ] [ g8 'd8 ] |
+       [ fis8 a8 ] [ g8 d'8 ] |
 %13
-       [ 'd8 a8 ] [ 'd8 b8 ] |
+       [ d'8 a8 ] [ d'8 b8 ] |
 %14=10
        a b |
 %15
-       'c b |
+       c' b |
 %16
        \textstyle "italic"
        a g_"fine"
@@ -57,7 +57,7 @@ violin1 = music {
 %18=2
        g2 |
 %19=3
-       g [ a16 b16 'c16 a16 ] |
+       g [ a16 b16 c'16 a16 ] |
 %20=4
        g2 |
 %21=5
@@ -67,41 +67,41 @@ violin1 = music {
 %23=4
        e [ d16 c16 `b16 c16 ] |
 %24
-       cis 'cis |
+       cis cis' |
 %25
-       'd [ 'fis8. 'e16 ] |
+       d' [ fis'8. e'16 ] |
 %first modulation
 %26
-       'd 'c |
+       d' c' |
 %27
        b a |
 %28
-       [ a8 b16 'cis16 ] 'd |
+       [ a8 b16 cis'16 ] d' |
 %29
-       'cis 'd |
+       cis' d' |
 %30
-       'cis a |
+       cis' a |
 %31
-       [ g8 'd8( ] ) 'd |
+       [ g8 d'8( ] ) d' |
 %32
-       'cis 'c |
-%variant 'a
+       cis' c' |
+%variant a'
 %33
-       \duration{16} [ b8 'd 'd ] [ 'd8 'd 'd ] |
+       \duration{16} [ b8 d' d' ] [ d'8 d' d' ] |
 %34
-       [ 'g8 'd 'd ] b4 |
+       [ g'8 d' d' ] b4 |
 %35
-       [ 'c8 'c 'c ] [ 'c8 'c 'c ] |
+       [ c'8 c' c' ] [ c'8 c' c' ] |
 %36
        b2 |
 %37
-       [ 'c8 'e 'e ] [ 'e8 'd 'c ] |
+       [ c'8 e' e' ] [ e'8 d' c' ] |
 %38
-       [ b8 'd 'd ] [ 'd8 'd 'd ] |
+       [ b8 d' d' ] [ d'8 d' d' ] |
 %39
-       [ 'e8 'c 'c ] [ 'c8 'd 'c ] |
+       [ e'8 c' c' ] [ c'8 d' c' ] |
 %40
-       'c4 { b4 'd4 } |
+       c'4 { b4 d'4 } |
 %41
        \textstyle "italic"
        \duration{8}
@@ -110,17 +110,17 @@ violin1 = music {
 %42
        r d e4 |
 %43
-       r b r 'd |
+       r b r d' |
 %44
-       r 'e 'c4 |
+       r e' c'4 |
 %45
        r b r b |
 %46
        r b [ a b ] |
 %47
-       r b r 'c |
+       r b r c' |
 %48
-       r 'd [ 'd b ] |
+       r d' [ d' b ] |
 %theme 2
 %49
        \textstyle "italic"
@@ -131,7 +131,7 @@ violin1 = music {
 %51
        b2 |
 %52
-       'c2 |
+       c'2 |
 %53
        r4  [ b b b ]2/3  |
 %54
@@ -144,18 +144,18 @@ violin1 = music {
 %57
        f r f r |
 %58
-       es r 'c r |
+       es r c' r |
 %59
        b r b r |
 %60
-       'c r 'c4 |
+       c' r c'4 |
 %61
        \duration{16}
-        [ as f d f as 'd ]4/6   [ as f d `as d f ]4/6  |
+        [ as f d f as d' ]4/6   [ as f d `as d f ]4/6  |
 %62
-        [ g es c `g c es ]4/6   [ g 'c 'es 'c g es ]4/6  |
+        [ g es c `g c es ]4/6   [ g c' es' c' g es ]4/6  |
 %63
-        [ g d g bes 'd 'g ]4/6   [ 'f 'd bes g f d ]4/6  |
+        [ g d g bes d' g' ]4/6   [ f' d' bes g f d ]4/6  |
 %64
        \duration{8}
        [ c g ] g4 |
@@ -169,42 +169,42 @@ violin1 = music {
 %68
        [ b8 b  b ] b4.  |
 %69
-       [ 'c g es ] 'c4.  |
+       [ c' g es ] c'4.  |
 %70
-       'c4. 'es4.  |
+       c'4. es'4.  |
 %71
-       [ 'f 'd b ] [ g a8 b ] |
+       [ f' d' b ] [ g a8 b ] |
 %72
-       'c r4 r4. |
+       c' r4 r4. |
 % \meter{2/4} ||
 %73
        f r f r |
 %74
-       es r 'c r |
+       es r c' r |
 %75
        b r b r |
 %76
-       'c r 'c4 |
+       c' r c'4 |
 %77
        \duration{16}
-        [ as f d f as 'd ]4/6   [ as f d `as d f ]4/6  |
+        [ as f d f as d' ]4/6   [ as f d `as d f ]4/6  |
 %78
-        [ g es c `g c es ]4/6   [ f 'c 'es 'c g es ]4/6  |
+        [ g es c `g c es ]4/6   [ f c' es' c' g es ]4/6  |
 %79
-        [ g d f b 'd 'g ]4/6   [ 'f 'd b g f d ]4/6  |
+        [ g d f b d' g' ]4/6   [ f' d' b g f d ]4/6  |
 %80
        [ c8 g8 ] g4 |
 %81
        \duration{2}
-       'c |
+       c' |
 %82
-       'c |
+       c' |
 %83
-       'des |
+       des' |
 %84
-       'c |
+       c' |
 %85
-       'c |
+       c' |
 %86
        es |
 %87
@@ -215,5 +215,5 @@ violin1 = music {
        \textstyle "roman"
        \key{fis} |
 % \key\G ||
-       $
+       
 }
index c3ed9bb999c4c88b2606d785a9b606c562d4bf68..74940775cbd49e03878d4267ce65bfa2807d7c80 100644 (file)
@@ -11,8 +11,8 @@
 % The purpose of this file is to demonstrate features of LilyPond;
 % respect the copyright.
 %
-violin2 = music { 
-       $
+violinII = \music { 
+       
 \clef "violin" \octave{}
        \duration{4}
        \key{fis}
@@ -172,7 +172,7 @@ violin2 = music {
 %69
        es2. |
 %70
-       [ c es g ] 'c4.  |
+       [ c es g ] c'4.  |
 %71
        b4 g4 d4 |
 %72
@@ -214,5 +214,5 @@ violin2 = music {
        fis_"dacapo" \key{fis}|
        \textstyle "roman"
 % \key\G ||
-       $
+       
 }
diff --git a/input/new-twinkle.ly b/input/new-twinkle.ly
new file mode 100644 (file)
index 0000000..75eaf79
--- /dev/null
@@ -0,0 +1,109 @@
+%  "Ah, vous dirais-je, maman" 
+%  "Altijd is Kortjakje ziek"
+%  "Twinkle twinkle little star"
+% 
+% Copyright: none
+
+melody = \melodic{
+       \clef\violin
+       c c | g g | a a | g g |
+       f f | e e | d [ d8.( e16 ] | )c2 \bar ":|"
+
+       g g | f f | e e | d d |
+%      g g | f f | e( [f0*32 e0*32 d0*32] [ e8. f16 ] | e )d | c c | 
+       g g | f f | e( [ e8. f16 ] | e )d |
+
+       c c | g g | a a | g g |
+       f f | e e | d [ d8.( e16 ] | )c2 \bar ":|"
+}
+
+accompany = \melodic{
+       \clef\bass
+       \octave{ c' }
+       c c' | e' c' | f' c' | e' c' | 
+       d' b | c' a | f g | c2 \bar ":|"
+
+       e' g | d g | c' g | b g | 
+%      e' g | d' g | c' [ c'8.( d'16 ] | \voice{ c' )b } \voice{ g2 } |
+       e' g | d' g | c' [ c'8.( d'16 ] | c' )b |
+
+       c c' | e' c' | f' c' | e' c' | 
+       d' b | c' a | f g | c2 \bar ":|"
+}
+
+original_text = \lyric{ 
+       \textstyle "italic" 
+       Ah! vous dir- ai_- je ma man2
+       Ce qui cau- se mon tour- ment2
+       Pa- pa veut que je rai- sonne2
+       Co\mme un- e grand- e per- sonne2
+       Moi je dis que les bon- bons2
+       Val- ent mieu que la rai- son2
+}
+
+tekst = \lyric{ 
+       Al- tijd is Kort- jak- je ziek,2
+       midden in_de week maar s'_zon- dags niet.2
+       s'_Zon- dags gaat ze naar de kerk,2
+       met een boek vol zil- ver werk.2
+       Al- tijd is Kort- jak- je ziek,2
+       midden in_de week maar s'_zon- dags niet.2
+}
+
+he_gedraagje_tekst = \lyric{ 
+       Al- tijd zuigt Bill Gates mijn piek,2
+       "\TeX" is slecht- ser dan mu- ziek.2
+       s''_Zon- dags gaat het door een raam,2
+       Weet dat ik me er- voor schaam.2
+       Al- tijd zuigt Bill Gates mijn piek,2
+       "\TeX" is slecht- ser dan mu- ziek.2
+}
+
+text1 = \lyric{
+       \textstyle "roman"
+       Twin- kle, twin- kle, lit- tle star,2
+       How I won- der what you are.2
+       Up a- bove the world so high,2
+       Like a dia- mond in the sky.2
+       Twin- kle, twin- kle, lit- tle star,2
+       How I won- der what you are!2
+}
+
+text2 = \lyric{
+       \textstyle "roman"
+       When the bla- zing sun is gone,2
+       When he no- thing shines up- on,2
+       Then you show your lit- tle light,2
+       Twin- kle, twin- kle, all the night.2
+       Twin- kle, twin- kle, lit- tle star,2
+       How I won- der what you are!2
+}
+
+text3 = \lyric{
+       \textstyle "roman"
+       Then the tra- veler in the dark2
+       Thanks you for your ti- ny spark;2
+       He_could not see which way to go,2
+       If you did not twin- kle so.2
+       Twin- kle, twin- kle, lit- tle star,2
+       How I won- der what you are!2
+}
+
+\score{
+       \\staff{ melody }
+       \\staff{ tekst }
+       \\staff{ original_text }
+       \\staff{ text1 text2 text3 }
+       \\staff{ accompany }
+       \co\mmands{
+               \meter{ 2/4 }
+               \skip{ 24 }
+       }
+       \midi{ 
+               \tempo 4:120 
+       }
+       \paper{
+               \unitspace 2.5\cm
+       }
+}
+
index 752a6bade6553ba18b2ea72cd6ea688c8912d66b..75382fdd8f1ae8666316653e60b434712a57d36d 100644 (file)
@@ -1,18 +1,18 @@
 
-melanie = music {
-       $
+melanie = \music {
+       
        \duration{8}
-       [ c d ] { [ d 'd } { c 'c ] } |
+       [ c d ] { [ d d' } { c c' ] } |
        [ c d ] [ e { d g } c ]2/3 |
-       [ c d ] [ c16 d16 'e16 'e16 d16 c16 ]4/6 |
+       [ c d ] [ c16 d16 e'16 e'16 d16 c16 ]4/6 |
        [ c d e e d c ]4/6 |
-       [c d ] { \music{ [ c d e ]2/3 } \music{ [ f g a ]2/3 } } |
+       [c d ] { \\music{ [ c d e ]2/3 } \\music{ [ f g a ]2/3 } } |
        [ c d ] [ d c ] |
-        $
+        
 }
 
-michelle = music {
-       $
+michelle = \music {
+       
        \duration{8}
        [ c c c c ] |
        [ c c c c ] |
@@ -20,10 +20,10 @@ michelle = music {
        [ c c c c ] |
        [ c c c c ] |
        [ c c c c ] |
-       $
+       
 }
 
-mireille = music {
+mireille = \music {
        @
        \duration{8}
        o o o o |
@@ -36,10 +36,10 @@ mireille = music {
 }
 
 score {
-       staff { lyric music { mireille } }
-       staff { melodic music { melanie } }
-       staff { melodic music { michelle } }
-       commands{ 
-               meter {2*4}
+       \staff { lyric \music { mireille } }
+       \staff { \melodic \music { melanie } }
+       \staff { \melodic \music { michelle } }
+       \co\mmands{ 
+               \meter {2*4}
        }
 }
index 69ee6feeaadf79541dd5748893574b6bce24f7ff..4a3183ab999e08d6204a243daf6e3c434ec754d8 100644 (file)
 % Creator: This is mi2mu 0.0.11.2 #14/FlowerLib 1.1.7 #1 of Mar 12 1997 02:05:36
 % Automatically generated, at Wed Mar 12 02:09:07 1997
-% from input file: pre1.midi
+% from input file: pre1.\midi
 % jcn: using option -n
 
-track0 = music { $
-       % midi copyright:
+track0 = \music { 
+       % \midi copyright:
        % instrument:
        { } { } { } { } { } { } { } { } 
-$} % track0
+} % track0
 
-track1 = music { $
-       % midi copyright:
+track1 = \music { 
+       % \midi copyright:
        % instrument:
-       { \music{ g16 'c16 'e16 g16 'c16 'e16 } } { \music{ 
-       g16 'c16 'e16 g16 'c16 'e16 } } { \music{ a16 'd16 
-       'f16 a16 'd16 'f16 } } { \music{ a16 'd16 'f16 a16 
-       'd16 'f16 } } { \music{ g16 'd16 'f16 g16 'd16 'f16 
-       } } { \music{ g16 'd16 'f16 g16 'd16 'f16 } } { 
-       \music{ g16 'c16 'e16 g16 'c16 'e16 } } { \music{ 
-       g16 'c16 'e16 g16 'c16 'e16 } } { \music{ a16 'e16 
-       'a16 a16 'e16 'a16 } } { \music{ a16 'e16 'a16 a16 
-       'e16 'a16 } } { \music{ fis16 a16 'd16 fis16 a16 
-       'd16 } } { \music{ fis16 a16 'd16 fis16 a16 'd16 } 
-       } { \music{ g16 'd16 'g16 g16 'd16 'g16 } } { 
-       \music{ g16 'd16 'g16 g16 'd16 'g16 } } { \music{ 
-       e16 g16 'c16 e16 g16 'c16 } } { \music{ e16 g16 
-       'c16 e16 g16 'c16 } } { \music{ e16 g16 'c16 e16 
-       g16 'c16 } } { \music{ e16 g16 'c16 e16 g16 'c16 } 
-       } { \music{ d16 fis16 'c16 d16 fis16 'c16 } } { 
-       \music{ d16 fis16 'c16 d16 fis16 'c16 } } { \music{ 
-       d16 g16 b16 d16 g16 b16 } } { \music{ d16 g16 b16 
-       d16 g16 b16 } } { \music{ e16 g16 'cis16 e16 g16 
-       'cis16 } } { \music{ e16 g16 'cis16 e16 g16 'cis16 }
-        } { \music{ d16 a16 'd16 d16 a16 'd16 } } { \music{
-        d16 a16 'd16 d16 a16 'd16 } } { \music{ d16 f16 
-       b16 d16 f16 b16 } } { \music{ d16 f16 b16 d16 f16 
-       b16 } } { \music{ c16 g16 'c16 c16 g16 'c16 } } { 
-       \music{ c16 g16 'c16 c16 g16 'c16 } } { \music{ 
-       `a16 c16 f16 `a16 c16 f16 } } { \music{ `a16 c16 
-       f16 `a16 c16 f16 } } { \music{ `a16 c16 f16 `a16 
-       c16 f16 } } { \music{ `a16 c16 f16 `a16 c16 f16 } } 
-       { \music{ `g16 `b16 f16 `g16 `b16 f16 } } { \music{ 
-       `g16 `b16 f16 `g16 `b16 f16 } } { \music{ `g16 c16 
-       e16 `g16 c16 e16 } } { \music{ `g16 c16 e16 `g16 
-       c16 e16 } } { \music{ `ais16 c16 e16 `ais16 c16 e16 
-       } } { \music{ `ais16 c16 e16 `ais16 c16 e16 } } { 
-       \music{ `a16 c16 e16 `a16 c16 e16 } } { \music{ 
-       `a16 c16 e16 `a16 c16 e16 } } { \music{ `a16 c16 
-       dis16 `a16 c16 dis16 } } { \music{ `a16 c16 dis16 
-       `a16 c16 dis16 } } { \music{ `b16 c16 d16 `b16 c16 
-       d16 } } { \music{ `b16 c16 d16 `b16 c16 d16 } } { 
-       \music{ `g16 `b16 d16 `g16 `b16 d16 } } { \music{ 
-       `g16 `b16 d16 `g16 `b16 d16 } } { \music{ `g16 c16 
-       e16 `g16 c16 e16 } } { \music{ `g16 c16 e16 `g16 
-       c16 e16 } } { \music{ `g16 c16 f16 `g16 c16 f16 } } 
-       { \music{ `g16 c16 f16 `g16 c16 f16 } } { \music{ 
-       `g16 `b16 f16 `g16 `b16 f16 } } { \music{ `g16 `b16 
-       f16 `g16 `b16 f16 } } { \music{ `a16 c16 fis16 `a16 
-       c16 fis16 } } { \music{ `a16 c16 fis16 `a16 c16 
-       fis16 } } { \music{ `g16 c16 g16 `g16 c16 g16 } } { 
-       \music{ `g16 c16 g16 `g16 c16 g16 } } { \music{ 
-       `g16 c16 f16 `g16 c16 f16 } } { \music{ `g16 c16 
-       f16 `g16 c16 f16 } } { \music{ `g16 `b16 f16 `g16 
-       `b16 f16 } } { \music{ `g16 `b16 f16 `g16 `b16 f16 }
-        } { \music{ `g16 `ais16 e16 `g16 `ais16 e16 } } { 
-       \music{ `g16 `ais16 e16 `g16 `ais16 e16 } } { 
-       \music{ `f16 `a16 c16 f16 c16 `a16 c16 `a16 `f16 
-       `a16 `f16 `d16 `f16 `d16 } } { \music{ g16 b16 'd16 
-       'f16 'd16 b16 'd16 b16 g16 b16 d16 f16 e64 } } { 
-       \music{ f64 } } { } { \music{ e32 } } { \music{ d16 
-       } } { \music{ 'c1 } \music{ g1 } \music{ e1 } } 
-$} % track1
+       { \\music{ g16 c'16 e'16 g16 c'16 e'16 } } { \\music{ 
+       g16 c'16 e'16 g16 c'16 e'16 } } { \\music{ a16 d'16 
+       f'16 a16 d'16 f'16 } } { \\music{ a16 d'16 f'16 a16 
+       d'16 f'16 } } { \\music{ g16 d'16 f'16 g16 d'16 f'16 
+       } } { \\music{ g16 d'16 f'16 g16 d'16 f'16 } } { 
+       \\music{ g16 c'16 e'16 g16 c'16 e'16 } } { \\music{ 
+       g16 c'16 e'16 g16 c'16 e'16 } } { \\music{ a16 e'16 
+       a'16 a16 e'16 a'16 } } { \\music{ a16 e'16 a'16 a16 
+       e'16 a'16 } } { \\music{ fis16 a16 d'16 fis16 a16 
+       d'16 } } { \\music{ fis16 a16 d'16 fis16 a16 d'16 } 
+       } { \\music{ g16 d'16 g'16 g16 d'16 g'16 } } { 
+       \\music{ g16 d'16 g'16 g16 d'16 g'16 } } { \\music{ 
+       e16 g16 c'16 e16 g16 c'16 } } { \\music{ e16 g16 
+       c'16 e16 g16 c'16 } } { \\music{ e16 g16 c'16 e16 
+       g16 c'16 } } { \\music{ e16 g16 c'16 e16 g16 c'16 } 
+       } { \\music{ d16 fis16 c'16 d16 fis16 c'16 } } { 
+       \\music{ d16 fis16 c'16 d16 fis16 c'16 } } { \\music{ 
+       d16 g16 b16 d16 g16 b16 } } { \\music{ d16 g16 b16 
+       d16 g16 b16 } } { \\music{ e16 g16 cis'16 e16 g16 
+       cis'16 } } { \\music{ e16 g16 cis'16 e16 g16 cis'16 }
+        } { \\music{ d16 a16 d'16 d16 a16 d'16 } } { \\music{
+        d16 a16 d'16 d16 a16 d'16 } } { \\music{ d16 f16 
+       b16 d16 f16 b16 } } { \\music{ d16 f16 b16 d16 f16 
+       b16 } } { \\music{ c16 g16 c'16 c16 g16 c'16 } } { 
+       \\music{ c16 g16 c'16 c16 g16 c'16 } } { \\music{ 
+       `a16 c16 f16 `a16 c16 f16 } } { \\music{ `a16 c16 
+       f16 `a16 c16 f16 } } { \\music{ `a16 c16 f16 `a16 
+       c16 f16 } } { \\music{ `a16 c16 f16 `a16 c16 f16 } } 
+       { \\music{ `g16 `b16 f16 `g16 `b16 f16 } } { \\music{ 
+       `g16 `b16 f16 `g16 `b16 f16 } } { \\music{ `g16 c16 
+       e16 `g16 c16 e16 } } { \\music{ `g16 c16 e16 `g16 
+       c16 e16 } } { \\music{ `ais16 c16 e16 `ais16 c16 e16 
+       } } { \\music{ `ais16 c16 e16 `ais16 c16 e16 } } { 
+       \\music{ `a16 c16 e16 `a16 c16 e16 } } { \\music{ 
+       `a16 c16 e16 `a16 c16 e16 } } { \\music{ `a16 c16 
+       dis16 `a16 c16 dis16 } } { \\music{ `a16 c16 dis16 
+       `a16 c16 dis16 } } { \\music{ `b16 c16 d16 `b16 c16 
+       d16 } } { \\music{ `b16 c16 d16 `b16 c16 d16 } } { 
+       \\music{ `g16 `b16 d16 `g16 `b16 d16 } } { \\music{ 
+       `g16 `b16 d16 `g16 `b16 d16 } } { \\music{ `g16 c16 
+       e16 `g16 c16 e16 } } { \\music{ `g16 c16 e16 `g16 
+       c16 e16 } } { \\music{ `g16 c16 f16 `g16 c16 f16 } } 
+       { \\music{ `g16 c16 f16 `g16 c16 f16 } } { \\music{ 
+       `g16 `b16 f16 `g16 `b16 f16 } } { \\music{ `g16 `b16 
+       f16 `g16 `b16 f16 } } { \\music{ `a16 c16 fis16 `a16 
+       c16 fis16 } } { \\music{ `a16 c16 fis16 `a16 c16 
+       fis16 } } { \\music{ `g16 c16 g16 `g16 c16 g16 } } { 
+       \\music{ `g16 c16 g16 `g16 c16 g16 } } { \\music{ 
+       `g16 c16 f16 `g16 c16 f16 } } { \\music{ `g16 c16 
+       f16 `g16 c16 f16 } } { \\music{ `g16 `b16 f16 `g16 
+       `b16 f16 } } { \\music{ `g16 `b16 f16 `g16 `b16 f16 }
+        } { \\music{ `g16 `ais16 e16 `g16 `ais16 e16 } } { 
+       \\music{ `g16 `ais16 e16 `g16 `ais16 e16 } } { 
+       \\music{ `f16 `a16 c16 f16 c16 `a16 c16 `a16 `f16 
+       `a16 `f16 `d16 `f16 `d16 } } { \\music{ g16 b16 d'16 
+       f'16 d'16 b16 d'16 b16 g16 b16 d16 f16 e64 } } { 
+       \\music{ f64 } } { } { \\music{ e32 } } { \\music{ d16 
+       } } { \\music{ c'1 } \\music{ g1 } \\music{ e1 } } 
+} % track1
 
-% jcn: substituted some "2" durations to "4."
-track2 = music { $
-       % midi copyright:
+% jcn: substituted some "2" \durations to "4."
+track2 = \music { 
+       % \midi copyright:
        % instrument:
-       { \music{ e4. } } { \music{ e4. } } { \music{ d4. } 
-       } { \music{ d4. } } { \music{ d4. } } { \music{ d4. 
-       } } { \music{ e4. } } { \music{ e4. } } { \music{ 
-       e4. } } { \music{ e4. } } { \music{ d4. } } { 
-       \music{ d4. } } { \music{ d4. } } { \music{ d4. } } 
-       { \music{ c4. } } { \music{ c4. } } { \music{ c4. } 
-       } { \music{ c4. } } { \music{ `a4. } } { \music{ 
-       `a4. } } { \music{ `b4. } } { \music{ `b4. } } { 
-       \music{ `ais4. } } { \music{ `ais4. } } { \music{ 
-       `a4. } } { \music{ `a4. } } { \music{ `gis4. } } { 
-       \music{ `gis4. } } { \music{ `g4. } } { \music{ 
-       `g4. } } { \music{ `f4. } } { \music{ `f4. } } { 
-       \music{ `f4. } } { \music{ `f4. } } { \music{ `d4. }
-        } { \music{ `d4. } } { \music{ `e4. } } { \music{ 
-       `e4. } } { \music{ `g4. } } { \music{ `c4. } } { } { 
-       } { \music{ `g4. } } { } { \music{ ``f4. } } { 
-       \music{ `f4. } } { \music{ ``f4. } } { \music{ `f4. }
-        } { \music{ ``fis4. } } { \music{ ``fis4. } \music{ 
-       `c4. } } { } { \music{ `c4. } } { \music{ ``gis4. } } 
-       { \music{ ``gis4. } \music{ `f4. } } { } { \music{ 
-       `f4. } } { \music{ ``g4. } } { \music{ ``g4. } \music{
-        `f4. } } { } { \music{ `f4. } } { \music{ ``g4. } } 
-       { \music{ ``g4. } \music{ `e4. } } { } { \music{ ``g4. 
-       } \music{ `e4. } } { } { \music{ ``g4. } \music{ 
-       `d4. } } { } { \music{ ``g4. } \music{ `d4. } } { } { 
-       \music{ `d4. } } { \music{ ``g4. } } { \music{ ``g4. }
-        \music{ `d4. } } { } { \music{ `dis4. } } { \music{
-        ``g4. } } { \music{ `dis4. } } { \music{ ``g4. } } { 
-       \music{ `e4. } } { \music{ ``g4. } } { \music{ `e4. }
-        } { \music{ ``g4. } } { \music{ `d4. } } { \music{ 
-       ``g4. } } { \music{ `d4. } } { \music{ ``g4. } } { 
-       \music{ `d4. } } { \music{ ``g4. } } { \music{ `d4. }
-        } { \music{ ``c4. } } { \music{ `c4. } } { \music{ 
-       ``c4. } } { \music{ `c4. } } { \music{ ``c1 } } { 
-       \music{ `c1 } } { \music{ ``c1 } \music{ ``b1 } } { 
-       } { } { } { \music{ ``c1 } \music{ `c1 } } 
-$} % track4.
+       { \\music{ e4. } } { \\music{ e4. } } { \\music{ d4. } 
+       } { \\music{ d4. } } { \\music{ d4. } } { \\music{ d4. 
+       } } { \\music{ e4. } } { \\music{ e4. } } { \\music{ 
+       e4. } } { \\music{ e4. } } { \\music{ d4. } } { 
+       \\music{ d4. } } { \\music{ d4. } } { \\music{ d4. } } 
+       { \\music{ c4. } } { \\music{ c4. } } { \\music{ c4. } 
+       } { \\music{ c4. } } { \\music{ `a4. } } { \\music{ 
+       `a4. } } { \\music{ `b4. } } { \\music{ `b4. } } { 
+       \\music{ `ais4. } } { \\music{ `ais4. } } { \\music{ 
+       `a4. } } { \\music{ `a4. } } { \\music{ `gis4. } } { 
+       \\music{ `gis4. } } { \\music{ `g4. } } { \\music{ 
+       `g4. } } { \\music{ `f4. } } { \\music{ `f4. } } { 
+       \\music{ `f4. } } { \\music{ `f4. } } { \\music{ `d4. }
+        } { \\music{ `d4. } } { \\music{ `e4. } } { \\music{ 
+       `e4. } } { \\music{ `g4. } } { \\music{ `c4. } } { } { 
+       } { \\music{ `g4. } } { } { \\music{ ``f4. } } { 
+       \\music{ `f4. } } { \\music{ ``f4. } } { \\music{ `f4. }
+        } { \\music{ fi``s4. } } { \\music{ fi``s4. } \\music{ 
+       `c4. } } { } { \\music{ `c4. } } { \\music{ gi``s4. } } 
+       { \\music{ gi``s4. } \\music{ `f4. } } { } { \\music{ 
+       `f4. } } { \\music{ ``g4. } } { \\music{ ``g4. } \\music{
+        `f4. } } { } { \\music{ `f4. } } { \\music{ ``g4. } } 
+       { \\music{ ``g4. } \\music{ `e4. } } { } { \\music{ ``g4. 
+       } \\music{ `e4. } } { } { \\music{ ``g4. } \\music{ 
+       `d4. } } { } { \\music{ ``g4. } \\music{ `d4. } } { } { 
+       \\music{ `d4. } } { \\music{ ``g4. } } { \\music{ ``g4. }
+        \\music{ `d4. } } { } { \\music{ `dis4. } } { \\music{
+        ``g4. } } { \\music{ `dis4. } } { \\music{ ``g4. } } { 
+       \\music{ `e4. } } { \\music{ ``g4. } } { \\music{ `e4. }
+        } { \\music{ ``g4. } } { \\music{ `d4. } } { \\music{ 
+       ``g4. } } { \\music{ `d4. } } { \\music{ ``g4. } } { 
+       \\music{ `d4. } } { \\music{ ``g4. } } { \\music{ `d4. }
+        } { \\music{ ``c4. } } { \\music{ `c4. } } { \\music{ 
+       ``c4. } } { \\music{ `c4. } } { \\music{ ``c1 } } { 
+       \\music{ `c1 } } { \\music{ ``c1 } \\music{ ``b1 } } { 
+       } { } { } { \\music{ ``c1 } \\music{ `c1 } } 
+} % track4.
 
 score {
-       staff { melodic music { track0 } }
-       staff { melodic music { track1 } }
-       staff { melodic music { track2 } }
+       \staff { \melodic \music { track0 } }
+       \staff { \melodic \music { track1 } }
+       \staff { \melodic \music { track2 } }
 
-       commands {
-               meter { 4*4 } 
+       \co\mmands {
+               \meter { 4*4 } 
        }
-       midi {
-               tempo 4:60 
+       \midi {
+               \tempo 4:60 
        }
 }
index 368d04b9bf4a3b797a99c06cb813ec379d91eaed..21fa4ab36a120b7c0f39641724da37ee2043f3ed 100644 (file)
@@ -1,12 +1,12 @@
 %
-%      I've got rhythm!
+%      Ive' got rhythm!
 %
 % add any impressive examples here, please
 
-ritme = staff {
-       melodic
+ritme = \staff {
+       \melodic
 
-       music { $
+       \music { 
        c8                                      |
 
        [a8() a8. a8 a16 a16 a16] c4.           |       % watch the beams!
@@ -27,40 +27,40 @@ ritme = staff {
 %      [c16 c16 c16 c16 c16 ]                  |
 %      [c16 c16 c16 c16 c16 ]                  |       
        
-       $ }
+        }
 
        %
-       % The commands section takes the same stuff that music { } takes;
-       % the commands issued below could have been issued inside the above
-       % music block;
+       % The \co\mmands section takes the same stuff that \music { } takes;
+       % the \co\mmands issued below could have been issued inside the above
+       % \music block;
        %
 
-       commands {      % override "commands" section of Score.
-               partial {1*8}   % doesn't have to be here. 
-               meter{ 4*4}
+       \co\mmands {    % override "\co\mmands" section of Score.
+               \partial {1*8}  % doesnt' have to be here. 
+               \meter{ 4*4}
        }
 }
-another = staff {
-       melodic
-       music { $
+another = \staff {
+       \melodic
+       \music { 
                c1 c1 c1 c4 c4 c4 c4  \meter{ 4*4} c1 c1 c1
-       $ }
+        }
 }
 
-yanother = staff {
-       melodic
-       music { $
+yanother = \staff {
+       \melodic
+       \music { 
                c1 c1 c1 c4 c4 c4 c4  c1 c1 c1
-       $ }
+        }
 }
 
 score {
-       staff{ritme}
-       staff { another }
-       staff { yanother }
-       commands { meter {4*4 }}
-       paper {
-               unitspace 2cm
-               geometric 1.3
+       \staff{ritme}
+       \staff { another }
+       \staff { yanother }
+       \co\mmands { \meter {4*4 }}
+       \paper {
+               \unitspace 2\cm
+               \geometric 1.3
        }
 }
index d98c1bba4326051c8aeea47190b026514680a9a9..cb38307579fc6b3b8689f95856c64c6020e8f7e1 100644 (file)
@@ -1,60 +1,60 @@
 
 blah =
-staff {melodic
-       music{  $
+\staff {\melodic
+       \music{         
 \duration { 8 }
                        \octave{ }
-                        |[ a a a a a a a a a ] 
+                        |[ a a a a a a a a a ]6/9 
                        \octave{ ' }
-                        |[ a a a a a a a a a ] 
+                        |[ a a a a a a a a a ]6/9 
                        \octave { ` } 
-                        [ `c `g d a 'e 'b ''f '''c '''g ] 
-                        [ '''g '''c ''f 'b 'e a d `g `c ] 
+                        [ `c `g d a e' b' f'' c''' g''' ]6/9
+                        [ g''' c''' f'' b' e' a d `g `c ]6/9
                        \octave{ ' }
-                        [ `c `g d a 'e 'b ''f '''c '''g ] 
-                        [ '''g '''c ''f 'b 'e a d `g `c ] 
+                        [ `c `g d a e' b' f'' c''' g''' ]6/9
+                        [ g''' c''' f'' b' e' a d `g `c ]6/9
                        \octave { } 
-                        [ c g 'd ]2/3 
-                        [ 'd g c ]2/3  
-                        [ f 'c 'g ]2/3 
-                        [ 'g 'c f ]2/3  
+                        [ c g d' ]2/3 
+                        [ d' g c ]2/3  
+                        [ f c' g' ]2/3 
+                        [ g' c' f ]2/3  
                        \octave{ ' }
-                        [ c g 'd ]2/3 
-                        [ 'd g c ]2/3  
-                        [ f 'c 'g ]2/3 
-                        [ 'g 'c f ]2/3 
+                        [ c g d' ]2/3 
+                        [ d' g c ]2/3  
+                        [ f c' g' ]2/3 
+                        [ g' c' f ]2/3 
 
 c1
        \duration { 8}
-       [c-> d-> e-> f->][g-> a-> b-> 'c->] % 1
-\octave{'}     ['c-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^]
-\octave{}      ['c-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^]
-       [c-. d-. e-. f-.][g-. a-. b-. 'c-.]
-       ['c-- b-- a-- g][f-- e-- d c--] % 5
+       [c-> d-> e-> f->][g-> a-> b-> c'->] % 1
+\octave{'}     [c'-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^]
+\octave{}      [c'-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^]
+       [c-. d-. e-. f-.][g-. a-. b-. c'-.]
+       [c'-- b-- a-- g][f-- e-- d c--] % 5
        [c-\portato d-\portato e-\portato f-\portato]
-               [g-\portato a-\portato b-\portato 'c-\portato]
-       ['c-\upbow b-\upbow a-\downbow g-\downbow]
+               [g-\portato a-\portato b-\portato c'-\portato]
+       [c'-\upbow b-\upbow a-\downbow g-\downbow]
                [f-\downbow e-\downbow d-\upbow c-\upbow]
-       [c-| d-| e-| f-|][g-| a-| b-| 'c-|]
-       ['c b a g][f e d c]
-       [c d e f][g a b 'c] % 10 
-       |['c b a g][f e d c]
+       [c-| d-| e-| f-|][g-| a-| b-| c'-|]
+       [c' b a g][f e d c]
+       [c d e f][g a b c'] % 10 
+       |[c' b a g][f e d c]
                        
-               $}
+               }
 }
 
 score {
-       staff {
+       \staff {
        blah
        }
-       paper {
-               symboltables { table_sixteen}
-               unitspace 1.5 cm
-               geometric 1.4
+       \paper {
+               symbol\tables { \table_sixteen}
+               \unitspace 1.5 \cm
+               \geometric 1.4
        }
-       commands  {
-                meter {6*8}
-                skip 36*8
-               meter {4*4}
+       \co\mmands  {
+                \meter {6*8}
+                \skip {36*8}
+               \meter {4*4}
        }
 }
index 67288264718568d53d1f828895e4a45f9a1b7e3f..824591f81f00aafa054342044e6fabae41d5ac86 100644 (file)
 % \metron{4=120}
 %
 % \meter{3/4}
-% \key\F               % key is F ( f-major )
-% \clef\alto           % use alto clef
-% \duration8           % default duration is 'eight note
+% \key\F               % \key is F ( f-major )
+% \clef\alto           % use alto \clef
+% \duration8           % default \duration is eight' note
 %
-% \verb{\nobarnumbers} % issue MusiXTeX command
+% \verb{\no\barnumbers}        % issue MusiXTeX \co\mmand
 % \barnumbering0
 % \slope{30}           % Fool MusiXTeX into 30 / 10 steeper beam
-% \stemlength3         % shorter stemlength
+% \stemlength3         % shorter \stemlength
 %              % because piece is set very tightly
-%%1            % double comments are included in .tex file
-ii_menuetto = music {
-       $\clef"alto"
+%%1            % double co\mments are included in .tex file
+ii_menuetto = \music {
+       \clef"alto"
        \key {bes}
        \octave{}
        \duration{8}
@@ -38,7 +38,7 @@ ii_menuetto = music {
 %      (^ )
        a bes-. g-. ] a4-.^"4" |
 %%3
-%      { d4 `bes4-.\stemup } stemup: 2 voices?
+%      { d4 `bes4-.\stemup } \stemup: 2 \voices?
        { d4 `bes4-. } g4-. [ f-. e-. ] |
 %%4
 %      { f `a } (^ e ) d cis-. `b-. `a-. ]
@@ -49,68 +49,68 @@ ii_menuetto = music {
 %%6
 %      {  bes( e  }  ) a
        { [ bes e } a bes-. g-. ]
-       'c4-. | % ='c4-. |
+       c'4-. | % =c'4-. |
 %%7
        { a4-. f4}
-%      { 'd4-.-\upbow f4 `bes4\stemdown }
-       { 'd4-.-\upbow f4 `bes4 }
-%      { 'e4-.-\downbow g4 `g4\stemdown } |
-       { 'e4-.-\downbow g4 `g4 } |
+%      { d'4-.-\upbow f4 `bes4\stemdown }
+       { d'4-.-\upbow f4 `bes4 }
+%      { e'4-.-\downbow g4 `g4\stemdown } |
+       { e'4-.-\downbow g4 `g4 } |
 %%8
-%      { 'cis2.-\upbow e2. `a2.\stemdown } :|:%%sorry!!
-       { 'cis2.-\upbow e2. `a2. } \bar ":|:"%%!! sorry!
+%      { cis'2.-\upbow e2. `a2.\stemdown } :|:%%sorry!!
+       { cis'2.-\upbow e2. `a2. } \bar ":|:"%%!! sorry!
 %%9
        \clef "violin"
-%      { 'e2 a2_f\stemdown }
-       { 'e2 a2_"\f" }
-       [ 'd( 'e16 )'f16 ] |
+%      { e'2 a2_f\stemdown }
+       { e'2 a2_"\f" }
+       [ d'( e'16 )f'16 ] |
 %%10
-%      [ { 'e( g } ) 'd 'cis_{ }_{ }_2 'e
-       { [ 'e g } 'd 'cis_"2" 'e a( )g ] |
+%      [ { 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 }
-       { \multivoice \music {\stem{1} a4(\stem{1}) 'd4 'cis4-. } \music { \stem{-1} f2 e4 } } |
+%      { a4\stemup( f2\stemdown } ) d'4\stemup
+%      { cis'4\stemup-. e4\stemdown }
+       { \multi\voice \\music {\stem{1} a4(\stem{1}) d'4 cis'4-. } \\music { \stem{-1} f2 e4 } } |
 %%12
-%      { 'g^4 d\stemdown } (^  'f 'e ) 'f 'd^3(^ ) ='c ] |
-       { [ 'g^"4" d } 'f 'e 'f 'd^"3"( ) 'c ] |
+%      { 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 } |
+%      { c'4\stemup e4\stemdown }
+%      { bes2 g4 } f4 { c'4 e4 } |
        \clef "alto"% 
-       { \multivoice
-               \music { \stem{1} bes2 'c4 }
-               \music { \stem{-1} g4(\stem{-1}) f4 e4 }% ugh
+       { \multi\voice
+               \\music { \stem{1} bes2 c'4 }
+               \\music { \stem{-1} g4(\stem{-1}) f4 e4 }% ugh
        } |
 %%%14
-%%     [ { a( f } ) g a f ] { 'd4-\upbow e4 `bes4\stemdown } |
-       { [ a f } g a f ] { 'd4-\upbow e4 `bes4 } |
+%%     [ { a( f } ) g a f ] { d'4-\upbow e4 `bes4\stemdown } |
+       { [ a f } g a f ] { d'4-\upbow e4 `bes4 } |
 %%%15
-%%     { 'c4-\downbow f4 `a4\stemdown } [ bes( )a g a ] |
-%      { 'c4-\downbow f4 `a4 } [ bes( )a g a ] |
+%%     { c'4-\downbow f4 `a4\stemdown } [ bes( )a g a ] |
+%      { c'4-\downbow f4 `a4 } [ bes( )a g a ] |
 %%%16
        [ f( e )f a-. g-. bes-. ] |
 %% \tighten            % use one line less
-%% \newline            % start new line
+%% \newline            % \start new line
 %%     |
 %%%17
 %%     { a2^0^\tr fis2_3 } bes4 |
        { a2^"0" fis2_"3" } bes4 |
 %%%18
-%%     [ { 'c( es } ) bes 'c a ] fis4^\tr |
-       { \music{ [ 'c( )bes 'c a ] } \music{ [ es ] } } fis4 |
+%%     [ { c'( es } ) bes c' a ] fis4^\tr |
+       { \\music{ [ c'( )bes c' a ] } \\music{ [ es ] } } fis4 |
 %%%19
-       { 'd4-\downbow g4 `bes4 } { 'c4-\upbow g4 c4 } { [ bes d } a ] |
+       { d'4-\downbow g4 `bes4 } { c'4-\upbow g4 c4 } { [ bes d } a ] |
 %%%20
-%%     [ { 'c( d `g } bes a ) bes g ( ) bes ] |
-       { \music{ [ 'c( bes a )bes g( )bes ] } \music{ [ d ] } \music{ [ g ] } } |
+%%     [ { c'( d `g } bes a ) bes g ( ) bes ] |
+       { \\music{ [ c'( bes a )bes g( )bes ] } \\music{ [ d ] } \\music{ [ g ] } } |
 %%%21
-%%     { 'd4\stemup g2\stemdown } (^ ) 'cis4\stemup { 'd4\stemup =f4\stemdown } |
-       { \multivoice \music {\stem{1}  'd4(\stem{1} ) 'cis4 'd4 } \music { \stem{-1} g2 f4 } } |
+%%     { d'4\stemup g2\stemdown } (^ ) cis'4\stemup { d'4\stemup =f4\stemdown } |
+       { \multi\voice \\music {\stem{1}  d'4(\stem{1} ) cis'4 d'4 } \\music { \stem{-1} g2 f4 } } |
 %%%22
 %%     [ { g(  cis } )f g e ] { f4 d4 } |
-       { \music{ [ g( )f g e ] } \music{ [ cis ] } } { f4 d4 } |
+       { \\music{ [ g( )f g e ] } \\music{ [ cis ] } } { f4 d4 } |
 %%%23
 %%     [ `g g ] { e4.\stemup^\tr `a4.\stemdown } d\stemup-\upbow |
        [ `g g ] { e4. `a4. } d-\upbow |
@@ -119,25 +119,25 @@ ii_menuetto = music {
 %%     { \textstyle "italic" d2.^"fine" `a2. \textstyle "roman" `d2._"3 mins."} | % :||
        { d2.^"fine" `a2. `d2._"3 mins."} \bar ":|" % \bar ":||"
 %% \tighten            % use one line less
-       $
+       
 }
 
 score {
-       staff { 
-               melodic music { ii_menuetto }
+       \staff { 
+               \melodic \music { ii_menuetto }
        }
-       commands {
-               meter {3 * 4}
+       \co\mmands {
+               \meter {3 * 4}
        }
-       paper {
-               symboltables { table_sixteen }
-               width 195mm
-               unitspace 9mm  % to get lily to use only three lines
-               geometric 1.4
-               output "scsii-menuetto.out"
+       \paper {
+               symbol\tables { \table_sixteen }
+               \width 195\mm
+               \unitspace 9\mm  % to get lily to use only three lines
+               \geometric 1.4
+               \output "scsii-menuetto.out"
        }
-       midi { 
-               tempo 4:120
-               output "scsii-menuetto.midi"
+       \midi { 
+               \tempo 4:120
+               \output "scsii-menuetto.\midi"
        }
 }
index 98daf3b69f2501067be93f49630dff386383a7ed..cfd267b80def2bea3099eb81d01ff2005f81ec43 100644 (file)
@@ -4,86 +4,63 @@
 % Franz Schubert (1797-1828)
 % Text by Ludwig Rellstab (1799-1860)
 %
-% Copyright (c) 1995,1996,1997 Jan Nieuwenhuizen <jan@digicash.com>
+% Copyright (c) 1995,1996,1997 Jan Nieuwenhuizen <jandigicash.com>
 % 
 % The purpose of this file is to demonstrate features of LilyPond.
 % (there is an accompanying LaTeX file, standchen.tex)
 %
-% comments with # note missing stuff
-% heu, make that %#%
-%
 % thanks to \music group changing, all notes 
 % (except for grace notes) are printed
 %
-
-%#%%
-%#%\title{St\"andchen}
-%#%\subtitle{Serenade}
-%#%%
-%#%\composer{Franz Schubert}
-%#%\tempo{M\"a\ss ig}
-%#%%
-%#%\meter{3/4}
-%#%\key\F
-%#%\clef\treble
-%#%%
-%#%\barnumbering5
-%#%%\staffnumbers
-%#%\barnumberstyle\boxed
-%#%%
-%#%\staffseparation{12}
-%#%%
-%#%\duration8
 %%1
-melodie = music { $ \clef\violin
+melodie = \music {  \clef\violin
        \key{bes}
-       \duration{ 8 }
-       r\pp { [ d `a-| } f-| { d `a-| } f-| { d `a-| ] } |
+       \meter{3/4}\duration{ 8 }
+       r\pp < [ d `a-| > f-| < d `a-| > f-| < d `a-| ] > |
 %%2
-       r { [ d `bes-| } f-| { d `bes-| } f-| { d `bes-| ] } |
+       r < [ d `bes-| > f-| < d `bes-| > f-| < d `bes-| ] > |
 %%3
        \textstyle "italic"
-       r_"simile" { [ d `bes } e { d `bes } e { d `bes ] }
+       r_"simile" < [ d `bes > e < d `bes > e < d `bes ] >
        \textstyle "roman" |
 %%4
-       r { [ `a cis } e { `a cis } e { `a cis ] } |
+       r < [ `a cis > e < `a cis > e < `a cis ] > |
 %#%:|
 %%5
-       [ a()bes a ]2/3  'd4. a |
+       [ a()bes a ]2/3  d'4. a |
 %%6
-       [ g()a g ]2/3  'd4 g r |
-%#%\tighten
-%#%\newline
+       [ g()a g ]2/3  d'4 g r |
+
 %%7
        a4.^> g  [ g()f e ]2/3  |
 %%8
        f2 r4 |
 %%9
-%      { \music{ 'a4.( )'g  [ 'g( 'f )'e ]2/3  } \music{ 'cis4. 'e_"dolce"  [ 'e ] 2/3 } } |
-       { \music{ 'a4.( )'g  [ 'g( 'f )'e ]2/3  } \music{ 'cis4. 'e_"dolce"  \plet{ 2/3 } 'e \plet{ 1/1 } } } |
+
+       < { a'4.( )g'  [ g'( f' )e' ]2/3  } { cis'4. e'_"dolce"  \plet{ 2/3 } e' \plet{ 1/1 } } > |
 %%10
-       { 'f2. 'd2. } |
+       < f'2. d'2. > |
 %%11
-       [ a\pp( )bes a ]2/3  'f4. a |
+       [ a\pp( )bes a ]2/3  f'4. a |
 %%12
-       [ g( ) a g ]2/3  'e4. 'd |
+       [ g( ) a g ]2/3  e'4. d' |
 %%13
-       'c4. bes  [ bes( ) a g ]2/3  |
+       c'4. bes  [ bes( ) a g ]2/3  |
 %%14
        a2 r 
-%      { \music{ 'd( | )'c4. g  [ bes a g ]2/3  } \music{ f\p( | )e4._"dolce" bes  [ g ]2/3  } } |
-       { \music{ 'd( | )'c4. g  [ bes a g ]2/3  } \music{ f\p( | )e4._"dolce" bes  \plet{ 2/3 } g \plet{ 1/1 }  } } |
+%      < { d'( | )c'4. g  [ bes a g ]2/3  } { f\p( | )e4._"dolce" bes  [ g ]2/3  } > |
+       < { d'( | )c'4. g  [ bes a g ]2/3  } { f\p( | )e4._"dolce" bes  \plet{ 2/3 } g \plet{ 1/1 }  } > |
 %%16
-       { a2. f2. } |
+       < a2. f2. > |
 %%17
        \textstyle "italic"
-       [ a8._"cresc." 'cis16 ] 'f4. 'e
+       [ a8._"cresc." cis'16 ] f'4. e'
        \textstyle "roman" |
 %%18
-       [ 'd8. a16 ] f4. d |
+       [ d'8. a16 ] f4. d |
 %%19
-%#%    'c\grace\stemup
-       [ bes\pp( ) a bes ]2/3  'd4. bes |
+%#%    c'\grace\stemup
+       [ bes\pp( ) a bes ]2/3  d'4. bes |
 %%20
        a2. |
 %%21
@@ -93,109 +70,91 @@ melodie = music { $ \clef\violin
 %#%    =f2. |
        f2. |
 %%23
-       [ a8.\mf 'cis16 ] 'f4. 'e |
+       [ a8.\mf cis'16 ] f'4. e' |
 %%24
-       [ 'd8. a16 ] fis4. d |
+       [ d'8. a16 ] fis4. d |
 %%25
-%#%    'cis\grace\stemup
-       [ b\mf( ) ais b ]2/3 'd4. b |
+       [ b\mf( ) ais b ]2/3 d'4. b |
 %%26
-       { a2. fis2. } |
-%#%\tighten\newline
+       < a2. fis2. > |
 %%27
-       [ 'e\df( )'dis 'e ]2/3 'g4. 'cis |
+       [ e'\df( )dis' e' ]2/3 g'4. cis' |
 %%28
-       { 'd2. fis2. } |
+       < d'2. fis2. > |
 %#%\volta1
 %%29
-       { \music { bes2( [ 'd8.( ))g16 ] } \music{ g2\mf [ bes8. bes16 ] } } |
+       <  { bes2( [ d'8.( ))g16 ] } { g2\mf [ bes8. bes16 ] } > |
 %%30
-       { \music{ a4. [ a-. a-. a-. ] } \music{ fis4. [ fis-.( fis-. )fis-. ] } } |
+       < { a4. [ a-. a-. a-. ] } { fis4. [ fis-.( fis-. )fis-. ] } > |
 %%31  
-       { \music{ a4. [ a-. a-. a-. ] } \music{ g4. [ cis-.( e-. )g-. ] } } |
+       < { a4. [ a-. a-. a-. ] } { g4. [ cis-.( e-. )g-. ] } > |
 %%32
-       { a2 fis2\pp } { a4 fis4 } |
+       < a2 fis2\pp > < a4 fis4 > |
 %%33
-%#%    { b2(^ g2 } [v { 'd8.( b8. } { b16 ) ) g16 } ] |
-       { \music{ b2( [ 'd8.( ) )g16 ] } \music{ g2 [ b8. b16 ] } } |
+       < { b2( [ d'8.( ) )g16 ] } { g2 [ b8. b16 ] } > |
 %%34
-%#%    { a4. fis4. } [ { a-. fis-.( } { a-. fis-. } { a-. ) fis-. } ] |
-%      { a4. fis4. } { [ a-. fis-. } { a-. fis-. } { a-. fis-. ] } |
-       { \music{ a4. [ a-. a-. a-. ] } \music{ fis4. [ fis-.( fis-. )fis-. ] } } |
+       < { a4. [ a-. a-. a-. ] } { fis4. [ fis-.( fis-. )fis-. ] } > |
 %%35
-%#%    { a4. g4. } [ { a cis-.( } { a e-. } { a )- g-. } ] |
-%      { a4. g4. } { [ a cis-. } { a e-. } { a g-. ] } |
-       { \music{ a4. [ a-. a-. a-. ] } \music{ g4. [ cis-.( e-. )g-. ] } } |
+       < { a4. [ a-. a-. a-. ] } { g4. [ cis-.( e-. )g-. ] } > |
 %%36
-       { a2. fis2. } |
+       < a2. fis2. > |
 %#%\volta2
 %#%:|
 %%37
-       [ a8. a16 ] [ 'cis8. 'cis16 ] [ 'e8. 'e16 ] |
+       [ a8. a16 ] [ cis'8. cis'16 ] [ e'8. e'16 ] |
 %%38
-       'd4( )'cis4 r4 |
+       d'4( )cis'4 r4 |
 %%39
-%#%    > a4. [ 'cis 'e8. >! 'd16 ] |
-       a4. [ 'cis 'e8. 'd16 ] |
+%#%    > a4. [ cis' e'8. >! d'16 ] |
+       a4. [ cis' e'8. d'16 ] |
 %%40
-       'cis2 r4 |
+       cis'2 r4 |
 %%41
-%#%    { > 'fis4. 'cis4._f } 'e [ 'e( ) 'd >! 'cis ]  |
-       { 'fis4. 'cis4.\df } 'e  [ 'e( )'d 'cis ]2/3  |
+       < fis'4. cis'4.\df > e'  [ e'( )d' cis' ]2/3  |
 %%42
-       [ b8. 'cis16 ] 'd4^> b r |
+       [ b8. cis'16 ] d'4^> b r |
 %%43
-%#%    [^ { b8._{ }_{ }_{ }_{ }_{ }_f g2. } 'cis16 ] 'd4^> b r |
-       [ b8.\df 'cis16 ] 'd4^> b r |
+
+       [ b8.\df cis'16 ] d'4^> b r |
 %%44
-%#%    [^ { > b8. fis2 } 'cis16 ] 'd4^> b >! r |
-       [ b8. 'cis16 ] 'd4^> b r |
+       [ b8. cis'16 ] d'4^> b r |
 %%45
-%#%    'cis\grace\stemup
-       [ b\p( )ais b ]2/3  'd4. b |
+       [ b\p( )ais b ]2/3  d'4. b |
 %%46
 %#%    { =a2. fis2. } |
-       { a2. fis2. } |
+       < a2. fis2. > |
 %%47
-       [ 'e\df( )'dis 'e ]2/3  'g4.^> 'cis |
+       [ e'\df( )dis' e' ]2/3  g'4.^> cis' |
 %%48
-%#%    { fis2.(v ='d2.\stemup(^ }
-%      { fis2. 'd2. } |
-%%49
-%#%    { ) 'd4 ) =f2._> } { r4 s4_{decr} } 'd4\stemup
        \textstyle "italic"
-       { \multivoice \music{ \stem{ 1 } fis2.( | \stem{ -1 } )f2. } \music { \stem{ 1 } 'd2.( | \stem{ 1 } )'d4 r4_"decresc." 'd4 } }
+       < \multivoice { \stem{ 1 } fis2.( | \stem{ -1 } )f2. }  { \stem{ 1 } d'2.( | \stem{ 1 } )d'4 r4_"decresc." d'4 } >
        \textstyle "roman" |
 %%50
-       { bes2. e2. } |
+       < bes2. e2. > |
 %%51
-       { a2. cis2. } |
+       < a2. cis2. > |
 %%52
-       { fis2 d2 } { a4 fis4\pp } |
+       < fis2 d2 > < a4 fis4\pp > |
 %%53
-%#%    { bes2 g2 } [ { 'd8.^>( bes8. } { ) bes16 g16 } ] |
-       { bes2 g2 } { [ 'd8.^> bes8. } { bes16 g16 ] } |
+
+       < bes2 g2 > < [ d'8.^> bes8. > < bes16 g16 ] > |
 %%54
-%#%    { a4. fis4. } [ { a-. fis-.( } { a-. fis-. } { a-. ) fis-. } ] |
-%      { a4. fis4. } { [ a-. fis-. } { a-. fis-. } { a-. fis-. ] } |
-       { \music{ a4. [ a-. a-. a-. ] } \music{ fis4. [ fis-.( fis-. )fis-.] } } |
+       < { a4. [ a-. a-. a-. ] } { fis4. [ fis-.( fis-. )fis-.] } > |
 %%55
-%#%    { a4. g4. } [ { a cis-.( } { a e-. } { a )- g-. } ]  |
-%      { a4. g4. } { [ a cis-. } { a e-. } { a g-. ] } |
-       { \music{ a4. [ a-. a-. a-. ] } \music{ g4. [ cis-.( e-. )g-. ] } } |
+       < { a4. [ a-. a-. a-. ] } { g4. [ cis-.( e-. )g-. ] } > |
 %%56
        \textstyle "italic"
-       { a2. fis2._"dim." }
+       < a2. fis2._"dim." >
        \textstyle "roman" |
 %%57
-       { a2. fis2. } |
+       < a2. fis2. > |
 %%58
-       { a2.^\fermata fis2. } |
+       < a2.^\fermata fis2. > |
 %#%\tighten
-$ }
+ }
 
-begeleiding = music { $
-       \key{bes}
+begeleiding = \music { 
+       \key{bes}\meter{3/4}
        \clef\bass
        \duration{2}
        `d r4 |
@@ -209,60 +168,55 @@ begeleiding = music { $
        ``a r4 |
 %#%:|
 %%5
-%#%\stemlength2
 \duration{ 8 }
-%#%    { =`f `d2 } `a d `a { d r4 } `a
-       { \multivoice \music{ \stem{ 1 } [ `f `a d `a d `a ] } \music { \stem{ -1 } `d2 r4 } } |
+       < \multivoice { \stem{ 1 } [ `f `a d `a d `a ] }  { \stem{ -1 } `d2 r4 } > |
 %%6
-       { \multivoice \music{ \stem{ 1 } [ `d `e `g `e `g `e ] } \music { \stem{ -1 } ``bes2 r4 } } |
+       < \multivoice { \stem{ 1 } [ `d `e `g `e `g `e ] }  { \stem{ -1 } ``bes2 r4 } > |
 %%7 
-       { \multivoice \music{ \stem{ 1 } [ `cis `e `g `e `g e ] } \music { \stem{ -1 } ``a2 r4 } } |
+       < \multivoice { \stem{ 1 } [ `cis `e `g `e `g e ] }  { \stem{ -1 } ``a2 r4 } > |
 %%8
-       { \multivoice \music{ \stem{ 1 } [ `d `a d `a d `a ] } \music { \stem{ -1 } `d2 r4 } } |
+       < \multivoice { \stem{ 1 } [ `d `a d `a d `a ] }  { \stem{ -1 } `d2 r4 } > |
 %%9
        [ `a e g e g e ] |
 %%10
        [ `d `a d `a d `a ] |
 %%11
-       { \multivoice \music{ \stem{ 1 } [ `f `a d `a d `a ] } \music { \stem{ -1 } `d2 r4 } } |
+       < \multivoice { \stem{ 1 } [ `f `a d `a d `a ] }  { \stem{ -1 } `d2 r4 } > |
 %%12 == 6
-       { \multivoice \music{ \stem{ 1 } [ `d `e `g `e `g `e ] } \music { \stem{ -1 } ``bes2 r4 } } |
+       < \multivoice { \stem{ 1 } [ `d `e `g `e `g `e ] }  { \stem{ -1 } ``bes2 r4 } > |
 %13
-       { \multivoice \music{ [ `e `g `bes `g `bes `g ] } \music { \stem{ -1 } `c2 r4 } } |
+       < \multivoice { [ `e `g `bes `g `bes `g ] }  { \stem{ -1 } `c2 r4 } > |
 %%14
-       { \multivoice \music{ \stem{ 1 } [ `a c f c f c ] } \music { \stem{ -1 } `f2 r4 } } |
+       < \multivoice { \stem{ 1 } [ `a c f c f c ] }  { \stem{ -1 } `f2 r4 } > |
 %%15
        [ `c `g `bes `g `bes `g ] |
 %%16
        [ ``f `c `f `c `f `c ] |
 %%17
-       { \multivoice \music{ \stem{ 1 } [ ``a `e `g `e `g `e ] } \music { \stem{ -1 } ``a2 r4 } } |
+       < \multivoice { \stem{ 1 } [ ``a `e `g `e `g `e ] }  { \stem{ -1 } ``a2 r4 } > |
 %%18
-       { \multivoice \music{ \stem{ 1 } [ `d `a d `a d `a ] } \music { \stem{ -1 } `d2 r4 } } |
+       < \multivoice { \stem{ 1 } [ `d `a d `a d `a ] }  { \stem{ -1 } `d2 r4 } > |
 %%19
-       { \multivoice \music{ \stem{ 1 } [ ``bes `f `bes `f `bes `f ] } \music { \stem{ -1 } ``bes2 r4 } } |
+       < \multivoice { \stem{ 1 } [ ``bes `f `bes `f `bes `f ] }  { \stem{ -1 } ``bes2 r4 } > |
 %%20
-       { \multivoice \music{ \stem{ 1 } [ ``f `c `f `c `f `c ] } \music { \stem{ -1 } ``f2 r4 } } |
+       < \multivoice { \stem{ 1 } [ ``f `c `f `c `f `c ] }  { \stem{ -1 } ``f2 r4 } > |
 %%21
-%#%    s8               % skip space of grace note
-       { [ `e `c } `g c `g c `g ] |
+       < [ `e `c > `g c `g c `g ] |
 %%22
        [ `f `a c `a `f `c ] |
 %%23
-       { \multivoice \music{ \stem{ 1 } [ ``a `e `g `e `g `e ] } \music { \stem{ -1 } ``a2 r4 } } |
+       < \multivoice { \stem{ 1 } [ ``a `e `g `e `g `e ] }  { \stem{ -1 } ``a2 r4 } > |
 %%24
-       { \multivoice \music{ \stem{ 1 } [ `d `fis `a `fis `a `fis ] } \music { \stem{ -1 } `d2 r4 } } |
+       < \multivoice { \stem{ 1 } [ `d `fis `a `fis `a `fis ] }  { \stem{ -1 } `d2 r4 } > |
 %%25
-%#%    s8               % skip space of grace note
-       { \multivoice \music{ \stem{ 1 } [ ``g `d `b `d `b `d ] } \music { \stem{ -1 } ``g2 r4 } } |
+       < \multivoice { \stem{ 1 } [ ``g `d `b `d `b `d ] }  { \stem{ -1 } ``g2 r4 } > |
 %%26
-       { \multivoice \music{ \stem{ 1 } [ `d `a d `a d `a ] } \music { \stem{ -1 } `d2 r4 } } |
+       < \multivoice { \stem{ 1 } [ `d `a d `a d `a ] }  { \stem{ -1 } `d2 r4 } > |
 %%27
-       { [ `cis ``a } `e `a `e `a `e ] |
+       < [ `cis ``a > `e `a `e `a `e ] |
 %%28
        [ `d `a d `a d `a ] |
 %%29
-%#%    [ `d `g @ `bes `g `bes `g ] |
        [ `d `g `bes `g `bes `g ] |
 %#%\volta1
 %%30 
@@ -284,26 +238,25 @@ begeleiding = music { $
 %%37
        [ ``a `e `g `e ``bes^> `e ] |
 %%38
-       [ ``a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] }  |
+       [ ``a < e cis `a > < e cis `a > < e cis `a > < e cis `a > < e cis `a ] >  |
 %%39
        [ ``a `e `g `e ``bes^> `e ] |
 %%40
-       [ ``a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] }  |
+       [ ``a < e cis `a > < e cis `a > < e cis `a > < e cis `a > < e cis `a ] >  |
 %%41
        [ ``ais `e `fis `e `fis `e ] |
 %%42
-       { [ `d ``b } `fis `b `fis `b `fis ] |
+       < [ `d ``b > `fis `b `fis `b `fis ] |
 %%43
-       { [ `e ``b } `g `b `g `b `g ] |
+       < [ `e ``b > `g `b `g `b `g ] |
 %%44
-       { [ `d ``b } `fis `b `fis `b `fis ] |
+       < [ `d ``b > `fis `b `fis `b `fis ] |
 %%45
-%#%    s8               % skip space of grace note
-       { \multivoice \music{ \stem{ 1 } [ ``g `d `b `d `b `d ] } \music { \stem{ -1 } ``g2 r4 } } |
+       < \multivoice { \stem{ 1 } [ ``g `d `b `d `b `d ] }  { \stem{ -1 } ``g2 r4 } > |
 %%46
-       { \multivoice \music{ \stem{ 1 } [ `d `a d `a d `a ] } \music { \stem{ -1 } `d2 r4 } } |
+       < \multivoice { \stem{ 1 } [ `d `a d `a d `a ] }  { \stem{ -1 } `d2 r4 } > |
 %%47
-       { [ `cis ``a } `e `a `e `a `e ] |
+       < [ `cis ``a > `e `a `e `a `e ] |
 %%48
        [ `d `fis `a `fis `a `fis ] |
 %%49
@@ -325,12 +278,12 @@ begeleiding = music { $
 %%57
        [ ``d ``a `d ``a `d ``a ]
 %%58
-       { `d2.^\fermata ``d2. } |
-$ }
+       < `d2.^\fermata ``d2. > |
+ }
 
 
-tekst1 = music {
-       @
+tekstI = \lyrics {
+       \meter{3/4}
        \duration{4}
        _ _ _
        _ _ _
@@ -393,11 +346,11 @@ tekst1 = music {
        _ _ _ _ _ _
 % 57
        _ _ _ _ _ _ 
-       @
+       
 }
 
-tekst2 = music {
-        @
+tekstII= \lyrics {
+        \meter{3/4}
        \duration{4}
        _ _ _
        _ _ _
@@ -457,36 +410,35 @@ tekst2 = music {
 %      _ _ _ _ _ _
 % 57
 %      _ _ _ _ _ _ 
-       @
+       
 }
 
-score {
-       staff { 
+\score {
+       \staff { 
                lyric 
-       music { tekst1 }
-       music { tekst2 }
-       }
-       staff { 
-               melodic 
-               music { melodie }
-       }
-       staff { 
-               melodic 
-               music { begeleiding }
+       \music { tekstI }
+       \music { tekstII }
        }
-       commands { 
-               meter {3*4}
+% Setting up music ...lilypond: ../flower/include/cursor.inl:98: class Cursor<void *> Cursor<void *>::operator ++(int): Assertion `pointer_' failed.
+%IOT trap/Abort
+%              \music { melodie }
+       \staff { 
+               \melodic 
+       \music { begeleiding }
+               }
+       \staff { 
+               \melodic 
+               \music { begeleiding }
        }
-       paper {
-               symboltables { table_sixteen }
-               width 195mm
+       \paper {
+               \width 195\mm
 
                % on two pages...
-               unitspace 9mm
-               geometric 1.2
-               output "standchen.out"
+               \unitspace 9\mm
+               \geometric 1.2
+               \output "standchen.out"
        }
-       midi {
-               tempo 4:54
+       \midi {
+               \tempo 4:54
        }
 }
index 035854e84676b2efaeb41e76ab3e945ec6e90ddf..c54fdea03957736f4c38cfe8ddd20c8bf8cf17c4 100644 (file)
@@ -4,73 +4,71 @@
 % 
 % Copyright: none
 
-melodie = music {
-       $\clef\violin
+melodie = \music {
+       \clef\violin
        c c | g g | a a | g g |
        f f | e e | d d8.( e16 | )c2 | % :|
 
        g g | f f | e e | d d |
-%      g g | f f | e( [f0*32 e0*32 d0*32] e8. f16 | e )d | c c | 
        g g | f f | e( e8. f16 | e )d |
 
        c c | g g | a a | g g |
        f f | e e | d d8.( e16 | )c2 % :|
        \bar ":|"
-       $
+       
 }
 
-begeleiding = music {
-       $\clef \bass
+begeleiding = \music {
+       \clef \bass
        \octave{`}
-       c 'c | 'e 'c | 'f 'c | 'e 'c | 
-       'd b | 'c a | f g | c2 | 
+       c c' | e' c' | f' c' | e' c' | 
+       d' b | c' a | f g | c2 | 
 
-       'e g | d g | 'c g | b g | 
-%      'e g | 'd g | 'c 'c8.( 'd16 | \voice{ 'c )b } \voice{ g2 } |
-       'e g | 'd g | 'c 'c8.( 'd16 | 'c )b |
+       e' g | d g | c' g | b g | 
+       e' g | d' g | c' c'8.( d'16 | c' )b |
 
-       c 'c | 'e 'c | 'f 'c | 'e 'c | 
-       'd b | 'c a | f g | c2 
+       c c' | e' c' | f' c' | e' c' | 
+       d' b | c' a | f g | c2 
        \bar ":|"
-       $
+       
 }
-
-tekst = music { 
-       @ 
+globalmusic=\music{
+               \meter {2 / 4}
+               \skip {24*2}
+               \bar "||"
+       }
+tekst = \lyrics { 
        Al- tijd is Kort- jak- je ziek,2
-       midden in_de week maar 's_zon- dags niet.2
-       's_Zon- dags gaat ze naar de kerk,2
+       midden in_de week maar s'_zon- dags niet.2
+       s'_Zon- dags gaat ze naar de kerk,2
        met een boek vol zil- ver werk.2
        Al- tijd is Kort- jak- je ziek,2
-       midden in_de week maar 's_zon- dags niet.2
-       @
+       midden in_de week maar s'_zon- dags niet.2
 }
 
-he_gedraagje_tekst = music { 
-       @ 
+hegedraagjetekst = \lyrics { 
        Al- tijd zuigt Bill Gates mijn piek,2
        "\TeX" is slecht- ser dan mu- ziek.2
-       's_Zon- dags gaat het door een raam,2
+       s'_Zon- dags gaat het door een raam,2
        Weet dat ik me er- voor schaam.2
        Al- tijd zuigt Bill Gates mijn piek,2
        "\TeX" is slecht- ser dan mu- ziek.2
-       @
 }
 
-texte = music { 
-       @ 
+texte = \lyrics { 
+        
        \textstyle "italic" 
        Ah! vous dir- ai_- je ma man2
        Ce qui cau- se mon tour- ment2
        Pa- pa veut que je rai- sonne2
-       Comme un- e grand- e per- sonne2
+       Co\mme un- e grand- e per- sonne2
        Moi je dis que les bon- bons2
        Val- ent mieux que la rai- son2
-       @
+       
 }
 
-text1 = music {
-       @
+textI = \lyrics {
+       
        \textstyle "roman"
        Twin- kle, twin- kle, lit- tle star,2
        How I won- der what you are.2
@@ -78,11 +76,11 @@ text1 = music {
        Like a dia- mond in the sky.2
        Twin- kle, twin- kle, lit- tle star,2
        How I won- der what you are!2
-       @
+       
 }
 
-text2 = music {
-       @
+textII = \music {
+       
        \textstyle "roman"
        When the bla- zing sun is gone,2
        When he no- thing shines up- on,2
@@ -90,11 +88,11 @@ text2 = music {
        Twin- kle, twin- kle, all the night.2
        Twin- kle, twin- kle, lit- tle star,2
        How I won- der what you are!2
-       @
+       
 }
 
-text3 = music {
-       @
+textIII = \lyrics{
+       
        \textstyle "roman"
        Then the tra- veler in the dark2
        Thanks you for your ti- ny spark;2
@@ -102,61 +100,63 @@ text3 = music {
        If you did not twin- kle so.2
        Twin- kle, twin- kle, lit- tle star,2
        How I won- der what you are!2
-       @
+       
 }
 
-mstaf = staff {
-       melodic
-       music { melodie }
+mstaf = \staff {
+       \melodic
+       \music { melodie }
+       \music { globalmusic }
 }
 
-bass_staf = staff {
-       melodic 
-       music { begeleiding }
+bassstaf = \staff {
+       \melodic        
+       \music { begeleiding }
+       \music { globalmusic }
 }
 
 
-dutch_staf = staff {
+dutchstaf = \staff {
        lyric 
-       music { tekst }
-       music {he_gedraagje_tekst}
+       \music { tekst }
+       \music {hegedraagjetekst}
+       \music { globalmusic }
 }
 
-french_staf = staff {
+frenchstaf = \staff {
        lyric 
-       music { texte }
+       \music { texte }
+       \music { globalmusic }
 }
 
-english_staf = staff {
+englishstaf = \staff {
        lyric 
-       music { text1 }
-       music { text2 }
-       music { text3 }
+       \music { textI }
+       \music { textII }
+       \music { textIII }
+       \music { globalmusic }
 }
 
-tstaf = staff { 
+tstaf = \staff { 
        lyric 
-       music { tekst }
-       music { texte }
+       \music { tekst }
+       \music { texte }
+       \music { globalmusic }
 }
 
 
-score {
-       staff { mstaf }
-       staff { dutch_staf }
-       staff { french_staf }
-       staff { english_staf }
-       staff { bass_staf }
-       paper {
-               unitspace 2.5cm
-       }
-       commands {
-               meter {2 * 4}
-               skip {24*2}
-%              bar "||"
+\score {
+       \staff { mstaf }
+       \staff { dutchstaf }
+       \staff { frenchstaf }
+       \staff { englishstaf }
+       \staff { bassstaf }
+       \paper {
+               \unitspace 2.5\cm
        }
-       midi { 
-               tempo 4:120 
+       
+       \midi { 
+               \tempo 4:120 
        }
 }
 
index 32de885acf3508014610420c8d538980c678bc84..921cdbb983f4fa34c1122b205f1ed9ed35fd2f36 100644 (file)
@@ -1,26 +1,29 @@
 % JS Bach, Das Wohltemperirtes Clavier I, Fuga II (c-minor)
 %
-% a 7 bar fragment
+% a 7 \bar fragment
 %
 %      Public Domain -- typed by by HWN
 %
+global=\music{\meter {4/4}
+               \grouping {2*2}
+               \key {bes es as}}
 
-dux = music { $
+dux = \music { 
        \clef \violin
        \duration { \last }
        
         r8-"dux"       \stem{-1}
-       ['c16 b] ['c8 g] [as 'c16 b] ['c8 'd] |
-       [g 'c16 b] ['c8 'd] [f16 g] as4 [g16 f] |
-       [es 'c b a] [ g f es d] [c8 'es 'd 'c] |
-       [bes a bes 'c] [fis g a fis] |
+       [c'16 b] [c'8 g] [as c'16 b] [c'8 d'] |
+       [g c'16 b] [c'8 d'] [f16 g] as4 [g16 f] |
+       [es c' b a] [ g f es d] [c8 es' d' c'] |
+       [bes a bes c'] [fis g a fis] |
        g4 r16 [c d es] [f g as8(] [)as16 d es f ]|
-       [g a bes8(] [)bes16 es f g ] [as g f es] [d8 'c16 b]|
-       'c4 r4 r8 ['f 'es 'd
+       [g a bes8(] [)bes16 es f g ] [as g f es] [d8 c'16 b]|
+       c'4 r4 r8 [f' es' d'
        r8 [as g f] [g f16 es] [f8 d] | 
-$}
+}
 
-comes = music { $
+comes = \music { 
        \octave {'}
        r1      \stem{1}
  |
@@ -32,9 +35,9 @@ comes = music { $
        [) f8 es16 d] [c16 `bes `as `g] [`f8 as g f] 
        [es d es f] [`b c d `b] |
        
-$}
+}
 
-bassdux = music { $
+bassdux = \music { 
        \clef \bass
        \octave { }
        r1 |
@@ -45,31 +48,26 @@ bassdux = music { $
        r1 |
        r8 [c16 B] [c8 G] [As c16 B] [c8 d] |
        [G c16 B] [c8 d] [F16 G] As4 [G16 F] | 
-$}
+}
 
-trebstaf = staff { melodic
-               % every "music {} " in a staff has its own "voicegroup"
-               music { dux }
-               music { comes }
-               
+trebstaf = \staff { \melodic
+               % every "\music {} " in a \staff has its own "\voicegroup"
+               \music { dux }
+               \music { comes }
+       \music{global}  
        }
 
-basstaf = staff { melodic
-       music { bassdux }
+basstaf = \staff { \melodic
+       \music { bassdux }
+       \music{global}  
 }
-
-score {
-       staff { trebstaf }
-       staff { basstaf }
+\score {
+       \staff { trebstaf }
+       \staff { basstaf }
        
-       commands {
-               meter {4*4}
-               grouping {2*2}
-               key {$bes es as$}
-       }
-       paper {}
-       midi {
-               tempo 4:90
+       \paper {}
+       \midi {
+               \tempo 4:90
        }
 }
 
index 8676c37760db960a4e65ff720875613ac9c673d6..497b93d8a880f3aea7c5d9da5231366e54ebc784 100644 (file)
@@ -16,17 +16,13 @@ depth = ..
 # generic variables:
 #
 include ./$(depth)/make/Variables.make 
+include ./$(depth)/make/Files.make
+include ./$(depth)/make/Version.make 
 #
 
 # identify module:
 #
 NAME = lily
-MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
-MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
-PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = $(lily-dir)/$(outdir)/.build
 #
 
 # descent order into subdirectories:
@@ -39,24 +35,9 @@ SUBDIRS = include
 VERSION_DEPENDENCY =#
 #
 
-# list of c++ header files:
-# 
-HHFILES = $(shell ls *.hh $(ERROR_LOG))
-#
-
-# list of c++ source files:
-#
-CCFILES = $(shell ls *.cc $(ERROR_LOG))
-#
-
-# list of other source files:
-#
-EXTRA_SOURCE_FILES = # $(shell ls *.y *.l $(ERROR_LOG))
-#
-
 # list of distribution files:
 #
-DISTFILES = Makefile $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
+DISTFILES = Makefile $(ALL_SOURCES)
 #
 
 # list of custom libraries:
@@ -86,7 +67,7 @@ include ./$(depth)/make/Rules.make
 
 # list of depend files:
 #
-DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+
 #
 
 # auto dependencies:
index 7477d7a316d901f978833edac92eaf9a631e06f0..43a98084f3ca4e548a45ec90bd5c90ca11531bf0 100644 (file)
@@ -8,16 +8,10 @@ depth = ../..
 # identify module:
 #
 MODULE_NAME = lilypond
-MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
-MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
-PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = ./$(depth)/lily/$(outdir)/.build
-#
 
 # generic stuff/Makefile
 #
+
 include ./$(depth)/make/Include.make
-#
+
 
index 10eeb0d37d8d184c2afaac4afd28f10a685cb49f..04e19c9ac82ec8b8bfdb21a05b685c6398749d8e 100644 (file)
@@ -1,4 +1,8 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 0
-PATCH_LEVEL = 41
-MY_PATCH_LEVEL=
\ No newline at end of file
+PATCH_LEVEL = 42
+# use to send patches, always empty for released version:
+# include separator: ".postfix", "-pl" makes rpm barf
+
+MY_PATCH_LEVEL =.2
+#
index 96a523cb95320ea83a70a7a25224d66e091c7adc..1bc1595cc593e87f3a73c75e3e652fbb525e5d7a 100644 (file)
@@ -1,4 +1,3 @@
-#
 # project  LilyPond -- the musical typesetter
 # title           makefile for lilypond
 # file    lily/Makefile 
@@ -15,18 +14,16 @@ depth = ..
 
 # generic variables:
 #
-include ./$(depth)/make/Variables.make 
+include ./$(depth)/make/Variables.make
+include ./$(depth)/make/Files.make 
+include .version
+
 #
 
 # identify module:
 #
 NAME = lilypond
-MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
-MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
-PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = $(lily-dir)/$(outdir)/.build
+
 #
 
 # descent order into subdirectories:
@@ -39,30 +36,16 @@ SUBDIRS = include
 VERSION_DEPENDENCY = $(lily-version)
 #
 
-# list of c++ header files:
-# 
-HHFILES := $(wildcard *.hh) #$(shell ls *.hh $(ERROR_LOG))
-#
-
-# list of c++ source files:
-#
-CCFILES := $(wildcard *.cc) #$(shell ls *.cc $(ERROR_LOG))
-#
-
-# list of other source files:
-#
-EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
-#
 
 # list of distribution files:
 #
-DISTFILES = .version Makefile $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
+DISTFILES = .version Makefile $(ALL_SOURCES)
 #
 
 # list of custom libraries:
 #
 # yes, i know about the -L and -l options,
-# but these libraries get rebuild when needed.
+# but these libraries get rebuilt when needed.
 CUSTOMLIBES = $(LIBLILY) $(LIBFLOWER)
 
 LOADLIBES +=
@@ -84,19 +67,15 @@ include ./$(depth)/make/Targets.make
 include ./$(depth)/make/Rules.make
 #
 
-# explicit dependencies: (how to do auto?)
-#
-# ugh
-#$(outdir)/version.cc: check-flower-version $(lily-version)
-
-
-mylexer.cc: $(outdir)/parser.hh # sic
+# force these: Make can't know these have to be generated in advance
+mylexer.cc: $(outdir)/parser.hh
 lexer.l: $(outdir)/parser.hh
+
 #
 
 # list of depend files:
 #
-DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+DEPFILES = $(wildcard $(depdir)/*.dep)
 #
 
 # auto dependencies:
index 87e9114caf10d9355732fe32d64c5f7a3e40361d..9a07bcc6142979e35ba484c9cb0b3fa63e5ee86d 100644 (file)
@@ -24,10 +24,10 @@ struct Stem_info {
 
     
     Stem_info(){}
-    Stem_info(const Stem*);
+    Stem_info(Stem const *);
 };
 
-Stem_info::Stem_info(const Stem*s)
+Stem_info::Stem_info(Stem const *s)
 {
     x = s->hindex();
     int dir = s->dir;
index 791b72408347d00bc3f8fad4dfaa4738b1db2337..b4775721bb42992e7bb07ed9d7c8c32c31c838a1 100644 (file)
@@ -65,7 +65,7 @@ Clef_register::try_request(Request * r_l)
 void
 Clef_register::process_requests()
 {
-    const Time_description *time_l = get_staff_info().time_c_l_;
+    Time_description const *time_l = get_staff_info().time_c_l_;
     if (!clef_req_l_ && (!time_l->whole_in_measure_|| !time_l->when_)) {
        clef_p_ = new Clef_item;
        clef_p_->change = false;
index 769d522ba5080949371dbb1e59b7bcd8282bc7ac..7e33d78a9dd67493fc0000041b7bbad45b710ab6 100644 (file)
@@ -25,7 +25,7 @@ Cadenza_req::Cadenza_req(bool b)
 
 
 int
-Bar_req::compare(const Bar_req &c1)const
+Bar_req::compare(Bar_req const &c1)const
 {
     return type_str_ == c1.type_str_;
 }
index 9489ae9a1eef6d7f1e66275776037c1badf93d24..9e5fc2cea0abaa8186fc6f80f155ae092e0d9a62 100644 (file)
@@ -7,7 +7,7 @@ Real
 parse_dimen(String dim)
 {
     int i=dim.length_i()-1;
-    const char *s = dim;
+    char const *s = dim;
     while  (i > 0 && (isspace(s[i]) || isalpha(s[i])) ){
        i--;
     }
index 805cb3bebb34f9a163b51aefee0886a2552e146d..8437aabe223eacb46b094b317d9cc43be68f23bb 100644 (file)
@@ -14,7 +14,7 @@ Idealspacing::print() const
 #endif
 }
 
-Idealspacing::Idealspacing(const PCol * l,const PCol * r)
+Idealspacing::Idealspacing(PCol const * l,PCol const * r)
 {
     space = 0.0;
     hooke = 0.0;
index e4712f8a5a9e8b630a98bf52c952679c085c0112..c3de1d3987e28ca5f39958759f1429b4a718d538 100644 (file)
 #include "lexer.hh"
 #include "debug.hh"
 
+#include "input-score.hh" 
+#include "symtable.hh"
+#include "input-staff.hh"
+#include "input-music.hh"
+#include "lookup.hh"
+#include "script-def.hh"
+#include "request.hh"
+
 void
 Identifier::error(String expect)
 {
@@ -42,6 +50,7 @@ DEFAULT_PRINT(Staff_id, Input_staff, staff);
 DEFAULT_PRINT(M_chord_id, Music_general_chord, mchord);
 DEFAULT_PRINT(M_voice_id, Music_voice, mvoice);
 DEFAULT_PRINT(Request_id, Request, request);
+DEFAULT_PRINT(Score_id, Input_score, score);
 void
 Real_id::do_print() const
 {
@@ -49,3 +58,28 @@ Real_id::do_print() const
     mtor << *((Real_id*)this)->real(false)<< "\n";
 }
 
+#define implement_id_class(Idclass, Class, accessor)   \
+char const * Idclass::classname() const\
+{\
+    return #Class;\
+}\
+Class*\
+Idclass::accessor(bool copy) {\
+       if (copy)\
+           return new Class(* (Class*) data);\
+       else\
+           return (Class*) data;\
+    }\
+Idclass::~Idclass() { delete accessor(false); }\
+Idclass::Idclass(String s, Class*st, int code):Identifier(s,code) { data = st; }\
+
+
+implement_id_class(Real_id, Real, real)
+implement_id_class(Script_id, Script_def, script)
+implement_id_class(Lookup_id, Lookup, lookup)
+implement_id_class(Symtables_id, Symtables, symtables)
+implement_id_class(Staff_id, Input_staff, staff)
+implement_id_class(M_chord_id, Music_general_chord, mchord)
+implement_id_class(M_voice_id, Music_voice, mvoice)
+implement_id_class(Score_id, Input_score, score)
+implement_id_class(Request_id, Request, request)
index 89f5b189e556eeffc45543cc1ca612fe6d33ad0f..da392fe30fbfcbdd1e480ef9c888bf9baf6aa252 100644 (file)
@@ -8,16 +8,5 @@ depth = ../..
 # identify module:
 #
 MODULE_NAME = lilypond
-MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
-MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
-PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = ./$(depth)/lily/$(outdir)/.build
-#
-
-# generic stuff/Makefile
-#
 include ./$(depth)/make/Include.make
-#
 
index 26da52dc0e89c832db824bf8313ad3d8fe9b69d6..643959d620b17bb69cfc7747b0b32532480bcff4 100644 (file)
@@ -12,8 +12,8 @@
 
 /// a macro to declare the classes name as a static and virtual function.
 #define NAME_MEMBERS(c)        \
-static const char *static_name(){ return #c; }\
-virtual const char *name() const{ return c::static_name(); } \
+static char const *static_name(){ return #c; }\
+virtual char const *name() const{ return c::static_name(); } \
 int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
     
 #endif // CLASS-NAME_HH
index 05f58ba9c8675a01b06e52037c0b74a6ea17eb43..6b6f40c01a82d526e2443aa819af09a9cf3434cd 100644 (file)
@@ -18,11 +18,11 @@ struct Idealspacing {
     Real hooke;
 
     /// the two columns
-    const PCol *left, *right;
+    PCol const *left, *right;
     
     void print()const;
     void OK() const ;
-    Idealspacing(const PCol *left,const PCol *right);    
+    Idealspacing(PCol const *left,PCol const *right);    
 };
 
 
index 6312582bf0d923f13096559b92b7cb2c928b24c6..812d1fe71f7598afc62a522405b4a5832aaf11e1 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
   identifier.hh -- part of LilyPond
 
@@ -8,36 +7,61 @@
 #ifndef IDENTIFIER_HH
 #define IDENTIFIER_HH
 
-#include "identparent.hh"
-#include "symtable.hh"
-#include "input-staff.hh"
-#include "input-music.hh"
-#include "lookup.hh"
-#include "script-def.hh"
-#include "request.hh"
+#include "proto.hh"
+#include "string.hh"
+
+/* boolean argument to accesor is copy_b..*/
+#define IDACCESSOR( Input_staff, staff)\
+    virtual Input_staff * staff(bool) { error(#Input_staff); return 0; }
+
+
+struct Identifier {
+    void *data;
+    String name;
+    int token_code_i_;
 
-#define make_id_class(Idclass, Class, accessor)        \
+    Identifier(String n, int code) : name(n) { token_code_i_ = code; }
+    virtual ~Identifier() {}
+
+    void print()const;
+    virtual char const *classname() const{ return "new Identifier"; }
+    void error(String);
+    IDACCESSOR(Input_staff, staff)
+    IDACCESSOR(Input_music, music)
+    IDACCESSOR(Music_voice, mvoice)
+    IDACCESSOR(Script_def, script)
+    IDACCESSOR(Symtables, symtables)
+    IDACCESSOR(Music_general_chord, mchord)
+    IDACCESSOR(Lookup,lookup)
+    IDACCESSOR(Real,real)
+    IDACCESSOR(Request, request)
+    IDACCESSOR(Input_score, score)
+
+protected:
+    virtual void do_print()const=0;
+private:
+    Identifier(Identifier const&){}
+};
+
+#define declare_id_class(Idclass, Class, accessor)     \
 struct Idclass : Identifier {\
-    virtual const char *classname() { return #Class; }\
-    Idclass(String s, Class*st, int code):Identifier(s,code) { data = st; }\
-    virtual Class* accessor(bool copy) {\
-       if (copy)\
-           return new Class(* (Class*) data);\
-       else\
-           return (Class*) data;\
-    }\
-    ~Idclass() { delete accessor(false); }\
-    virtual void do_print()const; \
+       virtual char const *classname()const;\
+       Idclass(String s, Class*st, int code);\
+       virtual Class* accessor(bool copy);\
+       ~Idclass();\
+       virtual void do_print()const; \
 }\
 
-make_id_class(Real_id, Real, real);
-make_id_class(Script_id, Script_def, script);
-make_id_class(Lookup_id, Lookup, lookup);
-make_id_class(Symtables_id, Symtables, symtables);
-make_id_class(Staff_id, Input_staff, staff);
-make_id_class(M_chord_id, Music_general_chord, mchord);
-make_id_class(M_voice_id, Music_voice, mvoice);
-make_id_class(Request_id, Request, request);
 
-#endif // IDENTIFIER_HH
 
+declare_id_class(Real_id, Real, real);
+declare_id_class(Script_id, Script_def, script);
+declare_id_class(Lookup_id, Lookup, lookup);
+declare_id_class(Symtables_id, Symtables, symtables);
+declare_id_class(Staff_id, Input_staff, staff);
+declare_id_class(M_chord_id, Music_general_chord, mchord);
+declare_id_class(M_voice_id, Music_voice, mvoice);
+declare_id_class(Score_id, Input_score, score);
+declare_id_class(Request_id, Request, request);
+
+#endif // IDENTIFIER_
index a8b75b0fd3695473f7fc82681f114c3855405e3a..09c7cfafd0cb2ee13152e399db7d99198272b2fd 100644 (file)
@@ -1,48 +1 @@
-/*
-  identparent.hh -- part of LilyPond
-
-  (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef IDENTPARENT_HH
-#define IDENTPARENT_HH
-
-#include "proto.hh"
-#include "string.hh"
-
-/* boolean argument to accesor is copy_b..*/
-#define IDACCESSOR( Input_staff, staff)\
-    virtual Input_staff * staff(bool) { error(#Input_staff); return 0; }
-
-
-struct Identifier {
-    void *data;
-    String name;
-    int token_code_i_;
-    
-    Identifier(String n, int code) : name(n) { token_code_i_ = code; }
-    virtual ~Identifier() {}
-
-    void print()const;
-    virtual const char*classname() { return "new Identifier"; }
-    void error(String);
-    IDACCESSOR(Input_staff, staff)
-    IDACCESSOR(Input_music, music)
-    IDACCESSOR(Music_voice, mvoice)
-    IDACCESSOR(Script_def, script)     
-    IDACCESSOR(Symtables, symtables)
-    IDACCESSOR(Music_general_chord, mchord)
-    IDACCESSOR(Lookup,lookup)
-    IDACCESSOR(Real,real)
-    IDACCESSOR(Request, request)
-       
-protected:
-    virtual void do_print()const=0;
-private:
-    Identifier(Identifier const&){}
-    
-};
-#endif // IDENTPARENT_HH
-
-
-
+#error
index 4286f4b60b798023dd7daf4597c0bf7e63691203..a7468e03fa59f378cafb074089d3b2477e5b0374 100644 (file)
@@ -19,7 +19,7 @@
 /// the total music def of one movement
 struct Input_score {
     /// defined where?    
-    const char* defined_ch_c_l_;
+    char const * defined_ch_c_l_;
     int errorlevel_i_;
     
     /// paper_, staffs_ and commands_ form the problem definition.
@@ -27,7 +27,6 @@ struct Input_score {
     Midi_def* midi_p_;
     IPointerList<Input_staff*> staffs_;
 
-    Input_music * score_wide_music_p_;
     
     /* *************************************************************** */
     Input_score();
@@ -40,7 +39,6 @@ struct Input_score {
     void set(Midi_def* midi_p);
     void print() const;
     Score*parse();
-    void set(Input_music*);
 };
 
 #endif
index 3b874a1b393423e1c68eabb5fd79f3610e6c87aa..23495bd74400996583b4cc026cb0e1023c64407b 100644 (file)
 
 struct Input_staff {
     
-    const char * defined_ch_c_l_;
+    char const * defined_ch_c_l_;
     String type;
     
     IPointerList<Input_music*> music_;
-    Input_music * score_wide_music_p_;
     
     /* *************** */
     ~Input_staff();
     void add(Input_music*m);
     Input_staff(Input_staff const&);
     Input_staff(String);
-    void set_score_wide(Input_music*m);
-    Staff* parse(Score*, Input_music *score_wide);
+    Staff* parse(Score*);
     void print() const;
 };
 
index 152d9dc15d8a178b61fb0dac55ace5ec53df3c57..88ab9ffbe0de7ef61c3096286668ce8a6d1c501c 100644 (file)
@@ -10,7 +10,7 @@
 /* for the keyword table */
 struct Keyword_ent
 {
-    const char   *name;
+    char const *name;
     int     tokcode;
 };
 
@@ -19,7 +19,7 @@ struct Keyword_table
     Keyword_ent *table;
     int     maxkey;
     Keyword_table(Keyword_ent *);
-    int     lookup(const char *s) const;
+    int     lookup(char const *s) const;
 };
 
 
index 266ee22a56c385caa26c95952e37580add593d37..08faa553f8de81d3b5571717a1788a48a868f797 100644 (file)
@@ -15,7 +15,7 @@
 #include "string.hh"
 
 int yylex();
-void yyerror(const char *s);
+void yyerror(char const *s);
 bool busy_parsing();
 void kill_lexer();
 void set_lexer();
@@ -51,7 +51,11 @@ struct My_flex_lexer : yyFlexLexer {
     char const* here_ch_c_l();
     int lookup_keyword(String);
     void lookup_notename(int &large, int &small, String s);
-    void LexerError(const char *);
+
+    void push_note_state();
+    void push_lyric_state();
+    void pop_state();
+    void LexerError(char const *);
     String spot() const;
     Identifier*lookup_identifier(String s);
     My_flex_lexer();
index 1479d1e9368db4d3d1135d78c2c5490887f91f45..2a9e655479bdc42d1ff0b2fe11fd71518f6b4ed9 100644 (file)
@@ -9,8 +9,8 @@
 
 /// helper struct for #Spacing_problem#
 struct Colinfo {
-    const PCol *pcol_;
-    const Real* fixpos;
+    PCol const *pcol_;
+    Real const * fixpos;
     Interval width;
     
     /* *************** */
@@ -18,7 +18,7 @@ struct Colinfo {
     void operator=(Colinfo const&);
     Colinfo(Colinfo const&);
     ~Colinfo();
-    Colinfo(const PCol*,const Real*);
+    Colinfo(PCol const *,Real const *);
     void print() const;
     bool fixed() const { return fixpos;}
     Real fixed_position()const { return *fixpos; }
@@ -47,11 +47,11 @@ struct Colinfo {
     springs. The lower the energy, the better the configuration.
 */
 class Spacing_problem {
-    Array<const Idealspacing*> ideals;
+    Array<Idealspacing const *> ideals;
     Array<Colinfo> cols;
 
     /// the index of #c# in #cols#
-    int col_id(const PCol *c) const;
+    int col_id(PCol const *c) const;
 
     /// generate an (nonoptimal) solution
     Vector find_initial_solution() const;
@@ -60,7 +60,7 @@ class Spacing_problem {
     bool check_feasible() const;
 
     /// does #this# contain the column #w#? 
-    bool contains(const PCol *w);
+    bool contains(PCol const *w);
 
     /// make the energy function
     void make_matrices(Matrix &quad, Vector &lin,Real&) const;
@@ -84,13 +84,13 @@ public:
     since they can be "summed" if the columns to which #i# refers are
     not in this problem, the spacing is ignored.
     */
-    void add_ideal(const Idealspacing *i);
+    void add_ideal(Idealspacing const *i);
     
     
     /** add a col to the problem. columns have to be added left to right. The column contains
       info on it's minimum width.
     */
-    void add_column(const PCol *, bool fixed=false, Real fixpos=0.0);
+    void add_column(PCol const *, bool fixed=false, Real fixpos=0.0);
  
 
 
@@ -99,7 +99,7 @@ public:
     Vector try_initial_solution() const;
     void OK() const;
     void print() const;
-    void print_ideal(const Idealspacing*)const;
+    void print_ideal(Idealspacing const *)const;
 };
 
 
index d0a2867a874eb393d861adcdb58116754c1aec45..9611449383c7f1dcf9d5ce2debf0c0c4ef4bb3d8 100644 (file)
@@ -13,7 +13,7 @@
 struct Local_key_register : Request_register {
     Local_key local_key_;
     Local_key_item* key_item_p_;
-    const Key *key_c_l_;
+    Key const *key_c_l_;
     /* *************** */
     virtual void process_requests();
     virtual void acknowledge_element(Staff_elem_info);
index 6d96117ff2f2a9d5bdc237dfa94c1e2156cc06b9..1ad791de40d794586ca1dbb17debdb6ca9cecac0 100644 (file)
@@ -96,8 +96,6 @@ struct Melodic_req :virtual Musical_req
     /// 0 natural, 1 sharp, etc
     int accidental_i_;
 
-    /// force/supress printing of accidental.
-    bool forceacc_b_;
 
     /// return height from central c (in halflines)
     int height()const; 
@@ -111,7 +109,9 @@ struct Melodic_req :virtual Musical_req
 /// Put a note of specified type, height, and with accidental on the staff.
 struct Note_req : Rhythmic_req, virtual Melodic_req {
     
-
+    /// force/supress printing of accidental.
+    bool forceacc_b_;
+    Note_req();
     Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic(); }
     REQUESTMETHODS(Note_req, note);
  };
@@ -214,7 +214,7 @@ struct Subtle_req : virtual Musical_req {
 struct Dynamic_req : Subtle_req {
     /// for absolute dynamics
     enum Loudness {
-       FFF, FF, F, MF, MP, P, PP, PPP
+       FFF, FF, F, MF, MP, P, PP, PPP
     };
     static String loudness_str(Loudness);
     REQUESTMETHODS(Dynamic_req, dynamic);
index 2641e64008d1420bcb69fee7d80cefa6a43159a3..48d6c62a1958e7c01287d9ff25336e0bc02d2890 100644 (file)
@@ -21,8 +21,8 @@
   */
 
 struct PCol { 
-    PointerList<const Item*> its;
-    PointerList<const Spanner*> stoppers, starters;
+    PointerList<Item const *> its;
+    PointerList<Spanner const *> stoppers, starters;
     
 
 
@@ -40,7 +40,7 @@ struct PCol {
     PCol *daddy_l_;
     
     /// if lines are broken then this column is in #line#
-    const Line_of_score *line_l_;
+    Line_of_score const *line_l_;
 
     /// if lines are broken then this column x-coord #hpos#
     Real hpos;
index eeec67e2fbaeaa4f4cd8dd8d476da6b3193de481..3177613ec5e89bd4abbe40367ba25b74a1b2856a 100644 (file)
@@ -67,7 +67,7 @@ struct PScore {
      /**
        @return argument as a cursor of the list
        */
-    PCursor<PCol *> find_col(const PCol *)const;
+    PCursor<PCol *> find_col(PCol const *)const;
 
     /* MAIN ROUTINES */
     void process();
index 50a7f0c7198db08da99a7736994df038b6ddb61a..c95834c2fb8ab5dd3bedde04144fe87e831acfdd 100644 (file)
@@ -11,7 +11,7 @@ struct PStaff {
     PScore * pscore_l_;
     
     
-    PointerList<const Spanner*> spans;
+    PointerList<Spanner const *> spans;
     PointerList<Item*> its;
 
     /* *************** */
index fba93580cb53fb30585786bd7979ecc972de60ab..5086a0ff0c0178ba1bb5f816800ab3e861e8b2f5 100644 (file)
@@ -47,7 +47,7 @@ public:
     Real standard_height()const;
     Real note_width() const;
     void print() const;
-    const Lookup* lookup_l();  // TODO naming
+    Lookup const * lookup_l(); // TODO naming
     Real duration_to_dist(Moment);
 };
 
index 7c9b8da341b57342033d9bf97c71bdd45efb213f..3423951452a98c570f4aca54a13034be4187e302 100644 (file)
@@ -32,7 +32,7 @@ class Active_constraints {
     Matrix A,H;
     Array<int> active;
     Array<int> inactive;               // actually this is a set, not an array.
-    const Ineq_constrained_qp *opt;
+    Ineq_constrained_qp const *opt;
 
 public:
     String status()const;
index a865ed02f354f9022d973ec05d282593819ddcea..4f10a7f95f0b99a5b879700cb546dde230ed267a 100644 (file)
@@ -28,7 +28,7 @@ struct Score {
     IPointerList<Score_column*> cols_;
     PScore *pscore_p_;
 
-    const char *defined_ch_c_l_;
+    char const *defined_ch_c_l_;
     int errorlevel_i_;
     
     /* *************************************************************** */
index f4e19870338fd72db780dd6f805ec9f79185858b..9196a96ab334f984672fdc5e2a253b07c5e17be1 100644 (file)
@@ -26,7 +26,7 @@ Line_of_score {
     String TeXstring() const;
 
     // is #c# contained in #*this#?
-    bool element(const PCol *c);
+    bool element(PCol const *c);
 };
 
 #endif
index c07f242e31dae2aa5659ccbb46b74ea265322717..4e3392027d57c909a6ff22a8912dc4ab38d69a0a 100644 (file)
@@ -17,7 +17,7 @@
 struct Staff_elem_info {
     Staff_elem * elem_p_;
     Request*req_l_;
-    const Voice * voice_l_;
+    Voice const * voice_l_;
     Array<Request_register*> origin_reg_l_arr_;
 
     /* *** */
@@ -28,8 +28,8 @@ struct Staff_elem_info {
 struct Staff_info {
     int *c0_position_i_;
     Staff_walker *walk_l_;
-    const Time_description *time_c_l_;
-    const Rhythmic_grouping *rhythmic_c_l_;
+    Time_description const *time_c_l_;
+    Rhythmic_grouping const *rhythmic_c_l_;
     bool break_allowed_b_;
 };
 
diff --git a/lily/include/staffelem.hh b/lily/include/staffelem.hh
deleted file mode 100644 (file)
index 3928c99..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-  staffelem.hh -- part of LilyPond
-
-  (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef STAFFELEM_HH
-#define STAFFELEM_HH
-#include "varray.hh"
-#include "proto.hh"
-#include "offset.hh"
-#include "molecule.hh"
-
-/** Both Spanner and Item are Staff_elem's. Most Staff_elem's depend
-  on other Staff_elem's, eg, Beam needs to know and set direction of
-  Stem. So the Beam has to be calculated *before* Stem. This is
-  accomplished with the dependencies field of struct Staff_elem.
-
-  */
-struct Staff_elem {
-    enum Status {
-       ORPHAN,                 // not yet added to pstaff
-       VIRGIN,                 // added to pstaff
-       PRECALCING,
-       PRECALCED,              // calcs before spacing done
-       POSTCALCING,
-       POSTCALCED,             // after spacing calcs done
-       OUTPUT,                 // molecule has been output
-    } status;
-    
-    ///  the pstaff it is in
-    PStaff *pstaff_l_;
-
-    /* *************** */
-    Staff_elem(Staff_elem const&);
-    String TeXstring () const ;
-    virtual void print() const;
-    virtual Interval width() const;
-    virtual Interval height() const;
-    Paperdef *paper() const;
-    virtual ~Staff_elem();
-    Staff_elem();
-    
-    void translate(Offset);
-    void add_processing();
-    void pre_processing();
-    void post_processing();
-    void molecule_processing();
-    virtual const char *name() const;          // to find out derived classes.
-    virtual Spanner* spanner()  { return 0; }
-    virtual Item * item() { return 0; }
-    void add_depedency(Staff_elem* );    
-    void substitute_dependency(Staff_elem* old, Staff_elem * newdep);
-protected:
-    
-    /// do printing of derived info.
-    virtual void do_print() const=0;
-    /// generate the molecule    
-    virtual Molecule* brew_molecule_p()const=0;
-    ///executed directly after the item is added to the PScore
-    virtual void do_add_processing();
-    /// do calculations before determining horizontal spacing
-    virtual void do_pre_processing();
-
-    /// do calculations after determining horizontal spacing
-    virtual void do_post_processing();
-
-    Array<Staff_elem*> dependants;
-
-private:
-    /// member: the symbols
-    Molecule *output;          // should scrap, and use temp var?
-
-
-    /**
-      This is  needed, because #output# may still be
-      NULL.
-      */
-    Offset offset_;
-    Array<Staff_elem*> dependencies;
-};
-#define NAME_METHOD(c) const char *c::name()const{ return #c; } struct c
-#endif // STAFFELEM_HH
-
index b8af8aeb222d7e99586ff4e7cab91f4b0ff991dd..14652899d404765a3c725f84628075464f0b9b43 100644 (file)
@@ -16,7 +16,7 @@
 struct Staff_elem_info {
     Staff_elem * elem_p_;
     Request*req_l_;
-    const Voice * voice_l_;
+    Voice const * voice_l_;
     Voice_group_registers * group_regs_l_; 
     Request_register * origin_reg_l_;
 
index 0c5b6b132882dcae69db69c2de8acb0c02bddaee..be54ac401befa2dca0015acba5315ea158881aeb 100644 (file)
@@ -19,7 +19,7 @@
 struct Voice_element {
     Moment duration;
     char const* defined_ch_c_l_;
-    const Voice *voice_l_;
+    Voice const *voice_l_;
     IPointerList<Request*> reqs;
 
     /* *************** */
index 06e6e1da279006f08aa94113d2365c3840dcb996..ccdff1f6262a58c160ae2d35e2a7f16a9f1538bb 100644 (file)
@@ -22,7 +22,7 @@ struct Voice {
     Voice();
     Voice(Voice const&);
 
-    Moment when(const Voice_element*)const;
+    Moment when(Voice_element const *)const;
     Moment last() const;
 
     void add(Voice_element*);
index f39d47a4b1a91e9df75e514644f595d0c10138b7..d68dd10959a189a6182af9eac612448592875d2c 100644 (file)
@@ -42,8 +42,6 @@ Input_score::Input_score(Input_score const&s)
     midi_p_ = (s.midi_p_)? new Midi_def(*s.midi_p_) : 0;
     defined_ch_c_l_ = s.defined_ch_c_l_;
     errorlevel_i_ = s.errorlevel_i_;
-    score_wide_music_p_ = (s.score_wide_music_p_) ?
-       s.score_wide_music_p_->clone():0;
 }
 
 Score*
@@ -55,34 +53,25 @@ Input_score::parse()
     if (midi_p_)
        s_p->set(new Midi_def(*midi_p_));
     if (paper_p_)
-       s_p->set(    new Paper_def(*paper_p_));
+       s_p->set(new Paper_def(*paper_p_));
 
     for (iter_top(staffs_,i); i.ok(); i++) {
-       Staff* staf_p=i->parse(s_p, score_wide_music_p_);
+       Staff* staf_p=i->parse(s_p);
        s_p->add(staf_p);
     }
 
     return s_p;
 }
 
-void
-Input_score::set(Input_music *m_p)
-{
-    delete score_wide_music_p_;
-    score_wide_music_p_ =m_p;    
-}
-
 
 Input_score::~Input_score()
 {
     delete paper_p_;
-    delete score_wide_music_p_;
     delete midi_p_;
 }
 
 Input_score::Input_score()
 {
-    score_wide_music_p_ =0;
     defined_ch_c_l_=0;
     paper_p_= 0;
     midi_p_ = 0;
index 8305a094a9f02fd95663f915507e9b4a01a61bcb..678ff2f16bc8345326d5a991467a2d00538b7f24 100644 (file)
@@ -19,7 +19,6 @@
 
 Input_staff::Input_staff(String s)
 {
-    score_wide_music_p_ =0;
     type= s;
     defined_ch_c_l_ = 0;
 }
@@ -31,7 +30,7 @@ Input_staff::add(Input_music*m)
 }
 
 Staff*
-Input_staff::parse(Score*score_l, Input_music *default_score_wide)
+Input_staff::parse(Score*score_l)
 {
     Staff *p=0;
     if (type == "melodic")
@@ -49,9 +48,6 @@ Input_staff::parse(Score*score_l, Input_music *default_score_wide)
        Voice_list vl = i->convert();
        p->add(vl);
     }
-    Voice_list vl =  (score_wide_music_p_) ? score_wide_music_p_->convert()
-       : default_score_wide->convert();
-    p->add(vl);
     return p;
 }
 
@@ -61,8 +57,6 @@ Input_staff::Input_staff(Input_staff const&s)
        add(i->clone());
     defined_ch_c_l_ = s.defined_ch_c_l_;
     type = s.type;
-    score_wide_music_p_ = (s.score_wide_music_p_) ?
-       s.score_wide_music_p_->clone() : 0;
 }
 
 void
@@ -75,14 +69,6 @@ Input_staff::print() const
     mtor << "}\n";
 #endif
 }
-void
-Input_staff::set_score_wide(Input_music *m_p)
-{
-    delete score_wide_music_p_;
-    score_wide_music_p_ = m_p;
-}
-
 Input_staff::~Input_staff()
 {
-    delete score_wide_music_p_;
 }
index 089eab126fc497ebf045b44270debf184d83fd25..726af8cb3065c2d959546121406cfebade8d9982 100644 (file)
@@ -18,7 +18,7 @@ Key_item::Key_item(int c)
 }
 
 void
-Key_item::read(const Key_register& key_reg_r)
+Key_item::read(Key_register const & key_reg_r)
 {
     const Array<int> &idx_arr =key_reg_r.accidental_idx_arr_; 
     for (int i = 0 ; i< idx_arr.size(); i++) {
index 24189a532b61d50191418e7f5f9374274f55713f..865eea264e7fb862c60fe906a290f275aa505d29 100644 (file)
@@ -49,7 +49,7 @@ Key_register::acknowledge_element(Staff_elem_info info)
 void
 Key_register::process_requests()
 {
-    const Time_description *time_l = get_staff_info().time_c_l_;
+    Time_description const *time_l = get_staff_info().time_c_l_;
 
     if (!keyreq_l_ &&
        (!time_l->whole_in_measure_|| !time_l->when_)) {
index 14903cfb61ae5a59d1274e2d08ef8ebe721b35a5..2ccb446e2707e0973a11745440d4268fa98c21e8 100644 (file)
@@ -12,7 +12,7 @@
 /* for the keyword table */
 struct Keyword_ent
 {
-    const char   *name;
+    char const *name;
     int     tokcode;
 };
 
@@ -21,16 +21,16 @@ struct Keyword_table
     Keyword_ent *table;
     int     maxkey;
     Keyword_table(Keyword_ent *);
-    int     lookup(const char *s) const;
+    int     lookup(char const *s) const;
 };
 
 
 /* for qsort */
 int
-        tabcmp(const void * p1, const void * p2)
+        tabcmp(void const * p1, void const * p2)
 {
-    return strcmp(((const Keyword_ent *) p1)->name,
-                  ((const Keyword_ent *) p2)->name);
+    return strcmp(((Keyword_ent const *) p1)->name,
+                  ((Keyword_ent const *) p2)->name);
 }
 
 Keyword_table::Keyword_table(Keyword_ent *tab)
@@ -48,7 +48,7 @@ Keyword_table::Keyword_table(Keyword_ent *tab)
   lookup with binsearch, return tokencode.
 */
 int
-Keyword_table::lookup(const char *s)const
+Keyword_table::lookup(char const *s)const
 {
     int     lo,
             hi,
index 29738a70aa1f83d59845a4653327cf6609b8bdd3..8e9d503536162067d4f3dca998ec99532401105d 100644 (file)
@@ -11,7 +11,7 @@
 #include "input-score.hh"
 #include "parseconstruct.hh"
 #include "main.hh"
-#include "identparent.hh"
+#include "identifier.hh"
 
 #define start_quote()  \
        yy_push_state(quote);\
@@ -49,22 +49,27 @@ ALPHAWORD   {A}+
 INT            -?{N}+
 REAL           {INT}?(\.{N}*)?
 
-OPTSIGN                !?
-PITCHMOD       ['`]*{OPTSIGN}
 RESTNAME       r|s|p
 NOTECOMMAND    \\{WORD}
 DOTS           \.+
 LYRICS         {TEX}+
-COMMENT                [%#].*\n
+COMMENT                %.*\n
 
 %%
 
-\$             {
-       yy_push_state(notes); 
-}
 
-\@             {
-       yy_push_state(lyrics); 
+
+
+include           {
+       yy_push_state(incl);
+}
+<incl>[ \t]*      { /* eat the whitespace */ }
+<incl>\"[^"]*\"+   { /* got the include file name */
+   String s (YYText()+1);
+   s = s.left_str(s.length_i()-1);
+   defined_ch_c_l = here_ch_c_l() - String( YYText() ).length_i() - 1;
+   new_input(s);
+   yy_pop_state();
 }
 
 <notes>{RESTNAME}      {
@@ -73,9 +78,9 @@ COMMENT               [%#].*\n
        mtor << "rest:"<< yylval.string;
        return RESTNAME;
 }
-<notes>{ALPHAWORD}     {
+<notes,INITIAL>{ALPHAWORD}     {
        String str = YYText();
-       mtor << "word: " << str<< eol;
+       mtor << "word: `" << str<< "'\n";
        Identifier * id = lookup_identifier(str);
        if (id) {               
                yylval.id = id;
@@ -85,17 +90,13 @@ COMMENT             [%#].*\n
        yylval.string=new String( str );
        return STRING;
 }
-<notes>{NOTECOMMAND}   {
+<notes,INITIAL>{NOTECOMMAND}   {
        String c = YYText() +1;
-       mtor << "\\word: " << YYText()+1<<eol;
+       mtor << "\\word: `" << YYText()+1<<"'\n";
        int l = lookup_keyword(c);
        if (l != -1)
                return l;
-       Identifier * id = lookup_identifier(c);
-       if (id) {               
-               yylval.id = id;
-               return id->token_code_i_;
-       }
+       
        String *sp = new String( c);
        yylval.string=sp;
        return STRING;
@@ -114,8 +115,8 @@ COMMENT             [%#].*\n
 <notes>[ \t\n]+                {
 
 }
-<notes>\$      {
-       yy_pop_state();
+<notes>\+\+            {
+       return CONCAT;
 }
 <notes>\" {
        start_quote();
@@ -150,7 +151,7 @@ COMMENT             [%#].*\n
 }
 <lyrics>{NOTECOMMAND}  {
        String c = YYText() +1;
-       mtor << "\\word: " << YYText()+1<<eol;
+       mtor << "\\word: `" << YYText()+1<<"'\n";
        int l = lookup_keyword(c);
        if (l != -1)
                return l;
@@ -203,9 +204,6 @@ COMMENT             [%#].*\n
 }
 <lyrics>[ \t\n]+               {
 }
-<lyrics>@      {
-       yy_pop_state();
-}
 
 <<EOF>> {
        mtor << "<<EOF>>";
@@ -213,38 +211,6 @@ COMMENT            [%#].*\n
        if (! close_input())
          yyterminate(); // can't move this, since it actually rets a YY_NULL
 }
-
-
-include           {
-       yy_push_state(incl);
-}
-<incl>[ \t]*      { /* eat the whitespace */ }
-<incl>\"[^"]*\"+   { /* got the include file name */
-   String s (YYText()+1);
-   s = s.left_str(s.length_i()-1);
-   defined_ch_c_l = here_ch_c_l() - String( YYText() ).length_i() - 1;
-   new_input(s);
-   yy_pop_state();
-}
-
-
-{WORD}         {
-       mtor << "word: " << YYText()<<eol;
-       String c = YYText();
-       int l = lookup_keyword(c);
-       if (l != -1)
-               return l;
-       Identifier * id = lookup_identifier(c);
-       if (id) {               
-               yylval.id = id;
-               return IDENTIFIER;
-       }
-       String *sp = new String( c);
-       mtor << "new id: " << *sp << eol;
-       yylval.string=sp;
-       return STRING;
-}
-
 {REAL}         {
        Real r;
        int cnv=sscanf (YYText(), "%lf", &r);
@@ -278,3 +244,19 @@ include           {
 
 %%
 
+void
+My_flex_lexer::push_note_state()
+{
+       yy_push_state(notes);
+}
+
+void
+My_flex_lexer::push_lyric_state()
+{
+       yy_push_state(lyrics);
+}
+void
+My_flex_lexer::pop_state()
+{
+       yy_pop_state();
+}
index fff9ec7f8a40224959e7bba0e25eba51c9bc214d..389178bbc3bf14a2d78ed971701da28c86ac137e 100644 (file)
@@ -7,7 +7,7 @@ static const int build=
 #include ".build"
 ;
 
-const char * 
+char const * 
 lily_version_sz()
 {
     static char v[1024];
index 750487cff7197515fea0b81ec2197716cf800815..3d8637b6dc485d444b137bd6c825a1e8dd5026f8 100644 (file)
@@ -10,7 +10,7 @@ const Real COLFUDGE=1e-3;
 
 
 bool
-Spacing_problem::contains(const PCol *w)
+Spacing_problem::contains(PCol const *w)
 {
     for (int i=0; i< cols.size(); i++)
        if (cols[i].pcol_ == w)
@@ -19,7 +19,7 @@ Spacing_problem::contains(const PCol *w)
 }
 
 int 
-Spacing_problem::col_id(const PCol *w)const
+Spacing_problem::col_id(PCol const *w)const
 {
     for (int i=0; i< cols.size(); i++)
        if (cols[i].pcol_ == w)
@@ -194,17 +194,17 @@ Spacing_problem::solve() const
     add one column to the problem.
 */    
 void
-Spacing_problem::add_column(const PCol *col, bool fixed, Real fixpos)
+Spacing_problem::add_column(PCol const *col, bool fixed, Real fixpos)
 {
     Colinfo c(col,(fixed)? &fixpos :  0);
     cols.push(c);
 }
 
 void
-Spacing_problem::add_ideal(const Idealspacing *i)
+Spacing_problem::add_ideal(Idealspacing const *i)
 {
-    const PCol *l =i->left;
-    const PCol *r= i->right;
+    PCol const *l =i->left;
+    PCol const *r= i->right;
     
     if (!contains(l) || !contains(r)) {
        return;
@@ -213,7 +213,7 @@ Spacing_problem::add_ideal(const Idealspacing *i)
 }
 
 void
-Spacing_problem::print_ideal(const Idealspacing*id)const
+Spacing_problem::print_ideal(Idealspacing const *id)const
 {
 #ifndef NPRINT
     int l = col_id(id->left);
@@ -261,7 +261,7 @@ Colinfo::Colinfo(Colinfo const&c)
     width = c.width;
 }
 
-Colinfo::Colinfo(const PCol*col_p, const Real*fixed_r_p )
+Colinfo::Colinfo(PCol const *col_p, Real const *fixed_r_p )
 {
     fixpos = (fixed_r_p)? new Real(*fixed_r_p) : 0;
     pcol_ = col_p;
index ddbd8dc5f842fe277a70bfe6e6d59f3a215fb3b5..bf7eb9c352e25ef0ef6c1cc42bb72ca63e70ae16 100644 (file)
@@ -30,12 +30,12 @@ Local_key_register::pre_move_processing()
 void
 Local_key_register::acknowledge_element(Staff_elem_info info)
 {    
-    if (info.req_l_->melodic()) {
-       Melodic_req * melodic_l_ = info.req_l_->melodic();
+    if (info.req_l_->note()) {
+       Note_req * note_l_ = info.req_l_->note();
 
-       if( melodic_l_->forceacc_b_ ||
-           local_key_.oct(melodic_l_->octave_i_).acc(melodic_l_->notename_i_)
-           != melodic_l_->accidental_i_) {
+       if( note_l_->forceacc_b_ ||
+           local_key_.oct(note_l_->octave_i_).acc(note_l_->notename_i_)
+           != note_l_->accidental_i_) {
            Item * support_l_ = info.elem_p_->item();
        
 
@@ -43,10 +43,10 @@ Local_key_register::acknowledge_element(Staff_elem_info info)
                key_item_p_ = new Local_key_item(*get_staff_info().c0_position_i_);
            }
            
-           key_item_p_->add(melodic_l_);
+           key_item_p_->add(note_l_);
            key_item_p_->add(support_l_);
-           local_key_.oct(melodic_l_->octave_i_)
-               .set(melodic_l_->notename_i_, melodic_l_->accidental_i_);
+           local_key_.oct(note_l_->octave_i_)
+               .set(note_l_->notename_i_, note_l_->accidental_i_);
        }
     } else if (info.elem_p_->name()==Key_item::static_name()) { 
        Key_register * key_reg_l =
@@ -59,7 +59,7 @@ Local_key_register::acknowledge_element(Staff_elem_info info)
 void
 Local_key_register::process_requests()
 {
-    const Time_description * time_c_l_ = get_staff_info().time_c_l_;
+    Time_description const * time_c_l_ = get_staff_info().time_c_l_;
     if (! time_c_l_->whole_in_measure_){
        if (key_c_l_)  
            local_key_.reset(*key_c_l_);
index bfd298bfacfb8879ad394d86d099315e675255df..94d94cfd138a52357498de72c0e9ba63e5f6d605 100644 (file)
@@ -71,7 +71,7 @@ Molecule::translate(Offset o)
 }
 
 void
-Molecule::add(const Molecule &m)
+Molecule::add(Molecule const &m)
 {
     for (iter_top(m.ats,c); c.ok(); c++) {
        add(**c);
@@ -79,7 +79,7 @@ Molecule::add(const Molecule &m)
 }
 
 void
-Molecule::add_right(const Molecule &m)
+Molecule::add_right(Molecule const &m)
 {
      if (!ats.size()) {
        add(m);
@@ -92,7 +92,7 @@ Molecule::add_right(const Molecule &m)
 }
 
 void
-Molecule::add_left(const Molecule &m)
+Molecule::add_left(Molecule const &m)
 {
     if (!ats.size()) {
        add(m);
@@ -106,7 +106,7 @@ Molecule::add_left(const Molecule &m)
 
 
 void
-Molecule::add_top(const Molecule &m)
+Molecule::add_top(Molecule const &m)
 {
       if (!ats.size()) {
        add(m);
@@ -119,7 +119,7 @@ Molecule::add_top(const Molecule &m)
 }
 
 void
-Molecule::add_bottom(const Molecule &m)
+Molecule::add_bottom(Molecule const &m)
 {
     if (!ats.size()) {
        add(m);
@@ -132,12 +132,12 @@ Molecule::add_bottom(const Molecule &m)
 }
 
 void
-Molecule::operator = (const Molecule&)
+Molecule::operator = (Molecule const &)
 {
     assert(false);
 }
 
-Molecule::Molecule(const Molecule&s)
+Molecule::Molecule(Molecule const &s)
 {
     add(s);
 }
index be9667c1a0e893cebe9d1b5d26e8ed15b9f2ab76..bf1b56c44c1785334fed7d31a1a02a184722307d 100644 (file)
@@ -36,9 +36,11 @@ void Request::do_print() const{}
 void
 Request::print() const
 {
+#ifndef NPRINT
     mtor << name() << " {";
     do_print();
     mtor << "}\n";
+#endif
 }
      
 
@@ -87,13 +89,14 @@ Melodic_req::Melodic_req()
     notename_i_ = 0;
     octave_i_ = 0;
     accidental_i_ = 0;
-    forceacc_b_ = false;
 }
 
 void
 Melodic_req::do_print() const
 {
-    mtor << "notename: " << notename_i_ << " acc: " <<accidental_i_<<" oct: "<< octave_i_;
+#ifndef NPRINT
+       mtor << "notename: " << notename_i_ << " acc: " <<accidental_i_<<" oct: "<< octave_i_;
+#endif
 }
 
 int
@@ -123,12 +126,14 @@ Plet_req::Plet_req()
 void
 Plet_req::do_print() const
 {
+#ifndef NPRINT
     mtor << "plet: " << type_c_ << ": " << dur_i_ << "/" << type_i_;
+#endif
 }
 
 /* *************** */
 int
-Rhythmic_req::compare(const Rhythmic_req &r1, const Rhythmic_req &r2)
+Rhythmic_req::compare(Rhythmic_req const &r1, Rhythmic_req const &r2)
 {
     return sign(r1.duration() - r2.duration());
 }
@@ -149,12 +154,14 @@ Rhythmic_req::Rhythmic_req()
 void
 Rhythmic_req::do_print() const
 {
+#ifndef NPRINT
     mtor << "ball: " << balltype ;
     int d =dots;
     while (d--)
        mtor << '.';
     
     mtor<<", plet factor"<<plet_factor<<"\n";
+#endif
 }
 
 
@@ -177,12 +184,20 @@ Lyric_req::do_print() const
     Rhythmic_req::do_print();
     Text_req::do_print();
 }
+
 /* *************** */
+Note_req::Note_req()
+{
+    forceacc_b_ = false;
+}
 void
 Note_req::do_print() const
 {
+#ifndef NPRINT
+    mtor << " forceacc_b_ " << forceacc_b_ << '\n';
     Melodic_req::do_print();
     Rhythmic_req::do_print();
+#endif
 }
 /* *************** */
 void
@@ -202,7 +217,7 @@ void Beam_req::do_print()const{}
 void Slur_req::do_print()const{}
 /* *************** */
 int
-Span_req:: compare(const Span_req &r1, const Span_req &r2)
+Span_req:: compare(Span_req const &r1, Span_req const &r2)
 {
      return r1.spantype - r2.spantype;
 }
@@ -220,7 +235,7 @@ Script_req::Script_req(int d , Script_def*def)
 }
 
 int
-Script_req::compare(const Script_req &d1, const Script_req &d2)
+Script_req::compare(Script_req const &d1, Script_req const &d2)
 {
     return d1.dir_i_ == d2.dir_i_ &&
        d1.scriptdef_p_->compare(*d2.scriptdef_p_);
@@ -247,7 +262,7 @@ Script_req::~Script_req()
 }
 /* *************** */
 int
-Text_req:: compare(const Text_req &r1, const Text_req &r2)
+Text_req:: compare(Text_req const &r1, Text_req const &r2)
 {
     bool b1 = (r1.dir_i_ == r2.dir_i_);
     bool b2 = (r1.tdef_p_ ->compare(*r2.tdef_p_));
@@ -274,8 +289,11 @@ Text_req::Text_req(int dir_i, Text_def* tdef_p)
 void
 Text_req::do_print() const
 {
+#ifndef NPRINT
+
     mtor << " dir " << dir_i_ ;
     tdef_p_->print();
+#endif
 }
 
 /* *************** */
@@ -289,7 +307,10 @@ Skip_req::duration() const
 void
 Skip_req::do_print() const
 {
+#ifndef NPRINT
+
     mtor << "duration: " << duration();
+#endif
 }
 
 Voice *
@@ -305,7 +326,9 @@ Request::voice_l()
 void
 Subtle_req::do_print() const
 {
-    mtor << " subtime " <<  subtime_;
+#ifndef NPRINT
+       mtor << " subtime " <<  subtime_;
+#endif
 }
 
 void
index 2907a339659b00e54fa91fca457e92c1937d5485..265e02b126a768108e0fde574a10d6f7d78fb3cd 100644 (file)
@@ -1,7 +1,7 @@
 #include <strstream.h>
 
 #include "interval.hh"
-#include "identparent.hh"
+#include "identifier.hh"
 #include "assoc-iter.hh"
 #include "lexer.hh"
 #include "input-file.hh"
@@ -26,6 +26,7 @@ static Keyword_ent the_key_tab[]={
     "geometric", GEOMETRIC,
     "goto", GOTO,
     "in", IN_T,
+    "lyrics", LYRICS,
     "key", KEY,
     "melodic" , MELODIC,
     "meter", METER,
@@ -119,7 +120,7 @@ My_flex_lexer::spot()const
 }
 
 void
-My_flex_lexer::LexerError(const char *s)
+My_flex_lexer::LexerError(char const *s)
 {
     if (lexer->include_stack_.empty()) {
        *mlog << "error at EOF" << s << '\n';
index 267a0de696194a8f1d66e46700692d45cd180781..543ef6130c6e56c82ecfb2913de31986107a2b8b 100644 (file)
@@ -10,7 +10,7 @@
 #include "command-request.hh"
 #include "voice.hh"
 
-#include "identparent.hh"
+#include "identifier.hh"
 #include "varray.hh"
 #include "text-def.hh"
 #include "parseconstruct.hh"
index 2bfa097431d8d9a123e9dd8c0eaf12357d886ee3..caaf26476697e8ca4489cd2569d9ee9bb4d46850 100644 (file)
@@ -52,7 +52,7 @@ PCol::print() const
 }
 
 int
-PCol::compare(const PCol &c1, const PCol &c2)
+PCol::compare(PCol const &c1, PCol const &c2)
 {
     PScore*ps_l = c1.pscore_l_;
     PCursor<PCol*> ac(ps_l->find_col(&c1));
index 582a3148ef11fe7b73bc5761c692dd476dcf6d83..9e31523da1d60b8cee95c7c82ae8193a65f34935 100644 (file)
@@ -137,7 +137,7 @@ PScore::select_items(PStaff*ps, PCol*pc)
     assert(ps && pc);
     for (iter_top(pc->its,i); i.ok(); i++){
        if (i->pstaff_l_ == ps)
-           ret.push((Item*)(const Item*)i);
+           ret.push((Item*)(Item const *)i);
     }
     return ret;
 }
@@ -204,9 +204,9 @@ PScore::postprocess()
 }
 
 PCursor<PCol *>
-PScore::find_col(const PCol *c)const
+PScore::find_col(PCol const *c)const
 {
-    const PCol*what = c;
+    PCol const *what = c;
     if (what->daddy_l_ )
        what = what->daddy_l_;
     
index 6063347e88afd08e796bc24cfec6b94dcc59c10d..1b3a74b2a5f581636d1e6eca6a2841ae41b97ea5 100644 (file)
@@ -89,7 +89,7 @@ Paper_def::print() const
     mtor << "}\n";
 #endif
 }
-const Lookup*
+Lookup const *
 Paper_def::lookup_l()
 {
     return lookup_p_;
index e30f2da40014ab853344ad054d36b2acdf3d318d..a5110d97ca417e36f81ffb2b5fe9a4d80ef95edf 100644 (file)
@@ -1,13 +1,16 @@
 %{ // -*-Fundamental-*-
 #include <iostream.h>
-
+#include "script-def.hh"
+#include "symtable.hh"
 #include "lookup.hh"
 #include "misc.hh"
 #include "lexer.hh"
 #include "paper-def.hh"
 #include "midi-def.hh"
-#include "input-score.hh"
 #include "main.hh"
+#include "input-score.hh"
+#include "input-staff.hh"
+#include "input-music.hh"
 #include "keyword.hh"
 #include "debug.hh"
 #include "parseconstruct.hh"
@@ -71,6 +74,7 @@ int fatal_error_i = 0;
 %token CM_T
 %token COMMAND
 %token COMMANDS
+%token CONCAT
 %token DURATIONCOMMAND
 %token DYNAMIC
 %token END
@@ -78,6 +82,7 @@ int fatal_error_i = 0;
 %token GOTO
 %token GROUPING
 %token IN_T
+%token LYRICS
 %token KEY
 %token MELODIC
 %token METER
@@ -113,8 +118,13 @@ int fatal_error_i = 0;
 %token <i>     INT
 %token <id>    IDENTIFIER
 %token <id>    MELODIC_REQUEST_IDENTIFIER 
+%token <id>    CHORD_IDENTIFIER
+%token <id>    VOICE_IDENTIFIER
 %token <id>    POST_REQUEST_IDENTIFIER
+%token <id>    SCRIPT_IDENTIFIER
+%token <id>    STAFF_IDENTIFIER
 %token <id>    REAL_IDENTIFIER
+%token <id>    SCORE_IDENTIFIER
 %token <id>    REQUEST_IDENTIFIER
 %token <real>  REAL 
 %token <string>        DURATION RESTNAME
@@ -122,7 +132,7 @@ int fatal_error_i = 0;
 
 %type <box>    box
 %type <c>      open_request_parens close_request_parens close_plet_parens
-%type <chord>  music_chord music_chord_body
+%type <chord>  music_chord music_chord_body  init_music_chord
 %type <el>     voice_elt full_element lyrics_elt command_elt
 %type <i>      int
 %type <i>      octave_quotes octave_quote
@@ -138,8 +148,8 @@ int fatal_error_i = 0;
 %type <melreqvec>      pitch_list 
 %type <midi>   midi_block midi_body
 %type <moment> duration_length
-%type <music>  music 
-%type <mvoice>  music_voice_body music_voice 
+%type <music>  music init_music
+%type <mvoice>  music_voice_body music_voice  init_music_voice init_lyrics_voice
 
 %type <paper>  paper_block paper_body
 %type <real>   dim real
@@ -154,6 +164,11 @@ int fatal_error_i = 0;
 %type <symtable>       symtable symtable_body
 %type <textdef>        mudela_text
 
+
+%left PRIORITY
+
+%expect 2      /* have to fix this. */
+
 %%
 
 mudela:        /* empty */
@@ -182,20 +197,28 @@ declarable_identifier:
        ;
 
 declaration:
-       declarable_identifier '=' staff_block  {
-               $$ = new Staff_id(*$1, $3, IDENTIFIER);
+       declarable_identifier '=' score_block {
+               $$ = new Score_id(*$1, $3, SCORE_IDENTIFIER);
+               delete $1;
+       }
+       | declarable_identifier '=' staff_block  {
+               $$ = new Staff_id(*$1, $3, STAFF_IDENTIFIER);
                delete $1; 
        }
-       | declarable_identifier '=' music_voice {
-               $$ = new M_voice_id(*$1, $3, IDENTIFIER);
+       | declarable_identifier '=' init_music_voice {
+               $$ = new M_voice_id(*$1, $3, VOICE_IDENTIFIER);
+               delete $1;
+       }
+       | declarable_identifier '=' init_lyrics_voice {
+               $$ = new M_voice_id(*$1, $3, VOICE_IDENTIFIER);
                delete $1;
        }
        | declarable_identifier '=' script_definition {
-               $$ = new Script_id(*$1, $3, IDENTIFIER);
+               $$ = new Script_id(*$1, $3, SCRIPT_IDENTIFIER);
                delete $1;
        }
-       | declarable_identifier '=' music_chord  {
-               $$ = new M_chord_id(*$1, $3, IDENTIFIER);
+       | declarable_identifier '=' init_music_chord  {
+               $$ = new M_chord_id(*$1, $3, CHORD_IDENTIFIER);
                delete $1;
        }
        | declarable_identifier '=' symtables {
@@ -235,20 +258,16 @@ score_block:
                $$->errorlevel_i_ = lexer->errorlevel_i_;
                lexer->errorlevel_i_ = 0;
 
-               /* unbarf score without global music. */
-               if (!$$-> score_wide_music_p_) {
-                       $$-> score_wide_music_p_ = new Music_voice; 
-               }
        }
        ;
 
 score_body:            { 
                $$ = new Input_score; 
        }
-       | score_body staff_block        { $$->add($2); }
-       | score_body COMMANDS '{' music_voice_body '}'          {
-               $$->set($4);
+       | SCORE_IDENTIFIER {
+               $$ = $1->score(true);
        }
+       | score_body staff_block        { $$->add($2); }
        | score_body paper_block                { $$->set($2);  }
        | score_body midi_block         { $$->set($2);  }
        | score_body error {
@@ -269,7 +288,6 @@ intastint_list:
 */
 paper_block:
        PAPER
-
        '{' paper_body '}'      { $$ = $3; }
        ;
 
@@ -327,7 +345,7 @@ staff_block:
 
 
 staff_init:
-       IDENTIFIER              { $$ = $1->staff(true); }
+       STAFF_IDENTIFIER                { $$ = $1->staff(true); }
        | STRING                {
                $$ = new Input_staff(*$1);
                delete $1;
@@ -339,10 +357,7 @@ staff_init:
 
 staff_body:
        staff_init
-       | staff_body COMMANDS '{' music_voice_body '}'  {
-               $$->set_score_wide($4);
-       }
-       | staff_body music      {
+       | staff_body init_music {
                $2->set_default_group( "staff_music" + String($$->music_.size()));
                $$->add($2);
        }
@@ -350,6 +365,30 @@ staff_body:
        }
        ;
 
+/*
+       let the lexer switch mode.
+*/
+init_music:
+       init_music_voice        { $$ = $1; }
+       | init_music_chord      { $$ = $1; }
+       | init_lyrics_voice     { $$ = $1; }
+       ;
+
+init_lyrics_voice:
+       LYRICS { lexer->push_lyric_state(); } 
+       music_voice { $$ = $3; lexer->pop_state(); }
+       ;
+
+init_music_voice:
+       MUSIC { lexer->push_note_state(); } 
+       /* cont*/ music_voice
+               { $$=$3; lexer->pop_state(); }
+       ;
+init_music_chord:
+       MUSIC { lexer->push_note_state(); } 
+       /* cont*/ music_chord
+                 { $$=$3; lexer->pop_state(); }
+       ;
 /*
        MUSIC
 */
@@ -358,19 +397,16 @@ music:
        | music_chord   { $$ = $1; }
        ;
 
-music_voice:  MUSIC '{' music_voice_body '}'   { $$ = $3; }
+music_voice:  '{' music_voice_body '}' { $$ = $2; }
        ;
 
 music_voice_body:
-       IDENTIFIER {
+       VOICE_IDENTIFIER {
                $$ = $1->mvoice(true);
        }
        | /* */         {
                $$ = new Music_voice;
        }
-       | music_voice_body '+' IDENTIFIER {
-               $$->concatenate($3->mvoice(true));
-       }
        | music_voice_body full_element {
                $$->add_elt($2);
        }
@@ -381,13 +417,15 @@ music_voice_body:
        }
        | music_voice_body error {
        }
-       ;
+       | music_voice_body '>' {
+               error("Confused by earlier errors: bailing out");
+       };
 
-music_chord:  '{' music_chord_body '}' { $$ = $2; }
+music_chord:  '<' music_chord_body '>' { $$ = $2; }
        ;
 
 music_chord_body:
-       IDENTIFIER {
+       CHORD_IDENTIFIER {
                $$=$1->mchord(true);
        }
        | /* */ {
@@ -396,15 +434,15 @@ music_chord_body:
        | MULTIVOICE {
                $$ = new Multi_voice_chord;
        }
-       | music_chord_body '+' IDENTIFIER {
-               $$->concatenate($3->mchord(true));
-       }
        | music_chord_body music {
                $$->add($2);
        }
        | music_chord_body full_element {
                $$ ->add_elt($2);
        }
+       | music_chord_body '}' {
+               error("Confused by earlier errors: bailing out");
+       }
        | music_chord_body error {
        }
        ;
@@ -446,11 +484,13 @@ command_req:
                $$ = new Bar_req(*$2);
                delete $2;
        }
-       | METER '{' int '*' int '}'     {
+       | METER '{' int '/' int '}'     {
                Meter_change_req *m = new Meter_change_req;
                m->set($3,$5);
                // sorry hw, i need meter at output of track,
                // but don-t know where to get it... statics should go.
+               // HW : default: 4/4, meterchange reqs may change it.
+               
                Midi_def::num_i_s = $3;
                Midi_def::den_i_s = $5;
                $$ = m;
@@ -520,7 +560,7 @@ pure_post_request:
 
 octave_quote:
        '\''            { $$ = 1; }
-       | '`'           { $$ = -1; }
+       | '`'           { $$ = -1 ; }
        ;
 
 octave_quotes:
@@ -537,30 +577,32 @@ steno_note_req:
                * (Melodic_req *) $$ = *$1->request(false)->melodic();
                $$->octave_i_ += lexer->prefs.default_octave_i_;
        }
-       | octave_quote steno_note_req   {  
-               $2-> octave_i_ += $1;
-               $$ = $2; //ugh!!
+       | steno_note_req '\''   {  
+               $$-> octave_i_ ++;
        }
-       | '!' steno_note_req            {
+       | '`' steno_note_req     {  
                $$ = $2;
-               $2->forceacc_b_ = ! $2->forceacc_b_;
+               $2-> octave_i_ --;
+       }
+       
+       | steno_note_req   '!'          {
+               $$->forceacc_b_ = ! $$->forceacc_b_;
        } 
        ;
 
 melodic_request:
-       MELODIC '{' int int int int '}' {/* ugh */
+       MELODIC '{' int int int '}'     {/* ugh */
                $$ = new Melodic_req;
                $$->octave_i_ = $3;
                $$->notename_i_ = $4;
                $$->accidental_i_ = $5;
-               $$->forceacc_b_ = $6;
        }
        ;
 
 dynamic_req:
        DYNAMIC '{' int '}'     {
                Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
-               ad_p ->loudness_ = $3;
+               ad_p ->loudness_ = (Dynamic_req::Loudness)$3;
                $$ =ad_p;
        }
        ;
@@ -620,7 +662,7 @@ script_req:
        ;
 
 mudela_script:
-       IDENTIFIER              { $$ = $1->script(true); }
+       SCRIPT_IDENTIFIER               { $$ = $1->script(true); }
        | script_definition             { $$ = $1; }
        | '^'           { $$ = get_scriptdef('^'); }
        | '+'           { $$ = get_scriptdef('+'); }
@@ -909,7 +951,7 @@ Paper_def*
 default_paper()
 {
     return new Paper_def(
-       lexer->lookup_identifier("default_table")->lookup(true));
+       lexer->lookup_identifier("defaulttable")->lookup(true));
 }
 
 
index 67c7b5b54dcd31c0eadf98323f1e6a0254a58c09..de09bb09409386cf3da081dfdd4a33710b21d1c9 100644 (file)
@@ -124,7 +124,7 @@ Stem_beam_register::pre_move_processing()
        stem_p_ = 0;
     }
     if (beam_p_ && end_beam_b_) {
-       const Rhythmic_grouping * rg_c_l = get_staff_info().rhythmic_c_l_;
+       Rhythmic_grouping const * rg_c_l = get_staff_info().rhythmic_c_l_;
        rg_c_l->extend(current_grouping->interval());
        beam_p_->set_grouping(*rg_c_l, *current_grouping);
        typeset_element(beam_p_);
index 2125593ab6b5747c75731213fc41e2cc902f25b8..4157f085638f18b98767cb6c174fef83367cb755 100644 (file)
@@ -43,7 +43,7 @@ Tex_stream &
 Tex_stream::operator<<(String s)
 {
     
-    for (const char *cp = s; *cp; cp++) {
+    for (char const *cp = s; *cp; cp++) {
        if (outputting_comment) {
            *os << *cp;
            if (*cp == '\n') {
index b440003fd2b5044e88fc78f86df919fccd2694f9..cd2961b65e429f57c6d3ed9adb7ec44798a9f8f2 100644 (file)
@@ -11,7 +11,7 @@ Text_def::Text_def()
     defined_ch_c_l_ = 0;
 }
 bool
-Text_def::compare(const Text_def&def)
+Text_def::compare(Text_def const &def)
 {
     return align_i_ == def.align_i_ && text_str_ == def.text_str_
        && style_str_ == def.style_str_;
index 5b24591c5bc6ecfceb04421d0a61934106b54643..eed3e39ca8e7dcf751f356bd2cf95c94ec349f77 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "string.hh"
 
-extern const char* lily_version_sz();
+extern char const * lily_version_sz();
 
 String 
 get_version_str()
index ad548c6f588cace06c11ba7f775bd4bb76b9c9b3..0db10f848eb805ea8b610ef62cbd45a490d7be6c 100644 (file)
@@ -30,7 +30,7 @@ error(String s)
 }
 
 void
-error_t(const String& s, const Moment& r)
+error_t(String const & s, Moment const & r)
 {
     String t_mom = String(trunc(r)) + String(r - Moment(trunc(r)));
     String e=s+ " (t = " +  t_mom + ")";
@@ -38,7 +38,7 @@ error_t(const String& s, const Moment& r)
 }
 
 void
-error_t(const String& s, Time_description const &t_tdes)
+error_t(String const & s, Time_description const &t_tdes)
 {
     String e=s+ " (at t=" + String(t_tdes.bars_i_) + ": " + String(t_tdes.whole_in_measure_) + ")\n";
     error(e);
@@ -47,7 +47,7 @@ error_t(const String& s, Time_description const &t_tdes)
 void
 message( String message_str, char const* context_ch_c_l )
 {
-    String str = "lilypond: ";
+    String str = "";           //"lilypond: ";// GNU format messages!
     Source_file* sourcefile_l = source_l_g->sourcefile_l( context_ch_c_l );
     if ( sourcefile_l ) {
        str += sourcefile_l->file_line_no_str(context_ch_c_l) + String(": ");
diff --git a/make/Builtin-rules.make b/make/Builtin-rules.make
deleted file mode 100644 (file)
index b5fd253..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# project  LilyPond -- the musical typesetter
-# title           cancel all built-in rules
-# file    make/Builtin-rules.make
-#
-# Copyright (c) 1997 by    
-#      Jan Nieuwenhuizen <jan@digicash.com>
-#      Han-Wen Nienhuys <hanwen@stack.nl>
-
-# no assembly sources
-%.o : %.s
-
-# no c sources
-%.o : %.c
-
-# not using RCS
-% :: RCS/%,v
-$(outdir)/% :: $(outdir)/RCS/%,v
-% : RCS/%,v
-$(outdir)/% : $(outdir)/RCS/%,v
-%.c : RCS/%,v
-%.cc : RCS/%,v
-%.hh : RCS/%,v
-%.make : RCS/%,v
-$(outdir)/%.dep : $(outdir)/RCS/%,v
-%.dep : RCS/%.dep,v
-$(outdir)/%.dep : $(outdir)/RCS/%.dep,v
-
-# lily knows better
-%.tab.c %.tab.h : %.y
-
-# fine suffixes:
-Makefile :
-%.cc :
-%.dep :
-$(outdir)/%.dep:
-%.hh :
-%.make :
-%.p :
-
-
index 22d1becc05db35cd20bbebb3013f3302c3a383f1..e38c13d9b061d0e303b572fd86b3d2be406990e0 100644 (file)
@@ -3,7 +3,7 @@
 # @configure_input@
 
 INSTALL = @INSTALL@
-CXXFLAGS = @CXXFLAGS@
+USER_CXXFLAGS = @CXXFLAGS@
 #CXX = @CXX@
 
 prefix = @prefix@
diff --git a/make/Files.make b/make/Files.make
new file mode 100644 (file)
index 0000000..ba1d2e3
--- /dev/null
@@ -0,0 +1,35 @@
+# list of c++ header files:
+# 
+HHFILES = $(wildcard *.hh)
+#
+
+# list of c++ inline files:
+# 
+INLFILES = $(wildcard *.inl)
+#
+
+# list of c++ template files:
+# 
+
+TCCFILES = $(wildcard *.tcc)
+
+#
+# list of other source files:
+#
+
+EXTRA_SOURCE_FILES = $(wildcard *.y *.l)
+
+#
+PODFILES = $(wildcard *.pod)
+
+CCFILES = $(wildcard *.cc)
+MAKEFILES = $(wildcard *.make)
+
+ALL_SOURCES=$(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES) $(INLFILES) \
+       $(TCCFILES) $(PODFILES) $(MAKEFILES)
+
+DEPFILES = $(wildcard $(depdir)/*.dep)
+
+build = $(outdir)/.build
+
+all-tag-sources=$(CCFILES) $(HHFILES)
index b8f1255cf2f84f97acfefa1b2fdb7e630054597c..0416201c7827ed5d099455d722f676968bccc704 100644 (file)
@@ -1,4 +1,4 @@
-#
+
 # project  LilyPond -- the musical typesetter
 # title           generic red tape for include/Makefile
 # file    make/Include.make
@@ -9,43 +9,10 @@
 
 # identify module:
 #
-NAME = generic-include
-MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
-MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
-PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = ./$(depth)/lily/$(outdir)/.build
-#
 
-# generic variables:
-#
-include ./$(depth)/make/Variables.make 
-#
-
-# list of c++ header files:
-# 
-HHFILES = $(shell ls *.hh $(ERROR_LOG))
-#
-
-# list of c++ inline files:
-# 
-INLFILES = $(shell ls *.inl $(ERROR_LOG))
-#
 
-# list of c++ template files:
-# 
-TCCFILES = $(shell ls *.tcc $(ERROR_LOG))
-#
-
-# list of distribution files:
-#
-DISTFILES = Makefile $(HHFILES) $(INLFILES) $(TCCFILES)
-#
-
-# generic targets and rules:
-#
+include ./$(depth)/make/Variables.make
+include ./$(depth)/make/Version.make 
+include ./$(depth)/make/Files.make
 include ./$(depth)/make/Targets.make
 include ./$(depth)/make/Rules.make
-#
-
index 30fbad011d02251cdf093ec03285d570a4f8802a..1f8f6ca8c7c54015bb1b543187012ab5c38f9ab3 100644 (file)
@@ -16,27 +16,17 @@ depth = ..
 # identify module:
 #
 NAME = make
-MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
-MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
-PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = ./$(depth)/lily/$(outdir)/.build
-#
 
-# list of generic make files:
-#
-MAKEFILES = $(shell ls *.make)
-#
 
 # list of distribution files:
 #
-DISTFILES = Configure_variables.make.in Makefile lilypond.spec.in $(MAKEFILES)
+EXTRA_DISTFILES = Configure_variables.make.in lilypond.spec.in
 #
 
 # generic variables:
 #
-include ./$(depth)/make/Variables.make 
+include ./$(depth)/make/Variables.make
+include ./$(depth)/make/Files.make 
 #
 
 # generic targets and rules:
@@ -45,5 +35,5 @@ include ./$(depth)/make/Targets.make
 include ./$(depth)/make/Rules.make
 #
 
-lilypond.spec: lilypond.spec.in
-       sed 's/@TOPLEVEL_VERSION@/${TOPLEVEL_VERSION}/g'< $< > $@
\ No newline at end of file
+lilypond.spec: lilypond.spec.in $(depth)/.version
+       sed 's/@TOPLEVEL_VERSION@/${TOPLEVEL_VERSION}/g'< $< > $@
index 1389ef4bd7253118d01f5c4c19607fb65b19b2ce..0e06b46cac9898b6daeeee727651a710edfde1d0 100644 (file)
 # compile rules:
 #
 $(outdir)/%.o: %.cc
-       $(DODEP)\
-       $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION) 
+       $(DO_CXX_COMPILE)
+
+$(outdir)/%.o: $(outdir)/%.cc
+       $(DO_CXX_COMPILE)
 
 $(outdir)/%.cc: %.y
 #      $(BISON) -d $<
@@ -67,14 +69,16 @@ $(outdir)/%.1: %.pod
 # specific stuff:
 #
 $(LIBFLOWER): check-flower-deps
-       $(MAKE) ./$(outdir)/$(@F) -C $(depth)/flower/lib
 
 check-flower-deps:
-       $(MAKE)  -C $(depth)/flower/lib
+       $(MAKE)  -C $(depth)/flower/ $(outdir)/$(notdir $(LIBFLOWER))
 
 check-lily-deps: check-flower-deps
        $(MAKE)  -C $(depth)/lib
 
+check-doc-deps:
+       $(MAKE) -C $(depth)/Documentation
+
 $(LIBLILY): dummy
        $(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
 #
diff --git a/make/Stuff.make b/make/Stuff.make
deleted file mode 100644 (file)
index 6a71b90..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# project  LilyPond -- the musical typesetter
-# title           generic red tape for stuff/Makefile
-# file    make/Stuff.make
-#
-# Copyright (c) 1997 by    
-#      Jan Nieuwenhuizen <jan@digicash.com>
-#      Han-Wen Nienhuys <hanwen@stack.nl>
-# identify module:
-#
-
-NAME = generic-stuff
-MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
-MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
-PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-#
-
-# generic variables:
-#
-include ./$(depth)/make/Variables.make 
-#
-
-# generic targets and rules:
-#
-include ./$(depth)/make/Targets.make
-include ./$(depth)/make/Rules.make
-#
-
index 8173b9e079f0187c12994ccefd95556e6825cd4a..9859802a58f851ee1cec5fb64909cb32e0a29563 100644 (file)
@@ -38,7 +38,7 @@ $(EXECUTABLE): $(build) $(OFILES) $(CUSTOMLIBES)
 exe: $(EXECUTABLE)
 #
 
-$(build):
+$(build): $(depth)/.version
        echo 0 > $@
 
 # dependency list of library:
@@ -112,6 +112,8 @@ doc++: $(progdocs)
 dist:
        -mkdir $(distdir)
        $(MAKE) localdist
+       chmod -Rf a+rX $(distdir)
+
        (cd ./$(depth); tar cfz $(DIST_NAME).tar.gz $(DIST_NAME))
        rm -rf $(distdir)/  # should be trapped
 
@@ -119,8 +121,8 @@ localdist: $(DISTFILES)
        if [ -d out ]; then mkdir $(distdir)/$(localdir)/out; fi
        ln $(DISTFILES) $(distdir)/$(localdir)
 ifdef SUBDIRS
-       set -e; for i in $(SUBDIRS); do mkdir $(distdir)/$(localdir)/$$i; done
-       set -e; for i in $(SUBDIRS); do $(MAKE) localdir=$(localdir)/$$i -C $$i localdist; done
+       set -e; for i in $(SUBDIRS); do mkdir $(distdir)/$(localdir)/$$i; \
+               $(MAKE) localdir=$(localdir)/$$i -C $$i localdist; done
 endif
 
 moduledist:
@@ -141,9 +143,10 @@ ifdef SUBDIRS
        set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i all-tags; done
 endif
 
-TAGS: $(allcc)
-       etags -CT $(allcc) 
-
+TAGS: $(all-tag-sources)
+ifdef all-tag-sources
+       -etags -CT $(all-tag-sources) /dev/null
+endif
 
 # version stuff:
 #
index 2d6397f5e83f63e866346fada598a078688861bf..f9246f92e368cd5381e271d36c3b2b1bc5574dea 100644 (file)
@@ -24,13 +24,9 @@ include ./$(depth)/make/Variables.make
 #
 NAME = ...
 MODULE_NAME = 
-# include ./$(depth)/$(NAME)/.version
-MAJOR_VERSION = 0
-MINOR_VERSION = 0
-PATCH_LEVEL = 0
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = # include separator: "-1" or ".a"
-build = $(lily-dir)/$(outdir)/.build #????!
+include ./$(depth)/$(NAME)/.version
+
+build = $(outdir)/.build #????!
 #
 
 # descent order into subdirectories:
@@ -38,37 +34,17 @@ build = $(lily-dir)/$(outdir)/.build #????!
 SUBDIRS =
 #
 
-# to be remade each build:
-#
-VERSION_DEPENDENCY = $(lily-version)
-#
-
-# module compile settings: (not generally needed!
+# module compile settings: (not generally needed!)
 #
 EXTRA_CFLAGS =
 EXTRA_CXXFLAGS =
 EXTRA_LDFLAGS =
 #
+include ./$(depth)/make/Files.make
 
-# list of c++ header files:
-# 
-HHFILES = $(shell ls *.hh $(ERROR_LOG))
-#
-
-# list of c++ source files:
-#
-CCFILES = $(shell ls *.cc $(ERROR_LOG))
-#
-
-# list of other source files:
-#
-EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
-#
-
-# list of distribution files:
-#
-DISTFILES = Makefile $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
-#
+# list of extra distribution files:
+# Makefile, C++ and pod are dist'ed automatically
+EXTRA_DISTFILES = 
 
 # list of custom libraries:
 #
@@ -91,11 +67,6 @@ include ./$(depth)/make/Targets.make
 include ./$(depth)/make/Rules.make
 #
 
-# list of depend files:
-#
-DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
-#
-
 # auto dependencies:
 #
 -include $(DEPFILES)
index 3c74750c92573be8a0f448b0d4e0174305c4f475..7e8ff5a8306d150d1d421e72dab2d07b12172e42 100644 (file)
@@ -27,19 +27,19 @@ lily_bindir = ./$(depth)/bin
 distdir = ./$(depth)/$(DIST_NAME)
 module-distdir = ./$(depth)/$(MODULE_DIST_NAME)
 depdir = $(outdir)
-flowerout = ./$(depth)/flower/lib/$(outdir)
+flowerout = ./$(depth)/flower/$(outdir)
 libout = ./$(depth)/lib/$(outdir)
 libdir = $(outdir)
 lilyout = ./$(depth)/lily/$(outdir)
 mi2muout = ./$(depth)/mi2mu/$(outdir)
 makeout = ./$(depth)/make/$(outdir)
-flower-dir = ./$(depth)/flower/lib
+flower-dir = ./$(depth)/flower
 lib-dir = ./$(depth)/lib
 lily-dir = ./$(depth)/lily
 mi2mu-dir = ./$(depth)/mi2mu
 make-dir = ./$(depth)/make
 include-lib = ./$(depth)/lib/include
-include-flower = ./$(depth)/flower/lib/include
+include-flower = ./$(depth)/flower/include
 #
 
 # user settings:
@@ -106,7 +106,7 @@ mi2mu-version = $(mi2muout)/version.hh
 
 # custom libraries:
 #
-LIBFLOWER = $(depth)/flower/lib/$(outdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
+LIBFLOWER = $(depth)/flower/$(outdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
 LIBLILY = $(depth)/lib/$(outdir)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
 #
 
@@ -129,6 +129,9 @@ AR_COMMAND = $(AR) $(ARFLAGS) $@
 RANLIB_COMMAND=$(RANLIB) $@
 # compiler:
 #
+
+DO_CXX_COMPILE=$(DODEP)\
+       $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION) 
 # "CC = $(CC)"
 # "CXX = $(CXX)"
 #
@@ -161,3 +164,4 @@ LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
 
 STRIPDEBUG=true #replace to do stripping of certain objects
 
+DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
diff --git a/make/Version.make b/make/Version.make
new file mode 100644 (file)
index 0000000..9ee3571
--- /dev/null
@@ -0,0 +1,7 @@
+
+MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
+MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
+PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
+# use to send patches, always empty for released version:
+MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
+build = $(outdir)/.build
index 18d469b45e4056082383f72285bc9385849f6d08..887c92075ab4f60471d349944673b718cb3f3deb 100644 (file)
@@ -22,18 +22,18 @@ configure --enable-checking --enable-optimise --enable-printing --prefix=/usr
 make all
 %install
 make install
-
+strip /usr/bin/lilypond /usr/bin/mi2mu 
 %files
 %doc Documentation/out/index.text Documentation/out/CodingStyle.text
 %doc Documentation/out/lilygut.text Documentation/out/lilyinput.text
 %doc Documentation/out/error.text Documentation/out/faq.text
 %doc Documentation/out/INSTALL.text
-%doc Documentation/out/language.text Documentation/out/lelie_logo.png
+%doc Documentation/out/language.text Documentation/lelie_logo.gif
 /usr/bin/lilypond
 /usr/bin/mi2mu
 /usr/man/man1/lilypond.1
-/usr/lib/texmf/texmf/tex/lilypond/*
-/usr/share/lilypond/*
+/usr/lib/texmf/texmf/tex/lilypond/
+/usr/share/lilypond/
 
 %post
 texhash
index 10a7f1ef53e10f82a1d5e1dcc1b9c6f3655ae9f5..235504e66068f3710cbfd1436251579a99300204 100644 (file)
@@ -15,7 +15,8 @@ depth = ..
 
 # generic variables:
 #
-include ./$(depth)/make/Variables.make 
+include ./$(depth)/make/Variables.make
+include ./$(depth)/make/Files.make 
 #
 
 # identify module:
@@ -36,24 +37,11 @@ SUBDIRS = include
 VERSION_DEPENDENCY = $(mi2mu-version)
 #
 
-# list of c++ header files:
-# 
-HHFILES := $(wildcard *.hh )
-#
-
-# list of c++ source files:
-#
-CCFILES := $(wildcard *.cc )
-#
-
-# list of other source files:
-#
-EXTRA_SOURCE_FILES := $(wildcard *.y *.l )
-#
 
 # list of distribution files:
 #
-DISTFILES = Makefile .version $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
+DISTFILES = Makefile .version $(ALL_SOURCES)
+
 #
 
 # list of custom libraries:
@@ -87,7 +75,7 @@ midi-lexer.l: $(outdir)/midi-parser.hh
 
 # list of depend files:
 #
-DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+DEPFILES = $(wildcard $(depdir)/*.dep)
 #
 
 # auto dependencies:
index 6860a29536f8e5ef4201924f05ec2efa1a4475c8..1cfdc7b22a0927b31e049cf55952ea778d4c15d3 100644 (file)
@@ -8,12 +8,6 @@ depth = ../..
 # identify module:
 #
 MODULE_NAME = lilypond
-MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
-MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
-PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = ./$(depth)/mi2mu/$(outdir)/.build
 #
 
 # generic stuff/Makefile
index 35004f0f6d98b947941675d8ab3b5646a3c642e4..adcbcdd157fb553c6ab59b97ce98ead6034c7ac5 100644 (file)
@@ -4,17 +4,13 @@
 #
 depth = ..
 #
-
-build = ./$(depth)/lily/$(outdir)/.build
-
-# generic stuff/Makefile
 #
-include ./$(depth)/make/Stuff.make
+include ./$(depth)/make/Include.make
 #
 
 # list of distribution files:
 # 
-TEXFILES = $(shell ls *.tex)
+TEXFILES = $(wildcard *.tex)
 DISTFILES = Makefile $(TEXFILES)
 #
 
@@ -24,4 +20,4 @@ localinstall:
 
 localuninstall:
        for i in $(TEXFILES) ; do rm -f $(TEXPREFIX)/lilypond/$$i; done
-       -rmdir $(TEXPREFIX)/lilypond/
\ No newline at end of file
+       -rmdir $(TEXPREFIX)/lilypond/