From: Navarrop Date: Tue, 27 Sep 2011 14:31:22 +0000 (+0200) Subject: Those files should not be in git. X-Git-Tag: v3_6_2~38 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3c0b68147366bc591839aab1cf37c8aeaab63112 Those files should not be in git. Generated by maintainer mode. --- diff --git a/src/gras/DataDesc/ddt_parse.yy.l b/src/gras/DataDesc/ddt_parse.yy.l deleted file mode 100644 index 29d029d59a..0000000000 --- a/src/gras/DataDesc/ddt_parse.yy.l +++ /dev/null @@ -1,238 +0,0 @@ -/* DataDesc/ddt_parse -- automatic parsing of data structures */ - -/* Copyright (c) 2004 Arnaud Legrand, Martin Quinson. All rights reserved. */ - -/* This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. */ - -%option noyywrap -%{ -#include "gras/DataDesc/datadesc_private.h" -#include "gras/DataDesc/ddt_parse.yy.h" -#include - YY_BUFFER_STATE gras_ddt_input_buffer; - FILE *gras_ddt_file_to_parse; - - int gras_ddt_parse_line_pos = 1; - int gras_ddt_parse_col_pos = 0; - int gras_ddt_parse_char_pos = 0; - int gras_ddt_parse_tok_num = 0; - const char *definition; - XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_ddt_lexer,gras_ddt_parse,"The crude internals of the lexer used for type parsing"); -#define SHOW_WHERE XBT_DEBUG("%d:%d (char #%d): seen '%s'", gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,gras_ddt_parse_char_pos,yytext) -%} - -%x annotate comment foo -space [ \t] -letter [A-Za-z._-] -digit [0-9] - -%% - int comment_caller=0; - int annotate_caller=0; - -"//"[^\n]* - -"/*g"{space}* { /****************** ANNOTATION ************************/ - XBT_DEBUG("Begin annotation"); - annotate_caller = INITIAL; - gras_ddt_parse_char_pos+= strlen(yytext); - gras_ddt_parse_col_pos+= strlen(yytext); - BEGIN(annotate); -} -"/*g"{space}* { /* trim annotation */ - XBT_DEBUG("Begin annotation"); - annotate_caller = foo; - gras_ddt_parse_char_pos+= strlen(yytext); - gras_ddt_parse_col_pos+= strlen(yytext); - BEGIN(annotate); -} - -{space}*"g*/" { - XBT_DEBUG("End annotation"); - gras_ddt_parse_char_pos+= strlen(yytext); - gras_ddt_parse_col_pos+= strlen(yytext); - BEGIN(annotate_caller); -} - -"*/" { - PARSE_ERROR("``/*g'' construct closed by a regular ``*/''"); -} -\n { - PARSE_ERROR("Type annotation cannot spread over several lines"); -} - -.* { /* eat the rest */ - gras_ddt_parse_char_pos+= strlen(yytext); - gras_ddt_parse_col_pos+= strlen(yytext); - return GRAS_DDT_PARSE_TOKEN_ANNOTATE; -} - -"/*[^g]" { /****************** COMMENTS ************************/ - /* constructs like : */ - /*g [string] g*/ - /* are not comments but size annotations */ - comment_caller = INITIAL; - BEGIN(comment); -} - -"/*[^g]" { - comment_caller = foo; - BEGIN(comment); -} - -[^*\n]* { /* eat anything that's not a '*' */ -} -"*"+[^*/\n]* { /* eat up '*'s not followed by '/'s */ -} -\n { - ++gras_ddt_parse_line_pos; - gras_ddt_parse_col_pos=0; - gras_ddt_parse_char_pos++; -} -"*"+"/" { - gras_ddt_parse_char_pos+= strlen(yytext); - gras_ddt_parse_col_pos+= strlen(yytext); - BEGIN(comment_caller); -} - -({letter}|{digit})* { /****************** STATEMENTS ************************/ - gras_ddt_parse_char_pos += strlen(yytext); - gras_ddt_parse_col_pos += strlen(yytext); - SHOW_WHERE; - return(GRAS_DDT_PARSE_TOKEN_WORD); -} -"{" { - gras_ddt_parse_char_pos++; - gras_ddt_parse_col_pos++; - SHOW_WHERE; - return(GRAS_DDT_PARSE_TOKEN_LA); -} -"}" { - gras_ddt_parse_char_pos++; - gras_ddt_parse_col_pos++; - SHOW_WHERE; - return(GRAS_DDT_PARSE_TOKEN_RA); -} -"[" { - gras_ddt_parse_char_pos++; - gras_ddt_parse_col_pos++; - SHOW_WHERE; - return(GRAS_DDT_PARSE_TOKEN_LB); -} -"]" { - gras_ddt_parse_char_pos++; - gras_ddt_parse_col_pos++; - SHOW_WHERE; - return(GRAS_DDT_PARSE_TOKEN_RB); -} -"(" { - gras_ddt_parse_char_pos++; - gras_ddt_parse_col_pos++; - SHOW_WHERE; - return(GRAS_DDT_PARSE_TOKEN_LP); -} -")" { - gras_ddt_parse_char_pos++; - gras_ddt_parse_col_pos++; - SHOW_WHERE; - return(GRAS_DDT_PARSE_TOKEN_RP); -} -"*" { - gras_ddt_parse_char_pos++; - gras_ddt_parse_col_pos++; - SHOW_WHERE; - return(GRAS_DDT_PARSE_TOKEN_STAR); -} -";" { - gras_ddt_parse_char_pos++; - gras_ddt_parse_col_pos++; - SHOW_WHERE; - return(GRAS_DDT_PARSE_TOKEN_SEMI_COLON); -} -"," { - gras_ddt_parse_char_pos++; - gras_ddt_parse_col_pos++; - SHOW_WHERE; - return(GRAS_DDT_PARSE_TOKEN_COLON); -} -"\n" { - gras_ddt_parse_line_pos++; - gras_ddt_parse_char_pos++; - gras_ddt_parse_col_pos=0; - SHOW_WHERE; -} -. { - gras_ddt_parse_char_pos++; - gras_ddt_parse_col_pos++; - SHOW_WHERE; -} -%% -/* {space}+ { return(TOKEN_SPACE);} */ - -void gras_ddt_parse_dump(void) { - switch(gras_ddt_parse_tok_num) { - case GRAS_DDT_PARSE_TOKEN_LA : {printf("TOKEN_LA ");break;} - case GRAS_DDT_PARSE_TOKEN_RA : {printf("TOKEN_RA ");break;} - case GRAS_DDT_PARSE_TOKEN_WORD : {printf("TOKEN_WORD ");break;} - /* case GRAS_DDT_PARSE_TOKEN_SPACE : {printf("TOKEN_SPACE ");break;}*/ - /* case GRAS_DDT_PARSE_TOKEN_COMMENT : {printf("TOKEN_COMMENT ");break;}*/ - case GRAS_DDT_PARSE_TOKEN_NEWLINE : {printf("TOKEN_NEWLINE\n");return;} - case GRAS_DDT_PARSE_TOKEN_EMPTY : {printf("TOKEN_EMPTY\n");return;} - default : {printf("Unknown token %d\n", gras_ddt_parse_tok_num);return;} - } - printf("-->%s<-- [line %d, pos %d]\n",yytext,gras_ddt_parse_line_pos,gras_ddt_parse_char_pos); - return; -} - -int gras_ddt_parse_lex_n_dump(void) { - gras_ddt_parse_tok_num = gras_ddt_parse_lex(); - /* gras_ddt_parse_char_pos += strlen(yytext);*/ - return(gras_ddt_parse_tok_num); -} - -void gras_ddt_parse_pointer_init(const char *file) { - gras_ddt_file_to_parse = fopen(file,"r"); - gras_ddt_input_buffer = yy_create_buffer( gras_ddt_file_to_parse, 10 ); - yy_switch_to_buffer(gras_ddt_input_buffer); - - gras_ddt_parse_line_pos = 1; - gras_ddt_parse_char_pos = 0; - gras_ddt_parse_col_pos = 0; - gras_ddt_parse_tok_num = 0; -} - -void gras_ddt_parse_pointer_close(void) { - yy_delete_buffer(gras_ddt_input_buffer); - fclose(gras_ddt_file_to_parse); - - gras_ddt_parse_line_pos = 1; - gras_ddt_parse_char_pos = 0; - gras_ddt_parse_tok_num = 0; -} - - -void gras_ddt_parse_pointer_string_init(const char *string_to_parse) { - gras_ddt_input_buffer = yy_scan_string (string_to_parse); - definition = string_to_parse; - yy_switch_to_buffer(gras_ddt_input_buffer); - - gras_ddt_parse_line_pos = 1; - gras_ddt_parse_char_pos = 0; - gras_ddt_parse_tok_num = 0; -} - -void gras_ddt_parse_pointer_string_close(void) { - yy_delete_buffer(gras_ddt_input_buffer); - - gras_ddt_parse_line_pos = 1; - gras_ddt_parse_char_pos = 0; - gras_ddt_parse_tok_num = 0; - - if (0) - yyunput('\0',NULL); /* fake a use of this function to calm gcc down */ -} - -/* Local variables:*/ -/* mode: c */ -/* End: */ diff --git a/src/simdag/dax_dtd.l b/src/simdag/dax_dtd.l deleted file mode 100644 index 7496336ca9..0000000000 --- a/src/simdag/dax_dtd.l +++ /dev/null @@ -1,876 +0,0 @@ -/* Validating XML processor for src/simdag/dax.dtd. - * - * 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.62 2007/10/11 10:00:14 mquinson 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_dax__flexml_skeleton[] = - "$" "Id: skel,v 1.40 2007/10/11 09:57:24 mquinson Exp $"; -const char rcs_dax__flexml[] = - "$" "Id: flexml.pl,v 1.62 2007/10/11 10:00:14 mquinson Exp $"; - -/* ANSI headers. */ -#include /* for realloc() -- needed here when using flex 2.5.4 */ -#include -#include -#include -#include -#include - -#if defined(_XBT_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__) -# ifndef __STRICT_ANSI__ -# include -# include -# endif -#else -# include -#endif - -#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 dax__pcdata_ix; -extern char *dax__bufferstack; -#define dax__pcdata (dax__bufferstack + dax__pcdata_ix) -AT_dax__adag_version AX_dax__adag_version; -#define A_dax__adag_version (dax__bufferstack + AX_dax__adag_version) -AT_dax__uses_type AX_dax__uses_type; -#define A_dax__uses_type (dax__bufferstack + AX_dax__uses_type) -AT_dax__uses_optional AX_dax__uses_optional; -#define A_dax__uses_optional AX_dax__uses_optional -AT_dax__adag_name AX_dax__adag_name; -#define A_dax__adag_name (dax__bufferstack + AX_dax__adag_name) -AT_dax__child_ref AX_dax__child_ref; -#define A_dax__child_ref (dax__bufferstack + AX_dax__child_ref) -AT_dax__adag_xmlns AX_dax__adag_xmlns; -#define A_dax__adag_xmlns (dax__bufferstack + AX_dax__adag_xmlns) -AT_dax__uses_transfer AX_dax__uses_transfer; -#define A_dax__uses_transfer AX_dax__uses_transfer -AT_dax__job_id AX_dax__job_id; -#define A_dax__job_id (dax__bufferstack + AX_dax__job_id) -AT_dax__uses_file AX_dax__uses_file; -#define A_dax__uses_file (dax__bufferstack + AX_dax__uses_file) -AT_dax__parent_ref AX_dax__parent_ref; -#define A_dax__parent_ref (dax__bufferstack + AX_dax__parent_ref) -AT_dax__adag_count AX_dax__adag_count; -#define A_dax__adag_count (dax__bufferstack + AX_dax__adag_count) -AT_dax__adag_xmlns_c_xsi AX_dax__adag_xmlns_c_xsi; -#define A_dax__adag_xmlns_c_xsi (dax__bufferstack + AX_dax__adag_xmlns_c_xsi) -AT_dax__adag_index AX_dax__adag_index; -#define A_dax__adag_index (dax__bufferstack + AX_dax__adag_index) -AT_dax__uses_size AX_dax__uses_size; -#define A_dax__uses_size (dax__bufferstack + AX_dax__uses_size) -AT_dax__adag_childCount AX_dax__adag_childCount; -#define A_dax__adag_childCount (dax__bufferstack + AX_dax__adag_childCount) -AT_dax__uses_link AX_dax__uses_link; -#define A_dax__uses_link AX_dax__uses_link -AT_dax__job_runtime AX_dax__job_runtime; -#define A_dax__job_runtime (dax__bufferstack + AX_dax__job_runtime) -AT_dax__job_level AX_dax__job_level; -#define A_dax__job_level (dax__bufferstack + AX_dax__job_level) -AT_dax__job_namespace AX_dax__job_namespace; -#define A_dax__job_namespace (dax__bufferstack + AX_dax__job_namespace) -AT_dax__job_name AX_dax__job_name; -#define A_dax__job_name (dax__bufferstack + AX_dax__job_name) -AT_dax__adag_jobCount AX_dax__adag_jobCount; -#define A_dax__adag_jobCount (dax__bufferstack + AX_dax__adag_jobCount) -AT_dax__job_version AX_dax__job_version; -#define A_dax__job_version (dax__bufferstack + AX_dax__job_version) -AT_dax__adag_xsi_c_schemaLocation AX_dax__adag_xsi_c_schemaLocation; -#define A_dax__adag_xsi_c_schemaLocation (dax__bufferstack + AX_dax__adag_xsi_c_schemaLocation) -AT_dax__uses_register AX_dax__uses_register; -#define A_dax__uses_register AX_dax__uses_register -AT_dax__adag_fileCount AX_dax__adag_fileCount; -#define A_dax__adag_fileCount (dax__bufferstack + AX_dax__adag_fileCount) - -/* 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 * dax__parse_err_msg() -{ - return flexml_err_msg; -} -static void reset_dax__parse_err_msg() -{ - flexml_err_msg[0] = '\0'; -} - -/* Cleanup */ -static void cleanup(void); -#define CLEANUP cleanup() - -/* Text buffer stack handling. */ -char *dax__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(), dax__bufferstack[bnext++] = (C)) -#define BUFFERDONE (BUFFERPUTC('\0')) - -#define BUFFERLITERAL(C, P) dax__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(dax__bufferstack, blimit); - assert(temp); - dax__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 dax__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_dax__adag AL_dax__adag S_dax__adag S_dax__adag_1 S_dax__adag_2 S_dax__adag_3 S_dax__adag_4 S_dax__adag_5 E_dax__adag -%x AL_dax__job S_dax__job S_dax__job_1 S_dax__job_2 E_dax__job -%x AL_dax__uses E_dax__uses -%x AL_dax__child S_dax__child S_dax__child_1 S_dax__child_2 E_dax__child -%x AL_dax__parent E_dax__parent -%x IMPOSSIBLE - -%{ -/* State names. */ -const char* *dax__statenames=NULL; -%} - -%% - - /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ - SET(PROLOG); - reset_dax__parse_err_msg(); - dax__bufferstack = (char *) malloc(FLEXML_BUFFERSTACKSIZE); - assert(dax__bufferstack); - #ifdef FLEX_DEBUG - { - int i; - for (i = 0; i < blimit; i++) { - dax__bufferstack[i] = '\377'; - } - } - #endif - dax__bufferstack[0] = '\0'; - indexstack = (int *) malloc(FLEXML_INDEXSTACKSIZE * sizeof(int)); - assert(indexstack); - indexstack[0] = 0; - - /* FleXML_init */ - bnext = inext = 1; - dax__bufferliteral('\0', &bnext, "http://pegasus.isi.edu/schema/DAX"); - dax__bufferliteral('\0', &bnext, "http://www.w3.org/2001/XMLSchema-instance"); - dax__bufferliteral('\0', &bnext, "http://pegasus.isi.edu/schema/DAX http://pegasus.isi.edu/schema/dax-2.1.xsd"); - dax__bufferliteral('\0', &bnext, "1.0"); - dax__bufferliteral('\0', &bnext, "0.0"); - dax__bufferliteral('\0', &bnext, "data"); - if(!dax__statenames) {dax__statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*)); - dax__statenames[PROLOG] = NULL; - dax__statenames[DOCTYPE] = NULL; - dax__statenames[EPILOG] = NULL; - dax__statenames[INCOMMENT] = NULL; - dax__statenames[INPI] = NULL; - dax__statenames[VALUE1] = NULL; - dax__statenames[VALUE2] = NULL; - dax__statenames[CDATA] = NULL; - dax__statenames[ROOT_dax__adag] = NULL; - dax__statenames[AL_dax__adag] = NULL; - dax__statenames[S_dax__adag] = "adag"; - dax__statenames[S_dax__adag_1] = "adag"; - dax__statenames[S_dax__adag_2] = "adag"; - dax__statenames[S_dax__adag_3] = "adag"; - dax__statenames[S_dax__adag_4] = "adag"; - dax__statenames[S_dax__adag_5] = "adag"; - dax__statenames[E_dax__adag] = "adag"; - dax__statenames[AL_dax__job] = NULL; - dax__statenames[S_dax__job] = "job"; - dax__statenames[S_dax__job_1] = "job"; - dax__statenames[S_dax__job_2] = "job"; - dax__statenames[E_dax__job] = "job"; - dax__statenames[AL_dax__uses] = NULL; - dax__statenames[E_dax__uses] = "uses"; - dax__statenames[AL_dax__child] = NULL; - dax__statenames[S_dax__child] = "child"; - dax__statenames[S_dax__child_1] = "child"; - dax__statenames[S_dax__child_2] = "child"; - dax__statenames[E_dax__child] = "child"; - dax__statenames[AL_dax__parent] = NULL; - dax__statenames[E_dax__parent] = "parent"; - } - - /* 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(ROOT_dax__adag); - "]*">" FAIL("Bad declaration %s.",yytext); -} - -{ - "" SET(ROOT_dax__adag); - "-][^>]*">" FAIL("Bad declaration %s.",yytext); - . FAIL("Unexpected character `%c' in prolog.", yytext[0]); - <> FAIL("EOF in prolog."); -} - - /* RULES DERIVED FROM DTD. */ - - /* */ - -" is not allowed here."); - -"{ - "xmlns"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__adag_xmlns); - "xmlns"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__adag_xmlns); - - "xmlns:xsi"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__adag_xmlns_c_xsi); - "xmlns:xsi"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__adag_xmlns_c_xsi); - - "xsi:schemaLocation"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__adag_xsi_c_schemaLocation); - "xsi:schemaLocation"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__adag_xsi_c_schemaLocation); - - "version"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__adag_version); - "version"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__adag_version); - - "count"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__adag_count); - "count"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__adag_count); - - "index"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__adag_index); - "index"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__adag_index); - - "name"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__adag_name); - "name"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__adag_name); - - "jobCount"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__adag_jobCount); - "jobCount"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__adag_jobCount); - - "fileCount"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__adag_fileCount); - "fileCount"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__adag_fileCount); - - "childCount"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__adag_childCount); - "childCount"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__adag_childCount); - - ">" { - LEAVE; STag_dax__adag();dax__pcdata_ix = 0; ENTER(S_dax__adag); - } - "/>" { - LEAVE; STag_dax__adag(); dax__pcdata_ix = 0; ETag_dax__adag(); popbuffer(); /* attribute */ - switch (YY_START) { - case ROOT_dax__adag: SET(EPILOG); break; - } - } - . FAIL("Unexpected character `%c' in attribute list of adag element.", yytext[0]); - {Name} FAIL("Bad attribute `%s' in `adag' element start tag.",yytext); - <> FAIL("EOF in attribute list of `adag' element."); -} - -{ - "" { - LEAVE; - ETag_dax__adag(); - popbuffer(); /* attribute */ - switch (YY_START) { - case ROOT_dax__adag: SET(EPILOG); break; - } - } - "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); - . FAIL("Unexpected character `%c': `' expected.",yytext[0]); - <> FAIL("Premature EOF: `' expected."); -} - -" is not allowed here."); - -"{ - "id"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__job_id); - "id"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__job_id); - - "namespace"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__job_namespace); - "namespace"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__job_namespace); - - "name"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__job_name); - "name"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__job_name); - - "version"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__job_version); - "version"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__job_version); - - "runtime"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__job_runtime); - "runtime"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__job_runtime); - - "level"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__job_level); - "level"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__job_level); - - ">" { - if (!AX_dax__job_id) FAIL("Required attribute `id' not set for `job' element."); - if (!AX_dax__job_name) FAIL("Required attribute `name' not set for `job' element."); - if (!AX_dax__job_runtime) FAIL("Required attribute `runtime' not set for `job' element."); - LEAVE; STag_dax__job();dax__pcdata_ix = 0; ENTER(S_dax__job); - } - "/>" { - if (!AX_dax__job_id) FAIL("Required attribute `id' not set for `job' element."); - if (!AX_dax__job_name) FAIL("Required attribute `name' not set for `job' element."); - if (!AX_dax__job_runtime) FAIL("Required attribute `runtime' not set for `job' element."); - LEAVE; STag_dax__job(); dax__pcdata_ix = 0; ETag_dax__job(); popbuffer(); /* attribute */ - switch (YY_START) { - case S_dax__adag_2: case S_dax__adag_3: case S_dax__adag: SET(S_dax__adag_3); break; - } - } - . FAIL("Unexpected character `%c' in attribute list of job element.", yytext[0]); - {Name} FAIL("Bad attribute `%s' in `job' element start tag.",yytext); - <> FAIL("EOF in attribute list of `job' element."); -} - -{ - "" { - LEAVE; - ETag_dax__job(); - popbuffer(); /* attribute */ - switch (YY_START) { - case S_dax__adag_2: case S_dax__adag_3: case S_dax__adag: SET(S_dax__adag_3); break; - } - } - "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); - . FAIL("Unexpected character `%c': `' expected.",yytext[0]); - <> FAIL("Premature EOF: `' expected."); -} - - /* - * */ - -" is not allowed here."); - -"{ - "file"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__uses_file); - "file"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__uses_file); - - "link"{Eq}"'input'" | - "link"{Eq}"\"input\"" A_dax__uses_link = A_dax__uses_link_input; - "link"{Eq}"'output'" | - "link"{Eq}"\"output\"" A_dax__uses_link = A_dax__uses_link_output; - - "register"{Eq}"'false'" | - "register"{Eq}"\"false\"" A_dax__uses_register = A_dax__uses_register_false; - "register"{Eq}"'true'" | - "register"{Eq}"\"true\"" A_dax__uses_register = A_dax__uses_register_true; - - "transfer"{Eq}"'false'" | - "transfer"{Eq}"\"false\"" A_dax__uses_transfer = A_dax__uses_transfer_false; - "transfer"{Eq}"'true'" | - "transfer"{Eq}"\"true\"" A_dax__uses_transfer = A_dax__uses_transfer_true; - - "optional"{Eq}"'false'" | - "optional"{Eq}"\"false\"" A_dax__uses_optional = A_dax__uses_optional_false; - "optional"{Eq}"'true'" | - "optional"{Eq}"\"true\"" A_dax__uses_optional = A_dax__uses_optional_true; - - "type"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__uses_type); - "type"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__uses_type); - - "size"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__uses_size); - "size"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__uses_size); - - ">" { - if (!AX_dax__uses_file) FAIL("Required attribute `file' not set for `uses' element."); - if (!AX_dax__uses_size) FAIL("Required attribute `size' not set for `uses' element."); - LEAVE; STag_dax__uses();dax__pcdata_ix = 0; ENTER(E_dax__uses); - } - "/>" { - if (!AX_dax__uses_file) FAIL("Required attribute `file' not set for `uses' element."); - if (!AX_dax__uses_size) FAIL("Required attribute `size' not set for `uses' element."); - LEAVE; STag_dax__uses(); dax__pcdata_ix = 0; ETag_dax__uses(); popbuffer(); /* attribute */ - switch (YY_START) { - case S_dax__job: case S_dax__job_2: case S_dax__job_1: SET(S_dax__job_2); break; - } - } - . FAIL("Unexpected character `%c' in attribute list of uses element.", yytext[0]); - {Name} FAIL("Bad attribute `%s' in `uses' element start tag.",yytext); - <> FAIL("EOF in attribute list of `uses' element."); -} - -{ - "" { - LEAVE; - ETag_dax__uses(); - popbuffer(); /* attribute */ - switch (YY_START) { - case S_dax__job: case S_dax__job_2: case S_dax__job_1: SET(S_dax__job_2); break; - } - } - "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); - . FAIL("Unexpected character `%c': `' expected.",yytext[0]); - <> FAIL("Premature EOF: `' expected."); -} - -" is not allowed here."); - -"{ - "ref"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__child_ref); - "ref"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__child_ref); - - ">" { - if (!AX_dax__child_ref) FAIL("Required attribute `ref' not set for `child' element."); - LEAVE; STag_dax__child();dax__pcdata_ix = 0; ENTER(S_dax__child); - } - "/>" { - if (!AX_dax__child_ref) FAIL("Required attribute `ref' not set for `child' element."); - LEAVE; STag_dax__child(); dax__pcdata_ix = 0; ETag_dax__child(); popbuffer(); /* attribute */ - switch (YY_START) { - case S_dax__adag_1: case S_dax__adag_4: case S_dax__adag_5: case S_dax__adag_3: case S_dax__adag: SET(S_dax__adag_5); break; - } - } - . FAIL("Unexpected character `%c' in attribute list of child element.", yytext[0]); - {Name} FAIL("Bad attribute `%s' in `child' element start tag.",yytext); - <> FAIL("EOF in attribute list of `child' element."); -} - -{ - "" { - LEAVE; - ETag_dax__child(); - popbuffer(); /* attribute */ - switch (YY_START) { - case S_dax__adag_1: case S_dax__adag_4: case S_dax__adag_5: case S_dax__adag_3: case S_dax__adag: SET(S_dax__adag_5); break; - } - } - "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); - . FAIL("Unexpected character `%c': `' expected.",yytext[0]); - <> FAIL("Premature EOF: `' expected."); -} - -" is not allowed here."); - -"{ - "ref"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_dax__parent_ref); - "ref"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_dax__parent_ref); - - ">" { - if (!AX_dax__parent_ref) FAIL("Required attribute `ref' not set for `parent' element."); - LEAVE; STag_dax__parent();dax__pcdata_ix = 0; ENTER(E_dax__parent); - } - "/>" { - if (!AX_dax__parent_ref) FAIL("Required attribute `ref' not set for `parent' element."); - LEAVE; STag_dax__parent(); dax__pcdata_ix = 0; ETag_dax__parent(); popbuffer(); /* attribute */ - switch (YY_START) { - case S_dax__child_2: case S_dax__child: case S_dax__child_1: SET(S_dax__child_2); break; - } - } - . FAIL("Unexpected character `%c' in attribute list of parent element.", yytext[0]); - {Name} FAIL("Bad attribute `%s' in `parent' element start tag.",yytext); - <> FAIL("EOF in attribute list of `parent' element."); -} - -{ - "" { - LEAVE; - ETag_dax__parent(); - popbuffer(); /* attribute */ - switch (YY_START) { - case S_dax__child_2: case S_dax__child: case S_dax__child_1: SET(S_dax__child_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. */ - -{ - . {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 dax__element_context(int i) -{ - return (0 /* for realloc() -- needed here when using flex 2.5.4 */ -#include -#include -#include -#include -#include - -#if defined(_XBT_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__) -# ifndef __STRICT_ANSI__ -# include -# include -# endif -#else -# include -#endif - -#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 graphxml_pcdata_ix; -extern char *graphxml_bufferstack; -#define graphxml_pcdata (graphxml_bufferstack + graphxml_pcdata_ix) -AT_graphxml_node_name AX_graphxml_node_name; -#define A_graphxml_node_name (graphxml_bufferstack + AX_graphxml_node_name) -AT_graphxml_edge_source AX_graphxml_edge_source; -#define A_graphxml_edge_source (graphxml_bufferstack + AX_graphxml_edge_source) -AT_graphxml_node_position_y AX_graphxml_node_position_y; -#define A_graphxml_node_position_y (graphxml_bufferstack + AX_graphxml_node_position_y) -AT_graphxml_node_position_x AX_graphxml_node_position_x; -#define A_graphxml_node_position_x (graphxml_bufferstack + AX_graphxml_node_position_x) -AT_graphxml_edge_data AX_graphxml_edge_data; -#define A_graphxml_edge_data (graphxml_bufferstack + AX_graphxml_edge_data) -AT_graphxml_edge_target AX_graphxml_edge_target; -#define A_graphxml_edge_target (graphxml_bufferstack + AX_graphxml_edge_target) -AT_graphxml_graph_isDirected AX_graphxml_graph_isDirected; -#define A_graphxml_graph_isDirected AX_graphxml_graph_isDirected -AT_graphxml_node_label AX_graphxml_node_label; -#define A_graphxml_node_label (graphxml_bufferstack + AX_graphxml_node_label) -AT_graphxml_node_data AX_graphxml_node_data; -#define A_graphxml_node_data (graphxml_bufferstack + AX_graphxml_node_data) -AT_graphxml_edge_label AX_graphxml_edge_label; -#define A_graphxml_edge_label (graphxml_bufferstack + AX_graphxml_edge_label) -AT_graphxml_edge_length AX_graphxml_edge_length; -#define A_graphxml_edge_length (graphxml_bufferstack + AX_graphxml_edge_length) -AT_graphxml_edge_name AX_graphxml_edge_name; -#define A_graphxml_edge_name (graphxml_bufferstack + AX_graphxml_edge_name) - -/* 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 * graphxml_parse_err_msg() -{ - return flexml_err_msg; -} -static void reset_graphxml_parse_err_msg() -{ - flexml_err_msg[0] = '\0'; -} - -/* Cleanup */ -static void cleanup(void); -#define CLEANUP cleanup() - -/* Text buffer stack handling. */ -char *graphxml_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(), graphxml_bufferstack[bnext++] = (C)) -#define BUFFERDONE (BUFFERPUTC('\0')) - -#define BUFFERLITERAL(C, P) graphxml_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(graphxml_bufferstack, blimit); - assert(temp); - graphxml_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 graphxml_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_graphxml_graph AL_graphxml_graph S_graphxml_graph S_graphxml_graph_1 S_graphxml_graph_2 S_graphxml_graph_3 S_graphxml_graph_4 S_graphxml_graph_5 E_graphxml_graph -%x ROOT_graphxml_node AL_graphxml_node E_graphxml_node -%x ROOT_graphxml_edge AL_graphxml_edge E_graphxml_edge -%x IMPOSSIBLE - -%{ -/* State names. */ -const char* *graphxml_statenames=NULL; -%} - -%% - - /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ - SET(PROLOG); - reset_graphxml_parse_err_msg(); - graphxml_bufferstack = (char *) malloc(FLEXML_BUFFERSTACKSIZE); - assert(graphxml_bufferstack); - #ifdef FLEX_DEBUG - { - int i; - for (i = 0; i < blimit; i++) { - graphxml_bufferstack[i] = '\377'; - } - } - #endif - graphxml_bufferstack[0] = '\0'; - indexstack = (int *) malloc(FLEXML_INDEXSTACKSIZE * sizeof(int)); - assert(indexstack); - indexstack[0] = 0; - - /* FleXML_init */ - bnext = inext = 1; - graphxml_bufferliteral('\0', &bnext, "-1.0"); - graphxml_bufferliteral('\0', &bnext, "-1.0"); - graphxml_bufferliteral('\0', &bnext, "-1.0"); - if(!graphxml_statenames) {graphxml_statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*)); - graphxml_statenames[PROLOG] = NULL; - graphxml_statenames[DOCTYPE] = NULL; - graphxml_statenames[EPILOG] = NULL; - graphxml_statenames[INCOMMENT] = NULL; - graphxml_statenames[INPI] = NULL; - graphxml_statenames[VALUE1] = NULL; - graphxml_statenames[VALUE2] = NULL; - graphxml_statenames[CDATA] = NULL; - graphxml_statenames[ROOT_graphxml_graph] = NULL; - graphxml_statenames[AL_graphxml_graph] = NULL; - graphxml_statenames[S_graphxml_graph] = "graph"; - graphxml_statenames[S_graphxml_graph_1] = "graph"; - graphxml_statenames[S_graphxml_graph_2] = "graph"; - graphxml_statenames[S_graphxml_graph_3] = "graph"; - graphxml_statenames[S_graphxml_graph_4] = "graph"; - graphxml_statenames[S_graphxml_graph_5] = "graph"; - graphxml_statenames[E_graphxml_graph] = "graph"; - graphxml_statenames[ROOT_graphxml_node] = NULL; - graphxml_statenames[AL_graphxml_node] = NULL; - graphxml_statenames[E_graphxml_node] = "node"; - graphxml_statenames[ROOT_graphxml_edge] = NULL; - graphxml_statenames[AL_graphxml_edge] = NULL; - graphxml_statenames[E_graphxml_edge] = "edge"; - } - - /* 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_graphxml_edge); - "" SET(ROOT_graphxml_node); - "" SET(ROOT_graphxml_graph); - "-][^>]*">" FAIL("Bad declaration %s.",yytext); - . FAIL("Unexpected character `%c' in prolog.", yytext[0]); - <> FAIL("EOF in prolog."); -} - - /* RULES DERIVED FROM DTD. */ - - /* */ - - /* isDirected (true|false) "true" - * > */ - -" is not allowed here."); - -"{ - "isDirected"{Eq}"'true'" | - "isDirected"{Eq}"\"true\"" A_graphxml_graph_isDirected = A_graphxml_graph_isDirected_true; - "isDirected"{Eq}"'false'" | - "isDirected"{Eq}"\"false\"" A_graphxml_graph_isDirected = A_graphxml_graph_isDirected_false; - - ">" { - LEAVE; STag_graphxml_graph();graphxml_pcdata_ix = 0; ENTER(S_graphxml_graph); - } - "/>" { - LEAVE; STag_graphxml_graph(); graphxml_pcdata_ix = 0; ETag_graphxml_graph(); popbuffer(); /* attribute */ - switch (YY_START) { - case ROOT_graphxml_graph: SET(EPILOG); break; - } - } - . FAIL("Unexpected character `%c' in attribute list of graph element.", yytext[0]); - {Name} FAIL("Bad attribute `%s' in `graph' element start tag.",yytext); - <> FAIL("EOF in attribute list of `graph' element."); -} - -{ - "" { - LEAVE; - ETag_graphxml_graph(); - popbuffer(); /* attribute */ - switch (YY_START) { - case ROOT_graphxml_graph: SET(EPILOG); break; - } - } - "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); - . FAIL("Unexpected character `%c': `' expected.",yytext[0]); - <> FAIL("Premature EOF: `' expected."); -} - - /* label CDATA "" - * name CDATA #REQUIRED - * data CDATA "" - * position_x CDATA "-1.0" - * position_y CDATA "-1.0" - * > */ - -" is not allowed here."); - -"{ - "label"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_graphxml_node_label); - "label"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_graphxml_node_label); - - "name"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_graphxml_node_name); - "name"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_graphxml_node_name); - - "data"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_graphxml_node_data); - "data"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_graphxml_node_data); - - "position_x"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_graphxml_node_position_x); - "position_x"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_graphxml_node_position_x); - - "position_y"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_graphxml_node_position_y); - "position_y"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_graphxml_node_position_y); - - ">" { - if (!AX_graphxml_node_name) FAIL("Required attribute `name' not set for `node' element."); - LEAVE; STag_graphxml_node();graphxml_pcdata_ix = 0; ENTER(E_graphxml_node); - } - "/>" { - if (!AX_graphxml_node_name) FAIL("Required attribute `name' not set for `node' element."); - LEAVE; STag_graphxml_node(); graphxml_pcdata_ix = 0; ETag_graphxml_node(); popbuffer(); /* attribute */ - switch (YY_START) { - case S_graphxml_graph_2: case S_graphxml_graph_3: case S_graphxml_graph: SET(S_graphxml_graph_3); break; - case ROOT_graphxml_node: SET(EPILOG); break; - } - } - . FAIL("Unexpected character `%c' in attribute list of node element.", yytext[0]); - {Name} FAIL("Bad attribute `%s' in `node' element start tag.",yytext); - <> FAIL("EOF in attribute list of `node' element."); -} - -{ - "" { - LEAVE; - ETag_graphxml_node(); - popbuffer(); /* attribute */ - switch (YY_START) { - case S_graphxml_graph_2: case S_graphxml_graph_3: case S_graphxml_graph: SET(S_graphxml_graph_3); break; - case ROOT_graphxml_node: SET(EPILOG); break; - } - } - "" FAIL("Unexpected end-tag `%s': `' expected.",yytext); - . FAIL("Unexpected character `%c': `' expected.",yytext[0]); - <> FAIL("Premature EOF: `' expected."); -} - - /* label CDATA "" - * name CDATA #IMPLIED - * source CDATA #REQUIRED - * target CDATA #REQUIRED - * length CDATA "-1.0" - * data CDATA "" - * > */ - -" is not allowed here."); - -"{ - "label"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_label); - "label"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_label); - - "name"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_name); - "name"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_name); - - "source"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_source); - "source"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_source); - - "target"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_target); - "target"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_target); - - "length"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_length); - "length"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_length); - - "data"{Eq}\' ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_data); - "data"{Eq}\" ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_data); - - ">" { - if (!AX_graphxml_edge_source) FAIL("Required attribute `source' not set for `edge' element."); - if (!AX_graphxml_edge_target) FAIL("Required attribute `target' not set for `edge' element."); - LEAVE; STag_graphxml_edge();graphxml_pcdata_ix = 0; ENTER(E_graphxml_edge); - } - "/>" { - if (!AX_graphxml_edge_source) FAIL("Required attribute `source' not set for `edge' element."); - if (!AX_graphxml_edge_target) FAIL("Required attribute `target' not set for `edge' element."); - LEAVE; STag_graphxml_edge(); graphxml_pcdata_ix = 0; ETag_graphxml_edge(); popbuffer(); /* attribute */ - switch (YY_START) { - case S_graphxml_graph_1: case S_graphxml_graph_3: case S_graphxml_graph_5: case S_graphxml_graph_4: case S_graphxml_graph: SET(S_graphxml_graph_5); break; - case ROOT_graphxml_edge: SET(EPILOG); break; - } - } - . FAIL("Unexpected character `%c' in attribute list of edge element.", yytext[0]); - {Name} FAIL("Bad attribute `%s' in `edge' element start tag.",yytext); - <> FAIL("EOF in attribute list of `edge' element."); -} - -{ - "" { - LEAVE; - ETag_graphxml_edge(); - popbuffer(); /* attribute */ - switch (YY_START) { - case S_graphxml_graph_1: case S_graphxml_graph_3: case S_graphxml_graph_5: case S_graphxml_graph_4: case S_graphxml_graph: SET(S_graphxml_graph_5); break; - case ROOT_graphxml_edge: 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 graphxml_element_context(int i) -{ - return (0