1 /* Validating XML processor for surfxml.dtd.
2 * Generated 2005/01/09 15:25:17.
4 * This program was generated with the FleXML XML processor generator,
5 * (Id: flexml.pl,v 1.35 2005/01/05 06:29:58 legranda Exp).
6 * Copyright © 1999 Kristoffer Rose. All rights reserved.
8 * You can redistribute and/or modify this program provided the following
11 * 1. The program is distributed WITHOUT ANY WARRANTY from the author of
12 * FleXML; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.
15 * 2. The program distribution conditions do not in any way affect the
16 * distribution conditions of the FleXML system used to generate this
17 * file or any version of FleXML derived from that system.
19 * Notice that these are explicit rights granted to you for files
20 * generated by the FleXML system. For your rights in connection with
21 * the FleXML system itself please consult the GNU General Public License.
26 /* Version strings. */
27 const char rcs_flexml_skeleton[] =
28 "$" "Id: skel,v 1.19 2005/01/05 18:49:27 legranda Exp $";
29 const char rcs_flexml[] =
30 "$" "Id: flexml.pl,v 1.35 2005/01/05 06:29:58 legranda Exp $";
40 /* Generated definitions. */
41 #define FLEXML_yylineno
42 #define FLEXML_BUFFERSTACKSIZE 10000000
44 /* XML processor api. */
47 /* FleXML-provided data. */
49 AT_network_link_bandwidth A_network_link_bandwidth;
50 AT_cpu_name A_cpu_name;
51 AT_network_link_state A_network_link_state;
52 AT_argument_value A_argument_value;
53 AT_cpu_availability_file A_cpu_availability_file;
54 AT_process_host A_process_host;
55 AT_route_impact_on_src A_route_impact_on_src;
56 AT_route_src A_route_src;
57 AT_network_link_latency_file A_network_link_latency_file;
58 AT_route_impact_on_dst_with_other_send A_route_impact_on_dst_with_other_send;
59 AT_cpu_interference_send_recv A_cpu_interference_send_recv;
60 AT_cpu_availability A_cpu_availability;
61 AT_route_impact_on_dst A_route_impact_on_dst;
62 AT_cpu_interference_recv A_cpu_interference_recv;
63 AT_route_impact_on_src_with_other_recv A_route_impact_on_src_with_other_recv;
64 AT_network_link_name A_network_link_name;
65 AT_route_element_name A_route_element_name;
66 AT_cpu_power A_cpu_power;
67 AT_include_file A_include_file;
68 AT_process_function A_process_function;
69 AT_route_dst A_route_dst;
70 AT_cpu_state A_cpu_state;
71 AT_network_link_latency A_network_link_latency;
72 AT_network_link_state_file A_network_link_state_file;
73 AT_cpu_interference_send A_cpu_interference_send;
74 AT_cpu_state_file A_cpu_state_file;
75 AT_network_link_bandwidth_file A_network_link_bandwidth_file;
79 # define ENTER(state) debug_enter(state,#state)
80 # define LEAVE debug_leave()
81 # define SET(state) debug_set(state,#state)
82 static void debug_enter(int, const char*);
83 static void debug_leave(void);
84 static void debug_set(int, const char*);
86 # define ENTER(state) (yy_push_state(state))
87 # define LEAVE (yy_pop_state())
88 # define SET(state) BEGIN(state)
91 /* Generic actions. */
93 #define SUCCEED return 0
95 #define FAIL return fail
96 static int fail(const char*, ...);
98 /* Text buffer stack handling. */
99 char bufferstack[FLEXML_BUFFERSTACKSIZE];
100 char* limit = bufferstack + FLEXML_BUFFERSTACKSIZE;
101 typedef struct BufferLast_s {
102 struct BufferLast_s *old; char* saved; char new[1];
104 BufferLast* last = (BufferLast*)0;
105 char* next = bufferstack;
107 #define BUFFERSET(P) (P = next)
108 #define BUFFERPUTC(C) (assert(next<limit), *(next++) = (C))
109 #define BUFFERDONE (BUFFERPUTC('\0'))
111 #define BUFFERLITERAL(C,P) bufferliteral(C,&(P),yytext)
112 static void bufferliteral(char c, const char** pp, char* text)
114 char *s = strchr(text,c), *e = strrchr(text,c);
115 assert(s <= e); BUFFERSET(*pp);
117 if (isspace(*s)) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
123 #ifdef FLEXML_HasMixed
124 static void pushbuffer(char* p)
126 BufferLast* l = (BufferLast*)next;
127 assert(next < limit);
134 static char* popbuffer(void)
136 BufferLast* l = last;
137 assert(last != (BufferLast*)0);
144 /* General internal entities are `unput' back onto the input stream... */
145 #define ENTITYTEXT(T) \
146 { char *s = (T), *e = s+strlen(s);\
147 while (--e >= s) { unput(*e); }}
150 /* Flex standard options. */
152 %option noyy_top_state
158 /* Flex user-requested options. */
162 /* XML character classes (currently restricted to ASCII). */
164 /* "Common syntactic structures." */
168 /* "Names and Tokens." */
169 NameChar [A-Za-z0-9.:_-]
170 Name [A-Za-z_:]{NameChar}*
171 Names {Name}({S}{Name})*
172 Nmtoken ({NameChar})+
173 Nmtokens {Nmtoken}({S}{Nmtoken})*
176 VersionNum [a-zA-Z0-9_.:-]+
178 Literal \'[^'']*\'|\"[^""]*\"
180 /* Parser states (flex `exclusive start conditions'):
182 * PROLOG the XML prolog of the document before <?xml...>
183 * DOCTYPE the XML prolog of the document after <?xml...>
184 * EPILOG after the root element
185 * INCOMMENT inside an XML comment <!--....-->
186 * INPI inside an XML PI <?...?>
187 * VALUE1 inside a '...'-delimited literal
188 * VALUE2 inside a "..."-delimited literal
189 * CDATA inside a <![CDATA[...]]> section.
190 * ROOT_<tag> expect root element <tag>
191 * AL_<tag> inside the attribute list for <tag>
192 * IN_<tag> inside a <tag> with element contents (ready for end tag)
193 * IMPOSSIBLE dummy to permit disabling rules; must be last
195 %x PROLOG DOCTYPE EPILOG INCOMMENT INPI VALUE1 VALUE2 CDATA
196 %x ROOT_platform_description AL_platform_description S_platform_description S_platform_description_1 S_platform_description_2 E_platform_description
197 %x ROOT_include AL_include S_include S_include_1 S_include_2 E_include
198 %x ROOT_cpu AL_cpu E_cpu
199 %x ROOT_network_link AL_network_link E_network_link
200 %x ROOT_route AL_route S_route S_route_1 S_route_2 E_route
201 %x ROOT_route_element AL_route_element E_route_element
202 %x ROOT_process AL_process S_process S_process_1 S_process_2 E_process
203 %x ROOT_argument AL_argument E_argument
208 const char* *statenames=NULL;
213 /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
216 if(!statenames) statenames=calloc(IMPOSSIBLE,sizeof(char*));
217 statenames[PROLOG] = NULL;
218 statenames[DOCTYPE] = NULL;
219 statenames[EPILOG] = NULL;
220 statenames[INCOMMENT] = NULL;
221 statenames[INPI] = NULL;
222 statenames[VALUE1] = NULL;
223 statenames[VALUE2] = NULL;
224 statenames[CDATA] = NULL;
225 statenames[ROOT_platform_description] = NULL;
226 statenames[AL_platform_description] = NULL;
227 statenames[S_platform_description] = "platform_description";
228 statenames[S_platform_description_1] = "platform_description";
229 statenames[S_platform_description_2] = "platform_description";
230 statenames[E_platform_description] = "platform_description";
231 statenames[ROOT_include] = NULL;
232 statenames[AL_include] = NULL;
233 statenames[S_include] = "include";
234 statenames[S_include_1] = "include";
235 statenames[S_include_2] = "include";
236 statenames[E_include] = "include";
237 statenames[ROOT_cpu] = NULL;
238 statenames[AL_cpu] = NULL;
239 statenames[E_cpu] = "cpu";
240 statenames[ROOT_network_link] = NULL;
241 statenames[AL_network_link] = NULL;
242 statenames[E_network_link] = "network_link";
243 statenames[ROOT_route] = NULL;
244 statenames[AL_route] = NULL;
245 statenames[S_route] = "route";
246 statenames[S_route_1] = "route";
247 statenames[S_route_2] = "route";
248 statenames[E_route] = "route";
249 statenames[ROOT_route_element] = NULL;
250 statenames[AL_route_element] = NULL;
251 statenames[E_route_element] = "route_element";
252 statenames[ROOT_process] = NULL;
253 statenames[AL_process] = NULL;
254 statenames[S_process] = "process";
255 statenames[S_process_1] = "process";
256 statenames[S_process_2] = "process";
257 statenames[E_process] = "process";
258 statenames[ROOT_argument] = NULL;
259 statenames[AL_argument] = NULL;
260 statenames[E_argument] = "argument";
262 /* COMMENTS and PIs: handled uniformly for efficiency. */
264 <ROOT_platform_description,AL_platform_description,S_platform_description,S_platform_description_1,S_platform_description_2,E_platform_description,ROOT_include,AL_include,S_include,S_include_1,S_include_2,E_include,ROOT_cpu,AL_cpu,E_cpu,ROOT_network_link,AL_network_link,E_network_link,ROOT_route,AL_route,S_route,S_route_1,S_route_2,E_route,ROOT_route_element,AL_route_element,E_route_element,ROOT_process,AL_process,S_process,S_process_1,S_process_2,E_process,ROOT_argument,AL_argument,E_argument,PROLOG,DOCTYPE,EPILOG>{
265 "<!--" ENTER(INCOMMENT);
273 <<EOF>> FAIL("EOF in comment.");
279 <<EOF>> FAIL("EOF in PI (processing instruction).");
282 /* SPACES: skipped uniformly */
284 <ROOT_platform_description,AL_platform_description,S_platform_description,S_platform_description_1,S_platform_description_2,E_platform_description,ROOT_include,AL_include,S_include,S_include_1,S_include_2,E_include,ROOT_cpu,AL_cpu,E_cpu,ROOT_network_link,AL_network_link,E_network_link,ROOT_route,AL_route,S_route,S_route_1,S_route_2,E_route,ROOT_route_element,AL_route_element,E_route_element,ROOT_process,AL_process,S_process,S_process_1,S_process_2,E_process,ROOT_argument,AL_argument,E_argument,PROLOG,DOCTYPE,EPILOG>{S} SKIP;
286 /* PROLOG: determine root element and process it. */
289 "<?xml"({S}version{Eq}(\'{VersionNum}\'|\"{VersionNum}\"))?"?>" SET(DOCTYPE);
290 "<?xml"[^>]*">" FAIL("Bad declaration %s.",yytext);
294 "<!DOCTYPE"{S}"argument"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_argument);
295 "<!DOCTYPE"{S}"route_element"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_route_element);
296 "<!DOCTYPE"{S}"cpu"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_cpu);
297 "<!DOCTYPE"{S}"include"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_include);
298 "<!DOCTYPE"{S}"route"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_route);
299 "<!DOCTYPE"{S}"platform_description"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_platform_description);
300 "<!DOCTYPE"{S}"network_link"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_network_link);
301 "<!DOCTYPE"{S}"process"{S}SYSTEM{S}("'surfxml.dtd'"|"\"surfxml.dtd\""){s}">" SET(ROOT_process);
302 "<!"[^>-][^>]*">" FAIL("Bad declaration %s.",yytext);
303 . FAIL("Unexpected character `%c' in prolog.", yytext[0]);
304 <<EOF>> FAIL("EOF in prolog.");
307 /* RULES DERIVED FROM DTD. */
309 /* <!-- Small DTD for SURF based tools. --> */
311 <ROOT_platform_description>"<platform_description"{s} {
312 ENTER(AL_platform_description);
315 <AL_platform_description>{
317 LEAVE; STag_platform_description();pcdata = NULL; ENTER(S_platform_description);
320 LEAVE; STag_platform_description(); pcdata = NULL; ETag_platform_description();
322 case ROOT_platform_description: SET(EPILOG); break;
325 . FAIL("Unexpected character `%c' in attribute list of platform_description element.", yytext[0]);
326 {Name} FAIL("Bad attribute `%s' in `platform_description' element start tag.",yytext);
327 <<EOF>> FAIL("EOF in attribute list of `platform_description' element.");
330 <E_platform_description,S_platform_description_2,S_platform_description>{
331 "</platform_description"{s}">" {
333 ETag_platform_description();
335 case ROOT_platform_description: SET(EPILOG); break;
338 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</platform_description>' expected.",yytext);
339 . FAIL("Unexpected character `%c': `</platform_description>' expected.",yytext[0]);
340 <<EOF>> FAIL("Premature EOF: `</platform_description>' expected.");
343 <ROOT_include,S_platform_description_2,S_include,S_include_2,S_platform_description_1,S_include_1,S_platform_description>"<include"{s} {
344 A_include_file = NULL;
349 "file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_include_file);
350 "file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_include_file);
353 if (!A_include_file) FAIL("Required attribute `file' not set for `include' element.");
354 LEAVE; STag_include();pcdata = NULL; ENTER(S_include);
357 if (!A_include_file) FAIL("Required attribute `file' not set for `include' element.");
358 LEAVE; STag_include(); pcdata = NULL; ETag_include();
360 case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break;
361 case S_include: case S_include_2: case S_include_1: SET(S_include_2); break;
362 case ROOT_include: SET(EPILOG); break;
365 . FAIL("Unexpected character `%c' in attribute list of include element.", yytext[0]);
366 {Name} FAIL("Bad attribute `%s' in `include' element start tag.",yytext);
367 <<EOF>> FAIL("EOF in attribute list of `include' element.");
370 <E_include,S_include,S_include_2>{
375 case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break;
376 case S_include: case S_include_2: case S_include_1: SET(S_include_2); break;
377 case ROOT_include: SET(EPILOG); break;
380 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</include>' expected.",yytext);
381 . FAIL("Unexpected character `%c': `</include>' expected.",yytext[0]);
382 <<EOF>> FAIL("Premature EOF: `</include>' expected.");
385 <ROOT_cpu,S_platform_description_2,S_include,S_include_2,S_platform_description_1,S_include_1,S_platform_description>"<cpu"{s} {
388 A_cpu_availability = "1.0";
389 A_cpu_availability_file = NULL;
390 A_cpu_state = A_cpu_state_ON;
391 A_cpu_state_file = NULL;
392 A_cpu_interference_send = "1.0";
393 A_cpu_interference_recv = "1.0";
394 A_cpu_interference_send_recv = "1.0";
399 "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_name);
400 "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_name);
402 "power"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_power);
403 "power"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_power);
405 "availability"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_availability);
406 "availability"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_availability);
408 "availability_file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_availability_file);
409 "availability_file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_availability_file);
412 "state"{Eq}"\"ON\"" A_cpu_state = A_cpu_state_ON;
414 "state"{Eq}"\"OFF\"" A_cpu_state = A_cpu_state_OFF;
416 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_state_file);
417 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_state_file);
419 "interference_send"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_interference_send);
420 "interference_send"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_interference_send);
422 "interference_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_interference_recv);
423 "interference_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_interference_recv);
425 "interference_send_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_interference_send_recv);
426 "interference_send_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_interference_send_recv);
429 if (!A_cpu_name) FAIL("Required attribute `name' not set for `cpu' element.");
430 if (!A_cpu_power) FAIL("Required attribute `power' not set for `cpu' element.");
431 LEAVE; STag_cpu();pcdata = NULL; ENTER(E_cpu);
434 if (!A_cpu_name) FAIL("Required attribute `name' not set for `cpu' element.");
435 if (!A_cpu_power) FAIL("Required attribute `power' not set for `cpu' element.");
436 LEAVE; STag_cpu(); pcdata = NULL; ETag_cpu();
438 case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break;
439 case S_include: case S_include_2: case S_include_1: SET(S_include_2); break;
440 case ROOT_cpu: SET(EPILOG); break;
443 . FAIL("Unexpected character `%c' in attribute list of cpu element.", yytext[0]);
444 {Name} FAIL("Bad attribute `%s' in `cpu' element start tag.",yytext);
445 <<EOF>> FAIL("EOF in attribute list of `cpu' element.");
453 case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break;
454 case S_include: case S_include_2: case S_include_1: SET(S_include_2); break;
455 case ROOT_cpu: SET(EPILOG); break;
458 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</cpu>' expected.",yytext);
459 . FAIL("Unexpected character `%c': `</cpu>' expected.",yytext[0]);
460 <<EOF>> FAIL("Premature EOF: `</cpu>' expected.");
463 <ROOT_network_link,S_platform_description_2,S_include,S_include_2,S_platform_description_1,S_include_1,S_platform_description>"<network_link"{s} {
464 A_network_link_name = NULL;
465 A_network_link_bandwidth = NULL;
466 A_network_link_bandwidth_file = NULL;
467 A_network_link_latency = "0.0";
468 A_network_link_latency_file = NULL;
469 A_network_link_state = A_network_link_state_ON;
470 A_network_link_state_file = NULL;
471 ENTER(AL_network_link);
475 "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_network_link_name);
476 "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_network_link_name);
478 "bandwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(A_network_link_bandwidth);
479 "bandwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(A_network_link_bandwidth);
481 "bandwidth_file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_network_link_bandwidth_file);
482 "bandwidth_file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_network_link_bandwidth_file);
484 "latency"{Eq}\' ENTER(VALUE1); BUFFERSET(A_network_link_latency);
485 "latency"{Eq}\" ENTER(VALUE2); BUFFERSET(A_network_link_latency);
487 "latency_file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_network_link_latency_file);
488 "latency_file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_network_link_latency_file);
491 "state"{Eq}"\"ON\"" A_network_link_state = A_network_link_state_ON;
493 "state"{Eq}"\"OFF\"" A_network_link_state = A_network_link_state_OFF;
495 "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_network_link_state_file);
496 "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_network_link_state_file);
499 if (!A_network_link_name) FAIL("Required attribute `name' not set for `network_link' element.");
500 if (!A_network_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `network_link' element.");
501 LEAVE; STag_network_link();pcdata = NULL; ENTER(E_network_link);
504 if (!A_network_link_name) FAIL("Required attribute `name' not set for `network_link' element.");
505 if (!A_network_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `network_link' element.");
506 LEAVE; STag_network_link(); pcdata = NULL; ETag_network_link();
508 case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break;
509 case S_include: case S_include_2: case S_include_1: SET(S_include_2); break;
510 case ROOT_network_link: SET(EPILOG); break;
513 . FAIL("Unexpected character `%c' in attribute list of network_link element.", yytext[0]);
514 {Name} FAIL("Bad attribute `%s' in `network_link' element start tag.",yytext);
515 <<EOF>> FAIL("EOF in attribute list of `network_link' element.");
519 "</network_link"{s}">" {
523 case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break;
524 case S_include: case S_include_2: case S_include_1: SET(S_include_2); break;
525 case ROOT_network_link: SET(EPILOG); break;
528 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</network_link>' expected.",yytext);
529 . FAIL("Unexpected character `%c': `</network_link>' expected.",yytext[0]);
530 <<EOF>> FAIL("Premature EOF: `</network_link>' expected.");
533 <ROOT_route,S_platform_description_2,S_include,S_include_2,S_platform_description_1,S_include_1,S_platform_description>"<route"{s} {
536 A_route_impact_on_src = "0.0";
537 A_route_impact_on_dst = "0.0";
538 A_route_impact_on_src_with_other_recv = "0.0";
539 A_route_impact_on_dst_with_other_send = "0.0";
544 "src"{Eq}\' ENTER(VALUE1); BUFFERSET(A_route_src);
545 "src"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_src);
547 "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(A_route_dst);
548 "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_dst);
550 "impact_on_src"{Eq}\' ENTER(VALUE1); BUFFERSET(A_route_impact_on_src);
551 "impact_on_src"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_impact_on_src);
553 "impact_on_dst"{Eq}\' ENTER(VALUE1); BUFFERSET(A_route_impact_on_dst);
554 "impact_on_dst"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_impact_on_dst);
556 "impact_on_src_with_other_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(A_route_impact_on_src_with_other_recv);
557 "impact_on_src_with_other_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_impact_on_src_with_other_recv);
559 "impact_on_dst_with_other_send"{Eq}\' ENTER(VALUE1); BUFFERSET(A_route_impact_on_dst_with_other_send);
560 "impact_on_dst_with_other_send"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_impact_on_dst_with_other_send);
563 if (!A_route_src) FAIL("Required attribute `src' not set for `route' element.");
564 if (!A_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
565 LEAVE; STag_route();pcdata = NULL; ENTER(S_route);
568 if (!A_route_src) FAIL("Required attribute `src' not set for `route' element.");
569 if (!A_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
570 LEAVE; STag_route(); pcdata = NULL; ETag_route();
572 case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break;
573 case S_include: case S_include_2: case S_include_1: SET(S_include_2); break;
574 case ROOT_route: SET(EPILOG); break;
577 . FAIL("Unexpected character `%c' in attribute list of route element.", yytext[0]);
578 {Name} FAIL("Bad attribute `%s' in `route' element start tag.",yytext);
579 <<EOF>> FAIL("EOF in attribute list of `route' element.");
582 <S_route,S_route_2,E_route>{
587 case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break;
588 case S_include: case S_include_2: case S_include_1: SET(S_include_2); break;
589 case ROOT_route: SET(EPILOG); break;
592 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route>' expected.",yytext);
593 . FAIL("Unexpected character `%c': `</route>' expected.",yytext[0]);
594 <<EOF>> FAIL("Premature EOF: `</route>' expected.");
597 <ROOT_route_element,S_route_1,S_route,S_route_2>"<route_element"{s} {
598 A_route_element_name = NULL;
599 ENTER(AL_route_element);
603 "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_route_element_name);
604 "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_element_name);
607 if (!A_route_element_name) FAIL("Required attribute `name' not set for `route_element' element.");
608 LEAVE; STag_route_element();pcdata = NULL; ENTER(E_route_element);
611 if (!A_route_element_name) FAIL("Required attribute `name' not set for `route_element' element.");
612 LEAVE; STag_route_element(); pcdata = NULL; ETag_route_element();
614 case S_route_1: case S_route: case S_route_2: SET(S_route_2); break;
615 case ROOT_route_element: SET(EPILOG); break;
618 . FAIL("Unexpected character `%c' in attribute list of route_element element.", yytext[0]);
619 {Name} FAIL("Bad attribute `%s' in `route_element' element start tag.",yytext);
620 <<EOF>> FAIL("EOF in attribute list of `route_element' element.");
624 "</route_element"{s}">" {
626 ETag_route_element();
628 case S_route_1: case S_route: case S_route_2: SET(S_route_2); break;
629 case ROOT_route_element: SET(EPILOG); break;
632 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route_element>' expected.",yytext);
633 . FAIL("Unexpected character `%c': `</route_element>' expected.",yytext[0]);
634 <<EOF>> FAIL("Premature EOF: `</route_element>' expected.");
637 <ROOT_process,S_platform_description_2,S_include,S_include_2,S_platform_description_1,S_include_1,S_platform_description>"<process"{s} {
638 A_process_host = NULL;
639 A_process_function = NULL;
644 "host"{Eq}\' ENTER(VALUE1); BUFFERSET(A_process_host);
645 "host"{Eq}\" ENTER(VALUE2); BUFFERSET(A_process_host);
647 "function"{Eq}\' ENTER(VALUE1); BUFFERSET(A_process_function);
648 "function"{Eq}\" ENTER(VALUE2); BUFFERSET(A_process_function);
651 if (!A_process_host) FAIL("Required attribute `host' not set for `process' element.");
652 if (!A_process_function) FAIL("Required attribute `function' not set for `process' element.");
653 LEAVE; STag_process();pcdata = NULL; ENTER(S_process);
656 if (!A_process_host) FAIL("Required attribute `host' not set for `process' element.");
657 if (!A_process_function) FAIL("Required attribute `function' not set for `process' element.");
658 LEAVE; STag_process(); pcdata = NULL; ETag_process();
660 case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break;
661 case S_include: case S_include_2: case S_include_1: SET(S_include_2); break;
662 case ROOT_process: SET(EPILOG); break;
665 . FAIL("Unexpected character `%c' in attribute list of process element.", yytext[0]);
666 {Name} FAIL("Bad attribute `%s' in `process' element start tag.",yytext);
667 <<EOF>> FAIL("EOF in attribute list of `process' element.");
670 <S_process,E_process,S_process_2>{
675 case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break;
676 case S_include: case S_include_2: case S_include_1: SET(S_include_2); break;
677 case ROOT_process: SET(EPILOG); break;
680 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</process>' expected.",yytext);
681 . FAIL("Unexpected character `%c': `</process>' expected.",yytext[0]);
682 <<EOF>> FAIL("Premature EOF: `</process>' expected.");
685 <ROOT_argument,S_process_1,S_process,S_process_2>"<argument"{s} {
686 A_argument_value = NULL;
691 "value"{Eq}\' ENTER(VALUE1); BUFFERSET(A_argument_value);
692 "value"{Eq}\" ENTER(VALUE2); BUFFERSET(A_argument_value);
695 if (!A_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
696 LEAVE; STag_argument();pcdata = NULL; ENTER(E_argument);
699 if (!A_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
700 LEAVE; STag_argument(); pcdata = NULL; ETag_argument();
702 case ROOT_argument: SET(EPILOG); break;
703 case S_process_1: case S_process: case S_process_2: SET(S_process_2); break;
706 . FAIL("Unexpected character `%c' in attribute list of argument element.", yytext[0]);
707 {Name} FAIL("Bad attribute `%s' in `argument' element start tag.",yytext);
708 <<EOF>> FAIL("EOF in attribute list of `argument' element.");
716 case ROOT_argument: SET(EPILOG); break;
717 case S_process_1: case S_process: case S_process_2: SET(S_process_2); break;
720 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</argument>' expected.",yytext);
721 . FAIL("Unexpected character `%c': `</argument>' expected.",yytext[0]);
722 <<EOF>> FAIL("Premature EOF: `</argument>' expected.");
725 /* EPILOG: after the root element. */
728 . FAIL("Unexpected character `%c' after document.", yytext[0]);
732 /* CHARACTER DATA. */
734 <IMPOSSIBLE,VALUE1,VALUE2>{
735 /* Non-defined standard entities... */
736 "&" BUFFERPUTC('&');
737 "<" BUFFERPUTC('<');
738 ">" BUFFERPUTC('>');
739 "'" BUFFERPUTC('\'');
740 """ BUFFERPUTC('"');
742 /* Character entities. */
743 "&#"[[:digit:]]+";" BUFFERPUTC((unsigned char)atoi(yytext+2));
744 "&#x"[[:xdigit:]]+";" BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
747 <IMPOSSIBLE,VALUE1,VALUE2,CDATA>{
751 "\n\r" BUFFERPUTC('\n');
755 "<![CDATA[" ENTER(CDATA);
756 "]""]>" FAIL("Unexpected `]""]>' in character data.");
760 \' BUFFERDONE; LEAVE;
761 <<EOF>> FAIL("EOF in literal (\"'\" expected).");
765 \" BUFFERDONE; LEAVE;
766 <<EOF>> FAIL("EOF in literal (`\"' expected).");
769 <IMPOSSIBLE,VALUE1,VALUE2>{
770 [^<&] BUFFERPUTC(yytext[0]);
771 [<&] FAIL("Spurious `%c' in character data.",yytext[0]);
776 "]""]" BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]);
777 . BUFFERPUTC(yytext[0]);
778 <<EOF>> FAIL("EOF in CDATA section.");
781 /* Impossible rules to avoid warnings from flex(1). */
783 <INITIAL,IMPOSSIBLE>{
784 .|[\n] FAIL("The Impossible Happened: INITIAL or IMPOSSIBLE state entered?");
789 /* Element context stack lookup. */
790 int element_context(int i)
792 return (0<i && i<yy_start_stack_depth
793 ? yy_start_stack[yy_start_stack_ptr - i]
798 void print_yy_stack(char* fmt, ...)
800 int i = 0; va_list ap; va_start(ap, fmt);
801 vfprintf(stderr, fmt, ap);
802 for (i=1; i<yy_start_stack_ptr; i++)
803 fprintf(stderr, "%s/", statenames[yy_start_stack[i] ]);
804 fprintf(stderr,"%s\n", statenames[YY_START]);
808 static void debug_enter(int state, const char* statename) {
809 yy_push_state(state);
810 if (yy_flex_debug) print_yy_stack("--ENTER(%s) : ",statename);
813 static void debug_leave(void) {
814 if (yy_flex_debug) print_yy_stack("--LEAVE : ");
818 static void debug_set(int state, const char* statename) {
820 if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename);
825 static int fail(const char* fmt, ...)
827 va_list ap; va_start(ap, fmt);
828 #ifdef FLEXML_yylineno
829 fprintf(stderr, "Invalid XML (XML input line %d, state %d): ", yylineno, YY_START);
831 fprintf(stderr, "Invalid XML (state %d): ",YY_START);
833 vfprintf(stderr, fmt, ap);
834 fprintf(stderr, "\n");