]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/src/TLexerPush.hh
Initial revision
[helm.git] / helm / DEVEL / mathml_editor / src / TLexerPush.hh
diff --git a/helm/DEVEL/mathml_editor/src/TLexerPush.hh b/helm/DEVEL/mathml_editor/src/TLexerPush.hh
new file mode 100644 (file)
index 0000000..f47def4
--- /dev/null
@@ -0,0 +1,31 @@
+
+#include <deque>
+
+#include "TToken.hh"
+
+class TLexerPush
+{
+public:
+  TLexerPush(void);
+
+  void   push(TChar);
+  TToken pop(void);
+  TToken front(void) const;
+  bool   ambiguous(void) const;
+  bool   pending(void) const;
+  bool   empty(void) const;
+
+  class EmptyBuffer { };
+
+private:
+  enum State
+    {
+      ACCEPT,
+      ESCAPE,
+      CONTROL,
+      IGNORE_SPACE
+    };
+
+  State state;
+  std::deque<TToken> tokens;
+};