--- /dev/null
+#include "clefitem.hh"
+#include "string.hh"
+#include "molecule.hh"
+#include "paper.hh"
+#include "lookup.hh"
+#include "clef.hh"
+
+Clef_item::Clef_item()
+{
+ read("violin");
+}
+void
+Clef_item::read(String t)
+{
+ type = t;
+ if (type == "violin")
+ y_off = 2;
+ if (type == "bass")
+ y_off = 6;
+}
+void
+Clef_item::read(Clef k)
+{
+ read(k.clef_type);
+}
+
+void
+Clef_item::preprocess()
+{
+ Symbol s = paper()->lookup_->clef(type);
+ output = new Molecule(Atom(s));
+ output->translate(Offset(0, paper()->interline()/2 * y_off));
+}
+
Request* request;
int i;
char c;
+ svec<String> * strvec;
}
%token VOICE STAFF SCORE TITLE RHYTHMSTAFF BAR NOTENAME OUTPUT
%token CM IN PT MM PAPER WIDTH METER UNITSPACE SKIP COMMANDS
%token MELODICSTAFF GEOMETRIC START_T DURATIONCOMMAND OCTAVECOMMAND
+%token KEY CLEF VIOLIN BASS
%token <id> IDENTIFIER
%token <string> NEWIDENTIFIER
%type <i> int
%type <scommands> score_commands_block score_commands_body
%type <request> post_request pre_request
-
-
+%type <strvec> pitch_list
+%type <string> clef_id
%%
mudela: /* empty */
;
voice_elt:
- PITCH DURATION {
+ PITCH DURATION {
$$ = get_note_element(*$1, *$2);
delete $1;
delete $2;
}
;
+pitch_list: {
+ $$ = new svec<String>;
+ }
+ | pitch_list PITCH {
+ $$->add(*$2);
+ delete $2;
+ }
+
score_command:
SKIP int ':' REAL {
$$ = get_skip_command($2, $4);
| METER int int {
$$ = get_meterchange_command($2, $3);
}
+ | KEY '$' pitch_list '$' {/*UGH*/
+ $$ = get_key_interpret_command(*$3);
+ delete $3;
+ }
+ | CLEF clef_id {
+ $$ = get_clef_interpret_command(*$2);
+ delete $2;
+ }
/* | PARTIALMEASURE REAL {
$$ = get_partial_command($2);
}*/
;
-
+clef_id:
+ VIOLIN { $$ = new String("violin"); }
+ | BASS { $$ = new String("bass"); }
+ ;
int:
REAL {
$$ = int($1);