Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Windows version of rand_r() and drand48()functions.
[simgrid.git] / src / surf / simgrid_dtd.l
1 /* Validating XML processor for surf/simgrid.dtd.
2  * Generated 2008/02/03 11:50:45.
3  *
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.63 2007/10/11 14:46:08 mquinson Exp).
8  * 
9  * There are two, intertwined parts to this program, part A and part B.
10  *
11  * Part A
12  * ------
13  * 
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.
17  *
18  * You can redistribute, use, perform, display and/or modify "Part A"
19  * provided the following two conditions hold:
20  *
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.
24  *
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.
28  *
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.
32  * 
33  * Part B
34  * ------
35  * 
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".
41  *
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.
45  * 
46  */
47
48 %{
49
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.63 2007/10/11 14:46:08 mquinson Exp $";
55
56 /* ANSI headers. */
57 #include <stdlib.h> /* for realloc() -- needed here when using flex 2.5.4 */
58 #include <stdio.h>
59 #include <string.h>
60 #include <assert.h>
61 #include <stdarg.h>
62 #include <ctype.h>
63      
64 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
65 # ifndef __STRICT_ANSI__
66 #  include <io.h>
67 #  include <process.h>
68 # endif
69 #else
70 # include <unistd.h>
71 #endif
72      
73 #ifndef FLEXML_INDEXSTACKSIZE
74 #define FLEXML_INDEXSTACKSIZE 1000
75 #endif
76
77 /* Generated definitions. */
78 #define FLEXML_yylineno
79 #ifndef FLEXML_BUFFERSTACKSIZE
80 #define FLEXML_BUFFERSTACKSIZE 1000000
81 #endif
82 #define FLEXML_NEED_BUFFERLIT
83
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_random_generator AX_surfxml_random_generator;
90 #define A_surfxml_random_generator AX_surfxml_random_generator
91 AT_surfxml_prop_id AX_surfxml_prop_id;
92 #define A_surfxml_prop_id (surfxml_bufferstack + AX_surfxml_prop_id)
93 AT_surfxml_host_interference_recv AX_surfxml_host_interference_recv;
94 #define A_surfxml_host_interference_recv (surfxml_bufferstack + AX_surfxml_host_interference_recv)
95 AT_surfxml_host_id AX_surfxml_host_id;
96 #define A_surfxml_host_id (surfxml_bufferstack + AX_surfxml_host_id)
97 AT_surfxml_set_id AX_surfxml_set_id;
98 #define A_surfxml_set_id (surfxml_bufferstack + AX_surfxml_set_id)
99 AT_surfxml_link_latency_file AX_surfxml_link_latency_file;
100 #define A_surfxml_link_latency_file (surfxml_bufferstack + AX_surfxml_link_latency_file)
101 AT_surfxml_host_state AX_surfxml_host_state;
102 #define A_surfxml_host_state AX_surfxml_host_state
103 AT_surfxml_host_interference_send_recv AX_surfxml_host_interference_send_recv;
104 #define A_surfxml_host_interference_send_recv (surfxml_bufferstack + AX_surfxml_host_interference_send_recv)
105 AT_surfxml_host_interference_send AX_surfxml_host_interference_send;
106 #define A_surfxml_host_interference_send (surfxml_bufferstack + AX_surfxml_host_interference_send)
107 AT_surfxml_set_suffix AX_surfxml_set_suffix;
108 #define A_surfxml_set_suffix (surfxml_bufferstack + AX_surfxml_set_suffix)
109 AT_surfxml_route_impact_on_dst AX_surfxml_route_impact_on_dst;
110 #define A_surfxml_route_impact_on_dst (surfxml_bufferstack + AX_surfxml_route_impact_on_dst)
111 AT_surfxml_host_power AX_surfxml_host_power;
112 #define A_surfxml_host_power (surfxml_bufferstack + AX_surfxml_host_power)
113 AT_surfxml_router_id AX_surfxml_router_id;
114 #define A_surfxml_router_id (surfxml_bufferstack + AX_surfxml_router_id)
115 AT_surfxml_process_start_time AX_surfxml_process_start_time;
116 #define A_surfxml_process_start_time (surfxml_bufferstack + AX_surfxml_process_start_time)
117 AT_surfxml_cluster_suffix AX_surfxml_cluster_suffix;
118 #define A_surfxml_cluster_suffix (surfxml_bufferstack + AX_surfxml_cluster_suffix)
119 AT_surfxml_platform_xmlns_c_route AX_surfxml_platform_xmlns_c_route;
120 #define A_surfxml_platform_xmlns_c_route (surfxml_bufferstack + AX_surfxml_platform_xmlns_c_route)
121 AT_surfxml_cluster_prefix AX_surfxml_cluster_prefix;
122 #define A_surfxml_cluster_prefix (surfxml_bufferstack + AX_surfxml_cluster_prefix)
123 AT_surfxml_trace_file AX_surfxml_trace_file;
124 #define A_surfxml_trace_file (surfxml_bufferstack + AX_surfxml_trace_file)
125 AT_surfxml_route_action AX_surfxml_route_action;
126 #define A_surfxml_route_action AX_surfxml_route_action
127 AT_surfxml_link_sharing_policy AX_surfxml_link_sharing_policy;
128 #define A_surfxml_link_sharing_policy AX_surfxml_link_sharing_policy
129 AT_surfxml_random_min AX_surfxml_random_min;
130 #define A_surfxml_random_min (surfxml_bufferstack + AX_surfxml_random_min)
131 AT_surfxml_process_kill_time AX_surfxml_process_kill_time;
132 #define A_surfxml_process_kill_time (surfxml_bufferstack + AX_surfxml_process_kill_time)
133 AT_surfxml_cluster_bb_bw AX_surfxml_cluster_bb_bw;
134 #define A_surfxml_cluster_bb_bw (surfxml_bufferstack + AX_surfxml_cluster_bb_bw)
135 AT_surfxml_trace_c_connect_element AX_surfxml_trace_c_connect_element;
136 #define A_surfxml_trace_c_connect_element (surfxml_bufferstack + AX_surfxml_trace_c_connect_element)
137 AT_surfxml_argument_value AX_surfxml_argument_value;
138 #define A_surfxml_argument_value (surfxml_bufferstack + AX_surfxml_argument_value)
139 AT_surfxml_link_state AX_surfxml_link_state;
140 #define A_surfxml_link_state AX_surfxml_link_state
141 AT_surfxml_route_impact_on_src AX_surfxml_route_impact_on_src;
142 #define A_surfxml_route_impact_on_src (surfxml_bufferstack + AX_surfxml_route_impact_on_src)
143 AT_surfxml_link_bandwidth AX_surfxml_link_bandwidth;
144 #define A_surfxml_link_bandwidth (surfxml_bufferstack + AX_surfxml_link_bandwidth)
145 AT_surfxml_cluster_id AX_surfxml_cluster_id;
146 #define A_surfxml_cluster_id (surfxml_bufferstack + AX_surfxml_cluster_id)
147 AT_surfxml_random_mean AX_surfxml_random_mean;
148 #define A_surfxml_random_mean (surfxml_bufferstack + AX_surfxml_random_mean)
149 AT_surfxml_cluster_bb_lat AX_surfxml_cluster_bb_lat;
150 #define A_surfxml_cluster_bb_lat (surfxml_bufferstack + AX_surfxml_cluster_bb_lat)
151 AT_surfxml_link_latency AX_surfxml_link_latency;
152 #define A_surfxml_link_latency (surfxml_bufferstack + AX_surfxml_link_latency)
153 AT_surfxml_platform_xmlns_c_link AX_surfxml_platform_xmlns_c_link;
154 #define A_surfxml_platform_xmlns_c_link (surfxml_bufferstack + AX_surfxml_platform_xmlns_c_link)
155 AT_surfxml_link_bandwidth_file AX_surfxml_link_bandwidth_file;
156 #define A_surfxml_link_bandwidth_file (surfxml_bufferstack + AX_surfxml_link_bandwidth_file)
157 AT_surfxml_random_id AX_surfxml_random_id;
158 #define A_surfxml_random_id (surfxml_bufferstack + AX_surfxml_random_id)
159 AT_surfxml_set_radical AX_surfxml_set_radical;
160 #define A_surfxml_set_radical (surfxml_bufferstack + AX_surfxml_set_radical)
161 AT_surfxml_random_max AX_surfxml_random_max;
162 #define A_surfxml_random_max (surfxml_bufferstack + AX_surfxml_random_max)
163 AT_surfxml_link_id AX_surfxml_link_id;
164 #define A_surfxml_link_id (surfxml_bufferstack + AX_surfxml_link_id)
165 AT_surfxml_process_host AX_surfxml_process_host;
166 #define A_surfxml_process_host (surfxml_bufferstack + AX_surfxml_process_host)
167 AT_surfxml_host_availability_file AX_surfxml_host_availability_file;
168 #define A_surfxml_host_availability_file (surfxml_bufferstack + AX_surfxml_host_availability_file)
169 AT_surfxml_cluster_lat AX_surfxml_cluster_lat;
170 #define A_surfxml_cluster_lat (surfxml_bufferstack + AX_surfxml_cluster_lat)
171 AT_surfxml_trace_periodicity AX_surfxml_trace_periodicity;
172 #define A_surfxml_trace_periodicity (surfxml_bufferstack + AX_surfxml_trace_periodicity)
173 AT_surfxml_foreach_set_id AX_surfxml_foreach_set_id;
174 #define A_surfxml_foreach_set_id (surfxml_bufferstack + AX_surfxml_foreach_set_id)
175 AT_surfxml_route_impact_on_dst_with_other_send AX_surfxml_route_impact_on_dst_with_other_send;
176 #define A_surfxml_route_impact_on_dst_with_other_send (surfxml_bufferstack + AX_surfxml_route_impact_on_dst_with_other_send)
177 AT_surfxml_prop_value AX_surfxml_prop_value;
178 #define A_surfxml_prop_value (surfxml_bufferstack + AX_surfxml_prop_value)
179 AT_surfxml_route_impact_on_src_with_other_recv AX_surfxml_route_impact_on_src_with_other_recv;
180 #define A_surfxml_route_impact_on_src_with_other_recv (surfxml_bufferstack + AX_surfxml_route_impact_on_src_with_other_recv)
181 AT_surfxml_link_state_file AX_surfxml_link_state_file;
182 #define A_surfxml_link_state_file (surfxml_bufferstack + AX_surfxml_link_state_file)
183 AT_surfxml_set_prefix AX_surfxml_set_prefix;
184 #define A_surfxml_set_prefix (surfxml_bufferstack + AX_surfxml_set_prefix)
185 AT_surfxml_cluster_power AX_surfxml_cluster_power;
186 #define A_surfxml_cluster_power (surfxml_bufferstack + AX_surfxml_cluster_power)
187 AT_surfxml_process_function AX_surfxml_process_function;
188 #define A_surfxml_process_function (surfxml_bufferstack + AX_surfxml_process_function)
189 AT_surfxml_host_max_outgoing_rate AX_surfxml_host_max_outgoing_rate;
190 #define A_surfxml_host_max_outgoing_rate (surfxml_bufferstack + AX_surfxml_host_max_outgoing_rate)
191 AT_surfxml_link_c_ctn_id AX_surfxml_link_c_ctn_id;
192 #define A_surfxml_link_c_ctn_id (surfxml_bufferstack + AX_surfxml_link_c_ctn_id)
193 AT_surfxml_host_availability AX_surfxml_host_availability;
194 #define A_surfxml_host_availability (surfxml_bufferstack + AX_surfxml_host_availability)
195 AT_surfxml_route_src AX_surfxml_route_src;
196 #define A_surfxml_route_src (surfxml_bufferstack + AX_surfxml_route_src)
197 AT_surfxml_route_c_multi_src AX_surfxml_route_c_multi_src;
198 #define A_surfxml_route_c_multi_src (surfxml_bufferstack + AX_surfxml_route_c_multi_src)
199 AT_surfxml_route_c_multi_action AX_surfxml_route_c_multi_action;
200 #define A_surfxml_route_c_multi_action AX_surfxml_route_c_multi_action
201 AT_surfxml_trace_c_connect_trace AX_surfxml_trace_c_connect_trace;
202 #define A_surfxml_trace_c_connect_trace (surfxml_bufferstack + AX_surfxml_trace_c_connect_trace)
203 AT_surfxml_trace_id AX_surfxml_trace_id;
204 #define A_surfxml_trace_id (surfxml_bufferstack + AX_surfxml_trace_id)
205 AT_surfxml_cluster_radical AX_surfxml_cluster_radical;
206 #define A_surfxml_cluster_radical (surfxml_bufferstack + AX_surfxml_cluster_radical)
207 AT_surfxml_include_file AX_surfxml_include_file;
208 #define A_surfxml_include_file (surfxml_bufferstack + AX_surfxml_include_file)
209 AT_surfxml_random_std_deviation AX_surfxml_random_std_deviation;
210 #define A_surfxml_random_std_deviation (surfxml_bufferstack + AX_surfxml_random_std_deviation)
211 AT_surfxml_trace_c_connect_kind AX_surfxml_trace_c_connect_kind;
212 #define A_surfxml_trace_c_connect_kind AX_surfxml_trace_c_connect_kind
213 AT_surfxml_route_c_multi_dst AX_surfxml_route_c_multi_dst;
214 #define A_surfxml_route_c_multi_dst (surfxml_bufferstack + AX_surfxml_route_c_multi_dst)
215 AT_surfxml_host_state_file AX_surfxml_host_state_file;
216 #define A_surfxml_host_state_file (surfxml_bufferstack + AX_surfxml_host_state_file)
217 AT_surfxml_route_c_multi_symmetric AX_surfxml_route_c_multi_symmetric;
218 #define A_surfxml_route_c_multi_symmetric AX_surfxml_route_c_multi_symmetric
219 AT_surfxml_route_dst AX_surfxml_route_dst;
220 #define A_surfxml_route_dst (surfxml_bufferstack + AX_surfxml_route_dst)
221 AT_surfxml_cluster_bw AX_surfxml_cluster_bw;
222 #define A_surfxml_cluster_bw (surfxml_bufferstack + AX_surfxml_cluster_bw)
223 AT_surfxml_platform_version AX_surfxml_platform_version;
224 #define A_surfxml_platform_version (surfxml_bufferstack + AX_surfxml_platform_version)
225
226 /* XML state. */
227 #ifdef FLEX_DEBUG
228 # define ENTER(state)   debug_enter(state,#state)
229 # define LEAVE          debug_leave()
230 # define SET(state)     debug_set(state,#state)
231   static void debug_enter(int, const char*);
232   static void debug_leave(void);
233   static void debug_set(int, const char*);
234 #else
235 # define ENTER(state)   (yy_push_state(state))
236 # define LEAVE          (yy_pop_state())
237 # define SET(state)     BEGIN(state)
238 #endif
239
240 /* Generic actions. */
241 #define SKIP    /*skip*/
242 #define SUCCEED        CLEANUP; return 0
243
244 #define FAIL    return fail
245 static int fail(const char*, ...);
246
247 enum {flexml_max_err_msg_size = 512};
248 static char flexml_err_msg[flexml_max_err_msg_size];
249 const char * surfxml_parse_err_msg()
250 {
251     return flexml_err_msg;
252 }
253 static void reset_surfxml_parse_err_msg()
254 {
255     flexml_err_msg[0] = '\0';
256 }
257
258 /* Cleanup */
259 static void cleanup(void);
260 #define CLEANUP  cleanup()
261
262 /* Text buffer stack handling. */
263 char *surfxml_bufferstack = NULL;
264 static int blimit = FLEXML_BUFFERSTACKSIZE;
265 static int bnext = 1;
266
267 static int *indexstack = NULL;
268 static int ilimit = FLEXML_INDEXSTACKSIZE;
269 static int inext = 1;
270
271 #define BUFFERSET(P)  (P = bnext)
272 #define BUFFERPUTC(C) (ck_blimit(), surfxml_bufferstack[bnext++] = (C))
273 #define BUFFERDONE    (BUFFERPUTC('\0'))
274
275 #define BUFFERLITERAL(C, P) surfxml_bufferliteral(C, &(P), yytext)
276
277 /* after this is called, there are at least 2 slots left in the stack */
278 static int ck_blimit()
279 {
280      if (bnext >= blimit) {
281          blimit += FLEXML_BUFFERSTACKSIZE + 2;
282          {
283              char *temp = (char *) realloc(surfxml_bufferstack, blimit);
284              assert(temp);
285              surfxml_bufferstack = temp;
286          }
287      }
288      return 0;
289 }
290
291 /* after this is called, there are at least 2 slots left in the stack */
292 static int ck_ilimit()
293 {
294      if (inext >= ilimit) {
295          ilimit += FLEXML_INDEXSTACKSIZE + 2;
296          {
297              int *temp = (int *) realloc(indexstack, ilimit);
298              assert(temp);
299              indexstack = temp;
300          }
301      }
302      return 0;
303 }
304
305 #ifdef FLEXML_NEED_BUFFERLIT
306 static void surfxml_bufferliteral(char c, int* pp, const char* text)
307 {
308   const char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c);
309   assert(s <= e); BUFFERSET(*pp);
310   while (++s<e) {
311     if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
312     else BUFFERPUTC(*s);
313   }
314   BUFFERDONE;
315 }
316 #endif
317
318 static void pushbuffer(int p)
319 {
320     ck_ilimit();
321     indexstack[inext++] = p;
322     indexstack[inext++] = bnext;    
323 }
324
325 static int popbuffer(void)
326 {
327     assert(inext >= 2);
328     bnext = indexstack[--inext];
329     return indexstack[--inext];
330 }
331
332 /* General internal entities are `unput' back onto the input stream... */
333 #define ENTITYTEXT(T) \
334   { char *s = (T), *e = s+strlen(s);\
335     while (--e >= s) { unput(*e); }}
336
337
338 %}
339
340 /* Flex standard options. */
341 %option stack
342 %option noyy_top_state
343 %option noinput
344 %option noreject
345 %option noyymore
346 %option noyywrap
347
348 /* Flex user-requested options. */
349 %option yylineno
350 %option nounput
351
352 /* XML character classes (currently restricted to ASCII). */
353
354 /* "Common syntactic structures." */
355 S               [ \t\n\r\f]+
356 s               [ \t\n\r\f]*
357
358 /* "Names and Tokens." */
359 NameChar        [A-Za-z0-9.:_-]
360 Name            [A-Za-z_:]{NameChar}*
361 Names           {Name}({S}{Name})*
362 Nmtoken         ({NameChar})+
363 Nmtokens        {Nmtoken}({S}{Nmtoken})*
364
365 /* Miscellaneous. */
366 VersionNum      [a-zA-Z0-9_.:-]+
367 Eq              {s}"="{s}
368 Literal         \'[^'']*\'|\"[^""]*\"
369
370 /* Parser states (flex `exclusive start conditions'):
371  *
372  * PROLOG       the XML prolog of the document before <?xml...>
373  * DOCTYPE      the XML prolog of the document after <?xml...>
374  * EPILOG       after the root element
375  * INCOMMENT    inside an XML comment <!--....-->
376  * INPI         inside an XML PI <?...?>
377  * VALUE1       inside a '...'-delimited literal
378  * VALUE2       inside a "..."-delimited literal
379  * CDATA        inside a <![CDATA[...] ]> section.
380  * ROOT_<tag>   expect root element <tag>
381  * AL_<tag>     inside the attribute list for <tag>
382  * IN_<tag>     inside a <tag> with element contents (ready for end tag)
383  * IMPOSSIBLE   dummy to permit disabling rules; must be last
384  */
385 %x PROLOG DOCTYPE EPILOG INCOMMENT INPI VALUE1 VALUE2 CDATA
386 %x ROOT_surfxml_platform AL_surfxml_platform S_surfxml_platform S_surfxml_platform_1 S_surfxml_platform_2 S_surfxml_platform_3 S_surfxml_platform_4 S_surfxml_platform_5 E_surfxml_platform
387 %x AL_surfxml_include E_surfxml_include
388 %x AL_surfxml_trace IN_trace
389 %x AL_surfxml_random S_surfxml_random S_surfxml_random_1 S_surfxml_random_2 E_surfxml_random
390 %x AL_surfxml_trace_c_connect E_surfxml_trace_c_connect
391 %x AL_surfxml_set E_surfxml_set
392 %x AL_surfxml_foreach S_surfxml_foreach S_surfxml_foreach_1 E_surfxml_foreach
393 %x AL_surfxml_host S_surfxml_host S_surfxml_host_1 S_surfxml_host_2 E_surfxml_host
394 %x AL_surfxml_prop E_surfxml_prop
395 %x AL_surfxml_cluster E_surfxml_cluster
396 %x AL_surfxml_router E_surfxml_router
397 %x AL_surfxml_link S_surfxml_link S_surfxml_link_1 S_surfxml_link_2 E_surfxml_link
398 %x AL_surfxml_route_c_multi S_surfxml_route_c_multi S_surfxml_route_c_multi_1 S_surfxml_route_c_multi_2 E_surfxml_route_c_multi
399 %x AL_surfxml_route S_surfxml_route S_surfxml_route_1 S_surfxml_route_2 E_surfxml_route
400 %x AL_surfxml_link_c_ctn E_surfxml_link_c_ctn
401 %x AL_surfxml_process S_surfxml_process S_surfxml_process_1 S_surfxml_process_2 E_surfxml_process
402 %x AL_surfxml_argument E_surfxml_argument
403 %x IMPOSSIBLE
404
405 %{
406 /* State names. */
407 const char* *surfxml_statenames=NULL;
408 %}
409
410 %%
411
412  /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
413  SET(PROLOG);
414  reset_surfxml_parse_err_msg();
415  surfxml_bufferstack = (char *) malloc(FLEXML_BUFFERSTACKSIZE);
416  assert(surfxml_bufferstack);
417  #ifdef FLEX_DEBUG
418  {
419      int i;
420      for (i = 0; i < blimit; i++) {
421          surfxml_bufferstack[i] = '\377';
422      }
423  }
424  #endif
425  surfxml_bufferstack[0] = '\0';
426  indexstack = (int *) malloc(FLEXML_INDEXSTACKSIZE * sizeof(int));
427  assert(indexstack);
428  indexstack[0] = 0;
429
430   /* FleXML_init */
431   bnext = inext = 1;
432   surfxml_bufferliteral('\0', &bnext, "0.0");
433   surfxml_bufferliteral('\0', &bnext, "http://simgrid.gforge.inria.fr/");
434   surfxml_bufferliteral('\0', &bnext, "http://simgrid.gforge.inria.fr/");
435   surfxml_bufferliteral('\0', &bnext, "1.0");
436   surfxml_bufferliteral('\0', &bnext, "1.0");
437   surfxml_bufferliteral('\0', &bnext, "1.0");
438   surfxml_bufferliteral('\0', &bnext, "1.0");
439   surfxml_bufferliteral('\0', &bnext, "-1.0");
440   surfxml_bufferliteral('\0', &bnext, "0.0");
441   surfxml_bufferliteral('\0', &bnext, "0.0");
442   surfxml_bufferliteral('\0', &bnext, "0.0");
443   surfxml_bufferliteral('\0', &bnext, "0.0");
444   surfxml_bufferliteral('\0', &bnext, "0.0");
445   surfxml_bufferliteral('\0', &bnext, "-1.0");
446   surfxml_bufferliteral('\0', &bnext, "-1.0");
447   if(!surfxml_statenames) {surfxml_statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*));
448   surfxml_statenames[PROLOG] = NULL;
449   surfxml_statenames[DOCTYPE] = NULL;
450   surfxml_statenames[EPILOG] = NULL;
451   surfxml_statenames[INCOMMENT] = NULL;
452   surfxml_statenames[INPI] = NULL;
453   surfxml_statenames[VALUE1] = NULL;
454   surfxml_statenames[VALUE2] = NULL;
455   surfxml_statenames[CDATA] = NULL;
456   surfxml_statenames[ROOT_surfxml_platform] = NULL;
457   surfxml_statenames[AL_surfxml_platform] = NULL;
458   surfxml_statenames[S_surfxml_platform] = "platform";
459   surfxml_statenames[S_surfxml_platform_1] = "platform";
460   surfxml_statenames[S_surfxml_platform_2] = "platform";
461   surfxml_statenames[S_surfxml_platform_3] = "platform";
462   surfxml_statenames[S_surfxml_platform_4] = "platform";
463   surfxml_statenames[S_surfxml_platform_5] = "platform";
464   surfxml_statenames[E_surfxml_platform] = "platform";
465   surfxml_statenames[AL_surfxml_include] = NULL;
466   surfxml_statenames[E_surfxml_include] = "include";
467   surfxml_statenames[AL_surfxml_trace] = NULL;
468   surfxml_statenames[IN_trace] = "trace";
469   surfxml_statenames[AL_surfxml_random] = NULL;
470   surfxml_statenames[S_surfxml_random] = "random";
471   surfxml_statenames[S_surfxml_random_1] = "random";
472   surfxml_statenames[S_surfxml_random_2] = "random";
473   surfxml_statenames[E_surfxml_random] = "random";
474   surfxml_statenames[AL_surfxml_trace_c_connect] = NULL;
475   surfxml_statenames[E_surfxml_trace_c_connect] = "trace:connect";
476   surfxml_statenames[AL_surfxml_set] = NULL;
477   surfxml_statenames[E_surfxml_set] = "set";
478   surfxml_statenames[AL_surfxml_foreach] = NULL;
479   surfxml_statenames[S_surfxml_foreach] = "foreach";
480   surfxml_statenames[S_surfxml_foreach_1] = "foreach";
481   surfxml_statenames[E_surfxml_foreach] = "foreach";
482   surfxml_statenames[AL_surfxml_host] = NULL;
483   surfxml_statenames[S_surfxml_host] = "host";
484   surfxml_statenames[S_surfxml_host_1] = "host";
485   surfxml_statenames[S_surfxml_host_2] = "host";
486   surfxml_statenames[E_surfxml_host] = "host";
487   surfxml_statenames[AL_surfxml_prop] = NULL;
488   surfxml_statenames[E_surfxml_prop] = "prop";
489   surfxml_statenames[AL_surfxml_cluster] = NULL;
490   surfxml_statenames[E_surfxml_cluster] = "cluster";
491   surfxml_statenames[AL_surfxml_router] = NULL;
492   surfxml_statenames[E_surfxml_router] = "router";
493   surfxml_statenames[AL_surfxml_link] = NULL;
494   surfxml_statenames[S_surfxml_link] = "link";
495   surfxml_statenames[S_surfxml_link_1] = "link";
496   surfxml_statenames[S_surfxml_link_2] = "link";
497   surfxml_statenames[E_surfxml_link] = "link";
498   surfxml_statenames[AL_surfxml_route_c_multi] = NULL;
499   surfxml_statenames[S_surfxml_route_c_multi] = "route:multi";
500   surfxml_statenames[S_surfxml_route_c_multi_1] = "route:multi";
501   surfxml_statenames[S_surfxml_route_c_multi_2] = "route:multi";
502   surfxml_statenames[E_surfxml_route_c_multi] = "route:multi";
503   surfxml_statenames[AL_surfxml_route] = NULL;
504   surfxml_statenames[S_surfxml_route] = "route";
505   surfxml_statenames[S_surfxml_route_1] = "route";
506   surfxml_statenames[S_surfxml_route_2] = "route";
507   surfxml_statenames[E_surfxml_route] = "route";
508   surfxml_statenames[AL_surfxml_link_c_ctn] = NULL;
509   surfxml_statenames[E_surfxml_link_c_ctn] = "link:ctn";
510   surfxml_statenames[AL_surfxml_process] = NULL;
511   surfxml_statenames[S_surfxml_process] = "process";
512   surfxml_statenames[S_surfxml_process_1] = "process";
513   surfxml_statenames[S_surfxml_process_2] = "process";
514   surfxml_statenames[E_surfxml_process] = "process";
515   surfxml_statenames[AL_surfxml_argument] = NULL;
516   surfxml_statenames[E_surfxml_argument] = "argument";
517   }
518
519  /* COMMENTS and PIs: handled uniformly for efficiency. */
520
521 <ROOT_surfxml_platform,AL_surfxml_platform,S_surfxml_platform,S_surfxml_platform_1,S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform_4,S_surfxml_platform_5,E_surfxml_platform,AL_surfxml_include,E_surfxml_include,AL_surfxml_trace,IN_trace,AL_surfxml_random,S_surfxml_random,S_surfxml_random_1,S_surfxml_random_2,E_surfxml_random,AL_surfxml_trace_c_connect,E_surfxml_trace_c_connect,AL_surfxml_set,E_surfxml_set,AL_surfxml_foreach,S_surfxml_foreach,S_surfxml_foreach_1,E_surfxml_foreach,AL_surfxml_host,S_surfxml_host,S_surfxml_host_1,S_surfxml_host_2,E_surfxml_host,AL_surfxml_prop,E_surfxml_prop,AL_surfxml_cluster,E_surfxml_cluster,AL_surfxml_router,E_surfxml_router,AL_surfxml_link,S_surfxml_link,S_surfxml_link_1,S_surfxml_link_2,E_surfxml_link,AL_surfxml_route_c_multi,S_surfxml_route_c_multi,S_surfxml_route_c_multi_1,S_surfxml_route_c_multi_2,E_surfxml_route_c_multi,AL_surfxml_route,S_surfxml_route,S_surfxml_route_1,S_surfxml_route_2,E_surfxml_route,AL_surfxml_link_c_ctn,E_surfxml_link_c_ctn,AL_surfxml_process,S_surfxml_process,S_surfxml_process_1,S_surfxml_process_2,E_surfxml_process,AL_surfxml_argument,E_surfxml_argument,PROLOG,DOCTYPE,EPILOG>{
522  "<!--" ENTER(INCOMMENT);
523  "<?" ENTER(INPI);
524 }
525 <INCOMMENT>{
526  "-->"          LEAVE;
527  "--"           |
528  .              |
529  \n             SKIP;
530  <<EOF>>        FAIL("EOF in comment.");
531 }
532 <INPI>{
533  "?>"           LEAVE;
534  .              |
535  \n             SKIP;
536  <<EOF>>        FAIL("EOF in PI (processing instruction).");
537 }
538
539  /* SPACES: skipped uniformly */
540
541 <ROOT_surfxml_platform,AL_surfxml_platform,S_surfxml_platform,S_surfxml_platform_1,S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform_4,S_surfxml_platform_5,E_surfxml_platform,AL_surfxml_include,E_surfxml_include,AL_surfxml_trace,AL_surfxml_random,S_surfxml_random,S_surfxml_random_1,S_surfxml_random_2,E_surfxml_random,AL_surfxml_trace_c_connect,E_surfxml_trace_c_connect,AL_surfxml_set,E_surfxml_set,AL_surfxml_foreach,S_surfxml_foreach,S_surfxml_foreach_1,E_surfxml_foreach,AL_surfxml_host,S_surfxml_host,S_surfxml_host_1,S_surfxml_host_2,E_surfxml_host,AL_surfxml_prop,E_surfxml_prop,AL_surfxml_cluster,E_surfxml_cluster,AL_surfxml_router,E_surfxml_router,AL_surfxml_link,S_surfxml_link,S_surfxml_link_1,S_surfxml_link_2,E_surfxml_link,AL_surfxml_route_c_multi,S_surfxml_route_c_multi,S_surfxml_route_c_multi_1,S_surfxml_route_c_multi_2,E_surfxml_route_c_multi,AL_surfxml_route,S_surfxml_route,S_surfxml_route_1,S_surfxml_route_2,E_surfxml_route,AL_surfxml_link_c_ctn,E_surfxml_link_c_ctn,AL_surfxml_process,S_surfxml_process,S_surfxml_process_1,S_surfxml_process_2,E_surfxml_process,AL_surfxml_argument,E_surfxml_argument,PROLOG,DOCTYPE,EPILOG>{S} SKIP;
542
543  /* PROLOG: determine root element and process it. */
544
545 <PROLOG>{
546  "<?xml"({S}version{Eq}(\'{VersionNum}\'|\"{VersionNum}\"))?({S}encoding{Eq}(\'[^']*\'|\"[^"]*\"))?"?>" SET(DOCTYPE); 
547  "<?xml"[^>]*">" FAIL("Bad declaration %s.",yytext);
548 }
549
550 <PROLOG,DOCTYPE>{
551  "<!DOCTYPE"{S}"platform"{S}SYSTEM{S}("'simgrid.dtd'"|"\"simgrid.dtd\""){s}">" SET(ROOT_surfxml_platform);
552  "<!"[^>-][^>]*">" FAIL("Bad declaration %s.",yytext);
553  .              FAIL("Unexpected character `%c' in prolog.", yytext[0]);
554  <<EOF>>        FAIL("EOF in prolog.");
555 }
556
557  /* RULES DERIVED FROM DTD. */
558
559  /* <!-- Small DTD for SURF based tools. -->  */
560
561 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_random,E_surfxml_route_c_multi,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_platform_3,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,S_surfxml_link,E_surfxml_host,S_surfxml_host,S_surfxml_platform_2,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_foreach_1,S_surfxml_process_2,S_surfxml_route>"<platform"{s} FAIL("Starting tag <platform> is not allowed here.");
562
563 <ROOT_surfxml_platform>"<platform"{s} {
564   AX_surfxml_platform_version = 1;
565   AX_surfxml_platform_xmlns_c_link = 5;
566   AX_surfxml_platform_xmlns_c_route = 37;
567   ENTER(AL_surfxml_platform); pushbuffer(0);
568   }
569
570 <AL_surfxml_platform>{
571  "version"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_version);
572  "version"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_version);
573
574  "xmlns:link"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_xmlns_c_link);
575  "xmlns:link"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_xmlns_c_link);
576
577  "xmlns:route"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_xmlns_c_route);
578  "xmlns:route"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_xmlns_c_route);
579
580  ">" {
581   LEAVE; STag_surfxml_platform();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform);
582  }
583  "/>" {
584   LEAVE; STag_surfxml_platform(); surfxml_pcdata_ix = 0; ETag_surfxml_platform(); popbuffer(); /* attribute */
585   switch (YY_START) {
586    case ROOT_surfxml_platform: SET(EPILOG); break;
587   }
588  }
589  .       FAIL("Unexpected character `%c' in attribute list of platform element.", yytext[0]);
590  {Name} FAIL("Bad attribute `%s' in `platform' element start tag.",yytext);
591  <<EOF>> FAIL("EOF in attribute list of `platform' element.");
592 }
593
594 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform_3,S_surfxml_platform,E_surfxml_platform>{
595  "</platform"{s}">" {
596   LEAVE;
597   ETag_surfxml_platform();
598   popbuffer(); /* attribute */
599   switch (YY_START) {
600    case ROOT_surfxml_platform: SET(EPILOG); break;
601   }
602  }
603  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</platform>' expected.",yytext);
604  .       FAIL("Unexpected character `%c': `</platform>' expected.",yytext[0]);
605  <<EOF>> FAIL("Premature EOF: `</platform>' expected.");
606 }
607
608 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_foreach_1,S_surfxml_route>"<include"{s} FAIL("Starting tag <include> is not allowed here.");
609
610 <S_surfxml_platform_5,S_surfxml_platform_2,S_surfxml_platform_1,S_surfxml_platform_3,S_surfxml_platform,S_surfxml_platform_4>"<include"{s} {
611   AX_surfxml_include_file = 0;
612   ENTER(AL_surfxml_include); pushbuffer(0);
613   }
614
615 <AL_surfxml_include>{
616  "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_include_file);
617  "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_include_file);
618
619  ">" {
620   if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
621   LEAVE; STag_surfxml_include();surfxml_pcdata_ix = 0; ENTER(E_surfxml_include);
622  }
623  "/>" {
624   if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
625   LEAVE; STag_surfxml_include(); surfxml_pcdata_ix = 0; ETag_surfxml_include(); popbuffer(); /* attribute */
626   switch (YY_START) {
627    case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
628    case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
629   }
630  }
631  .       FAIL("Unexpected character `%c' in attribute list of include element.", yytext[0]);
632  {Name} FAIL("Bad attribute `%s' in `include' element start tag.",yytext);
633  <<EOF>> FAIL("EOF in attribute list of `include' element.");
634 }
635
636 <E_surfxml_include>{
637  "</include"{s}">" {
638   LEAVE;
639   ETag_surfxml_include();
640   popbuffer(); /* attribute */
641   switch (YY_START) {
642    case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
643    case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
644   }
645  }
646  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</include>' expected.",yytext);
647  .       FAIL("Unexpected character `%c': `</include>' expected.",yytext[0]);
648  <<EOF>> FAIL("Premature EOF: `</include>' expected.");
649 }
650
651 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_foreach_1,S_surfxml_route>"<trace"{s} FAIL("Starting tag <trace> is not allowed here.");
652
653 <S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<trace"{s} {
654   AX_surfxml_trace_id = 0;
655   AX_surfxml_trace_file = 0;
656   AX_surfxml_trace_periodicity = 0;
657   ENTER(AL_surfxml_trace); pushbuffer(0);
658   }
659
660 <AL_surfxml_trace>{
661  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_id);
662  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_id);
663
664  "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_file);
665  "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_file);
666
667  "periodicity"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_periodicity);
668  "periodicity"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_periodicity);
669
670  ">" {
671   if (!AX_surfxml_trace_id) FAIL("Required attribute `id' not set for `trace' element.");
672   if (!AX_surfxml_trace_periodicity) FAIL("Required attribute `periodicity' not set for `trace' element.");
673   LEAVE; STag_surfxml_trace();pushbuffer(surfxml_pcdata_ix); BUFFERSET(surfxml_pcdata_ix);; ENTER(IN_trace);
674  }
675  "/>" {
676   if (!AX_surfxml_trace_id) FAIL("Required attribute `id' not set for `trace' element.");
677   if (!AX_surfxml_trace_periodicity) FAIL("Required attribute `periodicity' not set for `trace' element.");
678   LEAVE; STag_surfxml_trace(); surfxml_pcdata_ix = 0; ETag_surfxml_trace(); popbuffer(); /* attribute */
679   switch (YY_START) {
680    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
681   }
682  }
683  .       FAIL("Unexpected character `%c' in attribute list of trace element.", yytext[0]);
684  {Name} FAIL("Bad attribute `%s' in `trace' element start tag.",yytext);
685  <<EOF>> FAIL("EOF in attribute list of `trace' element.");
686 }
687
688 <IN_trace>{
689  "</trace"{s}">" {
690   LEAVE;
691   BUFFERDONE;
692   ETag_surfxml_trace();
693   surfxml_pcdata_ix = popbuffer();
694   popbuffer(); /* attribute */
695   switch (YY_START) {
696    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
697   }
698  }
699  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</trace>' expected.",yytext);
700  <<EOF>> FAIL("Premature EOF: `</trace>' expected.");
701 }
702
703 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_foreach_1,S_surfxml_route>"<random"{s} FAIL("Starting tag <random> is not allowed here.");
704
705 <S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<random"{s} {
706   AX_surfxml_random_id = 0;
707   AX_surfxml_random_min = 0;
708   AX_surfxml_random_max = 0;
709   AX_surfxml_random_mean = 0;
710   AX_surfxml_random_std_deviation = 0;
711   AX_surfxml_random_generator = A_surfxml_random_generator_DRAND48;
712   ENTER(AL_surfxml_random); pushbuffer(0);
713   }
714
715 <AL_surfxml_random>{
716  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_id);
717  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_id);
718
719  "min"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_min);
720  "min"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_min);
721
722  "max"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_max);
723  "max"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_max);
724
725  "mean"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_mean);
726  "mean"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_mean);
727
728  "std_deviation"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_std_deviation);
729  "std_deviation"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_std_deviation);
730
731  "generator"{Eq}"'DRAND48'" |
732  "generator"{Eq}"\"DRAND48\"" A_surfxml_random_generator = A_surfxml_random_generator_DRAND48;
733  "generator"{Eq}"'RAND'" |
734  "generator"{Eq}"\"RAND\"" A_surfxml_random_generator = A_surfxml_random_generator_RAND;
735
736  ">" {
737   if (!AX_surfxml_random_id) FAIL("Required attribute `id' not set for `random' element.");
738   if (!AX_surfxml_random_min) FAIL("Required attribute `min' not set for `random' element.");
739   if (!AX_surfxml_random_max) FAIL("Required attribute `max' not set for `random' element.");
740   if (!AX_surfxml_random_mean) FAIL("Required attribute `mean' not set for `random' element.");
741   if (!AX_surfxml_random_std_deviation) FAIL("Required attribute `std_deviation' not set for `random' element.");
742   LEAVE; STag_surfxml_random();surfxml_pcdata_ix = 0; ENTER(S_surfxml_random);
743  }
744  "/>" {
745   if (!AX_surfxml_random_id) FAIL("Required attribute `id' not set for `random' element.");
746   if (!AX_surfxml_random_min) FAIL("Required attribute `min' not set for `random' element.");
747   if (!AX_surfxml_random_max) FAIL("Required attribute `max' not set for `random' element.");
748   if (!AX_surfxml_random_mean) FAIL("Required attribute `mean' not set for `random' element.");
749   if (!AX_surfxml_random_std_deviation) FAIL("Required attribute `std_deviation' not set for `random' element.");
750   LEAVE; STag_surfxml_random(); surfxml_pcdata_ix = 0; ETag_surfxml_random(); popbuffer(); /* attribute */
751   switch (YY_START) {
752    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
753   }
754  }
755  .       FAIL("Unexpected character `%c' in attribute list of random element.", yytext[0]);
756  {Name} FAIL("Bad attribute `%s' in `random' element start tag.",yytext);
757  <<EOF>> FAIL("EOF in attribute list of `random' element.");
758 }
759
760 <S_surfxml_random_2,S_surfxml_random,E_surfxml_random>{
761  "</random"{s}">" {
762   LEAVE;
763   ETag_surfxml_random();
764   popbuffer(); /* attribute */
765   switch (YY_START) {
766    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
767   }
768  }
769  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</random>' expected.",yytext);
770  .       FAIL("Unexpected character `%c': `</random>' expected.",yytext[0]);
771  <<EOF>> FAIL("Premature EOF: `</random>' expected.");
772 }
773
774 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_foreach_1,S_surfxml_route>"<trace:connect"{s} FAIL("Starting tag <trace:connect> is not allowed here.");
775
776 <S_surfxml_platform_5,S_surfxml_platform_2,S_surfxml_platform_1,S_surfxml_platform_3,S_surfxml_platform,S_surfxml_platform_4>"<trace:connect"{s} {
777   AX_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_HOST_AVAIL;
778   AX_surfxml_trace_c_connect_trace = 0;
779   AX_surfxml_trace_c_connect_element = 0;
780   ENTER(AL_surfxml_trace_c_connect); pushbuffer(0);
781   }
782
783 <AL_surfxml_trace_c_connect>{
784  "kind"{Eq}"'HOST_AVAIL'" |
785  "kind"{Eq}"\"HOST_AVAIL\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_HOST_AVAIL;
786  "kind"{Eq}"'POWER'" |
787  "kind"{Eq}"\"POWER\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_POWER;
788  "kind"{Eq}"'LINK_AVAIL'" |
789  "kind"{Eq}"\"LINK_AVAIL\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_LINK_AVAIL;
790  "kind"{Eq}"'BANDWIDTH'" |
791  "kind"{Eq}"\"BANDWIDTH\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_BANDWIDTH;
792  "kind"{Eq}"'LATENCY'" |
793  "kind"{Eq}"\"LATENCY\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_LATENCY;
794
795  "trace"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_c_connect_trace);
796  "trace"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_c_connect_trace);
797
798  "element"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_c_connect_element);
799  "element"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_c_connect_element);
800
801  ">" {
802   if (!AX_surfxml_trace_c_connect_trace) FAIL("Required attribute `trace' not set for `trace:connect' element.");
803   if (!AX_surfxml_trace_c_connect_element) FAIL("Required attribute `element' not set for `trace:connect' element.");
804   LEAVE; STag_surfxml_trace_c_connect();surfxml_pcdata_ix = 0; ENTER(E_surfxml_trace_c_connect);
805  }
806  "/>" {
807   if (!AX_surfxml_trace_c_connect_trace) FAIL("Required attribute `trace' not set for `trace:connect' element.");
808   if (!AX_surfxml_trace_c_connect_element) FAIL("Required attribute `element' not set for `trace:connect' element.");
809   LEAVE; STag_surfxml_trace_c_connect(); surfxml_pcdata_ix = 0; ETag_surfxml_trace_c_connect(); popbuffer(); /* attribute */
810   switch (YY_START) {
811    case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
812    case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
813   }
814  }
815  .       FAIL("Unexpected character `%c' in attribute list of trace:connect element.", yytext[0]);
816  {Name} FAIL("Bad attribute `%s' in `trace:connect' element start tag.",yytext);
817  <<EOF>> FAIL("EOF in attribute list of `trace:connect' element.");
818 }
819
820 <E_surfxml_trace_c_connect>{
821  "</trace:connect"{s}">" {
822   LEAVE;
823   ETag_surfxml_trace_c_connect();
824   popbuffer(); /* attribute */
825   switch (YY_START) {
826    case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
827    case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
828   }
829  }
830  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</trace:connect>' expected.",yytext);
831  .       FAIL("Unexpected character `%c': `</trace:connect>' expected.",yytext[0]);
832  <<EOF>> FAIL("Premature EOF: `</trace:connect>' expected.");
833 }
834
835 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_foreach_1,S_surfxml_route>"<set"{s} FAIL("Starting tag <set> is not allowed here.");
836
837 <S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<set"{s} {
838   AX_surfxml_set_id = 0;
839   AX_surfxml_set_prefix = 0;
840   AX_surfxml_set_suffix = 0;
841   AX_surfxml_set_radical = 0;
842   ENTER(AL_surfxml_set); pushbuffer(0);
843   }
844
845 <AL_surfxml_set>{
846  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_set_id);
847  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_set_id);
848
849  "prefix"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_set_prefix);
850  "prefix"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_set_prefix);
851
852  "suffix"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_set_suffix);
853  "suffix"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_set_suffix);
854
855  "radical"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_set_radical);
856  "radical"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_set_radical);
857
858  ">" {
859   if (!AX_surfxml_set_id) FAIL("Required attribute `id' not set for `set' element.");
860   if (!AX_surfxml_set_prefix) FAIL("Required attribute `prefix' not set for `set' element.");
861   if (!AX_surfxml_set_suffix) FAIL("Required attribute `suffix' not set for `set' element.");
862   if (!AX_surfxml_set_radical) FAIL("Required attribute `radical' not set for `set' element.");
863   LEAVE; STag_surfxml_set();surfxml_pcdata_ix = 0; ENTER(E_surfxml_set);
864  }
865  "/>" {
866   if (!AX_surfxml_set_id) FAIL("Required attribute `id' not set for `set' element.");
867   if (!AX_surfxml_set_prefix) FAIL("Required attribute `prefix' not set for `set' element.");
868   if (!AX_surfxml_set_suffix) FAIL("Required attribute `suffix' not set for `set' element.");
869   if (!AX_surfxml_set_radical) FAIL("Required attribute `radical' not set for `set' element.");
870   LEAVE; STag_surfxml_set(); surfxml_pcdata_ix = 0; ETag_surfxml_set(); popbuffer(); /* attribute */
871   switch (YY_START) {
872    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
873   }
874  }
875  .       FAIL("Unexpected character `%c' in attribute list of set element.", yytext[0]);
876  {Name} FAIL("Bad attribute `%s' in `set' element start tag.",yytext);
877  <<EOF>> FAIL("EOF in attribute list of `set' element.");
878 }
879
880 <E_surfxml_set>{
881  "</set"{s}">" {
882   LEAVE;
883   ETag_surfxml_set();
884   popbuffer(); /* attribute */
885   switch (YY_START) {
886    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
887   }
888  }
889  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</set>' expected.",yytext);
890  .       FAIL("Unexpected character `%c': `</set>' expected.",yytext[0]);
891  <<EOF>> FAIL("Premature EOF: `</set>' expected.");
892 }
893
894 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_foreach_1,S_surfxml_route>"<foreach"{s} FAIL("Starting tag <foreach> is not allowed here.");
895
896 <S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<foreach"{s} {
897   AX_surfxml_foreach_set_id = 0;
898   ENTER(AL_surfxml_foreach); pushbuffer(0);
899   }
900
901 <AL_surfxml_foreach>{
902  "set_id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_foreach_set_id);
903  "set_id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_foreach_set_id);
904
905  ">" {
906   if (!AX_surfxml_foreach_set_id) FAIL("Required attribute `set_id' not set for `foreach' element.");
907   LEAVE; STag_surfxml_foreach();surfxml_pcdata_ix = 0; ENTER(S_surfxml_foreach);
908  }
909  "/>" FAIL("`foreach' element cannot be empty.");
910  .       FAIL("Unexpected character `%c' in attribute list of foreach element.", yytext[0]);
911  {Name} FAIL("Bad attribute `%s' in `foreach' element start tag.",yytext);
912  <<EOF>> FAIL("EOF in attribute list of `foreach' element.");
913 }
914
915 <E_surfxml_foreach>{
916  "</foreach"{s}">" {
917   LEAVE;
918   ETag_surfxml_foreach();
919   popbuffer(); /* attribute */
920   switch (YY_START) {
921    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
922   }
923  }
924  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</foreach>' expected.",yytext);
925  .       FAIL("Unexpected character `%c': `</foreach>' expected.",yytext[0]);
926  <<EOF>> FAIL("Premature EOF: `</foreach>' expected.");
927 }
928
929 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,E_surfxml_route,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_foreach_1,S_surfxml_route>"<host"{s} FAIL("Starting tag <host> is not allowed here.");
930
931 <S_surfxml_foreach,S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<host"{s} {
932   AX_surfxml_host_id = 0;
933   AX_surfxml_host_power = 0;
934   AX_surfxml_host_availability = 69;
935   AX_surfxml_host_availability_file = 0;
936   AX_surfxml_host_state = A_surfxml_host_state_ON;
937   AX_surfxml_host_state_file = 0;
938   AX_surfxml_host_interference_send = 73;
939   AX_surfxml_host_interference_recv = 77;
940   AX_surfxml_host_interference_send_recv = 81;
941   AX_surfxml_host_max_outgoing_rate = 85;
942   ENTER(AL_surfxml_host); pushbuffer(0);
943   }
944
945 <AL_surfxml_host>{
946  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_id);
947  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_id);
948
949  "power"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_power);
950  "power"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_power);
951
952  "availability"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability);
953  "availability"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability);
954
955  "availability_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability_file);
956  "availability_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability_file);
957
958  "state"{Eq}"'ON'" |
959  "state"{Eq}"\"ON\"" A_surfxml_host_state = A_surfxml_host_state_ON;
960  "state"{Eq}"'OFF'" |
961  "state"{Eq}"\"OFF\"" A_surfxml_host_state = A_surfxml_host_state_OFF;
962
963  "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_state_file);
964  "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_state_file);
965
966  "interference_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send);
967  "interference_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send);
968
969  "interference_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_recv);
970  "interference_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_recv);
971
972  "interference_send_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send_recv);
973  "interference_send_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send_recv);
974
975  "max_outgoing_rate"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_max_outgoing_rate);
976  "max_outgoing_rate"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_max_outgoing_rate);
977
978  ">" {
979   if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
980   if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element.");
981   LEAVE; STag_surfxml_host();surfxml_pcdata_ix = 0; ENTER(S_surfxml_host);
982  }
983  "/>" {
984   if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
985   if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element.");
986   LEAVE; STag_surfxml_host(); surfxml_pcdata_ix = 0; ETag_surfxml_host(); popbuffer(); /* attribute */
987   switch (YY_START) {
988    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
989    case S_surfxml_foreach: SET(S_surfxml_foreach_1); break;
990   }
991  }
992  .       FAIL("Unexpected character `%c' in attribute list of host element.", yytext[0]);
993  {Name} FAIL("Bad attribute `%s' in `host' element start tag.",yytext);
994  <<EOF>> FAIL("EOF in attribute list of `host' element.");
995 }
996
997 <S_surfxml_host,E_surfxml_host,S_surfxml_host_2>{
998  "</host"{s}">" {
999   LEAVE;
1000   ETag_surfxml_host();
1001   popbuffer(); /* attribute */
1002   switch (YY_START) {
1003    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
1004    case S_surfxml_foreach: SET(S_surfxml_foreach_1); break;
1005   }
1006  }
1007  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</host>' expected.",yytext);
1008  .       FAIL("Unexpected character `%c': `</host>' expected.",yytext[0]);
1009  <<EOF>> FAIL("Premature EOF: `</host>' expected.");
1010 }
1011
1012 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_platform,E_surfxml_process,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_platform_3,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_route_c_multi,E_surfxml_host,S_surfxml_platform_2,S_surfxml_route_c_multi_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_foreach_1,S_surfxml_route>"<prop"{s} FAIL("Starting tag <prop> is not allowed here.");
1013
1014 <S_surfxml_host,S_surfxml_link_1,S_surfxml_link_2,S_surfxml_random,S_surfxml_random_2,S_surfxml_link,S_surfxml_host_1,S_surfxml_random_1,S_surfxml_process_1,S_surfxml_process,S_surfxml_process_2,S_surfxml_host_2>"<prop"{s} {
1015   AX_surfxml_prop_id = 0;
1016   AX_surfxml_prop_value = 0;
1017   ENTER(AL_surfxml_prop); pushbuffer(0);
1018   }
1019
1020 <AL_surfxml_prop>{
1021  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_id);
1022  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_id);
1023
1024  "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_value);
1025  "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_value);
1026
1027  ">" {
1028   if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
1029   if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element.");
1030   LEAVE; STag_surfxml_prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_prop);
1031  }
1032  "/>" {
1033   if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
1034   if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element.");
1035   LEAVE; STag_surfxml_prop(); surfxml_pcdata_ix = 0; ETag_surfxml_prop(); popbuffer(); /* attribute */
1036   switch (YY_START) {
1037    case S_surfxml_random: case S_surfxml_random_2: case S_surfxml_random_1: SET(S_surfxml_random_2); break;
1038    case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1039    case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
1040    case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
1041   }
1042  }
1043  .       FAIL("Unexpected character `%c' in attribute list of prop element.", yytext[0]);
1044  {Name} FAIL("Bad attribute `%s' in `prop' element start tag.",yytext);
1045  <<EOF>> FAIL("EOF in attribute list of `prop' element.");
1046 }
1047
1048 <E_surfxml_prop>{
1049  "</prop"{s}">" {
1050   LEAVE;
1051   ETag_surfxml_prop();
1052   popbuffer(); /* attribute */
1053   switch (YY_START) {
1054    case S_surfxml_random: case S_surfxml_random_2: case S_surfxml_random_1: SET(S_surfxml_random_2); break;
1055    case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1056    case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
1057    case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
1058   }
1059  }
1060  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</prop>' expected.",yytext);
1061  .       FAIL("Unexpected character `%c': `</prop>' expected.",yytext[0]);
1062  <<EOF>> FAIL("Premature EOF: `</prop>' expected.");
1063 }
1064
1065 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_foreach_1,S_surfxml_route>"<cluster"{s} FAIL("Starting tag <cluster> is not allowed here.");
1066
1067 <S_surfxml_platform_2,S_surfxml_platform,S_surfxml_platform_3>"<cluster"{s} {
1068   AX_surfxml_cluster_id = 0;
1069   AX_surfxml_cluster_prefix = 0;
1070   AX_surfxml_cluster_suffix = 0;
1071   AX_surfxml_cluster_radical = 0;
1072   AX_surfxml_cluster_power = 0;
1073   AX_surfxml_cluster_bw = 0;
1074   AX_surfxml_cluster_lat = 0;
1075   AX_surfxml_cluster_bb_bw = 0;
1076   AX_surfxml_cluster_bb_lat = 0;
1077   ENTER(AL_surfxml_cluster); pushbuffer(0);
1078   }
1079
1080 <AL_surfxml_cluster>{
1081  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_id);
1082  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_id);
1083
1084  "prefix"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_prefix);
1085  "prefix"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_prefix);
1086
1087  "suffix"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_suffix);
1088  "suffix"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_suffix);
1089
1090  "radical"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_radical);
1091  "radical"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_radical);
1092
1093  "power"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_power);
1094  "power"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_power);
1095
1096  "bw"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bw);
1097  "bw"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bw);
1098
1099  "lat"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_lat);
1100  "lat"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_lat);
1101
1102  "bb_bw"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb_bw);
1103  "bb_bw"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb_bw);
1104
1105  "bb_lat"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb_lat);
1106  "bb_lat"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb_lat);
1107
1108  ">" {
1109   if (!AX_surfxml_cluster_id) FAIL("Required attribute `id' not set for `cluster' element.");
1110   if (!AX_surfxml_cluster_prefix) FAIL("Required attribute `prefix' not set for `cluster' element.");
1111   if (!AX_surfxml_cluster_suffix) FAIL("Required attribute `suffix' not set for `cluster' element.");
1112   if (!AX_surfxml_cluster_radical) FAIL("Required attribute `radical' not set for `cluster' element.");
1113   if (!AX_surfxml_cluster_power) FAIL("Required attribute `power' not set for `cluster' element.");
1114   if (!AX_surfxml_cluster_bw) FAIL("Required attribute `bw' not set for `cluster' element.");
1115   if (!AX_surfxml_cluster_lat) FAIL("Required attribute `lat' not set for `cluster' element.");
1116   if (!AX_surfxml_cluster_bb_bw) FAIL("Required attribute `bb_bw' not set for `cluster' element.");
1117   if (!AX_surfxml_cluster_bb_lat) FAIL("Required attribute `bb_lat' not set for `cluster' element.");
1118   LEAVE; STag_surfxml_cluster();surfxml_pcdata_ix = 0; ENTER(E_surfxml_cluster);
1119  }
1120  "/>" {
1121   if (!AX_surfxml_cluster_id) FAIL("Required attribute `id' not set for `cluster' element.");
1122   if (!AX_surfxml_cluster_prefix) FAIL("Required attribute `prefix' not set for `cluster' element.");
1123   if (!AX_surfxml_cluster_suffix) FAIL("Required attribute `suffix' not set for `cluster' element.");
1124   if (!AX_surfxml_cluster_radical) FAIL("Required attribute `radical' not set for `cluster' element.");
1125   if (!AX_surfxml_cluster_power) FAIL("Required attribute `power' not set for `cluster' element.");
1126   if (!AX_surfxml_cluster_bw) FAIL("Required attribute `bw' not set for `cluster' element.");
1127   if (!AX_surfxml_cluster_lat) FAIL("Required attribute `lat' not set for `cluster' element.");
1128   if (!AX_surfxml_cluster_bb_bw) FAIL("Required attribute `bb_bw' not set for `cluster' element.");
1129   if (!AX_surfxml_cluster_bb_lat) FAIL("Required attribute `bb_lat' not set for `cluster' element.");
1130   LEAVE; STag_surfxml_cluster(); surfxml_pcdata_ix = 0; ETag_surfxml_cluster(); popbuffer(); /* attribute */
1131   switch (YY_START) {
1132    case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1133   }
1134  }
1135  .       FAIL("Unexpected character `%c' in attribute list of cluster element.", yytext[0]);
1136  {Name} FAIL("Bad attribute `%s' in `cluster' element start tag.",yytext);
1137  <<EOF>> FAIL("EOF in attribute list of `cluster' element.");
1138 }
1139
1140 <E_surfxml_cluster>{
1141  "</cluster"{s}">" {
1142   LEAVE;
1143   ETag_surfxml_cluster();
1144   popbuffer(); /* attribute */
1145   switch (YY_START) {
1146    case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1147   }
1148  }
1149  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</cluster>' expected.",yytext);
1150  .       FAIL("Unexpected character `%c': `</cluster>' expected.",yytext[0]);
1151  <<EOF>> FAIL("Premature EOF: `</cluster>' expected.");
1152 }
1153
1154 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_foreach_1,S_surfxml_route>"<router"{s} FAIL("Starting tag <router> is not allowed here.");
1155
1156 <S_surfxml_platform_2,S_surfxml_platform,S_surfxml_platform_3>"<router"{s} {
1157   AX_surfxml_router_id = 0;
1158   ENTER(AL_surfxml_router); pushbuffer(0);
1159   }
1160
1161 <AL_surfxml_router>{
1162  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_router_id);
1163  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_router_id);
1164
1165  ">" {
1166   if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
1167   LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router);
1168  }
1169  "/>" {
1170   if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
1171   LEAVE; STag_surfxml_router(); surfxml_pcdata_ix = 0; ETag_surfxml_router(); popbuffer(); /* attribute */
1172   switch (YY_START) {
1173    case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1174   }
1175  }
1176  .       FAIL("Unexpected character `%c' in attribute list of router element.", yytext[0]);
1177  {Name} FAIL("Bad attribute `%s' in `router' element start tag.",yytext);
1178  <<EOF>> FAIL("EOF in attribute list of `router' element.");
1179 }
1180
1181 <E_surfxml_router>{
1182  "</router"{s}">" {
1183   LEAVE;
1184   ETag_surfxml_router();
1185   popbuffer(); /* attribute */
1186   switch (YY_START) {
1187    case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1188   }
1189  }
1190  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</router>' expected.",yytext);
1191  .       FAIL("Unexpected character `%c': `</router>' expected.",yytext[0]);
1192  <<EOF>> FAIL("Premature EOF: `</router>' expected.");
1193 }
1194
1195 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,E_surfxml_route,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_route>"<link"{s} FAIL("Starting tag <link> is not allowed here.");
1196
1197 <S_surfxml_foreach,S_surfxml_platform_2,S_surfxml_platform,S_surfxml_foreach_1,S_surfxml_platform_3>"<link"{s} {
1198   AX_surfxml_link_id = 0;
1199   AX_surfxml_link_bandwidth = 0;
1200   AX_surfxml_link_bandwidth_file = 0;
1201   AX_surfxml_link_latency = 90;
1202   AX_surfxml_link_latency_file = 0;
1203   AX_surfxml_link_state = A_surfxml_link_state_ON;
1204   AX_surfxml_link_state_file = 0;
1205   AX_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
1206   ENTER(AL_surfxml_link); pushbuffer(0);
1207   }
1208
1209 <AL_surfxml_link>{
1210  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_id);
1211  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_id);
1212
1213  "bandwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth);
1214  "bandwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth);
1215
1216  "bandwidth_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth_file);
1217  "bandwidth_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth_file);
1218
1219  "latency"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency);
1220  "latency"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency);
1221
1222  "latency_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency_file);
1223  "latency_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency_file);
1224
1225  "state"{Eq}"'ON'" |
1226  "state"{Eq}"\"ON\"" A_surfxml_link_state = A_surfxml_link_state_ON;
1227  "state"{Eq}"'OFF'" |
1228  "state"{Eq}"\"OFF\"" A_surfxml_link_state = A_surfxml_link_state_OFF;
1229
1230  "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_state_file);
1231  "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_state_file);
1232
1233  "sharing_policy"{Eq}"'SHARED'" |
1234  "sharing_policy"{Eq}"\"SHARED\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
1235  "sharing_policy"{Eq}"'FATPIPE'" |
1236  "sharing_policy"{Eq}"\"FATPIPE\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FATPIPE;
1237
1238  ">" {
1239   if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
1240   if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
1241   LEAVE; STag_surfxml_link();surfxml_pcdata_ix = 0; ENTER(S_surfxml_link);
1242  }
1243  "/>" {
1244   if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
1245   if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
1246   LEAVE; STag_surfxml_link(); surfxml_pcdata_ix = 0; ETag_surfxml_link(); popbuffer(); /* attribute */
1247   switch (YY_START) {
1248    case S_surfxml_foreach: case S_surfxml_foreach_1: SET(E_surfxml_foreach); break;
1249    case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1250   }
1251  }
1252  .       FAIL("Unexpected character `%c' in attribute list of link element.", yytext[0]);
1253  {Name} FAIL("Bad attribute `%s' in `link' element start tag.",yytext);
1254  <<EOF>> FAIL("EOF in attribute list of `link' element.");
1255 }
1256
1257 <S_surfxml_link_2,E_surfxml_link,S_surfxml_link>{
1258  "</link"{s}">" {
1259   LEAVE;
1260   ETag_surfxml_link();
1261   popbuffer(); /* attribute */
1262   switch (YY_START) {
1263    case S_surfxml_foreach: case S_surfxml_foreach_1: SET(E_surfxml_foreach); break;
1264    case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1265   }
1266  }
1267  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link>' expected.",yytext);
1268  .       FAIL("Unexpected character `%c': `</link>' expected.",yytext[0]);
1269  <<EOF>> FAIL("Premature EOF: `</link>' expected.");
1270 }
1271
1272 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_platform_2,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_foreach_1,S_surfxml_route>"<route:multi"{s} FAIL("Starting tag <route:multi> is not allowed here.");
1273
1274 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_platform_3,S_surfxml_platform_4>"<route:multi"{s} {
1275   AX_surfxml_route_c_multi_src = 0;
1276   AX_surfxml_route_c_multi_dst = 0;
1277   AX_surfxml_route_c_multi_action = A_surfxml_route_c_multi_action_POSTPEND;
1278   AX_surfxml_route_c_multi_symmetric = A_surfxml_route_c_multi_symmetric_YES;
1279   ENTER(AL_surfxml_route_c_multi); pushbuffer(0);
1280   }
1281
1282 <AL_surfxml_route_c_multi>{
1283  "src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_c_multi_src);
1284  "src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_c_multi_src);
1285
1286  "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_c_multi_dst);
1287  "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_c_multi_dst);
1288
1289  "action"{Eq}"'POSTPEND'" |
1290  "action"{Eq}"\"POSTPEND\"" A_surfxml_route_c_multi_action = A_surfxml_route_c_multi_action_POSTPEND;
1291  "action"{Eq}"'PREPEND'" |
1292  "action"{Eq}"\"PREPEND\"" A_surfxml_route_c_multi_action = A_surfxml_route_c_multi_action_PREPEND;
1293  "action"{Eq}"'OVERRIDE'" |
1294  "action"{Eq}"\"OVERRIDE\"" A_surfxml_route_c_multi_action = A_surfxml_route_c_multi_action_OVERRIDE;
1295
1296  "symmetric"{Eq}"'YES'" |
1297  "symmetric"{Eq}"\"YES\"" A_surfxml_route_c_multi_symmetric = A_surfxml_route_c_multi_symmetric_YES;
1298  "symmetric"{Eq}"'NO'" |
1299  "symmetric"{Eq}"\"NO\"" A_surfxml_route_c_multi_symmetric = A_surfxml_route_c_multi_symmetric_NO;
1300
1301  ">" {
1302   if (!AX_surfxml_route_c_multi_src) FAIL("Required attribute `src' not set for `route:multi' element.");
1303   if (!AX_surfxml_route_c_multi_dst) FAIL("Required attribute `dst' not set for `route:multi' element.");
1304   LEAVE; STag_surfxml_route_c_multi();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route_c_multi);
1305  }
1306  "/>" FAIL("`route:multi' element cannot be empty.");
1307  .       FAIL("Unexpected character `%c' in attribute list of route:multi element.", yytext[0]);
1308  {Name} FAIL("Bad attribute `%s' in `route:multi' element start tag.",yytext);
1309  <<EOF>> FAIL("EOF in attribute list of `route:multi' element.");
1310 }
1311
1312 <S_surfxml_route_c_multi_2,E_surfxml_route_c_multi>{
1313  "</route:multi"{s}">" {
1314   LEAVE;
1315   ETag_surfxml_route_c_multi();
1316   popbuffer(); /* attribute */
1317   switch (YY_START) {
1318    case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
1319   }
1320  }
1321  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route:multi>' expected.",yytext);
1322  .       FAIL("Unexpected character `%c': `</route:multi>' expected.",yytext[0]);
1323  <<EOF>> FAIL("Premature EOF: `</route:multi>' expected.");
1324 }
1325
1326 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_platform_2,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_foreach_1,S_surfxml_route>"<route"{s} FAIL("Starting tag <route> is not allowed here.");
1327
1328 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_platform_3,S_surfxml_platform_4>"<route"{s} {
1329   AX_surfxml_route_src = 0;
1330   AX_surfxml_route_dst = 0;
1331   AX_surfxml_route_impact_on_src = 94;
1332   AX_surfxml_route_impact_on_dst = 98;
1333   AX_surfxml_route_impact_on_src_with_other_recv = 102;
1334   AX_surfxml_route_impact_on_dst_with_other_send = 106;
1335   AX_surfxml_route_action = A_surfxml_route_action_POSTPEND;
1336   ENTER(AL_surfxml_route); pushbuffer(0);
1337   }
1338
1339 <AL_surfxml_route>{
1340  "src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src);
1341  "src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src);
1342
1343  "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst);
1344  "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst);
1345
1346  "impact_on_src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src);
1347  "impact_on_src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src);
1348
1349  "impact_on_dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst);
1350  "impact_on_dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst);
1351
1352  "impact_on_src_with_other_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
1353  "impact_on_src_with_other_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
1354
1355  "impact_on_dst_with_other_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
1356  "impact_on_dst_with_other_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
1357
1358  "action"{Eq}"'POSTPEND'" |
1359  "action"{Eq}"\"POSTPEND\"" A_surfxml_route_action = A_surfxml_route_action_POSTPEND;
1360  "action"{Eq}"'PREPEND'" |
1361  "action"{Eq}"\"PREPEND\"" A_surfxml_route_action = A_surfxml_route_action_PREPEND;
1362  "action"{Eq}"'OVERRIDE'" |
1363  "action"{Eq}"\"OVERRIDE\"" A_surfxml_route_action = A_surfxml_route_action_OVERRIDE;
1364
1365  ">" {
1366   if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
1367   if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
1368   LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route);
1369  }
1370  "/>" {
1371   if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
1372   if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
1373   LEAVE; STag_surfxml_route(); surfxml_pcdata_ix = 0; ETag_surfxml_route(); popbuffer(); /* attribute */
1374   switch (YY_START) {
1375    case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
1376   }
1377  }
1378  .       FAIL("Unexpected character `%c' in attribute list of route element.", yytext[0]);
1379  {Name} FAIL("Bad attribute `%s' in `route' element start tag.",yytext);
1380  <<EOF>> FAIL("EOF in attribute list of `route' element.");
1381 }
1382
1383 <S_surfxml_route,S_surfxml_route_2,E_surfxml_route>{
1384  "</route"{s}">" {
1385   LEAVE;
1386   ETag_surfxml_route();
1387   popbuffer(); /* attribute */
1388   switch (YY_START) {
1389    case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
1390   }
1391  }
1392  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route>' expected.",yytext);
1393  .       FAIL("Unexpected character `%c': `</route>' expected.",yytext[0]);
1394  <<EOF>> FAIL("Premature EOF: `</route>' expected.");
1395 }
1396
1397 <E_surfxml_link,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_platform_3,S_surfxml_platform_4,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_platform_2,S_surfxml_process_1,S_surfxml_host_2,S_surfxml_random_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_foreach_1>"<link:ctn"{s} FAIL("Starting tag <link:ctn> is not allowed here.");
1398
1399 <S_surfxml_route_1,S_surfxml_route,S_surfxml_route_2,S_surfxml_route_c_multi_2,S_surfxml_route_c_multi_1,S_surfxml_route_c_multi>"<link:ctn"{s} {
1400   AX_surfxml_link_c_ctn_id = 0;
1401   ENTER(AL_surfxml_link_c_ctn); pushbuffer(0);
1402   }
1403
1404 <AL_surfxml_link_c_ctn>{
1405  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_c_ctn_id);
1406  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_c_ctn_id);
1407
1408  ">" {
1409   if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element.");
1410   LEAVE; STag_surfxml_link_c_ctn();surfxml_pcdata_ix = 0; ENTER(E_surfxml_link_c_ctn);
1411  }
1412  "/>" {
1413   if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element.");
1414   LEAVE; STag_surfxml_link_c_ctn(); surfxml_pcdata_ix = 0; ETag_surfxml_link_c_ctn(); popbuffer(); /* attribute */
1415   switch (YY_START) {
1416    case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
1417    case S_surfxml_route_c_multi_2: case S_surfxml_route_c_multi_1: case S_surfxml_route_c_multi: SET(S_surfxml_route_c_multi_2); break;
1418   }
1419  }
1420  .       FAIL("Unexpected character `%c' in attribute list of link:ctn element.", yytext[0]);
1421  {Name} FAIL("Bad attribute `%s' in `link:ctn' element start tag.",yytext);
1422  <<EOF>> FAIL("EOF in attribute list of `link:ctn' element.");
1423 }
1424
1425 <E_surfxml_link_c_ctn>{
1426  "</link:ctn"{s}">" {
1427   LEAVE;
1428   ETag_surfxml_link_c_ctn();
1429   popbuffer(); /* attribute */
1430   switch (YY_START) {
1431    case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
1432    case S_surfxml_route_c_multi_2: case S_surfxml_route_c_multi_1: case S_surfxml_route_c_multi: SET(S_surfxml_route_c_multi_2); break;
1433   }
1434  }
1435  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link:ctn>' expected.",yytext);
1436  .       FAIL("Unexpected character `%c': `</link:ctn>' expected.",yytext[0]);
1437  <<EOF>> FAIL("Premature EOF: `</link:ctn>' expected.");
1438 }
1439
1440 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_platform_2,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,E_surfxml_foreach,S_surfxml_process_2,S_surfxml_foreach_1,S_surfxml_route>"<process"{s} FAIL("Starting tag <process> is not allowed here.");
1441
1442 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_platform_3,S_surfxml_platform_4>"<process"{s} {
1443   AX_surfxml_process_host = 0;
1444   AX_surfxml_process_function = 0;
1445   AX_surfxml_process_start_time = 110;
1446   AX_surfxml_process_kill_time = 115;
1447   ENTER(AL_surfxml_process); pushbuffer(0);
1448   }
1449
1450 <AL_surfxml_process>{
1451  "host"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host);
1452  "host"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host);
1453
1454  "function"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function);
1455  "function"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function);
1456
1457  "start_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start_time);
1458  "start_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start_time);
1459
1460  "kill_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill_time);
1461  "kill_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill_time);
1462
1463  ">" {
1464   if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
1465   if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
1466   LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process);
1467  }
1468  "/>" {
1469   if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
1470   if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
1471   LEAVE; STag_surfxml_process(); surfxml_pcdata_ix = 0; ETag_surfxml_process(); popbuffer(); /* attribute */
1472   switch (YY_START) {
1473    case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
1474   }
1475  }
1476  .       FAIL("Unexpected character `%c' in attribute list of process element.", yytext[0]);
1477  {Name} FAIL("Bad attribute `%s' in `process' element start tag.",yytext);
1478  <<EOF>> FAIL("EOF in attribute list of `process' element.");
1479 }
1480
1481 <S_surfxml_process,E_surfxml_process,S_surfxml_process_2>{
1482  "</process"{s}">" {
1483   LEAVE;
1484   ETag_surfxml_process();
1485   popbuffer(); /* attribute */
1486   switch (YY_START) {
1487    case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: case S_surfxml_platform_4: SET(S_surfxml_platform_5); break;
1488   }
1489  }
1490  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</process>' expected.",yytext);
1491  .       FAIL("Unexpected character `%c': `</process>' expected.",yytext[0]);
1492  <<EOF>> FAIL("Premature EOF: `</process>' expected.");
1493 }
1494
1495 <S_surfxml_route_c_multi_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_random,E_surfxml_process,S_surfxml_link_2,S_surfxml_host_1,E_surfxml_route_c_multi,E_surfxml_random,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,E_surfxml_route,S_surfxml_random_1,S_surfxml_platform_3,S_surfxml_platform_4,S_surfxml_route_1,S_surfxml_route_c_multi,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_host,S_surfxml_platform_2,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_random_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_foreach_1,S_surfxml_route>"<argument"{s} FAIL("Starting tag <argument> is not allowed here.");
1496
1497 <S_surfxml_process_1,S_surfxml_process,S_surfxml_process_2>"<argument"{s} {
1498   AX_surfxml_argument_value = 0;
1499   ENTER(AL_surfxml_argument); pushbuffer(0);
1500   }
1501
1502 <AL_surfxml_argument>{
1503  "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_argument_value);
1504  "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_argument_value);
1505
1506  ">" {
1507   if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
1508   LEAVE; STag_surfxml_argument();surfxml_pcdata_ix = 0; ENTER(E_surfxml_argument);
1509  }
1510  "/>" {
1511   if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
1512   LEAVE; STag_surfxml_argument(); surfxml_pcdata_ix = 0; ETag_surfxml_argument(); popbuffer(); /* attribute */
1513   switch (YY_START) {
1514    case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1515   }
1516  }
1517  .       FAIL("Unexpected character `%c' in attribute list of argument element.", yytext[0]);
1518  {Name} FAIL("Bad attribute `%s' in `argument' element start tag.",yytext);
1519  <<EOF>> FAIL("EOF in attribute list of `argument' element.");
1520 }
1521
1522 <E_surfxml_argument>{
1523  "</argument"{s}">" {
1524   LEAVE;
1525   ETag_surfxml_argument();
1526   popbuffer(); /* attribute */
1527   switch (YY_START) {
1528    case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1529   }
1530  }
1531  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</argument>' expected.",yytext);
1532  .       FAIL("Unexpected character `%c': `</argument>' expected.",yytext[0]);
1533  <<EOF>> FAIL("Premature EOF: `</argument>' expected.");
1534 }
1535
1536  /* EPILOG: after the root element. */
1537
1538 <EPILOG>{
1539  . {SET(PROLOG); yyless(0); CLEANUP; return -1;}
1540  <<EOF>>        SUCCEED;
1541 }
1542
1543  /* CHARACTER DATA. */
1544
1545 <IN_trace,VALUE1,VALUE2>{
1546  /* Non-defined standard entities... */
1547 "&amp;"  BUFFERPUTC('&');
1548 "&lt;"   BUFFERPUTC('<');
1549 "&gt;"   BUFFERPUTC('>');
1550 "&apos;" BUFFERPUTC('\'');
1551 "&quot;" BUFFERPUTC('"');
1552
1553  /* Character entities. */
1554  "&#"[[:digit:]]+";"    BUFFERPUTC((unsigned char)atoi(yytext+2));
1555  "&#x"[[:xdigit:]]+";"  BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
1556 }
1557
1558 <IN_trace,VALUE1,VALUE2,CDATA>{
1559  "\n"           |
1560  "\r"           |
1561  "\r\n"         |
1562  "\n\r"         BUFFERPUTC('\n');
1563 }
1564
1565 <IN_trace>{
1566  "<![CDATA["    ENTER(CDATA);
1567  "]""]>"                FAIL("Unexpected `]""]>' in character data.");
1568 }
1569
1570 <VALUE1>{
1571  \'             BUFFERDONE; LEAVE;
1572  <<EOF>>        FAIL("EOF in literal (\"'\" expected).");
1573 }
1574
1575 <VALUE2>{
1576  \"             BUFFERDONE; LEAVE;
1577  <<EOF>>        FAIL("EOF in literal (`\"' expected).");
1578 }
1579
1580 <IN_trace,VALUE1,VALUE2>{
1581  [^<&]          BUFFERPUTC(yytext[0]);
1582  [<&]           FAIL("Spurious `%c' in character data.",yytext[0]);
1583 }
1584
1585 <CDATA>{
1586  "]""]>"                LEAVE;
1587  /* "]""]"              BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]); */
1588  .              BUFFERPUTC(yytext[0]);
1589  <<EOF>>        FAIL("EOF in CDATA section.");
1590 }
1591
1592  /* Impossible rules to avoid warnings from flex(1). */
1593  /* Ideally, this should be replaced by code in flexml.pl that
1594     generates just the states not covered by other rules. */
1595 <*>{
1596  .|[\n] FAIL("Syntax error on character `%c'.", yytext[0]);
1597 }
1598
1599 %%
1600
1601 /* Element context stack lookup. */
1602 int surfxml_element_context(int i)
1603 {
1604   return (0<i && i<yy_start_stack_depth
1605           ? yy_start_stack[yy_start_stack_ptr - i]
1606           : 0);
1607 }
1608
1609 #ifdef FLEX_DEBUG
1610 void print_yy_stack(char* fmt, ...)
1611 {
1612   int i = 0; va_list ap; va_start(ap, fmt);
1613   vfprintf(stderr, fmt, ap);
1614   if (surfxml_statenames) {
1615       for (i=1; i<yy_start_stack_ptr; i++) {
1616           fprintf(stderr, "%s/", surfxml_statenames[yy_start_stack[i] ]);
1617       }
1618       fprintf(stderr,"%s\n", surfxml_statenames[YY_START]);
1619   }
1620   va_end(ap);
1621 }
1622
1623 void print_surfxml_bufferstack()
1624 {
1625     int i;
1626     fputs("Buffer: ", stderr);
1627     for (i = 0; i < blimit; i++) {
1628        if ( surfxml_bufferstack[i] == '\377' ) break;
1629          putc(surfxml_bufferstack[i], stderr);
1630     }
1631     putc('\n', stderr);
1632 }
1633
1634 static void debug_enter(int state, const char* statename) {
1635   yy_push_state(state);
1636   if (yy_flex_debug) {
1637        print_yy_stack("--ENTER(%s) : ",statename);
1638        print_surfxml_bufferstack();
1639   }
1640 }
1641
1642 static void debug_leave(void) {
1643     if (yy_flex_debug) {
1644         print_yy_stack("--LEAVE : ");
1645         print_surfxml_bufferstack();
1646     }
1647   yy_pop_state();
1648 }
1649
1650 static void debug_set(int state, const char* statename) {
1651   BEGIN(state);
1652   if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename);
1653 }
1654 #endif
1655
1656
1657 static void cleanup(void)
1658 {
1659     if (surfxml_statenames) {
1660         free(surfxml_statenames);
1661         surfxml_statenames = NULL;
1662     }
1663     free(surfxml_bufferstack);
1664     surfxml_bufferstack = NULL;
1665
1666     free(indexstack);
1667     indexstack = NULL;
1668 }
1669
1670
1671 static int fail(const char* fmt, ...)
1672 {
1673     int chars_left, used;
1674     va_list ap; va_start(ap, fmt);
1675 #ifdef FLEXML_yylineno
1676     used = sprintf(flexml_err_msg,
1677                    "Invalid XML (XML input line %d, state %d): ",
1678                    yylineno, YY_START);
1679 #else
1680     used = sprintf(flexml_err_msg,
1681                    "Invalid XML (state %d): ",
1682                    YY_START);
1683 #endif
1684     chars_left = flexml_max_err_msg_size - used - 1;
1685     vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
1686     va_end(ap);
1687
1688 #ifndef FLEXML_quiet_parser
1689     /* print directly to sdterr */
1690     fprintf(stderr, "%s\n", flexml_err_msg);
1691     flexml_err_msg[0] = '\0';
1692 #endif
1693
1694     cleanup();
1695
1696     return 1;
1697 }