]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/my-lily-parser.hh
release: 1.1.65
[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--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef MY_LILY_PARSER_HH
11 #define MY_LILY_PARSER_HH
12 #include "lily-proto.hh"
13 #include "string.hh"
14 #include "parray.hh"
15 #include "lily-proto.hh"
16 #include "lily-proto.hh"
17 #include "duration.hh"
18 #include "musical-pitch.hh"
19 #include "string.hh"
20 #include "array.hh"
21 #include "input.hh"
22
23 /**
24    State for the parser.  Do not ever add any variables to parse
25    musical content here.  We still have to remove default_duration_.
26    
27  */
28 class My_lily_parser 
29 {
30 public:
31   My_lily_parser (Sources * sources_l);
32   ~My_lily_parser();
33
34   void do_init_file();
35   void parse_file ( String init_str, String file_str);
36   void set_version_check (bool ignore);
37
38 public:
39   Duration default_duration_;
40   Musical_pitch default_pitch_;
41   Scope *default_header_p_;
42   int abbrev_beam_type_i_;
43   bool first_b_;
44   int fatal_error_i_;
45   Sources * source_l_;
46   int error_level_i_;
47   bool init_parse_b_;
48   My_lily_lexer * lexer_p_;
49   bool ignore_version_b_;
50
51
52   
53   Input here_input() const;
54   void remember_spot();
55   Input pop_spot();
56     
57   Paper_def*default_paper_p();
58   Midi_def*default_midi_p();
59   void do_yyparse();
60   void parser_error (String);
61
62   void set_debug();
63   void set_yydebug (bool);
64 private:
65   char const* here_ch_C() const;
66   Array<Input> define_spot_array_;
67   String init_str_;
68
69   Simultaneous_music * get_note_element (Note_req * ,Duration *);
70   Simultaneous_music * get_chord (Musical_pitch, Array<Musical_pitch>*, Array<Musical_pitch>*, Musical_pitch*, Duration);
71   Simultaneous_music* get_rest_element (String, Duration *);
72   Simultaneous_music* get_word_element (String, Duration*);
73   String notename_str (Melodic_req* melodic);
74   void set_abbrev_beam (int type_i);
75   void set_last_duration (Duration const *);
76   void set_last_pitch (Musical_pitch const *);
77   friend int yyparse (void*);
78 };
79
80 #endif // MY_LILY_PARSER_HH