]> git.lyx.org Git - lyx.git/blob - src/mathed/math_parser.h
use the new sstream return non-pods as const, use string instead of char * in a lot...
[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
20 #define MATH_PARSER
21
22 #ifdef __GNUG__
23 #pragma interface
24 #endif
25
26 #include "LString.h"
27
28 #include "symbol_def.h"
29
30 ///
31 #define LM_TK_OPEN '{'
32 ///
33 #define LM_TK_CLOSE '}'
34
35 ///
36 enum MathTokenEnum
37 {
38     ///
39     LM_TK_BOP = 256,
40     ///
41     LM_TK_ALPHA,
42     ///
43     LM_TK_STR,
44     ///
45     LM_TK_SYM,
46     ///
47     LM_TK_FRAC,
48     ///
49     LM_TK_SQRT,
50     ///
51     LM_TK_BEGIN,
52     ///
53     LM_TK_END,
54     ///
55     LM_TK_NEWLINE,
56     ///
57     LM_TK_UNDEF,
58     ///
59     LM_TK_FONT,
60     ///
61     LM_TK_LEFT,
62     ///
63     LM_TK_RIGHT,
64     ///
65     LM_TK_ACCENT,
66     ///
67     LM_TK_WIDE,
68     ///
69     LM_TK_FUNC,
70     ///
71     LM_TK_FUNCLIM,
72     ///
73     LM_TK_BIGSYM,
74     ///
75     LM_TK_LABEL,
76     ///
77     LM_TK_NONUM,
78     ///
79     LM_TK_SPACE,
80     ///
81     LM_TK_DOTS,
82     ///
83     LM_TK_LIMIT,
84     ///
85     LM_TK_STY,
86     ///
87     LM_TK_PMOD,
88     ///
89     LM_TK_BMOD,
90     ///
91     LM_TK_MACRO,
92     ///
93     LM_TK_SPECIAL,
94     ///
95     LM_TK_ARGUMENT, 
96     ///
97     LM_TK_NEWCOMMAND,
98     ///
99     LM_TK_STACK
100 };
101
102
103 ///
104 struct latexkeys {
105     ///
106     char const * name;
107     ///
108     short token;
109     ///
110     int id;
111 };
112
113
114 ///
115 latexkeys *
116 in_word_set (register char const * str, register int len);
117
118 ///
119 latexkeys * in_word_set(string const & str);
120
121 ///
122 latexkeys * lm_get_key(int index);
123
124 ///
125 latexkeys * lm_get_key_by_id(int id, short tc = LM_TK_SYM);
126
127 ///
128 union YYSTYPE {
129     ///
130     unsigned char c;
131     ///
132     char * s;
133     ///
134     int i;
135     ///
136     latexkeys * l;
137 };
138
139 extern YYSTYPE yylval;
140
141 #endif