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