#include <FlexLexer.h>
+#include "lily-proto.hh"
#include "proto.hh"
#include "fproto.hh"
#include "varray.hh"
/// lexer for Mudela
class My_lily_lexer : public Includable_lexer {
int lookup_keyword(String);
- void lookup_notename(int &large, int &small, String s);
int scan_bare_word(String);
int scan_escaped_word(String);
bool post_quotes_b_;
public:
- void * lexval_l;
-
+ void * lexval_l;
+ Notename_table *note_tab_p_;
Assoc<String, Identifier*> *identifier_assoc_p_;
Keyword_table * keytable_p_;
int errorlevel_i_;
/* *************** */
+ void clear_notenames();
Identifier*lookup_identifier(String s);
-
+ Melodic_req* lookup_melodic_req_l(String s);
void push_note_state();
void push_lyric_state();
void pop_state();
~My_lily_lexer();
int yylex();
void print_declarations(bool init_b) const;
-
+ void add_notename(String, Melodic_req*);
bool note_state_b() const;
bool lyric_state_b() const;
};
/*
- my-lily-parser.hh -- declare
+ my-lily-parser.hh -- declare My_lily_parser
source file of the LilyPond music typesetter
Voice_element* get_word_element(Text_def*, Duration*);
void set_last_duration(Duration const *);
void set_duration_mode(String s);
-public:
friend int yyparse( void*);
-
+public:
int default_octave_i_;
Duration default_duration_;
String textstyle_str_;
bool last_duration_mode ;
-
Array<Request*> pre_reqs, post_reqs;
int fatal_error_i_;
Sources * source_l_;
My_lily_lexer * lexer_p_;
Moment plet_mom();
+ void add_notename(String, Melodic_req* req_p);
Input here_input()const;
void remember_spot();
Input pop_spot();
Paper_def*default_paper();
void do_yyparse();
void parser_error(String);
+ void clear_notenames();
Request* get_parens_request(char c);
#include "voice-element.hh"
#include "musical-request.hh"
#include "command-request.hh"
+#include "parser.hh"
+
+void
+My_lily_parser::clear_notenames()
+{
+ lexer_p_->clear_notenames();
+}
void
My_lily_parser::set_debug()
void
My_lily_parser::parser_error(String s)
{
- lexer_p_->LexerError(s);
-
+ here_input().error(s);
if ( fatal_error_i_ )
exit( fatal_error_i_ );
error_level_i_ = 1;
{
Request* req_p=0;
switch (c) {
- case '|':
- req_p = new Barcheck_req;
- break;
case '[':
case ']':
}
break;
-
+ case '>':
+ case '!':
+ case '<':
+ req_p = new Span_dynamic_req;
+ break;
+
case ')':
case '(':
req_p = new Slur_req;
}
switch (c) {
+ case '<':
+ case '>':
case '(':
case '[':
req_p->span()->spantype = Span_req::START;
break;
+ case '!':
case ')':
case ']':
req_p->span()->spantype = Span_req::STOP;
break;
}
+ if (req_p->musical()->span_dynamic()) {
+ Span_dynamic_req* s_l= (req_p->musical()->span_dynamic()) ;
+ s_l->dynamic_dir_i_ = (c == '<') ? 1:-1;
+ }
+
req_p->set_spot( here_input());
return req_p;
}
Source_file * f_l= lexer_p_->source_file_l();
return Input(f_l, here_ch_C());
}
+
+void
+My_lily_parser::add_notename(String s, Melodic_req * m_p)
+{
+ lexer_p_->add_notename(s, m_p);
+}