2 midi-parser.hh -- declare Midi_parser
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Jan Nieuwenhuizen <janneke@gnu.org>
10 #ifndef MIDI_PARSER_HH
11 #define MIDI_PARSER_HH
13 // must, gcc 2.7.2{,.1} hits ico on midi-track-parser.cc:134 (@Midi_note)
18 #define next_byte() (inline_next_byte (__FUNCTION__))
19 #define peek_byte() (inline_peek_byte (__FUNCTION__))
20 #define forward_byte_L(n) (inline_forward_byte_L (__FUNCTION__, n))
25 ((info_l_->byte_L_ < info_l_->end_byte_L_ ?\
27 : (Byte const)exit (__FUNCTION__": unexpected EOF")));
30 ((info_l_->byte_L_ < info_l_->end_byte_L_ ?\
32 : (Byte const)exit (__FUNCTION__": unexpected EOF")));
34 #define forward_byte_L(n) (inline_forward_byte_L (__FUNCTION__, n))
39 #include "rational.hh"
40 #include "midi2ly-proto.hh"
42 struct Midi_parser_info
50 Byte const* end_byte_L_;
51 Source_file* source_l_;
52 Mudela_score* score_l_;
63 Midi_parser_info* info_l_;
66 Byte const* inline_forward_byte_L (char const* fun, int n)
68 if (info_l_->byte_L_ + n < info_l_->end_byte_L_ )
70 Byte const* p = info_l_->byte_L_;
71 info_l_->byte_L_ += n;
74 exit (String (fun) + ": unexpected EOF");
79 Byte inline_next_byte (char const* fun)
81 if (info_l_->byte_L_ < info_l_->end_byte_L_)
82 return *info_l_->byte_L_++;
83 exit (String (fun) + ": unexpected EOF");
87 Byte inline_peek_byte (char const* fun)
89 if (info_l_->byte_L_ < info_l_->end_byte_L_)
90 return *info_l_->byte_L_;
91 exit (String (fun) + ": unexpected EOF");
102 String message (String);
103 void warning (String);
106 #endif // MIDI_PARSER_HH