]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/my-lily-lexer.hh
release: 1.1.13
[lilypond.git] / lily / include / my-lily-lexer.hh
1 /*
2   lexer.hh -- declare My_lily_lexer
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef LEXER_HH
10 #define LEXER_HH
11
12 #include <FlexLexer.h>
13
14 #include "dictionary.hh"
15 #include "lily-proto.hh"
16 #include "lily-proto.hh"
17 #include "fproto.hh"
18 #include "array.hh"
19 #include "string.hh"
20 #include "includable-lexer.hh"
21 #include "duration.hh"
22 #include "musical-pitch.hh"
23
24 bool busy_parsing();
25 void kill_lexer();
26 void set_lexer();
27
28
29 /// lexer for Mudela
30 class My_lily_lexer : public Includable_lexer {
31   int lookup_keyword (String);
32   int scan_bare_word (String);
33   int scan_escaped_word (String);
34
35   char escaped_char(char) const;
36 public:
37   String main_input_str_;
38   void * lexval_l;
39   Scope * toplevel_scope_p_;
40   bool main_input_b_;
41   
42   Notename_table *note_tab_p_;
43   Array<Scope*> scope_l_arr_;
44   Keyword_table * keytable_p_;
45   int errorlevel_i_;
46   Notename_table *chordmodifier_tab_p_;
47   Musical_pitch lookup_notename (String s);
48   void start_main_input ();
49   void set_notename_table(Notename_table*tab_p);
50   bool chordmodifier_b (String) const;
51   void set_chordmodifier_table (Notename_table*tab_p);
52   Musical_pitch lookup_chordmodifier (String s);
53    
54   bool notename_b(String) const;
55   Identifier*lookup_identifier (String s);
56   Musical_pitch lookup_pitch (String s);
57   void push_note_state();
58   void push_chord_state();
59   void push_lyric_state();
60   void pop_state();
61   void LexerError (char const *);
62   My_lily_lexer();
63   void set_identifier (String str, Identifier* i, bool unique_b = true);
64   ~My_lily_lexer();
65   int yylex();
66   void print_declarations (bool init_b) const;
67   void add_notename (String, Musical_pitch);
68   bool note_state_b() const;
69   bool chord_state_b() const;
70   bool lyric_state_b() const;
71 };
72
73 #endif