X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fmathml_editor%2Ftest%2Feditor.cc;h=cfb0ade29df133ece954dca328a30131a247e2e8;hb=7cb90c67bc6f8113188a91ecc29f6db20db5aeb8;hp=6f9175f949d1da8c76c4be8660347dc2c7d2482b;hpb=e4fed32b1519f436de9ca84c3c9c67e1530808b6;p=helm.git diff --git a/helm/DEVEL/mathml_editor/test/editor.cc b/helm/DEVEL/mathml_editor/test/editor.cc index 6f9175f94..cfb0ade29 100644 --- a/helm/DEVEL/mathml_editor/test/editor.cc +++ b/helm/DEVEL/mathml_editor/test/editor.cc @@ -23,8 +23,11 @@ * or send an email to */ +#include + #include "dom.hh" #include "TPushParser.hh" +#include "timer.hh" #include "ILPushLexer.hh" #include "TDictionary.hh" @@ -65,9 +68,9 @@ edit_output_tex(Context* data) #if 0 res.normalize(); DOM::Node c = res.get_firstChild(); - if (c) cout << "HEY, there is a child! " << c.get_nodeName() << " " << c.get_nodeValue() << endl; + 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(); - cout << "*** SENDING " << ch << endl; + 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 @@ -144,7 +150,7 @@ edit_complete(Context* context) GUI_thaw(); } -void +int main(int argc, char* argv[]) { CLoggerConsole logger; @@ -152,7 +158,7 @@ main(int argc, char* argv[]) TDictionary dictionary(logger); logger.info("loading the dictionary..."); - dictionary.load("./dictionary-test.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); - CMathMLFactoryXSLT factory(logger, mmlStyle); + CMathMLFactoryXSLTDiff factory(logger, mmlStyle); TPushParser parser(logger, factory, dictionary); ILPushLexer lexer(logger, parser, dictionary); @@ -186,4 +192,5 @@ main(int argc, char* argv[]) GUI_run(); GUI_uninit(); GUI_unload_document(); + }