]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/mathml_editor/src/special.cc
Initial revision
[helm.git] / helm / DEVEL / mathml_editor / src / special.cc
1
2 #include <list>
3
4 #include "dom.hh"
5 #include "globals.hh"
6 #include "TNode.hh"
7 #include "TToken.hh"
8
9 void finishG(const TNode&);
10
11 void
12 do_bgroup(const TNode& cursor)
13 {
14   TNode parent = cursor.parent();
15   if (parent.isM("matrix") || parent.isM("pmatrix") ||
16       parent.isM("bordermatrix") || parent.isM("cases"))
17     {
18       TNode row = cursor.create("row");
19       TNode cell = cursor.create("cell");
20       TNode g = cursor.createG();
21       row.append(cell);
22       cell.append(g);
23       g.append(cursor);
24       parent.append(row);
25     }
26   else
27     {
28       TNode g = cursor.createG();
29       cursor.replace(g);
30       g.append(cursor);
31     }
32 }
33
34
35
36
37 void
38 do_apostrophe(const TNode& cursor)
39 {
40 }
41
42 void
43 do_control(const TNode& cursor, const std::string& name)
44 {
45 }
46
47 void
48 do_other(const TNode& cursor, const std::string& s)
49 {
50   switch (s[0])
51     {
52     case '\'': do_apostrophe(cursor); break;
53     default:
54       if (isUnicodeDigit(s[0])) do_number(cursor, s);
55       else do_control(cursor, s);
56     }
57 }
58
59 void
60 dispatch(const TNode& cursor, const TToken& token)
61 {
62