]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/src/LPushLexer.hh
Bug fixed. In the previous version, all right open macros and all delimited arguments
[helm.git] / helm / DEVEL / mathml_editor / src / LPushLexer.hh
diff --git a/helm/DEVEL/mathml_editor/src/LPushLexer.hh b/helm/DEVEL/mathml_editor/src/LPushLexer.hh
new file mode 100644 (file)
index 0000000..1466298
--- /dev/null
@@ -0,0 +1,38 @@
+
+#ifndef __TPushLexer_hh__
+#define __LPushLexer_hh__
+
+#include <string>
+
+#include "APushLexer.hh"
+
+class LPushLexer : public APushLexer
+{
+public:
+  LPushLexer(class ALogger&, class APushParser&);
+  virtual ~LPushLexer() { };
+
+  virtual void push(char);
+  virtual void drop(bool = false);
+  virtual void reset(void);
+  virtual void flush(void);
+  virtual bool error(void) const;
+
+private:
+  enum State
+    {
+      ACCEPT,
+      ESCAPE,
+      MACRO,
+      IGNORE_SPACE,
+      PARAMETER,
+      LONG_IDENTIFIER
+    };
+
+  void transaction(char, State);
+
+  State state;
+  std::string buffer;
+};
+
+#endif // __LPushLexer_hh__