#include #include #include #include "JLang/JToken.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to test JLANG::JToken class. * \author mdejong */ int main(int argc, char **argv) { using namespace std; typedef JLANG::JToken<';'> JToken_t; vector buffer; int debug; try { JParser<> zap("Example program to test token parsing."); zap['b'] = make_field(buffer) = JPARSER::initialised(); zap['d'] = make_field(debug) = 0; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } DEBUG(argv[0] << " parse input with separator '" << JToken_t::SEPARATOR << "'" << endl); for (size_t i = 0; i != buffer.size(); ++i) { cout << "[" << setw(2) << i << "] " << buffer[i] << endl; } }