]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/ocaml/c_mathml_editor.cc
* fix in optional argument for ocaml binding
[helm.git] / helm / DEVEL / mathml_editor / ocaml / c_mathml_editor.cc
index 14bab319d455df313b45d9c146889739a6979bb4..8ab2a05cc095c6ee6fdb3c6d9b9c41fb5004ce52 100644 (file)
@@ -29,6 +29,7 @@
 #include "TDictionary.hh"
 #include "CMathMLFactoryXSLT.hh"
 #include "TPushLexer.hh"
+#include "LPushLexer.hh"
 #include "TPushParser.hh"
 
 class CCallbackLogger : public ALogger
@@ -59,7 +60,7 @@ CCallbackLogger::message(Level l, const std::string& s)
 
 struct Editor
 {
-  Editor(const char*, const char*, const char*, void (*)(int, const char*, void*), void*);
+  Editor(const char*, const char*, const char*, void (*)(int, const char*, void*), void*, bool);
   ~Editor();
 
   ALogger*        logger;
@@ -72,7 +73,7 @@ struct Editor
 };
 
 Editor::Editor(const char* dict_uri, const char* mml_uri, const char* tex_uri,
-              void (*cb)(int, const char*, void*), void* data)
+              void (*cb)(int, const char*, void*), void* data, bool alt)
 {
   assert(dict_uri);
   assert(mml_uri);
@@ -88,7 +89,8 @@ Editor::Editor(const char* dict_uri, const char* mml_uri, const char* tex_uri,
   tml_tex = new DOMX::XSLTStylesheet(tex);
   factory = new CMathMLFactoryXSLT(*logger, *tml_mml);
   parser = new TPushParser(*logger, *factory, *dictionary);
-  lexer = new TPushLexer(*logger, *parser);
+  if (alt) lexer = new LPushLexer(*logger, *parser);
+  else lexer = new TPushLexer(*logger, *parser);
 }
 
 Editor::~Editor()
@@ -121,13 +123,14 @@ c_mathml_editor_get_default_tex_stylesheet_path()
 }
 
 extern "C" Editor*
-c_mathml_editor_new(const char* dictionary_uri,
+c_mathml_editor_new(bool alt,
+                   const char* dictionary_uri,
                    const char* tml_mml_uri,
                    const char* tml_tex_uri,
                    void (*log_message_cb)(int, const char*, void*),
                    void* user_data)
 {
-  return new Editor(dictionary_uri, tml_mml_uri, tml_tex_uri, log_message_cb, user_data);
+  return new Editor(dictionary_uri, tml_mml_uri, tml_tex_uri, log_message_cb, user_data, alt);
 }
 
 extern "C" void