]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/my-lily-parser.hh
bd5b82159bcc03c2993cd3db8e5ff2fe5f586444
[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--2000 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   Input here_input() const;
53   void remember_spot();
54   Input pop_spot();
55     
56   void do_yyparse();
57   void parser_error (String);
58
59   void set_yydebug (bool);
60
61
62   DECLARE_SCHEME_CALLBACK(paper_description, ());
63 private:
64
65   Array<Input> define_spot_array_;
66
67   char const* here_ch_C() const;
68
69   Simultaneous_music * get_chord (Pitch tonic, Array<Pitch>* add_arr_p,
70                                   Array<Pitch>* sub_arr_p, Pitch* inversion_p,
71                                   Pitch* bass_p, Duration d);
72   
73   void set_chord_tremolo (int type_i);
74   void set_last_duration (Duration const *);
75   void set_last_pitch (Pitch const *);
76   friend int yyparse (void*);
77 };
78
79 #endif // MY_LILY_PARSER_HH