1 /* Validating XML processor for surf/surfxml.dtd.
2 * Generated 2007/10/23 11:08:07.
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 S_surfxml_platform_description_6 S_surfxml_platform_description_7 S_surfxml_platform_description_8 S_surfxml_platform_description_9 S_surfxml_platform_description_10 S_surfxml_platform_description_11 S_surfxml_platform_description_12 S_surfxml_platform_description_13 S_surfxml_platform_description_14 S_surfxml_platform_description_15 S_surfxml_platform_description_16 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[S_surfxml_platform_description_6] = "platform_description";
381 surfxml_statenames[S_surfxml_platform_description_7] = "platform_description";
382 surfxml_statenames[S_surfxml_platform_description_8] = "platform_description";
383 surfxml_statenames[S_surfxml_platform_description_9] = "platform_description";
384 surfxml_statenames[S_surfxml_platform_description_10] = "platform_description";
385 surfxml_statenames[S_surfxml_platform_description_11] = "platform_description";
386 surfxml_statenames[S_surfxml_platform_description_12] = "platform_description";
387 surfxml_statenames[S_surfxml_platform_description_13] = "platform_description";
388 surfxml_statenames[S_surfxml_platform_description_14] = "platform_description";
389 surfxml_statenames[S_surfxml_platform_description_15] = "platform_description";
390 surfxml_statenames[S_surfxml_platform_description_16] = "platform_description";
391 surfxml_statenames[E_surfxml_platform_description] = "platform_description";
392 surfxml_statenames[ROOT_surfxml_include] = NULL;
393 surfxml_statenames[AL_surfxml_include] = NULL;
394 surfxml_statenames[E_surfxml_include] = "include";
395 surfxml_statenames[ROOT_surfxml_host] = NULL;
396 surfxml_statenames[AL_surfxml_host] = NULL;
397 surfxml_statenames[S_surfxml_host] = "host";
398 surfxml_statenames[S_surfxml_host_1] = "host";
399 surfxml_statenames[S_surfxml_host_2] = "host";
400 surfxml_statenames[E_surfxml_host] = "host";
401 surfxml_statenames[ROOT_surfxml_prop] = NULL;
402 surfxml_statenames[AL_surfxml_prop] = NULL;
403 surfxml_statenames[E_surfxml_prop] = "prop";
404 surfxml_statenames[ROOT_surfxml_router] = NULL;
405 surfxml_statenames[AL_surfxml_router] = NULL;
406 surfxml_statenames[E_surfxml_router] = "router";
407 surfxml_statenames[ROOT_surfxml_link] = NULL;
408 surfxml_statenames[AL_surfxml_link] = NULL;
409 surfxml_statenames[S_surfxml_link] = "link";
410 surfxml_statenames[S_surfxml_link_1] = "link";
411 surfxml_statenames[S_surfxml_link_2] = "link";
412 surfxml_statenames[E_surfxml_link] = "link";
413 surfxml_statenames[ROOT_surfxml_route] = NULL;
414 surfxml_statenames[AL_surfxml_route] = NULL;
415 surfxml_statenames[S_surfxml_route] = "route";
416 surfxml_statenames[S_surfxml_route_1] = "route";
417 surfxml_statenames[S_surfxml_route_2] = "route";
418 surfxml_statenames[E_surfxml_route] = "route";
419 surfxml_statenames[ROOT_surfxml_link_c_ctn] = NULL;
420 surfxml_statenames[AL_surfxml_link_c_ctn] = NULL;
421 surfxml_statenames[E_surfxml_link_c_ctn] = "link:ctn";
422 surfxml_statenames[ROOT_surfxml_process] = NULL;
423 surfxml_statenames[AL_surfxml_process] = NULL;
424 surfxml_statenames[S_surfxml_process] = "process";
425 surfxml_statenames[S_surfxml_process_1] = "process";
426 surfxml_statenames[S_surfxml_process_2] = "process";
427 surfxml_statenames[E_surfxml_process] = "process";
428 surfxml_statenames[ROOT_surfxml_argument] = NULL;
429 surfxml_statenames[AL_surfxml_argument] = NULL;
430 surfxml_statenames[E_surfxml_argument] = "argument";
433 /* COMMENTS and PIs: handled uniformly for efficiency. */
435 <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,S_surfxml_platform_description_6,S_surfxml_platform_description_7,S_surfxml_platform_description_8,S_surfxml_platform_description_9,S_surfxml_platform_description_10,S_surfxml_platform_description_11,S_surfxml_platform_description_12,S_surfxml_platform_description_13,S_surfxml_platform_description_14,S_surfxml_platform_description_15,S_surfxml_platform_description_16,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>{
436 "<!--" ENTER(INCOMMENT);
444 <<EOF>> FAIL("EOF in comment.");
450 <<EOF>> FAIL("EOF in PI (processing instruction).");
453 /* SPACES: skipped uniformly */
455 <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,S_surfxml_platform_description_6,S_surfxml_platform_description_7,S_surfxml_platform_description_8,S_surfxml_platform_description_9,S_surfxml_platform_description_10,S_surfxml_platform_description_11,S_surfxml_platform_description_12,S_surfxml_platform_description_13,S_surfxml_platform_description_14,S_surfxml_platform_description_15,S_surfxml_platform_description_16,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;
457 /* PROLOG: determine root element and process it. */
460 "<?xml"({S}version{Eq}(\'{VersionNum}\'|\"{VersionNum}\"))?({S}encoding{Eq}(\'[^']*\'|\"[^"]*\"))?"?>" SET(DOCTYPE);
461 "<?xml"[^>]*">" FAIL("Bad declaration %s.",yytext);
465 "<!DOCTYPE"{S}"link"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_link);
466 "<!DOCTYPE"{S}"include"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_include);
467 "<!DOCTYPE"{S}"route"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_route);
468 "<!DOCTYPE"{S}"process"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_process);
469 "<!DOCTYPE"{S}"link:ctn"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_link_c_ctn);
470 "<!DOCTYPE"{S}"router"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_router);
471 "<!DOCTYPE"{S}"host"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_host);
472 "<!DOCTYPE"{S}"argument"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_argument);
473 "<!DOCTYPE"{S}"prop"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_prop);
474 "<!DOCTYPE"{S}"platform_description"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_platform_description);
475 "<!"[^>-][^>]*">" FAIL("Bad declaration %s.",yytext);
476 . FAIL("Unexpected character `%c' in prolog.", yytext[0]);
477 <<EOF>> FAIL("EOF in prolog.");
480 /* RULES DERIVED FROM DTD. */
482 /* <!-- Small DTD for SURF based tools. --> */
484 <ROOT_surfxml_platform_description>"<platform_description"{s} {
485 AX_surfxml_platform_description_version = 1;
486 ENTER(AL_surfxml_platform_description); pushbuffer(0);
489 <AL_surfxml_platform_description>{
490 "version"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_description_version);
491 "version"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_description_version);
494 LEAVE; STag_surfxml_platform_description();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform_description);
497 LEAVE; STag_surfxml_platform_description(); surfxml_pcdata_ix = 0; ETag_surfxml_platform_description(); popbuffer(); /* attribute */
499 case ROOT_surfxml_platform_description: SET(EPILOG); break;
502 . FAIL("Unexpected character `%c' in attribute list of platform_description element.", yytext[0]);
503 {Name} FAIL("Bad attribute `%s' in `platform_description' element start tag.",yytext);
504 <<EOF>> FAIL("EOF in attribute list of `platform_description' element.");
507 <S_surfxml_platform_description_8,S_surfxml_platform_description_16,E_surfxml_platform_description,S_surfxml_platform_description_2,S_surfxml_platform_description_5,S_surfxml_platform_description_9,S_surfxml_platform_description_11,S_surfxml_platform_description_12,S_surfxml_platform_description_14,S_surfxml_platform_description_3,S_surfxml_platform_description,S_surfxml_platform_description_6>{
508 "</platform_description"{s}">" {
510 ETag_surfxml_platform_description();
511 popbuffer(); /* attribute */
513 case ROOT_surfxml_platform_description: SET(EPILOG); break;
516 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</platform_description>' expected.",yytext);
517 . FAIL("Unexpected character `%c': `</platform_description>' expected.",yytext[0]);
518 <<EOF>> FAIL("Premature EOF: `</platform_description>' expected.");
521 <ROOT_surfxml_include,S_surfxml_platform_description_2,S_surfxml_platform_description_1,S_surfxml_platform_description>"<include"{s} {
522 AX_surfxml_include_file = 0;
523 ENTER(AL_surfxml_include); pushbuffer(0);
526 <AL_surfxml_include>{
527 "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_include_file);
528 "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_include_file);
531 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
532 LEAVE; STag_surfxml_include();surfxml_pcdata_ix = 0; ENTER(E_surfxml_include);
535 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
536 LEAVE; STag_surfxml_include(); surfxml_pcdata_ix = 0; ETag_surfxml_include(); popbuffer(); /* attribute */
538 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
539 case ROOT_surfxml_include: SET(EPILOG); break;
542 . FAIL("Unexpected character `%c' in attribute list of include element.", yytext[0]);
543 {Name} FAIL("Bad attribute `%s' in `include' element start tag.",yytext);
544 <<EOF>> FAIL("EOF in attribute list of `include' element.");
550 ETag_surfxml_include();
551 popbuffer(); /* attribute */
553 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
554 case ROOT_surfxml_include: SET(EPILOG); break;
557 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</include>' expected.",yytext);
558 . FAIL("Unexpected character `%c': `</include>' expected.",yytext[0]);
559 <<EOF>> FAIL("Premature EOF: `</include>' expected.");
562 <ROOT_surfxml_host,S_surfxml_platform_description_5,S_surfxml_platform_description,S_surfxml_platform_description_4>"<host"{s} {
563 AX_surfxml_host_id = 0;
564 AX_surfxml_host_power = 0;
565 AX_surfxml_host_availability = 5;
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 = 9;
570 AX_surfxml_host_interference_recv = 13;
571 AX_surfxml_host_interference_send_recv = 17;
572 AX_surfxml_host_max_outgoing_rate = 21;
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_description_5: case S_surfxml_platform_description: case S_surfxml_platform_description_4: SET(S_surfxml_platform_description_5); break;
620 case ROOT_surfxml_host: SET(EPILOG); break;
623 . FAIL("Unexpected character `%c' in attribute list of host element.", yytext[0]);
624 {Name} FAIL("Bad attribute `%s' in `host' element start tag.",yytext);
625 <<EOF>> FAIL("EOF in attribute list of `host' element.");
628 <S_surfxml_host,E_surfxml_host,S_surfxml_host_2>{
632 popbuffer(); /* attribute */
634 case S_surfxml_platform_description_5: case S_surfxml_platform_description: case S_surfxml_platform_description_4: SET(S_surfxml_platform_description_5); break;
635 case ROOT_surfxml_host: SET(EPILOG); break;
638 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</host>' expected.",yytext);
639 . FAIL("Unexpected character `%c': `</host>' expected.",yytext[0]);
640 <<EOF>> FAIL("Premature EOF: `</host>' expected.");
643 <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_host_2,S_surfxml_process_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 ROOT_surfxml_prop: SET(EPILOG); break;
669 case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
672 . FAIL("Unexpected character `%c' in attribute list of prop element.", yytext[0]);
673 {Name} FAIL("Bad attribute `%s' in `prop' element start tag.",yytext);
674 <<EOF>> FAIL("EOF in attribute list of `prop' element.");
681 popbuffer(); /* attribute */
683 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
684 case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
685 case ROOT_surfxml_prop: SET(EPILOG); break;
686 case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
689 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</prop>' expected.",yytext);
690 . FAIL("Unexpected character `%c': `</prop>' expected.",yytext[0]);
691 <<EOF>> FAIL("Premature EOF: `</prop>' expected.");
694 <ROOT_surfxml_router,S_surfxml_platform_description_8,S_surfxml_platform_description_5,S_surfxml_platform_description_3,S_surfxml_platform_description,S_surfxml_platform_description_7>"<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_description_8: case S_surfxml_platform_description_5: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_7: SET(S_surfxml_platform_description_8); break;
712 case ROOT_surfxml_router: SET(EPILOG); break;
715 . FAIL("Unexpected character `%c' in attribute list of router element.", yytext[0]);
716 {Name} FAIL("Bad attribute `%s' in `router' element start tag.",yytext);
717 <<EOF>> FAIL("EOF in attribute list of `router' element.");
723 ETag_surfxml_router();
724 popbuffer(); /* attribute */
726 case S_surfxml_platform_description_8: case S_surfxml_platform_description_5: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_7: SET(S_surfxml_platform_description_8); break;
727 case ROOT_surfxml_router: SET(EPILOG); break;
730 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</router>' expected.",yytext);
731 . FAIL("Unexpected character `%c': `</router>' expected.",yytext[0]);
732 <<EOF>> FAIL("Premature EOF: `</router>' expected.");
735 <ROOT_surfxml_link,S_surfxml_platform_description_8,S_surfxml_platform_description_10,S_surfxml_platform_description_5,S_surfxml_platform_description_11,S_surfxml_platform_description_3,S_surfxml_platform_description,S_surfxml_platform_description_6>"<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 = 26;
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_description_8: case S_surfxml_platform_description_10: case S_surfxml_platform_description_5: case S_surfxml_platform_description_11: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_6: SET(S_surfxml_platform_description_11); break;
787 case ROOT_surfxml_link: SET(EPILOG); break;
790 . FAIL("Unexpected character `%c' in attribute list of link element.", yytext[0]);
791 {Name} FAIL("Bad attribute `%s' in `link' element start tag.",yytext);
792 <<EOF>> FAIL("EOF in attribute list of `link' element.");
795 <E_surfxml_link,S_surfxml_link_2,S_surfxml_link>{
799 popbuffer(); /* attribute */
801 case S_surfxml_platform_description_8: case S_surfxml_platform_description_10: case S_surfxml_platform_description_5: case S_surfxml_platform_description_11: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_6: SET(S_surfxml_platform_description_11); break;
802 case ROOT_surfxml_link: SET(EPILOG); break;
805 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link>' expected.",yytext);
806 . FAIL("Unexpected character `%c': `</link>' expected.",yytext[0]);
807 <<EOF>> FAIL("Premature EOF: `</link>' expected.");
810 <ROOT_surfxml_route,S_surfxml_platform_description_8,S_surfxml_platform_description_5,S_surfxml_platform_description_9,S_surfxml_platform_description_11,S_surfxml_platform_description_13,S_surfxml_platform_description_14,S_surfxml_platform_description_3,S_surfxml_platform_description,S_surfxml_platform_description_6>"<route"{s} {
811 AX_surfxml_route_src = 0;
812 AX_surfxml_route_dst = 0;
813 AX_surfxml_route_impact_on_src = 30;
814 AX_surfxml_route_impact_on_dst = 34;
815 AX_surfxml_route_impact_on_src_with_other_recv = 38;
816 AX_surfxml_route_impact_on_dst_with_other_send = 42;
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_description_8: case S_surfxml_platform_description_5: case S_surfxml_platform_description_9: case S_surfxml_platform_description_11: case S_surfxml_platform_description_13: case S_surfxml_platform_description_14: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_6: SET(S_surfxml_platform_description_14); break;
850 case ROOT_surfxml_route: SET(EPILOG); break;
853 . FAIL("Unexpected character `%c' in attribute list of route element.", yytext[0]);
854 {Name} FAIL("Bad attribute `%s' in `route' element start tag.",yytext);
855 <<EOF>> FAIL("EOF in attribute list of `route' element.");
858 <S_surfxml_route,S_surfxml_route_2,E_surfxml_route>{
861 ETag_surfxml_route();
862 popbuffer(); /* attribute */
864 case S_surfxml_platform_description_8: case S_surfxml_platform_description_5: case S_surfxml_platform_description_9: case S_surfxml_platform_description_11: case S_surfxml_platform_description_13: case S_surfxml_platform_description_14: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_6: SET(S_surfxml_platform_description_14); break;
865 case ROOT_surfxml_route: SET(EPILOG); break;
868 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route>' expected.",yytext);
869 . FAIL("Unexpected character `%c': `</route>' expected.",yytext[0]);
870 <<EOF>> FAIL("Premature EOF: `</route>' expected.");
873 <ROOT_surfxml_link_c_ctn,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;
891 case ROOT_surfxml_link_c_ctn: SET(EPILOG); break;
894 . FAIL("Unexpected character `%c' in attribute list of link:ctn element.", yytext[0]);
895 {Name} FAIL("Bad attribute `%s' in `link:ctn' element start tag.",yytext);
896 <<EOF>> FAIL("EOF in attribute list of `link:ctn' element.");
899 <E_surfxml_link_c_ctn>{
902 ETag_surfxml_link_c_ctn();
903 popbuffer(); /* attribute */
905 case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
906 case ROOT_surfxml_link_c_ctn: SET(EPILOG); break;
909 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link:ctn>' expected.",yytext);
910 . FAIL("Unexpected character `%c': `</link:ctn>' expected.",yytext[0]);
911 <<EOF>> FAIL("Premature EOF: `</link:ctn>' expected.");
914 <ROOT_surfxml_process,S_surfxml_platform_description_8,S_surfxml_platform_description_16,S_surfxml_platform_description_5,S_surfxml_platform_description_9,S_surfxml_platform_description_11,S_surfxml_platform_description_15,S_surfxml_platform_description_12,S_surfxml_platform_description_14,S_surfxml_platform_description_3,S_surfxml_platform_description,S_surfxml_platform_description_6>"<process"{s} {
915 AX_surfxml_process_host = 0;
916 AX_surfxml_process_function = 0;
917 AX_surfxml_process_start_time = 46;
918 AX_surfxml_process_kill_time = 51;
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_description_8: case S_surfxml_platform_description_16: case S_surfxml_platform_description_5: case S_surfxml_platform_description_9: case S_surfxml_platform_description_11: case S_surfxml_platform_description_15: case S_surfxml_platform_description_12: case S_surfxml_platform_description_14: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_6: SET(S_surfxml_platform_description_16); break;
946 case ROOT_surfxml_process: SET(EPILOG); break;
949 . FAIL("Unexpected character `%c' in attribute list of process element.", yytext[0]);
950 {Name} FAIL("Bad attribute `%s' in `process' element start tag.",yytext);
951 <<EOF>> FAIL("EOF in attribute list of `process' element.");
954 <E_surfxml_process,S_surfxml_process,S_surfxml_process_2>{
957 ETag_surfxml_process();
958 popbuffer(); /* attribute */
960 case S_surfxml_platform_description_8: case S_surfxml_platform_description_16: case S_surfxml_platform_description_5: case S_surfxml_platform_description_9: case S_surfxml_platform_description_11: case S_surfxml_platform_description_15: case S_surfxml_platform_description_12: case S_surfxml_platform_description_14: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_6: SET(S_surfxml_platform_description_16); break;
961 case ROOT_surfxml_process: SET(EPILOG); break;
964 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</process>' expected.",yytext);
965 . FAIL("Unexpected character `%c': `</process>' expected.",yytext[0]);
966 <<EOF>> FAIL("Premature EOF: `</process>' expected.");
969 <ROOT_surfxml_argument,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;
987 case ROOT_surfxml_argument: SET(EPILOG); break;
990 . FAIL("Unexpected character `%c' in attribute list of argument element.", yytext[0]);
991 {Name} FAIL("Bad attribute `%s' in `argument' element start tag.",yytext);
992 <<EOF>> FAIL("EOF in attribute list of `argument' element.");
995 <E_surfxml_argument>{
998 ETag_surfxml_argument();
999 popbuffer(); /* attribute */
1001 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1002 case ROOT_surfxml_argument: SET(EPILOG); break;
1005 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</argument>' expected.",yytext);
1006 . FAIL("Unexpected character `%c': `</argument>' expected.",yytext[0]);
1007 <<EOF>> FAIL("Premature EOF: `</argument>' expected.");
1010 /* EPILOG: after the root element. */
1013 . {SET(PROLOG); yyless(0); CLEANUP; return -1;}
1017 /* CHARACTER DATA. */
1019 <IMPOSSIBLE,VALUE1,VALUE2>{
1020 /* Non-defined standard entities... */
1021 "&" BUFFERPUTC('&');
1022 "<" BUFFERPUTC('<');
1023 ">" BUFFERPUTC('>');
1024 "'" BUFFERPUTC('\'');
1025 """ BUFFERPUTC('"');
1027 /* Character entities. */
1028 "&#"[[:digit:]]+";" BUFFERPUTC((unsigned char)atoi(yytext+2));
1029 "&#x"[[:xdigit:]]+";" BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
1032 <IMPOSSIBLE,VALUE1,VALUE2,CDATA>{
1036 "\n\r" BUFFERPUTC('\n');
1040 "<![CDATA[" ENTER(CDATA);
1041 "]""]>" FAIL("Unexpected `]""]>' in character data.");
1045 \' BUFFERDONE; LEAVE;
1046 <<EOF>> FAIL("EOF in literal (\"'\" expected).");
1050 \" BUFFERDONE; LEAVE;
1051 <<EOF>> FAIL("EOF in literal (`\"' expected).");
1054 <IMPOSSIBLE,VALUE1,VALUE2>{
1055 [^<&] BUFFERPUTC(yytext[0]);
1056 [<&] FAIL("Spurious `%c' in character data.",yytext[0]);
1061 /* "]""]" BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]); */
1062 . BUFFERPUTC(yytext[0]);
1063 <<EOF>> FAIL("EOF in CDATA section.");
1066 /* Impossible rules to avoid warnings from flex(1). */
1067 /* Ideally, this should be replaced by code in flexml.pl that
1068 generates just the states not covered by other rules. */
1070 .|[\n] FAIL("Syntax error on character `%c'.", yytext[0]);
1075 /* Element context stack lookup. */
1076 int surfxml_element_context(int i)
1078 return (0<i && i<yy_start_stack_depth
1079 ? yy_start_stack[yy_start_stack_ptr - i]
1084 void print_yy_stack(char* fmt, ...)
1086 int i = 0; va_list ap; va_start(ap, fmt);
1087 vfprintf(stderr, fmt, ap);
1088 if (surfxml_statenames) {
1089 for (i=1; i<yy_start_stack_ptr; i++) {
1090 fprintf(stderr, "%s/", surfxml_statenames[yy_start_stack[i] ]);
1092 fprintf(stderr,"%s\n", surfxml_statenames[YY_START]);
1097 void print_surfxml_bufferstack()
1100 fputs("Buffer: ", stderr);
1101 for (i = 0; i < blimit; i++) {
1102 if ( surfxml_bufferstack[i] == '\377' ) break;
1103 putc(surfxml_bufferstack[i], stderr);
1108 static void debug_enter(int state, const char* statename) {
1109 yy_push_state(state);
1110 if (yy_flex_debug) {
1111 print_yy_stack("--ENTER(%s) : ",statename);
1112 print_surfxml_bufferstack();
1116 static void debug_leave(void) {
1117 if (yy_flex_debug) {
1118 print_yy_stack("--LEAVE : ");
1119 print_surfxml_bufferstack();
1124 static void debug_set(int state, const char* statename) {
1126 if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename);
1131 static void cleanup(void)
1133 if (surfxml_statenames) {
1134 free(surfxml_statenames);
1135 surfxml_statenames = NULL;
1137 free(surfxml_bufferstack);
1138 surfxml_bufferstack = NULL;
1145 static int fail(const char* fmt, ...)
1147 int chars_left, used;
1148 va_list ap; va_start(ap, fmt);
1149 #ifdef FLEXML_yylineno
1150 used = sprintf(flexml_err_msg,
1151 "Invalid XML (XML input line %d, state %d): ",
1152 yylineno, YY_START);
1154 used = sprintf(flexml_err_msg,
1155 "Invalid XML (state %d): ",
1158 chars_left = flexml_max_err_msg_size - used - 1;
1159 vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
1162 #ifndef FLEXML_quiet_parser
1163 /* print directly to sdterr */
1164 fprintf(stderr, "%s\n", flexml_err_msg);
1165 flexml_err_msg[0] = '\0';