]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/mathml_editor/src/texlexer.cc
Initial revision
[helm.git] / helm / DEVEL / mathml_editor / src / texlexer.cc
1
2 #include "dom.hh"
3 #include "TLexerPush.hh"
4
5 main()
6 {
7   std::string s;
8   while (getline(std::cin, s))
9     {
10       TLexerPush lexer;
11       for (unsigned long i = 0; i < s.length(); i++)
12         {
13           lexer.push(s[i]);
14           cout << "pending: " << lexer.pending()
15                << " amb: " << lexer.ambiguous();
16           if (!lexer.empty())
17             {
18               TToken tok = lexer.front();
19               DOM::GdomeString v(tok.value);
20               cout << " cat: " << tok.category << " value: " << v << " length: " << v.length();
21               if (!lexer.ambiguous()) lexer.pop();
22             }
23           cout << endl;
24         }
25     }
26 }