]> git.lyx.org Git - lyx.git/blob - src/mathed/math_parser.h
45c89dddab19b76b2533fcf155c6bdebc3c37025
[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
28 #include "math_defs.h"
29 #include "symbol_def.h"
30
31 class MathMatrixInset;
32 class MathMacroTemplate;
33 class LyXLex;
34
35 ///
36 enum MathTokenEnum
37 {
38         ///
39         LM_TK_SYM = 256,
40         ///
41         LM_TK_CHOOSE,
42         ///
43         LM_TK_BINOM,
44         ///
45         LM_TK_ATOP,
46         ///
47         LM_TK_OVER,
48         ///
49         LM_TK_FRAC,
50         ///
51         LM_TK_SQRT,
52         ///
53         LM_TK_ROOT,
54         ///
55         LM_TK_BEGIN,
56         ///
57         LM_TK_END,
58         ///
59         LM_TK_NEWLINE,
60         ///
61         LM_TK_UNDEF,
62         /// mathcal, mathrm...
63         LM_TK_OLDFONT,
64         /// cal,...
65         LM_TK_FONT,
66         ///
67         LM_TK_LEFT,
68         ///
69         LM_TK_RIGHT,
70         ///
71         LM_TK_DECORATION,
72         ///
73         LM_TK_FUNC,
74         ///
75         LM_TK_FUNCLIM,
76         ///
77         LM_TK_CMR,
78         ///
79         LM_TK_CMSY,
80         ///
81         LM_TK_CMM,
82         ///
83         LM_TK_CMEX,
84         ///
85         LM_TK_MSA,
86         ///
87         LM_TK_MSB,
88         ///
89         LM_TK_LABEL,
90         ///
91         LM_TK_NONUM,
92         ///
93         LM_TK_SPACE,
94         ///
95         LM_TK_DOTS,
96         ///
97         LM_TK_LIMIT,
98         ///
99         LM_TK_PROTECT,
100         ///
101         LM_TK_STY,
102         ///
103         LM_TK_SPECIAL,
104         ///
105         LM_TK_ARGUMENT, 
106         ///
107         LM_TK_NEWCOMMAND,
108         ///
109         LM_TK_MATH,
110         ///
111         LM_TK_NOT,
112         ///
113         LM_TK_KERN,
114         ///
115         LM_TK_STACK
116 };
117
118
119 ///
120 struct latexkeys {
121         ///
122         string name;
123         ///
124         short token;
125         ///
126         unsigned int id;
127         ///
128         unsigned char latex_font_id;
129         ///
130         MathSymbolTypes type;
131 };
132
133
134 ///
135 latexkeys const * in_word_set(string const & str);
136
137 ///
138 void ReadSymbols(string const & file);
139
140 MathMatrixInset * mathed_parse_normal(string const &);
141 MathMatrixInset * mathed_parse_normal(std::istream &);
142 MathMatrixInset * mathed_parse_normal(LyXLex &);
143
144 MathMacroTemplate * mathed_parse_macro(string const &);
145 MathMacroTemplate * mathed_parse_macro(std::istream &);
146 MathMacroTemplate * mathed_parse_macro(LyXLex &);
147
148 #endif