1 /* Validating XML processor for surf/surfxml.dtd.
2 * Generated 2007/11/29 14:32:38.
4 * This program was generated with the FleXML XML processor generator.
5 * FleXML is Copyright (C) 1999-2005 Kristoffer Rose. All rights reserved.
6 * FleXML is Copyright (C) 2003-2006 Martin Quinson. All rights reserved.
7 * (Id: flexml.pl,v 1.61 2006/09/13 16:34:33 wdowling Exp).
9 * There are two, intertwined parts to this program, part A and part B.
14 * Some parts, here collectively called "Part A", are found in the
15 * FleXML package. They are Copyright (C) 1999-2005 Kristoffer Rose
16 * and Copyright (C) 2003-2006 Martin Quinson. All rights reserved.
18 * You can redistribute, use, perform, display and/or modify "Part A"
19 * provided the following two conditions hold:
21 * 1. The program is distributed WITHOUT ANY WARRANTY from the author of
22 * FleXML; without even the implied warranty of MERCHANTABILITY or
23 * FITNESS FOR A PARTICULAR PURPOSE.
25 * 2. The program distribution conditions do not in any way affect the
26 * distribution conditions of the FleXML system used to generate this
27 * file or any version of FleXML derived from that system.
29 * Notice that these are explicit rights granted to you for files
30 * generated by the FleXML system. For your rights in connection with
31 * the FleXML system itself please consult the GNU General Public License.
36 * The other parts, here collectively called "Part B", and which came
37 * from the DTD used by FleXML to generate this program, can be
38 * distributed (or not, as the case may be) under the terms of whoever
39 * wrote them, provided these terms respect and obey the two conditions
40 * above under the heading "Part A".
42 * The author of and contributors to FleXML specifically disclaim
43 * any copyright interest in "Part B", unless "Part B" was written
44 * by the author of or contributors to FleXML.
50 /* Version strings. */
51 const char rcs_surfxml_flexml_skeleton[] =
52 "$" "Id: skel,v 1.38 2006/09/12 18:05:45 wdowling Exp $";
53 const char rcs_surfxml_flexml[] =
54 "$" "Id: flexml.pl,v 1.61 2006/09/13 16:34:33 wdowling Exp $";
64 #ifndef FLEXML_INDEXSTACKSIZE
65 #define FLEXML_INDEXSTACKSIZE 1000
68 /* Generated definitions. */
69 #define FLEXML_yylineno
70 #ifndef FLEXML_BUFFERSTACKSIZE
71 #define FLEXML_BUFFERSTACKSIZE 1000000
73 #define FLEXML_NEED_BUFFERLIT
75 /* XML processor api. */
76 /* FleXML-provided data. */
77 int surfxml_pcdata_ix;
78 extern char *surfxml_bufferstack;
79 #define surfxml_pcdata (surfxml_bufferstack + surfxml_pcdata_ix)
80 AT_surfxml_random_generator AX_surfxml_random_generator;
81 #define A_surfxml_random_generator AX_surfxml_random_generator
82 AT_surfxml_prop_id AX_surfxml_prop_id;
83 #define A_surfxml_prop_id (surfxml_bufferstack + AX_surfxml_prop_id)
84 AT_surfxml_host_interference_recv AX_surfxml_host_interference_recv;
85 #define A_surfxml_host_interference_recv (surfxml_bufferstack + AX_surfxml_host_interference_recv)
86 AT_surfxml_host_id AX_surfxml_host_id;
87 #define A_surfxml_host_id (surfxml_bufferstack + AX_surfxml_host_id)
88 AT_surfxml_set_id AX_surfxml_set_id;
89 #define A_surfxml_set_id (surfxml_bufferstack + AX_surfxml_set_id)
90 AT_surfxml_link_latency_file AX_surfxml_link_latency_file;
91 #define A_surfxml_link_latency_file (surfxml_bufferstack + AX_surfxml_link_latency_file)
92 AT_surfxml_host_state AX_surfxml_host_state;
93 #define A_surfxml_host_state AX_surfxml_host_state
94 AT_surfxml_host_interference_send_recv AX_surfxml_host_interference_send_recv;
95 #define A_surfxml_host_interference_send_recv (surfxml_bufferstack + AX_surfxml_host_interference_send_recv)
96 AT_surfxml_host_interference_send AX_surfxml_host_interference_send;
97 #define A_surfxml_host_interference_send (surfxml_bufferstack + AX_surfxml_host_interference_send)
98 AT_surfxml_set_suffix AX_surfxml_set_suffix;
99 #define A_surfxml_set_suffix (surfxml_bufferstack + AX_surfxml_set_suffix)
100 AT_surfxml_route_impact_on_dst AX_surfxml_route_impact_on_dst;
101 #define A_surfxml_route_impact_on_dst (surfxml_bufferstack + AX_surfxml_route_impact_on_dst)
102 AT_surfxml_host_power AX_surfxml_host_power;
103 #define A_surfxml_host_power (surfxml_bufferstack + AX_surfxml_host_power)
104 AT_surfxml_router_id AX_surfxml_router_id;
105 #define A_surfxml_router_id (surfxml_bufferstack + AX_surfxml_router_id)
106 AT_surfxml_process_start_time AX_surfxml_process_start_time;
107 #define A_surfxml_process_start_time (surfxml_bufferstack + AX_surfxml_process_start_time)
108 AT_surfxml_cluster_suffix AX_surfxml_cluster_suffix;
109 #define A_surfxml_cluster_suffix (surfxml_bufferstack + AX_surfxml_cluster_suffix)
110 AT_surfxml_platform_xmlns_c_route AX_surfxml_platform_xmlns_c_route;
111 #define A_surfxml_platform_xmlns_c_route (surfxml_bufferstack + AX_surfxml_platform_xmlns_c_route)
112 AT_surfxml_cluster_prefix AX_surfxml_cluster_prefix;
113 #define A_surfxml_cluster_prefix (surfxml_bufferstack + AX_surfxml_cluster_prefix)
114 AT_surfxml_trace_file AX_surfxml_trace_file;
115 #define A_surfxml_trace_file (surfxml_bufferstack + AX_surfxml_trace_file)
116 AT_surfxml_route_action AX_surfxml_route_action;
117 #define A_surfxml_route_action AX_surfxml_route_action
118 AT_surfxml_link_sharing_policy AX_surfxml_link_sharing_policy;
119 #define A_surfxml_link_sharing_policy AX_surfxml_link_sharing_policy
120 AT_surfxml_random_min AX_surfxml_random_min;
121 #define A_surfxml_random_min (surfxml_bufferstack + AX_surfxml_random_min)
122 AT_surfxml_process_kill_time AX_surfxml_process_kill_time;
123 #define A_surfxml_process_kill_time (surfxml_bufferstack + AX_surfxml_process_kill_time)
124 AT_surfxml_cluster_bb_bw AX_surfxml_cluster_bb_bw;
125 #define A_surfxml_cluster_bb_bw (surfxml_bufferstack + AX_surfxml_cluster_bb_bw)
126 AT_surfxml_trace_c_connect_element AX_surfxml_trace_c_connect_element;
127 #define A_surfxml_trace_c_connect_element AX_surfxml_trace_c_connect_element
128 AT_surfxml_argument_value AX_surfxml_argument_value;
129 #define A_surfxml_argument_value (surfxml_bufferstack + AX_surfxml_argument_value)
130 AT_surfxml_link_state AX_surfxml_link_state;
131 #define A_surfxml_link_state AX_surfxml_link_state
132 AT_surfxml_route_impact_on_src AX_surfxml_route_impact_on_src;
133 #define A_surfxml_route_impact_on_src (surfxml_bufferstack + AX_surfxml_route_impact_on_src)
134 AT_surfxml_link_bandwidth AX_surfxml_link_bandwidth;
135 #define A_surfxml_link_bandwidth (surfxml_bufferstack + AX_surfxml_link_bandwidth)
136 AT_surfxml_cluster_id AX_surfxml_cluster_id;
137 #define A_surfxml_cluster_id (surfxml_bufferstack + AX_surfxml_cluster_id)
138 AT_surfxml_random_mean AX_surfxml_random_mean;
139 #define A_surfxml_random_mean (surfxml_bufferstack + AX_surfxml_random_mean)
140 AT_surfxml_cluster_bb_lat AX_surfxml_cluster_bb_lat;
141 #define A_surfxml_cluster_bb_lat (surfxml_bufferstack + AX_surfxml_cluster_bb_lat)
142 AT_surfxml_link_latency AX_surfxml_link_latency;
143 #define A_surfxml_link_latency (surfxml_bufferstack + AX_surfxml_link_latency)
144 AT_surfxml_trace_c_connect_trace_id AX_surfxml_trace_c_connect_trace_id;
145 #define A_surfxml_trace_c_connect_trace_id (surfxml_bufferstack + AX_surfxml_trace_c_connect_trace_id)
146 AT_surfxml_platform_xmlns_c_link AX_surfxml_platform_xmlns_c_link;
147 #define A_surfxml_platform_xmlns_c_link (surfxml_bufferstack + AX_surfxml_platform_xmlns_c_link)
148 AT_surfxml_link_bandwidth_file AX_surfxml_link_bandwidth_file;
149 #define A_surfxml_link_bandwidth_file (surfxml_bufferstack + AX_surfxml_link_bandwidth_file)
150 AT_surfxml_random_id AX_surfxml_random_id;
151 #define A_surfxml_random_id (surfxml_bufferstack + AX_surfxml_random_id)
152 AT_surfxml_set_radical AX_surfxml_set_radical;
153 #define A_surfxml_set_radical (surfxml_bufferstack + AX_surfxml_set_radical)
154 AT_surfxml_random_max AX_surfxml_random_max;
155 #define A_surfxml_random_max (surfxml_bufferstack + AX_surfxml_random_max)
156 AT_surfxml_link_id AX_surfxml_link_id;
157 #define A_surfxml_link_id (surfxml_bufferstack + AX_surfxml_link_id)
158 AT_surfxml_process_host AX_surfxml_process_host;
159 #define A_surfxml_process_host (surfxml_bufferstack + AX_surfxml_process_host)
160 AT_surfxml_host_availability_file AX_surfxml_host_availability_file;
161 #define A_surfxml_host_availability_file (surfxml_bufferstack + AX_surfxml_host_availability_file)
162 AT_surfxml_cluster_lat AX_surfxml_cluster_lat;
163 #define A_surfxml_cluster_lat (surfxml_bufferstack + AX_surfxml_cluster_lat)
164 AT_surfxml_trace_periodicity AX_surfxml_trace_periodicity;
165 #define A_surfxml_trace_periodicity (surfxml_bufferstack + AX_surfxml_trace_periodicity)
166 AT_surfxml_foreach_set_id AX_surfxml_foreach_set_id;
167 #define A_surfxml_foreach_set_id (surfxml_bufferstack + AX_surfxml_foreach_set_id)
168 AT_surfxml_route_impact_on_dst_with_other_send AX_surfxml_route_impact_on_dst_with_other_send;
169 #define A_surfxml_route_impact_on_dst_with_other_send (surfxml_bufferstack + AX_surfxml_route_impact_on_dst_with_other_send)
170 AT_surfxml_prop_value AX_surfxml_prop_value;
171 #define A_surfxml_prop_value (surfxml_bufferstack + AX_surfxml_prop_value)
172 AT_surfxml_route_impact_on_src_with_other_recv AX_surfxml_route_impact_on_src_with_other_recv;
173 #define A_surfxml_route_impact_on_src_with_other_recv (surfxml_bufferstack + AX_surfxml_route_impact_on_src_with_other_recv)
174 AT_surfxml_link_state_file AX_surfxml_link_state_file;
175 #define A_surfxml_link_state_file (surfxml_bufferstack + AX_surfxml_link_state_file)
176 AT_surfxml_set_prefix AX_surfxml_set_prefix;
177 #define A_surfxml_set_prefix (surfxml_bufferstack + AX_surfxml_set_prefix)
178 AT_surfxml_cluster_power AX_surfxml_cluster_power;
179 #define A_surfxml_cluster_power (surfxml_bufferstack + AX_surfxml_cluster_power)
180 AT_surfxml_process_function AX_surfxml_process_function;
181 #define A_surfxml_process_function (surfxml_bufferstack + AX_surfxml_process_function)
182 AT_surfxml_host_max_outgoing_rate AX_surfxml_host_max_outgoing_rate;
183 #define A_surfxml_host_max_outgoing_rate (surfxml_bufferstack + AX_surfxml_host_max_outgoing_rate)
184 AT_surfxml_link_c_ctn_id AX_surfxml_link_c_ctn_id;
185 #define A_surfxml_link_c_ctn_id (surfxml_bufferstack + AX_surfxml_link_c_ctn_id)
186 AT_surfxml_host_availability AX_surfxml_host_availability;
187 #define A_surfxml_host_availability (surfxml_bufferstack + AX_surfxml_host_availability)
188 AT_surfxml_route_src AX_surfxml_route_src;
189 #define A_surfxml_route_src (surfxml_bufferstack + AX_surfxml_route_src)
190 AT_surfxml_route_c_multi_src AX_surfxml_route_c_multi_src;
191 #define A_surfxml_route_c_multi_src (surfxml_bufferstack + AX_surfxml_route_c_multi_src)
192 AT_surfxml_route_c_multi_action AX_surfxml_route_c_multi_action;
193 #define A_surfxml_route_c_multi_action AX_surfxml_route_c_multi_action
194 AT_surfxml_trace_id AX_surfxml_trace_id;
195 #define A_surfxml_trace_id (surfxml_bufferstack + AX_surfxml_trace_id)
196 AT_surfxml_cluster_radical AX_surfxml_cluster_radical;
197 #define A_surfxml_cluster_radical (surfxml_bufferstack + AX_surfxml_cluster_radical)
198 AT_surfxml_include_file AX_surfxml_include_file;
199 #define A_surfxml_include_file (surfxml_bufferstack + AX_surfxml_include_file)
200 AT_surfxml_random_std_deviation AX_surfxml_random_std_deviation;
201 #define A_surfxml_random_std_deviation (surfxml_bufferstack + AX_surfxml_random_std_deviation)
202 AT_surfxml_trace_c_connect_kind AX_surfxml_trace_c_connect_kind;
203 #define A_surfxml_trace_c_connect_kind AX_surfxml_trace_c_connect_kind
204 AT_surfxml_trace_c_connect_connector_id AX_surfxml_trace_c_connect_connector_id;
205 #define A_surfxml_trace_c_connect_connector_id (surfxml_bufferstack + AX_surfxml_trace_c_connect_connector_id)
206 AT_surfxml_route_c_multi_dst AX_surfxml_route_c_multi_dst;
207 #define A_surfxml_route_c_multi_dst (surfxml_bufferstack + AX_surfxml_route_c_multi_dst)
208 AT_surfxml_host_state_file AX_surfxml_host_state_file;
209 #define A_surfxml_host_state_file (surfxml_bufferstack + AX_surfxml_host_state_file)
210 AT_surfxml_route_c_multi_symmetric AX_surfxml_route_c_multi_symmetric;
211 #define A_surfxml_route_c_multi_symmetric AX_surfxml_route_c_multi_symmetric
212 AT_surfxml_route_dst AX_surfxml_route_dst;
213 #define A_surfxml_route_dst (surfxml_bufferstack + AX_surfxml_route_dst)
214 AT_surfxml_cluster_bw AX_surfxml_cluster_bw;
215 #define A_surfxml_cluster_bw (surfxml_bufferstack + AX_surfxml_cluster_bw)
216 AT_surfxml_platform_version AX_surfxml_platform_version;
217 #define A_surfxml_platform_version (surfxml_bufferstack + AX_surfxml_platform_version)
221 # define ENTER(state) debug_enter(state,#state)
222 # define LEAVE debug_leave()
223 # define SET(state) debug_set(state,#state)
224 static void debug_enter(int, const char*);
225 static void debug_leave(void);
226 static void debug_set(int, const char*);
228 # define ENTER(state) (yy_push_state(state))
229 # define LEAVE (yy_pop_state())
230 # define SET(state) BEGIN(state)
233 /* Generic actions. */
234 #define SKIP /*skip*/
235 #define SUCCEED CLEANUP; return 0
237 #define FAIL return fail
238 static int fail(const char*, ...);
240 enum {flexml_max_err_msg_size = 512};
241 static char flexml_err_msg[flexml_max_err_msg_size];
242 const char * surfxml_parse_err_msg()
244 return flexml_err_msg;
246 static void reset_surfxml_parse_err_msg()
248 flexml_err_msg[0] = '\0';
252 static void cleanup(void);
253 #define CLEANUP cleanup()
255 /* Text buffer stack handling. */
256 char *surfxml_bufferstack = NULL;
257 static int blimit = FLEXML_BUFFERSTACKSIZE;
258 static int bnext = 1;
260 static int *indexstack = NULL;
261 static int ilimit = FLEXML_INDEXSTACKSIZE;
262 static int inext = 1;
264 #define BUFFERSET(P) (P = bnext)
265 #define BUFFERPUTC(C) (ck_blimit(), surfxml_bufferstack[bnext++] = (C))
266 #define BUFFERDONE (BUFFERPUTC('\0'))
268 #define BUFFERLITERAL(C, P) surfxml_bufferliteral(C, &(P), yytext)
270 /* after this is called, there are at least 2 slots left in the stack */
271 static int ck_blimit()
273 if (bnext >= blimit) {
274 blimit += FLEXML_BUFFERSTACKSIZE + 2;
276 char *temp = (char *) realloc(surfxml_bufferstack, blimit);
278 surfxml_bufferstack = temp;
284 /* after this is called, there are at least 2 slots left in the stack */
285 static int ck_ilimit()
287 if (inext >= ilimit) {
288 ilimit += FLEXML_INDEXSTACKSIZE + 2;
290 int *temp = (int *) realloc(indexstack, ilimit);
298 #ifdef FLEXML_NEED_BUFFERLIT
299 static void surfxml_bufferliteral(char c, int* pp, const char* text)
301 const char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c);
302 assert(s <= e); BUFFERSET(*pp);
304 if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
311 static void pushbuffer(int p)
314 indexstack[inext++] = p;
315 indexstack[inext++] = bnext;
318 static int popbuffer(void)
321 bnext = indexstack[--inext];
322 return indexstack[--inext];
325 /* General internal entities are `unput' back onto the input stream... */
326 #define ENTITYTEXT(T) \
327 { char *s = (T), *e = s+strlen(s);\
328 while (--e >= s) { unput(*e); }}
333 /* Flex standard options. */
335 %option noyy_top_state
341 /* Flex user-requested options. */
345 /* XML character classes (currently restricted to ASCII). */
347 /* "Common syntactic structures." */
351 /* "Names and Tokens." */
352 NameChar [A-Za-z0-9.:_-]
353 Name [A-Za-z_:]{NameChar}*
354 Names {Name}({S}{Name})*
355 Nmtoken ({NameChar})+
356 Nmtokens {Nmtoken}({S}{Nmtoken})*
359 VersionNum [a-zA-Z0-9_.:-]+
361 Literal \'[^'']*\'|\"[^""]*\"
363 /* Parser states (flex `exclusive start conditions'):
365 * PROLOG the XML prolog of the document before <?xml...>
366 * DOCTYPE the XML prolog of the document after <?xml...>
367 * EPILOG after the root element
368 * INCOMMENT inside an XML comment <!--....-->
369 * INPI inside an XML PI <?...?>
370 * VALUE1 inside a '...'-delimited literal
371 * VALUE2 inside a "..."-delimited literal
372 * CDATA inside a <![CDATA[...] ]> section.
373 * ROOT_<tag> expect root element <tag>
374 * AL_<tag> inside the attribute list for <tag>
375 * IN_<tag> inside a <tag> with element contents (ready for end tag)
376 * IMPOSSIBLE dummy to permit disabling rules; must be last
378 %x PROLOG DOCTYPE EPILOG INCOMMENT INPI VALUE1 VALUE2 CDATA
379 %x ROOT_surfxml_platform AL_surfxml_platform S_surfxml_platform S_surfxml_platform_1 S_surfxml_platform_2 S_surfxml_platform_3 S_surfxml_platform_4 S_surfxml_platform_5 E_surfxml_platform
380 %x AL_surfxml_include E_surfxml_include
381 %x AL_surfxml_trace IN_trace
382 %x AL_surfxml_random S_surfxml_random S_surfxml_random_1 S_surfxml_random_2 E_surfxml_random
383 %x AL_surfxml_trace_c_connect E_surfxml_trace_c_connect
384 %x AL_surfxml_set E_surfxml_set
385 %x AL_surfxml_foreach S_surfxml_foreach S_surfxml_foreach_1 E_surfxml_foreach
386 %x AL_surfxml_host S_surfxml_host S_surfxml_host_1 S_surfxml_host_2 E_surfxml_host
387 %x AL_surfxml_prop E_surfxml_prop
388 %x AL_surfxml_cluster E_surfxml_cluster
389 %x AL_surfxml_router E_surfxml_router
390 %x AL_surfxml_link S_surfxml_link S_surfxml_link_1 S_surfxml_link_2 E_surfxml_link
391 %x AL_surfxml_route_c_multi S_surfxml_route_c_multi S_surfxml_route_c_multi_1 S_surfxml_route_c_multi_2 E_surfxml_route_c_multi
392 %x AL_surfxml_route S_surfxml_route S_surfxml_route_1 S_surfxml_route_2 E_surfxml_route
393 %x AL_surfxml_link_c_ctn E_surfxml_link_c_ctn
394 %x AL_surfxml_process S_surfxml_process S_surfxml_process_1 S_surfxml_process_2 E_surfxml_process
395 %x AL_surfxml_argument E_surfxml_argument
400 const char* *surfxml_statenames=NULL;
405 /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
407 reset_surfxml_parse_err_msg();
408 surfxml_bufferstack = (char *) malloc(FLEXML_BUFFERSTACKSIZE);
409 assert(surfxml_bufferstack);
413 for (i = 0; i < blimit; i++) {
414 surfxml_bufferstack[i] = '\377';
418 surfxml_bufferstack[0] = '\0';
419 indexstack = (int *) malloc(FLEXML_INDEXSTACKSIZE * sizeof(int));
425 surfxml_bufferliteral('\0', &bnext, "0.0");
426 surfxml_bufferliteral('\0', &bnext, "http://simgrid.gforge.inria.fr/");
427 surfxml_bufferliteral('\0', &bnext, "http://simgrid.gforge.inria.fr/");
428 surfxml_bufferliteral('\0', &bnext, "1.0");
429 surfxml_bufferliteral('\0', &bnext, "1.0");
430 surfxml_bufferliteral('\0', &bnext, "1.0");
431 surfxml_bufferliteral('\0', &bnext, "1.0");
432 surfxml_bufferliteral('\0', &bnext, "-1.0");
433 surfxml_bufferliteral('\0', &bnext, "0.0");
434 surfxml_bufferliteral('\0', &bnext, "0.0");
435 surfxml_bufferliteral('\0', &bnext, "0.0");
436 surfxml_bufferliteral('\0', &bnext, "0.0");
437 surfxml_bufferliteral('\0', &bnext, "0.0");
438 surfxml_bufferliteral('\0', &bnext, "-1.0");
439 surfxml_bufferliteral('\0', &bnext, "-1.0");
440 if(!surfxml_statenames) {surfxml_statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*));
441 surfxml_statenames[PROLOG] = NULL;
442 surfxml_statenames[DOCTYPE] = NULL;
443 surfxml_statenames[EPILOG] = NULL;
444 surfxml_statenames[INCOMMENT] = NULL;
445 surfxml_statenames[INPI] = NULL;
446 surfxml_statenames[VALUE1] = NULL;
447 surfxml_statenames[VALUE2] = NULL;
448 surfxml_statenames[CDATA] = NULL;
449 surfxml_statenames[ROOT_surfxml_platform] = NULL;
450 surfxml_statenames[AL_surfxml_platform] = NULL;
451 surfxml_statenames[S_surfxml_platform] = "platform";
452 surfxml_statenames[S_surfxml_platform_1] = "platform";
453 surfxml_statenames[S_surfxml_platform_2] = "platform";
454 surfxml_statenames[S_surfxml_platform_3] = "platform";
455 surfxml_statenames[S_surfxml_platform_4] = "platform";
456 surfxml_statenames[S_surfxml_platform_5] = "platform";
457 surfxml_statenames[E_surfxml_platform] = "platform";
458 surfxml_statenames[AL_surfxml_include] = NULL;
459 surfxml_statenames[E_surfxml_include] = "include";
460 surfxml_statenames[AL_surfxml_trace] = NULL;
461 surfxml_statenames[IN_trace] = "trace";
462 surfxml_statenames[AL_surfxml_random] = NULL;
463 surfxml_statenames[S_surfxml_random] = "random";
464 surfxml_statenames[S_surfxml_random_1] = "random";
465 surfxml_statenames[S_surfxml_random_2] = "random";
466 surfxml_statenames[E_surfxml_random] = "random";
467 surfxml_statenames[AL_surfxml_trace_c_connect] = NULL;
468 surfxml_statenames[E_surfxml_trace_c_connect] = "trace:connect";
469 surfxml_statenames[AL_surfxml_set] = NULL;
470 surfxml_statenames[E_surfxml_set] = "set";
471 surfxml_statenames[AL_surfxml_foreach] = NULL;
472 surfxml_statenames[S_surfxml_foreach] = "foreach";
473 surfxml_statenames[S_surfxml_foreach_1] = "foreach";
474 surfxml_statenames[E_surfxml_foreach] = "foreach";
475 surfxml_statenames[AL_surfxml_host] = NULL;
476 surfxml_statenames[S_surfxml_host] = "host";
477 surfxml_statenames[S_surfxml_host_1] = "host";
478 surfxml_statenames[S_surfxml_host_2] = "host";
479 surfxml_statenames[E_surfxml_host] = "host";
480 surfxml_statenames[AL_surfxml_prop] = NULL;
481 surfxml_statenames[E_surfxml_prop] = "prop";
482 surfxml_statenames[AL_surfxml_cluster] = NULL;
483 surfxml_statenames[E_surfxml_cluster] = "cluster";
484 surfxml_statenames[AL_surfxml_router] = NULL;
485 surfxml_statenames[E_surfxml_router] = "router";
486 surfxml_statenames[AL_surfxml_link] = NULL;
487 surfxml_statenames[S_surfxml_link] = "link";
488 surfxml_statenames[S_surfxml_link_1] = "link";
489 surfxml_statenames[S_surfxml_link_2] = "link";
490 surfxml_statenames[E_surfxml_link] = "link";
491 surfxml_statenames[AL_surfxml_route_c_multi] = NULL;
492 surfxml_statenames[S_surfxml_route_c_multi] = "route:multi";
493 surfxml_statenames[S_surfxml_route_c_multi_1] = "route:multi";
494 surfxml_statenames[S_surfxml_route_c_multi_2] = "route:multi";
495 surfxml_statenames[E_surfxml_route_c_multi] = "route:multi";
496 surfxml_statenames[AL_surfxml_route] = NULL;
497 surfxml_statenames[S_surfxml_route] = "route";
498 surfxml_statenames[S_surfxml_route_1] = "route";
499 surfxml_statenames[S_surfxml_route_2] = "route";
500 surfxml_statenames[E_surfxml_route] = "route";
501 surfxml_statenames[AL_surfxml_link_c_ctn] = NULL;
502 surfxml_statenames[E_surfxml_link_c_ctn] = "link:ctn";
503 surfxml_statenames[AL_surfxml_process] = NULL;
504 surfxml_statenames[S_surfxml_process] = "process";
505 surfxml_statenames[S_surfxml_process_1] = "process";
506 surfxml_statenames[S_surfxml_process_2] = "process";
507 surfxml_statenames[E_surfxml_process] = "process";
508 surfxml_statenames[AL_surfxml_argument] = NULL;
509 surfxml_statenames[E_surfxml_argument] = "argument";
512 /* COMMENTS and PIs: handled uniformly for efficiency. */
514 <ROOT_surfxml_platform,AL_surfxml_platform,S_surfxml_platform,S_surfxml_platform_1,S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform_4,S_surfxml_platform_5,E_surfxml_platform,AL_surfxml_include,E_surfxml_include,AL_surfxml_trace,IN_trace,AL_surfxml_random,S_surfxml_random,S_surfxml_random_1,S_surfxml_random_2,E_surfxml_random,AL_surfxml_trace_c_connect,E_surfxml_trace_c_connect,AL_surfxml_set,E_surfxml_set,AL_surfxml_foreach,S_surfxml_foreach,S_surfxml_foreach_1,E_surfxml_foreach,AL_surfxml_host,S_surfxml_host,S_surfxml_host_1,S_surfxml_host_2,E_surfxml_host,AL_surfxml_prop,E_surfxml_prop,AL_surfxml_cluster,E_surfxml_cluster,AL_surfxml_router,E_surfxml_router,AL_surfxml_link,S_surfxml_link,S_surfxml_link_1,S_surfxml_link_2,E_surfxml_link,AL_surfxml_route_c_multi,S_surfxml_route_c_multi,S_surfxml_route_c_multi_1,S_surfxml_route_c_multi_2,E_surfxml_route_c_multi,AL_surfxml_route,S_surfxml_route,S_surfxml_route_1,S_surfxml_route_2,E_surfxml_route,AL_surfxml_link_c_ctn,E_surfxml_link_c_ctn,AL_surfxml_process,S_surfxml_process,S_surfxml_process_1,S_surfxml_process_2,E_surfxml_process,AL_surfxml_argument,E_surfxml_argument,PROLOG,DOCTYPE,EPILOG>{
515 "<!--" ENTER(INCOMMENT);
523 <<EOF>> FAIL("EOF in comment.");
529 <<EOF>> FAIL("EOF in PI (processing instruction).");
532 /* SPACES: skipped uniformly */
534 <ROOT_surfxml_platform,AL_surfxml_platform,S_surfxml_platform,S_surfxml_platform_1,S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform_4,S_surfxml_platform_5,E_surfxml_platform,AL_surfxml_include,E_surfxml_include,AL_surfxml_trace,AL_surfxml_random,S_surfxml_random,S_surfxml_random_1,S_surfxml_random_2,E_surfxml_random,AL_surfxml_trace_c_connect,E_surfxml_trace_c_connect,AL_surfxml_set,E_surfxml_set,AL_surfxml_foreach,S_surfxml_foreach,S_surfxml_foreach_1,E_surfxml_foreach,AL_surfxml_host,S_surfxml_host,S_surfxml_host_1,S_surfxml_host_2,E_surfxml_host,AL_surfxml_prop,E_surfxml_prop,AL_surfxml_cluster,E_surfxml_cluster,AL_surfxml_router,E_surfxml_router,AL_surfxml_link,S_surfxml_link,S_surfxml_link_1,S_surfxml_link_2,E_surfxml_link,AL_surfxml_route_c_multi,S_surfxml_route_c_multi,S_surfxml_route_c_multi_1,S_surfxml_route_c_multi_2,E_surfxml_route_c_multi,AL_surfxml_route,S_surfxml_route,S_surfxml_route_1,S_surfxml_route_2,E_surfxml_route,AL_surfxml_link_c_ctn,E_surfxml_link_c_ctn,AL_surfxml_process,S_surfxml_process,S_surfxml_process_1,S_surfxml_process_2,E_surfxml_process,AL_surfxml_argument,E_surfxml_argument,PROLOG,DOCTYPE,EPILOG>{S} SKIP;
536 /* PROLOG: determine root element and process it. */
539 "<?xml"({S}version{Eq}(\'{VersionNum}\'|\"{VersionNum}\"))?({S}encoding{Eq}(\'[^']*\'|\"[^"]*\"))?"?>" SET(DOCTYPE);
540 "<?xml"[^>]*">" FAIL("Bad declaration %s.",yytext);
544 "<!DOCTYPE"{S}"platform"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_platform);
545 "<!"[^>-][^>]*">" FAIL("Bad declaration %s.",yytext);
546 . FAIL("Unexpected character `%c' in prolog.", yytext[0]);
547 <<EOF>> FAIL("EOF in prolog.");
550 /* RULES DERIVED FROM DTD. */
552 /* <!-- Small DTD for SURF based tools. --> */
554 <ROOT_surfxml_platform>"<platform"{s} {
555 AX_surfxml_platform_version = 1;
556 AX_surfxml_platform_xmlns_c_link = 5;
557 AX_surfxml_platform_xmlns_c_route = 37;
558 ENTER(AL_surfxml_platform); pushbuffer(0);
561 <AL_surfxml_platform>{
562 "version"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_version);
563 "version"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_version);
565 "xmlns:link"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_xmlns_c_link);
566 "xmlns:link"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_xmlns_c_link);
568 "xmlns:route"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_xmlns_c_route);
569 "xmlns:route"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_xmlns_c_route);
572 LEAVE; STag_surfxml_platform();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform);
575 LEAVE; STag_surfxml_platform(); surfxml_pcdata_ix = 0; ETag_surfxml_platform(); popbuffer(); /* attribute */
577 case ROOT_surfxml_platform: SET(EPILOG); break;
580 . FAIL("Unexpected character `%c' in attribute list of platform element.", yytext[0]);
581 {Name} FAIL("Bad attribute `%s' in `platform' element start tag.",yytext);
582 <<EOF>> FAIL("EOF in attribute list of `platform' element.");
585 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform_3,S_surfxml_platform,E_surfxml_platform>{
588 ETag_surfxml_platform();
589 popbuffer(); /* attribute */
591 case ROOT_surfxml_platform: SET(EPILOG); break;
594 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</platform>' expected.",yytext);
595 . FAIL("Unexpected character `%c': `</platform>' expected.",yytext[0]);
596 <<EOF>> FAIL("Premature EOF: `</platform>' expected.");
599 <S_surfxml_platform_5,S_surfxml_platform_2,S_surfxml_platform_1,S_surfxml_platform_3,S_surfxml_platform,S_surfxml_platform_4>"<include"{s} {
600 AX_surfxml_include_file = 0;
601 ENTER(AL_surfxml_include); pushbuffer(0);
604 <AL_surfxml_include>{
605 "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_include_file);
606 "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_include_file);
609 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
610 LEAVE; STag_surfxml_include();surfxml_pcdata_ix = 0; ENTER(E_surfxml_include);
613 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
614 LEAVE; STag_surfxml_include(); surfxml_pcdata_ix = 0; ETag_surfxml_include(); popbuffer(); /* attribute */
616 case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
617 case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
620 . FAIL("Unexpected character `%c' in attribute list of include element.", yytext[0]);
621 {Name} FAIL("Bad attribute `%s' in `include' element start tag.",yytext);
622 <<EOF>> FAIL("EOF in attribute list of `include' element.");
628 ETag_surfxml_include();
629 popbuffer(); /* attribute */
631 case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
632 case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
635 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</include>' expected.",yytext);
636 . FAIL("Unexpected character `%c': `</include>' expected.",yytext[0]);
637 <<EOF>> FAIL("Premature EOF: `</include>' expected.");
640 <S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<trace"{s} {
641 AX_surfxml_trace_id = 0;
642 AX_surfxml_trace_file = 0;
643 AX_surfxml_trace_periodicity = 0;
644 ENTER(AL_surfxml_trace); pushbuffer(0);
648 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_id);
649 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_id);
651 "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_file);
652 "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_file);
654 "periodicity"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_periodicity);
655 "periodicity"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_periodicity);
658 if (!AX_surfxml_trace_id) FAIL("Required attribute `id' not set for `trace' element.");
659 if (!AX_surfxml_trace_periodicity) FAIL("Required attribute `periodicity' not set for `trace' element.");
660 LEAVE; STag_surfxml_trace();pushbuffer(surfxml_pcdata_ix); BUFFERSET(surfxml_pcdata_ix);; ENTER(IN_trace);
663 if (!AX_surfxml_trace_id) FAIL("Required attribute `id' not set for `trace' element.");
664 if (!AX_surfxml_trace_periodicity) FAIL("Required attribute `periodicity' not set for `trace' element.");
665 LEAVE; STag_surfxml_trace(); surfxml_pcdata_ix = 0; ETag_surfxml_trace(); popbuffer(); /* attribute */
667 case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
670 . FAIL("Unexpected character `%c' in attribute list of trace element.", yytext[0]);
671 {Name} FAIL("Bad attribute `%s' in `trace' element start tag.",yytext);
672 <<EOF>> FAIL("EOF in attribute list of `trace' element.");
679 ETag_surfxml_trace();
680 surfxml_pcdata_ix = popbuffer();
681 popbuffer(); /* attribute */
683 case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
686 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</trace>' expected.",yytext);
687 <<EOF>> FAIL("Premature EOF: `</trace>' expected.");
690 <S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<random"{s} {
691 AX_surfxml_random_id = 0;
692 AX_surfxml_random_min = 0;
693 AX_surfxml_random_max = 0;
694 AX_surfxml_random_mean = 0;
695 AX_surfxml_random_std_deviation = 0;
696 AX_surfxml_random_generator = A_surfxml_random_generator_DRAND48;
697 ENTER(AL_surfxml_random); pushbuffer(0);
701 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_id);
702 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_id);
704 "min"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_min);
705 "min"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_min);
707 "max"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_max);
708 "max"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_max);
710 "mean"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_mean);
711 "mean"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_mean);
713 "std_deviation"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_std_deviation);
714 "std_deviation"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_std_deviation);
716 "generator"{Eq}"'DRAND48'" |
717 "generator"{Eq}"\"DRAND48\"" A_surfxml_random_generator = A_surfxml_random_generator_DRAND48;
718 "generator"{Eq}"'RAND'" |
719 "generator"{Eq}"\"RAND\"" A_surfxml_random_generator = A_surfxml_random_generator_RAND;
722 if (!AX_surfxml_random_id) FAIL("Required attribute `id' not set for `random' element.");
723 if (!AX_surfxml_random_min) FAIL("Required attribute `min' not set for `random' element.");
724 if (!AX_surfxml_random_max) FAIL("Required attribute `max' not set for `random' element.");
725 if (!AX_surfxml_random_mean) FAIL("Required attribute `mean' not set for `random' element.");
726 if (!AX_surfxml_random_std_deviation) FAIL("Required attribute `std_deviation' not set for `random' element.");
727 LEAVE; STag_surfxml_random();surfxml_pcdata_ix = 0; ENTER(S_surfxml_random);
730 if (!AX_surfxml_random_id) FAIL("Required attribute `id' not set for `random' element.");
731 if (!AX_surfxml_random_min) FAIL("Required attribute `min' not set for `random' element.");
732 if (!AX_surfxml_random_max) FAIL("Required attribute `max' not set for `random' element.");
733 if (!AX_surfxml_random_mean) FAIL("Required attribute `mean' not set for `random' element.");
734 if (!AX_surfxml_random_std_deviation) FAIL("Required attribute `std_deviation' not set for `random' element.");
735 LEAVE; STag_surfxml_random(); surfxml_pcdata_ix = 0; ETag_surfxml_random(); popbuffer(); /* attribute */
737 case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
740 . FAIL("Unexpected character `%c' in attribute list of random element.", yytext[0]);
741 {Name} FAIL("Bad attribute `%s' in `random' element start tag.",yytext);
742 <<EOF>> FAIL("EOF in attribute list of `random' element.");
745 <S_surfxml_random_2,S_surfxml_random,E_surfxml_random>{
748 ETag_surfxml_random();
749 popbuffer(); /* attribute */
751 case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
754 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</random>' expected.",yytext);
755 . FAIL("Unexpected character `%c': `</random>' expected.",yytext[0]);
756 <<EOF>> FAIL("Premature EOF: `</random>' expected.");
759 <S_surfxml_platform_5,S_surfxml_platform_2,S_surfxml_platform_1,S_surfxml_platform_3,S_surfxml_platform,S_surfxml_platform_4>"<trace:connect"{s} {
760 AX_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_AVAILABILITY;
761 AX_surfxml_trace_c_connect_trace_id = 0;
762 AX_surfxml_trace_c_connect_element = A_surfxml_trace_c_connect_element_HOST;
763 AX_surfxml_trace_c_connect_connector_id = 0;
764 ENTER(AL_surfxml_trace_c_connect); pushbuffer(0);
767 <AL_surfxml_trace_c_connect>{
768 "kind"{Eq}"'AVAILABILITY'" |
769 "kind"{Eq}"\"AVAILABILITY\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_AVAILABILITY;
770 "kind"{Eq}"'BANDWIDTH'" |
771 "kind"{Eq}"\"BANDWIDTH\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_BANDWIDTH;
772 "kind"{Eq}"'LATENCY'" |
773 "kind"{Eq}"\"LATENCY\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_LATENCY;
774 "kind"{Eq}"'POWER'" |
775 "kind"{Eq}"\"POWER\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_POWER;
777 "trace_id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_c_connect_trace_id);
778 "trace_id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_c_connect_trace_id);
780 "element"{Eq}"'HOST'" |
781 "element"{Eq}"\"HOST\"" A_surfxml_trace_c_connect_element = A_surfxml_trace_c_connect_element_HOST;
782 "element"{Eq}"'LINK'" |
783 "element"{Eq}"\"LINK\"" A_surfxml_trace_c_connect_element = A_surfxml_trace_c_connect_element_LINK;
785 "connector_id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_c_connect_connector_id);
786 "connector_id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_c_connect_connector_id);
789 if (!AX_surfxml_trace_c_connect_trace_id) FAIL("Required attribute `trace_id' not set for `trace:connect' element.");
790 if (!AX_surfxml_trace_c_connect_connector_id) FAIL("Required attribute `connector_id' not set for `trace:connect' element.");
791 LEAVE; STag_surfxml_trace_c_connect();surfxml_pcdata_ix = 0; ENTER(E_surfxml_trace_c_connect);
794 if (!AX_surfxml_trace_c_connect_trace_id) FAIL("Required attribute `trace_id' not set for `trace:connect' element.");
795 if (!AX_surfxml_trace_c_connect_connector_id) FAIL("Required attribute `connector_id' not set for `trace:connect' element.");
796 LEAVE; STag_surfxml_trace_c_connect(); surfxml_pcdata_ix = 0; ETag_surfxml_trace_c_connect(); popbuffer(); /* attribute */
798 case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
799 case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
802 . FAIL("Unexpected character `%c' in attribute list of trace:connect element.", yytext[0]);
803 {Name} FAIL("Bad attribute `%s' in `trace:connect' element start tag.",yytext);
804 <<EOF>> FAIL("EOF in attribute list of `trace:connect' element.");
807 <E_surfxml_trace_c_connect>{
808 "</trace:connect"{s}">" {
810 ETag_surfxml_trace_c_connect();
811 popbuffer(); /* attribute */
813 case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
814 case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
817 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</trace:connect>' expected.",yytext);
818 . FAIL("Unexpected character `%c': `</trace:connect>' expected.",yytext[0]);
819 <<EOF>> FAIL("Premature EOF: `</trace:connect>' expected.");
822 <S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<set"{s} {
823 AX_surfxml_set_id = 0;
824 AX_surfxml_set_prefix = 0;
825 AX_surfxml_set_suffix = 0;
826 AX_surfxml_set_radical = 0;
827 ENTER(AL_surfxml_set); pushbuffer(0);
831 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_set_id);
832 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_set_id);
834 "prefix"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_set_prefix);
835 "prefix"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_set_prefix);
837 "suffix"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_set_suffix);
838 "suffix"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_set_suffix);
840 "radical"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_set_radical);
841 "radical"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_set_radical);
844 if (!AX_surfxml_set_id) FAIL("Required attribute `id' not set for `set' element.");
845 if (!AX_surfxml_set_prefix) FAIL("Required attribute `prefix' not set for `set' element.");
846 if (!AX_surfxml_set_suffix) FAIL("Required attribute `suffix' not set for `set' element.");
847 if (!AX_surfxml_set_radical) FAIL("Required attribute `radical' not set for `set' element.");
848 LEAVE; STag_surfxml_set();surfxml_pcdata_ix = 0; ENTER(E_surfxml_set);
851 if (!AX_surfxml_set_id) FAIL("Required attribute `id' not set for `set' element.");
852 if (!AX_surfxml_set_prefix) FAIL("Required attribute `prefix' not set for `set' element.");
853 if (!AX_surfxml_set_suffix) FAIL("Required attribute `suffix' not set for `set' element.");
854 if (!AX_surfxml_set_radical) FAIL("Required attribute `radical' not set for `set' element.");
855 LEAVE; STag_surfxml_set(); surfxml_pcdata_ix = 0; ETag_surfxml_set(); popbuffer(); /* attribute */
857 case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
860 . FAIL("Unexpected character `%c' in attribute list of set element.", yytext[0]);
861 {Name} FAIL("Bad attribute `%s' in `set' element start tag.",yytext);
862 <<EOF>> FAIL("EOF in attribute list of `set' element.");
869 popbuffer(); /* attribute */
871 case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
874 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</set>' expected.",yytext);
875 . FAIL("Unexpected character `%c': `</set>' expected.",yytext[0]);
876 <<EOF>> FAIL("Premature EOF: `</set>' expected.");
879 <S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<foreach"{s} {
880 AX_surfxml_foreach_set_id = 0;
881 ENTER(AL_surfxml_foreach); pushbuffer(0);
884 <AL_surfxml_foreach>{
885 "set_id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_foreach_set_id);
886 "set_id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_foreach_set_id);
889 if (!AX_surfxml_foreach_set_id) FAIL("Required attribute `set_id' not set for `foreach' element.");
890 LEAVE; STag_surfxml_foreach();surfxml_pcdata_ix = 0; ENTER(S_surfxml_foreach);
892 "/>" FAIL("`foreach' element cannot be empty.");
893 . FAIL("Unexpected character `%c' in attribute list of foreach element.", yytext[0]);
894 {Name} FAIL("Bad attribute `%s' in `foreach' element start tag.",yytext);
895 <<EOF>> FAIL("EOF in attribute list of `foreach' element.");
901 ETag_surfxml_foreach();
902 popbuffer(); /* attribute */
904 case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
907 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</foreach>' expected.",yytext);
908 . FAIL("Unexpected character `%c': `</foreach>' expected.",yytext[0]);
909 <<EOF>> FAIL("Premature EOF: `</foreach>' expected.");
912 <S_surfxml_foreach,S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<host"{s} {
913 AX_surfxml_host_id = 0;
914 AX_surfxml_host_power = 0;
915 AX_surfxml_host_availability = 69;
916 AX_surfxml_host_availability_file = 0;
917 AX_surfxml_host_state = A_surfxml_host_state_ON;
918 AX_surfxml_host_state_file = 0;
919 AX_surfxml_host_interference_send = 73;
920 AX_surfxml_host_interference_recv = 77;
921 AX_surfxml_host_interference_send_recv = 81;
922 AX_surfxml_host_max_outgoing_rate = 85;
923 ENTER(AL_surfxml_host); pushbuffer(0);
927 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_id);
928 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_id);
930 "power"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_power);
931 "power"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_power);
933 "availability"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability);
934 "availability"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability);
936 "availability_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability_file);
937 "availability_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability_file);
940 "state"{Eq}"\"ON\"" A_surfxml_host_state = A_surfxml_host_state_ON;
942 "state"{Eq}"\"OFF\"" A_surfxml_host_state = A_surfxml_host_state_OFF;
944 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_state_file);
945 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_state_file);
947 "interference_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send);
948 "interference_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send);
950 "interference_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_recv);
951 "interference_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_recv);
953 "interference_send_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send_recv);
954 "interference_send_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send_recv);
956 "max_outgoing_rate"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_max_outgoing_rate);
957 "max_outgoing_rate"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_max_outgoing_rate);
960 if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
961 if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element.");
962 LEAVE; STag_surfxml_host();surfxml_pcdata_ix = 0; ENTER(S_surfxml_host);
965 if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
966 if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element.");
967 LEAVE; STag_surfxml_host(); surfxml_pcdata_ix = 0; ETag_surfxml_host(); popbuffer(); /* attribute */
969 case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
970 case S_surfxml_foreach: SET(S_surfxml_foreach_1); break;
973 . FAIL("Unexpected character `%c' in attribute list of host element.", yytext[0]);
974 {Name} FAIL("Bad attribute `%s' in `host' element start tag.",yytext);
975 <<EOF>> FAIL("EOF in attribute list of `host' element.");
978 <S_surfxml_host,E_surfxml_host,S_surfxml_host_2>{
982 popbuffer(); /* attribute */
984 case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
985 case S_surfxml_foreach: SET(S_surfxml_foreach_1); break;
988 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</host>' expected.",yytext);
989 . FAIL("Unexpected character `%c': `</host>' expected.",yytext[0]);
990 <<EOF>> FAIL("Premature EOF: `</host>' expected.");
993 <S_surfxml_host,S_surfxml_link_1,S_surfxml_link_2,S_surfxml_random,S_surfxml_random_2,S_surfxml_link,S_surfxml_host_1,S_surfxml_random_1,S_surfxml_process_1,S_surfxml_process,S_surfxml_process_2,S_surfxml_host_2>"<prop"{s} {
994 AX_surfxml_prop_id = 0;
995 AX_surfxml_prop_value = 0;
996 ENTER(AL_surfxml_prop); pushbuffer(0);
1000 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_id);
1001 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_id);
1003 "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_value);
1004 "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_value);
1007 if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
1008 if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element.");
1009 LEAVE; STag_surfxml_prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_prop);
1012 if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
1013 if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element.");
1014 LEAVE; STag_surfxml_prop(); surfxml_pcdata_ix = 0; ETag_surfxml_prop(); popbuffer(); /* attribute */
1016 case S_surfxml_random: case S_surfxml_random_2: case S_surfxml_random_1: SET(S_surfxml_random_2); break;
1017 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1018 case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
1019 case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
1022 . FAIL("Unexpected character `%c' in attribute list of prop element.", yytext[0]);
1023 {Name} FAIL("Bad attribute `%s' in `prop' element start tag.",yytext);
1024 <<EOF>> FAIL("EOF in attribute list of `prop' element.");
1030 ETag_surfxml_prop();
1031 popbuffer(); /* attribute */
1033 case S_surfxml_random: case S_surfxml_random_2: case S_surfxml_random_1: SET(S_surfxml_random_2); break;
1034 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1035 case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
1036 case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
1039 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</prop>' expected.",yytext);
1040 . FAIL("Unexpected character `%c': `</prop>' expected.",yytext[0]);
1041 <<EOF>> FAIL("Premature EOF: `</prop>' expected.");
1044 <S_surfxml_platform_2,S_surfxml_platform,S_surfxml_platform_3>"<cluster"{s} {
1045 AX_surfxml_cluster_id = 0;
1046 AX_surfxml_cluster_prefix = 0;
1047 AX_surfxml_cluster_suffix = 0;
1048 AX_surfxml_cluster_radical = 0;
1049 AX_surfxml_cluster_power = 0;
1050 AX_surfxml_cluster_bw = 0;
1051 AX_surfxml_cluster_lat = 0;
1052 AX_surfxml_cluster_bb_bw = 0;
1053 AX_surfxml_cluster_bb_lat = 0;
1054 ENTER(AL_surfxml_cluster); pushbuffer(0);
1057 <AL_surfxml_cluster>{
1058 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_id);
1059 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_id);
1061 "prefix"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_prefix);
1062 "prefix"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_prefix);
1064 "suffix"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_suffix);
1065 "suffix"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_suffix);
1067 "radical"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_radical);
1068 "radical"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_radical);
1070 "power"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_power);
1071 "power"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_power);
1073 "bw"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bw);
1074 "bw"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bw);
1076 "lat"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_lat);
1077 "lat"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_lat);
1079 "bb_bw"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb_bw);
1080 "bb_bw"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb_bw);
1082 "bb_lat"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb_lat);
1083 "bb_lat"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb_lat);
1086 if (!AX_surfxml_cluster_id) FAIL("Required attribute `id' not set for `cluster' element.");
1087 if (!AX_surfxml_cluster_prefix) FAIL("Required attribute `prefix' not set for `cluster' element.");
1088 if (!AX_surfxml_cluster_suffix) FAIL("Required attribute `suffix' not set for `cluster' element.");
1089 if (!AX_surfxml_cluster_radical) FAIL("Required attribute `radical' not set for `cluster' element.");
1090 if (!AX_surfxml_cluster_power) FAIL("Required attribute `power' not set for `cluster' element.");
1091 if (!AX_surfxml_cluster_bw) FAIL("Required attribute `bw' not set for `cluster' element.");
1092 if (!AX_surfxml_cluster_lat) FAIL("Required attribute `lat' not set for `cluster' element.");
1093 if (!AX_surfxml_cluster_bb_bw) FAIL("Required attribute `bb_bw' not set for `cluster' element.");
1094 if (!AX_surfxml_cluster_bb_lat) FAIL("Required attribute `bb_lat' not set for `cluster' element.");
1095 LEAVE; STag_surfxml_cluster();surfxml_pcdata_ix = 0; ENTER(E_surfxml_cluster);
1098 if (!AX_surfxml_cluster_id) FAIL("Required attribute `id' not set for `cluster' element.");
1099 if (!AX_surfxml_cluster_prefix) FAIL("Required attribute `prefix' not set for `cluster' element.");
1100 if (!AX_surfxml_cluster_suffix) FAIL("Required attribute `suffix' not set for `cluster' element.");
1101 if (!AX_surfxml_cluster_radical) FAIL("Required attribute `radical' not set for `cluster' element.");
1102 if (!AX_surfxml_cluster_power) FAIL("Required attribute `power' not set for `cluster' element.");
1103 if (!AX_surfxml_cluster_bw) FAIL("Required attribute `bw' not set for `cluster' element.");
1104 if (!AX_surfxml_cluster_lat) FAIL("Required attribute `lat' not set for `cluster' element.");
1105 if (!AX_surfxml_cluster_bb_bw) FAIL("Required attribute `bb_bw' not set for `cluster' element.");
1106 if (!AX_surfxml_cluster_bb_lat) FAIL("Required attribute `bb_lat' not set for `cluster' element.");
1107 LEAVE; STag_surfxml_cluster(); surfxml_pcdata_ix = 0; ETag_surfxml_cluster(); popbuffer(); /* attribute */
1109 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1112 . FAIL("Unexpected character `%c' in attribute list of cluster element.", yytext[0]);
1113 {Name} FAIL("Bad attribute `%s' in `cluster' element start tag.",yytext);
1114 <<EOF>> FAIL("EOF in attribute list of `cluster' element.");
1117 <E_surfxml_cluster>{
1120 ETag_surfxml_cluster();
1121 popbuffer(); /* attribute */
1123 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1126 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</cluster>' expected.",yytext);
1127 . FAIL("Unexpected character `%c': `</cluster>' expected.",yytext[0]);
1128 <<EOF>> FAIL("Premature EOF: `</cluster>' expected.");
1131 <S_surfxml_platform_2,S_surfxml_platform,S_surfxml_platform_3>"<router"{s} {
1132 AX_surfxml_router_id = 0;
1133 ENTER(AL_surfxml_router); pushbuffer(0);
1136 <AL_surfxml_router>{
1137 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_router_id);
1138 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_router_id);
1141 if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
1142 LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router);
1145 if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
1146 LEAVE; STag_surfxml_router(); surfxml_pcdata_ix = 0; ETag_surfxml_router(); popbuffer(); /* attribute */
1148 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1151 . FAIL("Unexpected character `%c' in attribute list of router element.", yytext[0]);
1152 {Name} FAIL("Bad attribute `%s' in `router' element start tag.",yytext);
1153 <<EOF>> FAIL("EOF in attribute list of `router' element.");
1159 ETag_surfxml_router();
1160 popbuffer(); /* attribute */
1162 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1165 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</router>' expected.",yytext);
1166 . FAIL("Unexpected character `%c': `</router>' expected.",yytext[0]);
1167 <<EOF>> FAIL("Premature EOF: `</router>' expected.");
1170 <S_surfxml_foreach,S_surfxml_platform_2,S_surfxml_platform,S_surfxml_foreach_1,S_surfxml_platform_3>"<link"{s} {
1171 AX_surfxml_link_id = 0;
1172 AX_surfxml_link_bandwidth = 0;
1173 AX_surfxml_link_bandwidth_file = 0;
1174 AX_surfxml_link_latency = 90;
1175 AX_surfxml_link_latency_file = 0;
1176 AX_surfxml_link_state = A_surfxml_link_state_ON;
1177 AX_surfxml_link_state_file = 0;
1178 AX_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
1179 ENTER(AL_surfxml_link); pushbuffer(0);
1183 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_id);
1184 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_id);
1186 "bandwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth);
1187 "bandwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth);
1189 "bandwidth_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth_file);
1190 "bandwidth_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth_file);
1192 "latency"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency);
1193 "latency"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency);
1195 "latency_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency_file);
1196 "latency_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency_file);
1199 "state"{Eq}"\"ON\"" A_surfxml_link_state = A_surfxml_link_state_ON;
1200 "state"{Eq}"'OFF'" |
1201 "state"{Eq}"\"OFF\"" A_surfxml_link_state = A_surfxml_link_state_OFF;
1203 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_state_file);
1204 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_state_file);
1206 "sharing_policy"{Eq}"'SHARED'" |
1207 "sharing_policy"{Eq}"\"SHARED\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
1208 "sharing_policy"{Eq}"'FATPIPE'" |
1209 "sharing_policy"{Eq}"\"FATPIPE\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FATPIPE;
1212 if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
1213 if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
1214 LEAVE; STag_surfxml_link();surfxml_pcdata_ix = 0; ENTER(S_surfxml_link);
1217 if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
1218 if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
1219 LEAVE; STag_surfxml_link(); surfxml_pcdata_ix = 0; ETag_surfxml_link(); popbuffer(); /* attribute */
1221 case S_surfxml_foreach: case S_surfxml_foreach_1: SET(E_surfxml_foreach); break;
1222 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1225 . FAIL("Unexpected character `%c' in attribute list of link element.", yytext[0]);
1226 {Name} FAIL("Bad attribute `%s' in `link' element start tag.",yytext);
1227 <<EOF>> FAIL("EOF in attribute list of `link' element.");
1230 <S_surfxml_link_2,E_surfxml_link,S_surfxml_link>{
1233 ETag_surfxml_link();
1234 popbuffer(); /* attribute */
1236 case S_surfxml_foreach: case S_surfxml_foreach_1: SET(E_surfxml_foreach); break;
1237 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1240 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link>' expected.",yytext);
1241 . FAIL("Unexpected character `%c': `</link>' expected.",yytext[0]);
1242 <<EOF>> FAIL("Premature EOF: `</link>' expected.");
1245 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_platform_3,S_surfxml_platform_4>"<route:multi"{s} {
1246 AX_surfxml_route_c_multi_src = 0;
1247 AX_surfxml_route_c_multi_dst = 0;
1248 AX_surfxml_route_c_multi_action = A_surfxml_route_c_multi_action_POSTPEND;
1249 AX_surfxml_route_c_multi_symmetric = A_surfxml_route_c_multi_symmetric_YES;
1250 ENTER(AL_surfxml_route_c_multi); pushbuffer(0);
1253 <AL_surfxml_route_c_multi>{
1254 "src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_c_multi_src);
1255 "src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_c_multi_src);
1257 "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_c_multi_dst);
1258 "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_c_multi_dst);
1260 "action"{Eq}"'POSTPEND'" |
1261 "action"{Eq}"\"POSTPEND\"" A_surfxml_route_c_multi_action = A_surfxml_route_c_multi_action_POSTPEND;
1262 "action"{Eq}"'PREPEND'" |
1263 "action"{Eq}"\"PREPEND\"" A_surfxml_route_c_multi_action = A_surfxml_route_c_multi_action_PREPEND;
1264 "action"{Eq}"'OVERRIDE'" |
1265 "action"{Eq}"\"OVERRIDE\"" A_surfxml_route_c_multi_action = A_surfxml_route_c_multi_action_OVERRIDE;
1267 "symmetric"{Eq}"'YES'" |
1268 "symmetric"{Eq}"\"YES\"" A_surfxml_route_c_multi_symmetric = A_surfxml_route_c_multi_symmetric_YES;
1269 "symmetric"{Eq}"'NO'" |
1270 "symmetric"{Eq}"\"NO\"" A_surfxml_route_c_multi_symmetric = A_surfxml_route_c_multi_symmetric_NO;
1273 if (!AX_surfxml_route_c_multi_src) FAIL("Required attribute `src' not set for `route:multi' element.");
1274 if (!AX_surfxml_route_c_multi_dst) FAIL("Required attribute `dst' not set for `route:multi' element.");
1275 LEAVE; STag_surfxml_route_c_multi();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route_c_multi);
1277 "/>" FAIL("`route:multi' element cannot be empty.");
1278 . FAIL("Unexpected character `%c' in attribute list of route:multi element.", yytext[0]);
1279 {Name} FAIL("Bad attribute `%s' in `route:multi' element start tag.",yytext);
1280 <<EOF>> FAIL("EOF in attribute list of `route:multi' element.");
1283 <S_surfxml_route_c_multi_2,E_surfxml_route_c_multi>{
1284 "</route:multi"{s}">" {
1286 ETag_surfxml_route_c_multi();
1287 popbuffer(); /* attribute */
1289 case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
1292 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route:multi>' expected.",yytext);
1293 . FAIL("Unexpected character `%c': `</route:multi>' expected.",yytext[0]);
1294 <<EOF>> FAIL("Premature EOF: `</route:multi>' expected.");
1297 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_platform_3,S_surfxml_platform_4>"<route"{s} {
1298 AX_surfxml_route_src = 0;
1299 AX_surfxml_route_dst = 0;
1300 AX_surfxml_route_impact_on_src = 94;
1301 AX_surfxml_route_impact_on_dst = 98;
1302 AX_surfxml_route_impact_on_src_with_other_recv = 102;
1303 AX_surfxml_route_impact_on_dst_with_other_send = 106;
1304 AX_surfxml_route_action = A_surfxml_route_action_POSTPEND;
1305 ENTER(AL_surfxml_route); pushbuffer(0);
1309 "src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src);
1310 "src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src);
1312 "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst);
1313 "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst);
1315 "impact_on_src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src);
1316 "impact_on_src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src);
1318 "impact_on_dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst);
1319 "impact_on_dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst);
1321 "impact_on_src_with_other_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
1322 "impact_on_src_with_other_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
1324 "impact_on_dst_with_other_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
1325 "impact_on_dst_with_other_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
1327 "action"{Eq}"'POSTPEND'" |
1328 "action"{Eq}"\"POSTPEND\"" A_surfxml_route_action = A_surfxml_route_action_POSTPEND;
1329 "action"{Eq}"'PREPEND'" |
1330 "action"{Eq}"\"PREPEND\"" A_surfxml_route_action = A_surfxml_route_action_PREPEND;
1331 "action"{Eq}"'OVERRIDE'" |
1332 "action"{Eq}"\"OVERRIDE\"" A_surfxml_route_action = A_surfxml_route_action_OVERRIDE;
1335 if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
1336 if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
1337 LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route);
1340 if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
1341 if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
1342 LEAVE; STag_surfxml_route(); surfxml_pcdata_ix = 0; ETag_surfxml_route(); popbuffer(); /* attribute */
1344 case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
1347 . FAIL("Unexpected character `%c' in attribute list of route element.", yytext[0]);
1348 {Name} FAIL("Bad attribute `%s' in `route' element start tag.",yytext);
1349 <<EOF>> FAIL("EOF in attribute list of `route' element.");
1352 <S_surfxml_route,S_surfxml_route_2,E_surfxml_route>{
1355 ETag_surfxml_route();
1356 popbuffer(); /* attribute */
1358 case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
1361 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route>' expected.",yytext);
1362 . FAIL("Unexpected character `%c': `</route>' expected.",yytext[0]);
1363 <<EOF>> FAIL("Premature EOF: `</route>' expected.");
1366 <S_surfxml_route_1,S_surfxml_route,S_surfxml_route_2,S_surfxml_route_c_multi_2,S_surfxml_route_c_multi_1,S_surfxml_route_c_multi>"<link:ctn"{s} {
1367 AX_surfxml_link_c_ctn_id = 0;
1368 ENTER(AL_surfxml_link_c_ctn); pushbuffer(0);
1371 <AL_surfxml_link_c_ctn>{
1372 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_c_ctn_id);
1373 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_c_ctn_id);
1376 if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element.");
1377 LEAVE; STag_surfxml_link_c_ctn();surfxml_pcdata_ix = 0; ENTER(E_surfxml_link_c_ctn);
1380 if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element.");
1381 LEAVE; STag_surfxml_link_c_ctn(); surfxml_pcdata_ix = 0; ETag_surfxml_link_c_ctn(); popbuffer(); /* attribute */
1383 case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
1384 case S_surfxml_route_c_multi_2: case S_surfxml_route_c_multi_1: case S_surfxml_route_c_multi: SET(S_surfxml_route_c_multi_2); break;
1387 . FAIL("Unexpected character `%c' in attribute list of link:ctn element.", yytext[0]);
1388 {Name} FAIL("Bad attribute `%s' in `link:ctn' element start tag.",yytext);
1389 <<EOF>> FAIL("EOF in attribute list of `link:ctn' element.");
1392 <E_surfxml_link_c_ctn>{
1393 "</link:ctn"{s}">" {
1395 ETag_surfxml_link_c_ctn();
1396 popbuffer(); /* attribute */
1398 case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
1399 case S_surfxml_route_c_multi_2: case S_surfxml_route_c_multi_1: case S_surfxml_route_c_multi: SET(S_surfxml_route_c_multi_2); break;
1402 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link:ctn>' expected.",yytext);
1403 . FAIL("Unexpected character `%c': `</link:ctn>' expected.",yytext[0]);
1404 <<EOF>> FAIL("Premature EOF: `</link:ctn>' expected.");
1407 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_platform_3,S_surfxml_platform_4>"<process"{s} {
1408 AX_surfxml_process_host = 0;
1409 AX_surfxml_process_function = 0;
1410 AX_surfxml_process_start_time = 110;
1411 AX_surfxml_process_kill_time = 115;
1412 ENTER(AL_surfxml_process); pushbuffer(0);
1415 <AL_surfxml_process>{
1416 "host"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host);
1417 "host"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host);
1419 "function"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function);
1420 "function"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function);
1422 "start_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start_time);
1423 "start_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start_time);
1425 "kill_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill_time);
1426 "kill_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill_time);
1429 if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
1430 if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
1431 LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process);
1434 if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
1435 if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
1436 LEAVE; STag_surfxml_process(); surfxml_pcdata_ix = 0; ETag_surfxml_process(); popbuffer(); /* attribute */
1438 case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
1441 . FAIL("Unexpected character `%c' in attribute list of process element.", yytext[0]);
1442 {Name} FAIL("Bad attribute `%s' in `process' element start tag.",yytext);
1443 <<EOF>> FAIL("EOF in attribute list of `process' element.");
1446 <S_surfxml_process,E_surfxml_process,S_surfxml_process_2>{
1449 ETag_surfxml_process();
1450 popbuffer(); /* attribute */
1452 case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
1455 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</process>' expected.",yytext);
1456 . FAIL("Unexpected character `%c': `</process>' expected.",yytext[0]);
1457 <<EOF>> FAIL("Premature EOF: `</process>' expected.");
1460 <S_surfxml_process_1,S_surfxml_process,S_surfxml_process_2>"<argument"{s} {
1461 AX_surfxml_argument_value = 0;
1462 ENTER(AL_surfxml_argument); pushbuffer(0);
1465 <AL_surfxml_argument>{
1466 "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_argument_value);
1467 "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_argument_value);
1470 if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
1471 LEAVE; STag_surfxml_argument();surfxml_pcdata_ix = 0; ENTER(E_surfxml_argument);
1474 if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
1475 LEAVE; STag_surfxml_argument(); surfxml_pcdata_ix = 0; ETag_surfxml_argument(); popbuffer(); /* attribute */
1477 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1480 . FAIL("Unexpected character `%c' in attribute list of argument element.", yytext[0]);
1481 {Name} FAIL("Bad attribute `%s' in `argument' element start tag.",yytext);
1482 <<EOF>> FAIL("EOF in attribute list of `argument' element.");
1485 <E_surfxml_argument>{
1486 "</argument"{s}">" {
1488 ETag_surfxml_argument();
1489 popbuffer(); /* attribute */
1491 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1494 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</argument>' expected.",yytext);
1495 . FAIL("Unexpected character `%c': `</argument>' expected.",yytext[0]);
1496 <<EOF>> FAIL("Premature EOF: `</argument>' expected.");
1499 /* EPILOG: after the root element. */
1502 . {SET(PROLOG); yyless(0); CLEANUP; return -1;}
1506 /* CHARACTER DATA. */
1508 <IN_trace,VALUE1,VALUE2>{
1509 /* Non-defined standard entities... */
1510 "&" BUFFERPUTC('&');
1511 "<" BUFFERPUTC('<');
1512 ">" BUFFERPUTC('>');
1513 "'" BUFFERPUTC('\'');
1514 """ BUFFERPUTC('"');
1516 /* Character entities. */
1517 "&#"[[:digit:]]+";" BUFFERPUTC((unsigned char)atoi(yytext+2));
1518 "&#x"[[:xdigit:]]+";" BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
1521 <IN_trace,VALUE1,VALUE2,CDATA>{
1525 "\n\r" BUFFERPUTC('\n');
1529 "<![CDATA[" ENTER(CDATA);
1530 "]""]>" FAIL("Unexpected `]""]>' in character data.");
1534 \' BUFFERDONE; LEAVE;
1535 <<EOF>> FAIL("EOF in literal (\"'\" expected).");
1539 \" BUFFERDONE; LEAVE;
1540 <<EOF>> FAIL("EOF in literal (`\"' expected).");
1543 <IN_trace,VALUE1,VALUE2>{
1544 [^<&] BUFFERPUTC(yytext[0]);
1545 [<&] FAIL("Spurious `%c' in character data.",yytext[0]);
1550 /* "]""]" BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]); */
1551 . BUFFERPUTC(yytext[0]);
1552 <<EOF>> FAIL("EOF in CDATA section.");
1555 /* Impossible rules to avoid warnings from flex(1). */
1556 /* Ideally, this should be replaced by code in flexml.pl that
1557 generates just the states not covered by other rules. */
1559 .|[\n] FAIL("Syntax error on character `%c'.", yytext[0]);
1564 /* Element context stack lookup. */
1565 int surfxml_element_context(int i)
1567 return (0<i && i<yy_start_stack_depth
1568 ? yy_start_stack[yy_start_stack_ptr - i]
1573 void print_yy_stack(char* fmt, ...)
1575 int i = 0; va_list ap; va_start(ap, fmt);
1576 vfprintf(stderr, fmt, ap);
1577 if (surfxml_statenames) {
1578 for (i=1; i<yy_start_stack_ptr; i++) {
1579 fprintf(stderr, "%s/", surfxml_statenames[yy_start_stack[i] ]);
1581 fprintf(stderr,"%s\n", surfxml_statenames[YY_START]);
1586 void print_surfxml_bufferstack()
1589 fputs("Buffer: ", stderr);
1590 for (i = 0; i < blimit; i++) {
1591 if ( surfxml_bufferstack[i] == '\377' ) break;
1592 putc(surfxml_bufferstack[i], stderr);
1597 static void debug_enter(int state, const char* statename) {
1598 yy_push_state(state);
1599 if (yy_flex_debug) {
1600 print_yy_stack("--ENTER(%s) : ",statename);
1601 print_surfxml_bufferstack();
1605 static void debug_leave(void) {
1606 if (yy_flex_debug) {
1607 print_yy_stack("--LEAVE : ");
1608 print_surfxml_bufferstack();
1613 static void debug_set(int state, const char* statename) {
1615 if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename);
1620 static void cleanup(void)
1622 if (surfxml_statenames) {
1623 free(surfxml_statenames);
1624 surfxml_statenames = NULL;
1626 free(surfxml_bufferstack);
1627 surfxml_bufferstack = NULL;
1634 static int fail(const char* fmt, ...)
1636 int chars_left, used;
1637 va_list ap; va_start(ap, fmt);
1638 #ifdef FLEXML_yylineno
1639 used = sprintf(flexml_err_msg,
1640 "Invalid XML (XML input line %d, state %d): ",
1641 yylineno, YY_START);
1643 used = sprintf(flexml_err_msg,
1644 "Invalid XML (state %d): ",
1647 chars_left = flexml_max_err_msg_size - used - 1;
1648 vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
1651 #ifndef FLEXML_quiet_parser
1652 /* print directly to sdterr */
1653 fprintf(stderr, "%s\n", flexml_err_msg);
1654 flexml_err_msg[0] = '\0';