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