X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=helm%2FDEVEL%2Fmathml_editor%2Fsrc%2Ftexlexer.cc;fp=helm%2FDEVEL%2Fmathml_editor%2Fsrc%2Ftexlexer.cc;h=f0627321410aed43c3562939c9ad2f769eb62fee;hp=0000000000000000000000000000000000000000;hb=89262281b6e83bd2321150f81f1a0583645eb0c8;hpb=b1fb6b8e1767d775bc452303629e95941d142bea diff --git a/helm/DEVEL/mathml_editor/src/texlexer.cc b/helm/DEVEL/mathml_editor/src/texlexer.cc new file mode 100644 index 000000000..f06273214 --- /dev/null +++ b/helm/DEVEL/mathml_editor/src/texlexer.cc @@ -0,0 +1,26 @@ + +#include "dom.hh" +#include "TLexerPush.hh" + +main() +{ + std::string s; + while (getline(std::cin, s)) + { + TLexerPush lexer; + for (unsigned long i = 0; i < s.length(); i++) + { + lexer.push(s[i]); + cout << "pending: " << lexer.pending() + << " amb: " << lexer.ambiguous(); + if (!lexer.empty()) + { + TToken tok = lexer.front(); + DOM::GdomeString v(tok.value); + cout << " cat: " << tok.category << " value: " << v << " length: " << v.length(); + if (!lexer.ambiguous()) lexer.pop(); + } + cout << endl; + } + } +}