]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/test/editor.cc
ocaml 3.09 transition
[helm.git] / helm / DEVEL / mathml_editor / test / editor.cc
index eab57f709b5db36cef7a129f8c98def145d00eeb..3efc17cee2168b72acb5429a1f73c3c9bdb12c78 100644 (file)
  * or send an email to <lpadovan@cs.unibo.it>
  */
 
+#include <cassert>
+
 #include "dom.hh"
 #include "TPushParser.hh"
+#include "timer.hh"
 
 #include "ILPushLexer.hh"
 #include "TDictionary.hh"
@@ -67,7 +70,7 @@ edit_output_tex(Context* data)
   DOM::Node c = res.get_firstChild();
   if (c) std::cout << "HEY, there is a child! " << c.get_nodeName() << " " << c.get_nodeValue() << std::endl;
 #endif
-  data->texStyle.save(res, stdout);
+  //data->texStyle.save(res, stdout);
 }
 
 extern "C" int
@@ -84,10 +87,13 @@ extern "C" void
 edit_push_char(Context* context, gchar ch)
 {
   assert(context != NULL);
+  long t0 = getTimer();
   GUI_freeze();
   std::cout << "*** SENDING " << ch << std::endl;
   context->lexer.push(ch);
   GUI_thaw();
+  long t1 = getTimer();
+  std::cout << "=== OVERALL TIME = " << (t1 - t0) / 1000 << std::endl;
 }
 
 #include <unistd.h>
@@ -152,7 +158,7 @@ main(int argc, char* argv[])
 
   TDictionary dictionary(logger);
   logger.info("loading the dictionary...");
-  dictionary.load("/usr/share/editex/dictionary-tex.xml");
+  dictionary.load("./dict/dictionary-tex.xml");
 
   logger.info("loading the stylesheet...");
   DOM::DOMImplementation di;
@@ -162,7 +168,7 @@ main(int argc, char* argv[])
   DOM::Document texStyleDoc = di.createDocumentFromURI("./xsl/tml-texid.xsl");
   DOMX::XSLTStylesheet texStyle(texStyleDoc);
 
-  CMathMLFactoryXSLTDiff factory(logger, mmlStyle);
+  CMathMLFactoryXSLT factory(logger, mmlStyle);
   TPushParser parser(logger, factory, dictionary);
   ILPushLexer lexer(logger, parser, dictionary);