Skip to content
Snippets Groups Projects
Commit 7ada47ad authored by ilor's avatar ilor
Browse files

use wcclfile parsing in wcclrun

parent 8b555417
Branches
No related merge requests found
......@@ -80,18 +80,22 @@ private:
bool Runner::load_more_operators(const std::string& filename)
{
boost::shared_ptr<Wccl::FunctionalOperator> retOp;
boost::shared_ptr<Wccl::WcclFile> retOp;
try {
std::ifstream is(filename.c_str());
if (!is.good()) {
throw Wccl::FileNotFound(filename, "", __FUNCTION__);
}
retOp = parser_.parseAnyOperator(is);
retOp = parser_.parseWcclFile(is);
if (retOp) {
boost::filesystem::path p(filename);
op_names_.push_back(p.stem());
ops_.push_back(retOp);
std::string prefix = p.stem() + ":";
Wccl::UntypedOpSequence::name_op_v_t pairs = retOp->gen_all_op_pairs();
foreach (const Wccl::UntypedOpSequence::name_op_pair_t v, pairs) {
op_names_.push_back(prefix + v.first);
ops_.push_back(v.second);
}
return true;
} else {
std::cerr << "Problem while parsing -- "
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment