don't use ASSIGN_EVENT_ONCE for Figured_bass_engraver. Fixes #128.
minor cleanups
change naming: print-page-number becomescreate-page-number-stencil. This avoids nameclash withprint-page-number boolean, and fixes page number printing.
if (to_boolean (get_property ("ignoreFiguredBassRest")))
{
new_event_found_ = true;
- ASSIGN_EVENT_ONCE (rest_event_, ev);
+
+ /*
+ No ASSIGN_EVENT_ONCE() ; otherwise we get warnings about
+ polyphonic rests.
+ */
+ rest_event_ = ev;
}
}
int identifier_type (SCM);
char escaped_char (char) const;
+ Lily_parser *parser_;
Keyword_table *keytable_;
SCM scopes_;
SCM start_module_;
void *lexval;
Input *lexloc;
bool is_main_input_;
-
+
Sources *sources_;
/* Scheme hash tables with (oct name acc) values, and symbol keys. */
int error_level_;
Input last_input_;
- Lily_lexer (Sources *);
+ Lily_lexer (Sources *, Lily_parser *);
Lily_lexer (Lily_lexer const &);
int yylex ();
Translator *get_translator (SCM s);
Moment get_event_length (Stream_event *s);
DECLARE_UNSMOB (Translator, translator);
+
+
+/*
+ This helper is only meaningful inside listen_* methods.
+*/
+extern bool internal_event_assignment (Stream_event **old_ev, Stream_event *new_ev, const char *function);
+#define ASSIGN_EVENT_ONCE(o,n) internal_event_assignment (&o, n, __FUNCTION__)
+
+
#endif // TRANSLATOR_HH
listen_ ## m (ev); \
}
-/*
- This helper is only meaningful inside listen_* methods.
-*/
-extern bool internal_event_assignment (Stream_event **old_ev, Stream_event *new_ev, const char *function);
-#define ASSIGN_EVENT_ONCE(o,n) internal_event_assignment (&o, n, __FUNCTION__)
-
#endif /* TRANSLATOR_ICC */
#include "scm-hash.hh"
#include "source-file.hh"
#include "warn.hh"
+#include "program-option.hh"
+#include "lily-parser.hh"
static Keyword_ent the_key_tab[]
= {
{0, 0}
};
-Lily_lexer::Lily_lexer (Sources *sources)
+Lily_lexer::Lily_lexer (Sources *sources, Lily_parser *parser)
{
+ parser_ = parser;
keytable_ = new Keyword_table (the_key_tab);
chordmodifier_tab_ = SCM_EOL;
pitchname_tab_stack_ = SCM_EOL;
void
Lily_lexer::start_main_input ()
{
- // yy_flex_debug = 1;
+ yy_flex_debug = get_program_option ("debug-lexer");
+ parser_->set_yydebug (get_program_option ("debug-parser"));
+
+
new_input (main_input_name_, sources_);
/* Do not allow \include in --safe-mode */
Lily_lexer *lexer = (Lily_lexer *) SCM_CELL_WORD_1 (s);
scm_gc_mark (lexer->chordmodifier_tab_);
+ if (lexer->parser_)
+ scm_gc_mark (lexer->parser_->self_scm ());
scm_gc_mark (lexer->pitchname_tab_stack_);
scm_gc_mark (lexer->start_module_);
return lexer->scopes_;
smobify_self ();
- lexer_ = new Lily_lexer (sources_);
+ lexer_ = new Lily_lexer (sources_, this);
lexer_->unprotect ();
}
lexer_->main_input_name_ = name;
message (_ ("Parsing..."));
- // progress_indication ("\n");
set_yydebug (0);
new_ev->self_scm ())))
{
/* extract event class from function name */
- const char *prefix = "listen_";
string ev_class = function;
+
/* This assertion fails if EVENT_ASSIGNMENT was called outside a
translator listener. Don't do that. */
+ const char *prefix = "listen_";
assert (0 == ev_class.find (prefix));
/* "listen_foo_bar" -> "foo-bar" */
}
ADD_TRANSLATOR (Translator,
- "Base class. Unused",
+ "Base class. Not instantiated.",
"",
"",
"");
}
#(define (first-page layout props arg)
- (if (= (chain-assoc-get 'page:page-number props -1)
- (ly:output-def-lookup layout 'first-page-number)) (interpret-markup layout props arg)
- empty-stencil))
+ (if (= (chain-assoc-get 'page:page-number props -1)
+ (ly:output-def-lookup layout 'first-page-number))
+ (interpret-markup layout props arg)
+ empty-stencil))
#(define (last-page layout props arg)
(if (chain-assoc-get 'page:last? props #f)
(interpret-markup layout props arg)
empty-stencil))
-#(define (print-page-number layout props arg)
+#(define (create-page-number-stencil layout props arg)
(if (eq? (ly:output-def-lookup layout 'print-page-number) #t)
(interpret-markup layout props arg)
empty-stencil))
(if (or (not (= (chain-assoc-get 'page:page-number props -1)
(ly:output-def-lookup layout 'first-page-number)))
(eq? (ly:output-def-lookup layout 'print-first-page-number) #t))
- (print-page-number layout props arg)
+ (create-page-number-stencil layout props arg)
empty-stencil))
oddHeaderMarkup = \markup
(debug-gc #f
"dump memory debugging statistics")
(debug-midi #f "generate human readable MIDI")
+ (debug-parser #f "debug the bison parser")
+ (debug-lexer #f "debug the flex lexer")
+ (debug-midi #f "generate human readable MIDI")
(delete-intermediate-files #f
"delete unusable PostScript files")
(dump-signatures #f "dump output signatures of each system")
ALL_LDFLAGS = $(LDFLAGS) $(CONFIG_LDFLAGS) $($(PACKAGE)_LDFLAGS) $(MODULE_LDFLAGS) $(CONFIG_LDFLAGS)
-PIC_FLAGS = -fpic -fPIC
ifeq ($(MINGW_BUILD),)
+PIC_FLAGS = -fpic -fPIC
SHARED_FLAGS = -shared
else
SHARED_FLAGS = -mdll