]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/my-lily-parser.hh
c4f500cf5e2a65286128ab02498d1447d82b597b
[lilypond.git] / lily / include / my-lily-parser.hh
1 /*
2   my-lily-parser.hh -- declare My_lily_parser
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef MY_LILY_PARSER_HH
11 #define MY_LILY_PARSER_HH
12
13 #include "lily-proto.hh"
14 #include "string.hh"
15 #include "parray.hh"
16 #include "lily-proto.hh"
17 #include "lily-proto.hh"
18 #include "duration.hh"
19 #include "pitch.hh"
20 #include "string.hh"
21 #include "array.hh"
22 #include "input.hh"
23
24 /**
25    State for the parser.  Do not ever add any variables to parse
26    musical content here.  We still have to remove default_duration_.
27
28    TODO: interface is too complicated
29 */
30 class My_lily_parser 
31 {
32 public:
33   My_lily_parser (Sources * sources_l);
34   ~My_lily_parser ();
35
36   void do_init_file ();
37   void parse_file ( String init_str, String file_str);
38   void set_version_check (bool ignore);
39
40 public:
41   Duration default_duration_;
42
43   Scope *default_header_p_;
44
45   int fatal_error_i_;
46   Sources * source_l_;
47   int error_level_i_;
48
49   My_lily_lexer * lexer_p_;
50   bool ignore_version_b_;
51
52   SCM last_beam_start_;
53   void beam_check (SCM); 
54   
55   Input here_input () const;
56   void push_spot ();
57   Input pop_spot ();
58     
59   void do_yyparse ();
60   void parser_error (String);
61
62   void set_yydebug (bool);
63
64
65   DECLARE_SCHEME_CALLBACK (paper_description, ());
66 private:
67
68   Array<Input> define_spot_array_;
69
70   char const* here_ch_C () const;
71
72   Simultaneous_music * get_chord (Pitch tonic, Array<Pitch>* add_arr_p,
73                                   Array<Pitch>* sub_arr_p, Pitch* inversion_p,
74                                   Pitch* bass_p, Duration d);
75   
76   void set_chord_tremolo (int type_i);
77   void set_last_duration (Duration const *);
78   void set_last_pitch (Pitch const *);
79   friend int yyparse (void*);
80 };
81
82 #endif // MY_LILY_PARSER_HH