]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/my-lily-lexer.hh
release: 0.1.8
[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 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #ifndef LEXER_HH
10 #define LEXER_HH
11
12 #include <FlexLexer.h>
13
14 #include "lily-proto.hh"
15 #include "lily-proto.hh"
16 #include "fproto.hh"
17 #include "varray.hh"
18 #include "string.hh"
19 #include "includable-lexer.hh"
20 #include "duration.hh"
21
22 bool busy_parsing();
23 void kill_lexer();
24 void set_lexer();
25
26
27 /// lexer for Mudela
28 class My_lily_lexer : public Includable_lexer {
29     int lookup_keyword (String);
30     int scan_bare_word (String);
31     int scan_escaped_word (String);
32
33     bool post_quotes_b_;
34 public:
35     void * lexval_l;
36     
37     Notename_table  *note_tab_p_;
38     Assoc<String, Identifier*> *identifier_assoc_p_;
39     Keyword_table * keytable_p_;
40     int errorlevel_i_;
41
42     /* *************** */
43
44     void clear_notenames();
45     Identifier*lookup_identifier (String s);
46     Melodic_req* lookup_melodic_req_l (String s);
47     void push_note_state();
48     void push_lyric_state();
49     void pop_state();
50     void LexerError (char const *);
51     My_lily_lexer();
52     void set_identifier (String,Identifier*i);
53     ~My_lily_lexer();
54     int yylex();
55     void print_declarations (bool init_b) const;
56     void add_notename (String, Melodic_req*);
57     bool note_state_b() const;
58     bool lyric_state_b() const;
59 };
60
61 #endif