From: Martin Quinson Date: Sat, 4 Nov 2017 17:10:52 +0000 (+0100) Subject: Remove the undocumented/untested tag X-Git-Tag: v3.18~294 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/cc04c824b4f962aec78683b3ec78a3379b898326 Remove the undocumented/untested tag --- diff --git a/ChangeLog b/ChangeLog index be9dcc00cd..4930ddf787 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,9 @@ SimGrid (3.18) NOT RELEASED YET (target: December 24 2017) - Removed unused functions: - xbt/file.h: xbt_basename(), xbt_dirname(), xbt_getline() - xbt/str.h: xbt_str_join() + + XML + - Remove the undocumented/untested tag SimGrid (3.17) Released October 8 2017 diff --git a/src/surf/xml/simgrid_dtd.c b/src/surf/xml/simgrid_dtd.c index 40d7cadf12..ac9cb57a55 100644 --- a/src/surf/xml/simgrid_dtd.c +++ b/src/surf/xml/simgrid_dtd.c @@ -6454,7 +6454,7 @@ case YY_STATE_EOF(S_surfxml_AS_3): case YY_STATE_EOF(S_surfxml_AS_4): case YY_STATE_EOF(S_surfxml_AS_6): case YY_STATE_EOF(S_surfxml_AS_8): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 47: @@ -6553,10 +6553,10 @@ YY_RULE_SETUP if (!AX_surfxml_ASroute_src) FAIL("Required attribute `src' not set for `ASroute' element."); LEAVE; STag_surfxml_ASroute(); surfxml_pcdata_ix = 0; ETag_surfxml_ASroute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; - case S_surfxml_zone_1: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break; - case S_surfxml_zone: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break; + case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; + case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; + case S_surfxml_zone: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break; + case S_surfxml_zone_1: case S_surfxml_zone_4: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break; } } YY_BREAK @@ -6580,10 +6580,10 @@ YY_RULE_SETUP ETag_surfxml_ASroute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; - case S_surfxml_zone_1: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break; - case S_surfxml_zone: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break; + case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; + case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; + case S_surfxml_zone: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break; + case S_surfxml_zone_1: case S_surfxml_zone_4: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break; } } YY_BREAK @@ -6599,7 +6599,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); case YY_STATE_EOF(E_surfxml_ASroute): case YY_STATE_EOF(S_surfxml_ASroute): case YY_STATE_EOF(S_surfxml_ASroute_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 68: @@ -6734,7 +6734,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); case YY_STATE_EOF(E_surfxml_actor): case YY_STATE_EOF(S_surfxml_actor): case YY_STATE_EOF(S_surfxml_actor_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 89: @@ -6815,7 +6815,7 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(E_surfxml_argument): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 100: @@ -6924,7 +6924,7 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(E_surfxml_backbone): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 115: @@ -7049,7 +7049,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0 case YY_STATE_EOF(E_surfxml_bypassASroute): case YY_STATE_EOF(S_surfxml_bypassASroute): case YY_STATE_EOF(S_surfxml_bypassASroute_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 132: @@ -7146,7 +7146,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]) case YY_STATE_EOF(E_surfxml_bypassRoute): case YY_STATE_EOF(S_surfxml_bypassRoute): case YY_STATE_EOF(S_surfxml_bypassRoute_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 145: @@ -7271,7 +7271,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text case YY_STATE_EOF(E_surfxml_bypassZoneRoute): case YY_STATE_EOF(S_surfxml_bypassZoneRoute): case YY_STATE_EOF(S_surfxml_bypassZoneRoute_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 162: @@ -7440,7 +7440,7 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(E_surfxml_cabinet): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 185: @@ -7776,7 +7776,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); case YY_STATE_EOF(E_surfxml_cluster): case YY_STATE_EOF(S_surfxml_cluster): case YY_STATE_EOF(S_surfxml_cluster_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 242: @@ -7855,7 +7855,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); case YY_STATE_EOF(E_surfxml_config): case YY_STATE_EOF(S_surfxml_config): case YY_STATE_EOF(S_surfxml_config_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 253: @@ -8012,7 +8012,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); case YY_STATE_EOF(E_surfxml_host): case YY_STATE_EOF(S_surfxml_host): case YY_STATE_EOF(S_surfxml_host_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 276: @@ -8121,7 +8121,7 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(E_surfxml_host___link): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK /* */ @@ -8209,7 +8209,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); case YY_STATE_EOF(E_surfxml_include): case YY_STATE_EOF(S_surfxml_include): case YY_STATE_EOF(S_surfxml_include_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 302: @@ -8377,7 +8377,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); case YY_STATE_EOF(E_surfxml_link): case YY_STATE_EOF(S_surfxml_link): case YY_STATE_EOF(S_surfxml_link_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 329: @@ -8489,7 +8489,7 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(E_surfxml_link___ctn): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK /* @@ -8584,7 +8584,7 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(E_surfxml_model___prop): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 359: @@ -8677,7 +8677,7 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(E_surfxml_mount): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 372: @@ -8852,7 +8852,7 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(E_surfxml_peer): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK /* @@ -9237,7 +9237,7 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(E_surfxml_prop): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 442: @@ -9426,7 +9426,7 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(E_surfxml_random): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 473: @@ -9539,7 +9539,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); case YY_STATE_EOF(E_surfxml_route): case YY_STATE_EOF(S_surfxml_route): case YY_STATE_EOF(S_surfxml_route_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 490: @@ -9632,7 +9632,7 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(E_surfxml_router): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 503: @@ -9755,7 +9755,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); case YY_STATE_EOF(E_surfxml_storage): case YY_STATE_EOF(S_surfxml_storage): case YY_STATE_EOF(S_surfxml_storage_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 520: @@ -9876,7 +9876,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0] case YY_STATE_EOF(E_surfxml_storage___type): case YY_STATE_EOF(S_surfxml_storage___type): case YY_STATE_EOF(S_surfxml_storage___type_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 537: @@ -9985,7 +9985,7 @@ YY_RULE_SETUP FAIL("Unexpected end-tag `%s': `' expected.",surf_parse_text); YY_BREAK case YY_STATE_EOF(IN_trace): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 551: @@ -10121,7 +10121,7 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(E_surfxml_trace___connect): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 574: @@ -10286,7 +10286,7 @@ case YY_STATE_EOF(S_surfxml_zone_3): case YY_STATE_EOF(S_surfxml_zone_4): case YY_STATE_EOF(S_surfxml_zone_6): case YY_STATE_EOF(S_surfxml_zone_8): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK case 605: @@ -10385,10 +10385,10 @@ YY_RULE_SETUP if (!AX_surfxml_zoneRoute_src) FAIL("Required attribute `src' not set for `zoneRoute' element."); LEAVE; STag_surfxml_zoneRoute(); surfxml_pcdata_ix = 0; ETag_surfxml_zoneRoute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; - case S_surfxml_zone_1: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break; - case S_surfxml_zone: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break; + case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; + case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; + case S_surfxml_zone: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break; + case S_surfxml_zone_1: case S_surfxml_zone_4: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break; } } YY_BREAK @@ -10412,10 +10412,10 @@ YY_RULE_SETUP ETag_surfxml_zoneRoute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; - case S_surfxml_zone_1: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break; - case S_surfxml_zone: case S_surfxml_zone_3: case S_surfxml_zone_4: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break; + case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; + case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; + case S_surfxml_zone: case S_surfxml_zone_3: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break; + case S_surfxml_zone_1: case S_surfxml_zone_4: case S_surfxml_zone_7: case S_surfxml_zone_8: SET(S_surfxml_zone_8); break; } } YY_BREAK @@ -10431,7 +10431,7 @@ FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); case YY_STATE_EOF(E_surfxml_zoneRoute): case YY_STATE_EOF(S_surfxml_zoneRoute): case YY_STATE_EOF(S_surfxml_zoneRoute_2): -if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); +FAIL("Premature EOF: `' expected."); YY_BREAK /* EPILOG: after the root element. */ diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index 13de767561..6730a350ff 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -23,22 +23,9 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf, "Logging specific to the SURF extern "C" { -int ETag_surfxml_include_state(); - #include "simgrid_dtd.c" -/* - * Stuff relative to the tag - */ -static std::vector surf_input_buffer_stack; -static std::vector surf_file_to_parse_stack; -static std::vector surf_parsed_filename_stack; - -static inline const char* surf_parsed_filename() // to locate parse error messages -{ - return surf_parsed_filename_stack.empty() ? nullptr : surf_parsed_filename_stack.back().c_str(); -} - +static const char* surf_parsed_filename; // Currently parsed file (for the error messages) std::vector parsed_link_list; /* temporary store of current list link of a route */ /* @@ -49,7 +36,7 @@ void surf_parse_assert(bool cond, std::string msg) if (not cond) { int lineno = surf_parse_lineno; cleanup(); - XBT_ERROR("Parse error at %s:%d: %s", surf_parsed_filename(), lineno, msg.c_str()); + XBT_ERROR("Parse error at %s:%d: %s", surf_parsed_filename, lineno, msg.c_str()); surf_exit(); xbt_die("Exiting now"); } @@ -59,7 +46,7 @@ void surf_parse_error(std::string msg) { int lineno = surf_parse_lineno; cleanup(); - XBT_ERROR("Parse error at %s:%d: %s", surf_parsed_filename(), lineno, msg.c_str()); + XBT_ERROR("Parse error at %s:%d: %s", surf_parsed_filename, lineno, msg.c_str()); surf_exit(); xbt_die("Exiting now"); } @@ -96,7 +83,7 @@ void surf_parse_assert_netpoint(std::string hostname, std::string pre, std::stri void surf_parse_warn(std::string msg) { - XBT_WARN("%s:%d: %s", surf_parsed_filename(), surf_parse_lineno, msg.c_str()); + XBT_WARN("%s:%d: %s", surf_parsed_filename, surf_parse_lineno, msg.c_str()); } double surf_parse_get_double(std::string s) @@ -290,7 +277,6 @@ std::map* current_property_set = nullptr; std::map* current_model_property_set = nullptr; int ZONE_TAG = 0; // Whether we just opened a zone tag (to see what to do with the properties) -YY_BUFFER_STATE surf_input_buffer; FILE *surf_file_to_parse = nullptr; /* Stuff relative to storage */ @@ -356,61 +342,15 @@ void ETag_surfxml_mount() void STag_surfxml_include() { - XBT_ERROR(" tag is deprecated, and will be removed in SimGrid v3.18. Please stop using it now (or tell us why you need it)."); - parse_after_config(); - XBT_DEBUG("STag_surfxml_include '%s'",A_surfxml_include_file); - surf_parsed_filename_stack.emplace_back(A_surfxml_include_file); // save file name - - surf_file_to_parse_stack.push_back(surf_file_to_parse); // save old file descriptor - - surf_file_to_parse = surf_fopen(A_surfxml_include_file, "r"); // read new file descriptor - xbt_assert((surf_file_to_parse), "Unable to open \"%s\"\n", A_surfxml_include_file); - - surf_input_buffer_stack.push_back(surf_input_buffer); - surf_input_buffer = surf_parse__create_buffer(surf_file_to_parse, YY_BUF_SIZE); - surf_parse_push_buffer_state(surf_input_buffer); - - fflush(nullptr); -} - -void ETag_surfxml_include() { -/* Nothing to do when done with reading the include tag. - * Instead, the handling should be deferred until the EOF of current buffer -- see below */ + xbt_die(" tag was removed in SimGrid v3.18. Please stop using it now."); } -/** @brief When reaching EOF, check whether we are in an include tag, and behave accordingly if yes - * - * This function is called automatically by sedding the parser in tools/cmake/MaintainerMode.cmake - * Every FAIL on "Premature EOF" is preceded by a call to this function, which role is to restore the - * previous buffer if we reached the EOF /of an include file/. Its return code is used to avoid the - * error message in that case. - * - * Yeah, that's terribly hackish, but it works. A better solution should be dealed with in flexml - * directly: a command line flag could instruct it to do the correct thing when the include directive is encountered - * on a line. One day maybe, if the maya allow it. - */ -int ETag_surfxml_include_state() +void ETag_surfxml_include() { - fflush(nullptr); - XBT_DEBUG("ETag_surfxml_include_state '%s'",A_surfxml_include_file); - - if (surf_input_buffer_stack.empty()) // nope, that's a true premature EOF. Let the parser die verbosely. - return 0; - - // Yeah, we were in an Restore state and proceed. - fclose(surf_file_to_parse); - surf_file_to_parse_stack.pop_back(); - surf_parse_pop_buffer_state(); - surf_input_buffer_stack.pop_back(); - - // Restore the filename for error messages - surf_parsed_filename_stack.pop_back(); - - return 1; + /* Won't happen since is now removed since v3.18. */ } /* Stag and Etag parse functions */ - void STag_surfxml_platform() { XBT_ATTRIB_UNUSED double version = surf_parse_get_double(A_surfxml_platform_version); @@ -444,19 +384,19 @@ void STag_surfxml_platform() { "Use simgrid_update_xml to update your file automatically. " "This program is installed automatically with SimGrid, or " "available in the tools/ directory of the source archive.", - surf_parsed_filename(), version); + surf_parsed_filename, version); if (version < 4.1) { XBT_INFO("You're using a v%.1f XML file (%s) while the current standard is v4.1 " "That's fine, the new version is backward compatible. \n\n" "Use simgrid_update_xml to update your file automatically. " "This program is installed automatically with SimGrid, or " "available in the tools/ directory of the source archive.", - version, surf_parsed_filename()); + version, surf_parsed_filename); } xbt_assert(version <= 4.1, "******* FILE %s COMES FROM THE FUTURE (v:%.1f) *********\n " "The most recent formalism that this version of SimGrid understands is v4.1.\n" "Please update your code, or use another, more adapted, file.", - surf_parsed_filename(), version); + surf_parsed_filename, version); sg_platf_begin(); } @@ -1051,11 +991,13 @@ void ETag_surfxml_argument(){/* Nothing to do */} void ETag_surfxml_model___prop(){/* Nothing to do */} /* Open and Close parse file */ +YY_BUFFER_STATE surf_input_buffer; + void surf_parse_open(const char *file) { xbt_assert(file, "Cannot parse the nullptr file. Bypassing the parser is strongly deprecated nowadays."); - surf_parsed_filename_stack.emplace_back(file); + surf_parsed_filename = file; std::string dir = simgrid::xbt::Path(file).getDirname(); surf_path.push_back(dir); @@ -1069,11 +1011,7 @@ void surf_parse_open(const char *file) void surf_parse_close() { - if (surf_parsed_filename()) { - surf_path.pop_back(); - } - - surf_parsed_filename_stack.pop_back(); + surf_path.pop_back(); // remove the dirname of the opened file, that was added in surf_parse_open() if (surf_file_to_parse) { surf_parse__delete_buffer(surf_input_buffer); diff --git a/tools/cmake/MaintainerMode.cmake b/tools/cmake/MaintainerMode.cmake index 78f17b67c7..14a4c81248 100644 --- a/tools/cmake/MaintainerMode.cmake +++ b/tools/cmake/MaintainerMode.cmake @@ -162,7 +162,6 @@ if(enable_maintainer_mode AND NOT WIN32) set(string5 "'s/SET(DOCTYPE)/SET(ROOT_dax__adag)/'") set(string9 "'s/#include /#if defined(_WIN32)\\n# ifndef __STRICT_ANSI__\\n# include \\n# include \\n# endif\\n#else\\n# include \\n#endif/g'") set(string14 "'\\!^ \\* Generated [0-9/]\\{10\\} [0-9:]\\{8\\}\\.$$!d'") - set(string15 "'s/FAIL(\"Premature EOF/if(!ETag_surfxml_include_state()) FAIL(\"Premature EOF/'") ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.h @@ -206,7 +205,6 @@ if(enable_maintainer_mode AND NOT WIN32) COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.c COMMAND ${FLEX_EXE} -o src/surf/xml/simgrid_dtd.c -Psurf_parse_ --noline src/surf/xml/simgrid_dtd.l COMMAND ${SED_EXE} -i ${string9} src/surf/xml/simgrid_dtd.c - COMMAND ${SED_EXE} -i ${string15} src/surf/xml/simgrid_dtd.c COMMAND ${SED_EXE} -i 's/int yyl\;/unsigned int yyl\;/' src/surf/xml/simgrid_dtd.c COMMAND ${SED_EXE} -i 's/int surf_parse_leng\;/unsigned int surf_parse_leng\;/' src/surf/xml/simgrid_dtd.c COMMAND ${SED_EXE} -i 's/n = 0\; n < max_size/n = 0\; n < (size_t) max_size/' src/surf/xml/simgrid_dtd.c