From 53e54ae04a595aed7fbdd318f43cf4a80acad1c6 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:30:04 +0000 Subject: [PATCH] lilypond-0.0.26 --- src/lexer.l | 42 +++++++++++++++++++++--------------------- src/voice.cc | 13 +++++++------ 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/lexer.l b/src/lexer.l index dbe7755601..4446661d8e 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -17,6 +17,8 @@ %option yylineno %option debug %option yyclass="My_flex_lexer" +%option stack + %x notes %x incl %x quote @@ -30,7 +32,8 @@ N [0-9] AN {AA}|{N} PUNCT [?!,.:;] ACCENT [\\'"^] -TEX {AA}|-|{PUNCT}|{ACCENT} +NATIONAL [\241-\377] +TEX {AA}|-|{PUNCT}|{ACCENT}|{NATIONAL} WORD {A}{AN}* ALPHAWORD {A}+ @@ -49,11 +52,11 @@ COMMENT [%#].*\n %% \$ { - BEGIN(notes); + yy_push_state(notes); } \@ { - BEGIN(lyrics); + yy_push_state(lyrics); } {RESTNAME} { @@ -86,9 +89,8 @@ COMMENT [%#].*\n return IDENTIFIER; } String *sp = new String( c); - yylval.string=sp; - return NEWIDENTIFIER; + return STRING; } {PITCHMOD} { @@ -111,13 +113,9 @@ COMMENT [%#].*\n } \$ { - BEGIN(INITIAL); + yy_pop_state(); } -[{}] { - return YYText()[0]; - -} -\"[^\"]*\" { +\"[^"]*\" { String s (YYText()+1); s = s.left(s.len()-1); yylval.string = new String(s); @@ -128,14 +126,14 @@ COMMENT [%#].*\n } \" { - BEGIN(quote); + yy_push_state(quote); } -[^\"]* { +[^"]* { yylval.string = new String (YYText()); } \" { mtor << "quoted string\n"; - BEGIN(INITIAL); + yy_pop_state(); return STRING; } @@ -155,7 +153,7 @@ COMMENT [%#].*\n return l; /* let's try passing tex's typesetting macros like \ss \alpha \c */ - String* str_p = new String(YYText()); + String* str_p = new String(YYText());//huh? return STRING; /* and skip identifiers... @@ -167,10 +165,10 @@ COMMENT [%#].*\n String *sp = new String( c); yylval.string=sp; - return NEWIDENTIFIER; + return STRING; */ } -\"[^\"]*\" { +\"[^"]*\" { String s (YYText()+1); s = s.left(s.len()-1); yylval.string = new String(s); @@ -204,7 +202,7 @@ COMMENT [%#].*\n [ \t\n]+ { } @ { - BEGIN(INITIAL); + yy_pop_state(); } <> { @@ -215,13 +213,15 @@ COMMENT [%#].*\n } -include { BEGIN(incl); } +include { + yy_push_state(incl); +} [ \t]* { /* eat the whitespace */ } \"[^"]*\"+ { /* got the include file name */ String s (YYText()+1); s = s.left(s.len()-1); new_input(s); - BEGIN(INITIAL); + yy_pop_state(); } @@ -239,7 +239,7 @@ include { BEGIN(incl); } String *sp = new String( c); mtor << "new id: " << *sp << eol; yylval.string=sp; - return NEWIDENTIFIER; + return STRING; } {REAL} { diff --git a/src/voice.cc b/src/voice.cc index 334d1b4a5f..818e723b42 100644 --- a/src/voice.cc +++ b/src/voice.cc @@ -18,7 +18,7 @@ Voice::Voice() void Voice::add(Voice_element*v) { - v->voice_ = this; + v->voice_l_ = this; elts.bottom().add(v); } @@ -59,9 +59,10 @@ void Voice_element::add(Request*r) { if (r->rhythmic()) { - assert (!duration); + assert (!duration || duration == r->duration()); duration = r->duration(); } + r->elt_l_ = this; reqs.bottom().add(r); } @@ -69,15 +70,15 @@ Voice_element::add(Request*r) Voice_element::Voice_element() { - voice_ = 0; - group = 0; + voice_l_ = 0; +// group = 0; duration = 0.0; } Voice_element::Voice_element(Voice_element const&src) { - voice_=src.voice_; + voice_l_=0; for (iter_top(src.reqs, i); i.ok(); i++) add(i->clone()); - group=src.group; +// group=src.group; } -- 2.39.5