#include #include #include #include #include "JLang/JObjectIterator.hh" #include "JLang/JStreamObjectIterator.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to test JLANG::JObjectIterator class. * \author mdejong */ int main(int argc, char **argv) { using namespace std; int debug; try { JParser<> zap("Example program to test object iteration."); zap['d'] = make_field(debug) = 3; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } using namespace JPP; stringstream buffer; for (int i = 1; i != 5; ++i) { buffer << ' ' << i; } typedef int JType_t; JStreamObjectIterator in(buffer); for (int i = 1; in.hasNext(); ++i) { int value = *in.next(); DEBUG(value << endl); ASSERT(value == i); } return 0; }