Logo AND Algorithmique Numérique Distribuée

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