/* Validating XML processor for surf/surfxml.dtd. * Generated 2007/10/23 11:08:07. * * This program was generated with the FleXML XML processor generator. * FleXML is Copyright (C) 1999-2005 Kristoffer Rose. All rights reserved. * FleXML is Copyright (C) 2003-2006 Martin Quinson. All rights reserved. * (Id: flexml.pl,v 1.61 2006/09/13 16:34:33 wdowling Exp). * * There are two, intertwined parts to this program, part A and part B. * * Part A * ------ * * Some parts, here collectively called "Part A", are found in the * FleXML package. They are Copyright (C) 1999-2005 Kristoffer Rose * and Copyright (C) 2003-2006 Martin Quinson. All rights reserved. * * You can redistribute, use, perform, display and/or modify "Part A" * provided the following two conditions hold: * * 1. The program is distributed WITHOUT ANY WARRANTY from the author of * FleXML; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. * * 2. The program distribution conditions do not in any way affect the * distribution conditions of the FleXML system used to generate this * file or any version of FleXML derived from that system. * * Notice that these are explicit rights granted to you for files * generated by the FleXML system. For your rights in connection with * the FleXML system itself please consult the GNU General Public License. * * Part B * ------ * * The other parts, here collectively called "Part B", and which came * from the DTD used by FleXML to generate this program, can be * distributed (or not, as the case may be) under the terms of whoever * wrote them, provided these terms respect and obey the two conditions * above under the heading "Part A". * * The author of and contributors to FleXML specifically disclaim * any copyright interest in "Part B", unless "Part B" was written * by the author of or contributors to FleXML. * */ %{ /* Version strings. */ const char rcs_surfxml_flexml_skeleton[] = "$" "Id: skel,v 1.38 2006/09/12 18:05:45 wdowling Exp $"; const char rcs_surfxml_flexml[] = "$" "Id: flexml.pl,v 1.61 2006/09/13 16:34:33 wdowling Exp $"; /* ANSI headers. */ #include #include #include #include #include #include #ifndef FLEXML_INDEXSTACKSIZE #define FLEXML_INDEXSTACKSIZE 1000 #endif /* Generated definitions. */ #define FLEXML_yylineno #ifndef FLEXML_BUFFERSTACKSIZE #define FLEXML_BUFFERSTACKSIZE 1000000 #endif #define FLEXML_NEED_BUFFERLIT /* XML processor api. */ /* FleXML-provided data. */ int surfxml_pcdata_ix; extern char *surfxml_bufferstack; #define surfxml_pcdata (surfxml_bufferstack + surfxml_pcdata_ix) AT_surfxml_link_id AX_surfxml_link_id; #define A_surfxml_link_id (surfxml_bufferstack + AX_surfxml_link_id) AT_surfxml_prop_id AX_surfxml_prop_id; #define A_surfxml_prop_id (surfxml_bufferstack + AX_surfxml_prop_id) AT_surfxml_host_interference_recv AX_surfxml_host_interference_recv; #define A_surfxml_host_interference_recv (surfxml_bufferstack + AX_surfxml_host_interference_recv) AT_surfxml_host_id AX_surfxml_host_id; #define A_surfxml_host_id (surfxml_bufferstack + AX_surfxml_host_id) AT_surfxml_link_latency_file AX_surfxml_link_latency_file; #define A_surfxml_link_latency_file (surfxml_bufferstack + AX_surfxml_link_latency_file) AT_surfxml_process_host AX_surfxml_process_host; #define A_surfxml_process_host (surfxml_bufferstack + AX_surfxml_process_host) AT_surfxml_host_availability_file AX_surfxml_host_availability_file; #define A_surfxml_host_availability_file (surfxml_bufferstack + AX_surfxml_host_availability_file) AT_surfxml_host_state AX_surfxml_host_state; #define A_surfxml_host_state AX_surfxml_host_state AT_surfxml_host_interference_send_recv AX_surfxml_host_interference_send_recv; #define A_surfxml_host_interference_send_recv (surfxml_bufferstack + AX_surfxml_host_interference_send_recv) AT_surfxml_route_impact_on_dst_with_other_send AX_surfxml_route_impact_on_dst_with_other_send; #define A_surfxml_route_impact_on_dst_with_other_send (surfxml_bufferstack + AX_surfxml_route_impact_on_dst_with_other_send) AT_surfxml_host_interference_send AX_surfxml_host_interference_send; #define A_surfxml_host_interference_send (surfxml_bufferstack + AX_surfxml_host_interference_send) AT_surfxml_route_impact_on_dst AX_surfxml_route_impact_on_dst; #define A_surfxml_route_impact_on_dst (surfxml_bufferstack + AX_surfxml_route_impact_on_dst) AT_surfxml_platform_description_version AX_surfxml_platform_description_version; #define A_surfxml_platform_description_version (surfxml_bufferstack + AX_surfxml_platform_description_version) AT_surfxml_prop_value AX_surfxml_prop_value; #define A_surfxml_prop_value (surfxml_bufferstack + AX_surfxml_prop_value) AT_surfxml_route_impact_on_src_with_other_recv AX_surfxml_route_impact_on_src_with_other_recv; #define A_surfxml_route_impact_on_src_with_other_recv (surfxml_bufferstack + AX_surfxml_route_impact_on_src_with_other_recv) AT_surfxml_host_power AX_surfxml_host_power; #define A_surfxml_host_power (surfxml_bufferstack + AX_surfxml_host_power) AT_surfxml_link_state_file AX_surfxml_link_state_file; #define A_surfxml_link_state_file (surfxml_bufferstack + AX_surfxml_link_state_file) AT_surfxml_router_id AX_surfxml_router_id; #define A_surfxml_router_id (surfxml_bufferstack + AX_surfxml_router_id) AT_surfxml_process_start_time AX_surfxml_process_start_time; #define A_surfxml_process_start_time (surfxml_bufferstack + AX_surfxml_process_start_time) AT_surfxml_process_function AX_surfxml_process_function; #define A_surfxml_process_function (surfxml_bufferstack + AX_surfxml_process_function) AT_surfxml_host_max_outgoing_rate AX_surfxml_host_max_outgoing_rate; #define A_surfxml_host_max_outgoing_rate (surfxml_bufferstack + AX_surfxml_host_max_outgoing_rate) AT_surfxml_link_sharing_policy AX_surfxml_link_sharing_policy; #define A_surfxml_link_sharing_policy AX_surfxml_link_sharing_policy AT_surfxml_link_c_ctn_id AX_surfxml_link_c_ctn_id; #define A_surfxml_link_c_ctn_id (surfxml_bufferstack + AX_surfxml_link_c_ctn_id) AT_surfxml_process_kill_time AX_surfxml_process_kill_time; #define A_surfxml_process_kill_time (surfxml_bufferstack + AX_surfxml_process_kill_time) AT_surfxml_host_availability AX_surfxml_host_availability; #define A_surfxml_host_availability (surfxml_bufferstack + AX_surfxml_host_availability) AT_surfxml_argument_value AX_surfxml_argument_value; #define A_surfxml_argument_value (surfxml_bufferstack + AX_surfxml_argument_value) AT_surfxml_link_state AX_surfxml_link_state; #define A_surfxml_link_state AX_surfxml_link_state AT_surfxml_route_src AX_surfxml_route_src; #define A_surfxml_route_src (surfxml_bufferstack + AX_surfxml_route_src) AT_surfxml_route_impact_on_src AX_surfxml_route_impact_on_src; #define A_surfxml_route_impact_on_src (surfxml_bufferstack + AX_surfxml_route_impact_on_src) AT_surfxml_link_bandwidth AX_surfxml_link_bandwidth; #define A_surfxml_link_bandwidth (surfxml_bufferstack + AX_surfxml_link_bandwidth) AT_surfxml_link_latency AX_surfxml_link_latency; #define A_surfxml_link_latency (surfxml_bufferstack + AX_surfxml_link_latency) AT_surfxml_include_file AX_surfxml_include_file; #define A_surfxml_include_file (surfxml_bufferstack + AX_surfxml_include_file) AT_surfxml_link_bandwidth_file AX_surfxml_link_bandwidth_file; #define A_surfxml_link_bandwidth_file (surfxml_bufferstack + AX_surfxml_link_bandwidth_file) AT_surfxml_host_state_file AX_surfxml_host_state_file; #define A_surfxml_host_state_file (surfxml_bufferstack + AX_surfxml_host_state_file) AT_surfxml_route_dst AX_surfxml_route_dst; #define A_surfxml_route_dst (surfxml_bufferstack + AX_surfxml_route_dst) /* XML state. */ #ifdef FLEX_DEBUG # define ENTER(state) debug_enter(state,#state) # define LEAVE debug_leave() # define SET(state) debug_set(state,#state) static void debug_enter(int, const char*); static void debug_leave(void); static void debug_set(int, const char*); #else # define ENTER(state) (yy_push_state(state)) # define LEAVE (yy_pop_state()) # define SET(state) BEGIN(state) #endif /* Generic actions. */ #define SKIP /*skip*/ #define SUCCEED CLEANUP; return 0 #define FAIL return fail static int fail(const char*, ...); enum {flexml_max_err_msg_size = 512}; static char flexml_err_msg[flexml_max_err_msg_size]; const char * surfxml_parse_err_msg() { return flexml_err_msg; } static void reset_surfxml_parse_err_msg() { flexml_err_msg[0] = '\0'; } /* Cleanup */ static void cleanup(void); #define CLEANUP cleanup() /* Text buffer stack handling. */ char *surfxml_bufferstack = NULL; static int blimit = FLEXML_BUFFERSTACKSIZE; static int bnext = 1; static int *indexstack = NULL; static int ilimit = FLEXML_INDEXSTACKSIZE; static int inext = 1; #define BUFFERSET(P) (P = bnext) #define BUFFERPUTC(C) (ck_blimit(), surfxml_bufferstack[bnext++] = (C)) #define BUFFERDONE (BUFFERPUTC('\0')) #define BUFFERLITERAL(C, P) surfxml_bufferliteral(C, &(P), yytext) /* after this is called, there are at least 2 slots left in the stack */ static int ck_blimit() { if (bnext >= blimit) { blimit += FLEXML_BUFFERSTACKSIZE + 2; { char *temp = (char *) realloc(surfxml_bufferstack, blimit); assert(temp); surfxml_bufferstack = temp; } } return 0; } /* after this is called, there are at least 2 slots left in the stack */ static int ck_ilimit() { if (inext >= ilimit) { ilimit += FLEXML_INDEXSTACKSIZE + 2; { int *temp = (int *) realloc(indexstack, ilimit); assert(temp); indexstack = temp; } } return 0; } #ifdef FLEXML_NEED_BUFFERLIT static void surfxml_bufferliteral(char c, int* pp, const char* text) { const char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c); assert(s <= e); BUFFERSET(*pp); while (++s= 2); bnext = indexstack[--inext]; return indexstack[--inext]; } /* General internal entities are `unput' back onto the input stream... */ #define ENTITYTEXT(T) \ { char *s = (T), *e = s+strlen(s);\ while (--e >= s) { unput(*e); }} %} /* Flex standard options. */ %option stack %option noyy_top_state %option noinput %option noreject %option noyymore %option noyywrap /* Flex user-requested options. */ %option yylineno %option nounput /* XML character classes (currently restricted to ASCII). */ /* "Common syntactic structures." */ S [ \t\n\r\f]+ s [ \t\n\r\f]* /* "Names and Tokens." */ NameChar [A-Za-z0-9.:_-] Name [A-Za-z_:]{NameChar}* Names {Name}({S}{Name})* Nmtoken ({NameChar})+ Nmtokens {Nmtoken}({S}{Nmtoken})* /* Miscellaneous. */ VersionNum [a-zA-Z0-9_.:-]+ Eq {s}"="{s} Literal \'[^'']*\'|\"[^""]*\" /* Parser states (flex `exclusive start conditions'): * * PROLOG the XML prolog of the document before * DOCTYPE the XML prolog of the document after * EPILOG after the root element * INCOMMENT inside an XML comment * INPI inside an XML PI * VALUE1 inside a '...'-delimited literal * VALUE2 inside a "..."-delimited literal * CDATA inside a section. * ROOT_ expect root element * AL_ inside the attribute list for * IN_ inside a with element contents (ready for end tag) * IMPOSSIBLE dummy to permit disabling rules; must be last */ %x PROLOG DOCTYPE EPILOG INCOMMENT INPI VALUE1 VALUE2 CDATA %x ROOT_surfxml_platform_description AL_surfxml_platform_description S_surfxml_platform_description S_surfxml_platform_description_1 S_surfxml_platform_description_2 S_surfxml_platform_description_3 S_surfxml_platform_description_4 S_surfxml_platform_description_5 S_surfxml_platform_description_6 S_surfxml_platform_description_7 S_surfxml_platform_description_8 S_surfxml_platform_description_9 S_surfxml_platform_description_10 S_surfxml_platform_description_11 S_surfxml_platform_description_12 S_surfxml_platform_description_13 S_surfxml_platform_description_14 S_surfxml_platform_description_15 S_surfxml_platform_description_16 E_surfxml_platform_description %x ROOT_surfxml_include AL_surfxml_include E_surfxml_include %x ROOT_surfxml_host AL_surfxml_host S_surfxml_host S_surfxml_host_1 S_surfxml_host_2 E_surfxml_host %x ROOT_surfxml_prop AL_surfxml_prop E_surfxml_prop %x ROOT_surfxml_router AL_surfxml_router E_surfxml_router %x ROOT_surfxml_link AL_surfxml_link S_surfxml_link S_surfxml_link_1 S_surfxml_link_2 E_surfxml_link %x ROOT_surfxml_route AL_surfxml_route S_surfxml_route S_surfxml_route_1 S_surfxml_route_2 E_surfxml_route %x ROOT_surfxml_link_c_ctn AL_surfxml_link_c_ctn E_surfxml_link_c_ctn %x ROOT_surfxml_process AL_surfxml_process S_surfxml_process S_surfxml_process_1 S_surfxml_process_2 E_surfxml_process %x ROOT_surfxml_argument AL_surfxml_argument E_surfxml_argument %x IMPOSSIBLE %{ /* State names. */ const char* *surfxml_statenames=NULL; %} %% /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ SET(PROLOG); reset_surfxml_parse_err_msg(); surfxml_bufferstack = (char *) malloc(FLEXML_BUFFERSTACKSIZE); assert(surfxml_bufferstack); #ifdef FLEX_DEBUG { int i; for (i = 0; i < blimit; i++) { surfxml_bufferstack[i] = '\377'; } } #endif surfxml_bufferstack[0] = '\0'; indexstack = (int *) malloc(FLEXML_INDEXSTACKSIZE * sizeof(int)); assert(indexstack); indexstack[0] = 0; /* FleXML_init */ bnext = inext = 1; surfxml_bufferliteral('\0', &bnext, "0.0"); surfxml_bufferliteral('\0', &bnext, "1.0"); surfxml_bufferliteral('\0', &bnext, "1.0"); surfxml_bufferliteral('\0', &bnext, "1.0"); surfxml_bufferliteral('\0', &bnext, "1.0"); surfxml_bufferliteral('\0', &bnext, "-1.0"); surfxml_bufferliteral('\0', &bnext, "0.0"); surfxml_bufferliteral('\0', &bnext, "0.0"); surfxml_bufferliteral('\0', &bnext, "0.0"); surfxml_bufferliteral('\0', &bnext, "0.0"); surfxml_bufferliteral('\0', &bnext, "0.0"); surfxml_bufferliteral('\0', &bnext, "-1.0"); surfxml_bufferliteral('\0', &bnext, "-1.0"); if(!surfxml_statenames) {surfxml_statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*)); surfxml_statenames[PROLOG] = NULL; surfxml_statenames[DOCTYPE] = NULL; surfxml_statenames[EPILOG] = NULL; surfxml_statenames[INCOMMENT] = NULL; surfxml_statenames[INPI] = NULL; surfxml_statenames[VALUE1] = NULL; surfxml_statenames[VALUE2] = NULL; surfxml_statenames[CDATA] = NULL; surfxml_statenames[ROOT_surfxml_platform_description] = NULL; surfxml_statenames[AL_surfxml_platform_description] = NULL; surfxml_statenames[S_surfxml_platform_description] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_1] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_2] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_3] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_4] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_5] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_6] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_7] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_8] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_9] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_10] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_11] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_12] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_13] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_14] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_15] = "platform_description"; surfxml_statenames[S_surfxml_platform_description_16] = "platform_description"; surfxml_statenames[E_surfxml_platform_description] = "platform_description"; surfxml_statenames[ROOT_surfxml_include] = NULL; surfxml_statenames[AL_surfxml_include] = NULL; surfxml_statenames[E_surfxml_include] = "include"; surfxml_statenames[ROOT_surfxml_host] = NULL; surfxml_statenames[AL_surfxml_host] = NULL; surfxml_statenames[S_surfxml_host] = "host"; surfxml_statenames[S_surfxml_host_1] = "host"; surfxml_statenames[S_surfxml_host_2] = "host"; surfxml_statenames[E_surfxml_host] = "host"; surfxml_statenames[ROOT_surfxml_prop] = NULL; surfxml_statenames[AL_surfxml_prop] = NULL; surfxml_statenames[E_surfxml_prop] = "prop"; surfxml_statenames[ROOT_surfxml_router] = NULL; surfxml_statenames[AL_surfxml_router] = NULL; surfxml_statenames[E_surfxml_router] = "router"; surfxml_statenames[ROOT_surfxml_link] = NULL; surfxml_statenames[AL_surfxml_link] = NULL; surfxml_statenames[S_surfxml_link] = "link"; surfxml_statenames[S_surfxml_link_1] = "link"; surfxml_statenames[S_surfxml_link_2] = "link"; surfxml_statenames[E_surfxml_link] = "link"; surfxml_statenames[ROOT_surfxml_route] = NULL; surfxml_statenames[AL_surfxml_route] = NULL; surfxml_statenames[S_surfxml_route] = "route"; surfxml_statenames[S_surfxml_route_1] = "route"; surfxml_statenames[S_surfxml_route_2] = "route"; surfxml_statenames[E_surfxml_route] = "route"; surfxml_statenames[ROOT_surfxml_link_c_ctn] = NULL; surfxml_statenames[AL_surfxml_link_c_ctn] = NULL; surfxml_statenames[E_surfxml_link_c_ctn] = "link:ctn"; surfxml_statenames[ROOT_surfxml_process] = NULL; surfxml_statenames[AL_surfxml_process] = NULL; surfxml_statenames[S_surfxml_process] = "process"; surfxml_statenames[S_surfxml_process_1] = "process"; surfxml_statenames[S_surfxml_process_2] = "process"; surfxml_statenames[E_surfxml_process] = "process"; surfxml_statenames[ROOT_surfxml_argument] = NULL; surfxml_statenames[AL_surfxml_argument] = NULL; surfxml_statenames[E_surfxml_argument] = "argument"; } /* COMMENTS and PIs: handled uniformly for efficiency. */ { "" LEAVE; "--" | . | \n SKIP; <> FAIL("EOF in comment."); } { "?>" LEAVE; . | \n SKIP; <> FAIL("EOF in PI (processing instruction)."); } /* SPACES: skipped uniformly */ {S} SKIP; /* PROLOG: determine root element and process it. */ { "" SET(DOCTYPE); "]*">" FAIL("Bad declaration %s.",yytext); } { "" SET(ROOT_surfxml_link); "" SET(ROOT_surfxml_include); "" SET(ROOT_surfxml_route); "" SET(ROOT_surfxml_process); "" SET(ROOT_surfxml_link_c_ctn); "" SET(ROOT_surfxml_router); "" SET(ROOT_surfxml_host); "" SET(ROOT_surfxml_argument); "" SET(ROOT_surfxml_prop); "" SET(ROOT_surfxml_platform_description); "-][^>]*">" FAIL("Bad declaration %s.",yytext); . FAIL("Unexpected character `%c' in prolog.", yytext[0]); <> FAIL("EOF in prolog."); } /* RULES DERIVED FROM DTD. */ /* */ "{ "version"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_description_version); "version"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_description_version); ">" { LEAVE; STag_surfxml_platform_description();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform_description); } "/>" { LEAVE; STag_surfxml_platform_description(); surfxml_pcdata_ix = 0; ETag_surfxml_platform_description(); popbuffer(); /* attribute */ switch (YY_START) { case ROOT_surfxml_platform_description: SET(EPILOG); break; } } . FAIL("Unexpected character `%c' in attribute list of platform_description element.", yytext[0]); {Name} FAIL("Bad attribute `%s' in `platform_description' element start tag.",yytext); <> FAIL("EOF in attribute list of `platform_description' element."); } { "" { LEAVE; ETag_surfxml_platform_description(); popbuffer(); /* attribute */ switch (YY_START) { case ROOT_surfxml_platform_description: SET(EPILOG); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } "{ "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_include_file); "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_include_file); ">" { if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element."); LEAVE; STag_surfxml_include();surfxml_pcdata_ix = 0; ENTER(E_surfxml_include); } "/>" { if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element."); LEAVE; STag_surfxml_include(); surfxml_pcdata_ix = 0; ETag_surfxml_include(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break; case ROOT_surfxml_include: SET(EPILOG); break; } } . FAIL("Unexpected character `%c' in attribute list of include element.", yytext[0]); {Name} FAIL("Bad attribute `%s' in `include' element start tag.",yytext); <> FAIL("EOF in attribute list of `include' element."); } { "" { LEAVE; ETag_surfxml_include(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_platform_description_2: case S_surfxml_platform_description_1: case S_surfxml_platform_description: SET(S_surfxml_platform_description_2); break; case ROOT_surfxml_include: SET(EPILOG); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } "{ "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_id); "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_id); "power"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_power); "power"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_power); "availability"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability); "availability"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability); "availability_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability_file); "availability_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability_file); "state"{Eq}"'ON'" | "state"{Eq}"\"ON\"" A_surfxml_host_state = A_surfxml_host_state_ON; "state"{Eq}"'OFF'" | "state"{Eq}"\"OFF\"" A_surfxml_host_state = A_surfxml_host_state_OFF; "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_state_file); "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_state_file); "interference_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send); "interference_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send); "interference_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_recv); "interference_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_recv); "interference_send_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_interference_send_recv); "interference_send_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_interference_send_recv); "max_outgoing_rate"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_host_max_outgoing_rate); "max_outgoing_rate"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_host_max_outgoing_rate); ">" { if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element."); if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element."); LEAVE; STag_surfxml_host();surfxml_pcdata_ix = 0; ENTER(S_surfxml_host); } "/>" { if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element."); if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element."); LEAVE; STag_surfxml_host(); surfxml_pcdata_ix = 0; ETag_surfxml_host(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_platform_description_5: case S_surfxml_platform_description: case S_surfxml_platform_description_4: SET(S_surfxml_platform_description_5); break; case ROOT_surfxml_host: SET(EPILOG); break; } } . FAIL("Unexpected character `%c' in attribute list of host element.", yytext[0]); {Name} FAIL("Bad attribute `%s' in `host' element start tag.",yytext); <> FAIL("EOF in attribute list of `host' element."); } { "" { LEAVE; ETag_surfxml_host(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_platform_description_5: case S_surfxml_platform_description: case S_surfxml_platform_description_4: SET(S_surfxml_platform_description_5); break; case ROOT_surfxml_host: SET(EPILOG); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } "{ "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_id); "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_id); "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_value); "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_value); ">" { if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element."); if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element."); LEAVE; STag_surfxml_prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_prop); } "/>" { if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element."); if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element."); LEAVE; STag_surfxml_prop(); surfxml_pcdata_ix = 0; ETag_surfxml_prop(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break; case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break; case ROOT_surfxml_prop: SET(EPILOG); break; case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break; } } . FAIL("Unexpected character `%c' in attribute list of prop element.", yytext[0]); {Name} FAIL("Bad attribute `%s' in `prop' element start tag.",yytext); <> FAIL("EOF in attribute list of `prop' element."); } { "" { LEAVE; ETag_surfxml_prop(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break; case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break; case ROOT_surfxml_prop: SET(EPILOG); break; case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } "{ "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_router_id); "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_router_id); ">" { if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element."); LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router); } "/>" { if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element."); LEAVE; STag_surfxml_router(); surfxml_pcdata_ix = 0; ETag_surfxml_router(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_platform_description_8: case S_surfxml_platform_description_5: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_7: SET(S_surfxml_platform_description_8); break; case ROOT_surfxml_router: SET(EPILOG); break; } } . FAIL("Unexpected character `%c' in attribute list of router element.", yytext[0]); {Name} FAIL("Bad attribute `%s' in `router' element start tag.",yytext); <> FAIL("EOF in attribute list of `router' element."); } { "" { LEAVE; ETag_surfxml_router(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_platform_description_8: case S_surfxml_platform_description_5: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_7: SET(S_surfxml_platform_description_8); break; case ROOT_surfxml_router: SET(EPILOG); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } "{ "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_id); "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_id); "bandwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth); "bandwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth); "bandwidth_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth_file); "bandwidth_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth_file); "latency"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency); "latency"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency); "latency_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency_file); "latency_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency_file); "state"{Eq}"'ON'" | "state"{Eq}"\"ON\"" A_surfxml_link_state = A_surfxml_link_state_ON; "state"{Eq}"'OFF'" | "state"{Eq}"\"OFF\"" A_surfxml_link_state = A_surfxml_link_state_OFF; "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_state_file); "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_state_file); "sharing_policy"{Eq}"'SHARED'" | "sharing_policy"{Eq}"\"SHARED\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED; "sharing_policy"{Eq}"'FATPIPE'" | "sharing_policy"{Eq}"\"FATPIPE\"" A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FATPIPE; ">" { if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element."); if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element."); LEAVE; STag_surfxml_link();surfxml_pcdata_ix = 0; ENTER(S_surfxml_link); } "/>" { if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element."); if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element."); LEAVE; STag_surfxml_link(); surfxml_pcdata_ix = 0; ETag_surfxml_link(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_platform_description_8: case S_surfxml_platform_description_10: case S_surfxml_platform_description_5: case S_surfxml_platform_description_11: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_6: SET(S_surfxml_platform_description_11); break; case ROOT_surfxml_link: SET(EPILOG); break; } } . FAIL("Unexpected character `%c' in attribute list of link element.", yytext[0]); {Name} FAIL("Bad attribute `%s' in `link' element start tag.",yytext); <> FAIL("EOF in attribute list of `link' element."); } { "" { LEAVE; ETag_surfxml_link(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_platform_description_8: case S_surfxml_platform_description_10: case S_surfxml_platform_description_5: case S_surfxml_platform_description_11: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_6: SET(S_surfxml_platform_description_11); break; case ROOT_surfxml_link: SET(EPILOG); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } "{ "src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src); "src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src); "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst); "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst); "impact_on_src"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src); "impact_on_src"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src); "impact_on_dst"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst); "impact_on_dst"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst); "impact_on_src_with_other_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv); "impact_on_src_with_other_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_src_with_other_recv); "impact_on_dst_with_other_send"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send); "impact_on_dst_with_other_send"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_route_impact_on_dst_with_other_send); ">" { if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element."); if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element."); LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route); } "/>" { if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element."); if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element."); LEAVE; STag_surfxml_route(); surfxml_pcdata_ix = 0; ETag_surfxml_route(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_platform_description_8: case S_surfxml_platform_description_5: case S_surfxml_platform_description_9: case S_surfxml_platform_description_11: case S_surfxml_platform_description_13: case S_surfxml_platform_description_14: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_6: SET(S_surfxml_platform_description_14); break; case ROOT_surfxml_route: SET(EPILOG); break; } } . FAIL("Unexpected character `%c' in attribute list of route element.", yytext[0]); {Name} FAIL("Bad attribute `%s' in `route' element start tag.",yytext); <> FAIL("EOF in attribute list of `route' element."); } { "" { LEAVE; ETag_surfxml_route(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_platform_description_8: case S_surfxml_platform_description_5: case S_surfxml_platform_description_9: case S_surfxml_platform_description_11: case S_surfxml_platform_description_13: case S_surfxml_platform_description_14: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_6: SET(S_surfxml_platform_description_14); break; case ROOT_surfxml_route: SET(EPILOG); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } "{ "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_link_c_ctn_id); "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_link_c_ctn_id); ">" { if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element."); LEAVE; STag_surfxml_link_c_ctn();surfxml_pcdata_ix = 0; ENTER(E_surfxml_link_c_ctn); } "/>" { if (!AX_surfxml_link_c_ctn_id) FAIL("Required attribute `id' not set for `link:ctn' element."); LEAVE; STag_surfxml_link_c_ctn(); surfxml_pcdata_ix = 0; ETag_surfxml_link_c_ctn(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break; case ROOT_surfxml_link_c_ctn: SET(EPILOG); break; } } . FAIL("Unexpected character `%c' in attribute list of link:ctn element.", yytext[0]); {Name} FAIL("Bad attribute `%s' in `link:ctn' element start tag.",yytext); <> FAIL("EOF in attribute list of `link:ctn' element."); } { "" { LEAVE; ETag_surfxml_link_c_ctn(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break; case ROOT_surfxml_link_c_ctn: SET(EPILOG); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } "{ "host"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host); "host"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host); "function"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function); "function"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function); "start_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start_time); "start_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start_time); "kill_time"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill_time); "kill_time"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill_time); ">" { if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element."); if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element."); LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process); } "/>" { if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element."); if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element."); LEAVE; STag_surfxml_process(); surfxml_pcdata_ix = 0; ETag_surfxml_process(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_platform_description_8: case S_surfxml_platform_description_16: case S_surfxml_platform_description_5: case S_surfxml_platform_description_9: case S_surfxml_platform_description_11: case S_surfxml_platform_description_15: case S_surfxml_platform_description_12: case S_surfxml_platform_description_14: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_6: SET(S_surfxml_platform_description_16); break; case ROOT_surfxml_process: SET(EPILOG); break; } } . FAIL("Unexpected character `%c' in attribute list of process element.", yytext[0]); {Name} FAIL("Bad attribute `%s' in `process' element start tag.",yytext); <> FAIL("EOF in attribute list of `process' element."); } { "" { LEAVE; ETag_surfxml_process(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_platform_description_8: case S_surfxml_platform_description_16: case S_surfxml_platform_description_5: case S_surfxml_platform_description_9: case S_surfxml_platform_description_11: case S_surfxml_platform_description_15: case S_surfxml_platform_description_12: case S_surfxml_platform_description_14: case S_surfxml_platform_description_3: case S_surfxml_platform_description: case S_surfxml_platform_description_6: SET(S_surfxml_platform_description_16); break; case ROOT_surfxml_process: SET(EPILOG); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } "{ "value"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_surfxml_argument_value); "value"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_surfxml_argument_value); ">" { if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element."); LEAVE; STag_surfxml_argument();surfxml_pcdata_ix = 0; ENTER(E_surfxml_argument); } "/>" { if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element."); LEAVE; STag_surfxml_argument(); surfxml_pcdata_ix = 0; ETag_surfxml_argument(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break; case ROOT_surfxml_argument: SET(EPILOG); break; } } . FAIL("Unexpected character `%c' in attribute list of argument element.", yytext[0]); {Name} FAIL("Bad attribute `%s' in `argument' element start tag.",yytext); <> FAIL("EOF in attribute list of `argument' element."); } { "" { LEAVE; ETag_surfxml_argument(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break; case ROOT_surfxml_argument: SET(EPILOG); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } /* EPILOG: after the root element. */ { . {SET(PROLOG); yyless(0); CLEANUP; return -1;} <> SUCCEED; } /* CHARACTER DATA. */ { /* Non-defined standard entities... */ "&" BUFFERPUTC('&'); "<" BUFFERPUTC('<'); ">" BUFFERPUTC('>'); "'" BUFFERPUTC('\''); """ BUFFERPUTC('"'); /* Character entities. */ "&#"[[:digit:]]+";" BUFFERPUTC((unsigned char)atoi(yytext+2)); "&#x"[[:xdigit:]]+";" BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16)); } { "\n" | "\r" | "\r\n" | "\n\r" BUFFERPUTC('\n'); } { "" FAIL("Unexpected `]""]>' in character data."); } { \' BUFFERDONE; LEAVE; <> FAIL("EOF in literal (\"'\" expected)."); } { \" BUFFERDONE; LEAVE; <> FAIL("EOF in literal (`\"' expected)."); } { [^<&] BUFFERPUTC(yytext[0]); [<&] FAIL("Spurious `%c' in character data.",yytext[0]); } { "]""]>" LEAVE; /* "]""]" BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]); */ . BUFFERPUTC(yytext[0]); <> FAIL("EOF in CDATA section."); } /* Impossible rules to avoid warnings from flex(1). */ /* Ideally, this should be replaced by code in flexml.pl that generates just the states not covered by other rules. */ <*>{ .|[\n] FAIL("Syntax error on character `%c'.", yytext[0]); } %% /* Element context stack lookup. */ int surfxml_element_context(int i) { return (0