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