}
}
+<INITIAL,notes,figures,chords,markup>{
+ \" {
+ start_quote ();
+ }
+}
+
<INITIAL,chords,lyrics,notes,figures>\\version{WHITE}* {
yy_push_state (version);
}
return SCM_T;
}
<INITIAL,notes,lyrics>{
- \<\< {
+ \<\< {
return DOUBLE_ANGLE_OPEN;
}
- \>\> {
+ \>\> {
return DOUBLE_ANGLE_CLOSE;
}
}
+
+<INITIAL,notes>{
+ \< {
+ return ANGLE_OPEN;
+ }
+ \> {
+ return ANGLE_CLOSE;
+ }
+}
+
<figures>{
_ {
return FIGURE_SPACE;
yylval.i = String_convert::dec2int (string (YYText () +1));
return E_UNSIGNED;
}
- \" {
- start_quote ();
- }
}
-\" {
- start_quote ();
-}
-<quote>{
- \\{ESCAPED} {
- *yylval.string += to_string (escaped_char (YYText ()[1]));
- }
- [^\\"]+ {
- *yylval.string += YYText ();
- }
- \" {
-
- yy_pop_state ();
-
- /* yylval is union. Must remember STRING before setting SCM*/
- string *sp = yylval.string;
- yylval.scm = scm_makfrom0str (sp->c_str ());
- delete sp;
- return STRING;
- }
- . {
- *yylval.string += YYText ();
- }
-}
-<lyric_quote>{
+<quote,lyric_quote>{
\\{ESCAPED} {
*yylval.string += to_string (escaped_char (YYText ()[1]));
}
string *sp = yylval.string;
yylval.scm = scm_makfrom0str (sp->c_str ());
delete sp;
- return LYRICS_STRING;
+ return is_lyric_state () ? LYRICS_STRING : STRING;
}
. {
*yylval.string += YYText ();
yylval.i = String_convert::dec2int (string (YYText ()));
return UNSIGNED;
}
- \" {
- start_quote ();
- }
- {
return CHORD_MINUS;
}
<markup>{
- \" {
- start_quote ();
- }
\\score {
return SCORE;
}
%token ADDQUOTE "\\addquote"
%token ALIAS "\\alias"
%token ALTERNATIVE "\\alternative"
-%token BOOK "\book"
+%token BOOK "\\book"
%token CHANGE "\\change"
%token CHORDMODE "\\chordmode"
%token CHORDS "\\chords"
%token CHORD_COLON ":"
%token CHORD_MINUS "-"
%token CHORD_SLASH "/"
-%token DOUBLE_ANGLE_CLOSE ">>"
+%token ANGLE_OPEN "<"
+%token ANGLE_CLOSE ">"
%token DOUBLE_ANGLE_OPEN "<<"
+%token DOUBLE_ANGLE_CLOSE ">>"
%token E_BACKSLASH "\\"
%token E_ANGLE_CLOSE "\\>"
%token E_CHAR "\\C[haracter]"
%type <scm> simple_music_property_def
%type <scm> string_number_event
%type <scm> tempo_event
-%type <scm> toplevel_music
%type <outputdef> output_def_body
%type <outputdef> output_def_head
scm_call_2 (proc, PARSER->self_scm (), score->self_scm ());
score->unprotect ();
}
- | toplevel_music {
+ | composite_music {
Music *music = unsmob_music ($1);
SCM proc = PARSER->lexer_->lookup_identifier ("toplevel-music-handler");
scm_call_2 (proc, PARSER->self_scm (), music->self_scm ());
}
;
-toplevel_music:
- composite_music {
- }
- ;
-
embedded_scm:
SCM_T
| SCM_IDENTIFIER
SIMULTANEOUS '{' music_list '}'{
$$ = MAKE_SYNTAX ("simultaneous-music", @$, scm_car ($3));
}
- | simul_open music_list simul_close {
+ | DOUBLE_ANGLE_OPEN music_list DOUBLE_ANGLE_CLOSE {
$$ = MAKE_SYNTAX ("simultaneous-music", @$, scm_car ($2));
}
;
}
;
-chord_open: '<'
- ;
-
-chord_close: '>'
- ;
-
-simul_open: DOUBLE_ANGLE_OPEN
- ;
-
-simul_close: DOUBLE_ANGLE_CLOSE
- ;
-
chord_body:
- chord_open chord_body_elements chord_close
+ ANGLE_OPEN chord_body_elements ANGLE_CLOSE
{
$$ = MAKE_SYNTAX ("event-chord", @$, scm_reverse_x ($2, SCM_EOL));
}
| '|' {
$$ = scm_makfrom0str ("Bar");
}
- | '>' {
+ | ANGLE_CLOSE {
$$ = scm_makfrom0str ("Larger");
}
| '.' {