/* Validating XML processor for surfxml.dtd.
- * Generated 2005/02/13 20:04:21.
+ * Generated 2005/06/09 14:30:33.
*
- * 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
* 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 <unistd.h>
#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;
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;
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_route_dst A_route_dst;
/* 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;
statenames[AL_argument] = NULL;
statenames[E_argument] = "argument";
}
+
/* COMMENTS and PIs: handled uniformly for efficiency. */
<ROOT_platform_description,AL_platform_description,S_platform_description,S_platform_description_1,S_platform_description_2,E_platform_description,ROOT_include,AL_include,S_include,S_include_1,S_include_2,E_include,ROOT_cpu,AL_cpu,E_cpu,ROOT_network_link,AL_network_link,E_network_link,ROOT_route,AL_route,S_route,S_route_1,S_route_2,E_route,ROOT_route_element,AL_route_element,E_route_element,ROOT_process,AL_process,S_process,S_process_1,S_process_2,E_process,ROOT_argument,AL_argument,E_argument,PROLOG,DOCTYPE,EPILOG>{
<ROOT_process,S_platform_description_2,S_include,S_include_2,S_platform_description_1,S_include_1,S_platform_description>"<process"{s} {
A_process_host = NULL;
A_process_function = NULL;
+ A_process_start_time = "-1.0";
+ A_process_kill_time = "-1.0";
ENTER(AL_process);
}
"function"{Eq}\' ENTER(VALUE1); BUFFERSET(A_process_function);
"function"{Eq}\" ENTER(VALUE2); BUFFERSET(A_process_function);
+ "start_time"{Eq}\' ENTER(VALUE1); BUFFERSET(A_process_start_time);
+ "start_time"{Eq}\" ENTER(VALUE2); BUFFERSET(A_process_start_time);
+
+ "kill_time"{Eq}\' ENTER(VALUE1); BUFFERSET(A_process_kill_time);
+ "kill_time"{Eq}\" ENTER(VALUE2); BUFFERSET(A_process_kill_time);
+
">" {
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.");
/* EPILOG: after the root element. */
<EPILOG>{
- . {SET(PROLOG); yyless(0); return -1;}
+ . {SET(PROLOG); yyless(0); CLEANUP; return -1;}
<<EOF>> SUCCEED;
}
}
+static void cleanup(void)
+{
+ if (statenames) {
+ free(statenames);
+ statenames = NULL;
+ }
+}
+
+
static int fail(const char* fmt, ...)
{
int chars_left, used;
fprintf(stderr, "%s\n", flexml_err_msg);
flexml_err_msg[0] = '\0';
#endif
-
+
+ cleanup();
+
return 1;
}