]> git.lyx.org Git - lyx.git/blob - src/lyxlex_pimpl.h
Update NEWS, fix a few buglets
[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 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         bool next(bool esc = false);
41         ///
42         int search_kw(char const * const tag) const;
43         ///
44         int lex();
45         ///
46         bool EatLine();
47         ///
48         bool nextToken();
49         ///
50         void pushToken(string const &);
51         /// fb__ is only used to open files, the stream is accessed through is
52         std::filebuf fb__;
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         char buff[LEX_MAX_BUFF];
63         ///
64         short status;
65         ///
66         int lineno;
67         ///
68         string pushTok;
69 private:
70         ///
71         void verifyTable();
72         ///
73         struct pushed_table {
74                 ///
75                 pushed_table()
76                         : table_elem(0), table_siz(0) {}
77                 ///
78                 pushed_table(keyword_item * ki, int siz)
79                         : table_elem(ki), table_siz(siz) {}
80                 ///
81                 keyword_item * table_elem;
82                 ///
83                 int table_siz;
84         };
85         ///
86         std::stack<pushed_table> pushed;
87 };
88 #endif