]> git.lyx.org Git - lyx.git/blob - src/lyxlex_pimpl.h
add boost
[lyx.git] / src / lyxlex_pimpl.h
1 // -*- C++ -*-
2
3 #ifndef LYXLEX_PIMPL_H
4 #define LYXLEX_PIMPL_H
5
6 #include <fstream>
7 #include <stack>
8
9 #include "lyxlex.h"
10
11 #ifdef __GNUG__
12 #pragma interface
13 #endif
14
15 ///
16 struct LyXLex::Pimpl : public boost::noncopyable {
17         ///
18         enum {
19                 ///
20                 LEX_MAX_BUFF = 2048
21         };
22         
23         ///
24         Pimpl(keyword_item * tab, int num);
25         ///
26         string const GetString() const;
27         ///
28         void printError(string const & message) const;
29         ///
30         void printTable(std::ostream & os);
31         ///
32         void pushTable(keyword_item * tab, int num);
33         ///
34         void popTable();
35         ///
36         bool setFile(string const & filename);
37         ///
38         void setStream(std::istream & i);
39         ///
40         void setCommentChar(char c);
41         ///
42         bool next(bool esc = false);
43         ///
44         int search_kw(char const * const tag) const;
45         ///
46         int lex();
47         ///
48         bool EatLine();
49         ///
50         bool nextToken();
51         ///
52         void pushToken(string const &);
53         /// fb__ is only used to open files, the stream is accessed through is
54         std::filebuf fb__;
55         /// the stream that we use.
56         std::istream is;
57         /// 
58         string name;
59         ///
60         keyword_item * table;
61         ///
62         int no_items;
63         ///
64         char buff[LEX_MAX_BUFF];
65         ///
66         short status;
67         ///
68         int lineno;
69         ///
70         string pushTok;
71         ///
72         char commentChar;
73 private:
74         ///
75         void verifyTable();
76         ///
77         struct pushed_table {
78                 ///
79                 pushed_table()
80                         : table_elem(0), table_siz(0) {}
81                 ///
82                 pushed_table(keyword_item * ki, int siz)
83                         : table_elem(ki), table_siz(siz) {}
84                 ///
85                 keyword_item * table_elem;
86                 ///
87                 int table_siz;
88         };
89         ///
90         std::stack<pushed_table> pushed;
91 };
92 #endif