]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/includable-lexer.hh
* flower
[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--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef INCLUDABLE_LEXER_HH
10 #define INCLUDABLE_LEXER_HH
11
12 #ifndef LEXER_CC
13 using namespace std;
14 #include <FlexLexer.h>
15 #endif
16
17 #include "string.hh"
18 #include "parray.hh"
19 #include "lily-proto.hh"
20
21 // GIGA urg!
22 typedef struct yy_buffer_state *YY_BUFFER_STATE;
23
24 /**
25    an yyFlexLexer child with provisions for inclusion.
26 */
27 class Includable_lexer : public yyFlexLexer
28 {
29   Array<YY_BUFFER_STATE> state_stack_;
30
31 protected:
32   bool close_input ();
33   Link_array<Source_file> include_stack_;
34   Array<int> char_count_stack_;
35
36 public:
37   bool allow_includes_b_;
38
39   Includable_lexer ();
40   ~Includable_lexer ();
41
42   /// store dependencies for Makefile stuff.
43   Array<String> file_name_strings_;
44
45   Source_file *get_source_file () const;
46   void new_input (String s, Sources *);
47   void new_input (String name, String data, Sources *);
48
49   char const *here_str0 () const;
50 };
51
52 #endif // INCLUDABLE_LEXER_HH