lilypond-1.3.16
[lilypond.git] / lily / include / lexer.hh
blob266ee22a56c385caa26c95952e37580add593d37
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();
24 struct Lexer_prefs {
25 int default_duration, default_dots, default_octave_i_;
26 int default_plet_type, default_plet_dur;
27 String textstyle_str_;
29 bool last_duration_mode ;
31 Lexer_prefs();
32 Moment plet_mom();
33 void set_default_duration(int *);
34 void set_last_duration(int n);
35 void set_duration_mode(String s);
36 void get_default_duration(int *);
37 void set_plet(int,int);
40 /// lexer with provisions for include files.
41 struct My_flex_lexer : yyFlexLexer {
42 Lexer_prefs prefs;
44 Array<Input_file*> include_stack_;
45 Assoc<String, Identifier*> *identifier_assoc_p_;
46 Keyword_table * keytable_p_;
47 int errorlevel_i_;
49 /* *************** */
51 char const* here_ch_c_l();
52 int lookup_keyword(String);
53 void lookup_notename(int &large, int &small, String s);
54 void LexerError(const char *);
55 String spot() const;
56 Identifier*lookup_identifier(String s);
57 My_flex_lexer();
58 void add_identifier(Identifier*i);
59 ~My_flex_lexer();
60 void new_input(String s);
61 bool close_input();
62 int yylex();
63 void print_declarations() const;
66 extern My_flex_lexer *lexer;
68 #endif