#include "scalar.hh"
#include "translation-property.hh"
#include "script-def.hh"
-#include "symtable.hh"
#include "lookup.hh"
#include "misc.hh"
#include "my-lily-lexer.hh"
// mmm
Mudela_version oldest_version ("1.0.14");
-Mudela_version version ("1.0.14");
+Mudela_version version ("1.0.15");
// needed for bison.simple's malloc() and free()
Array<Musical_pitch> *pitch_arr;
Array<String> * strvec;
Array<int> *intvec;
- Atom * symbol;
- Box *box;
Notename_table *chordmodifiertab;
Duration *duration;
General_script_def * script;
Scalar *scalar;
Simultaneous_music *chord;
String *string;
- Symtable * symtable;
- Symtables* symtables;
Tempo_req *tempo;
Text_def * textdef;
Translator* trans;
%token SHAPE
%token SKIP
%token SPANDYNAMIC
-%token SYMBOLTABLES
-%token TABLE
%token TEMPO
%token TIME_T
%token TIMES
%type <outputdef> output_def
%type <scope> mudela_header mudela_header_body
-%type <box> box
%type <i> open_request_parens close_request_parens
%type <i> sub_quotes sup_quotes
%type <music> simple_element request_chord command_element Simple_music Composite_music
%type <id> identifier_init simple_identifier_init block_identifier
%type <duration> steno_duration notemode_duration
%type <duration> entered_notemode_duration explicit_duration
-%type <interval> dinterval
%type <intvec> intastint_list int_list
-%type <symtables> symtables symtables_body
%type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
%type <pitch> steno_tonic_pitch
%type <script> script_definition script_body mudela_script gen_script_def
%type <textdef> text_def finger
%type <string> script_abbreviation
-%type <symbol> symboldef
-%type <symtable> symtable symtable_body
%type <trans> translator_spec translator_spec_body
%type <tempo> tempo_request
%type <notenametab> notenames_body notenames_block chordmodifiers_block
-/* 5 extra for notemode_chord */
-%expect 15
+%expect 7
%left '-' '+'
$$ = new Midi_def_identifier ($1, MIDI_IDENTIFIER);
}
- | symtables {
- $$ = new Symtables_identifier ($1, IDENTIFIER);
- }
| translator_spec {
$$ = new Translator_identifier ($1, TRANS_IDENTIFIER);
}
THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
$$ = p;
}
- | paper_def_body int '=' symtables { // ugh, what a syntax
- Lookup * l = new Lookup (*$4);
+ | paper_def_body int '=' FONT STRING { // ugh, what a syntax
+ Lookup * l = new Lookup;
+ l->font_name_ = *$5;
+ delete $5;
$$->set_lookup ($2, l);
}
| paper_def_body assignment ';' {
THIS->parser_error (_ ("have to be in Chord mode for chords"));
$$ = $1;
}
- | '@' notemode_chord {
+ | '@' notemode_chord '@' {
if (!THIS->lexer_p_->note_state_b ())
THIS->parser_error (_ ("have to be in Note mode for @chords"));
$$ = $2;
;
chord:
- steno_tonic_pitch notemode_duration chord_additions chord_subtractions chord_inversion {
+ steno_tonic_pitch duration_length chord_additions chord_subtractions chord_inversion {
$$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
};
notemode_chord:
- steno_musical_pitch notemode_duration chord_additions chord_subtractions notemode_chord_inversion {
+ steno_musical_pitch duration_length chord_additions chord_subtractions notemode_chord_inversion {
$$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
};
{
$$ = new Array<Musical_pitch>;
}
- | '-' {
- $$ = new Array<Musical_pitch>;
- }
- | chord_additions chord_addsub {
+ | chord_additions '-' chord_addsub {
$$ = $1;
- $$->push (*$2);
+ $$->push (*$3);
}
;
;
chord_note:
- UNSIGNED {
+ unsigned {
$$ = new Musical_pitch;
$$->notename_i_ = ($1 - 1) % 7;
$$->octave_i_ = $1 > 7 ? 1 : 0;
$$->accidental_i_ = 0;
}
- | UNSIGNED '+' {
+ | unsigned '+' {
$$ = new Musical_pitch;
$$->notename_i_ = ($1 - 1) % 7;
$$->octave_i_ = $1 > 7 ? 1 : 0;
$$->accidental_i_ = 1;
}
- | UNSIGNED '-' {
+ | unsigned '-' {
$$ = new Musical_pitch;
$$->notename_i_ = ($1 - 1) % 7;
$$->octave_i_ = $1 > 7 ? 1 : 0;
{
$$ = new Array<Musical_pitch>;
}
- | '^' {
- $$ = new Array<Musical_pitch>;
- }
- | chord_subtractions chord_addsub {
+ | chord_subtractions '^' chord_addsub {
$$ = $1;
- $$->push (*$2);
+ $$->push (*$3);
}
;
-/*
- symbol tables
-*/
-symtables:
- SYMBOLTABLES '{' symtables_body '}' { $$ = $3; }
- ;
-
-symtables_body:
- {
- $$ = new Symtables;
- }
- | IDENTIFIER {
- $$ = $1->access_content_Symtables (true);
- }
- | symtables_body FONT STRING {
- $$->font_name_ = *$3;
- delete $3;
- }
- | symtables_body STRING '=' symtable {
- $$->add (*$2, $4);
- delete $2;
- }
- ;
-symtable:
- TABLE '{' symtable_body '}' { $$ = $3; }
- ;
-symtable_body:
- { $$ = new Symtable; }
- | symtable_body STRING symboldef {
- $$->elem (*$2) = *$3;
- delete $2;
- delete $3;
- }
- ;
-
-symboldef:
- STRING unsigned box {
- // ignore #args
- $$ = new Atom (*$1, *$3);
- delete $1;
- delete $3;
- }
- | STRING unsigned {
- Box b (Interval (0,0), Interval (0,0));
- // ignore #args
- $$ = new Atom (*$1, b);
- delete $1;
- }
- ;
-
-box:
- dinterval dinterval {
- $$ = new Box (*$1, *$2);
- delete $1;
- delete $2;
- }
- ;
-
-dinterval: real real {
- $$ = new Interval ($1, $2);
- }
- ;
%%