]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/lexer.hh
8a55f1a585d3dc95afc00df68039f1de3304f75c
[lilypond.git] / lily / include / lexer.hh
1 /*
2   lexer.hh -- declare My_flex_lexer
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #ifndef LEXER_HH
10 #define LEXER_HH
11 #include <FlexLexer.h>
12 #include "proto.hh"
13 #include "fproto.hh"
14 #include "varray.hh"
15 #include "string.hh"
16
17 int yylex();
18 void yyerror(const char *s);
19 bool busy_parsing();
20 void kill_lexer();
21 void set_lexer();
22
23 /// lexer with provisions for include files.
24 struct My_flex_lexer : yyFlexLexer {
25
26     Array<Input_file*> include_stack_;
27     Assoc<String, Identifier*> *identifier_assoc_p_;
28     Keyword_table * keytable_p_;
29     int errorlevel_i_;
30
31     /* *************** */
32
33     char const* here_ch_c_l();
34     int lookup_keyword(String);
35     void lookup_notename(int &large, int &small, String s);
36     void LexerError(const char *);
37     String spot() const;
38     Identifier*lookup_identifier(String s);
39     My_flex_lexer();
40     void add_identifier(Identifier*i);
41     ~My_flex_lexer();
42     void new_input(String s);
43     bool  close_input();
44     int yylex();
45     void print_declarations() const;
46 };
47
48 extern My_flex_lexer *lexer;
49
50 #endif