]> git.lyx.org Git - lyx.git/blob - src/mathed/math_parser.h
killing MathType simplifies a few things...
[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 class MathAtom;
29 class MathArray;
30 class LyXLex;
31
32
33 ///
34 struct latexkeys {
35         /// name of the macro or primitive
36         string name;
37         /// name of a inset that handles that macro
38         string inset;
39         /// position of the ting in a font
40         string draw;
41         /// operator/..., fontname e
42         string extra;
43         /// how is this called as XML entity?
44         string xmlname;
45 };
46
47
48 /// check whether this is a well-known (La)TeX macro or primitive
49 latexkeys const * in_word_set(string const & str);
50
51 /// parse formula from a string
52 bool mathed_parse_normal(MathAtom &, string const &);
53 /// ... a stream
54 bool mathed_parse_normal(MathAtom &, std::istream &);
55 /// ... the LyX lexxer
56 bool mathed_parse_normal(MathAtom &, LyXLex &);
57
58 /// parse a macro definition from a string, enter it into the macro table
59 bool mathed_parse_macro(string &, string const &);
60 /// ... a stream
61 bool mathed_parse_macro(string &, std::istream &);
62 /// ... the LyX lexxer
63 bool mathed_parse_macro(string &, LyXLex &);
64
65 /// parse a single cell from a string
66 void mathed_parse_cell(MathArray & ar, string const &);
67 /// ... a stream
68 void mathed_parse_cell(MathArray & ar, std::istream &);
69
70 #endif