]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/src/special.cc
Initial revision
[helm.git] / helm / DEVEL / mathml_editor / src / special.cc
diff --git a/helm/DEVEL/mathml_editor/src/special.cc b/helm/DEVEL/mathml_editor/src/special.cc
new file mode 100644 (file)
index 0000000..d794ffd
--- /dev/null
@@ -0,0 +1,62 @@
+
+#include <list>
+
+#include "dom.hh"
+#include "globals.hh"
+#include "TNode.hh"
+#include "TToken.hh"
+
+void finishG(const TNode&);
+
+void
+do_bgroup(const TNode& cursor)
+{
+  TNode parent = cursor.parent();
+  if (parent.isM("matrix") || parent.isM("pmatrix") ||
+      parent.isM("bordermatrix") || parent.isM("cases"))
+    {
+      TNode row = cursor.create("row");
+      TNode cell = cursor.create("cell");
+      TNode g = cursor.createG();
+      row.append(cell);
+      cell.append(g);
+      g.append(cursor);
+      parent.append(row);
+    }
+  else
+    {
+      TNode g = cursor.createG();
+      cursor.replace(g);
+      g.append(cursor);
+    }
+}
+
+
+
+
+void
+do_apostrophe(const TNode& cursor)
+{
+}
+
+void
+do_control(const TNode& cursor, const std::string& name)
+{
+}
+
+void
+do_other(const TNode& cursor, const std::string& s)
+{
+  switch (s[0])
+    {
+    case '\'': do_apostrophe(cursor); break;
+    default:
+      if (isUnicodeDigit(s[0])) do_number(cursor, s);
+      else do_control(cursor, s);
+    }
+}
+
+void
+dispatch(const TNode& cursor, const TToken& token)
+{
+