]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/mathml_editor/src/TToken.hh
Initial revision
[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     };
27
28   TToken(TCat c) : category(c) { };
29   TToken(TCat c, char ch) : category(c), value(std::string(1, ch)) { };
30   TToken(TCat c, const std::string& v) : category(c), value(v) { };
31
32   bool operator==(const TToken& token) const { return category == token.category && value == token.value; };
33
34   TCat        category;
35   std::string value;
36 };
37
38 #endif // __TToken_hh__