1 /* Validating XML processor for surf/surfxml.dtd.
2 * Generated 2007/10/31 10:34:28.
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_link_id AX_surfxml_link_id;
81 #define A_surfxml_link_id (surfxml_bufferstack + AX_surfxml_link_id)
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_link_latency_file AX_surfxml_link_latency_file;
89 #define A_surfxml_link_latency_file (surfxml_bufferstack + AX_surfxml_link_latency_file)
90 AT_surfxml_process_host AX_surfxml_process_host;
91 #define A_surfxml_process_host (surfxml_bufferstack + AX_surfxml_process_host)
92 AT_surfxml_host_availability_file AX_surfxml_host_availability_file;
93 #define A_surfxml_host_availability_file (surfxml_bufferstack + AX_surfxml_host_availability_file)
94 AT_surfxml_host_state AX_surfxml_host_state;
95 #define A_surfxml_host_state AX_surfxml_host_state
96 AT_surfxml_host_interference_send_recv AX_surfxml_host_interference_send_recv;
97 #define A_surfxml_host_interference_send_recv (surfxml_bufferstack + AX_surfxml_host_interference_send_recv)
98 AT_surfxml_route_impact_on_dst_with_other_send AX_surfxml_route_impact_on_dst_with_other_send;
99 #define A_surfxml_route_impact_on_dst_with_other_send (surfxml_bufferstack + AX_surfxml_route_impact_on_dst_with_other_send)
100 AT_surfxml_host_interference_send AX_surfxml_host_interference_send;
101 #define A_surfxml_host_interference_send (surfxml_bufferstack + AX_surfxml_host_interference_send)
102 AT_surfxml_route_impact_on_dst AX_surfxml_route_impact_on_dst;
103 #define A_surfxml_route_impact_on_dst (surfxml_bufferstack + AX_surfxml_route_impact_on_dst)
104 AT_surfxml_prop_value AX_surfxml_prop_value;
105 #define A_surfxml_prop_value (surfxml_bufferstack + AX_surfxml_prop_value)
106 AT_surfxml_route_impact_on_src_with_other_recv AX_surfxml_route_impact_on_src_with_other_recv;
107 #define A_surfxml_route_impact_on_src_with_other_recv (surfxml_bufferstack + AX_surfxml_route_impact_on_src_with_other_recv)
108 AT_surfxml_host_power AX_surfxml_host_power;
109 #define A_surfxml_host_power (surfxml_bufferstack + AX_surfxml_host_power)
110 AT_surfxml_link_state_file AX_surfxml_link_state_file;
111 #define A_surfxml_link_state_file (surfxml_bufferstack + AX_surfxml_link_state_file)
112 AT_surfxml_router_id AX_surfxml_router_id;
113 #define A_surfxml_router_id (surfxml_bufferstack + AX_surfxml_router_id)
114 AT_surfxml_process_start_time AX_surfxml_process_start_time;
115 #define A_surfxml_process_start_time (surfxml_bufferstack + AX_surfxml_process_start_time)
116 AT_surfxml_platform_xmlns_c_route AX_surfxml_platform_xmlns_c_route;
117 #define A_surfxml_platform_xmlns_c_route (surfxml_bufferstack + AX_surfxml_platform_xmlns_c_route)
118 AT_surfxml_process_function AX_surfxml_process_function;
119 #define A_surfxml_process_function (surfxml_bufferstack + AX_surfxml_process_function)
120 AT_surfxml_host_max_outgoing_rate AX_surfxml_host_max_outgoing_rate;
121 #define A_surfxml_host_max_outgoing_rate (surfxml_bufferstack + AX_surfxml_host_max_outgoing_rate)
122 AT_surfxml_link_sharing_policy AX_surfxml_link_sharing_policy;
123 #define A_surfxml_link_sharing_policy AX_surfxml_link_sharing_policy
124 AT_surfxml_link_c_ctn_id AX_surfxml_link_c_ctn_id;
125 #define A_surfxml_link_c_ctn_id (surfxml_bufferstack + AX_surfxml_link_c_ctn_id)
126 AT_surfxml_process_kill_time AX_surfxml_process_kill_time;
127 #define A_surfxml_process_kill_time (surfxml_bufferstack + AX_surfxml_process_kill_time)
128 AT_surfxml_host_availability AX_surfxml_host_availability;
129 #define A_surfxml_host_availability (surfxml_bufferstack + AX_surfxml_host_availability)
130 AT_surfxml_argument_value AX_surfxml_argument_value;
131 #define A_surfxml_argument_value (surfxml_bufferstack + AX_surfxml_argument_value)
132 AT_surfxml_link_state AX_surfxml_link_state;
133 #define A_surfxml_link_state AX_surfxml_link_state
134 AT_surfxml_route_src AX_surfxml_route_src;
135 #define A_surfxml_route_src (surfxml_bufferstack + AX_surfxml_route_src)
136 AT_surfxml_route_impact_on_src AX_surfxml_route_impact_on_src;
137 #define A_surfxml_route_impact_on_src (surfxml_bufferstack + AX_surfxml_route_impact_on_src)
138 AT_surfxml_link_bandwidth AX_surfxml_link_bandwidth;
139 #define A_surfxml_link_bandwidth (surfxml_bufferstack + AX_surfxml_link_bandwidth)
140 AT_surfxml_link_latency AX_surfxml_link_latency;
141 #define A_surfxml_link_latency (surfxml_bufferstack + AX_surfxml_link_latency)
142 AT_surfxml_platform_xmlns_c_link AX_surfxml_platform_xmlns_c_link;
143 #define A_surfxml_platform_xmlns_c_link (surfxml_bufferstack + AX_surfxml_platform_xmlns_c_link)
144 AT_surfxml_include_file AX_surfxml_include_file;
145 #define A_surfxml_include_file (surfxml_bufferstack + AX_surfxml_include_file)
146 AT_surfxml_link_bandwidth_file AX_surfxml_link_bandwidth_file;
147 #define A_surfxml_link_bandwidth_file (surfxml_bufferstack + AX_surfxml_link_bandwidth_file)
148 AT_surfxml_host_state_file AX_surfxml_host_state_file;
149 #define A_surfxml_host_state_file (surfxml_bufferstack + AX_surfxml_host_state_file)
150 AT_surfxml_route_dst AX_surfxml_route_dst;
151 #define A_surfxml_route_dst (surfxml_bufferstack + AX_surfxml_route_dst)
152 AT_surfxml_platform_version AX_surfxml_platform_version;
153 #define A_surfxml_platform_version (surfxml_bufferstack + AX_surfxml_platform_version)
157 # define ENTER(state) debug_enter(state,#state)
158 # define LEAVE debug_leave()
159 # define SET(state) debug_set(state,#state)
160 static void debug_enter(int, const char*);
161 static void debug_leave(void);
162 static void debug_set(int, const char*);
164 # define ENTER(state) (yy_push_state(state))
165 # define LEAVE (yy_pop_state())
166 # define SET(state) BEGIN(state)
169 /* Generic actions. */
170 #define SKIP /*skip*/
171 #define SUCCEED CLEANUP; return 0
173 #define FAIL return fail
174 static int fail(const char*, ...);
176 enum {flexml_max_err_msg_size = 512};
177 static char flexml_err_msg[flexml_max_err_msg_size];
178 const char * surfxml_parse_err_msg()
180 return flexml_err_msg;
182 static void reset_surfxml_parse_err_msg()
184 flexml_err_msg[0] = '\0';
188 static void cleanup(void);
189 #define CLEANUP cleanup()
191 /* Text buffer stack handling. */
192 char *surfxml_bufferstack = NULL;
193 static int blimit = FLEXML_BUFFERSTACKSIZE;
194 static int bnext = 1;
196 static int *indexstack = NULL;
197 static int ilimit = FLEXML_INDEXSTACKSIZE;
198 static int inext = 1;
200 #define BUFFERSET(P) (P = bnext)
201 #define BUFFERPUTC(C) (ck_blimit(), surfxml_bufferstack[bnext++] = (C))
202 #define BUFFERDONE (BUFFERPUTC('\0'))
204 #define BUFFERLITERAL(C, P) surfxml_bufferliteral(C, &(P), yytext)
206 /* after this is called, there are at least 2 slots left in the stack */
207 static int ck_blimit()
209 if (bnext >= blimit) {
210 blimit += FLEXML_BUFFERSTACKSIZE + 2;
212 char *temp = (char *) realloc(surfxml_bufferstack, blimit);
214 surfxml_bufferstack = temp;
220 /* after this is called, there are at least 2 slots left in the stack */
221 static int ck_ilimit()
223 if (inext >= ilimit) {
224 ilimit += FLEXML_INDEXSTACKSIZE + 2;
226 int *temp = (int *) realloc(indexstack, ilimit);
234 #ifdef FLEXML_NEED_BUFFERLIT
235 static void surfxml_bufferliteral(char c, int* pp, const char* text)
237 const char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c);
238 assert(s <= e); BUFFERSET(*pp);
240 if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
247 static void pushbuffer(int p)
250 indexstack[inext++] = p;
251 indexstack[inext++] = bnext;
254 static int popbuffer(void)
257 bnext = indexstack[--inext];
258 return indexstack[--inext];
261 /* General internal entities are `unput' back onto the input stream... */
262 #define ENTITYTEXT(T) \
263 { char *s = (T), *e = s+strlen(s);\
264 while (--e >= s) { unput(*e); }}
269 /* Flex standard options. */
271 %option noyy_top_state
277 /* Flex user-requested options. */
281 /* XML character classes (currently restricted to ASCII). */
283 /* "Common syntactic structures." */
287 /* "Names and Tokens." */
288 NameChar [A-Za-z0-9.:_-]
289 Name [A-Za-z_:]{NameChar}*
290 Names {Name}({S}{Name})*
291 Nmtoken ({NameChar})+
292 Nmtokens {Nmtoken}({S}{Nmtoken})*
295 VersionNum [a-zA-Z0-9_.:-]+
297 Literal \'[^'']*\'|\"[^""]*\"
299 /* Parser states (flex `exclusive start conditions'):
301 * PROLOG the XML prolog of the document before <?xml...>
302 * DOCTYPE the XML prolog of the document after <?xml...>
303 * EPILOG after the root element
304 * INCOMMENT inside an XML comment <!--....-->
305 * INPI inside an XML PI <?...?>
306 * VALUE1 inside a '...'-delimited literal
307 * VALUE2 inside a "..."-delimited literal
308 * CDATA inside a <![CDATA[...] ]> section.
309 * ROOT_<tag> expect root element <tag>
310 * AL_<tag> inside the attribute list for <tag>
311 * IN_<tag> inside a <tag> with element contents (ready for end tag)
312 * IMPOSSIBLE dummy to permit disabling rules; must be last
314 %x PROLOG DOCTYPE EPILOG INCOMMENT INPI VALUE1 VALUE2 CDATA
315 %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
316 %x ROOT_surfxml_include AL_surfxml_include E_surfxml_include
317 %x ROOT_surfxml_host AL_surfxml_host S_surfxml_host S_surfxml_host_1 S_surfxml_host_2 E_surfxml_host
318 %x ROOT_surfxml_prop AL_surfxml_prop E_surfxml_prop
319 %x ROOT_surfxml_router AL_surfxml_router E_surfxml_router
320 %x ROOT_surfxml_link AL_surfxml_link S_surfxml_link S_surfxml_link_1 S_surfxml_link_2 E_surfxml_link
321 %x ROOT_surfxml_route AL_surfxml_route S_surfxml_route S_surfxml_route_1 S_surfxml_route_2 E_surfxml_route
322 %x ROOT_surfxml_link_c_ctn AL_surfxml_link_c_ctn E_surfxml_link_c_ctn
323 %x ROOT_surfxml_process AL_surfxml_process S_surfxml_process S_surfxml_process_1 S_surfxml_process_2 E_surfxml_process
324 %x ROOT_surfxml_argument AL_surfxml_argument E_surfxml_argument
329 const char* *surfxml_statenames=NULL;
334 /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
336 reset_surfxml_parse_err_msg();
337 surfxml_bufferstack = (char *) malloc(FLEXML_BUFFERSTACKSIZE);
338 assert(surfxml_bufferstack);
342 for (i = 0; i < blimit; i++) {
343 surfxml_bufferstack[i] = '\377';
347 surfxml_bufferstack[0] = '\0';
348 indexstack = (int *) malloc(FLEXML_INDEXSTACKSIZE * sizeof(int));
354 surfxml_bufferliteral('\0', &bnext, "0.0");
355 surfxml_bufferliteral('\0', &bnext, "http://simgrid.gforge.inria.fr/");
356 surfxml_bufferliteral('\0', &bnext, "http://simgrid.gforge.inria.fr/");
357 surfxml_bufferliteral('\0', &bnext, "1.0");
358 surfxml_bufferliteral('\0', &bnext, "1.0");
359 surfxml_bufferliteral('\0', &bnext, "1.0");
360 surfxml_bufferliteral('\0', &bnext, "1.0");
361 surfxml_bufferliteral('\0', &bnext, "-1.0");
362 surfxml_bufferliteral('\0', &bnext, "0.0");
363 surfxml_bufferliteral('\0', &bnext, "0.0");
364 surfxml_bufferliteral('\0', &bnext, "0.0");
365 surfxml_bufferliteral('\0', &bnext, "0.0");
366 surfxml_bufferliteral('\0', &bnext, "0.0");
367 surfxml_bufferliteral('\0', &bnext, "-1.0");
368 surfxml_bufferliteral('\0', &bnext, "-1.0");
369 if(!surfxml_statenames) {surfxml_statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*));
370 surfxml_statenames[PROLOG] = NULL;
371 surfxml_statenames[DOCTYPE] = NULL;
372 surfxml_statenames[EPILOG] = NULL;
373 surfxml_statenames[INCOMMENT] = NULL;
374 surfxml_statenames[INPI] = NULL;
375 surfxml_statenames[VALUE1] = NULL;
376 surfxml_statenames[VALUE2] = NULL;
377 surfxml_statenames[CDATA] = NULL;
378 surfxml_statenames[ROOT_surfxml_platform] = NULL;
379 surfxml_statenames[AL_surfxml_platform] = NULL;
380 surfxml_statenames[S_surfxml_platform] = "platform";
381 surfxml_statenames[S_surfxml_platform_1] = "platform";
382 surfxml_statenames[S_surfxml_platform_2] = "platform";
383 surfxml_statenames[S_surfxml_platform_3] = "platform";
384 surfxml_statenames[S_surfxml_platform_4] = "platform";
385 surfxml_statenames[S_surfxml_platform_5] = "platform";
386 surfxml_statenames[E_surfxml_platform] = "platform";
387 surfxml_statenames[ROOT_surfxml_include] = NULL;
388 surfxml_statenames[AL_surfxml_include] = NULL;
389 surfxml_statenames[E_surfxml_include] = "include";
390 surfxml_statenames[ROOT_surfxml_host] = NULL;
391 surfxml_statenames[AL_surfxml_host] = NULL;
392 surfxml_statenames[S_surfxml_host] = "host";
393 surfxml_statenames[S_surfxml_host_1] = "host";
394 surfxml_statenames[S_surfxml_host_2] = "host";
395 surfxml_statenames[E_surfxml_host] = "host";
396 surfxml_statenames[ROOT_surfxml_prop] = NULL;
397 surfxml_statenames[AL_surfxml_prop] = NULL;
398 surfxml_statenames[E_surfxml_prop] = "prop";
399 surfxml_statenames[ROOT_surfxml_router] = NULL;
400 surfxml_statenames[AL_surfxml_router] = NULL;
401 surfxml_statenames[E_surfxml_router] = "router";
402 surfxml_statenames[ROOT_surfxml_link] = NULL;
403 surfxml_statenames[AL_surfxml_link] = NULL;
404 surfxml_statenames[S_surfxml_link] = "link";
405 surfxml_statenames[S_surfxml_link_1] = "link";
406 surfxml_statenames[S_surfxml_link_2] = "link";
407 surfxml_statenames[E_surfxml_link] = "link";
408 surfxml_statenames[ROOT_surfxml_route] = NULL;
409 surfxml_statenames[AL_surfxml_route] = NULL;
410 surfxml_statenames[S_surfxml_route] = "route";
411 surfxml_statenames[S_surfxml_route_1] = "route";
412 surfxml_statenames[S_surfxml_route_2] = "route";
413 surfxml_statenames[E_surfxml_route] = "route";
414 surfxml_statenames[ROOT_surfxml_link_c_ctn] = NULL;
415 surfxml_statenames[AL_surfxml_link_c_ctn] = NULL;
416 surfxml_statenames[E_surfxml_link_c_ctn] = "link:ctn";
417 surfxml_statenames[ROOT_surfxml_process] = NULL;
418 surfxml_statenames[AL_surfxml_process] = NULL;
419 surfxml_statenames[S_surfxml_process] = "process";
420 surfxml_statenames[S_surfxml_process_1] = "process";
421 surfxml_statenames[S_surfxml_process_2] = "process";
422 surfxml_statenames[E_surfxml_process] = "process";
423 surfxml_statenames[ROOT_surfxml_argument] = NULL;
424 surfxml_statenames[AL_surfxml_argument] = NULL;
425 surfxml_statenames[E_surfxml_argument] = "argument";
428 /* COMMENTS and PIs: handled uniformly for efficiency. */
430 <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,ROOT_surfxml_include,AL_surfxml_include,E_surfxml_include,ROOT_surfxml_host,AL_surfxml_host,S_surfxml_host,S_surfxml_host_1,S_surfxml_host_2,E_surfxml_host,ROOT_surfxml_prop,AL_surfxml_prop,E_surfxml_prop,ROOT_surfxml_router,AL_surfxml_router,E_surfxml_router,ROOT_surfxml_link,AL_surfxml_link,S_surfxml_link,S_surfxml_link_1,S_surfxml_link_2,E_surfxml_link,ROOT_surfxml_route,AL_surfxml_route,S_surfxml_route,S_surfxml_route_1,S_surfxml_route_2,E_surfxml_route,ROOT_surfxml_link_c_ctn,AL_surfxml_link_c_ctn,E_surfxml_link_c_ctn,ROOT_surfxml_process,AL_surfxml_process,S_surfxml_process,S_surfxml_process_1,S_surfxml_process_2,E_surfxml_process,ROOT_surfxml_argument,AL_surfxml_argument,E_surfxml_argument,PROLOG,DOCTYPE,EPILOG>{
431 "<!--" ENTER(INCOMMENT);
439 <<EOF>> FAIL("EOF in comment.");
445 <<EOF>> FAIL("EOF in PI (processing instruction).");
448 /* SPACES: skipped uniformly */
450 <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,ROOT_surfxml_include,AL_surfxml_include,E_surfxml_include,ROOT_surfxml_host,AL_surfxml_host,S_surfxml_host,S_surfxml_host_1,S_surfxml_host_2,E_surfxml_host,ROOT_surfxml_prop,AL_surfxml_prop,E_surfxml_prop,ROOT_surfxml_router,AL_surfxml_router,E_surfxml_router,ROOT_surfxml_link,AL_surfxml_link,S_surfxml_link,S_surfxml_link_1,S_surfxml_link_2,E_surfxml_link,ROOT_surfxml_route,AL_surfxml_route,S_surfxml_route,S_surfxml_route_1,S_surfxml_route_2,E_surfxml_route,ROOT_surfxml_link_c_ctn,AL_surfxml_link_c_ctn,E_surfxml_link_c_ctn,ROOT_surfxml_process,AL_surfxml_process,S_surfxml_process,S_surfxml_process_1,S_surfxml_process_2,E_surfxml_process,ROOT_surfxml_argument,AL_surfxml_argument,E_surfxml_argument,PROLOG,DOCTYPE,EPILOG>{S} SKIP;
452 /* PROLOG: determine root element and process it. */
455 "<?xml"({S}version{Eq}(\'{VersionNum}\'|\"{VersionNum}\"))?({S}encoding{Eq}(\'[^']*\'|\"[^"]*\"))?"?>" SET(DOCTYPE);
456 "<?xml"[^>]*">" FAIL("Bad declaration %s.",yytext);
460 "<!DOCTYPE"{S}"link"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_link);
461 "<!DOCTYPE"{S}"include"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_include);
462 "<!DOCTYPE"{S}"route"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_route);
463 "<!DOCTYPE"{S}"process"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_process);
464 "<!DOCTYPE"{S}"link:ctn"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_link_c_ctn);
465 "<!DOCTYPE"{S}"router"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_router);
466 "<!DOCTYPE"{S}"host"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_host);
467 "<!DOCTYPE"{S}"argument"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_argument);
468 "<!DOCTYPE"{S}"prop"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_prop);
469 "<!DOCTYPE"{S}"platform"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_platform);
470 "<!"[^>-][^>]*">" FAIL("Bad declaration %s.",yytext);
471 . FAIL("Unexpected character `%c' in prolog.", yytext[0]);
472 <<EOF>> FAIL("EOF in prolog.");
475 /* RULES DERIVED FROM DTD. */
477 /* <!-- Small DTD for SURF based tools. --> */
479 <ROOT_surfxml_platform>"<platform"{s} {
480 AX_surfxml_platform_version = 1;
481 AX_surfxml_platform_xmlns_c_link = 5;
482 AX_surfxml_platform_xmlns_c_route = 37;
483 ENTER(AL_surfxml_platform); pushbuffer(0);
486 <AL_surfxml_platform>{
487 "version"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_version);
488 "version"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_version);
490 "xmlns:link"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_xmlns_c_link);
491 "xmlns:link"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_xmlns_c_link);
493 "xmlns:route"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_xmlns_c_route);
494 "xmlns:route"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_xmlns_c_route);
497 LEAVE; STag_surfxml_platform();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform);
500 LEAVE; STag_surfxml_platform(); surfxml_pcdata_ix = 0; ETag_surfxml_platform(); popbuffer(); /* attribute */
502 case ROOT_surfxml_platform: SET(EPILOG); break;
505 . FAIL("Unexpected character `%c' in attribute list of platform element.", yytext[0]);
506 {Name} FAIL("Bad attribute `%s' in `platform' element start tag.",yytext);
507 <<EOF>> FAIL("EOF in attribute list of `platform' element.");
510 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform_3,S_surfxml_platform,E_surfxml_platform>{
513 ETag_surfxml_platform();
514 popbuffer(); /* attribute */
516 case ROOT_surfxml_platform: SET(EPILOG); break;
519 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</platform>' expected.",yytext);
520 . FAIL("Unexpected character `%c': `</platform>' expected.",yytext[0]);
521 <<EOF>> FAIL("Premature EOF: `</platform>' expected.");
524 <ROOT_surfxml_include,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} {
525 AX_surfxml_include_file = 0;
526 ENTER(AL_surfxml_include); pushbuffer(0);
529 <AL_surfxml_include>{
530 "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_include_file);
531 "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_include_file);
534 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
535 LEAVE; STag_surfxml_include();surfxml_pcdata_ix = 0; ENTER(E_surfxml_include);
538 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
539 LEAVE; STag_surfxml_include(); surfxml_pcdata_ix = 0; ETag_surfxml_include(); popbuffer(); /* attribute */
541 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;
542 case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
543 case ROOT_surfxml_include: SET(EPILOG); break;
546 . FAIL("Unexpected character `%c' in attribute list of include element.", yytext[0]);
547 {Name} FAIL("Bad attribute `%s' in `include' element start tag.",yytext);
548 <<EOF>> FAIL("EOF in attribute list of `include' element.");
554 ETag_surfxml_include();
555 popbuffer(); /* attribute */
557 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;
558 case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
559 case ROOT_surfxml_include: SET(EPILOG); break;
562 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</include>' expected.",yytext);
563 . FAIL("Unexpected character `%c': `</include>' expected.",yytext[0]);
564 <<EOF>> FAIL("Premature EOF: `</include>' expected.");
567 <ROOT_surfxml_host,S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<host"{s} {
568 AX_surfxml_host_id = 0;
569 AX_surfxml_host_power = 0;
570 AX_surfxml_host_availability = 69;
571 AX_surfxml_host_availability_file = 0;
572 AX_surfxml_host_state = A_surfxml_host_state_ON;
573 AX_surfxml_host_state_file = 0;
574 AX_surfxml_host_interference_send = 73;
575 AX_surfxml_host_interference_recv = 77;
576 AX_surfxml_host_interference_send_recv = 81;
577 AX_surfxml_host_max_outgoing_rate = 85;
578 ENTER(AL_surfxml_host); pushbuffer(0);
582 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_id);
583 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_id);
585 "power"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_power);
586 "power"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_power);
588 "availability"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability);
589 "availability"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability);
591 "availability_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability_file);
592 "availability_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability_file);
595 "state"{Eq}"\"ON\"" A_surfxml_host_state = A_surfxml_host_state_ON;
597 "state"{Eq}"\"OFF\"" A_surfxml_host_state = A_surfxml_host_state_OFF;
599 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_state_file);
600 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_state_file);
602 "interference_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send);
603 "interference_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send);
605 "interference_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_recv);
606 "interference_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_recv);
608 "interference_send_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send_recv);
609 "interference_send_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send_recv);
611 "max_outgoing_rate"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_max_outgoing_rate);
612 "max_outgoing_rate"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_max_outgoing_rate);
615 if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
616 if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element.");
617 LEAVE; STag_surfxml_host();surfxml_pcdata_ix = 0; ENTER(S_surfxml_host);
620 if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
621 if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element.");
622 LEAVE; STag_surfxml_host(); surfxml_pcdata_ix = 0; ETag_surfxml_host(); popbuffer(); /* attribute */
624 case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
625 case ROOT_surfxml_host: SET(EPILOG); break;
628 . FAIL("Unexpected character `%c' in attribute list of host element.", yytext[0]);
629 {Name} FAIL("Bad attribute `%s' in `host' element start tag.",yytext);
630 <<EOF>> FAIL("EOF in attribute list of `host' element.");
633 <S_surfxml_host,E_surfxml_host,S_surfxml_host_2>{
637 popbuffer(); /* attribute */
639 case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
640 case ROOT_surfxml_host: SET(EPILOG); break;
643 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</host>' expected.",yytext);
644 . FAIL("Unexpected character `%c': `</host>' expected.",yytext[0]);
645 <<EOF>> FAIL("Premature EOF: `</host>' expected.");
648 <ROOT_surfxml_prop,S_surfxml_host,S_surfxml_link_1,S_surfxml_link_2,S_surfxml_host_1,S_surfxml_link,S_surfxml_process_1,S_surfxml_process,S_surfxml_process_2,S_surfxml_host_2>"<prop"{s} {
649 AX_surfxml_prop_id = 0;
650 AX_surfxml_prop_value = 0;
651 ENTER(AL_surfxml_prop); pushbuffer(0);
655 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_id);
656 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_id);
658 "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_value);
659 "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_value);
662 if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
663 if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element.");
664 LEAVE; STag_surfxml_prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_prop);
667 if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
668 if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element.");
669 LEAVE; STag_surfxml_prop(); surfxml_pcdata_ix = 0; ETag_surfxml_prop(); popbuffer(); /* attribute */
671 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
672 case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
673 case ROOT_surfxml_prop: SET(EPILOG); break;
674 case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
677 . FAIL("Unexpected character `%c' in attribute list of prop element.", yytext[0]);
678 {Name} FAIL("Bad attribute `%s' in `prop' element start tag.",yytext);
679 <<EOF>> FAIL("EOF in attribute list of `prop' element.");
686 popbuffer(); /* attribute */
688 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
689 case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
690 case ROOT_surfxml_prop: SET(EPILOG); break;
691 case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
694 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</prop>' expected.",yytext);
695 . FAIL("Unexpected character `%c': `</prop>' expected.",yytext[0]);
696 <<EOF>> FAIL("Premature EOF: `</prop>' expected.");
699 <ROOT_surfxml_router,S_surfxml_platform_2,S_surfxml_platform,S_surfxml_platform_3>"<router"{s} {
700 AX_surfxml_router_id = 0;
701 ENTER(AL_surfxml_router); pushbuffer(0);
705 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_router_id);
706 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_router_id);
709 if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
710 LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router);
713 if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
714 LEAVE; STag_surfxml_router(); surfxml_pcdata_ix = 0; ETag_surfxml_router(); popbuffer(); /* attribute */
716 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
717 case ROOT_surfxml_router: SET(EPILOG); break;
720 . FAIL("Unexpected character `%c' in attribute list of router element.", yytext[0]);
721 {Name} FAIL("Bad attribute `%s' in `router' element start tag.",yytext);
722 <<EOF>> FAIL("EOF in attribute list of `router' element.");
728 ETag_surfxml_router();
729 popbuffer(); /* attribute */
731 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
732 case ROOT_surfxml_router: SET(EPILOG); break;
735 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</router>' expected.",yytext);
736 . FAIL("Unexpected character `%c': `</router>' expected.",yytext[0]);
737 <<EOF>> FAIL("Premature EOF: `</router>' expected.");
740 <ROOT_surfxml_link,S_surfxml_platform_2,S_surfxml_platform,S_surfxml_platform_3>"<link"{s} {
741 AX_surfxml_link_id = 0;
742 AX_surfxml_link_bandwidth = 0;
743 AX_surfxml_link_bandwidth_file = 0;
744 AX_surfxml_link_latency = 90;
745 AX_surfxml_link_latency_file = 0;
746 AX_surfxml_link_state = A_surfxml_link_state_ON;
747 AX_surfxml_link_state_file = 0;
748 AX_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
749 ENTER(AL_surfxml_link); pushbuffer(0);
753 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_id);
754 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_id);
756 "bandwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth);
757 "bandwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth);
759 "bandwidth_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth_file);
760 "bandwidth_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth_file);
762 "latency"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency);
763 "latency"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency);
765 "latency_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency_file);
766 "latency_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency_file);
769 "state"{Eq}"\"ON\"" A_surfxml_link_state = A_surfxml_link_state_ON;
771 "state"{Eq}"\"OFF\"" A_surfxml_link_state = A_surfxml_link_state_OFF;
773 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_state_file);
774 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_state_file);
776 "sharing_policy"{Eq}"'SHARED'" |
777 "sharing_policy"{Eq}"\"SHARED\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
778 "sharing_policy"{Eq}"'FATPIPE'" |
779 "sharing_policy"{Eq}"\"FATPIPE\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FATPIPE;
782 if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
783 if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
784 LEAVE; STag_surfxml_link();surfxml_pcdata_ix = 0; ENTER(S_surfxml_link);
787 if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
788 if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
789 LEAVE; STag_surfxml_link(); surfxml_pcdata_ix = 0; ETag_surfxml_link(); popbuffer(); /* attribute */
791 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
792 case ROOT_surfxml_link: SET(EPILOG); break;
795 . FAIL("Unexpected character `%c' in attribute list of link element.", yytext[0]);
796 {Name} FAIL("Bad attribute `%s' in `link' element start tag.",yytext);
797 <<EOF>> FAIL("EOF in attribute list of `link' element.");
800 <S_surfxml_link_2,E_surfxml_link,S_surfxml_link>{
804 popbuffer(); /* attribute */
806 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
807 case ROOT_surfxml_link: SET(EPILOG); break;
810 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link>' expected.",yytext);
811 . FAIL("Unexpected character `%c': `</link>' expected.",yytext[0]);
812 <<EOF>> FAIL("Premature EOF: `</link>' expected.");
815 <ROOT_surfxml_route,S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_platform_3,S_surfxml_platform_4>"<route"{s} {
816 AX_surfxml_route_src = 0;
817 AX_surfxml_route_dst = 0;
818 AX_surfxml_route_impact_on_src = 94;
819 AX_surfxml_route_impact_on_dst = 98;
820 AX_surfxml_route_impact_on_src_with_other_recv = 102;
821 AX_surfxml_route_impact_on_dst_with_other_send = 106;
822 ENTER(AL_surfxml_route); pushbuffer(0);
826 "src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src);
827 "src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src);
829 "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst);
830 "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst);
832 "impact_on_src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src);
833 "impact_on_src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src);
835 "impact_on_dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst);
836 "impact_on_dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst);
838 "impact_on_src_with_other_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
839 "impact_on_src_with_other_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
841 "impact_on_dst_with_other_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
842 "impact_on_dst_with_other_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
845 if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
846 if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
847 LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route);
850 if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
851 if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
852 LEAVE; STag_surfxml_route(); surfxml_pcdata_ix = 0; ETag_surfxml_route(); popbuffer(); /* attribute */
854 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;
855 case ROOT_surfxml_route: SET(EPILOG); break;
858 . FAIL("Unexpected character `%c' in attribute list of route element.", yytext[0]);
859 {Name} FAIL("Bad attribute `%s' in `route' element start tag.",yytext);
860 <<EOF>> FAIL("EOF in attribute list of `route' element.");
863 <S_surfxml_route,S_surfxml_route_2,E_surfxml_route>{
866 ETag_surfxml_route();
867 popbuffer(); /* attribute */
869 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;
870 case ROOT_surfxml_route: SET(EPILOG); break;
873 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route>' expected.",yytext);
874 . FAIL("Unexpected character `%c': `</route>' expected.",yytext[0]);
875 <<EOF>> FAIL("Premature EOF: `</route>' expected.");
878 <ROOT_surfxml_link_c_ctn,S_surfxml_route_1,S_surfxml_route,S_surfxml_route_2>"<link:ctn"{s} {
879 AX_surfxml_link_c_ctn_id = 0;
880 ENTER(AL_surfxml_link_c_ctn); pushbuffer(0);
883 <AL_surfxml_link_c_ctn>{
884 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_c_ctn_id);
885 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_c_ctn_id);
888 if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element.");
889 LEAVE; STag_surfxml_link_c_ctn();surfxml_pcdata_ix = 0; ENTER(E_surfxml_link_c_ctn);
892 if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element.");
893 LEAVE; STag_surfxml_link_c_ctn(); surfxml_pcdata_ix = 0; ETag_surfxml_link_c_ctn(); popbuffer(); /* attribute */
895 case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
896 case ROOT_surfxml_link_c_ctn: SET(EPILOG); break;
899 . FAIL("Unexpected character `%c' in attribute list of link:ctn element.", yytext[0]);
900 {Name} FAIL("Bad attribute `%s' in `link:ctn' element start tag.",yytext);
901 <<EOF>> FAIL("EOF in attribute list of `link:ctn' element.");
904 <E_surfxml_link_c_ctn>{
907 ETag_surfxml_link_c_ctn();
908 popbuffer(); /* attribute */
910 case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
911 case ROOT_surfxml_link_c_ctn: SET(EPILOG); break;
914 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link:ctn>' expected.",yytext);
915 . FAIL("Unexpected character `%c': `</link:ctn>' expected.",yytext[0]);
916 <<EOF>> FAIL("Premature EOF: `</link:ctn>' expected.");
919 <ROOT_surfxml_process,S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_platform_3,S_surfxml_platform_4>"<process"{s} {
920 AX_surfxml_process_host = 0;
921 AX_surfxml_process_function = 0;
922 AX_surfxml_process_start_time = 110;
923 AX_surfxml_process_kill_time = 115;
924 ENTER(AL_surfxml_process); pushbuffer(0);
927 <AL_surfxml_process>{
928 "host"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host);
929 "host"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host);
931 "function"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function);
932 "function"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function);
934 "start_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start_time);
935 "start_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start_time);
937 "kill_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill_time);
938 "kill_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill_time);
941 if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
942 if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
943 LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process);
946 if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
947 if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
948 LEAVE; STag_surfxml_process(); surfxml_pcdata_ix = 0; ETag_surfxml_process(); popbuffer(); /* attribute */
950 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;
951 case ROOT_surfxml_process: SET(EPILOG); break;
954 . FAIL("Unexpected character `%c' in attribute list of process element.", yytext[0]);
955 {Name} FAIL("Bad attribute `%s' in `process' element start tag.",yytext);
956 <<EOF>> FAIL("EOF in attribute list of `process' element.");
959 <S_surfxml_process,E_surfxml_process,S_surfxml_process_2>{
962 ETag_surfxml_process();
963 popbuffer(); /* attribute */
965 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;
966 case ROOT_surfxml_process: SET(EPILOG); break;
969 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</process>' expected.",yytext);
970 . FAIL("Unexpected character `%c': `</process>' expected.",yytext[0]);
971 <<EOF>> FAIL("Premature EOF: `</process>' expected.");
974 <ROOT_surfxml_argument,S_surfxml_process_1,S_surfxml_process,S_surfxml_process_2>"<argument"{s} {
975 AX_surfxml_argument_value = 0;
976 ENTER(AL_surfxml_argument); pushbuffer(0);
979 <AL_surfxml_argument>{
980 "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_argument_value);
981 "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_argument_value);
984 if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
985 LEAVE; STag_surfxml_argument();surfxml_pcdata_ix = 0; ENTER(E_surfxml_argument);
988 if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
989 LEAVE; STag_surfxml_argument(); surfxml_pcdata_ix = 0; ETag_surfxml_argument(); popbuffer(); /* attribute */
991 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
992 case ROOT_surfxml_argument: SET(EPILOG); break;
995 . FAIL("Unexpected character `%c' in attribute list of argument element.", yytext[0]);
996 {Name} FAIL("Bad attribute `%s' in `argument' element start tag.",yytext);
997 <<EOF>> FAIL("EOF in attribute list of `argument' element.");
1000 <E_surfxml_argument>{
1001 "</argument"{s}">" {
1003 ETag_surfxml_argument();
1004 popbuffer(); /* attribute */
1006 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1007 case ROOT_surfxml_argument: SET(EPILOG); break;
1010 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</argument>' expected.",yytext);
1011 . FAIL("Unexpected character `%c': `</argument>' expected.",yytext[0]);
1012 <<EOF>> FAIL("Premature EOF: `</argument>' expected.");
1015 /* EPILOG: after the root element. */
1018 . {SET(PROLOG); yyless(0); CLEANUP; return -1;}
1022 /* CHARACTER DATA. */
1024 <IMPOSSIBLE,VALUE1,VALUE2>{
1025 /* Non-defined standard entities... */
1026 "&" BUFFERPUTC('&');
1027 "<" BUFFERPUTC('<');
1028 ">" BUFFERPUTC('>');
1029 "'" BUFFERPUTC('\'');
1030 """ BUFFERPUTC('"');
1032 /* Character entities. */
1033 "&#"[[:digit:]]+";" BUFFERPUTC((unsigned char)atoi(yytext+2));
1034 "&#x"[[:xdigit:]]+";" BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
1037 <IMPOSSIBLE,VALUE1,VALUE2,CDATA>{
1041 "\n\r" BUFFERPUTC('\n');
1045 "<![CDATA[" ENTER(CDATA);
1046 "]""]>" FAIL("Unexpected `]""]>' in character data.");
1050 \' BUFFERDONE; LEAVE;
1051 <<EOF>> FAIL("EOF in literal (\"'\" expected).");
1055 \" BUFFERDONE; LEAVE;
1056 <<EOF>> FAIL("EOF in literal (`\"' expected).");
1059 <IMPOSSIBLE,VALUE1,VALUE2>{
1060 [^<&] BUFFERPUTC(yytext[0]);
1061 [<&] FAIL("Spurious `%c' in character data.",yytext[0]);
1066 /* "]""]" BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]); */
1067 . BUFFERPUTC(yytext[0]);
1068 <<EOF>> FAIL("EOF in CDATA section.");
1071 /* Impossible rules to avoid warnings from flex(1). */
1072 /* Ideally, this should be replaced by code in flexml.pl that
1073 generates just the states not covered by other rules. */
1075 .|[\n] FAIL("Syntax error on character `%c'.", yytext[0]);
1080 /* Element context stack lookup. */
1081 int surfxml_element_context(int i)
1083 return (0<i && i<yy_start_stack_depth
1084 ? yy_start_stack[yy_start_stack_ptr - i]
1089 void print_yy_stack(char* fmt, ...)
1091 int i = 0; va_list ap; va_start(ap, fmt);
1092 vfprintf(stderr, fmt, ap);
1093 if (surfxml_statenames) {
1094 for (i=1; i<yy_start_stack_ptr; i++) {
1095 fprintf(stderr, "%s/", surfxml_statenames[yy_start_stack[i] ]);
1097 fprintf(stderr,"%s\n", surfxml_statenames[YY_START]);
1102 void print_surfxml_bufferstack()
1105 fputs("Buffer: ", stderr);
1106 for (i = 0; i < blimit; i++) {
1107 if ( surfxml_bufferstack[i] == '\377' ) break;
1108 putc(surfxml_bufferstack[i], stderr);
1113 static void debug_enter(int state, const char* statename) {
1114 yy_push_state(state);
1115 if (yy_flex_debug) {
1116 print_yy_stack("--ENTER(%s) : ",statename);
1117 print_surfxml_bufferstack();
1121 static void debug_leave(void) {
1122 if (yy_flex_debug) {
1123 print_yy_stack("--LEAVE : ");
1124 print_surfxml_bufferstack();
1129 static void debug_set(int state, const char* statename) {
1131 if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename);
1136 static void cleanup(void)
1138 if (surfxml_statenames) {
1139 free(surfxml_statenames);
1140 surfxml_statenames = NULL;
1142 free(surfxml_bufferstack);
1143 surfxml_bufferstack = NULL;
1150 static int fail(const char* fmt, ...)
1152 int chars_left, used;
1153 va_list ap; va_start(ap, fmt);
1154 #ifdef FLEXML_yylineno
1155 used = sprintf(flexml_err_msg,
1156 "Invalid XML (XML input line %d, state %d): ",
1157 yylineno, YY_START);
1159 used = sprintf(flexml_err_msg,
1160 "Invalid XML (state %d): ",
1163 chars_left = flexml_max_err_msg_size - used - 1;
1164 vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
1167 #ifndef FLEXML_quiet_parser
1168 /* print directly to sdterr */
1169 fprintf(stderr, "%s\n", flexml_err_msg);
1170 flexml_err_msg[0] = '\0';