Raise the exception ourselves instead of leaking an error code that
must be converted into an exception by our caller.
sg_platf_init();
surf_parse_open(file);
- int parse_status = surf_parse();
+ surf_parse();
surf_parse_close();
- surf_parse_assert(not parse_status, std::string("Parse error in file ") + file);
}
void EngineImpl::register_function(const std::string& name, xbt_main_func_t code)
{
const std::string& name);
XBT_PUBLIC double surf_parse_get_speed(const char* string, const char* entity_kind, const std::string& name);
-XBT_PUBLIC int surf_parse(); /* Entry-point to the parser */
+XBT_PUBLIC void surf_parse(); /* Entry-point to the parser */
#endif
// Use XML parser
- int parse_status;
-
/* init the flex parser */
surf_parse_open(file);
/* Do the actual parsing */
- parse_status = surf_parse();
+ surf_parse();
/* connect all profiles relative to hosts */
for (auto const& elm : trace_connect_list_host_avail) {
}
surf_parse_close();
-
- if (parse_status)
- surf_parse_error(std::string("Parse error in ") + file);
}
}
/* Call the lexer to parse the currently opened file */
-int surf_parse()
+void surf_parse()
{
- return surf_parse_lex();
+ bool err = surf_parse_lex();
+ surf_parse_assert(not err, "Flex returned an error code");
}