a b ,c
a b c-*
a b c&
+ { a-. b-. }
$
}
@
}
+
+include "this-is-hopefully-a-nonexisting-file"
+
score {
staff {
lyric music { bla }
#include "parser.hh"
#include "debug.hh"
#include "inputscore.hh"
+#include "parseconstruct.hh"
#include "main.hh"
%}
<incl>[ \t]* { /* eat the whitespace */ }
<incl>\"[^"]*\"+ { /* got the include file name */
String s (YYText()+1);
- s = s.left(s.len()-1);
+ s = s.left(s.len()-1);
+ defined_ch_c_l = here_ch_c_l() - String( YYText() ).len() - 1;
new_input(s);
yy_pop_state();
}
/*
could use cleanup
*/
- #include <ctype.h>
+#include <ctype.h>
#include "lexer.hh"
#include "string.hh"
#include "real.hh"
parse_pitchmod(pitch, i, oct, forceacc);
rq->notename =notename[0];
rq->accidental = notename[1];
- rq->octave = oct;
+ rq->octave = oct + notename[2];
rq->forceacc = forceacc;
rq->balltype = dur;
rq->dots = dots;
get_script_req(int d , Script_def*def)
{
Script_req* script_req_p = new Script_req(d, def);
- script_req_p->defined_ch_c_l_m = defined_ch_c_l;
+// script_req_p->defined_ch_c_l_m = req_defined_ch_c_l;
+ // all terminal symbols, rather set directly here:
+ script_req_p->defined_ch_c_l_m = lexer->here_ch_c_l();
return script_req_p;
}
}
%token VOICE STAFF SCORE TITLE BAR OUTPUT MULTIVOICE
-%token CM IN PT MM PAPER WIDTH METER UNITSPACE SKIP COMMANDS COMMAND
+%token CM_T IN_T PT_T MM_T PAPER WIDTH METER UNITSPACE SKIP COMMANDS COMMAND
%token GEOMETRIC START_T DURATIONCOMMAND OCTAVECOMMAND
%token KEY CLEF TABLE VOICES STEM
%token PARTIAL MUSIC GROUPING CADENZA
%token <string> STRING
%token <i> DOTS INT
-%type <consstr> unit
+%type <real> unit
%type <intvec> pitch_list
%type <c> open_request_parens close_request_parens
%type <id> declaration
;
script_req:
- script_dir mudela_script { $$ = get_script_req($1, $2); }
+ script_dir mudela_script {
+ $$ = get_script_req($1, $2);
+ }
;
mudela_script:
dim:
- real unit { $$ = convert_dimen($1,$2); }
+ real unit { $$ = $1*$2; }
;
-unit: CM { $$ = "cm"; }
- |IN { $$ = "in"; }
- |MM { $$ = "mm"; }
- |PT { $$ = "pt"; }
+unit: CM_T { $$ = 1 CM; }
+ |IN_T { $$ = 1 INCH; }
+ |MM_T { $$ = 1 MM; }
+ |PT_T { $$ = 1 PT; }
;
/*
int
Script_def::compare(Script_def const & c)
{
- return (symidx == c.symidx &&
+ return !(symidx == c.symidx &&
stemdir == c.stemdir&&
staffdir == c.staffdir&&
invertsym == c.invertsym);
--- /dev/null
+/*
+ scriptreg.cc -- implement Script_register
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "scriptreg.hh"
+#include "script.hh"
+#include "request.hh"
+#include "complexwalker.hh"
+
+Script_register::Script_register(Complex_walker*w)
+ : Request_register(w)
+{
+ script_p_ = 0;
+}
+
+bool
+Script_register::try_request(Request *r_l)
+{
+ if (!r_l->script())
+ return false ;
+
+ if (accepted_req_arr_.size()
+ && Script_req::compare(*accepted_req_arr_[0]->script(), *r_l->script()))
+
+ return false;
+
+ accepted_req_arr_.push(r_l);
+
+ return true;
+}
+
+void
+Script_register::process_request()
+{
+ if (accepted_req_arr_.size() ) {
+ script_p_ = new Script(accepted_req_arr_[0]->script(), 10);
+ announce_element(
+ Staff_elem_info(script_p_, accepted_req_arr_[0], this));
+ }
+}
+
+void
+Script_register::acknowledge_element(Staff_elem_info info)
+{
+ if (!script_p_)
+ return;
+ if (info.elem_p_->name() == String("Stem"))
+ script_p_->set_stem((Stem*)info.elem_p_);
+ else if (info.req_l_->rhythmic())
+ script_p_->set_support(info.elem_p_->item());
+}
+
+void
+Script_register::do_pre_move_process()
+{
+ if (script_p_){
+ script_p_->dir = dir_i_;
+ typeset_element(script_p_);
+ script_p_ = 0;
+ }
+}
+
+void
+Script_register::set_dir(int i)
+{
+ dir_i_ = i;
+}
#include "string.hh"
#include "proto.hh"
#include "plist.hh"
+#include "lexer.hh"
+#include "debug.hh"
+#include "parseconstruct.hh"
#include "main.hh" // find_file
#include "sourcefile.hh"
void
Source_file::map()
{
+ if ( fildes_i_m == -1 )
+ return;
+
data_caddr_m = (caddr_t)mmap( (void*)0, size_off_m, PROT_READ, MAP_SHARED, fildes_i_m, 0 );
- if ( (int)data_caddr_m == -1 ) {
- cerr << "lilypond: can't map: " << name_str_m << ": " << strerror( errno ) << endl;
- assert( 0 );
- }
+ if ( (int)data_caddr_m == -1 )
+ warning( String( "can't map: " ) + name_str_m + String( ": " ) + strerror( errno ), defined_ch_c_l ); //lexer->here_ch_c_l() );
}
String
void
Source_file::open()
{
- name_str_m = find_file( name_str_m );
+ String name_str = find_file( name_str_m );
+ if ( name_str != "" )
+ name_str_m = name_str;
+
fildes_i_m = ::open( name_str_m, O_RDONLY );
-
+
if ( fildes_i_m == -1 ) {
- cerr << "lilypond: can't open: " << name_str_m << ": " << strerror( errno ) << endl;
- assert( 0 );
+ warning( String( "can't open: " ) + name_str_m + String( ": " ) + strerror( errno ), defined_ch_c_l ); // lexer->here_ch_c_l() );
+ return;
}
struct stat file_stat;
#include "pscore.hh"
#include "debug.hh"
-/* el stupido. This should be done more accurately:
+/** el stupido. This should be done more accurately:
It would be nice to have a Dynamic Programming type of algorithm
similar to TeX's
*/
-
Array<Col_hpositions>
Word_wrap::solve()
{
curcol ++;
break_idx_i++;
}
- mtor << "Adding cols~, next breakpoint " << break_idx_i << '\n';
+
+ *mlog << "[" <<break_idx_i<<"]"<<flush;
breaking.push(minimum);
}