]> git.donarmstrong.com Git - lilypond.git/blob - lily/parser.y
release: 0.0.42
[lilypond.git] / lily / parser.y
1 %{ // -*-Fundamental-*-
2 #include <iostream.h>
3
4 #include "lookup.hh"
5 #include "misc.hh"
6 #include "lexer.hh"
7 #include "paper-def.hh"
8 #include "midi-def.hh"
9 #include "input-score.hh"
10 #include "main.hh"
11 #include "keyword.hh"
12 #include "debug.hh"
13 #include "parseconstruct.hh"
14 #include "dimen.hh"
15 #include "identifier.hh"
16 #include "command-request.hh"
17 #include "musical-request.hh"
18 #include "voice-element.hh"
19
20 #ifndef NDEBUG
21 #define YYDEBUG 1
22 #endif
23
24 Array<Request*> pre_reqs, post_reqs;
25 Array<const char *> define_spots;
26 Paper_def*default_paper();
27 char const* defined_ch_c_l;
28 char const* req_defined_ch_c_l;
29 int fatal_error_i = 0;
30
31 %}
32
33
34 %union {
35     Array<Melodic_req*> *melreqvec;
36     Array<String> * strvec;
37     Array<int> *intvec;
38     Box *box;
39     Identifier *id;    
40     Input_music *music;
41     Input_score *score;
42     Input_staff *staff;    
43     Interval *interval;
44     Lookup*lookup;
45     Melodic_req * melreq;
46     Midi_def* midi;
47     Moment *moment;
48     Music_general_chord *chord;
49     Music_voice *mvoice;
50     Note_req *notereq;
51     Paper_def *paper;
52     Real real;
53     Request * request;
54     Script_def * script;
55     String *string;
56     Symbol * symbol;
57     Symtable * symtable;
58     Symtables * symtables;
59     Text_def * textdef;
60     Voice *voice;    
61     Voice_element *el;  
62     char c;
63     const char *consstr;
64     int i;
65     int ii[10];
66 }
67
68 %token BAR
69 %token CADENZA
70 %token CLEF
71 %token CM_T
72 %token COMMAND
73 %token COMMANDS
74 %token DURATIONCOMMAND
75 %token DYNAMIC
76 %token END
77 %token GEOMETRIC
78 %token GOTO
79 %token GROUPING
80 %token IN_T
81 %token KEY
82 %token MELODIC
83 %token METER
84 %token MIDI
85 %token MM_T
86 %token MULTIVOICE
87 %token MUSIC
88 %token OCTAVECOMMAND
89 %token OUTPUT
90 %token PAPER
91 %token PARTIAL
92 %token PLET
93 %token PT_T
94 %token SCORE
95 %token SCRIPT
96 %token SKIP
97 %token STAFF
98 %token START_T
99 %token STEM
100 %token SYMBOLTABLES
101 %token TABLE
102 %token TABLE
103 %token TEMPO
104 %token TEXID
105 %token TEXTSTYLE
106 %token TITLE
107 %token UNITSPACE
108 %token VOICE
109 %token VOICES
110 %token WIDTH
111
112 %token <i>      DOTS
113 %token <i>      INT
114 %token <id>     IDENTIFIER
115 %token <id>     MELODIC_REQUEST_IDENTIFIER 
116 %token <id>     POST_REQUEST_IDENTIFIER
117 %token <id>     REAL_IDENTIFIER
118 %token <id>     REQUEST_IDENTIFIER
119 %token <real>   REAL 
120 %token <string> DURATION RESTNAME
121 %token <string> STRING
122
123 %type <box>     box
124 %type <c>       open_request_parens close_request_parens close_plet_parens
125 %type <chord>   music_chord music_chord_body
126 %type <el>      voice_elt full_element lyrics_elt command_elt
127 %type <i>       int
128 %type <i>       octave_quotes octave_quote
129 %type <i>       script_dir
130 %type <id>      declaration
131 %type <ii>      default_duration explicit_duration notemode_duration
132 %type <ii>      mudela_duration
133 %type <interval>        dinterval
134 %type <intvec>  intastint_list
135 %type <lookup>  symtables symtables_body
136 %type <melreq>  melodic_request
137 %type <notereq> steno_note_req
138 %type <melreqvec>       pitch_list 
139 %type <midi>    midi_block midi_body
140 %type <moment>  duration_length
141 %type <music>   music 
142 %type <mvoice>   music_voice_body music_voice 
143
144 %type <paper>   paper_block paper_body
145 %type <real>    dim real
146 %type <real>    unit
147 %type <request> post_request pre_request command_req pure_post_request
148 %type <request> script_req textscript_req dynamic_req 
149 %type <score>   score_block score_body
150 %type <script>  script_definition script_body mudela_script
151 %type <staff>   staff_block staff_init staff_body
152 %type <string>  declarable_identifier
153 %type <symbol>  symboldef
154 %type <symtable>        symtable symtable_body
155 %type <textdef> mudela_text
156
157 %%
158
159 mudela: /* empty */
160         | mudela score_block {
161                 add_score($2);          
162         }
163         | mudela add_declaration { }
164         ;
165
166
167 /*
168         DECLARATIONS
169 */
170 add_declaration: declaration    {
171                 lexer->add_identifier($1);
172         }
173         ;
174
175 declarable_identifier:
176         STRING { $$ = $1;
177            if (lexer->lookup_identifier(*$1))
178                 warning("redeclaration of `" + *$1 + "'",
179                         lexer->here_ch_c_l());
180         }
181         | IDENTIFIER { $$ = new String($1->name); }
182         ;
183
184 declaration:
185         declarable_identifier '=' staff_block  {
186                 $$ = new Staff_id(*$1, $3, IDENTIFIER);
187                 delete $1; 
188         }
189         | declarable_identifier '=' music_voice {
190                 $$ = new M_voice_id(*$1, $3, IDENTIFIER);
191                 delete $1;
192         }
193         | declarable_identifier '=' script_definition {
194                 $$ = new Script_id(*$1, $3, IDENTIFIER);
195                 delete $1;
196         }
197         | declarable_identifier '=' music_chord  {
198                 $$ = new M_chord_id(*$1, $3, IDENTIFIER);
199                 delete $1;
200         }
201         | declarable_identifier '=' symtables {
202                 $$ = new Lookup_id(*$1, $3, IDENTIFIER);
203                 delete $1;
204         }
205         | declarable_identifier '=' real        {
206                 $$ = new Real_id(*$1, new Real($3), REAL_IDENTIFIER);
207                 delete $1;
208         }
209         | declarable_identifier error '}' {
210
211         }
212         | declarable_identifier '=' pure_post_request {
213                 $$ = new Request_id(*$1, $3, POST_REQUEST_IDENTIFIER);
214                 delete $1;
215         }
216         | declarable_identifier '=' melodic_request {
217                 $$ = new Request_id(*$1, $3, MELODIC_REQUEST_IDENTIFIER);
218                 delete $1;
219         }
220         ;
221
222
223 /*
224         SCORE
225 */
226 score_block:
227         SCORE { define_spots.push(lexer->here_ch_c_l()); }
228         /*cont*/ '{' score_body '}'     {
229                 $$ = $4;
230                 $$->defined_ch_c_l_ = define_spots.pop();
231                 if (!$$->paper_p_ && ! $$->midi_p_)
232                         $$->paper_p_ = default_paper();
233
234                 /* handle error levels. */
235                 $$->errorlevel_i_ = lexer->errorlevel_i_;
236                 lexer->errorlevel_i_ = 0;
237
238                 /* unbarf score without global music. */
239                 if (!$$-> score_wide_music_p_) {
240                         $$-> score_wide_music_p_ = new Music_voice; 
241                 }
242         }
243         ;
244
245 score_body:             { 
246                 $$ = new Input_score; 
247         }
248         | score_body staff_block        { $$->add($2); }
249         | score_body COMMANDS '{' music_voice_body '}'          {
250                 $$->set($4);
251         }
252         | score_body paper_block                { $$->set($2);  }
253         | score_body midi_block         { $$->set($2);  }
254         | score_body error {
255
256         }
257         ;
258
259 intastint_list:
260         /* */   { $$ =new Array<int>; }
261         | intastint_list int '*' int    {
262                 $$->push($2); $$->push($4);
263         }
264         ;
265
266
267 /*
268         PAPER
269 */
270 paper_block:
271         PAPER
272
273         '{' paper_body '}'      { $$ = $3; }
274         ;
275
276 paper_body:
277         /* empty */                     {
278                 $$ = default_paper();
279         }
280         | paper_body WIDTH dim          { $$->linewidth = $3;}
281         | paper_body OUTPUT STRING      { $$->outfile = *$3;
282                 delete $3;
283         }
284         | paper_body symtables          { $$->set($2); }
285         | paper_body UNITSPACE dim      { $$->whole_width = $3; }
286         | paper_body GEOMETRIC REAL     { $$->geometric_ = $3; }
287         | paper_body error {
288
289         }
290         ;
291
292 /*
293         MIDI
294 */
295 midi_block:
296         MIDI
297
298         '{' midi_body '}'       { $$ = $3; }
299         ;
300
301 midi_body: { 
302                 $$ = new Midi_def; 
303         }
304         | midi_body OUTPUT STRING       { 
305                 $$->outfile_str_ = *$3; 
306                 delete $3; 
307         }
308         | midi_body TEMPO mudela_duration ':' int {
309                 $$->set_tempo( wholes( $3[0], $3[1] ), $5 );
310         }
311         | midi_body error {
312
313         }
314         ;
315
316 /*
317         STAFFs
318 */
319 staff_block:
320         STAFF   { define_spots.push(lexer->here_ch_c_l()); }
321 /*cont*/        '{' staff_body '}'      {
322                 $$ = $4; 
323                 $$-> defined_ch_c_l_ = define_spots.pop();
324         }
325         ;
326
327
328
329 staff_init:
330         IDENTIFIER              { $$ = $1->staff(true); }
331         | STRING                {
332                 $$ = new Input_staff(*$1);
333                 delete $1;
334         }
335         | MELODIC {
336                 $$ = new Input_staff("melodic");
337         }
338         ;
339
340 staff_body:
341         staff_init
342         | staff_body COMMANDS '{' music_voice_body '}'  {
343                 $$->set_score_wide($4);
344         }
345         | staff_body music      {
346                 $2->set_default_group( "staff_music" + String($$->music_.size()));
347                 $$->add($2);
348         }
349         | staff_body error {
350         }
351         ;
352
353 /*
354         MUSIC
355 */
356 music:
357         music_voice     { $$ = $1; }
358         | music_chord   { $$ = $1; }
359         ;
360
361 music_voice:  MUSIC '{' music_voice_body '}'    { $$ = $3; }
362         ;
363
364 music_voice_body:
365         IDENTIFIER {
366                 $$ = $1->mvoice(true);
367         }
368         | /* */         {
369                 $$ = new Music_voice;
370         }
371         | music_voice_body '+' IDENTIFIER {
372                 $$->concatenate($3->mvoice(true));
373         }
374         | music_voice_body full_element {
375                 $$->add_elt($2);
376         }
377         | music_voice_body voice_command {
378         }
379         | music_voice_body music        {
380                 $$->add($2);
381         }
382         | music_voice_body error {
383         }
384         ;
385
386 music_chord:  '{' music_chord_body '}'  { $$ = $2; }
387         ;
388
389 music_chord_body:
390         IDENTIFIER {
391                 $$=$1->mchord(true);
392         }
393         | /* */ {
394                 $$ = new Voice_group_chord;
395         }
396         | MULTIVOICE {
397                 $$ = new Multi_voice_chord;
398         }
399         | music_chord_body '+' IDENTIFIER {
400                 $$->concatenate($3->mchord(true));
401         }
402         | music_chord_body music {
403                 $$->add($2);
404         }
405         | music_chord_body full_element {
406                 $$ ->add_elt($2);
407         }
408         | music_chord_body error {
409         }
410         ;
411
412 /*
413         VOICE ELEMENTS
414 */
415 full_element:   pre_requests voice_elt post_requests {
416                 add_requests($2, pre_reqs);
417                 add_requests($2, post_reqs);
418                 $$ = $2;
419         }
420         | pre_requests lyrics_elt post_requests {
421                 add_requests($2, pre_reqs);
422                 add_requests($2, post_reqs);
423                 $$ = $2;
424         }
425         | command_elt
426         ;
427
428 command_elt:
429 /* empty */     {
430                 $$ = new Voice_element;
431                 $$-> defined_ch_c_l_ = lexer->here_ch_c_l();
432         }
433 /* cont: */
434         command_req     {
435                 $2-> defined_ch_c_l_ = $$->defined_ch_c_l_;
436                 $$->add($2);
437
438         }
439         ;
440
441 command_req:
442          '|'                            { 
443                 $$ = new Barcheck_req;
444         }
445         | BAR STRING                    {
446                 $$ = new Bar_req(*$2);
447                 delete $2;
448         }
449         | METER '{' int '*' int '}'     {
450                 Meter_change_req *m = new Meter_change_req;
451                 m->set($3,$5);
452                 // sorry hw, i need meter at output of track,
453                 // but don-t know where to get it... statics should go.
454                 Midi_def::num_i_s = $3;
455                 Midi_def::den_i_s = $5;
456                 $$ = m;
457         }
458         | SKIP '{' duration_length '}' {
459                 Skip_req * skip_p = new Skip_req;
460                 skip_p->duration_ = *$3;
461                 delete $3;
462                 $$ = skip_p;
463         }
464         | CADENZA '{' int '}'   {
465                 $$ = new Cadenza_req($3);
466         }
467         | PARTIAL '{' duration_length '}'       {
468                 $$ = new Partial_measure_req(*$3);
469                 delete $3;
470         }
471         | STEM '{' int '}'              {
472                 $$ = get_stemdir_req($3);
473         }
474         | CLEF STRING {
475                 $$ = new Clef_change_req(*$2);
476                 delete $2;
477         }
478         | KEY '{' pitch_list '}'        {       
479                 Key_change_req *key_p= new Key_change_req;
480                 key_p->melodic_p_arr_ = *$3;
481                 $$ = key_p;
482                 delete $3;
483         }
484         | GROUPING '{' intastint_list '}' {
485                 $$ = get_grouping_req(*$3); delete $3;
486         }
487         ;
488
489 post_requests:
490         {
491                 assert(post_reqs.empty());
492         }
493         | post_requests post_request {
494                 $2->defined_ch_c_l_ = lexer->here_ch_c_l();
495                 post_reqs.push($2);
496         }
497         | post_requests close_plet_parens INT '/' INT { 
498                 post_reqs.push( get_request($2) ); 
499                 req_defined_ch_c_l = lexer->here_ch_c_l();
500                 post_reqs.push( get_plet_request( $2, $3, $5 ) ); 
501         }
502         ;
503
504 post_request:
505         pure_post_request
506         | POST_REQUEST_IDENTIFIER       {
507                 $$ = $1->request(false)->clone();
508         }
509         ;
510
511 pure_post_request:
512         close_request_parens    { 
513                 $$ = get_request($1); 
514         }
515         | script_req
516         | textscript_req
517         | dynamic_req
518         ;
519
520
521 octave_quote:
522         '\''            { $$ = 1; }
523         | '`'           { $$ = -1; }
524         ;
525
526 octave_quotes:
527         /**/ { $$ = 0; }
528         | octave_quotes octave_quote{ $$ += $2; }
529         ;
530
531 /*
532         URG!!
533 */
534 steno_note_req:
535         MELODIC_REQUEST_IDENTIFIER      {
536                 $$ = new Note_req;
537                 * (Melodic_req *) $$ = *$1->request(false)->melodic();
538                 $$->octave_i_ += lexer->prefs.default_octave_i_;
539         }
540         | octave_quote steno_note_req   {  
541                 $2-> octave_i_ += $1;
542                 $$ = $2; //ugh!!
543         }
544         | '!' steno_note_req            {
545                 $$ = $2;
546                 $2->forceacc_b_ = ! $2->forceacc_b_;
547         } 
548         ;
549
550 melodic_request:
551         MELODIC '{' int int int int '}' {/* ugh */
552                 $$ = new Melodic_req;
553                 $$->octave_i_ = $3;
554                 $$->notename_i_ = $4;
555                 $$->accidental_i_ = $5;
556                 $$->forceacc_b_ = $6;
557         }
558         ;
559
560 dynamic_req:
561         DYNAMIC '{' int '}'     {
562                 Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
563                 ad_p ->loudness_ = $3;
564                 $$ =ad_p;
565         }
566         ;
567
568 close_plet_parens:
569         ']' {
570                 req_defined_ch_c_l = lexer->here_ch_c_l();
571                 $$ = ']';
572         }
573         ;
574
575 close_request_parens:
576         '('     { 
577                 $$='(';
578         }
579         | ']'   { 
580                 $$ = ']';
581         }
582         ;
583   
584 open_request_parens:
585         ')'     { 
586                 $$=')';
587         }
588         | '['   {
589                 $$='[';
590         }
591         ;
592
593 script_definition:
594         SCRIPT '{' script_body '}'      { $$ = $3; }
595         ;
596
597 script_body:
598         STRING int int int              {
599                 $$ = new Script_def(*$1,$2, $3,$4);
600                 delete $1;
601         }       
602         ;
603
604 textscript_req:
605         script_dir mudela_text          { $$ = get_text_req($1,$2); }
606         ;
607
608 mudela_text:
609         STRING                  { 
610                 defined_ch_c_l = lexer->here_ch_c_l();
611                 $$ = get_text(*$1); 
612                 delete $1;
613         }
614         ;
615
616 script_req:
617         script_dir mudela_script        { 
618                 $$ = get_script_req($1, $2);
619         }
620         ;
621
622 mudela_script:
623         IDENTIFIER              { $$ = $1->script(true); }
624         | script_definition             { $$ = $1; }
625         | '^'           { $$ = get_scriptdef('^'); }
626         | '+'           { $$ = get_scriptdef('+'); }
627         | '-'           { $$ = get_scriptdef('-'); }
628         | '|'           { $$ = get_scriptdef('|'); }
629         | 'o'           { $$ = get_scriptdef('o'); }
630         | '>'           { $$ = get_scriptdef('>'); }
631         | '.'           { $$ = get_scriptdef('.'); }
632         | DOTS          {
633                 if ( $1 > 1 ) 
634                     warning( "too many staccato dots", lexer->here_ch_c_l() );
635                 $$ = get_scriptdef('.');
636         }
637         | error {
638                 $$ = get_scriptdef('.');
639                 yyerrok;
640         }
641         ;
642
643 script_dir:
644         '_'     { $$ = -1; }
645         |'^'    { $$ = 1; }
646         |'-'    { $$ = 0; }
647         ;
648
649 pre_requests:
650         | pre_requests pre_request {
651                 pre_reqs.push($2);
652                 $2->defined_ch_c_l_ = lexer->here_ch_c_l();
653         }
654         ;
655
656 pre_request: 
657         open_request_parens     { 
658                 defined_ch_c_l = lexer->here_ch_c_l();
659                 $$ = get_request($1); 
660         }
661         ;
662
663 voice_command:
664         PLET    '{' INT '/' INT '}'             {
665                 lexer->prefs.set_plet($3,$5);
666         }
667         | DURATIONCOMMAND '{' STRING '}'        {
668                 lexer->prefs.set_duration_mode(*$3);
669                 delete $3;
670         }
671         | DURATIONCOMMAND '{' notemode_duration '}'     {
672                 lexer->prefs.set_default_duration($3);
673         }
674         | OCTAVECOMMAND '{' octave_quotes '}'   {
675                 lexer->prefs.default_octave_i_ = $3;
676         }
677         | TEXTSTYLE STRING      {
678                 lexer->prefs.textstyle_str_ = *$2;
679                 delete $2;
680         }
681         ;
682
683 duration_length:        
684         mudela_duration         {
685                 $$ = new Moment(wholes($1[0], $1[1]));
686         }
687         |int '*' mudela_duration        {
688                 $$ = new Moment(Rational($1) * wholes($3[0], $3[1]));
689         }
690         ;
691
692 notemode_duration:
693         explicit_duration
694         | default_duration
695         ;
696
697 mudela_duration:
698         int             {
699                 $$[0] = $1;
700                 $$[1] = 0;
701         }
702         | int DOTS      {
703                 $$[0] = $1;
704                 $$[1] = $2;
705         }
706         ;
707
708
709 explicit_duration:
710         INT             {
711                 lexer->prefs.set_last_duration($1);
712                 $$[0] = $1;
713                 $$[1] = 0;
714         }
715         | INT DOTS      {
716                 lexer->prefs.set_last_duration($1);
717                 $$[0] = $1;
718                 $$[1] = $2;
719         }
720         | DOTS  {
721                 lexer->prefs.get_default_duration($$);
722                 $$[1] = $1;
723         }
724         | INT '*' INT '/' INT {
725                 // ugh, must use Duration
726                 lexer->prefs.set_plet( $3, $5 );
727                 $$[ 0 ] = $1;
728                 $$[ 1 ] = 0;
729                 lexer->prefs.set_plet( 1, 1 );
730         }
731         ;
732
733 default_duration:
734         /* empty */     {
735                 lexer->prefs.get_default_duration($$);
736         }
737         ;
738
739
740 voice_elt:
741         steno_note_req notemode_duration                {
742                 $$ = get_note_element($1, $2);
743         }
744         | RESTNAME notemode_duration            {
745                 $$ = get_rest_element(*$1, $2);
746                 delete $1;
747         }
748         ;
749
750 lyrics_elt:
751         mudela_text notemode_duration                   {
752                 $$ = get_word_element($1, $2);
753         };
754
755 /*
756         UTILITIES
757  */
758 pitch_list:                     {
759                 $$ = new Array<Melodic_req*>;
760         }
761         | pitch_list MELODIC_REQUEST_IDENTIFIER {
762                 $$->push($2->request(false)->clone()->melodic());
763         }
764         ;
765
766 int:
767         real                    {
768                 $$ = int($1);
769                 if ( distance($1,Real(int($$)) ) > 1e-8)
770                         error( "integer expected", lexer->here_ch_c_l() );
771         }
772         ;
773
774 real:
775         INT                     {
776                 $$ = Real($1);
777         }
778         | REAL          {
779                 $$ = $1;
780         }
781         | REAL_IDENTIFIER               {
782                 $$ = * $1->real(0);             
783         }
784         ;
785         
786
787
788 dim:
789         real unit       { $$ = $1*$2; }
790         ;
791
792
793 unit:   CM_T            { $$ = 1 CM; }
794         |IN_T           { $$ = 1 INCH; }
795         |MM_T           { $$ = 1 MM; }
796         |PT_T           { $$ = 1 PT; }
797         ;
798         
799 /*
800         symbol tables
801 */
802 symtables:
803         SYMBOLTABLES '{' symtables_body '}'     { $$ = $3; }
804         ;
805
806 symtables_body:
807                         {
808                 $$ = new Lookup;
809         }
810         | IDENTIFIER            {
811                 $$ = new Lookup(*$1->lookup(true));
812         }
813         | symtables_body TEXID STRING           {
814                 $$->texsetting = *$3;
815                 delete $3;
816         }
817         | symtables_body STRING '=' symtable            {
818                 $$->add(*$2, $4);
819                 delete $2;
820         }
821         ;
822
823 symtable:
824         TABLE '{' symtable_body '}' { $$ = $3; }
825         ;
826
827 symtable_body:
828                                 { $$ = new Symtable; }
829         | symtable_body STRING  symboldef {
830                 $$->add(*$2, *$3);
831                 delete $2;
832                 delete $3;
833         }
834         ;
835
836 symboldef:
837         STRING  box             {
838                 $$ = new Symbol(*$1, *$2);
839                 delete $1;
840                 delete $2;
841         }
842         | STRING {
843                 Box b;
844                 $$ = new Symbol(*$1, b);
845                 delete $1;
846         }
847         ;
848
849 box:
850         dinterval dinterval     {
851                 $$ = new Box(*$1, *$2);
852                 delete $1;
853                 delete $2;
854         }
855         ;
856
857 dinterval: dim  dim             {
858                 $$ = new Interval($1, $2);      
859         }
860         ;
861
862 %%
863
864 void
865 yyerror(const char *s)
866 {
867         lexer->LexerError(s);
868
869         if ( fatal_error_i )
870                 exit( fatal_error_i );
871 }
872
873 void
874 parse_file(String init, String s)
875 {
876    *mlog << "Parsing ... ";
877    lexer = new My_flex_lexer;
878
879 #ifndef NPRINT
880    yydebug = !monitor->silence("InitParser") && check_debug;
881    lexer->set_debug( !monitor->silence("InitLexer") && check_debug);
882 #endif
883
884    lexer->new_input(init);
885    yyparse();
886
887 #ifndef NPRINT
888    if (!monitor->silence("InitDeclarations") && check_debug)
889         lexer->print_declarations();
890
891    yydebug = !monitor->silence("Parser") && check_debug;
892    lexer->set_debug( !monitor->silence("Lexer") && check_debug);
893 #endif
894
895    lexer->new_input(s);
896    yyparse();
897 #ifdef NPRINT
898    if (!monitor->silence("Declarations") && check_debug)
899         lexer->print_declarations();
900 #endif
901    delete lexer;
902    lexer = 0;
903
904    if(!define_spots.empty())
905         warning("Braces don't match.",0);
906 }
907
908 Paper_def*
909 default_paper()
910 {
911     return new Paper_def(
912         lexer->lookup_identifier("default_table")->lookup(true));
913 }
914
915