return o;
}
+std::pair<std::string, unsigned>
+get_file_and_line(const xmlpp::Element* root, const xmlpp::Element* element)
+{
+ return std::pair<std::string, unsigned>(get_file(root, element->get_attribute("file")->get_value()),
+ boost::lexical_cast<unsigned>(element->get_attribute("line")->get_value())-1);
+}
+
+std::string
+get_file_and_line_as_string(const xmlpp::Element* root, const xmlpp::Element* element)
+{
+ std::pair<std::string, unsigned> fl(get_file_and_line(root,element));
+ return std::string(fl.first)+":"+boost::lexical_cast<std::string>(fl.second);
+}
+
class Parser
{
public:
if (f.args.back().second.name.empty()) {
assert(element->get_attribute("file"));
assert(element->get_attribute("line"));
- throw parse_error(get_file(root, element->get_attribute("file")->get_value()),
- boost::lexical_cast<unsigned>(element->get_attribute("line")->get_value())-1,
+ std::pair<std::string, unsigned> file_and_line(get_file_and_line(root, element));
+ throw parse_error(file_and_line.first,
+ file_and_line.second,
std::string("type of parameter `")+f.args.back().first+"' not (yet?) supported");
}
}
}
- std::cerr << "Found function: " << f << std::endl;
+ std::cerr << get_file_and_line_as_string(root, element) << ": found procedure: " << f << std::endl;
m_procedures.push_back(f);
}