]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/my-lily-parser.hh
Imported sources
[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 "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 (Input_file_results * 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   Scheme_hash_table *default_header_;
44
45   int fatal_error_;
46   Input_file_results * input_file_;
47   int error_level_;
48
49   My_lily_lexer * lexer_;
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_spots_;
69
70   char const* here_str0 () const;
71
72   Simultaneous_music * get_chord (Pitch tonic, Array<Pitch>* adds,
73                                   Array<Pitch>* subs, Pitch* inversion,
74                                   Pitch* bass, 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