lilypond-0.0.35
[lilypond.git] / hdr / lexer.hh
blob7f06158c3a5c31652fcfd3e3aeacbb44d03928ef
1 /*
2 lexer.hh -- declare My_flex_lexer
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
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"
17 int yylex();
18 void yyerror(const char *s);
19 bool busy_parsing();
20 void kill_lexer();
21 void set_lexer();
23 /// lexer with provisions for include files.
24 struct My_flex_lexer : yyFlexLexer {
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();
48 extern My_flex_lexer *lexer;
50 #endif