]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/my-lily-parser.hh
05393324d58f80e75d778231a6b01eaf13cfb09c
[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--2004 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 "protected-scm.hh"
14 #include "lily-proto.hh"
15 #include "string.hh"
16 #include "parray.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);
34   ~My_lily_parser ();
35
36   void do_init_file ();
37   void parse_file (String init, String file, String out_name);
38
39 public:
40   Duration default_duration_;
41   String output_basename_;
42   
43   Protected_scm header_;
44
45   int score_count_;
46   int book_count_;
47   Sources *sources_;
48   
49   int fatal_error_;
50   int error_level_;
51
52   My_lily_lexer * lexer_;
53   bool ignore_version_b_;
54
55   SCM last_beam_start_;
56   void beam_check (SCM); 
57
58   Input here_input () const;
59   void push_spot ();
60   Input pop_spot ();
61     
62   void do_yyparse ();
63   void parser_error (String);
64
65   void set_yydebug (bool);
66
67
68   DECLARE_SCHEME_CALLBACK (paper_description, ());
69 private:
70
71   Array<Input> define_spots_;
72
73   char const* here_str0 () const;
74
75   Simultaneous_music * get_chord (Pitch tonic, Array<Pitch>* adds,
76                                   Array<Pitch>* subs, Pitch* inversion,
77                                   Pitch* bass, Duration d);
78   
79   void set_chord_tremolo (int type_i);
80   void set_last_duration (Duration const *);
81   void set_last_pitch (Pitch const *);
82   friend int yyparse (void*);
83 };
84
85 #endif // MY_LILY_PARSER_HH