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