/*
- my-lily-parser.cc -- implement
+ my-lily-parser.cc -- implement My_lily_parser
source file of the LilyPond music typesetter
lexer_p_ = new My_lily_lexer;
set_debug();
+ init_parse_b_ = true;
lexer_p_->new_input(init, source_l_);
do_yyparse();
print_declarations();
init_parse_b_ = false;
+ set_debug();
lexer_p_->new_input(s, source_l_);
do_yyparse();
if(!define_spot_array_.empty())
- warning("Braces don't match.",0);
+ warning("Braces don't match.");
}
My_lily_parser::~My_lily_parser()
void
My_lily_parser::remember_spot()
{
- define_spot_array_.push(here_ch_C());
+ define_spot_array_.push(here_input());
}
char const *
Lyric_req* lreq_p = new Lyric_req(tdef_p);
lreq_p->duration_ = *duration_p;
- lreq_p->defined_ch_C_ = here_ch_C();
+ lreq_p->set_spot( here_input());
velt_p->add(lreq_p);
My_lily_parser::get_rest_element(String, Duration * duration_p )
{
Voice_element* velt_p = new Voice_element;
- velt_p->defined_ch_C_ = lexer_p_->here_ch_C();
+ velt_p->set_spot( here_input());
Rest_req * rest_req_p = new Rest_req;
rest_req_p->duration_ = *duration_p;
- rest_req_p->defined_ch_C_ = here_ch_C();
+ rest_req_p->set_spot( here_input());
velt_p->add(rest_req_p);
delete duration_p;
My_lily_parser::get_note_element(Note_req *rq, Duration * duration_p )
{
Voice_element*v = new Voice_element;
- v->defined_ch_C_ = here_ch_C();
+ v->set_spot( here_input());
if (duration_p->type_i_ >= 2) {
Stem_req * stem_req_p = new Stem_req();
stem_req_p->duration_ = *duration_p;
- stem_req_p->defined_ch_C_ = here_ch_C();
+ stem_req_p->set_spot( here_input());
v->add(stem_req_p);
}
rq->set_duration(*duration_p);
- rq->defined_ch_C_ = here_ch_C();
+ rq->set_spot( here_input());
v->add(rq);
break;
}
- req_p->defined_ch_C_ = here_ch_C();
+ req_p->set_spot( here_input());
return req_p;
}
textstyle_str_="roman"; // in lexer?
error_level_i_ = 0;
last_duration_mode = false;
- defined_ch_C_ = 0;
fatal_error_i_ = 0;
}
}
post_reqs.set_size(0);
}
+
+Input
+My_lily_parser::pop_spot()
+{
+ return define_spot_array_.pop();
+}
+
+Input
+My_lily_parser::here_input()const
+{
+ return Input(source_l_, here_ch_C());
+}