X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fmathml_editor%2Ftest%2Feditor.cc;h=38c8bbbd0d5ebaee248d133d3c1df6ec5c9aef96;hb=fde0ad77237a2fbdfb5621d5b5085fe7c82e3f92;hp=00aa28eb98c04654e6c3c3738c4015331b4f5506;hpb=98e5817ce4fa424fb3181d90d327935c1b100ec4;p=helm.git diff --git a/helm/DEVEL/mathml_editor/test/editor.cc b/helm/DEVEL/mathml_editor/test/editor.cc index 00aa28eb9..38c8bbbd0 100644 --- a/helm/DEVEL/mathml_editor/test/editor.cc +++ b/helm/DEVEL/mathml_editor/test/editor.cc @@ -23,12 +23,11 @@ * or send an email to */ +#include + #include "dom.hh" #include "TPushParser.hh" -#include "LPushLexer.hh" - -#include "TPushLexer.hh" #include "ILPushLexer.hh" #include "TDictionary.hh" #include "CLoggerConsole.hh" @@ -38,8 +37,6 @@ #include "guiGTK.h" -typedef ILPushLexer MyPushLexer; - extern void *parseMathMLFile(char *); struct Context @@ -47,7 +44,7 @@ struct Context /* Context(const std::string& s, TPushLexer& l, TPushParser& p) : buffer(s), i(0), lexer(l), parser(p) { }; */ - Context(const std::string& s, MyPushLexer& l, TPushParser& p, DOMX::XSLTStylesheet& ts) + Context(const std::string& s, APushLexer& l, TPushParser& p, DOMX::XSLTStylesheet& ts) : buffer(s), i(0), lexer(l), parser(p), texStyle(ts) { }; void send(void) @@ -57,8 +54,7 @@ struct Context std::string buffer; unsigned i; - //TPushLexer& lexer; - MyPushLexer& lexer; + APushLexer& lexer; TPushParser& parser; DOMX::XSLTStylesheet& texStyle; }; @@ -71,7 +67,7 @@ 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); } @@ -91,7 +87,7 @@ edit_push_char(Context* context, gchar ch) { assert(context != NULL); GUI_freeze(); - cout << "*** SENDING " << ch << endl; + std::cout << "*** SENDING " << ch << std::endl; context->lexer.push(ch); GUI_thaw(); } @@ -150,7 +146,7 @@ edit_complete(Context* context) GUI_thaw(); } -void +int main(int argc, char* argv[]) { CLoggerConsole logger; @@ -158,7 +154,7 @@ main(int argc, char* argv[]) TDictionary dictionary(logger); logger.info("loading the dictionary..."); - dictionary.load("./dictionary-test.xml"); + dictionary.load("/usr/share/editex/dictionary-tex.xml"); logger.info("loading the stylesheet..."); DOM::DOMImplementation di; @@ -168,9 +164,9 @@ 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); - MyPushLexer lexer(logger, parser, dictionary); + ILPushLexer lexer(logger, parser, dictionary); #if 0 lexer.push('$'); @@ -192,4 +188,5 @@ main(int argc, char* argv[]) GUI_run(); GUI_uninit(); GUI_unload_document(); + }