rem: int do_actual_work (po::options_and_arguments const opts, po::variables_map const &vm, vector<string> const &pathes)
add: int do_actual_work ( po::options_and_arguments const opts, po::variables_map const &vm, vector<string> const &pathes, vector<string> const &syspathes)
context: int do_actual_work (po::options_and_arguments const opts,     po::variables_map const &vm, vector<string> const &pathes){// current file position is saved for exception handlingfile_position current_position;    try {    vector<string> const &arguments = opts.arguments();    vector<string>::const_iterator lastfile = arguments.end();        for (vector<string>::const_iterator file_it = arguments.begin();              file_it != lastfile; ++file_it)        {        ifstream instream((*file_it).c_str());        string instring;            if (!instream.is_open()) {                cerr << "Could not open input file: " << *file_it << endl;                continue;            }            instring = string(istreambuf_iterator<char>(instream.rdbuf()),                              istreambuf_iterator<char>());                    // The template lex_functor<> is defined in both namespaces:         // cpplexer::slex and cpplexer::re2clex. The 'using namespace'         // directive above tells the compiler, which of them to use.            typedef cpp::context<lex_token<std::string::iterator> > context_t;        // The C preprocessor iterator shouldn't be constructed directly. It is         // to be generated through a cpp::context<> object. This cpp:context<>         // object is additionally to be used to initialize and define different         // parameters of the actual preprocessing.        // The preprocessing of the input stream is done on the fly behind the         // scenes during iteration over the context_t::iterator_t stream.        context_t ctx (instring.begin(), instring.end(), (*file_it).c_str());        // add include directories to the include path            if (vm.count("path")) {                vector<string>::const_iterator end = pathes.end();                for (vector<string>::const_iterator cit = pathes.begin();                      cit != end; ++cit)                {                    ctx.add_include_path((*cit).c_str());                }            }                    // analyze the actual file        context_t::iterator_t first = ctx.begin();        context_t::iterator_t last = ctx.end();        int iter_depth = 0;                    cout << "Printing dependency information for: "                  << *file_it << endl;                            while (first != last) {            // retrieve position of the next token                 current_position = (*first).get_position();                                if (iter_depth != ctx.get_iteration_depth()) {                    if (iter_depth < ctx.get_iteration_depth()) {                    // the get_iteration_depth() reflects the include level of                    // the _next_ to be returned token                        if (++first == last)                            break;                        current_position = (*first).get_position();                                            // extract the filename of the current token and print out                     // the required dependency information                        for (int i = 0; i <= iter_depth; ++i)                             cout << "  ";       // indent                        cout << current_position.file << endl;                    }                    else {                        ++first;    // advance token stream                      }                                    // save new iteration depth for later comparision                    iter_depth = ctx.get_iteration_depth();                }                else {                    ++first;            // advance token stream                  }            }                // prepend endl before next file            cout << endl;        }    }    catch (cpp::abort_preprocess_exception &e) {    // abort the preprocessing: simply abort compilation        cerr             << e.file_name() << "(" << e.line_no() << "): "            << "aborting preprocessing."             << endl;        return 1;    }    catch (cpp::cpp_exception &e) {    // some preprocessing error        cerr             << e.file_name() << "(" << e.line_no() << "): "            << e.description() << endl;        return 2;    }    catch (std::exception &e) {    // use last recognized token to retrieve the error position        cerr             << current_position.file             << "(" << current_position.line << "): "            << "exception caught: " << e.what()            << endl;        return 3;    }    catch (...) {    // use last recognized token to retrieve the error position        cerr             << current_position.file             << "(" << current_position.line << "): "            << "unexpected exception caught." << endl;        return 4;    }    return 0;}