]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/lexer.hh
6a9d21a98ed7314e566ed04e94d3257b7ab4fb42
[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*> *the_id_tab;
28     Keyword_table * keytable;
29     Notename_tab * defaulttab;
30     int errorlevel_i_;
31     /* *************** */
32     int ret_notename(int *p, String text, int octave_mod);    
33     char const* here_ch_c_l();
34     void set(Notename_tab *n);
35     int lookup_keyword(String);
36     void lookup_notename(int &large, int &small, String s);
37     void LexerError(const char *);
38     String spot() const;
39     Identifier*lookup_identifier(String s);
40     My_flex_lexer();
41     void add_identifier(Identifier*i);
42     ~My_flex_lexer();
43     void new_input(String s);
44     bool  close_input();
45     int yylex();
46     void print_declarations() const;
47 };
48
49 extern My_flex_lexer *lexer;
50
51 #endif