1 /* Validating XML processor for surf/surfxml.dtd.
2 * Generated 2007/08/09 10:57:49.
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_network_link_bandwidth AX_surfxml_network_link_bandwidth;
81 #define A_surfxml_network_link_bandwidth (surfxml_bufferstack + AX_surfxml_network_link_bandwidth)
82 AT_surfxml_router_name AX_surfxml_router_name;
83 #define A_surfxml_router_name (surfxml_bufferstack + AX_surfxml_router_name)
84 AT_surfxml_process_host AX_surfxml_process_host;
85 #define A_surfxml_process_host (surfxml_bufferstack + AX_surfxml_process_host)
86 AT_surfxml_network_link_latency_file AX_surfxml_network_link_latency_file;
87 #define A_surfxml_network_link_latency_file (surfxml_bufferstack + AX_surfxml_network_link_latency_file)
88 AT_surfxml_route_impact_on_dst_with_other_send AX_surfxml_route_impact_on_dst_with_other_send;
89 #define A_surfxml_route_impact_on_dst_with_other_send (surfxml_bufferstack + AX_surfxml_route_impact_on_dst_with_other_send)
90 AT_surfxml_cpu_interference_send_recv AX_surfxml_cpu_interference_send_recv;
91 #define A_surfxml_cpu_interference_send_recv (surfxml_bufferstack + AX_surfxml_cpu_interference_send_recv)
92 AT_surfxml_route_impact_on_dst AX_surfxml_route_impact_on_dst;
93 #define A_surfxml_route_impact_on_dst (surfxml_bufferstack + AX_surfxml_route_impact_on_dst)
94 AT_surfxml_platform_description_version AX_surfxml_platform_description_version;
95 #define A_surfxml_platform_description_version (surfxml_bufferstack + AX_surfxml_platform_description_version)
96 AT_surfxml_route_impact_on_src_with_other_recv AX_surfxml_route_impact_on_src_with_other_recv;
97 #define A_surfxml_route_impact_on_src_with_other_recv (surfxml_bufferstack + AX_surfxml_route_impact_on_src_with_other_recv)
98 AT_surfxml_route_element_name AX_surfxml_route_element_name;
99 #define A_surfxml_route_element_name (surfxml_bufferstack + AX_surfxml_route_element_name)
100 AT_surfxml_process_start_time AX_surfxml_process_start_time;
101 #define A_surfxml_process_start_time (surfxml_bufferstack + AX_surfxml_process_start_time)
102 AT_surfxml_process_function AX_surfxml_process_function;
103 #define A_surfxml_process_function (surfxml_bufferstack + AX_surfxml_process_function)
104 AT_surfxml_cpu_state AX_surfxml_cpu_state;
105 #define A_surfxml_cpu_state AX_surfxml_cpu_state
106 AT_surfxml_cpu_interference_send AX_surfxml_cpu_interference_send;
107 #define A_surfxml_cpu_interference_send (surfxml_bufferstack + AX_surfxml_cpu_interference_send)
108 AT_surfxml_network_link_bandwidth_file AX_surfxml_network_link_bandwidth_file;
109 #define A_surfxml_network_link_bandwidth_file (surfxml_bufferstack + AX_surfxml_network_link_bandwidth_file)
110 AT_surfxml_cpu_name AX_surfxml_cpu_name;
111 #define A_surfxml_cpu_name (surfxml_bufferstack + AX_surfxml_cpu_name)
112 AT_surfxml_process_kill_time AX_surfxml_process_kill_time;
113 #define A_surfxml_process_kill_time (surfxml_bufferstack + AX_surfxml_process_kill_time)
114 AT_surfxml_network_link_state AX_surfxml_network_link_state;
115 #define A_surfxml_network_link_state AX_surfxml_network_link_state
116 AT_surfxml_cpu_availability_file AX_surfxml_cpu_availability_file;
117 #define A_surfxml_cpu_availability_file (surfxml_bufferstack + AX_surfxml_cpu_availability_file)
118 AT_surfxml_argument_value AX_surfxml_argument_value;
119 #define A_surfxml_argument_value (surfxml_bufferstack + AX_surfxml_argument_value)
120 AT_surfxml_route_src AX_surfxml_route_src;
121 #define A_surfxml_route_src (surfxml_bufferstack + AX_surfxml_route_src)
122 AT_surfxml_route_impact_on_src AX_surfxml_route_impact_on_src;
123 #define A_surfxml_route_impact_on_src (surfxml_bufferstack + AX_surfxml_route_impact_on_src)
124 AT_surfxml_cpu_max_outgoing_rate AX_surfxml_cpu_max_outgoing_rate;
125 #define A_surfxml_cpu_max_outgoing_rate (surfxml_bufferstack + AX_surfxml_cpu_max_outgoing_rate)
126 AT_surfxml_cpu_availability AX_surfxml_cpu_availability;
127 #define A_surfxml_cpu_availability (surfxml_bufferstack + AX_surfxml_cpu_availability)
128 AT_surfxml_cpu_interference_recv AX_surfxml_cpu_interference_recv;
129 #define A_surfxml_cpu_interference_recv (surfxml_bufferstack + AX_surfxml_cpu_interference_recv)
130 AT_surfxml_network_link_name AX_surfxml_network_link_name;
131 #define A_surfxml_network_link_name (surfxml_bufferstack + AX_surfxml_network_link_name)
132 AT_surfxml_cpu_power AX_surfxml_cpu_power;
133 #define A_surfxml_cpu_power (surfxml_bufferstack + AX_surfxml_cpu_power)
134 AT_surfxml_include_file AX_surfxml_include_file;
135 #define A_surfxml_include_file (surfxml_bufferstack + AX_surfxml_include_file)
136 AT_surfxml_network_link_sharing_policy AX_surfxml_network_link_sharing_policy;
137 #define A_surfxml_network_link_sharing_policy AX_surfxml_network_link_sharing_policy
138 AT_surfxml_route_dst AX_surfxml_route_dst;
139 #define A_surfxml_route_dst (surfxml_bufferstack + AX_surfxml_route_dst)
140 AT_surfxml_network_link_latency AX_surfxml_network_link_latency;
141 #define A_surfxml_network_link_latency (surfxml_bufferstack + AX_surfxml_network_link_latency)
142 AT_surfxml_cpu_state_file AX_surfxml_cpu_state_file;
143 #define A_surfxml_cpu_state_file (surfxml_bufferstack + AX_surfxml_cpu_state_file)
144 AT_surfxml_network_link_state_file AX_surfxml_network_link_state_file;
145 #define A_surfxml_network_link_state_file (surfxml_bufferstack + AX_surfxml_network_link_state_file)
149 # define ENTER(state) debug_enter(state,#state)
150 # define LEAVE debug_leave()
151 # define SET(state) debug_set(state,#state)
152 static void debug_enter(int, const char*);
153 static void debug_leave(void);
154 static void debug_set(int, const char*);
156 # define ENTER(state) (yy_push_state(state))
157 # define LEAVE (yy_pop_state())
158 # define SET(state) BEGIN(state)
161 /* Generic actions. */
162 #define SKIP /*skip*/
163 #define SUCCEED CLEANUP; return 0
165 #define FAIL return fail
166 static int fail(const char*, ...);
168 enum {flexml_max_err_msg_size = 512};
169 static char flexml_err_msg[flexml_max_err_msg_size];
170 const char * surfxml_parse_err_msg()
172 return flexml_err_msg;
174 static void reset_surfxml_parse_err_msg()
176 flexml_err_msg[0] = '\0';
180 static void cleanup(void);
181 #define CLEANUP cleanup()
183 /* Text buffer stack handling. */
184 char *surfxml_bufferstack = NULL;
185 static int blimit = FLEXML_BUFFERSTACKSIZE;
186 static int bnext = 1;
188 static int *indexstack = NULL;
189 static int ilimit = FLEXML_INDEXSTACKSIZE;
190 static int inext = 1;
192 #define BUFFERSET(P) (P = bnext)
193 #define BUFFERPUTC(C) (ck_blimit(), surfxml_bufferstack[bnext++] = (C))
194 #define BUFFERDONE (BUFFERPUTC('\0'))
196 #define BUFFERLITERAL(C, P) surfxml_bufferliteral(C, &(P), yytext)
198 /* after this is called, there are at least 2 slots left in the stack */
199 static int ck_blimit()
201 if (bnext >= blimit) {
202 blimit += FLEXML_BUFFERSTACKSIZE + 2;
204 char *temp = (char *) realloc(surfxml_bufferstack, blimit);
206 surfxml_bufferstack = temp;
212 /* after this is called, there are at least 2 slots left in the stack */
213 static int ck_ilimit()
215 if (inext >= ilimit) {
216 ilimit += FLEXML_INDEXSTACKSIZE + 2;
218 int *temp = (int *) realloc(indexstack, ilimit);
226 #ifdef FLEXML_NEED_BUFFERLIT
227 static void surfxml_bufferliteral(char c, int* pp, const char* text)
229 const char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c);
230 assert(s <= e); BUFFERSET(*pp);
232 if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
239 static void pushbuffer(int p)
242 indexstack[inext++] = p;
243 indexstack[inext++] = bnext;
246 static int popbuffer(void)
249 bnext = indexstack[--inext];
250 return indexstack[--inext];
253 /* General internal entities are `unput' back onto the input stream... */
254 #define ENTITYTEXT(T) \
255 { char *s = (T), *e = s+strlen(s);\
256 while (--e >= s) { unput(*e); }}
261 /* Flex standard options. */
263 %option noyy_top_state
269 /* Flex user-requested options. */
273 /* XML character classes (currently restricted to ASCII). */
275 /* "Common syntactic structures." */
279 /* "Names and Tokens." */
280 NameChar [A-Za-z0-9.:_-]
281 Name [A-Za-z_:]{NameChar}*
282 Names {Name}({S}{Name})*
283 Nmtoken ({NameChar})+
284 Nmtokens {Nmtoken}({S}{Nmtoken})*
287 VersionNum [a-zA-Z0-9_.:-]+
289 Literal \'[^'']*\'|\"[^""]*\"
291 /* Parser states (flex `exclusive start conditions'):
293 * PROLOG the XML prolog of the document before <?xml...>
294 * DOCTYPE the XML prolog of the document after <?xml...>
295 * EPILOG after the root element
296 * INCOMMENT inside an XML comment <!--....-->
297 * INPI inside an XML PI <?...?>
298 * VALUE1 inside a '...'-delimited literal
299 * VALUE2 inside a "..."-delimited literal
300 * CDATA inside a <![CDATA[...] ]> section.
301 * ROOT_<tag> expect root element <tag>
302 * AL_<tag> inside the attribute list for <tag>
303 * IN_<tag> inside a <tag> with element contents (ready for end tag)
304 * IMPOSSIBLE dummy to permit disabling rules; must be last
306 %x PROLOG DOCTYPE EPILOG INCOMMENT INPI VALUE1 VALUE2 CDATA
307 %x ROOT_surfxml_platform_description AL_surfxml_platform_description S_surfxml_platform_description S_surfxml_platform_description_1 S_surfxml_platform_description_2 E_surfxml_platform_description
308 %x ROOT_surfxml_include AL_surfxml_include S_surfxml_include S_surfxml_include_1 S_surfxml_include_2 E_surfxml_include
309 %x ROOT_surfxml_cpu AL_surfxml_cpu E_surfxml_cpu
310 %x ROOT_surfxml_router AL_surfxml_router E_surfxml_router
311 %x ROOT_surfxml_network_link AL_surfxml_network_link E_surfxml_network_link
312 %x ROOT_surfxml_route AL_surfxml_route S_surfxml_route S_surfxml_route_1 S_surfxml_route_2 E_surfxml_route
313 %x ROOT_surfxml_route_element AL_surfxml_route_element E_surfxml_route_element
314 %x ROOT_surfxml_process AL_surfxml_process S_surfxml_process S_surfxml_process_1 S_surfxml_process_2 E_surfxml_process
315 %x ROOT_surfxml_argument AL_surfxml_argument E_surfxml_argument
320 const char* *surfxml_statenames=NULL;
325 /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
327 reset_surfxml_parse_err_msg();
328 surfxml_bufferstack = (char *) malloc(FLEXML_BUFFERSTACKSIZE);
329 assert(surfxml_bufferstack);
333 for (i = 0; i < blimit; i++) {
334 surfxml_bufferstack[i] = '\377';
338 surfxml_bufferstack[0] = '\0';
339 indexstack = (int *) malloc(FLEXML_INDEXSTACKSIZE * sizeof(int));
345 surfxml_bufferliteral('\0', &bnext, "0.0");
346 surfxml_bufferliteral('\0', &bnext, "1.0");
347 surfxml_bufferliteral('\0', &bnext, "1.0");
348 surfxml_bufferliteral('\0', &bnext, "1.0");
349 surfxml_bufferliteral('\0', &bnext, "1.0");
350 surfxml_bufferliteral('\0', &bnext, "-1.0");
351 surfxml_bufferliteral('\0', &bnext, "0.0");
352 surfxml_bufferliteral('\0', &bnext, "0.0");
353 surfxml_bufferliteral('\0', &bnext, "0.0");
354 surfxml_bufferliteral('\0', &bnext, "0.0");
355 surfxml_bufferliteral('\0', &bnext, "0.0");
356 surfxml_bufferliteral('\0', &bnext, "-1.0");
357 surfxml_bufferliteral('\0', &bnext, "-1.0");
358 if(!surfxml_statenames) {surfxml_statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*));
359 surfxml_statenames[PROLOG] = NULL;
360 surfxml_statenames[DOCTYPE] = NULL;
361 surfxml_statenames[EPILOG] = NULL;
362 surfxml_statenames[INCOMMENT] = NULL;
363 surfxml_statenames[INPI] = NULL;
364 surfxml_statenames[VALUE1] = NULL;
365 surfxml_statenames[VALUE2] = NULL;
366 surfxml_statenames[CDATA] = NULL;
367 surfxml_statenames[ROOT_surfxml_platform_description] = NULL;
368 surfxml_statenames[AL_surfxml_platform_description] = NULL;
369 surfxml_statenames[S_surfxml_platform_description] = "platform_description";
370 surfxml_statenames[S_surfxml_platform_description_1] = "platform_description";
371 surfxml_statenames[S_surfxml_platform_description_2] = "platform_description";
372 surfxml_statenames[E_surfxml_platform_description] = "platform_description";
373 surfxml_statenames[ROOT_surfxml_include] = NULL;
374 surfxml_statenames[AL_surfxml_include] = NULL;
375 surfxml_statenames[S_surfxml_include] = "include";
376 surfxml_statenames[S_surfxml_include_1] = "include";
377 surfxml_statenames[S_surfxml_include_2] = "include";
378 surfxml_statenames[E_surfxml_include] = "include";
379 surfxml_statenames[ROOT_surfxml_cpu] = NULL;
380 surfxml_statenames[AL_surfxml_cpu] = NULL;
381 surfxml_statenames[E_surfxml_cpu] = "cpu";
382 surfxml_statenames[ROOT_surfxml_router] = NULL;
383 surfxml_statenames[AL_surfxml_router] = NULL;
384 surfxml_statenames[E_surfxml_router] = "router";
385 surfxml_statenames[ROOT_surfxml_network_link] = NULL;
386 surfxml_statenames[AL_surfxml_network_link] = NULL;
387 surfxml_statenames[E_surfxml_network_link] = "network_link";
388 surfxml_statenames[ROOT_surfxml_route] = NULL;
389 surfxml_statenames[AL_surfxml_route] = NULL;
390 surfxml_statenames[S_surfxml_route] = "route";
391 surfxml_statenames[S_surfxml_route_1] = "route";
392 surfxml_statenames[S_surfxml_route_2] = "route";
393 surfxml_statenames[E_surfxml_route] = "route";
394 surfxml_statenames[ROOT_surfxml_route_element] = NULL;
395 surfxml_statenames[AL_surfxml_route_element] = NULL;
396 surfxml_statenames[E_surfxml_route_element] = "route_element";
397 surfxml_statenames[ROOT_surfxml_process] = NULL;
398 surfxml_statenames[AL_surfxml_process] = NULL;
399 surfxml_statenames[S_surfxml_process] = "process";
400 surfxml_statenames[S_surfxml_process_1] = "process";
401 surfxml_statenames[S_surfxml_process_2] = "process";
402 surfxml_statenames[E_surfxml_process] = "process";
403 surfxml_statenames[ROOT_surfxml_argument] = NULL;
404 surfxml_statenames[AL_surfxml_argument] = NULL;
405 surfxml_statenames[E_surfxml_argument] = "argument";
408 /* COMMENTS and PIs: handled uniformly for efficiency. */
410 <ROOT_surfxml_platform_description,AL_surfxml_platform_description,S_surfxml_platform_description,S_surfxml_platform_description_1,S_surfxml_platform_description_2,E_surfxml_platform_description,ROOT_surfxml_include,AL_surfxml_include,S_surfxml_include,S_surfxml_include_1,S_surfxml_include_2,E_surfxml_include,ROOT_surfxml_cpu,AL_surfxml_cpu,E_surfxml_cpu,ROOT_surfxml_router,AL_surfxml_router,E_surfxml_router,ROOT_surfxml_network_link,AL_surfxml_network_link,E_surfxml_network_link,ROOT_surfxml_route,AL_surfxml_route,S_surfxml_route,S_surfxml_route_1,S_surfxml_route_2,E_surfxml_route,ROOT_surfxml_route_element,AL_surfxml_route_element,E_surfxml_route_element,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>{
411 "<!--" ENTER(INCOMMENT);
419 <<EOF>> FAIL("EOF in comment.");
425 <<EOF>> FAIL("EOF in PI (processing instruction).");
428 /* SPACES: skipped uniformly */
430 <ROOT_surfxml_platform_description,AL_surfxml_platform_description,S_surfxml_platform_description,S_surfxml_platform_description_1,S_surfxml_platform_description_2,E_surfxml_platform_description,ROOT_surfxml_include,AL_surfxml_include,S_surfxml_include,S_surfxml_include_1,S_surfxml_include_2,E_surfxml_include,ROOT_surfxml_cpu,AL_surfxml_cpu,E_surfxml_cpu,ROOT_surfxml_router,AL_surfxml_router,E_surfxml_router,ROOT_surfxml_network_link,AL_surfxml_network_link,E_surfxml_network_link,ROOT_surfxml_route,AL_surfxml_route,S_surfxml_route,S_surfxml_route_1,S_surfxml_route_2,E_surfxml_route,ROOT_surfxml_route_element,AL_surfxml_route_element,E_surfxml_route_element,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;
432 /* PROLOG: determine root element and process it. */
435 "<?xml"({S}version{Eq}(\'{VersionNum}\'|\"{VersionNum}\"))?({S}encoding{Eq}(\'[^']*\'|\"[^"]*\"))?"?>" SET(DOCTYPE);
436 "<?xml"[^>]*">" FAIL("Bad declaration %s.",yytext);
440 "<!DOCTYPE"{S}"cpu"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_cpu);
441 "<!DOCTYPE"{S}"include"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_include);
442 "<!DOCTYPE"{S}"route"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_route);
443 "<!DOCTYPE"{S}"network_link"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_network_link);
444 "<!DOCTYPE"{S}"process"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_process);
445 "<!DOCTYPE"{S}"router"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_router);
446 "<!DOCTYPE"{S}"argument"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_argument);
447 "<!DOCTYPE"{S}"route_element"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_route_element);
448 "<!DOCTYPE"{S}"platform_description"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_platform_description);
449 "<!"[^>-][^>]*">" FAIL("Bad declaration %s.",yytext);
450 . FAIL("Unexpected character `%c' in prolog.", yytext[0]);
451 <<EOF>> FAIL("EOF in prolog.");
454 /* RULES DERIVED FROM DTD. */
456 /* <!-- Small DTD for SURF based tools. --> */
458 <ROOT_surfxml_platform_description>"<platform_description"{s} {
459 AX_surfxml_platform_description_version = 1;
460 ENTER(AL_surfxml_platform_description); pushbuffer(0);
463 <AL_surfxml_platform_description>{
464 "version"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_description_version);
465 "version"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_description_version);
468 LEAVE; STag_surfxml_platform_description();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform_description);
471 LEAVE; STag_surfxml_platform_description(); surfxml_pcdata_ix = 0; ETag_surfxml_platform_description(); popbuffer(); /* attribute */
473 case ROOT_surfxml_platform_description: SET(EPILOG); break;
476 . FAIL("Unexpected character `%c' in attribute list of platform_description element.", yytext[0]);
477 {Name} FAIL("Bad attribute `%s' in `platform_description' element start tag.",yytext);
478 <<EOF>> FAIL("EOF in attribute list of `platform_description' element.");
481 <E_surfxml_platform_description,S_surfxml_platform_description_2,S_surfxml_platform_description>{
482 "</platform_description"{s}">" {
484 ETag_surfxml_platform_description();
485 popbuffer(); /* attribute */
487 case ROOT_surfxml_platform_description: SET(EPILOG); break;
490 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</platform_description>' expected.",yytext);
491 . FAIL("Unexpected character `%c': `</platform_description>' expected.",yytext[0]);
492 <<EOF>> FAIL("Premature EOF: `</platform_description>' expected.");
495 <ROOT_surfxml_include,S_surfxml_platform_description_2,S_surfxml_include,S_surfxml_include_2,S_surfxml_platform_description_1,S_surfxml_include_1,S_surfxml_platform_description>"<include"{s} {
496 AX_surfxml_include_file = 0;
497 ENTER(AL_surfxml_include); pushbuffer(0);
500 <AL_surfxml_include>{
501 "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_include_file);
502 "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_include_file);
505 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
506 LEAVE; STag_surfxml_include();surfxml_pcdata_ix = 0; ENTER(S_surfxml_include);
509 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
510 LEAVE; STag_surfxml_include(); surfxml_pcdata_ix = 0; ETag_surfxml_include(); popbuffer(); /* attribute */
512 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
513 case ROOT_surfxml_include: SET(EPILOG); break;
514 case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
517 . FAIL("Unexpected character `%c' in attribute list of include element.", yytext[0]);
518 {Name} FAIL("Bad attribute `%s' in `include' element start tag.",yytext);
519 <<EOF>> FAIL("EOF in attribute list of `include' element.");
522 <E_surfxml_include,S_surfxml_include,S_surfxml_include_2>{
525 ETag_surfxml_include();
526 popbuffer(); /* attribute */
528 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
529 case ROOT_surfxml_include: SET(EPILOG); break;
530 case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
533 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</include>' expected.",yytext);
534 . FAIL("Unexpected character `%c': `</include>' expected.",yytext[0]);
535 <<EOF>> FAIL("Premature EOF: `</include>' expected.");
538 <ROOT_surfxml_cpu,S_surfxml_platform_description_2,S_surfxml_include,S_surfxml_include_2,S_surfxml_platform_description_1,S_surfxml_include_1,S_surfxml_platform_description>"<cpu"{s} {
539 AX_surfxml_cpu_name = 0;
540 AX_surfxml_cpu_power = 0;
541 AX_surfxml_cpu_availability = 5;
542 AX_surfxml_cpu_availability_file = 0;
543 AX_surfxml_cpu_state = A_surfxml_cpu_state_ON;
544 AX_surfxml_cpu_state_file = 0;
545 AX_surfxml_cpu_interference_send = 9;
546 AX_surfxml_cpu_interference_recv = 13;
547 AX_surfxml_cpu_interference_send_recv = 17;
548 AX_surfxml_cpu_max_outgoing_rate = 21;
549 ENTER(AL_surfxml_cpu); pushbuffer(0);
553 "name"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_name);
554 "name"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_name);
556 "power"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_power);
557 "power"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_power);
559 "availability"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_availability);
560 "availability"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_availability);
562 "availability_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_availability_file);
563 "availability_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_availability_file);
566 "state"{Eq}"\"ON\"" A_surfxml_cpu_state = A_surfxml_cpu_state_ON;
568 "state"{Eq}"\"OFF\"" A_surfxml_cpu_state = A_surfxml_cpu_state_OFF;
570 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_state_file);
571 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_state_file);
573 "interference_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_interference_send);
574 "interference_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_interference_send);
576 "interference_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_interference_recv);
577 "interference_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_interference_recv);
579 "interference_send_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_interference_send_recv);
580 "interference_send_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_interference_send_recv);
582 "max_outgoing_rate"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_max_outgoing_rate);
583 "max_outgoing_rate"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_max_outgoing_rate);
586 if (!AX_surfxml_cpu_name) FAIL("Required attribute `name' not set for `cpu' element.");
587 if (!AX_surfxml_cpu_power) FAIL("Required attribute `power' not set for `cpu' element.");
588 LEAVE; STag_surfxml_cpu();surfxml_pcdata_ix = 0; ENTER(E_surfxml_cpu);
591 if (!AX_surfxml_cpu_name) FAIL("Required attribute `name' not set for `cpu' element.");
592 if (!AX_surfxml_cpu_power) FAIL("Required attribute `power' not set for `cpu' element.");
593 LEAVE; STag_surfxml_cpu(); surfxml_pcdata_ix = 0; ETag_surfxml_cpu(); popbuffer(); /* attribute */
595 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
596 case ROOT_surfxml_cpu: SET(EPILOG); break;
597 case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
600 . FAIL("Unexpected character `%c' in attribute list of cpu element.", yytext[0]);
601 {Name} FAIL("Bad attribute `%s' in `cpu' element start tag.",yytext);
602 <<EOF>> FAIL("EOF in attribute list of `cpu' element.");
609 popbuffer(); /* attribute */
611 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
612 case ROOT_surfxml_cpu: SET(EPILOG); break;
613 case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
616 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</cpu>' expected.",yytext);
617 . FAIL("Unexpected character `%c': `</cpu>' expected.",yytext[0]);
618 <<EOF>> FAIL("Premature EOF: `</cpu>' expected.");
621 <ROOT_surfxml_router,S_surfxml_platform_description_2,S_surfxml_include,S_surfxml_include_2,S_surfxml_platform_description_1,S_surfxml_include_1,S_surfxml_platform_description>"<router"{s} {
622 AX_surfxml_router_name = 0;
623 ENTER(AL_surfxml_router); pushbuffer(0);
627 "name"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_router_name);
628 "name"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_router_name);
631 if (!AX_surfxml_router_name) FAIL("Required attribute `name' not set for `router' element.");
632 LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router);
635 if (!AX_surfxml_router_name) FAIL("Required attribute `name' not set for `router' element.");
636 LEAVE; STag_surfxml_router(); surfxml_pcdata_ix = 0; ETag_surfxml_router(); popbuffer(); /* attribute */
638 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
639 case ROOT_surfxml_router: SET(EPILOG); break;
640 case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
643 . FAIL("Unexpected character `%c' in attribute list of router element.", yytext[0]);
644 {Name} FAIL("Bad attribute `%s' in `router' element start tag.",yytext);
645 <<EOF>> FAIL("EOF in attribute list of `router' element.");
651 ETag_surfxml_router();
652 popbuffer(); /* attribute */
654 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
655 case ROOT_surfxml_router: SET(EPILOG); break;
656 case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
659 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</router>' expected.",yytext);
660 . FAIL("Unexpected character `%c': `</router>' expected.",yytext[0]);
661 <<EOF>> FAIL("Premature EOF: `</router>' expected.");
664 <ROOT_surfxml_network_link,S_surfxml_platform_description_2,S_surfxml_include,S_surfxml_include_2,S_surfxml_platform_description_1,S_surfxml_include_1,S_surfxml_platform_description>"<network_link"{s} {
665 AX_surfxml_network_link_name = 0;
666 AX_surfxml_network_link_bandwidth = 0;
667 AX_surfxml_network_link_bandwidth_file = 0;
668 AX_surfxml_network_link_latency = 26;
669 AX_surfxml_network_link_latency_file = 0;
670 AX_surfxml_network_link_state = A_surfxml_network_link_state_ON;
671 AX_surfxml_network_link_state_file = 0;
672 AX_surfxml_network_link_sharing_policy = A_surfxml_network_link_sharing_policy_SHARED;
673 ENTER(AL_surfxml_network_link); pushbuffer(0);
676 <AL_surfxml_network_link>{
677 "name"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_network_link_name);
678 "name"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_network_link_name);
680 "bandwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_network_link_bandwidth);
681 "bandwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_network_link_bandwidth);
683 "bandwidth_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_network_link_bandwidth_file);
684 "bandwidth_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_network_link_bandwidth_file);
686 "latency"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_network_link_latency);
687 "latency"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_network_link_latency);
689 "latency_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_network_link_latency_file);
690 "latency_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_network_link_latency_file);
693 "state"{Eq}"\"ON\"" A_surfxml_network_link_state = A_surfxml_network_link_state_ON;
695 "state"{Eq}"\"OFF\"" A_surfxml_network_link_state = A_surfxml_network_link_state_OFF;
697 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_network_link_state_file);
698 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_network_link_state_file);
700 "sharing_policy"{Eq}"'SHARED'" |
701 "sharing_policy"{Eq}"\"SHARED\"" A_surfxml_network_link_sharing_policy = A_surfxml_network_link_sharing_policy_SHARED;
702 "sharing_policy"{Eq}"'FATPIPE'" |
703 "sharing_policy"{Eq}"\"FATPIPE\"" A_surfxml_network_link_sharing_policy = A_surfxml_network_link_sharing_policy_FATPIPE;
706 if (!AX_surfxml_network_link_name) FAIL("Required attribute `name' not set for `network_link' element.");
707 if (!AX_surfxml_network_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `network_link' element.");
708 LEAVE; STag_surfxml_network_link();surfxml_pcdata_ix = 0; ENTER(E_surfxml_network_link);
711 if (!AX_surfxml_network_link_name) FAIL("Required attribute `name' not set for `network_link' element.");
712 if (!AX_surfxml_network_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `network_link' element.");
713 LEAVE; STag_surfxml_network_link(); surfxml_pcdata_ix = 0; ETag_surfxml_network_link(); popbuffer(); /* attribute */
715 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
716 case ROOT_surfxml_network_link: SET(EPILOG); break;
717 case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
720 . FAIL("Unexpected character `%c' in attribute list of network_link element.", yytext[0]);
721 {Name} FAIL("Bad attribute `%s' in `network_link' element start tag.",yytext);
722 <<EOF>> FAIL("EOF in attribute list of `network_link' element.");
725 <E_surfxml_network_link>{
726 "</network_link"{s}">" {
728 ETag_surfxml_network_link();
729 popbuffer(); /* attribute */
731 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
732 case ROOT_surfxml_network_link: SET(EPILOG); break;
733 case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
736 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</network_link>' expected.",yytext);
737 . FAIL("Unexpected character `%c': `</network_link>' expected.",yytext[0]);
738 <<EOF>> FAIL("Premature EOF: `</network_link>' expected.");
741 <ROOT_surfxml_route,S_surfxml_platform_description_2,S_surfxml_include,S_surfxml_include_2,S_surfxml_platform_description_1,S_surfxml_include_1,S_surfxml_platform_description>"<route"{s} {
742 AX_surfxml_route_src = 0;
743 AX_surfxml_route_dst = 0;
744 AX_surfxml_route_impact_on_src = 30;
745 AX_surfxml_route_impact_on_dst = 34;
746 AX_surfxml_route_impact_on_src_with_other_recv = 38;
747 AX_surfxml_route_impact_on_dst_with_other_send = 42;
748 ENTER(AL_surfxml_route); pushbuffer(0);
752 "src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src);
753 "src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src);
755 "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst);
756 "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst);
758 "impact_on_src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src);
759 "impact_on_src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src);
761 "impact_on_dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst);
762 "impact_on_dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst);
764 "impact_on_src_with_other_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
765 "impact_on_src_with_other_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
767 "impact_on_dst_with_other_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
768 "impact_on_dst_with_other_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
771 if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
772 if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
773 LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route);
776 if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
777 if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
778 LEAVE; STag_surfxml_route(); surfxml_pcdata_ix = 0; ETag_surfxml_route(); popbuffer(); /* attribute */
780 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
781 case ROOT_surfxml_route: SET(EPILOG); break;
782 case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
785 . FAIL("Unexpected character `%c' in attribute list of route element.", yytext[0]);
786 {Name} FAIL("Bad attribute `%s' in `route' element start tag.",yytext);
787 <<EOF>> FAIL("EOF in attribute list of `route' element.");
790 <S_surfxml_route,S_surfxml_route_2,E_surfxml_route>{
793 ETag_surfxml_route();
794 popbuffer(); /* attribute */
796 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
797 case ROOT_surfxml_route: SET(EPILOG); break;
798 case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
801 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route>' expected.",yytext);
802 . FAIL("Unexpected character `%c': `</route>' expected.",yytext[0]);
803 <<EOF>> FAIL("Premature EOF: `</route>' expected.");
806 <ROOT_surfxml_route_element,S_surfxml_route_1,S_surfxml_route,S_surfxml_route_2>"<route_element"{s} {
807 AX_surfxml_route_element_name = 0;
808 ENTER(AL_surfxml_route_element); pushbuffer(0);
811 <AL_surfxml_route_element>{
812 "name"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_element_name);
813 "name"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_element_name);
816 if (!AX_surfxml_route_element_name) FAIL("Required attribute `name' not set for `route_element' element.");
817 LEAVE; STag_surfxml_route_element();surfxml_pcdata_ix = 0; ENTER(E_surfxml_route_element);
820 if (!AX_surfxml_route_element_name) FAIL("Required attribute `name' not set for `route_element' element.");
821 LEAVE; STag_surfxml_route_element(); surfxml_pcdata_ix = 0; ETag_surfxml_route_element(); popbuffer(); /* attribute */
823 case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
824 case ROOT_surfxml_route_element: SET(EPILOG); break;
827 . FAIL("Unexpected character `%c' in attribute list of route_element element.", yytext[0]);
828 {Name} FAIL("Bad attribute `%s' in `route_element' element start tag.",yytext);
829 <<EOF>> FAIL("EOF in attribute list of `route_element' element.");
832 <E_surfxml_route_element>{
833 "</route_element"{s}">" {
835 ETag_surfxml_route_element();
836 popbuffer(); /* attribute */
838 case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
839 case ROOT_surfxml_route_element: SET(EPILOG); break;
842 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route_element>' expected.",yytext);
843 . FAIL("Unexpected character `%c': `</route_element>' expected.",yytext[0]);
844 <<EOF>> FAIL("Premature EOF: `</route_element>' expected.");
847 <ROOT_surfxml_process,S_surfxml_platform_description_2,S_surfxml_include,S_surfxml_include_2,S_surfxml_platform_description_1,S_surfxml_include_1,S_surfxml_platform_description>"<process"{s} {
848 AX_surfxml_process_host = 0;
849 AX_surfxml_process_function = 0;
850 AX_surfxml_process_start_time = 46;
851 AX_surfxml_process_kill_time = 51;
852 ENTER(AL_surfxml_process); pushbuffer(0);
855 <AL_surfxml_process>{
856 "host"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host);
857 "host"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host);
859 "function"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function);
860 "function"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function);
862 "start_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start_time);
863 "start_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start_time);
865 "kill_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill_time);
866 "kill_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill_time);
869 if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
870 if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
871 LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process);
874 if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
875 if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
876 LEAVE; STag_surfxml_process(); surfxml_pcdata_ix = 0; ETag_surfxml_process(); popbuffer(); /* attribute */
878 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
879 case ROOT_surfxml_process: SET(EPILOG); break;
880 case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
883 . FAIL("Unexpected character `%c' in attribute list of process element.", yytext[0]);
884 {Name} FAIL("Bad attribute `%s' in `process' element start tag.",yytext);
885 <<EOF>> FAIL("EOF in attribute list of `process' element.");
888 <S_surfxml_process,E_surfxml_process,S_surfxml_process_2>{
891 ETag_surfxml_process();
892 popbuffer(); /* attribute */
894 case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break;
895 case ROOT_surfxml_process: SET(EPILOG); break;
896 case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
899 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</process>' expected.",yytext);
900 . FAIL("Unexpected character `%c': `</process>' expected.",yytext[0]);
901 <<EOF>> FAIL("Premature EOF: `</process>' expected.");
904 <ROOT_surfxml_argument,S_surfxml_process_1,S_surfxml_process,S_surfxml_process_2>"<argument"{s} {
905 AX_surfxml_argument_value = 0;
906 ENTER(AL_surfxml_argument); pushbuffer(0);
909 <AL_surfxml_argument>{
910 "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_argument_value);
911 "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_argument_value);
914 if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
915 LEAVE; STag_surfxml_argument();surfxml_pcdata_ix = 0; ENTER(E_surfxml_argument);
918 if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
919 LEAVE; STag_surfxml_argument(); surfxml_pcdata_ix = 0; ETag_surfxml_argument(); popbuffer(); /* attribute */
921 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
922 case ROOT_surfxml_argument: SET(EPILOG); break;
925 . FAIL("Unexpected character `%c' in attribute list of argument element.", yytext[0]);
926 {Name} FAIL("Bad attribute `%s' in `argument' element start tag.",yytext);
927 <<EOF>> FAIL("EOF in attribute list of `argument' element.");
930 <E_surfxml_argument>{
933 ETag_surfxml_argument();
934 popbuffer(); /* attribute */
936 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
937 case ROOT_surfxml_argument: SET(EPILOG); break;
940 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</argument>' expected.",yytext);
941 . FAIL("Unexpected character `%c': `</argument>' expected.",yytext[0]);
942 <<EOF>> FAIL("Premature EOF: `</argument>' expected.");
945 /* EPILOG: after the root element. */
948 . {SET(PROLOG); yyless(0); CLEANUP; return -1;}
952 /* CHARACTER DATA. */
954 <IMPOSSIBLE,VALUE1,VALUE2>{
955 /* Non-defined standard entities... */
956 "&" BUFFERPUTC('&');
957 "<" BUFFERPUTC('<');
958 ">" BUFFERPUTC('>');
959 "'" BUFFERPUTC('\'');
960 """ BUFFERPUTC('"');
962 /* Character entities. */
963 "&#"[[:digit:]]+";" BUFFERPUTC((unsigned char)atoi(yytext+2));
964 "&#x"[[:xdigit:]]+";" BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
967 <IMPOSSIBLE,VALUE1,VALUE2,CDATA>{
971 "\n\r" BUFFERPUTC('\n');
975 "<![CDATA[" ENTER(CDATA);
976 "]""]>" FAIL("Unexpected `]""]>' in character data.");
980 \' BUFFERDONE; LEAVE;
981 <<EOF>> FAIL("EOF in literal (\"'\" expected).");
985 \" BUFFERDONE; LEAVE;
986 <<EOF>> FAIL("EOF in literal (`\"' expected).");
989 <IMPOSSIBLE,VALUE1,VALUE2>{
990 [^<&] BUFFERPUTC(yytext[0]);
991 [<&] FAIL("Spurious `%c' in character data.",yytext[0]);
996 /* "]""]" BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]); */
997 . BUFFERPUTC(yytext[0]);
998 <<EOF>> FAIL("EOF in CDATA section.");
1001 /* Impossible rules to avoid warnings from flex(1). */
1002 /* Ideally, this should be replaced by code in flexml.pl that
1003 generates just the states not covered by other rules. */
1005 .|[\n] FAIL("Syntax error on character `%c'.", yytext[0]);
1010 /* Element context stack lookup. */
1011 int surfxml_element_context(int i)
1013 return (0<i && i<yy_start_stack_depth
1014 ? yy_start_stack[yy_start_stack_ptr - i]
1019 void print_yy_stack(char* fmt, ...)
1021 int i = 0; va_list ap; va_start(ap, fmt);
1022 vfprintf(stderr, fmt, ap);
1023 if (surfxml_statenames) {
1024 for (i=1; i<yy_start_stack_ptr; i++) {
1025 fprintf(stderr, "%s/", surfxml_statenames[yy_start_stack[i] ]);
1027 fprintf(stderr,"%s\n", surfxml_statenames[YY_START]);
1032 void print_surfxml_bufferstack()
1035 fputs("Buffer: ", stderr);
1036 for (i = 0; i < blimit; i++) {
1037 if ( surfxml_bufferstack[i] == '\377' ) break;
1038 putc(surfxml_bufferstack[i], stderr);
1043 static void debug_enter(int state, const char* statename) {
1044 yy_push_state(state);
1045 if (yy_flex_debug) {
1046 print_yy_stack("--ENTER(%s) : ",statename);
1047 print_surfxml_bufferstack();
1051 static void debug_leave(void) {
1052 if (yy_flex_debug) {
1053 print_yy_stack("--LEAVE : ");
1054 print_surfxml_bufferstack();
1059 static void debug_set(int state, const char* statename) {
1061 if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename);
1066 static void cleanup(void)
1068 if (surfxml_statenames) {
1069 free(surfxml_statenames);
1070 surfxml_statenames = NULL;
1072 free(surfxml_bufferstack);
1073 surfxml_bufferstack = NULL;
1080 static int fail(const char* fmt, ...)
1082 int chars_left, used;
1083 va_list ap; va_start(ap, fmt);
1084 #ifdef FLEXML_yylineno
1085 used = sprintf(flexml_err_msg,
1086 "Invalid XML (XML input line %d, state %d): ",
1087 yylineno, YY_START);
1089 used = sprintf(flexml_err_msg,
1090 "Invalid XML (state %d): ",
1093 chars_left = flexml_max_err_msg_size - used - 1;
1094 vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
1097 #ifndef FLEXML_quiet_parser
1098 /* print directly to sdterr */
1099 fprintf(stderr, "%s\n", flexml_err_msg);
1100 flexml_err_msg[0] = '\0';