59 lines
1.8 KiB
C++
59 lines
1.8 KiB
C++
#include <iostream>
|
|
#include <sstream>
|
|
#include "Global.h"
|
|
#include "__jet.h"
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
coreutils::ZString data("<jet name=\"localname\" filterblanklines=\"true\">\n"
|
|
" <comment>This is a comment and should not show up in the output.</comment>\n"
|
|
" <html>\n"
|
|
" <set name=\"ix\" value=\"1\" />\n"
|
|
" <set name=\"theexpr\" expr=\"true\" />\n"
|
|
" <set name=\"varname$[ix]\" value=\"vardata\" scope=\"global\" />\n"
|
|
" <set name=\"noeval\" eval=\"no\">this is the value store in #[name].</set>\n"
|
|
" <set name=\"thename\" eval=\"yes\">this is the value store in #[name].</set>\n"
|
|
" <set name=\"newname\" scope=\"global\">another container value</set>\n"
|
|
" >>>$[noeval]<<<\n"
|
|
" >>>$[thename]<<<\n"
|
|
" local: >>>#[name]<<<\n"
|
|
" <mysql key=\"uu\">\n"
|
|
" <if value1=\"X\" value2=\"Y\" type=\"eq\">\n"
|
|
" 789\n"
|
|
" <if expr=\"false\">\n"
|
|
" 123\n"
|
|
" <else>\n"
|
|
" 456\n"
|
|
" </if>\n"
|
|
" </if>\n"
|
|
" </mysql>\n"
|
|
" <for name=\"ix\" start=\"1\" end=\"5\" step=\"1\">\n"
|
|
" -->#[ix]<--\n"
|
|
" </for>\n"
|
|
" <call pgm=\"/usr/bin/ls\" arg1=\"-al\" name=\"ls\" />\n"
|
|
" $[ls]\n"
|
|
" <read file=\"compile\" name=\"file\" />\n"
|
|
" $[file]\n"
|
|
" </html>\n"
|
|
"</jet>\n");
|
|
|
|
coreutils::ZString data2("<jet>\n"
|
|
" <if expr=\"false\">\n"
|
|
" XXX\n"
|
|
" <else>\n"
|
|
" YYY\n"
|
|
" </if>\n"
|
|
"</jet>\n");
|
|
|
|
// coreutils::ZString data("<jet>ABC<jet>HIJ</jet>XYZ</jet>\n");
|
|
|
|
std::cout << "---------\n" << data << "----------\n" << std::endl;
|
|
|
|
jet::Global global;
|
|
coreutils::MString out;
|
|
jet::__jet *jet = new jet::__jet(data, out, global);
|
|
delete jet;
|
|
std::cout << ">>-------" << std::endl << out << std::endl << "<<------" << std::endl;
|
|
// global.dump();
|
|
}
|