]> git.lyx.org Git - lyx.git/blob - src/mathed/math_parser.h
further code uglification to make Jean-Marc's compiler happy
[lyx.git] / src / mathed / math_parser.h
1 // -*- C++ -*-
2 /*
3  *  File:        math_parser.h
4  *  Purpose:     Declaration of parsing utilities for mathed
5  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
6  *  Created:     January 1996
7  *  Description: Parse LaTeX2e math mode code.
8  *
9  *  Dependencies: Xlib, XForms
10  *
11  *  Copyright: 1996, Alejandro Aguilar Sierra
12  *
13  *   Version: 0.8beta.
14  *
15  *   You are free to use and modify this code under the terms of
16  *   the GNU General Public Licence version 2 or later.
17  */
18
19 #ifndef MATH_PARSER_H
20 #define MATH_PARSER_H
21
22 #ifdef __GNUG__
23 #pragma interface
24 #endif
25
26 #include "LString.h"
27 #include "math_defs.h"
28
29 class MathMatrixInset;
30 class MathMacroTemplate;
31 class LyXLex;
32
33 ///
34 enum MathTokenEnum
35 {
36         ///
37         LM_TK_SYM = 256,
38         ///
39         LM_TK_CHOOSE,
40         ///
41         LM_TK_BINOM,
42         ///
43         LM_TK_ATOP,
44         ///
45         LM_TK_OVER,
46         ///
47         LM_TK_FRAC,
48         ///
49         LM_TK_SQRT,
50         ///
51         LM_TK_ROOT,
52         ///
53         LM_TK_BEGIN,
54         ///
55         LM_TK_END,
56         ///
57         LM_TK_NEWLINE,
58         /// mathcal, mathrm...
59         LM_TK_OLDFONT,
60         /// cal,...
61         LM_TK_FONT,
62         ///
63         LM_TK_LEFT,
64         ///
65         LM_TK_RIGHT,
66         ///
67         LM_TK_DECORATION,
68         ///
69         LM_TK_FUNC,
70         ///
71         LM_TK_FUNCLIM,
72         ///
73         LM_TK_CMR,
74         ///
75         LM_TK_CMSY,
76         ///
77         LM_TK_CMM,
78         ///
79         LM_TK_CMEX,
80         ///
81         LM_TK_MSA,
82         ///
83         LM_TK_MSB,
84         ///
85         LM_TK_LABEL,
86         ///
87         LM_TK_NONUM,
88         ///
89         LM_TK_SPACE,
90         ///
91         LM_TK_DOTS,
92         ///
93         LM_TK_LIMIT,
94         ///
95         LM_TK_PROTECT,
96         ///
97         LM_TK_STY,
98         ///
99         LM_TK_SPECIAL,
100         ///
101         LM_TK_ARGUMENT, 
102         ///
103         LM_TK_NEWCOMMAND,
104         ///
105         LM_TK_MATH,
106         ///
107         LM_TK_NOT,
108         ///
109         LM_TK_KERN,
110         ///
111         LM_TK_STACK
112 };
113
114
115 ///
116 struct latexkeys {
117         ///
118         string name;
119         ///
120         short token;
121         ///
122         unsigned int id;
123         ///
124         unsigned char latex_font_id;
125         ///
126         MathSymbolTypes type;
127 };
128
129
130 ///
131 latexkeys const * in_word_set(string const & str);
132
133 ///
134 void ReadSymbols(string const & file);
135
136 MathMatrixInset * mathed_parse_normal(string const &);
137 MathMatrixInset * mathed_parse_normal(std::istream &);
138 MathMatrixInset * mathed_parse_normal(LyXLex &);
139
140 MathMacroTemplate * mathed_parse_macro(string const &);
141 MathMacroTemplate * mathed_parse_macro(std::istream &);
142 MathMacroTemplate * mathed_parse_macro(LyXLex &);
143
144 #endif