]> git.lyx.org Git - lyx.git/blob - src/lyxlex_pimpl.h
Angus insetindex patch + protect patch from Dekel
[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         int search_kw(char const * const tag) const;
56         ///
57         int lex();
58         ///
59         bool EatLine();
60         ///
61         bool nextToken();
62         ///
63         void pushToken(string const &);
64
65         /// fb__ is only used to open files, the stream is accessed through is
66         std::filebuf fb__;
67         /// the stream that we use.
68         std::istream is;
69         /// 
70         string name;
71         ///
72         keyword_item * table;
73         ///
74         int no_items;
75         ///
76         char buff[LEX_MAX_BUFF];
77         ///
78         short status;
79         ///
80         pushed_table * pushed;
81         ///
82         int lineno;
83         ///
84         string pushTok;
85 };
86 #endif