# yydebug
InitParser 1
Parser 1
+InitDeclarations 1
# FlexLexer debug
InitLexer 1
Stem 1
Staff 0
Score 1
-Voice 1
-Voice_element 1
+Voice 0
+Voice_element 0
Input_cursor 1
Commands_at 1
Input_command 1
Melodic_req 0
Midi_walker 0
Stem_req 1
-Group_change_req 1
+Group_change_req 0
Script_req 1
Colinfo 1
Word_wrap 1
Script_def 1
Text_def 1
Paperdef 1
+Symtable 1
+Symtables 1
\ No newline at end of file
# Sources.make
# sourcefiles to be shipped. Also used for dependencies
-hdr=bar.hh barreg.hh beam.hh\
+hdr=bar.hh bar-reg.hh beam.hh\
binary-source-file.hh\
- boxes.hh break.hh clefreg.hh clefitem.hh\
+ boxes.hh break.hh class-name.hh clef-reg.hh clef-item.hh\
colhpos.hh commandrequest.hh \
- complexwalker.hh complexstaff.hh\
- const.hh debug.hh dimen.hh directionalspanner.hh\
+ complex-walker.hh complex-staff.hh\
+ const.hh debug.hh dimen.hh directional-spanner.hh\
glob.hh grouping.hh headreg.hh idealspacing.hh\
identifier.hh identparent.hh \
- inputmusic.hh inputscore.hh inputstaff.hh\
- inputfile.hh\
- item.hh key.hh keyitem.hh\
- keyreg.hh\
+ input-music.hh input-score.hh input-staff.hh\
+ input-file.hh\
+ item.hh key.hh key-item.hh\
+ key-reg.hh\
keyword.hh leastsquares.hh lexer.hh linespace.hh \
- localkeyitem.hh localkeyreg.hh lookup.hh \
- lyricitem.hh lyricstaff.hh lyricwalker.hh\
- main.hh meter.hh meterreg.hh\
- mididef.hh midiitem.hh midioutput.hh midistream.hh\
- midiwalker.hh\
+ local-key-item.hh local-key-reg.hh lookup.hh \
+ lyric-item.hh lyricstaff.hh lyricwalker.hh\
+ main.hh meter.hh meter-reg.hh\
+ midi-def.hh midi-item.hh midi-output.hh midi-stream.hh\
+ midi-walker.hh\
misc.hh\
molecule.hh moment.hh musicalrequest.hh\
- notehead.hh notename.hh offset.hh paperdef.hh\
+ notehead.hh notename.hh offset.hh paper-def.hh\
parseconstruct.hh pcol.hh proto.hh\
pscore.hh pstaff.hh qlp.hh\
qlpsolve.hh register.hh registergroup.hh reqtodo.hh \
- request.hh rest.hh scorecolumn.hh score.hh\
- scoreline.hh scorewalker.hh script.hh scriptdef.hh scriptreg.hh \
- slur.hh slurreg.hh source.hh sourcefile.hh\
+ request.hh rest.hh score-column.hh score.hh\
+ scoreline.hh score-walker.hh script.hh script-def.hh script-reg.hh \
+ slur.hh slur-reg.hh source.hh source-file.hh\
spanner.hh staff.hh\
- staffelem.hh staffeleminfo.hh staffline.hh staffsym.hh stembeamreg.hh\
- staffcolumn.hh stem.hh staffwalker.hh symbol.hh symtable.hh\
- tex.hh textdef.hh \
- textitem.hh textreg.hh textspanner.hh timedescription.hh \
- tstream.hh voice.hh\
- voiceregs.hh voicegroupregs.hh walkregs.hh
+ staff-elem.hh staff-elem-info.hh staffline.hh staffsym.hh stem-beam-reg.hh\
+ staff-column.hh stem.hh staff-walker.hh symbol.hh symtable.hh\
+ tex.hh text-def.hh \
+ textitem.hh text-reg.hh textspanner.hh time-description.hh \
+ tex-stream.hh voice.hh\
+ voice-element.hh voice-regs.hh voice-group-regs.hh walkregs.hh
-mycc=bar.cc barreg.cc beam.cc \
+mycc=bar.cc bar-reg.cc beam.cc \
binary-source-file.cc\
- boxes.cc break.cc calcideal.cc clefreg.cc\
- clefitem.cc colhpos.cc commandrequest.cc\
- complexstaff.cc complexwalker.cc \
+ boxes.cc break.cc calcideal.cc clef-reg.cc\
+ clef-item.cc colhpos.cc commandrequest.cc\
+ complex-staff.cc complex-walker.cc \
debug.cc dimen.cc\
- directionalspanner.cc\
+ directional-spanner.cc\
grouping.cc groupregs.cc headreg.cc\
idealspacing.cc identifier.cc\
- inputmusic.cc inputscore.cc\
- inputstaff.cc\
- inputfile.cc\
- item.cc key.cc keyitem.cc \
- keyreg.cc keyword.cc\
+ input-music.cc input-score.cc\
+ input-staff.cc\
+ input-file.cc\
+ item.cc key.cc key-item.cc \
+ key-reg.cc keyword.cc\
leastsquares.cc lexerinit.cc linespace.cc \
- localkeyitem.cc localkeyreg.cc lookup.cc\
- lyricitem.cc lyricstaff.cc lyricwalker.cc\
- main.cc meter.cc meterreg.cc\
- mididef.cc midiitem.cc midioutput.cc midistream.cc\
- midiwalker.cc misc.cc molecule.cc mylexer.cc note.cc\
+ local-key-item.cc local-key-reg.cc lookup.cc\
+ lyric-item.cc lyricstaff.cc lyricwalker.cc\
+ main.cc meter.cc meter-reg.cc\
+ midi-def.cc midi-item.cc midi-output.cc midi-stream.cc\
+ midi-walker.cc misc.cc molecule.cc mylexer.cc note.cc\
notehead.cc notename.cc\
- paperdef.cc pcol.cc pscore.cc pstaff.cc qlp.cc qlpsolve.cc\
+ paper-def.cc pcol.cc pscore.cc pstaff.cc qlp.cc qlpsolve.cc\
register.cc registergroup.cc request.cc rest.cc\
- scorecolumn.cc score.cc\
- scoreline.cc scores.cc scorewalker.cc script.cc\
- scriptdef.cc scriptreg.cc slur.cc\
- slurreg.cc source.cc sourcefile.cc\
+ score-column.cc score.cc\
+ scoreline.cc scores.cc score-walker.cc script.cc\
+ script-def.cc script-reg.cc slur.cc\
+ slur-reg.cc source.cc source-file.cc\
spanner.cc staff.cc\
- staffelem.cc staffline.cc staffsym.cc\
- stembeamreg.cc staffcolumn.cc stem.cc\
- staffeleminfo.cc staffwalker.cc symbol.cc\
+ staff-elem.cc staffline.cc staffsym.cc\
+ stem-beam-reg.cc staff-column.cc stem.cc\
+ staff-elem-info.cc staff-walker.cc symbol.cc\
symtable.cc tex.cc texbeam.cc\
- texslur.cc textdef.cc textitem.cc textreg.cc textspanner.cc\
- timedescription.cc tstream.cc voice.cc voiceelt.cc \
- voiceregs.cc voicegroupregs.cc\
+ texslur.cc text-def.cc textitem.cc text-reg.cc textspanner.cc\
+ time-description.cc tex-stream.cc voice.cc voiceelt.cc \
+ voice-regs.cc voice-group-regs.cc\
walkregs.cc warn.cc windhoos-suck-suck-suck-thank-you-cygnus.cc wordwrap.cc\
template1.cc template2.cc template3.cc template4.cc\
template5.cc template6.cc version.cc
# a bit of a hack to keep exec size under control.
stablecc=request.cc bar.cc boxes.cc break.cc \
item.cc keyword.cc leastsquares.cc \
- lookup.cc molecule.cc meter.cc\
- paperdef.cc parser.cc lexer.cc pstaff.cc qlp.cc qlpsolve.cc\
+ molecule.cc meter.cc\
+ paper-def.cc parser.cc lexer.cc pstaff.cc qlp.cc qlpsolve.cc\
template1.cc template2.cc template3.cc template4.cc\
- template5.cc template6.cc version.cc tstream.cc tex.cc\
+ template5.cc template6.cc version.cc tex-stream.cc tex.cc\
voice.cc wordwrap.cc spanner.cc
#
mym2msharedcc=\
binary-source-file.cc\
- inputfile.cc\
- sourcefile.cc\
+ input-file.cc\
+ source-file.cc\
source.cc\
#
--- /dev/null
+/*
+ class-name.hh -- declare
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef CLASS_NAME_HH
+#define CLASS_NAME_HH
+
+/// 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(); } \
+int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
+
+#endif // CLASS-NAME_HH
#include "proto.hh"
#include "varray.hh"
#include "request.hh"
-#include "staffeleminfo.hh"
-
+#include "staff-elem-info.hh"
/**
a struct which processes requests, and creates the #Staff_elem#s.
- Hungarian postfix: reg
+ It may use derived classes. Hungarian postfix: register
*/
class Request_register {
+ friend class Register_group_register;
/**
- Warning: you can't copy a #Request_register#
- */
- Request_register(Request_register const &);
-public:
- Complex_walker * walk_l_;
- Array<Request*> accepted_req_arr_;
-
- Request_register(Complex_walker*);
- Request_register();
- virtual ~Request_register(){}
-
- /**
- take note of item/spanner
- put item in spanner. Adjust local key; etc.
+ You cannot copy a Request_register
+ */
+ Request_register(const Request_register&){}
+protected:
- Default: ignore the info
- */
- virtual void acknowledge_element(Staff_elem_info){}
+ /// utility
+ virtual Paper_def * paper() const;
/**
try to fit the request in this register
true: request swallowed. Don't try to put the request elsewhere.
- (may be we could use C++ exceptions.. :-)
- #Request_register::try_request# always returns false
+ Default: always return false
*/
virtual bool try_request(Request *req_l);
/// make items/spanners with the requests you got
- virtual void process_request(){}
-
- /// typeset any spanners. Empty #accepted_req_arr_#
- void pre_move_processing();
- /// reset any appropriate data.
- void post_move_processing();
- virtual bool acceptable_request_b(Request*) const;
- virtual void set_dir(int){}
-protected:
- /// utility
- Paperdef * paper() const;
-
-
- /**
- invoke walker method to typeset element
- */
- void typeset_element(Staff_elem*elem_p);
-
+ virtual void process_requests(){}
+
+ /** typeset any items/spanners. Default: do nothing
+ */
+ virtual void pre_move_processing(){}
+ /** reset any appropriate data. Default: do nothing
+ */
+ virtual void post_move_processing(){}
+
+ /**
+ Is this request eligible to be processed? Default: return false.
+ */
+ virtual bool acceptable_request_b(Request*) const;
/**
- typeset a "command" item.
+ typeset a "command" item. Default: pass on to daddy.
If the column is not breakable, #pre_p# and #post_p# are junked
*/
- void typeset_breakable_item(Item * pre_p , Item * nobreak_p, Item * post_p);
- /** virtual, called by #pre_move_processing()#
- #Request_register::do_pre_move_process()# defaults to NOP
+ virtual void typeset_breakable_item(Item * pre_p ,
+ Item * nobreak_p, Item * post_p);
+ /**
+ Invoke walker method to typeset element. Default: pass on to daddy.
+ */
+ virtual void typeset_element(Staff_elem*elem_p);
+
+ /**
+ take note of item/spanner
+ put item in spanner. Adjust local key; etc.
+
+ Default: ignore the info
*/
- virtual void do_pre_move_process(){}
- /** virtual, called by #post_move_processing#,
- #Request_register::do_post_move_process()# defaults to NOP */
- virtual void do_post_move_process(){}
+ virtual void acknowledge_element(Staff_elem_info) {}
/**
- Announce element to walker. Utility
+ Announce element. Default: pass on to daddy. Utility
*/
- void announce_element(Staff_elem_info);
+ virtual void announce_element(Staff_elem_info);
+ /**
+ Set features of the register(s). Default: ignore features.
+ */
+ virtual void set_feature(Features){}
+ /**
+ Does this equal or contain a certain register?
+ */
+ virtual bool contains_b(Request_register*reg_l);
+ /**
+ Get information on the staff. Default: ask daddy.
+ */
+ virtual Staff_info get_staff_info();
+
+ virtual void do_print()const;
+public:
+ /** Every Request_register (except for the 'top' which is directly
+ inside the Staff_walker, is a element of a group. */
+ Register_group_register * daddy_reg_l_;
+
+ Request_register();
+ virtual ~Request_register(){}
+ NAME_MEMBERS(Request_register);
+ void print() const;
};
#include "glob.hh"
#include "string.hh"
#include "moment.hh"
+#include "class-name.hh"
/**
a voice element wants something printed.
Hungarian postfix: req
@see lilygut manpage
*/
-struct Request {
+class Request {
+public:
Voice_element*elt_l_;
char const* defined_ch_c_l_;
/* *************** */
+ Voice * voice_l();
Request();
Request(Request const&);
virtual ~Request(){}
- virtual const char * name() const { return "Request";}
+ NAME_MEMBERS(Request);
virtual Request* clone() const { return new Request(*this); }
void print()const ;
#define REQUESTMETHODS(T,accessor) \
virtual T * accessor() { return this;}\
-virtual const char* name() const { return #T; }\
+NAME_MEMBERS(T);\
virtual Request *clone() const { return new T(*this); } \
virtual void do_print() const
--- /dev/null
+/*
+ staff-elem.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"
+#include "class-name.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;
+ Paper_def *paper() const;
+ virtual ~Staff_elem();
+ Staff_elem();
+ NAME_MEMBERS(Staff_elem);
+ void translate(Offset);
+ void add_processing();
+ void pre_processing();
+ void post_processing();
+ void molecule_processing();
+
+ virtual Spanner* spanner() { return 0; }
+ virtual Item * item() { return 0; }
+ void add_dependency(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;
+};
+
+
+#endif // STAFFELEM_HH
+
/** class for horizontal stuff.
- Voice is a ordered row of Voice_elements. It is strictly horizontal:
- you cannot have two rhythmic elements running parallel in a Voice
+ Voice is a ordered row of Voice_elements. It is strictly
+ horizontal: you cannot have two rhythmic elements running parallel
+ in a Voice. For proper processing, each Voice should have
+ Group_change_req as a first element.
*/
void set_plet_backwards(Moment& now_moment_r, Moment until_moment, int num_i, int den_i);
};
-/** one horizontal bit. Apart from being a container for the requests, Voice_element is nothing
- */
-struct Voice_element {
- Moment duration;
- char const* defined_ch_c_l_;
- const Voice *voice_l_;
- IPointerList<Request*> reqs;
-
- /* *************** */
-
- Voice_element();
- Voice_element(Voice_element const & src );
-
- void add(Request*);
- bool find_plet_start_bo(char c, Moment& moment_r);
- void print ()const;
- void set_default_group(String id);
- void set_plet_backwards(Moment& now_moment_r, Moment until_moment, int num_i, int den_i);
- /// return true when done
-};
#endif