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