#define YYERROR_VERBOSE 1
-My_lily_parser* my_lily_parser;
#define YYPARSE_PARAM my_lily_parser
#define YYLEX_PARAM my_lily_parser
#define THIS\
tag_music (Music *m, SCM tag, Input ip)
{
SCM tags = m->get_property ("tags");
- if (gh_symbol_p (tag))
+ if (ly_symbol_p (tag))
tags = scm_cons (tag, tags);
- else if (gh_list_p (tag))
- tags = gh_append2 (tag, tags);
+ else if (ly_list_p (tag))
+ tags = ly_append2 (tag, tags);
else
ip.warning (_ ("Tag must be symbol or list of symbols."));
void
set_music_properties (Music *p, SCM a)
{
- for (SCM k = a; gh_pair_p (k); k = ly_cdr (k))
+ for (SCM k = a; ly_pair_p (k); k = ly_cdr (k))
p->internal_set_property (ly_caar (k), ly_cdar (k));
}
bool
ly_input_procedure_p (SCM x)
{
- return gh_procedure_p (x)
- || (gh_pair_p (x) && gh_procedure_p (gh_car (x)));
+ return ly_procedure_p (x)
+ || (ly_pair_p (x) && ly_procedure_p (ly_car (x)));
}
Music*
%pure_parser
-
%token ACCEPTS
%token ADDLYRICS
%token ADDQUOTE
| context_def_spec_body GROBDESCRIPTIONS embedded_scm {
Context_def*td = unsmob_context_def ($$);
- for (SCM p = $3; gh_pair_p (p); p = ly_cdr (p)) {
- SCM tag = gh_caar (p);
+ for (SCM p = $3; ly_pair_p (p); p = ly_cdr (p)) {
+ SCM tag = ly_caar (p);
/* TODO: should make new tag "grob-definition" ? */
td->add_context_mod (scm_list_3 (ly_symbol2scm ("assign"),
- tag, gh_cons (ly_cdar (p), SCM_EOL)));
+ tag, scm_cons (ly_cdar (p), SCM_EOL)));
}
}
| context_def_spec_body context_mod {
guh.
*/
SCM check_funcs = ly_scheme_function ("toplevel-music-functions");
- for (; gh_pair_p (check_funcs); check_funcs = gh_cdr (check_funcs))
- m = gh_call1 (gh_car (check_funcs), m);
+ for (; ly_pair_p (check_funcs); check_funcs = ly_cdr (check_funcs))
+ m = scm_call_1 (ly_car (check_funcs), m);
$$->music_ = m;
}
junk this ? there already is tempo stuff in
music.
*/
- int m = gh_scm2int ( $2->get_property ("metronome-count"));
+ int m = ly_scm2int ( $2->get_property ("metronome-count"));
Duration *d = unsmob_duration ($2->get_property ("tempo-unit"));
Midi_def *md = dynamic_cast<Midi_def*> ($$);
if (md)
TEMPO steno_duration '=' bare_unsigned {
$$ = MY_MAKE_MUSIC ("MetronomeChangeEvent");
$$->set_property ("tempo-unit", $2);
- $$->set_property ("metronome-count", gh_int2scm ( $4));
+ $$->set_property ("metronome-count", scm_int2num ( $4));
}
;
SCM s = $$;
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 */
+ if (ly_pair_p (ly_cdr (s)))
+ scm_set_cdr_x (ly_cdr (s), c); /* append */
else
- gh_set_car_x (s, c); /* set first cons */
- gh_set_cdr_x (s, c); /* remember last cell */
+ scm_set_car_x (s, c); /* set first cons */
+ scm_set_cdr_x (s, c); /* remember last cell */
}
| Music_list error {
}
{
Music *beg = $4;
int times = $3;
- SCM alts = gh_pair_p ($5) ? gh_car ($5) : SCM_EOL;
+ SCM alts = ly_pair_p ($5) ? ly_car ($5) : SCM_EOL;
if (times < scm_ilength (alts)) {
- unsmob_music (gh_car (alts))
+ unsmob_music (ly_car (alts))
->origin ()->warning (
_ ("More alternatives than repeats. Junking excess alternatives."));
alts = ly_truncate_list (times, alts);
r-> set_property ("element", beg->self_scm ());
scm_gc_unprotect_object (beg->self_scm ());
}
- r->set_property ("repeat-count", gh_int2scm (times >? 1));
+ r->set_property ("repeat-count", scm_int2num (times >? 1));
r-> set_property ("elements",alts);
- if (gh_equal_p ($2, scm_makfrom0str ("tremolo"))) {
+ if (ly_equal_p ($2, scm_makfrom0str ("tremolo"))) {
/*
TODO: move this code to Scheme.
*/
shift -= 1;
r->compress (Moment (Rational (1, list_len)));
}
- gh_call3 (func, r->self_scm (), gh_int2scm (shift),gh_int2scm (dots));
+ scm_call_3 (func, r->self_scm (), scm_int2num (shift),scm_int2num (dots));
}
r->set_spot (*$4->origin ());
context_mod_list:
/* */ { $$ = SCM_EOL; }
| context_mod_list context_mod {
- $$ = gh_cons ($2, $1);
+ $$ = scm_cons ($2, $1);
}
;
| PARTCOMBINE Music Music {
SCM proc = ly_scheme_function ("make-part-combine-music");
- SCM res = scm_call_1 (proc, gh_list ($2->self_scm (),
+ SCM res = scm_call_1 (proc, scm_listify ($2->self_scm (),
$3->self_scm (), SCM_UNDEFINED));
scm_gc_unprotect_object ($3->self_scm ());
scm_gc_unprotect_object ($2->self_scm ());
fraction Music
{
- int n = gh_scm2int (ly_car ($3)); int d = gh_scm2int (ly_cdr ($3));
+ int n = ly_scm2int (ly_car ($3)); int d = ly_scm2int (ly_cdr ($3));
Music *mp = $4;
$$= MY_MAKE_MUSIC ("TimeScaledMusic");
$$->set_property ("element", mp->self_scm ());
scm_gc_unprotect_object (mp->self_scm ());
- $$->set_property ("numerator", gh_int2scm (n));
- $$->set_property ("denominator", gh_int2scm (d));
+ $$->set_property ("numerator", scm_int2num (n));
+ $$->set_property ("denominator", scm_int2num (d));
$$->compress (Moment (Rational (n,d)));
}
}
else
{
- SCM ret = gh_call1 ($2, $3->self_scm ());
+ SCM ret = scm_call_1 ($2, $3->self_scm ());
Music *m = unsmob_music (ret);
if (!m) {
THIS->parser_error ("\\apply must return a Music");
re_rhythmed_music:
ADDLYRICS Music Music {
Music *l = MY_MAKE_MUSIC ("LyricCombineMusic");
- l->set_property ("elements", gh_list ($2->self_scm (), $3->self_scm (), SCM_UNDEFINED));
+ l->set_property ("elements", scm_listify ($2->self_scm (), $3->self_scm (), SCM_UNDEFINED));
scm_gc_unprotect_object ($3->self_scm ());
scm_gc_unprotect_object ($2->self_scm ());
$$ = l;
OVERRIDE context_prop_spec embedded_scm '=' scalar {
$$ = property_op_to_music (scm_list_4 (
ly_symbol2scm ("poppush"),
- gh_cadr ($2),
+ ly_cadr ($2),
$3, $5));
- $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
+ $$= context_spec_music (ly_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
}
| REVERT context_prop_spec embedded_scm {
$$ = property_op_to_music (scm_list_3 (
ly_symbol2scm ("pop"),
- gh_cadr ($2),
+ ly_cadr ($2),
$3));
- $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
+ $$= context_spec_music (ly_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
}
| SET context_prop_spec '=' scalar {
$$ = property_op_to_music (scm_list_3 (
ly_symbol2scm ("assign"),
- gh_cadr ($2),
+ ly_cadr ($2),
$4));
- $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
+ $$= context_spec_music (ly_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
}
| UNSET context_prop_spec {
$$ = property_op_to_music (scm_list_2 (
ly_symbol2scm ("unset"),
- gh_cadr ($2)));
- $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
+ ly_cadr ($2)));
+ $$= context_spec_music (ly_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
}
| ONCE music_property_def {
SCM e = $2->get_property ("element");
scalar:
string { $$ = $1; }
- | bare_int { $$ = gh_int2scm ($1); }
+ | bare_int { $$ = scm_int2num ($1); }
| embedded_scm { $$ = $1; }
| full_markup { $$ = $1; }
- | DIGIT { $$ = gh_int2scm ($1); }
+ | DIGIT { $$ = scm_int2num ($1); }
;
/*
pre_events simple_element post_events {
SCM elts = $2-> get_property ("elements");
- elts = gh_append2 (elts, scm_reverse_x ($3, SCM_EOL));
+ elts = ly_append2 (elts, scm_reverse_x ($3, SCM_EOL));
$2->set_property ("elements", elts);
$$ = $2;
SCM es = $1->get_property ("elements");
SCM postevs = scm_reverse_x ($3, SCM_EOL);
- for (SCM s = es; gh_pair_p (s); s = gh_cdr (s))
- unsmob_music (gh_car (s))->set_property ("duration", dur);
- es = gh_append2 (es, postevs);
+ for (SCM s = es; ly_pair_p (s); s = ly_cdr (s))
+ unsmob_music (ly_car (s))->set_property ("duration", dur);
+ es = ly_append2 (es, postevs);
$1-> set_property ("elements", es);
$$ = $1;
chord_body_elements:
/* empty */ { $$ = SCM_EOL; }
| chord_body_elements chord_body_element {
- $$ = gh_cons ($2->self_scm (), $1);
+ $$ = scm_cons ($2->self_scm (), $1);
scm_gc_unprotect_object ($2->self_scm ());
}
;
if ($2 % 2 || $3 % 2)
n->set_property ("force-accidental", SCM_BOOL_T);
- if (gh_pair_p ($4)) {
+ if (ly_pair_p ($4)) {
SCM arts = scm_reverse_x ($4, SCM_EOL);
n->set_property ("articulations", arts);
}
n->set_property ("drum-type", $1);
n->set_spot (THIS->here_input ());
- if (gh_pair_p ($2)) {
+ if (ly_pair_p ($2)) {
SCM arts = scm_reverse_x ($2, SCM_EOL);
n->set_property ("articulations", arts);
}
evs = scm_hash_ref (tab, key, SCM_BOOL_F);
}
Music *quote = 0;
- if (gh_vector_p (evs))
+ if (ly_vector_p (evs))
{
quote = MY_MAKE_MUSIC ("QuoteMusic");
quote->set_property ("duration", $3);
}
| E_LEFTSQUARE {
Music *l = MY_MAKE_MUSIC ("LigatureEvent");
- l->set_property ("span-direction", gh_int2scm (START));
+ l->set_property ("span-direction", scm_int2num (START));
l->set_spot (THIS->here_input ());
$$ = MY_MAKE_MUSIC ("EventChord");
}
| E_RIGHTSQUARE {
Music *l = MY_MAKE_MUSIC ("LigatureEvent");
- l->set_property ("span-direction", gh_int2scm (STOP));
+ l->set_property ("span-direction", scm_int2num (STOP));
l->set_spot (THIS->here_input ());
$$ = MY_MAKE_MUSIC ("EventChord");
| TIME_T fraction {
SCM proc= ly_scheme_function ("make-time-signature-set");
- SCM result = scm_apply_2 (proc, gh_car ($2), gh_cdr ($2), SCM_EOL);
+ SCM result = scm_apply_2 (proc, ly_car ($2), ly_cdr ($2), SCM_EOL);
scm_gc_protect_object (result);
$$ = unsmob_music (result);
}
}
| post_events post_event {
$2->set_spot (THIS->here_input ());
- $$ = gh_cons ($2->self_scm (), $$);
+ $$ = scm_cons ($2->self_scm (), $$);
scm_gc_unprotect_object ($2->self_scm ());
}
| post_events tagged_post_event {
}
| script_dir direction_reqd_event {
if ($1)
- $2->set_property ("direction", gh_int2scm ($1));
+ $2->set_property ("direction", scm_int2num ($1));
$$ = $2;
}
| script_dir direction_less_event {
if ($1)
- $2->set_property ("direction", gh_int2scm ($1));
+ $2->set_property ("direction", scm_int2num ($1));
$$ = $2;
}
| string_number_event
string_number_event:
E_UNSIGNED {
Music *s = MY_MAKE_MUSIC ("StringNumberEvent");
- s->set_property ("string-number", gh_int2scm ($1));
+ s->set_property ("string-number", scm_int2num ($1));
s->set_spot (THIS->here_input ());
$$ = s;
}
*/
Music *m = MY_MAKE_MUSIC ("BeamEvent");
m->set_spot (THIS->here_input ());
- m->set_property ("span-direction", gh_int2scm (START));
+ m->set_property ("span-direction", scm_int2num (START));
$$ = m;
}
| ']' {
Music *m = MY_MAKE_MUSIC ("BeamEvent");
m->set_spot (THIS->here_input ());
- m->set_property ("span-direction", gh_int2scm (STOP));
+ m->set_property ("span-direction", scm_int2num (STOP));
$$ = m;
}
| '~' {
| close_event {
$$ = $1;
dynamic_cast<Music *> ($$)->set_property ("span-direction",
- gh_int2scm (START));
+ scm_int2num (START));
}
| open_event {
$$ = $1;
dynamic_cast<Music *> ($$)->set_property ("span-direction",
- gh_int2scm (STOP));
+ scm_int2num (STOP));
}
| EVENT_IDENTIFIER {
$$ = unsmob_music ($1);
| tremolo_type {
Music *a = MY_MAKE_MUSIC ("TremoloEvent");
a->set_spot (THIS->here_input ());
- a->set_property ("tremolo-type", gh_int2scm ($1));
+ a->set_property ("tremolo-type", scm_int2num ($1));
$$ = a;
}
;
| script_abbreviation {
SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ($1));
Music *a = MY_MAKE_MUSIC ("ArticulationEvent");
- if (gh_string_p (s))
+ if (ly_string_p (s))
a->set_property ("articulation-type", s);
else THIS->parser_error (_ ("Expecting string as script definition"));
$$ = a;
oct_check:
/**/ { $$ = SCM_EOL; }
- | '=' { $$ = gh_int2scm (0); }
- | '=' sub_quotes { $$ = gh_int2scm ($2); }
- | '=' sup_quotes { $$ = gh_int2scm ($2); }
+ | '=' { $$ = scm_int2num (0); }
+ | '=' sub_quotes { $$ = scm_int2num ($2); }
+ | '=' sup_quotes { $$ = scm_int2num ($2); }
;
sup_quotes:
}
| DIGIT {
Music *t = MY_MAKE_MUSIC ("FingerEvent");
- t->set_property ("digit", gh_int2scm ($1));
+ t->set_property ("digit", scm_int2num ($1));
t->set_spot (THIS->here_input ());
$$ = t;
}
$$ = unsmob_duration ($$)->compressed ( $3) .smobbed_copy ();
}
| multiplied_duration '*' FRACTION {
- Rational m (gh_scm2int (ly_car ($3)), gh_scm2int (ly_cdr ($3)));
+ Rational m (ly_scm2int (ly_car ($3)), ly_scm2int (ly_cdr ($3)));
$$ = unsmob_duration ($$)->compressed (m).smobbed_copy ();
}
fraction:
FRACTION { $$ = $1; }
| UNSIGNED '/' UNSIGNED {
- $$ = scm_cons (gh_int2scm ($1), gh_int2scm ($3));
+ $$ = scm_cons (scm_int2num ($1), scm_int2num ($3));
}
;
*****************************************************************/
bass_number:
DIGIT {
- $$ = scm_number_to_string (gh_int2scm ($1), gh_int2scm (10));
+ $$ = scm_number_to_string (scm_int2num ($1), scm_int2num (10));
}
| UNSIGNED {
- $$ = scm_number_to_string (gh_int2scm ($1), gh_int2scm (10));
+ $$ = scm_number_to_string (scm_int2num ($1), scm_int2num (10));
}
| STRING { $$ = $1; }
;
Music *m = unsmob_music ($1);
if ($2) {
SCM salter = m->get_property ("alteration");
- int alter = gh_number_p (salter) ? gh_scm2int (salter) : 0;
+ int alter = ly_number_p (salter) ? ly_scm2int (salter) : 0;
m->set_property ("alteration",
- gh_int2scm (alter + $2));
+ scm_int2num (alter + $2));
} else {
- m->set_property ("alteration", gh_int2scm (0));
+ m->set_property ("alteration", scm_int2num (0));
}
}
;
n->set_property ("pitch", $1);
n->set_property ("duration", $5);
- if (gh_number_p ($4))
+ if (ly_number_p ($4))
{
- int q = gh_scm2int ($4);
- n->set_property ("absolute-octave", gh_int2scm (q-1));
+ int q = ly_scm2int ($4);
+ n->set_property ("absolute-octave", scm_int2num (q-1));
}
if ($3 % 2)
Music *m = unsmob_music ($1);
Input i = THIS->pop_spot ();
m->set_spot (i);
- for (SCM s = m->get_property ("elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = m->get_property ("elements"); ly_pair_p (s); s = ly_cdr (s))
{
unsmob_music (ly_car (s))->set_property ("duration", $2);
}
}
| steno_tonic_pitch optional_notemode_duration chord_separator chord_items {
SCM its = scm_reverse_x ($4, SCM_EOL);
- $$ = make_chord ($1, $2, gh_cons ($3, its));
+ $$ = make_chord ($1, $2, scm_cons ($3, its));
}
;
$$ = SCM_EOL;
}
| chord_items chord_item {
- $$ = gh_cons ($2, $$);
+ $$ = scm_cons ($2, $$);
}
;
;
step_numbers:
- step_number { $$ = gh_cons ($1, SCM_EOL); }
+ step_number { $$ = scm_cons ($1, SCM_EOL); }
| step_numbers '.' step_number {
- $$ = gh_cons ($3, $$);
+ $$ = scm_cons ($3, $$);
}
;
bare_number:
UNSIGNED {
- $$ = gh_int2scm ($1);
+ $$ = scm_int2num ($1);
}
| REAL {
$$ = $1;
$$ = $1;
}
| REAL NUMBER_IDENTIFIER {
- $$ = gh_double2scm (gh_scm2double ($1) *gh_scm2double ($2));
+ $$ = scm_make_real (ly_scm2double ($1) *ly_scm2double ($2));
}
| UNSIGNED NUMBER_IDENTIFIER {
- $$ = gh_double2scm ($1 *gh_scm2double ($2));
+ $$ = scm_make_real ($1 *ly_scm2double ($2));
}
;
bare_number {
if (scm_integer_p ($1) == SCM_BOOL_T)
{
- int k = gh_scm2int ($1);
+ int k = ly_scm2int ($1);
$$ = k;
} else
{
markup_list_body:
/**/ { $$ = SCM_EOL; }
| markup_list_body markup {
- $$ = gh_cons ($2, $1);
+ $$ = scm_cons ($2, $1);
}
;
int
My_lily_lexer::try_special_identifiers (SCM *destination, SCM sid)
{
- if (gh_string_p (sid)) {
+ if (ly_string_p (sid)) {
*destination = sid;
return STRING_IDENTIFIER;
- } else if (gh_number_p (sid)) {
+ } else if (ly_number_p (sid)) {
*destination = sid;
return NUMBER_IDENTIFIER;
} else if (unsmob_context_def (sid)) {
property_op_to_music (SCM op)
{
Music *m = 0;
- SCM tag = gh_car (op);
- SCM symbol = gh_cadr (op);
- SCM args = gh_cddr (op);
+ SCM tag = ly_car (op);
+ SCM symbol = ly_cadr (op);
+ SCM args = ly_cddr (op);
SCM grob_val = SCM_UNDEFINED;
SCM grob_sym = SCM_UNDEFINED;
SCM val = SCM_UNDEFINED;
if (tag == ly_symbol2scm ("assign"))
{
m = MY_MAKE_MUSIC ("PropertySet");
- val = gh_car (args);
+ val = ly_car (args);
}
else if (tag == ly_symbol2scm ("unset"))
m = MY_MAKE_MUSIC ("PropertyUnset");
|| tag == ly_symbol2scm ("push"))
{
m = MY_MAKE_MUSIC ("OverrideProperty");
- grob_sym = gh_car (args);
- grob_val = gh_cadr (args);
+ grob_sym = ly_car (args);
+ grob_val = ly_cadr (args);
}
else if (tag == ly_symbol2scm ("pop")) {
m = MY_MAKE_MUSIC ("RevertProperty");
- grob_sym = gh_car (args);
+ grob_sym = ly_car (args);
}
m->set_property ("symbol", symbol);
bool itc = internal_type_checking_global_b;
/* UGH.
*/
- bool autobeam = gh_equal_p (symbol, ly_symbol2scm ("autoBeamSettings"));
+ bool autobeam = ly_equal_p (symbol, ly_symbol2scm ("autoBeamSettings"));
if (autobeam)
internal_type_checking_global_b = false;
m->set_property ("grob-property", grob_sym);
scm_gc_unprotect_object (m->self_scm ());
csm->set_property ("context-type",
- gh_symbol_p (type) ? type : scm_string_to_symbol (type));
+ ly_symbol_p (type) ? type : scm_string_to_symbol (type));
csm->set_property ("property-operations", ops);
- if (gh_string_p (id))
+ if (ly_string_p (id))
csm->set_property ("context-id", id);
return csm;
}