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