]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/src/TPushParser.cc
* code cleanup
[helm.git] / helm / DEVEL / mathml_editor / src / TPushParser.cc
index d3dd893d73c494ad8b6648fd4ae74242b557349f..325b9aa3c129f9a9bd31500aeec01ed6850184f1 100644 (file)
@@ -1,13 +1,14 @@
 
+#include "ALogger.hh"
 #include "TPushParser.hh"
-#include "TListener.hh"
+#include "AMathMLFactory.hh"
 
-TPushParser::TPushParser(const TDictionary& d) : dictionary(d), listener(0)
+TPushParser::TPushParser(ALogger& l, const TDictionary& d) : APushParser(l), dictionary(d)
 {
   init();
 }
 
-TPushParser::TPushParser(const TDictionary& d, TListener& l) : dictionary(d), listener(&l)
+TPushParser::TPushParser(ALogger& l, AMathMLFactory& f, const TDictionary& d) : APushParser(l, f), dictionary(d)
 {
   init();
 }
@@ -1178,7 +1179,7 @@ TPushParser::push(const TToken& token)
           cout << "ignored token" << endl;
         }
       
-      if (listener) listener->callback(doc); //it shoul be repristened if you remove the comment in the else above
+      //if (listener) listener->callback(doc); //it shoul be repristened if you remove the comment in the else above
 
     } // this end corresponds to the if ((doc.root().first() && doc.root().first().is("math")) || token.category == TToken::SHIFT)
   else
@@ -1188,8 +1189,7 @@ TPushParser::push(const TToken& token)
       cout << "push: ignored token...you have to enter in math mode...insert $" << endl;
     }
 
-
-  //if (listener) listener->callback(doc);
+  if (factory) factory->documentModified(doc);
 
   if (frames.empty()) cout << "stack vuoto" << endl;
   else cout << "stack non vuoto" << endl;
@@ -1231,8 +1231,8 @@ TPushParser::advance(const TNode& node)
 }
 
 void
-TPushParser::setCursor(const std::string& c)
+TPushParser::setCursorHint(const std::string& c)
 {
   cursor["val"] = c;
-  if (listener) listener->callback(doc);
+  if (factory) factory->documentModified(doc);
 }