/* Validating XML processor for surfxml.dtd. * Generated 2005/01/07 10:51:23. * * This program was generated with the FleXML XML processor generator, * (Id: flexml.pl,v 1.35 2005/01/05 06:29:58 legranda Exp). * Copyright © 1999 Kristoffer Rose. All rights reserved. * * You can redistribute and/or modify this program 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. */ %{ /* Version strings. */ const char rcs_flexml_skeleton[] = "$" "Id: skel,v 1.19 2005/01/05 18:49:27 legranda Exp $"; const char rcs_flexml[] = "$" "Id: flexml.pl,v 1.35 2005/01/05 06:29:58 legranda Exp $"; /* ANSI headers. */ #include #include #include #include #include #include /* Generated definitions. */ #define FLEXML_yylineno #define FLEXML_BUFFERSTACKSIZE 10000000 /* XML processor api. */ #include "surfxml.h" /* FleXML-provided data. */ const char* pcdata; AT_network_link_bandwidth A_network_link_bandwidth; AT_cpu_name A_cpu_name; AT_network_link_state A_network_link_state; AT_argument_value A_argument_value; AT_cpu_availability_file A_cpu_availability_file; AT_process_host A_process_host; AT_route_impact_on_src A_route_impact_on_src; AT_route_src A_route_src; AT_network_link_latency_file A_network_link_latency_file; AT_route_impact_on_dst_with_other_send A_route_impact_on_dst_with_other_send; AT_cpu_interference_send_recv A_cpu_interference_send_recv; AT_cpu_availability A_cpu_availability; AT_route_impact_on_dst A_route_impact_on_dst; AT_cpu_interference_recv A_cpu_interference_recv; AT_route_impact_on_src_with_other_recv A_route_impact_on_src_with_other_recv; AT_network_link_name A_network_link_name; AT_route_element_name A_route_element_name; AT_cpu_power A_cpu_power; AT_include_file A_include_file; AT_process_function A_process_function; AT_route_dst A_route_dst; AT_cpu_state A_cpu_state; AT_network_link_latency A_network_link_latency; AT_network_link_state_file A_network_link_state_file; AT_cpu_interference_send A_cpu_interference_send; AT_cpu_state_file A_cpu_state_file; AT_network_link_bandwidth_file A_network_link_bandwidth_file; /* 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 return 0 #define FAIL return fail static int fail(const char*, ...); /* Text buffer stack handling. */ char bufferstack[FLEXML_BUFFERSTACKSIZE]; char* limit = bufferstack + FLEXML_BUFFERSTACKSIZE; typedef struct BufferLast_s { struct BufferLast_s *old; char* saved; char new[1]; } BufferLast; BufferLast* last = (BufferLast*)0; char* next = bufferstack; #define BUFFERSET(P) (P = next) #define BUFFERPUTC(C) (assert(nextold = last; l->saved = p; next = l->new; last = l; } static char* popbuffer(void) { BufferLast* l = last; assert(last != (BufferLast*)0); last = l->old; next = (char*)l; return l->saved; } #endif /* 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_platform_description AL_platform_description S_platform_description S_platform_description_1 S_platform_description_2 E_platform_description %x ROOT_include AL_include S_include S_include_1 S_include_2 E_include %x ROOT_cpu AL_cpu E_cpu %x ROOT_network_link AL_network_link E_network_link %x ROOT_route AL_route S_route S_route_1 S_route_2 E_route %x ROOT_route_element AL_route_element E_route_element %x ROOT_process AL_process S_process S_process_1 S_process_2 E_process %x ROOT_argument AL_argument E_argument %x IMPOSSIBLE %{ /* State names. */ const char* *statenames=NULL; %} %% /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ SET(PROLOG); /* FleXML_init */ if(!statenames) statenames=calloc(IMPOSSIBLE,sizeof(char*)); statenames[PROLOG] = NULL; statenames[DOCTYPE] = NULL; statenames[EPILOG] = NULL; statenames[INCOMMENT] = NULL; statenames[INPI] = NULL; statenames[VALUE1] = NULL; statenames[VALUE2] = NULL; statenames[CDATA] = NULL; statenames[ROOT_platform_description] = NULL; statenames[AL_platform_description] = NULL; statenames[S_platform_description] = "platform_description"; statenames[S_platform_description_1] = "platform_description"; statenames[S_platform_description_2] = "platform_description"; statenames[E_platform_description] = "platform_description"; statenames[ROOT_include] = NULL; statenames[AL_include] = NULL; statenames[S_include] = "include"; statenames[S_include_1] = "include"; statenames[S_include_2] = "include"; statenames[E_include] = "include"; statenames[ROOT_cpu] = NULL; statenames[AL_cpu] = NULL; statenames[E_cpu] = "cpu"; statenames[ROOT_network_link] = NULL; statenames[AL_network_link] = NULL; statenames[E_network_link] = "network_link"; statenames[ROOT_route] = NULL; statenames[AL_route] = NULL; statenames[S_route] = "route"; statenames[S_route_1] = "route"; statenames[S_route_2] = "route"; statenames[E_route] = "route"; statenames[ROOT_route_element] = NULL; statenames[AL_route_element] = NULL; statenames[E_route_element] = "route_element"; statenames[ROOT_process] = NULL; statenames[AL_process] = NULL; statenames[S_process] = "process"; statenames[S_process_1] = "process"; statenames[S_process_2] = "process"; statenames[E_process] = "process"; statenames[ROOT_argument] = NULL; statenames[AL_argument] = NULL; statenames[E_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_argument); "" SET(ROOT_route_element); "" SET(ROOT_cpu); "" SET(ROOT_include); "" SET(ROOT_route); "" SET(ROOT_platform_description); "" SET(ROOT_network_link); "" SET(ROOT_process); "-][^>]*">" FAIL("Bad declaration %s.",yytext); . FAIL("Unexpected character `%c' in prolog.", yytext[0]); <> FAIL("EOF in prolog."); } /* RULES DERIVED FROM DTD. */ /* */ "{ ">" { LEAVE; STag_platform_description();pcdata = NULL; ENTER(S_platform_description); } "/>" { LEAVE; STag_platform_description(); pcdata = NULL; ETag_platform_description(); switch (YY_START) { case ROOT_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_platform_description(); switch (YY_START) { case ROOT_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(A_include_file); "file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_include_file); ">" { if (!A_include_file) FAIL("Required attribute `file' not set for `include' element."); LEAVE; STag_include();pcdata = NULL; ENTER(S_include); } "/>" { if (!A_include_file) FAIL("Required attribute `file' not set for `include' element."); LEAVE; STag_include(); pcdata = NULL; ETag_include(); switch (YY_START) { case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break; case S_include: case S_include_2: case S_include_1: SET(S_include_2); break; case ROOT_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_include(); switch (YY_START) { case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break; case S_include: case S_include_2: case S_include_1: SET(S_include_2); break; case ROOT_include: SET(EPILOG); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } "{ "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_name); "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_name); "power"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_power); "power"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_power); "availability"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_availability); "availability"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_availability); "availability_file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_availability_file); "availability_file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_availability_file); "state"{Eq}"'ON'" | "state"{Eq}"\"ON\"" A_cpu_state = A_cpu_state_ON; "state"{Eq}"'OFF'" | "state"{Eq}"\"OFF\"" A_cpu_state = A_cpu_state_OFF; "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_state_file); "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_state_file); "interference_send"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_interference_send); "interference_send"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_interference_send); "interference_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_interference_recv); "interference_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_interference_recv); "interference_send_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cpu_interference_send_recv); "interference_send_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cpu_interference_send_recv); ">" { if (!A_cpu_name) FAIL("Required attribute `name' not set for `cpu' element."); if (!A_cpu_power) FAIL("Required attribute `power' not set for `cpu' element."); LEAVE; STag_cpu();pcdata = NULL; ENTER(E_cpu); } "/>" { if (!A_cpu_name) FAIL("Required attribute `name' not set for `cpu' element."); if (!A_cpu_power) FAIL("Required attribute `power' not set for `cpu' element."); LEAVE; STag_cpu(); pcdata = NULL; ETag_cpu(); switch (YY_START) { case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break; case S_include: case S_include_2: case S_include_1: SET(S_include_2); break; case ROOT_cpu: SET(EPILOG); break; } } . FAIL("Unexpected character `%c' in attribute list of cpu element.", yytext[0]); {Name} FAIL("Bad attribute `%s' in `cpu' element start tag.",yytext); <> FAIL("EOF in attribute list of `cpu' element."); } { "" { LEAVE; ETag_cpu(); switch (YY_START) { case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break; case S_include: case S_include_2: case S_include_1: SET(S_include_2); break; case ROOT_cpu: SET(EPILOG); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } "{ "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_network_link_name); "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_network_link_name); "bandwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(A_network_link_bandwidth); "bandwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(A_network_link_bandwidth); "bandwidth_file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_network_link_bandwidth_file); "bandwidth_file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_network_link_bandwidth_file); "latency"{Eq}\' ENTER(VALUE1); BUFFERSET(A_network_link_latency); "latency"{Eq}\" ENTER(VALUE2); BUFFERSET(A_network_link_latency); "latency_file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_network_link_latency_file); "latency_file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_network_link_latency_file); "state"{Eq}"'ON'" | "state"{Eq}"\"ON\"" A_network_link_state = A_network_link_state_ON; "state"{Eq}"'OFF'" | "state"{Eq}"\"OFF\"" A_network_link_state = A_network_link_state_OFF; "state_file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_network_link_state_file); "state_file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_network_link_state_file); ">" { if (!A_network_link_name) FAIL("Required attribute `name' not set for `network_link' element."); if (!A_network_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `network_link' element."); LEAVE; STag_network_link();pcdata = NULL; ENTER(E_network_link); } "/>" { if (!A_network_link_name) FAIL("Required attribute `name' not set for `network_link' element."); if (!A_network_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `network_link' element."); LEAVE; STag_network_link(); pcdata = NULL; ETag_network_link(); switch (YY_START) { case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break; case S_include: case S_include_2: case S_include_1: SET(S_include_2); break; case ROOT_network_link: SET(EPILOG); break; } } . FAIL("Unexpected character `%c' in attribute list of network_link element.", yytext[0]); {Name} FAIL("Bad attribute `%s' in `network_link' element start tag.",yytext); <> FAIL("EOF in attribute list of `network_link' element."); } { "" { LEAVE; ETag_network_link(); switch (YY_START) { case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break; case S_include: case S_include_2: case S_include_1: SET(S_include_2); break; case ROOT_network_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(A_route_src); "src"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_src); "dst"{Eq}\' ENTER(VALUE1); BUFFERSET(A_route_dst); "dst"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_dst); "impact_on_src"{Eq}\' ENTER(VALUE1); BUFFERSET(A_route_impact_on_src); "impact_on_src"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_impact_on_src); "impact_on_dst"{Eq}\' ENTER(VALUE1); BUFFERSET(A_route_impact_on_dst); "impact_on_dst"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_impact_on_dst); "impact_on_src_with_other_recv"{Eq}\' ENTER(VALUE1); BUFFERSET(A_route_impact_on_src_with_other_recv); "impact_on_src_with_other_recv"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_impact_on_src_with_other_recv); "impact_on_dst_with_other_send"{Eq}\' ENTER(VALUE1); BUFFERSET(A_route_impact_on_dst_with_other_send); "impact_on_dst_with_other_send"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_impact_on_dst_with_other_send); ">" { if (!A_route_src) FAIL("Required attribute `src' not set for `route' element."); if (!A_route_dst) FAIL("Required attribute `dst' not set for `route' element."); LEAVE; STag_route();pcdata = NULL; ENTER(S_route); } "/>" { if (!A_route_src) FAIL("Required attribute `src' not set for `route' element."); if (!A_route_dst) FAIL("Required attribute `dst' not set for `route' element."); LEAVE; STag_route(); pcdata = NULL; ETag_route(); switch (YY_START) { case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break; case S_include: case S_include_2: case S_include_1: SET(S_include_2); break; case ROOT_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_route(); switch (YY_START) { case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break; case S_include: case S_include_2: case S_include_1: SET(S_include_2); break; case ROOT_route: SET(EPILOG); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } "{ "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_route_element_name); "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_route_element_name); ">" { if (!A_route_element_name) FAIL("Required attribute `name' not set for `route_element' element."); LEAVE; STag_route_element();pcdata = NULL; ENTER(E_route_element); } "/>" { if (!A_route_element_name) FAIL("Required attribute `name' not set for `route_element' element."); LEAVE; STag_route_element(); pcdata = NULL; ETag_route_element(); switch (YY_START) { case S_route_1: case S_route: case S_route_2: SET(S_route_2); break; case ROOT_route_element: SET(EPILOG); break; } } . FAIL("Unexpected character `%c' in attribute list of route_element element.", yytext[0]); {Name} FAIL("Bad attribute `%s' in `route_element' element start tag.",yytext); <> FAIL("EOF in attribute list of `route_element' element."); } { "" { LEAVE; ETag_route_element(); switch (YY_START) { case S_route_1: case S_route: case S_route_2: SET(S_route_2); break; case ROOT_route_element: 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(A_process_host); "host"{Eq}\" ENTER(VALUE2); BUFFERSET(A_process_host); "function"{Eq}\' ENTER(VALUE1); BUFFERSET(A_process_function); "function"{Eq}\" ENTER(VALUE2); BUFFERSET(A_process_function); ">" { if (!A_process_host) FAIL("Required attribute `host' not set for `process' element."); if (!A_process_function) FAIL("Required attribute `function' not set for `process' element."); LEAVE; STag_process();pcdata = NULL; ENTER(S_process); } "/>" { if (!A_process_host) FAIL("Required attribute `host' not set for `process' element."); if (!A_process_function) FAIL("Required attribute `function' not set for `process' element."); LEAVE; STag_process(); pcdata = NULL; ETag_process(); switch (YY_START) { case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break; case S_include: case S_include_2: case S_include_1: SET(S_include_2); break; case ROOT_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_process(); switch (YY_START) { case S_platform_description_2: case S_platform_description_1: case S_platform_description: SET(S_platform_description_2); break; case S_include: case S_include_2: case S_include_1: SET(S_include_2); break; case ROOT_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(A_argument_value); "value"{Eq}\" ENTER(VALUE2); BUFFERSET(A_argument_value); ">" { if (!A_argument_value) FAIL("Required attribute `value' not set for `argument' element."); LEAVE; STag_argument();pcdata = NULL; ENTER(E_argument); } "/>" { if (!A_argument_value) FAIL("Required attribute `value' not set for `argument' element."); LEAVE; STag_argument(); pcdata = NULL; ETag_argument(); switch (YY_START) { case ROOT_argument: SET(EPILOG); break; case S_process_1: case S_process: case S_process_2: SET(S_process_2); 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_argument(); switch (YY_START) { case ROOT_argument: SET(EPILOG); break; case S_process_1: case S_process: case S_process_2: SET(S_process_2); break; } } "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); . FAIL("Unexpected character `%c': `' expected.",yytext[0]); <> FAIL("Premature EOF: `' expected."); } /* EPILOG: after the root element. */ { . FAIL("Unexpected character `%c' after document.", yytext[0]); <> 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). */ { .|[\n] FAIL("The Impossible Happened: INITIAL or IMPOSSIBLE state entered?"); } %% /* Element context stack lookup. */ int element_context(int i) { return (0