]> git.donarmstrong.com Git - lilypond.git/blob - lily/parser.yy
patch::: 1.3.2.jcn1
[lilypond.git] / lily / parser.yy
1 %{ // -*-Fundamental-*-
2
3 /*
4   parser.yy -- Bison/C++ parser for mudela
5
6   source file of the GNU LilyPond music typesetter
7
8   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9            Jan Nieuwenhuizen <janneke@gnu.org>
10 */
11
12 #include <iostream.h>
13 #include "lily-guile.hh"
14 #include "notename-table.hh"
15 #include "translation-property.hh"
16 #include "lookup.hh"
17 #include "misc.hh"
18 #include "my-lily-lexer.hh"
19 #include "paper-def.hh"
20 #include "midi-def.hh"
21 #include "main.hh"
22 #include "file-path.hh"
23 #include "keyword.hh"
24 #include "debug.hh"
25 #include "dimensions.hh"
26 #include "identifier.hh"
27 #include "command-request.hh"
28 #include "musical-request.hh"
29 #include "my-lily-parser.hh"
30 #include "context-specced-music.hh"
31 #include "translator-group.hh"
32 #include "score.hh"
33 #include "music-list.hh"
34 #include "duration-convert.hh"
35 #include "change-translator.hh"
36 #include "file-results.hh"
37 #include "scope.hh"
38 #include "relative-music.hh"
39 #include "lyric-combine-music.hh"
40 #include "transposed-music.hh"
41 #include "time-scaled-music.hh"
42 #include "repeated-music.hh"
43 #include "mudela-version.hh"
44 #include "grace-music.hh"
45 #include "auto-change-music.hh"
46
47 // mmm
48 Mudela_version oldest_version ("1.1.52");
49
50
51
52 void
53 print_mudela_versions (ostream &os)
54 {
55   os << _f ("Oldest supported input version: %s", oldest_version.str ()) 
56     << endl;
57 }
58 // needed for bison.simple's malloc() and free()
59 #include <malloc.h>
60
61 #ifndef NDEBUG
62 #define YYDEBUG 1
63 #endif
64
65 #define YYERROR_VERBOSE 1
66
67 #define YYPARSE_PARAM my_lily_parser_l
68 #define YYLEX_PARAM my_lily_parser_l
69 #define THIS ((My_lily_parser *) my_lily_parser_l)
70
71 #define yyerror THIS->parser_error
72 #define ARRAY_SIZE(a,s)   if (a.size () != s) THIS->parser_error (_f ("Expecting %d arguments", s))
73
74 %}
75
76
77 %union {
78     Array<Real>* realarr;
79     Array<Musical_pitch> *pitch_arr;
80     Link_array<Request> *reqvec;
81     Array<int> *intvec;
82     Notename_table *chordmodifiertab;
83     Duration *duration;
84     Identifier *id;
85     String * string;
86     Music *music;
87     Music_list *music_list;
88     Score *score;
89     Scope *scope;
90     Interval *interval;
91     Musical_req* musreq;
92     Music_output_def * outputdef;
93     Musical_pitch * pitch;
94     Midi_def* midi;
95     Moment *moment;
96     Notename_table *notenametab;
97     Paper_def *paper;
98     Real real;
99     Request * request;
100
101  /* We use SCMs to do strings, because it saves us the trouble of
102 deleting them.  Let's hope that a stack overflow doesnt trigger a move
103 of the parse stack onto the heap. */
104     SCM scm;
105
106     Tempo_req *tempo;
107     Translator_group* trans;
108     char c;
109     int i;
110     int ii[10];
111 }
112 %{
113
114 int
115 yylex (YYSTYPE *s,  void * v_l)
116 {
117         My_lily_parser   *pars_l = (My_lily_parser*) v_l;
118         My_lily_lexer * lex_l = pars_l->lexer_p_;
119
120         lex_l->lexval_l = (void*) s;
121         return lex_l->yylex ();
122 }
123
124
125 %}
126
127 %pure_parser
128
129 /* tokens which are not keywords */
130 %token AUTOCHANGE
131 %token TEXTSCRIPT
132 %token ACCEPTS
133 %token ALTERNATIVE
134 %token BAR
135 %token BREATHE
136 %token CADENZA
137 %token CHORDMODIFIERS
138 %token CHORDS
139 %token HYPHEN
140 %token CLEF
141 %token CM_T
142 %token CONSISTS
143 %token SEQUENTIAL
144 %token SIMULTANEOUS
145 %token CONSISTSEND
146 %token DURATION
147 %token EXTENDER
148 %token FONT
149 %token GRACE
150 %token HEADER
151 %token IN_T
152 %token INVALID
153 %token KEY
154 %token KEYSIGNATURE
155 %token LYRICS
156 %token MARK
157 %token MEASURES
158 %token MIDI
159 %token MM_T
160 %token MUSICAL_PITCH
161 %token NAME
162 %token NOTENAMES
163 %token NOTES
164 %token PAPER
165 %token PARTIAL
166 %token PENALTY
167 %token PROPERTY
168 %token PT_T
169 %token RELATIVE
170 %token REMOVE
171 %token REPEAT
172 %token REPETITIONS
173 %token ADDLYRICS
174 %token SCM_T
175 %token SCORE
176 %token SCRIPT
177 %token SHAPE
178 %token SKIP
179 %token SPANREQUEST
180 %token TEMPO
181 %token TIME_T
182 %token TIMES
183 %token TRANSLATOR
184 %token TRANSPOSE
185 %token TYPE
186 %token CONTEXT
187 %token VERSION
188
189 /* escaped */
190 %token E_CHAR E_EXCLAMATION E_SMALLER E_BIGGER 
191 %token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET 
192
193 %type <i>       exclamations questions
194 %token <i>      DIGIT
195 %token <pitch>  NOTENAME_PITCH
196 %token <pitch>  TONICNAME_PITCH
197 %token <pitch>  CHORDMODIFIER_PITCH
198 %token <id>     DURATION_IDENTIFIER
199 %token <id>     IDENTIFIER
200 %token <id>     NOTENAME_TABLE_IDENTIFIER
201 %token <id>     MUSIC_IDENTIFIER
202 %token <id>     REQUEST_IDENTIFIER
203 %token <id>     REAL_IDENTIFIER
204 %token <id>     STRING_IDENTIFIER
205 %token <id>     TRANS_IDENTIFIER
206 %token <id>     INT_IDENTIFIER
207 %token <id>     SCORE_IDENTIFIER
208 %token <id>     MIDI_IDENTIFIER
209 %token <id>     PAPER_IDENTIFIER
210 %token <real>   REAL
211 %token <scm>    DURATION RESTNAME
212 %token <scm>    STRING
213 %token <scm>    SCM_T
214 %token <i>      UNSIGNED
215
216
217 %type <outputdef> output_def
218 %type <scope>   mudela_header mudela_header_body
219 %type <request> open_request_parens close_request_parens open_request close_request
220 %type <request> request_with_dir request_that_take_dir verbose_request
221 %type <i>       sub_quotes sup_quotes
222 %type <music>   simple_element  request_chord command_element Simple_music  Composite_music 
223 %type <music>   Alternative_music Repeated_music
224 %type <i>       abbrev_type
225 %type <i>       int unsigned
226 %type <i>       script_dir
227 %type <i>       optional_modality 
228 %type <id>      identifier_init  
229 %type <duration> steno_duration optional_notemode_duration
230 %type <duration> entered_notemode_duration explicit_duration
231 %type <intvec>   int_list
232 %type <reqvec>  pre_requests post_requests
233 %type <request> gen_text_def
234 %type <pitch>   explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
235 %type <pitch>   steno_tonic_pitch
236
237 %type <pitch_arr>       pitch_list
238 %type <music>   chord
239 %type <pitch_arr>       chord_additions chord_subtractions chord_notes chord_step
240 %type <pitch>   chord_note chord_inversion chord_bass
241 %type <midi>    midi_block midi_body
242 %type <duration>        duration_length
243
244 %type <scm>  embedded_scm scalar
245 %type <music>   Music Sequential_music Simultaneous_music Music_sequence
246 %type <music>   relative_music re_rhythmed_music
247 %type <music>   property_def translator_change
248 %type <music_list> Music_list
249 %type <paper>   paper_block paper_def_body
250 %type <real>    real real_with_dimension
251 %type <request> abbrev_command_req
252 %type <request> post_request 
253 %type <request> command_req verbose_command_req
254 %type <request> extender_req
255 %type <request> hyphen_req
256 %type <scm>     string
257 %type <score>   score_block score_body
258 %type <realarr> real_array
259
260 %type <scm>     script_abbreviation
261 %type <trans>   translator_spec_block translator_spec_body
262 %type <tempo>   tempo_request
263 %type <notenametab> notenames_body notenames_block chordmodifiers_block
264
265
266
267 %left '-' '+'
268 %left '*' '/'
269 %left UNARY_MINUS
270
271 %%
272
273 mudela: /* empty */
274         | mudela toplevel_expression {}
275         | mudela assignment  { }
276         | mudela error
277         | mudela INVALID        {
278                 THIS->error_level_i_  =1;
279         }
280         ;
281
282 toplevel_expression:
283         notenames_block                 {
284                 THIS->lexer_p_->set_notename_table ($1);
285         }
286         | chordmodifiers_block                  {
287                 THIS->lexer_p_->set_chordmodifier_table ($1);
288         }
289         | mudela_header {
290                 delete header_global_p;
291                 header_global_p = $1;
292         }
293         | score_block {
294                 score_global_array.push ($1);
295         }
296         | paper_block {
297                 Identifier * id = new
298                         Paper_def_identifier ($1, PAPER_IDENTIFIER);
299                 THIS->lexer_p_->set_identifier ("$defaultpaper", id)
300         }
301         | midi_block {
302                 Identifier * id = new
303                         Midi_def_identifier ($1, MIDI_IDENTIFIER);
304                 THIS->lexer_p_->set_identifier ("$defaultmidi", id)
305         }
306         | embedded_scm {
307                 // junk value
308         }       
309         ;
310
311 embedded_scm:
312         SCM_T
313         ;
314
315
316 chordmodifiers_block:
317         CHORDMODIFIERS '{' notenames_body '}'  {  $$ = $3; }
318         ;
319
320
321 notenames_block:
322         NOTENAMES '{' notenames_body '}'  {  $$ = $3; }
323         ;
324
325
326
327 notenames_body:
328         /**/    {
329                 $$ = new Notename_table;
330         }
331         | NOTENAME_TABLE_IDENTIFIER     {
332                 $$ = $1-> access_content_Notename_table(true);
333         }
334         | notenames_body STRING '=' explicit_musical_pitch {
335                 (*$$)[ly_scm2string ($2)] = *$4;
336
337                 delete $4;
338         }
339         ;
340
341 mudela_header_body:
342         {
343                 $$ = new Scope;
344                 THIS->lexer_p_-> scope_l_arr_.push ($$);
345         }
346         | mudela_header_body assignment semicolon { 
347
348         }
349         ;
350
351 mudela_header:
352         HEADER '{' mudela_header_body '}'       {
353                 $$ = $3;
354                 THIS->lexer_p_-> scope_l_arr_.pop ();           
355         }
356         ;
357
358
359 /*
360         DECLARATIONS
361 */
362 assignment:
363         STRING {
364                 THIS->remember_spot ();
365         }
366         /* cont */ '=' identifier_init  {
367             THIS->lexer_p_->set_identifier (ly_scm2string ($1), $4);
368             $4->init_b_ = THIS->init_parse_b_;
369             $4->set_spot (THIS->pop_spot ());
370         }
371         ;
372
373
374
375 identifier_init:
376         score_block {
377                 $$ = new Score_identifier ($1, SCORE_IDENTIFIER);
378
379         }
380         | chordmodifiers_block {
381                 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
382         }
383         | notenames_block {
384                 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
385         }
386         | paper_block {
387                 $$ = new Paper_def_identifier ($1, PAPER_IDENTIFIER);
388         }
389         | midi_block {
390                 $$ = new Midi_def_identifier ($1, MIDI_IDENTIFIER);
391
392         }
393         | translator_spec_block {
394                 $$ = new Translator_group_identifier ($1, TRANS_IDENTIFIER);
395         }
396         | Music  {
397                 $$ = new Music_identifier ($1, MUSIC_IDENTIFIER);
398         }
399
400         | post_request {
401                 $$ = new Request_identifier ($1, REQUEST_IDENTIFIER);
402         }
403         | explicit_duration {
404                 $$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
405         }
406         | real {
407                 $$ = new Real_identifier (new Real ($1), REAL_IDENTIFIER);
408         }
409         | string {
410                 $$ = new String_identifier (new String (ly_scm2string ($1)), STRING_IDENTIFIER);
411         }
412         | int   {
413                 $$ = new int_identifier (new int ($1), INT_IDENTIFIER);
414         }
415         ;
416
417 translator_spec_block:
418         TRANSLATOR '{' translator_spec_body '}'
419                 {
420                 $$ = $3;
421         }
422         ;
423
424 translator_spec_body:
425         TRANS_IDENTIFIER        {
426                 $$ = $1->access_content_Translator_group (true);
427                 $$-> set_spot (THIS->here_input ());
428         }
429         | TYPE STRING semicolon {
430                 Translator* t = get_translator_l (ly_scm2string ($2));
431                 Translator_group * tg = dynamic_cast<Translator_group*> (t);
432
433                 if (!tg)
434                         THIS->parser_error (_("Need a translator group for a context"));
435                 
436                 tg = dynamic_cast<Translator_group*> (t->clone ());
437                 tg->set_spot (THIS->here_input ());
438                 $$ = tg;
439         }
440         | translator_spec_body STRING '=' embedded_scm                  {
441                 Translator_group* tg = dynamic_cast<Translator_group*> ($$);
442                 tg->set_property (ly_scm2string ($2), $4);
443         }
444         | translator_spec_body STRING '=' identifier_init semicolon     { 
445                 Identifier* id = $4;
446                 String_identifier *s = dynamic_cast<String_identifier*> (id);
447                 Real_identifier *r= dynamic_cast<Real_identifier*>(id);
448                 int_identifier *i = dynamic_cast<int_identifier*> (id);
449         
450                 SCM v;
451                 if (s) v = ly_str02scm (s->access_content_String (false)->ch_C());
452                 if (i) v = gh_int2scm (*i->access_content_int (false));
453                 if (r) v = gh_double2scm (*r->access_content_Real (false));
454                 if (!s && !i && !r)
455                         THIS->parser_error (_("Wrong type for property value"));
456
457                 delete $4;
458                 /* ugh*/
459                 Translator_group* tg = dynamic_cast<Translator_group*> ($$);
460                 
461                 tg->set_property (ly_scm2string ($2), v);
462         }
463         | translator_spec_body NAME STRING semicolon {
464                 $$->type_str_ = ly_scm2string ($3);
465         }
466         | translator_spec_body CONSISTS STRING semicolon {
467                 dynamic_cast<Translator_group*> ($$)-> set_element (ly_scm2string ($3), true);
468         }
469         | translator_spec_body CONSISTSEND STRING semicolon {
470                 dynamic_cast<Translator_group*> ($$)-> set_element (ly_scm2string ($3), true);
471         }
472         | translator_spec_body ACCEPTS STRING semicolon {
473                 dynamic_cast<Translator_group*> ($$)-> set_acceptor (ly_scm2string ($3), true);
474         }
475         | translator_spec_body REMOVE STRING semicolon {
476                 dynamic_cast<Translator_group*> ($$)-> set_element (ly_scm2string ($3), false);
477         }
478         ;
479
480 /*
481         SCORE
482 */
483 score_block:
484         SCORE { 
485         }
486         /*cont*/ '{' score_body '}'     {
487                 $$ = $4;
488                 if (!$$->def_p_arr_.size ())
489                         $$->add_output (THIS->default_paper_p ());
490         }
491         ;
492
493 score_body:             {
494                 $$ = new Score;
495                 $$->set_spot (THIS->here_input ());
496         }
497         | SCORE_IDENTIFIER {
498                 $$ = $1->access_content_Score (true);
499         }
500         | score_body mudela_header      {
501                 $$->header_p_ = $2;
502         }
503         | score_body Music      {
504                 if ($$->music_p_)
505                         $2->warning (_ ("More than one music block"));  
506                 $$->music_p_ = $2;
507         }
508         | score_body output_def {
509                 $$->add_output ($2);
510         }
511         | score_body error {
512
513         }
514         ;
515
516 output_def:
517         paper_block {
518                 $$ = $1;
519         }
520         |  midi_block           {
521                 $$= $1;
522         }
523         ;
524
525
526 /*
527         PAPER
528 */
529 paper_block:
530         PAPER '{' paper_def_body '}'    { 
531                 $$ = $3;
532                 THIS-> lexer_p_->scope_l_arr_.pop ();
533         }
534         ;
535
536
537 paper_def_body:
538         /* empty */                     {
539                 Paper_def *p = THIS->default_paper_p ();
540                 THIS-> lexer_p_-> scope_l_arr_.push (p->scope_p_);
541                 $$ = p;
542         }
543         | PAPER_IDENTIFIER      {
544                 Paper_def *p = $1->access_content_Paper_def (true);
545                 THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
546                 $$ = p;
547         }
548         | paper_def_body int '=' FONT STRING            { // ugh, what a syntax
549                 Lookup * l = new Lookup;
550                 l->font_name_ = ly_scm2string ($5);
551                 $$->set_lookup ($2, l);
552         }
553         | paper_def_body assignment semicolon {
554                 
555         }
556         | paper_def_body SCM_T '=' SCM_T {
557                 if (!gh_symbol_p ($2))
558                         THIS->parser_error ("expect a symbol as lvalue");
559                 else
560                         $$->default_properties_[$2] = $4;
561         }
562         | paper_def_body SCM_T '=' real semicolon {
563                 if (!gh_symbol_p ($2))
564                         THIS->parser_error ("expect a symbol as lvalue");
565                 else
566                         $$->default_properties_[$2] = gh_double2scm ($4);
567         }
568         | paper_def_body translator_spec_block {
569                 $$->assign_translator ($2);
570         }
571         | paper_def_body SHAPE real_array  semicolon {
572                 /*
573                         URG URG.
574                 */
575                 if ($3->size () % 2)
576                         warning (_ ("Need even number of args for shape array"));
577
578                 for (int i=0; i < $3->size ();  i+=2)
579                 {
580                         Real l = $3->elem (i);
581                         $$->shape_int_a_.push (Interval (l,
582                                                          l + $3->elem (i+1)));
583                 }
584                 delete $3;
585         }
586         | paper_def_body error {
587
588         }
589         ;
590
591
592
593 real_with_dimension:
594         REAL CM_T       {
595                 $$ = $1 CM;
596         }
597         | REAL PT_T     {
598                 $$ = $1 PT;
599         }
600         | REAL IN_T     {
601                 $$ = $1 INCH;
602         }
603         | REAL MM_T     {
604                 $$ = $1 MM;
605         }
606         ;
607
608 real:
609         REAL            {
610                 $$ = $1;
611         }
612         | real_with_dimension
613         | REAL_IDENTIFIER               {
614                 $$= *$1->access_content_Real (false);
615         }
616         | '-'  real %prec UNARY_MINUS {
617                 $$ = -$2;
618         }
619         | real '*' real {
620                 $$ = $1 * $3;
621         }
622         | real '/' real {
623                 $$ = $1 / $3;
624         }
625         | real '+' real {
626                 $$ = $1  + $3;
627         }
628         | real '-' real {
629                 $$ = $1 - $3;
630         }
631         | '(' real ')'  {
632                 $$ = $2;
633         }
634         ;
635                 
636
637 real_array:
638         real {
639                 $$ = new Array<Real>;
640                 $$->push ($1);
641         }
642         |  /* empty */ {
643                 $$ = new Array<Real>;
644         }
645         | real_array ',' real {
646                 $$->push($3);
647         }
648         ;
649
650 /*
651         MIDI
652 */
653 midi_block:
654         MIDI
655         '{' midi_body '}'       {
656                 $$ = $3;
657                 THIS-> lexer_p_-> scope_l_arr_.pop();
658         }
659         ;
660
661 midi_body: /* empty */          {
662                 Midi_def * p =THIS->default_midi_p ();
663                 $$ = p;
664                 THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
665         }
666         | MIDI_IDENTIFIER       {
667                 Midi_def * p =$1-> access_content_Midi_def (true);
668                 $$ = p;
669                 THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
670         }
671         | midi_body assignment semicolon {
672
673         }
674         | midi_body translator_spec_block       {
675                 $$-> assign_translator ($2);
676         }
677         | midi_body tempo_request semicolon {
678                 $$->set_tempo ($2->dur_.length_mom (), $2->metronome_i_);
679                 delete $2;
680         }
681         | midi_body error {
682
683         }
684         ;
685
686 tempo_request:
687         TEMPO steno_duration '=' unsigned       {
688                 $$ = new Tempo_req;
689                 $$->dur_ = *$2;
690                 delete $2;
691                 $$-> metronome_i_ = $4;
692         }
693         ;
694
695 Music_list: /* empty */ {
696                 $$ = new Music_list;
697                 $$->set_spot (THIS->here_input ());
698         }
699         | Music_list Music {
700                 $$->add_music ($2);
701         }
702         | Music_list error {
703         }
704         ;
705
706
707 Music:
708         Simple_music
709         | Composite_music
710         ;
711
712 Alternative_music:
713         /* empty */ {
714                 $$ = 0;
715         }
716         | ALTERNATIVE Music_sequence {
717                 $$ = $2;
718                 $2->set_spot (THIS->here_input ());
719         }
720         ;
721
722
723
724
725 Repeated_music:
726         REPEAT STRING unsigned Music Alternative_music
727         {
728                 Music_sequence* m = dynamic_cast <Music_sequence*> ($5);
729                 if (m && $3 < m->length_i ())
730                         $5->warning (_ ("More alternatives than repeats.  Junking excess alternatives."));
731
732                 Repeated_music * r = new Repeated_music ($4, $3 >? 1, m);
733                 $$ = r;
734                 r->fold_b_ = (ly_scm2string ($2) == "fold");
735                 r->volta_fold_b_ =  (ly_scm2string ($2) == "volta");
736                 r->set_spot ($4->spot  ());
737         }
738         ;
739
740 Music_sequence: '{' Music_list '}'      {
741                 $$ = new Music_sequence ($2);
742                 $$->set_spot ($2->spot ());
743         }
744         ;
745
746 Sequential_music:
747         SEQUENTIAL '{' Music_list '}'           {
748                 $$ = new Sequential_music ($3);
749                 $$->set_spot ($3->spot ());
750         }
751         | '{' Music_list '}'            {
752                 $$ = new Sequential_music ($2);
753                 $$->set_spot ($2->spot ());
754         }
755         ;
756
757 Simultaneous_music:
758         SIMULTANEOUS '{' Music_list '}'{
759                 $$ = new Simultaneous_music ($3);
760                 $$->set_spot ($3->spot ());
761         }
762         | '<' Music_list '>'    {
763                 $$ = new Simultaneous_music ($2);
764                 $$->set_spot ($2->spot ());
765         }
766         ;
767
768 Simple_music:
769         request_chord           { $$ = $1; }
770         | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
771         | property_def
772         | translator_change
773         | Simple_music '*' unsigned '/' unsigned        {
774                 $$ = $1;
775                 $$->compress (Moment($3, $5 ));
776         }
777         | Simple_music '*' unsigned              {
778                 $$ = $1;
779                 $$->compress (Moment ($3, 1));
780         }
781         ;
782
783
784 Composite_music:
785         CONTEXT STRING Music    {
786                 Context_specced_music *csm =  new Context_specced_music ($3);
787
788                 csm->translator_type_str_ = ly_scm2string ($2);
789                 csm->translator_id_str_ = "";
790
791
792                 $$ = csm;
793         }
794         | AUTOCHANGE STRING Music       {
795                 Auto_change_music * chm = new Auto_change_music (ly_scm2string ($2), $3);
796
797                 $$ = chm;
798                 chm->set_spot ($3->spot ());
799         }
800         | GRACE Music {
801                 $$ = new Grace_music ($2);
802         }
803         | CONTEXT STRING '=' STRING Music {
804                 Context_specced_music *csm =  new Context_specced_music ($5);
805
806                 csm->translator_type_str_ = ly_scm2string ($2);
807                 csm->translator_id_str_ = ly_scm2string ($4);
808
809                 $$ = csm;
810         }
811         | TIMES {
812                 THIS->remember_spot ();
813         }
814         /* CONTINUED */ 
815                 unsigned '/' unsigned Music     
816
817         {
818                 $$ = new Time_scaled_music ($3, $5, $6);
819                 $$->set_spot (THIS->pop_spot ());
820         }
821         | Repeated_music                { $$ = $1; }
822         | Simultaneous_music            { $$ = $1; }
823         | Sequential_music              { $$ = $1; }
824         | TRANSPOSE musical_pitch Music {
825                 $$ = new Transposed_music ($3, *$2);
826                 delete $2;
827         }
828         | TRANSPOSE steno_tonic_pitch Music {
829                 $$ = new Transposed_music ($3, *$2);
830                 delete $2;
831         }
832         | NOTES
833                 { THIS->lexer_p_->push_note_state (); }
834         Music
835                 { $$ = $3;
836                   THIS->lexer_p_->pop_state ();
837                 }
838         | CHORDS
839                 { THIS->lexer_p_->push_chord_state (); }
840         Music
841                 {
842                   $$ = $3;
843                   THIS->lexer_p_->pop_state ();
844         }
845         | LYRICS
846                 { THIS->lexer_p_->push_lyric_state (); }
847         Music
848                 {
849                   $$ = $3;
850                   THIS->lexer_p_->pop_state ();
851         }
852         | relative_music        { $$ = $1; }
853         | re_rhythmed_music     { $$ = $1; } 
854         ;
855
856 relative_music:
857         RELATIVE absolute_musical_pitch Music {
858                 $$ = new Relative_octave_music ($3, *$2);
859                 delete $2;
860         }
861         ;
862
863 re_rhythmed_music:
864         ADDLYRICS Music Music {
865                 Lyric_combine_music * l = new Lyric_combine_music ($2, $3);
866                 $$ = l;
867         }
868         ;
869
870 translator_change:
871         TRANSLATOR STRING '=' STRING  {
872                 Change_translator * t = new Change_translator;
873                 t-> change_to_type_str_ = ly_scm2string ($2);
874                 t-> change_to_id_str_ = ly_scm2string ($4);
875
876                 $$ = t;
877                 $$->set_spot (THIS->here_input ());
878         }
879         ;
880
881 property_def:
882         PROPERTY STRING '.' STRING '='  scalar {
883                 Translation_property *t = new Translation_property;
884
885                 t->var_str_ = ly_scm2string ($4);
886                 t->value_ = $6;
887
888                 Context_specced_music *csm = new Context_specced_music (t);
889                 $$ = csm;
890                 $$->set_spot (THIS->here_input ());
891
892                 csm-> translator_type_str_ = ly_scm2string ($2);
893         }
894         ;
895
896 scalar:
897         string          { $$ = $1; }
898         | int           { $$ = gh_int2scm ($1); }
899         | embedded_scm  { $$ = $1; }
900         ;
901
902
903 request_chord:
904         pre_requests simple_element post_requests       {
905                 Music_sequence *l = dynamic_cast<Music_sequence*>($2);
906                 for (int i=0; i < $1->size(); i++)
907                         l->add_music ($1->elem(i));
908                 for (int i=0; i < $3->size(); i++)
909                         l->add_music ($3->elem(i));
910                 $$ = $2;
911                 
912         }
913         | command_element
914         ;
915
916 command_element:
917         command_req {
918                 $$ = new Request_chord;
919                 $$-> set_spot (THIS->here_input ());
920                 $1-> set_spot (THIS->here_input ());
921                 ((Simultaneous_music*)$$) ->add_music ($1);//ugh
922         }
923         ;
924
925 command_req:
926         abbrev_command_req
927         | verbose_command_req semicolon { $$ = $1; }
928         ;
929
930 abbrev_command_req:
931         extender_req {
932                 $$ = $1;
933         }
934         | hyphen_req {
935                 $$ = $1;
936         }
937         | '|'                           {
938                 $$ = new Barcheck_req;
939         }
940         | '~'   {
941                 $$ = new Tie_req;
942         }
943         | '['           {
944                 Span_req*b= new Span_req;
945                 b->span_dir_ = START;
946                 b->span_type_str_ = "beam";
947                 $$ =b;
948         }
949         | '[' ':' unsigned {
950                 if (!Duration::duration_type_b ($3))
951                   THIS->parser_error (_f ("not a duration: %d", $3));
952                 else if ($3 < 8)
953                   THIS->parser_error (_ ("Can't abbreviate"));
954                 else
955                   THIS->set_abbrev_beam ($3);
956
957                 Chord_tremolo_req* a = new Chord_tremolo_req;
958                 a->span_dir_ = START;
959                 a->type_i_ = THIS->abbrev_beam_type_i_;
960                 $$=a;
961         }
962         | ']'           {
963                 if (!THIS->abbrev_beam_type_i_)
964                   {
965                      Span_req*b= new Span_req;
966                      b->span_dir_ = STOP;
967                      b->span_type_str_ = "beam";
968                      $$ = b;
969                    }
970                 else
971                   {
972                     Chord_tremolo_req* a = new Chord_tremolo_req;
973                     a->span_dir_ = STOP;
974                     a->type_i_ = THIS->abbrev_beam_type_i_;
975                     THIS->set_abbrev_beam (0);
976                     $$ = a;
977                   }
978         }
979         | BREATHE {
980                 $$ = new Breathing_sign_req;
981         }
982         ;
983
984
985 verbose_command_req:
986         BAR STRING                      {
987                 $$ = new Bar_req (ly_scm2string ($2));
988         }
989         | MARK STRING {
990                 $$ = new Mark_req (ly_scm2string ($2));
991
992         }
993         | MARK unsigned {
994                 $$ = new Mark_req (to_str ($2));
995         }
996         | TIME_T unsigned '/' unsigned  {
997                 Time_signature_change_req *m = new Time_signature_change_req;
998                 m->beats_i_ = $2;
999                 m->one_beat_i_=$4;
1000                 $$ = m;
1001         }
1002         | PENALTY int   {
1003                 Break_req * b = new Break_req;
1004                 b->penalty_f_ = $2 / 100.0;
1005                 b->set_spot (THIS->here_input ());
1006                 $$ = b;
1007         }
1008         | SKIP duration_length {
1009                 Skip_req * skip_p = new Skip_req;
1010                 skip_p->duration_ = *$2;
1011                 delete $2;
1012                 $$ = skip_p;
1013         }
1014         | tempo_request {
1015                 $$ = $1;
1016         }
1017         | CADENZA unsigned      {
1018                 $$ = new Cadenza_req ($2);
1019         }
1020         | PARTIAL duration_length       {
1021                 $$ = new Partial_measure_req ($2->length_mom ());
1022                 delete $2;
1023         }
1024         | CLEF STRING {
1025                 $$ = new Clef_change_req (ly_scm2string ($2));
1026
1027         }
1028 /* UGH. optional.  */
1029         | KEY NOTENAME_PITCH optional_modality  {
1030                 Key_change_req *key_p= new Key_change_req;
1031                 key_p->key_.pitch_arr_.push (*$2);
1032                 key_p->key_.ordinary_key_b_ = true;
1033                 key_p->key_.modality_i_ = $3;
1034                 $$ = key_p;
1035                 delete $2;
1036         }
1037         | KEYSIGNATURE pitch_list {
1038                 Key_change_req *key_p= new Key_change_req;
1039                 key_p->key_.pitch_arr_ = *$2;
1040                 key_p->key_.ordinary_key_b_ = false;
1041                 $$ = key_p;
1042                 delete $2;
1043         }
1044
1045         ;
1046
1047 post_requests:
1048         {
1049                 $$ = new Link_array<Request>;
1050         }
1051         | post_requests post_request {
1052                 $2->set_spot (THIS->here_input ());
1053                 $$->push ($2);
1054         }
1055         ;
1056
1057 post_request:
1058         verbose_request
1059         | request_with_dir
1060         | close_request
1061         ;
1062
1063
1064 request_that_take_dir:
1065         gen_text_def
1066         | verbose_request
1067         | script_abbreviation {
1068                 Identifier*i = THIS->lexer_p_->lookup_identifier ("dash-" + ly_scm2string ($1));
1069                 Articulation_req *a = new Articulation_req;
1070                 a->articulation_str_ = *i->access_content_String (false);
1071                 $$ = a;
1072         }
1073         ;
1074
1075 request_with_dir:
1076         script_dir request_that_take_dir        {
1077                 if (Script_req * gs = dynamic_cast<Script_req*> ($2))
1078                         gs->dir_ = Direction ($1);
1079                 else if ($1)
1080                         $2->warning (_ ("Can't specify direction for this request"));
1081                 $$ = $2;
1082         }
1083         ;
1084         
1085 verbose_request:
1086         REQUEST_IDENTIFIER      {
1087                 $$ = (Request*)$1->access_content_Request (true);
1088                 $$->set_spot (THIS->here_input ());
1089         }
1090         | TEXTSCRIPT STRING STRING      {
1091                 Text_script_req *ts_p = new Text_script_req;
1092                 ts_p-> text_str_ = ly_scm2string ($2);
1093                 ts_p-> style_str_ = ly_scm2string ($3);
1094                 ts_p->set_spot (THIS->here_input ());
1095
1096                 $$ = ts_p;
1097         }
1098         | SPANREQUEST int STRING {
1099                 Span_req * sp_p = new Span_req;
1100                 sp_p-> span_dir_  = Direction($2);
1101                 sp_p->span_type_str_ = ly_scm2string ($3);
1102                 sp_p->set_spot (THIS->here_input ());
1103                 $$ = sp_p;
1104         }
1105         | abbrev_type   {
1106                 Tremolo_req* a = new Tremolo_req;
1107                 a->set_spot (THIS->here_input ());
1108                 a->type_i_ = $1;
1109                 $$ = a;
1110         }
1111         | SCRIPT STRING         { 
1112                 Articulation_req * a = new Articulation_req;
1113                 a->articulation_str_ = ly_scm2string ($2);
1114                 a->set_spot (THIS->here_input ());
1115                 $$ = a;
1116
1117         }
1118         ;
1119
1120 optional_modality:
1121         /* empty */     {
1122                 $$ = 0;
1123         }
1124         | int   {
1125                 $$ = $1;
1126         }
1127         ;
1128
1129 sup_quotes:
1130         '\'' {
1131                 $$ = 1;
1132         }
1133         | sup_quotes '\'' {
1134                 $$ ++;
1135         }
1136         ;
1137
1138 sub_quotes:
1139         ',' {
1140                 $$ = 1;
1141         }
1142         | sub_quotes ',' {
1143                 $$ ++ ;
1144         }
1145         ;
1146
1147 steno_musical_pitch:
1148         NOTENAME_PITCH  {
1149                 $$ = $1;
1150         }
1151         | NOTENAME_PITCH sup_quotes     {
1152                 $$ = $1;
1153                 $$->octave_i_ +=  $2;
1154         }
1155         | NOTENAME_PITCH sub_quotes      {
1156                 $$ = $1;
1157                 $$->octave_i_ += - $2;
1158         }
1159         ;
1160
1161 steno_tonic_pitch:
1162         TONICNAME_PITCH {
1163                 $$ = $1;
1164         }
1165         | TONICNAME_PITCH sup_quotes    {
1166                 $$ = $1;
1167                 $$->octave_i_ +=  $2;
1168         }
1169         | TONICNAME_PITCH sub_quotes     {
1170                 $$ = $1;
1171                 $$->octave_i_ += - $2;
1172         }
1173         ;
1174
1175 explicit_musical_pitch:
1176         MUSICAL_PITCH '{' int_list '}'  {/* ugh */
1177                 Array<int> &a = *$3;
1178                 ARRAY_SIZE(a,3);
1179                 $$ = new Musical_pitch;
1180                 $$->octave_i_ = a[0];
1181                 $$->notename_i_ = a[1];
1182                 $$->accidental_i_ = a[2];
1183                 delete &a;
1184         }
1185         ;
1186
1187 musical_pitch:
1188         steno_musical_pitch {
1189                 $$ = $1;
1190                 THIS->set_last_pitch ($1);
1191         }
1192         | explicit_musical_pitch {
1193                 $$ = $1;
1194                 THIS->set_last_pitch ($1);
1195         }
1196         ;
1197
1198 explicit_duration:
1199         DURATION '{' int_list '}'       {
1200                 $$ = new Duration;
1201                 Array<int> &a = *$3;
1202                 ARRAY_SIZE(a,2);
1203                         
1204                 $$-> durlog_i_ = a[0];
1205                 $$-> dots_i_ = a[1];
1206
1207                 delete &a;              
1208         }
1209         ;
1210
1211 extender_req:
1212         EXTENDER {
1213                 if (!THIS->lexer_p_->lyric_state_b ())
1214                         THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
1215                 $$ = new Extender_req;
1216         }
1217         ;
1218
1219 hyphen_req:
1220         HYPHEN {
1221                 if (!THIS->lexer_p_->lyric_state_b ())
1222                         THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
1223                 $$ = new Hyphen_req;
1224         }
1225         ;
1226
1227 close_request:
1228         close_request_parens {
1229                 $$ = $1;
1230                 dynamic_cast<Span_req*> ($$)->span_dir_ = START;
1231         }
1232         
1233 close_request_parens:
1234         '('     {
1235                 Span_req* s= new Span_req;
1236                 $$ = s;
1237                 s->span_type_str_ = "slur";
1238         }
1239         | E_SMALLER {
1240                 Span_req*s =new Span_req;
1241                 $$ = s;
1242                 s->span_type_str_ = "crescendo";
1243         }
1244         | E_BIGGER {
1245                 Span_req*s =new Span_req;
1246                 $$ = s;
1247                 s->span_type_str_ = "decrescendo";
1248         }
1249         ;
1250
1251
1252 open_request:
1253         open_request_parens {
1254                 $$ = $1;
1255                 dynamic_cast<Span_req*> ($$)->span_dir_ = STOP;
1256         }
1257         ;
1258
1259 open_request_parens:
1260         E_EXCLAMATION   {
1261                 Span_req *s =  new Span_req;
1262                 s->span_type_str_ = "crescendo";
1263                 $$ = s;
1264         }
1265         | ')'   {
1266                 Span_req* s= new Span_req;
1267                 $$ = s;
1268                 s->span_type_str_ = "slur";
1269         }
1270         ;
1271
1272 gen_text_def:
1273         string {
1274                 Text_script_req *t  = new Text_script_req;
1275                 $$ = t;
1276                 t->text_str_ = ly_scm2string ($1);
1277
1278                 $$->set_spot (THIS->here_input ());
1279         }
1280         | DIGIT {
1281                 Text_script_req* t  = new Text_script_req;
1282                 $$ = t;
1283                 t->text_str_ = to_str ($1);
1284                 t->style_str_ = "finger";
1285                 $$->set_spot (THIS->here_input ());
1286         }
1287         ;
1288
1289 script_abbreviation:
1290         '^'             {
1291                 $$ = gh_str02scm  ("hat");
1292         }
1293         | '+'           {
1294                 $$ = gh_str02scm("plus");
1295         }
1296         | '-'           {
1297                 $$ = gh_str02scm ("dash");
1298         }
1299         | '|'           {
1300                 $$ = gh_str02scm ("bar");
1301         }
1302         | '>'           {
1303                 $$ = gh_str02scm ("larger");
1304         }
1305         | '.'           {
1306                 $$ = gh_str02scm ("dot");
1307         }
1308         ;
1309
1310
1311 script_dir:
1312         '_'     { $$ = DOWN; }
1313         | '^'   { $$ = UP; }
1314         | '-'   { $$ = CENTER; }
1315         ;
1316
1317 pre_requests:
1318         {
1319                 $$ = new Link_array<Request>;
1320         }
1321         | pre_requests open_request {
1322                 $$->push ($2);
1323         }
1324         ;
1325
1326 absolute_musical_pitch:
1327         steno_musical_pitch     {
1328                 $$ = $1;
1329         }
1330         ;
1331
1332 duration_length:
1333         steno_duration {
1334                 $$ = $1;
1335         }
1336         | duration_length '*' unsigned {
1337                 $$->plet_.iso_i_ *= $3;
1338         }
1339         | duration_length '/' unsigned {
1340                 $$->plet_.type_i_ *= $3;
1341         }
1342         ;
1343
1344 entered_notemode_duration:
1345         steno_duration  {
1346                 THIS->set_last_duration ($1);
1347         }
1348         ;
1349
1350 optional_notemode_duration:
1351         {
1352                 $$ = new Duration (THIS->default_duration_);
1353         }
1354         | entered_notemode_duration {
1355                 $$ = $1;
1356         }
1357         ;
1358
1359 steno_duration:
1360         unsigned                {
1361                 $$ = new Duration;
1362                 if (!Duration::duration_type_b ($1))
1363                         THIS->parser_error (_f ("not a duration: %d", $1));
1364                 else {
1365                         $$->durlog_i_ = Duration_convert::i2_type ($1);
1366                      }
1367         }
1368         | DURATION_IDENTIFIER   {
1369                 $$ = $1->access_content_Duration (true);
1370         }
1371         | steno_duration '.'    {
1372                 $$->dots_i_ ++;
1373         }
1374         ;
1375
1376
1377 abbrev_type: 
1378         ':'     {
1379                 $$ =0;
1380         }
1381         | ':' unsigned {
1382                 if (!Duration::duration_type_b ($2))
1383                         THIS->parser_error (_f ("not a duration: %d", $2));
1384                 else if ($2 < 8)
1385                         THIS->parser_error (_ ("Can't abbreviate"));
1386                 $$ = $2;
1387         }
1388         ;
1389
1390
1391 simple_element:
1392         musical_pitch exclamations questions optional_notemode_duration {
1393                 if (!THIS->lexer_p_->note_state_b ())
1394                         THIS->parser_error (_ ("Have to be in Note mode for notes"));
1395
1396
1397                 Note_req *n = new Note_req;
1398                 
1399                 n->pitch_ = *$1;
1400                 delete $1;
1401                 n->duration_ = *$4;
1402                 delete $4;
1403                 if (THIS->abbrev_beam_type_i_)
1404                   {
1405                     if (n->duration_.plet_b ())
1406                       THIS->parser_error (_ ("Can't abbreviate tuplet"));
1407                     else
1408                       n->duration_.set_plet (1, 2);
1409                   }
1410                 n->cautionary_b_ = $3 % 2;
1411                 n->forceacc_b_ = $2 % 2 || n->cautionary_b_;
1412
1413                 Simultaneous_music*v = new Request_chord;
1414                 v->set_spot (THIS->here_input ());
1415                 n->set_spot (THIS->here_input ());
1416
1417                 v->add_music (n);
1418
1419                 $$ = v;
1420         }
1421         | RESTNAME optional_notemode_duration           {
1422                 $$ = THIS->get_rest_element (ly_scm2string ($1), $2);
1423
1424         }
1425         | MEASURES optional_notemode_duration   {
1426                 Multi_measure_rest_req* m = new Multi_measure_rest_req;
1427                 m->duration_ = *$2;
1428                 delete $2;
1429
1430                 Simultaneous_music*velt_p = new Request_chord;
1431                 velt_p->set_spot (THIS->here_input ());
1432                 velt_p->add_music (m);
1433                 $$ = velt_p;
1434         }
1435         | REPETITIONS optional_notemode_duration        {
1436                 Repetitions_req* r = new Repetitions_req;
1437                 r->duration_ = *$2;
1438                 delete $2;
1439
1440                 Simultaneous_music*velt_p = new Request_chord;
1441                 velt_p->set_spot (THIS->here_input ());
1442                 velt_p->add_music (r);
1443                 $$ = velt_p;
1444         }
1445         | STRING optional_notemode_duration     {
1446                 if (!THIS->lexer_p_->lyric_state_b ())
1447                         THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
1448                 $$ = THIS->get_word_element (ly_scm2string ($1), $2);
1449
1450         }
1451         | chord {
1452                 if (!THIS->lexer_p_->chord_state_b ())
1453                         THIS->parser_error (_ ("Have to be in Chord mode for chords"));
1454                 $$ = $1;
1455         }
1456         ;
1457
1458 chord:
1459         steno_tonic_pitch optional_notemode_duration chord_additions chord_subtractions chord_inversion chord_bass {
1460                 $$ = THIS->get_chord (*$1, $3, $4, $5, $6, *$2);
1461         };
1462
1463 chord_additions: 
1464         {
1465                 $$ = new Array<Musical_pitch>;
1466         } 
1467         | CHORD_COLON chord_notes {
1468                 $$ = $2;
1469         }
1470         ;
1471
1472 chord_notes:
1473         chord_step {
1474                 $$ = $1
1475         }
1476         | chord_notes '.' chord_step {
1477                 $$ = $1;
1478                 $$->concat (*$3);
1479         }
1480         ;
1481
1482 chord_subtractions: 
1483         {
1484                 $$ = new Array<Musical_pitch>;
1485         } 
1486         | CHORD_CARET chord_notes {
1487                 $$ = $2;
1488         }
1489         ;
1490
1491
1492 chord_inversion:
1493         {
1494                 $$ = 0;
1495         }
1496         | '/' steno_tonic_pitch {
1497                 $$ = $2;
1498                 $$->set_spot (THIS->here_input ());
1499         }
1500         ;
1501
1502 chord_bass:
1503         {
1504                 $$ = 0;
1505         }
1506         | CHORD_BASS steno_tonic_pitch {
1507                 $$ = $2;
1508                 $$->set_spot (THIS->here_input ());
1509         }
1510         ;
1511
1512 chord_step:
1513         chord_note {
1514                 $$ = new Array<Musical_pitch>;
1515                 $$->push (*$1);
1516         }
1517         | CHORDMODIFIER_PITCH {
1518                 $$ = new Array<Musical_pitch>;
1519                 $$->push (*$1);
1520         }
1521         | CHORDMODIFIER_PITCH chord_note { /* Ugh. */
1522                 $$ = new Array<Musical_pitch>;
1523                 $$->push (*$1);
1524                 $$->push (*$2);
1525         }
1526         ;
1527
1528 chord_note:
1529         unsigned {
1530                 $$ = new Musical_pitch;
1531                 $$->notename_i_ = ($1 - 1) % 7;
1532                 $$->octave_i_ = $1 > 7 ? 1 : 0;
1533                 $$->accidental_i_ = 0;
1534         } 
1535         | unsigned '+' {
1536                 $$ = new Musical_pitch;
1537                 $$->notename_i_ = ($1 - 1) % 7;
1538                 $$->octave_i_ = $1 > 7 ? 1 : 0;
1539                 $$->accidental_i_ = 1;
1540         }
1541         | unsigned CHORD_MINUS {
1542                 $$ = new Musical_pitch;
1543                 $$->notename_i_ = ($1 - 1) % 7;
1544                 $$->octave_i_ = $1 > 7 ? 1 : 0;
1545                 $$->accidental_i_ = -1;
1546         }
1547         ;
1548
1549 /*
1550         UTILITIES
1551  */
1552 pitch_list:                     {
1553                 $$ = new Array<Musical_pitch>;
1554         }
1555         | pitch_list musical_pitch      {
1556                 $$->push (*$2);
1557                 delete $2;
1558         }
1559         ;
1560
1561
1562 int_list:
1563         /**/                    {
1564                 $$ = new Array<int>
1565         }
1566         | int_list int          {
1567                 $$->push ($2);          
1568         }
1569         ;
1570
1571 unsigned:
1572         UNSIGNED        {
1573                 $$ = $1;
1574         }
1575         | DIGIT         {
1576                 $$ = $1;
1577         }
1578         ;
1579
1580 int:
1581         unsigned {
1582                 $$ = $1;
1583         }
1584         | '-' unsigned {
1585                 $$ = -$2;
1586         }
1587         | INT_IDENTIFIER        {
1588                 $$ = *$1->access_content_int (false);
1589         }
1590         ;
1591
1592
1593 string:
1594         STRING          {
1595                 $$ = $1;
1596         }
1597         | STRING_IDENTIFIER     {
1598                 $$ = ly_str02scm ($1->access_content_String (true)->ch_C ());
1599         }
1600         | string '+' string {
1601                 $$ = scm_string_append (scm_listify ($1, $3, SCM_UNDEFINED));
1602         }
1603         ;
1604
1605
1606 exclamations:
1607                 { $$ = 0; }
1608         | exclamations '!'      { $$ ++; }
1609         ;
1610
1611 questions:
1612                 { $$ = 0; }
1613         | questions '?' { $$ ++; }
1614         ;
1615
1616
1617 semicolon:
1618         ';'
1619         ;
1620 %%
1621
1622 void
1623 My_lily_parser::set_yydebug (bool b)
1624 {
1625 #ifdef YYDEBUG
1626         yydebug = b;
1627 #endif
1628 }
1629 void
1630 My_lily_parser::do_yyparse ()
1631 {
1632         yyparse ((void*)this);
1633 }
1634
1635