Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix copyright headers
[simgrid.git] / src / surf / simgrid_dtd.l
1 /* Validating XML processor for /home/mquinson/Code/simgrid/src/surf/simgrid.dtd.
2  * Generated 2010/04/14 12:16:24.
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.62 2007/10/11 10:00:14 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.62 2007/10/11 10:00:14 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_host_vivaldi AX_surfxml_host_vivaldi;
158 #define A_surfxml_host_vivaldi (surfxml_bufferstack + AX_surfxml_host_vivaldi)
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_c_connect_trace AX_surfxml_trace_c_connect_trace;
204 #define A_surfxml_trace_c_connect_trace (surfxml_bufferstack + AX_surfxml_trace_c_connect_trace)
205 AT_surfxml_trace_id AX_surfxml_trace_id;
206 #define A_surfxml_trace_id (surfxml_bufferstack + AX_surfxml_trace_id)
207 AT_surfxml_cluster_radical AX_surfxml_cluster_radical;
208 #define A_surfxml_cluster_radical (surfxml_bufferstack + AX_surfxml_cluster_radical)
209 AT_surfxml_include_file AX_surfxml_include_file;
210 #define A_surfxml_include_file (surfxml_bufferstack + AX_surfxml_include_file)
211 AT_surfxml_random_std_deviation AX_surfxml_random_std_deviation;
212 #define A_surfxml_random_std_deviation (surfxml_bufferstack + AX_surfxml_random_std_deviation)
213 AT_surfxml_trace_c_connect_kind AX_surfxml_trace_c_connect_kind;
214 #define A_surfxml_trace_c_connect_kind AX_surfxml_trace_c_connect_kind
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 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, "0.0");
448   surfxml_bufferliteral('\0', &bnext, "-1.0");
449   surfxml_bufferliteral('\0', &bnext, "-1.0");
450   if(!surfxml_statenames) {surfxml_statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*));
451   surfxml_statenames[PROLOG] = NULL;
452   surfxml_statenames[DOCTYPE] = NULL;
453   surfxml_statenames[EPILOG] = NULL;
454   surfxml_statenames[INCOMMENT] = NULL;
455   surfxml_statenames[INPI] = NULL;
456   surfxml_statenames[VALUE1] = NULL;
457   surfxml_statenames[VALUE2] = NULL;
458   surfxml_statenames[CDATA] = NULL;
459   surfxml_statenames[ROOT_surfxml_platform] = NULL;
460   surfxml_statenames[AL_surfxml_platform] = NULL;
461   surfxml_statenames[S_surfxml_platform] = "platform";
462   surfxml_statenames[S_surfxml_platform_1] = "platform";
463   surfxml_statenames[S_surfxml_platform_2] = "platform";
464   surfxml_statenames[S_surfxml_platform_3] = "platform";
465   surfxml_statenames[S_surfxml_platform_4] = "platform";
466   surfxml_statenames[S_surfxml_platform_5] = "platform";
467   surfxml_statenames[E_surfxml_platform] = "platform";
468   surfxml_statenames[AL_surfxml_include] = NULL;
469   surfxml_statenames[E_surfxml_include] = "include";
470   surfxml_statenames[AL_surfxml_trace] = NULL;
471   surfxml_statenames[IN_trace] = "trace";
472   surfxml_statenames[AL_surfxml_random] = NULL;
473   surfxml_statenames[S_surfxml_random] = "random";
474   surfxml_statenames[S_surfxml_random_1] = "random";
475   surfxml_statenames[S_surfxml_random_2] = "random";
476   surfxml_statenames[E_surfxml_random] = "random";
477   surfxml_statenames[AL_surfxml_trace_c_connect] = NULL;
478   surfxml_statenames[E_surfxml_trace_c_connect] = "trace:connect";
479   surfxml_statenames[AL_surfxml_set] = NULL;
480   surfxml_statenames[E_surfxml_set] = "set";
481   surfxml_statenames[AL_surfxml_foreach] = NULL;
482   surfxml_statenames[S_surfxml_foreach] = "foreach";
483   surfxml_statenames[S_surfxml_foreach_1] = "foreach";
484   surfxml_statenames[E_surfxml_foreach] = "foreach";
485   surfxml_statenames[AL_surfxml_host] = NULL;
486   surfxml_statenames[S_surfxml_host] = "host";
487   surfxml_statenames[S_surfxml_host_1] = "host";
488   surfxml_statenames[S_surfxml_host_2] = "host";
489   surfxml_statenames[E_surfxml_host] = "host";
490   surfxml_statenames[AL_surfxml_prop] = NULL;
491   surfxml_statenames[E_surfxml_prop] = "prop";
492   surfxml_statenames[AL_surfxml_cluster] = NULL;
493   surfxml_statenames[E_surfxml_cluster] = "cluster";
494   surfxml_statenames[AL_surfxml_router] = NULL;
495   surfxml_statenames[E_surfxml_router] = "router";
496   surfxml_statenames[AL_surfxml_link] = NULL;
497   surfxml_statenames[S_surfxml_link] = "link";
498   surfxml_statenames[S_surfxml_link_1] = "link";
499   surfxml_statenames[S_surfxml_link_2] = "link";
500   surfxml_statenames[E_surfxml_link] = "link";
501   surfxml_statenames[AL_surfxml_route_c_multi] = NULL;
502   surfxml_statenames[S_surfxml_route_c_multi] = "route:multi";
503   surfxml_statenames[S_surfxml_route_c_multi_1] = "route:multi";
504   surfxml_statenames[S_surfxml_route_c_multi_2] = "route:multi";
505   surfxml_statenames[E_surfxml_route_c_multi] = "route:multi";
506   surfxml_statenames[AL_surfxml_route] = NULL;
507   surfxml_statenames[S_surfxml_route] = "route";
508   surfxml_statenames[S_surfxml_route_1] = "route";
509   surfxml_statenames[S_surfxml_route_2] = "route";
510   surfxml_statenames[E_surfxml_route] = "route";
511   surfxml_statenames[AL_surfxml_link_c_ctn] = NULL;
512   surfxml_statenames[E_surfxml_link_c_ctn] = "link:ctn";
513   surfxml_statenames[AL_surfxml_process] = NULL;
514   surfxml_statenames[S_surfxml_process] = "process";
515   surfxml_statenames[S_surfxml_process_1] = "process";
516   surfxml_statenames[S_surfxml_process_2] = "process";
517   surfxml_statenames[E_surfxml_process] = "process";
518   surfxml_statenames[AL_surfxml_argument] = NULL;
519   surfxml_statenames[E_surfxml_argument] = "argument";
520   }
521
522  /* COMMENTS and PIs: handled uniformly for efficiency. */
523
524 <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>{
525  "<!--" ENTER(INCOMMENT);
526  "<?" ENTER(INPI);
527 }
528 <INCOMMENT>{
529  "-->"          LEAVE;
530  "--"           |
531  .              |
532  \n             SKIP;
533  <<EOF>>        FAIL("EOF in comment.");
534 }
535 <INPI>{
536  "?>"           LEAVE;
537  .              |
538  \n             SKIP;
539  <<EOF>>        FAIL("EOF in PI (processing instruction).");
540 }
541
542  /* SPACES: skipped uniformly */
543
544 <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;
545
546  /* PROLOG: determine root element and process it. */
547
548 <PROLOG>{
549  "<?xml"({S}version{Eq}(\'{VersionNum}\'|\"{VersionNum}\"))?({S}encoding{Eq}(\'[^']*\'|\"[^"]*\"))?"?>" SET(DOCTYPE); 
550  "<?xml"[^>]*">" FAIL("Bad declaration %s.",yytext);
551 }
552
553 <PROLOG,DOCTYPE>{
554  "<!DOCTYPE"{S}"platform"{S}SYSTEM{S}("'simgrid.dtd'"|"\"simgrid.dtd\""){s}">" SET(ROOT_surfxml_platform);
555  "<!"[^>-][^>]*">" FAIL("Bad declaration %s.",yytext);
556  .              FAIL("Unexpected character `%c' in prolog.", yytext[0]);
557  <<EOF>>        FAIL("EOF in prolog.");
558 }
559
560  /* RULES DERIVED FROM DTD. */
561
562  /* <!-- Small DTD for SURF based tools. -->  */
563
564 <S_surfxml_route_c_multi_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_random,E_surfxml_route_c_multi,E_surfxml_route,S_surfxml_platform_3,S_surfxml_route_1,S_surfxml_link_1,S_surfxml_link,E_surfxml_host,S_surfxml_random_2,S_surfxml_foreach_1,S_surfxml_process_2,E_surfxml_link,S_surfxml_platform,S_surfxml_platform_1,S_surfxml_host_1,S_surfxml_foreach,E_surfxml_platform,S_surfxml_route_2,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_c_multi,S_surfxml_platform_2,S_surfxml_host,S_surfxml_process_1,S_surfxml_host_2,S_surfxml_route_c_multi_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_route>"<platform"{s} FAIL("Starting tag <platform> is not allowed here.");
565
566 <ROOT_surfxml_platform>"<platform"{s} {
567   AX_surfxml_platform_version = 1;
568   AX_surfxml_platform_xmlns_c_link = 5;
569   AX_surfxml_platform_xmlns_c_route = 37;
570   ENTER(AL_surfxml_platform); pushbuffer(0);
571   }
572
573 <AL_surfxml_platform>{
574  "version"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_version);
575  "version"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_version);
576
577  "xmlns:link"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_xmlns_c_link);
578  "xmlns:link"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_xmlns_c_link);
579
580  "xmlns:route"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_xmlns_c_route);
581  "xmlns:route"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_xmlns_c_route);
582
583  ">" {
584   LEAVE; STag_surfxml_platform();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform);
585  }
586  "/>" {
587   LEAVE; STag_surfxml_platform(); surfxml_pcdata_ix = 0; ETag_surfxml_platform(); popbuffer(); /* attribute */
588   switch (YY_START) {
589    case ROOT_surfxml_platform: SET(EPILOG); break;
590   }
591  }
592  .       FAIL("Unexpected character `%c' in attribute list of platform element.", yytext[0]);
593  {Name} FAIL("Bad attribute `%s' in `platform' element start tag.",yytext);
594  <<EOF>> FAIL("EOF in attribute list of `platform' element.");
595 }
596
597 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform_3,S_surfxml_platform,E_surfxml_platform>{
598  "</platform"{s}">" {
599   LEAVE;
600   ETag_surfxml_platform();
601   popbuffer(); /* attribute */
602   switch (YY_START) {
603    case ROOT_surfxml_platform: SET(EPILOG); break;
604   }
605  }
606  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</platform>' expected.",yytext);
607  .       FAIL("Unexpected character `%c': `</platform>' expected.",yytext[0]);
608  <<EOF>> FAIL("Premature EOF: `</platform>' expected.");
609 }
610
611 <S_surfxml_route_c_multi_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,ROOT_surfxml_include,S_surfxml_random_2,S_surfxml_process_2,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,S_surfxml_random_1,S_surfxml_route_c_multi,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,E_surfxml_foreach,S_surfxml_route>"<include"{s} FAIL("Starting tag <include> is not allowed here.");
612
613 <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} {
614   AX_surfxml_include_file = 0;
615   ENTER(AL_surfxml_include); pushbuffer(0);
616   }
617
618 <AL_surfxml_include>{
619  "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_include_file);
620  "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_include_file);
621
622  ">" {
623   if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
624   LEAVE; STag_surfxml_include();surfxml_pcdata_ix = 0; ENTER(E_surfxml_include);
625  }
626  "/>" {
627   if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
628   LEAVE; STag_surfxml_include(); surfxml_pcdata_ix = 0; ETag_surfxml_include(); popbuffer(); /* attribute */
629   switch (YY_START) {
630    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;
631    case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
632   }
633  }
634  .       FAIL("Unexpected character `%c' in attribute list of include element.", yytext[0]);
635  {Name} FAIL("Bad attribute `%s' in `include' element start tag.",yytext);
636  <<EOF>> FAIL("EOF in attribute list of `include' element.");
637 }
638
639 <E_surfxml_include>{
640  "</include"{s}">" {
641   LEAVE;
642   ETag_surfxml_include();
643   popbuffer(); /* attribute */
644   switch (YY_START) {
645    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;
646    case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
647   }
648  }
649  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</include>' expected.",yytext);
650  .       FAIL("Unexpected character `%c': `</include>' expected.",yytext[0]);
651  <<EOF>> FAIL("Premature EOF: `</include>' expected.");
652 }
653
654 <S_surfxml_route_c_multi_1,ROOT_surfxml_trace,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_random_2,S_surfxml_process_2,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_c_multi,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_route>"<trace"{s} FAIL("Starting tag <trace> is not allowed here.");
655
656 <S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<trace"{s} {
657   AX_surfxml_trace_id = 0;
658   AX_surfxml_trace_file = 0;
659   AX_surfxml_trace_periodicity = 0;
660   ENTER(AL_surfxml_trace); pushbuffer(0);
661   }
662
663 <AL_surfxml_trace>{
664  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_id);
665  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_id);
666
667  "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_file);
668  "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_file);
669
670  "periodicity"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_periodicity);
671  "periodicity"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_periodicity);
672
673  ">" {
674   if (!AX_surfxml_trace_id) FAIL("Required attribute `id' not set for `trace' element.");
675   if (!AX_surfxml_trace_periodicity) FAIL("Required attribute `periodicity' not set for `trace' element.");
676   LEAVE; STag_surfxml_trace();pushbuffer(surfxml_pcdata_ix); BUFFERSET(surfxml_pcdata_ix);; ENTER(IN_trace);
677  }
678  "/>" {
679   if (!AX_surfxml_trace_id) FAIL("Required attribute `id' not set for `trace' element.");
680   if (!AX_surfxml_trace_periodicity) FAIL("Required attribute `periodicity' not set for `trace' element.");
681   LEAVE; STag_surfxml_trace(); surfxml_pcdata_ix = 0; ETag_surfxml_trace(); popbuffer(); /* attribute */
682   switch (YY_START) {
683    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
684   }
685  }
686  .       FAIL("Unexpected character `%c' in attribute list of trace element.", yytext[0]);
687  {Name} FAIL("Bad attribute `%s' in `trace' element start tag.",yytext);
688  <<EOF>> FAIL("EOF in attribute list of `trace' element.");
689 }
690
691 <IN_trace>{
692  "</trace"{s}">" {
693   LEAVE;
694   BUFFERDONE;
695   ETag_surfxml_trace();
696   surfxml_pcdata_ix = popbuffer();
697   popbuffer(); /* attribute */
698   switch (YY_START) {
699    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
700   }
701  }
702  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</trace>' expected.",yytext);
703  <<EOF>> FAIL("Premature EOF: `</trace>' expected.");
704 }
705
706 <S_surfxml_route_c_multi_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,ROOT_surfxml_random,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_random_2,S_surfxml_process_2,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_c_multi,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_route>"<random"{s} FAIL("Starting tag <random> is not allowed here.");
707
708 <S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<random"{s} {
709   AX_surfxml_random_id = 0;
710   AX_surfxml_random_min = 0;
711   AX_surfxml_random_max = 0;
712   AX_surfxml_random_mean = 0;
713   AX_surfxml_random_std_deviation = 0;
714   AX_surfxml_random_generator = A_surfxml_random_generator_DRAND48;
715   ENTER(AL_surfxml_random); pushbuffer(0);
716   }
717
718 <AL_surfxml_random>{
719  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_id);
720  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_id);
721
722  "min"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_min);
723  "min"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_min);
724
725  "max"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_max);
726  "max"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_max);
727
728  "mean"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_mean);
729  "mean"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_mean);
730
731  "std_deviation"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_random_std_deviation);
732  "std_deviation"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_random_std_deviation);
733
734  "generator"{Eq}"'DRAND48'" |
735  "generator"{Eq}"\"DRAND48\"" A_surfxml_random_generator = A_surfxml_random_generator_DRAND48;
736  "generator"{Eq}"'RAND'" |
737  "generator"{Eq}"\"RAND\"" A_surfxml_random_generator = A_surfxml_random_generator_RAND;
738
739  ">" {
740   if (!AX_surfxml_random_id) FAIL("Required attribute `id' not set for `random' element.");
741   if (!AX_surfxml_random_min) FAIL("Required attribute `min' not set for `random' element.");
742   if (!AX_surfxml_random_max) FAIL("Required attribute `max' not set for `random' element.");
743   if (!AX_surfxml_random_mean) FAIL("Required attribute `mean' not set for `random' element.");
744   if (!AX_surfxml_random_std_deviation) FAIL("Required attribute `std_deviation' not set for `random' element.");
745   LEAVE; STag_surfxml_random();surfxml_pcdata_ix = 0; ENTER(S_surfxml_random);
746  }
747  "/>" {
748   if (!AX_surfxml_random_id) FAIL("Required attribute `id' not set for `random' element.");
749   if (!AX_surfxml_random_min) FAIL("Required attribute `min' not set for `random' element.");
750   if (!AX_surfxml_random_max) FAIL("Required attribute `max' not set for `random' element.");
751   if (!AX_surfxml_random_mean) FAIL("Required attribute `mean' not set for `random' element.");
752   if (!AX_surfxml_random_std_deviation) FAIL("Required attribute `std_deviation' not set for `random' element.");
753   LEAVE; STag_surfxml_random(); surfxml_pcdata_ix = 0; ETag_surfxml_random(); popbuffer(); /* attribute */
754   switch (YY_START) {
755    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
756   }
757  }
758  .       FAIL("Unexpected character `%c' in attribute list of random element.", yytext[0]);
759  {Name} FAIL("Bad attribute `%s' in `random' element start tag.",yytext);
760  <<EOF>> FAIL("EOF in attribute list of `random' element.");
761 }
762
763 <S_surfxml_random_2,S_surfxml_random,E_surfxml_random>{
764  "</random"{s}">" {
765   LEAVE;
766   ETag_surfxml_random();
767   popbuffer(); /* attribute */
768   switch (YY_START) {
769    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
770   }
771  }
772  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</random>' expected.",yytext);
773  .       FAIL("Unexpected character `%c': `</random>' expected.",yytext[0]);
774  <<EOF>> FAIL("Premature EOF: `</random>' expected.");
775 }
776
777 <S_surfxml_route_c_multi_1,S_surfxml_random,ROOT_surfxml_trace_c_connect,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_random_2,S_surfxml_process_2,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,S_surfxml_random_1,S_surfxml_route_c_multi,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,E_surfxml_foreach,S_surfxml_route>"<trace:connect"{s} FAIL("Starting tag <trace:connect> is not allowed here.");
778
779 <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} {
780   AX_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_HOST_AVAIL;
781   AX_surfxml_trace_c_connect_trace = 0;
782   AX_surfxml_trace_c_connect_element = 0;
783   ENTER(AL_surfxml_trace_c_connect); pushbuffer(0);
784   }
785
786 <AL_surfxml_trace_c_connect>{
787  "kind"{Eq}"'HOST_AVAIL'" |
788  "kind"{Eq}"\"HOST_AVAIL\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_HOST_AVAIL;
789  "kind"{Eq}"'POWER'" |
790  "kind"{Eq}"\"POWER\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_POWER;
791  "kind"{Eq}"'LINK_AVAIL'" |
792  "kind"{Eq}"\"LINK_AVAIL\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_LINK_AVAIL;
793  "kind"{Eq}"'BANDWIDTH'" |
794  "kind"{Eq}"\"BANDWIDTH\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_BANDWIDTH;
795  "kind"{Eq}"'LATENCY'" |
796  "kind"{Eq}"\"LATENCY\"" A_surfxml_trace_c_connect_kind = A_surfxml_trace_c_connect_kind_LATENCY;
797
798  "trace"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_c_connect_trace);
799  "trace"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_c_connect_trace);
800
801  "element"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_c_connect_element);
802  "element"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_c_connect_element);
803
804  ">" {
805   if (!AX_surfxml_trace_c_connect_trace) FAIL("Required attribute `trace' not set for `trace:connect' element.");
806   if (!AX_surfxml_trace_c_connect_element) FAIL("Required attribute `element' not set for `trace:connect' element.");
807   LEAVE; STag_surfxml_trace_c_connect();surfxml_pcdata_ix = 0; ENTER(E_surfxml_trace_c_connect);
808  }
809  "/>" {
810   if (!AX_surfxml_trace_c_connect_trace) FAIL("Required attribute `trace' not set for `trace:connect' element.");
811   if (!AX_surfxml_trace_c_connect_element) FAIL("Required attribute `element' not set for `trace:connect' element.");
812   LEAVE; STag_surfxml_trace_c_connect(); surfxml_pcdata_ix = 0; ETag_surfxml_trace_c_connect(); popbuffer(); /* attribute */
813   switch (YY_START) {
814    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;
815    case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
816   }
817  }
818  .       FAIL("Unexpected character `%c' in attribute list of trace:connect element.", yytext[0]);
819  {Name} FAIL("Bad attribute `%s' in `trace:connect' element start tag.",yytext);
820  <<EOF>> FAIL("EOF in attribute list of `trace:connect' element.");
821 }
822
823 <E_surfxml_trace_c_connect>{
824  "</trace:connect"{s}">" {
825   LEAVE;
826   ETag_surfxml_trace_c_connect();
827   popbuffer(); /* attribute */
828   switch (YY_START) {
829    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;
830    case S_surfxml_platform_2: SET(S_surfxml_platform_3); break;
831   }
832  }
833  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</trace:connect>' expected.",yytext);
834  .       FAIL("Unexpected character `%c': `</trace:connect>' expected.",yytext[0]);
835  <<EOF>> FAIL("Premature EOF: `</trace:connect>' expected.");
836 }
837
838 <S_surfxml_route_c_multi_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_random_2,S_surfxml_process_2,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,ROOT_surfxml_set,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_c_multi,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_route>"<set"{s} FAIL("Starting tag <set> is not allowed here.");
839
840 <S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<set"{s} {
841   AX_surfxml_set_id = 0;
842   AX_surfxml_set_prefix = 0;
843   AX_surfxml_set_suffix = 0;
844   AX_surfxml_set_radical = 0;
845   ENTER(AL_surfxml_set); pushbuffer(0);
846   }
847
848 <AL_surfxml_set>{
849  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_set_id);
850  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_set_id);
851
852  "prefix"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_set_prefix);
853  "prefix"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_set_prefix);
854
855  "suffix"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_set_suffix);
856  "suffix"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_set_suffix);
857
858  "radical"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_set_radical);
859  "radical"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_set_radical);
860
861  ">" {
862   if (!AX_surfxml_set_id) FAIL("Required attribute `id' not set for `set' element.");
863   if (!AX_surfxml_set_prefix) FAIL("Required attribute `prefix' not set for `set' element.");
864   if (!AX_surfxml_set_suffix) FAIL("Required attribute `suffix' not set for `set' element.");
865   if (!AX_surfxml_set_radical) FAIL("Required attribute `radical' not set for `set' element.");
866   LEAVE; STag_surfxml_set();surfxml_pcdata_ix = 0; ENTER(E_surfxml_set);
867  }
868  "/>" {
869   if (!AX_surfxml_set_id) FAIL("Required attribute `id' not set for `set' element.");
870   if (!AX_surfxml_set_prefix) FAIL("Required attribute `prefix' not set for `set' element.");
871   if (!AX_surfxml_set_suffix) FAIL("Required attribute `suffix' not set for `set' element.");
872   if (!AX_surfxml_set_radical) FAIL("Required attribute `radical' not set for `set' element.");
873   LEAVE; STag_surfxml_set(); surfxml_pcdata_ix = 0; ETag_surfxml_set(); popbuffer(); /* attribute */
874   switch (YY_START) {
875    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
876   }
877  }
878  .       FAIL("Unexpected character `%c' in attribute list of set element.", yytext[0]);
879  {Name} FAIL("Bad attribute `%s' in `set' element start tag.",yytext);
880  <<EOF>> FAIL("EOF in attribute list of `set' element.");
881 }
882
883 <E_surfxml_set>{
884  "</set"{s}">" {
885   LEAVE;
886   ETag_surfxml_set();
887   popbuffer(); /* attribute */
888   switch (YY_START) {
889    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
890   }
891  }
892  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</set>' expected.",yytext);
893  .       FAIL("Unexpected character `%c': `</set>' expected.",yytext[0]);
894  <<EOF>> FAIL("Premature EOF: `</set>' expected.");
895 }
896
897 <S_surfxml_route_c_multi_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,ROOT_surfxml_foreach,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_random_2,S_surfxml_process_2,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_c_multi,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_route>"<foreach"{s} FAIL("Starting tag <foreach> is not allowed here.");
898
899 <S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<foreach"{s} {
900   AX_surfxml_foreach_set_id = 0;
901   ENTER(AL_surfxml_foreach); pushbuffer(0);
902   }
903
904 <AL_surfxml_foreach>{
905  "set_id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_foreach_set_id);
906  "set_id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_foreach_set_id);
907
908  ">" {
909   if (!AX_surfxml_foreach_set_id) FAIL("Required attribute `set_id' not set for `foreach' element.");
910   LEAVE; STag_surfxml_foreach();surfxml_pcdata_ix = 0; ENTER(S_surfxml_foreach);
911  }
912  "/>" FAIL("`foreach' element cannot be empty.");
913  .       FAIL("Unexpected character `%c' in attribute list of foreach element.", yytext[0]);
914  {Name} FAIL("Bad attribute `%s' in `foreach' element start tag.",yytext);
915  <<EOF>> FAIL("EOF in attribute list of `foreach' element.");
916 }
917
918 <E_surfxml_foreach>{
919  "</foreach"{s}">" {
920   LEAVE;
921   ETag_surfxml_foreach();
922   popbuffer(); /* attribute */
923   switch (YY_START) {
924    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
925   }
926  }
927  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</foreach>' expected.",yytext);
928  .       FAIL("Unexpected character `%c': `</foreach>' expected.",yytext[0]);
929  <<EOF>> FAIL("Premature EOF: `</foreach>' expected.");
930 }
931
932 <S_surfxml_route_c_multi_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_random_2,S_surfxml_process_2,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_c_multi,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,ROOT_surfxml_host,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_route>"<host"{s} FAIL("Starting tag <host> is not allowed here.");
933
934 <S_surfxml_foreach,S_surfxml_platform_2,S_surfxml_platform_3,S_surfxml_platform>"<host"{s} {
935   AX_surfxml_host_id = 0;
936   AX_surfxml_host_power = 0;
937   AX_surfxml_host_availability = 69;
938   AX_surfxml_host_availability_file = 0;
939   AX_surfxml_host_state = A_surfxml_host_state_ON;
940   AX_surfxml_host_state_file = 0;
941   AX_surfxml_host_interference_send = 73;
942   AX_surfxml_host_interference_recv = 77;
943   AX_surfxml_host_interference_send_recv = 81;
944   AX_surfxml_host_max_outgoing_rate = 85;
945   AX_surfxml_host_vivaldi = 90;
946   ENTER(AL_surfxml_host); pushbuffer(0);
947   }
948
949 <AL_surfxml_host>{
950  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_id);
951  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_id);
952
953  "power"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_power);
954  "power"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_power);
955
956  "availability"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability);
957  "availability"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability);
958
959  "availability_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability_file);
960  "availability_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability_file);
961
962  "state"{Eq}"'ON'" |
963  "state"{Eq}"\"ON\"" A_surfxml_host_state = A_surfxml_host_state_ON;
964  "state"{Eq}"'OFF'" |
965  "state"{Eq}"\"OFF\"" A_surfxml_host_state = A_surfxml_host_state_OFF;
966
967  "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_state_file);
968  "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_state_file);
969
970  "interference_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send);
971  "interference_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send);
972
973  "interference_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_recv);
974  "interference_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_recv);
975
976  "interference_send_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send_recv);
977  "interference_send_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send_recv);
978
979  "max_outgoing_rate"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_max_outgoing_rate);
980  "max_outgoing_rate"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_max_outgoing_rate);
981
982  "vivaldi"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_vivaldi);
983  "vivaldi"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_vivaldi);
984
985  ">" {
986   if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
987   if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element.");
988   LEAVE; STag_surfxml_host();surfxml_pcdata_ix = 0; ENTER(S_surfxml_host);
989  }
990  "/>" {
991   if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
992   if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element.");
993   LEAVE; STag_surfxml_host(); surfxml_pcdata_ix = 0; ETag_surfxml_host(); popbuffer(); /* attribute */
994   switch (YY_START) {
995    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
996    case S_surfxml_foreach: SET(S_surfxml_foreach_1); break;
997   }
998  }
999  .       FAIL("Unexpected character `%c' in attribute list of host element.", yytext[0]);
1000  {Name} FAIL("Bad attribute `%s' in `host' element start tag.",yytext);
1001  <<EOF>> FAIL("EOF in attribute list of `host' element.");
1002 }
1003
1004 <S_surfxml_host,E_surfxml_host,S_surfxml_host_2>{
1005  "</host"{s}">" {
1006   LEAVE;
1007   ETag_surfxml_host();
1008   popbuffer(); /* attribute */
1009   switch (YY_START) {
1010    case S_surfxml_platform_2: case S_surfxml_platform_3: case S_surfxml_platform: SET(S_surfxml_platform_3); break;
1011    case S_surfxml_foreach: SET(S_surfxml_foreach_1); break;
1012   }
1013  }
1014  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</host>' expected.",yytext);
1015  .       FAIL("Unexpected character `%c': `</host>' expected.",yytext[0]);
1016  <<EOF>> FAIL("Premature EOF: `</host>' expected.");
1017 }
1018
1019 <S_surfxml_route_c_multi_1,E_surfxml_process,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,ROOT_surfxml_prop,S_surfxml_platform_3,S_surfxml_route_1,E_surfxml_host,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,S_surfxml_platform_4,S_surfxml_route_c_multi,S_surfxml_platform_2,S_surfxml_route_c_multi_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_route>"<prop"{s} FAIL("Starting tag <prop> is not allowed here.");
1020
1021 <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} {
1022   AX_surfxml_prop_id = 0;
1023   AX_surfxml_prop_value = 0;
1024   ENTER(AL_surfxml_prop); pushbuffer(0);
1025   }
1026
1027 <AL_surfxml_prop>{
1028  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_id);
1029  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_id);
1030
1031  "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_value);
1032  "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_value);
1033
1034  ">" {
1035   if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
1036   if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element.");
1037   LEAVE; STag_surfxml_prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_prop);
1038  }
1039  "/>" {
1040   if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
1041   if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element.");
1042   LEAVE; STag_surfxml_prop(); surfxml_pcdata_ix = 0; ETag_surfxml_prop(); popbuffer(); /* attribute */
1043   switch (YY_START) {
1044    case S_surfxml_random: case S_surfxml_random_2: case S_surfxml_random_1: SET(S_surfxml_random_2); break;
1045    case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1046    case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
1047    case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
1048   }
1049  }
1050  .       FAIL("Unexpected character `%c' in attribute list of prop element.", yytext[0]);
1051  {Name} FAIL("Bad attribute `%s' in `prop' element start tag.",yytext);
1052  <<EOF>> FAIL("EOF in attribute list of `prop' element.");
1053 }
1054
1055 <E_surfxml_prop>{
1056  "</prop"{s}">" {
1057   LEAVE;
1058   ETag_surfxml_prop();
1059   popbuffer(); /* attribute */
1060   switch (YY_START) {
1061    case S_surfxml_random: case S_surfxml_random_2: case S_surfxml_random_1: SET(S_surfxml_random_2); break;
1062    case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1063    case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
1064    case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
1065   }
1066  }
1067  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</prop>' expected.",yytext);
1068  .       FAIL("Unexpected character `%c': `</prop>' expected.",yytext[0]);
1069  <<EOF>> FAIL("Premature EOF: `</prop>' expected.");
1070 }
1071
1072 <S_surfxml_route_c_multi_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_random_2,S_surfxml_process_2,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,ROOT_surfxml_cluster,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_c_multi,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_route>"<cluster"{s} FAIL("Starting tag <cluster> is not allowed here.");
1073
1074 <S_surfxml_platform_2,S_surfxml_platform,S_surfxml_platform_3>"<cluster"{s} {
1075   AX_surfxml_cluster_id = 0;
1076   AX_surfxml_cluster_prefix = 0;
1077   AX_surfxml_cluster_suffix = 0;
1078   AX_surfxml_cluster_radical = 0;
1079   AX_surfxml_cluster_power = 0;
1080   AX_surfxml_cluster_bw = 0;
1081   AX_surfxml_cluster_lat = 0;
1082   AX_surfxml_cluster_bb_bw = 0;
1083   AX_surfxml_cluster_bb_lat = 0;
1084   ENTER(AL_surfxml_cluster); pushbuffer(0);
1085   }
1086
1087 <AL_surfxml_cluster>{
1088  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_id);
1089  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_id);
1090
1091  "prefix"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_prefix);
1092  "prefix"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_prefix);
1093
1094  "suffix"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_suffix);
1095  "suffix"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_suffix);
1096
1097  "radical"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_radical);
1098  "radical"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_radical);
1099
1100  "power"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_power);
1101  "power"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_power);
1102
1103  "bw"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bw);
1104  "bw"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bw);
1105
1106  "lat"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_lat);
1107  "lat"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_lat);
1108
1109  "bb_bw"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb_bw);
1110  "bb_bw"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb_bw);
1111
1112  "bb_lat"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb_lat);
1113  "bb_lat"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb_lat);
1114
1115  ">" {
1116   if (!AX_surfxml_cluster_id) FAIL("Required attribute `id' not set for `cluster' element.");
1117   if (!AX_surfxml_cluster_prefix) FAIL("Required attribute `prefix' not set for `cluster' element.");
1118   if (!AX_surfxml_cluster_suffix) FAIL("Required attribute `suffix' not set for `cluster' element.");
1119   if (!AX_surfxml_cluster_radical) FAIL("Required attribute `radical' not set for `cluster' element.");
1120   if (!AX_surfxml_cluster_power) FAIL("Required attribute `power' not set for `cluster' element.");
1121   if (!AX_surfxml_cluster_bw) FAIL("Required attribute `bw' not set for `cluster' element.");
1122   if (!AX_surfxml_cluster_lat) FAIL("Required attribute `lat' not set for `cluster' element.");
1123   if (!AX_surfxml_cluster_bb_bw) FAIL("Required attribute `bb_bw' not set for `cluster' element.");
1124   if (!AX_surfxml_cluster_bb_lat) FAIL("Required attribute `bb_lat' not set for `cluster' element.");
1125   LEAVE; STag_surfxml_cluster();surfxml_pcdata_ix = 0; ENTER(E_surfxml_cluster);
1126  }
1127  "/>" {
1128   if (!AX_surfxml_cluster_id) FAIL("Required attribute `id' not set for `cluster' element.");
1129   if (!AX_surfxml_cluster_prefix) FAIL("Required attribute `prefix' not set for `cluster' element.");
1130   if (!AX_surfxml_cluster_suffix) FAIL("Required attribute `suffix' not set for `cluster' element.");
1131   if (!AX_surfxml_cluster_radical) FAIL("Required attribute `radical' not set for `cluster' element.");
1132   if (!AX_surfxml_cluster_power) FAIL("Required attribute `power' not set for `cluster' element.");
1133   if (!AX_surfxml_cluster_bw) FAIL("Required attribute `bw' not set for `cluster' element.");
1134   if (!AX_surfxml_cluster_lat) FAIL("Required attribute `lat' not set for `cluster' element.");
1135   if (!AX_surfxml_cluster_bb_bw) FAIL("Required attribute `bb_bw' not set for `cluster' element.");
1136   if (!AX_surfxml_cluster_bb_lat) FAIL("Required attribute `bb_lat' not set for `cluster' element.");
1137   LEAVE; STag_surfxml_cluster(); surfxml_pcdata_ix = 0; ETag_surfxml_cluster(); popbuffer(); /* attribute */
1138   switch (YY_START) {
1139    case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1140   }
1141  }
1142  .       FAIL("Unexpected character `%c' in attribute list of cluster element.", yytext[0]);
1143  {Name} FAIL("Bad attribute `%s' in `cluster' element start tag.",yytext);
1144  <<EOF>> FAIL("EOF in attribute list of `cluster' element.");
1145 }
1146
1147 <E_surfxml_cluster>{
1148  "</cluster"{s}">" {
1149   LEAVE;
1150   ETag_surfxml_cluster();
1151   popbuffer(); /* attribute */
1152   switch (YY_START) {
1153    case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1154   }
1155  }
1156  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</cluster>' expected.",yytext);
1157  .       FAIL("Unexpected character `%c': `</cluster>' expected.",yytext[0]);
1158  <<EOF>> FAIL("Premature EOF: `</cluster>' expected.");
1159 }
1160
1161 <S_surfxml_route_c_multi_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_random_2,S_surfxml_process_2,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_c_multi,S_surfxml_host,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_route,ROOT_surfxml_router>"<router"{s} FAIL("Starting tag <router> is not allowed here.");
1162
1163 <S_surfxml_platform_2,S_surfxml_platform,S_surfxml_platform_3>"<router"{s} {
1164   AX_surfxml_router_id = 0;
1165   ENTER(AL_surfxml_router); pushbuffer(0);
1166   }
1167
1168 <AL_surfxml_router>{
1169  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_router_id);
1170  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_router_id);
1171
1172  ">" {
1173   if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
1174   LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router);
1175  }
1176  "/>" {
1177   if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
1178   LEAVE; STag_surfxml_router(); surfxml_pcdata_ix = 0; ETag_surfxml_router(); popbuffer(); /* attribute */
1179   switch (YY_START) {
1180    case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1181   }
1182  }
1183  .       FAIL("Unexpected character `%c' in attribute list of router element.", yytext[0]);
1184  {Name} FAIL("Bad attribute `%s' in `router' element start tag.",yytext);
1185  <<EOF>> FAIL("EOF in attribute list of `router' element.");
1186 }
1187
1188 <E_surfxml_router>{
1189  "</router"{s}">" {
1190   LEAVE;
1191   ETag_surfxml_router();
1192   popbuffer(); /* attribute */
1193   switch (YY_START) {
1194    case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1195   }
1196  }
1197  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</router>' expected.",yytext);
1198  .       FAIL("Unexpected character `%c': `</router>' expected.",yytext[0]);
1199  <<EOF>> FAIL("Premature EOF: `</router>' expected.");
1200 }
1201
1202 <S_surfxml_route_c_multi_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_random_2,S_surfxml_process_2,E_surfxml_link,S_surfxml_platform_1,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_c_multi,S_surfxml_host,ROOT_surfxml_link,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_route>"<link"{s} FAIL("Starting tag <link> is not allowed here.");
1203
1204 <S_surfxml_foreach,S_surfxml_platform_2,S_surfxml_platform,S_surfxml_foreach_1,S_surfxml_platform_3>"<link"{s} {
1205   AX_surfxml_link_id = 0;
1206   AX_surfxml_link_bandwidth = 0;
1207   AX_surfxml_link_bandwidth_file = 0;
1208   AX_surfxml_link_latency = 96;
1209   AX_surfxml_link_latency_file = 0;
1210   AX_surfxml_link_state = A_surfxml_link_state_ON;
1211   AX_surfxml_link_state_file = 0;
1212   AX_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
1213   ENTER(AL_surfxml_link); pushbuffer(0);
1214   }
1215
1216 <AL_surfxml_link>{
1217  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_id);
1218  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_id);
1219
1220  "bandwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth);
1221  "bandwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth);
1222
1223  "bandwidth_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth_file);
1224  "bandwidth_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth_file);
1225
1226  "latency"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency);
1227  "latency"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency);
1228
1229  "latency_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency_file);
1230  "latency_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency_file);
1231
1232  "state"{Eq}"'ON'" |
1233  "state"{Eq}"\"ON\"" A_surfxml_link_state = A_surfxml_link_state_ON;
1234  "state"{Eq}"'OFF'" |
1235  "state"{Eq}"\"OFF\"" A_surfxml_link_state = A_surfxml_link_state_OFF;
1236
1237  "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_state_file);
1238  "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_state_file);
1239
1240  "sharing_policy"{Eq}"'SHARED'" |
1241  "sharing_policy"{Eq}"\"SHARED\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
1242  "sharing_policy"{Eq}"'FATPIPE'" |
1243  "sharing_policy"{Eq}"\"FATPIPE\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FATPIPE;
1244
1245  ">" {
1246   if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
1247   if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
1248   LEAVE; STag_surfxml_link();surfxml_pcdata_ix = 0; ENTER(S_surfxml_link);
1249  }
1250  "/>" {
1251   if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
1252   if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
1253   LEAVE; STag_surfxml_link(); surfxml_pcdata_ix = 0; ETag_surfxml_link(); popbuffer(); /* attribute */
1254   switch (YY_START) {
1255    case S_surfxml_foreach: case S_surfxml_foreach_1: SET(E_surfxml_foreach); break;
1256    case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1257   }
1258  }
1259  .       FAIL("Unexpected character `%c' in attribute list of link element.", yytext[0]);
1260  {Name} FAIL("Bad attribute `%s' in `link' element start tag.",yytext);
1261  <<EOF>> FAIL("EOF in attribute list of `link' element.");
1262 }
1263
1264 <S_surfxml_link_2,E_surfxml_link,S_surfxml_link>{
1265  "</link"{s}">" {
1266   LEAVE;
1267   ETag_surfxml_link();
1268   popbuffer(); /* attribute */
1269   switch (YY_START) {
1270    case S_surfxml_foreach: case S_surfxml_foreach_1: SET(E_surfxml_foreach); break;
1271    case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
1272   }
1273  }
1274  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link>' expected.",yytext);
1275  .       FAIL("Unexpected character `%c': `</link>' expected.",yytext[0]);
1276  <<EOF>> FAIL("Premature EOF: `</link>' expected.");
1277 }
1278
1279 <S_surfxml_route_c_multi_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,ROOT_surfxml_route_c_multi,S_surfxml_random_2,S_surfxml_process_2,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,S_surfxml_random_1,S_surfxml_route_c_multi,S_surfxml_host,S_surfxml_platform_2,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,E_surfxml_foreach,S_surfxml_route>"<route:multi"{s} FAIL("Starting tag <route:multi> is not allowed here.");
1280
1281 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_platform_3,S_surfxml_platform_4>"<route:multi"{s} {
1282   AX_surfxml_route_c_multi_src = 0;
1283   AX_surfxml_route_c_multi_dst = 0;
1284   AX_surfxml_route_c_multi_action = A_surfxml_route_c_multi_action_POSTPEND;
1285   AX_surfxml_route_c_multi_symmetric = A_surfxml_route_c_multi_symmetric_YES;
1286   ENTER(AL_surfxml_route_c_multi); pushbuffer(0);
1287   }
1288
1289 <AL_surfxml_route_c_multi>{
1290  "src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_c_multi_src);
1291  "src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_c_multi_src);
1292
1293  "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_c_multi_dst);
1294  "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_c_multi_dst);
1295
1296  "action"{Eq}"'POSTPEND'" |
1297  "action"{Eq}"\"POSTPEND\"" A_surfxml_route_c_multi_action = A_surfxml_route_c_multi_action_POSTPEND;
1298  "action"{Eq}"'PREPEND'" |
1299  "action"{Eq}"\"PREPEND\"" A_surfxml_route_c_multi_action = A_surfxml_route_c_multi_action_PREPEND;
1300  "action"{Eq}"'OVERRIDE'" |
1301  "action"{Eq}"\"OVERRIDE\"" A_surfxml_route_c_multi_action = A_surfxml_route_c_multi_action_OVERRIDE;
1302
1303  "symmetric"{Eq}"'YES'" |
1304  "symmetric"{Eq}"\"YES\"" A_surfxml_route_c_multi_symmetric = A_surfxml_route_c_multi_symmetric_YES;
1305  "symmetric"{Eq}"'NO'" |
1306  "symmetric"{Eq}"\"NO\"" A_surfxml_route_c_multi_symmetric = A_surfxml_route_c_multi_symmetric_NO;
1307
1308  ">" {
1309   if (!AX_surfxml_route_c_multi_src) FAIL("Required attribute `src' not set for `route:multi' element.");
1310   if (!AX_surfxml_route_c_multi_dst) FAIL("Required attribute `dst' not set for `route:multi' element.");
1311   LEAVE; STag_surfxml_route_c_multi();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route_c_multi);
1312  }
1313  "/>" FAIL("`route:multi' element cannot be empty.");
1314  .       FAIL("Unexpected character `%c' in attribute list of route:multi element.", yytext[0]);
1315  {Name} FAIL("Bad attribute `%s' in `route:multi' element start tag.",yytext);
1316  <<EOF>> FAIL("EOF in attribute list of `route:multi' element.");
1317 }
1318
1319 <S_surfxml_route_c_multi_2,E_surfxml_route_c_multi>{
1320  "</route:multi"{s}">" {
1321   LEAVE;
1322   ETag_surfxml_route_c_multi();
1323   popbuffer(); /* attribute */
1324   switch (YY_START) {
1325    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;
1326   }
1327  }
1328  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route:multi>' expected.",yytext);
1329  .       FAIL("Unexpected character `%c': `</route:multi>' expected.",yytext[0]);
1330  <<EOF>> FAIL("Premature EOF: `</route:multi>' expected.");
1331 }
1332
1333 <S_surfxml_route_c_multi_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,ROOT_surfxml_route,E_surfxml_host,S_surfxml_link,S_surfxml_random_2,S_surfxml_process_2,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,S_surfxml_random_1,S_surfxml_route_c_multi,S_surfxml_host,S_surfxml_platform_2,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,E_surfxml_foreach,S_surfxml_route>"<route"{s} FAIL("Starting tag <route> is not allowed here.");
1334
1335 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_platform_3,S_surfxml_platform_4>"<route"{s} {
1336   AX_surfxml_route_src = 0;
1337   AX_surfxml_route_dst = 0;
1338   AX_surfxml_route_impact_on_src = 100;
1339   AX_surfxml_route_impact_on_dst = 104;
1340   AX_surfxml_route_impact_on_src_with_other_recv = 108;
1341   AX_surfxml_route_impact_on_dst_with_other_send = 112;
1342   AX_surfxml_route_action = A_surfxml_route_action_POSTPEND;
1343   ENTER(AL_surfxml_route); pushbuffer(0);
1344   }
1345
1346 <AL_surfxml_route>{
1347  "src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src);
1348  "src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src);
1349
1350  "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst);
1351  "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst);
1352
1353  "impact_on_src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src);
1354  "impact_on_src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src);
1355
1356  "impact_on_dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst);
1357  "impact_on_dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst);
1358
1359  "impact_on_src_with_other_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
1360  "impact_on_src_with_other_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv);
1361
1362  "impact_on_dst_with_other_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
1363  "impact_on_dst_with_other_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send);
1364
1365  "action"{Eq}"'POSTPEND'" |
1366  "action"{Eq}"\"POSTPEND\"" A_surfxml_route_action = A_surfxml_route_action_POSTPEND;
1367  "action"{Eq}"'PREPEND'" |
1368  "action"{Eq}"\"PREPEND\"" A_surfxml_route_action = A_surfxml_route_action_PREPEND;
1369  "action"{Eq}"'OVERRIDE'" |
1370  "action"{Eq}"\"OVERRIDE\"" A_surfxml_route_action = A_surfxml_route_action_OVERRIDE;
1371
1372  ">" {
1373   if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
1374   if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
1375   LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route);
1376  }
1377  "/>" {
1378   if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
1379   if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
1380   LEAVE; STag_surfxml_route(); surfxml_pcdata_ix = 0; ETag_surfxml_route(); popbuffer(); /* attribute */
1381   switch (YY_START) {
1382    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;
1383   }
1384  }
1385  .       FAIL("Unexpected character `%c' in attribute list of route element.", yytext[0]);
1386  {Name} FAIL("Bad attribute `%s' in `route' element start tag.",yytext);
1387  <<EOF>> FAIL("EOF in attribute list of `route' element.");
1388 }
1389
1390 <S_surfxml_route,S_surfxml_route_2,E_surfxml_route>{
1391  "</route"{s}">" {
1392   LEAVE;
1393   ETag_surfxml_route();
1394   popbuffer(); /* attribute */
1395   switch (YY_START) {
1396    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;
1397   }
1398  }
1399  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</route>' expected.",yytext);
1400  .       FAIL("Unexpected character `%c': `</route>' expected.",yytext[0]);
1401  <<EOF>> FAIL("Premature EOF: `</route>' expected.");
1402 }
1403
1404 <S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,ROOT_surfxml_link_c_ctn,E_surfxml_route,S_surfxml_platform_3,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_random_2,S_surfxml_process_2,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_host_1,E_surfxml_platform,S_surfxml_foreach,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_host,S_surfxml_platform_2,S_surfxml_process_1,S_surfxml_host_2,S_surfxml_platform_5,E_surfxml_foreach>"<link:ctn"{s} FAIL("Starting tag <link:ctn> is not allowed here.");
1405
1406 <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} {
1407   AX_surfxml_link_c_ctn_id = 0;
1408   ENTER(AL_surfxml_link_c_ctn); pushbuffer(0);
1409   }
1410
1411 <AL_surfxml_link_c_ctn>{
1412  "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_c_ctn_id);
1413  "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_c_ctn_id);
1414
1415  ">" {
1416   if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element.");
1417   LEAVE; STag_surfxml_link_c_ctn();surfxml_pcdata_ix = 0; ENTER(E_surfxml_link_c_ctn);
1418  }
1419  "/>" {
1420   if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element.");
1421   LEAVE; STag_surfxml_link_c_ctn(); surfxml_pcdata_ix = 0; ETag_surfxml_link_c_ctn(); popbuffer(); /* attribute */
1422   switch (YY_START) {
1423    case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
1424    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;
1425   }
1426  }
1427  .       FAIL("Unexpected character `%c' in attribute list of link:ctn element.", yytext[0]);
1428  {Name} FAIL("Bad attribute `%s' in `link:ctn' element start tag.",yytext);
1429  <<EOF>> FAIL("EOF in attribute list of `link:ctn' element.");
1430 }
1431
1432 <E_surfxml_link_c_ctn>{
1433  "</link:ctn"{s}">" {
1434   LEAVE;
1435   ETag_surfxml_link_c_ctn();
1436   popbuffer(); /* attribute */
1437   switch (YY_START) {
1438    case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
1439    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;
1440   }
1441  }
1442  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</link:ctn>' expected.",yytext);
1443  .       FAIL("Unexpected character `%c': `</link:ctn>' expected.",yytext[0]);
1444  <<EOF>> FAIL("Premature EOF: `</link:ctn>' expected.");
1445 }
1446
1447 <S_surfxml_route_c_multi_1,S_surfxml_random,E_surfxml_process,S_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_random_2,S_surfxml_process_2,S_surfxml_foreach_1,ROOT_surfxml_process,E_surfxml_link,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,S_surfxml_random_1,S_surfxml_route_c_multi,S_surfxml_host,S_surfxml_platform_2,S_surfxml_process_1,S_surfxml_route_c_multi_2,S_surfxml_host_2,E_surfxml_foreach,S_surfxml_route>"<process"{s} FAIL("Starting tag <process> is not allowed here.");
1448
1449 <S_surfxml_platform_5,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_platform_3,S_surfxml_platform_4>"<process"{s} {
1450   AX_surfxml_process_host = 0;
1451   AX_surfxml_process_function = 0;
1452   AX_surfxml_process_start_time = 116;
1453   AX_surfxml_process_kill_time = 121;
1454   ENTER(AL_surfxml_process); pushbuffer(0);
1455   }
1456
1457 <AL_surfxml_process>{
1458  "host"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host);
1459  "host"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host);
1460
1461  "function"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function);
1462  "function"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function);
1463
1464  "start_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start_time);
1465  "start_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start_time);
1466
1467  "kill_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill_time);
1468  "kill_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill_time);
1469
1470  ">" {
1471   if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
1472   if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
1473   LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process);
1474  }
1475  "/>" {
1476   if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
1477   if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
1478   LEAVE; STag_surfxml_process(); surfxml_pcdata_ix = 0; ETag_surfxml_process(); popbuffer(); /* attribute */
1479   switch (YY_START) {
1480    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;
1481   }
1482  }
1483  .       FAIL("Unexpected character `%c' in attribute list of process element.", yytext[0]);
1484  {Name} FAIL("Bad attribute `%s' in `process' element start tag.",yytext);
1485  <<EOF>> FAIL("EOF in attribute list of `process' element.");
1486 }
1487
1488 <S_surfxml_process,E_surfxml_process,S_surfxml_process_2>{
1489  "</process"{s}">" {
1490   LEAVE;
1491   ETag_surfxml_process();
1492   popbuffer(); /* attribute */
1493   switch (YY_START) {
1494    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;
1495   }
1496  }
1497  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</process>' expected.",yytext);
1498  .       FAIL("Unexpected character `%c': `</process>' expected.",yytext[0]);
1499  <<EOF>> FAIL("Premature EOF: `</process>' expected.");
1500 }
1501
1502 <S_surfxml_route_c_multi_1,S_surfxml_random,ROOT_surfxml_argument,E_surfxml_process,S_surfxml_link_2,E_surfxml_route_c_multi,E_surfxml_random,E_surfxml_route,S_surfxml_platform_3,S_surfxml_route_1,S_surfxml_link_1,E_surfxml_host,S_surfxml_link,S_surfxml_random_2,S_surfxml_foreach_1,E_surfxml_link,S_surfxml_platform_1,S_surfxml_platform,S_surfxml_host_1,S_surfxml_route_2,E_surfxml_platform,S_surfxml_foreach,S_surfxml_random_1,S_surfxml_platform_4,S_surfxml_route_c_multi,S_surfxml_host,S_surfxml_platform_2,S_surfxml_route_c_multi_2,S_surfxml_host_2,S_surfxml_platform_5,E_surfxml_foreach,S_surfxml_route>"<argument"{s} FAIL("Starting tag <argument> is not allowed here.");
1503
1504 <S_surfxml_process_1,S_surfxml_process,S_surfxml_process_2>"<argument"{s} {
1505   AX_surfxml_argument_value = 0;
1506   ENTER(AL_surfxml_argument); pushbuffer(0);
1507   }
1508
1509 <AL_surfxml_argument>{
1510  "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_argument_value);
1511  "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_argument_value);
1512
1513  ">" {
1514   if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
1515   LEAVE; STag_surfxml_argument();surfxml_pcdata_ix = 0; ENTER(E_surfxml_argument);
1516  }
1517  "/>" {
1518   if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
1519   LEAVE; STag_surfxml_argument(); surfxml_pcdata_ix = 0; ETag_surfxml_argument(); popbuffer(); /* attribute */
1520   switch (YY_START) {
1521    case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1522   }
1523  }
1524  .       FAIL("Unexpected character `%c' in attribute list of argument element.", yytext[0]);
1525  {Name} FAIL("Bad attribute `%s' in `argument' element start tag.",yytext);
1526  <<EOF>> FAIL("EOF in attribute list of `argument' element.");
1527 }
1528
1529 <E_surfxml_argument>{
1530  "</argument"{s}">" {
1531   LEAVE;
1532   ETag_surfxml_argument();
1533   popbuffer(); /* attribute */
1534   switch (YY_START) {
1535    case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
1536   }
1537  }
1538  "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</argument>' expected.",yytext);
1539  .       FAIL("Unexpected character `%c': `</argument>' expected.",yytext[0]);
1540  <<EOF>> FAIL("Premature EOF: `</argument>' expected.");
1541 }
1542
1543  /* EPILOG: after the root element. */
1544
1545 <EPILOG>{
1546  . {SET(PROLOG); yyless(0); CLEANUP; return -1;}
1547  <<EOF>>        SUCCEED;
1548 }
1549
1550  /* CHARACTER DATA. */
1551
1552 <IN_trace,VALUE1,VALUE2>{
1553  /* Non-defined standard entities... */
1554 "&amp;"  BUFFERPUTC('&');
1555 "&lt;"   BUFFERPUTC('<');
1556 "&gt;"   BUFFERPUTC('>');
1557 "&apos;" BUFFERPUTC('\'');
1558 "&quot;" BUFFERPUTC('"');
1559
1560  /* Character entities. */
1561  "&#"[[:digit:]]+";"    BUFFERPUTC((unsigned char)atoi(yytext+2));
1562  "&#x"[[:xdigit:]]+";"  BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
1563 }
1564
1565 <IN_trace,VALUE1,VALUE2,CDATA>{
1566  "\n"           |
1567  "\r"           |
1568  "\r\n"         |
1569  "\n\r"         BUFFERPUTC('\n');
1570 }
1571
1572 <IN_trace>{
1573  "<![CDATA["    ENTER(CDATA);
1574  "]""]>"                FAIL("Unexpected `]""]>' in character data.");
1575 }
1576
1577 <VALUE1>{
1578  \'             BUFFERDONE; LEAVE;
1579  <<EOF>>        FAIL("EOF in literal (\"'\" expected).");
1580 }
1581
1582 <VALUE2>{
1583  \"             BUFFERDONE; LEAVE;
1584  <<EOF>>        FAIL("EOF in literal (`\"' expected).");
1585 }
1586
1587 <IN_trace,VALUE1,VALUE2>{
1588  [^<&]          BUFFERPUTC(yytext[0]);
1589  [<&]           FAIL("Spurious `%c' in character data.",yytext[0]);
1590 }
1591
1592 <CDATA>{
1593  "]""]>"                LEAVE;
1594  /* "]""]"              BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]); */
1595  .              BUFFERPUTC(yytext[0]);
1596  <<EOF>>        FAIL("EOF in CDATA section.");
1597 }
1598
1599  /* Impossible rules to avoid warnings from flex(1). */
1600  /* Ideally, this should be replaced by code in flexml.pl that
1601     generates just the states not covered by other rules. */
1602 <*>{
1603  .|[\n] FAIL("Syntax error on character `%c'.", yytext[0]);
1604 }
1605
1606 %%
1607
1608 /* Element context stack lookup. */
1609 int surfxml_element_context(int i)
1610 {
1611   return (0<i && i<yy_start_stack_depth
1612           ? yy_start_stack[yy_start_stack_ptr - i]
1613           : 0);
1614 }
1615
1616 #ifdef FLEX_DEBUG
1617 void print_yy_stack(char* fmt, ...)
1618 {
1619   int i = 0; va_list ap; va_start(ap, fmt);
1620   vfprintf(stderr, fmt, ap);
1621   if (surfxml_statenames) {
1622       for (i=1; i<yy_start_stack_ptr; i++) {
1623           fprintf(stderr, "%s/", surfxml_statenames[yy_start_stack[i] ]);
1624       }
1625       fprintf(stderr,"%s\n", surfxml_statenames[YY_START]);
1626   }
1627   va_end(ap);
1628 }
1629
1630 void print_surfxml_bufferstack()
1631 {
1632     int i;
1633     fputs("Buffer: ", stderr);
1634     for (i = 0; i < blimit; i++) {
1635        if ( surfxml_bufferstack[i] == '\377' ) break;
1636          putc(surfxml_bufferstack[i], stderr);
1637     }
1638     putc('\n', stderr);
1639 }
1640
1641 static void debug_enter(int state, const char* statename) {
1642   yy_push_state(state);
1643   if (yy_flex_debug) {
1644        print_yy_stack("--ENTER(%s) : ",statename);
1645        print_surfxml_bufferstack();
1646   }
1647 }
1648
1649 static void debug_leave(void) {
1650     if (yy_flex_debug) {
1651         print_yy_stack("--LEAVE : ");
1652         print_surfxml_bufferstack();
1653     }
1654   yy_pop_state();
1655 }
1656
1657 static void debug_set(int state, const char* statename) {
1658   BEGIN(state);
1659   if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename);
1660 }
1661 #endif
1662
1663
1664 static void cleanup(void)
1665 {
1666     if (surfxml_statenames) {
1667         free(surfxml_statenames);
1668         surfxml_statenames = NULL;
1669     }
1670     free(surfxml_bufferstack);
1671     surfxml_bufferstack = NULL;
1672
1673     free(indexstack);
1674     indexstack = NULL;
1675 }
1676
1677
1678 static int fail(const char* fmt, ...)
1679 {
1680     int chars_left, used;
1681     va_list ap; va_start(ap, fmt);
1682 #ifdef FLEXML_yylineno
1683     used = sprintf(flexml_err_msg,
1684                    "Invalid XML (XML input line %d, state %d): ",
1685                    yylineno, YY_START);
1686 #else
1687     used = sprintf(flexml_err_msg,
1688                    "Invalid XML (state %d): ",
1689                    YY_START);
1690 #endif
1691     chars_left = flexml_max_err_msg_size - used - 1;
1692     vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
1693     va_end(ap);
1694
1695 #ifndef FLEXML_quiet_parser
1696     /* print directly to sdterr */
1697     fprintf(stderr, "%s\n", flexml_err_msg);
1698     flexml_err_msg[0] = '\0';
1699 #endif
1700
1701     cleanup();
1702
1703     return 1;
1704 }