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