]> git.lyx.org Git - lyx.git/blob - src/mathed/math_parser.h
make {} a proper inset; simplifications to 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_BOP = 256,
41         ///
42         LM_TK_ALPHA,
43         ///
44         LM_TK_STR,
45         ///
46         LM_TK_SYM,
47         ///
48         LM_TK_FRAC,
49         ///
50         LM_TK_SQRT,
51         ///
52         LM_TK_BEGIN,
53         ///
54         LM_TK_END,
55         ///
56         LM_TK_NEWLINE,
57         ///
58         LM_TK_UNDEF,
59         /// mathcal, mathrm...
60         LM_TK_OLDFONT,
61         /// cal,...
62         LM_TK_FONT,
63         ///
64         LM_TK_LEFT,
65         ///
66         LM_TK_RIGHT,
67         ///
68         LM_TK_DECORATION,
69         ///
70         LM_TK_FUNC,
71         ///
72         LM_TK_FUNCLIM,
73         ///
74         LM_TK_BIGSYM,
75         ///
76         LM_TK_NOGLYPH,
77         ///
78         LM_TK_NOGLYPHB,
79         ///
80         LM_TK_LABEL,
81         ///
82         LM_TK_NONUM,
83         ///
84         LM_TK_SPACE,
85         ///
86         LM_TK_DOTS,
87         ///
88         LM_TK_LIMIT,
89         ///
90         LM_TK_PROTECT,
91         ///
92         LM_TK_STY,
93         ///
94         LM_TK_MACRO,
95         ///
96         LM_TK_SPECIAL,
97         ///
98         LM_TK_ARGUMENT, 
99         ///
100         LM_TK_NEWCOMMAND,
101         ///
102         LM_TK_MATH,
103         ///
104         LM_TK_STACK
105 };
106
107
108 ///
109 struct latexkeys {
110         ///
111         char const * name;
112         ///
113         short token;
114         ///
115         unsigned int id;
116         ///
117         int numargs;
118 };
119
120
121 ///
122 latexkeys const * in_word_set(string const & str);
123
124 MathMatrixInset * mathed_parse_normal(string const &);
125 MathMatrixInset * mathed_parse_normal(std::istream &);
126 MathMatrixInset * mathed_parse_normal(LyXLex &);
127
128 MathMacroTemplate * mathed_parse_macro(string const &);
129 MathMacroTemplate * mathed_parse_macro(std::istream &);
130 MathMacroTemplate * mathed_parse_macro(LyXLex &);
131
132 #endif