]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/includable-lexer.hh
release: 1.0.1
[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--1998 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 "array.hh"
17 #include "fproto.hh"
18 #include "proto.hh"
19
20 // GIGA urg!
21 typedef struct yy_buffer_state *YY_BUFFER_STATE;
22
23 /**
24   an yyFlexLexer child with provisions for inclusion.
25  */
26 class Includable_lexer : public yyFlexLexer 
27 {
28   Array<YY_BUFFER_STATE> state_stack_;
29
30 protected:
31   bool  close_input ();
32   Array<Source_file*> include_stack_;
33   Array<int> char_count_stack_;
34
35 public:
36   Includable_lexer ();
37   ~Includable_lexer ();
38
39   /// store dependencies for Makefile stuff.
40   Array<String> filename_str_arr_;
41
42   Source_file* source_file_l () const;
43   void new_input (String s, Sources*);
44   void new_input (String name, String data, Sources*);
45
46   void add_lexed_char (int);
47   char const * here_ch_C ();
48 };
49
50
51 #endif // INCLUDABLE_LEXER_HH