*/
+#include <iostream.h>
#include <ctype.h>
-//#include <iostream>
-
#include "translator-def.hh"
#include "lily-guile.hh"
#include "change-iterator.hh"
#include "music-list.hh"
#include "output-property-music-iterator.hh"
#include "property-iterator.hh"
-#include "file-results.hh"
+#include "input-file-results.hh"
#include "input.hh"
#include "relative-music.hh"
#include "lyric-combine-music.hh"
Music * p = new Music (SCM_EOL);
p->set_mus_property ("symbol", sym);
p->set_mus_property ("iterator-ctor",
- Property_iterator::constructor_cxx_function);
+ Property_iterator::constructor_proc);
p->set_mus_property ("value", value);
return p;
// needed for bison.simple's malloc () and free ()
-#include <malloc.h>
+// #include <malloc.h>
#include <stdlib.h>
((My_lily_parser *) my_lily_parser)
#define yyerror THIS->parser_error
-#define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f ("Expecting %d arguments", s))
%}
%token NAME
%token PITCHNAMES
%token NOTES
+%token ONCE
%token PAPER
%token PARTIAL
%token PENALTY
%token E_CHAR E_EXCLAMATION E_SMALLER E_BIGGER E_OPEN E_CLOSE
%token E_LEFTSQUARE E_RIGHTSQUARE E_TILDE
%token E_BACKSLASH
-%token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET
+%token <i> E_UNSIGNED
+%token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET CHORD_SLASH
%token FIGURE_SPACE
-
%type <i> exclamations questions dots optional_rest
%type <i> bass_number bass_mod
%type <scm> br_bass_figure bass_figure figure_list figure_spec
%type <i> tremolo_type
%type <i> bare_int bare_unsigned
%type <i> script_dir
-
%type <scm> identifier_init
%type <scm> steno_duration optional_notemode_duration multiplied_duration
%type <scm> embedded_scm scalar
%type <music> Music Sequential_music Simultaneous_music
%type <music> relative_music re_rhythmed_music part_combined_music
-%type <music> property_def translator_change
+%type <music> property_def translator_change simple_property_def
%type <scm> Music_list
%type <outputdef> music_output_def_body
%type <request> shorthand_command_req
%type <music> command_req verbose_command_req
%type <request> extender_req
%type <request> hyphen_req
+%type <request> string_request
%type <scm> string bare_number number_expression number_term number_factor
%type <score> score_block score_body
THIS->lexer_->chordmodifier_tab_ = $1;
}
| lilypond_header {
- if (global_header)
- scm_gc_unprotect_object (global_header->self_scm ());
- global_header = $1;
+ if (THIS->input_file_->header_)
+ scm_gc_unprotect_object (THIS->input_file_->header_->self_scm ());
+ THIS->input_file_->header_ = $1;
}
| score_block {
- score_globals.push ($1);
+ THIS->input_file_->scores_.push ($1);
}
| output_def {
if (dynamic_cast<Paper_def*> ($1))
if (! regular_identifier_b ($1))
{
- ip.warning (_ ("Identifier should have alphabetic characters only"));
+ ip.warning (_ ("Identifier should have alphabetic characters only"));
}
THIS->lexer_->set_identifier ($1, $4);
}
| translator_spec_body ALIAS STRING {
Translator_def*td = unsmob_translator_def ($$);
- td->type_aliases_ = gh_cons ($3, td->type_aliases_);
+ td->type_aliases_ = scm_cons ($3, td->type_aliases_);
}
| translator_spec_body GROBDESCRIPTIONS embedded_scm {
Translator_def*td = unsmob_translator_def($$);
to have efficient append.
*/
Music_list: /* empty */ {
- $$ = gh_cons (SCM_EOL, SCM_EOL);
+ $$ = scm_cons (SCM_EOL, SCM_EOL);
}
| Music_list Music {
SCM s = $$;
- SCM c = gh_cons ($2->self_scm (), SCM_EOL);
+ SCM c = scm_cons ($2->self_scm (), SCM_EOL);
scm_gc_unprotect_object ($2->self_scm ()); /* UGH */
if (gh_pair_p (ly_cdr (s)))
gh_set_cdr_x (ly_cdr (s), c); /* append */
/*
we can not get durations and other stuff correct down the line, so we have to
add to the duration log here.
-
- TODO: do dots.
*/
SCM func = scm_primitive_eval (ly_symbol2scm ("shift-duration-log"));
- gh_call2 (func, r->self_scm (), gh_int2scm(-intlog2 ($3)));
+ if (($3 % 3) == 0)
+ gh_call3 (func, r->self_scm (), gh_int2scm(-intlog2 ($3*2/3)),gh_int2scm(1));
+ else
+ gh_call3 (func, r->self_scm (), gh_int2scm(-intlog2 ($3)), gh_int2scm(0));
}
set_music_properties (r, result);
{
THIS->parser_error (_ ("Second argument must be a symbol"));
}
- /*hould check # args */
+ /* Should check # args */
if (!gh_procedure_p (pred))
{
- THIS->parser_error (_ ("First argument must be a procedure taking 1 argument"));
+ THIS->parser_error (_ ("First argument must be a procedure taking one argument"));
}
Music *m = new Music (SCM_EOL);
m->set_mus_property ("grob-property", $3);
m->set_mus_property ("grob-value", $5);
m->set_mus_property ("iterator-ctor",
- Output_property_music_iterator::constructor_cxx_function);
+ Output_property_music_iterator::constructor_proc);
$$ = m;
}
| AUTOCHANGE STRING Music {
Music * chm = new Music_wrapper (SCM_EOL);
chm->set_mus_property ("element", $3->self_scm ());
- chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_cxx_function);
+ chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_proc);
scm_gc_unprotect_object ($3->self_scm ());
chm->set_mus_property ("what", $2);
SCM ms = SCM_EOL;
if (stopm) {
stopm = stopm->clone ();
- ms = gh_cons (stopm->self_scm (), ms);
+ ms = scm_cons (stopm->self_scm (), ms);
scm_gc_unprotect_object (stopm->self_scm ());
}
- ms = gh_cons ($2->self_scm (), ms);
+ ms = scm_cons ($2->self_scm (), ms);
scm_gc_unprotect_object ($2->self_scm());
if (startm) {
startm = startm->clone ();
- ms = gh_cons (startm->self_scm () , ms);
+ ms = scm_cons (startm->self_scm () , ms);
scm_gc_unprotect_object (startm->self_scm ());
}
TRANSLATOR STRING '=' STRING {
Music * t = new Music (SCM_EOL);
t->set_mus_property ("iterator-ctor",
- Change_iterator::constructor_cxx_function);
+ Change_iterator::constructor_proc);
t-> set_mus_property ("change-to-type", $2);
t-> set_mus_property ("change-to-id", $4);
;
property_def:
+ simple_property_def
+ | ONCE simple_property_def {
+ $$ = $2;
+ SCM e = $2->get_mus_property ("element");
+ unsmob_music (e)->set_mus_property ("once", SCM_BOOL_T);
+ }
+ ;
+
+simple_property_def:
PROPERTY STRING '.' STRING '=' scalar {
Music *t = set_property_music (scm_string_to_symbol ($4), $6);
Music *t = new Music (SCM_EOL);
t->set_mus_property ("iterator-ctor",
- Property_unset_iterator::constructor_cxx_function);
+ Property_unset_iterator::constructor_proc);
t->set_mus_property ("symbol", scm_string_to_symbol ($4));
Context_specced_music *csm = new Context_specced_music (SCM_EOL);
csm-> set_mus_property ("context-type", $2);
}
| PROPERTY STRING '.' STRING SET embedded_scm '=' embedded_scm {
+ bool autobeam
+ = gh_equal_p ($4, scm_makfrom0str ("autoBeamSettings"));
+ bool itc = internal_type_checking_global_b;
Music *t = new Music (SCM_EOL);
t->set_mus_property ("iterator-ctor",
- Push_property_iterator::constructor_cxx_function);
+ Push_property_iterator::constructor_proc);
t->set_mus_property ("symbol", scm_string_to_symbol ($4));
t->set_mus_property ("pop-first", SCM_BOOL_T);
+ if (autobeam)
+ internal_type_checking_global_b = false;
t->set_mus_property ("grob-property", $6);
+ if (autobeam)
+ internal_type_checking_global_b = itc;
t->set_mus_property ("grob-value", $8);
Context_specced_music *csm = new Context_specced_music (SCM_EOL);
csm->set_mus_property ("element", t->self_scm ());
csm-> set_mus_property ("context-type", $2);
}
- | PROPERTY STRING '.' STRING OVERRIDE embedded_scm '=' embedded_scm {
+ | PROPERTY STRING '.' STRING OVERRIDE
+ embedded_scm '=' embedded_scm
+ {
+ /*
+ UGH UGH UGH UGH.
+ */
+ bool autobeam
+ = gh_equal_p ($4, scm_makfrom0str ("autoBeamSettings"));
+ bool itc = internal_type_checking_global_b;
+
Music *t = new Music (SCM_EOL);
t->set_mus_property ("iterator-ctor",
- Push_property_iterator::constructor_cxx_function);
+ Push_property_iterator::constructor_proc);
t->set_mus_property ("symbol", scm_string_to_symbol ($4));
+
+ if (autobeam)
+ internal_type_checking_global_b = false;
t->set_mus_property ("grob-property", $6);
t->set_mus_property ("grob-value", $8);
+ if (autobeam)
+ internal_type_checking_global_b = itc;
+
Context_specced_music *csm = new Context_specced_music (SCM_EOL);
csm->set_mus_property ("element", t->self_scm ());
scm_gc_unprotect_object (t->self_scm ());
$$->set_spot (THIS->here_input ());
csm-> set_mus_property ("context-type", $2);
+
}
| PROPERTY STRING '.' STRING REVERT embedded_scm {
Music *t = new Music (SCM_EOL);
+ bool autobeam
+ = gh_equal_p ($4, scm_makfrom0str ("autoBeamSettings"));
+ bool itc = internal_type_checking_global_b;
+
t->set_mus_property ("iterator-ctor",
- Pop_property_iterator::constructor_cxx_function);
+ Pop_property_iterator::constructor_proc);
t->set_mus_property ("symbol", scm_string_to_symbol ($4));
+ if (autobeam)
+ internal_type_checking_global_b = false;
t->set_mus_property ("grob-property", $6);
-
+ if (autobeam)
+ internal_type_checking_global_b = itc;
+
Context_specced_music *csm = new Context_specced_music (SCM_EOL);
csm->set_mus_property ("element", t->self_scm ());
scm_gc_unprotect_object (t->self_scm ());
command_element:
command_req {
$$ = new Request_chord (SCM_EOL);
- $$->set_mus_property ("elements", gh_cons ($1->self_scm (), SCM_EOL));
+ $$->set_mus_property ("elements", scm_cons ($1->self_scm (), SCM_EOL));
scm_gc_unprotect_object ($1->self_scm());
$$-> set_spot (THIS->here_input ());
l->set_spot (THIS->here_input ());
$$ = new Request_chord (SCM_EOL);
- $$->set_mus_property ("elements", gh_cons (l->self_scm (), SCM_EOL));
+ $$->set_mus_property ("elements", scm_cons (l->self_scm (), SCM_EOL));
scm_gc_unprotect_object (l->self_scm());
$$->set_spot (THIS->here_input ());
}
l->set_spot (THIS->here_input ());
$$ = new Request_chord (SCM_EOL);
- $$->set_mus_property ("elements", gh_cons (l->self_scm (), SCM_EOL));
+ $$->set_mus_property ("elements", scm_cons (l->self_scm (), SCM_EOL));
$$->set_spot (THIS->here_input ());
scm_gc_unprotect_object (l->self_scm());
}
| E_BACKSLASH {
- $$ = new Music (gh_list (gh_cons (ly_symbol2scm ("name"), ly_symbol2scm ("separator")), SCM_UNDEFINED));
+ $$ = new Music (gh_list (scm_cons (ly_symbol2scm ("name"), ly_symbol2scm ("separator")), SCM_UNDEFINED));
$$->set_spot (THIS->here_input ());
}
| '|' {
$$ = csm;
$$->set_spot (THIS->here_input ());
- csm->set_mus_property ("context-type", scm_makfrom0str ("Score"));
+ csm->set_mus_property ("context-type", scm_makfrom0str ("Timing"));
}
| PARTIAL duration_length {
Moment m = - unsmob_duration ($2)->length_mom ();
scm_gc_unprotect_object (p->self_scm ());
$$ =sp ;
- sp-> set_mus_property ("context-type", scm_makfrom0str ( "Score"));
+ sp-> set_mus_property ("context-type", scm_makfrom0str ("Timing"));
}
| CLEF STRING {
SCM func = scm_primitive_eval (ly_symbol2scm ("clef-name-to-properties"));
for (SCM s = result ; gh_pair_p (s); s = ly_cdr (s)) {
Music * p = new Music (SCM_EOL);
set_music_properties (p, ly_car (s));
- l = gh_cons (p->self_scm (), l);
+ l = scm_cons (p->self_scm (), l);
scm_gc_unprotect_object (p->self_scm ());
}
Sequential_music * seq = new Sequential_music (SCM_EOL);
Context_specced_music * sp = new Context_specced_music (SCM_EOL);
sp->set_mus_property ("element", seq->self_scm ());
-
-
scm_gc_unprotect_object (p3->self_scm ());
scm_gc_unprotect_object (p2->self_scm ());
scm_gc_unprotect_object (p1->self_scm ());
$$ = sp;
-/*
- TODO: should make alias TimingContext for Score
-*/
-
- sp-> set_mus_property ("context-type", scm_makfrom0str ( "Score"));
+ sp-> set_mus_property ("context-type", scm_makfrom0str ( "Timing"));
}
;
verbose_request
| request_with_dir
| close_request
+ | string_request
+ ;
+
+
+string_request:
+ E_UNSIGNED {
+ String_number_req* s = new String_number_req;
+ s->set_mus_property ("string-number", gh_int2scm($1));
+ s->set_spot (THIS->here_input ());
+ $$ = s;
+ }
;
| '.' {
$$ = scm_makfrom0str ("Dot");
}
+ | '_' {
+ $$ = scm_makfrom0str ("Underscore");
+ }
;
script_dir:
fraction:
FRACTION { $$ = $1; }
| UNSIGNED '/' UNSIGNED {
- $$ = gh_cons (gh_int2scm ($1), gh_int2scm ($3));
+ $$ = scm_cons (gh_int2scm ($1), gh_int2scm ($3));
}
;
$$ = SCM_EOL;
}
| figure_list br_bass_figure {
- $$ = gh_cons ($2, $1);
+ $$ = scm_cons ($2, $1);
}
;
{
$$ = SCM_EOL;
}
- | '/' steno_tonic_pitch {
+ | CHORD_SLASH steno_tonic_pitch {
$$ = $2;
}
;
chord_step:
chord_note {
- $$ = gh_cons ($1, SCM_EOL);
+ $$ = scm_cons ($1, SCM_EOL);
}
| CHORDMODIFIER_PITCH {
- $$ = gh_cons (unsmob_pitch ($1)->smobbed_copy (), SCM_EOL);
+ $$ = scm_cons (unsmob_pitch ($1)->smobbed_copy (), SCM_EOL);
}
| CHORDMODIFIER_PITCH chord_note { /* Ugh. */
$$ = scm_list_n (unsmob_pitch ($1)->smobbed_copy (),