1 /* Validating XML processor for surf/surfxml.dtd.
2 * Generated 2007/10/26 19:58:25.
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_platform_description_version AX_surfxml_platform_description_version;
105 #define A_surfxml_platform_description_version (surfxml_bufferstack + AX_surfxml_platform_description_version)
106 AT_surfxml_prop_value AX_surfxml_prop_value;
107 #define A_surfxml_prop_value (surfxml_bufferstack + AX_surfxml_prop_value)
108 AT_surfxml_route_impact_on_src_with_other_recv AX_surfxml_route_impact_on_src_with_other_recv;
109 #define A_surfxml_route_impact_on_src_with_other_recv (surfxml_bufferstack + AX_surfxml_route_impact_on_src_with_other_recv)
110 AT_surfxml_host_power AX_surfxml_host_power;
111 #define A_surfxml_host_power (surfxml_bufferstack + AX_surfxml_host_power)
112 AT_surfxml_link_state_file AX_surfxml_link_state_file;
113 #define A_surfxml_link_state_file (surfxml_bufferstack + AX_surfxml_link_state_file)
114 AT_surfxml_router_id AX_surfxml_router_id;
115 #define A_surfxml_router_id (surfxml_bufferstack + AX_surfxml_router_id)
116 AT_surfxml_process_start_time AX_surfxml_process_start_time;
117 #define A_surfxml_process_start_time (surfxml_bufferstack + AX_surfxml_process_start_time)
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_include_file AX_surfxml_include_file;
143 #define A_surfxml_include_file (surfxml_bufferstack + AX_surfxml_include_file)
144 AT_surfxml_link_bandwidth_file AX_surfxml_link_bandwidth_file;
145 #define A_surfxml_link_bandwidth_file (surfxml_bufferstack + AX_surfxml_link_bandwidth_file)
146 AT_surfxml_host_state_file AX_surfxml_host_state_file;
147 #define A_surfxml_host_state_file (surfxml_bufferstack + AX_surfxml_host_state_file)
148 AT_surfxml_route_dst AX_surfxml_route_dst;
149 #define A_surfxml_route_dst (surfxml_bufferstack + AX_surfxml_route_dst)
153 # define ENTER(state) debug_enter(state,#state)
154 # define LEAVE debug_leave()
155 # define SET(state) debug_set(state,#state)
156 static void debug_enter(int, const char*);
157 static void debug_leave(void);
158 static void debug_set(int, const char*);
160 # define ENTER(state) (yy_push_state(state))
161 # define LEAVE (yy_pop_state())
162 # define SET(state) BEGIN(state)
165 /* Generic actions. */
166 #define SKIP /*skip*/
167 #define SUCCEED CLEANUP; return 0
169 #define FAIL return fail
170 static int fail(const char*, ...);
172 enum {flexml_max_err_msg_size = 512};
173 static char flexml_err_msg[flexml_max_err_msg_size];
174 const char * surfxml_parse_err_msg()
176 return flexml_err_msg;
178 static void reset_surfxml_parse_err_msg()
180 flexml_err_msg[0] = '\0';
184 static void cleanup(void);
185 #define CLEANUP cleanup()
187 /* Text buffer stack handling. */
188 char *surfxml_bufferstack = NULL;
189 static int blimit = FLEXML_BUFFERSTACKSIZE;
190 static int bnext = 1;
192 static int *indexstack = NULL;
193 static int ilimit = FLEXML_INDEXSTACKSIZE;
194 static int inext = 1;
196 #define BUFFERSET(P) (P = bnext)
197 #define BUFFERPUTC(C) (ck_blimit(), surfxml_bufferstack[bnext++] = (C))
198 #define BUFFERDONE (BUFFERPUTC('\0'))
200 #define BUFFERLITERAL(C, P) surfxml_bufferliteral(C, &(P), yytext)
202 /* after this is called, there are at least 2 slots left in the stack */
203 static int ck_blimit()
205 if (bnext >= blimit) {
206 blimit += FLEXML_BUFFERSTACKSIZE + 2;
208 char *temp = (char *) realloc(surfxml_bufferstack, blimit);
210 surfxml_bufferstack = temp;
216 /* after this is called, there are at least 2 slots left in the stack */
217 static int ck_ilimit()
219 if (inext >= ilimit) {
220 ilimit += FLEXML_INDEXSTACKSIZE + 2;
222 int *temp = (int *) realloc(indexstack, ilimit);
230 #ifdef FLEXML_NEED_BUFFERLIT
231 static void surfxml_bufferliteral(char c, int* pp, const char* text)
233 const char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c);
234 assert(s <= e); BUFFERSET(*pp);
236 if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
243 static void pushbuffer(int p)
246 indexstack[inext++] = p;
247 indexstack[inext++] = bnext;
250 static int popbuffer(void)
253 bnext = indexstack[--inext];
254 return indexstack[--inext];
257 /* General internal entities are `unput' back onto the input stream... */
258 #define ENTITYTEXT(T) \
259 { char *s = (T), *e = s+strlen(s);\
260 while (--e >= s) { unput(*e); }}
265 /* Flex standard options. */
267 %option noyy_top_state
273 /* Flex user-requested options. */
277 /* XML character classes (currently restricted to ASCII). */
279 /* "Common syntactic structures." */
283 /* "Names and Tokens." */
284 NameChar [A-Za-z0-9.:_-]
285 Name [A-Za-z_:]{NameChar}*
286 Names {Name}({S}{Name})*
287 Nmtoken ({NameChar})+
288 Nmtokens {Nmtoken}({S}{Nmtoken})*
291 VersionNum [a-zA-Z0-9_.:-]+
293 Literal \'[^'']*\'|\"[^""]*\"
295 /* Parser states (flex `exclusive start conditions'):
297 * PROLOG the XML prolog of the document before <?xml...>
298 * DOCTYPE the XML prolog of the document after <?xml...>
299 * EPILOG after the root element
300 * INCOMMENT inside an XML comment <!--....-->
301 * INPI inside an XML PI <?...?>
302 * VALUE1 inside a '...'-delimited literal
303 * VALUE2 inside a "..."-delimited literal
304 * CDATA inside a <![CDATA[...] ]> section.
305 * ROOT_<tag> expect root element <tag>
306 * AL_<tag> inside the attribute list for <tag>
307 * IN_<tag> inside a <tag> with element contents (ready for end tag)
308 * IMPOSSIBLE dummy to permit disabling rules; must be last
310 %x PROLOG DOCTYPE EPILOG INCOMMENT INPI VALUE1 VALUE2 CDATA
311 %x ROOT_surfxml_platform_description AL_surfxml_platform_description S_surfxml_platform_description S_surfxml_platform_description_1 S_surfxml_platform_description_2 S_surfxml_platform_description_3 S_surfxml_platform_description_4 S_surfxml_platform_description_5 E_surfxml_platform_description
312 %x ROOT_surfxml_include AL_surfxml_include E_surfxml_include
313 %x ROOT_surfxml_host AL_surfxml_host S_surfxml_host S_surfxml_host_1 S_surfxml_host_2 E_surfxml_host
314 %x ROOT_surfxml_prop AL_surfxml_prop E_surfxml_prop
315 %x ROOT_surfxml_router AL_surfxml_router E_surfxml_router
316 %x ROOT_surfxml_link AL_surfxml_link S_surfxml_link S_surfxml_link_1 S_surfxml_link_2 E_surfxml_link
317 %x ROOT_surfxml_route AL_surfxml_route S_surfxml_route S_surfxml_route_1 S_surfxml_route_2 E_surfxml_route
318 %x ROOT_surfxml_link_c_ctn AL_surfxml_link_c_ctn E_surfxml_link_c_ctn
319 %x ROOT_surfxml_process AL_surfxml_process S_surfxml_process S_surfxml_process_1 S_surfxml_process_2 E_surfxml_process
320 %x ROOT_surfxml_argument AL_surfxml_argument E_surfxml_argument
325 const char* *surfxml_statenames=NULL;
330 /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
332 reset_surfxml_parse_err_msg();
333 surfxml_bufferstack = (char *) malloc(FLEXML_BUFFERSTACKSIZE);
334 assert(surfxml_bufferstack);
338 for (i = 0; i < blimit; i++) {
339 surfxml_bufferstack[i] = '\377';
343 surfxml_bufferstack[0] = '\0';
344 indexstack = (int *) malloc(FLEXML_INDEXSTACKSIZE * sizeof(int));
350 surfxml_bufferliteral('\0', &bnext, "0.0");
351 surfxml_bufferliteral('\0', &bnext, "1.0");
352 surfxml_bufferliteral('\0', &bnext, "1.0");
353 surfxml_bufferliteral('\0', &bnext, "1.0");
354 surfxml_bufferliteral('\0', &bnext, "1.0");
355 surfxml_bufferliteral('\0', &bnext, "-1.0");
356 surfxml_bufferliteral('\0', &bnext, "0.0");
357 surfxml_bufferliteral('\0', &bnext, "0.0");
358 surfxml_bufferliteral('\0', &bnext, "0.0");
359 surfxml_bufferliteral('\0', &bnext, "0.0");
360 surfxml_bufferliteral('\0', &bnext, "0.0");
361 surfxml_bufferliteral('\0', &bnext, "-1.0");
362 surfxml_bufferliteral('\0', &bnext, "-1.0");
363 if(!surfxml_statenames) {surfxml_statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*));
364 surfxml_statenames[PROLOG] = NULL;
365 surfxml_statenames[DOCTYPE] = NULL;
366 surfxml_statenames[EPILOG] = NULL;
367 surfxml_statenames[INCOMMENT] = NULL;
368 surfxml_statenames[INPI] = NULL;
369 surfxml_statenames[VALUE1] = NULL;
370 surfxml_statenames[VALUE2] = NULL;
371 surfxml_statenames[CDATA] = NULL;
372 surfxml_statenames[ROOT_surfxml_platform_description] = NULL;
373 surfxml_statenames[AL_surfxml_platform_description] = NULL;
374 surfxml_statenames[S_surfxml_platform_description] = "platform_description";
375 surfxml_statenames[S_surfxml_platform_description_1] = "platform_description";
376 surfxml_statenames[S_surfxml_platform_description_2] = "platform_description";
377 surfxml_statenames[S_surfxml_platform_description_3] = "platform_description";
378 surfxml_statenames[S_surfxml_platform_description_4] = "platform_description";
379 surfxml_statenames[S_surfxml_platform_description_5] = "platform_description";
380 surfxml_statenames[E_surfxml_platform_description] = "platform_description";
381 surfxml_statenames[ROOT_surfxml_include] = NULL;
382 surfxml_statenames[AL_surfxml_include] = NULL;
383 surfxml_statenames[E_surfxml_include] = "include";
384 surfxml_statenames[ROOT_surfxml_host] = NULL;
385 surfxml_statenames[AL_surfxml_host] = NULL;
386 surfxml_statenames[S_surfxml_host] = "host";
387 surfxml_statenames[S_surfxml_host_1] = "host";
388 surfxml_statenames[S_surfxml_host_2] = "host";
389 surfxml_statenames[E_surfxml_host] = "host";
390 surfxml_statenames[ROOT_surfxml_prop] = NULL;
391 surfxml_statenames[AL_surfxml_prop] = NULL;
392 surfxml_statenames[E_surfxml_prop] = "prop";
393 surfxml_statenames[ROOT_surfxml_router] = NULL;
394 surfxml_statenames[AL_surfxml_router] = NULL;
395 surfxml_statenames[E_surfxml_router] = "router";
396 surfxml_statenames[ROOT_surfxml_link] = NULL;
397 surfxml_statenames[AL_surfxml_link] = NULL;
398 surfxml_statenames[S_surfxml_link] = "link";
399 surfxml_statenames[S_surfxml_link_1] = "link";
400 surfxml_statenames[S_surfxml_link_2] = "link";
401 surfxml_statenames[E_surfxml_link] = "link";
402 surfxml_statenames[ROOT_surfxml_route] = NULL;
403 surfxml_statenames[AL_surfxml_route] = NULL;
404 surfxml_statenames[S_surfxml_route] = "route";
405 surfxml_statenames[S_surfxml_route_1] = "route";
406 surfxml_statenames[S_surfxml_route_2] = "route";
407 surfxml_statenames[E_surfxml_route] = "route";
408 surfxml_statenames[ROOT_surfxml_link_c_ctn] = NULL;
409 surfxml_statenames[AL_surfxml_link_c_ctn] = NULL;
410 surfxml_statenames[E_surfxml_link_c_ctn] = "link:ctn";
411 surfxml_statenames[ROOT_surfxml_process] = NULL;
412 surfxml_statenames[AL_surfxml_process] = NULL;
413 surfxml_statenames[S_surfxml_process] = "process";
414 surfxml_statenames[S_surfxml_process_1] = "process";
415 surfxml_statenames[S_surfxml_process_2] = "process";
416 surfxml_statenames[E_surfxml_process] = "process";
417 surfxml_statenames[ROOT_surfxml_argument] = NULL;
418 surfxml_statenames[AL_surfxml_argument] = NULL;
419 surfxml_statenames[E_surfxml_argument] = "argument";
422 /* COMMENTS and PIs: handled uniformly for efficiency. */
424 <ROOT_surfxml_platform_description,AL_surfxml_platform_description,S_surfxml_platform_description,S_surfxml_platform_description_1,S_surfxml_platform_description_2,S_surfxml_platform_description_3,S_surfxml_platform_description_4,S_surfxml_platform_description_5,E_surfxml_platform_description,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>{
425 "<!--" ENTER(INCOMMENT);
433 <<EOF>> FAIL("EOF in comment.");
439 <<EOF>> FAIL("EOF in PI (processing instruction).");
442 /* SPACES: skipped uniformly */
444 <ROOT_surfxml_platform_description,AL_surfxml_platform_description,S_surfxml_platform_description,S_surfxml_platform_description_1,S_surfxml_platform_description_2,S_surfxml_platform_description_3,S_surfxml_platform_description_4,S_surfxml_platform_description_5,E_surfxml_platform_description,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;
446 /* PROLOG: determine root element and process it. */
449 "<?xml"({S}version{Eq}(\'{VersionNum}\'|\"{VersionNum}\"))?({S}encoding{Eq}(\'[^']*\'|\"[^"]*\"))?"?>" SET(DOCTYPE);
450 "<?xml"[^>]*">" FAIL("Bad declaration %s.",yytext);
454 "<!DOCTYPE"{S}"link"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_link);
455 "<!DOCTYPE"{S}"include"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_include);
456 "<!DOCTYPE"{S}"route"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_route);
457 "<!DOCTYPE"{S}"process"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_process);
458 "<!DOCTYPE"{S}"link:ctn"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_link_c_ctn);
459 "<!DOCTYPE"{S}"router"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_router);
460 "<!DOCTYPE"{S}"host"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_host);
461 "<!DOCTYPE"{S}"argument"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_argument);
462 "<!DOCTYPE"{S}"prop"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_prop);
463 "<!DOCTYPE"{S}"platform_description"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_platform_description);
464 "<!"[^>-][^>]*">" FAIL("Bad declaration %s.",yytext);
465 . FAIL("Unexpected character `%c' in prolog.", yytext[0]);
466 <<EOF>> FAIL("EOF in prolog.");
469 /* RULES DERIVED FROM DTD. */
471 /* <!-- Small DTD for SURF based tools. --> */
473 <ROOT_surfxml_platform_description>"<platform_description"{s} {
474 AX_surfxml_platform_description_version = 1;
475 ENTER(AL_surfxml_platform_description); pushbuffer(0);
478 <AL_surfxml_platform_description>{
479 "version"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_description_version);
480 "version"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_description_version);
483 LEAVE; STag_surfxml_platform_description();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform_description);
486 LEAVE; STag_surfxml_platform_description(); surfxml_pcdata_ix = 0; ETag_surfxml_platform_description(); popbuffer(); /* attribute */
488 case ROOT_surfxml_platform_description: SET(EPILOG); break;
491 . FAIL("Unexpected character `%c' in attribute list of platform_description element.", yytext[0]);
492 {Name} FAIL("Bad attribute `%s' in `platform_description' element start tag.",yytext);
493 <<EOF>> FAIL("EOF in attribute list of `platform_description' element.");
496 <E_surfxml_platform_description,S_surfxml_platform_description_5,S_surfxml_platform_description_3,S_surfxml_platform_description_1,S_surfxml_platform_description>{
497 "</platform_description"{s}">" {
499 ETag_surfxml_platform_description();
500 popbuffer(); /* attribute */
502 case ROOT_surfxml_platform_description: SET(EPILOG); break;
505 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</platform_description>' expected.",yytext);
506 . FAIL("Unexpected character `%c': `</platform_description>' expected.",yytext[0]);
507 <<EOF>> FAIL("Premature EOF: `</platform_description>' expected.");
510 <ROOT_surfxml_include,S_surfxml_platform_description_2,S_surfxml_platform_description_5,S_surfxml_platform_description_3,S_surfxml_platform_description_1,S_surfxml_platform_description,S_surfxml_platform_description_4>"<include"{s} {
511 AX_surfxml_include_file = 0;
512 ENTER(AL_surfxml_include); pushbuffer(0);
515 <AL_surfxml_include>{
516 "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_include_file);
517 "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_include_file);
520 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
521 LEAVE; STag_surfxml_include();surfxml_pcdata_ix = 0; ENTER(E_surfxml_include);
524 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
525 LEAVE; STag_surfxml_include(); surfxml_pcdata_ix = 0; ETag_surfxml_include(); popbuffer(); /* attribute */
527 case S_surfxml_platform_description_2: SET(S_surfxml_platform_description_3); break;
528 case ROOT_surfxml_include: SET(EPILOG); break;
529 case S_surfxml_platform_description_5: case S_surfxml_platform_description_3: case S_surfxml_platform_description_1: case S_surfxml_platform_description: case S_surfxml_platform_description_4: SET(S_surfxml_platform_description_5); break;
532 . FAIL("Unexpected character `%c' in attribute list of include element.", yytext[0]);
533 {Name} FAIL("Bad attribute `%s' in `include' element start tag.",yytext);
534 <<EOF>> FAIL("EOF in attribute list of `include' element.");
540 ETag_surfxml_include();
541 popbuffer(); /* attribute */
543 case S_surfxml_platform_description_2: SET(S_surfxml_platform_description_3); break;
544 case ROOT_surfxml_include: SET(EPILOG); break;
545 case S_surfxml_platform_description_5: case S_surfxml_platform_description_3: case S_surfxml_platform_description_1: case S_surfxml_platform_description: case S_surfxml_platform_description_4: SET(S_surfxml_platform_description_5); break;
548 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</include>' expected.",yytext);
549 . FAIL("Unexpected character `%c': `</include>' expected.",yytext[0]);
550 <<EOF>> FAIL("Premature EOF: `</include>' expected.");
553 <ROOT_surfxml_host,S_surfxml_platform_description_2,S_surfxml_platform_description_3,S_surfxml_platform_description>"<host"{s} {
554 AX_surfxml_host_id = 0;
555 AX_surfxml_host_power = 0;
556 AX_surfxml_host_availability = 5;
557 AX_surfxml_host_availability_file = 0;
558 AX_surfxml_host_state = A_surfxml_host_state_ON;
559 AX_surfxml_host_state_file = 0;
560 AX_surfxml_host_interference_send = 9;
561 AX_surfxml_host_interference_recv = 13;
562 AX_surfxml_host_interference_send_recv = 17;
563 AX_surfxml_host_max_outgoing_rate = 21;
564 ENTER(AL_surfxml_host); pushbuffer(0);
568 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_id);
569 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_id);
571 "power"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_power);
572 "power"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_power);
574 "availability"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability);
575 "availability"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability);
577 "availability_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability_file);
578 "availability_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability_file);
581 "state"{Eq}"\"ON\"" A_surfxml_host_state = A_surfxml_host_state_ON;
583 "state"{Eq}"\"OFF\"" A_surfxml_host_state = A_surfxml_host_state_OFF;
585 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_state_file);
586 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_state_file);
588 "interference_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send);
589 "interference_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send);
591 "interference_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_recv);
592 "interference_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_recv);
594 "interference_send_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send_recv);
595 "interference_send_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send_recv);
597 "max_outgoing_rate"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_max_outgoing_rate);
598 "max_outgoing_rate"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_max_outgoing_rate);
601 if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
602 if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element.");
603 LEAVE; STag_surfxml_host();surfxml_pcdata_ix = 0; ENTER(S_surfxml_host);
606 if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
607 if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element.");
608 LEAVE; STag_surfxml_host(); surfxml_pcdata_ix = 0; ETag_surfxml_host(); popbuffer(); /* attribute */
610 case S_surfxml_platform_description_2: case S_surfxml_platform_description_3: case S_surfxml_platform_description: SET(S_surfxml_platform_description_3); break;
611 case ROOT_surfxml_host: SET(EPILOG); break;
614 . FAIL("Unexpected character `%c' in attribute list of host element.", yytext[0]);
615 {Name} FAIL("Bad attribute `%s' in `host' element start tag.",yytext);
616 <<EOF>> FAIL("EOF in attribute list of `host' element.");
619 <S_surfxml_host,E_surfxml_host,S_surfxml_host_2>{
623 popbuffer(); /* attribute */
625 case S_surfxml_platform_description_2: case S_surfxml_platform_description_3: case S_surfxml_platform_description: SET(S_surfxml_platform_description_3); break;
626 case ROOT_surfxml_host: SET(EPILOG); break;
629 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</host>' expected.",yytext);
630 . FAIL("Unexpected character `%c': `</host>' expected.",yytext[0]);
631 <<EOF>> FAIL("Premature EOF: `</host>' expected.");
634 <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} {
635 AX_surfxml_prop_id = 0;
636 AX_surfxml_prop_value = 0;
637 ENTER(AL_surfxml_prop); pushbuffer(0);
641 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_id);
642 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_id);
644 "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_value);
645 "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_value);
648 if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
649 if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element.");
650 LEAVE; STag_surfxml_prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_prop);
653 if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
654 if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element.");
655 LEAVE; STag_surfxml_prop(); surfxml_pcdata_ix = 0; ETag_surfxml_prop(); popbuffer(); /* attribute */
657 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
658 case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
659 case ROOT_surfxml_prop: SET(EPILOG); break;
660 case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
663 . FAIL("Unexpected character `%c' in attribute list of prop element.", yytext[0]);
664 {Name} FAIL("Bad attribute `%s' in `prop' element start tag.",yytext);
665 <<EOF>> FAIL("EOF in attribute list of `prop' element.");
672 popbuffer(); /* attribute */
674 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
675 case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
676 case ROOT_surfxml_prop: SET(EPILOG); break;
677 case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
680 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</prop>' expected.",yytext);
681 . FAIL("Unexpected character `%c': `</prop>' expected.",yytext[0]);
682 <<EOF>> FAIL("Premature EOF: `</prop>' expected.");
685 <ROOT_surfxml_router,S_surfxml_platform_description_2,S_surfxml_platform_description_3,S_surfxml_platform_description>"<router"{s} {
686 AX_surfxml_router_id = 0;
687 ENTER(AL_surfxml_router); pushbuffer(0);
691 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_router_id);
692 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_router_id);
695 if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
696 LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router);
699 if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
700 LEAVE; STag_surfxml_router(); surfxml_pcdata_ix = 0; ETag_surfxml_router(); popbuffer(); /* attribute */
702 case S_surfxml_platform_description_2: case S_surfxml_platform_description_3: case S_surfxml_platform_description: SET(S_surfxml_platform_description_3); break;
703 case ROOT_surfxml_router: SET(EPILOG); break;
706 . FAIL("Unexpected character `%c' in attribute list of router element.", yytext[0]);
707 {Name} FAIL("Bad attribute `%s' in `router' element start tag.",yytext);
708 <<EOF>> FAIL("EOF in attribute list of `router' element.");
714 ETag_surfxml_router();
715 popbuffer(); /* attribute */
717 case S_surfxml_platform_description_2: case S_surfxml_platform_description_3: case S_surfxml_platform_description: SET(S_surfxml_platform_description_3); break;
718 case ROOT_surfxml_router: SET(EPILOG); break;
721 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</router>' expected.",yytext);
722 . FAIL("Unexpected character `%c': `</router>' expected.",yytext[0]);
723 <<EOF>> FAIL("Premature EOF: `</router>' expected.");
726 <ROOT_surfxml_link,S_surfxml_platform_description_2,S_surfxml_platform_description_3,S_surfxml_platform_description>"<link"{s} {
727 AX_surfxml_link_id = 0;
728 AX_surfxml_link_bandwidth = 0;
729 AX_surfxml_link_bandwidth_file = 0;
730 AX_surfxml_link_latency = 26;
731 AX_surfxml_link_latency_file = 0;
732 AX_surfxml_link_state = A_surfxml_link_state_ON;
733 AX_surfxml_link_state_file = 0;
734 AX_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
735 ENTER(AL_surfxml_link); pushbuffer(0);
739 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_id);
740 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_id);
742 "bandwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth);
743 "bandwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth);
745 "bandwidth_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth_file);
746 "bandwidth_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth_file);
748 "latency"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency);
749 "latency"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency);
751 "latency_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency_file);
752 "latency_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency_file);
755 "state"{Eq}"\"ON\"" A_surfxml_link_state = A_surfxml_link_state_ON;
757 "state"{Eq}"\"OFF\"" A_surfxml_link_state = A_surfxml_link_state_OFF;
759 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_state_file);
760 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_state_file);
762 "sharing_policy"{Eq}"'SHARED'" |
763 "sharing_policy"{Eq}"\"SHARED\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
764 "sharing_policy"{Eq}"'FATPIPE'" |
765 "sharing_policy"{Eq}"\"FATPIPE\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FATPIPE;
768 if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
769 if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
770 LEAVE; STag_surfxml_link();surfxml_pcdata_ix = 0; ENTER(S_surfxml_link);
773 if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
774 if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
775 LEAVE; STag_surfxml_link(); surfxml_pcdata_ix = 0; ETag_surfxml_link(); popbuffer(); /* attribute */
777 case S_surfxml_platform_description_2: case S_surfxml_platform_description_3: case S_surfxml_platform_description: SET(S_surfxml_platform_description_3); break;
778 case ROOT_surfxml_link: SET(EPILOG); break;
781 . FAIL("Unexpected character `%c' in attribute list of link element.", yytext[0]);
782 {Name} FAIL("Bad attribute `%s' in `link' element start tag.",yytext);
783 <<EOF>> FAIL("EOF in attribute list of `link' element.");
786 <S_surfxml_link_2,E_surfxml_link,S_surfxml_link>{
790 popbuffer(); /* attribute */
792 case S_surfxml_platform_description_2: case S_surfxml_platform_description_3: case S_surfxml_platform_description: SET(S_surfxml_platform_description_3); break;
793 case ROOT_surfxml_link: SET(EPILOG); break;
796 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link>' expected.",yytext);
797 . FAIL("Unexpected character `%c': `</link>' expected.",yytext[0]);
798 <<EOF>> FAIL("Premature EOF: `</link>' expected.");
801 <ROOT_surfxml_route,S_surfxml_platform_description_5,S_surfxml_platform_description_4,S_surfxml_platform_description_3,S_surfxml_platform_description_1,S_surfxml_platform_description>"<route"{s} {
802 AX_surfxml_route_src = 0;
803 AX_surfxml_route_dst = 0;
804 AX_surfxml_route_impact_on_src = 30;
805 AX_surfxml_route_impact_on_dst = 34;
806 AX_surfxml_route_impact_on_src_with_other_recv = 38;
807 AX_surfxml_route_impact_on_dst_with_other_send = 42;
808 ENTER(AL_surfxml_route); pushbuffer(0);
812 "src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src);
813 "src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src);
815 "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst);
816 "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst);
818 "impact_on_src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src);
819 "impact_on_src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src);
821 "impact_on_dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst);
822 "impact_on_dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst);
824 "impact_on_src_with_other_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
825 "impact_on_src_with_other_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
827 "impact_on_dst_with_other_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
828 "impact_on_dst_with_other_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
831 if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
832 if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
833 LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route);
836 if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
837 if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
838 LEAVE; STag_surfxml_route(); surfxml_pcdata_ix = 0; ETag_surfxml_route(); popbuffer(); /* attribute */
840 case S_surfxml_platform_description_5: case S_surfxml_platform_description_4: case S_surfxml_platform_description_3: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_5); break;
841 case ROOT_surfxml_route: SET(EPILOG); break;
844 . FAIL("Unexpected character `%c' in attribute list of route element.", yytext[0]);
845 {Name} FAIL("Bad attribute `%s' in `route' element start tag.",yytext);
846 <<EOF>> FAIL("EOF in attribute list of `route' element.");
849 <S_surfxml_route,S_surfxml_route_2,E_surfxml_route>{
852 ETag_surfxml_route();
853 popbuffer(); /* attribute */
855 case S_surfxml_platform_description_5: case S_surfxml_platform_description_4: case S_surfxml_platform_description_3: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_5); break;
856 case ROOT_surfxml_route: SET(EPILOG); break;
859 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route>' expected.",yytext);
860 . FAIL("Unexpected character `%c': `</route>' expected.",yytext[0]);
861 <<EOF>> FAIL("Premature EOF: `</route>' expected.");
864 <ROOT_surfxml_link_c_ctn,S_surfxml_route_1,S_surfxml_route,S_surfxml_route_2>"<link:ctn"{s} {
865 AX_surfxml_link_c_ctn_id = 0;
866 ENTER(AL_surfxml_link_c_ctn); pushbuffer(0);
869 <AL_surfxml_link_c_ctn>{
870 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_c_ctn_id);
871 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_c_ctn_id);
874 if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element.");
875 LEAVE; STag_surfxml_link_c_ctn();surfxml_pcdata_ix = 0; ENTER(E_surfxml_link_c_ctn);
878 if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element.");
879 LEAVE; STag_surfxml_link_c_ctn(); surfxml_pcdata_ix = 0; ETag_surfxml_link_c_ctn(); popbuffer(); /* attribute */
881 case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
882 case ROOT_surfxml_link_c_ctn: SET(EPILOG); break;
885 . FAIL("Unexpected character `%c' in attribute list of link:ctn element.", yytext[0]);
886 {Name} FAIL("Bad attribute `%s' in `link:ctn' element start tag.",yytext);
887 <<EOF>> FAIL("EOF in attribute list of `link:ctn' element.");
890 <E_surfxml_link_c_ctn>{
893 ETag_surfxml_link_c_ctn();
894 popbuffer(); /* attribute */
896 case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
897 case ROOT_surfxml_link_c_ctn: SET(EPILOG); break;
900 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link:ctn>' expected.",yytext);
901 . FAIL("Unexpected character `%c': `</link:ctn>' expected.",yytext[0]);
902 <<EOF>> FAIL("Premature EOF: `</link:ctn>' expected.");
905 <ROOT_surfxml_process,S_surfxml_platform_description_5,S_surfxml_platform_description_4,S_surfxml_platform_description_3,S_surfxml_platform_description_1,S_surfxml_platform_description>"<process"{s} {
906 AX_surfxml_process_host = 0;
907 AX_surfxml_process_function = 0;
908 AX_surfxml_process_start_time = 46;
909 AX_surfxml_process_kill_time = 51;
910 ENTER(AL_surfxml_process); pushbuffer(0);
913 <AL_surfxml_process>{
914 "host"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host);
915 "host"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host);
917 "function"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function);
918 "function"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function);
920 "start_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start_time);
921 "start_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start_time);
923 "kill_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill_time);
924 "kill_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill_time);
927 if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
928 if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
929 LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process);
932 if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
933 if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
934 LEAVE; STag_surfxml_process(); surfxml_pcdata_ix = 0; ETag_surfxml_process(); popbuffer(); /* attribute */
936 case S_surfxml_platform_description_5: case S_surfxml_platform_description_4: case S_surfxml_platform_description_3: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_5); break;
937 case ROOT_surfxml_process: SET(EPILOG); break;
940 . FAIL("Unexpected character `%c' in attribute list of process element.", yytext[0]);
941 {Name} FAIL("Bad attribute `%s' in `process' element start tag.",yytext);
942 <<EOF>> FAIL("EOF in attribute list of `process' element.");
945 <S_surfxml_process,E_surfxml_process,S_surfxml_process_2>{
948 ETag_surfxml_process();
949 popbuffer(); /* attribute */
951 case S_surfxml_platform_description_5: case S_surfxml_platform_description_4: case S_surfxml_platform_description_3: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_5); break;
952 case ROOT_surfxml_process: SET(EPILOG); break;
955 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</process>' expected.",yytext);
956 . FAIL("Unexpected character `%c': `</process>' expected.",yytext[0]);
957 <<EOF>> FAIL("Premature EOF: `</process>' expected.");
960 <ROOT_surfxml_argument,S_surfxml_process_1,S_surfxml_process,S_surfxml_process_2>"<argument"{s} {
961 AX_surfxml_argument_value = 0;
962 ENTER(AL_surfxml_argument); pushbuffer(0);
965 <AL_surfxml_argument>{
966 "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_argument_value);
967 "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_argument_value);
970 if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
971 LEAVE; STag_surfxml_argument();surfxml_pcdata_ix = 0; ENTER(E_surfxml_argument);
974 if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
975 LEAVE; STag_surfxml_argument(); surfxml_pcdata_ix = 0; ETag_surfxml_argument(); popbuffer(); /* attribute */
977 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
978 case ROOT_surfxml_argument: SET(EPILOG); break;
981 . FAIL("Unexpected character `%c' in attribute list of argument element.", yytext[0]);
982 {Name} FAIL("Bad attribute `%s' in `argument' element start tag.",yytext);
983 <<EOF>> FAIL("EOF in attribute list of `argument' element.");
986 <E_surfxml_argument>{
989 ETag_surfxml_argument();
990 popbuffer(); /* attribute */
992 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
993 case ROOT_surfxml_argument: SET(EPILOG); break;
996 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</argument>' expected.",yytext);
997 . FAIL("Unexpected character `%c': `</argument>' expected.",yytext[0]);
998 <<EOF>> FAIL("Premature EOF: `</argument>' expected.");
1001 /* EPILOG: after the root element. */
1004 . {SET(PROLOG); yyless(0); CLEANUP; return -1;}
1008 /* CHARACTER DATA. */
1010 <IMPOSSIBLE,VALUE1,VALUE2>{
1011 /* Non-defined standard entities... */
1012 "&" BUFFERPUTC('&');
1013 "<" BUFFERPUTC('<');
1014 ">" BUFFERPUTC('>');
1015 "'" BUFFERPUTC('\'');
1016 """ BUFFERPUTC('"');
1018 /* Character entities. */
1019 "&#"[[:digit:]]+";" BUFFERPUTC((unsigned char)atoi(yytext+2));
1020 "&#x"[[:xdigit:]]+";" BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
1023 <IMPOSSIBLE,VALUE1,VALUE2,CDATA>{
1027 "\n\r" BUFFERPUTC('\n');
1031 "<![CDATA[" ENTER(CDATA);
1032 "]""]>" FAIL("Unexpected `]""]>' in character data.");
1036 \' BUFFERDONE; LEAVE;
1037 <<EOF>> FAIL("EOF in literal (\"'\" expected).");
1041 \" BUFFERDONE; LEAVE;
1042 <<EOF>> FAIL("EOF in literal (`\"' expected).");
1045 <IMPOSSIBLE,VALUE1,VALUE2>{
1046 [^<&] BUFFERPUTC(yytext[0]);
1047 [<&] FAIL("Spurious `%c' in character data.",yytext[0]);
1052 /* "]""]" BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]); */
1053 . BUFFERPUTC(yytext[0]);
1054 <<EOF>> FAIL("EOF in CDATA section.");
1057 /* Impossible rules to avoid warnings from flex(1). */
1058 /* Ideally, this should be replaced by code in flexml.pl that
1059 generates just the states not covered by other rules. */
1061 .|[\n] FAIL("Syntax error on character `%c'.", yytext[0]);
1066 /* Element context stack lookup. */
1067 int surfxml_element_context(int i)
1069 return (0<i && i<yy_start_stack_depth
1070 ? yy_start_stack[yy_start_stack_ptr - i]
1075 void print_yy_stack(char* fmt, ...)
1077 int i = 0; va_list ap; va_start(ap, fmt);
1078 vfprintf(stderr, fmt, ap);
1079 if (surfxml_statenames) {
1080 for (i=1; i<yy_start_stack_ptr; i++) {
1081 fprintf(stderr, "%s/", surfxml_statenames[yy_start_stack[i] ]);
1083 fprintf(stderr,"%s\n", surfxml_statenames[YY_START]);
1088 void print_surfxml_bufferstack()
1091 fputs("Buffer: ", stderr);
1092 for (i = 0; i < blimit; i++) {
1093 if ( surfxml_bufferstack[i] == '\377' ) break;
1094 putc(surfxml_bufferstack[i], stderr);
1099 static void debug_enter(int state, const char* statename) {
1100 yy_push_state(state);
1101 if (yy_flex_debug) {
1102 print_yy_stack("--ENTER(%s) : ",statename);
1103 print_surfxml_bufferstack();
1107 static void debug_leave(void) {
1108 if (yy_flex_debug) {
1109 print_yy_stack("--LEAVE : ");
1110 print_surfxml_bufferstack();
1115 static void debug_set(int state, const char* statename) {
1117 if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename);
1122 static void cleanup(void)
1124 if (surfxml_statenames) {
1125 free(surfxml_statenames);
1126 surfxml_statenames = NULL;
1128 free(surfxml_bufferstack);
1129 surfxml_bufferstack = NULL;
1136 static int fail(const char* fmt, ...)
1138 int chars_left, used;
1139 va_list ap; va_start(ap, fmt);
1140 #ifdef FLEXML_yylineno
1141 used = sprintf(flexml_err_msg,
1142 "Invalid XML (XML input line %d, state %d): ",
1143 yylineno, YY_START);
1145 used = sprintf(flexml_err_msg,
1146 "Invalid XML (state %d): ",
1149 chars_left = flexml_max_err_msg_size - used - 1;
1150 vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
1153 #ifndef FLEXML_quiet_parser
1154 /* print directly to sdterr */
1155 fprintf(stderr, "%s\n", flexml_err_msg);
1156 flexml_err_msg[0] = '\0';