]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/includable-lexer.hh
Run `make grand-replace'.
[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--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef INCLUDABLE_LEXER_HH
10 #define INCLUDABLE_LEXER_HH
11
12 #ifndef LEXER_CC
13 #include <FlexLexer.h>
14 #endif
15
16 #include "std-string.hh"
17 #include "std-vector.hh"
18 #include "lily-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   vector<YY_BUFFER_STATE> state_stack_;
29
30 protected:
31   bool close_input ();
32   vector<Source_file*> include_stack_;
33   vector<int> char_count_stack_;
34
35 public:
36
37   Includable_lexer ();
38   ~Includable_lexer ();
39
40   /// store dependencies for Makefile stuff.
41   vector<string> file_name_strings_;
42
43   Source_file *get_source_file () const;
44   virtual void new_input (string s, Sources *);
45   
46   void new_input (string name, string data, Sources *);
47   
48   char const *here_str0 () const;
49 };
50
51 #endif // INCLUDABLE_LEXER_HH