#include "dom.hh"
#include "TPushParser.hh"
-#include "TPushLexer.hh"
+
#include "LPushLexer.hh"
+
+#include "TPushLexer.hh"
+#include "ILPushLexer.hh"
#include "TDictionary.hh"
#include "CLoggerConsole.hh"
#include "CMathMLFactoryXSLT.hh"
#include "guiGTK.h"
+typedef ILPushLexer MyPushLexer;
+
extern void *parseMathMLFile(char *);
struct Context
{
- Context(const std::string& s, APushLexer& l, TPushParser& p, DOMX::XSLTStylesheet& ts)
+ /*
+ 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)
: buffer(s), i(0), lexer(l), parser(p), texStyle(ts) { };
void send(void)
std::string buffer;
unsigned i;
- APushLexer& lexer;
+ //TPushLexer& lexer;
+ MyPushLexer& lexer;
TPushParser& parser;
DOMX::XSLTStylesheet& texStyle;
};
}
extern "C" void
-edit_drop(Context* context, gboolean alt)
+edit_drop(Context* context, gboolean alt, gboolean control)
{
+ // At the moment, the last parameter is not used, but it will
+ // be useful when we will handle the "fast" deletion
assert(context != NULL);
GUI_freeze();
context->lexer.drop(alt);
GUI_thaw();
}
+extern "C" void
+edit_complete(Context* context)
+{
+ assert(context != NULL);
+ GUI_freeze();
+ if (!context->lexer.complete()) context->lexer.push('\t');
+ GUI_thaw();
+}
+
void
main(int argc, char* argv[])
{
TDictionary dictionary(logger);
logger.info("loading the dictionary...");
- dictionary.load("/home/luca/projects/helm/DEVEL/mathml_editor/dictionary-test.xml");
+ dictionary.load("./dictionary-test.xml");
logger.info("loading the stylesheet...");
DOM::DOMImplementation di;
DOM::Document mmlStyleDoc = di.createDocumentFromURI("./xsl/tml-mmlp.xsl");
DOMX::XSLTStylesheet mmlStyle(mmlStyleDoc);
- DOM::Document texStyleDoc = di.createDocumentFromURI("./xsl/tml-tex.xsl");
+ DOM::Document texStyleDoc = di.createDocumentFromURI("./xsl/tml-texid.xsl");
DOMX::XSLTStylesheet texStyle(texStyleDoc);
CMathMLFactoryXSLT factory(logger, mmlStyle);
TPushParser parser(logger, factory, dictionary);
- LPushLexer lexer(logger, parser);
+ MyPushLexer lexer(logger, parser, dictionary);
#if 0
lexer.push('$');