From: fred Date: Fri, 11 Oct 1996 21:52:05 +0000 (+0000) Subject: lilypond-0.0.3 X-Git-Tag: release/1.5.59~7086 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=79f9effbc0c3cce127dce67fda2f8a9b07f7bb30;p=lilypond.git lilypond-0.0.3 --- diff --git a/lexer.l b/lexer.l index 0063227f4e..a0da226a99 100644 --- a/lexer.l +++ b/lexer.l @@ -23,6 +23,7 @@ const int DOTPRINT=50; // every 50 lines dots %option debug %x notes %x incl +%x quote OPTSIGN !? NOTENAMEI A|B|C|D|E|F|G|As|Bes|Ces|Des|Es|Fes|Ges|Ais|Bis|Cis|Dis|Eis|Fis|Gis @@ -46,16 +47,14 @@ REAL [0-9]+(\.[0-9]*)? {RESTNAME} { const char *s = YYText(); - yylval.string = new String (s); - if (debug_flags & DEBUGTOKEN) - mtor << "rest:"<< yylval.string; + yylval.string = new String (s); + mtor << "rest:"<< yylval.string; return RESTNAME; } {PITCH} { const char *s = YYText(); yylval.string = new String (s); - if (debug_flags & DEBUGTOKEN) - mtor << "pitch:"<< yylval.string; + mtor << "pitch:"<< *yylval.string; return PITCH; } {DURATION} { @@ -73,9 +72,20 @@ REAL [0-9]+(\.[0-9]*)? BEGIN(INITIAL); return '$'; } . { - cout << "SCANNER HOLE `" << YYText()<<'\''<[^\"]* { + yylval.string = new String (YYText()); +} +\" { + BEGIN(INITIAL); + return STRING; } + <> { if(!close_input()) yyterminate(); @@ -91,14 +101,16 @@ REAL [0-9]+(\.[0-9]*)? {REAL} { Real r; - sscanf (YYText(), "%lf", &r); + int cnv=sscanf (YYText(), "%lf", &r); + assert(cnv == 1); + mtor << "token (REAL)" << r; yylval.real = r; return REAL; } [\{\}\[\]\(\)] { - if (debug_flags & DEBUGTOKEN) - cout << "parens\n"; + + mtor << "parens\n"; return YYText()[0]; } [ \t\n]+ { @@ -136,7 +148,7 @@ new_input(String s) if (!lexer) { lexer = new yyFlexLexer; - lexer->set_debug( bool(debug_flags & DEBUGPARSER)); + lexer->set_debug( !monitor.silence("Lexer")); } lexer->switch_streams(newin);