]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/includable-lexer.hh
``slikken kreng''
[lilypond.git] / lily / include / includable-lexer.hh
1 /*
2   includable-lexer.hh -- declare Includable_lexer
3
4   source file of the LilyPond music typesetter
5
6   (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef INCLUDABLE_LEXER_HH
11 #define INCLUDABLE_LEXER_HH
12
13 #include <FlexLexer.h>
14
15 #include "string.hh"
16 #include "parray.hh"
17 #include "lily-proto.hh"
18
19 // GIGA urg!
20 typedef struct yy_buffer_state *YY_BUFFER_STATE;
21
22 /**
23   an yyFlexLexer child with provisions for inclusion.
24  */
25 class Includable_lexer : public yyFlexLexer 
26 {
27   Array<YY_BUFFER_STATE> state_stack_;
28
29 protected:
30   bool  close_input ();
31   Link_array<Source_file> include_stack_;
32   Array<int> char_count_stack_;
33
34 public:
35   bool allow_includes_b_;
36   
37   Includable_lexer ();
38   ~Includable_lexer ();
39
40   /// store dependencies for Makefile stuff.
41   Array<String> filename_strings_;
42
43   Source_file* get_source_file () const;
44   void new_input (String s, Sources*);
45   void new_input (String name, String data, Sources*);
46
47   void add_lexed_char (int);
48   char const * here_str0 () const;
49 };
50
51
52 #endif // INCLUDABLE_LEXER_HH