X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2e7943186f8c5e75f1fc623d0f52ead2ae68f0fd..1d6f35064b982906e6931d6e2cfbf22ab51a10b3:/src/surf/surfxml.l diff --git a/src/surf/surfxml.l b/src/surf/surfxml.l index 1626cb523a..b4cb523e4c 100644 --- a/src/surf/surfxml.l +++ b/src/surf/surfxml.l @@ -1,12 +1,21 @@ /* Validating XML processor for surfxml.dtd. - * Generated 2005/02/10 12:28:10. + * Generated 2005/08/16 14:42:02. * - * This program was generated with the FleXML XML processor generator, - * (Id: flexml.pl,v 1.38 2005/02/10 11:13:51 mquinson Exp). - * Copyright © 1999 Kristoffer Rose. All rights reserved. + * This program was generated with the FleXML XML processor generator. + * FleXML is Copyright © 1999-2005 Kristoffer Rose. All rights reserved. + * (Id: flexml.pl,v 1.44 2005/02/23 23:08:16 mquinson Exp). + * + * There are two, intertwined parts to this program, part A and part B. * - * You can redistribute and/or modify this program provided the following - * two conditions hold: + * Part A + * ------ + * + * Some parts, here collectively called "Part A", are found in the + * FleXML package. They are Copyright © 1999-2005 Kristoffer Rose. + * All rights reserved. + * + * You can redistribute, use, perform, display and/or modify "Part A" + * provided the following two conditions hold: * * 1. The program is distributed WITHOUT ANY WARRANTY from the author of * FleXML; without even the implied warranty of MERCHANTABILITY or @@ -19,15 +28,29 @@ * Notice that these are explicit rights granted to you for files * generated by the FleXML system. For your rights in connection with * the FleXML system itself please consult the GNU General Public License. + * + * Part B + * ------ + * + * The other parts, here collectively called "Part B", and which came + * from the DTD used by FleXML to generate this program, can be + * distributed (or not, as the case may be) under the terms of whoever + * wrote them, provided these terms respect and obey the two conditions + * above under the heading "Part A". + * + * The author of and contributors to FleXML specifically disclaim + * any copyright interest in "Part B", unless "Part B" was written + * by the author of or contributors to FleXML. + * */ %{ /* Version strings. */ const char rcs_flexml_skeleton[] = - "$" "Id: skel,v 1.22 2005/02/10 11:18:26 mquinson Exp $"; + "$" "Id: skel,v 1.26 2005/02/23 22:22:20 wdowling Exp $"; const char rcs_flexml[] = - "$" "Id: flexml.pl,v 1.38 2005/02/10 11:13:51 mquinson Exp $"; + "$" "Id: flexml.pl,v 1.44 2005/02/23 23:08:16 mquinson Exp $"; /* ANSI headers. */ #include @@ -39,13 +62,14 @@ const char rcs_flexml[] = /* Generated definitions. */ #define FLEXML_yylineno -#define FLEXML_BUFFERSTACKSIZE 100000 +#define FLEXML_BUFFERSTACKSIZE 1000000 /* XML processor api. */ /* FleXML-provided data. */ const char* pcdata; AT_network_link_bandwidth A_network_link_bandwidth; AT_cpu_name A_cpu_name; +AT_process_kill_time A_process_kill_time; AT_network_link_state A_network_link_state; AT_argument_value A_argument_value; AT_cpu_availability_file A_cpu_availability_file; @@ -63,8 +87,10 @@ AT_route_impact_on_src_with_other_recv A_route_impact_on_src_with_other_recv; AT_network_link_name A_network_link_name; AT_route_element_name A_route_element_name; AT_cpu_power A_cpu_power; +AT_process_start_time A_process_start_time; AT_include_file A_include_file; AT_process_function A_process_function; +AT_network_link_sharing_policy A_network_link_sharing_policy; AT_route_dst A_route_dst; AT_cpu_state A_cpu_state; AT_network_link_latency A_network_link_latency; @@ -89,12 +115,16 @@ AT_network_link_bandwidth_file A_network_link_bandwidth_file; /* Generic actions. */ #define SKIP /*skip*/ -#define SUCCEED return 0 +#define SUCCEED CLEANUP; return 0 #define FAIL return fail static int fail(const char*, ...); const char * parse_err_msg(void); +/* Cleanup */ +static void cleanup(void); +#define CLEANUP cleanup() + /* Text buffer stack handling. */ char bufferstack[FLEXML_BUFFERSTACKSIZE]; char* limit = bufferstack + FLEXML_BUFFERSTACKSIZE; @@ -213,7 +243,8 @@ const char* *statenames=NULL; /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ SET(PROLOG); /* FleXML_init */ - if(!statenames) statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*)); + next = bufferstack; + if(!statenames) {statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*)); statenames[PROLOG] = NULL; statenames[DOCTYPE] = NULL; statenames[EPILOG] = NULL; @@ -258,6 +289,7 @@ const char* *statenames=NULL; statenames[ROOT_argument] = NULL; statenames[AL_argument] = NULL; statenames[E_argument] = "argument"; + } /* COMMENTS and PIs: handled uniformly for efficiency. */ @@ -472,6 +504,7 @@ const char* *statenames=NULL; A_network_link_latency_file = NULL; A_network_link_state = A_network_link_state_ON; A_network_link_state_file = NULL; + A_network_link_sharing_policy = A_network_link_sharing_policy_SHARED; ENTER(AL_network_link); } @@ -499,6 +532,11 @@ const char* *statenames=NULL; "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_network_link_state_file); "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_network_link_state_file); + "sharing_policy"{Eq}"'SHARED'" | + "sharing_policy"{Eq}"\"SHARED\"" A_network_link_sharing_policy = A_network_link_sharing_policy_SHARED; + "sharing_policy"{Eq}"'FATPIPE'" | + "sharing_policy"{Eq}"\"FATPIPE\"" A_network_link_sharing_policy = A_network_link_sharing_policy_FATPIPE; + ">" { if (!A_network_link_name) FAIL("Required attribute `name' not set for `network_link' element."); if (!A_network_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `network_link' element."); @@ -641,6 +679,8 @@ const char* *statenames=NULL; "" { if (!A_process_host) FAIL("Required attribute `host' not set for `process' element."); if (!A_process_function) FAIL("Required attribute `function' not set for `process' element."); @@ -729,7 +775,7 @@ const char* *statenames=NULL; /* EPILOG: after the root element. */ { - . {SET(PROLOG); yyless(0); return -1;} + . {SET(PROLOG); yyless(0); CLEANUP; return -1;} <> SUCCEED; } @@ -840,6 +886,15 @@ static void reset_parse_err_msg() } +static void cleanup(void) +{ + if (statenames) { + free(statenames); + statenames = NULL; + } +} + + static int fail(const char* fmt, ...) { int chars_left, used; @@ -859,9 +914,11 @@ static int fail(const char* fmt, ...) #ifndef FLEXML_quiet_parser /* print directly to sdterr */ - fprintf(stderr, "%s", flexml_err_msg); + fprintf(stderr, "%s\n", flexml_err_msg); flexml_err_msg[0] = '\0'; #endif - + + cleanup(); + return 1; }