1 /* Validating XML processor for surf/surfxml.dtd.
2 * Generated 2007/10/12 10:23:15.
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.62 2007/10/11 10:00:14 mquinson Exp).
9 * There are two, intertwined parts to this program, part A and part B.
14 * Some parts, here collectively called "Part A", are found in the
15 * FleXML package. They are Copyright (C) 1999-2005 Kristoffer Rose
16 * and Copyright (C) 2003-2006 Martin Quinson. All rights reserved.
18 * You can redistribute, use, perform, display and/or modify "Part A"
19 * provided the following two conditions hold:
21 * 1. The program is distributed WITHOUT ANY WARRANTY from the author of
22 * FleXML; without even the implied warranty of MERCHANTABILITY or
23 * FITNESS FOR A PARTICULAR PURPOSE.
25 * 2. The program distribution conditions do not in any way affect the
26 * distribution conditions of the FleXML system used to generate this
27 * file or any version of FleXML derived from that system.
29 * Notice that these are explicit rights granted to you for files
30 * generated by the FleXML system. For your rights in connection with
31 * the FleXML system itself please consult the GNU General Public License.
36 * The other parts, here collectively called "Part B", and which came
37 * from the DTD used by FleXML to generate this program, can be
38 * distributed (or not, as the case may be) under the terms of whoever
39 * wrote them, provided these terms respect and obey the two conditions
40 * above under the heading "Part A".
42 * The author of and contributors to FleXML specifically disclaim
43 * any copyright interest in "Part B", unless "Part B" was written
44 * by the author of or contributors to FleXML.
50 /* Version strings. */
51 const char rcs_surfxml_flexml_skeleton[] =
52 "$" "Id: skel,v 1.40 2007/10/11 09:57:24 mquinson Exp $";
53 const char rcs_surfxml_flexml[] =
54 "$" "Id: flexml.pl,v 1.62 2007/10/11 10:00:14 mquinson Exp $";
57 #include <stdlib.h> /* for realloc() -- needed here when using flex 2.5.4 */
64 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
65 # ifndef __STRICT_ANSI__
73 #ifndef FLEXML_INDEXSTACKSIZE
74 #define FLEXML_INDEXSTACKSIZE 1000
77 /* Generated definitions. */
78 #define FLEXML_yylineno
79 #ifndef FLEXML_BUFFERSTACKSIZE
80 #define FLEXML_BUFFERSTACKSIZE 1000000
82 #define FLEXML_NEED_BUFFERLIT
84 /* XML processor api. */
85 /* FleXML-provided data. */
86 int surfxml_pcdata_ix;
87 extern char *surfxml_bufferstack;
88 #define surfxml_pcdata (surfxml_bufferstack + surfxml_pcdata_ix)
89 AT_surfxml_network_link_bandwidth AX_surfxml_network_link_bandwidth;
90 #define A_surfxml_network_link_bandwidth (surfxml_bufferstack + AX_surfxml_network_link_bandwidth)
91 AT_surfxml_router_name AX_surfxml_router_name;
92 #define A_surfxml_router_name (surfxml_bufferstack + AX_surfxml_router_name)
93 AT_surfxml_process_host AX_surfxml_process_host;
94 #define A_surfxml_process_host (surfxml_bufferstack + AX_surfxml_process_host)
95 AT_surfxml_network_link_latency_file AX_surfxml_network_link_latency_file;
96 #define A_surfxml_network_link_latency_file (surfxml_bufferstack + AX_surfxml_network_link_latency_file)
97 AT_surfxml_route_impact_on_dst_with_other_send AX_surfxml_route_impact_on_dst_with_other_send;
98 #define A_surfxml_route_impact_on_dst_with_other_send (surfxml_bufferstack + AX_surfxml_route_impact_on_dst_with_other_send)
99 AT_surfxml_cpu_interference_send_recv AX_surfxml_cpu_interference_send_recv;
100 #define A_surfxml_cpu_interference_send_recv (surfxml_bufferstack + AX_surfxml_cpu_interference_send_recv)
101 AT_surfxml_route_impact_on_dst AX_surfxml_route_impact_on_dst;
102 #define A_surfxml_route_impact_on_dst (surfxml_bufferstack + AX_surfxml_route_impact_on_dst)
103 AT_surfxml_platform_description_version AX_surfxml_platform_description_version;
104 #define A_surfxml_platform_description_version (surfxml_bufferstack + AX_surfxml_platform_description_version)
105 AT_surfxml_route_impact_on_src_with_other_recv AX_surfxml_route_impact_on_src_with_other_recv;
106 #define A_surfxml_route_impact_on_src_with_other_recv (surfxml_bufferstack + AX_surfxml_route_impact_on_src_with_other_recv)
107 AT_surfxml_route_element_name AX_surfxml_route_element_name;
108 #define A_surfxml_route_element_name (surfxml_bufferstack + AX_surfxml_route_element_name)
109 AT_surfxml_process_start_time AX_surfxml_process_start_time;
110 #define A_surfxml_process_start_time (surfxml_bufferstack + AX_surfxml_process_start_time)
111 AT_surfxml_process_function AX_surfxml_process_function;
112 #define A_surfxml_process_function (surfxml_bufferstack + AX_surfxml_process_function)
113 AT_surfxml_cpu_state AX_surfxml_cpu_state;
114 #define A_surfxml_cpu_state AX_surfxml_cpu_state
115 AT_surfxml_cpu_interference_send AX_surfxml_cpu_interference_send;
116 #define A_surfxml_cpu_interference_send (surfxml_bufferstack + AX_surfxml_cpu_interference_send)
117 AT_surfxml_network_link_bandwidth_file AX_surfxml_network_link_bandwidth_file;
118 #define A_surfxml_network_link_bandwidth_file (surfxml_bufferstack + AX_surfxml_network_link_bandwidth_file)
119 AT_surfxml_cpu_name AX_surfxml_cpu_name;
120 #define A_surfxml_cpu_name (surfxml_bufferstack + AX_surfxml_cpu_name)
121 AT_surfxml_process_kill_time AX_surfxml_process_kill_time;
122 #define A_surfxml_process_kill_time (surfxml_bufferstack + AX_surfxml_process_kill_time)
123 AT_surfxml_network_link_state AX_surfxml_network_link_state;
124 #define A_surfxml_network_link_state AX_surfxml_network_link_state
125 AT_surfxml_cpu_availability_file AX_surfxml_cpu_availability_file;
126 #define A_surfxml_cpu_availability_file (surfxml_bufferstack + AX_surfxml_cpu_availability_file)
127 AT_surfxml_argument_value AX_surfxml_argument_value;
128 #define A_surfxml_argument_value (surfxml_bufferstack + AX_surfxml_argument_value)
129 AT_surfxml_route_src AX_surfxml_route_src;
130 #define A_surfxml_route_src (surfxml_bufferstack + AX_surfxml_route_src)
131 AT_surfxml_route_impact_on_src AX_surfxml_route_impact_on_src;
132 #define A_surfxml_route_impact_on_src (surfxml_bufferstack + AX_surfxml_route_impact_on_src)
133 AT_surfxml_cpu_max_outgoing_rate AX_surfxml_cpu_max_outgoing_rate;
134 #define A_surfxml_cpu_max_outgoing_rate (surfxml_bufferstack + AX_surfxml_cpu_max_outgoing_rate)
135 AT_surfxml_cpu_availability AX_surfxml_cpu_availability;
136 #define A_surfxml_cpu_availability (surfxml_bufferstack + AX_surfxml_cpu_availability)
137 AT_surfxml_cpu_interference_recv AX_surfxml_cpu_interference_recv;
138 #define A_surfxml_cpu_interference_recv (surfxml_bufferstack + AX_surfxml_cpu_interference_recv)
139 AT_surfxml_network_link_name AX_surfxml_network_link_name;
140 #define A_surfxml_network_link_name (surfxml_bufferstack + AX_surfxml_network_link_name)
141 AT_surfxml_cpu_power AX_surfxml_cpu_power;
142 #define A_surfxml_cpu_power (surfxml_bufferstack + AX_surfxml_cpu_power)
143 AT_surfxml_include_file AX_surfxml_include_file;
144 #define A_surfxml_include_file (surfxml_bufferstack + AX_surfxml_include_file)
145 AT_surfxml_network_link_sharing_policy AX_surfxml_network_link_sharing_policy;
146 #define A_surfxml_network_link_sharing_policy AX_surfxml_network_link_sharing_policy
147 AT_surfxml_route_dst AX_surfxml_route_dst;
148 #define A_surfxml_route_dst (surfxml_bufferstack + AX_surfxml_route_dst)
149 AT_surfxml_network_link_latency AX_surfxml_network_link_latency;
150 #define A_surfxml_network_link_latency (surfxml_bufferstack + AX_surfxml_network_link_latency)
151 AT_surfxml_cpu_state_file AX_surfxml_cpu_state_file;
152 #define A_surfxml_cpu_state_file (surfxml_bufferstack + AX_surfxml_cpu_state_file)
153 AT_surfxml_network_link_state_file AX_surfxml_network_link_state_file;
154 #define A_surfxml_network_link_state_file (surfxml_bufferstack + AX_surfxml_network_link_state_file)
158 # define ENTER(state) debug_enter(state,#state)
159 # define LEAVE debug_leave()
160 # define SET(state) debug_set(state,#state)
161 static void debug_enter(int, const char*);
162 static void debug_leave(void);
163 static void debug_set(int, const char*);
165 # define ENTER(state) (yy_push_state(state))
166 # define LEAVE (yy_pop_state())
167 # define SET(state) BEGIN(state)
170 /* Generic actions. */
171 #define SKIP /*skip*/
172 #define SUCCEED CLEANUP; return 0
174 #define FAIL return fail
175 static int fail(const char*, ...);
177 enum {flexml_max_err_msg_size = 512};
178 static char flexml_err_msg[flexml_max_err_msg_size];
179 const char * surfxml_parse_err_msg()
181 return flexml_err_msg;
183 static void reset_surfxml_parse_err_msg()
185 flexml_err_msg[0] = '\0';
189 static void cleanup(void);
190 #define CLEANUP cleanup()
192 /* Text buffer stack handling. */
193 char *surfxml_bufferstack = NULL;
194 static int blimit = FLEXML_BUFFERSTACKSIZE;
195 static int bnext = 1;
197 static int *indexstack = NULL;
198 static int ilimit = FLEXML_INDEXSTACKSIZE;
199 static int inext = 1;
201 #define BUFFERSET(P) (P = bnext)
202 #define BUFFERPUTC(C) (ck_blimit(), surfxml_bufferstack[bnext++] = (C))
203 #define BUFFERDONE (BUFFERPUTC('\0'))
205 #define BUFFERLITERAL(C, P) surfxml_bufferliteral(C, &(P), yytext)
207 /* after this is called, there are at least 2 slots left in the stack */
208 static int ck_blimit()
210 if (bnext >= blimit) {
211 blimit += FLEXML_BUFFERSTACKSIZE + 2;
213 char *temp = (char *) realloc(surfxml_bufferstack, blimit);
215 surfxml_bufferstack = temp;
221 /* after this is called, there are at least 2 slots left in the stack */
222 static int ck_ilimit()
224 if (inext >= ilimit) {
225 ilimit += FLEXML_INDEXSTACKSIZE + 2;
227 int *temp = (int *) realloc(indexstack, ilimit);
235 #ifdef FLEXML_NEED_BUFFERLIT
236 static void surfxml_bufferliteral(char c, int* pp, const char* text)
238 const char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c);
239 assert(s <= e); BUFFERSET(*pp);
241 if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
248 static void pushbuffer(int p)
251 indexstack[inext++] = p;
252 indexstack[inext++] = bnext;
255 static int popbuffer(void)
258 bnext = indexstack[--inext];
259 return indexstack[--inext];
262 /* General internal entities are `unput' back onto the input stream... */
263 #define ENTITYTEXT(T) \
264 { char *s = (T), *e = s+strlen(s);\
265 while (--e >= s) { unput(*e); }}
270 /* Flex standard options. */
272 %option noyy_top_state
278 /* Flex user-requested options. */
282 /* XML character classes (currently restricted to ASCII). */
284 /* "Common syntactic structures." */
288 /* "Names and Tokens." */
289 NameChar [A-Za-z0-9.:_-]
290 Name [A-Za-z_:]{NameChar}*
291 Names {Name}({S}{Name})*
292 Nmtoken ({NameChar})+
293 Nmtokens {Nmtoken}({S}{Nmtoken})*
296 VersionNum [a-zA-Z0-9_.:-]+
298 Literal \'[^'']*\'|\"[^""]*\"
300 /* Parser states (flex `exclusive start conditions'):
302 * PROLOG the XML prolog of the document before <?xml...>
303 * DOCTYPE the XML prolog of the document after <?xml...>
304 * EPILOG after the root element
305 * INCOMMENT inside an XML comment <!--....-->
306 * INPI inside an XML PI <?...?>
307 * VALUE1 inside a '...'-delimited literal
308 * VALUE2 inside a "..."-delimited literal
309 * CDATA inside a <![CDATA[...] ]> section.
310 * ROOT_<tag> expect root element <tag>
311 * AL_<tag> inside the attribute list for <tag>
312 * IN_<tag> inside a <tag> with element contents (ready for end tag)
313 * IMPOSSIBLE dummy to permit disabling rules; must be last
315 %x PROLOG DOCTYPE EPILOG INCOMMENT INPI VALUE1 VALUE2 CDATA
316 %x ROOT_surfxml_platform_description AL_surfxml_platform_description S_surfxml_platform_description S_surfxml_platform_description_1 S_surfxml_platform_description_2 S_surfxml_platform_description_3 S_surfxml_platform_description_4 S_surfxml_platform_description_5 E_surfxml_platform_description
317 %x ROOT_surfxml_include AL_surfxml_include E_surfxml_include
318 %x ROOT_surfxml_cpu AL_surfxml_cpu E_surfxml_cpu
319 %x ROOT_surfxml_router AL_surfxml_router E_surfxml_router
320 %x ROOT_surfxml_network_link AL_surfxml_network_link E_surfxml_network_link
321 %x ROOT_surfxml_route AL_surfxml_route S_surfxml_route S_surfxml_route_1 S_surfxml_route_2 E_surfxml_route
322 %x ROOT_surfxml_route_element AL_surfxml_route_element E_surfxml_route_element
323 %x ROOT_surfxml_process AL_surfxml_process S_surfxml_process S_surfxml_process_1 S_surfxml_process_2 E_surfxml_process
324 %x ROOT_surfxml_argument AL_surfxml_argument E_surfxml_argument
329 const char* *surfxml_statenames=NULL;
334 /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
336 reset_surfxml_parse_err_msg();
337 surfxml_bufferstack = (char *) malloc(FLEXML_BUFFERSTACKSIZE);
338 assert(surfxml_bufferstack);
342 for (i = 0; i < blimit; i++) {
343 surfxml_bufferstack[i] = '\377';
347 surfxml_bufferstack[0] = '\0';
348 indexstack = (int *) malloc(FLEXML_INDEXSTACKSIZE * sizeof(int));
354 surfxml_bufferliteral('\0', &bnext, "0.0");
355 surfxml_bufferliteral('\0', &bnext, "1.0");
356 surfxml_bufferliteral('\0', &bnext, "1.0");
357 surfxml_bufferliteral('\0', &bnext, "1.0");
358 surfxml_bufferliteral('\0', &bnext, "1.0");
359 surfxml_bufferliteral('\0', &bnext, "-1.0");
360 surfxml_bufferliteral('\0', &bnext, "0.0");
361 surfxml_bufferliteral('\0', &bnext, "0.0");
362 surfxml_bufferliteral('\0', &bnext, "0.0");
363 surfxml_bufferliteral('\0', &bnext, "0.0");
364 surfxml_bufferliteral('\0', &bnext, "0.0");
365 surfxml_bufferliteral('\0', &bnext, "-1.0");
366 surfxml_bufferliteral('\0', &bnext, "-1.0");
367 if(!surfxml_statenames) {surfxml_statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*));
368 surfxml_statenames[PROLOG] = NULL;
369 surfxml_statenames[DOCTYPE] = NULL;
370 surfxml_statenames[EPILOG] = NULL;
371 surfxml_statenames[INCOMMENT] = NULL;
372 surfxml_statenames[INPI] = NULL;
373 surfxml_statenames[VALUE1] = NULL;
374 surfxml_statenames[VALUE2] = NULL;
375 surfxml_statenames[CDATA] = NULL;
376 surfxml_statenames[ROOT_surfxml_platform_description] = NULL;
377 surfxml_statenames[AL_surfxml_platform_description] = NULL;
378 surfxml_statenames[S_surfxml_platform_description] = "platform_description";
379 surfxml_statenames[S_surfxml_platform_description_1] = "platform_description";
380 surfxml_statenames[S_surfxml_platform_description_2] = "platform_description";
381 surfxml_statenames[S_surfxml_platform_description_3] = "platform_description";
382 surfxml_statenames[S_surfxml_platform_description_4] = "platform_description";
383 surfxml_statenames[S_surfxml_platform_description_5] = "platform_description";
384 surfxml_statenames[E_surfxml_platform_description] = "platform_description";
385 surfxml_statenames[ROOT_surfxml_include] = NULL;
386 surfxml_statenames[AL_surfxml_include] = NULL;
387 surfxml_statenames[E_surfxml_include] = "include";
388 surfxml_statenames[ROOT_surfxml_cpu] = NULL;
389 surfxml_statenames[AL_surfxml_cpu] = NULL;
390 surfxml_statenames[E_surfxml_cpu] = "cpu";
391 surfxml_statenames[ROOT_surfxml_router] = NULL;
392 surfxml_statenames[AL_surfxml_router] = NULL;
393 surfxml_statenames[E_surfxml_router] = "router";
394 surfxml_statenames[ROOT_surfxml_network_link] = NULL;
395 surfxml_statenames[AL_surfxml_network_link] = NULL;
396 surfxml_statenames[E_surfxml_network_link] = "network_link";
397 surfxml_statenames[ROOT_surfxml_route] = NULL;
398 surfxml_statenames[AL_surfxml_route] = NULL;
399 surfxml_statenames[S_surfxml_route] = "route";
400 surfxml_statenames[S_surfxml_route_1] = "route";
401 surfxml_statenames[S_surfxml_route_2] = "route";
402 surfxml_statenames[E_surfxml_route] = "route";
403 surfxml_statenames[ROOT_surfxml_route_element] = NULL;
404 surfxml_statenames[AL_surfxml_route_element] = NULL;
405 surfxml_statenames[E_surfxml_route_element] = "route_element";
406 surfxml_statenames[ROOT_surfxml_process] = NULL;
407 surfxml_statenames[AL_surfxml_process] = NULL;
408 surfxml_statenames[S_surfxml_process] = "process";
409 surfxml_statenames[S_surfxml_process_1] = "process";
410 surfxml_statenames[S_surfxml_process_2] = "process";
411 surfxml_statenames[E_surfxml_process] = "process";
412 surfxml_statenames[ROOT_surfxml_argument] = NULL;
413 surfxml_statenames[AL_surfxml_argument] = NULL;
414 surfxml_statenames[E_surfxml_argument] = "argument";
417 /* COMMENTS and PIs: handled uniformly for efficiency. */
419 <ROOT_surfxml_platform_description,AL_surfxml_platform_description,S_surfxml_platform_description,S_surfxml_platform_description_1,S_surfxml_platform_description_2,S_surfxml_platform_description_3,S_surfxml_platform_description_4,S_surfxml_platform_description_5,E_surfxml_platform_description,ROOT_surfxml_include,AL_surfxml_include,E_surfxml_include,ROOT_surfxml_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>{
420 "<!--" ENTER(INCOMMENT);
428 <<EOF>> FAIL("EOF in comment.");
434 <<EOF>> FAIL("EOF in PI (processing instruction).");
437 /* SPACES: skipped uniformly */
439 <ROOT_surfxml_platform_description,AL_surfxml_platform_description,S_surfxml_platform_description,S_surfxml_platform_description_1,S_surfxml_platform_description_2,S_surfxml_platform_description_3,S_surfxml_platform_description_4,S_surfxml_platform_description_5,E_surfxml_platform_description,ROOT_surfxml_include,AL_surfxml_include,E_surfxml_include,ROOT_surfxml_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;
441 /* PROLOG: determine root element and process it. */
444 "<?xml"({S}version{Eq}(\'{VersionNum}\'|\"{VersionNum}\"))?({S}encoding{Eq}(\'[^']*\'|\"[^"]*\"))?"?>" SET(DOCTYPE);
445 "<?xml"[^>]*">" FAIL("Bad declaration %s.",yytext);
449 "<!DOCTYPE"{S}"cpu"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_cpu);
450 "<!DOCTYPE"{S}"include"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_include);
451 "<!DOCTYPE"{S}"route"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_route);
452 "<!DOCTYPE"{S}"network_link"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_network_link);
453 "<!DOCTYPE"{S}"process"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_process);
454 "<!DOCTYPE"{S}"router"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_router);
455 "<!DOCTYPE"{S}"argument"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_argument);
456 "<!DOCTYPE"{S}"route_element"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_route_element);
457 "<!DOCTYPE"{S}"platform_description"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_surfxml_platform_description);
458 "<!"[^>-][^>]*">" FAIL("Bad declaration %s.",yytext);
459 . FAIL("Unexpected character `%c' in prolog.", yytext[0]);
460 <<EOF>> FAIL("EOF in prolog.");
463 /* RULES DERIVED FROM DTD. */
465 /* <!-- Small DTD for SURF based tools. --> */
467 <S_surfxml_platform_description_4,E_surfxml_process,S_surfxml_platform_description_5,S_surfxml_process,S_surfxml_route_2,S_surfxml_platform_description_3,E_surfxml_route,S_surfxml_platform_description,S_surfxml_route_1,S_surfxml_platform_description_1,S_surfxml_process_1,E_surfxml_platform_description,S_surfxml_platform_description_2,S_surfxml_process_2,S_surfxml_route>"<platform_description"{s} FAIL("Starting tag <platform_description> is not allowed here.");
469 <ROOT_surfxml_platform_description>"<platform_description"{s} {
470 AX_surfxml_platform_description_version = 1;
471 ENTER(AL_surfxml_platform_description); pushbuffer(0);
474 <AL_surfxml_platform_description>{
475 "version"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_description_version);
476 "version"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_description_version);
479 LEAVE; STag_surfxml_platform_description();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform_description);
482 LEAVE; STag_surfxml_platform_description(); surfxml_pcdata_ix = 0; ETag_surfxml_platform_description(); popbuffer(); /* attribute */
484 case ROOT_surfxml_platform_description: SET(EPILOG); break;
487 . FAIL("Unexpected character `%c' in attribute list of platform_description element.", yytext[0]);
488 {Name} FAIL("Bad attribute `%s' in `platform_description' element start tag.",yytext);
489 <<EOF>> FAIL("EOF in attribute list of `platform_description' element.");
492 <E_surfxml_platform_description,S_surfxml_platform_description_5,S_surfxml_platform_description_3,S_surfxml_platform_description_1,S_surfxml_platform_description>{
493 "</platform_description"{s}">" {
495 ETag_surfxml_platform_description();
496 popbuffer(); /* attribute */
498 case ROOT_surfxml_platform_description: SET(EPILOG); break;
501 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</platform_description>' expected.",yytext);
502 . FAIL("Unexpected character `%c': `</platform_description>' expected.",yytext[0]);
503 <<EOF>> FAIL("Premature EOF: `</platform_description>' expected.");
506 <E_surfxml_process,S_surfxml_process,S_surfxml_route_2,E_surfxml_route,S_surfxml_route_1,S_surfxml_process_1,E_surfxml_platform_description,S_surfxml_process_2,S_surfxml_route>"<include"{s} FAIL("Starting tag <include> is not allowed here.");
508 <ROOT_surfxml_include,S_surfxml_platform_description_2,S_surfxml_platform_description_5,S_surfxml_platform_description_3,S_surfxml_platform_description_1,S_surfxml_platform_description,S_surfxml_platform_description_4>"<include"{s} {
509 AX_surfxml_include_file = 0;
510 ENTER(AL_surfxml_include); pushbuffer(0);
513 <AL_surfxml_include>{
514 "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_include_file);
515 "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_include_file);
518 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
519 LEAVE; STag_surfxml_include();surfxml_pcdata_ix = 0; ENTER(E_surfxml_include);
522 if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
523 LEAVE; STag_surfxml_include(); surfxml_pcdata_ix = 0; ETag_surfxml_include(); popbuffer(); /* attribute */
525 case S_surfxml_platform_description_2: SET(S_surfxml_platform_description_3); break;
526 case ROOT_surfxml_include: SET(EPILOG); break;
527 case S_surfxml_platform_description_5: case S_surfxml_platform_description_3: case S_surfxml_platform_description_1: case S_surfxml_platform_description: case S_surfxml_platform_description_4: SET(S_surfxml_platform_description_5); break;
530 . FAIL("Unexpected character `%c' in attribute list of include element.", yytext[0]);
531 {Name} FAIL("Bad attribute `%s' in `include' element start tag.",yytext);
532 <<EOF>> FAIL("EOF in attribute list of `include' element.");
538 ETag_surfxml_include();
539 popbuffer(); /* attribute */
541 case S_surfxml_platform_description_2: SET(S_surfxml_platform_description_3); break;
542 case ROOT_surfxml_include: SET(EPILOG); break;
543 case S_surfxml_platform_description_5: case S_surfxml_platform_description_3: case S_surfxml_platform_description_1: case S_surfxml_platform_description: case S_surfxml_platform_description_4: SET(S_surfxml_platform_description_5); break;
546 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</include>' expected.",yytext);
547 . FAIL("Unexpected character `%c': `</include>' expected.",yytext[0]);
548 <<EOF>> FAIL("Premature EOF: `</include>' expected.");
551 <S_surfxml_platform_description_4,E_surfxml_process,S_surfxml_platform_description_5,S_surfxml_process,S_surfxml_route_2,E_surfxml_route,S_surfxml_route_1,S_surfxml_process_1,S_surfxml_platform_description_1,E_surfxml_platform_description,S_surfxml_process_2,S_surfxml_route>"<cpu"{s} FAIL("Starting tag <cpu> is not allowed here.");
553 <ROOT_surfxml_cpu,S_surfxml_platform_description_2,S_surfxml_platform_description_3,S_surfxml_platform_description>"<cpu"{s} {
554 AX_surfxml_cpu_name = 0;
555 AX_surfxml_cpu_power = 0;
556 AX_surfxml_cpu_availability = 5;
557 AX_surfxml_cpu_availability_file = 0;
558 AX_surfxml_cpu_state = A_surfxml_cpu_state_ON;
559 AX_surfxml_cpu_state_file = 0;
560 AX_surfxml_cpu_interference_send = 9;
561 AX_surfxml_cpu_interference_recv = 13;
562 AX_surfxml_cpu_interference_send_recv = 17;
563 AX_surfxml_cpu_max_outgoing_rate = 21;
564 ENTER(AL_surfxml_cpu); pushbuffer(0);
568 "name"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_name);
569 "name"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_name);
571 "power"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_power);
572 "power"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_power);
574 "availability"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_availability);
575 "availability"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_availability);
577 "availability_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_availability_file);
578 "availability_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_availability_file);
581 "state"{Eq}"\"ON\"" A_surfxml_cpu_state = A_surfxml_cpu_state_ON;
583 "state"{Eq}"\"OFF\"" A_surfxml_cpu_state = A_surfxml_cpu_state_OFF;
585 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_state_file);
586 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_state_file);
588 "interference_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_interference_send);
589 "interference_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_interference_send);
591 "interference_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_interference_recv);
592 "interference_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_interference_recv);
594 "interference_send_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_interference_send_recv);
595 "interference_send_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_interference_send_recv);
597 "max_outgoing_rate"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cpu_max_outgoing_rate);
598 "max_outgoing_rate"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cpu_max_outgoing_rate);
601 if (!AX_surfxml_cpu_name) FAIL("Required attribute `name' not set for `cpu' element.");
602 if (!AX_surfxml_cpu_power) FAIL("Required attribute `power' not set for `cpu' element.");
603 LEAVE; STag_surfxml_cpu();surfxml_pcdata_ix = 0; ENTER(E_surfxml_cpu);
606 if (!AX_surfxml_cpu_name) FAIL("Required attribute `name' not set for `cpu' element.");
607 if (!AX_surfxml_cpu_power) FAIL("Required attribute `power' not set for `cpu' element.");
608 LEAVE; STag_surfxml_cpu(); surfxml_pcdata_ix = 0; ETag_surfxml_cpu(); popbuffer(); /* attribute */
610 case S_surfxml_platform_description_2: case S_surfxml_platform_description_3: case S_surfxml_platform_description: SET(S_surfxml_platform_description_3); break;
611 case ROOT_surfxml_cpu: SET(EPILOG); break;
614 . FAIL("Unexpected character `%c' in attribute list of cpu element.", yytext[0]);
615 {Name} FAIL("Bad attribute `%s' in `cpu' element start tag.",yytext);
616 <<EOF>> FAIL("EOF in attribute list of `cpu' element.");
623 popbuffer(); /* attribute */
625 case S_surfxml_platform_description_2: case S_surfxml_platform_description_3: case S_surfxml_platform_description: SET(S_surfxml_platform_description_3); break;
626 case ROOT_surfxml_cpu: SET(EPILOG); break;
629 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</cpu>' expected.",yytext);
630 . FAIL("Unexpected character `%c': `</cpu>' expected.",yytext[0]);
631 <<EOF>> FAIL("Premature EOF: `</cpu>' expected.");
634 <S_surfxml_platform_description_4,E_surfxml_process,S_surfxml_platform_description_5,S_surfxml_process,S_surfxml_route_2,E_surfxml_route,S_surfxml_route_1,S_surfxml_process_1,S_surfxml_platform_description_1,E_surfxml_platform_description,S_surfxml_process_2,S_surfxml_route>"<router"{s} FAIL("Starting tag <router> is not allowed here.");
636 <ROOT_surfxml_router,S_surfxml_platform_description_2,S_surfxml_platform_description_3,S_surfxml_platform_description>"<router"{s} {
637 AX_surfxml_router_name = 0;
638 ENTER(AL_surfxml_router); pushbuffer(0);
642 "name"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_router_name);
643 "name"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_router_name);
646 if (!AX_surfxml_router_name) FAIL("Required attribute `name' not set for `router' element.");
647 LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router);
650 if (!AX_surfxml_router_name) FAIL("Required attribute `name' not set for `router' element.");
651 LEAVE; STag_surfxml_router(); surfxml_pcdata_ix = 0; ETag_surfxml_router(); popbuffer(); /* attribute */
653 case S_surfxml_platform_description_2: case S_surfxml_platform_description_3: case S_surfxml_platform_description: SET(S_surfxml_platform_description_3); break;
654 case ROOT_surfxml_router: SET(EPILOG); break;
657 . FAIL("Unexpected character `%c' in attribute list of router element.", yytext[0]);
658 {Name} FAIL("Bad attribute `%s' in `router' element start tag.",yytext);
659 <<EOF>> FAIL("EOF in attribute list of `router' element.");
665 ETag_surfxml_router();
666 popbuffer(); /* attribute */
668 case S_surfxml_platform_description_2: case S_surfxml_platform_description_3: case S_surfxml_platform_description: SET(S_surfxml_platform_description_3); break;
669 case ROOT_surfxml_router: SET(EPILOG); break;
672 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</router>' expected.",yytext);
673 . FAIL("Unexpected character `%c': `</router>' expected.",yytext[0]);
674 <<EOF>> FAIL("Premature EOF: `</router>' expected.");
677 <S_surfxml_platform_description_4,E_surfxml_process,S_surfxml_platform_description_5,S_surfxml_process,S_surfxml_route_2,E_surfxml_route,S_surfxml_route_1,S_surfxml_process_1,S_surfxml_platform_description_1,E_surfxml_platform_description,S_surfxml_process_2,S_surfxml_route>"<network_link"{s} FAIL("Starting tag <network_link> is not allowed here.");
679 <ROOT_surfxml_network_link,S_surfxml_platform_description_2,S_surfxml_platform_description_3,S_surfxml_platform_description>"<network_link"{s} {
680 AX_surfxml_network_link_name = 0;
681 AX_surfxml_network_link_bandwidth = 0;
682 AX_surfxml_network_link_bandwidth_file = 0;
683 AX_surfxml_network_link_latency = 26;
684 AX_surfxml_network_link_latency_file = 0;
685 AX_surfxml_network_link_state = A_surfxml_network_link_state_ON;
686 AX_surfxml_network_link_state_file = 0;
687 AX_surfxml_network_link_sharing_policy = A_surfxml_network_link_sharing_policy_SHARED;
688 ENTER(AL_surfxml_network_link); pushbuffer(0);
691 <AL_surfxml_network_link>{
692 "name"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_network_link_name);
693 "name"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_network_link_name);
695 "bandwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_network_link_bandwidth);
696 "bandwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_network_link_bandwidth);
698 "bandwidth_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_network_link_bandwidth_file);
699 "bandwidth_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_network_link_bandwidth_file);
701 "latency"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_network_link_latency);
702 "latency"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_network_link_latency);
704 "latency_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_network_link_latency_file);
705 "latency_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_network_link_latency_file);
708 "state"{Eq}"\"ON\"" A_surfxml_network_link_state = A_surfxml_network_link_state_ON;
710 "state"{Eq}"\"OFF\"" A_surfxml_network_link_state = A_surfxml_network_link_state_OFF;
712 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_network_link_state_file);
713 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_network_link_state_file);
715 "sharing_policy"{Eq}"'SHARED'" |
716 "sharing_policy"{Eq}"\"SHARED\"" A_surfxml_network_link_sharing_policy = A_surfxml_network_link_sharing_policy_SHARED;
717 "sharing_policy"{Eq}"'FATPIPE'" |
718 "sharing_policy"{Eq}"\"FATPIPE\"" A_surfxml_network_link_sharing_policy = A_surfxml_network_link_sharing_policy_FATPIPE;
721 if (!AX_surfxml_network_link_name) FAIL("Required attribute `name' not set for `network_link' element.");
722 if (!AX_surfxml_network_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `network_link' element.");
723 LEAVE; STag_surfxml_network_link();surfxml_pcdata_ix = 0; ENTER(E_surfxml_network_link);
726 if (!AX_surfxml_network_link_name) FAIL("Required attribute `name' not set for `network_link' element.");
727 if (!AX_surfxml_network_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `network_link' element.");
728 LEAVE; STag_surfxml_network_link(); surfxml_pcdata_ix = 0; ETag_surfxml_network_link(); popbuffer(); /* attribute */
730 case S_surfxml_platform_description_2: case S_surfxml_platform_description_3: case S_surfxml_platform_description: SET(S_surfxml_platform_description_3); break;
731 case ROOT_surfxml_network_link: SET(EPILOG); break;
734 . FAIL("Unexpected character `%c' in attribute list of network_link element.", yytext[0]);
735 {Name} FAIL("Bad attribute `%s' in `network_link' element start tag.",yytext);
736 <<EOF>> FAIL("EOF in attribute list of `network_link' element.");
739 <E_surfxml_network_link>{
740 "</network_link"{s}">" {
742 ETag_surfxml_network_link();
743 popbuffer(); /* attribute */
745 case S_surfxml_platform_description_2: case S_surfxml_platform_description_3: case S_surfxml_platform_description: SET(S_surfxml_platform_description_3); break;
746 case ROOT_surfxml_network_link: SET(EPILOG); break;
749 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</network_link>' expected.",yytext);
750 . FAIL("Unexpected character `%c': `</network_link>' expected.",yytext[0]);
751 <<EOF>> FAIL("Premature EOF: `</network_link>' expected.");
754 <E_surfxml_process,S_surfxml_process,S_surfxml_route_2,E_surfxml_route,S_surfxml_route_1,S_surfxml_process_1,E_surfxml_platform_description,S_surfxml_process_2,S_surfxml_platform_description_2,S_surfxml_route>"<route"{s} FAIL("Starting tag <route> is not allowed here.");
756 <ROOT_surfxml_route,S_surfxml_platform_description_5,S_surfxml_platform_description_3,S_surfxml_platform_description_1,S_surfxml_platform_description,S_surfxml_platform_description_4>"<route"{s} {
757 AX_surfxml_route_src = 0;
758 AX_surfxml_route_dst = 0;
759 AX_surfxml_route_impact_on_src = 30;
760 AX_surfxml_route_impact_on_dst = 34;
761 AX_surfxml_route_impact_on_src_with_other_recv = 38;
762 AX_surfxml_route_impact_on_dst_with_other_send = 42;
763 ENTER(AL_surfxml_route); pushbuffer(0);
767 "src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src);
768 "src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src);
770 "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst);
771 "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst);
773 "impact_on_src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src);
774 "impact_on_src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src);
776 "impact_on_dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst);
777 "impact_on_dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst);
779 "impact_on_src_with_other_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
780 "impact_on_src_with_other_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
782 "impact_on_dst_with_other_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
783 "impact_on_dst_with_other_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
786 if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
787 if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
788 LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route);
791 if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
792 if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
793 LEAVE; STag_surfxml_route(); surfxml_pcdata_ix = 0; ETag_surfxml_route(); popbuffer(); /* attribute */
795 case S_surfxml_platform_description_5: case S_surfxml_platform_description_3: case S_surfxml_platform_description_1: case S_surfxml_platform_description: case S_surfxml_platform_description_4: SET(S_surfxml_platform_description_5); break;
796 case ROOT_surfxml_route: SET(EPILOG); break;
799 . FAIL("Unexpected character `%c' in attribute list of route element.", yytext[0]);
800 {Name} FAIL("Bad attribute `%s' in `route' element start tag.",yytext);
801 <<EOF>> FAIL("EOF in attribute list of `route' element.");
804 <S_surfxml_route,S_surfxml_route_2,E_surfxml_route>{
807 ETag_surfxml_route();
808 popbuffer(); /* attribute */
810 case S_surfxml_platform_description_5: case S_surfxml_platform_description_3: case S_surfxml_platform_description_1: case S_surfxml_platform_description: case S_surfxml_platform_description_4: SET(S_surfxml_platform_description_5); break;
811 case ROOT_surfxml_route: SET(EPILOG); break;
814 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route>' expected.",yytext);
815 . FAIL("Unexpected character `%c': `</route>' expected.",yytext[0]);
816 <<EOF>> FAIL("Premature EOF: `</route>' expected.");
819 <S_surfxml_platform_description_4,E_surfxml_process,S_surfxml_platform_description_5,S_surfxml_process,S_surfxml_platform_description_3,E_surfxml_route,S_surfxml_platform_description,S_surfxml_process_1,S_surfxml_platform_description_1,E_surfxml_platform_description,S_surfxml_process_2,S_surfxml_platform_description_2>"<route_element"{s} FAIL("Starting tag <route_element> is not allowed here.");
821 <ROOT_surfxml_route_element,S_surfxml_route_1,S_surfxml_route,S_surfxml_route_2>"<route_element"{s} {
822 AX_surfxml_route_element_name = 0;
823 ENTER(AL_surfxml_route_element); pushbuffer(0);
826 <AL_surfxml_route_element>{
827 "name"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_element_name);
828 "name"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_element_name);
831 if (!AX_surfxml_route_element_name) FAIL("Required attribute `name' not set for `route_element' element.");
832 LEAVE; STag_surfxml_route_element();surfxml_pcdata_ix = 0; ENTER(E_surfxml_route_element);
835 if (!AX_surfxml_route_element_name) FAIL("Required attribute `name' not set for `route_element' element.");
836 LEAVE; STag_surfxml_route_element(); surfxml_pcdata_ix = 0; ETag_surfxml_route_element(); 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 . FAIL("Unexpected character `%c' in attribute list of route_element element.", yytext[0]);
843 {Name} FAIL("Bad attribute `%s' in `route_element' element start tag.",yytext);
844 <<EOF>> FAIL("EOF in attribute list of `route_element' element.");
847 <E_surfxml_route_element>{
848 "</route_element"{s}">" {
850 ETag_surfxml_route_element();
851 popbuffer(); /* attribute */
853 case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
854 case ROOT_surfxml_route_element: SET(EPILOG); break;
857 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route_element>' expected.",yytext);
858 . FAIL("Unexpected character `%c': `</route_element>' expected.",yytext[0]);
859 <<EOF>> FAIL("Premature EOF: `</route_element>' expected.");
862 <E_surfxml_process,S_surfxml_process,S_surfxml_route_2,E_surfxml_route,S_surfxml_route_1,S_surfxml_process_1,E_surfxml_platform_description,S_surfxml_process_2,S_surfxml_platform_description_2,S_surfxml_route>"<process"{s} FAIL("Starting tag <process> is not allowed here.");
864 <ROOT_surfxml_process,S_surfxml_platform_description_5,S_surfxml_platform_description_3,S_surfxml_platform_description_1,S_surfxml_platform_description,S_surfxml_platform_description_4>"<process"{s} {
865 AX_surfxml_process_host = 0;
866 AX_surfxml_process_function = 0;
867 AX_surfxml_process_start_time = 46;
868 AX_surfxml_process_kill_time = 51;
869 ENTER(AL_surfxml_process); pushbuffer(0);
872 <AL_surfxml_process>{
873 "host"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host);
874 "host"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host);
876 "function"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function);
877 "function"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function);
879 "start_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start_time);
880 "start_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start_time);
882 "kill_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill_time);
883 "kill_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill_time);
886 if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
887 if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
888 LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process);
891 if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
892 if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
893 LEAVE; STag_surfxml_process(); surfxml_pcdata_ix = 0; ETag_surfxml_process(); popbuffer(); /* attribute */
895 case S_surfxml_platform_description_5: case S_surfxml_platform_description_3: case S_surfxml_platform_description_1: case S_surfxml_platform_description: case S_surfxml_platform_description_4: SET(S_surfxml_platform_description_5); break;
896 case ROOT_surfxml_process: SET(EPILOG); break;
899 . FAIL("Unexpected character `%c' in attribute list of process element.", yytext[0]);
900 {Name} FAIL("Bad attribute `%s' in `process' element start tag.",yytext);
901 <<EOF>> FAIL("EOF in attribute list of `process' element.");
904 <S_surfxml_process,E_surfxml_process,S_surfxml_process_2>{
907 ETag_surfxml_process();
908 popbuffer(); /* attribute */
910 case S_surfxml_platform_description_5: case S_surfxml_platform_description_3: case S_surfxml_platform_description_1: case S_surfxml_platform_description: case S_surfxml_platform_description_4: SET(S_surfxml_platform_description_5); break;
911 case ROOT_surfxml_process: SET(EPILOG); break;
914 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</process>' expected.",yytext);
915 . FAIL("Unexpected character `%c': `</process>' expected.",yytext[0]);
916 <<EOF>> FAIL("Premature EOF: `</process>' expected.");
919 <S_surfxml_platform_description_4,E_surfxml_process,S_surfxml_platform_description_5,S_surfxml_platform_description_3,S_surfxml_route_2,E_surfxml_route,S_surfxml_platform_description,S_surfxml_route_1,S_surfxml_platform_description_1,E_surfxml_platform_description,S_surfxml_platform_description_2,S_surfxml_route>"<argument"{s} FAIL("Starting tag <argument> is not allowed here.");
921 <ROOT_surfxml_argument,S_surfxml_process_1,S_surfxml_process,S_surfxml_process_2>"<argument"{s} {
922 AX_surfxml_argument_value = 0;
923 ENTER(AL_surfxml_argument); pushbuffer(0);
926 <AL_surfxml_argument>{
927 "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_argument_value);
928 "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_argument_value);
931 if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
932 LEAVE; STag_surfxml_argument();surfxml_pcdata_ix = 0; ENTER(E_surfxml_argument);
935 if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
936 LEAVE; STag_surfxml_argument(); surfxml_pcdata_ix = 0; ETag_surfxml_argument(); popbuffer(); /* attribute */
938 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
939 case ROOT_surfxml_argument: SET(EPILOG); break;
942 . FAIL("Unexpected character `%c' in attribute list of argument element.", yytext[0]);
943 {Name} FAIL("Bad attribute `%s' in `argument' element start tag.",yytext);
944 <<EOF>> FAIL("EOF in attribute list of `argument' element.");
947 <E_surfxml_argument>{
950 ETag_surfxml_argument();
951 popbuffer(); /* attribute */
953 case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
954 case ROOT_surfxml_argument: SET(EPILOG); break;
957 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</argument>' expected.",yytext);
958 . FAIL("Unexpected character `%c': `</argument>' expected.",yytext[0]);
959 <<EOF>> FAIL("Premature EOF: `</argument>' expected.");
962 /* EPILOG: after the root element. */
965 . {SET(PROLOG); yyless(0); CLEANUP; return -1;}
969 /* CHARACTER DATA. */
971 <IMPOSSIBLE,VALUE1,VALUE2>{
972 /* Non-defined standard entities... */
973 "&" BUFFERPUTC('&');
974 "<" BUFFERPUTC('<');
975 ">" BUFFERPUTC('>');
976 "'" BUFFERPUTC('\'');
977 """ BUFFERPUTC('"');
979 /* Character entities. */
980 "&#"[[:digit:]]+";" BUFFERPUTC((unsigned char)atoi(yytext+2));
981 "&#x"[[:xdigit:]]+";" BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
984 <IMPOSSIBLE,VALUE1,VALUE2,CDATA>{
988 "\n\r" BUFFERPUTC('\n');
992 "<![CDATA[" ENTER(CDATA);
993 "]""]>" FAIL("Unexpected `]""]>' in character data.");
997 \' BUFFERDONE; LEAVE;
998 <<EOF>> FAIL("EOF in literal (\"'\" expected).");
1002 \" BUFFERDONE; LEAVE;
1003 <<EOF>> FAIL("EOF in literal (`\"' expected).");
1006 <IMPOSSIBLE,VALUE1,VALUE2>{
1007 [^<&] BUFFERPUTC(yytext[0]);
1008 [<&] FAIL("Spurious `%c' in character data.",yytext[0]);
1013 /* "]""]" BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]); */
1014 . BUFFERPUTC(yytext[0]);
1015 <<EOF>> FAIL("EOF in CDATA section.");
1018 /* Impossible rules to avoid warnings from flex(1). */
1019 /* Ideally, this should be replaced by code in flexml.pl that
1020 generates just the states not covered by other rules. */
1022 .|[\n] FAIL("Syntax error on character `%c'.", yytext[0]);
1027 /* Element context stack lookup. */
1028 int surfxml_element_context(int i)
1030 return (0<i && i<yy_start_stack_depth
1031 ? yy_start_stack[yy_start_stack_ptr - i]
1036 void print_yy_stack(char* fmt, ...)
1038 int i = 0; va_list ap; va_start(ap, fmt);
1039 vfprintf(stderr, fmt, ap);
1040 if (surfxml_statenames) {
1041 for (i=1; i<yy_start_stack_ptr; i++) {
1042 fprintf(stderr, "%s/", surfxml_statenames[yy_start_stack[i] ]);
1044 fprintf(stderr,"%s\n", surfxml_statenames[YY_START]);
1049 void print_surfxml_bufferstack()
1052 fputs("Buffer: ", stderr);
1053 for (i = 0; i < blimit; i++) {
1054 if ( surfxml_bufferstack[i] == '\377' ) break;
1055 putc(surfxml_bufferstack[i], stderr);
1060 static void debug_enter(int state, const char* statename) {
1061 yy_push_state(state);
1062 if (yy_flex_debug) {
1063 print_yy_stack("--ENTER(%s) : ",statename);
1064 print_surfxml_bufferstack();
1068 static void debug_leave(void) {
1069 if (yy_flex_debug) {
1070 print_yy_stack("--LEAVE : ");
1071 print_surfxml_bufferstack();
1076 static void debug_set(int state, const char* statename) {
1078 if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename);
1083 static void cleanup(void)
1085 if (surfxml_statenames) {
1086 free(surfxml_statenames);
1087 surfxml_statenames = NULL;
1089 free(surfxml_bufferstack);
1090 surfxml_bufferstack = NULL;
1097 static int fail(const char* fmt, ...)
1099 int chars_left, used;
1100 va_list ap; va_start(ap, fmt);
1101 #ifdef FLEXML_yylineno
1102 used = sprintf(flexml_err_msg,
1103 "Invalid XML (XML input line %d, state %d): ",
1104 yylineno, YY_START);
1106 used = sprintf(flexml_err_msg,
1107 "Invalid XML (state %d): ",
1110 chars_left = flexml_max_err_msg_size - used - 1;
1111 vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
1114 #ifndef FLEXML_quiet_parser
1115 /* print directly to sdterr */
1116 fprintf(stderr, "%s\n", flexml_err_msg);
1117 flexml_err_msg[0] = '\0';