From: mquinson Date: Wed, 6 Apr 2005 10:49:07 +0000 (+0000) Subject: Regenerating with flexml 1.3 X-Git-Tag: v3.3~4145 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/611e12c3d9c307481fecbac2d8759484de621209 Regenerating with flexml 1.3 git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1209 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/surf/surfxml.l b/src/surf/surfxml.l index 4e1d0b1179..69ff5a29e7 100644 --- a/src/surf/surfxml.l +++ b/src/surf/surfxml.l @@ -1,12 +1,21 @@ /* Validating XML processor for surfxml.dtd. - * Generated 2005/02/13 20:04:21. + * Generated 2005/04/06 12:46:16. * - * This program was generated with the FleXML XML processor generator, - * (Id: flexml.pl,v 1.39 2005/02/13 18:12:19 legranda 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.24 2005/02/10 11:42:39 mquinson Exp $"; + "$" "Id: skel,v 1.26 2005/02/23 22:22:20 wdowling Exp $"; const char rcs_flexml[] = - "$" "Id: flexml.pl,v 1.39 2005/02/13 18:12:19 legranda Exp $"; + "$" "Id: flexml.pl,v 1.44 2005/02/23 23:08:16 mquinson Exp $"; /* ANSI headers. */ #include @@ -42,8 +65,6 @@ const char rcs_flexml[] = #define FLEXML_BUFFERSTACKSIZE 1000000 /* XML processor api. */ -#include "surf/surfxml.h" - /* FleXML-provided data. */ const char* pcdata; AT_network_link_bandwidth A_network_link_bandwidth; @@ -91,12 +112,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; @@ -262,6 +287,7 @@ const char* *statenames=NULL; statenames[AL_argument] = NULL; statenames[E_argument] = "argument"; } + /* COMMENTS and PIs: handled uniformly for efficiency. */ { @@ -732,7 +758,7 @@ const char* *statenames=NULL; /* EPILOG: after the root element. */ { - . {SET(PROLOG); yyless(0); return -1;} + . {SET(PROLOG); yyless(0); CLEANUP; return -1;} <> SUCCEED; } @@ -843,6 +869,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; @@ -865,6 +900,8 @@ static int fail(const char* fmt, ...) fprintf(stderr, "%s\n", flexml_err_msg); flexml_err_msg[0] = '\0'; #endif - + + cleanup(); + return 1; }