]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/src/TToken.hh
Initial revision
[helm.git] / helm / DEVEL / mathml_editor / src / TToken.hh
diff --git a/helm/DEVEL/mathml_editor/src/TToken.hh b/helm/DEVEL/mathml_editor/src/TToken.hh
new file mode 100644 (file)
index 0000000..1cb6ca1
--- /dev/null
@@ -0,0 +1,38 @@
+
+#ifndef __TToken_hh__
+#define __TToken_hh__
+
+#include <string>
+
+struct TToken
+{
+  enum TCat
+    {
+      BEGIN,
+      END,
+      SHIFT,
+      ALIGN,
+      EOL,
+      PARAMETER,
+      SUPERSCRIPT,
+      SUBSCRIPT,
+      SPACE,
+      LETTER,
+      DIGIT,
+      OTHER,
+      ACTIVE,
+      COMMENT,
+      CONTROL
+    };
+
+  TToken(TCat c) : category(c) { };
+  TToken(TCat c, char ch) : category(c), value(std::string(1, ch)) { };
+  TToken(TCat c, const std::string& v) : category(c), value(v) { };
+
+  bool operator==(const TToken& token) const { return category == token.category && value == token.value; };
+
+  TCat        category;
+  std::string value;
+};
+
+#endif // __TToken_hh__