]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/mathml_editor/src/TToken.hh
A first partial implementation of deleting is introduced. The user might
[helm.git] / helm / DEVEL / mathml_editor / src / TToken.hh
1
2 #ifndef __TToken_hh__
3 #define __TToken_hh__
4
5 #include <string>
6
7 struct TToken
8 {
9   enum TCat
10     {
11       BEGIN,
12       END,
13       SHIFT,
14       ALIGN,
15       EOL,
16       PARAMETER,
17       SUPERSCRIPT,
18       SUBSCRIPT,
19       SPACE,
20       LETTER,
21       DIGIT,
22       OTHER,
23       ACTIVE,
24       COMMENT,
25       CONTROL,
26       GDELETE
27     };
28
29   TToken(TCat c) : category(c) { };
30   TToken(TCat c, char ch) : category(c), value(std::string(1, ch)) { };
31   TToken(TCat c, const std::string& v) : category(c), value(v) { };
32
33   bool operator==(const TToken& token) const { return category == token.category && value == token.value; };
34
35   TCat        category;
36   std::string value;
37 };
38
39 #endif // __TToken_hh__