Logo AND Algorithmique Numérique Distribuée

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