1 /* Validating XML processor for surf/surfxml.dtd.
2 * Generated 2007/11/08 11:56:22.
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.63 2007/10/11 14:46:08 mquinson 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.40 2007/10/11 09:57:24 mquinson Exp $";
53 const char rcs_surfxml_flexml[] =
54 "$" "Id: flexml.pl,v 1.63 2007/10/11 14:46:08 mquinson Exp $";
57 #include <stdlib.h> /* for realloc() -- needed here when using flex 2.5.4 */
64 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
65 # ifndef __STRICT_ANSI__
73 #ifndef FLEXML_INDEXSTACKSIZE
74 #define FLEXML_INDEXSTACKSIZE 1000
77 /* Generated definitions. */
78 #define FLEXML_yylineno
79 #ifndef FLEXML_BUFFERSTACKSIZE
80 #define FLEXML_BUFFERSTACKSIZE 1000000
82 #define FLEXML_NEED_BUFFERLIT
84 /* XML processor api. */
85 /* FleXML-provided data. */
86 int surfxml_pcdata_ix;
87 extern char *surfxml_bufferstack;
88 #define surfxml_pcdata (surfxml_bufferstack + surfxml_pcdata_ix)
89 AT_surfxml_link_id AX_surfxml_link_id;
90 #define A_surfxml_link_id (surfxml_bufferstack + AX_surfxml_link_id)
91 AT_surfxml_prop_id AX_surfxml_prop_id;
92 #define A_surfxml_prop_id (surfxml_bufferstack + AX_surfxml_prop_id)
93 AT_surfxml_host_interference_recv AX_surfxml_host_interference_recv;
94 #define A_surfxml_host_interference_recv (surfxml_bufferstack + AX_surfxml_host_interference_recv)
95 AT_surfxml_host_id AX_surfxml_host_id;
96 #define A_surfxml_host_id (surfxml_bufferstack + AX_surfxml_host_id)
97 AT_surfxml_link_latency_file AX_surfxml_link_latency_file;
98 #define A_surfxml_link_latency_file (surfxml_bufferstack + AX_surfxml_link_latency_file)
99 AT_surfxml_process_host AX_surfxml_process_host;
100 #define A_surfxml_process_host (surfxml_bufferstack + AX_surfxml_process_host)
101 AT_surfxml_host_availability_file AX_surfxml_host_availability_file;
102 #define A_surfxml_host_availability_file (surfxml_bufferstack + AX_surfxml_host_availability_file)
103 AT_surfxml_host_state AX_surfxml_host_state;
104 #define A_surfxml_host_state AX_surfxml_host_state
105 AT_surfxml_host_interference_send_recv AX_surfxml_host_interference_send_recv;
106 #define A_surfxml_host_interference_send_recv (surfxml_bufferstack + AX_surfxml_host_interference_send_recv)
107 AT_surfxml_route_impact_on_dst_with_other_send AX_surfxml_route_impact_on_dst_with_other_send;
108 #define A_surfxml_route_impact_on_dst_with_other_send (surfxml_bufferstack + AX_surfxml_route_impact_on_dst_with_other_send)
109 AT_surfxml_host_interference_send AX_surfxml_host_interference_send;
110 #define A_surfxml_host_interference_send (surfxml_bufferstack + AX_surfxml_host_interference_send)
111 AT_surfxml_route_impact_on_dst AX_surfxml_route_impact_on_dst;
112 #define A_surfxml_route_impact_on_dst (surfxml_bufferstack + AX_surfxml_route_impact_on_dst)
113 AT_surfxml_prop_value AX_surfxml_prop_value;
114 #define A_surfxml_prop_value (surfxml_bufferstack + AX_surfxml_prop_value)
115 AT_surfxml_route_impact_on_src_with_other_recv AX_surfxml_route_impact_on_src_with_other_recv;
116 #define A_surfxml_route_impact_on_src_with_other_recv (surfxml_bufferstack + AX_surfxml_route_impact_on_src_with_other_recv)
117 AT_surfxml_host_power AX_surfxml_host_power;
118 #define A_surfxml_host_power (surfxml_bufferstack + AX_surfxml_host_power)
119 AT_surfxml_link_state_file AX_surfxml_link_state_file;
120 #define A_surfxml_link_state_file (surfxml_bufferstack + AX_surfxml_link_state_file)
121 AT_surfxml_router_id AX_surfxml_router_id;
122 #define A_surfxml_router_id (surfxml_bufferstack + AX_surfxml_router_id)
123 AT_surfxml_process_start_time AX_surfxml_process_start_time;
124 #define A_surfxml_process_start_time (surfxml_bufferstack + AX_surfxml_process_start_time)
125 AT_surfxml_platform_xmlns_c_route AX_surfxml_platform_xmlns_c_route;
126 #define A_surfxml_platform_xmlns_c_route (surfxml_bufferstack + AX_surfxml_platform_xmlns_c_route)
127 AT_surfxml_process_function AX_surfxml_process_function;
128 #define A_surfxml_process_function (surfxml_bufferstack + AX_surfxml_process_function)
129 AT_surfxml_host_max_outgoing_rate AX_surfxml_host_max_outgoing_rate;
130 #define A_surfxml_host_max_outgoing_rate (surfxml_bufferstack + AX_surfxml_host_max_outgoing_rate)
131 AT_surfxml_link_sharing_policy AX_surfxml_link_sharing_policy;
132 #define A_surfxml_link_sharing_policy AX_surfxml_link_sharing_policy
133 AT_surfxml_link_c_ctn_id AX_surfxml_link_c_ctn_id;
134 #define A_surfxml_link_c_ctn_id (surfxml_bufferstack + AX_surfxml_link_c_ctn_id)
135 AT_surfxml_process_kill_time AX_surfxml_process_kill_time;
136 #define A_surfxml_process_kill_time (surfxml_bufferstack + AX_surfxml_process_kill_time)
137 AT_surfxml_host_availability AX_surfxml_host_availability;
138 #define A_surfxml_host_availability (surfxml_bufferstack + AX_surfxml_host_availability)
139 AT_surfxml_argument_value AX_surfxml_argument_value;
140 #define A_surfxml_argument_value (surfxml_bufferstack + AX_surfxml_argument_value)
141 AT_surfxml_link_state AX_surfxml_link_state;
142 #define A_surfxml_link_state AX_surfxml_link_state
143 AT_surfxml_route_src AX_surfxml_route_src;
144 #define A_surfxml_route_src (surfxml_bufferstack + AX_surfxml_route_src)
145 AT_surfxml_route_impact_on_src AX_surfxml_route_impact_on_src;
146 #define A_surfxml_route_impact_on_src (surfxml_bufferstack + AX_surfxml_route_impact_on_src)
147 AT_surfxml_link_bandwidth AX_surfxml_link_bandwidth;
148 #define A_surfxml_link_bandwidth (surfxml_bufferstack + AX_surfxml_link_bandwidth)
149 AT_surfxml_link_latency AX_surfxml_link_latency;
150 #define A_surfxml_link_latency (surfxml_bufferstack + AX_surfxml_link_latency)
151 AT_surfxml_platform_xmlns_c_link AX_surfxml_platform_xmlns_c_link;
152 #define A_surfxml_platform_xmlns_c_link (surfxml_bufferstack + AX_surfxml_platform_xmlns_c_link)
153 AT_surfxml_include_file AX_surfxml_include_file;
154 #define A_surfxml_include_file (surfxml_bufferstack + AX_surfxml_include_file)
155 AT_surfxml_link_bandwidth_file AX_surfxml_link_bandwidth_file;
156 #define A_surfxml_link_bandwidth_file (surfxml_bufferstack + AX_surfxml_link_bandwidth_file)
157 AT_surfxml_host_state_file AX_surfxml_host_state_file;
158 #define A_surfxml_host_state_file (surfxml_bufferstack + AX_surfxml_host_state_file)
159 AT_surfxml_route_dst AX_surfxml_route_dst;
160 #define A_surfxml_route_dst (surfxml_bufferstack + AX_surfxml_route_dst)
161 AT_surfxml_platform_version AX_surfxml_platform_version;
162 #define A_surfxml_platform_version (surfxml_bufferstack + AX_surfxml_platform_version)
166 # define ENTER(state) debug_enter(state,#state)
167 # define LEAVE debug_leave()
168 # define SET(state) debug_set(state,#state)
169 static void debug_enter(int, const char*);
170 static void debug_leave(void);
171 static void debug_set(int, const char*);
173 # define ENTER(state) (yy_push_state(state))
174 # define LEAVE (yy_pop_state())
175 # define SET(state) BEGIN(state)
178 /* Generic actions. */
179 #define SKIP /*skip*/
180 #define SUCCEED CLEANUP; return 0
182 #define FAIL return fail
183 static int fail(const char*, ...);
185 enum {flexml_max_err_msg_size = 512};
186 static char flexml_err_msg[flexml_max_err_msg_size];
187 const char * surfxml_parse_err_msg()
189 return flexml_err_msg;
191 static void reset_surfxml_parse_err_msg()
193 flexml_err_msg[0] = '\0';
197 static void cleanup(void);
198 #define CLEANUP cleanup()
200 /* Text buffer stack handling. */
201 char *surfxml_bufferstack = NULL;
202 static int blimit = FLEXML_BUFFERSTACKSIZE;
203 static int bnext = 1;
205 static int *indexstack = NULL;
206 static int ilimit = FLEXML_INDEXSTACKSIZE;
207 static int inext = 1;
209 #define BUFFERSET(P) (P = bnext)
210 #define BUFFERPUTC(C) (ck_blimit(), surfxml_bufferstack[bnext++] = (C))
211 #define BUFFERDONE (BUFFERPUTC('\0'))
213 #define BUFFERLITERAL(C, P) surfxml_bufferliteral(C, &(P), yytext)
215 /* after this is called, there are at least 2 slots left in the stack */
216 static int ck_blimit()
218 if (bnext >= blimit) {
219 blimit += FLEXML_BUFFERSTACKSIZE + 2;
221 char *temp = (char *) realloc(surfxml_bufferstack, blimit);
223 surfxml_bufferstack = temp;
229 /* after this is called, there are at least 2 slots left in the stack */
230 static int ck_ilimit()
232 if (inext >= ilimit) {
233 ilimit += FLEXML_INDEXSTACKSIZE + 2;
235 int *temp = (int *) realloc(indexstack, ilimit);
243 #ifdef FLEXML_NEED_BUFFERLIT
244 static void surfxml_bufferliteral(char c, int* pp, const char* text)
246 const char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c);
247 assert(s <= e); BUFFERSET(*pp);
249 if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
256 static void pushbuffer(int p)
259 indexstack[inext++] = p;
260 indexstack[inext++] = bnext;
263 static int popbuffer(void)
266 bnext = indexstack[--inext];
267 return indexstack[--inext];
270 /* General internal entities are `unput' back onto the input stream... */
271 #define ENTITYTEXT(T) \
272 { char *s = (T), *e = s+strlen(s);\
273 while (--e >= s) { unput(*e); }}
278 /* Flex standard options. */
280 %option noyy_top_state
286 /* Flex user-requested options. */
290 /* XML character classes (currently restricted to ASCII). */
292 /* "Common syntactic structures." */
296 /* "Names and Tokens." */
297 NameChar [A-Za-z0-9.:_-]
298 Name [A-Za-z_:]{NameChar}*
299 Names {Name}({S}{Name})*
300 Nmtoken ({NameChar})+
301 Nmtokens {Nmtoken}({S}{Nmtoken})*
304 VersionNum [a-zA-Z0-9_.:-]+
306 Literal \'[^'']*\'|\"[^""]*\"
308 /* Parser states (flex `exclusive start conditions'):
310 * PROLOG the XML prolog of the document before <?xml...>
311 * DOCTYPE the XML prolog of the document after <?xml...>
312 * EPILOG after the root element
313 * INCOMMENT inside an XML comment <!--....-->
314 * INPI inside an XML PI <?...?>
315 * VALUE1 inside a '...'-delimited literal
316 * VALUE2 inside a "..."-delimited literal
317 * CDATA inside a <![CDATA[...] ]> section.
318 * ROOT_<tag> expect root element <tag>
319 * AL_<tag> inside the attribute list for <tag>
320 * IN_<tag> inside a <tag> with element contents (ready for end tag)
321 * IMPOSSIBLE dummy to permit disabling rules; must be last
323 %x PROLOG DOCTYPE EPILOG INCOMMENT INPI VALUE1 VALUE2 CDATA
324 %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
325 %x AL_surfxml_include E_surfxml_include
326 %x AL_surfxml_host S_surfxml_host S_surfxml_host_1 S_surfxml_host_2 E_surfxml_host
327 %x AL_surfxml_prop E_surfxml_prop
328 %x AL_surfxml_router E_surfxml_router
329 %x AL_surfxml_link S_surfxml_link S_surfxml_link_1 S_surfxml_link_2 E_surfxml_link
330 %x AL_surfxml_route S_surfxml_route S_surfxml_route_1 S_surfxml_route_2 E_surfxml_route
331 %x AL_surfxml_link_c_ctn E_surfxml_link_c_ctn
332 %x AL_surfxml_process S_surfxml_process S_surfxml_process_1 S_surfxml_process_2 E_surfxml_process
333 %x AL_surfxml_argument E_surfxml_argument
338 const char* *surfxml_statenames=NULL;
343 /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
345 reset_surfxml_parse_err_msg();
346 surfxml_bufferstack = (char *) malloc(FLEXML_BUFFERSTACKSIZE);
347 assert(surfxml_bufferstack);
351 for (i = 0; i < blimit; i++) {
352 surfxml_bufferstack[i] = '\377';
356 surfxml_bufferstack[0] = '\0';
357 indexstack = (int *) malloc(FLEXML_INDEXSTACKSIZE * sizeof(int));
363 surfxml_bufferliteral('\0', &bnext, "0.0");
364 surfxml_bufferliteral('\0', &bnext, "http://simgrid.gforge.inria.fr/");
365 surfxml_bufferliteral('\0', &bnext, "http://simgrid.gforge.inria.fr/");
366 surfxml_bufferliteral('\0', &bnext, "1.0");
367 surfxml_bufferliteral('\0', &bnext, "1.0");
368 surfxml_bufferliteral('\0', &bnext, "1.0");
369 surfxml_bufferliteral('\0', &bnext, "1.0");
370 surfxml_bufferliteral('\0', &bnext, "-1.0");
371 surfxml_bufferliteral('\0', &bnext, "0.0");
372 surfxml_bufferliteral('\0', &bnext, "0.0");
373 surfxml_bufferliteral('\0', &bnext, "0.0");
374 surfxml_bufferliteral('\0', &bnext, "0.0");
375 surfxml_bufferliteral('\0', &bnext, "0.0");
376 surfxml_bufferliteral('\0', &bnext, "-1.0");
377 surfxml_bufferliteral('\0', &bnext, "-1.0");
378 if(!surfxml_statenames) {surfxml_statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*));
379 surfxml_statenames[PROLOG] = NULL;
380 surfxml_statenames[DOCTYPE] = NULL;
381 surfxml_statenames[EPILOG] = NULL;
382 surfxml_statenames[INCOMMENT] = NULL;
383 surfxml_statenames[INPI] = NULL;
384 surfxml_statenames[VALUE1] = NULL;
385 surfxml_statenames[VALUE2] = NULL;
386 surfxml_statenames[CDATA] = NULL;
387 surfxml_statenames[ROOT_surfxml_platform] = NULL;
388 surfxml_statenames[AL_surfxml_platform] = NULL;
389 surfxml_statenames[S_surfxml_platform] = "platform";
390 surfxml_statenames[S_surfxml_platform_1] = "platform";
391 surfxml_statenames[S_surfxml_platform_2] = "platform";
392 surfxml_statenames[S_surfxml_platform_3] = "platform";
393 surfxml_statenames[S_surfxml_platform_4] = "platform";
394 surfxml_statenames[S_surfxml_platform_5] = "platform";
395 surfxml_statenames[E_surfxml_platform] = "platform";
396 surfxml_statenames[AL_surfxml_include] = NULL;
397 surfxml_statenames[E_surfxml_include] = "include";
398 surfxml_statenames[AL_surfxml_host] = NULL;
399 surfxml_statenames[S_surfxml_host] = "host";
400 surfxml_statenames[S_surfxml_host_1] = "host";
401 surfxml_statenames[S_surfxml_host_2] = "host";
402 surfxml_statenames[E_surfxml_host] = "host";
403 surfxml_statenames[AL_surfxml_prop] = NULL;
404 surfxml_statenames[E_surfxml_prop] = "prop";
405 surfxml_statenames[AL_surfxml_router] = NULL;
406 surfxml_statenames[E_surfxml_router] = "router";
407 surfxml_statenames[AL_surfxml_link] = NULL;
408 surfxml_statenames[S_surfxml_link] = "link";
409 surfxml_statenames[S_surfxml_link_1] = "link";
410 surfxml_statenames[S_surfxml_link_2] = "link";
411 surfxml_statenames[E_surfxml_link] = "link";
412 surfxml_statenames[AL_surfxml_route] = NULL;
413 surfxml_statenames[S_surfxml_route] = "route";
414 surfxml_statenames[S_surfxml_route_1] = "route";
415 surfxml_statenames[S_surfxml_route_2] = "route";
416 surfxml_statenames[E_surfxml_route] = "route";
417 surfxml_statenames[AL_surfxml_link_c_ctn] = NULL;
418 surfxml_statenames[E_surfxml_link_c_ctn] = "link:ctn";
419 surfxml_statenames[AL_surfxml_process] = NULL;
420 surfxml_statenames[S_surfxml_process] = "process";
421 surfxml_statenames[S_surfxml_process_1] = "process";
422 surfxml_statenames[S_surfxml_process_2] = "process";
423 surfxml_statenames[E_surfxml_process] = "process";
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,AL_surfxml_include,E_surfxml_include,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_router,E_surfxml_router,AL_surfxml_link,S_surfxml_link,S_surfxml_link_1,S_surfxml_link_2,E_surfxml_link,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>{
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,AL_surfxml_include,E_surfxml_include,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_router,E_surfxml_router,AL_surfxml_link,S_surfxml_link,S_surfxml_link_1,S_surfxml_link_2,E_surfxml_link,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;
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}"platform"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_platform);
461 "<!"[^>-][^>]*">" FAIL("Bad declaration %s.",yytext);
462 . FAIL("Unexpected character `%c' in prolog.", yytext[0]);
463 <<EOF>> FAIL("EOF in prolog.");
466 /* RULES DERIVED FROM DTD. */
468 /* <!-- Small DTD for SURF based tools. --> */
470 <E_surfxml_link,S_surfxml_platform,S_surfxml_platform_1,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_platform,S_surfxml_route_2,E_surfxml_route,S_surfxml_platform_3,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_platform_2,S_surfxml_host,S_surfxml_process_1,S_surfxml_host_2,S_surfxml_platform_5,S_surfxml_process_2,S_surfxml_route>"<platform"{s} FAIL("Starting tag <platform> is not allowed here.");
472 <ROOT_surfxml_platform>"<platform"{s} {
473 AX_surfxml_platform_version = 1;
474 AX_surfxml_platform_xmlns_c_link = 5;
475 AX_surfxml_platform_xmlns_c_route = 37;
476 ENTER(AL_surfxml_platform); pushbuffer(0);
479 <AL_surfxml_platform>{
480 "version"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_version);
481 "version"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_version);
483 "xmlns:link"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_xmlns_c_link);
484 "xmlns:link"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_xmlns_c_link);
486 "xmlns:route"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_xmlns_c_route);
487 "xmlns:route"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_xmlns_c_route);
490 LEAVE; STag_surfxml_platform();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform);
493 LEAVE; STag_surfxml_platform(); surfxml_pcdata_ix = 0; ETag_surfxml_platform(); popbuffer(); /* attribute */
495 case ROOT_surfxml_platform: SET(EPILOG); break;
498 . FAIL("Unexpected character `%c' in attribute list of platform element.", yytext[0]);
499 {Name} FAIL("Bad attribute `%s' in `platform' element start tag.",yytext);
500 <<EOF>> FAIL("EOF in attribute list of `platform' element.");
503 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform_3,S_surfxml_platform,E_surfxml_platform>{
506 ETag_surfxml_platform();
507 popbuffer(); /* attribute */
509 case ROOT_surfxml_platform: SET(EPILOG); break;
512 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</platform>' expected.",yytext);
513 . FAIL("Unexpected character `%c': `</platform>' expected.",yytext[0]);
514 <<EOF>> FAIL("Premature EOF: `</platform>' expected.");
517 <E_surfxml_link,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_platform,S_surfxml_route_2,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,S_surfxml_link,E_surfxml_host,S_surfxml_host,S_surfxml_process_1,S_surfxml_host_2,S_surfxml_process_2,S_surfxml_route>"<include"{s} FAIL("Starting tag <include> is not allowed here.");
519 <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} {
520 AX_surfxml_include_file = 0;
521 ENTER(AL_surfxml_include); pushbuffer(0);
524 <AL_surfxml_include>{
525 "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_include_file);
526 "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_include_file);
529 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
530 LEAVE; STag_surfxml_include();surfxml_pcdata_ix = 0; ENTER(E_surfxml_include);
533 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
534 LEAVE; STag_surfxml_include(); surfxml_pcdata_ix = 0; ETag_surfxml_include(); popbuffer(); /* attribute */
536 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;
537 case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
540 . FAIL("Unexpected character `%c' in attribute list of include element.", yytext[0]);
541 {Name} FAIL("Bad attribute `%s' in `include' element start tag.",yytext);
542 <<EOF>> FAIL("EOF in attribute list of `include' element.");
548 ETag_surfxml_include();
549 popbuffer(); /* attribute */
551 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;
552 case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
555 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</include>' expected.",yytext);
556 . FAIL("Unexpected character `%c': `</include>' expected.",yytext[0]);
557 <<EOF>> FAIL("Premature EOF: `</include>' expected.");
560 <E_surfxml_link,S_surfxml_platform_1,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_platform,S_surfxml_route_2,E_surfxml_route,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_link_1,S_surfxml_link,E_surfxml_host,S_surfxml_host,S_surfxml_process_1,S_surfxml_host_2,S_surfxml_platform_5,S_surfxml_process_2,S_surfxml_route>"<host"{s} FAIL("Starting tag <host> is not allowed here.");
562 <S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<host"{s} {
563 AX_surfxml_host_id = 0;
564 AX_surfxml_host_power = 0;
565 AX_surfxml_host_availability = 69;
566 AX_surfxml_host_availability_file = 0;
567 AX_surfxml_host_state = A_surfxml_host_state_ON;
568 AX_surfxml_host_state_file = 0;
569 AX_surfxml_host_interference_send = 73;
570 AX_surfxml_host_interference_recv = 77;
571 AX_surfxml_host_interference_send_recv = 81;
572 AX_surfxml_host_max_outgoing_rate = 85;
573 ENTER(AL_surfxml_host); pushbuffer(0);
577 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_id);
578 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_id);
580 "power"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_power);
581 "power"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_power);
583 "availability"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability);
584 "availability"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability);
586 "availability_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability_file);
587 "availability_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability_file);
590 "state"{Eq}"\"ON\"" A_surfxml_host_state = A_surfxml_host_state_ON;
592 "state"{Eq}"\"OFF\"" A_surfxml_host_state = A_surfxml_host_state_OFF;
594 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_state_file);
595 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_state_file);
597 "interference_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send);
598 "interference_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send);
600 "interference_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_recv);
601 "interference_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_recv);
603 "interference_send_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send_recv);
604 "interference_send_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send_recv);
606 "max_outgoing_rate"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_max_outgoing_rate);
607 "max_outgoing_rate"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_max_outgoing_rate);
610 if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
611 if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element.");
612 LEAVE; STag_surfxml_host();surfxml_pcdata_ix = 0; ENTER(S_surfxml_host);
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; ETag_surfxml_host(); popbuffer(); /* attribute */
619 case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
622 . FAIL("Unexpected character `%c' in attribute list of host element.", yytext[0]);
623 {Name} FAIL("Bad attribute `%s' in `host' element start tag.",yytext);
624 <<EOF>> FAIL("EOF in attribute list of `host' element.");
627 <S_surfxml_host,E_surfxml_host,S_surfxml_host_2>{
631 popbuffer(); /* attribute */
633 case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
636 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</host>' expected.",yytext);
637 . FAIL("Unexpected character `%c': `</host>' expected.",yytext[0]);
638 <<EOF>> FAIL("Premature EOF: `</host>' expected.");
641 <E_surfxml_link,S_surfxml_platform,S_surfxml_platform_1,E_surfxml_process,E_surfxml_platform,S_surfxml_route_2,E_surfxml_route,S_surfxml_platform_3,S_surfxml_platform_4,S_surfxml_route_1,E_surfxml_host,S_surfxml_platform_2,S_surfxml_platform_5,S_surfxml_route>"<prop"{s} FAIL("Starting tag <prop> is not allowed here.");
643 <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} {
644 AX_surfxml_prop_id = 0;
645 AX_surfxml_prop_value = 0;
646 ENTER(AL_surfxml_prop); pushbuffer(0);
650 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_id);
651 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_id);
653 "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_value);
654 "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_value);
657 if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
658 if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element.");
659 LEAVE; STag_surfxml_prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_prop);
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; ETag_surfxml_prop(); popbuffer(); /* attribute */
666 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
667 case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
668 case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
671 . FAIL("Unexpected character `%c' in attribute list of prop element.", yytext[0]);
672 {Name} FAIL("Bad attribute `%s' in `prop' element start tag.",yytext);
673 <<EOF>> FAIL("EOF in attribute list of `prop' element.");
680 popbuffer(); /* attribute */
682 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
683 case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
684 case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
687 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</prop>' expected.",yytext);
688 . FAIL("Unexpected character `%c': `</prop>' expected.",yytext[0]);
689 <<EOF>> FAIL("Premature EOF: `</prop>' expected.");
692 <E_surfxml_link,S_surfxml_platform_1,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_platform,S_surfxml_route_2,E_surfxml_route,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_link_1,S_surfxml_link,E_surfxml_host,S_surfxml_host,S_surfxml_process_1,S_surfxml_host_2,S_surfxml_platform_5,S_surfxml_process_2,S_surfxml_route>"<router"{s} FAIL("Starting tag <router> is not allowed here.");
694 <S_surfxml_platform_2,S_surfxml_platform,S_surfxml_platform_3>"<router"{s} {
695 AX_surfxml_router_id = 0;
696 ENTER(AL_surfxml_router); pushbuffer(0);
700 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_router_id);
701 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_router_id);
704 if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
705 LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router);
708 if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
709 LEAVE; STag_surfxml_router(); surfxml_pcdata_ix = 0; ETag_surfxml_router(); popbuffer(); /* attribute */
711 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
714 . FAIL("Unexpected character `%c' in attribute list of router element.", yytext[0]);
715 {Name} FAIL("Bad attribute `%s' in `router' element start tag.",yytext);
716 <<EOF>> FAIL("EOF in attribute list of `router' element.");
722 ETag_surfxml_router();
723 popbuffer(); /* attribute */
725 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
728 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</router>' expected.",yytext);
729 . FAIL("Unexpected character `%c': `</router>' expected.",yytext[0]);
730 <<EOF>> FAIL("Premature EOF: `</router>' expected.");
733 <E_surfxml_link,S_surfxml_platform_1,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_platform,S_surfxml_route_2,E_surfxml_route,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_link_1,S_surfxml_link,E_surfxml_host,S_surfxml_host,S_surfxml_process_1,S_surfxml_host_2,S_surfxml_platform_5,S_surfxml_process_2,S_surfxml_route>"<link"{s} FAIL("Starting tag <link> is not allowed here.");
735 <S_surfxml_platform_2,S_surfxml_platform,S_surfxml_platform_3>"<link"{s} {
736 AX_surfxml_link_id = 0;
737 AX_surfxml_link_bandwidth = 0;
738 AX_surfxml_link_bandwidth_file = 0;
739 AX_surfxml_link_latency = 90;
740 AX_surfxml_link_latency_file = 0;
741 AX_surfxml_link_state = A_surfxml_link_state_ON;
742 AX_surfxml_link_state_file = 0;
743 AX_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
744 ENTER(AL_surfxml_link); pushbuffer(0);
748 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_id);
749 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_id);
751 "bandwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth);
752 "bandwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth);
754 "bandwidth_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth_file);
755 "bandwidth_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth_file);
757 "latency"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency);
758 "latency"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency);
760 "latency_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency_file);
761 "latency_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency_file);
764 "state"{Eq}"\"ON\"" A_surfxml_link_state = A_surfxml_link_state_ON;
766 "state"{Eq}"\"OFF\"" A_surfxml_link_state = A_surfxml_link_state_OFF;
768 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_state_file);
769 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_state_file);
771 "sharing_policy"{Eq}"'SHARED'" |
772 "sharing_policy"{Eq}"\"SHARED\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
773 "sharing_policy"{Eq}"'FATPIPE'" |
774 "sharing_policy"{Eq}"\"FATPIPE\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FATPIPE;
777 if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
778 if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
779 LEAVE; STag_surfxml_link();surfxml_pcdata_ix = 0; ENTER(S_surfxml_link);
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; ETag_surfxml_link(); popbuffer(); /* attribute */
786 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
789 . FAIL("Unexpected character `%c' in attribute list of link element.", yytext[0]);
790 {Name} FAIL("Bad attribute `%s' in `link' element start tag.",yytext);
791 <<EOF>> FAIL("EOF in attribute list of `link' element.");
794 <S_surfxml_link_2,E_surfxml_link,S_surfxml_link>{
798 popbuffer(); /* attribute */
800 case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
803 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link>' expected.",yytext);
804 . FAIL("Unexpected character `%c': `</link>' expected.",yytext[0]);
805 <<EOF>> FAIL("Premature EOF: `</link>' expected.");
808 <E_surfxml_link,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_platform,S_surfxml_route_2,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,S_surfxml_link,E_surfxml_host,S_surfxml_platform_2,S_surfxml_host,S_surfxml_process_1,S_surfxml_host_2,S_surfxml_process_2,S_surfxml_route>"<route"{s} FAIL("Starting tag <route> is not allowed here.");
810 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_platform_3,S_surfxml_platform_4>"<route"{s} {
811 AX_surfxml_route_src = 0;
812 AX_surfxml_route_dst = 0;
813 AX_surfxml_route_impact_on_src = 94;
814 AX_surfxml_route_impact_on_dst = 98;
815 AX_surfxml_route_impact_on_src_with_other_recv = 102;
816 AX_surfxml_route_impact_on_dst_with_other_send = 106;
817 ENTER(AL_surfxml_route); pushbuffer(0);
821 "src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src);
822 "src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src);
824 "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst);
825 "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst);
827 "impact_on_src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src);
828 "impact_on_src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src);
830 "impact_on_dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst);
831 "impact_on_dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst);
833 "impact_on_src_with_other_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
834 "impact_on_src_with_other_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
836 "impact_on_dst_with_other_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
837 "impact_on_dst_with_other_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
840 if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
841 if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
842 LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route);
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; ETag_surfxml_route(); popbuffer(); /* attribute */
849 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;
852 . FAIL("Unexpected character `%c' in attribute list of route element.", yytext[0]);
853 {Name} FAIL("Bad attribute `%s' in `route' element start tag.",yytext);
854 <<EOF>> FAIL("EOF in attribute list of `route' element.");
857 <S_surfxml_route,S_surfxml_route_2,E_surfxml_route>{
860 ETag_surfxml_route();
861 popbuffer(); /* attribute */
863 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;
866 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route>' expected.",yytext);
867 . FAIL("Unexpected character `%c': `</route>' expected.",yytext[0]);
868 <<EOF>> FAIL("Premature EOF: `</route>' expected.");
871 <E_surfxml_link,S_surfxml_platform,S_surfxml_platform_1,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_platform,E_surfxml_route,S_surfxml_platform_3,S_surfxml_platform_4,S_surfxml_link_1,S_surfxml_link,E_surfxml_host,S_surfxml_platform_2,S_surfxml_host,S_surfxml_process_1,S_surfxml_host_2,S_surfxml_platform_5,S_surfxml_process_2>"<link:ctn"{s} FAIL("Starting tag <link:ctn> is not allowed here.");
873 <S_surfxml_route_1,S_surfxml_route,S_surfxml_route_2>"<link:ctn"{s} {
874 AX_surfxml_link_c_ctn_id = 0;
875 ENTER(AL_surfxml_link_c_ctn); pushbuffer(0);
878 <AL_surfxml_link_c_ctn>{
879 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_c_ctn_id);
880 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_c_ctn_id);
883 if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element.");
884 LEAVE; STag_surfxml_link_c_ctn();surfxml_pcdata_ix = 0; ENTER(E_surfxml_link_c_ctn);
887 if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element.");
888 LEAVE; STag_surfxml_link_c_ctn(); surfxml_pcdata_ix = 0; ETag_surfxml_link_c_ctn(); popbuffer(); /* attribute */
890 case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
893 . FAIL("Unexpected character `%c' in attribute list of link:ctn element.", yytext[0]);
894 {Name} FAIL("Bad attribute `%s' in `link:ctn' element start tag.",yytext);
895 <<EOF>> FAIL("EOF in attribute list of `link:ctn' element.");
898 <E_surfxml_link_c_ctn>{
901 ETag_surfxml_link_c_ctn();
902 popbuffer(); /* attribute */
904 case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
907 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link:ctn>' expected.",yytext);
908 . FAIL("Unexpected character `%c': `</link:ctn>' expected.",yytext[0]);
909 <<EOF>> FAIL("Premature EOF: `</link:ctn>' expected.");
912 <E_surfxml_link,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_platform,S_surfxml_route_2,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,S_surfxml_link,E_surfxml_host,S_surfxml_platform_2,S_surfxml_host,S_surfxml_process_1,S_surfxml_host_2,S_surfxml_process_2,S_surfxml_route>"<process"{s} FAIL("Starting tag <process> is not allowed here.");
914 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_platform_3,S_surfxml_platform_4>"<process"{s} {
915 AX_surfxml_process_host = 0;
916 AX_surfxml_process_function = 0;
917 AX_surfxml_process_start_time = 110;
918 AX_surfxml_process_kill_time = 115;
919 ENTER(AL_surfxml_process); pushbuffer(0);
922 <AL_surfxml_process>{
923 "host"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host);
924 "host"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host);
926 "function"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function);
927 "function"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function);
929 "start_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start_time);
930 "start_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start_time);
932 "kill_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill_time);
933 "kill_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill_time);
936 if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
937 if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
938 LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process);
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; ETag_surfxml_process(); popbuffer(); /* attribute */
945 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;
948 . FAIL("Unexpected character `%c' in attribute list of process element.", yytext[0]);
949 {Name} FAIL("Bad attribute `%s' in `process' element start tag.",yytext);
950 <<EOF>> FAIL("EOF in attribute list of `process' element.");
953 <S_surfxml_process,E_surfxml_process,S_surfxml_process_2>{
956 ETag_surfxml_process();
957 popbuffer(); /* attribute */
959 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;
962 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</process>' expected.",yytext);
963 . FAIL("Unexpected character `%c': `</process>' expected.",yytext[0]);
964 <<EOF>> FAIL("Premature EOF: `</process>' expected.");
967 <E_surfxml_link,S_surfxml_platform,S_surfxml_platform_1,E_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_platform,S_surfxml_route_2,E_surfxml_route,S_surfxml_platform_3,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_link_1,S_surfxml_link,E_surfxml_host,S_surfxml_platform_2,S_surfxml_host,S_surfxml_host_2,S_surfxml_platform_5,S_surfxml_route>"<argument"{s} FAIL("Starting tag <argument> is not allowed here.");
969 <S_surfxml_process_1,S_surfxml_process,S_surfxml_process_2>"<argument"{s} {
970 AX_surfxml_argument_value = 0;
971 ENTER(AL_surfxml_argument); pushbuffer(0);
974 <AL_surfxml_argument>{
975 "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_argument_value);
976 "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_argument_value);
979 if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
980 LEAVE; STag_surfxml_argument();surfxml_pcdata_ix = 0; ENTER(E_surfxml_argument);
983 if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
984 LEAVE; STag_surfxml_argument(); surfxml_pcdata_ix = 0; ETag_surfxml_argument(); popbuffer(); /* attribute */
986 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
989 . FAIL("Unexpected character `%c' in attribute list of argument element.", yytext[0]);
990 {Name} FAIL("Bad attribute `%s' in `argument' element start tag.",yytext);
991 <<EOF>> FAIL("EOF in attribute list of `argument' element.");
994 <E_surfxml_argument>{
997 ETag_surfxml_argument();
998 popbuffer(); /* attribute */
1000 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1003 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</argument>' expected.",yytext);
1004 . FAIL("Unexpected character `%c': `</argument>' expected.",yytext[0]);
1005 <<EOF>> FAIL("Premature EOF: `</argument>' expected.");
1008 /* EPILOG: after the root element. */
1011 . {SET(PROLOG); yyless(0); CLEANUP; return -1;}
1015 /* CHARACTER DATA. */
1017 <IMPOSSIBLE,VALUE1,VALUE2>{
1018 /* Non-defined standard entities... */
1019 "&" BUFFERPUTC('&');
1020 "<" BUFFERPUTC('<');
1021 ">" BUFFERPUTC('>');
1022 "'" BUFFERPUTC('\'');
1023 """ BUFFERPUTC('"');
1025 /* Character entities. */
1026 "&#"[[:digit:]]+";" BUFFERPUTC((unsigned char)atoi(yytext+2));
1027 "&#x"[[:xdigit:]]+";" BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
1030 <IMPOSSIBLE,VALUE1,VALUE2,CDATA>{
1034 "\n\r" BUFFERPUTC('\n');
1038 "<![CDATA[" ENTER(CDATA);
1039 "]""]>" FAIL("Unexpected `]""]>' in character data.");
1043 \' BUFFERDONE; LEAVE;
1044 <<EOF>> FAIL("EOF in literal (\"'\" expected).");
1048 \" BUFFERDONE; LEAVE;
1049 <<EOF>> FAIL("EOF in literal (`\"' expected).");
1052 <IMPOSSIBLE,VALUE1,VALUE2>{
1053 [^<&] BUFFERPUTC(yytext[0]);
1054 [<&] FAIL("Spurious `%c' in character data.",yytext[0]);
1059 /* "]""]" BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]); */
1060 . BUFFERPUTC(yytext[0]);
1061 <<EOF>> FAIL("EOF in CDATA section.");
1064 /* Impossible rules to avoid warnings from flex(1). */
1065 /* Ideally, this should be replaced by code in flexml.pl that
1066 generates just the states not covered by other rules. */
1068 .|[\n] FAIL("Syntax error on character `%c'.", yytext[0]);
1073 /* Element context stack lookup. */
1074 int surfxml_element_context(int i)
1076 return (0<i && i<yy_start_stack_depth
1077 ? yy_start_stack[yy_start_stack_ptr - i]
1082 void print_yy_stack(char* fmt, ...)
1084 int i = 0; va_list ap; va_start(ap, fmt);
1085 vfprintf(stderr, fmt, ap);
1086 if (surfxml_statenames) {
1087 for (i=1; i<yy_start_stack_ptr; i++) {
1088 fprintf(stderr, "%s/", surfxml_statenames[yy_start_stack[i] ]);
1090 fprintf(stderr,"%s\n", surfxml_statenames[YY_START]);
1095 void print_surfxml_bufferstack()
1098 fputs("Buffer: ", stderr);
1099 for (i = 0; i < blimit; i++) {
1100 if ( surfxml_bufferstack[i] == '\377' ) break;
1101 putc(surfxml_bufferstack[i], stderr);
1106 static void debug_enter(int state, const char* statename) {
1107 yy_push_state(state);
1108 if (yy_flex_debug) {
1109 print_yy_stack("--ENTER(%s) : ",statename);
1110 print_surfxml_bufferstack();
1114 static void debug_leave(void) {
1115 if (yy_flex_debug) {
1116 print_yy_stack("--LEAVE : ");
1117 print_surfxml_bufferstack();
1122 static void debug_set(int state, const char* statename) {
1124 if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename);
1129 static void cleanup(void)
1131 if (surfxml_statenames) {
1132 free(surfxml_statenames);
1133 surfxml_statenames = NULL;
1135 free(surfxml_bufferstack);
1136 surfxml_bufferstack = NULL;
1143 static int fail(const char* fmt, ...)
1145 int chars_left, used;
1146 va_list ap; va_start(ap, fmt);
1147 #ifdef FLEXML_yylineno
1148 used = sprintf(flexml_err_msg,
1149 "Invalid XML (XML input line %d, state %d): ",
1150 yylineno, YY_START);
1152 used = sprintf(flexml_err_msg,
1153 "Invalid XML (state %d): ",
1156 chars_left = flexml_max_err_msg_size - used - 1;
1157 vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
1160 #ifndef FLEXML_quiet_parser
1161 /* print directly to sdterr */
1162 fprintf(stderr, "%s\n", flexml_err_msg);
1163 flexml_err_msg[0] = '\0';