]> git.donarmstrong.com Git - lilypond.git/blob - lib/include/includable-lexer.hh
release: 0.0.44
[lilypond.git] / lib / include / includable-lexer.hh
1 /*
2   includable-lexer.hh -- declare 
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef INCLUDABLE_LEXER_HH
11 #define INCLUDABLE_LEXER_HH
12 #include "string.hh"
13 #include <FlexLexer.h>
14 #include "varray.hh"
15 #include "fproto.hh"
16 #include "proto.hh"
17
18 // GIGA urg!
19 typedef struct yy_buffer_state *YY_BUFFER_STATE;
20
21 /**
22   an yyFlexLexer child with provisions for inclusion.
23  */
24 class Includable_lexer : public yyFlexLexer {
25     Array<YY_BUFFER_STATE> state_stack_;
26 protected:
27     bool  close_input();
28     Array<Source_file*> include_stack_;
29     Array<int> char_count_stack_;
30 public:
31     void new_input(String s,Sources*);
32     Includable_lexer();
33     ~Includable_lexer();
34     void add_lexed_char(int);
35     char const * here_ch_C();
36 };
37
38
39 #endif // INCLUDABLE_LEXER_HH