# -*- Makefile-*-
# sourcefiles to be shipped. Also for dependencies
-hdr= accidental.hh bar.hh beam.hh boxes.hh break.hh clef.hh clefitem.hh\
+hdr= bar.hh beam.hh boxes.hh break.hh clef.hh clefitem.hh\
command.hh complexwalker.hh complexstaff.hh\
const.hh debug.hh dimen.hh directionalspanner.hh\
- getcommand.hh glob.hh globvars.hh grouping.hh idealspacing.hh\
+ getcommand.hh glob.hh grouping.hh idealspacing.hh\
identifier.hh identparent.hh inputcommand.hh inputcommands.hh\
inputmusic.hh inputscore.hh inputstaff.hh item.hh key.hh keyitem.hh\
keyword.hh leastsquares.hh lexer.hh linespace.hh linepstaff.hh\
qlpsolve.hh register.hh request.hh rest.hh rhythmstaff.hh\
sccol.hh score.hh\
scoreline.hh script.hh scriptdef.hh simplestaff.hh simplewalker.hh\
- slur.hh spanner.hh staff.hh staffcommands.hh staffelem.hh staffline.hh\
+ slur.hh source.hh sourcefile.hh spanner.hh staff.hh staffcommands.hh\
+ staffelem.hh staffline.hh\
stcol.hh stem.hh staffwalker.hh symbol.hh symtable.hh\
tex.hh textdef.hh\
- textitem.hh textspanner.hh timedescription.hh tstream.hh voice.hh
+ textitem.hh textspanner.hh timedescription.hh tstream.hh voice.hh\
+ voicegroup.hh
mycc=bar.cc beam.cc boxes.cc break.cc calcideal.cc clef.cc\
clefitem.cc command.cc complexstaff.cc complexwalker.cc \
- complexmelodicstaff.cc complexprint.cc debug.cc dimen.cc\
+ complexprint.cc debug.cc dimen.cc\
directionalspanner.cc\
getcommands.cc grouping.cc groupregs.cc idealspacing.cc identifier.cc\
inputcommand.cc inputcommands.cc inputmusic.cc inputscore.cc\
paper.cc pcol.cc pscore.cc pstaff.cc qlp.cc qlpsolve.cc\
register.cc request.cc rest.cc rhythmstaff.cc sccol.cc score.cc\
scoreline.cc scores.cc script.cc scriptdef.cc simpleprint.cc\
- simplestaff.cc simplewalker.cc slur.cc spanner.cc staff.cc\
+ simplestaff.cc simplewalker.cc slur.cc source.cc sourcefile.cc\
+ spanner.cc staff.cc\
staffcommands.cc staffelem.cc staffline.cc stcol.cc stem.cc\
- staffwalker.cc symbol.cc symtable.cc table.cc tex.cc texbeam.cc\
+ staffwalker.cc symbol.cc symtable.cc tex.cc texbeam.cc\
texslur.cc textdef.cc textitem.cc textspanner.cc\
timedescription.cc tstream.cc voice.cc voiceregs.cc voicegroup.cc\
- warn.cc wordwrap.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
\ No newline at end of file
+ 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 clef.cc getcommands.cc grouping.cc\
+ item.cc keyword.cc leastsquares.cc \
+ linepstaff.cc linespace.cc lookup.cc molecule.cc meter.cc\
+ paper.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\
+ voice.cc wordwrap.cc spanner.cc
+#include <strstream.h>
#include "interval.hh"
#include "identparent.hh"
#include "associter.hh"
#include "sstack.hh"
#include "debug.hh"
#include "notename.hh"
+#include "sourcefile.hh"
static Keyword_ent the_key_tab[]={
"bar", BAR,
"mark", MARK,
"meter", METER,
"mm", MM,
+ "multivoice", MULTIVOICE,
"octave", OCTAVECOMMAND,
"output", OUTPUT,
"partial", PARTIAL,
"skip", SKIP,
"staff", STAFF,
"start", START_T,
+ "stem", STEM,
"table", TABLE,
"symboltables", SYMBOLTABLES,
"notenames", NOTENAMES,
"texid", TEXID,
"textstyle", TEXTSTYLE,
- "chord", CHORD,
- "multi", MULTI,
"unitspace", UNITSPACE,
"voice", VOICE,
"voices", VOICES,
0,0
};
+int
+My_flex_lexer::ret_notename(int *p, String text, int octave_mod)
+{
+ text.lower();
+ char const* ch_c_l = here_ch_c_l();
+ ch_c_l--;
+ while ( ( *ch_c_l == ' ' ) || ( *ch_c_l == '\t' ) || ( *ch_c_l == '\n' ) )
+ ch_c_l--;
+ ch_c_l++;
+
+ lookup_notename(p[0], p[1], text);
+ p[2] = octave_mod;
+ mtor << "notename: "<< text <<eol;
+ if (p[0] < 0) {
+
+ errorlevel_i_ |= 1;
+ warning( String( "notename does not exist: " ) +YYText() + ": ", ch_c_l );
+ p[0] = p[1] = 0;
+ }
+ return NOTENAME;
+}
+
My_flex_lexer::My_flex_lexer()
{
keytable = new Keyword_table(the_key_tab);
the_id_tab = new Assoc<String, Identifier*>;
defaulttab = 0;
+ data_ch_c_l_m = 0;
+ errorlevel_i_ = 0;
}
int
return (*the_id_tab)[s];
}
+char const*
+My_flex_lexer::here_ch_c_l()
+{
+ return data_ch_c_l_m + yyin->tellg();
+}
+
void
My_flex_lexer::add_identifier(Identifier*i)
{
String
My_flex_lexer::spot()const
{
- return include_stack.top()->name + ": " + lineno();
+ return include_stack.top()->name + ": " + String( lineno() );
}
void
{
if (lexer->include_stack.empty()) {
*mlog << "error at EOF" << s << '\n';
- }else
- *mlog << spot() << ": error:" << s << '\n';
- exit(1);
+ } else {
+ char const* ch_c_l = here_ch_c_l();
+ ch_c_l--;
+ while ( ( *ch_c_l == ' ' ) || ( *ch_c_l == '\t' ) || ( *ch_c_l == '\n' ) )
+ ch_c_l--;
+ ch_c_l++;
+ error( s, ch_c_l );
+ }
}
+
// set the new input to s, remember old file.
void
My_flex_lexer::new_input(String s)
Input_file *newin = new Input_file(s);
include_stack.push(newin);
switch_streams(newin->is);
+ data_ch_c_l_m = newin->sourcefile_l_->ch_c_l();
yylineno = 1;
}